I have most of my spell done, and now i am stuck at point, where after the creep is damaged by the spell, and if it is killed by the spell, there is a new creep spawned for the owner of the casting unit.
Here is what i have done in the spell:
Can any1 help me with this spell?
Here is what i have done in the spell:
JASS:
function Cond takes nothing returns boolean
return GetSpellAbilityId() = 039;A002039;
endfunction
function TurnToDead takes nothing returns nothing
local unit cast = GetTriggerUnit()
local unit targ = GetSpellTargetUnit()
local unit dumb
if IsUnitEnemy(targ, GetOwningPlayer(cast)) == true then
set dumb = CreateUnitAtLoc(GetOwningPlayer(cast), 039;h001039;, GetUnitLoc(targ), 0.00)
call IssueTargetOrder(dumb, "TurnToDead", targ)
call UnitApplyTimedLife(dumb, 039;BTLF039;, 0.01)
call SetUnitState(targ, UNIT_STATE_LIFE, ( GetUnitState(targ, UNIT_STATE_LIFE) - 300))
set dumb = null
endif
set cast = null
set targ = null
endfunction
function InitTrig_TurnToDead takes nothing returns nothing
local trigger t
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Cond))
call TriggerAddAction(t, function TurnToDead)
endfunction
Can any1 help me with this spell?