TriggerHappy
...
- Reaction score
- 341
Ok , im trying to make a MUI spell using structs because im tired of using arrays. Here's my start of my spell.
What i'm wondering is how would i get the struct information previously stored?
JASS:
scope FlamePort initializer InitTrig
globals
// ------------------------------------------------------------------------------------
private string Dummy = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
// ------------------------------------------------------------------------------------
private constant real PeriodicTimer = 0.10
private constant integer ID = 039;A000039;
private constant real Speed = 500
// ------------------------------------------------------------------------------------
endglobals
struct Data
unit Unit
real Dest
//---------------------------------------------------
public static method create takes unit u returns Data
local Data this = Data.allocate()
set .Unit = u
return this
endmethod
//---------------------------------------------------
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == ID
endfunction
private function MoveUnit takes nothing returns nothing
//local Data.d = create() --- how would i get the struct declared earlier?
endfunction
private function BeginSpell takes nothing returns nothing
local Data d = Data.create(GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig takes nothing returns nothing
local trigger t = CreateTrigger()
local timer time = CreateTimer()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( t, function BeginSpell )
call TimerStart(time, PeriodicTimer, true, function MoveUnit)
endfunction
endscope
What i'm wondering is how would i get the struct information previously stored?