Bah I shame myself that this 'easy' JASS spell doesn't work, and that I can't create it
Well the currently plan is to whenever a hero uses its item on a unit, it is changing its position with it.
(So the hero on the place of the target, and the target on place of the hero).
Currently I had this:
Bahbah, shame on me
Well the currently plan is to whenever a hero uses its item on a unit, it is changing its position with it.
(So the hero on the place of the target, and the target on place of the hero).
Currently I had this:
JASS:
function Trig_Swap_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06G' ) ) then
return false
endif
return true
endfunction
function Trig_Swap_Actions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local unit Target = GetSpellTargetUnit()
local location C = GetUnitLoc(Caster)
local location T = GetSpellTargetLoc(Target)
call TriggerSleepAction( 0.10 )
call SetUnitPositionLoc( Caster, T )
call SetUnitPositionLoc( Target, C )
set Caster=null
set Target=null
call RemoveLocation(C)
call RemoveLocation(T)
endfunction
//===========================================================================
function InitTrig_Swap takes nothing returns nothing
set gg_trg_Swap = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Swap, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Swap, Condition( function Trig_Swap_Conditions ) )
call TriggerAddAction( gg_trg_Swap, function Trig_Swap_Actions )
endfunction
Bahbah, shame on me