[HELP]SQL, C++ - Item Gossip
OK ... I made a gossip item ... really wanna know ? heres source :
Code:
class SCRIPT_DECL MasterGuildStone : 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 MasterGuildStone::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
Menu->AddItem(0, "Create Guild Stone", 1);
Menu->AddItem(0, "Take me to my Guild City", 2);
if(AutoSend)
Menu->SendTo(Plr);
}
void MasterGuildStone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 1:
{
Plr->GetItemInterface()->SafeAddItem(90003, INVENTORY_SLOT_NOT_SET, 23);
Plr->Gossip_Complete();
}break;
case 2:
{
if(Plr->GetItemInterface()->GetItemCount(2838) >= 1 && Plr->GetSession()->HasGMPermissions())
{
Plr->EventTeleport(0, -4816.450195, -984.530029, 464.709015);
}
Plr->Gossip_Complete();
}break;
}
}
void MasterGuildStone::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
Well ... I dont think my problem lies in the script ... it compiles perfectly ... but the item doesnt show a gossip menu ... what I'd like to know is what is the Flag for a Gossip item ... coz I think thats my problem : /
Can someone maby paste an SQL here for an item they use as a wishing stone or something ?
~Mizu~
Re: [HELP]SQL, C++ - Item Gossip
Quote:
Originally Posted by
Kira90
OK ... I made a gossip item ... really wanna know ? heres source :
Code:
class SCRIPT_DECL MasterGuildStone : 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 MasterGuildStone::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
Menu->AddItem(0, "Create Guild Stone", 1);
Menu->AddItem(0, "Take me to my Guild City", 2);
if(AutoSend)
Menu->SendTo(Plr);
}
void MasterGuildStone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 1:
{
Plr->GetItemInterface()->SafeAddItem(90003, INVENTORY_SLOT_NOT_SET, 23);
Plr->Gossip_Complete();
}break;
case 2:
{
if(Plr->GetItemInterface()->GetItemCount(2838) >= 1 && Plr->GetSession()->HasGMPermissions())
{
Plr->EventTeleport(0, -4816.450195, -984.530029, 464.709015);
}
Plr->Gossip_Complete();
}break;
}
}
void MasterGuildStone::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
Well ... I dont think my problem lies in the script ... it compiles perfectly ... but the item doesnt show a gossip menu ... what I'd like to know is what is the Flag for a Gossip item ... coz I think thats my problem : /
Can someone maby paste an SQL here for an item they use as a wishing stone or something ?
~Mizu~
um am i blind? but i dont think you have your item 90003 bound to the script, its in the additem to player, but the gossipt script doesnt know that item 90003 is bound to the script
Re: [HELP]SQL, C++ - Item Gossip
lol I just dint add that part ;) heres my complete script *SNIF* im not SUCH a noob XD - Just dint feel like adding irelavent stuff :p ...
Code:
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
//Start of Script
class SCRIPT_DECL MasterGuildStone : 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 MasterGuildStone::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
Menu->AddItem(0, "Create Guild Stone", 1);
Menu->AddItem(0, "Take me to my Guild City", 2);
if(AutoSend)
Menu->SendTo(Plr);
}
void MasterGuildStone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 1:
{
Plr->GetItemInterface()->SafeAddItem(90003, INVENTORY_SLOT_NOT_SET, 23);
Plr->Gossip_Complete();
}break;
case 2:
{
if(Plr->GetItemInterface()->GetItemCount(2838) >= 1 && Plr->GetSession()->HasGMPermissions())
{
Plr->EventTeleport(*CENSORED*);
}
Plr->Gossip_Complete();
}break;
}
}
void MasterGuildStone::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
class SCRIPT_DECL GuildStone : 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 GuildStone::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
{
GossipMenu *Menu;
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
//Menu->AddItem(0, "Create Guild Stone", 1);
Menu->AddItem(0, "Take me to my Guild City", 2);
if(AutoSend)
Menu->SendTo(Plr);
}
void GuildStone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch(IntId)
{
case 1:
{
//Plr->GetItemInterface()->SafeAddItem(90003, INVENTORY_SLOT_NOT_SET, 23);
Plr->Gossip_Complete();
}break;
case 2:
{
if(Plr->GetItemInterface()->GetItemCount(2838) >= 1 && Plr->GetSession()->HasGMPermissions())
{
Plr->EventTeleport(*CENSORED*);
}
Plr->Gossip_Complete();
}break;
}
}
void GuildStone::GossipEnd(Object * pObject, Player* Plr)
{
GossipScript::GossipEnd(pObject, Plr);
}
void SetupGossipItems(ScriptMgr * mgr)
{
GossipScript * mgs = (GossipScript*) new MasterGuildStone();
GossipScript * gs = (GossipScript*) new GuildStone();
mgr->register_item_gossip_script(90002, mgs);
mgr->register_item_gossip_script(90003, gs);
}
Im almost certain its my item causing the problems ... im good @ C++ but dont ask me 2 do SQL XD so could someone plz just show me their items sql plz ? I dunno what the items flags and properties should be XD
Re: [HELP]SQL, C++ - Item Gossip
Thanx :) It works :) Type 8 ^^ YeY!
Re: [HELP]SQL, C++ - Item Gossip