Likes: 0
Results 1 to 2 of 2
Thread: [Patch] Multi Trainer
-
11-01-14, 11:35 PM #1
[Patch] Multi Trainer
Register to remove this adSince Rochet2 shared multi vendor patch, I tought I can make something similar such multi trainer :Ppatch link:https://docs.google.com/file/d/0B9MO...pITGFrU2M/edit
TRAINER_ID can be left blank and will use default npc's trainer list if has one.
For example I have a simple creature gossip script to test that:For example I have a simple creature gossip script to test that:Code:#include "ScriptPCH.h" class TestGossipNpc : public CreatureScript { public: TestGossipNpc() : CreatureScript("TestGossipNpc") { } bool OnGossipHello(Player* player, Creature* pCreature) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "trainer 1 [default]", GOSSIP_SENDER_MAIN, 1); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "trainer 2 [entry: 918]", GOSSIP_SENDER_MAIN, 2); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "trainer 3 [entry: 914]", GOSSIP_SENDER_MAIN, 3); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "trainer 4 [entry: 928]", GOSSIP_SENDER_MAIN, 4); player->PlayerTalkClass->SendGossipMenu(1, pCreature->GetGUID()); return true; } bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) { switch (uiAction) { case 1: player->GetSession()->SendTrainerList(creature->GetGUID()); // if using without trainer_id specified, then the npc has to containthis flag id UNIT_NPC_FLAG_TRAINER = 16, in this case we will use 17 since the npc needs flag id 1 for gossip and 16 to set the npc as a trainer break; case 2: player->GetSession()->SendTrainerList(creature->GetGUID(), 918); // rogue trainer list break; case 3: player->GetSession()->SendTrainerList(creature->GetGUID(), 914); // warrior trainer list break; case 4: player->GetSession()->SendTrainerList(creature->GetGUID(), 928); // paladin trainer list break; } return true; } }; void AddSC_TestGossipNpc() { new TestGossipNpc(); }
Credits : Alexewarr
› See More: [Patch] Multi Trainer
-
07-11-16, 09:51 AM #2
Register to remove this adhello bro, can you upload the File Patch? please.
thanks!