
Results 1 to 2 of 2
Threaded View
-
13-10-14, 04:23 PM #2Dr.CoreGuest
Respect =)
But here is a Fixxed Version =)
PHP Code:class honorable_kills_shop : public CreatureScript
{
public:
honorable_kills_shop() : CreatureScript("hk_kills_shop") { }
bool OnGossipHello(Player* player, Creature* creature)
{
player->ADD_GOSSIP_ITEM(4, "[500 Lifetime Kills are required in order to view my goods. Make sure you have it, or you won't be able to view nor purchase anything.]", GOSSIP_SENDER_MAIN, 1001); //first menu option - a note for what this creature is
player->ADD_GOSSIP_ITEM(4, "[500 Kills] Show me what you got!", GOSSIP_SENDER_MAIN, 1002); //second option, click to send to the vendor (if he has 500 Kills)
player->SEND_GOSSIP_MENU(1, creature->GetGUID()); // This sends the menu to the player
return true;
}
bool OnGossipSelect(Player* player, Creature* pCreature, uint32 /*uiSender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
///////////START ACTIONS//////////////////
case 1001:
player->CLOSE_GOSSIP_MENU();
break;
case 1002:
if (player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) >= 500)
{
player->GetSession()->SendListInventory(pCreature->GetGUID()), //send to the vendor himself. add items via .npc add item command
pCreature->Whisper("You have 500 kills or more, therefore you can view my goods.", LANG_UNIVERSAL, player, true); //if the player has 500 Kills, send this message when
}
else
{
pCreature->Whisper("You do not have 500 kills or more, therefore I cannot allow you to check my store. Sorry.", LANG_UNIVERSAL, player, true), player->CLOSE_GOSSIP_MENU(); //send this "error" message and close everything
}
break;
}
return true;
}
};
void AddSC_Honorable_Kills_Shop()
{
new honorable_kills_shop();
}