- Joined
- Oct 24, 2012
- Messages
- 6,545
hello i have a problem w my sells trigger i think im missing something can anyone help me w y this isnt working the right way ? thx
JASS:
function Trig_Sell_Towers_Conditions takes nothing returns boolean
if GetSpellAbilityId() == 'A003' then
return true
else
return false
endif
endfunction
function Trig_Sell_Towers_Actions takes nothing returns nothing
local effect sfx
local integer p = GetPlayerId( GetTriggerPlayer() )
local unit u = GetTriggerUnit()
local real x = GetUnitX( u )
local real y = GetUnitY( u )
local integer v = GetUnitPointValue( u )
set sfx = AddSpecialEffect( "Units\\Demon\\Infernal\\InfernalBirth.mdl", x, y )
call SetPlayerState( Player(p), PLAYER_STATE_RESOURCE_GOLD, (GetPlayerState( Player(p), PLAYER_STATE_RESOURCE_GOLD ) + v) )
//set sfx = AddSpecialEffectTargetUnitBJ( "overhead", u, "Units\\Demon\\Infernal\\InfernalBirth.mdl" )
call PolledWait( 1.50 )
call RemoveUnit( u )
call DestroyEffect( sfx )
set sfx = null
set u = null
endfunction
//===========================================================================
function InitTrig_Sell_Towers takes nothing returns nothing
local trigger t
local integer L = 0
set t = CreateTrigger()
loop
exitwhen L > 11
call TriggerRegisterPlayerUnitEvent( t, Player(L), EVENT_PLAYER_UNIT_SPELL_CAST, Condition( function Trig_Sell_Towers_Conditions ) )
set L = L + 1
endloop
call TriggerAddAction( t, function Trig_Sell_Towers_Actions )
set t = null
endfunction