Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "Chat.h"
- #include "Language.h"
- #include "ObjectMgr.h"
- #include "Player.h"
- #include "ScriptMgr.h"
- /*
- Author : Philippe
- Release Date : 8/10/13
- Script Complete : 50 %
- Why 50 % ?
- Because There is many way to add more stuff on it.
- like VIP System Or Area Restriction...
- */
- /* SQL
- DELETE FROM `creature_template` WHERE (`entry`=500000);
- 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);
- */
- class GodMode_NPC : public CreatureScript
- {
- public:
- GodMode_NPC()
- : CreatureScript("GodMode_NPC")
- {}
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->IsInCombat())
- {
- creature->MonsterWhisper("Your are in combat", player->GetGUID());
- }
- player->ADD_GOSSIP_ITEM(5, "Activate : God Mode", GOSSIP_SENDER_MAIN, 1);
- player->ADD_GOSSIP_ITEM(5, "Activate : Instant CastTime", GOSSIP_SENDER_MAIN, 2);
- player->ADD_GOSSIP_ITEM(5, "Activate : No Global Cooldowns", GOSSIP_SENDER_MAIN, 3);
- player->ADD_GOSSIP_ITEM(5, "Disable all", GOSSIP_SENDER_MAIN, 4);
- player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Actions)
- {
- player->PlayerTalkClass->ClearMenus();
- if (player->IsInCombat())
- {
- player->CLOSE_GOSSIP_MENU();
- creature->MonsterWhisper("Your are in combat", player->GetGUID());
- return true;
- }
- switch (Sender,Actions)
- {
- {
- case 0:
- player->ADD_GOSSIP_ITEM(5, "Activate : God Mode", GOSSIP_SENDER_MAIN, 1);
- player->ADD_GOSSIP_ITEM(5, "Activate : Instant CastTime", GOSSIP_SENDER_MAIN, 2);
- player->ADD_GOSSIP_ITEM(5, "Activate : No Global Cooldowns", GOSSIP_SENDER_MAIN, 3);
- player->ADD_GOSSIP_ITEM(5, "Disable all", GOSSIP_SENDER_MAIN, 4);
- player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
- break;
- case 1:
- player->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_POWER);
- if (player->getClass() == CLASS_WARRIOR)
- {
- player->SetMaxPower(POWER_RAGE, 1000000);
- player->SetPower(POWER_RAGE, 1000000);
- }
- if (player->getClass() == CLASS_DEATH_KNIGHT)
- {
- player->SetMaxPower(POWER_RUNIC_POWER, 1000000);
- player->SetPower(POWER_RUNIC_POWER, 1000000);
- }
- ChatHandler(player->GetSession()).PSendSysMessage("God Mode is ON !");
- player->CLOSE_GOSSIP_MENU();
- break;
- case 2:
- player->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_CASTTIME);
- ChatHandler(player->GetSession()).PSendSysMessage("Instant CastTime, Is On !");
- player->CLOSE_GOSSIP_MENU();
- break;
- case 3:
- player->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_COOLDOWN);
- ChatHandler(player->GetSession()).PSendSysMessage("No Global Cooldowns, Is On !");
- player->CLOSE_GOSSIP_MENU();
- break;
- case 4:
- player->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_POWER);
- player->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_CASTTIME);
- player->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_COOLDOWN);
- if (player->getClass() == CLASS_WARRIOR)
- {
- player->SetMaxPower(POWER_RAGE, 100);
- player->SetPower(POWER_RAGE, 0);
- }
- if (player->getClass() == CLASS_DEATH_KNIGHT)
- {
- player->SetMaxPower(POWER_RUNIC_POWER, 100);
- player->SetPower(POWER_RUNIC_POWER, 0);
- }
- ChatHandler(player->GetSession()).PSendSysMessage("All Gods Modes has been shutdown");
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- }
- return true;
- }
- };
- void AddSC_GodMode_NPC()
- {
- new GodMode_NPC();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement