*Some cleanup.
--HG-- branch : trunk
This commit is contained in:
@@ -3,26 +3,22 @@
|
||||
|
||||
#define GOSSIP_FLIGHT "I need a ride"
|
||||
|
||||
bool GossipHello_npc_acherus_taxi(Player* pPlayer, Creature* pCreature)
|
||||
bool GossipHello_npc_acherus_taxi(Player *pPlayer, Creature *pCreature)
|
||||
{
|
||||
pPlayer->SetTaxiCheater(true);
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID());
|
||||
pPlayer->SetTaxiCheater(true);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_acherus_taxi(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
bool GossipSelect_npc_acherus_taxi(Player *pPlayer, Creature *pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
if (pPlayer->GetPositionZ() >=316)
|
||||
{
|
||||
pPlayer->GetSession()->SendDoFlight(24446, 1053);
|
||||
}else{
|
||||
pPlayer->GetSession()->SendDoFlight(24446, 1054);
|
||||
}
|
||||
|
||||
if (pPlayer->GetPositionZ() >= 316)
|
||||
pPlayer->GetSession()->SendDoFlight(24446, 1053);
|
||||
else
|
||||
pPlayer->GetSession()->SendDoFlight(24446, 1054);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -31,9 +27,9 @@ void AddSC_npc_acherus_taxi()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_acherus_taxi";
|
||||
newscript->pGossipHello = &GossipHello_npc_acherus_taxi;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_acherus_taxi;
|
||||
newscript->RegisterSelf();
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_acherus_taxi";
|
||||
newscript->pGossipHello = &GossipHello_npc_acherus_taxi;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_acherus_taxi;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
|
||||
if(areaflag < 0)
|
||||
return NULL;
|
||||
|
||||
return sAreaStore.LookupEntry(areaflag );
|
||||
return sAreaStore.LookupEntry(areaflag);
|
||||
}
|
||||
|
||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id)
|
||||
@@ -695,7 +695,7 @@ void Map2ZoneCoordinates(float& x,float& y,uint32 zone)
|
||||
std::swap(x,y); // client have map coords swapped
|
||||
}
|
||||
|
||||
uint32 const* GetTalentTabPages(uint32 cls)
|
||||
uint32 const* GetTalentTabPages(uint8 cls)
|
||||
{
|
||||
return sTalentTabPages[cls];
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id);
|
||||
|
||||
bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId);
|
||||
|
||||
void Zone2MapCoordinates(float& x,float& y,uint32 zone);
|
||||
void Map2ZoneCoordinates(float& x,float& y,uint32 zone);
|
||||
void Zone2MapCoordinates(float &x, float &y, uint32 zone);
|
||||
void Map2ZoneCoordinates(float &x, float &y, uint32 zone);
|
||||
|
||||
uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls);
|
||||
uint32 const* /*[3]*/ GetTalentTabPages(uint8 cls);
|
||||
|
||||
extern DBCStorage <AchievementEntry> sAchievementStore;
|
||||
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||
|
||||
+120
-121
@@ -55,7 +55,7 @@
|
||||
#include "AuctionHouseBot.h"
|
||||
#include "CreatureEventAIMgr.h"
|
||||
|
||||
bool ChatHandler::HandleAHBotOptionsCommand(const char* args)
|
||||
bool ChatHandler::HandleAHBotOptionsCommand(const char *args)
|
||||
{
|
||||
uint32 ahMapID = 0;
|
||||
char * opt = strtok((char*)args, " ");
|
||||
@@ -755,7 +755,7 @@ bool ChatHandler::HandleReloadCreatureQuestRelationsCommand(const char*)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadCreatureLinkedRespawnCommand(const char* args)
|
||||
bool ChatHandler::HandleReloadCreatureLinkedRespawnCommand(const char *args)
|
||||
{
|
||||
sLog.outString( "Loading Linked Respawns... (`creature_linked_respawn`)" );
|
||||
objmgr.LoadCreatureLinkedRespawn();
|
||||
@@ -1365,7 +1365,7 @@ bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLoadScriptsCommand(const char* args)
|
||||
bool ChatHandler::HandleLoadScriptsCommand(const char *args)
|
||||
{
|
||||
if(!LoadScriptingModule(args)) return true;
|
||||
|
||||
@@ -1373,7 +1373,7 @@ bool ChatHandler::HandleLoadScriptsCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReloadAuctionsCommand(const char* args)
|
||||
bool ChatHandler::HandleReloadAuctionsCommand(const char *args)
|
||||
{
|
||||
///- Reload dynamic data tables from the database
|
||||
sLog.outString( "Re-Loading Auctions..." );
|
||||
@@ -1383,7 +1383,7 @@ bool ChatHandler::HandleReloadAuctionsCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -1473,7 +1473,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
}
|
||||
|
||||
/// Set password for account
|
||||
bool ChatHandler::HandleAccountSetPasswordCommand(const char* args)
|
||||
bool ChatHandler::HandleAccountSetPasswordCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -1553,7 +1553,7 @@ bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleSetSkillCommand(const char* args)
|
||||
bool ChatHandler::HandleSetSkillCommand(const char *args)
|
||||
{
|
||||
// number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r
|
||||
char* skill_p = extractKeyFromLink((char*)args,"Hskill");
|
||||
@@ -1613,7 +1613,7 @@ bool ChatHandler::HandleSetSkillCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnLearnCommand(const char* args)
|
||||
bool ChatHandler::HandleUnLearnCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -1648,7 +1648,7 @@ bool ChatHandler::HandleUnLearnCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCooldownCommand(const char* args)
|
||||
bool ChatHandler::HandleCooldownCommand(const char *args)
|
||||
{
|
||||
Player* target = getSelectedPlayer();
|
||||
if (!target)
|
||||
@@ -2528,7 +2528,7 @@ bool ChatHandler::HandleLearnAllLangCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLearnAllDefaultCommand(const char* args)
|
||||
bool ChatHandler::HandleLearnAllDefaultCommand(const char *args)
|
||||
{
|
||||
Player* target;
|
||||
if(!extractPlayerTarget((char*)args,&target))
|
||||
@@ -2541,7 +2541,7 @@ bool ChatHandler::HandleLearnAllDefaultCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLearnCommand(const char* args)
|
||||
bool ChatHandler::HandleLearnCommand(const char *args)
|
||||
{
|
||||
Player* targetPlayer = getSelectedPlayer();
|
||||
|
||||
@@ -2590,7 +2590,7 @@ bool ChatHandler::HandleLearnCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleAddItemCommand(const char* args)
|
||||
bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -2696,7 +2696,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleAddItemSetCommand(const char* args)
|
||||
bool ChatHandler::HandleAddItemSetCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -2765,7 +2765,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleListItemCommand(const char* args)
|
||||
bool ChatHandler::HandleListItemCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -2989,7 +2989,7 @@ bool ChatHandler::HandleListItemCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleListObjectCommand(const char* args)
|
||||
bool ChatHandler::HandleListObjectCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3065,7 +3065,7 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGameObjectStateCommand(const char* args)
|
||||
bool ChatHandler::HandleGameObjectStateCommand(const char *args)
|
||||
{
|
||||
// number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r
|
||||
char* cId = extractKeyFromLink((char*)args, "Hgameobject");
|
||||
@@ -3126,7 +3126,7 @@ bool ChatHandler::HandleGameObjectStateCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||
bool ChatHandler::HandleListCreatureCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3202,7 +3202,7 @@ bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupItemCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupItemCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3273,7 +3273,7 @@ bool ChatHandler::HandleLookupItemCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupItemSetCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupItemSetCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3335,7 +3335,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupSkillCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupSkillCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3414,7 +3414,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupSpellCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupSpellCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3515,7 +3515,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupQuestCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupQuestCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3621,7 +3621,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupCreatureCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupCreatureCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -3691,7 +3691,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupObjectCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupObjectCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -3761,7 +3761,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupFactionCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupFactionCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -3919,7 +3919,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupMapCommand(const char* args)
|
||||
bool ChatHandler::HandleLookupMapCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -4032,7 +4032,7 @@ bool ChatHandler::HandleLookupMapCommand(const char* args)
|
||||
* and then the name of the guild.
|
||||
*
|
||||
*/
|
||||
bool ChatHandler::HandleGuildCreateCommand(const char* args)
|
||||
bool ChatHandler::HandleGuildCreateCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -4150,7 +4150,7 @@ bool ChatHandler::HandleGuildRankCommand(const char *args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGuildDeleteCommand(const char* args)
|
||||
bool ChatHandler::HandleGuildDeleteCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -4170,7 +4170,7 @@ bool ChatHandler::HandleGuildDeleteCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGetDistanceCommand(const char* args)
|
||||
bool ChatHandler::HandleGetDistanceCommand(const char *args)
|
||||
{
|
||||
WorldObject* obj = NULL;
|
||||
|
||||
@@ -4333,7 +4333,7 @@ bool ChatHandler::HandleModifyArenaCommand(const char * args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleReviveCommand(const char* args)
|
||||
bool ChatHandler::HandleReviveCommand(const char *args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
@@ -4353,7 +4353,7 @@ bool ChatHandler::HandleReviveCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleAuraCommand(const char* args)
|
||||
bool ChatHandler::HandleAuraCommand(const char *args)
|
||||
{
|
||||
Unit *target = getSelectedUnit();
|
||||
if(!target)
|
||||
@@ -4389,7 +4389,7 @@ bool ChatHandler::HandleAuraCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnAuraCommand(const char* args)
|
||||
bool ChatHandler::HandleUnAuraCommand(const char *args)
|
||||
{
|
||||
Unit *target = getSelectedUnit();
|
||||
if(!target)
|
||||
@@ -4416,7 +4416,7 @@ bool ChatHandler::HandleUnAuraCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLinkGraveCommand(const char* args)
|
||||
bool ChatHandler::HandleLinkGraveCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -4469,7 +4469,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleNearGraveCommand(const char* args)
|
||||
bool ChatHandler::HandleNearGraveCommand(const char *args)
|
||||
{
|
||||
uint32 g_team;
|
||||
|
||||
@@ -4624,7 +4624,7 @@ bool ChatHandler::HandleNpcInfoCommand(const char* /*args*/)
|
||||
}
|
||||
|
||||
//play npc emote
|
||||
bool ChatHandler::HandleNpcPlayEmoteCommand(const char* args)
|
||||
bool ChatHandler::HandleNpcPlayEmoteCommand(const char *args)
|
||||
{
|
||||
uint32 emote = atoi((char*)args);
|
||||
|
||||
@@ -4712,7 +4712,7 @@ bool ChatHandler::HandleNpcAddWeaponCommand(const char* /*args*/)
|
||||
}
|
||||
//----------------------------------------------------------
|
||||
|
||||
bool ChatHandler::HandleExploreCheatCommand(const char* args)
|
||||
bool ChatHandler::HandleExploreCheatCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -4755,7 +4755,7 @@ bool ChatHandler::HandleExploreCheatCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleHoverCommand(const char* args)
|
||||
bool ChatHandler::HandleHoverCommand(const char *args)
|
||||
{
|
||||
char* px = strtok((char*)args, " ");
|
||||
uint32 flag;
|
||||
@@ -4799,7 +4799,7 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 player_guid, uint3
|
||||
}
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCharacterLevelCommand(const char* args)
|
||||
bool ChatHandler::HandleCharacterLevelCommand(const char *args)
|
||||
{
|
||||
char* nameStr;
|
||||
char* levelStr;
|
||||
@@ -4840,7 +4840,7 @@ bool ChatHandler::HandleCharacterLevelCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLevelUpCommand(const char* args)
|
||||
bool ChatHandler::HandleLevelUpCommand(const char *args)
|
||||
{
|
||||
char* nameStr;
|
||||
char* levelStr;
|
||||
@@ -4880,7 +4880,7 @@ bool ChatHandler::HandleLevelUpCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleShowAreaCommand(const char* args)
|
||||
bool ChatHandler::HandleShowAreaCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -4911,7 +4911,7 @@ bool ChatHandler::HandleShowAreaCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleHideAreaCommand(const char* args)
|
||||
bool ChatHandler::HandleHideAreaCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -4949,7 +4949,7 @@ bool ChatHandler::HandleBankCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleChangeWeather(const char* args)
|
||||
bool ChatHandler::HandleChangeWeather(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -4991,7 +4991,7 @@ bool ChatHandler::HandleChangeWeather(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleDebugSet32Bit(const char* args)
|
||||
bool ChatHandler::HandleDebugSet32Bit(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -5393,7 +5393,7 @@ bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleServerShutDownCommand(const char* args)
|
||||
bool ChatHandler::HandleServerShutDownCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -5428,7 +5428,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleServerRestartCommand(const char* args)
|
||||
bool ChatHandler::HandleServerRestartCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -5463,7 +5463,7 @@ bool ChatHandler::HandleServerRestartCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleServerIdleRestartCommand(const char* args)
|
||||
bool ChatHandler::HandleServerIdleRestartCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -5498,7 +5498,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleServerIdleShutDownCommand(const char* args)
|
||||
bool ChatHandler::HandleServerIdleShutDownCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -5533,7 +5533,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleQuestAdd(const char* args)
|
||||
bool ChatHandler::HandleQuestAdd(const char *args)
|
||||
{
|
||||
Player* player = getSelectedPlayer();
|
||||
if(!player)
|
||||
@@ -5587,7 +5587,7 @@ bool ChatHandler::HandleQuestAdd(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleQuestRemove(const char* args)
|
||||
bool ChatHandler::HandleQuestRemove(const char *args)
|
||||
{
|
||||
Player* player = getSelectedPlayer();
|
||||
if(!player)
|
||||
@@ -5637,7 +5637,7 @@ bool ChatHandler::HandleQuestRemove(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleQuestComplete(const char* args)
|
||||
bool ChatHandler::HandleQuestComplete(const char *args)
|
||||
{
|
||||
Player* player = getSelectedPlayer();
|
||||
if(!player)
|
||||
@@ -5727,22 +5727,22 @@ bool ChatHandler::HandleQuestComplete(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanAccountCommand(const char* args)
|
||||
bool ChatHandler::HandleBanAccountCommand(const char *args)
|
||||
{
|
||||
return HandleBanHelper(BAN_ACCOUNT,args);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanCharacterCommand(const char* args)
|
||||
bool ChatHandler::HandleBanCharacterCommand(const char *args)
|
||||
{
|
||||
return HandleBanHelper(BAN_CHARACTER,args);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanIPCommand(const char* args)
|
||||
bool ChatHandler::HandleBanIPCommand(const char *args)
|
||||
{
|
||||
return HandleBanHelper(BAN_IP,args);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanHelper(BanMode mode, const char* args)
|
||||
bool ChatHandler::HandleBanHelper(BanMode mode, const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -5815,22 +5815,22 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnBanAccountCommand(const char* args)
|
||||
bool ChatHandler::HandleUnBanAccountCommand(const char *args)
|
||||
{
|
||||
return HandleUnBanHelper(BAN_ACCOUNT,args);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnBanCharacterCommand(const char* args)
|
||||
bool ChatHandler::HandleUnBanCharacterCommand(const char *args)
|
||||
{
|
||||
return HandleUnBanHelper(BAN_CHARACTER,args);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnBanIPCommand(const char* args)
|
||||
bool ChatHandler::HandleUnBanIPCommand(const char *args)
|
||||
{
|
||||
return HandleUnBanHelper(BAN_IP,args);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnBanHelper(BanMode mode, const char* args)
|
||||
bool ChatHandler::HandleUnBanHelper(BanMode mode, const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -5873,7 +5873,7 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
|
||||
bool ChatHandler::HandleBanInfoAccountCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -5900,7 +5900,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char* args)
|
||||
return HandleBanInfoHelper(accountid,account_name.c_str());
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanInfoCharacterCommand(const char* args)
|
||||
bool ChatHandler::HandleBanInfoCharacterCommand(const char *args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
@@ -5947,7 +5947,7 @@ bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanInfoIPCommand(const char* args)
|
||||
bool ChatHandler::HandleBanInfoIPCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -5978,7 +5978,7 @@ bool ChatHandler::HandleBanInfoIPCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanListCharacterCommand(const char* args)
|
||||
bool ChatHandler::HandleBanListCharacterCommand(const char *args)
|
||||
{
|
||||
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
|
||||
|
||||
@@ -5998,7 +5998,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char* args)
|
||||
return HandleBanListHelper(result);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanListAccountCommand(const char* args)
|
||||
bool ChatHandler::HandleBanListAccountCommand(const char *args)
|
||||
{
|
||||
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
|
||||
|
||||
@@ -6107,7 +6107,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult* result)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBanListIPCommand(const char* args)
|
||||
bool ChatHandler::HandleBanListIPCommand(const char *args)
|
||||
{
|
||||
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
|
||||
|
||||
@@ -6216,7 +6216,7 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGMFlyCommand(const char* args)
|
||||
bool ChatHandler::HandleGMFlyCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
@@ -6534,7 +6534,7 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCastCommand(const char* args)
|
||||
bool ChatHandler::HandleCastCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -6579,7 +6579,7 @@ bool ChatHandler::HandleCastCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCastBackCommand(const char* args)
|
||||
bool ChatHandler::HandleCastBackCommand(const char *args)
|
||||
{
|
||||
Creature* caster = getSelectedCreature();
|
||||
|
||||
@@ -6619,7 +6619,7 @@ bool ChatHandler::HandleCastBackCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCastDistCommand(const char* args)
|
||||
bool ChatHandler::HandleCastDistCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -6664,7 +6664,7 @@ bool ChatHandler::HandleCastDistCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCastTargetCommand(const char* args)
|
||||
bool ChatHandler::HandleCastTargetCommand(const char *args)
|
||||
{
|
||||
Creature* caster = getSelectedCreature();
|
||||
|
||||
@@ -6741,7 +6741,7 @@ bool ChatHandler::HandleComeToMeCommand(const char *args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCastSelfCommand(const char* args)
|
||||
bool ChatHandler::HandleCastSelfCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -6824,7 +6824,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
|
||||
bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -6918,7 +6918,7 @@ bool ChatHandler::HandleGMListFullCommand(const char* /*args*/)
|
||||
}
|
||||
|
||||
/// Define the 'Message of the day' for the realm
|
||||
bool ChatHandler::HandleServerSetMotdCommand(const char* args)
|
||||
bool ChatHandler::HandleServerSetMotdCommand(const char *args)
|
||||
{
|
||||
sWorld.SetMotd(args);
|
||||
PSendSysMessage(LANG_MOTD_NEW, args);
|
||||
@@ -6926,7 +6926,7 @@ bool ChatHandler::HandleServerSetMotdCommand(const char* args)
|
||||
}
|
||||
|
||||
/// Set whether we accept new clients
|
||||
bool ChatHandler::HandleServerSetClosedCommand(const char* args)
|
||||
bool ChatHandler::HandleServerSetClosedCommand(const char *args)
|
||||
{
|
||||
std::string arg = args;
|
||||
|
||||
@@ -6949,7 +6949,7 @@ bool ChatHandler::HandleServerSetClosedCommand(const char* args)
|
||||
}
|
||||
|
||||
/// Set/Unset the expansion level for an account
|
||||
bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
|
||||
bool ChatHandler::HandleAccountSetAddonCommand(const char *args)
|
||||
{
|
||||
///- Get the command line arguments
|
||||
char *szAcc = strtok((char*)args," ");
|
||||
@@ -7009,7 +7009,7 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
|
||||
}
|
||||
|
||||
//Send items by mail
|
||||
bool ChatHandler::HandleSendItemsCommand(const char* args)
|
||||
bool ChatHandler::HandleSendItemsCommand(const char *args)
|
||||
{
|
||||
// format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
|
||||
Player* receiver;
|
||||
@@ -7119,7 +7119,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
|
||||
}
|
||||
|
||||
///Send money by mail
|
||||
bool ChatHandler::HandleSendMoneyCommand(const char* args)
|
||||
bool ChatHandler::HandleSendMoneyCommand(const char *args)
|
||||
{
|
||||
/// format: name "subject text" "mail text" money
|
||||
|
||||
@@ -7169,19 +7169,19 @@ bool ChatHandler::HandleSendMoneyCommand(const char* args)
|
||||
}
|
||||
|
||||
/// Send a message to a player in game
|
||||
bool ChatHandler::HandleSendMessageCommand(const char* args)
|
||||
bool ChatHandler::HandleSendMessageCommand(const char *args)
|
||||
{
|
||||
///- Find the player
|
||||
Player *rPlayer;
|
||||
if(!extractPlayerTarget((char*)args,&rPlayer))
|
||||
if (!extractPlayerTarget((char*)args, &rPlayer))
|
||||
return false;
|
||||
|
||||
char* msg_str = strtok(NULL, "");
|
||||
if(!msg_str)
|
||||
if (!msg_str)
|
||||
return false;
|
||||
|
||||
///- Check that he is not logging out.
|
||||
if(rPlayer->GetSession()->isLogingOut())
|
||||
if (rPlayer->GetSession()->isLogingOut())
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -7207,12 +7207,12 @@ bool ChatHandler::HandleFlushArenaPointsCommand(const char * /*args*/)
|
||||
|
||||
bool ChatHandler::HandleModifyGenderCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player *player = getSelectedPlayer();
|
||||
|
||||
if(!player)
|
||||
if (!player)
|
||||
{
|
||||
PSendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -7230,14 +7230,14 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
|
||||
|
||||
if(!strncmp(gender_str, "male", gender_len)) // MALE
|
||||
{
|
||||
if(player->getGender() == GENDER_MALE)
|
||||
if (player->getGender() == GENDER_MALE)
|
||||
return true;
|
||||
|
||||
gender = GENDER_MALE;
|
||||
}
|
||||
else if (!strncmp(gender_str, "female", gender_len)) // FEMALE
|
||||
{
|
||||
if(player->getGender() == GENDER_FEMALE)
|
||||
if (player->getGender() == GENDER_FEMALE)
|
||||
return true;
|
||||
|
||||
gender = GENDER_FEMALE;
|
||||
@@ -7270,14 +7270,14 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args)
|
||||
*-------------TRINITY----------------------
|
||||
*-------------------------------------*/
|
||||
|
||||
bool ChatHandler::HandlePlayAllCommand(const char* args)
|
||||
bool ChatHandler::HandlePlayAllCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 soundId = atoi((char*)args);
|
||||
|
||||
if(!sSoundEntriesStore.LookupEntry(soundId))
|
||||
if (!sSoundEntriesStore.LookupEntry(soundId))
|
||||
{
|
||||
PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -7295,8 +7295,8 @@ bool ChatHandler::HandlePlayAllCommand(const char* args)
|
||||
bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
{
|
||||
std::string name;
|
||||
Player* player;
|
||||
char* TargetName = strtok((char*)args, " "); //get entered name
|
||||
Player *player;
|
||||
char *TargetName = strtok((char*)args, " "); //get entered name
|
||||
if (!TargetName) //if no name entered use target
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
@@ -7319,33 +7319,33 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player==m_session->GetPlayer())
|
||||
if (player == m_session->GetPlayer())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_FREEZE_ERROR);
|
||||
return true;
|
||||
}
|
||||
|
||||
//effect
|
||||
if ((player) && (!(player==m_session->GetPlayer())))
|
||||
if (player && player != m_session->GetPlayer())
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_FREEZE,name.c_str());
|
||||
|
||||
//stop combat + make player unattackable + duel stop + stop some spells
|
||||
player->setFaction(35);
|
||||
player->CombatStop();
|
||||
if(player->IsNonMeleeSpellCasted(true))
|
||||
if (player->IsNonMeleeSpellCasted(true))
|
||||
player->InterruptNonMeleeSpells(true);
|
||||
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
player->SetUInt32Value(PLAYER_DUEL_TEAM, 1);
|
||||
|
||||
//if player class = hunter || warlock remove pet if alive
|
||||
if((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
|
||||
if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
|
||||
{
|
||||
if(Pet* pet = player->GetPet())
|
||||
if (Pet *pet = player->GetPet())
|
||||
{
|
||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||
// not let dismiss dead pet
|
||||
if(pet && pet->isAlive())
|
||||
if (pet && pet->isAlive())
|
||||
player->RemovePet(pet,PET_SAVE_NOT_IN_SLOT);
|
||||
}
|
||||
}
|
||||
@@ -7364,15 +7364,13 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
std::string name;
|
||||
Player* player;
|
||||
char* TargetName = strtok((char*)args, " "); //get entered name
|
||||
Player *player;
|
||||
char *TargetName = strtok((char*)args, " "); //get entered name
|
||||
if (!TargetName) //if no name entered use target
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
{
|
||||
name = player->GetName();
|
||||
}
|
||||
}
|
||||
|
||||
else // if name entered
|
||||
@@ -7389,7 +7387,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
|
||||
//Reset player faction + allow combat + allow duels
|
||||
player->setFactionForRace(player->getRace());
|
||||
player->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
//allow movement and spells
|
||||
player->RemoveAurasDueToSpell(9454);
|
||||
@@ -7404,7 +7402,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
//check for offline players
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'",name.c_str());
|
||||
if(!result)
|
||||
if (!result)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
|
||||
return true;
|
||||
@@ -7427,11 +7425,11 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleListFreezeCommand(const char* args)
|
||||
bool ChatHandler::HandleListFreezeCommand(const char *args)
|
||||
{
|
||||
//Get names from DB
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454");
|
||||
if(!result)
|
||||
if (!result)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS);
|
||||
return true;
|
||||
@@ -7451,71 +7449,72 @@ bool ChatHandler::HandleListFreezeCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGroupLeaderCommand(const char* args)
|
||||
bool ChatHandler::HandleGroupLeaderCommand(const char *args)
|
||||
{
|
||||
Player* plr = NULL;
|
||||
Group* group = NULL;
|
||||
uint64 guid = 0;
|
||||
char* cname = strtok((char*)args, " ");
|
||||
|
||||
if(GetPlayerGroupAndGUIDByName(cname, plr, group, guid))
|
||||
if(group && group->GetLeaderGUID() != guid)
|
||||
if (GetPlayerGroupAndGUIDByName(cname, plr, group, guid))
|
||||
if (group && group->GetLeaderGUID() != guid)
|
||||
group->ChangeLeader(guid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGroupDisbandCommand(const char* args)
|
||||
bool ChatHandler::HandleGroupDisbandCommand(const char *args)
|
||||
{
|
||||
Player* plr = NULL;
|
||||
Group* group = NULL;
|
||||
uint64 guid = 0;
|
||||
char* cname = strtok((char*)args, " ");
|
||||
|
||||
if(GetPlayerGroupAndGUIDByName(cname, plr, group, guid))
|
||||
if(group)
|
||||
if (GetPlayerGroupAndGUIDByName(cname, plr, group, guid))
|
||||
if (group)
|
||||
group->Disband();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGroupRemoveCommand(const char* args)
|
||||
bool ChatHandler::HandleGroupRemoveCommand(const char *args)
|
||||
{
|
||||
Player* plr = NULL;
|
||||
Group* group = NULL;
|
||||
uint64 guid = 0;
|
||||
char* cname = strtok((char*)args, " ");
|
||||
|
||||
if(GetPlayerGroupAndGUIDByName(cname, plr, group, guid, true))
|
||||
if(group)
|
||||
if (GetPlayerGroupAndGUIDByName(cname, plr, group, guid, true))
|
||||
if (group)
|
||||
group->RemoveMember(guid, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandlePossessCommand(const char* args)
|
||||
bool ChatHandler::HandlePossessCommand(const char *args)
|
||||
{
|
||||
Unit* pUnit = getSelectedUnit();
|
||||
if(!pUnit)
|
||||
Unit *pUnit = getSelectedUnit();
|
||||
if (!pUnit)
|
||||
return false;
|
||||
|
||||
m_session->GetPlayer()->CastSpell(pUnit, 530, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnPossessCommand(const char* args)
|
||||
bool ChatHandler::HandleUnPossessCommand(const char *args)
|
||||
{
|
||||
Unit* pUnit = getSelectedUnit();
|
||||
if(!pUnit) pUnit = m_session->GetPlayer();
|
||||
Unit *pUnit = getSelectedUnit();
|
||||
if (!pUnit)
|
||||
pUnit = m_session->GetPlayer();
|
||||
|
||||
pUnit->RemoveCharmAuras();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleBindSightCommand(const char* args)
|
||||
bool ChatHandler::HandleBindSightCommand(const char *args)
|
||||
{
|
||||
Unit* pUnit = getSelectedUnit();
|
||||
Unit *pUnit = getSelectedUnit();
|
||||
if (!pUnit)
|
||||
return false;
|
||||
|
||||
@@ -7523,7 +7522,7 @@ bool ChatHandler::HandleBindSightCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleUnbindSightCommand(const char* args)
|
||||
bool ChatHandler::HandleUnbindSightCommand(const char *args)
|
||||
{
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
@@ -28,7 +28,7 @@ NullCreatureAI::NullCreatureAI(Creature *c) : CreatureAI(c) { me->SetReactState(
|
||||
|
||||
void PassiveAI::UpdateAI(const uint32)
|
||||
{
|
||||
if(me->isInCombat() && me->getAttackers().empty())
|
||||
if (me->isInCombat() && me->getAttackers().empty())
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -63,19 +63,19 @@ void PossessedAI::KilledUnit(Unit* victim)
|
||||
|
||||
void CritterAI::DamageTaken(Unit *done_by, uint32 &)
|
||||
{
|
||||
if(!me->hasUnitState(UNIT_STAT_FLEEING))
|
||||
if (!me->hasUnitState(UNIT_STAT_FLEEING))
|
||||
me->SetControlled(true, UNIT_STAT_FLEEING);
|
||||
}
|
||||
|
||||
void CritterAI::EnterEvadeMode()
|
||||
{
|
||||
if(me->hasUnitState(UNIT_STAT_FLEEING))
|
||||
if (me->hasUnitState(UNIT_STAT_FLEEING))
|
||||
me->SetControlled(false, UNIT_STAT_FLEEING);
|
||||
CreatureAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void TriggerAI::IsSummonedBy(Unit *summoner)
|
||||
{
|
||||
if(me->m_spells[0])
|
||||
if (me->m_spells[0])
|
||||
me->CastSpell(me, me->m_spells[0], false, 0, 0, summoner->GetGUID());
|
||||
}
|
||||
|
||||
+31
-32
@@ -3364,19 +3364,19 @@ void Player::learnSpell(uint32 spell_id, bool dependent)
|
||||
bool learning = addSpell(spell_id,active,true,dependent,false);
|
||||
|
||||
// learn all disabled higher ranks (recursive)
|
||||
if(disabled)
|
||||
if (disabled)
|
||||
{
|
||||
SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id);
|
||||
if(node)
|
||||
if (node)
|
||||
{
|
||||
PlayerSpellMap::iterator iter = m_spells.find(node->next);
|
||||
if (iter != m_spells.end() && iter->second->disabled )
|
||||
if (iter != m_spells.end() && iter->second->disabled)
|
||||
learnSpell(node->next,false);
|
||||
}
|
||||
}
|
||||
|
||||
// prevent duplicated entires in spell book, also not send if not in world (loading)
|
||||
if(!learning || !IsInWorld ())
|
||||
if (!learning || !IsInWorld())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_LEARNED_SPELL, 4);
|
||||
@@ -3394,16 +3394,15 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
return;
|
||||
|
||||
// unlearn non talent higher ranks (recursive)
|
||||
SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id);
|
||||
if (node)
|
||||
if (SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id))
|
||||
{
|
||||
if(HasSpell(node->next) && !GetTalentSpellPos(node->next))
|
||||
if (HasSpell(node->next) && !GetTalentSpellPos(node->next))
|
||||
removeSpell(node->next,disabled);
|
||||
}
|
||||
//unlearn spells dependent from recently removed spells
|
||||
SpellsRequiringSpellMap const& reqMap = spellmgr.GetSpellsRequiringSpell();
|
||||
SpellsRequiringSpellMap::const_iterator itr2 = reqMap.find(spell_id);
|
||||
for (uint32 i=reqMap.count(spell_id); i>0; i--,itr2++)
|
||||
for (uint32 i = reqMap.count(spell_id); i > 0; --i, ++itr2)
|
||||
removeSpell(itr2->second,disabled,false);
|
||||
|
||||
// re-search, it can be corrupted in prev loop
|
||||
@@ -3417,12 +3416,12 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
if (disabled)
|
||||
{
|
||||
itr->second->disabled = disabled;
|
||||
if(itr->second->state != PLAYERSPELL_NEW)
|
||||
if (itr->second->state != PLAYERSPELL_NEW)
|
||||
itr->second->state = PLAYERSPELL_CHANGED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(itr->second->state == PLAYERSPELL_NEW)
|
||||
if (itr->second->state == PLAYERSPELL_NEW)
|
||||
{
|
||||
delete itr->second;
|
||||
m_spells.erase(itr);
|
||||
@@ -3434,40 +3433,40 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
RemoveAurasDueToSpell(spell_id);
|
||||
|
||||
// remove pet auras
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if(PetAura const* petSpell = spellmgr.GetPetAura(spell_id, i))
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (PetAura const* petSpell = spellmgr.GetPetAura(spell_id, i))
|
||||
RemovePetAura(petSpell);
|
||||
|
||||
// free talent points
|
||||
uint32 talentCosts = GetTalentSpellCost(spell_id);
|
||||
if(talentCosts > 0)
|
||||
{
|
||||
if(talentCosts < m_usedTalentCount)
|
||||
if (talentCosts < m_usedTalentCount)
|
||||
m_usedTalentCount -= talentCosts;
|
||||
else
|
||||
m_usedTalentCount = 0;
|
||||
}
|
||||
|
||||
// update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning)
|
||||
if(spellmgr.IsPrimaryProfessionFirstRankSpell(spell_id))
|
||||
if (spellmgr.IsPrimaryProfessionFirstRankSpell(spell_id))
|
||||
{
|
||||
uint32 freeProfs = GetFreePrimaryProfessionPoints()+1;
|
||||
if(freeProfs <= sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
||||
if (freeProfs <= sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
||||
SetFreePrimaryProfessions(freeProfs);
|
||||
}
|
||||
|
||||
// remove dependent skill
|
||||
SpellLearnSkillNode const* spellLearnSkill = spellmgr.GetSpellLearnSkill(spell_id);
|
||||
if(spellLearnSkill)
|
||||
if (spellLearnSkill)
|
||||
{
|
||||
uint32 prev_spell = spellmgr.GetPrevSpellInChain(spell_id);
|
||||
if(!prev_spell) // first rank, remove skill
|
||||
if (!prev_spell) // first rank, remove skill
|
||||
SetSkill(spellLearnSkill->skill,0,0);
|
||||
else
|
||||
{
|
||||
// search prev. skill setting by spell ranks chain
|
||||
SpellLearnSkillNode const* prevSkill = spellmgr.GetSpellLearnSkill(prev_spell);
|
||||
while(!prevSkill && prev_spell)
|
||||
while (!prevSkill && prev_spell)
|
||||
{
|
||||
prev_spell = spellmgr.GetPrevSpellInChain(prev_spell);
|
||||
prevSkill = spellmgr.GetSpellLearnSkill(spellmgr.GetFirstSpellInChain(prev_spell));
|
||||
@@ -3507,14 +3506,14 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL &&
|
||||
pSkill->categoryId != SKILL_CATEGORY_CLASS ||// not unlearn class skills (spellbook/talent pages)
|
||||
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
|
||||
((pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0))
|
||||
((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0))
|
||||
{
|
||||
// not reset skills for professions and racial abilities
|
||||
if ((pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
|
||||
(IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask!=0))
|
||||
continue;
|
||||
|
||||
SetSkill(pSkill->id, 0, 0 );
|
||||
SetSkill(pSkill->id, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3536,8 +3535,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
if (talentCosts)
|
||||
{
|
||||
// I cannot see why mangos has these lines.
|
||||
//if(learn_low_rank)
|
||||
// learnSpell (prev_id,false);
|
||||
//if (learn_low_rank)
|
||||
// learnSpell(prev_id,false);
|
||||
}
|
||||
// if ranked non-stackable spell: need activate lesser rank and update dendence state
|
||||
else if (cur_active && !SpellMgr::canStackSpellRanks(spellInfo) && spellmgr.GetSpellRank(spellInfo->Id) != 0)
|
||||
@@ -3562,7 +3561,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4);
|
||||
data << uint32(spell_id);
|
||||
data << uint32(prev_id);
|
||||
GetSession()->SendPacket( &data );
|
||||
GetSession()->SendPacket(&data);
|
||||
prev_activate = true;
|
||||
}
|
||||
}
|
||||
@@ -3570,14 +3569,14 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
}
|
||||
}
|
||||
|
||||
if(spell_id == 46917 && m_canTitanGrip)
|
||||
if (spell_id == 46917 && m_canTitanGrip)
|
||||
SetCanTitanGrip(false);
|
||||
|
||||
if(sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
||||
if (sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
||||
AutoUnequipOffhandIfNeed();
|
||||
|
||||
// remove from spell book if not replaced by lesser rank
|
||||
if(!prev_activate)
|
||||
if (!prev_activate)
|
||||
{
|
||||
WorldPacket data(SMSG_REMOVED_SPELL, 4);
|
||||
data << uint32(spell_id);
|
||||
@@ -3585,19 +3584,19 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ )
|
||||
void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */)
|
||||
{
|
||||
m_spellCooldowns.erase(spell_id);
|
||||
|
||||
if(update)
|
||||
if (update)
|
||||
SendClearCooldown(spell_id, this);
|
||||
}
|
||||
|
||||
// I am not sure which one is more efficient
|
||||
void Player::RemoveCategoryCooldown( uint32 cat )
|
||||
void Player::RemoveCategoryCooldown(uint32 cat)
|
||||
{
|
||||
SpellCategoryStore::const_iterator i_scstore = sSpellCategoryStore.find(cat);
|
||||
if(i_scstore != sSpellCategoryStore.end())
|
||||
if (i_scstore != sSpellCategoryStore.end())
|
||||
for (SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset)
|
||||
RemoveSpellCooldown(*i_scset, true);
|
||||
}
|
||||
@@ -3641,7 +3640,7 @@ void Player::RemoveArenaSpellCooldowns()
|
||||
|
||||
void Player::RemoveAllSpellCooldown()
|
||||
{
|
||||
if(!m_spellCooldowns.empty())
|
||||
if (!m_spellCooldowns.empty())
|
||||
{
|
||||
for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr)
|
||||
SendClearCooldown(itr->first, this);
|
||||
@@ -3656,7 +3655,7 @@ void Player::_LoadSpellCooldowns(QueryResult *result)
|
||||
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow());
|
||||
|
||||
if(result)
|
||||
if (result)
|
||||
{
|
||||
time_t curTime = time(NULL);
|
||||
|
||||
|
||||
+120
-123
@@ -1915,7 +1915,7 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
|
||||
QueryResult *result = WorldDatabase.Query("SELECT entry,type,targetEntry FROM spell_script_target");
|
||||
|
||||
if(!result)
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
|
||||
@@ -1939,14 +1939,14 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
|
||||
SpellEntry const* spellProto = sSpellStore.LookupEntry(spellId);
|
||||
|
||||
if(!spellProto)
|
||||
if (!spellProto)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: spellId %u listed for TargetEntry %u does not exist.",spellId,targetEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*bool targetfound = false;
|
||||
for (int i = 0; i <3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if( spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
@@ -1957,13 +1957,13 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!targetfound)
|
||||
if (!targetfound)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: spellId %u listed for TargetEntry %u does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46).",spellId,targetEntry);
|
||||
continue;
|
||||
}*/
|
||||
|
||||
if( type >= MAX_SPELL_TARGET_TYPE )
|
||||
if (type >= MAX_SPELL_TARGET_TYPE)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: target type %u for TargetEntry %u is incorrect.",type,targetEntry);
|
||||
continue;
|
||||
@@ -1973,35 +1973,35 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
{
|
||||
case SPELL_TARGET_TYPE_GAMEOBJECT:
|
||||
{
|
||||
if( targetEntry==0 )
|
||||
if (targetEntry == 0)
|
||||
break;
|
||||
|
||||
if(!sGOStorage.LookupEntry<GameObjectInfo>(targetEntry))
|
||||
if (!sGOStorage.LookupEntry<GameObjectInfo>(targetEntry))
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: gameobject template entry %u does not exist.",targetEntry);
|
||||
sLog.outErrorDb("Table `spell_script_target`: gameobject template entry %u does not exist.", targetEntry);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELL_TARGET_TYPE_CONTROLLED:
|
||||
if( targetEntry==0 )
|
||||
sLog.outErrorDb("Table `spell_script_target`: creature template entry %u does not exist.",targetEntry);
|
||||
if (targetEntry == 0)
|
||||
sLog.outErrorDb("Table `spell_script_target`: creature template entry %u does not exist.", targetEntry);
|
||||
default:
|
||||
{
|
||||
//players
|
||||
/*if( targetEntry==0 )
|
||||
/*if(targetEntry == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: target entry == 0 for not GO target type (%u).",type);
|
||||
continue;
|
||||
}*/
|
||||
if(targetEntry && !sCreatureStorage.LookupEntry<CreatureInfo>(targetEntry))
|
||||
if (targetEntry && !sCreatureStorage.LookupEntry<CreatureInfo>(targetEntry))
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target`: creature template entry %u does not exist.",targetEntry);
|
||||
sLog.outErrorDb("Table `spell_script_target`: creature template entry %u does not exist.", targetEntry);
|
||||
continue;
|
||||
}
|
||||
const CreatureInfo* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(targetEntry);
|
||||
|
||||
if(spellId == 30427 && !cInfo->SkinLootId)
|
||||
if (spellId == 30427 && !cInfo->SkinLootId)
|
||||
{
|
||||
sLog.outErrorDb("Table `spell_script_target` has creature %u as a target of spellid 30427, but this creature has no skinlootid. Gas extraction will not work!", cInfo->Entry);
|
||||
continue;
|
||||
@@ -2010,7 +2010,7 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
}
|
||||
}
|
||||
|
||||
mSpellScriptTarget.insert(SpellScriptTarget::value_type(spellId,SpellTargetEntry(SpellScriptTargetType(type),targetEntry)));
|
||||
mSpellScriptTarget.insert(SpellScriptTarget::value_type(spellId, SpellTargetEntry(SpellScriptTargetType(type), targetEntry)));
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -2021,13 +2021,13 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const * spellInfo = sSpellStore.LookupEntry(i);
|
||||
if(!spellInfo)
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
bool found = false;
|
||||
for (int j = 0; j < 3; ++j)
|
||||
for (uint8 j = 0; j < 3; ++j)
|
||||
{
|
||||
switch(spellInfo->EffectImplicitTargetA[j])
|
||||
switch (spellInfo->EffectImplicitTargetA[j])
|
||||
{
|
||||
case TARGET_UNIT_AREA_ENTRY_SRC:
|
||||
case TARGET_UNIT_AREA_ENTRY_DST:
|
||||
@@ -2037,9 +2037,9 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if(found)
|
||||
if (found)
|
||||
break;
|
||||
switch(spellInfo->EffectImplicitTargetB[j])
|
||||
switch (spellInfo->EffectImplicitTargetB[j])
|
||||
{
|
||||
case TARGET_UNIT_AREA_ENTRY_SRC:
|
||||
case TARGET_UNIT_AREA_ENTRY_DST:
|
||||
@@ -2049,13 +2049,13 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if(found)
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
if(found)
|
||||
if (found)
|
||||
{
|
||||
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(i);
|
||||
if(bounds.first==bounds.second)
|
||||
if (bounds.first == bounds.second)
|
||||
sLog.outDebug("Spell (ID: %u) does not have record in `spell_script_target`", i);
|
||||
}
|
||||
}
|
||||
@@ -2072,19 +2072,19 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult *result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
|
||||
if( !result )
|
||||
if (!result)
|
||||
{
|
||||
|
||||
barGoLink bar( 1 );
|
||||
barGoLink bar(1);
|
||||
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %u spell pet auras", count );
|
||||
sLog.outString( ">> Loaded %u spell pet auras", count);
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( result->GetRowCount() );
|
||||
barGoLink bar(result->GetRowCount());
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2098,10 +2098,8 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
uint32 aura = fields[3].GetUInt32();
|
||||
|
||||
SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find((spell<<8) + eff);
|
||||
if(itr != mSpellPetAuraMap.end())
|
||||
{
|
||||
if (itr != mSpellPetAuraMap.end())
|
||||
itr->second.AddAura(pet, aura);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
|
||||
@@ -2130,7 +2128,7 @@ void SpellMgr::LoadSpellPetAuras()
|
||||
}
|
||||
|
||||
++count;
|
||||
} while( result->NextRow() );
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
||||
@@ -2159,7 +2157,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
|
||||
for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k)
|
||||
{
|
||||
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(k);
|
||||
if( !skillLine )
|
||||
if (!skillLine)
|
||||
continue;
|
||||
|
||||
//if (skillLine->skillId!=creatureFamily->skillLine[0] &&
|
||||
@@ -2169,22 +2167,22 @@ void SpellMgr::LoadPetLevelupSpellMap()
|
||||
if (skillLine->skillId!=creatureFamily->skillLine[j])
|
||||
continue;
|
||||
|
||||
if(skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL)
|
||||
if (skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL)
|
||||
continue;
|
||||
|
||||
SpellEntry const *spell = sSpellStore.LookupEntry(skillLine->spellId);
|
||||
if(!spell) // not exist or triggered or talent
|
||||
if (!spell) // not exist or triggered or talent
|
||||
continue;
|
||||
|
||||
if(!spell->spellLevel)
|
||||
if (!spell->spellLevel)
|
||||
continue;
|
||||
|
||||
PetLevelupSpellSet& spellSet = mPetLevelupSpellMap[creatureFamily->ID];
|
||||
if(spellSet.empty())
|
||||
++family_count;
|
||||
PetLevelupSpellSet& spellSet = mPetLevelupSpellMap[creatureFamily->ID];
|
||||
if (spellSet.empty())
|
||||
++family_count;
|
||||
|
||||
spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel,spell->Id));
|
||||
count++;
|
||||
spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel,spell->Id));
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2197,21 +2195,21 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
{
|
||||
// skip empty list;
|
||||
bool have_spell = false;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
if(petDefSpells.spellid[j])
|
||||
if (petDefSpells.spellid[j])
|
||||
{
|
||||
have_spell = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!have_spell)
|
||||
if (!have_spell)
|
||||
return false;
|
||||
|
||||
// remove duplicates with levelupSpells if any
|
||||
if(PetLevelupSpellSet const *levelupSpells = cInfo->family ? spellmgr.GetPetLevelupSpellList(cInfo->family) : NULL)
|
||||
{
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
if(!petDefSpells.spellid[j])
|
||||
continue;
|
||||
@@ -2229,9 +2227,9 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
|
||||
// skip empty list;
|
||||
have_spell = false;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
if(petDefSpells.spellid[j])
|
||||
if (petDefSpells.spellid[j])
|
||||
{
|
||||
have_spell = true;
|
||||
break;
|
||||
@@ -2248,23 +2246,23 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
uint32 countCreature = 0;
|
||||
uint32 countData = 0;
|
||||
|
||||
for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
|
||||
{
|
||||
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i);
|
||||
if(!cInfo)
|
||||
if (!cInfo)
|
||||
continue;
|
||||
|
||||
if(!cInfo->PetSpellDataId)
|
||||
if (!cInfo->PetSpellDataId)
|
||||
continue;
|
||||
|
||||
// for creature with PetSpellDataId get default pet spells from dbc
|
||||
CreatureSpellDataEntry const* spellDataEntry = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId);
|
||||
if(!spellDataEntry)
|
||||
if (!spellDataEntry)
|
||||
continue;
|
||||
|
||||
int32 petSpellsId = -(int32)cInfo->PetSpellDataId;
|
||||
int32 petSpellsId = -int32(cInfo->PetSpellDataId);
|
||||
PetDefaultSpellsEntry petDefSpells;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
petDefSpells.spellid[j] = spellDataEntry->spellId[j];
|
||||
|
||||
if(LoadPetDefaultSpells_helper(cInfo, petDefSpells))
|
||||
@@ -2275,35 +2273,35 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
}
|
||||
|
||||
// different summon spells
|
||||
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i )
|
||||
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(i);
|
||||
if(!spellEntry)
|
||||
if (!spellEntry)
|
||||
continue;
|
||||
|
||||
for (int k = 0; k < 3; ++k)
|
||||
for (uint8 k = 0; k < 3; ++k)
|
||||
{
|
||||
if(spellEntry->Effect[k]==SPELL_EFFECT_SUMMON || spellEntry->Effect[k]==SPELL_EFFECT_SUMMON_PET)
|
||||
if (spellEntry->Effect[k] == SPELL_EFFECT_SUMMON || spellEntry->Effect[k] == SPELL_EFFECT_SUMMON_PET)
|
||||
{
|
||||
uint32 creature_id = spellEntry->EffectMiscValue[k];
|
||||
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(creature_id);
|
||||
if(!cInfo)
|
||||
CreatureInfo const *cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(creature_id);
|
||||
if (!cInfo)
|
||||
continue;
|
||||
|
||||
// already loaded
|
||||
if(cInfo->PetSpellDataId)
|
||||
if (cInfo->PetSpellDataId)
|
||||
continue;
|
||||
|
||||
// for creature without PetSpellDataId get default pet spells from creature_template
|
||||
int32 petSpellsId = cInfo->Entry;
|
||||
if(mPetDefaultSpellsMap.find(cInfo->Entry) != mPetDefaultSpellsMap.end())
|
||||
if (mPetDefaultSpellsMap.find(cInfo->Entry) != mPetDefaultSpellsMap.end())
|
||||
continue;
|
||||
|
||||
PetDefaultSpellsEntry petDefSpells;
|
||||
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
petDefSpells.spellid[j] = cInfo->spells[j];
|
||||
|
||||
if(LoadPetDefaultSpells_helper(cInfo, petDefSpells))
|
||||
if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
|
||||
{
|
||||
mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
|
||||
++countCreature;
|
||||
@@ -2317,18 +2315,18 @@ void SpellMgr::LoadPetDefaultSpells()
|
||||
}
|
||||
|
||||
/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc
|
||||
bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
|
||||
bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg)
|
||||
{
|
||||
// not exist
|
||||
if(!spellInfo)
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
bool need_check_reagents = false;
|
||||
|
||||
// check effects
|
||||
for (int i=0; i<3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
switch(spellInfo->Effect[i])
|
||||
switch (spellInfo->Effect[i])
|
||||
{
|
||||
case 0:
|
||||
continue;
|
||||
@@ -2337,11 +2335,11 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
|
||||
case SPELL_EFFECT_CREATE_ITEM:
|
||||
case SPELL_EFFECT_CREATE_ITEM_2:
|
||||
{
|
||||
if(!ObjectMgr::GetItemPrototype( spellInfo->EffectItemType[i] ))
|
||||
if(!ObjectMgr::GetItemPrototype(spellInfo->EffectItemType[i]))
|
||||
{
|
||||
if(msg)
|
||||
if (msg)
|
||||
{
|
||||
if(pl)
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]);
|
||||
else
|
||||
sLog.outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]);
|
||||
@@ -2354,12 +2352,12 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
|
||||
}
|
||||
case SPELL_EFFECT_LEARN_SPELL:
|
||||
{
|
||||
SpellEntry const* spellInfo2 = sSpellStore.LookupEntry(spellInfo->EffectTriggerSpell[i]);
|
||||
if( !IsSpellValid(spellInfo2,pl,msg) )
|
||||
SpellEntry const *spellInfo2 = sSpellStore.LookupEntry(spellInfo->EffectTriggerSpell[i]);
|
||||
if (!IsSpellValid(spellInfo2,pl,msg))
|
||||
{
|
||||
if(msg)
|
||||
if (msg)
|
||||
{
|
||||
if(pl)
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("Spell %u learn to broken spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]);
|
||||
else
|
||||
sLog.outErrorDb("Spell %u learn to invalid spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]);
|
||||
@@ -2373,13 +2371,13 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
|
||||
|
||||
if(need_check_reagents)
|
||||
{
|
||||
for (int j = 0; j < 8; ++j)
|
||||
for (uint8 j = 0; j < 8; ++j)
|
||||
{
|
||||
if(spellInfo->Reagent[j] > 0 && !ObjectMgr::GetItemPrototype( spellInfo->Reagent[j] ))
|
||||
if (spellInfo->Reagent[j] > 0 && !ObjectMgr::GetItemPrototype(spellInfo->Reagent[j]))
|
||||
{
|
||||
if(msg)
|
||||
if (msg)
|
||||
{
|
||||
if(pl)
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->Reagent[j]);
|
||||
else
|
||||
sLog.outErrorDb("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->Reagent[j]);
|
||||
@@ -2405,18 +2403,18 @@ void SpellMgr::LoadSpellAreas()
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult *result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
|
||||
|
||||
if( !result )
|
||||
if (!result)
|
||||
{
|
||||
barGoLink bar( 1 );
|
||||
barGoLink bar(1);
|
||||
|
||||
bar.step();
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %u spell area requirements", count );
|
||||
sLog.outString(">> Loaded %u spell area requirements", count);
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( result->GetRowCount() );
|
||||
barGoLink bar(result->GetRowCount());
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2475,46 +2473,45 @@ void SpellMgr::LoadSpellAreas()
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
|
||||
if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell,spellArea.areaId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(spellArea.questStart && !objmgr.GetQuestTemplate(spellArea.questStart))
|
||||
if (spellArea.questStart && !objmgr.GetQuestTemplate(spellArea.questStart))
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(spellArea.questEnd)
|
||||
if (spellArea.questEnd)
|
||||
{
|
||||
if(!objmgr.GetQuestTemplate(spellArea.questEnd))
|
||||
if (!objmgr.GetQuestTemplate(spellArea.questEnd))
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive)
|
||||
if (spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(spellArea.auraSpell)
|
||||
if (spellArea.auraSpell)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell));
|
||||
if(!spellInfo)
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell));
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(spellInfo->EffectApplyAuraName[0])
|
||||
switch (spellInfo->EffectApplyAuraName[0])
|
||||
{
|
||||
case SPELL_AURA_DUMMY:
|
||||
case SPELL_AURA_PHASE:
|
||||
@@ -2525,27 +2522,27 @@ void SpellMgr::LoadSpellAreas()
|
||||
continue;
|
||||
}
|
||||
|
||||
if(abs(spellArea.auraSpell)==spellArea.spellId)
|
||||
if (abs(spellArea.auraSpell) == spellArea.spellId)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell,abs(spellArea.auraSpell));
|
||||
continue;
|
||||
}
|
||||
|
||||
// not allow autocast chains by auraSpell field (but allow use as alternative if not present)
|
||||
if(spellArea.autocast && spellArea.auraSpell > 0)
|
||||
if (spellArea.autocast && spellArea.auraSpell > 0)
|
||||
{
|
||||
bool chain = false;
|
||||
SpellAreaForAuraMapBounds saBound = GetSpellAreaForAuraMapBounds(spellArea.spellId);
|
||||
for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
|
||||
{
|
||||
if(itr->second->autocast && itr->second->auraSpell > 0)
|
||||
if (itr->second->autocast && itr->second->auraSpell > 0)
|
||||
{
|
||||
chain = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(chain)
|
||||
if (chain)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell);
|
||||
continue;
|
||||
@@ -2554,14 +2551,14 @@ void SpellMgr::LoadSpellAreas()
|
||||
SpellAreaMapBounds saBound2 = GetSpellAreaMapBounds(spellArea.auraSpell);
|
||||
for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
|
||||
{
|
||||
if(itr2->second.autocast && itr2->second.auraSpell > 0)
|
||||
if (itr2->second.autocast && itr2->second.auraSpell > 0)
|
||||
{
|
||||
chain = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(chain)
|
||||
if (chain)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell);
|
||||
continue;
|
||||
@@ -2569,43 +2566,43 @@ void SpellMgr::LoadSpellAreas()
|
||||
}
|
||||
}
|
||||
|
||||
if(spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0)
|
||||
if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(spellArea.gender!=GENDER_NONE && spellArea.gender!=GENDER_FEMALE && spellArea.gender!=GENDER_MALE)
|
||||
if (spellArea.gender != GENDER_NONE && spellArea.gender != GENDER_FEMALE && spellArea.gender != GENDER_MALE)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell,spellArea.gender);
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender);
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell,spellArea))->second;
|
||||
|
||||
// for search by current zone/subzone at zone/subzone change
|
||||
if(spellArea.areaId)
|
||||
if (spellArea.areaId)
|
||||
mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId,sa));
|
||||
|
||||
// for search at quest start/reward
|
||||
if(spellArea.questStart)
|
||||
if (spellArea.questStart)
|
||||
{
|
||||
if(spellArea.questStartCanActive)
|
||||
if (spellArea.questStartCanActive)
|
||||
mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa));
|
||||
else
|
||||
mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa));
|
||||
}
|
||||
|
||||
// for search at quest start/reward
|
||||
if(spellArea.questEnd)
|
||||
if (spellArea.questEnd)
|
||||
mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd,sa));
|
||||
|
||||
// for search at aura apply
|
||||
if(spellArea.auraSpell)
|
||||
if (spellArea.auraSpell)
|
||||
mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell),sa));
|
||||
|
||||
++count;
|
||||
} while( result->NextRow() );
|
||||
} while(result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
||||
@@ -2622,7 +2619,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(spellInfo->AreaGroupId);
|
||||
while (groupEntry)
|
||||
{
|
||||
for (uint32 i=0; i<6; ++i)
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id)
|
||||
found = true;
|
||||
if (found || !groupEntry->nextGroup)
|
||||
@@ -2639,7 +2636,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND)
|
||||
{
|
||||
uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
|
||||
MapEntry const *mapEntry = sMapStore.LookupEntry(v_map);
|
||||
if (!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent())
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
}
|
||||
@@ -2647,7 +2644,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
// raid instance limitation
|
||||
if (spellInfo->AttributesEx6 & SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE)
|
||||
{
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
|
||||
MapEntry const *mapEntry = sMapStore.LookupEntry(map_id);
|
||||
if (!mapEntry || mapEntry->IsRaid())
|
||||
return SPELL_FAILED_NOT_IN_RAID_INSTANCE;
|
||||
}
|
||||
@@ -2684,14 +2681,14 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
return zone_id == 4197 || mapEntry->IsBattleGround() && player && player->InBattleGround() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return zone_id == 4197 || (mapEntry->IsBattleGround() && player && player->InBattleGround()) ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
case 44521: // Preparation
|
||||
{
|
||||
if (!player)
|
||||
return SPELL_FAILED_REQUIRES_AREA;
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
|
||||
MapEntry const *mapEntry = sMapStore.LookupEntry(map_id);
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
@@ -2699,14 +2696,14 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
return SPELL_FAILED_REQUIRES_AREA;
|
||||
|
||||
BattleGround* bg = player->GetBattleGround();
|
||||
return bg && bg->GetStatus()==STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
return bg && bg->GetStatus() == STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
case 32724: // Gold Team (Alliance)
|
||||
case 32725: // Green Team (Alliance)
|
||||
case 35774: // Gold Team (Horde)
|
||||
case 35775: // Green Team (Horde)
|
||||
{
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
|
||||
MapEntry const *mapEntry = sMapStore.LookupEntry(map_id);
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
@@ -2717,22 +2714,22 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
if (!player)
|
||||
return SPELL_FAILED_REQUIRES_AREA;
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
|
||||
if(!mapEntry)
|
||||
MapEntry const *mapEntry = sMapStore.LookupEntry(map_id);
|
||||
if (!mapEntry)
|
||||
return SPELL_FAILED_INCORRECT_AREA;
|
||||
|
||||
if(!mapEntry->IsBattleArena())
|
||||
if (!mapEntry->IsBattleArena())
|
||||
return SPELL_FAILED_REQUIRES_AREA;
|
||||
|
||||
BattleGround* bg = player->GetBattleGround();
|
||||
return bg && bg->GetStatus()==STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
BattleGround *bg = player->GetBattleGround();
|
||||
return bg && bg->GetStatus() == STATUS_WAIT_JOIN ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
|
||||
}
|
||||
}
|
||||
|
||||
// aura limitations
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
switch(spellInfo->EffectApplyAuraName[i])
|
||||
switch (spellInfo->EffectApplyAuraName[i])
|
||||
{
|
||||
case SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED:
|
||||
case SPELL_AURA_FLY:
|
||||
@@ -2750,14 +2747,14 @@ void SpellMgr::LoadSkillLineAbilityMap()
|
||||
{
|
||||
mSkillLineAbilityMap.clear();
|
||||
|
||||
barGoLink bar( sSkillLineAbilityStore.GetNumRows() );
|
||||
barGoLink bar(sSkillLineAbilityStore.GetNumRows());
|
||||
uint32 count = 0;
|
||||
|
||||
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
|
||||
{
|
||||
bar.step();
|
||||
SkillLineAbilityEntry const *SkillInfo = sSkillLineAbilityStore.LookupEntry(i);
|
||||
if(!SkillInfo)
|
||||
if (!SkillInfo)
|
||||
continue;
|
||||
|
||||
mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId,SkillInfo));
|
||||
@@ -2771,7 +2768,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
|
||||
DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto, bool triggered)
|
||||
{
|
||||
// Explicit Diminishing Groups
|
||||
switch(spellproto->SpellFamilyName)
|
||||
switch (spellproto->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
// some generic arena related spells have by some strange reason MECHANIC_TURN
|
||||
@@ -2892,7 +2889,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
|
||||
if (mechanic & (1<<MECHANIC_HORROR)) return DIMINISHING_DEATHCOIL;
|
||||
|
||||
// Get by effect
|
||||
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellproto->EffectApplyAuraName[i] == SPELL_AURA_MOD_TAUNT)
|
||||
return DIMINISHING_TAUNT;
|
||||
|
||||
@@ -54,7 +54,7 @@ void WaypointMovementGenerator<Creature>::MovementInform(Creature &unit)
|
||||
template<>
|
||||
bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
|
||||
{
|
||||
if(i_destinationHolder.HasArrived())
|
||||
if (i_destinationHolder.HasArrived())
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
@@ -97,11 +97,11 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
|
||||
//i_currentNode = -1; // uint32, become 0 in the first update
|
||||
//i_nextMoveTime.Reset(0);
|
||||
StopedByPlayer = false;
|
||||
if(!path_id)
|
||||
if (!path_id)
|
||||
path_id = u.GetWaypointPath();
|
||||
waypoints = WaypointMgr.GetPath(path_id);
|
||||
i_currentNode = 0;
|
||||
if(waypoints && waypoints->size())
|
||||
if (waypoints && waypoints->size())
|
||||
{
|
||||
node = waypoints->front();
|
||||
Traveller<Creature> traveller(u);
|
||||
@@ -110,7 +110,7 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
|
||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||
|
||||
//Call for creature group update
|
||||
if(u.GetFormation() && u.GetFormation()->getLeader() == &u)
|
||||
if (u.GetFormation() && u.GetFormation()->getLeader() == &u)
|
||||
u.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
|
||||
}
|
||||
else
|
||||
@@ -131,19 +131,19 @@ template<>
|
||||
bool
|
||||
WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
{
|
||||
if(!&unit)
|
||||
if (!&unit)
|
||||
return true;
|
||||
|
||||
if(!path_id)
|
||||
if (!path_id)
|
||||
return false;
|
||||
|
||||
// Waypoint movement can be switched on/off
|
||||
// This is quite handy for escort quests and other stuff
|
||||
if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
if (unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
return true;
|
||||
|
||||
// Clear the generator if the path doesn't exist
|
||||
if(!waypoints || !waypoints->size())
|
||||
if (!waypoints || !waypoints->size())
|
||||
return false;
|
||||
|
||||
Traveller<Creature> traveller(unit);
|
||||
@@ -151,11 +151,11 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
i_nextMoveTime.Update(diff);
|
||||
i_destinationHolder.UpdateTraveller(traveller, diff, true);
|
||||
|
||||
if(i_nextMoveTime.Passed())
|
||||
if (i_nextMoveTime.Passed())
|
||||
{
|
||||
if(unit.IsStopped())
|
||||
if (unit.IsStopped())
|
||||
{
|
||||
if(StopedByPlayer)
|
||||
if (StopedByPlayer)
|
||||
{
|
||||
assert(node);
|
||||
InitTraveller(unit, *node);
|
||||
@@ -165,15 +165,15 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint
|
||||
if (i_currentNode == waypoints->size() - 1) // If that's our last waypoint
|
||||
{
|
||||
if(repeating) //If the movement is repeating
|
||||
i_currentNode = 0; //Start moving all over again
|
||||
if (repeating) // If the movement is repeating
|
||||
i_currentNode = 0; // Start moving all over again
|
||||
else
|
||||
{
|
||||
unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation());
|
||||
unit.GetMotionMaster()->Initialize();
|
||||
return false; //Clear the waypoint movement
|
||||
return false; // Clear the waypoint movement
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -185,17 +185,17 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||
|
||||
//Call for creature group update
|
||||
if(unit.GetFormation() && unit.GetFormation()->getLeader() == &unit)
|
||||
if (unit.GetFormation() && unit.GetFormation()->getLeader() == &unit)
|
||||
unit.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Determine waittime
|
||||
if(node->delay)
|
||||
if (node->delay)
|
||||
i_nextMoveTime.Reset(node->delay);
|
||||
|
||||
//note: disable "start" for mtmap
|
||||
if(node->event_id && urand(0,99) < node->event_chance)
|
||||
if (node->event_id && urand(0,99) < node->event_chance)
|
||||
unit.GetMap()->ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL/*, false*/);
|
||||
|
||||
MovementInform(unit);
|
||||
@@ -206,9 +206,9 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(unit.IsStopped() && !i_destinationHolder.HasArrived())
|
||||
if (unit.IsStopped() && !i_destinationHolder.HasArrived())
|
||||
{
|
||||
if(!StopedByPlayer)
|
||||
if (!StopedByPlayer)
|
||||
{
|
||||
i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER);
|
||||
i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER);
|
||||
@@ -231,13 +231,13 @@ void FlightPathMovementGenerator::LoadPath(Player &)
|
||||
|
||||
uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
|
||||
{
|
||||
if(i_currentNode >= i_mapIds.size())
|
||||
if (i_currentNode >= i_mapIds.size())
|
||||
return i_mapIds.size();
|
||||
|
||||
uint32 curMapId = i_mapIds[i_currentNode];
|
||||
for (uint32 i = i_currentNode; i < i_mapIds.size(); ++i)
|
||||
{
|
||||
if(i_mapIds[i] != curMapId)
|
||||
if (i_mapIds[i] != curMapId)
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -248,13 +248,13 @@ void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
{
|
||||
player.getHostilRefManager().setOnlineOfflineState(false);
|
||||
player.addUnitState(UNIT_STAT_IN_FLIGHT);
|
||||
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
LoadPath(player);
|
||||
Traveller<Player> traveller(player);
|
||||
// do not send movement, it was sent already
|
||||
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
|
||||
|
||||
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd());
|
||||
player.SendMonsterMoveByPath(GetPath(), GetCurrentNode(), GetPathAtMapEnd());
|
||||
|
||||
// Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
|
||||
// be reinitialized for each flightmaster at the end of each spline (or stop) in the flight.
|
||||
@@ -279,20 +279,20 @@ void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
|
||||
bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
||||
{
|
||||
if(MovementInProgress())
|
||||
if (MovementInProgress())
|
||||
{
|
||||
Traveller<Player> traveller(player);
|
||||
if(i_destinationHolder.UpdateTraveller(traveller, diff))
|
||||
if (i_destinationHolder.UpdateTraveller(traveller, diff))
|
||||
{
|
||||
i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE);
|
||||
if(i_destinationHolder.HasArrived())
|
||||
if (i_destinationHolder.HasArrived())
|
||||
{
|
||||
uint32 curMap = i_mapIds[i_currentNode];
|
||||
++i_currentNode;
|
||||
if(MovementInProgress())
|
||||
if (MovementInProgress())
|
||||
{
|
||||
DEBUG_LOG("loading node %u for player %s", i_currentNode, player.GetName());
|
||||
if(i_mapIds[i_currentNode] == curMap)
|
||||
if (i_mapIds[i_currentNode] == curMap)
|
||||
{
|
||||
// do not send movement, it was sent already
|
||||
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
|
||||
@@ -319,13 +319,13 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
||||
|
||||
void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
|
||||
{
|
||||
if(i_mapIds.empty())
|
||||
if (i_mapIds.empty())
|
||||
return;
|
||||
|
||||
uint32 map0 = i_mapIds[0];
|
||||
for (size_t i = 1; i < i_mapIds.size(); ++i)
|
||||
{
|
||||
if(i_mapIds[i]!=map0)
|
||||
if(i_mapIds[i] != map0)
|
||||
{
|
||||
i_currentNode = i;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user