Name | Type | is_array | initial_value |
//***************************************************************************************************
//*
//* **************
//* * Fire Flower *
//* * by ctb *
//* **************
//*
//***************************************************************************************************
//1.Copy the Fire Dummy unit, the Fire Flower ability and the Fire Flower Damage ability into your map.
//2.Change A000 and n000 above to the codes in your map (Further info above).
//To find the unit/ability codes, go into view in the obj. editor and turn 'display values as raw data' on
//===========================================================================
function getFireFlowerAbilityCode takes nothing returns integer
return 'A000' //To implement just change A000 to the ability code of the 'Fire Flower' spell in your map
endfunction
function getFireFlowerAbilityCode2 takes nothing returns integer
return 'A001' //Just change A001 to the ability code of the 'Fire Flower Damage' spell in your map
endfunction
function getFireFlowerDummy takes nothing returns integer
return 'n000' //And finally you need to change n000 to the unit codes of the fire dummy in your map
endfunction
//*You don't need to change anything after this point
//===========================================================================
function Trig_Fire_Flower_Conditions takes nothing returns boolean
if GetSpellAbilityId()==getFireFlowerAbilityCode() then
return true
endif
return false
endfunction
function Trig_Fire_Flower_Actions takes nothing returns nothing
local integer a
local integer b
local integer i
local unit c=GetTriggerUnit()
local location l=GetUnitLoc(c)
local unit array u
local trigger t=CreateTrigger()
local player z=GetOwningPlayer(c)
call TriggerRegisterUnitEvent(t,c,EVENT_UNIT_SPELL_ENDCAST)
set a=0
loop
exitwhen a>7 or GetTriggerEvalCount(t)>0
set b=1
loop
exitwhen b>9
set u[a*9+b]=CreateUnit(z,getFireFlowerDummy(),GetUnitX(c)+600*CosBJ(b*40+5*a),GetUnitY(c)+600*SinBJ(b*40+5*a),0)
set b=b+1
endloop
call PolledWait(0.1)
set a=a+1
endloop
set a=1
loop
exitwhen a>23 or GetTriggerEvalCount(t)>0
set b=1
loop
exitwhen b>9
set u[a*9+b+63]=CreateUnit(z,getFireFlowerDummy(),GetUnitX(c)+(600-a*50)*CosBJ(b*40+5*a),GetUnitY(c)+(600-a*50)*SinBJ(b*40+5*a),0)
set b=b+1
endloop
call PolledWait(0.1)
set a=a+1
endloop
if GetTriggerEvalCount(t)>0 then
set a=1
loop
exitwhen a > 279
call UnitRemoveAbility( u[a],getFireFlowerAbilityCode2())
call KillUnit(u[a])
set u[a]=null
set a=a+1
endloop
else
call PauseUnitBJ(true,c)
call IssueImmediateOrder(c,"stop")
call PauseUnitBJ(false,c)
set a=1
loop
exitwhen a>279
call KillUnit(u[a*2-1])
call KillUnit(u[a*2])
set u[a*2-1]=null
set u[a*2]=null
call TriggerSleepAction(0)
set a=a+1
endloop
endif
call DestroyTrigger(t)
call RemoveLocation(l)
set l=null
set t=null
set z=null
set c=null
endfunction
//===========================================================================
function InitTrig_Fire_Flower takes nothing returns nothing
set gg_trg_Fire_Flower=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Fire_Flower,EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_Fire_Flower, Condition( function Trig_Fire_Flower_Conditions ))
call TriggerAddAction(gg_trg_Fire_Flower,function Trig_Fire_Flower_Actions )
endfunction