// =============================================================================== // DESCRIPTION: Abstract class for powerup spawning // CALLED BY: // PARAMS: // TYPE: // =============================================================================== // Init ========================================================================== @INIT if [__debug == 1] goto DEBUG goto SCRIPT // =============================================================================== // Debug ========================================================================= @DEBUG Echo #__debug_prefix#"Calling script _SVR_POWERUP" goto SCRIPT // =============================================================================== // Script ======================================================================== @SCRIPT if [__debug == 1] Echo #__debug_prefix#"Calling method _SVR_POWERUP::"#GetScriptParam(::)# goto #GetScriptParam(::)# goto EOF @GIVE Set _idx #GetScriptParam(idx)# Set _item #GetScriptParam(item)# Set _triggerindex #GetScriptParam(triggeridx)# Set _slot #GetScriptParam(slot)# Set _type #GetScriptParam(type)# Set _name #GetNameFromIndex(|#_triggerindex|#)#_#_item# Set _equip #StringEquals(|#_type|#,Equip)# TakeItem #_idx# #_slot# sleep 100 GiveItem #_idx# #_slot# #_item# RemoveEntity #_triggerindex# RemoveEntity #_name# StartEffectOnObject #_idx# /shared/effects/healed.effect goto EOF @CREATE_ALLY_RECALL Set _spawn #GetScriptParam(location)# Set _spawn "spawn_powerup"#_spawn# Set _trigger Item#__powerups# Set _item Item#__powerups#_Spell_CommanderHeal SpawnEntityAtEntity #_spawn# Trigger_Proximity name #_trigger# triggeronplayer 1 triggerradius 10 model /ui/models/error.mdf triggerenter "Set _idx #GetScriptParam(index)#; Set _triggeridx #GetScriptParam(triggerindex)#;ExecScript _SVR_POWERUP :: GIVE idx #_idx# item Spell_CommanderHeal type Equip slot #Spell_CommanderHeal_Slot# triggeridx #_triggeridx#" SpawnEntityAtEntity #_spawn# Prop_Dynamic name #_item# angles "0.0000 0.0000 91.1999" model /shared/models/chest/chest.mdf Set _x #GetPosX(|#_spawn|#)# Set _y #GetPosY(|#_spawn|#)# Set _z #GetPosZ(|#_spawn|#)# Set _z 15 SetPosition #GetIndexFromName(|#_trigger|#)# #_x# #_y# #_z# SetPosition #GetIndexFromName(|#_item|#)# #_x# #_y# #_z# SetToValidPosition #GetIndexFromName(|#_trigger|#)# SetToValidPosition #GetIndexFromName(|#_item|#)# StartEffectOnObject #GetIndexFromName(|#_item|#)# /shared/effects/soul_trail.effect Set __powerups [__powerups + 1] goto EOF @ACTIVATE_ALLY_RECALL echo "Summon team: "#GetScriptParam(team)#" idx: "#GetScriptParam(idx)# Set _tmp_team #GetScriptParam(team)# Set _tmp_idx #GetScriptParam(idx)# Set _tmp_clientnum #GetClientNumFromIndex(|#_tmp_idx|#)# echo "Real idx: "#GetIndexFromClientNum(|#_tmp_clientnum|#)# Sleep 200 TakeItem #_tmp_idx# 11 Set sommonteam_summoner #_tmp_idx# Set summonteam_team #_tmp_team# Set summonteam_count 0 CreateVar int summonteam_idx 0 CreateVar int summon_idx_max [__clients_max_idx + 50] goto ALLY_RECALL_LOOP goto EOF @ALLY_RECALL_ACCEPT Set _idx #GetScriptParam(index)# set _clientid #GetScriptParam(clientid)# Set _targetidx #GetScriptParam(targetidx)# set _summoner #GetClientNameFromClientNum(|GetClientNumFromIndex(|#_targetidx|#)|#)# StopEffectOnObject #_idx# SendMessage #_clientid# "^rACCEPTED^y summoning request of ^r"#_summoner#"^Y teleporting you now." sleep 100 ExecScript _SVR_PLAYER :: TELEPORT idx #_idx# targetidx #_targetidx# goto EOF @ALLY_RECALL_LOOP Set _tmp_index #GetIndexFromClientNum(|#summonteam_idx|#)# if [_tmp_index == 0] goto NEXT_ALLY_RECALL if [summonteam_count == __powerups_teamrecall_max_ally] goto EOF Set _team #GetTeam(|#_tmp_index|#)# if [_team != summonteam_team] goto NEXT_ALLY_RECALL if [_tmp_index == sommonteam_summoner] goto NEXT_ALLY_RECALL StartEffectOnObject #_tmp_index# /shared/effects/relocate.effect SendMessage #GetClientNumFromIndex(|#_tmp_index|#)# "^R"#GetClientNameFromClientNum(|GetClientNumFromIndex(|#sommonteam_summoner|#)|#)#"^Y Cast a ^RSUMMONTEAM ^Yon you. Press ^RE ^YTO SPAWN AT HIS LOCATION, YOU GOT ^R7 ^YSeconds" ClientExecScript #GetClientNumFromIndex(|#_tmp_index|#)# _CL_PLAYER :: REQUEST_ALLY_RECALL maxtimeout #__powerups_teamrecall_accept_timeout# idx #_tmp_index# target_idx #sommonteam_summoner# Set summonteam_count [summonteam_count + 1] @NEXT_ALLY_RECALL Set summonteam_idx [summonteam_idx + 1] if [summonteam_idx < summon_idx_max] "goto ALLY_RECALL_LOOP" goto EOF @EOF