Code:
/***********************************************************
* *
* *
* ****************************** *
* * * *
* * The FrostTeam Project * *
* * Snailz * *
* ****************************** *
* *
* *
* --FrostTeam SVN consists of the latest WotLK *
* scripts, both Lua and C++. Some will be our own, *
* some will be others with credits attatched. Our *
* Svn includes all scripts that you may need *
* to help make your server a more fun environment.-- *
* *
************************************************************/
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
class SCRIPT_DECL WotlkTele : public GossipScript
{
public:
void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
void GossipEnd(Object * pObject, Player* Plr);
void Destroy()
{
delete this;
}
};
void WotlkTele::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
if(Plr->IsPvPFlagged() && Plr->getLevel() <= 70)
{
Menu->AddItem(2, "You are either Flagged for PVP or are not higher than level 70.");
}else{
if(Plr->getRace()== 10||Plr->getRace()== 2||Plr->getRace()== 6||Plr->getRace()== 8||Plr->getRace()== 5)
{Menu->AddItem(0, "Horde Wotlk Cities", 1);}else{Menu->AddItem(1, "Alliance Wotlk Cities", 2);}
Menu->AddItem(2, "Wotlk Locations", 3);
Menu->AddItem(3, "Wotlk Instances", 4);
Menu->AddItem(8, "Buff me up, baby!", 5);
Menu->AddItem(9, "Remove Resurrection Sickness", 6);
}
if(AutoSend)
Menu->SendTo(Plr);
}
void WotlkTele::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
if(pCreature==NULL)
return;
GossipMenu * Menu;
switch(IntId)
{
case 0:
GossipHello(pObject, Plr, true);
break;
case 1: // Horde Wotlk Cities
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Still To Come", 9000);
Menu->SendTo(Plr);
}
break;
case 2: // Alliance Wotlk Cities
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Still To Come", 9000);
Menu->SendTo(Plr);
}
break;
case 3: // Wotlk Locations
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Howling Fjord", 20);
Menu->AddItem(5, "Ebon Hold", 21);
Menu->AddItem(5, "Dragonblight", 22);
Menu->AddItem(5, "Dalaran", 23);
Menu->AddItem(5, "Grizzly Hills", 24);
Menu->AddItem(5, "Zul'Drak", 25);
Menu->AddItem(5, "Storm Peaks [Highly Recommend F-Mount]", 26);
Menu->AddItem(5, "Crystalsong", 27);
Menu->AddItem(5, "Icecrown", 28);
Menu->AddItem(5, "WIntergrasp", 29);
Menu->AddItem(5, "Sholazar Basin", 30);
Menu->AddItem(5, "Borean Tundra", 31);
Menu->SendTo(Plr);
}
break;
case 4: //Wotlk Instances
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
Menu->AddItem(5, "Still to come", 9000);
Menu->SendTo(Plr);
}
break;
case 20://Howling Fjord
{
Plr->EventTeleport(571, 592, -5095, 6);
}
break;
case 21://Ebon Hold
{
Plr->EventTeleport(609, 0, 0, 0);
}
break;
case 22://DragonBlight
{
Plr->EventTeleport(571, 3577.16, 656.005, 76.5898);
}
break;
case 23://Dalaran
{
Plr->EventTeleport(571, 5797.17, 639.257, 647.505);
}
break;
case 24://Grizzly Hills
{
Plr->EventTeleport(571, 3475.56, -4357.48, 230.87);
}
break;
case 25://Zul'Drak
{
Plr->EventTeleport(571, 5249.10, -4034.64, 371.99);
}
break;
case 26://Storm Peaks
{
Plr->EventTeleport(571, 6123.95, -987.35, 403.49);
}
break;
case 27://Crystalsong
{
Plr->EventTeleport(571, 5703.00, -199.67, 4184.12);
}
break;
case 28://Icecrown
{
Plr->EventTeleport(571, 7294.33, 2728.08, 396.78);
}
break;
case 29://Wintergrasp
{
Plr->EventTeleport(571, 4478.33, 2828.92, 395.37m);
}
break;
case 30://Shol. Basin
{
Plr->EventTeleport(571, 4727.07, 556917.17, 7.36);
}
break;
case 31://Bo. Tundra
{
Plr->EventTeleport(571, 3354.95, 5453.45, 59.13);
}
break;
case 5: // Buff me up!
{
if(Plr->getLevel() >= 70)
{
pCreature->CastSpell(Plr, 15366, 0);
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "By all that is wrong in this world, I bless you." );
Plr->Gossip_Complete();
}else{
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You need to be at least level 70 in order to recieve my buff." );
Plr->Gossip_Complete();}
}
break;
case 6: // Rez Sickness
{
Plr->addSpell(15007);
Plr->removeSpell(15007,0,0,0);
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You have been cured of that dreaded sickness." );
Plr->Gossip_Complete();
}
break;
case 9000: //Ye Ol' Still to come
{
}
break;
}
}
void WotlkTele::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupWotlkTele(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new WotlkTele();
mgr->register_gossip_script(112230, gs);
}