Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- AYE
- Tommy
- */
- struct HonorGossip
- {
- uint32 menu_id;
- uint8 icon;
- std::string name;
- uint32 HK, titleID;
- };
- // {icon, "title name", honored_kills, titleID}
- HonorGossip Titles [] =
- {
- {1, 9, "Private", 1, 1 },
- {2, 9, "Corporal", 100, 2 },
- {3, 9, "Sergeant", 250, 3 },
- {4, 9, "Master Sergeant", 500, 4 },
- {5, 9, "Sergeant Major", 750, 5 },
- {6, 9, "Knight", 1000, 6 },
- {7, 9, "Knight-Lieutenant", 1500, 7 },
- {8, 9, "Knight-Captain", 2000, 8 },
- {9, 9, "Knight-Champion", 2500, 9 },
- {10, 9, "Lieutenant Commander", 3000, 10 },
- {11, 9, "Commander", 3500, 11 },
- {12, 9, "Marshal", 4000, 12 },
- {13, 9, "Field Marshal", 4500, 13 },
- {14, 9, "Grand Marshal", 5000, 14 },
- {15, 9, "Scout", 1, 15 },
- {16, 9, "Grunt", 100, 16 },
- {17, 9, "Sergeant", 250, 17 },
- {18, 9, "Senior Sergeant", 500, 18 },
- {19, 9, "First Sergeant", 750, 19 },
- {20, 9, "Stone Guard", 1000, 20 },
- {21, 9, "Blood Guard", 1500, 21 },
- {22, 9, "Legionnaire", 2000, 22 },
- {23, 9, "Centurion", 2500, 23 },
- {24, 9, "Champion", 3000, 24 },
- {25, 9, "Lieutenant General", 3500, 25 },
- {26, 9, "General", 4000, 26 },
- {27, 9, "Warlord", 4500, 27 },
- {28, 9, "High Warlord", 5000, 28 },
- };
- class npc_honor_gossip : public CreatureScript
- {
- public:
- npc_honor_gossip() : CreatureScript("npc_honor_gossip") { }
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->ADD_GOSSIP_ITEM(0, "|TInterface\\icons\\INV_Misc_QuestionMark:30|tHow does this npc work?|r", GOSSIP_SENDER_MAIN, 100);
- player->ADD_GOSSIP_ITEM(4, "|TInterface\\icons\\Achievement_PVP_H_15:30|tHonorable Kills Titles|r", GOSSIP_SENDER_MAIN, 101);
- player->ADD_GOSSIP_ITEM(7, "|TInterface\\icons\\Ability_Spy:30|tNevermind|r", GOSSIP_SENDER_MAIN, 102);
- player->SEND_GOSSIP_MENU(1, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /* sender */, uint32 actions)
- {
- player->PlayerTalkClass->ClearMenus();
- if (actions == 100)
- ChatHandler(player->GetSession()).SendSysMessage("|cffff6060[Information]:|r This npc show you 2 different options,Honorable Kills Titles costed on LifeTime Kills,Devium WoW Titles show you our own titles |cffff0000[Patch Required]|r,and costed on [Devium Title Token].");
- return false;
- }
- else if(actions == 101)
- {
- if (player->GetTeam() == ALLIANCE)
- for (int i = 0; i < 14; i++)
- player->ADD_GOSSIP_ITEM(Titles[i].icon, Titles[i].name.c_str(), GOSSIP_SENDER_MAIN, Titles[i].menu_id);
- else
- for (int i = 14; i < 28; i++)
- player->ADD_GOSSIP_ITEM(Titles[i].icon, Titles[i].name.c_str(), GOSSIP_SENDER_MAIN, Titles[i].menu_id);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "<- Back", GOSSIP_SENDER_MAIN, 999);
- player->SEND_GOSSIP_MENU(1, creature->GetGUID());
- }
- else if (actions == 102)
- player->CLOSE_GOSSIP_MENU();
- else if (actions == 999)
- {
- player->ADD_GOSSIP_ITEM(0, "|TInterface\\icons\\INV_Misc_QuestionMark:30|tHow does this npc work?|r", GOSSIP_SENDER_MAIN, 100);
- player->ADD_GOSSIP_ITEM(4, "|TInterface\\icons\\Achievement_PVP_H_15:30|tHonorable Kills Titles|r", GOSSIP_SENDER_MAIN, 101);
- player->ADD_GOSSIP_ITEM(7, "|TInterface\\icons\\Ability_Spy:30|tNevermind|r", GOSSIP_SENDER_MAIN, 102);
- player->SEND_GOSSIP_MENU(1, creature->GetGUID());
- }
- for (int i = 0; i < sizeof(Titles) / sizeof(uint32); i++)
- {
- if (actions == Titles[i].menu_id)
- {
- if (player->HasTitle(Titles[i].titleID))
- {
- player->GetSession()->SendNotification("You already have this title!");
- return false;
- }
- if (player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS) < Titles[i].HK)
- {
- player->GetSession()->SendNotification("You don't have enough kills!");
- return false;
- }
- if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(Titles[i].titleID))
- {
- player->SetTitle(titleEntry);
- player->CLOSE_GOSSIP_MENU();
- }
- }
- }
- return true;
- }
- };
- void AddSC_honor_gossip()
- {
- new npc_honor_gossip;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement