Warsong Gulch Death Fix
v 1.0
I have scripted WSG so that if you are in the WSG map, and you die, it teleports you and revives you back at your base.
Setup.cpp:
Code:
/*
Author: insanesk8123
Date: 2/17/08
Purpose: Revive players when they die in WSG
todo: Get players health to be full when they revive.
*/
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
void UnDeath(Player* Plr)
{
if (Plr->GetMapId() == 489)
{
if (Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
{
Plr->EventTeleport(489,927.775330,1433.976929,345.535797);
Plr->BroadcastMessage("[Warsong]|cffCC0000 Try not to die again.");
Plr->SetMovement(MOVE_UNROOT, 1); //horde
Plr->ResurrectPlayer();
Plr->CastSpell(Plr,23493,true); //Restoration spell because FullHPMP() isnt workin' here
}
else
{
Plr->EventTeleport(489,1526.425049,1481.340210,351.998962);
Plr->BroadcastMessage("[Silverwing]|cffCC0000 Try not to die again.");
Plr->SetMovement(MOVE_UNROOT, 1); //alliance
Plr->ResurrectPlayer();
Plr->CastSpell(Plr,23493,true); //Restoration spell because FullHPMP() isnt workin' here
}
}
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_DEATH, &UnDeath);
}
extern "C" SCRIPT_DECL uint32 _exp_get_version()
{
return MAKE_SCRIPT_VERSION(SCRIPTLIB_VERSION_MAJOR, SCRIPTLIB_VERSION_MINOR);
}
extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
#endif
Setup.h
Code:
void UnDeath(Player* Plr); //yep, thats all
DLL download (compiled with ascent 3.9): Filebeam - Free Fast File Hosting
Got recommendations? Don't be afraid to tell me.