- Joined
- Apr 23, 2011
- Messages
- 460
I've tried many different spell ID's and none have worked so far and I'm curious as to what could be wrong with my scripting that would cause this to happen. Using Debug messages I was able to determine that the trigger is working as intended, but a block in the coding for the struct isn't working. I can't find it, anyone have any ideas?
vJass code
Jass Trigger Creation
vJass code
JASS:
struct Jump extends array
private static integer spell = 'Aroc'
private static rect area = gg_rct_GiveSpell
private static method GiveSpell takes nothing returns nothing
local unit u = GetEnumUnit()
local location loc = Location(GetRectCenterX(gg_rct_ResendSpell),GetRectCenterY(gg_rct_ResendSpell))
call UnitAddAbility(u, spell)
call SetUnitPositionLoc(u, loc)
set loc = null
set u = null
endmethod
private static method CheckUnit takes nothing returns nothing
local group g = CreateGroup()
call GroupEnumUnitsInRect(g, area, null)
call ForGroup(g, function thistype.GiveSpell)
call DestroyGroup(g)
set g = null
endmethod
static method Main takes nothing returns nothing
call .CheckUnit()
endmethod
endstruct
Jass Trigger Creation
JASS:
function CheckUnitCond takes unit u returns boolean
local integer typeUnit = 'hfoo'
local region r = CreateRegion()
call RegionAddRect(r, gg_rct_GiveSpell)
if GetUnitTypeId(u) == typeUnit and IsUnitInRegion(r, u) == true then
return true
else
return false
endif
endfunction
function DoSpellGive takes nothing returns nothing
local unit u = GetEnumUnit()
if CheckUnitCond(u) == true then
call Jump.Main()
endif
set u = null
endfunction
function GiveSpell takes nothing returns nothing
local group g = CreateGroup()
call GroupEnumUnitsInRect(g, gg_rct_GiveSpell, null)
call ForGroup(g, function DoSpellGive)
call DestroyGroup(g)
set g = null
endfunction
function InitTrig_Run_Jump takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 1., true)
call TriggerAddAction(t, function GiveSpell)
set t = null
endfunction