|
部分变量,函数 没贴出来,整体经过JassCraft 检查无错,魔兽运行通过,但在魔兽里技能施放的时候没效果!
[jass]
function DestructableRemoveCond takes nothing returns boolean
local trigger trg=GetTriggeringTrigger()
local string key=H2S(trg)
local destructable Dstr=I2D(GetStoredInteger(HashCache,key,"Destr"))
call RemoveDestructable(Dstr)
call DestroyTrigger(trg)
call FlushStoredMission(HashCache,key)
set trg=null
set Dstr=null
set key=null
return false
endfunction
function DestructableRemoveTrg takes destructable dstr,real tm returns nothing
local trigger trg=CreateTrigger()
local string key=H2S(trg)
call StoreInteger(HashCache,key,"Destr",H2I(dstr))
call TriggerRegisterTimerEvent(trg,tm,false)
call TriggerAddCondition(trg,Condition(function DestructableRemoveCond))
set trg=null
set key=null
endfunction
function XuanYunUnit takes unit danwei,integer level returns nothing
local unit majia=CreateUnit(GetOwningPlayer(danwei),'hx01',GetUnitX(danwei),GetUnitY(danwei),0)
call UnitAddAbility(majia,'Az91')
call SetUnitAbilityLevel(majia,'Az91',level)
call IssueTargetOrder(majia,"thunderbolt",danwei)
call UnitApplyTimedLife(majia,'BHLF',0.5)
set majia=null
endfunction
function LieFengAction takes nothing returns nothing
local unit danwei=GetTriggerUnit()
local integer int=0
local location Loc=GetUnitLoc(danwei)
local location loc=GetSpellTargetLoc()
local unit mubiao=GetSpellTargetUnit()
local real angle
local real Tx=GetUnitX(danwei)
local real Ty=GetUnitY(danwei)
local real tx
local real ty
local group qun=CreateGroup()
local group Qun=CreateGroup()
local integer level=GetUnitAbilityLevel(danwei,'Az92')
if mubiao==null then
set loc=loc
else
set loc=GetUnitLoc(mubiao)
endif
set angle=AngleBetweenPoints(Loc,loc)
call RemoveLocation(loc)
call RemoveLocation(Loc)
loop
exitwhen int>20
set tx=Tx+int*60*CosBJ(angle)
set ty=Ty+int*60*SinBJ(angle)
call GroupEnumUnitsInRange(qun,tx,ty,250,null)
call GroupAddGroup(qun,Qun)
call GroupClear(qun)
call DestructableRemoveTrg(CreateDestructable('BRfs',tx,ty,GetRandomReal(0,360),0.5,GetRandomInt(0,2)),8)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",tx,ty))
set int=int+1
endloop
loop
set mubiao=FirstOfGroup(Qun)
exitwhen mubiao==null
if IsAttack(danwei,mubiao) then
call DamageTarget(danwei,mubiao,level*50)
call XuanYunUnit(mubiao,level)
endif
call GroupRemoveUnit(Qun,mubiao)
endloop
call DestroyGroup(qun)
call DestroyGroup(Qun)
set danwei=null
set loc=null
set Loc=null
set mubiao=null
set qun=null
set Qun=null
endfunction
function LieFengCond takes nothing returns boolean
if GetSpellAbilityId()=='Az92' then
call LieFengAction()
endif
return false
endfunction
function LieFengTrg takes nothing returns nothing
local trigger trg=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trg,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trg,Condition(function LieFengCond))
set trg=null
endfunction
[/jass] |
|