Code:
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
#define STONEID 90020
class SCRIPT_DECL OwlStone : 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 OwlStone::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
{
if(Plr->CombatStatus.IsInCombat())
{
Plr->BroadcastMessage("You are in combat!");
return;
}
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
{
Menu->AddItem(5,"Shattrath Mall", 1);
Menu->AddItem(0,"PvP Areas", 2);
Menu->AddItem(0,"Battlefront Areas", 3);
Menu->AddItem(5,"Advance all Wep Skills", 4);
Menu->AddItem(5,"Save Character", 5);
Menu->AddItem(5,"Reset Talents", 6);
Menu->AddItem(5,"Remove Ress Sickness", 7);
if(AutoSend)
Menu->SendTo(Plr);
}}
void OwlStone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 0:
GossipHello(pObject, Plr, true);
break;
case 1:
{
Plr->EventTeleport(530, -1851.617188, 5466.460938, 12.428118);
}
break;
case 2:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
Menu->AddItem(5,"Nagrand PvP Arena", 10);
Menu->AddItem(5,"Blade's Edge Arena", 11);
Menu->AddItem(5,"Gurubashi Arena", 12);
Menu->SendTo(Plr);
}
break;
case 3:
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
Menu->AddItem(5,"Horde Battlefront Area", 15);
Menu->AddItem(5,"Battlefront Mid-Field Area", 16);
Menu->AddItem(5,"Alliance Battlefront Area", 17);
Menu->SendTo(Plr);
}
break;
case 4:
{
if (Plr->_HasSkillLine(43))
{Plr->_AdvanceSkillLine(43, 350);}
if (Plr->_HasSkillLine(55))
{Plr->_AdvanceSkillLine(55, 350);}
if (Plr->_HasSkillLine(44))
{Plr->_AdvanceSkillLine(44, 350);}
if (Plr->_HasSkillLine(95))
{Plr->_AdvanceSkillLine(95, 350);}
if (Plr->_HasSkillLine(54))
{Plr->_AdvanceSkillLine(54, 350);}
if (Plr->_HasSkillLine(45))
{Plr->_AdvanceSkillLine(45, 350);}
if (Plr->_HasSkillLine(46))
{Plr->_AdvanceSkillLine(46, 350);}
if (Plr->_HasSkillLine(136))
{Plr->_AdvanceSkillLine(136, 350);}
if (Plr->_HasSkillLine(160))
{Plr->_AdvanceSkillLine(160, 350);}
if (Plr->_HasSkillLine(162))
{Plr->_AdvanceSkillLine(162, 350);}
if (Plr->_HasSkillLine(172))
{Plr->_AdvanceSkillLine(172, 350);}
if (Plr->_HasSkillLine(173))
{Plr->_AdvanceSkillLine(173, 350);}
if (Plr->_HasSkillLine(176))
{Plr->_AdvanceSkillLine(176, 350);}
if (Plr->_HasSkillLine(226))
{Plr->_AdvanceSkillLine(226, 350);}
if (Plr->_HasSkillLine(228))
{Plr->_AdvanceSkillLine(228, 350);}
if (Plr->_HasSkillLine(229))
{Plr->_AdvanceSkillLine(229, 350);}
if (Plr->_HasSkillLine(473))
{Plr->_AdvanceSkillLine(473, 350);}
Plr->Gossip_Complete();
}
break;
case 5:
{
Plr->SaveToDB(true);
Plr->BroadcastMessage("Your Character Has Been Succesfully Saved to the Database");
Plr->Emote(EMOTE_ONESHOT_CHEER);
Plr->Gossip_Complete();
}
break;
case 6:
{
Plr->BroadcastMessage("Your Talentpoints have been sucessfully reset!");
Plr->Reset_Talents();
Plr->Gossip_Complete();
}
break;
case 7:
{
Plr->addSpell(15007);
Plr->removeSpell(15007,0,0,0);
Plr->BroadcastMessage("You have been cured of that dreaded sickness!" );
Plr->Gossip_Complete();
}
break;
case 10:
{
Plr->EventTeleport(530, -2046.101807, 6657.619141, 13.053440);
}break;
case 11:
{
Plr->EventTeleport(530, 2838.986572, 5928.729004, 11.064964);
}
break;
case 12:
{
Plr->EventTeleport(0, -13228.034180, 229.909576, 33.117268);
}
break;
case 15:
{
Plr->EventTeleport(0, -8282.810547, -3328.542236, 170.881210);
}
break;
case 16:
{
Plr->EventTeleport(0, -7886.782227, -3345.649902, 171.201370);
}
break;
case 17:
{
Plr->EventTeleport(0, -7569.903809, -3434.363770, 170.881958);
}
break;
}
}
void OwlStone::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupOwlStone(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new OwlStone();
mgr->register_item_gossip_script(STONEID,gs);
}