icond3maker
New Member
- Reaction score
- 6
once again, I have a problem... when I kill a unit and kill another one...
Sometimes they exchange places
Example.
Legends :
o~ = rat
>~ = wolf
o~
>~
Becomes this :
>~
o~
It exchanges places with the other unit died also. Here is my trigger :
Any answer to my problem?
Sometimes they exchange places
Example.
Legends :
o~ = rat
>~ = wolf
o~
>~
Becomes this :
>~
o~
It exchanges places with the other unit died also. Here is my trigger :
JASS:
function Trig_Creep_Reviving_Func009001 takes nothing returns boolean
return ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Creep_Reviving_Func009002 takes nothing returns boolean
return ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) != true )
endfunction
function Trig_Creep_Reviving_Conditions takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Creep_Reviving_Func009001(), Trig_Creep_Reviving_Func009002() ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Reviving_Actions takes nothing returns nothing
local integer utype = GetUnitTypeId(GetTriggerUnit())
set udg_Temp_Type = utype
call CreateEffectLoc( OffsetLocation(GetRectCenter(GetEntireMapRect()), udg_CREEPX[GetUnitUserData(GetTriggerUnit())], udg_CREEPY[GetUnitUserData(GetTriggerUnit())]), "Abilities\\Spells\\NightElf\\TrueshotAura\\TrueshotAura.mdl", 30.00 )
call TriggerSleepAction( 30.00 )
call CreateNUnitsAtLoc( 1, udg_Temp_Type, Player(PLAYER_NEUTRAL_AGGRESSIVE), OffsetLocation(GetRectCenter(GetEntireMapRect()), udg_CREEPX[GetUnitUserData(GetTriggerUnit())], udg_CREEPY[GetUnitUserData(GetTriggerUnit())]), GetUnitFacing(GetTriggerUnit()) )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(GetTriggerUnit()))
endfunction
//===========================================================================
function InitTrig_Creep_Reviving takes nothing returns nothing
set gg_trg_Creep_Reviving = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Creep_Reviving, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Creep_Reviving, Condition( function Trig_Creep_Reviving_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Reviving, function Trig_Creep_Reviving_Actions )
endfunction
Any answer to my problem?