|
发表于 2012-5-8 09:11:16
|
显示全部楼层
- //========================================================
- //Trigger:技能特效展示,在公司写的,没有测试环境,报错的话再说一声。
- // @udg_HT:全局变量,hashtable|如果是1.20请改成return bug方式储存|或者直接定义全局变量储存
- //========================================================
- function trg_SpecialNova_Conditions takes nothing returns boolean
- returns GetSpellAbilityId() == 'a001' //'a001'自己改成你的马甲技能编码 把施法准备时间改成4s
- endfunction
- function IsUnitEnemyFilter takes nothing returns boolean
- return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0 and IsUnitEnemy(GetFilterUnit(),GetTriggerUnit())
- endfunction
- function DamageActions takes nothing returns nothing
- local real DAMAGE = 0 // 造成伤害自己定义
- call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),DAMAGE,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
- endfunction
- function trg_SpecialNova_TimerActions takes nothing returns nothing
- local integer parentKey = GetHandleId(GetExpiredTimer())
- local integer n = LoadInteger(udg_HT,parentKey,0)
- local location loc = LoadLocationHandle(udg_HT,parentKey,1)
- local location tempLoc //特效创建点
- local integer MAX_N = 6 // MAX_N为扩散次数,6可以按需要修改
- local integer DISTANCE = 90 // DISTANCE每次扩散距离,可以按需求修改
- local integer i = 0
- if (n < MAX_N) then
- loop
- exitwhen i <= 12 // 循环遍历12次,每次扩散30°
- set tempLoc = PolarProjectionBJ(loc, DISTANCE, n*30)
- set n = n + 1
- call SaveInteger(udg_HT,parentKey,0,n) // 重新储存扩散次数
- call DestroyEffect(AddSpecialEffectLoc("霜冻新星的路径,自己找下吧,记得'/'要写成'//'转义",tempLoc))
- call ForGroup(GetUnitsInRangeOfLocMatching(90,tempLoc,Condition(function IsUnitEnemyFilter)),function DamageActions) // 选取敌人单位组单位造成伤害
- call RemoveLocation(tempLoc)
- set tempLoc = null
- endloop
- else
- call PauseTimer(t)
- call DestroyTimer(t)
- call FlushChildHashtable(udg_HT,parentKey)
- call RemoveLocation(loc)
- endif
- set loc = null
- set tempLoc = null
- endfunction
- function trg_SpecialNova_Actions takes nothing returns nothing
- local timer t = CreateTimer()
- local integer parentKey = GetHandleId(t)
- local location loc = GetUnitLoc(GetTriggerUnit())
- call SaveInteger(udg_HT,parentKey,0,0) // 储存冰霜特效扩散次数
- call SaveLocationHandle(udg_HT,parentKey,1,loc) // 储存施法单位位置
- call TimerStart(t,0.35,TRUE,function trg_SpecialNova_TimerActions)//0.35s的间隔自己按需要修改
- set t = null
- set loc = null
- endfunction
- //========================================================
- function InitTrig_SpecialNova takes nothing returns nothing
- set gg_trg_SpecialNova = CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(gg_trg_SpecialNova,EVENT_UNIT_SPELL_EFFECT)
- call TriggerAddCondition(gg_trg_SpecialNova,Condition(function trg_SpecialNova_Conditions))
- call TriggerAddAction(gg_trg_SpecialNova,function trg_SpecialNova_Actions)
- endfunction
复制代码 PS:求技能貌似你发错区了!还有你花200RMB求技能?汗~在GA有问题可以得到解决的,不用拿钱浪费。(如果是钱多就当我没说了) |
|