Ok well i'm working on a map atm and i'm just wondering whether or not this use of GetLocalPlayer would cause any Desyncs.
Heres the trigger:
So far i haven't experienced anything unusual but i've only tested it in single player and not with anybody.
Heres the trigger:
Purchase
Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Sold unit)) Equal to Select Hero
Actions
Custom script: set udg_LocalPlayer = GetLocalPlayer()
Unit - Remove (Sold unit) from the game
Selection - Clear selection for LocalPlayer
Player - Make Neutral Passive treat LocalPlayer as an Neutral
Set TempLoc = (LocalPlayer start location)
Camera - Pan camera for LocalPlayer to (LocalPlayer start location) over 0.00 seconds
Unit - Create 1 (Unit-type of (Triggering unit)) for LocalPlayer at TempLoc facing Default building facing degrees
Set TempLoc = (Position of (Last created unit))
Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
Set TempSFX = (Last created special effect)
Selection - Select (Last created unit) for LocalPlayer
Unit - Remove Sell Units from (Last created unit)
Unit - Remove Cargo Hold (Orc Burrow) from (Last created unit)
Unit - Add Inventory (Hero) to (Last created unit)
Custom script: call UnitAddAbilityBJ( 'Amov', GetLastCreatedUnit() )
Custom script: set udg_LocalPlayer = null
Custom script: call RemoveLocation(udg_TempLoc)
Special Effect - Destroy TempSFX
Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Sold unit)) Equal to Select Hero
Actions
Custom script: set udg_LocalPlayer = GetLocalPlayer()
Unit - Remove (Sold unit) from the game
Selection - Clear selection for LocalPlayer
Player - Make Neutral Passive treat LocalPlayer as an Neutral
Set TempLoc = (LocalPlayer start location)
Camera - Pan camera for LocalPlayer to (LocalPlayer start location) over 0.00 seconds
Unit - Create 1 (Unit-type of (Triggering unit)) for LocalPlayer at TempLoc facing Default building facing degrees
Set TempLoc = (Position of (Last created unit))
Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
Set TempSFX = (Last created special effect)
Selection - Select (Last created unit) for LocalPlayer
Unit - Remove Sell Units from (Last created unit)
Unit - Remove Cargo Hold (Orc Burrow) from (Last created unit)
Unit - Add Inventory (Hero) to (Last created unit)
Custom script: call UnitAddAbilityBJ( 'Amov', GetLastCreatedUnit() )
Custom script: set udg_LocalPlayer = null
Custom script: call RemoveLocation(udg_TempLoc)
Special Effect - Destroy TempSFX
So far i haven't experienced anything unusual but i've only tested it in single player and not with anybody.