Advertisement
Callmephil

God Mode NPC

Oct 8th, 2013
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.98 KB | None | 0 0
  1.  
  2.  
  3. #include "ScriptPCH.h"
  4. #include "Chat.h"
  5. #include "Language.h"
  6. #include "ObjectMgr.h"
  7. #include "Player.h"
  8. #include "ScriptMgr.h"
  9.  
  10. /*
  11. Author : Philippe
  12. Release Date : 8/10/13
  13. Script Complete : 50 %
  14. Why 50 % ?
  15. Because There is many way to add more stuff on it.
  16. like VIP System Or Area Restriction...
  17. */
  18.  
  19. /* SQL
  20. DELETE FROM `creature_template` WHERE (`entry`=500000);
  21. INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (500000, 0, 0, 0, 0, 0, 30507, 0, 0, 0, 'God Mods NPC', '', '', 0, 1, 1, 0, 35, 35, 1, 1, 1.14286, 10, 0, 2, 2, 0, 24, 1, 2000, 0, 1, 33536, 2048, 8, 0, 0, 0, 0, 0, 1, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 7, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 'GodMode_NPC', 12340);
  22.  
  23. */
  24.  
  25. class GodMode_NPC : public CreatureScript
  26. {
  27. public:
  28.     GodMode_NPC()
  29.         : CreatureScript("GodMode_NPC")
  30.     {}
  31.  
  32.     bool OnGossipHello(Player* player, Creature* creature)
  33.     {
  34.         if (player->IsInCombat())
  35.         {
  36.             creature->MonsterWhisper("Your are in combat", player->GetGUID());
  37.         }
  38.  
  39.         player->ADD_GOSSIP_ITEM(5,  "Activate : God Mode", GOSSIP_SENDER_MAIN, 1);
  40.         player->ADD_GOSSIP_ITEM(5,  "Activate : Instant CastTime", GOSSIP_SENDER_MAIN, 2);
  41.         player->ADD_GOSSIP_ITEM(5,  "Activate : No Global Cooldowns", GOSSIP_SENDER_MAIN, 3);
  42.         player->ADD_GOSSIP_ITEM(5,  "Disable all", GOSSIP_SENDER_MAIN, 4);
  43.         player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
  44.  
  45.         return true;
  46.  
  47.     }
  48.  
  49.  
  50.     bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32  Actions)
  51.     {
  52.         player->PlayerTalkClass->ClearMenus();
  53.  
  54.         if (player->IsInCombat())
  55.         {
  56.  
  57.             player->CLOSE_GOSSIP_MENU();
  58.             creature->MonsterWhisper("Your are in combat", player->GetGUID());
  59.  
  60.             return true;
  61.         }
  62.         switch (Sender,Actions)
  63.         {
  64.             {
  65.         case 0:
  66.             player->ADD_GOSSIP_ITEM(5,  "Activate : God Mode", GOSSIP_SENDER_MAIN, 1);
  67.             player->ADD_GOSSIP_ITEM(5,  "Activate : Instant CastTime", GOSSIP_SENDER_MAIN, 2);
  68.             player->ADD_GOSSIP_ITEM(5,  "Activate : No Global Cooldowns", GOSSIP_SENDER_MAIN, 3);
  69.             player->ADD_GOSSIP_ITEM(5,  "Disable all", GOSSIP_SENDER_MAIN, 4);
  70.             player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
  71.             break;
  72.  
  73.         case 1:
  74.             player->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_POWER);
  75.             if (player->getClass() == CLASS_WARRIOR)
  76.             {
  77.             player->SetMaxPower(POWER_RAGE, 1000000);
  78.             player->SetPower(POWER_RAGE, 1000000);
  79.             }
  80.             if (player->getClass() == CLASS_DEATH_KNIGHT)
  81.             {
  82.             player->SetMaxPower(POWER_RUNIC_POWER, 1000000);
  83.             player->SetPower(POWER_RUNIC_POWER, 1000000);
  84.             }
  85.             ChatHandler(player->GetSession()).PSendSysMessage("God Mode is ON !");
  86.             player->CLOSE_GOSSIP_MENU();
  87.             break;
  88.         case 2:
  89.             player->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_CASTTIME);
  90.             ChatHandler(player->GetSession()).PSendSysMessage("Instant CastTime, Is On !");
  91.             player->CLOSE_GOSSIP_MENU();
  92.             break;
  93.         case 3:
  94.             player->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_COOLDOWN);
  95.             ChatHandler(player->GetSession()).PSendSysMessage("No Global Cooldowns, Is On !");
  96.             player->CLOSE_GOSSIP_MENU();
  97.             break;
  98.  
  99.         case 4:
  100.             player->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_POWER);
  101.             player->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_CASTTIME);
  102.             player->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_COOLDOWN);
  103.             if (player->getClass() == CLASS_WARRIOR)
  104.             {
  105.             player->SetMaxPower(POWER_RAGE, 100);
  106.             player->SetPower(POWER_RAGE, 0);
  107.             }
  108.             if (player->getClass() == CLASS_DEATH_KNIGHT)
  109.             {
  110.             player->SetMaxPower(POWER_RUNIC_POWER, 100);
  111.             player->SetPower(POWER_RUNIC_POWER, 0);
  112.             }
  113.             ChatHandler(player->GetSession()).PSendSysMessage("All Gods Modes has been shutdown");
  114.             player->CLOSE_GOSSIP_MENU();
  115.             break;
  116.             }
  117.         }
  118.         return true;
  119.     }
  120. };
  121.  
  122.  
  123. void AddSC_GodMode_NPC()
  124. {
  125.     new GodMode_NPC();
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement