amacarena
获得竞技场敌方正在施法状态及人物信息
语法
unit,name,class,race,spell,spellcd,guid = amacarena(String);
参数
String
字符串 - 字符串关系表达式,以下是函数里的变量值
name - 正在施放的法术敌方人物名称
class - 职业
race - 种族
spell - 正在施放的法术名称
unit - 正在施放的法术敌方人物 UnitID (竞技场敌方 arena1 ~ arena5)
spellcd - 正在施放的法术剩余时间
guid - 正在施放的法术敌方人物 Guid
注:String 可以有任何函数和变量出现
返回值
当 String 表达式 的结果为 true 时
返回 unit,name,class,race,spell,spellcd,guid
反之返回 nil。
当 String 表达式 的结果为 true 时
同时也返回相应全局变量可通过amgv函数获得值
name - amgv("amarena_name")
class - amgv("amarena_class")
racea - mgv("amarena_race")
spell - amgv("amarena_spell")
spellcd - amgv("amarena_spellcd")
guid - amgv("amarena_guid")
unit - amgv("amarena_unit")
反之返回 nil。
备注
参数区分大小写
请参考
Unit 详细请看Unit的说明
例子1:
1. localUnit = amacarena('class=="法师" and spell == "变羊术"')
2. if Unit and amisr("法术反制",Unit) then
3. amrun("法术反制",Unit)
4. return true;
5. end
当有法师在施放变羊术时,对该法师用法术反制
注意:单引号【'】 括主的为字符串
如:在字符串中使用 【"】双引号 '"我是小可爱"'
例子2:
1. localTIME=0.5; --防骗时间
2. localSPELLS="变羊术,恐惧"; --要打断的法术列表
3. localSPELL = "法术反制"; --打断技能的法术
4. localUnit = amacarena('amfind(spell,"' .. SPELLS .. '") and spellcd <=' .. TIME );
5. if Unit and amisr(SPELL,Unit) then
6. amrun("/stopcasting\n/cast [target=" .. Unit .. "]" .. SPELL);
7. return true;
8. end
在敌方施放法术还剩0.5秒的时候(防骗技能),对其施放打断技能。