#include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float' #endif //Defining MegaItem by volker class SCRIPT_DECL MegaItem : 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 MegaItem::GossipHello(Object* pObject, Player * Plr, bool AutoSend) { if(Plr->CombatStatus.IsInCombat()) { Plr->BroadcastMessage ("Du befindest dich in einem Kampf"); } if(!Plr->CombatStatus.IsInCombat()) { GossipMenu *Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 220000, Plr); Menu->AddItem(0, "Teleport Orte", 1); } }; void MegaItem::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code) { GossipMenu * Menu; switch(IntId) { case 1: // Teleport Orte { Plr->EventTeleport(1, 3469.43, 847.62, 6.36476); } break; } } void MegaItem::GossipEnd(Object * pObject, Player* Plr) { GossipScript::GossipEnd(pObject, Plr); } void SetupMegaItem(ScriptMgr * mgr) { GossipScript * gs = (GossipScript*) new MegaItem(); mgr->register_item_gossip_script(600004,gs); }