// SCRIPT HEADER ***************************************************************** // DESCRIPTION: Abstract class for teleporter // CALLED BY: Map trigger // PARAMS: i: index // TYPE: Server-Side, Client-Side // ************************************************************* SCRIPT HEADER END // * // * // SCRIPT INIT ******************************************************************* @INIT if [scr_debug == 1] goto DEBUG goto SCRIPT // *************************************************************** SCRIPT INIT END // * // * // SCRIPT DEBUG ****************************************************************** @DEBUG Echo #scr_debug_prefix#"Calling script _TELEPORT" goto SCRIPT // ************************************************************** SCRIPT DEBUG END // * // * // SCRIPT CODE ******************************************************************* @SCRIPT if [scr_debug == 1] Echo #scr_debug_prefix#"Calling method _TELEPORT::"#GetScriptParam(::)# goto #GetScriptParam(::)# goto EOF // *** // * Checks for a valid player entity and then returns to the previous method // * @param int i the player index // *** @CHECK_TYPE Set hvl_csector_ptype #GetType(|#GetScriptParam(i)|#)# if #StringEquals(|#hvl_csector_ptype|#,Pet_HumanWorker)# goto EOF if #StringEquals(|#hvl_csector_ptype|#,Pet_BeastWorker)# goto EOF if #StringEquals(|#hvl_csector_ptype|#,Pet_Imp)# goto EOF if #StringEquals(|#hvl_csector_ptype|#,Pet_Bearloth)# goto EOF if #StringEquals(|#hvl_csector_ptype|#,NPC_Critter)# goto EOF if #StringEquals(|#hvl_csector_ptype|#,Player_Engineer)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Marksman)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Savage)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Chaplain)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Legionnaire)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_BatteringRam)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Steambuchet)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Conjurer)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Shapeshifter)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Hunter)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Shaman)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Predator)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Behemoth)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Tempest)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Malphas)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Devourer)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Maliken)# goto #GetScriptParam(::)#_CTPASSED if #StringEquals(|#hvl_csector_ptype|#,Player_Revenant)# goto #GetScriptParam(::)#_CTPASSED goto EOF // *** // * Brings up a teleporter menu // * @param int i the player index // *** @ENTER // Check for valid unit type if #IsEntityActive(|#GetScriptParam(i)|#)# goto CHECK_TYPE goto EOF @ENTER_CTPASSED Set scr_tp_clid #GetClientNumFromIndex(|#GetScriptParam(i)|#)# Set scr_tp_uistat #scr_cl|#scr_tp_clid|#_duel# Set scr_tp_utstat #scr_cl|#scr_tp_uistat|#_duel# if [scr_tp_uistat > -1] goto ENTER_CHECKDUEL else goto ENTER_CHECKDUELPASSED goto EOF @ENTER_CHECKDUEL // Do not enable tp during a duel if [scr_tp_utstat == scr_tp_clid] goto ENTER_DUEL @ENTER_CHECKDUELPASSED // Show tp destination screen ClientExecScript #scr_tp_clid# _TELEPORT :: SELECT goto EOF @ENTER_DUEL Set scr_tpe_img "/npcs/chiprell/icon.tga" Set scr_tpe_h "Why u doing this?" Set scr_tpe_c "You cannot use the teleporter during a duel!" ClientExecScript #scr_tp_clid# _CL_PLAYER :: DUELPOP_INFO h #scr_tpe_h# c #scr_tpe_c# img #scr_tpe_img# goto EOF // *** // * Client-side destination menu // *** @SELECT AllowMouseAim false AllowMovement false MouseHidden true false MouseCentered true false UIcall tp_menu "SetVisible(true);" goto EOF // *** // * Teleports a player // * @param int i the player index // * @param int l the teleporter id // *** @RELOCATE Set scr_tp_exitname "tp"#GetScriptParam(l)#"_exit" StartEffectOnObject #GetScriptParam(i)# #scr_tp_startfx# Sleep 1000 SetPosition #GetScriptParam(i)# #GetPosX(|#scr_tp_exitname|#)# #GetPosY(|#scr_tp_exitname|#)# 0 SetToValidPosition #GetScriptParam(i)# StartEffectOnObject #GetScriptParam(i)# #scr_tp_endfx# goto EOF // *************************************************************** SCRIPT CODE END // * // * // SCRIPT EOF ******************************************************************** @EOF // *****************************************************************SCRIPT EOF END