|
- function Aphotic_Spell takes nothing returns boolean
- return GetSpellAbilityId()=='A002'//判断施法函数
- endfunction
- function Aphotic_AntiDoom takes nothing returns nothing
- if(GetUnitAbilityLevel(GetSpellTargetUnit(),'BNdo')!=0)then
- call IssueImmediateOrder(GetTriggerUnit(),"stop")//末日BUFF函数
- endif
- endfunction
- function Aphotic_Filter takes nothing returns boolean
- return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==true)and(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=0)and((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))==false)//判断函数
- endfunction
- function Aphotic_Heal takes nothing returns nothing
- local integer k=GetHandleId(GetTriggerUnit())
- local real df=LoadReal(HT,k,1)
- local location point
- local group team
- local unit target
- local unit caster
- local effect ase
- local boolexpr asb=Condition(function Aphotic_Filter)//判断
- if(df<GetEventDamage())then
- call DisableTrigger(GetTriggeringTrigger())
- call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+df)//回血
- set ase=LoadEffectHandle(HT,k,2)
- call DestroyEffect(ase)
- set ase=null
- set point=GetUnitLoc(GetTriggerUnit())
- call GroupEnumUnitsInRangeOfLoc(team,point,500,asb)//选区单位
- loop
- set target=FirstOfGroup(team)
- exitwhen(target==null)
- call GroupRemoveUnit(team,target)
- set caster=CreateUnitAtLoc(LoadPlayerHandle(HT,k,3),'e000',point,0)//创建施法单位
- call UnitAddAbility(caster,'A005')//添加技能
- call SetUnitAbilityLevel(caster,'A005',LoadInteger(HT,k,5))//设置技能等级
- call IssueTargetOrderById(caster,852587,target)//发动技能效果
- call UnitApplyTimedLife(caster,'BTLF',1)
- endloop
- call FlushChildHashtable(HT,k)
- call DestroyGroup(team)
- call RemoveLocation(point)
- set team=null
- set target=null
- set caster=null
- set point=null
- elseif(GetEventDamage()>0)then
- call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+GetEventDamage())//回血
- call SaveReal(HT,k,1,df-GetEventDamage())
- set team=null
- set target=null
- set caster=null
- set point=null
- endif
- endfunction
- function Aphotic_Setting takes nothing returns nothing
- local trigger heal=CreateTrigger()
- local integer k=GetHandleId(GetSpellTargetUnit())
- local triggeraction fct=TriggerAddAction(heal,function Aphotic_Heal)//创建主要函数
- local effect ase
- if(HaveSavedReal(HT,k,1)==true)then
- call DestroyEffect(LoadEffectHandle(HT,k,2))
- set ase=null
- call FlushChildHashtable(HT,k)
- endif
- call TriggerRegisterUnitEvent(heal,GetSpellTargetUnit(),EVENT_UNIT_DAMAGED)//注册单位接受伤害事件
- set ase=AddSpecialEffectTarget("war3mapImported\\defensive barrier big.mdx",GetSpellTargetUnit(),"chest")
- call UnitRemoveBuffs(GetSpellTargetUnit(),false,true)//清除DEBUFF
- call SaveReal(HT,k,1,80+30*GetUnitAbilityLevel(GetTriggerUnit(),'A002'))//保存盾的血量(下面的保存)
- call SaveEffectHandle(HT,k,2,ase)
- call SavePlayerHandle(HT,k,3,GetOwningPlayer(GetTriggerUnit()))
- call SaveBoolean(HT,k,4,false)
- call SaveInteger(HT,k,5,GetUnitAbilityLevel(GetTriggerUnit(),'A002'))
- call PolledWait(15)
- if(HaveSavedBoolean(HT,k,4)==true)then
- set ase=LoadEffectHandle(HT,k,2)
- call DestroyEffect(ase)
- set ase=null
- call FlushChildHashtable(HT,k)
- endif
- call TriggerRemoveAction(heal,fct)
- set heal=null
- set fct=null
- endfunction
- function InitTrig_Aphotic_Shield takes nothing returns nothing
- local trigger Aphotic_Shield1=CreateTrigger()
- local trigger Aphotic_Shield2=CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(Aphotic_Shield1,EVENT_PLAYER_UNIT_SPELL_CAST)//判断末日BUFF
- call TriggerAddCondition(Aphotic_Shield1,Condition(function Aphotic_Spell))
- call TriggerAddAction(Aphotic_Shield1,function Aphotic_AntiDoom)
- call TriggerRegisterAnyUnitEventBJ(Aphotic_Shield2,EVENT_PLAYER_UNIT_SPELL_EFFECT)
- call TriggerAddCondition(Aphotic_Shield2,Condition(function Aphotic_Spell))
- call TriggerAddAction(Aphotic_Shield2,function Aphotic_Setting)//设置
- set Aphotic_Shield1=null
- set Aphotic_Shield2=null
- endfunction
复制代码 为什么创建施法单位然后发动技能效果(就是游戏中盾爆伤害)哪里无效
无奈求助。WOW8冷落了我。 |
|