• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

tree respawn system

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
671
can someone make me a tree respawn system that when a hero is near it won't respawn, I just need it's aoe in checking a nearby hero and time configurations. and please can you make it as efficient as possible and works in 1.20+ patch.

+rep to those who help. too busy to look for one. xD
 
Rough jass, i dont have we available ritt nao.

JASS:
function Callback takes nothing returns nothing
  local timer T = CreateTimer()
  if DistanceBetweenPoints(GetDestructableLoc(YourDest), GetUnitLoc(GetEnumUnit())) != your distance then
  call ReviveTree(or whatever func name is) (YourDest)
else
  call StartTimer(T, false, 20.00, function Callback)
endif
endfunction

function TriggerActions takes nothing returns nothing
  call EnumUnitsInRange(GetDestructableLoc(TrigDest)), 300.0, function Callback)  
endfunction

function inittrig takes nothing returns nothing
  call TriggerRegisterDestructableDeath(Thistrig, any destryctblr?)
  call TriggerRegisterAction(Thistrig, function TriggerActions)

sorry for errors, and i cant test it.
 
Status
Not open for further replies.
Top