Hi everybody, i have a problem with next code:
creature->MonsterWhisper(“Test”, player->GetGUID(),false);
Error Message:
can not convert parameter 2 of ‘uint64’ to ‘const Player *’
review the documentation and everything seems fine.
Hi everybody, i have a problem with next code:
creature->MonsterWhisper(“Test”, player->GetGUID(),false);
Error Message:
can not convert parameter 2 of ‘uint64’ to ‘const Player *’
review the documentation and everything seems fine.
so, don’t send the GUID just send the player…
Code:
#include "ScriptPCH.h"
#include "GossipDef.h"
class NPC_TEST : public CreatureScript
{
public:
NPC_TEST() : CreatureScript("NPC_TEST"){}
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->IsInCombat())
{
creature->MonsterWhisper("Test", player->GetGUID(),false);
player->PlayerTalkClass->SendCloseGossip();
return true;
}
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Option 1", GOSSIP_SENDER_MAIN, 2);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "Bye...", GOSSIP_SENDER_MAIN, 3);
player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Actions)
{
player->PlayerTalkClass->ClearMenus();
if(Sender == GOSSIP_SENDER_MAIN)
{
switch(Actions)
{
case 1:
OnGossipHello(player,creature);
break;
case 2:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "Back", GOSSIP_SENDER_MAIN, 1);
player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
break;
case 3:
player->PlayerTalkClass->SendCloseGossip();
break;
}
}
return true;
}
};
void AddSC_NPC_TEST()
{
new NPC_TEST();
}
if (player->IsInCombat())
{
player->CLOSE_GOSSIP_MENU();
creature->MonsterWhisper("You are in combat. Come back later", player);
return true;
}