- Joined
- Nov 13, 2006
- Messages
- 1,814
1. Respawn unit in last position, with same faceing angle than was when he died and same hero level if he is a hero unit
map init
Requiment the unit indexer
Requiment the unit indexer
map init
-
Unit dieing
-
Events
- Unit - A unit owned by Neutral Hostile Dies
- Conditions
-
Actions
- Custom script: local unit u = GetDyingUnit()
- Custom script: local integer utype=GetUnitTypeId(u)
- Custom script: local real ang = GetUnitFacing(u)
- Custom script: local integer herolv = GetHeroLevel(u)
- Custom script: local real x = GetUnitX(u)
- Custom script: local real y = GetUnitY(u)
- Wait 2.00 seconds
- Custom script: call RemoveUnit(u)
- Custom script: set u = CreateUnit(GetTriggerPlayer(),utype,x,y,ang)
- Custom script: if herolv > 1 then
- Custom script: call SetHeroLevel(u,herolv,false)
- Custom script: endif
- Custom script: set u = null
-
Events
map init
-
Define regions
-
Events
- Map initialization
- Conditions
-
Actions
- Set Regions[0] = Forest <gen>
- Set Regions[1] = Mountain <gen>
- Set Regions[2] = Desert <gen>
- -------- u can declare here the regions, then check the unit point values in object editor-units --------
-
Events
-
Unit dieing
-
Events
- Unit - A unit owned by Neutral Hostile Dies
- Conditions
-
Actions
- Custom script: local unit u = GetDyingUnit()
- Custom script: local integer utype=GetUnitTypeId(u)
- Custom script: local real ang = GetUnitFacing(u)
- Custom script: local integer pv = GetUnitPointValueByType(utype)
- Custom script: local integer herolv = GetHeroLevel(u)
- Custom script: local real x = GetRandomReal(GetRectMinX(udg_Regions[pv]), GetRectMaxX(udg_Regions[pv]))
- Custom script: local real y = GetRandomReal(GetRectMinY(udg_Regions[pv]), GetRectMaxY(udg_Regions[pv]))
- Wait 2.00 seconds
- Custom script: call RemoveUnit(u)
- Custom script: set u = CreateUnit(GetTriggerPlayer(),utype,x,y,ang)
- Custom script: if herolv > 1 then
- Custom script: call SetHeroLevel(u,herolv,false)
- Custom script: endif
- Custom script: set u = null
-
Events
Requiment the unit indexer
-
Set the unit coordinate
-
Events
- Game - UnitIndexEvent becomes Equal to 1.00
- Conditions
-
Actions
- Custom script: local unit u = udg_UDexUnits[udg_UDex]
- Custom script: set udg_CreepX[udg_UDex]=GetUnitX(u)
- Custom script: set udg_CreepY[udg_UDex]=GetUnitY(u)
- Custom script: set udg_CreepAng[udg_UDex] = GetUnitFacing(u)
- Custom script: set u = null
-
Events
-
Respawn
-
Events
- Unit - A unit owned by Neutral Hostile Dies
- Conditions
-
Actions
- Custom script: local unit u = GetDyingUnit()
- Custom script: local integer id = GetUnitTypeId(u)
- Custom script: local integer lv = GetHeroLevel(u)
- Custom script: local integer cv = GetUnitUserData(u)
- Wait 5.00 seconds
- Custom script: call RemoveUnit( u )
- Custom script: set u = CreateUnit(GetTriggerPlayer(),id,udg_CreepX[cv],udg_CreepY[cv],udg_CreepAng[cv])
- Custom script: if lv > 1 then
- Custom script: call SetHeroLevel(u,lv,false)
- Custom script: endif
- Custom script: set u = null
-
Events
Requiment the unit indexer
map init
-
Mapinit
-
Events
- Map initialization
- Conditions
-
Actions
- Custom script: set udg_CreepTable = InitHashtable()
-
Events
-
Set the unit coordinate
-
Events
- Game - UnitIndexEvent becomes Equal to 1.00
- Conditions
-
Actions
- Custom script: local unit u = udg_UDexUnits[udg_UDex]
- Custom script: call SaveReal(udg_CreepTable, udg_UDex, 1, GetUnitX(u))
- Custom script: call SaveReal(udg_CreepTable, udg_UDex, 2, GetUnitY(u))
- Custom script: call SaveReal(udg_CreepTable, udg_UDex, 3, GetUnitFacing(u))
- Custom script: set u = null
-
Events
-
Respawn
-
Events
- Unit - A unit owned by Neutral Hostile Dies
- Conditions
-
Actions
- Custom script: local unit u = GetDyingUnit()
- Custom script: local integer id = GetUnitTypeId(u)
- Custom script: local integer lv = GetHeroLevel(u)
- Custom script: local integer cv = GetUnitUserData(u)
- Custom script: local real x = LoadReal(udg_CreepTable, cv, 1)
- Custom script: local real y = LoadReal(udg_CreepTable, cv, 2)
- Custom script: local real ang = LoadReal(udg_CreepTable, cv, 3)
- Wait 5.00 seconds
- Custom script: call RemoveUnit( u )
- Custom script: set u = CreateUnit(GetTriggerPlayer(),id,x,y,ang)
- Custom script: if lv > 1 then
- Custom script: call SetHeroLevel(u,lv,false)
- Custom script: endif
- Custom script: set u = null
-
Events