//This Script is written by WHOS and TRONYC
//Credits go to Original Authors of the following:
//MounterNPC.CPP - ODIN//Scarface
//Mounter.CPP - ACDB SVN
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
#define Mounter_Item_ID 62019
#define Mounter_Text_ID 2593
class SCRIPT_DECL MounterItem : 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){ GossipScript::GossipEnd(pObject, Plr); }
void Destroy(){ delete this; }
};
void MounterItem::GossipHello(Object* pObject, Player * Plr, bool AutoSend){
bool flytf = false;
uint32 eventid = 5;
WorldPacket fly(SMSG_MOVE_SET_UNFLY, 13);
Plr->m_setflycheat = flytf;
fly << Plr->GetNewGUID();
fly << uint32(eventid);
Plr->SendMessageToSet(&fly, true);
Plr->SetPlayerSpeed(RUN,

;
Plr->SetPlayerSpeed(SWIM, 6);
Plr->SetPlayerSpeed(RUNBACK, 4);
Plr->SetPlayerSpeed(FLY, 12);
Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
Plr->Gossip_Complete();
if(Plr->CombatStatus.IsInCombat()){
Plr->BroadcastMessage("You are in combat!");
}else{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), Mounter_Text_ID, Plr);
Menu->AddItem(0, "Mount Nether Drake", 1);
Menu->AddItem(0, "Mount Armored Nether Drake", 2);
Menu->AddItem(2, "Nevermind", 3);
if(AutoSend) Menu->SendTo(Plr);
}
};
void MounterItem::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code){
switch(IntId){
case 1:{
if(Plr->getLevel() >= 50){
bool flytf = true;
uint32 eventid = 2;
uint32 displayid = 17772;
WorldPacket fly(SMSG_MOVE_SET_FLY, 13);
Plr->m_setflycheat = true;
fly << Plr->GetNewGUID();
fly << uint32(eventid);
Plr->SendMessageToSet(&fly, true);
Plr->SetPlayerSpeed(RUN, 10);
Plr->SetPlayerSpeed(SWIM, 10);
Plr->SetPlayerSpeed(RUNBACK, 10);
Plr->SetPlayerSpeed(FLY, 20);
Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayid);
Plr->Gossip_Complete();
}else {
Plr->BroadcastMessage("You Must be level 50 to use this mount!");
}break;
}
case 2:{
if(Plr->getLevel() >= 100){
bool flytf = true;
uint32 eventid = 2;
uint32 displayid = 20809;
WorldPacket fly(SMSG_MOVE_SET_FLY, 13);
Plr->m_setflycheat = true;
fly << Plr->GetNewGUID();
fly << uint32(eventid);
Plr->SendMessageToSet(&fly, true);
Plr->SetPlayerSpeed(RUN, 15);
Plr->SetPlayerSpeed(SWIM, 10);
Plr->SetPlayerSpeed(RUNBACK, 10);
Plr->SetPlayerSpeed(FLY, 30);
Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayid);
Plr->Gossip_Complete();
}else {
Plr->BroadcastMessage("You Must be level 100 to use this mount!");
}break;
}
case 3:{
Plr->Gossip_Complete();
}
}
}
void SetupMounterItem(ScriptMgr *mgr){
GossipScript * gs = (GossipScript*) new MounterItem();
mgr->register_item_gossip_script(Mounter_Item_ID, gs);
}