rexpim
Member
- Reaction score
- 8
I'm moving from gui to jass this is my first spell, so i wanna know if i got mistakes in this code
I'm using sleep action, can any1 tell me another action to get the life of the tree
JASS:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// -Made By REX
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//===========================================================================
scope NatureStrike
globals
private constant integer NATURESTRIKE = 039;A01U039; // Nature Strike RAW CODE
private constant integer TREE = 039;BTtw039; // Tree RAW CODE
private constant integer VAR = 2 // Tree variation
private constant real SCALE = 2.00 // Tree scale size
private constant real LIFE = 20.00 // Tree life time
endglobals
//===========================================================================
//===========================================================================
private function Trig_NatureStrike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == NATURESTRIKE
endfunction
function Trig_NatureStrike_Actions takes nothing returns nothing
local destructable FSTREE
local location FORCETARGET = GetSpellTargetLoc()
call CreateDestructableLoc( TREE, FORCETARGET, GetRandomDirectionDeg(), SCALE, VAR )
set FSTREE = GetLastCreatedDestructable()
call TriggerSleepAction( LIFE )
call RemoveDestructable( FSTREE )
endfunction
//===========================================================================
function InitTrig_NatureStrike takes nothing returns nothing
set gg_trg_NatureStrike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NatureStrike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_NatureStrike, Condition( function Trig_NatureStrike_Conditions ) )
call TriggerAddAction( gg_trg_NatureStrike, function Trig_NatureStrike_Actions )
endfunction
endscope
//===========================================================================
//===========================================================================
I'm using sleep action, can any1 tell me another action to get the life of the tree