darth-yoda
New Member
- Reaction score
- 15
Im trying to make a pretty simple ability, all it is basically supposed to do is create a line of dummy units and have them cast a modified warstomp. The dummy units are made but nothing after that works, the ability is never added and the units never die...Here is the code...
As far as I can tell the dummy unit is never being assigned to the variable and I dont know why.:banghead:
JASS:
constant function Geysers_id takes nothing returns integer
return 039;A002039;
endfunction
constant function Geysers_dummyspell takes nothing returns integer
return 039;A003039;
endfunction
constant function Geysers_dummy takes nothing returns integer
return 039;h000039;
endfunction
constant function Geysers_height takes nothing returns real
return 38.50
endfunction
function Geysers_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A002039;
endfunction
function Geysers_water takes location cast returns boolean
return GetLocationZ(cast) < Geysers_height()
endfunction
function Geysers_hp takes unit caster returns boolean
return GetUnitState(caster,UNIT_STATE_LIFE) > GetUnitAbilityLevel(caster,Geysers_id()) * 10
endfunction
function Geysers_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit dummy
local location cast = GetUnitLoc(caster)
local location targ
local integer a = 1
local integer b = 5
if ( Geysers_water(cast)) then
loop
exitwhen a > b
set targ = PolarProjectionBJ(cast, 150.00, GetUnitFacing(caster))
set cast = targ
call CreateUnitAtLoc(GetOwningPlayer(caster),Geysers_dummy(),targ,90)
set dummy = GetLastCreatedUnit()
call UnitApplyTimedLife(dummy,039;BTLF039;,1.00)
call UnitAddAbility(dummy,Geysers_dummyspell())
call SetUnitAbilityLevel(dummy,Geysers_dummyspell (),GetUnitAbilityLevel(caster,Geysers_id()))
call IssueImmediateOrder(dummy,"stomp")
set a = a + 1
call PolledWait(0.20)
endloop
else
loop
exitwhen a > b
if (Geysers_hp(caster)) then
call UnitDamageTarget(caster,caster,GetUnitAbilityLevel(caster,Geysers_id()) * 10,true,false,ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
set targ = PolarProjectionBJ(cast, 150.00, GetUnitFacing(caster))
set cast = targ
call CreateUnitAtLoc(GetOwningPlayer(caster),Geysers_dummy(),targ,90)
set dummy = GetLastCreatedUnit()
call UnitApplyTimedLife(dummy,039;BTLF039;,1.00)
call UnitAddAbility(dummy,Geysers_dummyspell())
call SetUnitAbilityLevel(dummy,Geysers_dummyspell(),GetUnitAbilityLevel(caster,Geysers_id()))
call IssueImmediateOrder(dummy,"stomp")
set a = a + 1
call PolledWait(0.20)
else
set a = a + 1
endif
endloop
endif
endfunction
//===========================================================================
function InitTrig_Geysers takes nothing returns nothing
set gg_trg_Geysers = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Geysers, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Geysers, function Geysers_Actions )
call TriggerAddCondition( gg_trg_Geysers, Condition( function Geysers_Conditions ) )
endfunction
As far as I can tell the dummy unit is never being assigned to the variable and I dont know why.:banghead: