TeachersPet
Well-known member
- Joined
- Jul 27, 2005
- RedCents
- 71¢
Original idea is credited to Zippzipp, but he coded it so badly I couldn't stand it.
Uses: Ghetto Fade on Zek, refreshing Harm Touch, deleveling an enemy you have info to.
Command: /respawn
Uses: Ghetto Fade on Zek, refreshing Harm Touch, deleveling an enemy you have info to.
Command: /respawn
Rich (BB code):
/*
MQ2Respawn
By: TeachersPet
Based on MQ2SelfKill by Zippzipp because I can't stand how he coded it.
Usage: /respawn to die and then respawn on top of yourself
*/
#include "../MQ2Plugin.h"
#include <time.h>
PreSetup("MQ2Respawn");
bool bSuicide = false;
float oldGravity = 0;
time_t suicideTime;
VOID RespawnMe(PSPAWNINFO pChar, PCHAR szLine) {
suicideTime = time (NULL);
oldGravity = ((PZONEINFO)pZoneInfo)->ZoneGravity;
((PZONEINFO)pZoneInfo)->ZoneGravity = 9999;
bSuicide = true;
}
PLUGIN_API VOID InitializePlugin(VOID) {
AddCommand("/respawn", RespawnMe);
}
PLUGIN_API VOID ShutdownPlugin(VOID) {
RemoveCommand("/respawn");
}
PLUGIN_API VOID OnPulse(VOID){
if(bSuicide && (time (NULL)) >= (suicideTime + 1)) {
((PZONEINFO)pZoneInfo)->ZoneGravity = oldGravity;
DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_OptionsList listselect 2");
DoCommand(GetCharInfo()->pSpawn,"/squelch /notify RespawnWnd RW_SelectButton leftmouseup");
bSuicide = false;
}
}

