Skip to content

Instantly share code, notes, and snippets.

@callmephil
Last active December 9, 2016 18:46
Show Gist options
  • Save callmephil/e300320534a60d7f6a2a06964eff403f to your computer and use it in GitHub Desktop.
Save callmephil/e300320534a60d7f6a2a06964eff403f to your computer and use it in GitHub Desktop.
Ac-Web Script Request
class Custom_NPC : public CreatureScript
{
public:
Custom_NPC() : CreatureScript("Custom_NPC") { }
bool OnGossipHello(Player* player, Creature* creature)
{
player->ADD_GOSSIP_ITEM(1, "Nevermind", GOSSIP_SENDER_MAIN, 0);
player->ADD_GOSSIP_ITEM(1, "Thing you Want to do", GOSSIP_SENDER_MAIN, 1);
player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /* Sender*/, uint32 Action)
{
uint32 Item_Entry[16] =
{
// Priest // Add Extra
278, 279
};
player->PlayerTalkClass->ClearMenus();
switch (Action)
{
case 0:
player->CLOSE_GOSSIP_MENU();
break;
case 1:
for (uint32 i = 0; i < sizeof(Item_Entry) / sizeof(uint32); i++)
{
if (ItemSetEntry const* set = sItemSetStore.LookupEntry(Item_Entry[i]) &&
player->hasQuest(0))
player->CompleteQuest(0);
}
player->CLOSE_GOSSIP_MENU();
break;
}
return false;
}
};
void AddSC_Custom_NPC()
{
new Custom_NPC();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment