xAnaMorphine
Active Member
- Reaction score
- 43
Hi, folks!
The unit does not get revived at the grave location and does the code look somehow ok?
Code:
Create Grave
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
Set TEMP_Point = (Position of (Dying unit))
Set UnitPosition[(Player number of (Owner of (Triggering unit)))] = TEMP_Point
Set GraveLocation[(Player number of (Owner of (Triggering unit)))] = UnitPosition[(Player number of (Owner of (Triggering unit)))]
Set Revive[(Player number of (Owner of (Triggering unit)))] = (Dying unit)
Set ReviveLocation[(Player number of (Owner of (Triggering unit)))] = GraveLocation[(Player number of (Owner of (Triggering unit)))]
Unit - Create 1 Grave for (Owner of (Triggering unit)) at ReviveLocation[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
Custom script: call RemoveLocation(udg_TEMP_Point)
Code:
Revive Unit
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Revive
Actions
Hero - Instantly revive Revive[(Player number of (Owner of (Target unit of ability being cast)))] at GraveLocation[(Player number of (Owner of (Triggering unit)))], Hide revival graphics
Set ReviveGrave = (Units owned by (Owner of (Target unit of ability being cast)) of type Grave)
Set ReviveUnitGroup[(Player number of (Owner of (Target unit of ability being cast)))] = ReviveGrave
Unit Group - Pick every unit in ReviveUnitGroup[(Player number of (Owner of (Target unit of ability being cast)))] and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Custom script: call RemoveLocation(udg_ReviveLocation[GetConvertedPlayerId(GetTriggerPlayer())])
Custom script: call DestroyGroup(udg_ReviveUnitGroup[GetConvertedPlayerId(GetOwningPlayer(GetSpellTargetUnit()))])
Custom script: call DestroyGroup(udg_ReviveGrave)
Custom script: call RemoveLocation(udg_GraveLocation[GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))])
Custom script: call RemoveLocation(udg_UnitPosition[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
The unit does not get revived at the grave location and does the code look somehow ok?