package ThreatHandlerConfig import initlater ThreatHandler import initlater UnitData import initlater BuffHandler /** Make this return the ThreatHandlerTU assigned to the specified unit. */ public function getThreatUnit(unit u) returns ThreatHandlerTU return u.xGetUnitData().threatHandlerTu /** Make this return the ThreatHandlerPU assigned to the specified unit. */ public function getPlayerUnit(unit u) returns ThreatHandlerPU return u.xGetUnitData().threatHandlerPu /** This function is executed when units are returning. It can be used to clean them up. */ public function onThreatUnitReturn(unit u) u.setHP(u.getState(UNIT_STATE_MAX_LIFE)) u.setMana(u.getState(UNIT_STATE_MAX_MANA)) u.getBuffList().destroyAllBuffs() // Maximum returning time after which ThreatUnits will get teleported back to camp: public constant int TIME_TO_PORT = 10 // The range a ThreatUnit can move away from the original camping position, before being ordered to return: public constant real RETURN_RANGE = 1200 // The range a ThreatUnits target can be away from the original camping position, before being ordered to return: public constant real ORDER_RETURN_RANGE = 4000 // The range between units considered being in the same camp. public constant real CAMP_RANGE = 400