Merge remote-tracking branch 'origin/master' into 4.3.4

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/scripts/Commands/cs_misc.cpp
	src/server/worldserver/worldserver.conf.dist
This commit is contained in:
Nay committed 2012-09-01 22:19:13 +01:00
commit 2e1de60593
20 files changed
+476 -243

No files matched your search

@@ -16,6 +16,7 @@ set(scripts_STAT_SRCS
Commands/cs_bf.cpp
Commands/cs_cast.cpp
Commands/cs_character.cpp
Commands/cs_cheat.cpp
Commands/cs_debug.cpp
Commands/cs_disable.cpp
Commands/cs_event.cpp
+281
View File
@@ -0,0 +1,281 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
Name: cheat_commandscript
%Complete: 100
Comment: All cheat related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
class cheat_commandscript : public CommandScript
{
public:
cheat_commandscript() : CommandScript("cheat_commandscript") { }
ChatCommand* GetCommands() const
{
static ChatCommand cheatCommandTable[] =
{
{ "god", SEC_GAMEMASTER, false, &HandleGodModeCheatCommand, "", NULL },
{ "casttime", SEC_GAMEMASTER, false, &HandleCasttimeCheatCommand, "", NULL },
{ "cooldown", SEC_GAMEMASTER, false, &HandleCoolDownCheatCommand, "", NULL },
{ "power", SEC_GAMEMASTER, false, &HandlePowerCheatCommand, "", NULL },
{ "waterwalk", SEC_GAMEMASTER, false, &HandleWaterWalkCheatCommand, "", NULL },
{ "taxi", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "", NULL },
{ "explore", SEC_GAMEMASTER, false, &HandleExploreCheatCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "cheat", SEC_GAMEMASTER, false, NULL, "", cheatCommandTable },
{ NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
static bool HandleGodModeCheatCommand(ChatHandler* handler, const char* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
std::string argstr = (char*)args;
if (!*args)
argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_GOD)) ? "off" : "on";
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_GOD);
handler->SendSysMessage("Godmode is OFF. You can take damage.");
return true;
}
else if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_GOD);
handler->SendSysMessage("Godmode is ON. You won't take damage.");
return true;
}
return false;
}
static bool HandleCasttimeCheatCommand(ChatHandler* handler, const char* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
std::string argstr = (char*)args;
if (!*args)
argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_CASTTIME)) ? "off" : "on";
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_CASTTIME);
handler->SendSysMessage("CastTime Cheat is OFF. Your spells will have a casttime.");
return true;
}
else if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_CASTTIME);
handler->SendSysMessage("CastTime Cheat is ON. Your spells won't have a casttime.");
return true;
}
return false;
}
static bool HandleCoolDownCheatCommand(ChatHandler* handler, const char* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
std::string argstr = (char*)args;
if (!*args)
argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_COOLDOWN)) ? "off" : "on";
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_COOLDOWN);
handler->SendSysMessage("Cooldown Cheat is OFF. You are on the global cooldown.");
return true;
}
else if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_COOLDOWN);
handler->SendSysMessage("Cooldown Cheat is ON. You are not on the global cooldown.");
return true;
}
return false;
}
static bool HandlePowerCheatCommand(ChatHandler* handler, const char* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
std::string argstr = (char*)args;
if (!*args)
argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_POWER)) ? "off" : "on";
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_POWER);
handler->SendSysMessage("Power Cheat is OFF. You need mana/rage/energy to use spells.");
return true;
}
else if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_POWER);
handler->SendSysMessage("Power Cheat is ON. You don't need mana/rage/energy to use spells.");
return true;
}
return false;
}
static bool HandleWaterWalkCheatCommand(ChatHandler* handler, const char* args)
{
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
return false;
std::string argstr = (char*)args;
if (!*args)
{
argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK)) ? "off" : "on";
if (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK))
argstr = "off";
else
argstr = "on";
}
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK);
handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF
handler->SendSysMessage("Waterwalking is OFF. You can't walk on water.");
return true;
}
else if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK);
handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON
handler->SendSysMessage("Waterwalking is ON. You can walk on water.");
return true;
}
return false;
}
static bool HandleTaxiCheatCommand(ChatHandler* handler, const char* args)
{
if (!*args)
{
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;
}
std::string argstr = (char*)args;
Player* chr = handler->getSelectedPlayer();
if (!chr)
chr = handler->GetSession()->GetPlayer();
else if (handler->HasLowerSecurity(chr, 0)) // check online security
return false;
if (argstr == "on")
{
chr->SetTaxiCheater(true);
handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
return true;
}
if (argstr == "off")
{
chr->SetTaxiCheater(false);
handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
return true;
}
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;
}
static bool HandleExploreCheatCommand(ChatHandler* handler, const char *args)
{
if (!*args)
return false;
int flag = atoi((char*)args);
Player* chr = handler->getSelectedPlayer();
if (chr == NULL)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
if (flag != 0)
{
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str());
}
else
{
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str());
}
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
{
if (flag != 0)
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
else
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
}
return true;
}
};
void AddSC_cheat_commandscript()
{
new cheat_commandscript();
}
-118
View File
@@ -82,10 +82,8 @@ public:
{ "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL },
{ "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL },
{ "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL },
{ "taxicheat", SEC_MODERATOR, false, &HandleTaxiCheatCommand, "", NULL },
{ "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL },
{ "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL },
{ "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "", NULL },
{ "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL },
{ "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL },
{ "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL },
@@ -106,7 +104,6 @@ public:
{ "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL },
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL },
{ "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL },
{ "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "", NULL },
{ "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL },
{ "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL },
{ "listfreeze", SEC_MODERATOR, false, &HandleListFreezeCommand, "", NULL },
@@ -960,49 +957,6 @@ public:
player->CastSpell(player, 7355, false);
return true;
}
// Enable on\off all taxi paths
static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args)
{
if (!*args)
{
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;
}
std::string argStr = (char*)args;
Player* chr = handler->getSelectedPlayer();
if (!chr)
chr = handler->GetSession()->GetPlayer();
else if (handler->HasLowerSecurity(chr, 0)) // check online security
return false;
if (argStr == "on")
{
chr->SetTaxiCheater(true);
handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
return true;
}
if (argStr == "off")
{
chr->SetTaxiCheater(false);
handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
return true;
}
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;
}
static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args)
{
@@ -1123,45 +1077,6 @@ public:
return true;
}
static bool HandleExploreCheatCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
int32 flag = int32(atoi((char*)args));
Player* playerTarget = handler->getSelectedPlayer();
if (!playerTarget)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
if (flag != 0)
{
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(playerTarget).c_str());
if (handler->needReportToTarget(playerTarget))
ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str());
}
else
{
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(playerTarget).c_str());
if (handler->needReportToTarget(playerTarget))
ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str());
}
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
{
if (flag != 0)
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
else
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
}
return true;
}
static bool HandleShowAreaCommand(ChatHandler* handler, char const* args)
{
if (!*args)
@@ -2193,39 +2108,6 @@ public:
return true;
}
static bool HandleWaterwalkCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
Player* player = handler->getSelectedPlayer();
if (!player)
{
handler->PSendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
// check online security
if (handler->HasLowerSecurity(player, 0))
return false;
if (strncmp(args, "on", 3) == 0)
player->SendMovementSetWaterWalking(true);
else if (strncmp(args, "off", 4) == 0)
player->SendMovementSetWaterWalking(false);
else
{
handler->SendSysMessage(LANG_USE_BOL);
return false;
}
handler->PSendSysMessage(LANG_YOU_SET_WATERWALK, args, handler->GetNameLink(player).c_str());
if (handler->needReportToTarget(player))
ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, handler->GetNameLink().c_str());
return true;
}
// Send mail by command
static bool HandleSendMailCommand(ChatHandler* handler, char const* args)
{
+15 -7
View File
@@ -174,9 +174,12 @@ public:
## wyrmrest_defender
######*/
enum Spells
enum WyrmDefenderEnum
{
SPELL_CHARACTER_SCRIPT = 49213
QUEST_DEFENDING_WYRMREST_TEMPLE = 12372,
GOSSIP_TEXTID_DEF1 = 12899,
GOSSIP_TEXTID_DEF2 = 12900,
SPELL_CHARACTER_SCRIPT = 49213
};
#define GOSSIP_ITEM_1 "We need to get into the fight. Are you ready?"
@@ -187,19 +190,24 @@ class npc_wyrmrest_defender : public CreatureScript
npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { }
bool OnGossipHello(Player* player, Creature* creature)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
{
if (player->GetQuestStatus(QUEST_DEFENDING_WYRMREST_TEMPLE) == QUEST_STATUS_INCOMPLETE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF1, creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF2, creature->GetGUID());
// Makes player cast trigger spell for 49207 on self
player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true);
}
@@ -194,103 +194,6 @@ public:
}
};
/*######
## npc_victorious_challenger
######*/
#define GOSSIP_CHALLENGER "Let's do this, sister."
enum eVictoriousChallenger
{
QUEST_TAKING_ALL_CHALLENGERS = 12971,
QUEST_DEFENDING_YOUR_TITLE = 13423,
SPELL_SUNDER_ARMOR = 11971,
SPELL_REND_VC = 11977
};
class npc_victorious_challenger : public CreatureScript
{
public:
npc_victorious_challenger() : CreatureScript("npc_victorious_challenger") { }
struct npc_victorious_challengerAI : public ScriptedAI
{
npc_victorious_challengerAI(Creature* creature) : ScriptedAI(creature) {}
uint32 SunderArmorTimer;
uint32 RendTimer;
void Reset()
{
me->RestoreFaction();
SunderArmorTimer = 10000;
RendTimer = 15000;
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (RendTimer < diff)
{
DoCast(me->getVictim(), SPELL_REND_VC, true);
RendTimer = 15000;
}else RendTimer -= diff;
if (SunderArmorTimer < diff)
{
DoCast(me->getVictim(), SPELL_SUNDER_ARMOR, true);
SunderArmorTimer = 10000;
}else SunderArmorTimer -= diff;
DoMeleeAttackIfReady();
}
void KilledUnit(Unit* /*victim*/)
{
me->RestoreFaction();
}
};
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(QUEST_TAKING_ALL_CHALLENGERS) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_DEFENDING_YOUR_TITLE) == QUEST_STATUS_INCOMPLETE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CHALLENGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
return false;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
creature->setFaction(14);
creature->AI()->AttackStart(player);
}
return true;
}
CreatureAI* GetAI(Creature* creature) const
{
return new npc_victorious_challengerAI(creature);
}
};
/*######
## npc_loklira_crone
######*/
@@ -753,7 +656,6 @@ void AddSC_storm_peaks()
new npc_agnetta_tyrsdottar();
new npc_frostborn_scout();
new npc_thorim();
new npc_victorious_challenger();
new npc_loklira_crone();
new npc_injured_goblin();
new npc_roxi_ramrocket();
@@ -45,6 +45,7 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "Group.h"
#include "SpellScript.h"
/*#####
# mob_mature_netherwing_drake
@@ -1868,9 +1869,41 @@ public:
};
};
/*#####
#
######*/
enum ZuluhedChains
{
QUEST_ZULUHED = 10866,
NPC_KARYNAKU = 22112,
};
class spell_unlocking_zuluheds_chains : public SpellScriptLoader
{
public:
spell_unlocking_zuluheds_chains() : SpellScriptLoader("spell_unlocking_zuluheds_chains") { }
class spell_unlocking_zuluheds_chains_SpellScript : public SpellScript
{
PrepareSpellScript(spell_unlocking_zuluheds_chains_SpellScript);
void HandleOnCast()
{
// FIXME: Hackish solution, a better way to reward killcredit should be found
if (Unit* caster = GetCaster())
if(Player* player = caster->ToPlayer())
if (player->GetQuestStatus(QUEST_ZULUHED) == QUEST_STATUS_INCOMPLETE)
player->CastedCreatureOrGO(NPC_KARYNAKU, MAKE_NEW_GUID(0, NPC_KARYNAKU, HIGHGUID_UNIT), 0);
}
void Register()
{
OnCast += SpellCastFn(spell_unlocking_zuluheds_chains_SpellScript::HandleOnCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_unlocking_zuluheds_chains_SpellScript();
}
};
void AddSC_shadowmoon_valley()
{
@@ -1889,4 +1922,5 @@ void AddSC_shadowmoon_valley()
new mob_illidari_spawn();
new mob_torloth_the_magnificent();
new npc_enraged_spirit();
new spell_unlocking_zuluheds_chains();
}