- Joined
- Jan 3, 2009
- Messages
- 402
Code:
function Trig_MirrorStone_Conditions takes nothing returns nothing
if (gg_gamecheck == GAME_TYPE_MELEE) then
return true
endif
return false
endfunction
function Trig_MirrorStone_Func001C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_MirrorStone_Actions takes nothing returns nothing
if ( Trig_MirrorStone_Func001C() ) then
call UnitAddItemByIdSwapped( GetItemTypeId(GetSpellTargetItem()), GetSpellAbilityUnit() )
else
endif
endfunction
//===========================================================================
function InitTrig_MirrorStone takes nothing returns nothing
local gametype gg_gamecheck
set gg_trg_MirrorStone = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_MirrorStone, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MirrorStone, Condition( function Trig_MirrorStone_Conditions ) )
call TriggerAddAction( gg_trg_MirrorStone, function Trig_MirrorStone_Actions )
endfunction
Can someone please tell me if this is written correctly and if not what do I need to in order to implement
such a variable in map script? I think gametype is a global variable and I'm not really sure where to add it if at all.