raw data exchange

icond3maker

New Member
Reaction score
6
I got this Creep Revival System triggers from my map and I have a question...
If I kill a creep, and an other person killed a creep also... will the last killed unit's user data or raw data replace the creep I killed.. and respawn an other unit in the creep's place?
If yes, how can I fix this? I was wondering of using arrays...
Please help me :d , thank you

Trigger:
  • CRS Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Temp_Integer = (Temp_Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Temp_Integer
          • Custom script: set udg_CREEPX[udg_Temp_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_CREEPY[udg_Temp_Integer] = GetUnitY(GetEnumUnit())


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 array utype[GetUnitUserData(GetTriggerUnit())] = 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", ( I2R(GetUnitLevel(GetTriggerUnit())) * 10.00 ) )
    call TriggerSleepAction( ( I2R(GetUnitLevel(GetTriggerUnit())) * 8.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
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top