Common.ai
来自咸鱼维基
转载AI函数全解释(测试版)
- native DebugS takes string str returns nothing //显示文本
- native DebugFI takes string str, integer val returns nothing //显示文本带1个数字
- native DebugUnitID takes string str, integer val returns nothing //显示文本带1个单位ID
- native DisplayText takes integer p, string str returns nothing //按玩家显示文本
- native DisplayTextI takes integer p, string str, integer val returns nothing//按玩家显示文本带1个数字
- native DisplayTextII takes integer p, string str, integer v1, integer v2 returns nothing //按玩家显示文本带2个数字
- native DisplayTextIII takes integer p, string str, integer v1, integer v2, integer v3 returns nothing //按玩家显示文本带3
- native DoAiScriptDebug takes nothing returns boolean //AI脚本是否允许显示文本(没试出过返回true)
- native GetAiPlayer takes nothing returns integer//当前脚本控制的AI玩家
- native GetHeroId takes nothing returns integer//英雄升级技能函数内获得升级的英雄类型
- native GetHeroLevelAI takes nothing returns integer //英雄升级技能函数内获得英雄等级
- native GetUnitCount takes integer unitid returns integer //获得AI玩家的该类型单位个数,包括建造中单
- native GetPlayerUnitTypeCount takes player p, integer unitid returns integer //获得某玩家的该类型单位个数
- native GetUnitCountDone takes integer unitid returns integer//获得AI玩家的已完成的该类型单位个数
- native GetTownUnitCount takes integer id, integer tn, boolean dn returns integer //获得AI玩家该类型单位在指定基地的个数(dn
- native GetUnitGoldCost takes integer unitid returns integer //获取单位类型造价金钱
- native GetUnitWoodCost takes integer unitid returns integer//获取单位类型造价木材
- native GetUnitBuildTime takes integer unitid returns integer//获取单位类型建造时间(以秒为单位)
- native GetMinesOwned takes nothing returns integer //获取AI玩家所拥有的金矿个数
- native GetGoldOwned takes nothing returns integer//获得地图中未被采集保持满储金量的金矿数量
- native TownWithMine takes nothing returns integer //获得编号最靠前的有金矿的基地编号
- native TownHasMine takes integer townid returns boolean //基地有金矿可开采
- native TownHasHall takes integer townid returns boolean //基地有城镇大厅
- native GetUpgradeLevel takes integer id returns integer //获得AI玩家当前科技等级
- native GetUpgradeGoldCost takes integer id returns integer//科技升级花费黄金
- native GetUpgradeWoodCost takes integer id returns integer //科技升级花费木材
- native GetNextExpansion takes nothing returns integer //获得下一个扩张点编号
- native GetMegaTarget takes nothing returns unit //AI玩家当前目标单位?
- native GetBuilding takes player p returns unit//AI玩家正在建造的单位
- native GetEnemyPower takes nothing returns integer //获得敌人强度?
- native SetAllianceTarget takes unit id returns nothing //设置联盟目标?
- native GetAllianceTarget takes nothing returns unit //获取联盟目标?
- native SetProduce takes integer qty, integer id, integer town returns boolean //命令训练/建造单位(数量,单位类型,基地)
- native Unsummon takes unit unitid returns nothing //取消建造单位
- native SetExpansion takes unit peon, integer id returns boolean//建造建筑<建筑工人,建筑类型>
- native SetUpgrade takes integer id returns boole //升级科技
- native SetHeroLevels takes code func returns nothing an
//设置英雄升级技能函数 //函数要求返回整数-即是需要学习的技能ID //函数内使用GetHeroId()获得升级的英雄类型
- native SetNewHeroes takes boolean state returns nothing //使用GetHeroLevelAI()获得英雄等级
- native PurchaseZeppelin takes nothing returns nothing //购买地精飞艇
- native MergeUnits takes integer qty, integer a, integer b, integer make returns boolean //单位合体<数量,单位A,单位B,合
- native ConvertUnits takes integer qty, integer id returns boolean //单位变身<数量,变身后的单位>
- native SetCampaignAI takes nothing returns nothing //战役AI初始化?
- native SetMeleeAI takes nothing returns nothing //对战AI初始化?
- native SetTargetHeroes takes boolean state returns nothing //AI在战斗中设置较高的优先权攻击英雄
- native SetPeonsRepair takes boolean state returns nothing//农民会自动修理需要修理的建筑
- native SetRandomPaths takes boolean state returns nothing //增加AI选择目的地的随机性
- native SetDefendPlayer takes boolean state returns nothing//AI会试图保护那些遭受攻击的盟友用户玩家
- native SetHeroesFlee takes boolean state returns nothing //英雄在受伤严重或遭受攻击时会试图逃跑
- native SetHeroesBuyItems takes boolean state returns nothing//英雄会在商店里购买有用的物品
- native SetWatchMegaTargets takes boolean state returns nothing //AI会抓住敌人较弱或处于劣势的时候进攻
- native SetIgnoreInjured takes boolean state returns nothing//在集结部队进攻时,忽略生命值低于50%的单位
- native SetHeroesTakeItems takes boolean state returns nothing //英雄拾取物品
- native SetUnitsFlee takes boolean state returns nothing //非英雄单位在受伤严重或遭受攻击时会试图逃跑
- native SetGroupsFlee takes boolean state returns nothing //允许群组逃跑
- native SetSlowChopping takes boolean state returns nothing //AI的黄金采集数量一次只有1. 这会对AI造成
- native SetCaptainChanges takes boolean allow returns nothing //允许基地变换
- native SetSmartArtillery takes boolean state returns nothing //攻城单位会尽可能的攻击敌人基地
- native SetReplacementCount takes integer qty returns nothing //设置AI会替换几次被杀的防卫者?
- native GroupTimedLife takes boolean allow returns nothing //把受伤者送回主基或泉水
- native RemoveInjuries takes nothing returns nothing
- native RemoveSiege takes nothing returns nothing
- native InitAssault takes nothing returns nothing //初始化攻击组
- native AddAssault takes integer qty, integer id returns boolean //增加单位进攻击组
- native AddDefenders takes integer qty, integer id returns boolean //增加单位进防守组
- native GetCreepCamp takes integer min, integer max, boolean flyers_ok returns unit //获取中立敌对营地<最小总等级,最大总等级
- native StartGetEnemyBase takes nothing returns nothing //开始寻找敌人基地
- native WaitGetEnemyBase takes nothing returns boolean //是否正在寻找敌人基地
- native GetEnemyBase takes nothing returns unit //获取敌人基地
- native GetExpansionFoe takes nothing returns unit //下一个扩张点有威胁的单位?
- native GetEnemyExpansion takes nothing returns unit //获取敌人扩张点(分基地)
- native GetExpansionX takes nothing returns integer //获取可能的扩张点X坐标
- native GetExpansionY takes nothing returns integer //获取可能的扩张点Y坐标
- native SetStagePoint takes real x, real y returns nothing
- native AttackMoveKill takes unit target returns nothing //攻击组攻击单位
- native AttackMoveXY takes integer x, integer y returns nothing //攻击组攻击地点
- native LoadZepWave takes integer x, integer y returns nothing //在<X坐标,Y坐标>空投单位?
- native SuicidePlayer takes player id, boolean check_full returns boolean //玩家自杀?
- native SuicidePlayerUnits takes player id, boolean check_full returns boolean//让玩家杀自己的单位?
- native CaptainInCombat takes boolean attack_captain returns boolean //组在战斗中<是否攻击组>
- native IsTowered takes unit target returns boolean //单位在基地中
- native ClearHarvestAI takes nothing returns nothing //清空资源单位任务分配
- native HarvestGold takes integer town, integer peons returns nothing//设置(增加)采集金矿单位<地点,人数>
- native HarvestWood takes integer town, integer peons returns nothing//设置(增加)采集树木单位<地点,人数>
- native GetExpansionPeon takes nothing returns unit //寻找1个扩张工人?
- native StopGathering takes nothing returns nothing //停止聚集?
- native AddGuardPost takes integer id, real x, real y returns nothing //增加防守岗位?
- native FillGuardPosts takes nothing returns nothing//填满防守岗位?
- native ReturnGuardPosts takes nothing returns nothing //返回防守岗位?
- native CreateCaptains takes nothing returns nothing //创建攻击组
- native SetCaptainHome takes integer which, real x, real y returns nothing //设置组在家的点<组,x坐标,y坐标> //组的参
- native ResetCaptainLocs takes nothing returns nothing//命令攻击组复位?
- native ShiftTownSpot takes real x, real y returns nothing //转移基地?
- native TeleportCaptain takes real x, real y returns nothing //命令攻击组传送到点
- native ClearCaptainTargets takes nothing returns nothing //撤销攻击组目标
- native CaptainAttack takes real x, real y returns nothing //攻击组攻击
- native CaptainVsUnits takes player id returns nothing//攻击组攻击玩家的部队?
- native CaptainVsPlayer takes player id returns nothing //攻击组攻击玩家?
- native CaptainGoHome takes nothing returns nothing //命令攻击组回家
- native CaptainIsHome takes nothing returns boolean //攻击组在家
- native CaptainIsFull takes nothing returns boolean //攻击组准备完毕
- native CaptainIsEmpty takes nothing returns boolean //攻击组为空
- native CaptainGroupSize takes nothing returns integer //攻击组当前人数
- native CaptainReadiness takes nothing returns integer//攻击组准备就绪
- native CaptainRetreating takes nothing returns boolean//攻击组撤退
- native CaptainReadinessHP takes nothing returns integer//攻击组生命级别,生命级别为所有攻击组单位的平
- native CaptainReadinessMa takes nothing returns integer //攻击组魔法级别,魔法级别为所有攻击组单位的
- native CaptainAtGoal takes nothing returns boolean //攻击组到达目的地
- native CreepsOnMap takes nothing returns boolean //存在中立生物
- native SuicideUnit takes integer count, integer unitid returns nothing //让一群单位自杀?
- native SuicideUnitEx takes integer ct, integer uid, integer pid returns nothing
- native StartThread takes code func returns nothing//开始新线程
- native Sleep takes real seconds returns nothing //休眠
- native UnitAlive takes unit id returns boolean //单位存活
- native UnitInvis takes unit id returns boolean //单位隐形
- native IgnoredUnits takes integer unitid returns integer//某一类型单位被攻击组忽略的人数?
- native TownThreatened takes nothing returns boolean //基地被攻击
- native DisablePathing takes nothing returns nothing //允许水上战斗?
- native SetAmphibious takes nothing returns nothing //获得命令队列中的指令条数
- native CommandsWaiting takes nothing returns integer //命令可以通过动作'AI - 发送AI命令'发送给A
- native GetLastCommand takes nothing returns integer //获得队列中最新一条指令
- native GetLastData takes nothing returns integer //获得队列中最新一条指令的数据
- native PopLastCommand takes nothing returns nothing //将最新指令踢出队列
- native MeleeDifficulty takes nothing returns integer//对战难度等级
- native SetGroupsFlee takes boolean state returns nothing//在对己方不利的情况下,队伍会放弃战斗从战场逃离