diff --git a/Npcmorph.cpp b/Npcmorph.cpp new file mode 100644 index 0000000..94a5130 --- /dev/null +++ b/Npcmorph.cpp @@ -0,0 +1,144 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +class Morph_npc : public CreatureScript +{ +public: + Morph_npc() : CreatureScript("Morph_npc") { } + + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->isInCombat()) + { + player->GetSession()->SendNotification("Estas en Combate!"); + player->CLOSE_GOSSIP_MENU(); + return false; + } + + player->ADD_GOSSIP_ITEM(6, "Broken", GOSSIP_SENDER_MAIN, 1); + player->ADD_GOSSIP_ITEM(6, "Fel Orc", GOSSIP_SENDER_MAIN, 2); + player->ADD_GOSSIP_ITEM(6, "Goblin", GOSSIP_SENDER_MAIN, 3); + player->ADD_GOSSIP_ITEM(6, "Pandaren", GOSSIP_SENDER_MAIN, 4); + player->ADD_GOSSIP_ITEM(6, "Worgen", GOSSIP_SENDER_MAIN, 5); + player->ADD_GOSSIP_ITEM(6, "Worgen 1", GOSSIP_SENDER_MAIN, 6); + player->ADD_GOSSIP_ITEM(6, "Velen The Prophet", GOSSIP_SENDER_MAIN, 7); + player->ADD_GOSSIP_ITEM(6, "Illidan", GOSSIP_SENDER_MAIN, 8); + player->ADD_GOSSIP_ITEM(6, "Exanime", GOSSIP_SENDER_MAIN, 9); + player->ADD_GOSSIP_ITEM(6, "Felguar", GOSSIP_SENDER_MAIN, 10); + player->ADD_GOSSIP_ITEM(6, "Elemental de Sangre", GOSSIP_SENDER_MAIN, 11); + player->ADD_GOSSIP_ITEM(6, "Tigerman", GOSSIP_SENDER_MAIN, 12); + player->ADD_GOSSIP_ITEM(6, "Babosa de Cloaca", GOSSIP_SENDER_MAIN, 13); + player->ADD_GOSSIP_ITEM(6, "Sucubo", GOSSIP_SENDER_MAIN, 14); + player->ADD_GOSSIP_ITEM(6, "Necrofago", GOSSIP_SENDER_MAIN, 15); + player->ADD_GOSSIP_ITEM(6, "Fantasma", GOSSIP_SENDER_MAIN, 16); + player->ADD_GOSSIP_ITEM(6, "Fantasma 1", GOSSIP_SENDER_MAIN, 17); + player->ADD_GOSSIP_ITEM(6, "Eliminar Transformacion", GOSSIP_SENDER_MAIN, 18); + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 action) + { + + switch (action) + { + case 1: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(21105); + break; + case 2: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(21267); + break; + case 3: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(20582); + break; + case 4: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(30414); + break; + case 5: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(26788); + break; + case 6: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(657); + break; + case 7: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(17822); + break; + case 8: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(21137); + break; + case 9: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(24191); + break; + case 10: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(5048); + break; + case 11: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(20030); + break; + case 12: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(15214); + break; + case 13: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(12349); + break; + case 14: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(4162); + break; + case 15: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(414); + break; + case 16: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(16162); + break; + case 17: + player->CLOSE_GOSSIP_MENU(); + player->SetDisplayId(16168); + break; + case 18: + player->CLOSE_GOSSIP_MENU(); + player->DeMorph(); + break; + } + return true; + } +}; + +void AddSC_Morph_npc() +{ + new Morph_npc(); +} \ No newline at end of file diff --git a/README.md b/README.md index 0b5f9e6..3175ec8 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,12 @@ -# TrinityCore-335a -TrinityCore Release 335a +# TrinityCore-434 +TrinityCore Release 434 -FixCore es una empresa de desarrollo con especialidad en el juego world of warcraft. -@FixStore - @FixDevs - @FixCMS son propiedad de @FixCore. +FixCore es una empresa de desarrollo con especialidad en el juego world of warcraft. @FixStore - @FixDevs - @FixCMS son propiedad de @FixCore. -El 80% de los trabajos que realiza @FixCore y sus demás subempresas son de manera gratuita sin embargo el 20% de los demás trabajos suelen ser de cobro debido a que se pudo haber requerido de algún pago extra para algún template, linea etc.. -No acepte cosas de cobro que estén a nombre de @FixCore sin que usted esté seguro de que sea de manera legal -** En caso de tener dudas, inquietudes o desea contactarnos puede enviarnos un E-Mail ** develop.km14@gmail.com +El 80% de los trabajos que realiza @FixCore y sus demás subempresas son de manera gratuita sin embargo el 20% de los demás trabajos suelen ser de cobro debido a que se pudo haber requerido de algún pago extra para algún template, linea etc.. No acepte cosas de cobro que estén a nombre de @FixCore sin que usted esté seguro de que sea de manera legal ** En caso de tener dudas, inquietudes o desea contactarnos puede enviarnos un E-Mail ** fixcore2@gmail.com ---------- +--- -FixCore is a development company specializing in the game world of warcraft. -@FixStore - @FixDevs - @FixCMS Are owned by @FixCore. +FixCore is a development company specializing in the game world of warcraft. @FixStore - @FixDevs - @FixCMS Are owned by @FixCore. -80% of the work done @FixCore and other sub-companies are free however 20% of other jobs usually collection because it could have required some extra payment for a template, line etc .. -Do not accept things that are a collection @FixCore name without you sure it legally -** If you have questions, concerns or want to contact you can send an E-Mail ** develop.km14@gmail.com +80% of the work done @FixCore and other sub-companies are free however 20% of other jobs usually collection because it could have required some extra payment for a template, line etc .. Do not accept things that are a collection @FixCore name without you sure it legally ** If you have questions, concerns or want to contact you can send an E-Mail ** fixcore2@gmail.com diff --git a/Trainer.cpp b/Trainer.cpp new file mode 100644 index 0000000..659b122 --- /dev/null +++ b/Trainer.cpp @@ -0,0 +1,751 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ + +#include "ScriptPCH.h" + +class npc_trainer : public CreatureScript +{ +public: + npc_trainer() : CreatureScript("npc_trainer") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface/ICONS/Spell_Arcane_StudentOfMagic:30|t Aprender Spells!", GOSSIP_SENDER_MAIN, 1); + player->SEND_GOSSIP_MENU(80001, creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + + if (sender == GOSSIP_SENDER_MAIN) + { + switch (action) + { + case 1: // Train Me. + player->CastSpell(player, 63680, true, NULL, NULL, player->GetGUID()); + player->CastSpell(player, 63624, true, NULL, NULL, player->GetGUID()); + + switch (player->getClass()) + { + case CLASS_WARRIOR: + player->learnSpell(7384, false); + player->learnSpell(47436, false); + player->learnSpell(47450, false); + player->learnSpell(11578, false); + player->learnSpell(47465, false); + player->learnSpell(47502, false); + player->learnSpell(34428, false); + player->learnSpell(1715, false); + player->learnSpell(2687, false); + player->learnSpell(71, false); + player->learnSpell(7386, false); + player->learnSpell(355, false); + player->learnSpell(72, false); + player->learnSpell(47437, false); + player->learnSpell(57823, false); + player->learnSpell(694, false); + player->learnSpell(2565, false); + player->learnSpell(676, false); + player->learnSpell(47520, false); + player->learnSpell(20230, false); + player->learnSpell(12678, false); + player->learnSpell(47471, false); + player->learnSpell(1161, false); + player->learnSpell(871, false); + player->learnSpell(2458, false); + player->learnSpell(20252, false); + player->learnSpell(47475, false); + player->learnSpell(18499, false); + player->learnSpell(1680, false); + player->learnSpell(6552, false); + player->learnSpell(47488, false); + player->learnSpell(1719, false); + player->learnSpell(23920, false); + player->learnSpell(47440, false); + player->learnSpell(3411, false); + player->learnSpell(64382, false); + player->learnSpell(55694, false); + player->learnSpell(57755, false); + player->learnSpell(42459, false); + player->learnSpell(750, false); + player->learnSpell(5246, false); + player->learnSpell(3127, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(12294)) + player->learnSpell(47486, false); + if (player->HasSpell(20243)) + player->learnSpell(47498, false); + player->SaveToDB(); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_PALADIN: + player->learnSpell(3127, false); + player->learnSpell(19746, false); + player->learnSpell(19752, false); + player->learnSpell(750, false); + player->learnSpell(48942, false); + player->learnSpell(48782, false); + player->learnSpell(48932, false); + player->learnSpell(20271, false); + player->learnSpell(498, false); + player->learnSpell(10308, false); + player->learnSpell(1152, false); + player->learnSpell(10278, false); + player->learnSpell(48788, false); + player->learnSpell(53408, false); + player->learnSpell(48950, false); + player->learnSpell(48936, false); + player->learnSpell(31789, false); + player->learnSpell(62124, false); + player->learnSpell(54043, false); + player->learnSpell(25780, false); + player->learnSpell(1044, false); + player->learnSpell(20217, false); + player->learnSpell(48819, false); + player->learnSpell(48801, false); + player->learnSpell(48785, false); + player->learnSpell(5502, false); + player->learnSpell(20164, false); + player->learnSpell(10326, false); + player->learnSpell(1038, false); + player->learnSpell(53407, false); + player->learnSpell(48943, false); + player->learnSpell(20165, false); + player->learnSpell(48945, false); + player->learnSpell(642, false); + player->learnSpell(48947, false); + player->learnSpell(20166, false); + player->learnSpell(4987, false); + player->learnSpell(48806, false); + player->learnSpell(6940, false); + player->learnSpell(48817, false); + player->learnSpell(48934, false); + player->learnSpell(48938, false); + player->learnSpell(25898, false); + player->learnSpell(32223, false); + player->learnSpell(31884, false); + player->learnSpell(54428, false); + player->learnSpell(61411, false); + player->learnSpell(53601, false); + player->learnSpell(33388, false); + player->learnSpell(33391, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(20925)) + player->learnSpell(48952, false); + if (player->HasSpell(31935)) + player->learnSpell(48827, false); + if (player->HasSpell(20911)) + player->learnSpell(25899, false); + if (player->HasSpell(20473)) + player->learnSpell(48825, false); + if (player->GetTeam() == ALLIANCE) + { + player->learnSpell(31801, false); + player->learnSpell(13819, false); + player->learnSpell(23214, false); + } + if (player->GetTeam() == HORDE) + { + player->learnSpell(53736, false); + player->learnSpell(34769, false); + player->learnSpell(34767, false); + } + player->SaveToDB(); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_HUNTER: + player->learnSpell(3043, false); + player->learnSpell(3127, false); + player->learnSpell(3045, false); + player->learnSpell(3034, false); + player->learnSpell(8737, false); + player->learnSpell(1494, false); + player->learnSpell(13163, false); + player->learnSpell(48996, false); + player->learnSpell(49001, false); + player->learnSpell(49045, false); + player->learnSpell(53338, false); + player->learnSpell(5116, false); + player->learnSpell(27044, false); + player->learnSpell(883, false); + player->learnSpell(2641, false); + player->learnSpell(6991, false); + player->learnSpell(982, false); + player->learnSpell(1515, false); + player->learnSpell(19883, false); + player->learnSpell(20736, false); + player->learnSpell(48990, false); + player->learnSpell(2974, false); + player->learnSpell(6197, false); + player->learnSpell(1002, false); + player->learnSpell(14327, false); + player->learnSpell(5118, false); + player->learnSpell(49056, false); + player->learnSpell(53339, false); + player->learnSpell(49048, false); + player->learnSpell(19884, false); + player->learnSpell(34074, false); + player->learnSpell(781, false); + player->learnSpell(14311, false); + player->learnSpell(1462, false); + player->learnSpell(19885, false); + player->learnSpell(19880, false); + player->learnSpell(13809, false); + player->learnSpell(13161, false); + player->learnSpell(5384, false); + player->learnSpell(1543, false); + player->learnSpell(19878, false); + player->learnSpell(49067, false); + player->learnSpell(3034, false); + player->learnSpell(13159, false); + player->learnSpell(19882, false); + player->learnSpell(58434, false); + player->learnSpell(49071, false); + player->learnSpell(49052, false); + player->learnSpell(19879, false); + player->learnSpell(19263, false); + player->learnSpell(19801, false); + player->learnSpell(34026, false); + player->learnSpell(34600, false); + player->learnSpell(34477, false); + player->learnSpell(61006, false); + player->learnSpell(61847, false); + player->learnSpell(53271, false); + player->learnSpell(60192, false); + player->learnSpell(62757, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(19386)) + player->learnSpell(49012, false); + if (player->HasSpell(53301)) + player->learnSpell(60053, false); + if (player->HasSpell(19306)) + player->learnSpell(48999, false); + if (player->HasSpell(19434)) + player->learnSpell(49050, false); + player->SaveToDB(); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_MAGE: + player->learnSpell(42921, false); + player->learnSpell(42842, false); + player->learnSpell(42995, false); + player->learnSpell(42833, false); + player->learnSpell(27090, false); + player->learnSpell(33717, false); + player->learnSpell(42873, false); + player->learnSpell(42846, false); + player->learnSpell(12826, false); + player->learnSpell(28271, false); + player->learnSpell(61780, false); + player->learnSpell(61721, false); + player->learnSpell(28272, false); + player->learnSpell(42917, false); + player->learnSpell(43015, false); + player->learnSpell(130, false); + player->learnSpell(42926, false); + player->learnSpell(43017, false); + player->learnSpell(475, false); + player->learnSpell(1953, false); + player->learnSpell(42940, false); + player->learnSpell(12051, false); + player->learnSpell(43010, false); + player->learnSpell(43020, false); + player->learnSpell(43012, false); + player->learnSpell(42859, false); + player->learnSpell(2139, false); + player->learnSpell(42931, false); + player->learnSpell(42985, false); + player->learnSpell(43008, false); + player->learnSpell(45438, false); + player->learnSpell(43024, false); + player->learnSpell(43002, false); + player->learnSpell(43046, false); + player->learnSpell(42897, false); + player->learnSpell(42914, false); + player->learnSpell(66, false); + player->learnSpell(58659, false); + player->learnSpell(30449, false); + player->learnSpell(42956, false); + player->learnSpell(47610, false); + player->learnSpell(61316, false); + player->learnSpell(61024, false); + player->learnSpell(55342, false); + player->learnSpell(53142, false); + player->learnSpell(7301, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->GetTeam() == ALLIANCE) + { + player->learnSpell(32271, false); // Teleport: Exodar. + player->learnSpell(49359, false); // Teleport: Theramore. + player->learnSpell(3565, false); // Teleport: Darnassus. + player->learnSpell(33690, false); // Teleport: Shattrath. + player->learnSpell(3562, false); // Teleport: Ironforge. + player->learnSpell(3561, false); // Teleport: Stormwind. + player->learnSpell(53140, false); // Teleport: Dalaran. + player->learnSpell(53142, false); // Portal: Dalaran. + player->learnSpell(10059, false); // Portal: Stormwind. + player->learnSpell(11419, false); // Portal: Darnassus. + player->learnSpell(32266, false); // Portal: Exodar. + player->learnSpell(11416, false); // Portal: Ironforge. + player->learnSpell(33691, false); // Portal: Shattrath. + player->learnSpell(49360, false); // Portal: Theramore. + } + if (player->GetTeam() == HORDE) + { + player->learnSpell(3567, false); // Teleport: Orgrimmar. + player->learnSpell(35715, false); // Teleport: Shattrath. + player->learnSpell(3566, false); // Teleport: Thunder Bluff. + player->learnSpell(49358, false); // Teleport: Stonard. + player->learnSpell(32272, false); // Teleport: Silvermoon. + player->learnSpell(3563, false); // Teleport: Undercity. + player->learnSpell(53140, false); // Teleport: Dalaran. + player->learnSpell(53142, false); // Portal: Dalaran. + player->learnSpell(11417, false); // Portal: Orgrimmar. + player->learnSpell(35717, false); // Portal: Shattrath. + player->learnSpell(32267, false); // Portal: Silvermoon. + player->learnSpell(49361, false); // Portal: Stonard. + player->learnSpell(11420, false); // Portal: Thunder Bluff. + player->learnSpell(11418, false); // Portal: Undercity. + } + if (player->HasSpell(11366)) + player->learnSpell(42891, false); + if (player->HasSpell(11426)) + player->learnSpell(43039, false); + if (player->HasSpell(44457)) + player->learnSpell(55360, false); + if (player->HasSpell(31661)) + player->learnSpell(42950, false); + if (player->HasSpell(11113)) + player->learnSpell(42945, false); + if (player->HasSpell(44425)) + player->learnSpell(44781, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_WARLOCK: + player->learnSpell(696, false); + player->learnSpell(47811, false); + player->learnSpell(47809, false); + player->learnSpell(688, false); + player->learnSpell(47813, false); + player->learnSpell(50511, false); + player->learnSpell(57946, false); + player->learnSpell(47864, false); + player->learnSpell(6215, false); + player->learnSpell(47878, false); + player->learnSpell(47855, false); + player->learnSpell(697, false); + player->learnSpell(47856, false); + player->learnSpell(47857, false); + player->learnSpell(5697, false); + player->learnSpell(47884, false); + player->learnSpell(47815, false); + player->learnSpell(47889, false); + player->learnSpell(47820, false); + player->learnSpell(698, false); + player->learnSpell(712, false); + player->learnSpell(126, false); + player->learnSpell(5138, false); + player->learnSpell(5500, false); + player->learnSpell(11719, false); + player->learnSpell(132, false); + player->learnSpell(60220, false); + player->learnSpell(18647, false); + player->learnSpell(61191, false); + player->learnSpell(47823, false); + player->learnSpell(691, false); + player->learnSpell(47865, false); + player->learnSpell(47891, false); + player->learnSpell(47888, false); + player->learnSpell(17928, false); + player->learnSpell(47860, false); + player->learnSpell(47825, false); + player->learnSpell(1122, false); + player->learnSpell(47867, false); + player->learnSpell(18540, false); + player->learnSpell(47893, false); + player->learnSpell(47838, false); + player->learnSpell(29858, false); + player->learnSpell(58887, false); + player->learnSpell(47836, false); + player->learnSpell(61290, false); + player->learnSpell(48018, false); + player->learnSpell(48020, false); + player->learnSpell(33388, false); + player->learnSpell(33391, false); + player->learnSpell(23161, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(17877)) + player->learnSpell(47827, false); + if (player->HasSpell(30283)) + player->learnSpell(47847, false); + if (player->HasSpell(30108)) + player->learnSpell(47843, false); + if (player->HasSpell(50796)) + player->learnSpell(59172, false); + if (player->HasSpell(48181)) + player->learnSpell(59164, false); + if (player->HasSpell(18220)) + player->learnSpell(59092, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_ROGUE: + player->learnSpell(3127, false); + player->learnSpell(42459, false); + player->learnSpell(48668, false); + player->learnSpell(48638, false); + player->learnSpell(1784, false); + player->learnSpell(48657, false); + player->learnSpell(921, false); + player->learnSpell(1776, false); + player->learnSpell(26669, false); + player->learnSpell(51724, false); + player->learnSpell(6774, false); + player->learnSpell(11305, false); + player->learnSpell(1766, false); + player->learnSpell(48676, false); + player->learnSpell(48659, false); + player->learnSpell(1804, false); + player->learnSpell(8647, false); + player->learnSpell(48691, false); + player->learnSpell(51722, false); + player->learnSpell(48672, false); + player->learnSpell(1725, false); + player->learnSpell(26889, false); + player->learnSpell(2836, false); + player->learnSpell(1833, false); + player->learnSpell(1842, false); + player->learnSpell(8643, false); + player->learnSpell(2094, false); + player->learnSpell(1860, false); + player->learnSpell(57993, false); + player->learnSpell(48674, false); + player->learnSpell(31224, false); + player->learnSpell(5938, false); + player->learnSpell(57934, false); + player->learnSpell(51723, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(16511)) + player->learnSpell(48660, false); + if (player->HasSpell(1329)) + player->learnSpell(48666, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_PRIEST: + player->learnSpell(528, false); + player->learnSpell(2053, false); + player->learnSpell(48161, false); + player->learnSpell(48123, false); + player->learnSpell(48125, false); + player->learnSpell(48066, false); + player->learnSpell(586, false); + player->learnSpell(48068, false); + player->learnSpell(48127, false); + player->learnSpell(48171, false); + player->learnSpell(48168, false); + player->learnSpell(10890, false); + player->learnSpell(6064, false); + player->learnSpell(988, false); + player->learnSpell(48300, false); + player->learnSpell(6346, false); + player->learnSpell(48071, false); + player->learnSpell(48135, false); + player->learnSpell(48078, false); + player->learnSpell(453, false); + player->learnSpell(10955, false); + player->learnSpell(10909, false); + player->learnSpell(8129, false); + player->learnSpell(48073, false); + player->learnSpell(605, false); + player->learnSpell(48072, false); + player->learnSpell(48169, false); + player->learnSpell(552, false); + player->learnSpell(1706, false); + player->learnSpell(48063, false); + player->learnSpell(48162, false); + player->learnSpell(48170, false); + player->learnSpell(48074, false); + player->learnSpell(48158, false); + player->learnSpell(48120, false); + player->learnSpell(34433, false); + player->learnSpell(48113, false); + player->learnSpell(32375, false); + player->learnSpell(64843, false); + player->learnSpell(64901, false); + player->learnSpell(53023, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(34914)) + player->learnSpell(48160, false); + if (player->HasSpell(47540)) + player->learnSpell(53007, false); + if (player->HasSpell(724)) + player->learnSpell(48087, false); + if (player->HasSpell(19236)) + player->learnSpell(48173, false); + if (player->HasSpell(34861)) + player->learnSpell(48089, false); + if (player->HasSpell(15407)) + player->learnSpell(48156, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_DEATH_KNIGHT: + player->learnSpell(3127, false); + player->learnSpell(50842, false); + player->learnSpell(49941, false); + player->learnSpell(49930, false); + player->learnSpell(47476, false); + player->learnSpell(45529, false); + player->learnSpell(3714, false); + player->learnSpell(56222, false); + player->learnSpell(48743, false); + player->learnSpell(48263, false); + player->learnSpell(49909, false); + player->learnSpell(47528, false); + player->learnSpell(45524, false); + player->learnSpell(48792, false); + player->learnSpell(57623, false); + player->learnSpell(56815, false); + player->learnSpell(47568, false); + player->learnSpell(49895, false); + player->learnSpell(50977, false); + player->learnSpell(49576, false); + player->learnSpell(49921, false); + player->learnSpell(46584, false); + player->learnSpell(49938, false); + player->learnSpell(48707, false); + player->learnSpell(48265, false); + player->learnSpell(61999, false); + player->learnSpell(42650, false); + player->learnSpell(53428, false); + player->learnSpell(53331, false); + player->learnSpell(54447, false); + player->learnSpell(53342, false); + player->learnSpell(54446, false); + player->learnSpell(53323, false); + player->learnSpell(53344, false); + player->learnSpell(70164, false); + player->learnSpell(62158, false); + player->learnSpell(33391, false); + player->learnSpell(48778, false); + player->learnSpell(51425, false); + player->learnSpell(49924, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(55050)) + player->learnSpell(55262, false); + if (player->HasSpell(49143)) + player->learnSpell(55268, false); + if (player->HasSpell(49184)) + player->learnSpell(51411, false); + if (player->HasSpell(55090)) + player->learnSpell(55271, false); + if (player->HasSpell(49158)) + player->learnSpell(51328, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_SHAMAN: + player->learnSpell(2062, false); + player->learnSpell(8737, false); + player->learnSpell(49273, false); + player->learnSpell(49238, false); + player->learnSpell(10399, false); + player->learnSpell(49231, false); + player->learnSpell(58753, false); + player->learnSpell(2484, false); + player->learnSpell(49281, false); + player->learnSpell(58582, false); + player->learnSpell(49233, false); + player->learnSpell(58790, false); + player->learnSpell(58704, false); + player->learnSpell(58643, false); + player->learnSpell(49277, false); + player->learnSpell(61657, false); + player->learnSpell(8012, false); + player->learnSpell(526, false); + player->learnSpell(2645, false); + player->learnSpell(57994, false); + player->learnSpell(8143, false); + player->learnSpell(49236, false); + player->learnSpell(58796, false); + player->learnSpell(58757, false); + player->learnSpell(49276, false); + player->learnSpell(57960, false); + player->learnSpell(131, false); + player->learnSpell(58745, false); + player->learnSpell(6196, false); + player->learnSpell(58734, false); + player->learnSpell(58774, false); + player->learnSpell(58739, false); + player->learnSpell(58656, false); + player->learnSpell(546, false); + player->learnSpell(556, false); + player->learnSpell(66842, false); + player->learnSpell(51994, false); + player->learnSpell(8177, false); + player->learnSpell(58749, false); + player->learnSpell(20608, false); + player->learnSpell(36936, false); + player->learnSpell(36936, false); + player->learnSpell(58804, false); + player->learnSpell(49271, false); + player->learnSpell(8512, false); + player->learnSpell(6495, false); + player->learnSpell(8170, false); + player->learnSpell(66843, false); + player->learnSpell(55459, false); + player->learnSpell(66844, false); + player->learnSpell(3738, false); + player->learnSpell(2894, false); + player->learnSpell(60043, false); + player->learnSpell(51514, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->GetTeam() == ALLIANCE) + player->learnSpell(32182, false); + if (player->GetTeam() == HORDE) + player->learnSpell(2825, false); + if (player->HasSpell(61295)) + player->learnSpell(61301, false); + if (player->HasSpell(974)) + player->learnSpell(49284, false); + if (player->HasSpell(30706)) + player->learnSpell(57722, false); + if (player->HasSpell(51490)) + player->learnSpell(59159, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + + case CLASS_DRUID: + player->learnSpell(48378, false); + player->learnSpell(48469, false); + player->learnSpell(48461, false); + player->learnSpell(48463, false); + player->learnSpell(48441, false); + player->learnSpell(53307, false); + player->learnSpell(53308, false); + player->learnSpell(5487, false); + player->learnSpell(48560, false); + player->learnSpell(6795, false); + player->learnSpell(48480, false); + player->learnSpell(53312, false); + player->learnSpell(18960, false); + player->learnSpell(5229, false); + player->learnSpell(48443, false); + player->learnSpell(50763, false); + player->learnSpell(8983, false); + player->learnSpell(8946, false); + player->learnSpell(1066, false); + player->learnSpell(48562, false); + player->learnSpell(783, false); + player->learnSpell(770, false); + player->learnSpell(16857, false); + player->learnSpell(18658, false); + player->learnSpell(768, false); + player->learnSpell(1082, false); + player->learnSpell(16979, false); + player->learnSpell(49376, false); + player->learnSpell(5215, false); + player->learnSpell(48477, false); + player->learnSpell(49800, false); + player->learnSpell(48465, false); + player->learnSpell(48572, false); + player->learnSpell(26995, false); + player->learnSpell(48574, false); + player->learnSpell(2782, false); + player->learnSpell(50213, false); + player->learnSpell(2893, false); + player->learnSpell(33357, false); + player->learnSpell(5209, false); + player->learnSpell(48575, false); + player->learnSpell(48447, false); + player->learnSpell(48577, false); + player->learnSpell(48579, false); + player->learnSpell(5225, false); + player->learnSpell(22842, false); + player->learnSpell(49803, false); + player->learnSpell(9634, false); + player->learnSpell(20719, false); + player->learnSpell(48467, false); + player->learnSpell(29166, false); + player->learnSpell(62600, false); + player->learnSpell(22812, false); + player->learnSpell(48470, false); + player->learnSpell(48564, false); + player->learnSpell(48566, false); + player->learnSpell(33943, false); + player->learnSpell(49802, false); + player->learnSpell(48451, false); + player->learnSpell(48568, false); + player->learnSpell(33786, false); + player->learnSpell(40120, false); + player->learnSpell(62078, false); + player->learnSpell(52610, false); + player->learnSpell(50464, false); + player->learnSpell(48570, false); + player->learnSpell(34093, false); + player->learnSpell(33392, false); + if (player->HasSpell(50516)) + player->learnSpell(61384, false); + if (player->HasSpell(48505)) + player->learnSpell(53201, false); + if (player->HasSpell(48438)) + player->learnSpell(53251, false); + if (player->HasSpell(5570)) + player->learnSpell(48468, false); + player->SaveToDB(); + player->PlayerTalkClass->SendCloseGossip(); + break; + } + + } + } + return true; + } +}; + +void AddSC_npc_trainer() +{ + new npc_trainer(); +} \ No newline at end of file diff --git a/VisualWeapon.cpp b/VisualWeapon.cpp new file mode 100644 index 0000000..864fb71 --- /dev/null +++ b/VisualWeapon.cpp @@ -0,0 +1,181 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +using namespace std; + +#define DEFAULT_MESSAGE 907 + +struct VisualData +{ + uint32 Menu; + uint32 Submenu; + uint32 Icon; + uint32 Id; + string Name; +}; + +VisualData vData[] = +{ + { 1, 0, GOSSIP_ICON_BATTLE, 3789, "Berserking" }, + { 1, 0, GOSSIP_ICON_BATTLE, 3854, "Spell Power" }, + { 1, 0, GOSSIP_ICON_BATTLE, 3273, "Deathfrost" }, + { 1, 0, GOSSIP_ICON_BATTLE, 3225, "Executioner" }, + { 1, 0, GOSSIP_ICON_BATTLE, 3870, "Blood Draining" }, + { 1, 0, GOSSIP_ICON_BATTLE, 1899, "Unholy Weapon" }, + { 1, 0, GOSSIP_ICON_BATTLE, 2674, "Spellsurge" }, + { 1, 0, GOSSIP_ICON_BATTLE, 2675, "Battlemaster" }, + { 1, 0, GOSSIP_ICON_BATTLE, 2671, "Arcane and Fire Spell Power" }, + { 1, 0, GOSSIP_ICON_BATTLE, 2672, "Shadow and Frost Spell Power" }, + { 1, 0, GOSSIP_ICON_BATTLE, 3365, "Rune of Swordshattering" }, + { 1, 0, GOSSIP_ICON_BATTLE, 2673, "Mongoose" }, + { 1, 0, GOSSIP_ICON_BATTLE, 2343, "Spell Power" }, + { 1, 2, GOSSIP_ICON_TALK, 0, "Next.." }, + + { 2, 0, GOSSIP_ICON_BATTLE, 425, "Black Temple Dummy" }, + { 2, 0, GOSSIP_ICON_BATTLE, 3855, "Spell Power III" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1894, "Icy Weapon" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1103, "Agility" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1898, "Lifestealing" }, + { 2, 0, GOSSIP_ICON_BATTLE, 3345, "Earthliving I" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1743, "MHTest02" }, + { 2, 0, GOSSIP_ICON_BATTLE, 3093, "Attack Power vs Undead and Demons" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1900, "Crusader" }, + { 2, 0, GOSSIP_ICON_BATTLE, 3846, "Spell Power II" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1606, "Attack Power" }, + { 2, 0, GOSSIP_ICON_BATTLE, 283, "Windfury I" }, + { 2, 0, GOSSIP_ICON_BATTLE, 1, "Rockbiter III" }, + { 2, 3, GOSSIP_ICON_TALK, 0, "Next.." }, + { 2, 1, GOSSIP_ICON_TALK, 0, "..Back" }, + + { 3, 0, GOSSIP_ICON_BATTLE, 3265, "Blessed Weapon Coating" }, + { 3, 0, GOSSIP_ICON_BATTLE, 2, "Frostbrand I" }, + { 3, 0, GOSSIP_ICON_BATTLE, 3, "Flametongue III" }, + { 3, 0, GOSSIP_ICON_BATTLE, 3266, "Righteous Weapon Coating" }, + { 3, 0, GOSSIP_ICON_BATTLE, 1903, "Spirit" }, + { 3, 0, GOSSIP_ICON_BATTLE, 13, "Sharpened" }, + { 3, 0, GOSSIP_ICON_BATTLE, 26, "Frost Oil" }, + { 3, 0, GOSSIP_ICON_BATTLE, 7, "Deadly Poison" }, + { 3, 0, GOSSIP_ICON_BATTLE, 803, "Fiery Weapon" }, + { 3, 0, GOSSIP_ICON_BATTLE, 1896, "Weapon Damage" }, + { 3, 0, GOSSIP_ICON_BATTLE, 2666, "Intellect" }, + { 3, 0, GOSSIP_ICON_BATTLE, 25, "Shadow Oil" }, + { 3, 2, GOSSIP_ICON_TALK, 0, "..Back" }, +}; + +class NPC_VisualWeapon : public CreatureScript +{ +public: + NPC_VisualWeapon() : CreatureScript("NPC_VisualWeapon") { } + + bool MainHand; + + void SetVisual(Player* player, uint32 visual) + { + uint8 slot = MainHand ? EQUIPMENT_SLOT_MAINHAND : EQUIPMENT_SLOT_OFFHAND; + + Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + + if (!item) + { + ChatHandler(player->GetSession()).PSendSysMessage("Sem item equipado disponivel para mudar o Visual."); + return; + } + + const ItemTemplate* itemTemplate = item->GetTemplate(); + + if (itemTemplate->SubClass == ITEM_SUBCLASS_ARMOR_SHIELD || + itemTemplate->SubClass == ITEM_SUBCLASS_ARMOR_BUCKLER || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_SPEAR || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_BOW || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_GUN || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_Obsolete || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_EXOTIC || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_EXOTIC2 || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_MISCELLANEOUS || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_THROWN || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_CROSSBOW || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_WAND || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_FISHING_POLE || + itemTemplate->SubClass == ITEM_SUBCLASS_WEAPON_Obsolete) + return; + + player->SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (item->GetSlot() * 2), 0, visual); + } + + void GetMenu(Player* player, Creature* creature, uint32 menuId) + { + for (uint8 i = 0; i < (sizeof(vData) / sizeof(*vData)); i++) + { + if (vData[i].Menu == menuId) + player->ADD_GOSSIP_ITEM(vData[i].Icon, vData[i].Name, GOSSIP_SENDER_MAIN, i); + } + + player->SEND_GOSSIP_MENU(DEFAULT_MESSAGE, creature->GetGUID()); + } + + bool OnGossipHello(Player* player, Creature* creature) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "|TInterface/PaperDoll/UI-PaperDoll-Slot-MainHand:32:32:-32:0|tMain-Hand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "|TInterface/PaperDoll/UI-PaperDoll-Slot-SecondaryHand:32:32:-32:0|tOff-Hand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "|TInterface/PaperDollInfoFrame/UI-GearManager-Undo:32:32:-32:0|tSair", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + player->SEND_GOSSIP_MENU(DEFAULT_MESSAGE, creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: + MainHand = true; + GetMenu(player, creature, 1); + return false; + + case GOSSIP_ACTION_INFO_DEF + 2: + MainHand = false; + GetMenu(player, creature, 1); + return false; + + case GOSSIP_ACTION_INFO_DEF + 3: + player->CLOSE_GOSSIP_MENU(); + return false; + } + + uint32 menuData = vData[action].Submenu; + + if (menuData == 0) + { + SetVisual(player, vData[action].Id); + menuData = vData[action].Menu; + } + + GetMenu(player, creature, menuData); + return true; + } +}; + +void AddSC_NPC_VisualWeapon() +{ + new NPC_VisualWeapon; +} diff --git a/casino_dos.cpp b/casino_dos.cpp new file mode 100644 index 0000000..bbf6c50 --- /dev/null +++ b/casino_dos.cpp @@ -0,0 +1,148 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +class casino_km : public CreatureScript +{ +public: + casino_km() : CreatureScript("casino_km") { } + + bool OnGossipHello(Player * player, Creature * creature) + { + + player->ADD_GOSSIP_ITEM_EXTENDED(3, "Quieres jugar con el juego de los dados", GOSSIP_SENDER_MAIN, 1337, "¿Cuánto oro va a apostar?", 0, true); + player->ADD_GOSSIP_ITEM(3, "¿Cómo funciona este juego?", GOSSIP_SENDER_MAIN, 1); + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 uiAction) + { + player->PlayerTalkClass->ClearMenus(); + + if(uiAction == 1) + { + player->ADD_GOSSIP_ITEM(7, "Las reglas son simples, Si sacas superior a 50, su apuesta se duplica. De lo contrario, se pierde la cantidad apostada.", GOSSIP_SENDER_MAIN, 1); + player->SEND_GOSSIP_MENU(123432, creature->GetGUID()); + } + else if(uiAction == 0) + { + OnGossipHello(player, creature); + } + return true; + } + + bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 uiAction, const char* code) // happens when an extended gossip item is selected and the code is set to true for the gossip item. + { + player->PlayerTalkClass->ClearMenus(); + + uint32 amount = 0; + uint32 gold = 0; + amount = uint32(atol(code)); + gold = amount * 10000; + + std::ostringstream message; + + if(amount < 50) + { + player->GetSession()->SendNotification("Usted no tiene suficiente oro!"); + } + else + { + + + if(urand(1,2) == 1) + { + player->ModifyMoney(player->GetMoney() + gold); + player->PlayDirectSound(3337); + player->CastSpell(player, 47292); + player->CastSpell(player, 44940); + message << "¡Felicidades " << player->GetName() << " Has ganado!"; + player->MonsterWhisper(message.str().c_str(), player->GetGUID()); + + } + else + { + player->ModifyMoney(player->GetMoney() - gold); + message << "Así que lo siento, " << player->GetName() << " que ha perdido."; + player->MonsterWhisper(message.str().c_str(), player->GetGUID()); + } + } + OnGossipSelect(player, creature, sender, 0); + return true; + } + +struct gambler_passivesAI : public ScriptedAI +{ + gambler_passivesAI(Creature * c) : ScriptedAI(c){ } + + uint32 uiAdATimer; + uint32 uiAdBTimer; + uint32 uiAdCTimer; + + void Reset() + { + uiAdATimer = 1000; + uiAdBTimer = 23000; + uiAdCTimer = 11000; + } + + + void UpdateAI(const uint32 diff) + { + + if(uiAdATimer <= diff) + { + me->MonsterSay("¡Venga uno, vengan todos! Un paso al frente a Crown Casino! hagan sus apuestas, hagan sus apuestas!", LANG_UNIVERSAL, NULL); + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + me->CastSpell(me, 44940); + uiAdATimer = 61000; + } + else + uiAdATimer -= diff; + + if(uiAdBTimer <= diff) + { + me->MonsterSay("Vamos chicos! Hagan sus apuestas, No seas un pollo!", LANG_UNIVERSAL, NULL); + me->HandleEmoteCommand(EMOTE_ONESHOT_CHICKEN); + uiAdBTimer = 61000; + } + else + uiAdBTimer -= diff; + + if(uiAdCTimer <= diff) + { + me->MonsterSay("No me hagas triste, Ven a apostar! Un paso al frente y a ganar hoy!", LANG_UNIVERSAL, NULL); + me->HandleEmoteCommand(EMOTE_ONESHOT_CRY); + uiAdCTimer = 61000; + } + else + uiAdCTimer -= diff; + } +}; + + CreatureAI * GetAI(Creature * pCreature) const + { + return new gambler_passivesAI(pCreature); + } +}; + +void AddSC_casino_km() +{ + new casino_km(); +} \ No newline at end of file diff --git a/casino_uno.cpp b/casino_uno.cpp new file mode 100644 index 0000000..4023615 --- /dev/null +++ b/casino_uno.cpp @@ -0,0 +1,148 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +class gamble_npc : public CreatureScript +{ +public: + gamble_npc() : CreatureScript("gamble_npc") { } + + bool OnGossipHello(Player * player, Creature * creature) + { + + player->ADD_GOSSIP_ITEM_EXTENDED(3, "Quieres jugar con el juego de los dados", GOSSIP_SENDER_MAIN, 1337, "¿Cuánto oro va a apostar?", 0, true); + player->ADD_GOSSIP_ITEM(3, "¿Cómo funciona este juego?", GOSSIP_SENDER_MAIN, 1); + player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 uiAction) + { + player->PlayerTalkClass->ClearMenus(); + + if(uiAction == 1) + { + player->ADD_GOSSIP_ITEM(7, "Las reglas son simples, Si sacas superior a 50, su apuesta se duplica. De lo contrario, se pierde la cantidad apostada.", GOSSIP_SENDER_MAIN, 1); + player->SEND_GOSSIP_MENU(123432, creature->GetGUID()); + } + else if(uiAction == 0) + { + OnGossipHello(player, creature); + } + return true; + } + + bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 uiAction, const char* code) // happens when an extended gossip item is selected and the code is set to true for the gossip item. + { + player->PlayerTalkClass->ClearMenus(); + + uint32 amount = 0; + uint32 gold = 0; + amount = uint32(atol(code)); + gold = amount * 10000; + + std::ostringstream message; + + if(amount < 50) + { + player->GetSession()->SendNotification("Usted no tiene suficiente oro!"); + } + else + { + + + if(urand(1,2) == 1) + { + player->ModifyMoney(player->GetMoney() + gold); + player->PlayDirectSound(3337); + player->CastSpell(player, 47292); + player->CastSpell(player, 44940); + message << "¡Felicidades " << player->GetName() << " Has ganado!"; + player->MonsterWhisper(message.str().c_str(), player->GetGUID()); + + } + else + { + player->ModifyMoney(player->GetMoney() - gold); + message << "Así que lo siento, " << player->GetName() << " que ha perdido."; + player->MonsterWhisper(message.str().c_str(), player->GetGUID()); + } + } + OnGossipSelect(player, creature, sender, 0); + return true; + } + +struct gambler_passivesAI : public ScriptedAI +{ + gambler_passivesAI(Creature * c) : ScriptedAI(c){ } + + uint32 uiAdATimer; + uint32 uiAdBTimer; + uint32 uiAdCTimer; + + void Reset() + { + uiAdATimer = 1000; + uiAdBTimer = 23000; + uiAdCTimer = 11000; + } + + + void UpdateAI(const uint32 diff) + { + + if(uiAdATimer <= diff) + { + me->MonsterSay("¡Venga uno, vengan todos! Un paso al frente a Crown Casino! hagan sus apuestas, hagan sus apuestas!", LANG_UNIVERSAL, NULL); + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + me->CastSpell(me, 44940); + uiAdATimer = 61000; + } + else + uiAdATimer -= diff; + + if(uiAdBTimer <= diff) + { + me->MonsterSay("Vamos chicos! Hagan sus apuestas, No seas un pollo!", LANG_UNIVERSAL, NULL); + me->HandleEmoteCommand(EMOTE_ONESHOT_CHICKEN); + uiAdBTimer = 61000; + } + else + uiAdBTimer -= diff; + + if(uiAdCTimer <= diff) + { + me->MonsterSay("No me hagas triste, Ven a apostar! Un paso al frente y a ganar hoy!", LANG_UNIVERSAL, NULL); + me->HandleEmoteCommand(EMOTE_ONESHOT_CRY); + uiAdCTimer = 61000; + } + else + uiAdCTimer -= diff; + } +}; + + CreatureAI * GetAI(Creature * pCreature) const + { + return new gambler_passivesAI(pCreature); + } +}; + +void AddSC_gamble_npc() +{ + new gamble_npc(); +} \ No newline at end of file diff --git a/chat_censure.cpp b/chat_censure.cpp new file mode 100644 index 0000000..94ed1f4 --- /dev/null +++ b/chat_censure.cpp @@ -0,0 +1,168 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include "Channel.h" +#include "Language.h" +#include + +class System_Censure : public PlayerScript +{ +public: + System_Censure() : PlayerScript("System_Censure") {} + + void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg) + { + CheckMessage(player, msg, lang, NULL, NULL, NULL, NULL); + } + + void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver) + { + CheckMessage(player, msg, lang, receiver, NULL, NULL, NULL); + } + + void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Group* group) + { + CheckMessage(player, msg, lang, NULL, group, NULL, NULL); + } + + void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Guild* guild) + { + CheckMessage(player, msg, lang, NULL, NULL, guild, NULL); + } + + void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Channel* channel) + { + CheckMessage(player, msg, lang, NULL, NULL, NULL, channel); + } + +void CheckMessage(Player* player, std::string& msg, uint32 lang, Player* /*receiver*/, Group* /*group*/, Guild* /*guild*/, Channel* channel) +{ + if (player->isGameMaster() || lang == LANG_ADDON) + return; + + //transform to lowercase (for simpler checking) + std::string lower = msg; + std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); + + const uint8 cheksSize = 74; + std::string checks[cheksSize]; + checks[0] ="http://"; + checks[1] =".com"; + checks[2] =".net"; + checks[3] =".org"; + checks[4] =".ru"; + checks[5] ="rondor"; + checks[6] ="www."; + checks[7] ="terragolfa"; + checks[8] ="server de mierda"; + checks[9] ="nuevo servidor"; + checks[10] ="wowmagic"; + checks[11] ="circle"; + checks[12] ="www.wowtiberian.com"; + checks[13] ="wow-core"; + checks[14] ="wowcool"; + checks[15] ="wowysera"; + checks[16] ="wowlatinoamerica"; + checks[17] ="wowlatinos"; + checks[18] ="wowtiberian"; + checks[19] ="wowsulvus"; + checks[20] ="s u l v u s"; + checks[21] ="l a t i n o s"; + checks[22] ="3.3.5a"; + checks[23] ="eternallife.es"; + checks[24] ="reinosiberos"; + checks[25] ="lost"; + checks[26] ="fumetas"; + checks[27] ="otro server"; + checks[28] ="otro servidor"; + checks[29] ="sulvus"; + checks[30] ="latinos"; + checks[31] ="templars"; + checks[32] ="core"; + checks[33] ="tiberian"; + checks[34] ="mewet"; + checks[35] ="kbotcostarica"; + checks[36] ="wowpilas"; + checks[37] ="wowcolombia"; + checks[38] ="wow-colombia"; + checks[39] = "area 51"; + checks[40] = "arena-51"; + checks[41] = "vgaming"; + checks[42] = "sytes.net"; + checks[43] = "ddns.net"; + checks[44] = "zaptop.org"; + checks[45] = "wowmortal"; + checks[46] = "wow-mortal"; + checks[47] = "adverse wow"; + checks[48] = "adverse"; + checks[49] = "wowadverse"; + checks[50] = "wow "; + checks[51] = "lanrun"; + checks[52] = "lan-run"; + checks[53] = "wow-lanrun"; + checks[54] = "lan-run"; + checks[55] = "lanrun"; + checks[56] = "skyfire"; + checks[57] = "logon.lanrunteam.com:3725"; + checks[58] = "http://lich.lanrunteam.com/"; + checks[59] = "set realmlist logon.lanrunteam.com"; + checks[60] = "logon.lanrunteam.com"; + checks[61] = "http://cata.lanrunteam.com/"; + checks[62] = "http://lanrunteam.com/"; + checks[63] = "lanrunteam.com"; + checks[64] = "http://wow-legends.tk/"; + checks[65] = "wow-legends.tk"; + checks[66] = "set realmlist logon.wow-legends.tk"; + checks[67] = "wow-legends"; + checks[68] = "http://wow-platinum.sytes.net/"; + checks[69] = "wow-platinum.sytes.net"; + checks[70] = "set realmlist wowplatinum.com"; + checks[71] = "wowplatinum.com"; + checks[72] = "http://wowplatinum.com/"; + checks[73] = "wow-platinum"; + + + for (int i = 0; i < cheksSize; ++i) + if (lower.find(checks[i]) != std::string::npos) + { + msg = "No se tolera el Spam!"; + msg = lang == LANG_GM_SILENCE; + ChatHandler(player->GetSession()).PSendSysMessage("No se tolera el Spam!"); + std::string plr = player->GetName(); + std::string gender = player->getGender() == GENDER_FEMALE ? "esta" : "esta"; + bool ingroup = player->GetGroup(); + std::string tag_colour = "7bbef7"; + std::string plr_colour = "ff0000"; + std::string boss_colour = "18be00"; + std::ostringstream stream; + stream << "|CFF" << tag_colour << + "[Anuncio de Spam]|r:|cff" << plr_colour << " " << plr << + (ingroup ? " el " : " haciendo ") << gender << (ingroup ? " Spameando " : " Spameando ") << "!"; + sWorld->SendGMText(LANG_GM_BROADCAST, stream.str().c_str()); + return; + } + + } + }; + +void AddSC_System_Censure() +{ + new System_Censure(); +} diff --git a/clear_combat_bug.cpp b/clear_combat_bug.cpp new file mode 100644 index 0000000..b568d4d --- /dev/null +++ b/clear_combat_bug.cpp @@ -0,0 +1,63 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ + #include "ScriptPCH.h" + + class clear_combat : public CreatureScript + { + public: + clear_combat() : CreatureScript("clear_combat") + { + } + + bool OnGossipHello(Player * pPlayer, Creature * pCreature) + { +pPlayer->ADD_GOSSIP_ITEM(4, "Limpiar mi combate", GOSSIP_SENDER_MAIN, 0); +pPlayer->ADD_GOSSIP_ITEM(0, "No Importa...", GOSSIP_SENDER_MAIN, 3); +pPlayer->PlayerTalkClass->SendGossipMenu(9425, pCreature->GetGUID()); +return true; + } + + bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /*uiSender*/, uint32 uiAction) + { +if(!Player) + return true; + +switch(uiAction) +{ + case 0: if(!Player->duel) // Comprueba si un jugador está en un duelo o no.// Checks if a player is in a duel or not. + { + Player->ClearInCombat(); + ChatHandler(Player->GetSession()).SendSysMessage("Tu combate esta limpio!"); + } + else + { + ChatHandler(Player->GetSession()).SendSysMessage("Estás en un duelo! Usted no puede usar esto!!"); + Player->PlayerTalkClass->SendCloseGossip(); + }; +} +return true; + } + +}; + +void AddSC_clear_combat() +{ + new clear_combat(); +} \ No newline at end of file diff --git a/duel_reset.cpp b/duel_reset.cpp new file mode 100644 index 0000000..885d1fa --- /dev/null +++ b/duel_reset.cpp @@ -0,0 +1,43 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +class Duel_Reset : public PlayerScript +{ + public: + Duel_Reset() : PlayerScript("Duel_Reset"){} + + void OnDuelEnd(Player* pWinner, Player* pLoser, DuelCompleteType /*type*/) + { + pWinner->RemoveAllSpellCooldown(); + pLoser->RemoveAllSpellCooldown(); + pWinner->SetHealth(pWinner->GetMaxHealth()); + if ( pWinner->getPowerType() == POWER_MANA ) + pWinner->SetPower(POWER_MANA, pWinner->GetMaxPower(POWER_MANA)); + pLoser->SetHealth(pLoser->GetMaxHealth()); + if ( pLoser->getPowerType() == POWER_MANA ) + pLoser->SetPower(POWER_MANA, pLoser->GetMaxPower(POWER_MANA)); + } +}; + +void AddSC_Duel_Reset() +{ + new Duel_Reset(); +} diff --git a/gurubashi_theme.cpp b/gurubashi_theme.cpp new file mode 100644 index 0000000..44a4921 --- /dev/null +++ b/gurubashi_theme.cpp @@ -0,0 +1,124 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include +#include +#include + +#define OFFSET_THEME 10000 + +int GetLastThemeTime() +{ + QueryResult result; + result = WorldDatabase.PQuery("SELECT `time` FROM `gurubashi_lastspawned`"); + + if (result) + { + Field *fields = result->Fetch(); + return fields[0].GetInt32(); + } + else + return 0; + +} + +void GossipObjects(Player *player, Creature *m_creature) +{ + if (GetLastThemeTime() + 600 <= time (NULL)) + { + QueryResult result; + result = WorldDatabase.PQuery("SELECT `id`, `name` FROM `gurubashi_themes`"); + if (result) + { + do + { + Field *fields = result->Fetch(); + player->ADD_GOSSIP_ITEM(4, fields[1].GetString(), GOSSIP_SENDER_MAIN, OFFSET_THEME + fields[0].GetInt32()); + } + while (result->NextRow()); + } + } + else + { + char msg[100]; + int time2 = GetLastThemeTime() + 600 - time (NULL); + if (time2 < 60) + sprintf(msg, "Next change possible in less than minute."); + else + sprintf(msg, "Next change possible in %u minute/s.", time2 / 60); + player->ADD_GOSSIP_ITEM(0, msg, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + } + player->ADD_GOSSIP_ITEM(0, "Good bye", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(1,m_creature->GetGUID()); +} + + +class Theme_NPC : public CreatureScript +{ + public: + Theme_NPC() : CreatureScript("Theme_NPC") {} + + bool OnGossipHello(Player * pPlayer, Creature * pCreature) + { + GossipObjects(pPlayer, pCreature); + return true; + } + + bool OnGossipSelect(Player *player, Creature * m_creature, uint32 sender, uint32 action) + { + if (action > OFFSET_THEME) + { + QueryResult result; + result = WorldDatabase.PQuery("DELETE FROM `gurubashi_lastspawned`"); + result = WorldDatabase.PQuery("INSERT INTO `gurubashi_lastspawned` VALUES (%u)", time (NULL)); + result = WorldDatabase.PQuery("SELECT `x`, `y`, `z`, `o`, `entry` FROM `gurubashi_spawns` WHERE `theme` = %u", action - OFFSET_THEME); + if (result) + { + do + { + Field *fields = result->Fetch(); + m_creature->SummonGameObject(fields[4].GetInt32(), fields[0].GetFloat(), fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), 0, 0, 0, 0, 600); + } + while (result->NextRow()); + } + else + player->PlayerTalkClass->SendCloseGossip(); + } + else + { + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: + player->PlayerTalkClass->SendCloseGossip(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + GossipObjects(player, m_creature); + break; + } + } + return true; + } +}; + + +void AddSC_npc_gurubashi_theme() +{ + new Theme_NPC(); +} \ No newline at end of file diff --git a/item_res_group b/item_res_group new file mode 100644 index 0000000..01d40f0 --- /dev/null +++ b/item_res_group @@ -0,0 +1,107 @@ + /*---------------------------------------------*\ + | Coded By Obitus | + | April 02, 2016 | + | Tested on TrinityCore 3.3.5 | + | Added distance check (Thanks to Phil) | + | This is the 2nd version - without gossip | + \*---------------------------------------------*/ + +//I was insipired by http://www.wowhead.com/spell=83968/mass-resurrection + +/* +-- Execute this query in WORLD DATABASE +INSERT INTO `item_template` (`entry`, `class`, `SoundOverrideSubclass`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `BuyPrice`, `SellPrice`, `AllowableClass`, `AllowableRace`, `RequiredLevel`, `maxcount`, `stackable`, `delay`, `spellid_1`, `spellcooldown_1`, `spellcategorycooldown_1`, `spellcooldown_2`, `spellcategorycooldown_2`, `spellcooldown_3`, `spellcategorycooldown_3`, `spellcooldown_4`, `spellcategorycooldown_4`, `spellcooldown_5`, `spellcategorycooldown_5`, `description`, `RequiredDisenchantSkill`, `ScriptName`) +VALUES (192000, 15, -1, 'Mass Resurrection', 67105, 7, 0, 0, 1, 228800000, 34, -1, -1, 28, 1, 1, 1000, 14093, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, '|cffffffff100 yd range\r\n|cffffd400Brings all dead party and raid members back to life with 35% health and 35% mana. Cannot be cast in combat or while in a battleground or arena.\r\nYou can use this item once every 15 minutes.', -1, 'item_res_group'); +*/ + + +#include "ScriptMgr.h" +#include "Player.h" +#include "Group.h" +#include "ObjectAccessor.h" +#include "ScriptedGossip.h" +#include "WorldSession.h" + +class item_res_group : public ItemScript +{ +public: + item_res_group() : ItemScript("item_res_group") { } + + bool DistanceIsValid(Position* playerWhoUsesTheItem, Position* deadPlayersInGroup) + { + if (std::abs(deadPlayersInGroup->GetPositionX() - playerWhoUsesTheItem->GetPositionX()) <= 91.44) //91.44 meters = 100 yards + return true; + return false; + } + + bool OnUse(Player* playerWhoUsesTheItem, Item* item, SpellCastTargets const& /*targets*/) + { + Group* group = playerWhoUsesTheItem->GetGroup(); + Group::MemberSlotList const &members = group->GetMemberSlots(); + + if (playerWhoUsesTheItem->HasAura(38910)) //Fel Weakness + { + playerWhoUsesTheItem->GetSession()->SendNotification("Usted debe esperar 15 minutos para usar este objeto otra vez"); + return false; + } + + if (!playerWhoUsesTheItem->GetGroup()) + { + playerWhoUsesTheItem->GetSession()->SendNotification("Usted no está en un grupo!"); + return false; + } + /* //What if the leader is dead? + if (playerWhoUsesTheItem->GetGroup()->GetLeaderGUID() != playerWhoUsesTheItem->GetGUID()) + { + playerWhoUsesTheItem->GetSession()->SendNotification("You are not the group leader!"); + return false; + } + */ + if (playerWhoUsesTheItem->InBattleground()) + { + playerWhoUsesTheItem->GetSession()->SendNotification("Usted no puede usar este objeto en un campo de batalla!"); + return false; + } + + if (playerWhoUsesTheItem->InArena()) + { + playerWhoUsesTheItem->GetSession()->SendNotification("Usted no puede usar este objeto en una Arena!"); + return false; + } + + if (playerWhoUsesTheItem->IsInCombat()) + { + playerWhoUsesTheItem->GetSession()->SendNotification("Usted no puede usar este objeto en combate!"); + return false; + } + + else + { + for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr) + { + Group::MemberSlot const &slot = *itr; + Player* deadPlayersInGroup = ObjectAccessor::FindPlayer((*itr).guid); + + //skip if player/s is/are offline //--This check is mandatory. the server will crash without it + if (!deadPlayersInGroup || deadPlayersInGroup->GetSession()->PlayerDisconnected()) + { + playerWhoUsesTheItem->CLOSE_GOSSIP_MENU(); + } + + if (deadPlayersInGroup && deadPlayersInGroup->GetSession() && deadPlayersInGroup->isDead() && playerWhoUsesTheItem->GetSession() && DistanceIsValid(playerWhoUsesTheItem, deadPlayersInGroup)) + { + deadPlayersInGroup->ResurrectPlayer(0.35f, false); //35% hp and mana, don't apply Resurrection Sickness + deadPlayersInGroup->CastSpell(deadPlayersInGroup, 48171, true); //Visual Spell Resurrect (priest) + deadPlayersInGroup->DurabilityRepairAll(0, 0, false); //Repair All - upon resurrection + playerWhoUsesTheItem->CastSpell(playerWhoUsesTheItem, 38910, true); //Fel Weakness //Cast a debuff on player To prevent the item being used over and over again + } + } + } + return true; + } +}; + +void AddSC_item_res_group() +{ + new item_res_group; +} diff --git a/itemlevel.cpp b/itemlevel.cpp new file mode 100644 index 0000000..344adbf --- /dev/null +++ b/itemlevel.cpp @@ -0,0 +1,57 @@ +/* + _______ _ ______ + |__ __| | | | ____| + | | __ _ ___| |_ _ _| |__ _ __ ___ _ _ + | |/ _` / __| __| | | | __| | '_ ` _ \| | | | + | | (_| \__ \ |_| |_| | |____| | | | | | |_| | + |_|\__,_|___/\__|\__, |______|_| |_| |_|\__,_| + __/ | + |___/ + +Script Made By Sinistah +Special Thanks To LilleCarl For The Code Snippet +Legend +------ +item_id = the item id of the item ur using. +max_lvl = the max lvl the script will allow players to use the item. +lvl = how many levels the item will grant upon used +*/ +#include "ScriptMgr.h" +#include "Player.h" +#include "WorldSession.h" + +enum +{ + item_id = 90001, + max_lvl = 80, + lvl = 1 +}; + +class item_level : public ItemScript +{ +public: + item_level() : ItemScript("item_level") { } + + bool OnUse(Player* player, Item* item, const SpellCastTargets &) + { + if(player->IsInCombat() || player->IsInFlight() || player->InBattleground() || player->InArena()) + { + player->GetSession()->SendNotification("No puedes usar Piedra de la Verguenza!"); + return false; + } + if(player->getLevel() == max_lvl) + { + player->GetSession()->SendNotification("Estas en el maximo nivel."); + return false; + } + player->SetLevel(player->getLevel() == max_lvl ? max_lvl : player->getLevel() + lvl); + player->DestroyItemCount(item_id, 1, true); + player->GetSession()->SendNotification("Usaste una Piedra de la Verguenza."); + return true; + } +}; + +void AddSC_item_level() +{ + new item_level(); +} diff --git a/killstreak.cpp b/killstreak.cpp new file mode 100644 index 0000000..7d0002b --- /dev/null +++ b/killstreak.cpp @@ -0,0 +1,74 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +class System_OnKill : public PlayerScript +{ +public: + System_OnKill() : PlayerScript("System_OnKill") {} + + void OnPVPKill(Player * Killer, Player * Victim) + { + uint32 KillerGUID = Killer->GetGUIDLow(); + uint32 VictimGUID = Victim->GetGUIDLow(); + + struct KillStreak_Info + { + uint32 killstreak; + uint32 lastkill; + }; + + static std::map KillStreakData; + + if (KillerGUID == VictimGUID || KillStreakData[KillerGUID].lastkill == VictimGUID) + return; + + if (KillStreakData[VictimGUID].killstreak >= 3) + { + std::ostringstream ss; + ss << "|cFF81CF42" << Killer->GetName() << "|r has ended |cFFFFFFFF" << Victim->GetName() << "|r's killingspree!"; + sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); + } + + ++KillStreakData[KillerGUID].killstreak; + KillStreakData[KillerGUID].lastkill = VictimGUID; + KillStreakData[VictimGUID].killstreak = 0; + KillStreakData[VictimGUID].lastkill = 0; + + if (KillStreakData[KillerGUID].killstreak % 10 == 0) // send killstreak message every 10 kills + { + std::ostringstream ss; + ss << "|cFF81CF42" << Killer->GetName() << "|r has a killstreak of |cFF42A0CF" << KillStreakData[KillerGUID].killstreak << "|r!"; + sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); + } + else if (KillStreakData[KillerGUID].killstreak == 3) + { + std::ostringstream ss; + ss << "|cFF81CF42" << Killer->GetName() << "|r is on a killingspree!"; + sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); + } + + } +}; + +void AddSC_PvP_System() +{ + new System_OnKill; +} \ No newline at end of file diff --git a/learn_all_spells.cpp b/learn_all_spells.cpp new file mode 100644 index 0000000..bce856c --- /dev/null +++ b/learn_all_spells.cpp @@ -0,0 +1,167 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include "DisableMgr.h" + +class LearnSpellsOnLevelUp : public PlayerScript +{ + public: + std::vector ignoreSpells; + + LearnSpellsOnLevelUp() : PlayerScript("LearnSpellsOnLevelUp") + { + uint32 temp[] = { + 64380, 23885, 23880, 44461, 25346, 10274, 10273, 8418, + 8419, 7270, 7269, 7268, 54648, 12536, 24530, 70909, + 12494, 57933, 24224, 27095, 27096, 27097, 27099, 32841, + 56131, 56160, 56161, 48153, 34754, 64844, 64904, 48085, + 33110, 48084, 28276, 27874, 27873, 7001, 49821, 53022, + 47757, 47750, 47758, 47666, 53001, 52983, 52998, 52986, + 52987, 52999, 52984, 53002, 53003, 53000, 52988, 52985, + 42208, 42209, 42210, 42211, 42212, 42213, 42198, 42937, + 42938, 12484, 12485, 12486, 44461, 55361, 55362, 34913, + 43043, 43044, 38703, 38700, 27076, 42844, 42845, 64891, + 25912, 25914, 25911, 25913, 25902, 25903, 27175, 27176, + 33073, 33074, 48822, 48820, 48823, 48821, 20154, 25997, + 20467, 20425, 67, 26017, 34471, 53254, 13812, 14314, + 14315, 27026, 49064, 49065, 60202, 60210, 13797, 14298, + 14299, 14300, 14301, 27024, 49053, 49054, 52399, 1742, + 24453, 53548, 53562, 52016, 26064, 35346, 57386, 57389, + 57390, 57391, 57392, 57393, 55509, 35886, 43339, 45297, + 45298, 45299, 45300, 45301, 45302, 49268, 49269, 8349, + 8502, 8503, 11306, 11307, 25535, 25537, 61650, 61654, + 63685, 45284, 45286, 45287, 45288, 45289, 45290, 45291, + 45292, 45293, 45294, 45295, 45296, 49239, 49240, 26364, + 26365, 26366, 26367, 26369, 26370, 26363, 26371, 26372, + 49278, 49279, 32176, 32175, 21169, 47206, 27285, 47833, + 47836, 42223, 42224, 42225, 42226, 42218, 47817, 47818, + 42231, 42232, 42233, 42230, 48466, 44203, 44205, 44206, + 44207, 44208, 48444, 48445, 33891, 52374, 57532, 59921, + 52372, 49142, 52375, 47633, 47632, 52373, 50536, 27214, + 47822, 11682, 11681, 5857, 1010, 24907, 24905, 53227, + 61391, 61390, 61388, 61387, 64801, 5421, 9635, 1178, + 20186, 20185, 20184, 20187, 25899, 24406, 50581, 30708 + }; + + ignoreSpells = std::vector (temp, temp + sizeof(temp)/sizeof(temp[0])); + } + + void OnLevelChanged(Player* player, uint8 oldLevel) + { + if (oldLevel < player->getLevel()) + LearnSpellsForNewLevel(player, oldLevel); + } + + bool IsIgnoredSpell(uint32 spellID) + { + for (std::vector::const_iterator itr = ignoreSpells.begin(); itr != ignoreSpells.end(); ++itr) + if (spellID == (*itr)) + return true; + return false; + } + + void LearnSpellsForNewLevel(Player* player, uint8 level) + { + if (level == player->getLevel() + 1) + return; + uint32 family; + switch(player->getClass()) + { + case CLASS_ROGUE: + family = SPELLFAMILY_ROGUE; + break; + case CLASS_DEATH_KNIGHT: + family = SPELLFAMILY_DEATHKNIGHT; + break; + case CLASS_WARRIOR: + family = SPELLFAMILY_WARRIOR; + break; + case CLASS_PRIEST: + family = SPELLFAMILY_PRIEST; + break; + case CLASS_MAGE: + family = SPELLFAMILY_MAGE; + break; + case CLASS_PALADIN: + family = SPELLFAMILY_PALADIN; + break; + case CLASS_HUNTER: + family = SPELLFAMILY_HUNTER; + break; + case CLASS_DRUID: + family = SPELLFAMILY_DRUID; + break; + case CLASS_SHAMAN: + family = SPELLFAMILY_SHAMAN; + break; + case CLASS_WARLOCK: + family = SPELLFAMILY_WARLOCK; + break; + } + for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i); + if (!spellInfo) + continue; + if (spellInfo->SpellFamilyName != family) + continue; + if (IsIgnoredSpell(spellInfo->Id)) + continue; + if (spellInfo->PowerType == POWER_FOCUS) + continue; + if (DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, spellInfo->Id, player)) + continue; + if ((spellInfo->AttributesEx7 & SPELL_ATTR7_ALLIANCE_ONLY && player->GetTeam() != ALLIANCE) || (spellInfo->AttributesEx7 & SPELL_ATTR7_HORDE_ONLY && player->GetTeam() != HORDE)) + continue; + if (spellInfo->BaseLevel != level && sSpellMgr->IsSpellValid(spellInfo, player)) + continue; + + bool valid = false; + + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellInfo->Id); + for (SkillLineAbilityMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr) + { + if (itr->second->spellId == spellInfo->Id && itr->second->racemask == 0 && itr->second->learnOnGetSkill == 0) + { + valid = true; + SpellInfo const* prevSpell = spellInfo->GetPrevRankSpell(); + if (prevSpell && !player->HasSpell(prevSpell->Id)) + { + valid = false; + break; + } + if (GetTalentSpellPos(itr->second->spellId)) + if (!prevSpell || !player->HasSpell(prevSpell->Id) || spellInfo->GetRank() == 1) + valid = false; + break; + } + } + + if (valid) + player->learnSpell(spellInfo->Id, false); + } + LearnSpellsForNewLevel(player, ++level); + } +}; + +void AddSC_LearnSpellsOnLevelUp() +{ + new LearnSpellsOnLevelUp(); +} \ No newline at end of file diff --git a/learn_spells_on_login.cpp b/learn_spells_on_login.cpp new file mode 100644 index 0000000..1df30c1 --- /dev/null +++ b/learn_spells_on_login.cpp @@ -0,0 +1,286 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ + #include "ScriptPCH.h" + + enum SkillSpells + { + SPELL_SWORDS = 201, + SPELL_AXES = 196, + SPELL_BOWS = 264, + SPELL_GUNS = 266, + SPELL_MACES = 198, + SPELL_DEFENSE = 204, + SPELL_STAVES = 227, + SPELL_TWO_HANDED_SWORDS = 202, + SPELL_TWO_HANDED_MACES = 199, + SPELL_TWO_HANDED_AXES = 197, + SPELL_UNARMED = 203, + SPELL_DAGGERS = 1180, + SPELL_THROWN = 2567, + SPELL_CROSSBOW = 5011, + SPELL_WANDS = 5009, + SPELL_POLEARMS = 200, + SPELL_FIST_WEAPON = 15590, + SPELL_LOCKPICKING = 6460, + + }; + + class skills_on_login : public PlayerScript + { + public: + skills_on_login() : PlayerScript("skills_on_login") { } + + void OnLogin(Player * player) + { + if(player->HasAtLoginFlag(AT_LOGIN_FIRST)) + { + switch(player->getClass()) + { + case CLASS_PALADIN: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + + }break; + + case CLASS_SHAMAN: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + + case CLASS_WARRIOR: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + + case CLASS_HUNTER: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + }break; + + case CLASS_ROGUE: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + player->learnSpell(SPELL_LOCKPICKING, true); + + }break; + + case CLASS_DRUID: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + + case CLASS_MAGE: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + + case CLASS_WARLOCK: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + + case CLASS_PRIEST: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + + case CLASS_DEATH_KNIGHT: + { + player->learnSpell(SPELL_SWORDS, true); + player->learnSpell(SPELL_AXES, true); + player->learnSpell(SPELL_BOWS, true); + player->learnSpell(SPELL_GUNS, true); + player->learnSpell(SPELL_MACES, true); + player->learnSpell(SPELL_DEFENSE, true); + player->learnSpell(SPELL_STAVES, true); + player->learnSpell(SPELL_TWO_HANDED_SWORDS, true); + player->learnSpell(SPELL_TWO_HANDED_MACES, true); + player->learnSpell(SPELL_TWO_HANDED_AXES, true); + player->learnSpell(SPELL_UNARMED, true); + player->learnSpell(SPELL_DAGGERS, true); + player->learnSpell(SPELL_THROWN, true); + player->learnSpell(SPELL_CROSSBOW, true); + player->learnSpell(SPELL_WANDS, true); + player->learnSpell(SPELL_POLEARMS, true); + player->learnSpell(SPELL_FIST_WEAPON, true); + + }break; + } + player->MonsterWhisper("You now have All Weaponskills and maxed!", player->GetGUID()); + player->UpdateSkillsToMaxSkillsForLevel(); + } + } + }; + + void AddSC_skills_on_first_login() + { + new skills_on_login; + } \ No newline at end of file diff --git a/login_announce.cpp b/login_announce.cpp new file mode 100644 index 0000000..1dae967 --- /dev/null +++ b/login_announce.cpp @@ -0,0 +1,51 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +class login_announce : public PlayerScript +{ + public: + login_announce() : PlayerScript("login_announce") + { + } + void OnLogin(Player *player) + { + if( !player || !player->GetSession() ) + return; + + char msg[41] = { NULL }; + switch(player->GetSession()->GetSecurity()) + { + case SEC_PLAYER: + snprintf(msg, 40, "[|cffff6060Player]: %s ha conectado!", player->GetName()); + break; + + } + sWorld->SendGlobalText(msg, NULL); + } + + + +}; + +void AddSC_login_announce() +{ + new login_announce; +} \ No newline at end of file diff --git a/monturasenpj.cpp b/monturasenpj.cpp new file mode 100644 index 0000000..fa20a4d --- /dev/null +++ b/monturasenpj.cpp @@ -0,0 +1,54 @@ +#include + +class AccountMounts : public PlayerScript +{ + static const bool limitrace = false; // This set to true will only learn mounts from chars on the same team, do what you want. +public: + AccountMounts() : PlayerScript("AccountMounts") { } + + void OnLogin(Player* pPlayer, bool firstLogin) + { + std::vector Guids; + QueryResult result1 = CharacterDatabase.PQuery("SELECT guid, race FROM characters WHERE account = %u", pPlayer->GetSession()->GetAccountId()); + if (!result1) + return; + + do + { + Field* fields = result1->Fetch(); + + uint32 guid = fields[0].GetUInt32(); + uint32 race = fields[1].GetUInt8(); + + if ((Player::TeamForRace(race) == Player::TeamForRace(pPlayer->getRace())) || !limitrace) + Guids.push_back(result1->Fetch()[0].GetUInt32()); + + } while (result1->NextRow()); + + std::vector Spells; + + for (auto& i : Guids) + { + QueryResult result2 = CharacterDatabase.PQuery("SELECT spell FROM character_spell WHERE guid = %u", i); + if (!result2) + continue; + + do + { + Spells.push_back(result2->Fetch()[0].GetUInt32()); + } while (result2->NextRow()); + } + + for (auto& i : Spells) + { + auto sSpell = sSpellStore.LookupEntry(i); + if (sSpell->Effect[0] == SPELL_EFFECT_APPLY_AURA && sSpell->EffectApplyAuraName[0] == SPELL_AURA_MOUNTED) + pPlayer->LearnSpell(sSpell->Id, false); + } + } +}; + +void AddSC_accontmounts() +{ + new AccountMounts; +} diff --git a/npc_enchant.cpp b/npc_enchant.cpp new file mode 100644 index 0000000..6157684 --- /dev/null +++ b/npc_enchant.cpp @@ -0,0 +1,996 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +enum Enchants +{ + ENCHANT_WEP_BLADE_WARD = 3869, + ENCHANT_WEP_BLOOD_DRAINING = 3870, + ENCHANT_WEP_BERSERKING = 3789, + + ENCHANT_WEP_ACCURACY = 3788, + ENCHANT_WEP_AGILITY_1H = 1103, + ENCHANT_WEP_AGILITY_2H = 2670, + ENCHANT_WEP_SPIRIT = 3844, + ENCHANT_WEP_BATTLEMASTER = 2675, + ENCHANT_WEP_BLACK_MAGIC = 3790, + ENCHANT_WEP_ICEBREAKER = 3239, + ENCHANT_WEP_LIFEWARD = 3241, + ENCHANT_WEP_MIGHTY_SPELL_POWER = 3834, // One-hand + ENCHANT_WEP_GREATER_SPELL_POWER = 3854, // Two-hand (staff) + ENCHANT_WEP_MONGOOSE = 2673, + ENCHANT_WEP_EXECUTIONER = 3225, + ENCHANT_WEP_POTENCY = 3833, + ENCHANT_WEP_TITANGUARD = 3851, + ENCHANT_WEP_MASSACRE = 3827, + + ENCHANT_WEP_CINDERGLACIER = 3369, + ENCHANT_WEP_LICHBANE = 3366, + ENCHANT_WEP_RAZORICE = 3370, + ENCHANT_WEP_SPELLBREAKING = 3595, + ENCHANT_WEP_SPELLSHATTERING = 3367, + ENCHANT_WEP_SWORDBREAKING = 3594, + ENCHANT_WEP_SWORDSHATTERING = 3365, + ENCHANT_WEP_FALLEN_CRUSADER = 3368, + ENCHANT_WEP_NERUBIAN_CARAPACE = 3883, + ENCHANT_WEP_STONESKIN_GARGOYLE = 3847, + + ENCHANT_WEP_TITANIUM_CHAIN = 3731, + + ENCHANT_SHIELD_DEFENSE = 1952, + ENCHANT_SHIELD_INTELLECT = 1128, + ENCHANT_SHIELD_MAJOR_STAMINA = 1071, + ENCHANT_SHIELD_RESILIENCE = 3229, + + ENCHANT_SHIELD_TITANIUM_PLATING = 3849, + ENCHANT_SHIELD_TITANIUM_SPIKE = 3748, + + ENCHANT_HEAD_BLISSFUL_MENDING = 3819, + ENCHANT_HEAD_BURNING_MYSTERIES = 3820, + ENCHANT_HEAD_DOMINANCE = 3796, + ENCHANT_HEAD_SAVAGE_GLADIATOR = 3842, + ENCHANT_HEAD_STALWART_PROTECTOR = 3818, + ENCHANT_HEAD_TORMENT = 3817, + ENCHANT_HEAD_TRIUMPH = 3795, + + ENCHANT_SHOULDER_MASTERS_AXE = 3835, + ENCHANT_SHOULDER_MASTERS_CRAG = 3836, + ENCHANT_SHOULDER_MASTERS_PINNACLE = 3837, + ENCHANT_SHOULDER_MASTERS_STORM = 3838, + ENCHANT_SHOULDER_GREATER_AXE = 3808, + ENCHANT_SHOULDER_GREATER_CRAG = 3809, + ENCHANT_SHOULDER_GREATER_GLADIATOR = 3852, + ENCHANT_SHOULDER_GREATER_PINNACLE = 3811, + ENCHANT_SHOULDER_GREATER_STORM = 3810, + ENCHANT_SHOULDER_DOMINANCE = 3794, + ENCHANT_SHOULDER_TRIUMPH = 3793, + + ENCHANT_CLOAK_DARKGLOW_EMBROIDERY = 3728, + ENCHANT_CLOAK_SWORDGUARD_EMBROIDERY = 3730, + ENCHANT_CLOAK_LIGHTWEAVE_EMBROIDERY = 3722, + ENCHANT_CLOAK_FLEXWEAVE_UNDERLAY = 3605, + ENCHANT_CLOAK_SPRINGY_ARACHNOWEAVE = 3859, + ENCHANT_CLOAK_WISDOM = 3296, + ENCHANT_CLOAK_TITANWEAVE = 1951, + ENCHANT_CLOAK_SPELL_PIERCING = 3243, + ENCHANT_CLOAK_SHADOW_ARMOR = 3256, + ENCHANT_CLOAK_MIGHTY_ARMOR = 3294, + ENCHANT_CLOAK_MAJOR_AGILITY = 1099, + ENCHANT_CLOAK_GREATER_SPEED = 3831, + + ENCHANT_CHEST_EXCEPTIONAL_MANA = 3233, + ENCHANT_CHEST_GREATER_MANA_RESTO = 3533, + ENCHANT_CHEST_EXCEPTIONAL_RESILIENCE= 3245, + ENCHANT_CHEST_SUPER_HEALTH = 3297, + ENCHANT_CHEST_ALL_STATS = 3832, + + ENCHANT_BRACER_GREATER_ASSAULT = 3845, + ENCHANT_BRACER_EXCEPTIONAL_INTELLECT= 3458, + ENCHANT_BRACER_MAJOR_SPIRIT = 1147, + ENCHANT_BRACER_EXPERTISE = 3231, + ENCHANT_BRACER_GREATER_STATS = 2661, + ENCHANT_BRACER_SUPERIOR_SPELLPOWER = 2332, + ENCHANT_BRACER_MAJOR_STAMINA = 3850, + + ENCHANT_BRACER_FUR_LINING_AP = 3756, + ENCHANT_BRACER_FUR_LINING_STAMINA = 3757, + ENCHANT_BRACER_FUR_LINING_SP = 3758, + ENCHANT_BRACER_ARCANE_RESIST = 3763, + ENCHANT_BRACER_NATURE_RESIST = 3762, + ENCHANT_BRACER_SHADOW_RESIST = 3761, + ENCHANT_BRACER_FROST_RESIST = 3760, + ENCHANT_BRACER_FIRE_RESIST = 3759, + + ENCHANT_BRACER_SOCKET_BRACER = 3717, + + ENCHANT_GLOVES_CRUSHER = 1603, + // EXTREMELY ugly hack for duplicate enchants + ENCHANT_GLOVES_EXPERTISE = -3231, + ENCHANT_GLOVES_PRECISION = 3234, + ENCHANT_GLOVES_GREATER_ASSAULT = 1603, + ENCHANT_GLOVES_MAJOR_AGILITY = 1097, + ENCHANT_GLOVES_EXCEPTIONAL_SPELLPOWER = 2330, + ENCHANT_GLOVES_ARMSMAN = 3253, + + ENCHANT_GLOVES_SOCKET_GLOVES = 3723, + + ENCHANT_GLOVES_PYROROCKET = 3603, + ENCHANT_GLOVES_HYPERSPEED_ACCELERATORS = 3604, + + ENCHANT_BELT_ETERNAL_BELT_BUCKLE = 3729, + ENCHANT_BELT_FRAG_BELT = 3601, + + ENCHANT_LEGS_FROSTHIDE_ARMOR = 3822, + ENCHANT_LEGS_ICESCALE_ARMOR = 3823, + ENCHANT_LEGS_EARTHEN_ARMOR = 3853, + ENCHANT_LEGS_SAPPHIRE_SPELLTHREAD = 3873, + ENCHANT_LEGS_BRILLIANT_SPELLTHREAD = 3872, + + ENCHANT_BOOTS_TUSKARRS_VITALITY = 3232, + ENCHANT_BOOTS_ICEWALKER = 2599, + ENCHANT_BOOTS_GREATER_ASSAULT = 1597, + ENCHANT_BOOTS_GREATER_SPIRIT = 528, + ENCHANT_BOOTS_GREATER_FORTITUDE = 3259, + ENCHANT_BOOTS_SUPERIOR_AGILITY = 983, + ENCHANT_BOOTS_NITRO_BOOSTS = 3606, + + ENCHANT_RING_STAMINA = 3791, + ENCHANT_RING_GREATER_SPELLPOWER = 3840, + ENCHANT_RING_ASSAULT = 3839, + + ENCHANT_RANGED_HEARTSEEKER_SCOPE = 3608, + ENCHANT_RANGED_SUN_SCOPE = 3607 +}; + +Item* PlayerAddItem(Player* player, uint32 item_id) +{ + uint8 count = 1; + uint32 noSpaceForCount = 0; + ItemPosCountVec dest; + + InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, + dest, item_id, count, &noSpaceForCount); + if (msg != EQUIP_ERR_OK) + count -= noSpaceForCount; + + Item* item = player->StoreNewItem(dest, item_id, true, + Item::GenerateItemRandomPropertyId(item_id)); + + if (noSpaceForCount > 0) + { + player->GetSession()->SendNotification("Please make room in your " + "inventory first."); + return NULL; + } + return item; +} + +void EnchantWithItem(Player* player, uint32 item_id, Item* target) +{ + Item* item = PlayerAddItem(player, item_id); + SpellCastTargets* targets = new SpellCastTargets(); + targets->SetItemTarget(target); + player->CastItemUseSpell(item, *targets, 1, 0); +} + +void EnchantWithSpell(Player* player, uint32 spell_id, Item* item) +{ + SpellCastTargets* targets = new SpellCastTargets(); + targets->SetItemTarget(item); + player->CastSpell(*targets, sSpellMgr->GetSpellInfo(spell_id), + NULL, TRIGGERED_IGNORE_POWER_AND_REAGENT_COST); +} + +void Enchant(Player* player, Creature* creature, Item* item, uint32 enchantid) +{ + if (!item) + { + player->GetSession()->SendNotification("Primero equipa el item."); + return; + } + + uint32 item_id = 0; + switch (enchantid) + { + case ENCHANT_WEP_GREATER_SPELL_POWER: + case ENCHANT_WEP_AGILITY_2H: + case ENCHANT_WEP_MASSACRE: + if (item->GetTemplate()->InventoryType != INVTYPE_2HWEAPON) + { + ChatHandler(player->GetSession()).PSendSysMessage("Esta no es un arma de 2M"); + return; + } + break; + case ENCHANT_SHIELD_DEFENSE: + case ENCHANT_SHIELD_INTELLECT: + case ENCHANT_SHIELD_MAJOR_STAMINA: + case ENCHANT_SHIELD_RESILIENCE: + case ENCHANT_SHIELD_TITANIUM_PLATING: + case ENCHANT_SHIELD_TITANIUM_SPIKE: + if (item->GetTemplate()->InventoryType != INVTYPE_SHIELD) + { + ChatHandler(player->GetSession()).PSendSysMessage("That isn't a shield"); + return; + } + break; + case ENCHANT_RANGED_HEARTSEEKER_SCOPE: + case ENCHANT_RANGED_SUN_SCOPE: + if (item->GetTemplate()->InventoryType != INVTYPE_RANGED && + item->GetTemplate()->InventoryType != INVTYPE_RANGEDRIGHT) + { + ChatHandler(player->GetSession()).PSendSysMessage("That isn't a ranged weapon"); + return; + } + break; + default: + break; + } + + player->ApplyEnchantment(item, PERM_ENCHANTMENT_SLOT, false); + item->ClearEnchantment(PERM_ENCHANTMENT_SLOT); + item->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchantid, 0, 0); + player->ApplyEnchantment(item, PERM_ENCHANTMENT_SLOT, true); + + switch (enchantid) + { + case ENCHANT_BELT_ETERNAL_BELT_BUCKLE: + EnchantWithItem(player, 41611, item); + break; + case ENCHANT_BRACER_SOCKET_BRACER: + PlayerAddItem(player, 5956); // Blacksmith hammer + EnchantWithSpell(player, 55628, item); + player->DestroyItemCount(5956, -1, true, false); + break; + case ENCHANT_GLOVES_SOCKET_GLOVES: + PlayerAddItem(player, 5956); // Blacksmith hammer + EnchantWithSpell(player, 55641, item); + player->DestroyItemCount(5956, -1, true, false); + break; + } + + const char* item_name = item->GetTemplate()->Name1.c_str(); + char* message; + player->GetSession()->SendNotification("|cff0000FF%s |cffFF0000Item Encantado!", item->GetTemplate()->Name1.c_str()); +} + +class npc_enchantment : public CreatureScript +{ + public: + npc_enchantment() : CreatureScript("npc_enchantment") { } + int selected_enchant; + + bool OnGossipHello(Player* player, Creature* creature) + { + ShowMainMenu(player, creature); + return true; + } + + void ShowMainMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Weapon_ShortBlade_02:24|t|r[Encantar Arma]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Weapon_Staff_109:24|t|r[Encantar Arma 2M]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Weapon_ShortBlade_02:24|t|r[Encantar Arma a Distancia]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\Ability_Warrior_ShieldWall:24|t|r[Encantar Escudo]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Misc_Head_Gnome_01:24|t|r[Encantar Casco]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_SHOULDER_97:24|t|r[Encantar Hombros]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\Item_icecrowncloak:24|t|r[Encantar Capa]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Misc_Desecrated_ClothChest:24|t|r[Encantar Pecho]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Misc_Desecrated_MailBracer:24|t|r[Encantar Muneca]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Misc_Desecrated_PlateGloves:24|t|r[Encantar Guantes]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Belt_28:24|t|r[Encantar Cintura Ebilla Eterna]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Misc_Desecrated_ClothPants:24|t|r[Encantar Piernas]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff00ff00|TInterface\\icons\\INV_Misc_Desecrated_LeatherBoots:24|t|r[Encantar Botas]", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + if (player->HasSkill(SKILL_ENCHANTING) && player->GetSkillValue(SKILL_ENCHANTING) >= 450) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Encantar Anillos", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void Show1HWeaponMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + if (player->getClass() == CLASS_DEATH_KNIGHT) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Cinderglacier", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_CINDERGLACIER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Lichbane", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_LICHBANE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Razorice", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_RAZORICE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Spellbreaking", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_SPELLBREAKING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Swordbreaking", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_SWORDBREAKING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of the Fallen Crusader", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_FALLEN_CRUSADER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of the Nerubian Carapace", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_NERUBIAN_CARAPACE); + } + if (player->HasSkill(SKILL_ENCHANTING) && player->GetSkillValue(SKILL_ENCHANTING) >= 450) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Blade Ward", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_BLADE_WARD); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Blood Draining", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_BLOOD_DRAINING); + } + + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Accuracy -- 25 Hit + 25 Crit", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_ACCURACY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Black Magic -- 250 Spell Haste Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_BLACK_MAGIC); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Battlemaster -- Chance of heal on hit", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_BATTLEMASTER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Berserking -- 400 Attack Power Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_BERSERKING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exceptional Agility -- 26 Agility", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_AGILITY_1H); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exceptional Spirit -- 45 Spirit", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_SPIRIT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Executioner -- 120 Arm Pen Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_EXECUTIONER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Icebreaker -- Fire damage on hit", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_ICEBREAKER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Lifeward -- Chance of heal on hit", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_LIFEWARD); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Mighty Spellpower -- 63 Spell Power", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_MIGHTY_SPELL_POWER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Mongoose -- 120 Agility Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_MONGOOSE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Superior Potency -- 65 Attack Power", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_POTENCY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Titanguard -- 50 Stamina", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_TITANGUARD); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Titanium Weapon Chain -- Less Disarm Time", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_TITANIUM_CHAIN); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void Show2HWeaponMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + if (player->getClass() == CLASS_DEATH_KNIGHT) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Cinderglacier", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_CINDERGLACIER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Lichbane", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_LICHBANE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Razorice", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_RAZORICE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Spellshattering", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_SPELLSHATTERING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of Swordshattering", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_SWORDSHATTERING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of the Fallen Crusader", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_FALLEN_CRUSADER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Rune of the Stoneskin Gargoyle", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_STONESKIN_GARGOYLE); + } + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Berserking -- 400 Attack Power Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_BERSERKING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Executioner -- 120 Arm Pen Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_EXECUTIONER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Spellpower -- 81 Spell Power", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_GREATER_SPELL_POWER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Major Agility -- 35 Agility", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_AGILITY_2H); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Massacre -- 110 Attack Power", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_MASSACRE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Mongoose --120 Agility Proc", GOSSIP_SENDER_MAIN, + ENCHANT_WEP_MONGOOSE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowShieldMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Defense -- 20 Defense", GOSSIP_SENDER_MAIN, + ENCHANT_SHIELD_DEFENSE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Intellect -- 25 Intellect", GOSSIP_SENDER_MAIN, + ENCHANT_SHIELD_INTELLECT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Major Stamina -- 18 Stamina", GOSSIP_SENDER_MAIN, + ENCHANT_SHIELD_MAJOR_STAMINA); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Resilience -- 12 Resilience", GOSSIP_SENDER_MAIN, + ENCHANT_SHIELD_RESILIENCE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Titanium Plating -- 36 Block", GOSSIP_SENDER_MAIN, + ENCHANT_SHIELD_TITANIUM_PLATING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Titanium Shield Spike -- 81 Block + 50% less Disarm", GOSSIP_SENDER_MAIN, + ENCHANT_SHIELD_TITANIUM_SPIKE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowHeadMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of Blissful Mending -- 30 Spell Power + 10 Mp5", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_BLISSFUL_MENDING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of Burning Mysteries -- 25 Fire Resist + 30 Stam", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_BURNING_MYSTERIES); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of Dominance -- 30 Spell Power + 20 Crit", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_DOMINANCE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of The Savage Gladiator -- 30 Stamina + 25 Resil", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_SAVAGE_GLADIATOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of The Stalwart Protector -- 37 Stamina + Defense", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_STALWART_PROTECTOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of Torment -- 29 Spell Power + 20 Resil", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_TORMENT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Arcanum of Triumph -- 50 Attack Power + 20 Resil", GOSSIP_SENDER_MAIN, + ENCHANT_HEAD_TRIUMPH); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowShouldersMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + if (player->HasSkill(SKILL_INSCRIPTION) && player->GetSkillValue(SKILL_INSCRIPTION) >= 450) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Master's Inscription of the Axe", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_MASTERS_AXE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Master's Inscription of the Crag", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_MASTERS_CRAG); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Master's Inscription of the Pinnacle", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_MASTERS_PINNACLE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Master's Inscription of the Storm", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_MASTERS_STORM); + } + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Inscription of the Axe -- 40 Attack Power + 15 Crit", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_GREATER_AXE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Inscription of the Crag -- 24 Spell Power + 8 Mp5", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_GREATER_CRAG); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Inscription of the Pinnacle -- 30 Stamina + 15 Resil", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_GREATER_PINNACLE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Inscription of the Gladiator -- 20 Dodge + 15 Defense", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_GREATER_GLADIATOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Inscription of the Storm -- 24 Spell Power + 15 Crit", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_GREATER_STORM); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Inscription of Dominance -- 23 Spell Power + 15 Resil", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_DOMINANCE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Inscription of Triumph -- 40 Attack Power + 15 Resil", GOSSIP_SENDER_MAIN, + ENCHANT_SHOULDER_TRIUMPH); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowCloakMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + if (player->HasSkill(SKILL_ENGINEERING) && player->GetSkillValue(SKILL_ENGINEERING) >= 450) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Springy Arachnoweave", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_SPRINGY_ARACHNOWEAVE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Flexweave Underlay", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_FLEXWEAVE_UNDERLAY); + } + if (player->getClass() == CLASS_ROGUE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Shadow Armor", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_SHADOW_ARMOR); + if (player->HasSkill(SKILL_TAILORING) && player->GetSkillValue(SKILL_TAILORING) >= 450) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Darkglow Embroidery", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_DARKGLOW_EMBROIDERY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Lightweave Embroidery", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_LIGHTWEAVE_EMBROIDERY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Swordguard Embroidery", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_SWORDGUARD_EMBROIDERY); + } + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Wisdom -- 10 Spirit +2% reduce threat", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_WISDOM); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Titanweave -- 16 Defense", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_TITANWEAVE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Spell Piercing -- 35 Spell Pen", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_SPELL_PIERCING); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Mighty Armor -- 225 Armor", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_MIGHTY_ARMOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Major Agility -- 22 Agility", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_MAJOR_AGILITY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Speed -- 23 Haste", GOSSIP_SENDER_MAIN, + ENCHANT_CLOAK_GREATER_SPEED); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowChestMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exceptional Mana -- 150 Mana", GOSSIP_SENDER_MAIN, + ENCHANT_CHEST_EXCEPTIONAL_MANA); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Mana Restoration -- 10 Mp5", GOSSIP_SENDER_MAIN, + ENCHANT_CHEST_GREATER_MANA_RESTO); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exceptional Resilience -- 20 Resilience", GOSSIP_SENDER_MAIN, + ENCHANT_CHEST_EXCEPTIONAL_RESILIENCE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Super Health -- 225 Health", GOSSIP_SENDER_MAIN, + ENCHANT_CHEST_SUPER_HEALTH); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "10 of all stats", GOSSIP_SENDER_MAIN, + ENCHANT_CHEST_ALL_STATS); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowBracerMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Assault -- 50 Attack Power", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_GREATER_ASSAULT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exceptional Intellect -- 16 Intellect", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_EXCEPTIONAL_INTELLECT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Major Spirit -- 18 Spirit", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_MAJOR_SPIRIT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Expertise -- 15 Expertise", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_EXPERTISE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Stats -- 6 all stats", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_GREATER_STATS); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Superior Spellpower -- 30 Spell Power", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_SUPERIOR_SPELLPOWER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Major Stamina -- 40 Stamina", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_MAJOR_STAMINA); + if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetSkillValue(SKILL_LEATHERWORKING) >= 450) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Attack Power", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_FUR_LINING_AP); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Stamina", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_FUR_LINING_STAMINA); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Spell Power", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_FUR_LINING_SP); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Arcane Resist", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_ARCANE_RESIST); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Nature Resist", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_NATURE_RESIST); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Shadow Resist", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_SHADOW_RESIST); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Frost Resist", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_FROST_RESIST); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Fur Lining: Fire Resist", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_FIRE_RESIST); + } + if (player->HasSkill(SKILL_BLACKSMITHING) && player->GetSkillValue(SKILL_BLACKSMITHING) >= 450) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Socket Bracer", GOSSIP_SENDER_MAIN, + ENCHANT_BRACER_SOCKET_BRACER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowGlovesMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Armsman -- 2% Threat 10 Parry", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_ARMSMAN); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Exceptional Spellpower -- 23 Spell Power", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_EXCEPTIONAL_SPELLPOWER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Expertise -- 15 Expertise", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_EXPERTISE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Assault -- 44 Attack Power", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_CRUSHER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Major Agility -- 20 Agility", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_MAJOR_AGILITY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Precision -- 20 Hit Rating", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_PRECISION); + if (player->HasSkill(SKILL_BLACKSMITHING) && player->GetSkillValue(SKILL_BLACKSMITHING) >= 450) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Socket Gloves", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_SOCKET_GLOVES); + if (player->HasSkill(SKILL_ENGINEERING) && player->GetSkillValue(SKILL_ENGINEERING) >= 450) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Hand-Mounted Pyro Rocket", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_PYROROCKET); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Hyperspeed Accelerators", GOSSIP_SENDER_MAIN, + ENCHANT_GLOVES_HYPERSPEED_ACCELERATORS); + } + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowBeltMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Eternal Belt Buckle", GOSSIP_SENDER_MAIN, + ENCHANT_BELT_ETERNAL_BELT_BUCKLE); + if (player->HasSkill(SKILL_ENGINEERING) && player->GetSkillValue(SKILL_ENGINEERING) >= 450) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Frag Belt", GOSSIP_SENDER_MAIN, + ENCHANT_BELT_FRAG_BELT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowLegsMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Frosthide Leg Armor -- 55 Stam 22 Agil", GOSSIP_SENDER_MAIN, + ENCHANT_LEGS_FROSTHIDE_ARMOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Icescale Leg Armor -- 75 AP 22 Crit", GOSSIP_SENDER_MAIN, + ENCHANT_LEGS_ICESCALE_ARMOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Earthen Leg Armor -- 40 Resil 28 Stam", GOSSIP_SENDER_MAIN, + ENCHANT_LEGS_EARTHEN_ARMOR); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Sapphire Spellthread -- 50 SP 30 Stam", GOSSIP_SENDER_MAIN, + ENCHANT_LEGS_SAPPHIRE_SPELLTHREAD); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Brilliant Spellthread -- 50 SP 22 Spirit", GOSSIP_SENDER_MAIN, + ENCHANT_LEGS_BRILLIANT_SPELLTHREAD); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowBootsMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Icewalker -- 12 Hit + 12 Crit", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_ICEWALKER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Assault -- 32 Assult", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_GREATER_ASSAULT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Fortitude -- 22 Stamins", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_GREATER_FORTITUDE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Spirit -- 18 Spirit", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_GREATER_SPIRIT); + if (player->HasSkill(SKILL_ENGINEERING) && player->GetSkillValue(SKILL_ENGINEERING) >= 450) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Nitro Boosts", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_NITRO_BOOSTS); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Superior Agility -- 16 Agility", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_SUPERIOR_AGILITY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Tuskarr's Vitality -- 15 Stam + Speed Increase", GOSSIP_SENDER_MAIN, + ENCHANT_BOOTS_TUSKARRS_VITALITY); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowRingsMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Assault", GOSSIP_SENDER_MAIN, + ENCHANT_RING_ASSAULT); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Greater Spellpower", GOSSIP_SENDER_MAIN, + ENCHANT_RING_GREATER_SPELLPOWER); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Stamina", GOSSIP_SENDER_MAIN, + ENCHANT_RING_STAMINA); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + void ShowRangedMenu(Player* player, Creature* creature) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Heartseeker Scope", GOSSIP_SENDER_MAIN, + ENCHANT_RANGED_HEARTSEEKER_SCOPE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Sun Scope", GOSSIP_SENDER_MAIN, + ENCHANT_RANGED_SUN_SCOPE); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Back", GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + int slot = -1; + bool check_adjacent_slot = true; + switch (action) + { + case -1: // Back + ShowMainMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + Show1HWeaponMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + Show2HWeaponMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + ShowShieldMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + ShowHeadMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + ShowShouldersMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + ShowCloakMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 7: + ShowChestMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 8: + ShowBracerMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 9: + ShowGlovesMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 10: + ShowBeltMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 11: + ShowLegsMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + ShowBootsMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + ShowRangedMenu(player, creature); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + ShowRingsMenu(player, creature); + break; + + // 1H weapons + case ENCHANT_WEP_BLADE_WARD: + case ENCHANT_WEP_BLOOD_DRAINING: + case ENCHANT_WEP_AGILITY_1H: + case ENCHANT_WEP_SPIRIT: + case ENCHANT_WEP_BERSERKING: + case ENCHANT_WEP_ACCURACY: + case ENCHANT_WEP_BLACK_MAGIC: + case ENCHANT_WEP_BATTLEMASTER: + case ENCHANT_WEP_ICEBREAKER: + case ENCHANT_WEP_LIFEWARD: + case ENCHANT_WEP_TITANGUARD: + case ENCHANT_WEP_POTENCY: + case ENCHANT_WEP_MONGOOSE: + case ENCHANT_WEP_MIGHTY_SPELL_POWER: + case ENCHANT_WEP_EXECUTIONER: + case ENCHANT_WEP_TITANIUM_CHAIN: + + // 2H weapons + // case ENCHANT_WEP_BERSERKING: + // case ENCHANT_WEP_MONGOOSE: + // case ENCHANT_WEP_EXECUTIONER: + // case ENCHANT_WEP_TITANIUM_CHAIN: + case ENCHANT_WEP_GREATER_SPELL_POWER: + case ENCHANT_WEP_AGILITY_2H: + case ENCHANT_WEP_MASSACRE: + + // Runeforging + case ENCHANT_WEP_CINDERGLACIER: + case ENCHANT_WEP_LICHBANE: + case ENCHANT_WEP_RAZORICE: + case ENCHANT_WEP_SPELLBREAKING: + case ENCHANT_WEP_SPELLSHATTERING: + case ENCHANT_WEP_SWORDBREAKING: + case ENCHANT_WEP_SWORDSHATTERING: + case ENCHANT_WEP_FALLEN_CRUSADER: + case ENCHANT_WEP_NERUBIAN_CARAPACE: + case ENCHANT_WEP_STONESKIN_GARGOYLE: + slot = EQUIPMENT_SLOT_MAINHAND; + break; + + // Shields + case ENCHANT_SHIELD_DEFENSE: + case ENCHANT_SHIELD_INTELLECT: + case ENCHANT_SHIELD_RESILIENCE: + case ENCHANT_SHIELD_TITANIUM_PLATING: + case ENCHANT_SHIELD_MAJOR_STAMINA: + case ENCHANT_SHIELD_TITANIUM_SPIKE: + slot = EQUIPMENT_SLOT_OFFHAND; + break; + + // Head + case ENCHANT_HEAD_BLISSFUL_MENDING: + case ENCHANT_HEAD_BURNING_MYSTERIES: + case ENCHANT_HEAD_DOMINANCE: + case ENCHANT_HEAD_SAVAGE_GLADIATOR: + case ENCHANT_HEAD_STALWART_PROTECTOR: + case ENCHANT_HEAD_TORMENT: + case ENCHANT_HEAD_TRIUMPH: + slot = EQUIPMENT_SLOT_HEAD; + break; + + // Shoulders + case ENCHANT_SHOULDER_MASTERS_AXE: + case ENCHANT_SHOULDER_MASTERS_CRAG: + case ENCHANT_SHOULDER_MASTERS_PINNACLE: + case ENCHANT_SHOULDER_MASTERS_STORM: + case ENCHANT_SHOULDER_GREATER_AXE: + case ENCHANT_SHOULDER_GREATER_CRAG: + case ENCHANT_SHOULDER_GREATER_GLADIATOR: + case ENCHANT_SHOULDER_GREATER_PINNACLE: + case ENCHANT_SHOULDER_GREATER_STORM: + case ENCHANT_SHOULDER_DOMINANCE: + case ENCHANT_SHOULDER_TRIUMPH: + slot = EQUIPMENT_SLOT_SHOULDERS; + break; + + // Cloak + case ENCHANT_CLOAK_DARKGLOW_EMBROIDERY: + case ENCHANT_CLOAK_SWORDGUARD_EMBROIDERY: + case ENCHANT_CLOAK_FLEXWEAVE_UNDERLAY: + case ENCHANT_CLOAK_LIGHTWEAVE_EMBROIDERY: + case ENCHANT_CLOAK_SPRINGY_ARACHNOWEAVE: + case ENCHANT_CLOAK_WISDOM: + case ENCHANT_CLOAK_TITANWEAVE: + case ENCHANT_CLOAK_SPELL_PIERCING: + case ENCHANT_CLOAK_SHADOW_ARMOR: + case ENCHANT_CLOAK_MIGHTY_ARMOR: + case ENCHANT_CLOAK_MAJOR_AGILITY: + case ENCHANT_CLOAK_GREATER_SPEED: + slot = EQUIPMENT_SLOT_BACK; + break; + + // Chest + case ENCHANT_CHEST_EXCEPTIONAL_MANA: + case ENCHANT_CHEST_GREATER_MANA_RESTO: + case ENCHANT_CHEST_EXCEPTIONAL_RESILIENCE: + case ENCHANT_CHEST_SUPER_HEALTH: + case ENCHANT_CHEST_ALL_STATS: + slot = EQUIPMENT_SLOT_CHEST; + break; + + // Bracers + case ENCHANT_BRACER_GREATER_ASSAULT: + case ENCHANT_BRACER_EXCEPTIONAL_INTELLECT: + case ENCHANT_BRACER_MAJOR_SPIRIT: + case ENCHANT_BRACER_EXPERTISE: + case ENCHANT_BRACER_GREATER_STATS: + case ENCHANT_BRACER_SUPERIOR_SPELLPOWER: + case ENCHANT_BRACER_MAJOR_STAMINA: + case ENCHANT_BRACER_FUR_LINING_AP: + case ENCHANT_BRACER_FUR_LINING_STAMINA: + case ENCHANT_BRACER_FUR_LINING_SP: + case ENCHANT_BRACER_ARCANE_RESIST: + case ENCHANT_BRACER_NATURE_RESIST: + case ENCHANT_BRACER_SHADOW_RESIST: + case ENCHANT_BRACER_FROST_RESIST: + case ENCHANT_BRACER_FIRE_RESIST: + case ENCHANT_BRACER_SOCKET_BRACER: + slot = EQUIPMENT_SLOT_WRISTS; + break; + + // Gloves + case ENCHANT_GLOVES_EXPERTISE: + case ENCHANT_GLOVES_PRECISION: + case ENCHANT_GLOVES_GREATER_ASSAULT: + case ENCHANT_GLOVES_MAJOR_AGILITY: + case ENCHANT_GLOVES_EXCEPTIONAL_SPELLPOWER: + case ENCHANT_GLOVES_ARMSMAN: + case ENCHANT_GLOVES_SOCKET_GLOVES: + case ENCHANT_GLOVES_PYROROCKET: + case ENCHANT_GLOVES_HYPERSPEED_ACCELERATORS: + slot = EQUIPMENT_SLOT_HANDS; + break; + + // Belt + case ENCHANT_BELT_ETERNAL_BELT_BUCKLE: + case ENCHANT_BELT_FRAG_BELT: + slot = EQUIPMENT_SLOT_WAIST; + break; + + // Legs + case ENCHANT_LEGS_FROSTHIDE_ARMOR: + case ENCHANT_LEGS_ICESCALE_ARMOR: + case ENCHANT_LEGS_EARTHEN_ARMOR: + case ENCHANT_LEGS_SAPPHIRE_SPELLTHREAD : + case ENCHANT_LEGS_BRILLIANT_SPELLTHREAD: + slot = EQUIPMENT_SLOT_LEGS; + break; + + // Boots + case ENCHANT_BOOTS_TUSKARRS_VITALITY: + case ENCHANT_BOOTS_ICEWALKER: + case ENCHANT_BOOTS_GREATER_ASSAULT: + case ENCHANT_BOOTS_GREATER_SPIRIT: + case ENCHANT_BOOTS_GREATER_FORTITUDE: + case ENCHANT_BOOTS_SUPERIOR_AGILITY: + case ENCHANT_BOOTS_NITRO_BOOSTS: + slot = EQUIPMENT_SLOT_FEET; + break; + + // Rings + case ENCHANT_RING_STAMINA: + case ENCHANT_RING_GREATER_SPELLPOWER: + case ENCHANT_RING_ASSAULT: + slot = EQUIPMENT_SLOT_FINGER1; + break; + + // Ranged weapon + case ENCHANT_RANGED_HEARTSEEKER_SCOPE: + case ENCHANT_RANGED_SUN_SCOPE: + slot = EQUIPMENT_SLOT_RANGED; + break; + + // Main hand + case GOSSIP_ACTION_INFO_DEF + 20: + slot = EQUIPMENT_SLOT_MAINHAND; + action = selected_enchant; + check_adjacent_slot = false; + break; + + // Off hand + case GOSSIP_ACTION_INFO_DEF + 21: + slot = EQUIPMENT_SLOT_OFFHAND; + action = selected_enchant; + check_adjacent_slot = false; + break; + + default: + player->CLOSE_GOSSIP_MENU(); + break; + } + if (slot > -1) + { + // allows for a maximum of 2 duplicates, and the + // convenience of using enchant ids as gossip + // userdata + if (action < 0) + action = -action; + Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); + if (!item && slot == INVTYPE_RANGEDRIGHT) + item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, + INVTYPE_RANGEDRIGHT); + if (item && check_adjacent_slot && + item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT) != 0) + { + switch (slot) + { + case EQUIPMENT_SLOT_MAINHAND: + { + Item* offhand = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + if (offhand) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, + item->GetTemplate()->Name1.c_str(), + GOSSIP_SENDER_MAIN, + GOSSIP_ACTION_INFO_DEF + 20); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, + offhand->GetTemplate()->Name1.c_str(), + GOSSIP_SENDER_MAIN, + GOSSIP_ACTION_INFO_DEF + 21); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, + "Back", + GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + selected_enchant = action; + return true; + } + break; + } + case EQUIPMENT_SLOT_FINGER1: + { + Item* ring2 = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_FINGER2); + if (ring2) + { + player->PlayerTalkClass->ClearMenus(); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, + item->GetTemplate()->Name1.c_str(), + GOSSIP_SENDER_MAIN, + GOSSIP_ACTION_INFO_DEF + 20); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, + ring2->GetTemplate()->Name1.c_str(), + GOSSIP_SENDER_MAIN, + GOSSIP_ACTION_INFO_DEF + 21); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, + "Back", + GOSSIP_SENDER_MAIN, -1); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + selected_enchant = action; + return true; + } + break; + } + default: + break; + } + } + Enchant(player, creature, item, action); + ShowMainMenu(player, creature); + } + return true; + } +}; + +void AddSC_npc_enchantment() +{ + new npc_enchantment(); +} \ No newline at end of file diff --git a/npc_incansable_km.cpp b/npc_incansable_km.cpp new file mode 100644 index 0000000..1aa9b20 --- /dev/null +++ b/npc_incansable_km.cpp @@ -0,0 +1,282 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +enum defines +{ +// Guerrero Dps + warr_dps_cabeza = 70256 , + warr_dps_manos = 70255, + warr_dps_piernas = 70257, + warr_dps_pecho = 70254, + warr_dps_hombros = 70258, +// Paladin Heal + paladin_heal_cabeza = 70355, + paladin_heal_manos = 70354, + paladin_heal_piernas = 70356, + paladin_heal_pecho = 70353, + paladin_heal_hombros = 70357, +// Paladin Dps + paladin_dps_cabeza = 70251, + paladin_dps_manos = 70250, + paladin_dps_piernas = 70252, + paladin_dps_pecho = 70249, + paladin_dps_hombros = 70253, +// Dk Dps + dk_dps_cabeza = 70246, + dk_dps_manos = 70245, + dk_dps_piernas = 70247, + dk_dps_pecho = 70244, + dk_dps_hombros = 70248, +// Chaman Heal + chaman_heal_cabeza = 70266, + chaman_heal_manos = 70265, + chaman_heal_piernas = 70267, + chaman_heal_pecho = 70264, + chaman_heal_hombros = 70268, +// Chaman Elemental + chaman_dps_melee_cabeza = 70271, + chaman_dps_melee_manos = 70270, + chaman_dps_melee_piernas = 70272, + chaman_dps_melee_pecho = 70269, + chaman_dps_melee_hombros = 70273, +// Chaman Dps Spell + chaman_dps_spell_cabeza = 70276, + chaman_dps_spell_manos = 70275, + chaman_dps_spell_piernas = 70277, + chaman_dps_spell_pecho = 70274, + chaman_dps_spell_hombros = 70278, +// Brujo Dps + brujo_dps_cabeza = 70315, + brujo_dps_manos = 70314, + brujo_dps_piernas = 70316, + brujo_dps_pecho = 70317, + brujo_dps_hombros = 70318, +// Mago + mago_dps_cabeza = 70300, + mago_dps_manos = 70299, + mago_dps_piernas = 70301, + mago_dps_pecho = 70302, + mago_dps_hombros = 70303, +// Picaro + picaro_dps_cabeza = 70444, + picaro_dps_manos = 70295, + picaro_dps_piernas = 70297, + picaro_dps_pecho = 70294, + picaro_dps_hombros = 70298, +// Cazador + cazador_dps_cabeza = 70261, + cazador_dps_manos = 70260, + cazador_dps_piernas = 70262, + cazador_dps_pecho = 70259, + cazador_dps_hombros = 70263, +// Druida Heal + druida_heal_cabeza = 70285, + druida_heal_manos = 70284, + druida_heal_piernas = 70286, + druida_heal_pecho = 70287, + druida_heal_hombros = 70288, +// Druida Dps Spell + druida_dps_spell_cabeza = 70290, + druida_dps_spell_manos = 70289, + druida_dps_spell_piernas = 70291, + druida_dps_spell_pecho = 70292, + druida_dps_spell_hombros = 70293, +// Druida Dps + druida_dps_cabeza = 70280, + druida_dps_manos = 70279, + druida_dps_piernas = 70281, + druida_dps_pecho = 70282, + druida_dps_hombros = 70283, +// Sacerdote Dps + sacerdote_dps_cabeza = 70310, + sacerdote_dps_manos = 70309, + sacerdote_dps_piernas = 70311, + sacerdote_dps_pecho = 70312, + sacerdote_dps_hombros = 70313, +// Sacerdote Heal + sacerdote_heal_cabeza = 70305, + sacerdote_heal_manos = 70304, + sacerdote_heal_piernas = 70306, + sacerdote_heal_pecho = 70307, + sacerdote_heal_hombros = 70308, +}; +class npc_incansable_km : public CreatureScript +{ + public: + npc_incansable_km() : CreatureScript("npc_incansable_km"){} + bool OnGossipHello(Player * pPlayer, Creature * pCreature) + { + pPlayer->ADD_GOSSIP_ITEM(4, "Guerrero Dps", GOSSIP_SENDER_MAIN, 0); + pPlayer->ADD_GOSSIP_ITEM(4, "Paladin Heal", GOSSIP_SENDER_MAIN, 1); + pPlayer->ADD_GOSSIP_ITEM(4, "Paladin Dps", GOSSIP_SENDER_MAIN, 2); + pPlayer->ADD_GOSSIP_ITEM(4, "Dk Dps", GOSSIP_SENDER_MAIN, 3); + pPlayer->ADD_GOSSIP_ITEM(4, "Chaman Heal", GOSSIP_SENDER_MAIN, 4); + pPlayer->ADD_GOSSIP_ITEM(4, "Chaman Dps Melee", GOSSIP_SENDER_MAIN, 5); + pPlayer->ADD_GOSSIP_ITEM(4, "Chaman Dps Spell", GOSSIP_SENDER_MAIN, 6); + pPlayer->ADD_GOSSIP_ITEM(4, "Brujo Dps", GOSSIP_SENDER_MAIN, 7); + pPlayer->ADD_GOSSIP_ITEM(4, "Mago Dps", GOSSIP_SENDER_MAIN, 8); + pPlayer->ADD_GOSSIP_ITEM(4, "Picaro Dps", GOSSIP_SENDER_MAIN, 9); + pPlayer->ADD_GOSSIP_ITEM(4, "Cazador Dps", GOSSIP_SENDER_MAIN, 10); + pPlayer->ADD_GOSSIP_ITEM(4, "Druida Heal", GOSSIP_SENDER_MAIN, 11); + pPlayer->ADD_GOSSIP_ITEM(4, "Druida Dps", GOSSIP_SENDER_MAIN, 12); + pPlayer->ADD_GOSSIP_ITEM(4, "Druida Spell", GOSSIP_SENDER_MAIN, 13); + pPlayer->ADD_GOSSIP_ITEM(4, "Sacerdote Dps", GOSSIP_SENDER_MAIN, 14); + pPlayer->ADD_GOSSIP_ITEM(4, "Sacerdote Heal", GOSSIP_SENDER_MAIN, 15); + pPlayer->PlayerTalkClass->SendGossipMenu(9425, pCreature->GetGUID()); + return true; + } + bool OnGossipSelect(Player * pPlayer, Creature * pCreature, uint32 /*uiSender*/, uint32 Action) + { + if (Action == 0) + { + pPlayer->AddItem(warr_dps_cabeza, 1); + pPlayer->AddItem(warr_dps_manos ,1); + pPlayer->AddItem(warr_dps_piernas ,1); + pPlayer->AddItem(warr_dps_pecho, 1); + pPlayer->AddItem(warr_dps_hombros, 1); + } + else if (Action == 1) + { + pPlayer->AddItem(paladin_heal_cabeza, 1); + pPlayer->AddItem(paladin_heal_manos ,1); + pPlayer->AddItem(paladin_heal_piernas ,1); + pPlayer->AddItem(paladin_heal_pecho, 1); + pPlayer->AddItem(paladin_heal_hombros, 1); + } + else if (Action == 2) + { + pPlayer->AddItem(paladin_dps_cabeza, 1); + pPlayer->AddItem(paladin_dps_manos ,1); + pPlayer->AddItem(paladin_dps_piernas ,1); + pPlayer->AddItem(paladin_dps_pecho, 1); + pPlayer->AddItem(paladin_dps_hombros, 1); + } + else if (Action == 3) + { + pPlayer->AddItem(dk_dps_cabeza, 1); + pPlayer->AddItem(dk_dps_manos ,1); + pPlayer->AddItem(dk_dps_piernas ,1); + pPlayer->AddItem(dk_dps_pecho, 1); + pPlayer->AddItem(dk_dps_hombros, 1); + } + else if (Action == 4) + { + pPlayer->AddItem(chaman_heal_cabeza, 1); + pPlayer->AddItem(chaman_heal_manos ,1); + pPlayer->AddItem(chaman_heal_piernas ,1); + pPlayer->AddItem(chaman_heal_pecho, 1); + pPlayer->AddItem(chaman_heal_hombros, 1); + } + else if (Action == 5) + { + pPlayer->AddItem(chaman_dps_melee_cabeza, 1); + pPlayer->AddItem(chaman_dps_melee_manos ,1); + pPlayer->AddItem(chaman_dps_melee_piernas ,1); + pPlayer->AddItem(chaman_dps_melee_pecho, 1); + pPlayer->AddItem(chaman_dps_melee_hombros, 1); + } + else if (Action == 6) + { + pPlayer->AddItem(chaman_dps_spell_cabeza, 1); + pPlayer->AddItem(chaman_dps_spell_manos ,1); + pPlayer->AddItem(chaman_dps_spell_piernas ,1); + pPlayer->AddItem(chaman_dps_spell_pecho, 1); + pPlayer->AddItem(chaman_dps_spell_hombros, 1); + } + else if (Action == 7) + { + pPlayer->AddItem(brujo_dps_cabeza, 1); + pPlayer->AddItem(brujo_dps_manos ,1); + pPlayer->AddItem(brujo_dps_piernas ,1); + pPlayer->AddItem(brujo_dps_pecho, 1); + pPlayer->AddItem(brujo_dps_hombros, 1); + } + else if (Action == 8) + { + pPlayer->AddItem(mago_dps_cabeza, 1); + pPlayer->AddItem(mago_dps_manos ,1); + pPlayer->AddItem(mago_dps_piernas ,1); + pPlayer->AddItem(mago_dps_pecho, 1); + pPlayer->AddItem(mago_dps_hombros, 1); + } + else if (Action == 9) + { + pPlayer->AddItem(picaro_dps_cabeza, 1); + pPlayer->AddItem(picaro_dps_manos ,1); + pPlayer->AddItem(picaro_dps_piernas ,1); + pPlayer->AddItem(picaro_dps_pecho, 1); + pPlayer->AddItem(picaro_dps_hombros, 1); + } + else if (Action == 10) + { + pPlayer->AddItem(cazador_dps_cabeza, 1); + pPlayer->AddItem(cazador_dps_manos ,1); + pPlayer->AddItem(cazador_dps_piernas ,1); + pPlayer->AddItem(cazador_dps_pecho, 1); + pPlayer->AddItem(cazador_dps_hombros, 1); + } + else if (Action == 11) + { + pPlayer->AddItem(druida_heal_cabeza, 1); + pPlayer->AddItem(druida_heal_manos ,1); + pPlayer->AddItem(druida_heal_piernas ,1); + pPlayer->AddItem(druida_heal_pecho, 1); + pPlayer->AddItem(druida_heal_hombros, 1); + } + else if (Action == 12) + { + pPlayer->AddItem(druida_dps_cabeza, 1); + pPlayer->AddItem(druida_dps_manos ,1); + pPlayer->AddItem(druida_dps_piernas ,1); + pPlayer->AddItem(druida_dps_pecho, 1); + pPlayer->AddItem(druida_dps_hombros, 1); + } + else if (Action == 13) + { + pPlayer->AddItem(druida_dps_spell_cabeza, 1); + pPlayer->AddItem(druida_dps_spell_manos ,1); + pPlayer->AddItem(druida_dps_spell_piernas ,1); + pPlayer->AddItem(druida_dps_spell_pecho, 1); + pPlayer->AddItem(druida_dps_spell_hombros, 1); + } + + else if (Action == 14) + { + pPlayer->AddItem(sacerdote_dps_cabeza, 1); + pPlayer->AddItem(sacerdote_dps_manos ,1); + pPlayer->AddItem(sacerdote_dps_piernas ,1); + pPlayer->AddItem(sacerdote_dps_pecho, 1); + pPlayer->AddItem(sacerdote_dps_hombros, 1); + } + else if (Action == 15) + { + pPlayer->AddItem(sacerdote_heal_cabeza, 1); + pPlayer->AddItem(sacerdote_heal_manos ,1); + pPlayer->AddItem(sacerdote_heal_piernas ,1); + pPlayer->AddItem(sacerdote_heal_pecho, 1); + pPlayer->AddItem(sacerdote_heal_hombros, 1); + } + return true; + } +}; +void AddSC_npc_incansable_km() +{ +new npc_incansable_km(); +} \ No newline at end of file diff --git a/npc_profesiones.cpp b/npc_profesiones.cpp new file mode 100644 index 0000000..ec69728 --- /dev/null +++ b/npc_profesiones.cpp @@ -0,0 +1,344 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include "Language.h" + +class Professions_NPC : public CreatureScript +{ +public: + Professions_NPC() : CreatureScript("Professions_NPC") {} + + void CreatureWhisperBasedOnBool(const char *text, Creature *_creature, Player *pPlayer, bool value) + { + if (value) + _creature->MonsterWhisper(text, pPlayer->GetGUID()); + } + + uint32 PlayerMaxLevel() const + { + return sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); + } + + bool PlayerHasItemOrSpell(const Player *plr, uint32 itemId, uint32 spellId) const + { + return plr->HasItemCount(itemId, 1, true) || plr->HasSpell(spellId); + } + + bool OnGossipHello(Player *pPlayer, Creature* _creature) + { + pPlayer->ADD_GOSSIP_ITEM(9, "[Profesiones] ->", GOSSIP_SENDER_MAIN, 196); + pPlayer->PlayerTalkClass->SendGossipMenu(907, _creature->GetGUID()); + return true; + } + + bool PlayerAlreadyHasTwoProfessions(const Player *pPlayer) const + { + uint32 skillCount = 0; + + if (pPlayer->HasSkill(SKILL_MINING)) + skillCount++; + if (pPlayer->HasSkill(SKILL_SKINNING)) + skillCount++; + if (pPlayer->HasSkill(SKILL_HERBALISM)) + skillCount++; + + if (skillCount >= 2) + return true; + + for (uint32 i = 1; i < sSkillLineStore.GetNumRows(); ++i) + { + SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(i); + if (!SkillInfo) + continue; + + if (SkillInfo->categoryId == SKILL_CATEGORY_SECONDARY) + continue; + + if ((SkillInfo->categoryId != SKILL_CATEGORY_PROFESSION) || !SkillInfo->canLink) + continue; + + const uint32 skillID = SkillInfo->id; + if (pPlayer->HasSkill(skillID)) + skillCount++; + + if (skillCount >= 2) + return true; + } + return false; + } + + bool LearnAllRecipesInProfession(Player *pPlayer, SkillType skill) + { + ChatHandler handler(pPlayer->GetSession()); + char* skill_name; + + SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill); + + if (!SkillInfo) + { + sLog->outError(LOG_FILTER_PLAYER_SKILLS, "Profesion Master: ERROR POR FAVOR REPORTALO"); + return false; + } + + LearnSkillRecipesHelper(pPlayer, SkillInfo->id); + + pPlayer->SetSkill(SkillInfo->id, pPlayer->GetSkillStep(SkillInfo->id), 550, 550); + handler.PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, skill_name); + + return true; + } + + void LearnSkillRecipesHelper(Player *player, uint32 skill_id) + { + uint32 classmask = player->getClassMask(); + + for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) + { + SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j); + if (!skillLine) + continue; + + // wrong skill + if (skillLine->skillId != skill_id) + continue; + + // not high rank + if (skillLine->forward_spellid) + continue; + + // skip racial skills + if (skillLine->racemask != 0) + continue; + + // skip wrong class skills + if (skillLine->classmask && (skillLine->classmask & classmask) == 0) + continue; + + SpellInfo const * spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId); + if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false)) + continue; + + player->learnSpell(skillLine->spellId, false); + } + } + + bool IsSecondarySkill(SkillType skill) const + { + return skill == SKILL_COOKING || skill == SKILL_FIRST_AID; + } + + void CompleteLearnProfession(Player *pPlayer, Creature *pCreature, SkillType skill) + { + if (PlayerAlreadyHasTwoProfessions(pPlayer) && !IsSecondarySkill(skill)) + pCreature->MonsterWhisper("Ya tienes 2 Profesiones!", pPlayer->GetGUID()); + else + { + if (!LearnAllRecipesInProfession(pPlayer, skill)) + pCreature->MonsterWhisper("ERROR POR FAVOR REPORTALO", pPlayer->GetGUID()); + } + } + + bool OnGossipSelect(Player* pPlayer, Creature* _creature, uint32 uiSender, uint32 uiAction) + { + pPlayer->PlayerTalkClass->ClearMenus(); + + if (uiSender == GOSSIP_SENDER_MAIN) + { + + switch (uiAction) + { + case 196: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\trade_alchemy:30|t ALQUIMIA.", GOSSIP_SENDER_MAIN, 1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\INV_Ingot_05:30|t HERRERIA.", GOSSIP_SENDER_MAIN, 2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\INV_Misc_LeatherScrap_02:30|t PELETERIA.", GOSSIP_SENDER_MAIN, 3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\INV_Fabric_Felcloth_Ebon:30|t SASTRERIA.", GOSSIP_SENDER_MAIN, 4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\inv_misc_wrench_01:30|t INGENIERIA.", GOSSIP_SENDER_MAIN, 5); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\trade_engraving:30|t ENCANTAMIENTO.", GOSSIP_SENDER_MAIN, 6); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\inv_misc_gem_01:30|t JOYERIA.", GOSSIP_SENDER_MAIN, 7); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\INV_Scroll_08:30|t INSCRIPCION.", GOSSIP_SENDER_MAIN, 8); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\INV_Misc_Herb_07:30|t HERBORISTERIA.", GOSSIP_SENDER_MAIN, 11); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\inv_misc_pelt_wolf_01:30|t DESUELLO.", GOSSIP_SENDER_MAIN, 12); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\trade_mining:30|t MINERIA.", GOSSIP_SENDER_MAIN, 13); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\INV_Misc_Food_17:30|t COCINA", GOSSIP_SENDER_MAIN, 9); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|TInterface\\icons\\Achievement_BG_winSOA_underXminutes:30|t PRIMEROS AUXILIOS", GOSSIP_SENDER_MAIN, 10); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TALK, "|TInterface/ICONS/Thrown_1H_Harpoon_D_01Blue:30|t Adios...", GOSSIP_SENDER_MAIN, 14); + pPlayer->PlayerTalkClass->SendGossipMenu(80000, _creature->GetGUID()); + break; + case 1: + if (pPlayer->HasSkill(SKILL_ALCHEMY)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + + + { + CompleteLearnProfession(pPlayer, _creature, SKILL_ALCHEMY); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + + case 2: + if (pPlayer->HasSkill(SKILL_BLACKSMITHING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_BLACKSMITHING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 3: + if (pPlayer->HasSkill(SKILL_LEATHERWORKING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_LEATHERWORKING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 4: + if (pPlayer->HasSkill(SKILL_TAILORING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_TAILORING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 5: + if (pPlayer->HasSkill(SKILL_ENGINEERING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_ENGINEERING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + + case 6: + if (pPlayer->HasSkill(SKILL_ENCHANTING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_ENCHANTING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 7: + if (pPlayer->HasSkill(SKILL_JEWELCRAFTING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_JEWELCRAFTING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 8: + if (pPlayer->HasSkill(SKILL_INSCRIPTION)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_INSCRIPTION); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 9: + if (pPlayer->HasSkill(SKILL_COOKING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_COOKING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 10: + if (pPlayer->HasSkill(SKILL_FIRST_AID)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_FIRST_AID); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 11: + if (pPlayer->HasSkill(SKILL_HERBALISM)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_HERBALISM); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 12: + if (pPlayer->HasSkill(SKILL_SKINNING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_SKINNING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 13: + if (pPlayer->HasSkill(SKILL_MINING)) + { + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + else + { + CompleteLearnProfession(pPlayer, _creature, SKILL_MINING); + pPlayer->PlayerTalkClass->SendCloseGossip(); + }break; + case 14: + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + + + } + return true; + } +}; + +void AddSC_Professions_NPC() +{ + new Professions_NPC(); +} \ No newline at end of file diff --git a/npc_promo.cpp b/npc_promo.cpp new file mode 100644 index 0000000..19736d5 --- /dev/null +++ b/npc_promo.cpp @@ -0,0 +1,116 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +#define MSG_PLACE "Bienvenido a SkyLegions: Promocion Nivel 85 + 15k de Oro" + +class npc_shop : public CreatureScript +{ +public: + npc_shop() : CreatureScript("npc_shop") { } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, MSG_PLACE, GOSSIP_SENDER_MAIN,1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "No mejor no..", GOSSIP_SENDER_MAIN,2); + pPlayer->SEND_GOSSIP_MENU(1, pCreature->GetGUID()); + return true; +} + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 Sender, uint32 Action) + { + if (Sender != GOSSIP_SENDER_MAIN) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + if (Action == 1) + { + // QueryResult pResult = LoginDatabase.PQuery("select last_ip from account where id = %u", pPlayer->GetSession()->GetAccountId()); + //Field * pFields = pResult->Fetch(); + //pFields[0].GetString(); + QueryResult Result = LoginDatabase.PQuery("select count(*) from account where last_ip = %u", pPlayer->GetSession()->GetRemoteAddress()); + Field * rFields = Result->Fetch(); + int64 ip2 = rFields[0].GetInt64(); + if (ip2 > 1) + { + ChatHandler(pPlayer->GetSession()).PSendSysMessage("Para obtener la promoción debe ser tu primera cuenta, no puedes tener dos o mas cuentas"); + pPlayer->PlayerTalkClass->SendCloseGossip(); + return true; + } + QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM characters WHERE account = %u AND LEVEL = 85",pPlayer->GetSession()->GetAccountId()); + Field* field = result->Fetch(); + int8 chars = field[0].GetInt8(); + if (chars > 0 && pPlayer->getLevel() != 85 ) + { + ChatHandler(pPlayer->GetSession()).PSendSysMessage("Ya tienes un pj 85 en esta cuenta no abuses de la promocion."); + pPlayer->PlayerTalkClass->SendCloseGossip(); + return true; + } + + + + + + else if (pPlayer->getLevel() == 85) + { + ChatHandler(pPlayer->GetSession()).PSendSysMessage("Ya eres Nivel 85"); + pPlayer->PlayerTalkClass->SendCloseGossip(); + return true; + + } + } + //else if(Sender == GOSSIP_SENDER_MAIN) + + + switch(Action) + { + case 1: + + pPlayer->SetMoney(150000000); + pPlayer->GiveLevel(85); + pPlayer->UpdateSkillsToMaxSkillsForLevel(); + + if(pPlayer->GetTeam() == ALLIANCE){ //ID DEL SPELL QUE LLEVE A SHOP ALIANZA + pPlayer->TeleportTo(37, 49.945271f, -412.212799f, 410.581818f, 1.106602f); + //pPlayer->CastSpell(pPlayer,61420,true,NULL,NULL,pPlayer->GetGUID()); + } + else { //ID DEL SPELL QUE LLEVE A SHOP HORDA + pPlayer->TeleportTo(37, 49.945271f, -412.212799f, 410.581818f, 1.106602f); + //pPlayer->CastSpell(pPlayer,34673,true,NULL,NULL,pPlayer->GetGUID()); + } + pPlayer->PlayerTalkClass->SendCloseGossip(); + pPlayer->SaveToDB(); + break; + case 2: + pPlayer->PlayerTalkClass->SendCloseGossip(); + break; + } + + + return true; + + } +}; + + +void AddSC_npc_shop() +{ + new npc_shop(); +} \ No newline at end of file diff --git a/npc_pve_km.cpp b/npc_pve_km.cpp new file mode 100644 index 0000000..175ed33 --- /dev/null +++ b/npc_pve_km.cpp @@ -0,0 +1,312 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +enum defines +{ + // Guerrero Dps + warr_dps_cabeza = 71070, + warr_dps_manos = 71069, + warr_dps_piernas = 71071, + warr_dps_pecho = 71068, + warr_dps_hombros = 71072, + // Guerrero Tank + warr_tank_cabeza = 70944, + warr_tank_manos = 70943, + warr_tank_piernas = 70942, + warr_tank_pecho = 70945, + warr_tank_hombros = 70941, + // Paladin Heal + paladin_heal_cabeza = 71093, + paladin_heal_manos = 71092, + paladin_heal_piernas = 71094, + paladin_heal_pecho = 71091, + paladin_heal_hombros = 71095, + // Paladin Dps + paladin_dps_cabeza = 71065, + paladin_dps_manos = 71064, + paladin_dps_piernas = 71066, + paladin_dps_pecho = 71063, + paladin_dps_hombros = 71067, + // Paladin Tank + paladin_tank_cabeza = 70948, + paladin_tank_manos = 70949, + paladin_tank_piernas = 70947, + paladin_tank_pecho = 70950, + paladin_tank_hombros = 70946, + // Dk Dps + dk_dps_cabeza = 71060, + dk_dps_manos = 71059, + dk_dps_piernas = 71061, + dk_dps_pecho = 71058, + dk_dps_hombros = 71062, + // Chaman Heal + chaman_heal_cabeza = 71298, + chaman_heal_manos = 71297, + chaman_heal_piernas = 71299, + chaman_heal_pecho = 71296, + chaman_heal_hombros = 71300, + // Chaman Elemental + chaman_dps_melee_cabeza = 71303, + chaman_dps_melee_manos = 71302, + chaman_dps_melee_piernas = 71304, + chaman_dps_melee_pecho = 71301, + chaman_dps_melee_hombros = 71305, + // Chaman Dps Spell + chaman_dps_spell_cabeza = 71293, + chaman_dps_spell_manos = 71292, + chaman_dps_spell_piernas = 71294, + chaman_dps_spell_pecho = 71291, + chaman_dps_spell_hombros = 71295, + // Brujo Dps + brujo_dps_cabeza = 71282, + brujo_dps_manos = 71281, + brujo_dps_piernas = 71283, + brujo_dps_pecho = 71284, + brujo_dps_hombros = 71285, + // Mago + mago_dps_cabeza = 71287, + mago_dps_manos = 71286, + mago_dps_piernas = 71288, + mago_dps_pecho = 71289, + mago_dps_hombros = 71290, + // Picaro + picaro_dps_cabeza = 71047, + picaro_dps_manos = 71046, + picaro_dps_piernas = 710487, + picaro_dps_pecho = 71045, + picaro_dps_hombros = 71049, + // Cazador + cazador_dps_cabeza = 71051, + cazador_dps_manos = 71050, + cazador_dps_piernas = 71052, + cazador_dps_pecho = 71054, + cazador_dps_hombros = 71053, + // Druida Heal + druida_heal_cabeza = 71103, + druida_heal_manos = 71102, + druida_heal_piernas = 71104, + druida_heal_pecho = 71105, + druida_heal_hombros = 71105, + // Druida Dps Spell + druida_dps_spell_cabeza = 71108, + druida_dps_spell_manos = 71107, + druida_dps_spell_piernas = 71109, + druida_dps_spell_pecho = 91110, + druida_dps_spell_hombros = 71111, + // Druida Dps + druida_dps_cabeza = 71098, + druida_dps_manos = 71097, + druida_dps_piernas = 71099, + druida_dps_pecho = 71100, + druida_dps_hombros = 71101, + // Sacerdote Dps + sacerdote_dps_cabeza = 71277, + sacerdote_dps_manos = 71276, + sacerdote_dps_piernas = 71278, + sacerdote_dps_pecho = 71279, + sacerdote_dps_hombros = 71280, + // Sacerdote Heal + sacerdote_heal_cabeza = 71272, + sacerdote_heal_manos = 71271, + sacerdote_heal_piernas = 71273, + sacerdote_heal_pecho = 71274, + sacerdote_heal_hombros = 71275, +}; +class npc_pve_km : public CreatureScript +{ +public: + npc_pve_km() : CreatureScript("npc_pve_km"){} + bool OnGossipHello(Player * pPlayer, Creature * pCreature) + { + pPlayer->ADD_GOSSIP_ITEM(4, "Guerrero Dps", GOSSIP_SENDER_MAIN, 0); + pPlayer->ADD_GOSSIP_ITEM(4, "Guerrero Tank", GOSSIP_SENDER_MAIN, 1); + pPlayer->ADD_GOSSIP_ITEM(4, "Paladin Heal", GOSSIP_SENDER_MAIN, 2); + pPlayer->ADD_GOSSIP_ITEM(4, "Paladin Dps", GOSSIP_SENDER_MAIN, 3); + pPlayer->ADD_GOSSIP_ITEM(4, "Paladin Tank", GOSSIP_SENDER_MAIN, 4); + pPlayer->ADD_GOSSIP_ITEM(4, "Dk Dps", GOSSIP_SENDER_MAIN, 5); + pPlayer->ADD_GOSSIP_ITEM(4, "Chaman Heal", GOSSIP_SENDER_MAIN, 6); + pPlayer->ADD_GOSSIP_ITEM(4, "Chaman Dps Melee", GOSSIP_SENDER_MAIN, 7); + pPlayer->ADD_GOSSIP_ITEM(4, "Chaman Dps Spell", GOSSIP_SENDER_MAIN, 8); + pPlayer->ADD_GOSSIP_ITEM(4, "Brujo Dps", GOSSIP_SENDER_MAIN, 9); + pPlayer->ADD_GOSSIP_ITEM(4, "Mago Dps", GOSSIP_SENDER_MAIN, 10); + pPlayer->ADD_GOSSIP_ITEM(4, "Picaro Dps", GOSSIP_SENDER_MAIN, 11); + pPlayer->ADD_GOSSIP_ITEM(4, "Cazador Dps", GOSSIP_SENDER_MAIN, 12); + pPlayer->ADD_GOSSIP_ITEM(4, "Druida Heal", GOSSIP_SENDER_MAIN, 13); + pPlayer->ADD_GOSSIP_ITEM(4, "Druida Dps", GOSSIP_SENDER_MAIN, 14); + pPlayer->ADD_GOSSIP_ITEM(4, "Druida Spell", GOSSIP_SENDER_MAIN, 15); + pPlayer->ADD_GOSSIP_ITEM(4, "Sacerdote Dps", GOSSIP_SENDER_MAIN, 16); + pPlayer->ADD_GOSSIP_ITEM(4, "Sacerdote Heal", GOSSIP_SENDER_MAIN, 17); + pPlayer->PlayerTalkClass->SendGossipMenu(9425, pCreature->GetGUID()); + return true; + } + bool OnGossipSelect(Player * pPlayer, Creature * pCreature, uint32 /*uiSender*/, uint32 Action) + { + if (Action == 0) + { + pPlayer->AddItem(warr_dps_cabeza, 1); + pPlayer->AddItem(warr_dps_manos, 1); + pPlayer->AddItem(warr_dps_piernas, 1); + pPlayer->AddItem(warr_dps_pecho, 1); + pPlayer->AddItem(warr_dps_hombros, 1); + } + else if (Action == 1) + { + pPlayer->AddItem(warr_tank_cabeza, 1); + pPlayer->AddItem(warr_tank_manos, 1); + pPlayer->AddItem(warr_tank_piernas, 1); + pPlayer->AddItem(warr_tank_pecho, 1); + pPlayer->AddItem(warr_tank_hombros, 1); + } + else if (Action == 2) + { + pPlayer->AddItem(paladin_heal_cabeza, 1); + pPlayer->AddItem(paladin_heal_manos, 1); + pPlayer->AddItem(paladin_heal_piernas, 1); + pPlayer->AddItem(paladin_heal_pecho, 1); + pPlayer->AddItem(paladin_heal_hombros, 1); + } + else if (Action == 3) + { + pPlayer->AddItem(paladin_dps_cabeza, 1); + pPlayer->AddItem(paladin_dps_manos, 1); + pPlayer->AddItem(paladin_dps_piernas, 1); + pPlayer->AddItem(paladin_dps_pecho, 1); + pPlayer->AddItem(paladin_dps_hombros, 1); + } + else if (Action == 4) + { + pPlayer->AddItem(paladin_tank_cabeza, 1); + pPlayer->AddItem(paladin_tank_manos, 1); + pPlayer->AddItem(paladin_tank_piernas, 1); + pPlayer->AddItem(paladin_tank_pecho, 1); + pPlayer->AddItem(paladin_tank_hombros, 1); + } + else if (Action == 5) + { + pPlayer->AddItem(dk_dps_cabeza, 1); + pPlayer->AddItem(dk_dps_manos, 1); + pPlayer->AddItem(dk_dps_piernas, 1); + pPlayer->AddItem(dk_dps_pecho, 1); + pPlayer->AddItem(dk_dps_hombros, 1); + } + else if (Action == 6) + { + pPlayer->AddItem(chaman_heal_cabeza, 1); + pPlayer->AddItem(chaman_heal_manos, 1); + pPlayer->AddItem(chaman_heal_piernas, 1); + pPlayer->AddItem(chaman_heal_pecho, 1); + pPlayer->AddItem(chaman_heal_hombros, 1); + } + else if (Action == 7) + { + pPlayer->AddItem(chaman_dps_melee_cabeza, 1); + pPlayer->AddItem(chaman_dps_melee_manos, 1); + pPlayer->AddItem(chaman_dps_melee_piernas, 1); + pPlayer->AddItem(chaman_dps_melee_pecho, 1); + pPlayer->AddItem(chaman_dps_melee_hombros, 1); + } + else if (Action == 8) + { + pPlayer->AddItem(chaman_dps_spell_cabeza, 1); + pPlayer->AddItem(chaman_dps_spell_manos, 1); + pPlayer->AddItem(chaman_dps_spell_piernas, 1); + pPlayer->AddItem(chaman_dps_spell_pecho, 1); + pPlayer->AddItem(chaman_dps_spell_hombros, 1); + } + else if (Action == 9) + { + pPlayer->AddItem(brujo_dps_cabeza, 1); + pPlayer->AddItem(brujo_dps_manos, 1); + pPlayer->AddItem(brujo_dps_piernas, 1); + pPlayer->AddItem(brujo_dps_pecho, 1); + pPlayer->AddItem(brujo_dps_hombros, 1); + } + else if (Action == 10) + { + pPlayer->AddItem(mago_dps_cabeza, 1); + pPlayer->AddItem(mago_dps_manos, 1); + pPlayer->AddItem(mago_dps_piernas, 1); + pPlayer->AddItem(mago_dps_pecho, 1); + pPlayer->AddItem(mago_dps_hombros, 1); + } + else if (Action == 11) + { + pPlayer->AddItem(picaro_dps_cabeza, 1); + pPlayer->AddItem(picaro_dps_manos, 1); + pPlayer->AddItem(picaro_dps_piernas, 1); + pPlayer->AddItem(picaro_dps_pecho, 1); + pPlayer->AddItem(picaro_dps_hombros, 1); + } + else if (Action == 12) + { + pPlayer->AddItem(cazador_dps_cabeza, 1); + pPlayer->AddItem(cazador_dps_manos, 1); + pPlayer->AddItem(cazador_dps_piernas, 1); + pPlayer->AddItem(cazador_dps_pecho, 1); + pPlayer->AddItem(cazador_dps_hombros, 1); + } + else if (Action == 13) + { + pPlayer->AddItem(druida_heal_cabeza, 1); + pPlayer->AddItem(druida_heal_manos, 1); + pPlayer->AddItem(druida_heal_piernas, 1); + pPlayer->AddItem(druida_heal_pecho, 1); + pPlayer->AddItem(druida_heal_hombros, 1); + } + else if (Action == 14) + { + pPlayer->AddItem(druida_dps_cabeza, 1); + pPlayer->AddItem(druida_dps_manos, 1); + pPlayer->AddItem(druida_dps_piernas, 1); + pPlayer->AddItem(druida_dps_pecho, 1); + pPlayer->AddItem(druida_dps_hombros, 1); + } + else if (Action == 15) + { + pPlayer->AddItem(druida_dps_spell_cabeza, 1); + pPlayer->AddItem(druida_dps_spell_manos, 1); + pPlayer->AddItem(druida_dps_spell_piernas, 1); + pPlayer->AddItem(druida_dps_spell_pecho, 1); + pPlayer->AddItem(druida_dps_spell_hombros, 1); + } + + else if (Action == 16) + { + pPlayer->AddItem(sacerdote_dps_cabeza, 1); + pPlayer->AddItem(sacerdote_dps_manos, 1); + pPlayer->AddItem(sacerdote_dps_piernas, 1); + pPlayer->AddItem(sacerdote_dps_pecho, 1); + pPlayer->AddItem(sacerdote_dps_hombros, 1); + } + else if (Action == 17) + { + pPlayer->AddItem(sacerdote_heal_cabeza, 1); + pPlayer->AddItem(sacerdote_heal_manos, 1); + pPlayer->AddItem(sacerdote_heal_piernas, 1); + pPlayer->AddItem(sacerdote_heal_pecho, 1); + pPlayer->AddItem(sacerdote_heal_hombros, 1); + } + return true; + } +}; +void AddSC_npc_pve_km() +{ + new npc_pve_km(); +} \ No newline at end of file diff --git a/npc_teleporter.cpp b/npc_teleporter.cpp new file mode 100644 index 0000000..91b5832 --- /dev/null +++ b/npc_teleporter.cpp @@ -0,0 +1,91 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include "Chat.h" + +const int PLAYER_QUEUE = 4; +static const Position playerSpawnPoint[PLAYER_QUEUE] = +{ + {-7473.95f, -1088.11f, 896.78f, 4.38455f}, + {-6379.22f, 1256.77f, 7.18803f, 2.9329f}, + {-775.036f, 1511.92f, 137.398f, 4.71829f}, + {-6414.02f, -3507.6f, 402.778f, 2.03819f}, +}; + +class global_teleporter : public CreatureScript +{ +public: + global_teleporter() : CreatureScript("global_teleporter") { } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + if (pPlayer->isInCombat()) + { + pPlayer->GetSession()->SendNotification("ESTAS EN COMBATE!"); + return false; + } + pPlayer->ADD_GOSSIP_ITEM(1, "|cff00ff00|TInterface\\icons\\Achievement_Boss_Mimiron_01:24|t|r MERCADO", GOSSIP_SENDER_MAIN, 1); + pPlayer->ADD_GOSSIP_ITEM(1, "|cff00ff00|TInterface\\icons\\Spell_Arcane_PortalDalaran:24|t|r Dalaran", GOSSIP_SENDER_MAIN, 3); + pPlayer->ADD_GOSSIP_ITEM(1, "|cff00ff00|TInterface\\icons\\Achievement_Arena_2v2_4:24|t|r Gurubashi Arena", GOSSIP_SENDER_MAIN, 2); + pPlayer->SEND_GOSSIP_MENU(80001, pCreature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature,uint32 uiSender, uint32 uiAction) + { + pPlayer->PlayerTalkClass->ClearMenus(); + + switch (uiAction) + { + case 1: // Mercado Global + { + pCreature->CastSpell(pPlayer,35517,false); + pPlayer->TeleportTo(37, 49.945271f, -412.212799f, 410.581818f, 1.106602f); + ChatHandler(pPlayer->GetSession()).PSendSysMessage("|cffff6060[SkyLegions]:|r Estas Siendo telestransportado hacia: |cFFFF4500Global Mercado|r!", pPlayer->GetName()); + }break; + + case 2: // Gurubashi Arena + { + pCreature->CastSpell(pPlayer,35517,false); + pPlayer->TeleportTo(0, -13226.437500f, 232.104935f, 33.287682f, 1.133178f); + ChatHandler(pPlayer->GetSession()).PSendSysMessage("|cffff6060[SkyLegions]:|r Estas Siendo telestransportado hacia: |cFFFF4500Gurubashi Arena - (ZONA PVP)|r!", pPlayer->GetName()); + }break; + + case 3: // Dalaran + { + pCreature->CastSpell(pPlayer,35517,false); + pPlayer->TeleportTo(571, 5804.149902f, 624.770996f, 647.767029f, 1.640000f); + ChatHandler(pPlayer->GetSession()).PSendSysMessage("|cffff6060[SkyLegions]:|r Estas Siendo telestransportado hacia: |cFFFF4500Dalaran - (SANTUARIO)|r!", pPlayer->GetName()); + }break; + { + OnGossipHello(pPlayer, pCreature); + return true; + }break; + } + pPlayer->CLOSE_GOSSIP_MENU(); + return true; + } + +}; + +void AddSC_global_teleporter() +{ + new global_teleporter(); +} diff --git a/npc_top10_arena.cpp b/npc_top10_arena.cpp new file mode 100644 index 0000000..3423c34 --- /dev/null +++ b/npc_top10_arena.cpp @@ -0,0 +1,380 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include +#include +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ArenaTeam.h" +#include "ArenaTeamMgr.h" +#include "World.h" + +enum enus +{ + ARENA_MAX_RESULTS = 10, + ARENA_1V1_LADDER = GOSSIP_ACTION_INFO_DEF + 1, + ARENA_2V2_LADDER = GOSSIP_ACTION_INFO_DEF + 2, + ARENA_3V3_LADDER = GOSSIP_ACTION_INFO_DEF + 3, + ARENA_5V5_LADDER = GOSSIP_ACTION_INFO_DEF + 4, + ARENA_GOODBYE = GOSSIP_ACTION_INFO_DEF + 5, + ARENA_START_TEAM_LOOKUP = GOSSIP_ACTION_INFO_DEF + 6, + ARENA_HELP = GOSSIP_ACTION_INFO_DEF + 9999, +}; + +class arena_top_teams : public CreatureScript +{ + private: + uint32 optionToTeamType(uint32 option) + { + uint32 teamType; + switch(option) + { + case ARENA_1V1_LADDER: + teamType = 1; + break; + case ARENA_2V2_LADDER: + teamType = 2; + break; + + case ARENA_3V3_LADDER: + teamType = 3; + break; + + case ARENA_5V5_LADDER: + teamType = 5; + break; + } + return teamType; + } + + uint32 teamTypeToOption(uint32 teamType) + { + uint32 option; + switch(teamType) + { + + case 1: + option = ARENA_1V1_LADDER; + break; + + case 2: + option = ARENA_2V2_LADDER; + break; + + case 3: + option = ARENA_3V3_LADDER; + break; + + case 5: + option = ARENA_5V5_LADDER; + break; + } + return option; + } + + std::string raceToString(uint8 race) + { + std::string race_s = "Desconocido"; + switch (race) + { + case RACE_HUMAN: + race_s = "Humano"; + break; + + case RACE_ORC: + race_s = "Orco"; + break; + + case RACE_DWARF: + race_s = "Enano"; + break; + + case RACE_NIGHTELF: + race_s = "Elfo de la Noche"; + break; + + case RACE_UNDEAD_PLAYER: + race_s = "Muerto Viviente"; + break; + + case RACE_TAUREN: + race_s = "Tauren"; + break; + + case RACE_GNOME: + race_s = "Gnomo"; + break; + + case RACE_TROLL: + race_s = "Troll"; + break; + + case RACE_BLOODELF: + race_s = "Elfo de Sangre"; + break; + + case RACE_DRAENEI: + race_s = "Draenei"; + break; + } + return race_s; + } + + std::string classToString(uint8 Class) + { + std::string Class_s = "Desconocido"; + switch (Class) + { + case CLASS_WARRIOR: + Class_s = "Guerrero"; + break; + + case CLASS_PALADIN: + Class_s = "Paladin"; + break; + + case CLASS_HUNTER: + Class_s = "Cazador"; + break; + + case CLASS_ROGUE: + Class_s = "Picaro"; + break; + + case CLASS_PRIEST: + Class_s = "Sacerdote"; + break; + + case CLASS_DEATH_KNIGHT: + Class_s = "Caballero de la Muerte"; + break; + + case CLASS_SHAMAN: + Class_s = "Chaman"; + break; + + case CLASS_MAGE: + Class_s = "Mago"; + break; + + case CLASS_WARLOCK: + Class_s = "Brujo"; + break; + + case CLASS_DRUID: + Class_s = "Druida"; + break; + } + return Class_s; + } + + + std::string getWinPercent(uint32 wins, uint32 losses) + { + uint32 totalGames = wins + losses; + if (totalGames == 0) + return "0%"; + + std::stringstream buf; + uint32 percentage = (wins * 100) / totalGames; + buf << percentage << "%"; + return buf.str(); + } + + public: + arena_top_teams() : CreatureScript("arena_top_teams"){} + + bool OnGossipHello(Player *player, Creature *creature) + { + player->ADD_GOSSIP_ITEM(4,"|cff00ff00|TInterface\\icons\\spell_chargepositive:26|t|r ¿Como Funciona este npc?", GOSSIP_SENDER_MAIN, ARENA_HELP); + player->ADD_GOSSIP_ITEM(4, "|cff00ff00|TInterface\\icons\\Ability_Warrior_WeaponMastery:26|t|r Top 10: 1v1 Arena", GOSSIP_SENDER_MAIN, ARENA_1V1_LADDER); + player->ADD_GOSSIP_ITEM(4,"|cff00ff00|TInterface\\icons\\Achievement_Arena_2v2_7:26|t|r Top 10: 2v2 Arena", GOSSIP_SENDER_MAIN, ARENA_2V2_LADDER); + player->ADD_GOSSIP_ITEM(4,"|cff00ff00|TInterface\\icons\\Achievement_Arena_3v3_7:26|t|r Top 10: 3v3 Arena", GOSSIP_SENDER_MAIN, ARENA_3V3_LADDER); + player->ADD_GOSSIP_ITEM(4,"|cff00ff00|TInterface\\icons\\Achievement_Arena_5v5_7:26|t|r Top 10: 5v5 Arena", GOSSIP_SENDER_MAIN, ARENA_5V5_LADDER); + player->ADD_GOSSIP_ITEM(4,"|cff00ff00|TInterface\\icons\\spell_chargenegative:26|t|r No...", GOSSIP_SENDER_MAIN, ARENA_GOODBYE); + player->SEND_GOSSIP_MENU(90085, creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + { + player->PlayerTalkClass->ClearMenus(); + switch(uiAction) + { + case ARENA_GOODBYE: + { + player->PlayerTalkClass->SendCloseGossip(); + break; + } + + case ARENA_HELP: + { + ChatHandler(player->GetSession()).PSendSysMessage("|cffff6060[INFO]:|r Este npc crea una lista con los mejores players del server, un top 10 de ellos."); + break; + } + + case ARENA_1V1_LADDER: + case ARENA_2V2_LADDER: + case ARENA_5V5_LADDER: + case ARENA_3V3_LADDER: + { + uint32 teamType = optionToTeamType(uiAction); + QueryResult result = CharacterDatabase.PQuery("SELECT arenaTeamId, name, rating FROM arena_team WHERE type = '%u' ORDER BY rating DESC LIMIT %u;", teamType, ARENA_MAX_RESULTS); + + if(!result) + { + player->ADD_GOSSIP_ITEM(7, "No...", GOSSIP_SENDER_MAIN, ARENA_GOODBYE); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + } + else + { + std::string name; + uint32 teamId, rating, rank = 1; + player->ADD_GOSSIP_ITEM(0,"Top Arena Lista de Gladiadores:", GOSSIP_SENDER_MAIN, ARENA_GOODBYE); + do + { + Field *fields = result->Fetch(); + teamId = fields[0].GetUInt32(); + name = fields[1].GetString(); + rating = fields[2].GetUInt32(); + + std::stringstream buffer; + buffer << rank << ". " << name; + buffer << ": " << "|cFF1E90FF" << rating << "|r" << " rating!"; + player->ADD_GOSSIP_ITEM(4, buffer.str(), GOSSIP_SENDER_MAIN, ARENA_START_TEAM_LOOKUP + teamId); + + rank++; + } + while(result->NextRow()); + player->ADD_GOSSIP_ITEM(7, "Adios...", GOSSIP_SENDER_MAIN, ARENA_GOODBYE); + player->SEND_GOSSIP_MENU(90086, creature->GetGUID()); + } + break; + } + + default: + { + if (uiAction > ARENA_START_TEAM_LOOKUP) + { + uint32 teamId = uiAction - ARENA_START_TEAM_LOOKUP; + QueryResult result = CharacterDatabase.PQuery("SELECT name, rating, seasonWins, seasonGames - seasonWins, weekWins, weekGames - weekWins, rank, captainGuid , type FROM arena_team WHERE arenaTeamId = '%u'", teamId); + + if(!result) + { + player->GetSession()->SendNotification("Team de arena no funciona!..."); + player->PlayerTalkClass->SendCloseGossip(); + return true; + } + + Field *fields = result->Fetch(); + std::string name = fields[0].GetString(); + uint32 rating = fields[1].GetUInt32(); + uint32 seasonWins = fields[2].GetUInt32(); + uint32 seasonLosses = fields[3].GetUInt32(); + uint32 weekWins = fields[4].GetUInt32(); + uint32 weekLosses = fields[5].GetUInt32(); + uint32 rank = fields[6].GetUInt32(); + uint32 captainGuid = fields[7].GetUInt32(); + uint32 type = fields[8].GetUInt32(); + uint32 parentOption = teamTypeToOption(type); + + std::string seasonWinPercentage = getWinPercent(seasonWins, seasonLosses); + std::string weekWinPercentage = getWinPercent(weekWins, weekLosses); + + std::stringstream buf; + buf << "Team Name: " << "|cFF1E90FF" << name << "|r"; + player->ADD_GOSSIP_ITEM(7, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + buf.str(""); + + buf << "Rating: " << "|cFF1E90FF" << rating << "|r" << " (Rank: " << "|cFF1E90FF" << rank << "|r" << ", Type: " << "|cFF1E90FF" << type << "v" << type << "|r"")"; + player->ADD_GOSSIP_ITEM(4, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + buf.str(""); + + buf << "Total Week: " << "|cFF1E90FF" << weekWins << "-" << weekLosses << "|r"" (" << "|cFF1E90FF" << weekWinPercentage << "|r" << "win)"; + player->ADD_GOSSIP_ITEM(4, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + buf.str(""); + + buf << "Total Season: " << "|cFF1E90FF" << seasonWins << "-" << seasonLosses << "|r" << " (" << "|cFF1E90FF" << seasonWinPercentage << "|r" << " win)"; + player->ADD_GOSSIP_ITEM(4, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + + QueryResult members = CharacterDatabase.PQuery("SELECT a.guid, a.personalRating, a.weekWins, a.weekGames - a.weekWins, a.seasonWins, a.seasonGames - a.seasonWins, c.name, c.race, c.class, c.level FROM arena_team_member a LEFT JOIN characters c ON c.guid = a.guid WHERE arenaTeamId = '%u' ORDER BY a.guid = '%u' DESC, a.seasonGames DESC, c.name ASC", teamId, captainGuid); + if(!members) + { + player->ADD_GOSSIP_ITEM(7, "No team members found...?", GOSSIP_SENDER_MAIN, parentOption); + } + else + { + uint32 memberPos = 1; + uint32 memberCount = members->GetRowCount(); + uint32 guid, personalRating, level; + std::string name, race, Class; + + buf.str(""); + buf << " --- " << memberCount << " team" << ((memberCount == 1) ? " member" : " members") << " found" << " ---"; + player->ADD_GOSSIP_ITEM(0, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + do + { + fields = members->Fetch(); + guid = fields[0].GetUInt32(); + personalRating = fields[1].GetUInt32(); + weekWins= fields[2].GetUInt32(); + weekLosses = fields[3].GetUInt32(); + seasonWins = fields[4].GetUInt32(); + seasonLosses = fields[5].GetUInt32(); + name = fields[6].GetString(); + race = raceToString(fields[7].GetUInt8()); + Class = classToString(fields[8].GetUInt8()); + level = fields[9].GetUInt32(); + + seasonWinPercentage = getWinPercent(seasonWins, seasonLosses); + weekWinPercentage = getWinPercent(weekWins, weekLosses); + + buf.str(""); + buf << memberPos << ". "; + if (guid == captainGuid) + buf << "Team Captain "; + + + buf << race << " " << Class << ", " << "|cFF1E90FF" << personalRating << "|r" << " personal rating!"; + player->ADD_GOSSIP_ITEM(4, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + buf.str(""); + + buf << "Week: " << "|cFF1E90FF" << weekWins << "-" << weekLosses << "|r" << " (" << "|cFF1E90FF" << weekWinPercentage << "|r" << " win), " << "|cFF1E90FF" << (weekWins + weekLosses) << "|r" << " played!"; + player->ADD_GOSSIP_ITEM(4, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + buf.str(""); + + buf << "Season: " << "|cFF1E90FF" << seasonWins << "-" << seasonLosses << "|r" << " (" << "|cFF1E90FF" << seasonWinPercentage << "|r" << " win), " << "|cFF1E90FF" << (seasonWins + seasonLosses) << "|r" << " played!"; + player->ADD_GOSSIP_ITEM(4, buf.str(), GOSSIP_SENDER_MAIN, parentOption); + memberPos++; + } + while(members->NextRow()); + } + player->SEND_GOSSIP_MENU(90087, creature->GetGUID()); + } + } + } + return true; + } +}; + +void AddSC_arena_top_teams() +{ + new arena_top_teams(); +} \ No newline at end of file diff --git a/prizelevel.cpp b/prizelevel.cpp new file mode 100644 index 0000000..d7bf09b --- /dev/null +++ b/prizelevel.cpp @@ -0,0 +1,88 @@ +#include "ScriptMgr.h" +#include "Player.h" +#include "WorldSession.h" +class custom_CongratsOnLevel : public PlayerScript +{ +public: + custom_CongratsOnLevel() : PlayerScript("custom_CongratsOnLevel") { } + + void OnLevelChanged(Player* player, uint8 newLevel) + { + uint32 money, item, spell; + + switch(++newLevel) + { + case 10: + money = 10; // 1 de oro + item = 4500; // Mochila de viajero + //item3 = 29434; + spell = 26035; // celebra los buenos tiempos + break; + case 15: + money = 20; + item = 90001; //moneda de nivel + spell = 53758; //Frasco de Sangre piedra + break; + case 20: + money = 50; // 2 de oro + item = 43599; //Gran Oso de Blizzard + spell = 24705; //bendicion del hombre de mimbre + break; + case 30: + money = 30; // 3 de oro + item = 52002; // anillo de pirata aterrador + //item2 = 50255; + spell = 24425; //Espiritu zandalar + break; + case 40: + money = 40; + item = 41426; //obsequi envuelto en magia + //item2 = 50255; + spell = 35076; //bendicion de adal + break; + case 50: + money = 50; + item = 52002; //cartera de biene utiles + //item2 = 50255; + spell = 53758; // frasco de sangre piedra + break; + case 60: + money = 5000; + item = 29434; //distintivo de justicia + //item2 = 50255; + spell = 16609; //bendicion del jefe de guerra + break; + case 70: + money = 5000; + item = 45624;//emblema de conquista + //item2 = 50255; + spell = 26393; //bendicion de elune + break; + case 80: + money = 5000; + item = 90001; + //item2 = 50255; + spell = 33053; //Bendicion de don pellisco + break; + default: + return; + } + + std::ostringstream ss; + ss << "|cffFF0000[Rhonin WoW]|r Felicidades " << player->GetName() << " por alcanzar el nivel " << (uint32)newLevel; + sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str()); + + std::ostringstream ss2; + ss2 << "Por su esfuerzo y dedicación le recompensaron con " << money << " oro y un objeto especial!"; + player->GetSession()->SendNotification(ss2.str().c_str()); + + player->ModifyMoney(money*GOLD); + player->AddItem(item, 1); + player->CastSpell(player, spell, false); + } +}; + +void AddSC_custom_CongratsOnLevel() +{ + new custom_CongratsOnLevel(); +} diff --git a/removeore.cpp b/removeore.cpp new file mode 100644 index 0000000..0f4f310 --- /dev/null +++ b/removeore.cpp @@ -0,0 +1,100 @@ +#include "ScriptMgr.h" +#include "Player.h" +#include "Chat.h" +#define FFA_ENTER_MSG "|cffff6060[InMoral JcJ]:|r Esto es una |cFFFF4500zona JcJ|r, recuerda que cuando mueres |cFFFF4500pierdes 5 de oro|r pero ganaras |cFFFF4500 5 de oro|r por muerte!" +#define KILL_MSG "|cff00ff00|TInterface\\PvPRankBadges/PvPRank06:24|t|r Bien hecho usted ha ganado 5 de oro por esta |cFFFF4500Muerte|r!" +#define KILL_FFA_MSG "|cffff6060[InMoral JcJ]:|r Bien hecho ganaste 5 de oro por esta muerte! |cFFFF4500Muerte|r!" +#define LOST_GOLD_MSG "|cffff6060[InMoral JcJ]:|r Lo siento |cFFFF4500perdiste|r 5 de oro" +#define ERR_TOO_MUCH_MONEY "|cffff6060[InMoral JcJ]: Superaste la cantidad maxima de oro!|r" + +enum Rewards +{ + NORMAL_REWARD = 50000, + FFA_REWARD = 50000, + FFA_LOST = 50000 +}; + +class GoldOnKill : public PlayerScript +{ +public: + GoldOnKill() : PlayerScript("GoldOnKill") {} + + void OnUpdateZone(Player* player, uint32 zone, uint32 area) + { + if(player->pvpInfo.IsInFFAPvPArea) //gets updated by UpdatePvPState + { + ChatHandler handler(player->GetSession()); + handler.PSendSysMessage(FFA_ENTER_MSG); + } + } + void OnPVPKill(Player* killer, Player* victim) + { + ChatHandler kHandler(killer->GetSession()); + ChatHandler vHandler(victim->GetSession()); + + if(killer->GetGUID() == victim->GetGUID()) + { + return; + } + else + { + if(killer->pvpInfo.IsInFFAPvPArea && victim->pvpInfo.IsInFFAPvPArea) //gets updated by UpdatePvPState + { + if(killer->GetMoney() + FFA_REWARD < MAX_MONEY_AMOUNT) + { + killer->SetMoney(killer->GetMoney() + FFA_REWARD); + kHandler.PSendSysMessage(KILL_FFA_MSG); + killer->CastSpell(killer, 23505, true); + //killer->CastSpell(killer, 33053, true); //bendicion de don pellisco + //killer->CastSpell(killer, 35076, true); //bendicion de adal + //killer->CastSpell(killer, 26393, true); //bendicion de elune + //killer->CastSpell(killer, 26035, true); //celebra los buenos tiempos + //killer->CastSpell(killer, 22888, true); //berrido de convocacion + //killer->CastSpell(killer, 24425, true); //espiritu zandalar + //killer->CastSpell(killer, 24705, true); //hombre de minbre + killer->ModifyArenaPoints(1); + } + else + kHandler.PSendSysMessage(ERR_TOO_MUCH_MONEY); + if(victim->GetMoney() - FFA_LOST > 0) + { + if(victim->GetMoney() != 0){ + victim->SetMoney(victim->GetMoney() - FFA_LOST); + } + vHandler.PSendSysMessage(LOST_GOLD_MSG); + } + } + else + { + if(killer->GetMoney() + NORMAL_REWARD < MAX_MONEY_AMOUNT) + { + killer->SetMoney(killer->GetMoney() + NORMAL_REWARD); + kHandler.PSendSysMessage(KILL_MSG); + killer->CastSpell(killer, 23505, true); + //killer->CastSpell(killer, 33053, true); + //killer->CastSpell(killer, 35076, true); + //killer->CastSpell(killer, 26393, true); + //killer->CastSpell(killer, 26035, true); + //killer->CastSpell(killer, 22888, true); + //killer->CastSpell(killer, 24425, true); + //killer->CastSpell(killer, 24705, true); + killer->ModifyArenaPoints(1); + } + else + kHandler.PSendSysMessage(ERR_TOO_MUCH_MONEY); + if (victim->GetMoney() - FFA_LOST > 0) + { + if (victim->GetMoney() != 0){ + victim->SetMoney(victim->GetMoney() - FFA_LOST); + } + vHandler.PSendSysMessage(LOST_GOLD_MSG); + } + } + } + } +}; + +void AddSC_GoldOnKill() +{ + new GoldOnKill(); +} diff --git a/simple_pvp_title_system.cpp b/simple_pvp_title_system.cpp new file mode 100644 index 0000000..c9da58d --- /dev/null +++ b/simple_pvp_title_system.cpp @@ -0,0 +1,56 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" + +const int ALLIANCE_TITLES[15] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 126 +}; +const int HORDE_TITLES[15] = { + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 127 +}; +const int HK_RANKS[15] = { + 100, 500, 1000, 2000, 4000, 5000, 6000, 8000, 10000, 15000, + 25000, 40000, 45000, 50000, 75000 +}; + +class title_granter : public PlayerScript +{ + public: + title_granter() : PlayerScript("title_granter") {} + + void OnPVPKill(Player* killer, Player* killed) + { + if (killer == NULL) return; + + uint32 hks = killer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS); + for (int rank=0; rank < 15; rank++) + { + if (hks >= HK_RANKS[rank]) + killer->SetTitle(sCharTitlesStore.LookupEntry( + (killer->GetTeam() == ALLIANCE ? ALLIANCE_TITLES + : HORDE_TITLES)[rank])); + } + } +}; + +void AddSC_title_granter() +{ + new title_granter(); +} \ No newline at end of file diff --git a/tokenconverter.cpp b/tokenconverter.cpp new file mode 100644 index 0000000..17d9033 --- /dev/null +++ b/tokenconverter.cpp @@ -0,0 +1,116 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include +#include "CharacterDatabaseCleaner.h" +#include "DatabaseEnv.h" +#include "ObjectMgr.h" + +class pvpconverter : public CreatureScript +{ +public: + pvpconverter() : CreatureScript("pvpconverter") + { + } + + void RewardItem(Player* pPlayer, Creature* pCreature) + { + char str[200]; + + if (pPlayer->HasItemCount(29436, 1)) + { + pPlayer->DestroyItemCount(29436, 1, true); + pPlayer->GetArenaTeamId(500); + ChatHandler(pPlayer->GetSession()).PSendSysMessage("Your Arena Token was successfully converted to arena points!", pPlayer->GetName()); + } + else + { + ChatHandler(pPlayer->GetSession()).PSendSysMessage("You don't have any Arena Tokens!!", pPlayer->GetName()); + } + pPlayer->PlayerTalkClass->ClearMenus(); + OnGossipHello(pPlayer, pCreature); + } + + void RewardItemArena(Player* pPlayer, Creature* pCreature) + { + char str[200]; + + if (pPlayer->HasItemCount(29436, 1)) + { + pPlayer->DestroyItemCount(29436, 1, true); + pPlayer->GetArenaTeamId(1000); + ChatHandler(pPlayer->GetSession()).PSendSysMessage("Your Arena Token was successfully converted to arena points!", pPlayer->GetName()); + } + else + { + ChatHandler(pPlayer->GetSession()).PSendSysMessage("You don't have any Arena Tokens!", pPlayer->GetName()); + } + pPlayer->PlayerTalkClass->ClearMenus(); + OnGossipHello(pPlayer, pCreature); + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Information about this system:", GOSSIP_SENDER_MAIN, 2000); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Continue", GOSSIP_SENDER_MAIN, 1000); + + pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID()); + + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) + { + pPlayer->PlayerTalkClass->ClearMenus(); + + char str[200]; + + switch (uiAction) + { + case 1000: + pPlayer->PlayerTalkClass->ClearMenus(); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Convert 1 Arena Token", GOSSIP_SENDER_MAIN, 1001); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Return.", GOSSIP_SENDER_MAIN, 9999); + pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID()); + return true; + break; + case 1001: + RewardItem(pPlayer, pCreature); + break; + case 2000: + ChatHandler(pPlayer->GetSession()).PSendSysMessage("For 1 Arena Token you will receive 500 Arena Points!", pPlayer->GetName()); + pPlayer->PlayerTalkClass->ClearMenus(); + OnGossipHello(pPlayer, pCreature); + break; + case 9999: + pPlayer->PlayerTalkClass->ClearMenus(); + OnGossipHello(pPlayer, pCreature); + break; + } + + return true; + } + +}; + +void AddSC_pvpconverter() +{ + new pvpconverter(); +} \ No newline at end of file diff --git a/top_class_killers.cpp b/top_class_killers.cpp new file mode 100644 index 0000000..fdcb151 --- /dev/null +++ b/top_class_killers.cpp @@ -0,0 +1,109 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ + +#include "ScriptPCH.h" + +/*Class E_Menu*/ +#define E_Warrior "Ver top 5 Guerrero Muertes" +#define E_Paladin "Ver top 5 Paladin Muertes" +#define E_Hunter "Ver top 5 Cazador Muertes" +#define E_Rogue "Ver top 5 Picaro Muertes" +#define E_Priest "Ver top 5 Sacerdote Muertes" +#define E_Shaman "Ver top 5 Chaman Muertes" +#define E_Mage "Ver top 5 Mago Muertes" +#define E_Warlock "Ver top 5 Brujo Muertes" +#define E_Druid "Ver top 5 Druida Muertes" +#define E_Death_knight "Ver top 5 Dk Muertes" +/*Top 5 Message*/ +#define M_Warrior "Este es el top 5 Guerrero Muertes" +#define M_Paladin "Este es el top 5 Paladin Muertes" +#define M_Hunter "Este es el top 5 Cazador Muertes" +#define M_Rogue "Este es el top 5 Picaro Muertes" +#define M_Priest "Este es el top 5 Sacerdote Muertes" +#define M_Shaman "Este es el top 5 Chaman Muertes" +#define M_Mage "Este es el top 5 Mago Muertes" +#define M_Warlock "Este es el top 5 Brujo Muertes" +#define M_Druid "Este es el top 5 Druida Muertes" +#define M_Death_knight "Este es el top 5 Dk Muertes" + +class Top5_Killers : public CreatureScript +{ +public: + Top5_Killers() : CreatureScript("Top5_Killers") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + player->ADD_GOSSIP_ITEM(1, E_Warrior, GOSSIP_SENDER_MAIN, 1); + player->ADD_GOSSIP_ITEM(1, E_Paladin, GOSSIP_SENDER_MAIN, 2); + player->ADD_GOSSIP_ITEM(1, E_Hunter, GOSSIP_SENDER_MAIN, 3); + player->ADD_GOSSIP_ITEM(1, E_Rogue, GOSSIP_SENDER_MAIN, 4); + player->ADD_GOSSIP_ITEM(1, E_Priest, GOSSIP_SENDER_MAIN, 5); + player->ADD_GOSSIP_ITEM(1, E_Shaman, GOSSIP_SENDER_MAIN, 7); + player->ADD_GOSSIP_ITEM(1, E_Mage, GOSSIP_SENDER_MAIN, 8); + player->ADD_GOSSIP_ITEM(1, E_Warlock, GOSSIP_SENDER_MAIN, 9); + player->ADD_GOSSIP_ITEM(1, E_Druid, GOSSIP_SENDER_MAIN, 11); + player->ADD_GOSSIP_ITEM(1, E_Death_knight, GOSSIP_SENDER_MAIN, 6); + player->SEND_GOSSIP_MENU(1, creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (sender != GOSSIP_SENDER_MAIN) + return true; // wrong sender, something fisy + + switch(action) + { + case 1: ChatHandler(player->GetSession()).PSendSysMessage(M_Warrior); break; + case 2: ChatHandler(player->GetSession()).PSendSysMessage(M_Paladin); break; + case 3: ChatHandler(player->GetSession()).PSendSysMessage(M_Hunter); break; + case 4: ChatHandler(player->GetSession()).PSendSysMessage(M_Rogue); break; + case 5: ChatHandler(player->GetSession()).PSendSysMessage(M_Priest); break; + case 6: ChatHandler(player->GetSession()).PSendSysMessage(M_Death_knight); break; + case 7: ChatHandler(player->GetSession()).PSendSysMessage(M_Shaman); break; + case 8: ChatHandler(player->GetSession()).PSendSysMessage(M_Mage); break; + case 9: ChatHandler(player->GetSession()).PSendSysMessage(M_Warlock); break; + case 11: ChatHandler(player->GetSession()).PSendSysMessage(M_Druid); break; + default: return true; // invalid class, something fishy + } + + QueryResult result = CharacterDatabase.PQuery("SELECT name, totalKills FROM characters WHERE class = %u ORDER BY totalKills DESC LIMIT 5", action); + if(result) + { + do + { + Field * fields = result->Fetch(); + std::string name = fields[0].GetString(); + uint32 totalKills = fields[1].GetUInt32(); + ChatHandler(player->GetSession()).PSendSysMessage("Nombre: %s, Total de muertes : %u", name.c_str(), totalKills); + } + while(result->NextRow()); + } + OnGossipHello(player, creature); // return to main menu + return true; + } +}; + + +void AddSC_Top5_Killers() +{ + new Top5_Killers(); +} \ No newline at end of file diff --git a/world_chat.cpp b/world_chat.cpp new file mode 100644 index 0000000..f69181c --- /dev/null +++ b/world_chat.cpp @@ -0,0 +1,175 @@ +/* +*==============================================* +* _/_/_/ _/_/_/ * +* _/ _/ _/ _/ * +* _/_/_/ _/ _/_/ * +* _/ _/ _/_/ * +* _/ _/_/_/ _/ _/ * +*==============================================* +* _/_/_/ _/_/_/ _/_/_/ _/_/_/ * +* _/ _/ _/ _/ _/ _/ * +* _/ _/ _/ _/_/_/ _/_/_/ * +* _/_/_/ _/_/_/ _/ _/ _/ * +* 2015 Dev-KM _/ _/_/_/_/ * +* -------------------------------------------- * +* - Developer(s): KM * +* - Contacto: krizttian@live.com * +* - Copyright (C) 2014 - 2015 FixCore. * +*==============================================* +*/ +#include "ScriptPCH.h" +#include "Chat.h" + +#define FACTION_SPECIFIC 0 + +std::string GetNameLink(Player* player) +{ + std::string name = player->GetName(); + std::string color; + switch(player->getClass()) + { + case CLASS_DEATH_KNIGHT: + color = "|cffC41F3B"; + break; + case CLASS_DRUID: + color = "|cffFF7D0A"; + break; + case CLASS_HUNTER: + color = "|cffABD473"; + break; + case CLASS_MAGE: + color = "|cff69CCF0"; + break; + case CLASS_PALADIN: + color = "|cffF58CBA"; + break; + case CLASS_PRIEST: + color = "|cffFFFFFF"; + break; + case CLASS_ROGUE: + color = "|cffFFF569"; + break; + case CLASS_SHAMAN: + color = "|cff0070DE"; + break; + case CLASS_WARLOCK: + color = "|cff9482C9"; + break; + case CLASS_WARRIOR: + color = "|cffC79C6E"; + break; + } + return "|Hplayer:"+name+"|h|cffFFFFFF["+color+name+"|cffFFFFFF]|h|r"; +} + +class cs_world_chat : public CommandScript +{ + public: + cs_world_chat() : CommandScript("cs_world_chat"){} + + ChatCommand * GetCommands() const + { + static ChatCommand WorldChatCommandTable[] = + { + {"chat", SEC_PLAYER, true, &HandleWorldChatCommand, "", NULL}, + {NULL, 0, false, NULL, "", NULL} + }; + + return WorldChatCommandTable; + } + + static bool HandleWorldChatCommand(ChatHandler * handler, const char * args) + { + if (!handler->GetSession()->GetPlayer()->CanSpeak()) + return false; + std::string temp = args; + + if (!args || temp.find_first_not_of(' ') == std::string::npos) + return false; + + std::string msg = ""; + Player * player = handler->GetSession()->GetPlayer(); + + switch(player->GetSession()->GetSecurity()) + { + // Player + case SEC_PLAYER: + if (player->GetTeam() == ALLIANCE) + { + msg += "|cff0000ff[Alianza] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + } + + else + { + msg += "|cffff0000[Horda] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + } + break; + // VIP + case 1: + msg += "|cffC400C4[Gm-R1] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + // Trial GM - 2 + case 2: + msg += "|cff800000[Gm-R2] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + // GM - 3 + case 3: + msg += "|cff0000FF[GM-R3] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + // GM-4 + case 4: + msg += "|CFF800080[GM-R4] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + // Developer - 5 + case 5: + msg += "|cff000000[Administrador] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + // Admin - 6 + case 6: + msg += "|cffFF0000[ADMIN] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + // CONSOLA + case 7: + msg += "|cffFF0000[SERVIDOR] "; + msg += GetNameLink(player); + msg += " |cfffaeb00"; + break; + + } + + msg += args; + if (FACTION_SPECIFIC) + { + SessionMap sessions = sWorld->GetAllSessions(); + for (SessionMap::iterator itr = sessions.begin(); itr != sessions.end(); ++itr) + if (Player* plr = itr->second->GetPlayer()) + if (plr->GetTeam() == player->GetTeam()) + sWorld->SendServerMessage(SERVER_MSG_STRING, msg.c_str(), plr); + } + else + sWorld->SendServerMessage(SERVER_MSG_STRING, msg.c_str(), 0); + + return true; + } +}; + +void AddSC_cs_world_chat() +{ + new cs_world_chat(); +} \ No newline at end of file