mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
Cleanup Operator padding
This commit is contained in:
parent
9141299127
commit
e32b9953a1
264 changed files with 6715 additions and 6715 deletions
|
|
@ -49,7 +49,7 @@ void ScriptsInit()
|
|||
{
|
||||
nrscripts = GetScriptNames().size();
|
||||
for (int i = 0; i < MAX_SCRIPTS; ++i)
|
||||
m_scripts[i]=NULL;
|
||||
m_scripts[i] = NULL;
|
||||
|
||||
// -- Inicialize the Scripts to be Added --
|
||||
AddSC_default();
|
||||
|
|
@ -78,7 +78,7 @@ bool GossipHello(Player* player, Creature* _Creature)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pGossipHello(player,_Creature);
|
||||
return tmpscript->pGossipHello(player, _Creature);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -94,9 +94,9 @@ bool GOGossipHello(Player* pPlayer, GameObject* pGo)
|
|||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
bool GossipSelect(Player* player, Creature* _Creature,uint32 sender, uint32 action)
|
||||
bool GossipSelect(Player* player, Creature* _Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
debug_log("DEBUG: Gossip selection, sender: %d, action: %d",sender, action);
|
||||
debug_log("DEBUG: Gossip selection, sender: %d, action: %d", sender, action);
|
||||
|
||||
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||
if (!tmpscript || !tmpscript->pGossipSelect)
|
||||
|
|
@ -104,7 +104,7 @@ bool GossipSelect(Player* player, Creature* _Creature,uint32 sender, uint32 acti
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pGossipSelect(player,_Creature,sender,action);
|
||||
return tmpscript->pGossipSelect(player, _Creature, sender, action);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -124,7 +124,7 @@ bool GOGossipSelect(Player* pPlayer, GameObject* pGo, uint32 sender, uint32 acti
|
|||
MANGOS_DLL_EXPORT
|
||||
bool GossipSelectWithCode(Player* player, Creature* _Creature, uint32 sender, uint32 action, const char* sCode)
|
||||
{
|
||||
debug_log("DEBUG: Gossip selection, sender: %d, action: %d",sender, action);
|
||||
debug_log("DEBUG: Gossip selection, sender: %d, action: %d", sender, action);
|
||||
|
||||
Script* tmpscript = m_scripts[_Creature->GetScriptId()];
|
||||
if (!tmpscript || !tmpscript->pGossipSelectWithCode)
|
||||
|
|
@ -132,7 +132,7 @@ bool GossipSelectWithCode(Player* player, Creature* _Creature, uint32 sender, ui
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pGossipSelectWithCode(player,_Creature,sender,action,sCode);
|
||||
return tmpscript->pGossipSelectWithCode(player, _Creature, sender, action, sCode);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -158,7 +158,7 @@ bool QuestAccept(Player* player, Creature* _Creature, Quest* _Quest)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pQuestAccept(player,_Creature,_Quest);
|
||||
return tmpscript->pQuestAccept(player, _Creature, _Quest);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -170,7 +170,7 @@ bool QuestSelect(Player* player, Creature* _Creature, Quest* _Quest)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pQuestSelect(player,_Creature,_Quest);
|
||||
return tmpscript->pQuestSelect(player, _Creature, _Quest);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -182,7 +182,7 @@ bool QuestComplete(Player* player, Creature* _Creature, Quest* _Quest)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pQuestComplete(player,_Creature,_Quest);
|
||||
return tmpscript->pQuestComplete(player, _Creature, _Quest);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -194,7 +194,7 @@ bool ChooseReward(Player* player, Creature* _Creature, Quest* _Quest, uint32 opt
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pChooseReward(player,_Creature,_Quest,opt);
|
||||
return tmpscript->pChooseReward(player, _Creature, _Quest, opt);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -206,7 +206,7 @@ uint32 NPCDialogStatus(Player* player, Creature* _Creature)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pNPCDialogStatus(player,_Creature);
|
||||
return tmpscript->pNPCDialogStatus(player, _Creature);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -218,7 +218,7 @@ uint32 GODialogStatus(Player* player, GameObject* _GO)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pGODialogStatus(player,_GO);
|
||||
return tmpscript->pGODialogStatus(player, _GO);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -230,7 +230,7 @@ bool ItemHello(Player* player, Item* _Item, Quest* _Quest)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pItemHello(player,_Item,_Quest);
|
||||
return tmpscript->pItemHello(player, _Item, _Quest);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -242,7 +242,7 @@ bool ItemQuestAccept(Player* player, Item* _Item, Quest* _Quest)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pItemQuestAccept(player,_Item,_Quest);
|
||||
return tmpscript->pItemQuestAccept(player, _Item, _Quest);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -254,7 +254,7 @@ bool GOHello(Player* player, GameObject* _GO)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pGOHello(player,_GO);
|
||||
return tmpscript->pGOHello(player, _GO);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -266,7 +266,7 @@ bool GOQuestAccept(Player* player, GameObject* _GO, Quest* _Quest)
|
|||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
return tmpscript->pGOQuestAccept(player,_GO,_Quest);
|
||||
return tmpscript->pGOQuestAccept(player, _GO, _Quest);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -277,7 +277,7 @@ bool GOChooseReward(Player* player, GameObject* _GO, Quest* _Quest, uint32 opt)
|
|||
return false;
|
||||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
return tmpscript->pGOChooseReward(player,_GO,_Quest,opt);
|
||||
return tmpscript->pGOChooseReward(player, _GO, _Quest, opt);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
@ -308,7 +308,7 @@ bool ItemUse(Player* player, Item* _Item, SpellCastTargets const& targets)
|
|||
if (!tmpscript || !tmpscript->pItemUse)
|
||||
return false;
|
||||
|
||||
return tmpscript->pItemUse(player,_Item,targets);
|
||||
return tmpscript->pItemUse(player, _Item, targets);
|
||||
}
|
||||
|
||||
MANGOS_DLL_EXPORT
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
|
|||
// Is unit visible for MoveInLineOfSight
|
||||
bool IsVisible(Unit* who) const
|
||||
{
|
||||
return !who->HasStealthAura() && m_creature->IsWithinDist(who,VISIBLE_RANGE);
|
||||
return !who->HasStealthAura() && m_creature->IsWithinDist(who, VISIBLE_RANGE);
|
||||
}
|
||||
|
||||
// Called at World update tick
|
||||
|
|
@ -113,12 +113,12 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
|
|||
// Cast spell
|
||||
void DoCast(Unit* victim, uint32 spelId)
|
||||
{
|
||||
m_creature->CastSpell(victim,spelId,true);
|
||||
m_creature->CastSpell(victim, spelId, true);
|
||||
}
|
||||
|
||||
void DoCastSpell(Unit* who,SpellEntry* spellInfo)
|
||||
void DoCastSpell(Unit* who, SpellEntry* spellInfo)
|
||||
{
|
||||
m_creature->CastSpell(who,spellInfo,true);
|
||||
m_creature->CastSpell(who, spellInfo, true);
|
||||
}
|
||||
|
||||
void DoSay(int32 text_id, uint32 language)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ void AddSC_default()
|
|||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="default";
|
||||
newscript->Name = "default";
|
||||
newscript->pGossipHello = &GossipHello_default;
|
||||
newscript->pQuestAccept = &QuestAccept_default;
|
||||
newscript->pGossipSelect = &GossipSelect_default;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "../../../game/Player.h"
|
||||
|
||||
uint32 GetSkillLevel(Player* player,uint32 trskill)
|
||||
uint32 GetSkillLevel(Player* player, uint32 trskill)
|
||||
{
|
||||
// Returns the level of some tradetrskill known by player
|
||||
// Need to add missing spells
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
#define DEFAULT_GOSSIP_MESSAGE 0xffffff
|
||||
|
||||
extern uint32 GetSkillLevel(Player* player,uint32 skill);
|
||||
extern uint32 GetSkillLevel(Player* player, uint32 skill);
|
||||
|
||||
// Defined functions to use with player.
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class MANGOS_DLL_DECL ObjectRegistry
|
|||
ObjectRegistry() {}
|
||||
~ObjectRegistry()
|
||||
{
|
||||
for (typename RegistryMapType::iterator iter=i_registeredObjects.begin(); iter != i_registeredObjects.end(); ++iter)
|
||||
for (typename RegistryMapType::iterator iter = i_registeredObjects.begin(); iter != i_registeredObjects.end(); ++iter)
|
||||
delete iter->second;
|
||||
i_registeredObjects.clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class MANGOS_DLL_DECL GridLoader
|
|||
/** Loads the grid
|
||||
*/
|
||||
template<class LOADER>
|
||||
void Load(Grid<ACTIVE_OBJECT,WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>& grid, LOADER& loader)
|
||||
void Load(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>& grid, LOADER& loader)
|
||||
{
|
||||
loader.Load(grid);
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ class MANGOS_DLL_DECL GridLoader
|
|||
/** Stop the grid
|
||||
*/
|
||||
template<class STOPER>
|
||||
void Stop(Grid<ACTIVE_OBJECT,WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>& grid, STOPER& stoper)
|
||||
void Stop(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>& grid, STOPER& stoper)
|
||||
{
|
||||
stoper.Stop(grid);
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ class MANGOS_DLL_DECL GridLoader
|
|||
/** Unloads the grid
|
||||
*/
|
||||
template<class UNLOADER>
|
||||
void Unload(Grid<ACTIVE_OBJECT,WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>& grid, UNLOADER& unloader)
|
||||
void Unload(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>& grid, UNLOADER& unloader)
|
||||
{
|
||||
unloader.Unload(grid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace MaNGOS
|
|||
template<class SPECIFIC_TYPE, class T>
|
||||
size_t Count(const ContainerMapList<TypeList<SPECIFIC_TYPE, T> >& elements, SPECIFIC_TYPE* fake)
|
||||
{
|
||||
return Count(elements._elements,fake);
|
||||
return Count(elements._elements, fake);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_TYPE, class H, class T>
|
||||
|
|
@ -89,7 +89,7 @@ namespace MaNGOS
|
|||
template<class SPECIFIC_TYPE, class H, class T>
|
||||
SPECIFIC_TYPE* Insert(ContainerMapList<TypeList<H, T> >& elements, SPECIFIC_TYPE* obj)
|
||||
{
|
||||
SPECIFIC_TYPE* t= Insert(elements._elements, obj);
|
||||
SPECIFIC_TYPE* t = Insert(elements._elements, obj);
|
||||
return (t != NULL ? t : Insert(elements._TailElements, obj));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ namespace MaNGOS
|
|||
|
||||
template<class SPECIFIC_TYPE, class H, class T> CountedPtr<SPECIFIC_TYPE>& Find(ContainerMapList<TypeList<H, T> >& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* fake)
|
||||
{
|
||||
CountedPtr<SPECIFIC_TYPE>& t = Find(elements._elements, hdl,fake);
|
||||
return (!t ? Find(elements._TailElements, hdl,fake) : t);
|
||||
CountedPtr<SPECIFIC_TYPE>& t = Find(elements._elements, hdl, fake);
|
||||
return (!t ? Find(elements._TailElements, hdl, fake) : t);
|
||||
}
|
||||
|
||||
// const find functions
|
||||
|
|
@ -100,9 +100,9 @@ namespace MaNGOS
|
|||
|
||||
template<class SPECIFIC_TYPE, class H, class T> CountedPtr<SPECIFIC_TYPE>& Find(const ContainerMapList<TypeList<H, T> >& elements, OBJECT_HANDLE hdl, CountedPtr<SPECIFIC_TYPE>* fake)
|
||||
{
|
||||
CountedPtr<SPECIFIC_TYPE>& t = Find(elements._elements, hdl,fake);
|
||||
CountedPtr<SPECIFIC_TYPE>& t = Find(elements._elements, hdl, fake);
|
||||
if (!t)
|
||||
t = Find(elements._TailElement, hdl,fake);
|
||||
t = Find(elements._TailElement, hdl, fake);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ namespace MaNGOS
|
|||
// Recursion
|
||||
template<class SPECIFIC_TYPE, class H, class T> CountedPtr<SPECIFIC_TYPE>& Insert(ContainerMapList<TypeList<H, T> >& elements, CountedPtr<SPECIFIC_TYPE>& obj, OBJECT_HANDLE hdl)
|
||||
{
|
||||
CountedPtr<SPECIFIC_TYPE>& t= Insert(elements._elements, obj, hdl);
|
||||
CountedPtr<SPECIFIC_TYPE>& t = Insert(elements._elements, obj, hdl);
|
||||
return (!t ? Insert(elements._TailElements, obj, hdl) : t);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace ByteConverter
|
|||
inline void convert(char* val)
|
||||
{
|
||||
std::swap(*val, *(val + T - 1));
|
||||
convert<T - 2>(val + 1);
|
||||
convert < T - 2 > (val + 1);
|
||||
}
|
||||
|
||||
template<> inline void convert<0>(char*) {}
|
||||
|
|
|
|||
|
|
@ -90,15 +90,15 @@ class Reference : public LinkedListElement
|
|||
return iRefTo != NULL;
|
||||
}
|
||||
|
||||
Reference<TO,FROM>* next() { return((Reference<TO, FROM>*) LinkedListElement::next()); }
|
||||
Reference<TO,FROM> const* next() const { return((Reference<TO, FROM> const*) LinkedListElement::next()); }
|
||||
Reference<TO,FROM>* prev() { return((Reference<TO, FROM>*) LinkedListElement::prev()); }
|
||||
Reference<TO,FROM> const* prev() const { return((Reference<TO, FROM> const*) LinkedListElement::prev()); }
|
||||
Reference<TO, FROM>* next() { return((Reference<TO, FROM>*) LinkedListElement::next()); }
|
||||
Reference<TO, FROM> const* next() const { return((Reference<TO, FROM> const*) LinkedListElement::next()); }
|
||||
Reference<TO, FROM>* prev() { return((Reference<TO, FROM>*) LinkedListElement::prev()); }
|
||||
Reference<TO, FROM> const* prev() const { return((Reference<TO, FROM> const*) LinkedListElement::prev()); }
|
||||
|
||||
Reference<TO,FROM>* nocheck_next() { return((Reference<TO, FROM>*) LinkedListElement::nocheck_next()); }
|
||||
Reference<TO,FROM> const* nocheck_next() const { return((Reference<TO, FROM> const*) LinkedListElement::nocheck_next()); }
|
||||
Reference<TO,FROM>* nocheck_prev() { return((Reference<TO, FROM>*) LinkedListElement::nocheck_prev()); }
|
||||
Reference<TO,FROM> const* nocheck_prev() const { return((Reference<TO, FROM> const*) LinkedListElement::nocheck_prev()); }
|
||||
Reference<TO, FROM>* nocheck_next() { return((Reference<TO, FROM>*) LinkedListElement::nocheck_next()); }
|
||||
Reference<TO, FROM> const* nocheck_next() const { return((Reference<TO, FROM> const*) LinkedListElement::nocheck_next()); }
|
||||
Reference<TO, FROM>* nocheck_prev() { return((Reference<TO, FROM>*) LinkedListElement::nocheck_prev()); }
|
||||
Reference<TO, FROM> const* nocheck_prev() const { return((Reference<TO, FROM> const*) LinkedListElement::nocheck_prev()); }
|
||||
|
||||
TO* operator->() const { return iRefTo; }
|
||||
TO* getTarget() const { return iRefTo; }
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
|
|||
delete result;
|
||||
|
||||
// existing characters list
|
||||
result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%u'",accid);
|
||||
result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%u'", accid);
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
|
|
@ -82,7 +82,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
|
|||
}
|
||||
|
||||
// table realm specific but common for all characters of account for realm
|
||||
CharacterDatabase.PExecute("DELETE FROM character_tutorial WHERE account = '%u'",accid);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_tutorial WHERE account = '%u'", accid);
|
||||
|
||||
LoginDatabase.BeginTransaction();
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ uint32 AccountMgr::GetCharactersCount(uint32 acc_id)
|
|||
QueryResult* result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%u'", acc_id);
|
||||
if (result)
|
||||
{
|
||||
Field* fields=result->Fetch();
|
||||
Field* fields = result->Fetch();
|
||||
uint32 charcount = fields[0].GetUInt32();
|
||||
delete result;
|
||||
return charcount;
|
||||
|
|
@ -219,15 +219,15 @@ bool AccountMgr::CheckPassword(uint32 accid, std::string passwd)
|
|||
|
||||
bool AccountMgr::normalizeString(std::string& utf8str)
|
||||
{
|
||||
wchar_t wstr_buf[MAX_ACCOUNT_STR+1];
|
||||
wchar_t wstr_buf[MAX_ACCOUNT_STR + 1];
|
||||
|
||||
size_t wstr_len = MAX_ACCOUNT_STR;
|
||||
if (!Utf8toWStr(utf8str,wstr_buf,wstr_len))
|
||||
if (!Utf8toWStr(utf8str, wstr_buf, wstr_len))
|
||||
return false;
|
||||
|
||||
std::transform(&wstr_buf[0], wstr_buf+wstr_len, &wstr_buf[0], wcharToUpperOnlyLatin);
|
||||
std::transform(&wstr_buf[0], wstr_buf + wstr_len, &wstr_buf[0], wcharToUpperOnlyLatin);
|
||||
|
||||
return WStrToUtf8(wstr_buf,wstr_len,utf8str);
|
||||
return WStrToUtf8(wstr_buf, wstr_len, utf8str);
|
||||
}
|
||||
|
||||
std::string AccountMgr::CalculateShaPassHash(std::string& name, std::string& password)
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@ namespace MaNGOS
|
|||
: i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
||||
|
||||
data << uint8(i_msgtype);
|
||||
data << uint32(LANG_UNIVERSAL);
|
||||
data << i_player.GetObjectGuid();
|
||||
data << uint32(5);
|
||||
data << i_player.GetObjectGuid();
|
||||
data << uint32(strlen(text)+1);
|
||||
data << uint32(strlen(text) + 1);
|
||||
data << text;
|
||||
data << uint8(0);
|
||||
data << uint32(i_achievementId);
|
||||
|
|
@ -116,7 +116,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (!creature.id || !ObjectMgr::GetCreatureTemplate(creature.id))
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_CREATURE (%u) have nonexistent creature id in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,creature.id);
|
||||
criteria->ID, criteria->requiredType, requirementType, creature.id);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -124,19 +124,19 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (!classRace.class_id && !classRace.race_id)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_PLAYER_CLASS_RACE (%u) must have not 0 in one from value fields, ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType);
|
||||
criteria->ID, criteria->requiredType, requirementType);
|
||||
return false;
|
||||
}
|
||||
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE)==0)
|
||||
if (classRace.class_id && ((1 << (classRace.class_id - 1)) & CLASSMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_CREATURE (%u) have nonexistent class in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,classRace.class_id);
|
||||
criteria->ID, criteria->requiredType, requirementType, classRace.class_id);
|
||||
return false;
|
||||
}
|
||||
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE)==0)
|
||||
if (classRace.race_id && ((1 << (classRace.race_id - 1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_CREATURE (%u) have nonexistent race in value2 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,classRace.race_id);
|
||||
criteria->ID, criteria->requiredType, requirementType, classRace.race_id);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -144,7 +144,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (health.percent < 1 || health.percent > 100)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_PLAYER_LESS_HEALTH (%u) have wrong percent value in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,health.percent);
|
||||
criteria->ID, criteria->requiredType, requirementType, health.percent);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -152,7 +152,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (player_dead.own_team_flag > 1)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_DEAD (%u) have wrong boolean value1 (%u).",
|
||||
criteria->ID, criteria->requiredType,requirementType,player_dead.own_team_flag);
|
||||
criteria->ID, criteria->requiredType, requirementType, player_dead.own_team_flag);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -163,19 +163,19 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (!spellEntry)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement %s (%u) have wrong spell id in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,(requirementType==ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA?"ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA":"ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA"),requirementType,aura.spell_id);
|
||||
criteria->ID, criteria->requiredType, (requirementType == ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA ? "ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA" : "ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA"), requirementType, aura.spell_id);
|
||||
return false;
|
||||
}
|
||||
if (aura.effect_idx >= MAX_EFFECT_INDEX)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement %s (%u) have wrong spell effect index in value2 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,(requirementType==ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA?"ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA":"ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA"),requirementType,aura.effect_idx);
|
||||
criteria->ID, criteria->requiredType, (requirementType == ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA ? "ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA" : "ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA"), requirementType, aura.effect_idx);
|
||||
return false;
|
||||
}
|
||||
if (!spellEntry->EffectApplyAuraName[aura.effect_idx])
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement %s (%u) have non-aura spell effect (ID: %u Effect: %u), ignore.",
|
||||
criteria->ID, criteria->requiredType,(requirementType==ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA?"ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA":"ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA"),requirementType,aura.spell_id,aura.effect_idx);
|
||||
criteria->ID, criteria->requiredType, (requirementType == ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA ? "ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA" : "ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA"), requirementType, aura.spell_id, aura.effect_idx);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -184,7 +184,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (!GetAreaEntryByAreaID(area.id))
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_AREA (%u) have wrong area id in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,area.id);
|
||||
criteria->ID, criteria->requiredType, requirementType, area.id);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -192,7 +192,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (level.minlevel > STRONG_MAX_LEVEL)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_T_LEVEL (%u) have wrong minlevel in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,level.minlevel);
|
||||
criteria->ID, criteria->requiredType, requirementType, level.minlevel);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -200,7 +200,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (gender.gender > GENDER_NONE)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_T_GENDER (%u) have wrong gender in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,gender.gender);
|
||||
criteria->ID, criteria->requiredType, requirementType, gender.gender);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -208,7 +208,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (difficulty.difficulty >= MAX_DIFFICULTY)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_MAP_DIFFICULTY (%u) have wrong difficulty in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,difficulty.difficulty);
|
||||
criteria->ID, criteria->requiredType, requirementType, difficulty.difficulty);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -216,7 +216,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (map_players.maxcount <= 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_MAP_PLAYER_COUNT (%u) have wrong max players count in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,map_players.maxcount);
|
||||
criteria->ID, criteria->requiredType, requirementType, map_players.maxcount);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -224,7 +224,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (team.team != ALLIANCE && team.team != HORDE)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_T_TEAM (%u) have unknown team in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,team.team);
|
||||
criteria->ID, criteria->requiredType, requirementType, team.team);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -232,7 +232,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (drunk.state >= MAX_DRUNKEN)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_DRUNK (%u) have unknown drunken state in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,drunk.state);
|
||||
criteria->ID, criteria->requiredType, requirementType, drunk.state);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -240,7 +240,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (!sHolidaysStore.LookupEntry(holiday.id))
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_HOLIDAY (%u) have unknown holiday in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,holiday.id);
|
||||
criteria->ID, criteria->requiredType, requirementType, holiday.id);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -248,7 +248,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
if (equipped_item.item_quality >= MAX_ITEM_QUALITY)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPPED_ITEM_LVL (%u) have unknown quality state in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,requirementType,equipped_item.item_quality);
|
||||
criteria->ID, criteria->requiredType, requirementType, equipped_item.item_quality);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -264,7 +264,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri
|
|||
return true;
|
||||
}
|
||||
default:
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType,requirementType);
|
||||
sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType, requirementType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -276,11 +276,11 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
case ACHIEVEMENT_CRITERIA_REQUIRE_NONE:
|
||||
return true;
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_CREATURE:
|
||||
if (!target || target->GetTypeId()!=TYPEID_UNIT)
|
||||
if (!target || target->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
return target->GetEntry() == creature.id;
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_CLASS_RACE:
|
||||
if (!target || target->GetTypeId()!=TYPEID_PLAYER)
|
||||
if (!target || target->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
if (classRace.class_id && classRace.class_id != ((Player*)target)->getClass())
|
||||
return false;
|
||||
|
|
@ -288,24 +288,24 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
return false;
|
||||
return true;
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_LESS_HEALTH:
|
||||
if (!target || target->GetTypeId()!=TYPEID_PLAYER)
|
||||
if (!target || target->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
return target->GetHealth()*100 <= health.percent*target->GetMaxHealth();
|
||||
return target->GetHealth() * 100 <= health.percent * target->GetMaxHealth();
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_DEAD:
|
||||
if (!target || target->GetTypeId() != TYPEID_PLAYER || target->isAlive() || ((Player*)target)->GetDeathTimer() == 0)
|
||||
return false;
|
||||
// flag set == must be same team, not set == different team
|
||||
return (((Player*)target)->GetTeam() == source->GetTeam()) == (player_dead.own_team_flag != 0);
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA:
|
||||
return source->HasAura(aura.spell_id,SpellEffectIndex(aura.effect_idx));
|
||||
return source->HasAura(aura.spell_id, SpellEffectIndex(aura.effect_idx));
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_S_AREA:
|
||||
{
|
||||
uint32 zone_id,area_id;
|
||||
source->GetZoneAndAreaId(zone_id,area_id);
|
||||
return area.id==zone_id || area.id==area_id;
|
||||
uint32 zone_id, area_id;
|
||||
source->GetZoneAndAreaId(zone_id, area_id);
|
||||
return area.id == zone_id || area.id == area_id;
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_AURA:
|
||||
return target && target->HasAura(aura.spell_id,SpellEffectIndex(aura.effect_idx));
|
||||
return target && target->HasAura(aura.spell_id, SpellEffectIndex(aura.effect_idx));
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_VALUE:
|
||||
return miscvalue1 >= value.minvalue;
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_LEVEL:
|
||||
|
|
@ -319,7 +319,7 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
case ACHIEVEMENT_CRITERIA_REQUIRE_DISABLED:
|
||||
return false; // always fail
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_MAP_DIFFICULTY:
|
||||
return source->GetMap()->GetSpawnMode()==difficulty.difficulty;
|
||||
return source->GetMap()->GetSpawnMode() == difficulty.difficulty;
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_MAP_PLAYER_COUNT:
|
||||
return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount;
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_T_TEAM:
|
||||
|
|
@ -335,7 +335,7 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
BattleGround* bg = source->GetBattleGround();
|
||||
if (!bg)
|
||||
return false;
|
||||
return bg->IsTeamScoreInRange(source->GetTeam()==ALLIANCE ? HORDE : ALLIANCE,bg_loss_team_score.min_score,bg_loss_team_score.max_score);
|
||||
return bg->IsTeamScoreInRange(source->GetTeam() == ALLIANCE ? HORDE : ALLIANCE, bg_loss_team_score.min_score, bg_loss_team_score.max_score);
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT:
|
||||
{
|
||||
|
|
@ -352,7 +352,7 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
}
|
||||
case ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPPED_ITEM_LVL:
|
||||
{
|
||||
Item* item = source->GetItemByPos(INVENTORY_SLOT_BAG_0,miscvalue1);
|
||||
Item* item = source->GetItemByPos(INVENTORY_SLOT_BAG_0, miscvalue1);
|
||||
if (!item)
|
||||
return false;
|
||||
ItemPrototype const* proto = item->GetProto();
|
||||
|
|
@ -403,16 +403,16 @@ AchievementMgr::~AchievementMgr()
|
|||
|
||||
void AchievementMgr::Reset()
|
||||
{
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_DELETED,4);
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4);
|
||||
data << uint32(iter->first);
|
||||
m_player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter)
|
||||
{
|
||||
WorldPacket data(SMSG_CRITERIA_DELETED,4);
|
||||
WorldPacket data(SMSG_CRITERIA_DELETED, 4);
|
||||
data << uint32(iter->first);
|
||||
m_player->SendDirectMessage(&data);
|
||||
}
|
||||
|
|
@ -433,7 +433,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
|||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
AchievementCriteriaEntry const* achievementCriteria = (*i);
|
||||
|
||||
|
|
@ -441,7 +441,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
|||
// Checked in LoadAchievementCriteriaList
|
||||
|
||||
// don't update already completed criteria
|
||||
if (IsCompletedCriteria(achievementCriteria,achievement))
|
||||
if (IsCompletedCriteria(achievementCriteria, achievement))
|
||||
continue;
|
||||
|
||||
switch (type)
|
||||
|
|
@ -482,7 +482,7 @@ void AchievementMgr::SaveToDB()
|
|||
if (!m_completedAchievements.empty())
|
||||
{
|
||||
//delete existing achievements in the loop
|
||||
for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
if (!iter->second.changed)
|
||||
continue;
|
||||
|
|
@ -501,7 +501,7 @@ void AchievementMgr::SaveToDB()
|
|||
if (!m_criteriaProgress.empty())
|
||||
{
|
||||
//insert achievements
|
||||
for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter)
|
||||
{
|
||||
if (!iter->second.changed)
|
||||
continue;
|
||||
|
|
@ -568,8 +568,8 @@ void AchievementMgr::LoadFromDB(QueryResult* achievementResult, QueryResult* cri
|
|||
if (!criteria)
|
||||
{
|
||||
// we will remove nonexistent criteria for all characters
|
||||
sLog.outError("Nonexistent achievement criteria %u data removed from table `character_achievement_progress`.",id);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u",id);
|
||||
sLog.outError("Nonexistent achievement criteria %u data removed from table `character_achievement_progress`.", id);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u", id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -621,15 +621,15 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
|
||||
if (Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId()))
|
||||
{
|
||||
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
|
||||
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
|
||||
guild->BroadcastWorker(say_do,GetPlayer());
|
||||
guild->BroadcastWorker(say_do, GetPlayer());
|
||||
}
|
||||
|
||||
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL|ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
{
|
||||
// broadcast realm first reached
|
||||
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName())+1+8+4+4);
|
||||
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName()) + 1 + 8 + 4 + 4);
|
||||
data << GetPlayer()->GetName();
|
||||
data << GetPlayer()->GetObjectGuid();
|
||||
data << uint32(achievement->ID);
|
||||
|
|
@ -639,14 +639,14 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
// if player is in world he can tell his friends about new achievement
|
||||
else if (GetPlayer()->IsInWorld())
|
||||
{
|
||||
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
|
||||
MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
|
||||
MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> say_do(say_builder);
|
||||
MaNGOS::CameraDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> > say_worker(GetPlayer(),sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY),say_do);
|
||||
MaNGOS::CameraDistWorker<MaNGOS::LocalizedPacketDo<MaNGOS::AchievementChatBuilder> > say_worker(GetPlayer(), sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY), say_do);
|
||||
|
||||
Cell::VisitWorldObjects(GetPlayer(), say_worker, sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8 + 4 + 8);
|
||||
data << GetPlayer()->GetPackGUID();
|
||||
data << uint32(achievement->ID);
|
||||
data << uint32(secsToTimeBitFields(time(NULL)));
|
||||
|
|
@ -656,7 +656,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
|
||||
void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress)
|
||||
{
|
||||
WorldPacket data(SMSG_CRITERIA_UPDATE, 8+4+8);
|
||||
WorldPacket data(SMSG_CRITERIA_UPDATE, 8 + 4 + 8);
|
||||
data << uint32(id);
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
|
@ -677,7 +677,7 @@ void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progr
|
|||
void AchievementMgr::CheckAllAchievementCriteria()
|
||||
{
|
||||
// suppress sending packets
|
||||
for (uint32 i=0; i<ACHIEVEMENT_CRITERIA_TYPE_TOTAL; ++i)
|
||||
for (uint32 i = 0; i < ACHIEVEMENT_CRITERIA_TYPE_TOTAL; ++i)
|
||||
UpdateAchievementCriteria(AchievementCriteriaTypes(i));
|
||||
}
|
||||
|
||||
|
|
@ -709,7 +709,7 @@ void AchievementMgr::StartTimedAchievementCriteria(AchievementCriteriaTypes type
|
|||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr.GetAchievementCriteriaByType(type);
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
AchievementCriteriaEntry const* achievementCriteria = (*i);
|
||||
|
||||
|
|
@ -728,7 +728,7 @@ void AchievementMgr::StartTimedAchievementCriteria(AchievementCriteriaTypes type
|
|||
continue;
|
||||
|
||||
// don't update already completed criteria
|
||||
if (IsCompletedCriteria(achievementCriteria,achievement))
|
||||
if (IsCompletedCriteria(achievementCriteria, achievement))
|
||||
continue;
|
||||
|
||||
// Only the Quest-Complete Timed Achievements need the groupcheck, so this check is only needed here
|
||||
|
|
@ -828,7 +828,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
// don't update already completed criteria
|
||||
if (IsCompletedCriteria(achievementCriteria,achievement))
|
||||
if (IsCompletedCriteria(achievementCriteria, achievement))
|
||||
continue;
|
||||
|
||||
// init values, real set in switch
|
||||
|
|
@ -899,7 +899,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
if (!data || !data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
}
|
||||
// some hardcoded requirements
|
||||
|
|
@ -946,7 +946,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
if (!data || !data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
|
||||
change = miscvalue2;
|
||||
|
|
@ -1016,8 +1016,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
}
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT:
|
||||
{
|
||||
uint32 counter =0;
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); ++itr)
|
||||
uint32 counter = 0;
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); ++itr)
|
||||
if (itr->second.m_rewarded)
|
||||
counter++;
|
||||
change = counter;
|
||||
|
|
@ -1030,8 +1030,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (miscvalue1 && miscvalue1 != achievementCriteria->complete_quests_in_zone.zoneID)
|
||||
continue;
|
||||
|
||||
uint32 counter =0;
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); ++itr)
|
||||
uint32 counter = 0;
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); ++itr)
|
||||
{
|
||||
Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first);
|
||||
if (itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
|
||||
|
|
@ -1106,7 +1106,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (!achievIdForDungeon[j][2])
|
||||
break; // for
|
||||
}
|
||||
else if (GetPlayer()->GetDungeonDifficulty()==DUNGEON_DIFFICULTY_NORMAL)
|
||||
else if (GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL)
|
||||
{
|
||||
// dungeon in normal mode accepted
|
||||
if (!achievIdForDungeon[j][1])
|
||||
|
|
@ -1150,7 +1150,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
// if team check required: must kill by opposition faction
|
||||
if (achievement->ID==318 && miscvalue2==uint32(GetPlayer()->GetTeam()))
|
||||
if (achievement->ID == 318 && miscvalue2 == uint32(GetPlayer()->GetTeam()))
|
||||
continue;
|
||||
|
||||
change = 1;
|
||||
|
|
@ -1164,7 +1164,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
if (!data || !data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
|
||||
// miscvalue1 is the ingame fallheight*100 as stored in dbc
|
||||
|
|
@ -1208,7 +1208,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
if (!data || !data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1235,7 +1235,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (!data)
|
||||
continue;
|
||||
|
||||
if (!data->Meets(GetPlayer(),unit))
|
||||
if (!data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
|
||||
change = 1;
|
||||
|
|
@ -1253,7 +1253,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (!data)
|
||||
continue;
|
||||
|
||||
if (!data->Meets(GetPlayer(),unit))
|
||||
if (!data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
|
||||
change = 1;
|
||||
|
|
@ -1261,7 +1261,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
break;
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
|
||||
if (miscvalue1 && miscvalue1!=achievementCriteria->learn_spell.spellID)
|
||||
if (miscvalue1 && miscvalue1 != achievementCriteria->learn_spell.spellID)
|
||||
continue;
|
||||
|
||||
if (!GetPlayer()->HasSpell(achievementCriteria->learn_spell.spellID))
|
||||
|
|
@ -1280,11 +1280,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
// zone specific
|
||||
if (achievementCriteria->loot_type.lootTypeCount==1)
|
||||
if (achievementCriteria->loot_type.lootTypeCount == 1)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
if (!data || !data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1305,11 +1305,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
// additional requirements
|
||||
if (achievementCriteria->win_rated_arena.flag==ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
if (achievementCriteria->win_rated_arena.flag == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit,miscvalue1))
|
||||
if (!data || !data->Meets(GetPlayer(), unit, miscvalue1))
|
||||
{
|
||||
// reset the progress as we have a win without the requirement.
|
||||
SetCriteriaProgress(achievementCriteria, achievement, 0, PROGRESS_SET);
|
||||
|
|
@ -1362,7 +1362,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
uint32 playerIndexOffset = uint32(exploreFlag) / 32;
|
||||
uint32 mask = 1<< (uint32(exploreFlag) % 32);
|
||||
uint32 mask = 1 << (uint32(exploreFlag) % 32);
|
||||
|
||||
if (GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
|
||||
{
|
||||
|
|
@ -1416,12 +1416,12 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
// miscvalue1 = equip_slot+1 (for avoid use 0)
|
||||
if (!miscvalue1)
|
||||
continue;
|
||||
uint32 item_slot = miscvalue1-1;
|
||||
uint32 item_slot = miscvalue1 - 1;
|
||||
if (item_slot != achievementCriteria->equip_epic_item.itemSlot)
|
||||
continue;
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit,item_slot))
|
||||
if (!data || !data->Meets(GetPlayer(), unit, item_slot))
|
||||
continue;
|
||||
change = 1;
|
||||
progressType = PROGRESS_HIGHEST;
|
||||
|
|
@ -1442,7 +1442,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (achievementCriteria->ID == 2412 || achievementCriteria->ID == 2358)
|
||||
requiredItemLevel = 185;
|
||||
|
||||
if (!pProto || pProto->ItemLevel <requiredItemLevel)
|
||||
if (!pProto || pProto->ItemLevel < requiredItemLevel)
|
||||
continue;
|
||||
change = 1;
|
||||
progressType = PROGRESS_ACCUMULATE;
|
||||
|
|
@ -1459,7 +1459,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaRequirementSet const* data = sAchievementMgr.GetCriteriaRequirementSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(),unit))
|
||||
if (!data || !data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1479,7 +1479,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
continue;
|
||||
|
||||
// map specific case (BG in fact) expected player targeted damage/heal
|
||||
if (!unit || unit->GetTypeId()!=TYPEID_PLAYER)
|
||||
if (!unit || unit->GetTypeId() != TYPEID_PLAYER)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1518,7 +1518,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (!data)
|
||||
continue;
|
||||
|
||||
if (!data->Meets(GetPlayer(),unit))
|
||||
if (!data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
|
||||
change = 1;
|
||||
|
|
@ -1567,7 +1567,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (!data)
|
||||
continue;
|
||||
|
||||
if (!data->Meets(GetPlayer(),unit))
|
||||
if (!data->Meets(GetPlayer(), unit))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1920,7 +1920,7 @@ void AchievementMgr::CompletedCriteriaFor(AchievementEntry const* achievement)
|
|||
return;
|
||||
|
||||
// already completed and stored
|
||||
if (m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end())
|
||||
if (m_completedAchievements.find(achievement->ID) != m_completedAchievements.end())
|
||||
return;
|
||||
|
||||
if (IsCompletedAchievement(achievement))
|
||||
|
|
@ -2088,7 +2088,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* criteri
|
|||
{
|
||||
if (progress->counter < max_value)
|
||||
{
|
||||
WorldPacket data(SMSG_CRITERIA_DELETED,4);
|
||||
WorldPacket data(SMSG_CRITERIA_DELETED, 4);
|
||||
data << uint32(criteria->ID);
|
||||
m_player->SendDirectMessage(&data);
|
||||
}
|
||||
|
|
@ -2108,7 +2108,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* criteri
|
|||
void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
{
|
||||
DETAIL_LOG("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end())
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID) != m_completedAchievements.end())
|
||||
return;
|
||||
|
||||
SendAchievementEarned(achievement);
|
||||
|
|
@ -2183,7 +2183,7 @@ void AchievementMgr::IncompletedAchievement(AchievementEntry const* achievement)
|
|||
if (itr == m_completedAchievements.end())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_DELETED,4);
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4);
|
||||
data << uint32(achievement->ID);
|
||||
m_player->SendDirectMessage(&data);
|
||||
|
||||
|
|
@ -2213,7 +2213,7 @@ void AchievementMgr::IncompletedAchievement(AchievementEntry const* achievement)
|
|||
void AchievementMgr::SendAllAchievementData()
|
||||
{
|
||||
// since we don't know the exact size of the packed GUIDs this is just an approximation
|
||||
WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, 4*2+m_completedAchievements.size()*4*2+m_completedAchievements.size()*7*4);
|
||||
WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, 4 * 2 + m_completedAchievements.size() * 4 * 2 + m_completedAchievements.size() * 7 * 4);
|
||||
BuildAllDataPacket(&data);
|
||||
GetPlayer()->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
|
@ -2221,7 +2221,7 @@ void AchievementMgr::SendAllAchievementData()
|
|||
void AchievementMgr::SendRespondInspectAchievements(Player* player)
|
||||
{
|
||||
// since we don't know the exact size of the packed GUIDs this is just an approximation
|
||||
WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 4+4*2+m_completedAchievements.size()*4*2+m_completedAchievements.size()*7*4);
|
||||
WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 4 + 4 * 2 + m_completedAchievements.size() * 4 * 2 + m_completedAchievements.size() * 7 * 4);
|
||||
data << GetPlayer()->GetPackGUID();
|
||||
BuildAllDataPacket(&data);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
|
@ -2232,7 +2232,7 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player)
|
|||
*/
|
||||
void AchievementMgr::BuildAllDataPacket(WorldPacket* data)
|
||||
{
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
*data << uint32(iter->first);
|
||||
*data << uint32(secsToTimeBitFields(iter->second.date));
|
||||
|
|
@ -2240,7 +2240,7 @@ void AchievementMgr::BuildAllDataPacket(WorldPacket* data)
|
|||
*data << int32(-1);
|
||||
|
||||
time_t now = time(NULL);
|
||||
for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter)
|
||||
{
|
||||
*data << uint32(iter->first);
|
||||
data->appendPackGUID(iter->second.counter);
|
||||
|
|
@ -2295,7 +2295,7 @@ AchievementRewardLocale const* AchievementGlobalMgr::GetAchievementRewardLocale(
|
|||
AchievementCriteriaRequirementSet const* AchievementGlobalMgr::GetCriteriaRequirementSet(AchievementCriteriaEntry const* achievementCriteria)
|
||||
{
|
||||
AchievementCriteriaRequirementMap::const_iterator iter = m_criteriaRequirementMap.find(achievementCriteria->ID);
|
||||
return iter!=m_criteriaRequirementMap.end() ? &iter->second : NULL;
|
||||
return iter != m_criteriaRequirementMap.end() ? &iter->second : NULL;
|
||||
}
|
||||
|
||||
bool AchievementGlobalMgr::IsRealmCompleted(AchievementEntry const* achievement) const
|
||||
|
|
@ -2310,7 +2310,7 @@ void AchievementGlobalMgr::SetRealmCompleted(AchievementEntry const* achievement
|
|||
|
||||
void AchievementGlobalMgr::LoadAchievementCriteriaList()
|
||||
{
|
||||
if (sAchievementCriteriaStore.GetNumRows()==0)
|
||||
if (sAchievementCriteriaStore.GetNumRows() == 0)
|
||||
{
|
||||
BarGoLink bar(1);
|
||||
bar.step();
|
||||
|
|
@ -2352,7 +2352,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
|
|||
|
||||
void AchievementGlobalMgr::LoadAchievementReferenceList()
|
||||
{
|
||||
if (sAchievementStore.GetNumRows()==0)
|
||||
if (sAchievementStore.GetNumRows() == 0)
|
||||
{
|
||||
BarGoLink bar(1);
|
||||
bar.step();
|
||||
|
|
@ -2422,7 +2422,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
|
|||
continue;
|
||||
}
|
||||
|
||||
AchievementCriteriaRequirement data(fields[1].GetUInt32(),fields[2].GetUInt32(),fields[3].GetUInt32());
|
||||
AchievementCriteriaRequirement data(fields[1].GetUInt32(), fields[2].GetUInt32(), fields[3].GetUInt32());
|
||||
|
||||
if (!data.IsValid(criteria))
|
||||
{
|
||||
|
|
@ -2487,25 +2487,25 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
|
|||
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: // any cases
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: // need skip generic cases
|
||||
if (criteria->win_rated_arena.flag!=ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
if (criteria->win_rated_arena.flag != ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
continue;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: // any cases
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: // need skip generic cases
|
||||
if (criteria->do_emote.count==0)
|
||||
if (criteria->do_emote.count == 0)
|
||||
continue;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL:// any cases
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: // skip statistics
|
||||
if (criteria->win_duel.duelCount==0)
|
||||
if (criteria->win_duel.duelCount == 0)
|
||||
continue;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: // any cases
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: // need skip generic cases
|
||||
if (criteria->loot_type.lootTypeCount!=1)
|
||||
if (criteria->loot_type.lootTypeCount != 1)
|
||||
continue;
|
||||
break;
|
||||
default: // type not use DB data, ignore
|
||||
|
|
@ -2517,7 +2517,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements()
|
|||
}
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %u additional achievement criteria data (%u disabled).",count,disabled_count);
|
||||
sLog.outString(">> Loaded %u additional achievement criteria data (%u disabled).", count, disabled_count);
|
||||
}
|
||||
|
||||
void AchievementGlobalMgr::LoadCompletedAchievements()
|
||||
|
|
@ -2544,8 +2544,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
|
|||
if (!sAchievementStore.LookupEntry(achievement_id))
|
||||
{
|
||||
// we will remove nonexistent achievement for all characters
|
||||
sLog.outError("Nonexistent achievement %u data removed from table `character_achievement`.",achievement_id);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u",achievement_id);
|
||||
sLog.outError("Nonexistent achievement %u data removed from table `character_achievement`.", achievement_id);
|
||||
CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u", achievement_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -2556,7 +2556,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
|
|||
delete result;
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString(">> Loaded %lu realm completed achievements.",(unsigned long)m_allCompletedAchievements.size());
|
||||
sLog.outString(">> Loaded %lu realm completed achievements.", (unsigned long)m_allCompletedAchievements.size());
|
||||
}
|
||||
|
||||
void AchievementGlobalMgr::LoadRewards()
|
||||
|
|
@ -2620,7 +2620,7 @@ void AchievementGlobalMgr::LoadRewards()
|
|||
if (dup)
|
||||
continue;
|
||||
|
||||
if ((reward.titleId[0]==0)!=(reward.titleId[1]==0))
|
||||
if ((reward.titleId[0] == 0) != (reward.titleId[1] == 0))
|
||||
sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) only for one from teams.", entry, reward.titleId[0], reward.titleId[1]);
|
||||
|
||||
// must be title or mail at least
|
||||
|
|
@ -2718,7 +2718,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
|||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
|
||||
if (m_achievementRewards.find(entry)==m_achievementRewards.end())
|
||||
if (m_achievementRewards.find(entry) == m_achievementRewards.end())
|
||||
{
|
||||
sLog.outErrorDb("Table `locales_achievement_reward` (Entry: %u) has locale strings for nonexistent achievement reward .", entry);
|
||||
continue;
|
||||
|
|
@ -2749,26 +2749,26 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
|||
|
||||
for (int i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[2+2*(i-1)].GetCppString();
|
||||
std::string str = fields[2 + 2 * (i - 1)].GetCppString();
|
||||
if (!str.empty())
|
||||
{
|
||||
int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
if (idx >= 0)
|
||||
{
|
||||
if (data.subject.size() <= size_t(idx))
|
||||
data.subject.resize(idx+1);
|
||||
data.subject.resize(idx + 1);
|
||||
|
||||
data.subject[idx] = str;
|
||||
}
|
||||
}
|
||||
str = fields[2+2*(i-1)+1].GetCppString();
|
||||
str = fields[2 + 2 * (i - 1) + 1].GetCppString();
|
||||
if (!str.empty())
|
||||
{
|
||||
int idx = sObjectMgr.GetOrNewIndexForLocale(LocaleConstant(i));
|
||||
if (idx >= 0)
|
||||
{
|
||||
if (data.text.size() <= size_t(idx))
|
||||
data.text.resize(idx+1);
|
||||
data.text.resize(idx + 1);
|
||||
|
||||
data.text[idx] = str;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ struct AchievementCriteriaEntry;
|
|||
typedef std::list<AchievementCriteriaEntry const*> AchievementCriteriaEntryList;
|
||||
typedef std::list<AchievementEntry const*> AchievementEntryList;
|
||||
|
||||
typedef std::map<uint32,AchievementCriteriaEntryList> AchievementCriteriaListByAchievement;
|
||||
typedef std::map<uint32,AchievementEntryList> AchievementListByReferencedId;
|
||||
typedef std::map<uint32,time_t> AchievementCriteriaFailTimeMap;
|
||||
typedef std::map<uint32, AchievementCriteriaEntryList> AchievementCriteriaListByAchievement;
|
||||
typedef std::map<uint32, AchievementEntryList> AchievementListByReferencedId;
|
||||
typedef std::map<uint32, time_t> AchievementCriteriaFailTimeMap;
|
||||
|
||||
struct CriteriaProgress
|
||||
{
|
||||
|
|
@ -52,7 +52,7 @@ enum AchievementCriteriaRequirementType
|
|||
ACHIEVEMENT_CRITERIA_REQUIRE_NONE = 0, // 0 0
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_T_CREATURE = 1, // creature_id 0
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_CLASS_RACE = 2, // class_id race_id
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_LESS_HEALTH= 3, // health_percent 0
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_LESS_HEALTH = 3, // health_percent 0
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_T_PLAYER_DEAD = 4, // own_team 0 not corpse (not released body), own_team==false if enemy team expected
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_S_AURA = 5, // spell_id effect_idx
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_S_AREA = 6, // area id 0
|
||||
|
|
@ -216,7 +216,7 @@ struct AchievementCriteriaRequirementSet
|
|||
Storage storage;
|
||||
};
|
||||
|
||||
typedef std::map<uint32,AchievementCriteriaRequirementSet> AchievementCriteriaRequirementMap;
|
||||
typedef std::map<uint32, AchievementCriteriaRequirementSet> AchievementCriteriaRequirementMap;
|
||||
|
||||
struct AchievementReward
|
||||
{
|
||||
|
|
@ -264,10 +264,10 @@ class AchievementMgr
|
|||
static void DeleteFromDB(ObjectGuid guid);
|
||||
void LoadFromDB(QueryResult* achievementResult, QueryResult* criteriaResult);
|
||||
void SaveToDB();
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0);
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0);
|
||||
void StartTimedAchievementCriteria(AchievementCriteriaTypes type, uint32 timedRequirementId, time_t startTime = 0);
|
||||
void DoFailedTimedAchievementCriterias();
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit* unit=NULL, uint32 time=0);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, Unit* unit = NULL, uint32 time = 0);
|
||||
void CheckAllAchievementCriteria();
|
||||
void SendAllAchievementData();
|
||||
void SendRespondInspectAchievements(Player* player);
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ AggressorAI::UpdateAI(const uint32 /*diff*/)
|
|||
bool
|
||||
AggressorAI::IsVisible(Unit* pl) const
|
||||
{
|
||||
return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_FLOAT_SIGHT_MONSTER))
|
||||
&& pl->isVisibleForOrDetect(m_creature,m_creature,true);
|
||||
return m_creature->IsWithinDist(pl, sWorld.getConfig(CONFIG_FLOAT_SIGHT_MONSTER))
|
||||
&& pl->isVisibleForOrDetect(m_creature, m_creature, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -144,7 +144,7 @@ AggressorAI::AttackStart(Unit* u)
|
|||
if (!u)
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(u,true))
|
||||
if (m_creature->Attack(u, true))
|
||||
{
|
||||
i_victimGuid = u->GetObjectGuid();
|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ void ArenaTeam::Roster(WorldSession* session)
|
|||
|
||||
void ArenaTeam::Query(WorldSession* session)
|
||||
{
|
||||
WorldPacket data(SMSG_ARENA_TEAM_QUERY_RESPONSE, 4*7+GetName().size()+1);
|
||||
WorldPacket data(SMSG_ARENA_TEAM_QUERY_RESPONSE, 4 * 7 + GetName().size() + 1);
|
||||
data << uint32(GetId()); // team id
|
||||
data << GetName(); // team name
|
||||
data << uint32(GetType()); // arena team type (2=2x2, 3=3x3 or 5=5x5)
|
||||
|
|
@ -403,7 +403,7 @@ void ArenaTeam::Query(WorldSession* session)
|
|||
|
||||
void ArenaTeam::Stats(WorldSession* session)
|
||||
{
|
||||
WorldPacket data(SMSG_ARENA_TEAM_STATS, 4*7);
|
||||
WorldPacket data(SMSG_ARENA_TEAM_STATS, 4 * 7);
|
||||
data << uint32(GetId()); // team id
|
||||
data << uint32(m_stats.rating); // rating
|
||||
data << uint32(m_stats.games_week); // games this week
|
||||
|
|
@ -432,7 +432,7 @@ void ArenaTeam::InspectStats(WorldSession* session, ObjectGuid guid)
|
|||
if (!member)
|
||||
return;
|
||||
|
||||
WorldPacket data(MSG_INSPECT_ARENA_TEAMS, 8+1+4*6);
|
||||
WorldPacket data(MSG_INSPECT_ARENA_TEAMS, 8 + 1 + 4 * 6);
|
||||
data << guid; // player guid
|
||||
data << uint8(GetSlot()); // slot (0...2)
|
||||
data << uint32(GetId()); // arena team id
|
||||
|
|
@ -503,7 +503,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, char cons
|
|||
{
|
||||
uint8 strCount = !str1 ? 0 : (!str2 ? 1 : (!str3 ? 2 : 3));
|
||||
|
||||
WorldPacket data(SMSG_ARENA_TEAM_EVENT, 1 + 1 + 1*strCount + (!guid ? 0 : 8));
|
||||
WorldPacket data(SMSG_ARENA_TEAM_EVENT, 1 + 1 + 1 * strCount + (!guid ? 0 : 8));
|
||||
data << uint8(event);
|
||||
data << uint8(strCount);
|
||||
|
||||
|
|
@ -587,7 +587,7 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)
|
|||
if (sWorld.getConfig(CONFIG_UINT32_ARENA_SEASON_ID) >= 6)
|
||||
if (enemy_rating < 1000)
|
||||
enemy_rating = 1000;
|
||||
return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));
|
||||
return 1.0f / (1.0f + exp(log(10.0f) * (float)((float)enemy_rating - (float)own_rating) / 400.0f));
|
||||
}
|
||||
|
||||
void ArenaTeam::FinishGame(int32 mod)
|
||||
|
|
@ -616,7 +616,7 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
|
|||
float chance = GetChanceAgainst(m_stats.rating, againstRating);
|
||||
float K = (m_stats.rating < 1000) ? 48.0f : 32.0f;
|
||||
// calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)
|
||||
int32 mod = (int32)floor(K* (1.0f - chance));
|
||||
int32 mod = (int32)floor(K * (1.0f - chance));
|
||||
// modify the team stats accordingly
|
||||
FinishGame(mod);
|
||||
m_stats.wins_week += 1;
|
||||
|
|
@ -700,7 +700,7 @@ void ArenaTeam::MemberWon(Player* plr, uint32 againstRating)
|
|||
float chance = GetChanceAgainst(itr->personal_rating, againstRating);
|
||||
float K = (itr->personal_rating < 1000) ? 48.0f : 32.0f;
|
||||
// calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)
|
||||
int32 mod = (int32)floor(K* (1.0f - chance));
|
||||
int32 mod = (int32)floor(K * (1.0f - chance));
|
||||
itr->ModifyPersonalRating(plr, mod, GetSlot());
|
||||
// update personal stats
|
||||
itr->games_week += 1;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recv_data)
|
|||
|
||||
player->SetArenaTeamIdInvited(arenateam->GetId());
|
||||
|
||||
WorldPacket data(SMSG_ARENA_TEAM_INVITE, (8+10));
|
||||
WorldPacket data(SMSG_ARENA_TEAM_INVITE, (8 + 10));
|
||||
data << GetPlayer()->GetName();
|
||||
data << arenateam->GetName();
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
|
@ -176,7 +176,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket& /*recv_data*/)
|
|||
if (!at->AddMember(_player->GetObjectGuid()))
|
||||
{
|
||||
// arena team not found
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ARENA_TEAM_INTERNAL);
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_INTERNAL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket& recv_data)
|
|||
|
||||
void WorldSession::SendArenaTeamCommandResult(uint32 team_action, const std::string& team, const std::string& player, uint32 error_id)
|
||||
{
|
||||
WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 4+team.length()+1+player.length()+1+4);
|
||||
WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 4 + team.length() + 1 + player.length() + 1 + 4);
|
||||
data << uint32(team_action);
|
||||
data << team;
|
||||
data << player;
|
||||
|
|
@ -339,7 +339,7 @@ void WorldSession::SendArenaTeamCommandResult(uint32 team_action, const std::str
|
|||
|
||||
void WorldSession::SendNotInArenaTeamPacket(uint8 type)
|
||||
{
|
||||
WorldPacket data(SMSG_ARENA_ERROR, 4+1); // 886 - You are not in a %uv%u arena team
|
||||
WorldPacket data(SMSG_ARENA_ERROR, 4 + 1); // 886 - You are not in a %uv%u arena team
|
||||
uint32 unk = 0;
|
||||
data << uint32(unk); // unk(0)
|
||||
if (!unk)
|
||||
|
|
|
|||
|
|
@ -122,23 +122,23 @@ class AHB_Seller_Config
|
|||
void SetMaxTime(uint32 value) { m_maxTime = value; }
|
||||
uint32 GetMaxTime() const { return m_maxTime; }
|
||||
// Data access classified by item class and item quality //
|
||||
void SetItemsAmountPerClass(AuctionQuality quality, ItemClass itemclass, uint32 amount) { m_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems=amount * m_ItemInfo[quality].ItemClassInfos[itemclass].Quantity; }
|
||||
void SetItemsAmountPerClass(AuctionQuality quality, ItemClass itemclass, uint32 amount) { m_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems = amount * m_ItemInfo[quality].ItemClassInfos[itemclass].Quantity; }
|
||||
uint32 GetItemsAmountPerClass(AuctionQuality quality, ItemClass itemclass) const { return m_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems; }
|
||||
void SetItemsQuantityPerClass(AuctionQuality quality, ItemClass itemclass, uint32 qty) { m_ItemInfo[quality].ItemClassInfos[itemclass].Quantity=qty; }
|
||||
void SetItemsQuantityPerClass(AuctionQuality quality, ItemClass itemclass, uint32 qty) { m_ItemInfo[quality].ItemClassInfos[itemclass].Quantity = qty; }
|
||||
uint32 GetItemsQuantityPerClass(AuctionQuality quality, ItemClass itemclass) const { return m_ItemInfo[quality].ItemClassInfos[itemclass].Quantity; }
|
||||
void SetMissedItemsPerClass(AuctionQuality quality, ItemClass itemclass, uint32 found)
|
||||
{
|
||||
if (m_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems > found)
|
||||
m_ItemInfo[quality].ItemClassInfos[itemclass].MissItems=m_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems - found;
|
||||
m_ItemInfo[quality].ItemClassInfos[itemclass].MissItems = m_ItemInfo[quality].ItemClassInfos[itemclass].AmountOfItems - found;
|
||||
else
|
||||
m_ItemInfo[quality].ItemClassInfos[itemclass].MissItems = 0;
|
||||
}
|
||||
uint32 GetMissedItemsPerClass(AuctionQuality quality, ItemClass itemclass) const { return m_ItemInfo[quality].ItemClassInfos[itemclass].MissItems; }
|
||||
|
||||
// Data for every quality of item //
|
||||
void SetItemsAmountPerQuality(AuctionQuality quality, uint32 cnt) { m_ItemInfo[quality].AmountOfItems=cnt; }
|
||||
void SetItemsAmountPerQuality(AuctionQuality quality, uint32 cnt) { m_ItemInfo[quality].AmountOfItems = cnt; }
|
||||
uint32 GetItemsAmountPerQuality(AuctionQuality quality) const { return m_ItemInfo[quality].AmountOfItems; }
|
||||
void SetPriceRatioPerQuality(AuctionQuality quality, uint32 value) { m_ItemInfo[quality].PriceRatio=value; }
|
||||
void SetPriceRatioPerQuality(AuctionQuality quality, uint32 value) { m_ItemInfo[quality].PriceRatio = value; }
|
||||
uint32 GetPriceRatioPerQuality(AuctionQuality quality) const { return m_ItemInfo[quality].PriceRatio; }
|
||||
|
||||
private:
|
||||
|
|
@ -237,13 +237,13 @@ bool AuctionBotConfig::Initialize()
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((getConfig(CONFIG_UINT32_AHBOT_ALLIANCE_ITEM_AMOUNT_RATIO)==0) && (getConfig(CONFIG_UINT32_AHBOT_HORDE_ITEM_AMOUNT_RATIO)==0) && (getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_ITEM_AMOUNT_RATIO)==0) &&
|
||||
if ((getConfig(CONFIG_UINT32_AHBOT_ALLIANCE_ITEM_AMOUNT_RATIO) == 0) && (getConfig(CONFIG_UINT32_AHBOT_HORDE_ITEM_AMOUNT_RATIO) == 0) && (getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_ITEM_AMOUNT_RATIO) == 0) &&
|
||||
!getConfig(CONFIG_BOOL_AHBOT_BUYER_ALLIANCE_ENABLED) && !getConfig(CONFIG_BOOL_AHBOT_BUYER_HORDE_ENABLED) && !getConfig(CONFIG_BOOL_AHBOT_BUYER_NEUTRAL_ENABLED))
|
||||
{
|
||||
sLog.outString("All feature of AuctionHouseBot are disabled! (If you want to use it please set config in 'ahbot.conf')");
|
||||
return false;
|
||||
}
|
||||
if ((getConfig(CONFIG_UINT32_AHBOT_ALLIANCE_ITEM_AMOUNT_RATIO)==0) && (getConfig(CONFIG_UINT32_AHBOT_HORDE_ITEM_AMOUNT_RATIO)==0) && (getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_ITEM_AMOUNT_RATIO)==0))
|
||||
if ((getConfig(CONFIG_UINT32_AHBOT_ALLIANCE_ITEM_AMOUNT_RATIO) == 0) && (getConfig(CONFIG_UINT32_AHBOT_HORDE_ITEM_AMOUNT_RATIO) == 0) && (getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_ITEM_AMOUNT_RATIO) == 0))
|
||||
sLog.outString("AuctionHouseBot SELLER is disabled! (If you want to use it please set config in 'ahbot.conf')");
|
||||
|
||||
if (!getConfig(CONFIG_BOOL_AHBOT_BUYER_ALLIANCE_ENABLED) && !getConfig(CONFIG_BOOL_AHBOT_BUYER_HORDE_ENABLED) && !getConfig(CONFIG_BOOL_AHBOT_BUYER_NEUTRAL_ENABLED))
|
||||
|
|
@ -256,7 +256,7 @@ bool AuctionBotConfig::Initialize()
|
|||
|
||||
void AuctionBotConfig::setConfig(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue)
|
||||
{
|
||||
setConfig(index, m_AhBotCfg.GetIntDefault(fieldname,defvalue));
|
||||
setConfig(index, m_AhBotCfg.GetIntDefault(fieldname, defvalue));
|
||||
if (int32(getConfig(index)) < 0)
|
||||
{
|
||||
sLog.outError("AHBot: %s (%i) can't be negative. Using %u instead.", fieldname, int32(getConfig(index)), defvalue);
|
||||
|
|
@ -266,7 +266,7 @@ void AuctionBotConfig::setConfig(AuctionBotConfigUInt32Values index, char const*
|
|||
|
||||
void AuctionBotConfig::setConfigMax(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 maxvalue)
|
||||
{
|
||||
setConfig(index, m_AhBotCfg.GetIntDefault(fieldname,defvalue));
|
||||
setConfig(index, m_AhBotCfg.GetIntDefault(fieldname, defvalue));
|
||||
if (getConfig(index) > maxvalue)
|
||||
{
|
||||
sLog.outError("AHBot: %s (%u) must be in range 0...%u. Using %u instead.", fieldname, getConfig(index), maxvalue, maxvalue);
|
||||
|
|
@ -276,7 +276,7 @@ void AuctionBotConfig::setConfigMax(AuctionBotConfigUInt32Values index, char con
|
|||
|
||||
void AuctionBotConfig::setConfigMinMax(AuctionBotConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue)
|
||||
{
|
||||
setConfig(index, m_AhBotCfg.GetIntDefault(fieldname,defvalue));
|
||||
setConfig(index, m_AhBotCfg.GetIntDefault(fieldname, defvalue));
|
||||
if (getConfig(index) > maxvalue)
|
||||
{
|
||||
sLog.outError("AHBot: %s (%u) must be in range %u...%u. Using %u instead.", fieldname, getConfig(index), minvalue, maxvalue, maxvalue);
|
||||
|
|
@ -291,7 +291,7 @@ void AuctionBotConfig::setConfigMinMax(AuctionBotConfigUInt32Values index, char
|
|||
|
||||
void AuctionBotConfig::setConfig(AuctionBotConfigBoolValues index, char const* fieldname, bool defvalue)
|
||||
{
|
||||
setConfig(index, m_AhBotCfg.GetBoolDefault(fieldname,defvalue));
|
||||
setConfig(index, m_AhBotCfg.GetBoolDefault(fieldname, defvalue));
|
||||
}
|
||||
|
||||
//Get AuctionHousebot configuration file
|
||||
|
|
@ -369,7 +369,7 @@ void AuctionBotConfig::GetConfigFromFile()
|
|||
setConfigMinMax(CONFIG_UINT32_AHBOT_BUYER_CHANCE_RATIO_ALLIANCE, "AuctionHouseBot.Buyer.Alliance.Chance.Ratio", 3, 1, 100);
|
||||
setConfigMinMax(CONFIG_UINT32_AHBOT_BUYER_CHANCE_RATIO_HORDE , "AuctionHouseBot.Buyer.Horde.Chance.Ratio" , 3, 1, 100);
|
||||
setConfigMinMax(CONFIG_UINT32_AHBOT_BUYER_CHANCE_RATIO_NEUTRAL , "AuctionHouseBot.Buyer.Neutral.Chance.Ratio" , 3, 1, 100);
|
||||
setConfigMinMax(CONFIG_UINT32_AHBOT_BUYER_RECHECK_INTERVAL , "AuctionHouseBot.Buyer.Recheck.Interval" , 20,1, DAY/MINUTE);
|
||||
setConfigMinMax(CONFIG_UINT32_AHBOT_BUYER_RECHECK_INTERVAL , "AuctionHouseBot.Buyer.Recheck.Interval" , 20, 1, DAY / MINUTE);
|
||||
|
||||
setConfig(CONFIG_BOOL_AHBOT_DEBUG_SELLER , "AuctionHouseBot.DEBUG.Seller" , false);
|
||||
setConfig(CONFIG_BOOL_AHBOT_DEBUG_BUYER , "AuctionHouseBot.DEBUG.Buyer" , false);
|
||||
|
|
@ -441,8 +441,8 @@ uint32 AuctionBotConfig::getConfigItemQualityAmount(AuctionQuality quality) cons
|
|||
case AUCTION_QUALITY_WHITE: return getConfig(CONFIG_UINT32_AHBOT_ITEM_WHITE_AMOUNT);
|
||||
case AUCTION_QUALITY_GREEN: return getConfig(CONFIG_UINT32_AHBOT_ITEM_GREEN_AMOUNT);
|
||||
case AUCTION_QUALITY_BLUE: return getConfig(CONFIG_UINT32_AHBOT_ITEM_BLUE_AMOUNT);
|
||||
case AUCTION_QUALITY_PURPLE:return getConfig(CONFIG_UINT32_AHBOT_ITEM_PURPLE_AMOUNT);
|
||||
case AUCTION_QUALITY_ORANGE:return getConfig(CONFIG_UINT32_AHBOT_ITEM_ORANGE_AMOUNT);
|
||||
case AUCTION_QUALITY_PURPLE: return getConfig(CONFIG_UINT32_AHBOT_ITEM_PURPLE_AMOUNT);
|
||||
case AUCTION_QUALITY_ORANGE: return getConfig(CONFIG_UINT32_AHBOT_ITEM_ORANGE_AMOUNT);
|
||||
default: return getConfig(CONFIG_UINT32_AHBOT_ITEM_YELLOW_AMOUNT);
|
||||
}
|
||||
}
|
||||
|
|
@ -489,19 +489,19 @@ void AuctionBotBuyer::LoadBuyerValues(AHB_Buyer_Config& config)
|
|||
switch (config.GetHouseType())
|
||||
{
|
||||
case AUCTION_HOUSE_ALLIANCE:
|
||||
config.BuyerPriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_ALLIANCE_PRICE_RATIO)+50;
|
||||
config.BuyerPriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_ALLIANCE_PRICE_RATIO) + 50;
|
||||
FactionChance = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_BUYER_CHANCE_RATIO_ALLIANCE);
|
||||
break;
|
||||
case AUCTION_HOUSE_HORDE:
|
||||
config.BuyerPriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_HORDE_PRICE_RATIO)+50;
|
||||
config.BuyerPriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_HORDE_PRICE_RATIO) + 50;
|
||||
FactionChance = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_BUYER_CHANCE_RATIO_HORDE);
|
||||
break;
|
||||
default:
|
||||
config.BuyerPriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_PRICE_RATIO)+50;
|
||||
config.BuyerPriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_PRICE_RATIO) + 50;
|
||||
FactionChance = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_BUYER_CHANCE_RATIO_NEUTRAL);
|
||||
break;
|
||||
}
|
||||
config.FactionChance=5000*FactionChance;
|
||||
config.FactionChance = 5000 * FactionChance;
|
||||
}
|
||||
|
||||
void AuctionBotBuyer::LoadConfig()
|
||||
|
|
@ -517,8 +517,8 @@ void AuctionBotBuyer::LoadConfig()
|
|||
uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config)
|
||||
{
|
||||
config.SameItemInfo.clear();
|
||||
uint32 count=0;
|
||||
time_t Now=time(NULL);
|
||||
uint32 count = 0;
|
||||
time_t Now = time(NULL);
|
||||
|
||||
AuctionHouseObject::AuctionEntryMapBounds bounds = sAuctionMgr.GetAuctionsMap(config.GetHouseType())->GetAuctionsBounds();
|
||||
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
|
|
@ -531,45 +531,45 @@ uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config)
|
|||
if (prototype)
|
||||
{
|
||||
++config.SameItemInfo[item->GetEntry()].ItemCount; // Structure constructor will make sure Element are correctly initialised if entry is created here.
|
||||
config.SameItemInfo[item->GetEntry()].BuyPrice =config.SameItemInfo[item->GetEntry()].BuyPrice + (itr->second->buyout/item->GetCount());
|
||||
config.SameItemInfo[item->GetEntry()].BidPrice =config.SameItemInfo[item->GetEntry()].BidPrice + (itr->second->startbid/item->GetCount());
|
||||
config.SameItemInfo[item->GetEntry()].BuyPrice = config.SameItemInfo[item->GetEntry()].BuyPrice + (itr->second->buyout / item->GetCount());
|
||||
config.SameItemInfo[item->GetEntry()].BidPrice = config.SameItemInfo[item->GetEntry()].BidPrice + (itr->second->startbid / item->GetCount());
|
||||
if (itr->second->buyout != 0)
|
||||
{
|
||||
if (itr->second->buyout/item->GetCount() < config.SameItemInfo[item->GetEntry()].MinBuyPrice)
|
||||
config.SameItemInfo[item->GetEntry()].MinBuyPrice = itr->second->buyout/item->GetCount();
|
||||
if (itr->second->buyout / item->GetCount() < config.SameItemInfo[item->GetEntry()].MinBuyPrice)
|
||||
config.SameItemInfo[item->GetEntry()].MinBuyPrice = itr->second->buyout / item->GetCount();
|
||||
else if (config.SameItemInfo[item->GetEntry()].MinBuyPrice == 0)
|
||||
config.SameItemInfo[item->GetEntry()].MinBuyPrice = itr->second->buyout/item->GetCount();
|
||||
config.SameItemInfo[item->GetEntry()].MinBuyPrice = itr->second->buyout / item->GetCount();
|
||||
}
|
||||
if (itr->second->startbid/item->GetCount() < config.SameItemInfo[item->GetEntry()].MinBidPrice)
|
||||
config.SameItemInfo[item->GetEntry()].MinBidPrice = itr->second->startbid/item->GetCount();
|
||||
if (itr->second->startbid / item->GetCount() < config.SameItemInfo[item->GetEntry()].MinBidPrice)
|
||||
config.SameItemInfo[item->GetEntry()].MinBidPrice = itr->second->startbid / item->GetCount();
|
||||
else if (config.SameItemInfo[item->GetEntry()].MinBidPrice == 0)
|
||||
config.SameItemInfo[item->GetEntry()].MinBidPrice = itr->second->startbid/item->GetCount();
|
||||
config.SameItemInfo[item->GetEntry()].MinBidPrice = itr->second->startbid / item->GetCount();
|
||||
|
||||
if (!Aentry->owner)
|
||||
{
|
||||
|
||||
if ((Aentry->bid!=0) && Aentry->bidder) // Add bided by player
|
||||
if ((Aentry->bid != 0) && Aentry->bidder) // Add bided by player
|
||||
{
|
||||
config.CheckedEntry[Aentry->Id].LastExist=Now;
|
||||
config.CheckedEntry[Aentry->Id].AuctionId=Aentry->Id;
|
||||
config.CheckedEntry[Aentry->Id].LastExist = Now;
|
||||
config.CheckedEntry[Aentry->Id].AuctionId = Aentry->Id;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Aentry->bid!=0)
|
||||
if (Aentry->bid != 0)
|
||||
{
|
||||
if (Aentry->bidder)
|
||||
{
|
||||
config.CheckedEntry[Aentry->Id].LastExist=Now;
|
||||
config.CheckedEntry[Aentry->Id].AuctionId=Aentry->Id;
|
||||
config.CheckedEntry[Aentry->Id].LastExist = Now;
|
||||
config.CheckedEntry[Aentry->Id].AuctionId = Aentry->Id;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
config.CheckedEntry[Aentry->Id].LastExist=Now;
|
||||
config.CheckedEntry[Aentry->Id].AuctionId=Aentry->Id;
|
||||
config.CheckedEntry[Aentry->Id].LastExist = Now;
|
||||
config.CheckedEntry[Aentry->Id].AuctionId = Aentry->Id;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
|
@ -577,18 +577,18 @@ uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config)
|
|||
}
|
||||
}
|
||||
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: %u items added to buyable vector for ah type: %u",count, config.GetHouseType());
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: %u items added to buyable vector for ah type: %u", count, config.GetHouseType());
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: SameItemInfo size = " SIZEFMTD, config.SameItemInfo.size());
|
||||
return count;
|
||||
}
|
||||
|
||||
void AuctionBotBuyer::PrepareListOfEntry(AHB_Buyer_Config& config)
|
||||
{
|
||||
time_t Now=time(NULL)-5;
|
||||
time_t Now = time(NULL) - 5;
|
||||
|
||||
for (CheckEntryMap::iterator itr=config.CheckedEntry.begin(); itr != config.CheckedEntry.end();)
|
||||
for (CheckEntryMap::iterator itr = config.CheckedEntry.begin(); itr != config.CheckedEntry.end();)
|
||||
{
|
||||
if (itr->second.LastExist < (Now-5))
|
||||
if (itr->second.LastExist < (Now - 5))
|
||||
config.CheckedEntry.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
|
|
@ -599,13 +599,13 @@ void AuctionBotBuyer::PrepareListOfEntry(AHB_Buyer_Config& config)
|
|||
|
||||
bool AuctionBotBuyer::IsBuyableEntry(uint32 buyoutPrice, double InGame_BuyPrice, double MaxBuyablePrice, uint32 MinBuyPrice, uint32 MaxChance, uint32 ChanceRatio)
|
||||
{
|
||||
double ratio=0;
|
||||
uint32 Chance=0;
|
||||
double ratio = 0;
|
||||
uint32 Chance = 0;
|
||||
|
||||
if (buyoutPrice <= MinBuyPrice)
|
||||
{
|
||||
if (buyoutPrice <= MaxBuyablePrice)
|
||||
Chance=MaxChance;
|
||||
Chance = MaxChance;
|
||||
else
|
||||
{
|
||||
|
||||
|
|
@ -613,15 +613,15 @@ bool AuctionBotBuyer::IsBuyableEntry(uint32 buyoutPrice, double InGame_BuyPrice,
|
|||
{
|
||||
ratio = buyoutPrice / MaxBuyablePrice;
|
||||
if (ratio < 10)
|
||||
Chance=MaxChance - (ratio*(MaxChance/10));
|
||||
else Chance=1;
|
||||
Chance = MaxChance - (ratio * (MaxChance / 10));
|
||||
else Chance = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (buyoutPrice <= InGame_BuyPrice)
|
||||
{
|
||||
if (buyoutPrice <= MaxBuyablePrice)
|
||||
Chance=MaxChance/5;
|
||||
Chance = MaxChance / 5;
|
||||
else
|
||||
{
|
||||
|
||||
|
|
@ -629,80 +629,80 @@ bool AuctionBotBuyer::IsBuyableEntry(uint32 buyoutPrice, double InGame_BuyPrice,
|
|||
{
|
||||
ratio = buyoutPrice / MaxBuyablePrice;
|
||||
if (ratio < 10)
|
||||
Chance=(MaxChance/5) - (ratio*(MaxChance/50));
|
||||
else Chance=1;
|
||||
Chance = (MaxChance / 5) - (ratio * (MaxChance / 50));
|
||||
else Chance = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (buyoutPrice <= MaxBuyablePrice)
|
||||
Chance = MaxChance/10;
|
||||
Chance = MaxChance / 10;
|
||||
else
|
||||
{
|
||||
if ((buyoutPrice > 0) && (MaxBuyablePrice > 0))
|
||||
{
|
||||
ratio = buyoutPrice / MaxBuyablePrice;
|
||||
if (ratio < 10)
|
||||
Chance=(MaxChance/5) - (ratio*(MaxChance/50));
|
||||
else Chance=0;
|
||||
Chance = (MaxChance / 5) - (ratio * (MaxChance / 50));
|
||||
else Chance = 0;
|
||||
}
|
||||
else Chance = 0;
|
||||
}
|
||||
uint32 RandNum = urand(1,ChanceRatio);
|
||||
if (RandNum<=Chance)
|
||||
uint32 RandNum = urand(1, ChanceRatio);
|
||||
if (RandNum <= Chance)
|
||||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: WIN BUY! Chance = %u, num = %u.",Chance, RandNum);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: WIN BUY! Chance = %u, num = %u.", Chance, RandNum);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot:LOOSE BUY! Chance = %u, num = %u.",Chance, RandNum);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot:LOOSE BUY! Chance = %u, num = %u.", Chance, RandNum);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool AuctionBotBuyer::IsBidableEntry(uint32 bidPrice, double InGame_BuyPrice, double MaxBidablePrice, uint32 MinBidPrice, uint32 MaxChance, uint32 ChanceRatio)
|
||||
{
|
||||
double ratio=0;
|
||||
uint32 Chance=0;
|
||||
double ratio = 0;
|
||||
uint32 Chance = 0;
|
||||
|
||||
if (bidPrice <= MinBidPrice)
|
||||
{
|
||||
if ((InGame_BuyPrice != 0) && (bidPrice < (InGame_BuyPrice - (InGame_BuyPrice / 30))))
|
||||
Chance=MaxChance;
|
||||
Chance = MaxChance;
|
||||
else
|
||||
{
|
||||
if (bidPrice < MaxBidablePrice)
|
||||
{
|
||||
ratio = MaxBidablePrice / bidPrice;
|
||||
if (ratio < 3)
|
||||
Chance = ((MaxChance/500)*ratio);
|
||||
Chance = ((MaxChance / 500) * ratio);
|
||||
else
|
||||
Chance = (MaxChance/500);
|
||||
Chance = (MaxChance / 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bidPrice < (InGame_BuyPrice - (InGame_BuyPrice / 30)))
|
||||
Chance=(MaxChance/10);
|
||||
Chance = (MaxChance / 10);
|
||||
else
|
||||
{
|
||||
if (bidPrice < MaxBidablePrice)
|
||||
{
|
||||
ratio = MaxBidablePrice / bidPrice;
|
||||
if (ratio < 4)
|
||||
Chance = ((MaxChance/1000)*ratio);
|
||||
Chance = ((MaxChance / 1000) * ratio);
|
||||
else
|
||||
Chance = (MaxChance/1000);
|
||||
Chance = (MaxChance / 1000);
|
||||
}
|
||||
}
|
||||
uint32 RandNum = urand(1,ChanceRatio);
|
||||
if (RandNum<=Chance)
|
||||
uint32 RandNum = urand(1, ChanceRatio);
|
||||
if (RandNum <= Chance)
|
||||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: WIN BID! Chance = %u, num = %u.",Chance, RandNum);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: WIN BID! Chance = %u, num = %u.", Chance, RandNum);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: LOOSE BID! Chance = %u, num = %u.",Chance, RandNum);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: LOOSE BID! Chance = %u, num = %u.", Chance, RandNum);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -729,13 +729,13 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
|||
uint32 BuyCycles;
|
||||
if (config.CheckedEntry.size() > sAuctionBotConfig.GetItemPerCycleBoost())
|
||||
{
|
||||
BuyCycles=sAuctionBotConfig.GetItemPerCycleBoost();
|
||||
BuyCycles = sAuctionBotConfig.GetItemPerCycleBoost();
|
||||
BASIC_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Boost value used for Buyer! (if this happens often adjust both ItemsPerCycle in ahbot.conf)");
|
||||
}
|
||||
else
|
||||
BuyCycles=sAuctionBotConfig.GetItemPerCycleNormal();
|
||||
BuyCycles = sAuctionBotConfig.GetItemPerCycleNormal();
|
||||
|
||||
for (CheckEntryMap::iterator itr =config.CheckedEntry.begin(); itr != config.CheckedEntry.end();)
|
||||
for (CheckEntryMap::iterator itr = config.CheckedEntry.begin(); itr != config.CheckedEntry.end();)
|
||||
{
|
||||
AuctionEntry* auction = auctionHouse->GetAuction(itr->second.AuctionId);
|
||||
if (!auction || auction->moneyDeliveryTime) // is auction not active now
|
||||
|
|
@ -757,7 +757,7 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
|||
if (BuyCycles == 0)
|
||||
break;
|
||||
|
||||
uint32 MaxChance=5000;
|
||||
uint32 MaxChance = 5000;
|
||||
|
||||
Item* item = sAuctionMgr.GetAItem(auction->itemGuidLow);
|
||||
if (!item) // auction item not accessible, possible auction in payment pending mode
|
||||
|
|
@ -771,45 +771,45 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
|||
uint32 BasePrice = sAuctionBotConfig.getConfig(CONFIG_BOOL_AHBOT_BUYPRICE_BUYER) ? prototype->BuyPrice : prototype->SellPrice;
|
||||
BasePrice *= item->GetCount();
|
||||
|
||||
double MaxBuyablePrice = (BasePrice * config.BuyerPriceRatio)/100;
|
||||
double MaxBuyablePrice = (BasePrice * config.BuyerPriceRatio) / 100;
|
||||
BuyerItemInfoMap::iterator sameitem_itr = config.SameItemInfo.find(item->GetEntry());
|
||||
uint32 buyoutPrice = auction->buyout/item->GetCount();
|
||||
uint32 buyoutPrice = auction->buyout / item->GetCount();
|
||||
|
||||
uint32 bidPrice;
|
||||
uint32 bidPriceByItem;
|
||||
if (auction->bid >= auction->startbid)
|
||||
{
|
||||
bidPrice = auction->GetAuctionOutBid();
|
||||
bidPriceByItem = auction->bid/item->GetCount();
|
||||
bidPriceByItem = auction->bid / item->GetCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
bidPrice = auction->startbid;
|
||||
bidPriceByItem = auction->startbid/item->GetCount();
|
||||
bidPriceByItem = auction->startbid / item->GetCount();
|
||||
}
|
||||
|
||||
double InGame_BuyPrice;
|
||||
double InGame_BidPrice;
|
||||
if (sameitem_itr==config.SameItemInfo.end())
|
||||
if (sameitem_itr == config.SameItemInfo.end())
|
||||
{
|
||||
InGame_BuyPrice=0;
|
||||
InGame_BidPrice=0;
|
||||
InGame_BuyPrice = 0;
|
||||
InGame_BidPrice = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sameitem_itr->second.ItemCount == 1) MaxBuyablePrice = MaxBuyablePrice * 5; // if only one item exist can be buyed if the price is high too.
|
||||
InGame_BuyPrice=sameitem_itr->second.BuyPrice/sameitem_itr->second.ItemCount;
|
||||
InGame_BidPrice=sameitem_itr->second.BidPrice/sameitem_itr->second.ItemCount;
|
||||
InGame_BuyPrice = sameitem_itr->second.BuyPrice / sameitem_itr->second.ItemCount;
|
||||
InGame_BidPrice = sameitem_itr->second.BidPrice / sameitem_itr->second.ItemCount;
|
||||
}
|
||||
|
||||
double MaxBidablePrice = MaxBuyablePrice - (MaxBuyablePrice / 30); // Max Bidable price defined to 70% of max buyable price
|
||||
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Auction added with data:");
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: MaxPrice of Entry %u is %.1fg.", itr->second.AuctionId, MaxBuyablePrice / 10000);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: GamePrice buy=%.1fg, bid=%.1fg.",InGame_BuyPrice/10000, InGame_BidPrice / 10000);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: GamePrice buy=%.1fg, bid=%.1fg.", InGame_BuyPrice / 10000, InGame_BidPrice / 10000);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Minimal price see in AH Buy=%ug, Bid=%ug.",
|
||||
sameitem_itr->second.MinBuyPrice / 10000,sameitem_itr->second.MinBidPrice / 10000);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Actual Entry price, Buy=%ug, Bid=%ug.", buyoutPrice / 10000, bidPrice/ 10000);
|
||||
sameitem_itr->second.MinBuyPrice / 10000, sameitem_itr->second.MinBidPrice / 10000);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Actual Entry price, Buy=%ug, Bid=%ug.", buyoutPrice / 10000, bidPrice / 10000);
|
||||
|
||||
if (!auction->owner) // Original auction owner
|
||||
{
|
||||
|
|
@ -819,19 +819,19 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
|||
{
|
||||
if (IsBuyableEntry(buyoutPrice, InGame_BuyPrice, MaxBuyablePrice, sameitem_itr->second.MinBuyPrice, MaxChance, config.FactionChance))
|
||||
{
|
||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance/2, config.FactionChance))
|
||||
if (urand(0,5)==0) PlaceBidToEntry(auction, bidPrice); else BuyEntry(auction);
|
||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance / 2, config.FactionChance))
|
||||
if (urand(0, 5) == 0) PlaceBidToEntry(auction, bidPrice); else BuyEntry(auction);
|
||||
else
|
||||
BuyEntry(auction);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance/2, config.FactionChance))
|
||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance / 2, config.FactionChance))
|
||||
PlaceBidToEntry(auction, bidPrice);
|
||||
}
|
||||
}
|
||||
else // buyout = 0 mean only bid are possible
|
||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice,MaxChance, config.FactionChance))
|
||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance, config.FactionChance))
|
||||
PlaceBidToEntry(auction, bidPrice);
|
||||
|
||||
itr->second.LastChecked = Now;
|
||||
|
|
@ -879,14 +879,14 @@ bool AuctionBotSeller::Initialize()
|
|||
{
|
||||
std::stringstream includeStream(sAuctionBotConfig.GetAHBotIncludes());
|
||||
std::string temp;
|
||||
while (getline(includeStream,temp, ','))
|
||||
while (getline(includeStream, temp, ','))
|
||||
includeItems.push_back(atoi(temp.c_str()));
|
||||
}
|
||||
|
||||
{
|
||||
std::stringstream excludeStream(sAuctionBotConfig.GetAHBotExcludes());
|
||||
std::string temp;
|
||||
while (getline(excludeStream,temp, ','))
|
||||
while (getline(excludeStream, temp, ','))
|
||||
excludeItems.push_back(atoi(temp.c_str()));
|
||||
|
||||
}
|
||||
|
|
@ -973,7 +973,7 @@ bool AuctionBotSeller::Initialize()
|
|||
// forced exclude filter
|
||||
bool isExcludeItem = false;
|
||||
for (size_t i = 0; (i < excludeItems.size() && (!isExcludeItem)); ++i)
|
||||
if (itemID ==excludeItems[i])
|
||||
if (itemID == excludeItems[i])
|
||||
isExcludeItem = true;
|
||||
if (isExcludeItem)
|
||||
continue;
|
||||
|
|
@ -1116,7 +1116,7 @@ bool AuctionBotSeller::Initialize()
|
|||
break;
|
||||
}
|
||||
case ITEM_CLASS_MISC:
|
||||
if (prototype->SubClass==ITEM_SUBCLASS_JUNK_MOUNT)
|
||||
if (prototype->SubClass == ITEM_SUBCLASS_JUNK_MOUNT)
|
||||
{
|
||||
if (uint32 value = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_CLASS_MISC_MOUNT_MIN_REQ_LEVEL))
|
||||
if (prototype->RequiredLevel < value)
|
||||
|
|
@ -1379,13 +1379,13 @@ void AuctionBotSeller::LoadSellerValues(AHB_Seller_Config& config)
|
|||
PriceRatio = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_NEUTRAL_PRICE_RATIO);
|
||||
break;
|
||||
}
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREY,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_WHITE,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREEN,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_BLUE,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_PURPLE,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW,PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREY, PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_WHITE, PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREEN, PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_BLUE, PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_PURPLE, PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio);
|
||||
config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio);
|
||||
|
||||
//load min and max auction times
|
||||
config.SetMinTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MINTIME));
|
||||
|
|
@ -1394,7 +1394,7 @@ void AuctionBotSeller::LoadSellerValues(AHB_Seller_Config& config)
|
|||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: minTime = %u", config.GetMinTime());
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: maxTime = %u", config.GetMaxTime());
|
||||
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: For AH type %u",config.GetHouseType());
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: For AH type %u", config.GetHouseType());
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: GreyItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GREY));
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: WhiteItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_WHITE));
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: GreenItems = %u", config.GetItemsAmountPerQuality(AUCTION_QUALITY_GREEN));
|
||||
|
|
@ -1428,18 +1428,18 @@ uint32 AuctionBotSeller::SetStat(AHB_Seller_Config& config)
|
|||
}
|
||||
}
|
||||
}
|
||||
uint32 count=0;
|
||||
for (uint32 j=0; j<MAX_AUCTION_QUALITY; ++j)
|
||||
uint32 count = 0;
|
||||
for (uint32 j = 0; j < MAX_AUCTION_QUALITY; ++j)
|
||||
{
|
||||
for (uint32 i=0; i<MAX_ITEM_CLASS; ++i)
|
||||
for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
|
||||
{
|
||||
config.SetMissedItemsPerClass((AuctionQuality) j, (ItemClass) i, ItemsInAH[j][i]);
|
||||
count+=config.GetMissedItemsPerClass((AuctionQuality) j, (ItemClass) i);
|
||||
count += config.GetMissedItemsPerClass((AuctionQuality) j, (ItemClass) i);
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: Missed Item \tGrey\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow");
|
||||
for (uint32 i=0; i<MAX_ITEM_CLASS; ++i)
|
||||
for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
|
||||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_SELLER, "AHBot: %-18s\t%u\t%u\t%u\t%u\t%u\t%u\t%u",
|
||||
sAuctionBotConfig.GetItemClassName(ItemClass(i)),
|
||||
|
|
@ -1459,7 +1459,7 @@ uint32 AuctionBotSeller::SetStat(AHB_Seller_Config& config)
|
|||
bool AuctionBotSeller::getRandomArray(AHB_Seller_Config& config, RandomArray& ra, const std::vector<std::vector<uint32> >& addedItem)
|
||||
{
|
||||
ra.clear();
|
||||
bool Ok=false;
|
||||
bool Ok = false;
|
||||
|
||||
for (uint32 j = 0; j < MAX_AUCTION_QUALITY; ++j)
|
||||
{
|
||||
|
|
@ -1471,7 +1471,7 @@ bool AuctionBotSeller::getRandomArray(AHB_Seller_Config& config, RandomArray& ra
|
|||
miss_item.color = j;
|
||||
miss_item.itemclass = i;
|
||||
ra.push_back(miss_item);
|
||||
Ok=true;
|
||||
Ok = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1485,10 +1485,10 @@ void AuctionBotSeller::SetPricesOfItem(ItemPrototype const* itemProto, AHB_Selle
|
|||
(itemQuality < MAX_AUCTION_QUALITY ? config.GetPriceRatioPerQuality(AuctionQuality(itemQuality)) : 1) ;
|
||||
|
||||
double randrange = temp_buyp * 0.4;
|
||||
buyp = (urand(temp_buyp-randrange, temp_buyp+randrange)/100)+1;
|
||||
double urandrange=buyp*40;
|
||||
double temp_bidp = buyp*50;
|
||||
bidp = (urand(temp_bidp-urandrange, temp_bidp+urandrange)/100)+1;
|
||||
buyp = (urand(temp_buyp - randrange, temp_buyp + randrange) / 100) + 1;
|
||||
double urandrange = buyp * 40;
|
||||
double temp_bidp = buyp * 50;
|
||||
bidp = (urand(temp_bidp - urandrange, temp_bidp + urandrange) / 100) + 1;
|
||||
}
|
||||
|
||||
void AuctionBotSeller::SetItemsRatio(uint32 al, uint32 ho, uint32 ne)
|
||||
|
|
@ -1538,8 +1538,8 @@ void AuctionBotSeller::SetItemsAmountForQuality(AuctionQuality quality, uint32 v
|
|||
case AUCTION_QUALITY_WHITE: sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_WHITE_AMOUNT, val); break;
|
||||
case AUCTION_QUALITY_GREEN: sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_GREEN_AMOUNT, val); break;
|
||||
case AUCTION_QUALITY_BLUE: sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_BLUE_AMOUNT, val); break;
|
||||
case AUCTION_QUALITY_PURPLE:sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_PURPLE_AMOUNT, val); break;
|
||||
case AUCTION_QUALITY_ORANGE:sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_ORANGE_AMOUNT, val); break;
|
||||
case AUCTION_QUALITY_PURPLE: sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_PURPLE_AMOUNT, val); break;
|
||||
case AUCTION_QUALITY_ORANGE: sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_ORANGE_AMOUNT, val); break;
|
||||
default: sAuctionBotConfig.setConfig(CONFIG_UINT32_AHBOT_ITEM_YELLOW_AMOUNT, val); break;
|
||||
}
|
||||
|
||||
|
|
@ -1556,10 +1556,10 @@ void AuctionBotSeller::addNewAuctions(AHB_Seller_Config& config)
|
|||
// If there is large amount of items missed we can use boost value to get fast filled AH
|
||||
if (config.LastMissedItem > sAuctionBotConfig.GetItemPerCycleBoost())
|
||||
{
|
||||
items=sAuctionBotConfig.GetItemPerCycleBoost();
|
||||
items = sAuctionBotConfig.GetItemPerCycleBoost();
|
||||
BASIC_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Boost value used to fill AH! (if this happens often adjust both ItemsPerCycle in ahbot.conf)");
|
||||
}
|
||||
else items=sAuctionBotConfig.GetItemPerCycleNormal();
|
||||
else items = sAuctionBotConfig.GetItemPerCycleNormal();
|
||||
|
||||
uint32 houseid;
|
||||
switch (config.GetHouseType())
|
||||
|
|
@ -1574,18 +1574,18 @@ void AuctionBotSeller::addNewAuctions(AHB_Seller_Config& config)
|
|||
AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(config.GetHouseType());
|
||||
|
||||
RandomArray randArray;
|
||||
std::vector<std::vector<uint32> > ItemsAdded(MAX_AUCTION_QUALITY,std::vector<uint32> (MAX_ITEM_CLASS));
|
||||
std::vector<std::vector<uint32> > ItemsAdded(MAX_AUCTION_QUALITY, std::vector<uint32> (MAX_ITEM_CLASS));
|
||||
// Main loop
|
||||
// getRandomArray will give what categories of items should be added (return true if there is at least 1 items missed)
|
||||
while (getRandomArray(config,randArray, ItemsAdded) && (items>0))
|
||||
while (getRandomArray(config, randArray, ItemsAdded) && (items > 0))
|
||||
{
|
||||
--items;
|
||||
|
||||
// Select random position from missed items table
|
||||
uint32 pos = (urand(0,randArray.size()-1));
|
||||
uint32 pos = (urand(0, randArray.size() - 1));
|
||||
|
||||
// Set itemID with random item ID for selected categories and color, from m_ItemPool table
|
||||
uint32 itemID = m_ItemPool[randArray[pos].color][randArray[pos].itemclass][urand(0,m_ItemPool[randArray[pos].color][randArray[pos].itemclass].size()-1)];
|
||||
uint32 itemID = m_ItemPool[randArray[pos].color][randArray[pos].itemclass][urand(0, m_ItemPool[randArray[pos].color][randArray[pos].itemclass].size() - 1)];
|
||||
++ ItemsAdded[randArray[pos].color][randArray[pos].itemclass]; // Helper table to avoid rescan from DB in this loop. (has we add item in random orders)
|
||||
|
||||
if (!itemID)
|
||||
|
|
@ -1763,7 +1763,7 @@ void AuctionHouseBot::Update()
|
|||
return;
|
||||
|
||||
// scan all possible update cases until first success
|
||||
for (uint32 count = 0; count < 2*MAX_AUCTION_HOUSE_TYPE; ++count)
|
||||
for (uint32 count = 0; count < 2 * MAX_AUCTION_HOUSE_TYPE; ++count)
|
||||
{
|
||||
bool successStep = false;
|
||||
|
||||
|
|
@ -1779,7 +1779,7 @@ void AuctionHouseBot::Update()
|
|||
}
|
||||
|
||||
++m_OperationSelector;
|
||||
if (m_OperationSelector >= 2*MAX_AUCTION_HOUSE_TYPE)
|
||||
if (m_OperationSelector >= 2 * MAX_AUCTION_HOUSE_TYPE)
|
||||
m_OperationSelector = 0;
|
||||
|
||||
// one success update per call
|
||||
|
|
|
|||
|
|
@ -116,8 +116,8 @@ class AuctionBotConfig
|
|||
|
||||
uint32 getConfig(AuctionBotConfigUInt32Values index) const { return m_configUint32Values[index]; }
|
||||
bool getConfig(AuctionBotConfigBoolValues index) const { return m_configBoolValues[index]; }
|
||||
void setConfig(AuctionBotConfigBoolValues index, bool value) { m_configBoolValues[index]=value; }
|
||||
void setConfig(AuctionBotConfigUInt32Values index, uint32 value) { m_configUint32Values[index]=value; }
|
||||
void setConfig(AuctionBotConfigBoolValues index, bool value) { m_configBoolValues[index] = value; }
|
||||
void setConfig(AuctionBotConfigUInt32Values index, uint32 value) { m_configUint32Values[index] = value; }
|
||||
|
||||
uint32 getConfigItemAmountRatio(AuctionHouseType houseType) const;
|
||||
bool getConfigBuyerEnabled(AuctionHouseType houseType) const;
|
||||
|
|
@ -160,8 +160,8 @@ class AuctionBotAgent
|
|||
AuctionBotAgent() {}
|
||||
virtual ~AuctionBotAgent() {}
|
||||
public:
|
||||
virtual bool Initialize() =0;
|
||||
virtual bool Update(AuctionHouseType houseType) =0;
|
||||
virtual bool Initialize() = 0;
|
||||
virtual bool Update(AuctionHouseType houseType) = 0;
|
||||
};
|
||||
|
||||
struct AuctionHouseBotStatusInfoPerType
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ void WorldSession::SendAuctionCommandResult(AuctionEntry* auc, AuctionAction Act
|
|||
data << uint32(invError);
|
||||
break;
|
||||
case AUCTION_ERR_HIGHER_BID:
|
||||
data << ObjectGuid(HIGHGUID_PLAYER,auc->bidder);// new bidder guid
|
||||
data << ObjectGuid(HIGHGUID_PLAYER, auc->bidder); // new bidder guid
|
||||
data << uint32(auc->bid); // new bid
|
||||
data << uint32(auc->GetAuctionOutBid()); // new AuctionOutBid?
|
||||
break;
|
||||
|
|
@ -98,7 +98,7 @@ void WorldSession::SendAuctionCommandResult(AuctionEntry* auc, AuctionAction Act
|
|||
// this function sends notification, if bidder is online
|
||||
void WorldSession::SendAuctionBidderNotification(AuctionEntry* auction)
|
||||
{
|
||||
WorldPacket data(SMSG_AUCTION_BIDDER_NOTIFICATION, (8*4));
|
||||
WorldPacket data(SMSG_AUCTION_BIDDER_NOTIFICATION, (8 * 4));
|
||||
data << uint32(auction->GetHouseId());
|
||||
data << uint32(auction->Id);
|
||||
data << ObjectGuid(HIGHGUID_PLAYER, auction->bidder);
|
||||
|
|
@ -115,7 +115,7 @@ void WorldSession::SendAuctionBidderNotification(AuctionEntry* auction)
|
|||
// this void causes on client to display: "Your auction sold"
|
||||
void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
|
||||
{
|
||||
WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (7*4));
|
||||
WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (7 * 4));
|
||||
data << uint32(auction->Id);
|
||||
data << uint32(auction->bid); // if 0, client shows ERR_AUCTION_EXPIRED_S, else ERR_AUCTION_SOLD_S (works only when guid==0)
|
||||
data << uint32(auction->GetAuctionOutBid()); // AuctionOutBid?
|
||||
|
|
@ -140,7 +140,7 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
|
|||
// shows ERR_AUCTION_REMOVED_S
|
||||
void WorldSession::SendAuctionRemovedNotification(AuctionEntry* auction)
|
||||
{
|
||||
WorldPacket data(SMSG_AUCTION_REMOVED_NOTIFICATION, (3*4));
|
||||
WorldPacket data(SMSG_AUCTION_REMOVED_NOTIFICATION, (3 * 4));
|
||||
data << uint32(auction->Id);
|
||||
data << uint32(auction->itemTemplate);
|
||||
data << uint32(auction->itemRandomPropertyId);
|
||||
|
|
@ -207,7 +207,7 @@ AuctionHouseEntry const* WorldSession::GetCheckedAuctionHouseForAuctioneer(Objec
|
|||
{
|
||||
// command case will return only if player have real access to command
|
||||
// using special access modes (1,-1) done at mode set in command, so not need recheck
|
||||
if (GetPlayer()->GetAuctionAccessMode()==0 && !ChatHandler(GetPlayer()).FindCommand("auction"))
|
||||
if (GetPlayer()->GetAuctionAccessMode() == 0 && !ChatHandler(GetPlayer()).FindCommand("auction"))
|
||||
{
|
||||
DEBUG_LOG("%s attempt open auction in cheating way.", guid.GetString().c_str());
|
||||
return NULL;
|
||||
|
|
@ -340,7 +340,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recv_data)
|
|||
|
||||
if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
||||
sLog.outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
||||
GetPlayerName(), GetAccountId(), it->GetProto()->Name1, it->GetEntry(), it->GetCount());
|
||||
}
|
||||
|
||||
|
|
@ -553,7 +553,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket& recv_data)
|
|||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4));
|
||||
WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4 + 4 + 4));
|
||||
Player* pl = GetPlayer();
|
||||
data << uint32(0); // add 0 as count
|
||||
uint32 count = 0;
|
||||
|
|
@ -600,7 +600,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket& recv_data)
|
|||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
|
||||
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4 + 4 + 4));
|
||||
data << uint32(0); // amount place holder
|
||||
|
||||
uint32 count = 0;
|
||||
|
|
@ -675,7 +675,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket& recv_data)
|
|||
//DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
|
||||
// auctioneerGuid.GetString().c_str(), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
|
||||
|
||||
WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4+4+4));
|
||||
WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4 + 4));
|
||||
uint32 count = 0;
|
||||
uint32 totalcount = 0;
|
||||
data << uint32(0);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction)
|
|||
|
||||
uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(ownerGuid);
|
||||
|
||||
sLog.outCommand(bidder_accId,"GM %s (Account: %u) won item in auction (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)",
|
||||
sLog.outCommand(bidder_accId, "GM %s (Account: %u) won item in auction (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)",
|
||||
bidder_name.c_str(), bidder_accId, auction->itemTemplate, auction->itemCount, auction->bid, owner_name.c_str(), owner_accid);
|
||||
}
|
||||
}
|
||||
|
|
@ -292,7 +292,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
|||
|
||||
if (!proto)
|
||||
{
|
||||
sLog.outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template);
|
||||
sLog.outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ void AuctionHouseMgr::LoadAuctions()
|
|||
}
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
uint32 AuctionCount=fields[0].GetUInt32();
|
||||
uint32 AuctionCount = fields[0].GetUInt32();
|
||||
delete result;
|
||||
|
||||
if (!AuctionCount)
|
||||
|
|
@ -433,7 +433,7 @@ void AuctionHouseMgr::LoadAuctions()
|
|||
|
||||
// Attempt send item back to owner
|
||||
std::ostringstream msgAuctionCanceledOwner;
|
||||
msgAuctionCanceledOwner << auction->itemTemplate << ":"<< auction->itemRandomPropertyId << ":" << AUCTION_CANCELED << ":" << auction->Id << ":" << auction->itemCount;
|
||||
msgAuctionCanceledOwner << auction->itemTemplate << ":" << auction->itemRandomPropertyId << ":" << AUCTION_CANCELED << ":" << auction->Id << ":" << auction->itemCount;
|
||||
|
||||
if (auction->itemGuidLow)
|
||||
{
|
||||
|
|
@ -949,7 +949,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
|
|||
data << uint32(startbid); // Auction->startbid (not sure if useful)
|
||||
data << uint32(bid ? GetAuctionOutBid() : 0); // minimal outbid
|
||||
data << uint32(buyout); // auction->buyout
|
||||
data << uint32((expireTime-time(NULL))*IN_MILLISECONDS);// time left
|
||||
data << uint32((expireTime - time(NULL))*IN_MILLISECONDS); // time left
|
||||
data << ObjectGuid(HIGHGUID_PLAYER, bidder); // auction->bidder current
|
||||
data << uint32(bid); // current bid
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -44,22 +44,22 @@ namespace MaNGOS
|
|||
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
// we need copy va_list before use or original va_list will corrupted
|
||||
va_list ap;
|
||||
va_copy(ap,*i_args);
|
||||
va_copy(ap, *i_args);
|
||||
|
||||
char str [2048];
|
||||
vsnprintf(str,2048,text, ap);
|
||||
vsnprintf(str, 2048, text, ap);
|
||||
va_end(ap);
|
||||
|
||||
do_helper(data,&str[0]);
|
||||
do_helper(data, &str[0]);
|
||||
}
|
||||
else
|
||||
do_helper(data,text);
|
||||
do_helper(data, text);
|
||||
}
|
||||
private:
|
||||
void do_helper(WorldPacket& data, char const* text)
|
||||
|
|
@ -71,7 +71,7 @@ namespace MaNGOS
|
|||
data << ObjectGuid(targetGuid); // there 0 for BG messages
|
||||
data << uint32(0); // can be chat msg group or something
|
||||
data << ObjectGuid(targetGuid);
|
||||
data << uint32(strlen(text)+1);
|
||||
data << uint32(strlen(text) + 1);
|
||||
data << text;
|
||||
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE);
|
||||
}
|
||||
|
|
@ -89,22 +89,22 @@ namespace MaNGOS
|
|||
: i_language(language), i_textId(textId), i_source(source), i_args(args) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
// we need copy va_list before use or original va_list will corrupted
|
||||
va_list ap;
|
||||
va_copy(ap,*i_args);
|
||||
va_copy(ap, *i_args);
|
||||
|
||||
char str [2048];
|
||||
vsnprintf(str,2048,text, ap);
|
||||
vsnprintf(str, 2048, text, ap);
|
||||
va_end(ap);
|
||||
|
||||
do_helper(data,&str[0]);
|
||||
do_helper(data, &str[0]);
|
||||
}
|
||||
else
|
||||
do_helper(data,text);
|
||||
do_helper(data, text);
|
||||
}
|
||||
private:
|
||||
void do_helper(WorldPacket& data, char const* text)
|
||||
|
|
@ -114,10 +114,10 @@ namespace MaNGOS
|
|||
data << uint32(i_language);
|
||||
data << ObjectGuid(i_source->GetObjectGuid());
|
||||
data << uint32(0); // 2.1.0
|
||||
data << uint32(strlen(i_source->GetName())+1);
|
||||
data << uint32(strlen(i_source->GetName()) + 1);
|
||||
data << i_source->GetName();
|
||||
data << ObjectGuid(); // Unit Target - isn't important for bgs
|
||||
data << uint32(strlen(text)+1);
|
||||
data << uint32(strlen(text) + 1);
|
||||
data << text;
|
||||
data << uint8(0); // ChatTag - for bgs allways 0?
|
||||
}
|
||||
|
|
@ -136,12 +136,12 @@ namespace MaNGOS
|
|||
: i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
|
||||
char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1,loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
||||
char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1, loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2, loc_idx) : "";
|
||||
|
||||
char str [2048];
|
||||
snprintf(str,2048,text, arg1str, arg2str);
|
||||
snprintf(str, 2048, text, arg1str, arg2str);
|
||||
|
||||
ObjectGuid targetGuid = i_source ? i_source ->GetObjectGuid() : ObjectGuid();
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ namespace MaNGOS
|
|||
data << ObjectGuid(targetGuid); // there 0 for BG messages
|
||||
data << uint32(0); // can be chat msg group or something
|
||||
data << ObjectGuid(targetGuid);
|
||||
data << uint32(strlen(str)+1);
|
||||
data << uint32(strlen(str) + 1);
|
||||
data << str;
|
||||
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE);
|
||||
}
|
||||
|
|
@ -170,9 +170,9 @@ namespace MaNGOS
|
|||
: i_language(language), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {}
|
||||
void operator()(WorldPacket& data, int32 loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId,loc_idx);
|
||||
char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1,loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2,loc_idx) : "";
|
||||
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
||||
char const* arg1str = i_arg1 ? sObjectMgr.GetMangosString(i_arg1, loc_idx) : "";
|
||||
char const* arg2str = i_arg2 ? sObjectMgr.GetMangosString(i_arg2, loc_idx) : "";
|
||||
|
||||
char str [2048];
|
||||
snprintf(str, 2048, text, arg1str, arg2str);
|
||||
|
|
@ -181,10 +181,10 @@ namespace MaNGOS
|
|||
data << uint32(i_language);
|
||||
data << ObjectGuid(i_source->GetObjectGuid());
|
||||
data << uint32(0); // 2.1.0
|
||||
data << uint32(strlen(i_source->GetName())+1);
|
||||
data << uint32(strlen(i_source->GetName()) + 1);
|
||||
data << i_source->GetName();
|
||||
data << ObjectGuid(); // Unit Target - isn't important for bgs
|
||||
data << uint32(strlen(str)+1);
|
||||
data << uint32(strlen(str) + 1);
|
||||
data << str;
|
||||
data << uint8(0); // ChatTag - for bgs allways 0?
|
||||
}
|
||||
|
|
@ -776,7 +776,7 @@ void BattleGround::EndBattleGround(Team winner)
|
|||
if (member)
|
||||
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, member->personal_rating);
|
||||
|
||||
winner_arena_team->MemberWon(plr,loser_rating);
|
||||
winner_arena_team->MemberWon(plr, loser_rating);
|
||||
|
||||
if (member)
|
||||
{
|
||||
|
|
@ -786,7 +786,7 @@ void BattleGround::EndBattleGround(Team winner)
|
|||
}
|
||||
else
|
||||
{
|
||||
loser_arena_team->MemberLost(plr,winner_rating);
|
||||
loser_arena_team->MemberLost(plr, winner_rating);
|
||||
|
||||
// Arena lost => reset the win_rated_arena having the "no_loose" condition
|
||||
plr->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE);
|
||||
|
|
@ -795,12 +795,12 @@ void BattleGround::EndBattleGround(Team winner)
|
|||
|
||||
if (team == winner)
|
||||
{
|
||||
RewardMark(plr,ITEM_WINNER_COUNT);
|
||||
RewardMark(plr, ITEM_WINNER_COUNT);
|
||||
RewardQuestComplete(plr);
|
||||
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1);
|
||||
}
|
||||
else
|
||||
RewardMark(plr,ITEM_LOSER_COUNT);
|
||||
RewardMark(plr, ITEM_LOSER_COUNT);
|
||||
|
||||
plr->CombatStopWithPets(true);
|
||||
|
||||
|
|
@ -852,27 +852,27 @@ uint32 BattleGround::GetBattlemasterEntry() const
|
|||
}
|
||||
}
|
||||
|
||||
void BattleGround::RewardMark(Player* plr,uint32 count)
|
||||
void BattleGround::RewardMark(Player* plr, uint32 count)
|
||||
{
|
||||
switch (GetTypeID())
|
||||
{
|
||||
case BATTLEGROUND_AV:
|
||||
if (count == ITEM_WINNER_COUNT)
|
||||
RewardSpellCast(plr,SPELL_AV_MARK_WINNER);
|
||||
RewardSpellCast(plr, SPELL_AV_MARK_WINNER);
|
||||
else
|
||||
RewardSpellCast(plr,SPELL_AV_MARK_LOSER);
|
||||
RewardSpellCast(plr, SPELL_AV_MARK_LOSER);
|
||||
break;
|
||||
case BATTLEGROUND_WS:
|
||||
if (count == ITEM_WINNER_COUNT)
|
||||
RewardSpellCast(plr,SPELL_WS_MARK_WINNER);
|
||||
RewardSpellCast(plr, SPELL_WS_MARK_WINNER);
|
||||
else
|
||||
RewardSpellCast(plr,SPELL_WS_MARK_LOSER);
|
||||
RewardSpellCast(plr, SPELL_WS_MARK_LOSER);
|
||||
break;
|
||||
case BATTLEGROUND_AB:
|
||||
if (count == ITEM_WINNER_COUNT)
|
||||
RewardSpellCast(plr,SPELL_AB_MARK_WINNER);
|
||||
RewardSpellCast(plr, SPELL_AB_MARK_WINNER);
|
||||
else
|
||||
RewardSpellCast(plr,SPELL_AB_MARK_LOSER);
|
||||
RewardSpellCast(plr, SPELL_AB_MARK_LOSER);
|
||||
break;
|
||||
case BATTLEGROUND_EY: // no rewards
|
||||
default:
|
||||
|
|
@ -889,7 +889,7 @@ void BattleGround::RewardSpellCast(Player* plr, uint32 spell_id)
|
|||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog.outError("Battleground reward casting spell %u not exist.",spell_id);
|
||||
sLog.outError("Battleground reward casting spell %u not exist.", spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -908,7 +908,7 @@ void BattleGround::RewardItem(Player* plr, uint32 item_id, uint32 count)
|
|||
|
||||
if (msg == EQUIP_ERR_ITEM_NOT_FOUND)
|
||||
{
|
||||
sLog.outErrorDb("Battleground reward item (Entry %u) not exist in `item_template`.",item_id);
|
||||
sLog.outErrorDb("Battleground reward item (Entry %u) not exist in `item_template`.", item_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -917,13 +917,13 @@ void BattleGround::RewardItem(Player* plr, uint32 item_id, uint32 count)
|
|||
|
||||
if (count != 0 && !dest.empty()) // can add some
|
||||
if (Item* item = plr->StoreNewItem(dest, item_id, true, 0))
|
||||
plr->SendNewItem(item,count,true,false);
|
||||
plr->SendNewItem(item, count, true, false);
|
||||
|
||||
if (no_space_count > 0)
|
||||
SendRewardMarkByMail(plr,item_id,no_space_count);
|
||||
SendRewardMarkByMail(plr, item_id, no_space_count);
|
||||
}
|
||||
|
||||
void BattleGround::SendRewardMarkByMail(Player* plr,uint32 mark, uint32 count)
|
||||
void BattleGround::SendRewardMarkByMail(Player* plr, uint32 mark, uint32 count)
|
||||
{
|
||||
uint32 bmEntry = GetBattlemasterEntry();
|
||||
if (!bmEntry)
|
||||
|
|
@ -933,7 +933,7 @@ void BattleGround::SendRewardMarkByMail(Player* plr,uint32 mark, uint32 count)
|
|||
if (!markProto)
|
||||
return;
|
||||
|
||||
if (Item* markItem = Item::CreateItem(mark,count,plr))
|
||||
if (Item* markItem = Item::CreateItem(mark, count, plr))
|
||||
{
|
||||
// save new item before send
|
||||
markItem->SaveToDB(); // save for prevent lost at next mail load, if send fail then item will deleted
|
||||
|
|
@ -1038,7 +1038,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
|
|||
if (isArena())
|
||||
{
|
||||
plr->RemoveArenaAuras(true); // removes debuffs / dots etc., we don't want the player to die after porting out
|
||||
bgTypeId=BATTLEGROUND_AA; // set the bg type to all arenas (it will be used for queue refreshing)
|
||||
bgTypeId = BATTLEGROUND_AA; // set the bg type to all arenas (it will be used for queue refreshing)
|
||||
|
||||
// unsummon current and summon old pet if there was one and there isn't a current pet
|
||||
plr->RemovePet(PET_SAVE_NOT_IN_SLOT);
|
||||
|
|
@ -1050,7 +1050,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
|
|||
ArenaTeam* winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam* loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
if (winner_arena_team && loser_arena_team)
|
||||
loser_arena_team->MemberLost(plr,winner_arena_team->GetRating());
|
||||
loser_arena_team->MemberLost(plr, winner_arena_team->GetRating());
|
||||
}
|
||||
}
|
||||
if (SendPacket)
|
||||
|
|
@ -1203,16 +1203,16 @@ void BattleGround::AddPlayer(Player* plr)
|
|||
if (team == ALLIANCE) // gold
|
||||
{
|
||||
if (plr->GetTeam() == HORDE)
|
||||
plr->CastSpell(plr, SPELL_HORDE_GOLD_FLAG,true);
|
||||
plr->CastSpell(plr, SPELL_HORDE_GOLD_FLAG, true);
|
||||
else
|
||||
plr->CastSpell(plr, SPELL_ALLIANCE_GOLD_FLAG,true);
|
||||
plr->CastSpell(plr, SPELL_ALLIANCE_GOLD_FLAG, true);
|
||||
}
|
||||
else // green
|
||||
{
|
||||
if (plr->GetTeam() == HORDE)
|
||||
plr->CastSpell(plr, SPELL_HORDE_GREEN_FLAG,true);
|
||||
plr->CastSpell(plr, SPELL_HORDE_GREEN_FLAG, true);
|
||||
else
|
||||
plr->CastSpell(plr, SPELL_ALLIANCE_GREEN_FLAG,true);
|
||||
plr->CastSpell(plr, SPELL_ALLIANCE_GREEN_FLAG, true);
|
||||
}
|
||||
|
||||
plr->DestroyConjuredItems(true);
|
||||
|
|
@ -1393,8 +1393,8 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
|
|||
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
||||
// so we must create it specific for this instance
|
||||
GameObject* go = new GameObject;
|
||||
if (!go->Create(GetBgMap()->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(),
|
||||
PHASEMASK_NORMAL, x,y,z,o, QuaternionData(rotation0,rotation1,rotation2,rotation3)))
|
||||
if (!go->Create(GetBgMap()->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(),
|
||||
PHASEMASK_NORMAL, x, y, z, o, QuaternionData(rotation0, rotation1, rotation2, rotation3)))
|
||||
{
|
||||
sLog.outErrorDb("Gameobject template %u not found in database! BattleGround not created!", entry);
|
||||
sLog.outError("Cannot create gameobject template %u! BattleGround not created!", entry);
|
||||
|
|
@ -1834,5 +1834,5 @@ bool BattleGround::IsTeamScoreInRange(Team team, uint32 minScore, uint32 maxScor
|
|||
void BattleGround::SetBracket(PvPDifficultyEntry const* bracketEntry)
|
||||
{
|
||||
m_BracketId = bracketEntry->GetBracketId();
|
||||
SetLevelRange(bracketEntry->minLevel,bracketEntry->maxLevel);
|
||||
SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ class BattleGround
|
|||
BattleGroundBracketId GetBracketId() const { return m_BracketId; }
|
||||
// the instanceId check is also used to determine a bg-template
|
||||
// that's why the m_map hack is here..
|
||||
uint32 GetInstanceID() { return m_Map?GetBgMap()->GetInstanceId():0; }
|
||||
uint32 GetInstanceID() { return m_Map ? GetBgMap()->GetInstanceId() : 0; }
|
||||
BattleGroundStatus GetStatus() const { return m_Status; }
|
||||
uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
|
||||
uint32 GetStartTime() const { return m_StartTime; }
|
||||
|
|
@ -411,8 +411,8 @@ class BattleGround
|
|||
void CastSpellOnTeam(uint32 SpellID, Team team);
|
||||
void RewardHonorToTeam(uint32 Honor, Team team);
|
||||
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, Team team);
|
||||
void RewardMark(Player* plr,uint32 count);
|
||||
void SendRewardMarkByMail(Player* plr,uint32 mark, uint32 count);
|
||||
void RewardMark(Player* plr, uint32 count);
|
||||
void SendRewardMarkByMail(Player* plr, uint32 mark, uint32 count);
|
||||
void RewardItem(Player* plr, uint32 item_id, uint32 count);
|
||||
void RewardQuestComplete(Player* plr);
|
||||
void RewardSpellCast(Player* plr, uint32 spell_id);
|
||||
|
|
@ -633,7 +633,7 @@ inline void FillInitialWorldState(ByteBuffer& data, uint32& count, uint32 state,
|
|||
inline void FillInitialWorldState(ByteBuffer& data, uint32& count, uint32 state, bool value)
|
||||
{
|
||||
data << uint32(state);
|
||||
data << uint32(value?1:0);
|
||||
data << uint32(value ? 1 : 0);
|
||||
++count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,23 +75,23 @@ void BattleGroundAB::Update(uint32 diff)
|
|||
{
|
||||
m_NodeTimers[node] = 0;
|
||||
// Change from contested to occupied !
|
||||
uint8 teamIndex = m_Nodes[node]-1;
|
||||
uint8 teamIndex = m_Nodes[node] - 1;
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] += 2;
|
||||
// create new occupied banner
|
||||
_CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true);
|
||||
_SendNodeUpdate(node);
|
||||
_NodeOccupied(node,(teamIndex == 0) ? ALLIANCE:HORDE);
|
||||
_NodeOccupied(node, (teamIndex == 0) ? ALLIANCE : HORDE);
|
||||
// Message to chatlog
|
||||
|
||||
if (teamIndex == 0)
|
||||
{
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE,NULL,LANG_BG_ALLY,_GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_ALLY, _GetNodeNameId(node));
|
||||
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_ALLIANCE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE,NULL,LANG_BG_HORDE,_GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_HORDE, _GetNodeNameId(node));
|
||||
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_HORDE);
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ int32 BattleGroundAB::_GetNodeNameId(uint8 node)
|
|||
case BG_AB_NODE_STABLES: return LANG_BG_AB_NODE_STABLES;
|
||||
case BG_AB_NODE_BLACKSMITH: return LANG_BG_AB_NODE_BLACKSMITH;
|
||||
case BG_AB_NODE_FARM: return LANG_BG_AB_NODE_FARM;
|
||||
case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL;
|
||||
case BG_AB_NODE_LUMBER_MILL: return LANG_BG_AB_NODE_LUMBER_MILL;
|
||||
case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE;
|
||||
default:
|
||||
MANGOS_ASSERT(0);
|
||||
|
|
@ -267,12 +267,12 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data, uint32& count)
|
|||
|
||||
// Node icons
|
||||
for (uint8 node = 0; node < BG_AB_NODES_MAX; ++node)
|
||||
FillInitialWorldState(data, count, BG_AB_OP_NODEICONS[node], m_Nodes[node]==0);
|
||||
FillInitialWorldState(data, count, BG_AB_OP_NODEICONS[node], m_Nodes[node] == 0);
|
||||
|
||||
// Node occupied states
|
||||
for (uint8 node = 0; node < BG_AB_NODES_MAX; ++node)
|
||||
for (uint8 i = 1; i < BG_AB_NODES_MAX; ++i)
|
||||
FillInitialWorldState(data, count, BG_AB_OP_NODESTATES[node] + plusArray[i], m_Nodes[node]==i);
|
||||
FillInitialWorldState(data, count, BG_AB_OP_NODESTATES[node] + plusArray[i], m_Nodes[node] == i);
|
||||
|
||||
// How many bases each team owns
|
||||
uint8 ally = 0, horde = 0;
|
||||
|
|
@ -319,7 +319,7 @@ void BattleGroundAB::_SendNodeUpdate(uint8 node)
|
|||
UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_HORDE, horde);
|
||||
}
|
||||
|
||||
void BattleGroundAB::_NodeOccupied(uint8 node,Team team)
|
||||
void BattleGroundAB::_NodeOccupied(uint8 node, Team team)
|
||||
{
|
||||
uint8 capturedNodes = 0;
|
||||
for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
|
||||
|
|
@ -367,9 +367,9 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target
|
|||
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
|
||||
|
||||
if (teamIndex == 0)
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_ALLY);
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_ALLY);
|
||||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_HORDE);
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_HORDE);
|
||||
|
||||
sound = BG_AB_SOUND_NODE_CLAIMED;
|
||||
}
|
||||
|
|
@ -388,9 +388,9 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target
|
|||
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
|
||||
|
||||
if (teamIndex == BG_TEAM_ALLIANCE)
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
|
||||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
}
|
||||
// If contested, change back to occupied
|
||||
else
|
||||
|
|
@ -402,12 +402,12 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target
|
|||
_CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true);
|
||||
_SendNodeUpdate(node);
|
||||
m_NodeTimers[node] = 0;
|
||||
_NodeOccupied(node,(teamIndex == BG_TEAM_ALLIANCE) ? ALLIANCE:HORDE);
|
||||
_NodeOccupied(node, (teamIndex == BG_TEAM_ALLIANCE) ? ALLIANCE : HORDE);
|
||||
|
||||
if (teamIndex == BG_TEAM_ALLIANCE)
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
|
||||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
}
|
||||
sound = (teamIndex == BG_TEAM_ALLIANCE) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE;
|
||||
}
|
||||
|
|
@ -423,9 +423,9 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target
|
|||
m_NodeTimers[node] = BG_AB_FLAG_CAPTURING_TIME;
|
||||
|
||||
if (teamIndex == BG_TEAM_ALLIANCE)
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node));
|
||||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node));
|
||||
|
||||
sound = (teamIndex == BG_TEAM_ALLIANCE) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE;
|
||||
}
|
||||
|
|
@ -434,9 +434,9 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target
|
|||
if (m_Nodes[node] >= BG_AB_NODE_TYPE_OCCUPIED)
|
||||
{
|
||||
if (teamIndex == BG_TEAM_ALLIANCE)
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_ALLY, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_ALLY, _GetNodeNameId(node));
|
||||
else
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_HORDE, _GetNodeNameId(node));
|
||||
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_HORDE, _GetNodeNameId(node));
|
||||
}
|
||||
PlaySoundToAll(sound);
|
||||
}
|
||||
|
|
@ -446,9 +446,9 @@ bool BattleGroundAB::SetupBattleGround()
|
|||
//buffs
|
||||
for (int i = 0; i < BG_AB_NODES_MAX; ++i)
|
||||
{
|
||||
if (!AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|
||||
if (!AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY)
|
||||
)
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn buff object!");
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
|
|||
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[nodes[i]]);
|
||||
if (!entry)
|
||||
continue;
|
||||
float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y);
|
||||
float dist = (entry->x - plr_x) * (entry->x - plr_x) + (entry->y - plr_y) * (entry->y - plr_y);
|
||||
if (mindist > dist)
|
||||
{
|
||||
mindist = dist;
|
||||
|
|
@ -536,7 +536,7 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
|
|||
}
|
||||
// If not, place ghost on starting location
|
||||
if (!good_entry)
|
||||
good_entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[teamIndex+5]);
|
||||
good_entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[teamIndex + 5]);
|
||||
|
||||
return good_entry;
|
||||
}
|
||||
|
|
@ -556,7 +556,7 @@ void BattleGroundAB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
|
|||
((BattleGroundABScore*)itr->second)->BasesDefended += value;
|
||||
break;
|
||||
default:
|
||||
BattleGround::UpdatePlayerScore(Source,type,value);
|
||||
BattleGround::UpdatePlayerScore(Source, type, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class BattleGroundAB : public BattleGround
|
|||
|
||||
/* Creature spawning/despawning */
|
||||
// TODO: working, scripted peons spawning
|
||||
void _NodeOccupied(uint8 node,Team team);
|
||||
void _NodeOccupied(uint8 node, Team team);
|
||||
|
||||
int32 _GetNodeNameId(uint8 node);
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ void BattleGroundAV::UpdateScore(BattleGroundTeamIndex teamIdx, int32 points)
|
|||
{
|
||||
m_TeamScores[teamIdx] = 0;
|
||||
// other team will win:
|
||||
EndBattleGround((teamIdx == BG_TEAM_ALLIANCE)? HORDE : ALLIANCE);
|
||||
EndBattleGround((teamIdx == BG_TEAM_ALLIANCE) ? HORDE : ALLIANCE);
|
||||
}
|
||||
else if (!m_IsInformedNearLose[teamIdx] && m_TeamScores[teamIdx] < BG_AV_SCORE_NEAR_LOSE)
|
||||
{
|
||||
|
|
@ -246,7 +246,7 @@ void BattleGroundAV::Update(uint32 diff)
|
|||
{
|
||||
if (m_Mine_Owner[mine] != BG_AV_TEAM_NEUTRAL)
|
||||
{
|
||||
m_Mine_Timer[mine] -=diff;
|
||||
m_Mine_Timer[mine] -= diff;
|
||||
if (m_Mine_Timer[mine] <= 0)
|
||||
{
|
||||
UpdateScore(BattleGroundTeamIndex(m_Mine_Owner[mine]), 1);
|
||||
|
|
@ -568,7 +568,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
|
|||
{
|
||||
SendYell2ToAll(LANG_BG_AV_TOWER_DEFENDED, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0),
|
||||
GetNodeName(node),
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY:LANG_BG_HORDE);
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY : LANG_BG_HORDE);
|
||||
UpdatePlayerScore(player, SCORE_TOWERS_DEFENDED, 1);
|
||||
PlaySoundToAll(BG_AV_SOUND_BOTH_TOWER_DEFEND);
|
||||
}
|
||||
|
|
@ -576,10 +576,10 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
|
|||
{
|
||||
SendYell2ToAll(LANG_BG_AV_GRAVE_DEFENDED, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0),
|
||||
GetNodeName(node),
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY:LANG_BG_HORDE);
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY : LANG_BG_HORDE);
|
||||
UpdatePlayerScore(player, SCORE_GRAVEYARDS_DEFENDED, 1);
|
||||
// update the statistic for the defending player
|
||||
PlaySoundToAll((teamIdx == BG_TEAM_ALLIANCE)?BG_AV_SOUND_ALLIANCE_GOOD:BG_AV_SOUND_HORDE_GOOD);
|
||||
PlaySoundToAll((teamIdx == BG_TEAM_ALLIANCE) ? BG_AV_SOUND_ALLIANCE_GOOD : BG_AV_SOUND_HORDE_GOOD);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -599,14 +599,14 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, BG_AV_Nodes node)
|
|||
{
|
||||
SendYell2ToAll(LANG_BG_AV_TOWER_ASSAULTED, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0),
|
||||
GetNodeName(node),
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY:LANG_BG_HORDE);
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY : LANG_BG_HORDE);
|
||||
UpdatePlayerScore(player, SCORE_TOWERS_ASSAULTED, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendYell2ToAll(LANG_BG_AV_GRAVE_ASSAULTED, LANG_UNIVERSAL, GetSingleCreatureGuid(BG_AV_HERALD, 0),
|
||||
GetNodeName(node),
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY:LANG_BG_HORDE);
|
||||
(teamIdx == BG_TEAM_ALLIANCE) ? LANG_BG_ALLY : LANG_BG_HORDE);
|
||||
// update the statistic for the assaulting player
|
||||
UpdatePlayerScore(player, SCORE_GRAVEYARDS_ASSAULTED, 1);
|
||||
}
|
||||
|
|
@ -656,11 +656,11 @@ void BattleGroundAV::FillInitialWorldStates(WorldPacket& data, uint32& count)
|
|||
|
||||
void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||
{
|
||||
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State,m_Nodes[node].Owner)], 1);
|
||||
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State, m_Nodes[node].Owner)], 1);
|
||||
if (m_Nodes[node].PrevOwner == BG_AV_TEAM_NEUTRAL) // currently only snowfall is supported as neutral node
|
||||
UpdateWorldState(AV_SNOWFALL_N, 0);
|
||||
else
|
||||
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState,m_Nodes[node].PrevOwner)], 0);
|
||||
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState, m_Nodes[node].PrevOwner)], 0);
|
||||
}
|
||||
|
||||
void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
||||
|
|
@ -807,7 +807,7 @@ void BattleGroundAV::Reset()
|
|||
{
|
||||
m_Mine_Owner[i] = BG_AV_TEAM_NEUTRAL;
|
||||
m_Mine_PrevOwner[i] = m_Mine_Owner[i];
|
||||
m_ActiveEvents[BG_AV_MINE_BOSSES+ i] = BG_AV_TEAM_NEUTRAL;
|
||||
m_ActiveEvents[BG_AV_MINE_BOSSES + i] = BG_AV_TEAM_NEUTRAL;
|
||||
m_ActiveEvents[BG_AV_MINE_EVENT + i] = BG_AV_TEAM_NEUTRAL;
|
||||
m_Mine_Timer[i] = BG_AV_MINE_TICK_TIMER;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ enum BG_AV_Graveyards
|
|||
BG_AV_GRAVE_MAIN_HORDE = 610
|
||||
};
|
||||
|
||||
const uint32 BG_AV_GraveyardIds[9]=
|
||||
const uint32 BG_AV_GraveyardIds[9] =
|
||||
{
|
||||
BG_AV_GRAVE_STORM_AID,
|
||||
BG_AV_GRAVE_STORM_GRAVE,
|
||||
|
|
@ -227,35 +227,35 @@ const uint32 BG_AV_MineWorldStates[2][BG_AV_TEAMS_COUNT] =
|
|||
const uint32 BG_AV_NodeWorldStates[BG_AV_NODES_MAX][4] =
|
||||
{
|
||||
// Stormpike first aid station
|
||||
{1326,1325,1328,1327},
|
||||
{1326, 1325, 1328, 1327},
|
||||
// Stormpike Graveyard
|
||||
{1335,1333,1336,1334},
|
||||
{1335, 1333, 1336, 1334},
|
||||
// Stoneheart Grave
|
||||
{1304,1302,1303,1301},
|
||||
{1304, 1302, 1303, 1301},
|
||||
// Snowfall Grave
|
||||
{1343,1341,1344,1342},
|
||||
{1343, 1341, 1344, 1342},
|
||||
// Iceblood grave
|
||||
{1348,1346,1349,1347},
|
||||
{1348, 1346, 1349, 1347},
|
||||
// Frostwolf Grave
|
||||
{1339,1337,1340,1338},
|
||||
{1339, 1337, 1340, 1338},
|
||||
// Frostwolf Hut
|
||||
{1331,1329,1332,1330},
|
||||
{1331, 1329, 1332, 1330},
|
||||
// Dunbaldar South Bunker
|
||||
{1375,1361,1378,1370},
|
||||
{1375, 1361, 1378, 1370},
|
||||
// Dunbaldar North Bunker
|
||||
{1374,1362,1379,1371},
|
||||
{1374, 1362, 1379, 1371},
|
||||
// Icewing Bunker
|
||||
{1376,1363,1380,1372},
|
||||
{1376, 1363, 1380, 1372},
|
||||
// Stoneheart Bunker
|
||||
{1377,1364,1381,1373},
|
||||
{1377, 1364, 1381, 1373},
|
||||
// Iceblood Tower
|
||||
{1390,1368,1395,1385},
|
||||
{1390, 1368, 1395, 1385},
|
||||
// Tower Point
|
||||
{1389,1367,1394,1384},
|
||||
{1389, 1367, 1394, 1384},
|
||||
// Frostwolf East
|
||||
{1388,1366,1393,1383},
|
||||
{1388, 1366, 1393, 1383},
|
||||
// Frostwolf West
|
||||
{1387,1365,1392,1382},
|
||||
{1387, 1365, 1392, 1382},
|
||||
};
|
||||
|
||||
// through the armorscap-quest 4 different gravedefender exist
|
||||
|
|
@ -365,8 +365,8 @@ class BattleGroundAV : public BattleGround
|
|||
void PopulateNode(BG_AV_Nodes node);
|
||||
|
||||
uint32 GetNodeName(BG_AV_Nodes node);
|
||||
const bool IsTower(BG_AV_Nodes node) { return (node == BG_AV_NODES_ERROR)? false : m_Nodes[node].Tower; }
|
||||
const bool IsGrave(BG_AV_Nodes node) { return (node == BG_AV_NODES_ERROR)? false : !m_Nodes[node].Tower; }
|
||||
const bool IsTower(BG_AV_Nodes node) { return (node == BG_AV_NODES_ERROR) ? false : m_Nodes[node].Tower; }
|
||||
const bool IsGrave(BG_AV_Nodes node) { return (node == BG_AV_NODES_ERROR) ? false : !m_Nodes[node].Tower; }
|
||||
|
||||
/*mine*/
|
||||
void ChangeMineOwner(uint8 mine, BattleGroundAVTeamIndex teamIdx);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void BattleGroundBE::HandleKillPlayer(Player* player, Player* killer)
|
|||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
|
||||
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
|
||||
|
|
@ -104,7 +104,7 @@ void BattleGroundBE::HandleKillPlayer(Player* player, Player* killer)
|
|||
|
||||
bool BattleGroundBE::HandlePlayerUnderMap(Player* player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(),6238.930176f,262.963470f,0.889519f,player->GetOrientation(),false);
|
||||
player->TeleportTo(GetMapId(), 6238.930176f, 262.963470f, 0.889519f, player->GetOrientation(), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
|||
void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
{
|
||||
//reset current point counts
|
||||
for (uint8 i = 0; i < 2*BG_EY_NODES_MAX; ++i)
|
||||
for (uint8 i = 0; i < 2 * BG_EY_NODES_MAX; ++i)
|
||||
m_CurrentPointPlayersCount[i] = 0;
|
||||
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
|
||||
{
|
||||
|
|
@ -576,9 +576,9 @@ void BattleGroundEY::EventTeamLostPoint(Player* Source, uint32 Point)
|
|||
//buff isn't despawned
|
||||
|
||||
if (team == ALLIANCE)
|
||||
SendMessageToAll(LoosingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
|
||||
SendMessageToAll(LoosingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
|
||||
else
|
||||
SendMessageToAll(LoosingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
SendMessageToAll(LoosingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
|
||||
UpdatePointsIcons(team, Point);
|
||||
UpdatePointsCount(team);
|
||||
|
|
@ -600,9 +600,9 @@ void BattleGroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point)
|
|||
m_PointState[Point] = EY_POINT_UNDER_CONTROL;
|
||||
|
||||
if (team == ALLIANCE)
|
||||
SendMessageToAll(CapturingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
|
||||
SendMessageToAll(CapturingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
|
||||
else
|
||||
SendMessageToAll(CapturingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
SendMessageToAll(CapturingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source);
|
||||
|
||||
UpdatePointsIcons(team, Point);
|
||||
UpdatePointsCount(team);
|
||||
|
|
@ -729,19 +729,19 @@ WorldSafeLocsEntry const* BattleGroundEY::GetClosestGraveYard(Player* player)
|
|||
float plr_z = player->GetPositionZ();
|
||||
|
||||
|
||||
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
|
||||
distance = (entry->x - plr_x) * (entry->x - plr_x) + (entry->y - plr_y) * (entry->y - plr_y) + (entry->z - plr_z) * (entry->z - plr_z);
|
||||
nearestDistance = distance;
|
||||
|
||||
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
|
||||
{
|
||||
if (m_PointOwnedByTeam[i]==player->GetTeam() && m_PointState[i]==EY_POINT_UNDER_CONTROL)
|
||||
if (m_PointOwnedByTeam[i] == player->GetTeam() && m_PointState[i] == EY_POINT_UNDER_CONTROL)
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(CapturingPointTypes[i].GraveYardId);
|
||||
if (!entry)
|
||||
sLog.outError("BattleGroundEY: Not found graveyard: %u",CapturingPointTypes[i].GraveYardId);
|
||||
sLog.outError("BattleGroundEY: Not found graveyard: %u", CapturingPointTypes[i].GraveYardId);
|
||||
else
|
||||
{
|
||||
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
|
||||
distance = (entry->x - plr_x) * (entry->x - plr_x) + (entry->y - plr_y) * (entry->y - plr_y) + (entry->z - plr_z) * (entry->z - plr_z);
|
||||
if (distance < nearestDistance)
|
||||
{
|
||||
nearestDistance = distance;
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ class BattleGroundEY : public BattleGround
|
|||
uint8 m_PointState[BG_EY_NODES_MAX];
|
||||
int32 m_PointBarStatus[BG_EY_NODES_MAX];
|
||||
GuidVector m_PlayersNearPoint[BG_EY_NODES_MAX_WITH_SPEIAL];
|
||||
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];
|
||||
uint8 m_CurrentPointPlayersCount[2 * BG_EY_NODES_MAX];
|
||||
|
||||
int32 m_PointAddingTimer;
|
||||
uint32 m_HonorTics;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
|
||||
{
|
||||
sLog.outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u",bgTypeId_,_player->GetGUIDLow());
|
||||
sLog.outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data)
|
|||
}
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data)
|
|||
member->GetSession()->SendPacket(&data);
|
||||
sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
DEBUG_LOG("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName());
|
||||
DEBUG_LOG("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName());
|
||||
}
|
||||
DEBUG_LOG("Battleground: group end");
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data)
|
|||
// send status packet (in queue)
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->arenaType);
|
||||
SendPacket(&data);
|
||||
DEBUG_LOG("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
|
||||
DEBUG_LOG("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName());
|
||||
}
|
||||
sBattleGroundMgr.ScheduleQueueUpdate(0, ARENA_TYPE_NONE, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
|
@ -238,7 +238,7 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d
|
|||
if (horde_plr)
|
||||
++count2;
|
||||
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2));
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4 + 16 * count1 + 16 * count2));
|
||||
data << count1; // alliance flag holders count - obsolete, now always 0
|
||||
/*for(uint8 i = 0; i < count1; ++i)
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d
|
|||
case BATTLEGROUND_AV:
|
||||
{
|
||||
//for other BG types - send default
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4));
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4));
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
SendPacket(&data);
|
||||
|
|
@ -386,7 +386,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recv_data)
|
|||
}
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
|
|
@ -555,7 +555,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recv_data*/)
|
|||
continue;
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
if (!bracketEntry)
|
||||
continue;
|
||||
|
||||
|
|
@ -661,7 +661,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
|
|||
|
||||
BattleGroundTypeId bgTypeId = bg->GetTypeID();
|
||||
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, arenatype);
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
|
|
@ -740,7 +740,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
|
|||
{
|
||||
DEBUG_LOG("Battleground: arena join as group start");
|
||||
if (isRated)
|
||||
DEBUG_LOG("Battleground: arena team id %u, leader %s queued with rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),arenaRating,arenatype);
|
||||
DEBUG_LOG("Battleground: arena team id %u, leader %s queued with rating %u for type %u", _player->GetArenaTeamId(arenaslot), _player->GetName(), arenaRating, arenatype);
|
||||
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
|
||||
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
|
|
@ -783,7 +783,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
|
|||
// send status packet (in queue)
|
||||
sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype);
|
||||
SendPacket(&data);
|
||||
DEBUG_LOG("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName());
|
||||
DEBUG_LOG("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName());
|
||||
}
|
||||
sBattleGroundMgr.ScheduleQueueUpdate(arenaRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,5 +77,5 @@ void BattleGroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
|
|||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
BattleGround::UpdatePlayerScore(Source,type,value);
|
||||
BattleGround::UpdatePlayerScore(Source, type, value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ BattleGroundQueue::~BattleGroundQueue()
|
|||
{
|
||||
for (uint32 j = 0; j < BG_QUEUE_GROUP_TYPES_COUNT; ++j)
|
||||
{
|
||||
for (GroupsQueueType::iterator itr = m_QueuedGroups[i][j].begin(); itr!= m_QueuedGroups[i][j].end(); ++itr)
|
||||
for (GroupsQueueType::iterator itr = m_QueuedGroups[i][j].begin(); itr != m_QueuedGroups[i][j].end(); ++itr)
|
||||
delete(*itr);
|
||||
m_QueuedGroups[i][j].clear();
|
||||
}
|
||||
|
|
@ -232,7 +232,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
|
|||
qHorde += (*itr)->Players.size();
|
||||
|
||||
// Show queue status to player only (when joining queue)
|
||||
if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN)==1)
|
||||
if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN) == 1)
|
||||
{
|
||||
ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level,
|
||||
qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0);
|
||||
|
|
@ -805,7 +805,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
|
|||
return;
|
||||
}
|
||||
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(),bracket_id);
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(), bracket_id);
|
||||
if (!bracketEntry)
|
||||
{
|
||||
sLog.outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
|
||||
|
|
@ -1098,7 +1098,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[m_BgQueueTypeId];
|
||||
if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime))
|
||||
{
|
||||
DEBUG_LOG("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
|
||||
DEBUG_LOG("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.", plr->GetGUIDLow(), m_BgInstanceGUID);
|
||||
|
||||
plr->RemoveBattleGroundQueueId(m_BgQueueTypeId);
|
||||
bgQueue.RemovePlayer(m_PlayerGuid, true);
|
||||
|
|
@ -1130,7 +1130,7 @@ BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
|
|||
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
m_BattleGrounds[i].clear();
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER);
|
||||
m_Testing=false;
|
||||
m_Testing = false;
|
||||
}
|
||||
|
||||
BattleGroundMgr::~BattleGroundMgr()
|
||||
|
|
@ -1221,13 +1221,13 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket* data, BattleGro
|
|||
|
||||
if (StatusID == 0 || !bg)
|
||||
{
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS, 4+8);
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS, 4 + 8);
|
||||
*data << uint32(QueueSlot); // queue id (0...1)
|
||||
*data << uint64(0);
|
||||
return;
|
||||
}
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS, (4+8+1+1+4+1+4+4+4));
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS, (4 + 8 + 1 + 1 + 4 + 1 + 4 + 4 + 4));
|
||||
*data << uint32(QueueSlot); // queue id (0...1) - player can be in 2 queues in time
|
||||
// uint64 in client
|
||||
*data << uint64(uint64(arenatype) | (uint64(0x0D) << 8) | (uint64(bg->GetTypeID()) << 16) | (uint64(0x1F90) << 48));
|
||||
|
|
@ -1266,7 +1266,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
|||
{
|
||||
uint8 type = (bg->isArena() ? 1 : 0);
|
||||
// last check on 3.0.3
|
||||
data->Initialize(MSG_PVP_LOG_DATA, (1+1+4+40*bg->GetPlayerScoresSize()));
|
||||
data->Initialize(MSG_PVP_LOG_DATA, (1 + 1 + 4 + 40 * bg->GetPlayerScoresSize()));
|
||||
*data << uint8(type); // type (battleground=0/arena=1)
|
||||
|
||||
if (type) // arena
|
||||
|
|
@ -1382,7 +1382,7 @@ void BattleGroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Grou
|
|||
|
||||
void BattleGroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value)
|
||||
{
|
||||
data->Initialize(SMSG_UPDATE_WORLD_STATE, 4+4);
|
||||
data->Initialize(SMSG_UPDATE_WORLD_STATE, 4 + 4);
|
||||
*data << uint32(field);
|
||||
*data << uint32(value);
|
||||
}
|
||||
|
|
@ -1486,7 +1486,7 @@ BattleGround* BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId
|
|||
if (bg_template->isArena())
|
||||
{
|
||||
BattleGroundTypeId arenas[] = { BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL/*, BATTLEGROUND_DS, BATTLEGROUND_RV*/ };
|
||||
bgTypeId = arenas[urand(0, countof(arenas)-1)];
|
||||
bgTypeId = arenas[urand(0, countof(arenas) - 1)];
|
||||
bg_template = GetBattleGroundTemplate(bgTypeId);
|
||||
if (!bg_template)
|
||||
{
|
||||
|
|
@ -1830,7 +1830,7 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket* data, ObjectGuid
|
|||
if (BattleGround* bgTemplate = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId))
|
||||
{
|
||||
// expected bracket entry
|
||||
if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(),plr->getLevel()))
|
||||
if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(), plr->getLevel()))
|
||||
{
|
||||
BattleGroundBracketId bracketId = bracketEntry->GetBracketId();
|
||||
ClientBattleGroundIdSet const& ids = m_ClientBattleGroundIds[bgTypeId][bracketId];
|
||||
|
|
@ -1853,7 +1853,7 @@ void BattleGroundMgr::SendToBattleGround(Player* pl, uint32 instanceId, BattleGr
|
|||
uint32 mapid = bg->GetMapId();
|
||||
float x, y, z, O;
|
||||
Team team = pl->GetBGTeam();
|
||||
if (team==0)
|
||||
if (team == 0)
|
||||
team = pl->GetTeam();
|
||||
bg->GetTeamStartLoc(team, x, y, z, O);
|
||||
|
||||
|
|
@ -1862,7 +1862,7 @@ void BattleGroundMgr::SendToBattleGround(Player* pl, uint32 instanceId, BattleGr
|
|||
}
|
||||
else
|
||||
{
|
||||
sLog.outError("player %u trying to port to nonexistent bg instance %u",pl->GetGUIDLow(), instanceId);
|
||||
sLog.outError("player %u trying to port to nonexistent bg instance %u", pl->GetGUIDLow(), instanceId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void BattleGroundNA::HandleKillPlayer(Player* player, Player* killer)
|
|||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
|
||||
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
|
||||
|
|
@ -105,7 +105,7 @@ void BattleGroundNA::HandleKillPlayer(Player* player, Player* killer)
|
|||
|
||||
bool BattleGroundNA::HandlePlayerUnderMap(Player* player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(),4055.504395f,2919.660645f,13.611241f,player->GetOrientation(),false);
|
||||
player->TeleportTo(GetMapId(), 4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation(), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,5 +77,5 @@ void BattleGroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
|
|||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
BattleGround::UpdatePlayerScore(Source,type,value);
|
||||
BattleGround::UpdatePlayerScore(Source, type, value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void BattleGroundRL::HandleKillPlayer(Player* player, Player* killer)
|
|||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
|
||||
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
|
||||
|
|
@ -104,7 +104,7 @@ void BattleGroundRL::HandleKillPlayer(Player* player, Player* killer)
|
|||
|
||||
bool BattleGroundRL::HandlePlayerUnderMap(Player* player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(),1285.810547f,1667.896851f,39.957642f,player->GetOrientation(),false);
|
||||
player->TeleportTo(GetMapId(), 1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation(), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,5 +76,5 @@ void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
|
|||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
BattleGround::UpdatePlayerScore(Source,type,value);
|
||||
BattleGround::UpdatePlayerScore(Source, type, value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class BattleGroundWS : public BattleGround
|
|||
virtual void Reset();
|
||||
void EndBattleGround(Team winner);
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
uint32 GetRemainingTimeInMinutes() { return m_EndTimer ? (m_EndTimer-1) / (MINUTE * IN_MILLISECONDS) + 1 : 0; }
|
||||
uint32 GetRemainingTimeInMinutes() { return m_EndTimer ? (m_EndTimer - 1) / (MINUTE * IN_MILLISECONDS) + 1 : 0; }
|
||||
|
||||
void UpdateFlagState(Team team, uint32 value);
|
||||
void UpdateTeamScore(Team team);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
|
|||
|
||||
time_t cur_time = time(NULL);
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 4+4*0+4+4*0+4+4);
|
||||
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 4 + 4 * 0 + 4 + 4 * 0 + 4 + 4);
|
||||
|
||||
// TODO: calendar invite event output
|
||||
data << (uint32) 0; // invite node count
|
||||
|
|
@ -59,7 +59,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
|
|||
}
|
||||
}
|
||||
}
|
||||
data.put<uint32>(p_counter,counter);
|
||||
data.put<uint32>(p_counter, counter);
|
||||
|
||||
data << (uint32) 1135753200; // base date (28.12.2005 12:00)
|
||||
data << (uint32) 0; // raid reset count
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ void Camera::UpdateVisibilityOf(WorldObject* target)
|
|||
template<class T>
|
||||
void Camera::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& vis)
|
||||
{
|
||||
m_owner.template UpdateVisibilityOf<T>(m_source, target,data,vis);
|
||||
m_owner.template UpdateVisibilityOf<T>(m_source, target, data, vis);
|
||||
}
|
||||
|
||||
template void Camera::UpdateVisibilityOf(Player* , UpdateData& , std::set<WorldObject*>&);
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ struct MANGOS_DLL_DECL Cell
|
|||
|
||||
void Compute(uint32& x, uint32& y) const
|
||||
{
|
||||
x = data.Part.grid_x*MAX_NUMBER_OF_CELLS + data.Part.cell_x;
|
||||
y = data.Part.grid_y*MAX_NUMBER_OF_CELLS + data.Part.cell_y;
|
||||
x = data.Part.grid_x * MAX_NUMBER_OF_CELLS + data.Part.cell_x;
|
||||
y = data.Part.grid_y * MAX_NUMBER_OF_CELLS + data.Part.cell_y;
|
||||
}
|
||||
|
||||
bool DiffCell(const Cell& cell) const
|
||||
|
|
@ -75,13 +75,13 @@ struct MANGOS_DLL_DECL Cell
|
|||
bool NoCreate() const { return data.Part.nocreate; }
|
||||
void SetNoCreate() { data.Part.nocreate = 1; }
|
||||
|
||||
GridPair gridPair() const { return GridPair(GridX(),GridY()); }
|
||||
GridPair gridPair() const { return GridPair(GridX(), GridY()); }
|
||||
|
||||
CellPair cellPair() const
|
||||
{
|
||||
return CellPair(
|
||||
data.Part.grid_x*MAX_NUMBER_OF_CELLS+data.Part.cell_x,
|
||||
data.Part.grid_y*MAX_NUMBER_OF_CELLS+data.Part.cell_y);
|
||||
data.Part.grid_x * MAX_NUMBER_OF_CELLS + data.Part.cell_x,
|
||||
data.Part.grid_y * MAX_NUMBER_OF_CELLS + data.Part.cell_y);
|
||||
}
|
||||
|
||||
Cell& operator=(const Cell& cell)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER>& v
|
|||
{
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
{
|
||||
CellPair cell_pair(x,y);
|
||||
CellPair cell_pair(x, y);
|
||||
//lets skip standing cell since we already visited it
|
||||
if (cell_pair != standing_cell)
|
||||
{
|
||||
|
|
@ -133,7 +133,7 @@ Cell::VisitCircle(TypeContainerVisitor<T, CONTAINER>& visitor, Map& m, const Cel
|
|||
{
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
{
|
||||
CellPair cell_pair(x,y);
|
||||
CellPair cell_pair(x, y);
|
||||
Cell r_zone(cell_pair);
|
||||
r_zone.data.Part.nocreate = data.Part.nocreate;
|
||||
m.Visit(r_zone, visitor);
|
||||
|
|
@ -225,7 +225,7 @@ inline void Cell::VisitWorldObjects(float x, float y, Map* map, T& visitor, floa
|
|||
if (dont_load)
|
||||
cell.SetNoCreate();
|
||||
TypeContainerVisitor<T, WorldTypeMapContainer > gnotifier(visitor);
|
||||
cell.Visit(p ,gnotifier, *map, x, y, radius);
|
||||
cell.Visit(p , gnotifier, *map, x, y, radius);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ void Channel::List(Player* player)
|
|||
}
|
||||
else
|
||||
{
|
||||
WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+m_players.size()*(8+1));
|
||||
WorldPacket data(SMSG_CHANNEL_LIST, 1 + (GetName().size() + 1) + 1 + 4 + m_players.size() * (8 + 1));
|
||||
data << uint8(1); // channel type?
|
||||
data << GetName(); // channel name
|
||||
data << uint8(GetFlags()); // channel flags?
|
||||
|
|
@ -461,7 +461,7 @@ void Channel::List(Player* player)
|
|||
}
|
||||
}
|
||||
|
||||
data.put<uint32>(pos,count);
|
||||
data.put<uint32>(pos, count);
|
||||
|
||||
SendToOne(&data, p);
|
||||
}
|
||||
|
|
@ -565,7 +565,7 @@ void Channel::Say(ObjectGuid p, const char* what, uint32 lang)
|
|||
{
|
||||
uint32 messageLength = strlen(what) + 1;
|
||||
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 1+4+8+4+m_name.size()+1+8+4+messageLength+1);
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 1 + 4 + 8 + 4 + m_name.size() + 1 + 8 + 4 + messageLength + 1);
|
||||
data << uint8(CHAT_MSG_CHANNEL);
|
||||
data << uint32(lang);
|
||||
data << ObjectGuid(p); // 2.1.0
|
||||
|
|
@ -686,7 +686,7 @@ void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/)
|
|||
// done
|
||||
void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type)
|
||||
{
|
||||
data->Initialize(SMSG_CHANNEL_NOTIFY, 1+m_name.size()+1);
|
||||
data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + m_name.size() + 1);
|
||||
*data << uint8(notify_type);
|
||||
*data << m_name;
|
||||
}
|
||||
|
|
@ -948,9 +948,9 @@ void Channel::JoinNotify(ObjectGuid guid)
|
|||
WorldPacket data;
|
||||
|
||||
if (IsConstant())
|
||||
data.Initialize(SMSG_USERLIST_ADD, 8+1+1+4+GetName().size()+1);
|
||||
data.Initialize(SMSG_USERLIST_ADD, 8 + 1 + 1 + 4 + GetName().size() + 1);
|
||||
else
|
||||
data.Initialize(SMSG_USERLIST_UPDATE, 8+1+1+4+GetName().size()+1);
|
||||
data.Initialize(SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size() + 1);
|
||||
|
||||
data << ObjectGuid(guid);
|
||||
data << uint8(GetPlayerFlags(guid));
|
||||
|
|
@ -962,7 +962,7 @@ void Channel::JoinNotify(ObjectGuid guid)
|
|||
|
||||
void Channel::LeaveNotify(ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(SMSG_USERLIST_REMOVE, 8+1+4+GetName().size()+1);
|
||||
WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size() + 1);
|
||||
data << ObjectGuid(guid);
|
||||
data << uint8(GetFlags());
|
||||
data << uint32(GetNumPlayers());
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ void WorldSession::HandleGetChannelMemberCountOpcode(WorldPacket& recvPacket)
|
|||
{
|
||||
if (Channel* chn = cMgr->GetChannel(channelname, _player))
|
||||
{
|
||||
WorldPacket data(SMSG_CHANNEL_MEMBER_COUNT, chn->GetName().size()+1+1+4);
|
||||
WorldPacket data(SMSG_CHANNEL_MEMBER_COUNT, chn->GetName().size() + 1 + 1 + 4);
|
||||
data << chn->GetName();
|
||||
data << uint8(chn->GetFlags());
|
||||
data << uint32(chn->GetNumPlayers());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ ChannelMgr* channelMgr(Team team)
|
|||
|
||||
ChannelMgr::~ChannelMgr()
|
||||
{
|
||||
for (ChannelMap::iterator itr = channels.begin(); itr!=channels.end(); ++itr)
|
||||
for (ChannelMap::iterator itr = channels.begin(); itr != channels.end(); ++itr)
|
||||
delete itr->second;
|
||||
|
||||
channels.clear();
|
||||
|
|
@ -47,12 +47,12 @@ ChannelMgr::~ChannelMgr()
|
|||
Channel* ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name,wname);
|
||||
Utf8toWStr(name, wname);
|
||||
wstrToLower(wname);
|
||||
|
||||
if (channels.find(wname) == channels.end())
|
||||
{
|
||||
Channel* nchan = new Channel(name,channel_id);
|
||||
Channel* nchan = new Channel(name, channel_id);
|
||||
channels[wname] = nchan;
|
||||
return nchan;
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ Channel* ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
|
|||
Channel* ChannelMgr::GetChannel(std::string name, Player* p, bool pkt)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name,wname);
|
||||
Utf8toWStr(name, wname);
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
|
|
@ -73,7 +73,7 @@ Channel* ChannelMgr::GetChannel(std::string name, Player* p, bool pkt)
|
|||
if (pkt)
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeNotOnPacket(&data,name);
|
||||
MakeNotOnPacket(&data, name);
|
||||
p->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ Channel* ChannelMgr::GetChannel(std::string name, Player* p, bool pkt)
|
|||
void ChannelMgr::LeftChannel(std::string name)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name,wname);
|
||||
Utf8toWStr(name, wname);
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
|
|
@ -105,6 +105,6 @@ void ChannelMgr::LeftChannel(std::string name)
|
|||
|
||||
void ChannelMgr::MakeNotOnPacket(WorldPacket* data, std::string name)
|
||||
{
|
||||
data->Initialize(SMSG_CHANNEL_NOTIFY, (1+10)); // we guess size
|
||||
data->Initialize(SMSG_CHANNEL_NOTIFY, (1 + 10)); // we guess size
|
||||
(*data) << (uint8)CHAT_NOT_MEMBER_NOTICE << name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
class ChannelMgr
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::wstring,Channel*> ChannelMap;
|
||||
typedef std::map<std::wstring, Channel*> ChannelMap;
|
||||
ChannelMgr() {}
|
||||
~ChannelMgr();
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,9 @@ bool LoginQueryHolder::Initialize()
|
|||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4,itemcount5,itemcount6 FROM character_queststatus WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS,"SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADWEEKLYQUESTSTATUS,"SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMONTHLYQUESTSTATUS,"SELECT quest FROM character_queststatus_monthly WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS, "SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADWEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMONTHLYQUESTSTATUS, "SELECT quest FROM character_queststatus_monthly WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADITEMLOOT, "SELECT guid,itemid,amount,suffix,property FROM item_loot WHERE owner_guid = '%u'", m_guid.GetCounter());
|
||||
|
|
@ -95,7 +95,7 @@ bool LoginQueryHolder::Initialize()
|
|||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGUILD, "SELECT guildid,rank FROM guild_member WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADARENAINFO, "SELECT arenateamid, played_week, played_season, wons_season, personal_rating FROM arena_team_member WHERE guid='%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS,"SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = '%u' ORDER BY setindex", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBGDATA, "SELECT instance_id, team, join_x, join_y, join_z, join_o, join_map, taxi_start, taxi_end, mount_spell FROM character_battleground_data WHERE guid = '%u'", m_guid.GetCounter());
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, "SELECT type, time, data FROM character_account_data WHERE guid='%u'", m_guid.GetCounter());
|
||||
|
|
@ -297,7 +297,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
|
|||
QueryResult* resultacct = LoginDatabase.PQuery("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '%u'", GetAccountId());
|
||||
if (resultacct)
|
||||
{
|
||||
Field* fields=resultacct->Fetch();
|
||||
Field* fields = resultacct->Fetch();
|
||||
uint32 acctcharcount = fields[0].GetUInt32();
|
||||
delete resultacct;
|
||||
|
||||
|
|
@ -349,7 +349,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
|
|||
bool have_same_race = false;
|
||||
|
||||
// if 0 then allowed creating without any characters
|
||||
bool have_req_level_for_heroic = (req_level_for_heroic==0);
|
||||
bool have_req_level_for_heroic = (req_level_for_heroic == 0);
|
||||
|
||||
if (!AllowTwoSideAccounts || skipCinematics == CINEMATICS_SKIP_SAME_RACE || class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
|
|
@ -357,7 +357,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
|
|||
GetAccountId(), (skipCinematics == CINEMATICS_SKIP_SAME_RACE || class_ == CLASS_DEATH_KNIGHT) ? "" : "LIMIT 1");
|
||||
if (result2)
|
||||
{
|
||||
Team team_= Player::TeamForRace(race_);
|
||||
Team team_ = Player::TeamForRace(race_);
|
||||
|
||||
Field* field = result2->Fetch();
|
||||
uint8 acc_race = field[1].GetUInt32();
|
||||
|
|
@ -601,7 +601,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
SendPacket(&data);
|
||||
|
||||
// load player specific part before send times
|
||||
LoadAccountData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA),PER_CHARACTER_CACHE_MASK);
|
||||
LoadAccountData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA), PER_CHARACTER_CACHE_MASK);
|
||||
SendAccountDataTimes(PER_CHARACTER_CACHE_MASK);
|
||||
|
||||
data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0
|
||||
|
|
@ -614,16 +614,16 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
data.Initialize(SMSG_MOTD, 50); // new in 2.0.1
|
||||
data << (uint32)0;
|
||||
|
||||
uint32 linecount=0;
|
||||
uint32 linecount = 0;
|
||||
std::string str_motd = sWorld.GetMotd();
|
||||
std::string::size_type pos, nextpos;
|
||||
|
||||
pos = 0;
|
||||
while ((nextpos= str_motd.find('@',pos)) != std::string::npos)
|
||||
while ((nextpos = str_motd.find('@', pos)) != std::string::npos)
|
||||
{
|
||||
if (nextpos != pos)
|
||||
{
|
||||
data << str_motd.substr(pos, nextpos-pos);
|
||||
data << str_motd.substr(pos, nextpos - pos);
|
||||
++linecount;
|
||||
}
|
||||
pos = nextpos + 1;
|
||||
|
|
@ -662,7 +662,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
Guild* guild = sGuildMgr.GetGuildById(pCurrChar->GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
data.Initialize(SMSG_GUILD_EVENT, (1+1+guild->GetMOTD().size()+1));
|
||||
data.Initialize(SMSG_GUILD_EVENT, (1 + 1 + guild->GetMOTD().size() + 1));
|
||||
data << uint8(GE_MOTD);
|
||||
data << uint8(1);
|
||||
data << guild->GetMOTD();
|
||||
|
|
@ -676,12 +676,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
else
|
||||
{
|
||||
// remove wrong guild data
|
||||
sLog.outError("Player %s (GUID: %u) marked as member of nonexistent guild (id: %u), removing guild membership for player.",pCurrChar->GetName(),pCurrChar->GetGUIDLow(),pCurrChar->GetGuildId());
|
||||
sLog.outError("Player %s (GUID: %u) marked as member of nonexistent guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId());
|
||||
pCurrChar->SetInGuild(0);
|
||||
}
|
||||
}
|
||||
|
||||
data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4);
|
||||
data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4 + 4);
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
SendPacket(&data);
|
||||
|
|
@ -759,7 +759,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
pCurrChar->LoadPet();
|
||||
|
||||
// Set FFA PvP for non GM in non-rest mode
|
||||
if (sWorld.IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_RESTING))
|
||||
if (sWorld.IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
|
||||
pCurrChar->SetFFAPvP(true);
|
||||
|
||||
if (pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
|
|
@ -774,7 +774,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
|
||||
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_TALENTS))
|
||||
{
|
||||
pCurrChar->resetTalents(true,true);
|
||||
pCurrChar->resetTalents(true, true);
|
||||
pCurrChar->SendTalentsInfoData(false); // original talents send already in to SendInitialPacketsBeforeAddToMap, resend reset state
|
||||
SendNotification(LANG_RESET_TALENTS); // we can use SMSG_TALENTS_INVOLUNTARILY_RESET here
|
||||
}
|
||||
|
|
@ -784,7 +784,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
|||
|
||||
// show time before shutdown if shutdown planned.
|
||||
if (sWorld.IsShutdowning())
|
||||
sWorld.ShutdownMsg(true,pCurrChar);
|
||||
sWorld.ShutdownMsg(true, pCurrChar);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_BOOL_ALL_TAXI_PATHS))
|
||||
pCurrChar->SetTaxiCheater(true);
|
||||
|
|
@ -907,7 +907,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
|||
return;
|
||||
}
|
||||
|
||||
uint8 res = ObjectMgr::CheckPlayerName(newname,true);
|
||||
uint8 res = ObjectMgr::CheckPlayerName(newname, true);
|
||||
if (res != CHAR_NAME_SUCCESS)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||
|
|
@ -967,7 +967,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult* result, uin
|
|||
|
||||
sLog.outChar("Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s", session->GetAccountId(), session->GetRemoteAddress().c_str(), oldname.c_str(), guidLow, newname.c_str());
|
||||
|
||||
WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newname.size()+1));
|
||||
WorldPacket data(SMSG_CHAR_RENAME, 1 + 8 + (newname.size() + 1));
|
||||
data << uint8(RESPONSE_SUCCESS);
|
||||
data << guid;
|
||||
data << newname;
|
||||
|
|
@ -984,7 +984,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
std::string name;
|
||||
if (!sObjectMgr.GetPlayerNameByGUID(guid, name))
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(1);
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -994,7 +994,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
std::wstring wname;
|
||||
if (!Utf8toWStr(name, wname))
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(1);
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -1003,7 +1003,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (!isCyrillicCharacter(wname[0])) // name already stored as only single alphabet using
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(1);
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -1017,7 +1017,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (name2 != name) // character have different name
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(1);
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -1029,7 +1029,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
recv_data >> declinedname.name[i];
|
||||
if (!normalizePlayerName(declinedname.name[i]))
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(1);
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -1039,7 +1039,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (!ObjectMgr::CheckDeclinedNames(GetMainPartOfName(wname, 0), declinedname))
|
||||
{
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(1);
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -1055,7 +1055,7 @@ void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
|||
guid.GetCounter(), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
|
||||
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4 + 8);
|
||||
data << uint32(0); // OK
|
||||
data << ObjectGuid(guid);
|
||||
SendPacket(&data);
|
||||
|
|
@ -1180,7 +1180,7 @@ void WorldSession::HandleCharCustomizeOpcode(WorldPacket& recv_data)
|
|||
return;
|
||||
}
|
||||
|
||||
uint8 res = ObjectMgr::CheckPlayerName(newname,true);
|
||||
uint8 res = ObjectMgr::CheckPlayerName(newname, true);
|
||||
if (res != CHAR_NAME_SUCCESS)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||
|
|
@ -1216,7 +1216,7 @@ void WorldSession::HandleCharCustomizeOpcode(WorldPacket& recv_data)
|
|||
std::string IP_str = GetRemoteAddress();
|
||||
sLog.outChar("Account: %d (IP: %s), Character %s customized to: %s", GetAccountId(), IP_str.c_str(), guid.GetString().c_str(), newname.c_str());
|
||||
|
||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1+8+(newname.size()+1)+6);
|
||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1 + 8 + (newname.size() + 1) + 6);
|
||||
data << uint8(RESPONSE_SUCCESS);
|
||||
data << ObjectGuid(guid);
|
||||
data << newname;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
static ChatCommand achievementCriteriaCommandTable[] =
|
||||
{
|
||||
{ "add", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementCriteriaAddCommand, "", NULL },
|
||||
{ "remove", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementCriteriaRemoveCommand,"", NULL },
|
||||
{ "remove", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAchievementCriteriaRemoveCommand, "", NULL },
|
||||
{ NULL, 0, true, NULL, "", NULL }
|
||||
};
|
||||
|
||||
|
|
@ -111,9 +111,9 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "white", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>, "", NULL },
|
||||
{ "green", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>, "", NULL },
|
||||
{ "blue", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>, "", NULL },
|
||||
{ "purple", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>,"", NULL },
|
||||
{ "orange", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>,"", NULL },
|
||||
{ "yellow", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>,"", NULL },
|
||||
{ "purple", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>, "", NULL },
|
||||
{ "orange", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>, "", NULL },
|
||||
{ "yellow", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>, "", NULL },
|
||||
{ "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotItemsAmountCommand, "", NULL },
|
||||
{ NULL, 0, true, NULL, "", NULL }
|
||||
};
|
||||
|
|
@ -190,15 +190,15 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
static ChatCommand characterDeletedCommandTable[] =
|
||||
{
|
||||
{ "delete", SEC_CONSOLE, true, &ChatHandler::HandleCharacterDeletedDeleteCommand, "", NULL },
|
||||
{ "list", SEC_ADMINISTRATOR, true, &ChatHandler::HandleCharacterDeletedListCommand,"", NULL },
|
||||
{ "restore", SEC_ADMINISTRATOR, true, &ChatHandler::HandleCharacterDeletedRestoreCommand,"", NULL },
|
||||
{ "list", SEC_ADMINISTRATOR, true, &ChatHandler::HandleCharacterDeletedListCommand, "", NULL },
|
||||
{ "restore", SEC_ADMINISTRATOR, true, &ChatHandler::HandleCharacterDeletedRestoreCommand, "", NULL },
|
||||
{ "old", SEC_CONSOLE, true, &ChatHandler::HandleCharacterDeletedOldCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand characterCommandTable[] =
|
||||
{
|
||||
{ "achievements", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterAchievementsCommand,"",NULL },
|
||||
{ "achievements", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterAchievementsCommand, "", NULL },
|
||||
{ "customize", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterCustomizeCommand, "", NULL },
|
||||
{ "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable},
|
||||
{ "erase", SEC_CONSOLE, true, &ChatHandler::HandleCharacterEraseCommand, "", NULL },
|
||||
|
|
@ -340,7 +340,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "all_default", SEC_MODERATOR, false, &ChatHandler::HandleLearnAllDefaultCommand, "", NULL },
|
||||
{ "all_lang", SEC_MODERATOR, false, &ChatHandler::HandleLearnAllLangCommand, "", NULL },
|
||||
{ "all_myclass", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyClassCommand, "", NULL },
|
||||
{ "all_mypettalents",SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyPetTalentsCommand,"", NULL },
|
||||
{ "all_mypettalents", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyPetTalentsCommand, "", NULL },
|
||||
{ "all_myspells", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMySpellsCommand, "", NULL },
|
||||
{ "all_mytalents", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyTalentsCommand, "", NULL },
|
||||
{ "all_recipes", SEC_GAMEMASTER, false, &ChatHandler::HandleLearnAllRecipesCommand, "", NULL },
|
||||
|
|
@ -500,7 +500,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
static ChatCommand reloadCommandTable[] =
|
||||
{
|
||||
{ "all", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllCommand, "", NULL },
|
||||
{ "all_achievement",SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllAchievementCommand,"", NULL },
|
||||
{ "all_achievement", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllAchievementCommand, "", NULL },
|
||||
{ "all_area", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllAreaCommand, "", NULL },
|
||||
{ "all_eventai", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllEventAICommand, "", NULL },
|
||||
{ "all_gossips", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllGossipsCommand, "", NULL },
|
||||
|
|
@ -514,9 +514,9 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
|
||||
{ "config", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadConfigCommand, "", NULL },
|
||||
|
||||
{ "achievement_criteria_requirement",SEC_ADMINISTRATOR,true,&ChatHandler::HandleReloadAchievementCriteriaRequirementCommand,"",NULL },
|
||||
{ "achievement_criteria_requirement", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAchievementCriteriaRequirementCommand, "", NULL },
|
||||
{ "achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAchievementRewardCommand, "", NULL },
|
||||
{ "areatrigger_involvedrelation",SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestAreaTriggersCommand, "", NULL },
|
||||
{ "areatrigger_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestAreaTriggersCommand, "", NULL },
|
||||
{ "areatrigger_tavern", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAreaTriggerTavernCommand, "", NULL },
|
||||
{ "areatrigger_teleport", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAreaTriggerTeleportCommand, "", NULL },
|
||||
{ "command", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommandCommand, "", NULL },
|
||||
|
|
@ -525,7 +525,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAISummonsCommand, "", NULL },
|
||||
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAITextsCommand, "", NULL },
|
||||
{ "creature_battleground", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadBattleEventCommand, "", NULL },
|
||||
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand,"",NULL },
|
||||
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
|
||||
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
|
||||
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL },
|
||||
{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL },
|
||||
|
|
@ -546,7 +546,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
|
||||
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
|
||||
{ "item_required_target", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemRequiredTragetCommand, "", NULL },
|
||||
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesAchievementRewardCommand,"", NULL },
|
||||
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesAchievementRewardCommand, "", NULL },
|
||||
{ "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
|
||||
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
|
||||
{ "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGossipMenuOptionCommand, "", NULL },
|
||||
|
|
@ -565,9 +565,9 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL },
|
||||
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
|
||||
{ "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
|
||||
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand,"",NULL},
|
||||
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
|
||||
{ "points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPointsOfInterestCommand, "", NULL },
|
||||
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand,"", NULL },
|
||||
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand, "", NULL },
|
||||
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestEndScriptsCommand, "", NULL },
|
||||
{ "quest_poi", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestPOICommand, "", NULL },
|
||||
{ "quest_start_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestStartScriptsCommand, "", NULL },
|
||||
|
|
@ -575,7 +575,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesReferenceCommand, "", NULL },
|
||||
{ "reserved_name", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadReservedNameCommand, "", NULL },
|
||||
{ "reputation_reward_rate", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadReputationRewardRateCommand, "", NULL },
|
||||
{ "reputation_spillover_template",SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadReputationSpilloverTemplateCommand,"", NULL },
|
||||
{ "reputation_spillover_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadReputationSpilloverTemplateCommand, "", NULL },
|
||||
{ "skill_discovery_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillDiscoveryTemplateCommand, "", NULL },
|
||||
{ "skill_extra_item_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillExtraItemTemplateCommand, "", NULL },
|
||||
{ "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillFishingBaseLevelCommand, "", NULL },
|
||||
|
|
@ -631,28 +631,28 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
|
||||
static ChatCommand serverIdleRestartCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerIdleRestartCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand serverIdleShutdownCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerIdleShutDownCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand serverRestartCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerRestartCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand serverShutdownCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCancelCommand, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerShutDownCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
|
@ -818,7 +818,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
|||
{ "cometome", SEC_ADMINISTRATOR, false, &ChatHandler::HandleComeToMeCommand, "", NULL },
|
||||
{ "damage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDamageCommand, "", NULL },
|
||||
{ "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
|
||||
{ "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
||||
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
||||
{ "repairitems", SEC_GAMEMASTER, true, &ChatHandler::HandleRepairitemsCommand, "", NULL },
|
||||
{ "stable", SEC_ADMINISTRATOR, false, &ChatHandler::HandleStableCommand, "", NULL },
|
||||
{ "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCommand, "", NULL },
|
||||
|
|
@ -909,7 +909,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
|
|||
return true;
|
||||
}
|
||||
|
||||
return HasLowerSecurityAccount(target_session,target_account,strong);
|
||||
return HasLowerSecurityAccount(target_session, target_account, strong);
|
||||
}
|
||||
|
||||
bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_account, bool strong)
|
||||
|
|
@ -1033,7 +1033,7 @@ void ChatHandler::CheckIntegrity(ChatCommand* table, ChatCommand* parentCommand)
|
|||
sLog.outError("Subcommand '%s' of command '%s' have less access level (%u) that parent (%u)",
|
||||
command->Name, parentCommand->Name, command->SecurityLevel, parentCommand->SecurityLevel);
|
||||
|
||||
if (!parentCommand && strlen(command->Name)==0)
|
||||
if (!parentCommand && strlen(command->Name) == 0)
|
||||
sLog.outError("Subcommand '' at top level");
|
||||
|
||||
if (command->ChildCommands)
|
||||
|
|
@ -1048,7 +1048,7 @@ void ChatHandler::CheckIntegrity(ChatCommand* table, ChatCommand* parentCommand)
|
|||
command->Name);
|
||||
}
|
||||
|
||||
if (parentCommand && strlen(command->Name)==0)
|
||||
if (parentCommand && strlen(command->Name) == 0)
|
||||
sLog.outError("Subcommand '' of command '%s' have subcommands", parentCommand->Name);
|
||||
|
||||
CheckIntegrity(command->ChildCommands, command);
|
||||
|
|
@ -1129,7 +1129,7 @@ ChatCommandSearchResult ChatHandler::FindCommand(ChatCommand* table, char const*
|
|||
if (exactlyName)
|
||||
{
|
||||
size_t len = strlen(table[i].Name);
|
||||
if (strncmp(table[i].Name, cmd.c_str(), len+1) != 0)
|
||||
if (strncmp(table[i].Name, cmd.c_str(), len + 1) != 0)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
|
@ -1153,7 +1153,7 @@ ChatCommandSearchResult ChatHandler::FindCommand(ChatCommand* table, char const*
|
|||
*parentCommand = parentSubcommand ? parentSubcommand : &table[i];
|
||||
|
||||
// Name == "" is special case: restore original command text for next level "" (where parentSubcommand==NULL)
|
||||
if (strlen(command->Name)==0 && !parentSubcommand)
|
||||
if (strlen(command->Name) == 0 && !parentSubcommand)
|
||||
text = oldchildtext;
|
||||
|
||||
return CHAT_COMMAND_OK;
|
||||
|
|
@ -1247,7 +1247,7 @@ void ChatHandler::ExecuteCommand(const char* text)
|
|||
else
|
||||
SendSysMessage(LANG_CMD_SYNTAX);
|
||||
|
||||
if (ChatCommand* showCommand = (strlen(command->Name)==0 && parentCommand ? parentCommand : command))
|
||||
if (ChatCommand* showCommand = (strlen(command->Name) == 0 && parentCommand ? parentCommand : command))
|
||||
if (ChatCommand* childs = showCommand->ChildCommands)
|
||||
ShowHelpForSubCommands(childs, showCommand->Name);
|
||||
|
||||
|
|
@ -1258,7 +1258,7 @@ void ChatHandler::ExecuteCommand(const char* text)
|
|||
case CHAT_COMMAND_UNKNOWN_SUBCOMMAND:
|
||||
{
|
||||
SendSysMessage(LANG_NO_SUBCMD);
|
||||
ShowHelpForCommand(command->ChildCommands,text);
|
||||
ShowHelpForCommand(command->ChildCommands, text);
|
||||
SetSentErrorMessage(true);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1298,7 +1298,7 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* commandTable, const char
|
|||
{
|
||||
if (command->SecurityLevel != security)
|
||||
DETAIL_LOG("Table `command` overwrite for command '%s' default security (%u) by %u",
|
||||
fullcommand.c_str(),command->SecurityLevel,security);
|
||||
fullcommand.c_str(), command->SecurityLevel, security);
|
||||
|
||||
command->SecurityLevel = security;
|
||||
command->Help = help;
|
||||
|
|
@ -1489,7 +1489,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
{
|
||||
if (commandChar == *validSequenceIterator)
|
||||
{
|
||||
if (validSequenceIterator == validSequence+4)
|
||||
if (validSequenceIterator == validSequence + 4)
|
||||
validSequenceIterator = validSequence;
|
||||
else
|
||||
++validSequenceIterator;
|
||||
|
|
@ -1508,7 +1508,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
|
||||
ItemPrototype const* linkedItem = NULL;
|
||||
Quest const* linkedQuest = NULL;
|
||||
SpellEntry const* linkedSpell= NULL;
|
||||
SpellEntry const* linkedSpell = NULL;
|
||||
AchievementEntry const* linkedAchievement = NULL;
|
||||
ItemRandomPropertiesEntry const* itemProperty = NULL;
|
||||
ItemRandomSuffixEntry const* itemSuffix = NULL;
|
||||
|
|
@ -1551,7 +1551,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
{
|
||||
if (commandChar == *validSequenceIterator)
|
||||
{
|
||||
if (validSequenceIterator == validSequence+4)
|
||||
if (validSequenceIterator == validSequence + 4)
|
||||
validSequenceIterator = validSequence;
|
||||
else
|
||||
++validSequenceIterator;
|
||||
|
|
@ -1574,7 +1574,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
case 'c':
|
||||
color = 0;
|
||||
// validate color, expect 8 hex chars
|
||||
for (int i=0; i<8; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
char c;
|
||||
reader >> c;
|
||||
|
|
@ -1586,14 +1586,14 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
|
||||
color <<= 4;
|
||||
// check for hex char
|
||||
if (c >= '0' && c <='9')
|
||||
if (c >= '0' && c <= '9')
|
||||
{
|
||||
color |= c-'0';
|
||||
color |= c - '0';
|
||||
continue;
|
||||
}
|
||||
if (c >= 'a' && c <='f')
|
||||
if (c >= 'a' && c <= 'f')
|
||||
{
|
||||
color |= 10+c-'a';
|
||||
color |= 10 + c - 'a';
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG("ChatHandler::isValidChatMessage got non hex char '%c' while reading color", c);
|
||||
|
|
@ -1635,16 +1635,16 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
int32 propertyId = 0;
|
||||
bool negativeNumber = false;
|
||||
char c;
|
||||
for (uint8 i=0; i < randomPropertyPosition; ++i)
|
||||
for (uint8 i = 0; i < randomPropertyPosition; ++i)
|
||||
{
|
||||
propertyId = 0;
|
||||
negativeNumber = false;
|
||||
while ((c = reader.get()) != ':')
|
||||
{
|
||||
if (c >='0' && c<='9')
|
||||
if (c >= '0' && c <= '9')
|
||||
{
|
||||
propertyId*=10;
|
||||
propertyId += c-'0';
|
||||
propertyId *= 10;
|
||||
propertyId += c - '0';
|
||||
}
|
||||
else if (c == '-')
|
||||
negativeNumber = true;
|
||||
|
|
@ -1669,7 +1669,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
}
|
||||
|
||||
// ignore other integers
|
||||
while ((c >= '0' && c <= '9') || c== ':')
|
||||
while ((c >= '0' && c <= '9') || c == ':')
|
||||
{
|
||||
reader.ignore(1);
|
||||
c = reader.peek();
|
||||
|
|
@ -1678,14 +1678,14 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
else if (strcmp(buffer, "quest") == 0)
|
||||
{
|
||||
// no color check for questlinks, each client will adapt it anyway
|
||||
uint32 questid= 0;
|
||||
uint32 questid = 0;
|
||||
// read questid
|
||||
char c = reader.peek();
|
||||
while (c >='0' && c<='9')
|
||||
while (c >= '0' && c <= '9')
|
||||
{
|
||||
reader.ignore(1);
|
||||
questid *= 10;
|
||||
questid += c-'0';
|
||||
questid += c - '0';
|
||||
c = reader.peek();
|
||||
}
|
||||
|
||||
|
|
@ -1697,7 +1697,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (c !=':')
|
||||
if (c != ':')
|
||||
{
|
||||
DEBUG_LOG("ChatHandler::isValidChatMessage Invalid quest link structure");
|
||||
return false;
|
||||
|
|
@ -1707,11 +1707,11 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
c = reader.peek();
|
||||
// level
|
||||
uint32 questlevel = 0;
|
||||
while (c >='0' && c<='9')
|
||||
while (c >= '0' && c <= '9')
|
||||
{
|
||||
reader.ignore(1);
|
||||
questlevel *= 10;
|
||||
questlevel += c-'0';
|
||||
questlevel += c - '0';
|
||||
c = reader.peek();
|
||||
}
|
||||
|
||||
|
|
@ -1721,7 +1721,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (c !='|')
|
||||
if (c != '|')
|
||||
{
|
||||
DEBUG_LOG("ChatHandler::isValidChatMessage Invalid quest link structure");
|
||||
return false;
|
||||
|
|
@ -1743,7 +1743,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
|
||||
char c = reader.peek();
|
||||
// base64 encoded stuff
|
||||
while (c !='|' && c!='\0')
|
||||
while (c != '|' && c != '\0')
|
||||
{
|
||||
reader.ignore(1);
|
||||
c = reader.peek();
|
||||
|
|
@ -1770,7 +1770,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
|
||||
char c = reader.peek();
|
||||
// skillpoints? whatever, drop it
|
||||
while (c !='|' && c!='\0')
|
||||
while (c != '|' && c != '\0')
|
||||
{
|
||||
reader.ignore(1);
|
||||
c = reader.peek();
|
||||
|
|
@ -1784,11 +1784,11 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
uint32 spellid = 0;
|
||||
// read spell entry
|
||||
char c = reader.peek();
|
||||
while (c >='0' && c<='9')
|
||||
while (c >= '0' && c <= '9')
|
||||
{
|
||||
reader.ignore(1);
|
||||
spellid *= 10;
|
||||
spellid += c-'0';
|
||||
spellid += c - '0';
|
||||
c = reader.peek();
|
||||
}
|
||||
linkedSpell = sSpellStore.LookupEntry(spellid);
|
||||
|
|
@ -1803,11 +1803,11 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
uint32 spellid = 0;
|
||||
// read spell entry
|
||||
char c = reader.peek();
|
||||
while (c >='0' && c<='9')
|
||||
while (c >= '0' && c <= '9')
|
||||
{
|
||||
reader.ignore(1);
|
||||
spellid *= 10;
|
||||
spellid += c-'0';
|
||||
spellid += c - '0';
|
||||
c = reader.peek();
|
||||
}
|
||||
linkedSpell = sSpellStore.LookupEntry(spellid);
|
||||
|
|
@ -1831,7 +1831,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
|
||||
char c = reader.peek();
|
||||
// skip progress
|
||||
while (c !='|' && c != '\0')
|
||||
while (c != '|' && c != '\0')
|
||||
{
|
||||
reader.ignore(1);
|
||||
c = reader.peek();
|
||||
|
|
@ -1849,10 +1849,10 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
|
||||
uint32 glyphId = 0;
|
||||
char c = reader.peek();
|
||||
while (c>='0' && c <='9')
|
||||
while (c >= '0' && c <= '9')
|
||||
{
|
||||
glyphId *= 10;
|
||||
glyphId += c-'0';
|
||||
glyphId += c - '0';
|
||||
reader.ignore(1);
|
||||
c = reader.peek();
|
||||
}
|
||||
|
|
@ -1911,20 +1911,20 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
return false;
|
||||
}
|
||||
|
||||
for (uint8 i=0; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
uint32 skillLineNameLength = strlen(skillLine->name[i]);
|
||||
if (skillLineNameLength > 0 && strncmp(skillLine->name[i], buffer, skillLineNameLength) == 0)
|
||||
{
|
||||
// found the prefix, remove it to perform spellname validation below
|
||||
// -2 = strlen(": ")
|
||||
uint32 spellNameLength = strlen(buffer)-skillLineNameLength-2;
|
||||
memmove(buffer, buffer+skillLineNameLength+2, spellNameLength+1);
|
||||
uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2;
|
||||
memmove(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
bool foundName = false;
|
||||
for (uint8 i=0; i<MAX_LOCALE; ++i)
|
||||
for (uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
if (*linkedSpell->SpellName[i] && strcmp(linkedSpell->SpellName[i], buffer) == 0)
|
||||
{
|
||||
|
|
@ -1948,7 +1948,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
}
|
||||
|
||||
bool foundName = false;
|
||||
for (uint8 i=0; i < ql->Title.size(); ++i)
|
||||
for (uint8 i = 0; i < ql->Title.size(); ++i)
|
||||
{
|
||||
if (ql->Title[i] == buffer)
|
||||
{
|
||||
|
|
@ -1965,7 +1965,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
}
|
||||
else if (linkedItem)
|
||||
{
|
||||
char* const* suffix = itemSuffix?itemSuffix->nameSuffix:(itemProperty?itemProperty->nameSuffix:NULL);
|
||||
char* const* suffix = itemSuffix ? itemSuffix->nameSuffix : (itemProperty ? itemProperty->nameSuffix : NULL);
|
||||
|
||||
std::string expectedName = std::string(linkedItem->Name1);
|
||||
if (suffix)
|
||||
|
|
@ -1979,7 +1979,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
ItemLocale const* il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
|
||||
|
||||
bool foundName = false;
|
||||
for (uint8 i=LOCALE_koKR; i<MAX_LOCALE; ++i)
|
||||
for (uint8 i = LOCALE_koKR; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
int8 dbIndex = sObjectMgr.GetIndexForLocale(LocaleConstant(i));
|
||||
if (dbIndex == -1 || il == NULL || (size_t)dbIndex >= il->Name.size())
|
||||
|
|
@ -2008,7 +2008,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
|
|||
else if (linkedAchievement)
|
||||
{
|
||||
bool foundName = false;
|
||||
for (uint8 i=0; i<MAX_LOCALE; ++i)
|
||||
for (uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
if (*linkedAchievement->name[i] && strcmp(linkedAchievement->name[i], buffer) == 0)
|
||||
{
|
||||
|
|
@ -2420,7 +2420,7 @@ char* ChatHandler::ExtractQuotedArg(char** args, bool asis /*= false*/)
|
|||
if (guard == '[')
|
||||
guard = ']';
|
||||
|
||||
char* tail = (*args)+1; // start scan after first quote symbol
|
||||
char* tail = (*args) + 1; // start scan after first quote symbol
|
||||
char* head = asis ? *args : tail; // start arg
|
||||
|
||||
while (*tail && *tail != guard)
|
||||
|
|
@ -2442,7 +2442,7 @@ char* ChatHandler::ExtractQuotedArg(char** args, bool asis /*= false*/)
|
|||
*tail = '\0';
|
||||
}
|
||||
|
||||
*args = tail+1;
|
||||
*args = tail + 1;
|
||||
|
||||
SkipWhiteSpaces(args);
|
||||
|
||||
|
|
@ -2525,7 +2525,7 @@ char* ChatHandler::ExtractLinkArg(char** args, char const* const* linkTypes /*=
|
|||
|
||||
// |color|Hlinktype:key:data...|h[name]|h|r
|
||||
|
||||
char* tail = (*args)+1; // skip |
|
||||
char* tail = (*args) + 1; // skip |
|
||||
|
||||
if (*tail != 'H') // skip color part, some links can not have color part
|
||||
{
|
||||
|
|
@ -2595,8 +2595,8 @@ char* ChatHandler::ExtractLinkArg(char** args, char const* const* linkTypes /*=
|
|||
|
||||
// |h[name]|h|r or :something...|h[name]|h|r
|
||||
|
||||
char* somethingStart = tail+1;
|
||||
char* somethingEnd = tail+1; // will updated later if need
|
||||
char* somethingStart = tail + 1;
|
||||
char* somethingEnd = tail + 1; // will updated later if need
|
||||
|
||||
if (*tail == ':' && somethingPair) // optional data extraction
|
||||
{
|
||||
|
|
@ -2618,7 +2618,7 @@ char* ChatHandler::ExtractLinkArg(char** args, char const* const* linkTypes /*=
|
|||
|
||||
// |h[name]|h|r or :something2...|h[name]|h|r
|
||||
|
||||
while (*tail && (*tail != '|' || *(tail+1) != 'h')) // skip ... part if exist
|
||||
while (*tail && (*tail != '|' || *(tail + 1) != 'h')) // skip ... part if exist
|
||||
++tail;
|
||||
|
||||
if (!*tail)
|
||||
|
|
@ -2632,19 +2632,19 @@ char* ChatHandler::ExtractLinkArg(char** args, char const* const* linkTypes /*=
|
|||
if (!*tail || *tail != '[')
|
||||
return NULL;
|
||||
|
||||
while (*tail && (*tail != ']' || *(tail+1) != '|')) // skip name part
|
||||
while (*tail && (*tail != ']' || *(tail + 1) != '|')) // skip name part
|
||||
++tail;
|
||||
|
||||
tail += 2; // skip ]|
|
||||
|
||||
// h|r
|
||||
if (!*tail || *tail != 'h' || *(tail+1) != '|')
|
||||
if (!*tail || *tail != 'h' || *(tail + 1) != '|')
|
||||
return NULL;
|
||||
|
||||
tail += 2; // skip h|
|
||||
|
||||
// r
|
||||
if (!*tail || *tail != 'r' || (*(tail+1) && !isWhiteSpace(*(tail+1))))
|
||||
if (!*tail || *tail != 'r' || (*(tail + 1) && !isWhiteSpace(*(tail + 1))))
|
||||
return NULL;
|
||||
|
||||
++tail; // skip r
|
||||
|
|
@ -2814,7 +2814,7 @@ bool ChatHandler::ExtractUint32KeyFromLink(char** text, char const* linkType, ui
|
|||
return ExtractUInt32(&arg, value);
|
||||
}
|
||||
|
||||
GameObject* ChatHandler::GetGameObjectWithGuid(uint32 lowguid,uint32 entry)
|
||||
GameObject* ChatHandler::GetGameObjectWithGuid(uint32 lowguid, uint32 entry)
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
|
|
@ -2826,7 +2826,7 @@ GameObject* ChatHandler::GetGameObjectWithGuid(uint32 lowguid,uint32 entry)
|
|||
|
||||
enum SpellLinkType
|
||||
{
|
||||
SPELL_LINK_RAW =-1, // non-link case
|
||||
SPELL_LINK_RAW = -1, // non-link case
|
||||
SPELL_LINK_SPELL = 0,
|
||||
SPELL_LINK_TALENT = 1,
|
||||
SPELL_LINK_ENCHANT = 2,
|
||||
|
|
@ -2903,7 +2903,7 @@ uint32 ChatHandler::ExtractSpellIdFromLink(char** text)
|
|||
GameTele const* ChatHandler::ExtractGameTeleFromLink(char** text)
|
||||
{
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
char* cId = ExtractKeyFromLink(text,"Htele");
|
||||
char* cId = ExtractKeyFromLink(text, "Htele");
|
||||
if (!cId)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -2917,7 +2917,7 @@ GameTele const* ChatHandler::ExtractGameTeleFromLink(char** text)
|
|||
|
||||
enum GuidLinkType
|
||||
{
|
||||
GUID_LINK_RAW =-1, // non-link case
|
||||
GUID_LINK_RAW = -1, // non-link case
|
||||
GUID_LINK_PLAYER = 0,
|
||||
GUID_LINK_CREATURE = 1,
|
||||
GUID_LINK_GAMEOBJECT = 2,
|
||||
|
|
@ -2986,7 +2986,7 @@ ObjectGuid ChatHandler::ExtractGuidFromLink(char** text)
|
|||
|
||||
enum LocationLinkType
|
||||
{
|
||||
LOCATION_LINK_RAW =-1, // non-link case
|
||||
LOCATION_LINK_RAW = -1, // non-link case
|
||||
LOCATION_LINK_PLAYER = 0,
|
||||
LOCATION_LINK_TELE = 1,
|
||||
LOCATION_LINK_TAXINODE = 2,
|
||||
|
|
@ -2995,7 +2995,7 @@ enum LocationLinkType
|
|||
LOCATION_LINK_CREATURE_ENTRY = 5,
|
||||
LOCATION_LINK_GAMEOBJECT_ENTRY = 6,
|
||||
LOCATION_LINK_AREATRIGGER = 7,
|
||||
LOCATION_LINK_AREATRIGGER_TARGET= 8,
|
||||
LOCATION_LINK_AREATRIGGER_TARGET = 8,
|
||||
};
|
||||
|
||||
static char const* const locationKeys[] =
|
||||
|
|
@ -3253,7 +3253,7 @@ std::string ChatHandler::ExtractPlayerNameFromLink(char** text)
|
|||
*
|
||||
* @return true if extraction successful
|
||||
*/
|
||||
bool ChatHandler::ExtractPlayerTarget(char** args, Player** player /*= NULL*/, ObjectGuid* player_guid /*= NULL*/,std::string* player_name /*= NULL*/)
|
||||
bool ChatHandler::ExtractPlayerTarget(char** args, Player** player /*= NULL*/, ObjectGuid* player_guid /*= NULL*/, std::string* player_name /*= NULL*/)
|
||||
{
|
||||
if (*args &&** args)
|
||||
{
|
||||
|
|
@ -3340,7 +3340,7 @@ uint32 ChatHandler::ExtractAccountId(char** args, std::string* accountName /*= N
|
|||
{
|
||||
if (!sAccountMgr.GetName(account_id, account_name))
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_str);
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_str);
|
||||
SetSentErrorMessage(true);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3350,7 +3350,7 @@ uint32 ChatHandler::ExtractAccountId(char** args, std::string* accountName /*= N
|
|||
account_name = account_str;
|
||||
if (!AccountMgr::normalizeString(account_name))
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3358,7 +3358,7 @@ uint32 ChatHandler::ExtractAccountId(char** args, std::string* accountName /*= N
|
|||
account_id = sAccountMgr.GetId(account_name);
|
||||
if (!account_id)
|
||||
{
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str());
|
||||
PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3382,16 +3382,16 @@ struct RaceMaskName
|
|||
static RaceMaskName const raceMaskNames[] =
|
||||
{
|
||||
// races
|
||||
{ "human", (1<<(RACE_HUMAN-1)) },
|
||||
{ "orc", (1<<(RACE_ORC-1)) },
|
||||
{ "dwarf", (1<<(RACE_DWARF-1)) },
|
||||
{ "nightelf", (1<<(RACE_NIGHTELF-1))},
|
||||
{ "undead", (1<<(RACE_UNDEAD-1)) },
|
||||
{ "tauren", (1<<(RACE_TAUREN-1)) },
|
||||
{ "gnome", (1<<(RACE_GNOME-1)) },
|
||||
{ "troll", (1<<(RACE_TROLL-1)) },
|
||||
{ "bloodelf", (1<<(RACE_BLOODELF-1))},
|
||||
{ "draenei", (1<<(RACE_DRAENEI-1)) },
|
||||
{ "human", (1 << (RACE_HUMAN - 1)) },
|
||||
{ "orc", (1 << (RACE_ORC - 1)) },
|
||||
{ "dwarf", (1 << (RACE_DWARF - 1)) },
|
||||
{ "nightelf", (1 << (RACE_NIGHTELF - 1))},
|
||||
{ "undead", (1 << (RACE_UNDEAD - 1)) },
|
||||
{ "tauren", (1 << (RACE_TAUREN - 1)) },
|
||||
{ "gnome", (1 << (RACE_GNOME - 1)) },
|
||||
{ "troll", (1 << (RACE_TROLL - 1)) },
|
||||
{ "bloodelf", (1 << (RACE_BLOODELF - 1))},
|
||||
{ "draenei", (1 << (RACE_DRAENEI - 1)) },
|
||||
|
||||
// masks
|
||||
{ "alliance", RACEMASK_ALLIANCE },
|
||||
|
|
@ -3578,13 +3578,13 @@ void ChatHandler::LogCommand(char const* fullcmd)
|
|||
{
|
||||
Player* p = m_session->GetPlayer();
|
||||
ObjectGuid sel_guid = p->GetSelectionGuid();
|
||||
sLog.outCommand(GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected: %s]",
|
||||
sLog.outCommand(GetAccountId(), "Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected: %s]",
|
||||
fullcmd, p->GetName(), GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(),
|
||||
sel_guid.GetString().c_str());
|
||||
}
|
||||
else // 0 account -> console
|
||||
{
|
||||
sLog.outCommand(GetAccountId(),"Command: %s [Account: %u from %s]",
|
||||
sLog.outCommand(GetAccountId(), "Command: %s [Account: %u from %s]",
|
||||
fullcmd, GetAccountId(), GetAccountId() ? "RA-connection" : "Console");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class MANGOS_DLL_SPEC ChatHandler
|
|||
FillMessageData(data, m_session, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, ObjectGuid(), message);
|
||||
}
|
||||
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; }
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual const char* GetMangosString(int32 entry) const;
|
||||
|
|
@ -95,7 +95,7 @@ class MANGOS_DLL_SPEC ChatHandler
|
|||
virtual void SendSysMessage(const char* str);
|
||||
|
||||
void SendSysMessage(int32 entry);
|
||||
void PSendSysMessage(const char* format, ...) ATTR_PRINTF(2,3);
|
||||
void PSendSysMessage(const char* format, ...) ATTR_PRINTF(2, 3);
|
||||
void PSendSysMessage(int32 entry, ...);
|
||||
|
||||
bool ParseCommands(const char* text);
|
||||
|
|
@ -617,7 +617,7 @@ class MANGOS_DLL_SPEC ChatHandler
|
|||
bool ExtractInt32(char** args, int32& val);
|
||||
bool ExtractOptInt32(char** args, int32& val, int32 defVal);
|
||||
bool ExtractUInt32Base(char** args, uint32& val, uint32 base);
|
||||
bool ExtractUInt32(char** args, uint32& val) { return ExtractUInt32Base(args,val, 10); }
|
||||
bool ExtractUInt32(char** args, uint32& val) { return ExtractUInt32Base(args, val, 10); }
|
||||
bool ExtractOptUInt32(char** args, uint32& val, uint32 defVal);
|
||||
bool ExtractFloat(char** args, float& val);
|
||||
bool ExtractOptFloat(char** args, float& val, float defVal);
|
||||
|
|
@ -646,10 +646,10 @@ class MANGOS_DLL_SPEC ChatHandler
|
|||
bool ExtractPlayerTarget(char** args, Player** player, ObjectGuid* player_guid = NULL, std::string* player_name = NULL);
|
||||
// select by arg (name/link) or in-game selection online/offline player
|
||||
|
||||
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
|
||||
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:" + name + "|h[" + name + "]|h|r" : name; }
|
||||
std::string GetNameLink(Player* chr) const;
|
||||
|
||||
GameObject* GetGameObjectWithGuid(uint32 lowguid,uint32 entry);
|
||||
GameObject* GetGameObjectWithGuid(uint32 lowguid, uint32 entry);
|
||||
|
||||
// Utility methods for commands
|
||||
bool ShowAccountListHelper(QueryResult* result, uint32* limit = NULL, bool title = true, bool error = true);
|
||||
|
|
@ -670,7 +670,7 @@ class MANGOS_DLL_SPEC ChatHandler
|
|||
bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
|
||||
bool HandleUnBanHelper(BanMode mode, char* args);
|
||||
void HandleCharacterLevel(Player* player, ObjectGuid player_guid, uint32 oldlevel, uint32 newlevel);
|
||||
void HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id);
|
||||
void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id);
|
||||
bool HandleGoHelper(Player* _player, uint32 mapid, float x, float y, float const* zPtr = NULL, float const* ortPtr = NULL);
|
||||
bool HandleGetValueHelper(Object* target, uint32 field, char* typeStr);
|
||||
bool HandlerDebugModValueHelper(Object* target, uint32 field, char* typeStr, char* valStr);
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ namespace MaNGOS
|
|||
char const* nam = i_target ? i_target->GetNameForLocaleIdx(loc_idx) : NULL;
|
||||
uint32 namlen = (nam ? strlen(nam) : 0) + 1;
|
||||
|
||||
data.Initialize(SMSG_TEXT_EMOTE, (20+namlen));
|
||||
data.Initialize(SMSG_TEXT_EMOTE, (20 + namlen));
|
||||
data << ObjectGuid(i_player.GetObjectGuid());
|
||||
data << uint32(i_text_emote);
|
||||
data << uint32(i_emote_num);
|
||||
|
|
@ -625,14 +625,14 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data)
|
|||
|
||||
void WorldSession::SendPlayerNotFoundNotice(std::string name)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, name.size()+1);
|
||||
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, name.size() + 1);
|
||||
data << name;
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendPlayerAmbiguousNotice(std::string name)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAT_PLAYER_AMBIGUOUS, name.size()+1);
|
||||
WorldPacket data(SMSG_CHAT_PLAYER_AMBIGUOUS, name.size() + 1);
|
||||
data << name;
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (_player->IsFriendlyTo(pEnemy) || pEnemy->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
|
||||
{
|
||||
sLog.outError("WORLD: Enemy %s is friendly",guid.GetString().c_str());
|
||||
sLog.outError("WORLD: Enemy %s is friendly", guid.GetString().c_str());
|
||||
|
||||
// stop attack state at client
|
||||
SendAttackStop(pEnemy);
|
||||
|
|
@ -65,7 +65,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recv_data)
|
|||
return;
|
||||
}
|
||||
|
||||
_player->Attack(pEnemy,true);
|
||||
_player->Attack(pEnemy, true);
|
||||
}
|
||||
|
||||
void WorldSession::HandleAttackStopOpcode(WorldPacket& /*recv_data*/)
|
||||
|
|
@ -82,7 +82,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data)
|
|||
|
||||
if (sheathed >= MAX_SHEATH_STATE)
|
||||
{
|
||||
sLog.outError("Unknown sheath state %u ??",sheathed);
|
||||
sLog.outError("Unknown sheath state %u ??", sheathed);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data)
|
|||
|
||||
void WorldSession::SendAttackStop(Unit const* enemy)
|
||||
{
|
||||
WorldPacket data(SMSG_ATTACKSTOP, (4+20)); // we guess size
|
||||
WorldPacket data(SMSG_ATTACKSTOP, (4 + 20)); // we guess size
|
||||
data << GetPlayer()->GetPackGUID();
|
||||
data << (enemy ? enemy->GetPackGUID() : PackedGuid()); // must be packed guid
|
||||
data << uint32(0); // unk, can be 1 also
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ void ConfusedMovementGenerator<T>::Initialize(T& unit)
|
|||
unit.GetPosition(i_x, i_y, i_z);
|
||||
|
||||
unit.StopMoving();
|
||||
unit.addUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.addUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
@ -46,7 +46,7 @@ void ConfusedMovementGenerator<T>::Reset(T& unit)
|
|||
{
|
||||
i_nextMoveTime.Reset(0);
|
||||
unit.StopMoving();
|
||||
unit.addUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.addUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
@ -73,8 +73,8 @@ bool ConfusedMovementGenerator<T>::Update(T& unit, const uint32& diff)
|
|||
// start moving
|
||||
unit.addUnitState(UNIT_STAT_CONFUSED_MOVE);
|
||||
|
||||
float x = i_x + 10.0f*(rand_norm_f() - 0.5f);
|
||||
float y = i_y + 10.0f*(rand_norm_f() - 0.5f);
|
||||
float x = i_x + 10.0f * (rand_norm_f() - 0.5f);
|
||||
float y = i_y + 10.0f * (rand_norm_f() - 0.5f);
|
||||
float z = i_z;
|
||||
|
||||
unit.UpdateAllowedPositionZ(x, y, z);
|
||||
|
|
@ -101,14 +101,14 @@ bool ConfusedMovementGenerator<T>::Update(T& unit, const uint32& diff)
|
|||
template<>
|
||||
void ConfusedMovementGenerator<Player>::Finalize(Player& unit)
|
||||
{
|
||||
unit.clearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.clearUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.StopMoving();
|
||||
}
|
||||
|
||||
template<>
|
||||
void ConfusedMovementGenerator<Creature>::Finalize(Creature& unit)
|
||||
{
|
||||
unit.clearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
|
||||
unit.clearUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_CONFUSED_MOVE);
|
||||
}
|
||||
|
||||
template void ConfusedMovementGenerator<Player>::Initialize(Player& player);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ void Corpse::SaveToDB()
|
|||
<< GetPositionZ() << ", "
|
||||
<< GetOrientation() << ", "
|
||||
<< GetMapId() << ", "
|
||||
<< uint64(m_time) <<", "
|
||||
<< uint64(m_time) << ", "
|
||||
<< uint32(GetType()) << ", "
|
||||
<< int(GetInstanceId()) << ", "
|
||||
<< uint16(GetPhaseMask()) << ")"; // prevent out of range error
|
||||
|
|
@ -155,7 +155,7 @@ bool Corpse::LoadFromDB(uint32 lowguid, Field* fields)
|
|||
//QueryResult *result = CharacterDatabase.Query("SELECT corpse.guid, player, corpse.position_x, corpse.position_y, corpse.position_z, corpse.orientation, corpse.map,"
|
||||
//// 7 8 9 10 11 12 13 14 15 16 17 18
|
||||
// "time, corpse_type, instance, phaseMask, gender, race, class, playerBytes, playerBytes2, equipmentCache, guildId, playerFlags FROM corpse"
|
||||
uint32 playerLowGuid= fields[1].GetUInt32();
|
||||
uint32 playerLowGuid = fields[1].GetUInt32();
|
||||
float positionX = fields[2].GetFloat();
|
||||
float positionY = fields[3].GetFloat();
|
||||
float positionZ = fields[4].GetFloat();
|
||||
|
|
@ -277,7 +277,7 @@ bool Corpse::IsFriendlyTo(Unit const* unit) const
|
|||
bool Corpse::IsExpired(time_t t) const
|
||||
{
|
||||
if (m_type == CORPSE_BONES)
|
||||
return m_time < t - 60*MINUTE;
|
||||
return m_time < t - 60 * MINUTE;
|
||||
else
|
||||
return m_time < t - 3*DAY;
|
||||
return m_time < t - 3 * DAY;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,13 +349,13 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData* data /*=
|
|||
else
|
||||
setFaction(GetCreatureInfo()->faction_A);
|
||||
|
||||
SetUInt32Value(UNIT_NPC_FLAGS,GetCreatureInfo()->npcflag);
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, GetCreatureInfo()->npcflag);
|
||||
|
||||
uint32 attackTimer = GetCreatureInfo()->baseattacktime;
|
||||
|
||||
SetAttackTime(BASE_ATTACK, attackTimer);
|
||||
SetAttackTime(OFF_ATTACK, attackTimer - attackTimer/4);
|
||||
SetAttackTime(RANGED_ATTACK,GetCreatureInfo()->rangeattacktime);
|
||||
SetAttackTime(OFF_ATTACK, attackTimer - attackTimer / 4);
|
||||
SetAttackTime(RANGED_ATTACK, GetCreatureInfo()->rangeattacktime);
|
||||
|
||||
uint32 unitFlags = GetCreatureInfo()->unit_flags;
|
||||
|
||||
|
|
@ -424,12 +424,12 @@ uint32 Creature::ChooseDisplayId(const CreatureInfo* cinfo, const CreatureData*
|
|||
|
||||
if (cinfo->ModelId[3] && cinfo->ModelId[2] && cinfo->ModelId[1] && cinfo->ModelId[0])
|
||||
{
|
||||
display_id = cinfo->ModelId[urand(0,3)];
|
||||
display_id = cinfo->ModelId[urand(0, 3)];
|
||||
}
|
||||
else if (cinfo->ModelId[2] && cinfo->ModelId[1] && cinfo->ModelId[0])
|
||||
{
|
||||
uint32 modelid_tmp = sObjectMgr.GetCreatureModelAlternativeModel(cinfo->ModelId[1]);
|
||||
display_id = modelid_tmp ? cinfo->ModelId[urand(0,2)] : cinfo->ModelId[2];
|
||||
display_id = modelid_tmp ? cinfo->ModelId[urand(0, 2)] : cinfo->ModelId[2];
|
||||
}
|
||||
else if (cinfo->ModelId[1])
|
||||
{
|
||||
|
|
@ -462,11 +462,11 @@ void Creature::Update(uint32 update_diff, uint32 diff)
|
|||
{
|
||||
case JUST_ALIVED:
|
||||
// Don't must be called, see Creature::SetDeathState JUST_ALIVED -> ALIVE promoting.
|
||||
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry());
|
||||
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry());
|
||||
break;
|
||||
case JUST_DIED:
|
||||
// Don't must be called, see Creature::SetDeathState JUST_DIED -> CORPSE promoting.
|
||||
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry());
|
||||
sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry());
|
||||
break;
|
||||
case DEAD:
|
||||
{
|
||||
|
|
@ -691,7 +691,7 @@ void Creature::RegenerateHealth()
|
|||
addvalue = uint32(Spirit * 0.80 * HealthIncreaseRate);
|
||||
}
|
||||
else
|
||||
addvalue = maxValue/3;
|
||||
addvalue = maxValue / 3;
|
||||
|
||||
ModifyHealth(addvalue);
|
||||
}
|
||||
|
|
@ -702,7 +702,7 @@ void Creature::DoFleeToGetAssistance()
|
|||
return;
|
||||
|
||||
float radius = sWorld.getConfig(CONFIG_FLOAT_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
|
||||
if (radius >0)
|
||||
if (radius > 0)
|
||||
{
|
||||
Creature* pCreature = NULL;
|
||||
|
||||
|
|
@ -714,7 +714,7 @@ void Creature::DoFleeToGetAssistance()
|
|||
UpdateSpeed(MOVE_RUN, false);
|
||||
|
||||
if (!pCreature)
|
||||
SetFeared(true, getVictim()->GetObjectGuid(), 0 ,sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY));
|
||||
SetFeared(true, getVictim()->GetObjectGuid(), 0 , sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_FLEE_DELAY));
|
||||
else
|
||||
GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ());
|
||||
}
|
||||
|
|
@ -804,7 +804,7 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
|
|||
if ((!cSpells || cSpells->spellList.empty()) && (!tSpells || tSpells->spellList.empty()))
|
||||
{
|
||||
sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
|
||||
GetGUIDLow(),GetEntry());
|
||||
GetGUIDLow(), GetEntry());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -822,12 +822,12 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
|
|||
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913, GetObjectGuid()); break;
|
||||
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetObjectGuid()); break;
|
||||
case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328, GetObjectGuid()); break;
|
||||
case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635, GetObjectGuid()); break;
|
||||
case CLASS_PALADIN: pPlayer->PlayerTalkClass->SendGossipMenu(1635, GetObjectGuid()); break;
|
||||
case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436, GetObjectGuid()); break;
|
||||
case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797, GetObjectGuid()); break;
|
||||
case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003, GetObjectGuid()); break;
|
||||
case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836, GetObjectGuid()); break;
|
||||
case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985, GetObjectGuid()); break;
|
||||
case CLASS_WARLOCK: pPlayer->PlayerTalkClass->SendGossipMenu(5836, GetObjectGuid()); break;
|
||||
case CLASS_WARRIOR: pPlayer->PlayerTalkClass->SendGossipMenu(4985, GetObjectGuid()); break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1062,7 +1062,7 @@ void Creature::SaveToDB()
|
|||
return;
|
||||
}
|
||||
|
||||
SaveToDB(GetMapId(), data->spawnMask,GetPhaseMask());
|
||||
SaveToDB(GetMapId(), data->spawnMask, GetPhaseMask());
|
||||
}
|
||||
|
||||
void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
|
|
@ -1102,13 +1102,13 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
data.orientation = GetOrientation();
|
||||
data.spawntimesecs = m_respawnDelay;
|
||||
// prevent add data integrity problems
|
||||
data.spawndist = GetDefaultMovementType()==IDLE_MOTION_TYPE ? 0 : m_respawnradius;
|
||||
data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0 : m_respawnradius;
|
||||
data.currentwaypoint = 0;
|
||||
data.curhealth = GetHealth();
|
||||
data.curmana = GetPower(POWER_MANA);
|
||||
data.is_dead = m_isDeadByDefault;
|
||||
// prevent add data integrity problems
|
||||
data.movementType = !m_respawnradius && GetDefaultMovementType()==RANDOM_MOTION_TYPE
|
||||
data.movementType = !m_respawnradius && GetDefaultMovementType() == RANDOM_MOTION_TYPE
|
||||
? IDLE_MOTION_TYPE : GetDefaultMovementType();
|
||||
|
||||
// updated in DB
|
||||
|
|
@ -1120,11 +1120,11 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
ss << "INSERT INTO creature VALUES ("
|
||||
<< GetGUIDLow() << ","
|
||||
<< data.id << ","
|
||||
<< data.mapid <<","
|
||||
<< data.mapid << ","
|
||||
<< uint32(data.spawnMask) << "," // cast to prevent save as symbol
|
||||
<< uint16(data.phaseMask) << "," // prevent out of range error
|
||||
<< data.modelid_override <<","
|
||||
<< data.equipmentId <<","
|
||||
<< data.modelid_override << ","
|
||||
<< data.equipmentId << ","
|
||||
<< data.posX << ","
|
||||
<< data.posY << ","
|
||||
<< data.posZ << ","
|
||||
|
|
@ -1144,7 +1144,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
|
||||
void Creature::SelectLevel(const CreatureInfo* cinfo, float percentHealth, float percentMana)
|
||||
{
|
||||
uint32 rank = IsPet()? 0 : cinfo->rank;
|
||||
uint32 rank = IsPet() ? 0 : cinfo->rank;
|
||||
|
||||
// level
|
||||
uint32 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel);
|
||||
|
|
@ -1152,14 +1152,14 @@ void Creature::SelectLevel(const CreatureInfo* cinfo, float percentHealth, float
|
|||
uint32 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel);
|
||||
SetLevel(level);
|
||||
|
||||
float rellevel = maxlevel == minlevel ? 0 : (float(level - minlevel))/(maxlevel - minlevel);
|
||||
float rellevel = maxlevel == minlevel ? 0 : (float(level - minlevel)) / (maxlevel - minlevel);
|
||||
|
||||
// health
|
||||
float healthmod = _GetHealthMod(rank);
|
||||
|
||||
uint32 minhealth = std::min(cinfo->maxhealth, cinfo->minhealth);
|
||||
uint32 maxhealth = std::max(cinfo->maxhealth, cinfo->minhealth);
|
||||
uint32 health = uint32(healthmod * (minhealth + uint32(rellevel*(maxhealth - minhealth))));
|
||||
uint32 health = uint32(healthmod * (minhealth + uint32(rellevel * (maxhealth - minhealth))));
|
||||
|
||||
SetCreateHealth(health);
|
||||
SetMaxHealth(health);
|
||||
|
|
@ -1323,7 +1323,7 @@ bool Creature::LoadFromDB(uint32 guidlow, Map* map)
|
|||
uint32 curhealth = data->curhealth;
|
||||
if (curhealth)
|
||||
{
|
||||
curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank));
|
||||
curhealth = uint32(curhealth * _GetHealthMod(GetCreatureInfo()->rank));
|
||||
if (curhealth < 1)
|
||||
curhealth = 1;
|
||||
}
|
||||
|
|
@ -1470,7 +1470,7 @@ float Creature::GetAttackDistance(Unit const* pl) const
|
|||
// radius grow if playlevel < creaturelevel
|
||||
RetDistance -= (float)leveldif;
|
||||
|
||||
if (creaturelevel+5 <= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
|
||||
if (creaturelevel + 5 <= sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// detect range auras
|
||||
RetDistance += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE);
|
||||
|
|
@ -1483,14 +1483,14 @@ float Creature::GetAttackDistance(Unit const* pl) const
|
|||
if (RetDistance < 5)
|
||||
RetDistance = 5;
|
||||
|
||||
return (RetDistance*aggroRate);
|
||||
return (RetDistance * aggroRate);
|
||||
}
|
||||
|
||||
void Creature::SetDeathState(DeathState s)
|
||||
{
|
||||
if ((s == JUST_DIED && !m_isDeadByDefault) || (s == JUST_ALIVED && m_isDeadByDefault))
|
||||
{
|
||||
m_corpseDecayTimer = m_corpseDelay*IN_MILLISECONDS; // the max/default time for corpse decay (before creature is looted/AllLootRemovedFromCorpse() is called)
|
||||
m_corpseDecayTimer = m_corpseDelay * IN_MILLISECONDS; // the max/default time for corpse decay (before creature is looted/AllLootRemovedFromCorpse() is called)
|
||||
m_respawnTime = time(NULL) + m_respawnDelay; // respawn delay (spawntimesecs)
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
|
|
@ -1739,7 +1739,7 @@ bool Creature::IsVisibleInGridForPlayer(Player* pl) const
|
|||
if (corpse)
|
||||
{
|
||||
// 20 - aggro distance for same level, 25 - max additional distance if player level less that creature level
|
||||
if (corpse->IsWithinDistInMap(this,(20+25)*sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)))
|
||||
if (corpse->IsWithinDistInMap(this, (20 + 25)*sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1779,7 +1779,7 @@ void Creature::CallAssistance()
|
|||
{
|
||||
MaNGOS::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(assistList, u_check);
|
||||
Cell::VisitGridObjects(this,searcher, radius);
|
||||
Cell::VisitGridObjects(this, searcher, radius);
|
||||
}
|
||||
|
||||
if (!assistList.empty())
|
||||
|
|
@ -1798,7 +1798,7 @@ void Creature::CallForHelp(float fRadius)
|
|||
|
||||
MaNGOS::CallOfHelpCreatureInRangeDo u_do(this, getVictim(), fRadius);
|
||||
MaNGOS::CreatureWorker<MaNGOS::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
Cell::VisitGridObjects(this,worker, fRadius);
|
||||
Cell::VisitGridObjects(this, worker, fRadius);
|
||||
}
|
||||
|
||||
bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /*= true*/) const
|
||||
|
|
@ -1880,7 +1880,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const
|
|||
if (!pVictim->isInAccessablePlaceFor(this))
|
||||
return true;
|
||||
|
||||
if (!pVictim->isVisibleForOrDetect(this,this,false))
|
||||
if (!pVictim->isVisibleForOrDetect(this, this, false))
|
||||
return true;
|
||||
|
||||
if (sMapStore.LookupEntry(GetMapId())->IsDungeon())
|
||||
|
|
@ -2099,7 +2099,7 @@ Unit* Creature::SelectAttackingTarget(AttackingTarget target, uint32 position, S
|
|||
suitableUnits.push_back(pTarget);
|
||||
|
||||
if (!suitableUnits.empty())
|
||||
return suitableUnits[urand(0, suitableUnits.size()-1)];
|
||||
return suitableUnits[urand(0, suitableUnits.size() - 1)];
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -2146,7 +2146,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
|
|||
|
||||
uint32 cooldown = GetSpellRecoveryTime(spellInfo);
|
||||
if (cooldown)
|
||||
_AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILLISECONDS);
|
||||
_AddCreatureSpellCooldown(spellid, time(NULL) + cooldown / IN_MILLISECONDS);
|
||||
|
||||
if (spellInfo->Category)
|
||||
_AddCreatureCategoryCooldown(spellInfo->Category, time(NULL));
|
||||
|
|
@ -2241,7 +2241,7 @@ void Creature::AllLootRemovedFromCorpse()
|
|||
if (sWorld.getConfig(CONFIG_FLOAT_RATE_CORPSE_DECAY_LOOTED) > 0.0f)
|
||||
corpseLootedDelay = (uint32)((m_corpseDelay * IN_MILLISECONDS) * sWorld.getConfig(CONFIG_FLOAT_RATE_CORPSE_DECAY_LOOTED));
|
||||
else
|
||||
corpseLootedDelay = (m_respawnDelay*IN_MILLISECONDS) /3;
|
||||
corpseLootedDelay = (m_respawnDelay * IN_MILLISECONDS) / 3;
|
||||
}
|
||||
else // corpse was skinned, corpse will despawn next update
|
||||
corpseLootedDelay = 0;
|
||||
|
|
@ -2281,7 +2281,7 @@ uint32 Creature::GetLevelForTarget(Unit const* target) const
|
|||
if (!IsWorldBoss())
|
||||
return Unit::GetLevelForTarget(target);
|
||||
|
||||
uint32 level = target->getLevel()+sWorld.getConfig(CONFIG_UINT32_WORLD_BOSS_LEVEL_DIFF);
|
||||
uint32 level = target->getLevel() + sWorld.getConfig(CONFIG_UINT32_WORLD_BOSS_LEVEL_DIFF);
|
||||
if (level < 1)
|
||||
return 1;
|
||||
if (level > 255)
|
||||
|
|
@ -2322,7 +2322,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||
|
||||
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||
if (itr->itemId==vItem->item)
|
||||
if (itr->itemId == vItem->item)
|
||||
break;
|
||||
|
||||
if (itr == m_vendorItemCounts.end())
|
||||
|
|
@ -2336,7 +2336,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||
{
|
||||
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item);
|
||||
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime) / vItem->incrtime);
|
||||
if ((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount)
|
||||
{
|
||||
m_vendorItemCounts.erase(itr);
|
||||
|
|
@ -2357,13 +2357,13 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||
|
||||
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||
if (itr->itemId==vItem->item)
|
||||
if (itr->itemId == vItem->item)
|
||||
break;
|
||||
|
||||
if (itr == m_vendorItemCounts.end())
|
||||
{
|
||||
uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
||||
m_vendorItemCounts.push_back(VendorItemCount(vItem->item,new_count));
|
||||
uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount - used_count : 0;
|
||||
m_vendorItemCounts.push_back(VendorItemCount(vItem->item, new_count));
|
||||
return new_count;
|
||||
}
|
||||
|
||||
|
|
@ -2375,14 +2375,14 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||
{
|
||||
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item);
|
||||
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime) / vItem->incrtime);
|
||||
if ((vCount->count + diff * pProto->BuyCount) < vItem->maxcount)
|
||||
vCount->count += diff * pProto->BuyCount;
|
||||
else
|
||||
vCount->count = vItem->maxcount;
|
||||
}
|
||||
|
||||
vCount->count = vCount->count > used_count ? vCount->count-used_count : 0;
|
||||
vCount->count = vCount->count > used_count ? vCount->count - used_count : 0;
|
||||
vCount->lastIncrementTime = ptime;
|
||||
return vCount->count;
|
||||
}
|
||||
|
|
@ -2456,7 +2456,7 @@ void Creature::FillGuidsListFromThreatList(GuidVector& guids, uint32 maxamount /
|
|||
|
||||
ThreatList const& threats = getThreatManager().getThreatList();
|
||||
|
||||
maxamount = maxamount > 0 ? std::min(maxamount,uint32(threats.size())) : threats.size();
|
||||
maxamount = maxamount > 0 ? std::min(maxamount, uint32(threats.size())) : threats.size();
|
||||
|
||||
guids.reserve(guids.size() + maxamount);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ enum CreatureFlagsExtra
|
|||
CREATURE_FLAG_EXTRA_NOT_TAUNTABLE = 0x00000100, // creature is immune to taunt auras and effect attack me
|
||||
CREATURE_FLAG_EXTRA_AGGRO_ZONE = 0x00000200, // creature sets itself in combat with zone on aggro
|
||||
CREATURE_FLAG_EXTRA_GUARD = 0x00000400, // creature is a guard
|
||||
CREATURE_FLAG_EXTRA_NO_TALKTO_CREDIT= 0x00000800, // creature doesn't give quest-credits when talked to (temporarily flag)
|
||||
CREATURE_FLAG_EXTRA_NO_TALKTO_CREDIT = 0x00000800, // creature doesn't give quest-credits when talked to (temporarily flag)
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
|
||||
|
|
@ -328,7 +328,7 @@ struct VendorItemData
|
|||
|
||||
VendorItem* GetItem(uint32 slot) const
|
||||
{
|
||||
if (slot>=m_items.size()) return NULL;
|
||||
if (slot >= m_items.size()) return NULL;
|
||||
return m_items[slot];
|
||||
}
|
||||
bool Empty() const { return m_items.empty(); }
|
||||
|
|
@ -380,7 +380,7 @@ struct TrainerSpell
|
|||
bool IsCastable() const { return learnedSpell != spell; }
|
||||
};
|
||||
|
||||
typedef UNORDERED_MAP<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
|
||||
typedef UNORDERED_MAP < uint32 /*spellid*/, TrainerSpell > TrainerSpellMap;
|
||||
|
||||
struct TrainerSpellData
|
||||
{
|
||||
|
|
@ -393,7 +393,7 @@ struct TrainerSpellData
|
|||
void Clear() { spellList.clear(); }
|
||||
};
|
||||
|
||||
typedef std::map<uint32,time_t> CreatureSpellCooldowns;
|
||||
typedef std::map<uint32, time_t> CreatureSpellCooldowns;
|
||||
|
||||
// max different by z coordinate for creature aggro reaction
|
||||
#define CREATURE_Z_ATTACK_RANGE 3
|
||||
|
|
@ -467,7 +467,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
|||
bool Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, Team team = TEAM_NONE, const CreatureData* data = NULL, GameEventCreatureData const* eventData = NULL);
|
||||
bool LoadCreatureAddon(bool reload);
|
||||
void SelectLevel(const CreatureInfo* cinfo, float percentHealth = 100.0f, float percentMana = 100.0f);
|
||||
void LoadEquipment(uint32 equip_entry, bool force=false);
|
||||
void LoadEquipment(uint32 equip_entry, bool force = false);
|
||||
|
||||
bool HasStaticDBSpawnData() const; // listed in `creature` table and have fixed in DB guid
|
||||
|
||||
|
|
@ -476,7 +476,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
|||
void Update(uint32 update_diff, uint32 time) override; // overwrite Unit::Update
|
||||
|
||||
virtual void RegenerateAll(uint32 update_diff);
|
||||
void GetRespawnCoord(float& x, float& y, float& z, float* ori = NULL, float* dist =NULL) const;
|
||||
void GetRespawnCoord(float& x, float& y, float& z, float* ori = NULL, float* dist = NULL) const;
|
||||
uint32 GetEquipmentId() const { return m_equipmentId; }
|
||||
|
||||
CreatureSubtype GetSubtype() const { return m_subtype; }
|
||||
|
|
@ -703,7 +703,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
|||
protected:
|
||||
bool MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const* pSpellInfo, uint32 selectFlags) const;
|
||||
|
||||
bool CreateFromProto(uint32 guidlow, CreatureInfo const* cinfo, Team team, const CreatureData* data = NULL, GameEventCreatureData const* eventData =NULL);
|
||||
bool CreateFromProto(uint32 guidlow, CreatureInfo const* cinfo, Team team, const CreatureData* data = NULL, GameEventCreatureData const* eventData = NULL);
|
||||
bool InitEntry(uint32 entry, const CreatureData* data = NULL, GameEventCreatureData const* eventData = NULL);
|
||||
|
||||
uint32 m_groupLootTimer; // (msecs)timer used for group loot
|
||||
|
|
|
|||
|
|
@ -41,13 +41,13 @@ namespace FactorySelector
|
|||
|
||||
const CreatureAICreator* ai_factory = NULL;
|
||||
|
||||
std::string ainame=creature->GetAIName();
|
||||
std::string ainame = creature->GetAIName();
|
||||
|
||||
// select by NPC flags _first_ - otherwise EventAI might be choosen for pets/totems
|
||||
// excplicit check for isControlled() and owner type to allow guardian, mini-pets and pets controlled by NPCs to be scripted by EventAI
|
||||
Unit* owner=NULL;
|
||||
Unit* owner = NULL;
|
||||
if ((creature->IsPet() && ((Pet*)creature)->isControlled() &&
|
||||
((owner=creature->GetOwner()) && owner->GetTypeId()==TYPEID_PLAYER)) || creature->isCharmed())
|
||||
((owner = creature->GetOwner()) && owner->GetTypeId() == TYPEID_PLAYER)) || creature->isCharmed())
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if (creature->IsTotem())
|
||||
ai_factory = ai_registry.GetRegistryItem("TotemAI");
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
|
|||
#endif
|
||||
if (m_creature->GetMap()->IsDungeon())
|
||||
{
|
||||
if ((1 << (m_creature->GetMap()->GetSpawnMode()+1)) & (*i).event_flags)
|
||||
if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & (*i).event_flags)
|
||||
{
|
||||
++events_count;
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
|
|||
#endif
|
||||
if (m_creature->GetMap()->IsDungeon())
|
||||
{
|
||||
if ((1 << (m_creature->GetMap()->GetSpawnMode()+1)) & (*i).event_flags)
|
||||
if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & (*i).event_flags)
|
||||
{
|
||||
//event flagged for instance mode
|
||||
m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
|
||||
|
|
@ -153,27 +153,27 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.timer.repeatMin,event.timer.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax);
|
||||
break;
|
||||
case EVENT_T_TIMER_OOC:
|
||||
if (m_creature->isInCombat() || m_creature->IsInEvadeMode())
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.timer.repeatMin,event.timer.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax);
|
||||
break;
|
||||
case EVENT_T_HP:
|
||||
{
|
||||
if (!m_creature->isInCombat() || !m_creature->GetMaxHealth())
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
|
||||
uint32 perc = (m_creature->GetHealth() * 100) / m_creature->GetMaxHealth();
|
||||
|
||||
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_MANA:
|
||||
|
|
@ -181,20 +181,20 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
if (!m_creature->isInCombat() || !m_creature->GetMaxPower(POWER_MANA))
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
|
||||
uint32 perc = (m_creature->GetPower(POWER_MANA) * 100) / m_creature->GetMaxPower(POWER_MANA);
|
||||
|
||||
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_AGGRO:
|
||||
break;
|
||||
case EVENT_T_KILL:
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.kill.repeatMin,event.kill.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.kill.repeatMin, event.kill.repeatMax);
|
||||
break;
|
||||
case EVENT_T_DEATH:
|
||||
case EVENT_T_EVADE:
|
||||
|
|
@ -203,15 +203,15 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
//Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.spell_hit.repeatMin,event.spell_hit.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.spell_hit.repeatMin, event.spell_hit.repeatMax);
|
||||
break;
|
||||
case EVENT_T_RANGE:
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.range.repeatMin,event.range.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.range.repeatMin, event.range.repeatMax);
|
||||
break;
|
||||
case EVENT_T_OOC_LOS:
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.ooc_los.repeatMin,event.ooc_los.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.ooc_los.repeatMin, event.ooc_los.repeatMax);
|
||||
break;
|
||||
case EVENT_T_SPAWNED:
|
||||
break;
|
||||
|
|
@ -220,13 +220,13 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
|
||||
uint32 perc = (m_creature->getVictim()->GetHealth() * 100) / m_creature->getVictim()->GetMaxHealth();
|
||||
|
||||
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_TARGET_CASTING:
|
||||
|
|
@ -234,7 +234,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.target_casting.repeatMin,event.target_casting.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.target_casting.repeatMin, event.target_casting.repeatMax);
|
||||
break;
|
||||
case EVENT_T_FRIENDLY_HP:
|
||||
{
|
||||
|
|
@ -248,7 +248,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
pActionInvoker = pUnit;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.friendly_hp.repeatMin,event.friendly_hp.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_FRIENDLY_IS_CC:
|
||||
|
|
@ -267,7 +267,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
pActionInvoker = *(pList.begin());
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.friendly_is_cc.repeatMin,event.friendly_is_cc.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_FRIENDLY_MISSING_BUFF:
|
||||
|
|
@ -283,7 +283,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
pActionInvoker = *(pList.begin());
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.friendly_buff.repeatMin,event.friendly_buff.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_SUMMONED_UNIT:
|
||||
|
|
@ -291,7 +291,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
case EVENT_T_SUMMONED_JUST_DESPAWN:
|
||||
{
|
||||
//Prevent event from occuring on no unit or non creatures
|
||||
if (!pActionInvoker || pActionInvoker->GetTypeId()!=TYPEID_UNIT)
|
||||
if (!pActionInvoker || pActionInvoker->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
|
||||
//Creature id doesn't match up
|
||||
|
|
@ -299,7 +299,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.summoned.repeatMin,event.summoned.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.summoned.repeatMin, event.summoned.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_TARGET_MANA:
|
||||
|
|
@ -307,13 +307,13 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxPower(POWER_MANA))
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->getVictim()->GetPower(POWER_MANA)*100) / m_creature->getVictim()->GetMaxPower(POWER_MANA);
|
||||
uint32 perc = (m_creature->getVictim()->GetPower(POWER_MANA) * 100) / m_creature->getVictim()->GetMaxPower(POWER_MANA);
|
||||
|
||||
if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin)
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.percent_range.repeatMin,event.percent_range.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_REACHED_HOME:
|
||||
|
|
@ -326,7 +326,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_TARGET_AURA:
|
||||
|
|
@ -339,7 +339,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_MISSING_AURA:
|
||||
|
|
@ -349,7 +349,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
|
||||
break;
|
||||
}
|
||||
case EVENT_T_TARGET_MISSING_AURA:
|
||||
|
|
@ -362,7 +362,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
pHolder.UpdateRepeatTimer(m_creature,event.buffed.repeatMin,event.buffed.repeatMax);
|
||||
pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -399,7 +399,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
|
|||
if (count)
|
||||
{
|
||||
// select action number from found amount
|
||||
uint32 idx = urand(0,count-1);
|
||||
uint32 idx = urand(0, count - 1);
|
||||
|
||||
// find selected action, skipping not used
|
||||
uint32 j = 0;
|
||||
|
|
@ -431,8 +431,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
int32 temp = 0;
|
||||
|
||||
if (action.text.TextId[1] && action.text.TextId[2])
|
||||
temp = action.text.TextId[rand()%3];
|
||||
else if (action.text.TextId[1] && urand(0,1))
|
||||
temp = action.text.TextId[rand() % 3];
|
||||
else if (action.text.TextId[1] && urand(0, 1))
|
||||
temp = action.text.TextId[1];
|
||||
else
|
||||
temp = action.text.TextId[0];
|
||||
|
|
@ -620,7 +620,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
break;
|
||||
case ACTION_T_COMBAT_MOVEMENT:
|
||||
// ignore no affect case
|
||||
if (m_CombatMovementEnabled==(action.combat_movement.state!=0))
|
||||
if (m_CombatMovementEnabled == (action.combat_movement.state != 0))
|
||||
return;
|
||||
|
||||
m_CombatMovementEnabled = action.combat_movement.state != 0;
|
||||
|
|
@ -657,7 +657,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
break;
|
||||
case ACTION_T_INC_PHASE:
|
||||
{
|
||||
int32 new_phase = int32(m_Phase)+action.set_inc_phase.step;
|
||||
int32 new_phase = int32(m_Phase) + action.set_inc_phase.step;
|
||||
if (new_phase < 0)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d decrease Phase under 0. CreatureEntry = %d", EventId, m_creature->GetEntry());
|
||||
|
|
@ -665,8 +665,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
}
|
||||
else if (new_phase >= MAX_PHASE)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d incremented Phase above %u. Phase mask cannot be used with phases past %u. CreatureEntry = %d", EventId, MAX_PHASE-1, MAX_PHASE-1, m_creature->GetEntry());
|
||||
m_Phase = MAX_PHASE-1;
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d incremented Phase above %u. Phase mask cannot be used with phases past %u. CreatureEntry = %d", EventId, MAX_PHASE - 1, MAX_PHASE - 1, m_creature->GetEntry());
|
||||
m_Phase = MAX_PHASE - 1;
|
||||
}
|
||||
else
|
||||
m_Phase = new_phase;
|
||||
|
|
@ -681,7 +681,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
break;
|
||||
case ACTION_T_QUEST_EVENT_ALL:
|
||||
if (pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)pActionInvoker)->GroupEventHappens(action.quest_event_all.questId,m_creature);
|
||||
((Player*)pActionInvoker)->GroupEventHappens(action.quest_event_all.questId, m_creature);
|
||||
break;
|
||||
case ACTION_T_CAST_EVENT_ALL:
|
||||
{
|
||||
|
|
@ -697,7 +697,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
break;
|
||||
case ACTION_T_RANGED_MOVEMENT:
|
||||
m_AttackDistance = (float)action.ranged_movement.distance;
|
||||
m_AttackAngle = action.ranged_movement.angle/180.0f*M_PI_F;
|
||||
m_AttackAngle = action.ranged_movement.angle / 180.0f * M_PI_F;
|
||||
|
||||
if (m_CombatMovementEnabled)
|
||||
{
|
||||
|
|
@ -802,7 +802,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, m_creature->GetEntry());
|
||||
return;
|
||||
}
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
break;
|
||||
case ACTION_T_ZONE_COMBAT_PULSE:
|
||||
{
|
||||
|
|
@ -827,7 +827,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
|
||||
{
|
||||
if (action.invincibility_hp_level.is_percent)
|
||||
m_InvinceabilityHpLevel = m_creature->GetMaxHealth()*action.invincibility_hp_level.hp_level/100;
|
||||
m_InvinceabilityHpLevel = m_creature->GetMaxHealth() * action.invincibility_hp_level.hp_level / 100;
|
||||
else
|
||||
m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
|
||||
break;
|
||||
|
|
@ -887,7 +887,7 @@ void CreatureEventAI::Reset()
|
|||
//Reset all out of combat timers
|
||||
case EVENT_T_TIMER_OOC:
|
||||
{
|
||||
if ((*i).UpdateRepeatTimer(m_creature,event.timer.initialMin,event.timer.initialMax))
|
||||
if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax))
|
||||
(*i).Enabled = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1025,7 +1025,7 @@ void CreatureEventAI::EnterCombat(Unit* enemy)
|
|||
break;
|
||||
//Reset all in combat timers
|
||||
case EVENT_T_TIMER:
|
||||
if ((*i).UpdateRepeatTimer(m_creature,event.timer.initialMin,event.timer.initialMax))
|
||||
if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax))
|
||||
(*i).Enabled = true;
|
||||
break;
|
||||
//All normal events need to be re-enabled and their time set to 0
|
||||
|
|
@ -1208,8 +1208,8 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
|
|||
|
||||
bool CreatureEventAI::IsVisible(Unit* pl) const
|
||||
{
|
||||
return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_FLOAT_SIGHT_MONSTER))
|
||||
&& pl->isVisibleForOrDetect(m_creature,m_creature,true);
|
||||
return m_creature->IsWithinDist(pl, sWorld.getConfig(CONFIG_FLOAT_SIGHT_MONSTER))
|
||||
&& pl->isVisibleForOrDetect(m_creature, m_creature, true);
|
||||
}
|
||||
|
||||
inline uint32 CreatureEventAI::GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3)
|
||||
|
|
@ -1283,7 +1283,7 @@ void CreatureEventAI::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, flo
|
|||
{
|
||||
MaNGOS::FriendlyMissingBuffInRangeCheck u_check(m_creature, range, spellid);
|
||||
MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRangeCheck> searcher(_list, u_check);
|
||||
Cell::VisitGridObjects(m_creature,searcher, range);
|
||||
Cell::VisitGridObjects(m_creature, searcher, range);
|
||||
}
|
||||
|
||||
//*********************************
|
||||
|
|
@ -1293,13 +1293,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
|
|||
{
|
||||
if (!pSource)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.",textEntry);
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
if (textEntry >= 0)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry);
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), textEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1307,18 +1307,18 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
|
|||
|
||||
if (i == sEventAIMgr.GetCreatureEventAITextMap().end())
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry);
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), textEntry);
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote);
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", textEntry, (*i).second.SoundId, (*i).second.Type, (*i).second.Language, (*i).second.Emote);
|
||||
|
||||
if ((*i).second.SoundId)
|
||||
{
|
||||
if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId))
|
||||
pSource->PlayDirectSound((*i).second.SoundId);
|
||||
else
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId);
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId);
|
||||
}
|
||||
|
||||
if ((*i).second.Emote)
|
||||
|
|
@ -1328,7 +1328,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
|
|||
((Unit*)pSource)->HandleEmote((*i).second.Emote);
|
||||
}
|
||||
else
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId());
|
||||
sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, pSource->GetTypeId());
|
||||
}
|
||||
|
||||
switch ((*i).second.Type)
|
||||
|
|
@ -1387,7 +1387,7 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const* Spell, bool Trigge
|
|||
return false;
|
||||
|
||||
//Unit is out of range of this spell
|
||||
if (!m_creature->IsInRange(Target,TempRange->minRange,TempRange->maxRange))
|
||||
if (!m_creature->IsInRange(Target, TempRange->minRange, TempRange->maxRange))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -1405,7 +1405,7 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
|
|||
if ((*itr).Event.receive_emote.emoteId != text_emote)
|
||||
return;
|
||||
|
||||
PlayerCondition pcon(0, (*itr).Event.receive_emote.condition,(*itr).Event.receive_emote.conditionValue1,(*itr).Event.receive_emote.conditionValue2);
|
||||
PlayerCondition pcon(0, (*itr).Event.receive_emote.condition, (*itr).Event.receive_emote.conditionValue1, (*itr).Event.receive_emote.conditionValue2);
|
||||
if (pcon.Meets(pPlayer))
|
||||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing");
|
||||
|
|
@ -1417,7 +1417,7 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
|
|||
|
||||
void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage)
|
||||
{
|
||||
if (m_InvinceabilityHpLevel > 0 && m_creature->GetHealth() < m_InvinceabilityHpLevel+damage)
|
||||
if (m_InvinceabilityHpLevel > 0 && m_creature->GetHealth() < m_InvinceabilityHpLevel + damage)
|
||||
{
|
||||
if (m_creature->GetHealth() <= m_InvinceabilityHpLevel)
|
||||
damage = 0;
|
||||
|
|
@ -1443,7 +1443,7 @@ bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& e
|
|||
{
|
||||
// zone ID check
|
||||
uint32 zone, area;
|
||||
m_creature->GetZoneAndAreaId(zone,area);
|
||||
m_creature->GetZoneAndAreaId(zone, area);
|
||||
return zone == event.spawned.conditionValue1 || area == event.spawned.conditionValue1;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ enum EventFlags
|
|||
EFLAG_RESERVED_6 = 0x40,
|
||||
EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build
|
||||
// no free bits, uint8 field
|
||||
EFLAG_DIFFICULTY_ALL = (EFLAG_DIFFICULTY_0|EFLAG_DIFFICULTY_1|EFLAG_DIFFICULTY_2|EFLAG_DIFFICULTY_3)
|
||||
EFLAG_DIFFICULTY_ALL = (EFLAG_DIFFICULTY_0 | EFLAG_DIFFICULTY_1 | EFLAG_DIFFICULTY_2 | EFLAG_DIFFICULTY_3)
|
||||
};
|
||||
|
||||
enum SpawnedEventMode
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
|
|||
m_CreatureEventAI_TextMap.clear();
|
||||
|
||||
// Load EventAI Text
|
||||
sObjectMgr.LoadMangosStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
sObjectMgr.LoadMangosStrings(WorldDatabase, "creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
|
||||
// Gather Additional data from EventAI Texts
|
||||
QueryResult* result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
|
||||
|
|
@ -62,33 +62,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use)
|
|||
// range negative
|
||||
if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)",i,MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
// range negative (don't must be happen, loaded from same table)
|
||||
if (!sObjectMgr.GetMangosStringLocale(i))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (temp.SoundId)
|
||||
{
|
||||
if (!sSoundEntriesStore.LookupEntry(temp.SoundId))
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.",i,temp.SoundId);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId);
|
||||
}
|
||||
|
||||
if (!GetLanguageDescByID(temp.Language))
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.",i,temp.Language);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language);
|
||||
|
||||
if (temp.Type > CHAT_TYPE_ZONE_YELL)
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type);
|
||||
|
||||
if (temp.Emote)
|
||||
{
|
||||
if (!sEmotesStore.LookupEntry(temp.Emote))
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.",i,temp.Emote);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote);
|
||||
}
|
||||
|
||||
m_CreatureEventAI_TextMap[i] = temp;
|
||||
|
|
@ -146,7 +146,7 @@ void CreatureEventAIMgr::CheckUnusedAITexts()
|
|||
}
|
||||
|
||||
for (std::set<int32>::const_iterator itr = idx_set.begin(); itr != idx_set.end(); ++itr)
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` but not used in EventAI scripts.",*itr);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` but not used in EventAI scripts.", *itr);
|
||||
}
|
||||
|
||||
// -------------------
|
||||
|
|
@ -238,7 +238,7 @@ void CreatureEventAIMgr::CheckUnusedAISummons()
|
|||
}
|
||||
|
||||
for (std::set<int32>::const_iterator itr = idx_set.begin(); itr != idx_set.end(); ++itr)
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_summons` but not used in EventAI scripts.",*itr);
|
||||
sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_summons` but not used in EventAI scripts.", *itr);
|
||||
}
|
||||
|
||||
// -------------------
|
||||
|
|
@ -275,7 +275,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
//Report any errors in event
|
||||
if (e_type >= EVENT_T_END)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i,e_type);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type);
|
||||
continue;
|
||||
}
|
||||
temp.event_type = EventAI_Type(e_type);
|
||||
|
|
@ -444,13 +444,13 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
{
|
||||
if (!sEmotesTextStore.LookupEntry(temp.receive_emote.emoteId))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.",temp.creature_id, i, temp.receive_emote.emoteId);
|
||||
sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!PlayerCondition::IsValid(0, ConditionType(temp.receive_emote.condition), temp.receive_emote.conditionValue1, temp.receive_emote.conditionValue2))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition);
|
||||
sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -491,10 +491,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
|
||||
for (uint32 j = 0; j < MAX_ACTIONS; j++)
|
||||
{
|
||||
uint16 action_type = fields[10+(j*4)].GetUInt16();
|
||||
uint16 action_type = fields[10 + (j * 4)].GetUInt16();
|
||||
if (action_type >= ACTION_T_END)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j + 1, action_type);
|
||||
temp.action[j].type = ACTION_T_NONE;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -502,9 +502,9 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
CreatureEventAI_Action& action = temp.action[j];
|
||||
|
||||
action.type = EventAI_ActionType(action_type);
|
||||
action.raw.param1 = fields[11+(j*4)].GetUInt32();
|
||||
action.raw.param2 = fields[12+(j*4)].GetUInt32();
|
||||
action.raw.param3 = fields[13+(j*4)].GetUInt32();
|
||||
action.raw.param1 = fields[11 + (j * 4)].GetUInt32();
|
||||
action.raw.param2 = fields[12 + (j * 4)].GetUInt32();
|
||||
action.raw.param3 = fields[13 + (j * 4)].GetUInt32();
|
||||
|
||||
//Report any errors in actions
|
||||
switch (action.type)
|
||||
|
|
@ -519,19 +519,19 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
if (action.text.TextId[k])
|
||||
{
|
||||
if (k > 0 && not_set)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u has param%d, but it follow after not set param. Required for randomized text.", i, j+1, k+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u has param%d, but it follow after not set param. Required for randomized text.", i, j + 1, k + 1);
|
||||
|
||||
if (!action.text.TextId[k])
|
||||
not_set = true;
|
||||
// range negative
|
||||
else if (action.text.TextId[k] > MIN_CREATURE_AI_TEXT_STRING_ID || action.text.TextId[k] <= MAX_CREATURE_AI_TEXT_STRING_ID)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param%d references out-of-range entry (%i) in texts table.", i, j+1, k+1, action.text.TextId[k]);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param%d references out-of-range entry (%i) in texts table.", i, j + 1, k + 1, action.text.TextId[k]);
|
||||
action.text.TextId[k] = 0;
|
||||
}
|
||||
else if (m_CreatureEventAI_TextMap.find(action.text.TextId[k]) == m_CreatureEventAI_TextMap.end())
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param%d references non-existing entry (%i) in texts table.", i, j+1, k+1, action.text.TextId[k]);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param%d references non-existing entry (%i) in texts table.", i, j + 1, k + 1, action.text.TextId[k]);
|
||||
action.text.TextId[k] = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -539,18 +539,18 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
break;
|
||||
}
|
||||
case ACTION_T_SET_FACTION:
|
||||
if (action.set_faction.factionId !=0 && !sFactionTemplateStore.LookupEntry(action.set_faction.factionId))
|
||||
if (action.set_faction.factionId != 0 && !sFactionTemplateStore.LookupEntry(action.set_faction.factionId))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent FactionId %u.", i, j+1, action.set_faction.factionId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent FactionId %u.", i, j + 1, action.set_faction.factionId);
|
||||
action.set_faction.factionId = 0;
|
||||
}
|
||||
break;
|
||||
case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
|
||||
if (action.morph.creatureId !=0 || action.morph.modelId !=0)
|
||||
if (action.morph.creatureId != 0 || action.morph.modelId != 0)
|
||||
{
|
||||
if (action.morph.creatureId && !sCreatureStorage.LookupEntry<CreatureInfo>(action.morph.creatureId))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.morph.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j + 1, action.morph.creatureId);
|
||||
action.morph.creatureId = 0;
|
||||
}
|
||||
|
||||
|
|
@ -558,12 +558,12 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
{
|
||||
if (action.morph.creatureId)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId,action.morph.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j + 1, action.morph.modelId, action.morph.creatureId);
|
||||
action.morph.modelId = 0;
|
||||
}
|
||||
else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.morph.modelId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j + 1, action.morph.modelId);
|
||||
action.morph.modelId = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -571,33 +571,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
break;
|
||||
case ACTION_T_SOUND:
|
||||
if (!sSoundEntriesStore.LookupEntry(action.sound.soundId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SoundID %u.", i, j+1, action.sound.soundId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SoundID %u.", i, j + 1, action.sound.soundId);
|
||||
break;
|
||||
case ACTION_T_EMOTE:
|
||||
if (!sEmotesStore.LookupEntry(action.emote.emoteId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.emote.emoteId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j + 1, action.emote.emoteId);
|
||||
break;
|
||||
case ACTION_T_RANDOM_SOUND:
|
||||
if (!sSoundEntriesStore.LookupEntry(action.random_sound.soundId1))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 uses nonexistent SoundID %u.", i, j+1, action.random_sound.soundId1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 uses nonexistent SoundID %u.", i, j + 1, action.random_sound.soundId1);
|
||||
if (action.random_sound.soundId2 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId2))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 uses nonexistent SoundID %u.", i, j+1, action.random_sound.soundId2);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 uses nonexistent SoundID %u.", i, j + 1, action.random_sound.soundId2);
|
||||
if (action.random_sound.soundId3 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId3))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 uses nonexistent SoundID %u.", i, j+1, action.random_sound.soundId3);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 uses nonexistent SoundID %u.", i, j + 1, action.random_sound.soundId3);
|
||||
break;
|
||||
case ACTION_T_RANDOM_EMOTE:
|
||||
if (!sEmotesStore.LookupEntry(action.random_emote.emoteId1))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j + 1, action.random_emote.emoteId1);
|
||||
if (action.random_emote.emoteId2 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId2))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId2);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j + 1, action.random_emote.emoteId2);
|
||||
if (action.random_emote.emoteId3 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId3))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j + 1, action.random_emote.emoteId3);
|
||||
break;
|
||||
case ACTION_T_CAST:
|
||||
{
|
||||
const SpellEntry* spell = sSpellStore.LookupEntry(action.cast.spellId);
|
||||
if (!spell)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j+1, action.cast.spellId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.cast.spellId);
|
||||
/* FIXME: temp.raw.param3 not have event tipes with recovery time in it....
|
||||
else
|
||||
{
|
||||
|
|
@ -615,143 +615,143 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
action.cast.castFlags |= CAST_TRIGGERED;
|
||||
|
||||
if (action.cast.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
}
|
||||
case ACTION_T_SUMMON:
|
||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.summon.creatureId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j+1, action.summon.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.summon.creatureId);
|
||||
|
||||
if (action.summon.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_THREAT_SINGLE_PCT:
|
||||
if (std::abs(action.threat_single_pct.percent) > 100)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_single_pct.percent);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j + 1, action.threat_single_pct.percent);
|
||||
if (action.threat_single_pct.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_THREAT_ALL_PCT:
|
||||
if (std::abs(action.threat_all_pct.percent) > 100)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j + 1, action.threat_all_pct.percent);
|
||||
break;
|
||||
case ACTION_T_QUEST_EVENT:
|
||||
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event.questId))
|
||||
{
|
||||
if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j + 1, action.quest_event.questId);
|
||||
}
|
||||
else
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Quest entry %u.", i, j+1, action.quest_event.questId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Quest entry %u.", i, j + 1, action.quest_event.questId);
|
||||
|
||||
if (action.quest_event.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
|
||||
break;
|
||||
case ACTION_T_CAST_EVENT:
|
||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.cast_event.creatureId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j+1, action.cast_event.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.cast_event.creatureId);
|
||||
if (!sSpellStore.LookupEntry(action.cast_event.spellId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j+1, action.cast_event.spellId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.cast_event.spellId);
|
||||
if (action.cast_event.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_SET_UNIT_FIELD:
|
||||
if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j + 1);
|
||||
if (action.set_unit_field.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_SET_UNIT_FLAG:
|
||||
case ACTION_T_REMOVE_UNIT_FLAG:
|
||||
if (action.unit_flag.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_SET_PHASE:
|
||||
if (action.set_phase.phase >= MAX_PHASE)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
|
||||
break;
|
||||
case ACTION_T_INC_PHASE:
|
||||
if (action.set_inc_phase.step == 0)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
|
||||
else if (std::abs(action.set_inc_phase.step) > MAX_PHASE-1)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j + 1);
|
||||
else if (std::abs(action.set_inc_phase.step) > MAX_PHASE - 1)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j + 1, action.set_inc_phase.step);
|
||||
break;
|
||||
case ACTION_T_QUEST_EVENT_ALL:
|
||||
if (Quest const* qid = sObjectMgr.GetQuestTemplate(action.quest_event_all.questId))
|
||||
{
|
||||
if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAG_EXPLORATION_OR_EVENT))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j + 1, action.quest_event_all.questId);
|
||||
}
|
||||
else
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Quest entry %u.", i, j+1, action.quest_event_all.questId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Quest entry %u.", i, j + 1, action.quest_event_all.questId);
|
||||
break;
|
||||
case ACTION_T_CAST_EVENT_ALL:
|
||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.cast_event_all.creatureId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j+1, action.cast_event_all.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.cast_event_all.creatureId);
|
||||
if (!sSpellStore.LookupEntry(action.cast_event_all.spellId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j+1, action.cast_event_all.spellId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.cast_event_all.spellId);
|
||||
break;
|
||||
case ACTION_T_REMOVEAURASFROMSPELL:
|
||||
if (!sSpellStore.LookupEntry(action.remove_aura.spellId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j+1, action.remove_aura.spellId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent SpellID %u.", i, j + 1, action.remove_aura.spellId);
|
||||
if (action.remove_aura.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3
|
||||
if (action.random_phase.phase1 >= MAX_PHASE)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
|
||||
if (action.random_phase.phase2 >= MAX_PHASE)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
|
||||
if (action.random_phase.phase3 >= MAX_PHASE)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
|
||||
break;
|
||||
case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax
|
||||
if (action.random_phase_range.phaseMin >= MAX_PHASE)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
|
||||
if (action.random_phase_range.phaseMin >= MAX_PHASE)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1);
|
||||
if (action.random_phase_range.phaseMin >= action.random_phase_range.phaseMax)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1);
|
||||
std::swap(action.random_phase_range.phaseMin,action.random_phase_range.phaseMax);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j + 1);
|
||||
std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
|
||||
// equal case processed at call
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SUMMON_ID:
|
||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.summon_id.creatureId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j+1, action.summon_id.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.summon_id.creatureId);
|
||||
if (action.summon_id.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
if (m_CreatureEventAI_Summon_Map.find(action.summon_id.spawnId) == m_CreatureEventAI_Summon_Map.end())
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j + 1, action.summon_id.spawnId);
|
||||
break;
|
||||
case ACTION_T_KILLED_MONSTER:
|
||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.killed_monster.creatureId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j+1, action.killed_monster.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.killed_monster.creatureId);
|
||||
if (action.killed_monster.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_SET_INST_DATA:
|
||||
if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j + 1);
|
||||
if (action.set_inst_data.value > 4/*SPECIAL*/)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_SET_INST_DATA64:
|
||||
if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j + 1);
|
||||
if (action.set_inst_data64.target >= TARGET_T_END)
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1);
|
||||
break;
|
||||
case ACTION_T_UPDATE_TEMPLATE:
|
||||
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.update_template.creatureId))
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j+1, action.update_template.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent creature entry %u.", i, j + 1, action.update_template.creatureId);
|
||||
break;
|
||||
case ACTION_T_SET_SHEATH:
|
||||
if (action.set_sheath.sheath >= MAX_SHEATH_STATE)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j+1, action.set_sheath.sheath);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j + 1, action.set_sheath.sheath);
|
||||
action.set_sheath.sheath = SHEATH_STATE_UNARMED;
|
||||
}
|
||||
break;
|
||||
|
|
@ -760,7 +760,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
{
|
||||
if (action.invincibility_hp_level.hp_level > 100)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j + 1, action.invincibility_hp_level.hp_level);
|
||||
action.invincibility_hp_level.hp_level = 100;
|
||||
}
|
||||
}
|
||||
|
|
@ -770,7 +770,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
{
|
||||
if (action.mount.creatureId && !sCreatureStorage.LookupEntry<CreatureInfo>(action.mount.creatureId))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j + 1, action.mount.creatureId);
|
||||
action.morph.creatureId = 0;
|
||||
}
|
||||
|
||||
|
|
@ -778,12 +778,12 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
{
|
||||
if (action.mount.creatureId)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j + 1, action.mount.modelId, action.mount.creatureId);
|
||||
action.mount.modelId = 0;
|
||||
}
|
||||
else if (!sCreatureDisplayInfoStore.LookupEntry(action.mount.modelId))
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j + 1, action.mount.modelId);
|
||||
action.mount.modelId = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -803,10 +803,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
|||
case ACTION_T_RANDOM_SAY:
|
||||
case ACTION_T_RANDOM_YELL:
|
||||
case ACTION_T_RANDOM_TEXTEMOTE:
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j + 1);
|
||||
break;
|
||||
default:
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, temp.action[j].type);
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j + 1, temp.action[j].type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ void CreatureLinkingHolder::SetFollowing(Creature* pWho, Creature* pWhom)
|
|||
dy = sY - mY;
|
||||
dz = sZ - mZ;
|
||||
|
||||
float dist = sqrt(dx*dx + dy*dy + dz*dz);
|
||||
float dist = sqrt(dx * dx + dy * dy + dz * dz);
|
||||
// REMARK: This code needs the same distance calculation that is used for following
|
||||
// Atm this means we have to subtract the bounding radiuses
|
||||
dist = dist - pWho->GetObjectBoundingRadius() - pWhom->GetObjectBoundingRadius();
|
||||
|
|
@ -595,7 +595,7 @@ bool CreatureLinkingHolder::IsSlaveInRangeOfBoss(Creature* pSlave, Creature* pBo
|
|||
dx = sX - mX;
|
||||
dy = sY - mY;
|
||||
|
||||
return dx*dx + dy*dy < searchRange*searchRange;
|
||||
return dx * dx + dy * dy < searchRange * searchRange;
|
||||
}
|
||||
|
||||
// Function to check if a passive spawning condition is met
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ struct CreatureLinkingInfo
|
|||
uint32 mapId;
|
||||
uint32 masterId;
|
||||
uint32 masterDBGuid;
|
||||
uint16 linkingFlag:16;
|
||||
uint16 searchRange:16;
|
||||
uint16 linkingFlag: 16;
|
||||
uint16 searchRange: 16;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -116,7 +116,7 @@ class CreatureLinkingMgr
|
|||
CreatureLinkingInfo const* GetLinkedTriggerInformation(Creature* pCreature);
|
||||
|
||||
private:
|
||||
typedef std::multimap<uint32 /*slaveEntry*/, CreatureLinkingInfo> CreatureLinkingMap;
|
||||
typedef std::multimap < uint32 /*slaveEntry*/, CreatureLinkingInfo > CreatureLinkingMap;
|
||||
typedef std::pair<CreatureLinkingMap::const_iterator, CreatureLinkingMap::const_iterator> CreatureLinkingMapBounds;
|
||||
|
||||
// Storage of Data: npc_entry_slave, (map, npc_entry_master, flag, master_db_guid[If Unique], search_range)
|
||||
|
|
@ -163,8 +163,8 @@ class CreatureLinkingHolder
|
|||
// Structure associated to a master (entry case)
|
||||
struct InfoAndGuids
|
||||
{
|
||||
uint16 linkingFlag:16;
|
||||
uint16 searchRange:16;
|
||||
uint16 linkingFlag: 16;
|
||||
uint16 searchRange: 16;
|
||||
GuidList linkedGuids;
|
||||
};
|
||||
// Structure associated to a master (guid case)
|
||||
|
|
@ -174,9 +174,9 @@ class CreatureLinkingHolder
|
|||
ObjectGuid linkedGuid;
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32 /*masterEntryOrGuid*/, InfoAndGuids> HolderMap;
|
||||
typedef std::multimap < uint32 /*masterEntryOrGuid*/, InfoAndGuids > HolderMap;
|
||||
typedef std::pair<HolderMap::iterator, HolderMap::iterator> HolderMapBounds;
|
||||
typedef std::multimap<uint32 /*Entry*/, ObjectGuid> BossGuidMap;
|
||||
typedef std::multimap < uint32 /*Entry*/, ObjectGuid > BossGuidMap;
|
||||
typedef std::pair<BossGuidMap::iterator, BossGuidMap::iterator> BossGuidMapBounds;
|
||||
|
||||
// Helper function, to process a slave list
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ enum AchievementCriteriaTypes
|
|||
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND= 15,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP= 16,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DEATH= 17,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND = 15,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP = 16,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DEATH = 17,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20,
|
||||
|
|
@ -117,7 +117,7 @@ enum AchievementCriteriaTypes
|
|||
ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL= 29,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL = 29,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE = 30,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32,
|
||||
|
|
@ -132,18 +132,18 @@ enum AchievementCriteriaTypes
|
|||
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM= 42,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM = 42,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK= 44,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT= 45,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION= 46,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK = 44,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT = 45,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION = 46,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION = 47,
|
||||
// noted: rewarded as soon as the player payed, not at taking place at the seat
|
||||
ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP= 48,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49,
|
||||
// TODO: itemlevel is mentioned in text but not present in dbc
|
||||
ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT= 51,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT = 51,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54,
|
||||
|
|
@ -160,20 +160,20 @@ enum AchievementCriteriaTypes
|
|||
ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL = 66,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2= 69,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL= 70,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72,
|
||||
// TODO: title id is not mentioned in dbc
|
||||
ACHIEVEMENT_CRITERIA_TYPE_ON_LOGIN = 74,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS= 75,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77,
|
||||
// TODO: creature type (demon, undead etc.) is not stored in dbc
|
||||
ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS= 80,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION= 82,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID= 83,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS= 84,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS = 80,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION = 82,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID = 83,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS = 84,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD = 85,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED = 86,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION = 87,
|
||||
|
|
@ -200,7 +200,7 @@ enum AchievementCriteriaTypes
|
|||
ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109,
|
||||
// TODO: target entry is missing
|
||||
ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE = 112,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114,
|
||||
ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115,
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
#include <map>
|
||||
|
||||
typedef std::map<uint16,uint32> AreaFlagByAreaID;
|
||||
typedef std::map<uint32,uint32> AreaFlagByMapID;
|
||||
typedef std::map<uint16, uint32> AreaFlagByAreaID;
|
||||
typedef std::map<uint32, uint32> AreaFlagByMapID;
|
||||
|
||||
struct WMOAreaTableTripple
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ struct WMOAreaTableTripple
|
|||
|
||||
bool operator <(const WMOAreaTableTripple& b) const
|
||||
{
|
||||
return memcmp(this, &b, sizeof(WMOAreaTableTripple))<0;
|
||||
return memcmp(this, &b, sizeof(WMOAreaTableTripple)) < 0;
|
||||
}
|
||||
|
||||
// ordered by entropy; that way memcmp will have a minimal medium runtime
|
||||
|
|
@ -83,7 +83,7 @@ DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore(DurabilityCostsfmt);
|
|||
DBCStorage <EmotesEntry> sEmotesStore(EmotesEntryfmt);
|
||||
DBCStorage <EmotesTextEntry> sEmotesTextStore(EmotesTextEntryfmt);
|
||||
|
||||
typedef std::map<uint32,SimpleFactionsList> FactionTeamMap;
|
||||
typedef std::map<uint32, SimpleFactionsList> FactionTeamMap;
|
||||
static FactionTeamMap sFactionTeamMap;
|
||||
DBCStorage <FactionEntry> sFactionStore(FactionEntryfmt);
|
||||
DBCStorage <FactionTemplateEntry> sFactionTemplateStore(FactionTemplateEntryfmt);
|
||||
|
|
@ -215,10 +215,10 @@ static bool ReadDBCBuildFileText(const std::string& dbc_path, char const* locale
|
|||
{
|
||||
std::string filename = dbc_path + "component.wow-" + localeName + ".txt";
|
||||
|
||||
if (FILE* file = fopen(filename.c_str(),"rb"))
|
||||
if (FILE* file = fopen(filename.c_str(), "rb"))
|
||||
{
|
||||
char buf[100];
|
||||
fread(buf,1,100-1,file);
|
||||
fread(buf, 1, 100 - 1, file);
|
||||
fclose(file);
|
||||
|
||||
text = &buf[0];
|
||||
|
|
@ -236,7 +236,7 @@ static uint32 ReadDBCBuild(const std::string& dbc_path, LocaleNameStr const* loc
|
|||
{
|
||||
for (LocaleNameStr const* itr = &fullLocaleNameList[0]; itr->name; ++itr)
|
||||
{
|
||||
if (ReadDBCBuildFileText(dbc_path,itr->name,text))
|
||||
if (ReadDBCBuildFileText(dbc_path, itr->name, text))
|
||||
{
|
||||
localeNameStr = itr;
|
||||
break;
|
||||
|
|
@ -244,18 +244,18 @@ static uint32 ReadDBCBuild(const std::string& dbc_path, LocaleNameStr const* loc
|
|||
}
|
||||
}
|
||||
else
|
||||
ReadDBCBuildFileText(dbc_path,localeNameStr->name,text);
|
||||
ReadDBCBuildFileText(dbc_path, localeNameStr->name, text);
|
||||
|
||||
if (text.empty())
|
||||
return 0;
|
||||
|
||||
size_t pos = text.find("version=\"");
|
||||
size_t pos1 = pos + strlen("version=\"");
|
||||
size_t pos2 = text.find("\"",pos1);
|
||||
size_t pos2 = text.find("\"", pos1);
|
||||
if (pos == text.npos || pos2 == text.npos || pos1 >= pos2)
|
||||
return 0;
|
||||
|
||||
std::string build_str = text.substr(pos1,pos2-pos1);
|
||||
std::string build_str = text.substr(pos1, pos2 - pos1);
|
||||
|
||||
int build = atoi(build_str.c_str());
|
||||
if (build <= 0)
|
||||
|
|
@ -264,9 +264,9 @@ static uint32 ReadDBCBuild(const std::string& dbc_path, LocaleNameStr const* loc
|
|||
return build;
|
||||
}
|
||||
|
||||
static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& filename)
|
||||
static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename)
|
||||
{
|
||||
sLog.outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).",filename.c_str(),fsize,rsize);
|
||||
sLog.outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
|
||||
|
||||
// ASSERT must fail after function call
|
||||
return false;
|
||||
|
|
@ -275,7 +275,7 @@ static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& f
|
|||
struct LocalData
|
||||
{
|
||||
LocalData(uint32 build)
|
||||
: main_build(build), availableDbcLocales(0xFFFFFFFF),checkedDbcLocaleBuilds(0) {}
|
||||
: main_build(build), availableDbcLocales(0xFFFFFFFF), checkedDbcLocaleBuilds(0) {}
|
||||
|
||||
uint32 main_build;
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ template<class T>
|
|||
inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
|
||||
{
|
||||
// compatibility format and C++ structure sizes
|
||||
MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
|
||||
MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), sizeof(T), filename));
|
||||
|
||||
std::string dbc_filename = dbc_path + filename;
|
||||
if (storage.Load(dbc_filename.c_str()))
|
||||
|
|
@ -305,20 +305,20 @@ inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& err
|
|||
|
||||
if (!(localeData.checkedDbcLocaleBuilds & (1 << i)))
|
||||
{
|
||||
localeData.checkedDbcLocaleBuilds |= (1<<i);// mark as checked for speedup next checks
|
||||
localeData.checkedDbcLocaleBuilds |= (1 << i); // mark as checked for speedup next checks
|
||||
|
||||
|
||||
uint32 build_loc = ReadDBCBuild(dbc_dir_loc,localStr);
|
||||
uint32 build_loc = ReadDBCBuild(dbc_dir_loc, localStr);
|
||||
if (localeData.main_build != build_loc)
|
||||
{
|
||||
localeData.availableDbcLocales &= ~(1<<i); // mark as not available for speedup next checks
|
||||
localeData.availableDbcLocales &= ~(1 << i); // mark as not available for speedup next checks
|
||||
|
||||
// exist but wrong build
|
||||
if (build_loc)
|
||||
{
|
||||
std::string dbc_filename_loc = dbc_path + localStr->name + "/" + filename;
|
||||
char buf[200];
|
||||
snprintf(buf,200," (exist, but DBC locale subdir %s have DBCs for build %u instead expected build %u, it and other DBC from subdir skipped)",localStr->name,build_loc,localeData.main_build);
|
||||
snprintf(buf, 200, " (exist, but DBC locale subdir %s have DBCs for build %u instead expected build %u, it and other DBC from subdir skipped)", localStr->name, build_loc, localeData.main_build);
|
||||
errlist.push_back(dbc_filename_loc + buf);
|
||||
}
|
||||
|
||||
|
|
@ -328,13 +328,13 @@ inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& err
|
|||
|
||||
std::string dbc_filename_loc = dbc_path + localStr->name + "/" + filename;
|
||||
if (!storage.LoadStringsFrom(dbc_filename_loc.c_str()))
|
||||
localeData.availableDbcLocales &= ~(1<<i); // mark as not available for speedup next checks
|
||||
localeData.availableDbcLocales &= ~(1 << i); // mark as not available for speedup next checks
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// sort problematic dbc to (1) non compatible and (2) nonexistent
|
||||
FILE* f=fopen(dbc_filename.c_str(),"rb");
|
||||
FILE* f = fopen(dbc_filename.c_str(), "rb");
|
||||
if (f)
|
||||
{
|
||||
char buf[100];
|
||||
|
|
@ -349,7 +349,7 @@ inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& err
|
|||
|
||||
void LoadDBCStores(const std::string& dataPath)
|
||||
{
|
||||
std::string dbcPath = dataPath+"dbc/";
|
||||
std::string dbcPath = dataPath + "dbc/";
|
||||
|
||||
uint32 build = ReadDBCBuild(dbcPath);
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
if (build)
|
||||
sLog.outError("Found DBC files for build %u but mangosd expected DBC for one from builds: %s Please extract correct DBC files.", build, AcceptableClientBuildsListStr().c_str());
|
||||
else
|
||||
sLog.outError("Incorrect DataDir value in mangosd.conf or not found build info (outdated DBC files). Required one from builds: %s Please extract correct DBC files.",AcceptableClientBuildsListStr().c_str());
|
||||
sLog.outError("Incorrect DataDir value in mangosd.conf or not found build info (outdated DBC files). Required one from builds: %s Please extract correct DBC files.", AcceptableClientBuildsListStr().c_str());
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -372,7 +372,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
|
||||
LocalData availableDbcLocales(build);
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaStore, dbcPath,"AreaTable.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAreaStore, dbcPath, "AreaTable.dbc");
|
||||
|
||||
// must be after sAreaStore loading
|
||||
for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
|
||||
|
|
@ -380,41 +380,41 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
if (AreaTableEntry const* area = sAreaStore.LookupEntry(i))
|
||||
{
|
||||
// fill AreaId->DBC records
|
||||
sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID),area->exploreFlag));
|
||||
sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID), area->exploreFlag));
|
||||
|
||||
// fill MapId->DBC records ( skip sub zones and continents )
|
||||
if (area->zone==0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571)
|
||||
sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid,area->exploreFlag));
|
||||
if (area->zone == 0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571)
|
||||
sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid, area->exploreFlag));
|
||||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAchievementStore, dbcPath,"Achievement.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAchievementCriteriaStore, dbcPath,"Achievement_Criteria.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaTriggerStore, dbcPath,"AreaTrigger.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaGroupStore, dbcPath,"AreaGroup.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAuctionHouseStore, dbcPath,"AuctionHouse.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBankBagSlotPricesStore, dbcPath,"BankBagSlotPrices.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBattlemasterListStore, dbcPath,"BattlemasterList.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBarberShopStyleStore, dbcPath,"BarberShopStyle.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCharStartOutfitStore, dbcPath,"CharStartOutfit.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCharTitlesStore, dbcPath,"CharTitles.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChatChannelsStore, dbcPath,"ChatChannels.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrClassesStore, dbcPath,"ChrClasses.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrRacesStore, dbcPath,"ChrRaces.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCinematicSequencesStore, dbcPath,"CinematicSequences.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureDisplayInfoStore, dbcPath,"CreatureDisplayInfo.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureDisplayInfoExtraStore,dbcPath,"CreatureDisplayInfoExtra.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureFamilyStore, dbcPath,"CreatureFamily.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureSpellDataStore, dbcPath,"CreatureSpellData.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureTypeStore, dbcPath,"CreatureType.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCurrencyTypesStore, dbcPath,"CurrencyTypes.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sDungeonEncounterStore, dbcPath,"DungeonEncounter.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sDurabilityCostsStore, dbcPath,"DurabilityCosts.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sDurabilityQualityStore, dbcPath,"DurabilityQuality.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sEmotesStore, dbcPath,"Emotes.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sEmotesTextStore, dbcPath,"EmotesText.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sFactionStore, dbcPath,"Faction.dbc");
|
||||
for (uint32 i=0; i<sFactionStore.GetNumRows(); ++i)
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sBarberShopStyleStore, dbcPath, "BarberShopStyle.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCreatureDisplayInfoExtraStore, dbcPath, "CreatureDisplayInfoExtra.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCreatureSpellDataStore, dbcPath, "CreatureSpellData.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCreatureTypeStore, dbcPath, "CreatureType.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCurrencyTypesStore, dbcPath, "CurrencyTypes.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sDungeonEncounterStore, dbcPath, "DungeonEncounter.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sDurabilityCostsStore, dbcPath, "DurabilityCosts.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sDurabilityQualityStore, dbcPath, "DurabilityQuality.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sEmotesStore, dbcPath, "Emotes.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sEmotesTextStore, dbcPath, "EmotesText.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sFactionStore, dbcPath, "Faction.dbc");
|
||||
for (uint32 i = 0; i < sFactionStore.GetNumRows(); ++i)
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(i);
|
||||
if (faction && faction->team)
|
||||
|
|
@ -424,67 +424,67 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sFactionTemplateStore, dbcPath,"FactionTemplate.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGameObjectDisplayInfoStore,dbcPath,"GameObjectDisplayInfo.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGemPropertiesStore, dbcPath,"GemProperties.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGlyphPropertiesStore, dbcPath,"GlyphProperties.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGlyphSlotStore, dbcPath,"GlyphSlot.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sFactionTemplateStore, dbcPath, "FactionTemplate.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGameObjectDisplayInfoStore, dbcPath, "GameObjectDisplayInfo.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGemPropertiesStore, dbcPath, "GemProperties.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGlyphPropertiesStore, dbcPath, "GlyphProperties.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGlyphSlotStore, dbcPath, "GlyphSlot.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtBarberShopCostBaseStore,dbcPath,"gtBarberShopCostBase.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtCombatRatingsStore, dbcPath,"gtCombatRatings.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtBarberShopCostBaseStore, dbcPath, "gtBarberShopCostBase.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtCombatRatingsStore, dbcPath, "gtCombatRatings.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToMeleeCritBaseStore, dbcPath,"gtChanceToMeleeCritBase.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToMeleeCritStore, dbcPath,"gtChanceToMeleeCrit.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToMeleeCritBaseStore, dbcPath, "gtChanceToMeleeCritBase.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToMeleeCritStore, dbcPath, "gtChanceToMeleeCrit.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToSpellCritBaseStore, dbcPath,"gtChanceToSpellCritBase.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToSpellCritStore, dbcPath,"gtChanceToSpellCrit.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToSpellCritBaseStore, dbcPath, "gtChanceToSpellCritBase.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToSpellCritStore, dbcPath, "gtChanceToSpellCrit.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTClassCombatRatingScalarStore,dbcPath,"gtOCTClassCombatRatingScalar.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenHPStore, dbcPath,"gtOCTRegenHP.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTClassCombatRatingScalarStore, dbcPath, "gtOCTClassCombatRatingScalar.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc");
|
||||
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenHPPerSptStore, dbcPath,"gtRegenHPPerSpt.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenMPPerSptStore, dbcPath,"gtRegenMPPerSpt.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sHolidaysStore, dbcPath,"Holidays.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemStore, dbcPath,"Item.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemBagFamilyStore, dbcPath,"ItemBagFamily.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemClassStore, dbcPath,"ItemClass.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemStore, dbcPath, "Item.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc");
|
||||
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently
|
||||
//LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemExtendedCostStore, dbcPath,"ItemExtendedCost.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemLimitCategoryStore, dbcPath,"ItemLimitCategory.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemRandomPropertiesStore,dbcPath,"ItemRandomProperties.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemRandomSuffixStore, dbcPath,"ItemRandomSuffix.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemSetStore, dbcPath,"ItemSet.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sLockStore, dbcPath,"Lock.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMailTemplateStore, dbcPath,"MailTemplate.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMapStore, dbcPath,"Map.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMailTemplateStore, dbcPath, "MailTemplate.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMapStore, dbcPath, "Map.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMapDifficultyStore, dbcPath,"MapDifficulty.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMapDifficultyStore, dbcPath, "MapDifficulty.dbc");
|
||||
// fill data
|
||||
for (uint32 i = 1; i < sMapDifficultyStore.GetNumRows(); ++i)
|
||||
if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
|
||||
sMapDifficultyMap[MAKE_PAIR32(entry->MapId,entry->Difficulty)] = MapDifficulty(entry->resetTime,entry->maxPlayers);
|
||||
sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers);
|
||||
sMapDifficultyStore.Clear();
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sOverrideSpellDataStore, dbcPath,"OverrideSpellData.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestXPLevelStore, dbcPath,"QuestXP.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPvPDifficultyStore, dbcPath,"PvpDifficulty.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestFactionRewardStore, dbcPath, "QuestFactionReward.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestXPLevelStore, dbcPath, "QuestXP.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc");
|
||||
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
||||
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
||||
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
|
||||
MANGOS_ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatValuesStore, dbcPath,"ScalingStatValues.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineStore, dbcPath,"SkillLine.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineAbilityStore, dbcPath,"SkillLineAbility.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillRaceClassInfoStore, dbcPath,"SkillRaceClassInfo.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSoundEntriesStore, dbcPath,"SoundEntries.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellStore, dbcPath,"Spell.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc");
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const* spell = sSpellStore.LookupEntry(i);
|
||||
|
|
@ -494,7 +494,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
// DBC not support uint64 fields but SpellEntry have SpellFamilyFlags mapped at 2 uint32 fields
|
||||
// uint32 field already converted to bigendian if need, but must be swapped for correct uint64 bigendian view
|
||||
#if MANGOS_ENDIAN == MANGOS_BIGENDIAN
|
||||
std::swap(*((uint32*)(&spell->SpellFamilyFlags)),*(((uint32*)(&spell->SpellFamilyFlags))+1));
|
||||
std::swap(*((uint32*)(&spell->SpellFamilyFlags)), *(((uint32*)(&spell->SpellFamilyFlags)) + 1));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -522,19 +522,19 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCastTimesStore, dbcPath,"SpellCastTimes.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellDurationStore, dbcPath,"SpellDuration.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellDifficultyStore, dbcPath,"SpellDifficulty.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellFocusObjectStore, dbcPath,"SpellFocusObject.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellItemEnchantmentStore,dbcPath,"SpellItemEnchantment.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellItemEnchantmentConditionStore,dbcPath,"SpellItemEnchantmentCondition.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellRadiusStore, dbcPath,"SpellRadius.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellRangeStore, dbcPath,"SpellRange.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellRuneCostStore, dbcPath,"SpellRuneCost.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellShapeshiftFormStore, dbcPath,"SpellShapeshiftForm.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sStableSlotPricesStore, dbcPath,"StableSlotPrices.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSummonPropertiesStore, dbcPath,"SummonProperties.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentStore, dbcPath,"Talent.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");
|
||||
|
||||
// create talent spells set
|
||||
for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
|
|
@ -543,10 +543,10 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
if (!talentInfo) continue;
|
||||
for (int j = 0; j < MAX_TALENT_RANK; j++)
|
||||
if (talentInfo->RankID[j])
|
||||
sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i,j);
|
||||
sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j);
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentTabStore, dbcPath,"TalentTab.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTalentTabStore, dbcPath, "TalentTab.dbc");
|
||||
|
||||
// prepare fast data access to bit pos of talent ranks for use at inspecting
|
||||
{
|
||||
|
|
@ -558,27 +558,27 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
continue;
|
||||
|
||||
// prevent memory corruption; otherwise cls will become 12 below
|
||||
if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE)==0)
|
||||
if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) == 0)
|
||||
continue;
|
||||
|
||||
// store class talent tab pages
|
||||
uint32 cls = 1;
|
||||
for (uint32 m=1; !(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES; m <<=1, ++cls) {}
|
||||
for (uint32 m = 1; !(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES; m <<= 1, ++cls) {}
|
||||
|
||||
sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId;
|
||||
sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId;
|
||||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiNodesStore, dbcPath,"TaxiNodes.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTaxiNodesStore, dbcPath, "TaxiNodes.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiPathStore, dbcPath,"TaxiPath.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTaxiPathStore, dbcPath, "TaxiPath.dbc");
|
||||
for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
|
||||
if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
|
||||
sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID,entry->price);
|
||||
sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price);
|
||||
uint32 pathCount = sTaxiPathStore.GetNumRows();
|
||||
|
||||
//## TaxiPathNode.dbc ## Loaded only for initialization different structures
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiPathNodeStore, dbcPath,"TaxiPathNode.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTaxiPathNodeStore, dbcPath, "TaxiPathNode.dbc");
|
||||
// Calculate path nodes count
|
||||
std::vector<uint32> pathLength;
|
||||
pathLength.resize(pathCount); // 0 and some other indexes not used
|
||||
|
|
@ -603,12 +603,12 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
std::set<uint32> spellPaths;
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
if (SpellEntry const* sInfo = sSpellStore.LookupEntry(i))
|
||||
for (int j=0; j < MAX_EFFECT_INDEX; ++j)
|
||||
if (sInfo->Effect[j]==123 /*SPELL_EFFECT_SEND_TAXI*/)
|
||||
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
|
||||
if (sInfo->Effect[j] == 123 /*SPELL_EFFECT_SEND_TAXI*/)
|
||||
spellPaths.insert(sInfo->EffectMiscValue[j]);
|
||||
|
||||
memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
memset(sOldContinentsNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask));
|
||||
memset(sOldContinentsNodesMask, 0, sizeof(sTaxiNodesMask));
|
||||
for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
{
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
|
||||
|
|
@ -616,13 +616,13 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
continue;
|
||||
|
||||
TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i);
|
||||
if (src_i!=sTaxiPathSetBySource.end() && !src_i->second.empty())
|
||||
if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty())
|
||||
{
|
||||
bool ok = false;
|
||||
for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
|
||||
{
|
||||
// not spell path
|
||||
if (spellPaths.find(dest_i->second.ID)==spellPaths.end())
|
||||
if (spellPaths.find(dest_i->second.ID) == spellPaths.end())
|
||||
{
|
||||
ok = true;
|
||||
break;
|
||||
|
|
@ -635,7 +635,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
|
||||
// valid taxi network node
|
||||
uint8 field = (uint8)((i - 1) / 32);
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
uint32 submask = 1 << ((i - 1) % 32);
|
||||
sTaxiNodesMask[field] |= submask;
|
||||
|
||||
// old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
|
||||
|
|
@ -644,12 +644,12 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
}
|
||||
}
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTeamContributionPoints, dbcPath,"TeamContributionPoints.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapAreaStore, dbcPath,"WorldMapArea.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWMOAreaTableStore, dbcPath,"WMOAreaTable.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTeamContributionPoints, dbcPath, "TeamContributionPoints.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sVehicleSeatStore, dbcPath, "VehicleSeat.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sWorldMapAreaStore, dbcPath, "WorldMapArea.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sWMOAreaTableStore, dbcPath, "WMOAreaTable.dbc");
|
||||
for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i)
|
||||
{
|
||||
if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i))
|
||||
|
|
@ -657,13 +657,13 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->rootId, entry->adtId, entry->groupId), entry));
|
||||
}
|
||||
}
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapOverlayStore, dbcPath,"WorldMapOverlay.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldSafeLocsStore, dbcPath,"WorldSafeLocs.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sWorldMapOverlayStore, dbcPath, "WorldMapOverlay.dbc");
|
||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sWorldSafeLocsStore, dbcPath, "WorldSafeLocs.dbc");
|
||||
|
||||
// error checks
|
||||
if (bad_dbc_files.size() >= DBCFilesCount)
|
||||
{
|
||||
sLog.outError("\nIncorrect DataDir value in mangosd.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str());
|
||||
sLog.outError("\nIncorrect DataDir value in mangosd.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFilesCount, dataPath.c_str());
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -673,7 +673,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
for (std::list<std::string>::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
|
||||
str += *i + "\n";
|
||||
|
||||
sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str());
|
||||
sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFilesCount, str.c_str());
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -687,7 +687,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
!sMapStore.LookupEntry(724) || // last map added in 3.3.5a
|
||||
!sSpellStore.LookupEntry(80864)) // last added spell in 3.3.5a
|
||||
{
|
||||
sLog.outError("\nYou have mixed version DBC files. Please re-extract DBC files for one from client build: %s",AcceptableClientBuildsListStr().c_str());
|
||||
sLog.outError("\nYou have mixed version DBC files. Please re-extract DBC files for one from client build: %s", AcceptableClientBuildsListStr().c_str());
|
||||
Log::WaitBeforeContinueIfNeed();
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -699,7 +699,7 @@ void LoadDBCStores(const std::string& dataPath)
|
|||
SimpleFactionsList const* GetFactionTeamList(uint32 faction)
|
||||
{
|
||||
FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
|
||||
if (itr==sFactionTeamMap.end())
|
||||
if (itr == sFactionTeamMap.end())
|
||||
return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
|
|
@ -711,13 +711,13 @@ char const* GetPetName(uint32 petfamily, uint32 dbclang)
|
|||
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
|
||||
if (!pet_family)
|
||||
return NULL;
|
||||
return pet_family->Name[dbclang]?pet_family->Name[dbclang]:NULL;
|
||||
return pet_family->Name[dbclang] ? pet_family->Name[dbclang] : NULL;
|
||||
}
|
||||
|
||||
TalentSpellPos const* GetTalentSpellPos(uint32 spellId)
|
||||
{
|
||||
TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId);
|
||||
if (itr==sTalentSpellPosMap.end())
|
||||
if (itr == sTalentSpellPosMap.end())
|
||||
return NULL;
|
||||
|
||||
return &itr->second;
|
||||
|
|
@ -726,7 +726,7 @@ TalentSpellPos const* GetTalentSpellPos(uint32 spellId)
|
|||
uint32 GetTalentSpellCost(TalentSpellPos const* pos)
|
||||
{
|
||||
if (pos)
|
||||
return pos->rank+1;
|
||||
return pos->rank + 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -763,7 +763,7 @@ AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
|
|||
return sAreaStore.LookupEntry(areaflag);
|
||||
}
|
||||
|
||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id)
|
||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id)
|
||||
{
|
||||
if (area_flag)
|
||||
return sAreaStore.LookupEntry(area_flag);
|
||||
|
|
@ -796,7 +796,7 @@ uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
|
|||
|
||||
ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId)
|
||||
{
|
||||
mapid = GetVirtualMapForMapAndZone(mapid,zoneId);
|
||||
mapid = GetVirtualMapForMapAndZone(mapid, zoneId);
|
||||
if (mapid < 2)
|
||||
return CONTENT_1_60;
|
||||
|
||||
|
|
@ -826,9 +826,9 @@ ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id)
|
|||
|
||||
bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
|
||||
{
|
||||
if (requiredTotemCategoryId==0)
|
||||
if (requiredTotemCategoryId == 0)
|
||||
return true;
|
||||
if (itemTotemCategoryId==0)
|
||||
if (itemTotemCategoryId == 0)
|
||||
return false;
|
||||
|
||||
TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
|
||||
|
|
@ -838,13 +838,13 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT
|
|||
if (!reqEntry)
|
||||
return false;
|
||||
|
||||
if (itemEntry->categoryType!=reqEntry->categoryType)
|
||||
if (itemEntry->categoryType != reqEntry->categoryType)
|
||||
return false;
|
||||
|
||||
return (itemEntry->categoryMask & reqEntry->categoryMask)==reqEntry->categoryMask;
|
||||
return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask;
|
||||
}
|
||||
|
||||
bool Zone2MapCoordinates(float& x,float& y,uint32 zone)
|
||||
bool Zone2MapCoordinates(float& x, float& y, uint32 zone)
|
||||
{
|
||||
WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
|
||||
|
||||
|
|
@ -852,14 +852,14 @@ bool Zone2MapCoordinates(float& x,float& y,uint32 zone)
|
|||
if (!maEntry || maEntry->x2 == maEntry->x1 || maEntry->y2 == maEntry->y1)
|
||||
return false;
|
||||
|
||||
std::swap(x,y); // at client map coords swapped
|
||||
x = x*((maEntry->x2-maEntry->x1)/100)+maEntry->x1;
|
||||
y = y*((maEntry->y2-maEntry->y1)/100)+maEntry->y1; // client y coord from top to down
|
||||
std::swap(x, y); // at client map coords swapped
|
||||
x = x * ((maEntry->x2 - maEntry->x1) / 100) + maEntry->x1;
|
||||
y = y * ((maEntry->y2 - maEntry->y1) / 100) + maEntry->y1; // client y coord from top to down
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Map2ZoneCoordinates(float& x,float& y,uint32 zone)
|
||||
bool Map2ZoneCoordinates(float& x, float& y, uint32 zone)
|
||||
{
|
||||
WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
|
||||
|
||||
|
|
@ -867,16 +867,16 @@ bool Map2ZoneCoordinates(float& x,float& y,uint32 zone)
|
|||
if (!maEntry || maEntry->x2 == maEntry->x1 || maEntry->y2 == maEntry->y1)
|
||||
return false;
|
||||
|
||||
x = (x-maEntry->x1)/((maEntry->x2-maEntry->x1)/100);
|
||||
y = (y-maEntry->y1)/((maEntry->y2-maEntry->y1)/100); // client y coord from top to down
|
||||
std::swap(x,y); // client have map coords swapped
|
||||
x = (x - maEntry->x1) / ((maEntry->x2 - maEntry->x1) / 100);
|
||||
y = (y - maEntry->y1) / ((maEntry->y2 - maEntry->y1) / 100); // client y coord from top to down
|
||||
std::swap(x, y); // client have map coords swapped
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
|
||||
{
|
||||
MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId,difficulty));
|
||||
MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId, difficulty));
|
||||
return itr != sMapDifficultyMap.end() ? &itr->second : NULL;
|
||||
}
|
||||
|
||||
|
|
@ -927,8 +927,8 @@ bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, flo
|
|||
if (atEntry->radius > 0)
|
||||
{
|
||||
// if we have radius check it
|
||||
float dist2 = (x-atEntry->x)*(x-atEntry->x) + (y-atEntry->y)*(y-atEntry->y) + (z-atEntry->z)*(z-atEntry->z);
|
||||
if (dist2 > (atEntry->radius + delta)*(atEntry->radius + delta))
|
||||
float dist2 = (x - atEntry->x) * (x - atEntry->x) + (y - atEntry->y) * (y - atEntry->y) + (z - atEntry->z) * (z - atEntry->z);
|
||||
if (dist2 > (atEntry->radius + delta) * (atEntry->radius + delta))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
|
@ -939,23 +939,23 @@ bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, flo
|
|||
// is-in-cube check and we have to calculate only one point instead of 4
|
||||
|
||||
// 2PI = 360, keep in mind that ingame orientation is counter-clockwise
|
||||
double rotation = 2*M_PI-atEntry->box_orientation;
|
||||
double rotation = 2 * M_PI - atEntry->box_orientation;
|
||||
double sinVal = sin(rotation);
|
||||
double cosVal = cos(rotation);
|
||||
|
||||
float playerBoxDistX = x - atEntry->x;
|
||||
float playerBoxDistY = y - atEntry->y;
|
||||
|
||||
float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
|
||||
float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
|
||||
float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY * sinVal);
|
||||
float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX * sinVal);
|
||||
|
||||
// box edges are parallel to coordiante axis, so we can treat every dimension independently :D
|
||||
float dz = z - atEntry->z;
|
||||
float dx = rotPlayerX - atEntry->x;
|
||||
float dy = rotPlayerY - atEntry->y;
|
||||
if ((fabs(dx) > atEntry->box_x/2 + delta) ||
|
||||
(fabs(dy) > atEntry->box_y/2 + delta) ||
|
||||
(fabs(dz) > atEntry->box_z/2 + delta))
|
||||
if ((fabs(dx) > atEntry->box_x / 2 + delta) ||
|
||||
(fabs(dy) > atEntry->box_y / 2 + delta) ||
|
||||
(fabs(dz) > atEntry->box_z / 2 + delta))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ uint32 GetAreaFlagByMapId(uint32 mapid);
|
|||
WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
|
||||
|
||||
MANGOS_DLL_SPEC AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
|
||||
MANGOS_DLL_SPEC AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id);
|
||||
MANGOS_DLL_SPEC AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id);
|
||||
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId);
|
||||
|
||||
|
|
@ -58,10 +58,10 @@ ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id);
|
|||
|
||||
bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId);
|
||||
|
||||
bool Zone2MapCoordinates(float& x,float& y,uint32 zone);
|
||||
bool Map2ZoneCoordinates(float& x,float& y,uint32 zone);
|
||||
bool Zone2MapCoordinates(float& x, float& y, uint32 zone);
|
||||
bool Map2ZoneCoordinates(float& x, float& y, uint32 zone);
|
||||
|
||||
typedef std::map<uint32/*pair32(map,diff)*/,MapDifficulty> MapDifficultyMap;
|
||||
typedef std::map < uint32/*pair32(map,diff)*/, MapDifficulty > MapDifficultyMap;
|
||||
MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
|
||||
|
||||
// natural order for difficulties up-down iteration
|
||||
|
|
|
|||
|
|
@ -913,7 +913,7 @@ struct FactionTemplateEntry
|
|||
}
|
||||
return (hostileMask & entry.ourMask) != 0;
|
||||
}
|
||||
bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
|
||||
bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) != 0; }
|
||||
bool IsNeutralToAll() const
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
|
|
@ -921,7 +921,7 @@ struct FactionTemplateEntry
|
|||
return false;
|
||||
return hostileMask == 0 && friendlyMask == 0;
|
||||
}
|
||||
bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; }
|
||||
bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
|
||||
};
|
||||
|
||||
struct GameObjectDisplayInfoEntry
|
||||
|
|
@ -1259,10 +1259,10 @@ struct MapEntry
|
|||
bool IsMountAllowed() const
|
||||
{
|
||||
return !IsDungeon() ||
|
||||
MapID==209 || MapID==269 || MapID==309 || // TanarisInstance, CavernsOfTime, Zul'gurub
|
||||
MapID==509 || MapID==534 || MapID==560 || // AhnQiraj, HyjalPast, HillsbradPast
|
||||
MapID==568 || MapID==580 || MapID==595 || // ZulAman, Sunwell Plateau, Culling of Stratholme
|
||||
MapID==603 || MapID==615 || MapID==616; // Ulduar, The Obsidian Sanctum, The Eye Of Eternity
|
||||
MapID == 209 || MapID == 269 || MapID == 309 || // TanarisInstance, CavernsOfTime, Zul'gurub
|
||||
MapID == 509 || MapID == 534 || MapID == 560 || // AhnQiraj, HyjalPast, HillsbradPast
|
||||
MapID == 568 || MapID == 580 || MapID == 595 || // ZulAman, Sunwell Plateau, Culling of Stratholme
|
||||
MapID == 603 || MapID == 615 || MapID == 616; // Ulduar, The Obsidian Sanctum, The Eye Of Eternity
|
||||
}
|
||||
|
||||
bool IsContinent() const
|
||||
|
|
@ -2100,9 +2100,9 @@ struct WorldSafeLocsEntry
|
|||
#endif
|
||||
|
||||
typedef std::set<uint32> SpellCategorySet;
|
||||
typedef std::map<uint32,SpellCategorySet > SpellCategoryStore;
|
||||
typedef std::map<uint32, SpellCategorySet > SpellCategoryStore;
|
||||
typedef std::set<uint32> PetFamilySpellsSet;
|
||||
typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore;
|
||||
typedef std::map<uint32, PetFamilySpellsSet > PetFamilySpellsStore;
|
||||
|
||||
// Structures not used for casting to loaded DBC data and not required then packing
|
||||
struct MapDifficulty
|
||||
|
|
@ -2123,18 +2123,18 @@ struct TalentSpellPos
|
|||
uint8 rank;
|
||||
};
|
||||
|
||||
typedef std::map<uint32,TalentSpellPos> TalentSpellPosMap;
|
||||
typedef std::map<uint32, TalentSpellPos> TalentSpellPosMap;
|
||||
|
||||
struct TaxiPathBySourceAndDestination
|
||||
{
|
||||
TaxiPathBySourceAndDestination() : ID(0),price(0) {}
|
||||
TaxiPathBySourceAndDestination(uint32 _id,uint32 _price) : ID(_id),price(_price) {}
|
||||
TaxiPathBySourceAndDestination() : ID(0), price(0) {}
|
||||
TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) {}
|
||||
|
||||
uint32 ID;
|
||||
uint32 price;
|
||||
};
|
||||
typedef std::map<uint32,TaxiPathBySourceAndDestination> TaxiPathSetForSource;
|
||||
typedef std::map<uint32,TaxiPathSetForSource> TaxiPathSetBySource;
|
||||
typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource;
|
||||
typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource;
|
||||
|
||||
struct TaxiPathNodePtr
|
||||
{
|
||||
|
|
@ -2146,7 +2146,7 @@ struct TaxiPathNodePtr
|
|||
operator TaxiPathNodeEntry const& () const { return *i_ptr; }
|
||||
};
|
||||
|
||||
typedef Path<TaxiPathNodePtr,TaxiPathNodeEntry const> TaxiPathNodeList;
|
||||
typedef Path<TaxiPathNodePtr, TaxiPathNodeEntry const> TaxiPathNodeList;
|
||||
typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
|
||||
|
||||
#define TaxiMaskSize 14
|
||||
|
|
|
|||
|
|
@ -19,103 +19,103 @@
|
|||
#ifndef MANGOS_DBCSFRM_H
|
||||
#define MANGOS_DBCSFRM_H
|
||||
|
||||
const char Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii";
|
||||
const char AchievementCriteriafmt[]="niiiiiiiissssssssssssssssxixiii";
|
||||
const char AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxixxxxxxx";
|
||||
const char AreaGroupEntryfmt[]="niiiiiii";
|
||||
const char AreaTriggerEntryfmt[]="niffffffff";
|
||||
const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
|
||||
const char BankBagSlotPricesEntryfmt[]="ni";
|
||||
const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
|
||||
const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxiiii";
|
||||
const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
||||
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
const char Achievementfmt[] = "niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii";
|
||||
const char AchievementCriteriafmt[] = "niiiiiiiissssssssssssssssxixiii";
|
||||
const char AreaTableEntryfmt[] = "iiinixxxxxissssssssssssssssxixxxxxxx";
|
||||
const char AreaGroupEntryfmt[] = "niiiiiii";
|
||||
const char AreaTriggerEntryfmt[] = "niffffffff";
|
||||
const char AuctionHouseEntryfmt[] = "niiixxxxxxxxxxxxxxxxx";
|
||||
const char BankBagSlotPricesEntryfmt[] = "ni";
|
||||
const char BarberShopStyleEntryfmt[] = "nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
|
||||
const char BattlemasterListEntryfmt[] = "niiiiiiiiixssssssssssssssssxiiii";
|
||||
const char CharStartOutfitEntryfmt[] = "diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char CharTitlesEntryfmt[] = "nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
||||
const char ChatChannelsEntryfmt[] = "iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
// ChatChannelsEntryfmt, index not used (more compact store)
|
||||
const char ChrClassesEntryfmt[]="nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
||||
const char ChrRacesEntryfmt[]="nxixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
||||
const char CinematicSequencesEntryfmt[]="nxxxxxxxxx";
|
||||
const char CreatureDisplayInfofmt[]="nxxifxxxxxxxxxxx";
|
||||
const char CreatureDisplayInfoExtrafmt[]="nixxxxxxxxxxxxxxxxxxx";
|
||||
const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx";
|
||||
const char CreatureSpellDatafmt[]="niiiixxxx";
|
||||
const char CreatureTypefmt[]="nxxxxxxxxxxxxxxxxxx";
|
||||
const char CurrencyTypesfmt[]="xnxi";
|
||||
const char DungeonEncounterfmt[]="niiiissssssssssssssssxx";
|
||||
const char DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
|
||||
const char DurabilityQualityfmt[]="nf";
|
||||
const char EmotesEntryfmt[]="nxxiiix";
|
||||
const char EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx";
|
||||
const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
const char FactionTemplateEntryfmt[]="niiiiiiiiiiiii";
|
||||
const char GameObjectDisplayInfofmt[]="nxxxxxxxxxxxfxxxxxx";
|
||||
const char GemPropertiesEntryfmt[]="nixxi";
|
||||
const char GlyphPropertiesfmt[]="niii";
|
||||
const char GlyphSlotfmt[]="nii";
|
||||
const char GtBarberShopCostBasefmt[]="f";
|
||||
const char GtCombatRatingsfmt[]="f";
|
||||
const char GtChanceToMeleeCritBasefmt[]="f";
|
||||
const char GtChanceToMeleeCritfmt[]="f";
|
||||
const char GtChanceToSpellCritBasefmt[]="f";
|
||||
const char GtChanceToSpellCritfmt[]="f";
|
||||
const char GtOCTClassCombatRatingScalarfmt[]="df";
|
||||
const char GtOCTRegenHPfmt[]="f";
|
||||
const char ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
||||
const char ChrRacesEntryfmt[] = "nxixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
||||
const char CinematicSequencesEntryfmt[] = "nxxxxxxxxx";
|
||||
const char CreatureDisplayInfofmt[] = "nxxifxxxxxxxxxxx";
|
||||
const char CreatureDisplayInfoExtrafmt[] = "nixxxxxxxxxxxxxxxxxxx";
|
||||
const char CreatureFamilyfmt[] = "nfifiiiiixssssssssssssssssxx";
|
||||
const char CreatureSpellDatafmt[] = "niiiixxxx";
|
||||
const char CreatureTypefmt[] = "nxxxxxxxxxxxxxxxxxx";
|
||||
const char CurrencyTypesfmt[] = "xnxi";
|
||||
const char DungeonEncounterfmt[] = "niiiissssssssssssssssxx";
|
||||
const char DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
|
||||
const char DurabilityQualityfmt[] = "nf";
|
||||
const char EmotesEntryfmt[] = "nxxiiix";
|
||||
const char EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx";
|
||||
const char FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
const char FactionTemplateEntryfmt[] = "niiiiiiiiiiiii";
|
||||
const char GameObjectDisplayInfofmt[] = "nxxxxxxxxxxxfxxxxxx";
|
||||
const char GemPropertiesEntryfmt[] = "nixxi";
|
||||
const char GlyphPropertiesfmt[] = "niii";
|
||||
const char GlyphSlotfmt[] = "nii";
|
||||
const char GtBarberShopCostBasefmt[] = "f";
|
||||
const char GtCombatRatingsfmt[] = "f";
|
||||
const char GtChanceToMeleeCritBasefmt[] = "f";
|
||||
const char GtChanceToMeleeCritfmt[] = "f";
|
||||
const char GtChanceToSpellCritBasefmt[] = "f";
|
||||
const char GtChanceToSpellCritfmt[] = "f";
|
||||
const char GtOCTClassCombatRatingScalarfmt[] = "df";
|
||||
const char GtOCTRegenHPfmt[] = "f";
|
||||
//const char GtOCTRegenMPfmt[]="f";
|
||||
const char GtRegenHPPerSptfmt[]="f";
|
||||
const char GtRegenMPPerSptfmt[]="f";
|
||||
const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char Itemfmt[]="niiiiiii";
|
||||
const char ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||
const char ItemClassfmt[]="nxxssssssssssssssssx";
|
||||
const char GtRegenHPPerSptfmt[] = "f";
|
||||
const char GtRegenMPPerSptfmt[] = "f";
|
||||
const char Holidaysfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char Itemfmt[] = "niiiiiii";
|
||||
const char ItemBagFamilyfmt[] = "nxxxxxxxxxxxxxxxxx";
|
||||
const char ItemClassfmt[] = "nxxssssssssssssssssx";
|
||||
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
|
||||
//const char ItemCondExtCostsEntryfmt[]="xiii";
|
||||
const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix";
|
||||
const char ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
|
||||
const char ItemRandomPropertiesfmt[]="nxiiiiissssssssssssssssx";
|
||||
const char ItemRandomSuffixfmt[]="nssssssssssssssssxxiiiiiiiiii";
|
||||
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
||||
const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
|
||||
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx";
|
||||
const char MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxixx";
|
||||
const char MapDifficultyEntryfmt[]="diixxxxxxxxxxxxxxxxxiix";
|
||||
const char MovieEntryfmt[]="nxx";
|
||||
const char OverrideSpellDatafmt[]="niiiiiiiiiix";
|
||||
const char QuestFactionRewardfmt[]="niiiiiiiiii";
|
||||
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||
const char QuestXPLevelfmt[]="niiiiiiiiii";
|
||||
const char PvPDifficultyfmt[]="diiiii";
|
||||
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
|
||||
const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii";
|
||||
const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiixiiii";
|
||||
const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi";
|
||||
const char SkillLineAbilityfmt[]="niiiixxiiiiixx";
|
||||
const char SkillRaceClassInfofmt[]="diiiiixx";
|
||||
const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char SpellCastTimefmt[]="nixx";
|
||||
const char SpellDurationfmt[]="niii";
|
||||
const char SpellDifficultyfmt[]="niiii";
|
||||
const char SpellEntryfmt[]="niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxxi";
|
||||
const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||
const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiixxx";
|
||||
const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
|
||||
const char SpellRadiusfmt[]="nfxx";
|
||||
const char SpellRangefmt[]="nffffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char SpellRuneCostfmt[]="niiii";
|
||||
const char SpellShapeshiftFormfmt[]="nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii";
|
||||
const char ItemExtendedCostEntryfmt[] = "niiiiiiiiiiiiiix";
|
||||
const char ItemLimitCategoryEntryfmt[] = "nxxxxxxxxxxxxxxxxxii";
|
||||
const char ItemRandomPropertiesfmt[] = "nxiiiiissssssssssssssssx";
|
||||
const char ItemRandomSuffixfmt[] = "nssssssssssssssssxxiiiiiiiiii";
|
||||
const char ItemSetEntryfmt[] = "dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
||||
const char LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
|
||||
const char MailTemplateEntryfmt[] = "nxxxxxxxxxxxxxxxxxssssssssssssssssx";
|
||||
const char MapEntryfmt[] = "nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxixx";
|
||||
const char MapDifficultyEntryfmt[] = "diixxxxxxxxxxxxxxxxxiix";
|
||||
const char MovieEntryfmt[] = "nxx";
|
||||
const char OverrideSpellDatafmt[] = "niiiiiiiiiix";
|
||||
const char QuestFactionRewardfmt[] = "niiiiiiiiii";
|
||||
const char QuestSortEntryfmt[] = "nxxxxxxxxxxxxxxxxx";
|
||||
const char QuestXPLevelfmt[] = "niiiiiiiiii";
|
||||
const char PvPDifficultyfmt[] = "diiiii";
|
||||
const char RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii";
|
||||
const char ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiii";
|
||||
const char ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiixiiii";
|
||||
const char SkillLinefmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi";
|
||||
const char SkillLineAbilityfmt[] = "niiiixxiiiiixx";
|
||||
const char SkillRaceClassInfofmt[] = "diiiiixx";
|
||||
const char SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char SpellCastTimefmt[] = "nixx";
|
||||
const char SpellDurationfmt[] = "niii";
|
||||
const char SpellDifficultyfmt[] = "niiii";
|
||||
const char SpellEntryfmt[] = "niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxxi";
|
||||
const char SpellFocusObjectfmt[] = "nxxxxxxxxxxxxxxxxx";
|
||||
const char SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiissssssssssssssssxiiiixxx";
|
||||
const char SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
|
||||
const char SpellRadiusfmt[] = "nfxx";
|
||||
const char SpellRangefmt[] = "nffffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char SpellRuneCostfmt[] = "niiii";
|
||||
const char SpellShapeshiftFormfmt[] = "nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii";
|
||||
const char StableSlotPricesfmt[] = "ni";
|
||||
const char SummonPropertiesfmt[] = "niiiii";
|
||||
const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx";
|
||||
const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix";
|
||||
const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii";
|
||||
const char TaxiPathEntryfmt[]="niii";
|
||||
const char TaxiPathNodeEntryfmt[]="diiifffiiii";
|
||||
const char TeamContributionPointsfmt[]="df";
|
||||
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
|
||||
const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifixxx";
|
||||
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx";
|
||||
const char WMOAreaTableEntryfmt[]="niiixxxxxiixxxxxxxxxxxxxxxxx";
|
||||
const char WorldMapAreaEntryfmt[]="xinxffffixx";
|
||||
const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx";
|
||||
const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";
|
||||
const char TalentEntryfmt[] = "niiiiiiiixxxxixxixxxxxx";
|
||||
const char TalentTabEntryfmt[] = "nxxxxxxxxxxxxxxxxxxxiiix";
|
||||
const char TaxiNodesEntryfmt[] = "nifffssssssssssssssssxii";
|
||||
const char TaxiPathEntryfmt[] = "niii";
|
||||
const char TaxiPathNodeEntryfmt[] = "diiifffiiii";
|
||||
const char TeamContributionPointsfmt[] = "df";
|
||||
const char TotemCategoryEntryfmt[] = "nxxxxxxxxxxxxxxxxxii";
|
||||
const char VehicleEntryfmt[] = "niffffiiiiiiiifffffffffffffffssssfifixxx";
|
||||
const char VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx";
|
||||
const char WMOAreaTableEntryfmt[] = "niiixxxxxiixxxxxxxxxxxxxxxxx";
|
||||
const char WorldMapAreaEntryfmt[] = "xinxffffixx";
|
||||
const char WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxxxx";
|
||||
const char WorldSafeLocsEntryfmt[] = "nifffxxxxxxxxxxxxxxxxx";
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit* caster, uint32 spellId, SpellEf
|
|||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
sLog.outError("DynamicObject (spell %u eff %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,effIndex,GetPositionX(),GetPositionY());
|
||||
sLog.outError("DynamicObject (spell %u eff %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, effIndex, GetPositionX(), GetPositionY());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class DynamicObject : public WorldObject
|
|||
ObjectGuid const& GetCasterGuid() const { return GetGuidValue(DYNAMICOBJECT_CASTER); }
|
||||
Unit* GetCaster() const;
|
||||
float GetRadius() const { return m_radius; }
|
||||
DynamicObjectType GetType() const { return (DynamicObjectType)GetByteValue(DYNAMICOBJECT_BYTES,0); }
|
||||
DynamicObjectType GetType() const { return (DynamicObjectType)GetByteValue(DYNAMICOBJECT_BYTES, 0); }
|
||||
bool IsAffecting(Unit* unit) const { return m_affected.find(unit->GetObjectGuid()) != m_affected.end(); }
|
||||
void AddAffected(Unit* unit) { m_affected.insert(unit->GetObjectGuid()); }
|
||||
void RemoveAffected(Unit* unit) { m_affected.erase(unit->GetObjectGuid()); }
|
||||
|
|
|
|||
|
|
@ -73,36 +73,36 @@ bool FleeingMovementGenerator<T>::_getPoint(T& owner, float& x, float& y, float&
|
|||
if (dist_from_caster > 0.2f)
|
||||
angle_to_caster = fright->GetAngle(&owner);
|
||||
else
|
||||
angle_to_caster = frand(0, 2*M_PI_F);
|
||||
angle_to_caster = frand(0, 2 * M_PI_F);
|
||||
}
|
||||
else
|
||||
{
|
||||
dist_from_caster = 0.0f;
|
||||
angle_to_caster = frand(0, 2*M_PI_F);
|
||||
angle_to_caster = frand(0, 2 * M_PI_F);
|
||||
}
|
||||
|
||||
float dist, angle;
|
||||
if (dist_from_caster < MIN_QUIET_DISTANCE)
|
||||
{
|
||||
dist = frand(0.4f, 1.3f)*(MIN_QUIET_DISTANCE - dist_from_caster);
|
||||
angle = angle_to_caster + frand(-M_PI_F/8, M_PI_F/8);
|
||||
dist = frand(0.4f, 1.3f) * (MIN_QUIET_DISTANCE - dist_from_caster);
|
||||
angle = angle_to_caster + frand(-M_PI_F / 8, M_PI_F / 8);
|
||||
}
|
||||
else if (dist_from_caster > MAX_QUIET_DISTANCE)
|
||||
{
|
||||
dist = frand(0.4f, 1.0f)*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
|
||||
angle = -angle_to_caster + frand(-M_PI_F/4, M_PI_F/4);
|
||||
dist = frand(0.4f, 1.0f) * (MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
|
||||
angle = -angle_to_caster + frand(-M_PI_F / 4, M_PI_F / 4);
|
||||
}
|
||||
else // we are inside quiet range
|
||||
{
|
||||
dist = frand(0.6f, 1.2f)*(MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
|
||||
angle = frand(0, 2*M_PI_F);
|
||||
dist = frand(0.6f, 1.2f) * (MAX_QUIET_DISTANCE - MIN_QUIET_DISTANCE);
|
||||
angle = frand(0, 2 * M_PI_F);
|
||||
}
|
||||
|
||||
float curr_x, curr_y, curr_z;
|
||||
owner.GetPosition(curr_x, curr_y, curr_z);
|
||||
|
||||
x = curr_x + dist*cos(angle);
|
||||
y = curr_y + dist*sin(angle);
|
||||
x = curr_x + dist * cos(angle);
|
||||
y = curr_y + dist * sin(angle);
|
||||
z = curr_z;
|
||||
|
||||
owner.UpdateAllowedPositionZ(x, y, z);
|
||||
|
|
@ -113,7 +113,7 @@ bool FleeingMovementGenerator<T>::_getPoint(T& owner, float& x, float& y, float&
|
|||
template<class T>
|
||||
void FleeingMovementGenerator<T>::Initialize(T& owner)
|
||||
{
|
||||
owner.addUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_FLEEING_MOVE);
|
||||
owner.StopMoving();
|
||||
|
||||
if (owner.GetTypeId() == TYPEID_UNIT)
|
||||
|
|
@ -125,14 +125,14 @@ void FleeingMovementGenerator<T>::Initialize(T& owner)
|
|||
template<>
|
||||
void FleeingMovementGenerator<Player>::Finalize(Player& owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_FLEEING_MOVE);
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
template<>
|
||||
void FleeingMovementGenerator<Creature>::Finalize(Creature& owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_FLEEING_MOVE);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
@ -183,7 +183,7 @@ template bool FleeingMovementGenerator<Creature>::Update(Creature&, const uint32
|
|||
|
||||
void TimedFleeingMovementGenerator::Finalize(Unit& owner)
|
||||
{
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
|
||||
owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_FLEEING_MOVE);
|
||||
if (Unit* victim = owner.getVictim())
|
||||
{
|
||||
if (owner.isAlive())
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ namespace MaNGOS
|
|||
{
|
||||
namespace Honor
|
||||
{
|
||||
inline float hk_honor_at_level(uint32 level, uint32 count=1)
|
||||
inline float hk_honor_at_level(uint32 level, uint32 count = 1)
|
||||
{
|
||||
return (float)ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f)));
|
||||
return (float)ceil(count * (-0.53177f + 0.59357f * exp((level + 23.54042f) / 26.07859f)));
|
||||
}
|
||||
}
|
||||
namespace XP
|
||||
|
|
@ -39,9 +39,9 @@ namespace MaNGOS
|
|||
if (pl_level <= 5)
|
||||
return 0;
|
||||
else if (pl_level <= 39)
|
||||
return pl_level - 5 - pl_level/10;
|
||||
return pl_level - 5 - pl_level / 10;
|
||||
else if (pl_level <= 59)
|
||||
return pl_level - 1 - pl_level/5;
|
||||
return pl_level - 1 - pl_level / 5;
|
||||
else
|
||||
return pl_level - 9;
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ namespace MaNGOS
|
|||
case CONTENT_61_70: nBaseExp = 235; break;
|
||||
case CONTENT_71_80: nBaseExp = 580; break;
|
||||
default:
|
||||
sLog.outError("BaseGain: Unsupported content level %u",content);
|
||||
sLog.outError("BaseGain: Unsupported content level %u", content);
|
||||
nBaseExp = 45; break;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ namespace MaNGOS
|
|||
uint32 nLevelDiff = mob_level - pl_level;
|
||||
if (nLevelDiff > 4)
|
||||
nLevelDiff = 4;
|
||||
return ((pl_level*5 + nBaseExp) * (20 + nLevelDiff)/10 + 1)/2;
|
||||
return ((pl_level * 5 + nBaseExp) * (20 + nLevelDiff) / 10 + 1) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -102,7 +102,7 @@ namespace MaNGOS
|
|||
if (mob_level > gray_level)
|
||||
{
|
||||
uint32 ZD = GetZeroDifference(pl_level);
|
||||
return (pl_level*5 + nBaseExp) * (ZD + mob_level - pl_level)/ZD;
|
||||
return (pl_level * 5 + nBaseExp) * (ZD + mob_level - pl_level) / ZD;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -110,19 +110,19 @@ namespace MaNGOS
|
|||
|
||||
inline uint32 Gain(Player* pl, Unit* u)
|
||||
{
|
||||
if (u->GetTypeId()==TYPEID_UNIT && (
|
||||
if (u->GetTypeId() == TYPEID_UNIT && (
|
||||
((Creature*)u)->IsTotem() || ((Creature*)u)->IsPet() ||
|
||||
(((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)))
|
||||
return 0;
|
||||
|
||||
uint32 xp_gain= BaseGain(pl->getLevel(), u->getLevel(), GetContentLevelsForMapAndZone(pl->GetMapId(),pl->GetZoneId()));
|
||||
uint32 xp_gain = BaseGain(pl->getLevel(), u->getLevel(), GetContentLevelsForMapAndZone(pl->GetMapId(), pl->GetZoneId()));
|
||||
if (xp_gain == 0)
|
||||
return 0;
|
||||
|
||||
if (u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->IsElite())
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsElite())
|
||||
xp_gain *= 2;
|
||||
|
||||
return (uint32)(xp_gain*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL));
|
||||
return (uint32)(xp_gain * sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL));
|
||||
}
|
||||
|
||||
inline float xp_in_group_rate(uint32 count, bool isRaid)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
void WorldSession::SendGMTicketGetTicket(uint32 status, GMTicket* ticket /*= NULL*/)
|
||||
{
|
||||
int len = ticket ? strlen(ticket->GetText()) : 0;
|
||||
WorldPacket data(SMSG_GMTICKET_GETTICKET, (4+len+1+4+2+4+4));
|
||||
WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + len + 1 + 4 + 2 + 4 + 4));
|
||||
data << uint32(status); // standard 0x0A, 0x06 if text present
|
||||
if (status == 6)
|
||||
{
|
||||
|
|
@ -46,8 +46,8 @@ void WorldSession::SendGMTicketGetTicket(uint32 status, GMTicket* ticket /*= NUL
|
|||
|
||||
void WorldSession::SendGMResponse(GMTicket* ticket)
|
||||
{
|
||||
int len = strlen(ticket->GetText())+1+strlen(ticket->GetResponse())+1;
|
||||
WorldPacket data(SMSG_GMTICKET_GET_RESPONSE, 4+4+len+1+1+1);
|
||||
int len = strlen(ticket->GetText()) + 1 + strlen(ticket->GetResponse()) + 1;
|
||||
WorldPacket data(SMSG_GMTICKET_GET_RESPONSE, 4 + 4 + len + 1 + 1 + 1);
|
||||
data << uint32(123);
|
||||
data << uint32(456);
|
||||
data << ticket->GetText(); // issue text
|
||||
|
|
@ -137,7 +137,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recv_data)
|
|||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets())
|
||||
ChatHandler(itr->second).PSendSysMessage(LANG_COMMAND_TICKETNEW,GetPlayer()->GetName());
|
||||
ChatHandler(itr->second).PSendSysMessage(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class GMTicket
|
|||
m_guid = guid;
|
||||
m_text = text;
|
||||
m_responseText = responsetext;
|
||||
m_lastUpdate =update;
|
||||
m_lastUpdate = update;
|
||||
}
|
||||
|
||||
ObjectGuid const& GetPlayerGuid() const
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ void GameEventMgr::StartEvent(uint16 event_id, bool overwrite /*=false*/, bool r
|
|||
{
|
||||
mGameEvent[event_id].start = time(NULL);
|
||||
if (mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
||||
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
||||
mGameEvent[event_id].end = mGameEvent[event_id].start + mGameEvent[event_id].length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
|||
{
|
||||
mGameEvent[event_id].start = time(NULL) - mGameEvent[event_id].length * MINUTE;
|
||||
if (mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
||||
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
||||
mGameEvent[event_id].end = mGameEvent[event_id].start + mGameEvent[event_id].length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ void GameEventMgr::LoadFromDB()
|
|||
uint32 max_event_id = fields[0].GetUInt16();
|
||||
delete result;
|
||||
|
||||
mGameEvent.resize(max_event_id+1);
|
||||
mGameEvent.resize(max_event_id + 1);
|
||||
}
|
||||
|
||||
QueryResult* result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description FROM game_event");
|
||||
|
|
@ -176,14 +176,14 @@ void GameEventMgr::LoadFromDB()
|
|||
sLog.outString(">> Loaded %u game events", count);
|
||||
}
|
||||
|
||||
std::map<uint16,int16> pool2event; // for check unique spawn event associated with pool
|
||||
std::map<uint32,int16> creature2event; // for check unique spawn event associated with creature
|
||||
std::map<uint32,int16> go2event; // for check unique spawn event associated with gameobject
|
||||
std::map<uint16, int16> pool2event; // for check unique spawn event associated with pool
|
||||
std::map<uint32, int16> creature2event; // for check unique spawn event associated with creature
|
||||
std::map<uint32, int16> go2event; // for check unique spawn event associated with gameobject
|
||||
|
||||
// list only positive event top pools, filled at creature/gameobject loading
|
||||
mGameEventSpawnPoolIds.resize(mGameEvent.size());
|
||||
|
||||
mGameEventCreatureGuids.resize(mGameEvent.size()*2-1);
|
||||
mGameEventCreatureGuids.resize(mGameEvent.size() * 2 - 1);
|
||||
// 1 2
|
||||
result = WorldDatabase.Query("SELECT creature.guid, game_event_creature.event "
|
||||
"FROM creature JOIN game_event_creature ON creature.guid = game_event_creature.guid");
|
||||
|
|
@ -262,7 +262,7 @@ void GameEventMgr::LoadFromDB()
|
|||
sLog.outString(">> Loaded %u creatures in game events", count);
|
||||
}
|
||||
|
||||
mGameEventGameobjectGuids.resize(mGameEvent.size()*2-1);
|
||||
mGameEventGameobjectGuids.resize(mGameEvent.size() * 2 - 1);
|
||||
// 1 2
|
||||
result = WorldDatabase.Query("SELECT gameobject.guid, game_event_gameobject.event "
|
||||
"FROM gameobject JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid");
|
||||
|
|
@ -342,7 +342,7 @@ void GameEventMgr::LoadFromDB()
|
|||
}
|
||||
|
||||
// now recheck that all eventPools linked with events after our skip pools with parents
|
||||
for (std::map<uint16,int16>::const_iterator itr = pool2event.begin(); itr != pool2event.end(); ++itr)
|
||||
for (std::map<uint16, int16>::const_iterator itr = pool2event.begin(); itr != pool2event.end(); ++itr)
|
||||
{
|
||||
uint16 pool_id = itr->first;
|
||||
int16 event_id = itr->second;
|
||||
|
|
@ -382,7 +382,7 @@ void GameEventMgr::LoadFromDB()
|
|||
|
||||
if (event_id == 0)
|
||||
{
|
||||
sLog.outErrorDb("`game_event_creature_data` game event id (%i) is reserved and can't be used." ,event_id);
|
||||
sLog.outErrorDb("`game_event_creature_data` game event id (%i) is reserved and can't be used." , event_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ void GameEventMgr::LoadFromDB()
|
|||
sLog.outString(">> Loaded %u quest additions in game events", count);
|
||||
}
|
||||
|
||||
mGameEventMails.resize(mGameEvent.size()*2-1);
|
||||
mGameEventMails.resize(mGameEvent.size() * 2 - 1);
|
||||
|
||||
result = WorldDatabase.Query("SELECT event, raceMask, quest, mailTemplateId, senderEntry FROM game_event_mail");
|
||||
|
||||
|
|
@ -707,7 +707,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
|||
|
||||
if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventCreatureGuids.size())
|
||||
{
|
||||
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",internal_event_id,mGameEventCreatureGuids.size());
|
||||
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -737,7 +737,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
|||
|
||||
if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventGameobjectGuids.size())
|
||||
{
|
||||
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",internal_event_id,mGameEventGameobjectGuids.size());
|
||||
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -784,7 +784,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
|||
|
||||
if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventCreatureGuids.size())
|
||||
{
|
||||
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",internal_event_id,mGameEventCreatureGuids.size());
|
||||
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -814,7 +814,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
|||
|
||||
if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventGameobjectGuids.size())
|
||||
{
|
||||
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",internal_event_id,mGameEventGameobjectGuids.size());
|
||||
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class MapPersistentState;
|
|||
|
||||
struct GameEventData
|
||||
{
|
||||
GameEventData() : start(1),end(0),occurence(0),length(0), holiday_id(HOLIDAY_NONE) {}
|
||||
GameEventData() : start(1), end(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE) {}
|
||||
time_t start;
|
||||
time_t end;
|
||||
uint32 occurence; // Delay in minutes between occurences of the event
|
||||
|
|
@ -81,7 +81,7 @@ class GameEventMgr
|
|||
void Initialize(MapPersistentState* state); // called at new MapPersistentState object create
|
||||
uint32 Update(ActiveEvents const* activeAtShutdown = NULL);
|
||||
bool IsValidEvent(uint16 event_id) const { return event_id < mGameEvent.size() && mGameEvent[event_id].isValid(); }
|
||||
bool IsActiveEvent(uint16 event_id) const { return (m_ActiveEvents.find(event_id)!=m_ActiveEvents.end()); }
|
||||
bool IsActiveEvent(uint16 event_id) const { return (m_ActiveEvents.find(event_id) != m_ActiveEvents.end()); }
|
||||
bool IsActiveHoliday(HolidayIds id);
|
||||
uint32 Initialize();
|
||||
void StartEvent(uint16 event_id, bool overwrite = false, bool resume = false);
|
||||
|
|
@ -107,7 +107,7 @@ class GameEventMgr
|
|||
typedef std::list<GameEventCreatureDataPair> GameEventCreatureDataList;
|
||||
typedef std::vector<GameEventCreatureDataList> GameEventCreatureDataMap;
|
||||
typedef std::multimap<uint32, uint32> GameEventCreatureDataPerGuidMap;
|
||||
typedef std::pair<GameEventCreatureDataPerGuidMap::const_iterator,GameEventCreatureDataPerGuidMap::const_iterator> GameEventCreatureDataPerGuidBounds;
|
||||
typedef std::pair<GameEventCreatureDataPerGuidMap::const_iterator, GameEventCreatureDataPerGuidMap::const_iterator> GameEventCreatureDataPerGuidBounds;
|
||||
|
||||
typedef std::list<uint32> QuestList;
|
||||
typedef std::vector<QuestList> GameEventQuestMap;
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ void GameObject::RemoveFromWorld()
|
|||
// Remove GO from owner
|
||||
if (ObjectGuid owner_guid = GetOwnerGuid())
|
||||
{
|
||||
if (Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid))
|
||||
owner->RemoveGameObject(this,false);
|
||||
if (Unit* owner = ObjectAccessor::GetUnit(*this, owner_guid))
|
||||
owner->RemoveGameObject(this, false);
|
||||
else
|
||||
{
|
||||
sLog.outError("Delete %s with SpellId %u LinkedGO %u that lost references to owner %s GO list. Crash possible later.",
|
||||
|
|
@ -106,20 +106,20 @@ void GameObject::RemoveFromWorld()
|
|||
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, QuaternionData rotation, uint8 animprogress, GOState go_state)
|
||||
{
|
||||
MANGOS_ASSERT(map);
|
||||
Relocate(x,y,z,ang);
|
||||
Relocate(x, y, z, ang);
|
||||
SetMap(map);
|
||||
SetPhaseMask(phaseMask,false);
|
||||
SetPhaseMask(phaseMask, false);
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
sLog.outError("Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates are invalid (X: %f Y: %f)",guidlow,name_id,x,y);
|
||||
sLog.outError("Gameobject (GUID: %u Entry: %u ) not created. Suggested coordinates are invalid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id);
|
||||
if (!goinfo)
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (GUID: %u) not created: Entry %u does not exist in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f",guidlow, name_id, map->GetId(), x, y, z, ang);
|
||||
sLog.outErrorDb("Gameobject (GUID: %u) not created: Entry %u does not exist in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, name_id, map->GetId(), x, y, z, ang);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -129,18 +129,18 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
|
|||
|
||||
if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (GUID: %u) not created: Entry %u has invalid type %u in `gameobject_template`. It may crash client if created.",guidlow,name_id,goinfo->type);
|
||||
sLog.outErrorDb("Gameobject (GUID: %u) not created: Entry %u has invalid type %u in `gameobject_template`. It may crash client if created.", guidlow, name_id, goinfo->type);
|
||||
return false;
|
||||
}
|
||||
|
||||
SetObjectScale(goinfo->size);
|
||||
|
||||
SetWorldRotation(rotation.x,rotation.y,rotation.z,rotation.w);
|
||||
SetWorldRotation(rotation.x, rotation.y, rotation.z, rotation.w);
|
||||
// For most of gameobjects is (0, 0, 0, 1) quaternion, only some transports has not standart rotation
|
||||
if (const GameObjectDataAddon* addon = sGameObjectDataAddonStorage.LookupEntry<GameObjectDataAddon>(guidlow))
|
||||
SetTransportPathRotation(addon->path_rotation);
|
||||
else
|
||||
SetTransportPathRotation(QuaternionData(0,0,0,1));
|
||||
SetTransportPathRotation(QuaternionData(0, 0, 0, 1));
|
||||
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
|
||||
|
|
@ -238,7 +238,7 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
|
|||
{
|
||||
caster->FinishSpell(CURRENT_CHANNELED_SPELL);
|
||||
|
||||
WorldPacket data(SMSG_FISH_NOT_HOOKED,0);
|
||||
WorldPacket data(SMSG_FISH_NOT_HOOKED, 0);
|
||||
((Player*)caster)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
// can be deleted
|
||||
|
|
@ -304,9 +304,9 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
|
|||
{
|
||||
MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius);
|
||||
MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> checker(ok, u_check);
|
||||
Cell::VisitGridObjects(this,checker, radius);
|
||||
Cell::VisitGridObjects(this, checker, radius);
|
||||
if (!ok)
|
||||
Cell::VisitWorldObjects(this,checker, radius);
|
||||
Cell::VisitWorldObjects(this, checker, radius);
|
||||
}
|
||||
else // environmental trap
|
||||
{
|
||||
|
|
@ -316,7 +316,7 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
|
|||
Player* p_ok = NULL;
|
||||
MaNGOS::AnyPlayerInObjectRangeCheck p_check(this, radius);
|
||||
MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck> checker(p_ok, p_check);
|
||||
Cell::VisitWorldObjects(this,checker, radius);
|
||||
Cell::VisitWorldObjects(this, checker, radius);
|
||||
ok = p_ok;
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ void GameObject::getFishLoot(Loot* fishloot, Player* loot_owner)
|
|||
fishloot->clear();
|
||||
|
||||
uint32 zone, subzone;
|
||||
GetZoneAndAreaId(zone,subzone);
|
||||
GetZoneAndAreaId(zone, subzone);
|
||||
|
||||
// if subzone loot exist use it
|
||||
if (!fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner, true, (subzone != zone)) && subzone != zone)
|
||||
|
|
@ -600,7 +600,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map* map)
|
|||
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);
|
||||
sLog.outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -615,7 +615,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map* map)
|
|||
uint8 animprogress = data->animprogress;
|
||||
GOState go_state = data->go_state;
|
||||
|
||||
if (!Create(guid,entry, map, phaseMask, x, y, z, ang, data->rotation, animprogress, go_state))
|
||||
if (!Create(guid, entry, map, phaseMask, x, y, z, ang, data->rotation, animprogress, go_state))
|
||||
return false;
|
||||
|
||||
if (!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction() && data->spawntimesecs >= 0)
|
||||
|
|
@ -825,7 +825,7 @@ bool GameObject::ActivateToQuest(Player* pTarget) const
|
|||
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team
|
||||
if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
|
||||
if (BattleGround* bg = pTarget->GetBattleGround())
|
||||
if (bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(),pTarget->GetTeam())))
|
||||
if (bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam())))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -925,7 +925,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
|||
|
||||
MaNGOS::NearestGameObjectFishingHoleCheck u_check(*this, range);
|
||||
MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHoleCheck> checker(ok, u_check);
|
||||
Cell::VisitGridObjects(this,checker, range);
|
||||
Cell::VisitGridObjects(this, checker, range);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
|
@ -948,7 +948,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
|
|||
if (!time_to_restore)
|
||||
time_to_restore = GetGOInfo()->GetAutoCloseTime();
|
||||
|
||||
SwitchDoorOrButton(true,alternative);
|
||||
SwitchDoorOrButton(true, alternative);
|
||||
SetLootState(GO_ACTIVATED);
|
||||
|
||||
m_cooldownTime = time(NULL) + time_to_restore;
|
||||
|
|
@ -1103,10 +1103,10 @@ void GameObject::Use(Unit* user)
|
|||
// every slot will be on that straight line
|
||||
float orthogonalOrientation = GetOrientation() + M_PI_F * 0.5f;
|
||||
// find nearest slot
|
||||
for (uint32 i=0; i<info->chair.slots; ++i)
|
||||
for (uint32 i = 0; i < info->chair.slots; ++i)
|
||||
{
|
||||
// the distance between this slot and the center of the go - imagine a 1D space
|
||||
float relativeDistance = (info->size*i)-(info->size*(info->chair.slots-1)/2.0f);
|
||||
float relativeDistance = (info->size * i) - (info->size * (info->chair.slots - 1) / 2.0f);
|
||||
|
||||
float x_i = GetPositionX() + relativeDistance * cos(orthogonalOrientation);
|
||||
float y_i = GetPositionY() + relativeDistance * sin(orthogonalOrientation);
|
||||
|
|
@ -1567,7 +1567,7 @@ void GameObject::Use(Unit* user)
|
|||
Player* player = (Player*)user;
|
||||
|
||||
// fallback, will always work
|
||||
player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
|
||||
player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
|
||||
|
||||
WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
|
@ -1646,7 +1646,7 @@ struct QuaternionCompressed
|
|||
MANGOS_ASSERT(w >= 0);
|
||||
w = sqrt(w);
|
||||
|
||||
return Quat(x,y,z,w);
|
||||
return Quat(x, y, z, w);
|
||||
}
|
||||
|
||||
int64 m_raw;
|
||||
|
|
@ -1669,10 +1669,10 @@ void GameObject::SetWorldRotation(float qx, float qy, float qz, float qw)
|
|||
|
||||
void GameObject::SetTransportPathRotation(QuaternionData rotation)
|
||||
{
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation.x);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation.y);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation.z);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation.w);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION + 0, rotation.x);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION + 1, rotation.y);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION + 2, rotation.z);
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION + 3, rotation.w);
|
||||
}
|
||||
|
||||
void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)
|
||||
|
|
@ -1684,7 +1684,7 @@ void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)
|
|||
bool GameObject::IsHostileTo(Unit const* unit) const
|
||||
{
|
||||
// always non-hostile to GM in GM mode
|
||||
if (unit->GetTypeId()==TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
||||
return false;
|
||||
|
||||
// test owner instead if have
|
||||
|
|
@ -1727,7 +1727,7 @@ bool GameObject::IsHostileTo(Unit const* unit) const
|
|||
bool GameObject::IsFriendlyTo(Unit const* unit) const
|
||||
{
|
||||
// always friendly to GM in GM mode
|
||||
if (unit->GetTypeId()==TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER && ((Player const*)unit)->isGameMaster())
|
||||
return true;
|
||||
|
||||
// test owner instead if have
|
||||
|
|
@ -1753,7 +1753,7 @@ bool GameObject::IsFriendlyTo(Unit const* unit) const
|
|||
if (tester_faction->faction)
|
||||
{
|
||||
// forced reaction
|
||||
if (ReputationRank const* force =((Player*)unit)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
|
||||
if (ReputationRank const* force = ((Player*)unit)->GetReputationMgr().GetForcedRankIfAny(tester_faction))
|
||||
return *force >= REP_FRIENDLY;
|
||||
|
||||
// apply reputation state
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ struct GameObjectInfo
|
|||
case GAMEOBJECT_TYPE_AREADAMAGE: return areadamage.lockId;
|
||||
case GAMEOBJECT_TYPE_CAMERA: return camera.lockId;
|
||||
case GAMEOBJECT_TYPE_FLAGSTAND: return flagstand.lockId;
|
||||
case GAMEOBJECT_TYPE_FISHINGHOLE:return fishinghole.lockId;
|
||||
case GAMEOBJECT_TYPE_FISHINGHOLE: return fishinghole.lockId;
|
||||
case GAMEOBJECT_TYPE_FLAGDROP: return flagdrop.lockId;
|
||||
default: return 0;
|
||||
}
|
||||
|
|
@ -556,7 +556,7 @@ struct QuaternionData
|
|||
QuaternionData() : x(0.f), y(0.f), z(0.f), w(0.f) {}
|
||||
QuaternionData(float X, float Y, float Z, float W) : x(X), y(Y), z(Z), w(W) {}
|
||||
|
||||
bool isUnit() const { return fabs(x*x + y*y + z*z + w*w - 1.f) < 1e-5;}
|
||||
bool isUnit() const { return fabs(x * x + y * y + z * z + w * w - 1.f) < 1e-5;}
|
||||
};
|
||||
|
||||
// from `gameobject`
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ void PlayerMenu::CloseGossip()
|
|||
// Outdated
|
||||
void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const* locName)
|
||||
{
|
||||
WorldPacket data(SMSG_GOSSIP_POI, (4+4+4+4+4+10)); // guess size
|
||||
WorldPacket data(SMSG_GOSSIP_POI, (4 + 4 + 4 + 4 + 4 + 10)); // guess size
|
||||
data << uint32(Flags);
|
||||
data << float(X);
|
||||
data << float(Y);
|
||||
|
|
@ -221,7 +221,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
|
|||
PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id);
|
||||
if (!poi)
|
||||
{
|
||||
sLog.outErrorDb("Requested send nonexistent POI (Id: %u), ignore.",poi_id);
|
||||
sLog.outErrorDb("Requested send nonexistent POI (Id: %u), ignore.", poi_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
|
|||
if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
|
||||
icon_name = pl->IconName[loc_idx];
|
||||
|
||||
WorldPacket data(SMSG_GOSSIP_POI, (4+4+4+4+4+10)); // guess size
|
||||
WorldPacket data(SMSG_GOSSIP_POI, (4 + 4 + 4 + 4 + 4 + 10)); // guess size
|
||||
data << uint32(poi->flags);
|
||||
data << float(poi->x);
|
||||
data << float(poi->y);
|
||||
|
|
@ -669,7 +669,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest)
|
|||
if (pQuest->ReqCreatureOrGOId[iI] < 0)
|
||||
{
|
||||
// client expected gameobject template id in form (id|0x80000000)
|
||||
data << uint32((pQuest->ReqCreatureOrGOId[iI]*(-1))|0x80000000);
|
||||
data << uint32((pQuest->ReqCreatureOrGOId[iI] * (-1)) | 0x80000000);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -776,7 +776,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGU
|
|||
data << uint32(pQuest->XPValue(GetMenuSession()->GetPlayer()));
|
||||
|
||||
// TODO: fixme. rewarded honor points. Multiply with 10 to satisfy client
|
||||
data << uint32(10*MaNGOS::Honor::hk_honor_at_level(GetMenuSession()->GetPlayer()->getLevel(), pQuest->GetRewHonorAddition()));
|
||||
data << uint32(10 * MaNGOS::Honor::hk_honor_at_level(GetMenuSession()->GetPlayer()->getLevel(), pQuest->GetRewHonorAddition()));
|
||||
data << float(pQuest->GetRewHonorMultiplier());
|
||||
|
||||
data << uint32(0x08); // unused by client?
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ typedef GridRefManager<DynamicObject> DynamicObjectMapType;
|
|||
typedef GridRefManager<GameObject> GameObjectMapType;
|
||||
typedef GridRefManager<Player> PlayerMapType;
|
||||
|
||||
typedef Grid<Player, AllWorldObjectTypes,AllGridObjectTypes> GridType;
|
||||
typedef Grid<Player, AllWorldObjectTypes, AllGridObjectTypes> GridType;
|
||||
typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType;
|
||||
|
||||
typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer;
|
||||
|
|
@ -77,7 +77,7 @@ typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer;
|
|||
template<const unsigned int LIMIT>
|
||||
struct MANGOS_DLL_DECL CoordPair
|
||||
{
|
||||
CoordPair(uint32 x=0, uint32 y=0) : x_coord(x), y_coord(y) {}
|
||||
CoordPair(uint32 x = 0, uint32 y = 0) : x_coord(x), y_coord(y) {}
|
||||
CoordPair(const CoordPair<LIMIT>& obj) : x_coord(obj.x_coord), y_coord(obj.y_coord) {}
|
||||
bool operator==(const CoordPair<LIMIT>& obj) const { return (obj.x_coord == x_coord && obj.y_coord == y_coord); }
|
||||
bool operator!=(const CoordPair<LIMIT>& obj) const { return !operator==(obj); }
|
||||
|
|
@ -98,7 +98,7 @@ struct MANGOS_DLL_DECL CoordPair
|
|||
|
||||
void operator>>(const uint32 val)
|
||||
{
|
||||
if (x_coord+val < LIMIT)
|
||||
if (x_coord + val < LIMIT)
|
||||
x_coord += val;
|
||||
else
|
||||
x_coord = LIMIT - 1;
|
||||
|
|
@ -114,7 +114,7 @@ struct MANGOS_DLL_DECL CoordPair
|
|||
|
||||
void operator+=(const uint32 val)
|
||||
{
|
||||
if (y_coord+val < LIMIT)
|
||||
if (y_coord + val < LIMIT)
|
||||
y_coord += val;
|
||||
else
|
||||
y_coord = LIMIT - 1;
|
||||
|
|
@ -122,8 +122,8 @@ struct MANGOS_DLL_DECL CoordPair
|
|||
|
||||
CoordPair& normalize()
|
||||
{
|
||||
x_coord = std::min(x_coord, LIMIT-1);
|
||||
y_coord = std::min(y_coord, LIMIT-1);
|
||||
x_coord = std::min(x_coord, LIMIT - 1);
|
||||
y_coord = std::min(y_coord, LIMIT - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -140,11 +140,11 @@ namespace MaNGOS
|
|||
inline RET_TYPE Compute(float x, float y, float center_offset, float size)
|
||||
{
|
||||
// calculate and store temporary values in double format for having same result as same mySQL calculations
|
||||
double x_offset = (double(x) - center_offset)/size;
|
||||
double y_offset = (double(y) - center_offset)/size;
|
||||
double x_offset = (double(x) - center_offset) / size;
|
||||
double y_offset = (double(y) - center_offset) / size;
|
||||
|
||||
int x_val = int(x_offset+CENTER_VAL + 0.5);
|
||||
int y_val = int(y_offset+CENTER_VAL + 0.5);
|
||||
int x_val = int(x_offset + CENTER_VAL + 0.5);
|
||||
int y_val = int(y_offset + CENTER_VAL + 0.5);
|
||||
return RET_TYPE(x_val, y_val);
|
||||
}
|
||||
|
||||
|
|
@ -178,12 +178,12 @@ namespace MaNGOS
|
|||
|
||||
inline bool IsValidMapCoord(float x, float y, float z)
|
||||
{
|
||||
return IsValidMapCoord(x,y) && finite(z);
|
||||
return IsValidMapCoord(x, y) && finite(z);
|
||||
}
|
||||
|
||||
inline bool IsValidMapCoord(float x, float y, float z, float o)
|
||||
{
|
||||
return IsValidMapCoord(x,y,z) && finite(o);
|
||||
return IsValidMapCoord(x, y, z) && finite(o);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ bool GridMap::loadData(char* filename)
|
|||
if (!in)
|
||||
return true;
|
||||
|
||||
fread(&header, sizeof(header),1,in);
|
||||
fread(&header, sizeof(header), 1, in);
|
||||
if (header.mapMagic == *((uint32 const*)(MAP_MAGIC)) &&
|
||||
header.versionMagic == *((uint32 const*)(MAP_VERSION_MAGIC)) &&
|
||||
IsAcceptableClientBuild(header.buildMagic))
|
||||
|
|
@ -151,8 +151,8 @@ bool GridMap::loadAreaData(FILE* in, uint32 offset, uint32 /*size*/)
|
|||
m_gridArea = header.gridArea;
|
||||
if (!(header.flags & MAP_AREA_NO_AREA))
|
||||
{
|
||||
m_area_map = new uint16 [16*16];
|
||||
fread(m_area_map, sizeof(uint16), 16*16, in);
|
||||
m_area_map = new uint16 [16 * 16];
|
||||
fread(m_area_map, sizeof(uint16), 16 * 16, in);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -171,28 +171,28 @@ bool GridMap::loadHeightData(FILE* in, uint32 offset, uint32 /*size*/)
|
|||
{
|
||||
if ((header.flags & MAP_HEIGHT_AS_INT16))
|
||||
{
|
||||
m_uint16_V9 = new uint16 [129*129];
|
||||
m_uint16_V8 = new uint16 [128*128];
|
||||
fread(m_uint16_V9, sizeof(uint16), 129*129, in);
|
||||
fread(m_uint16_V8, sizeof(uint16), 128*128, in);
|
||||
m_uint16_V9 = new uint16 [129 * 129];
|
||||
m_uint16_V8 = new uint16 [128 * 128];
|
||||
fread(m_uint16_V9, sizeof(uint16), 129 * 129, in);
|
||||
fread(m_uint16_V8, sizeof(uint16), 128 * 128, in);
|
||||
m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 65535;
|
||||
m_gridGetHeight = &GridMap::getHeightFromUint16;
|
||||
}
|
||||
else if ((header.flags & MAP_HEIGHT_AS_INT8))
|
||||
{
|
||||
m_uint8_V9 = new uint8 [129*129];
|
||||
m_uint8_V8 = new uint8 [128*128];
|
||||
fread(m_uint8_V9, sizeof(uint8), 129*129, in);
|
||||
fread(m_uint8_V8, sizeof(uint8), 128*128, in);
|
||||
m_uint8_V9 = new uint8 [129 * 129];
|
||||
m_uint8_V8 = new uint8 [128 * 128];
|
||||
fread(m_uint8_V9, sizeof(uint8), 129 * 129, in);
|
||||
fread(m_uint8_V8, sizeof(uint8), 128 * 128, in);
|
||||
m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 255;
|
||||
m_gridGetHeight = &GridMap::getHeightFromUint8;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_V9 = new float [129*129];
|
||||
m_V8 = new float [128*128];
|
||||
fread(m_V9, sizeof(float), 129*129, in);
|
||||
fread(m_V8, sizeof(float), 128*128, in);
|
||||
m_V9 = new float [129 * 129];
|
||||
m_V8 = new float [128 * 128];
|
||||
fread(m_V9, sizeof(float), 129 * 129, in);
|
||||
fread(m_V8, sizeof(float), 128 * 128, in);
|
||||
m_gridGetHeight = &GridMap::getHeightFromFloat;
|
||||
}
|
||||
}
|
||||
|
|
@ -219,14 +219,14 @@ bool GridMap::loadGridMapLiquidData(FILE* in, uint32 offset, uint32 /*size*/)
|
|||
|
||||
if (!(header.flags & MAP_LIQUID_NO_TYPE))
|
||||
{
|
||||
m_liquid_type = new uint8 [16*16];
|
||||
fread(m_liquid_type, sizeof(uint8), 16*16, in);
|
||||
m_liquid_type = new uint8 [16 * 16];
|
||||
fread(m_liquid_type, sizeof(uint8), 16 * 16, in);
|
||||
}
|
||||
|
||||
if (!(header.flags & MAP_LIQUID_NO_HEIGHT))
|
||||
{
|
||||
m_liquid_map = new float [m_liquid_width*m_liquid_height];
|
||||
fread(m_liquid_map, sizeof(float), m_liquid_width*m_liquid_height, in);
|
||||
m_liquid_map = new float [m_liquid_width * m_liquid_height];
|
||||
fread(m_liquid_map, sizeof(float), m_liquid_width * m_liquid_height, in);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -237,11 +237,11 @@ uint16 GridMap::getArea(float x, float y)
|
|||
if (!m_area_map)
|
||||
return m_gridArea;
|
||||
|
||||
x = 16 * (32 - x/SIZE_OF_GRIDS);
|
||||
y = 16 * (32 - y/SIZE_OF_GRIDS);
|
||||
x = 16 * (32 - x / SIZE_OF_GRIDS);
|
||||
y = 16 * (32 - y / SIZE_OF_GRIDS);
|
||||
int lx = (int)x & 15;
|
||||
int ly = (int)y & 15;
|
||||
return m_area_map[lx*16 + ly];
|
||||
return m_area_map[lx * 16 + ly];
|
||||
}
|
||||
|
||||
float GridMap::getHeightFromFlat(float /*x*/, float /*y*/) const
|
||||
|
|
@ -254,8 +254,8 @@ float GridMap::getHeightFromFloat(float x, float y) const
|
|||
if (!m_V8 || !m_V9)
|
||||
return m_gridHeight;
|
||||
|
||||
x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
|
||||
x = MAP_RESOLUTION * (32 - x / SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y / SIZE_OF_GRIDS);
|
||||
|
||||
int x_int = (int)x;
|
||||
int y_int = (int)y;
|
||||
|
|
@ -279,26 +279,26 @@ float GridMap::getHeightFromFloat(float x, float y) const
|
|||
// 2 - solve linear equation from triangle points
|
||||
// Calculate coefficients for solve h = a*x + b*y + c
|
||||
|
||||
float a,b,c;
|
||||
float a, b, c;
|
||||
// Select triangle:
|
||||
if (x+y < 1)
|
||||
if (x + y < 1)
|
||||
{
|
||||
if (x > y)
|
||||
{
|
||||
// 1 triangle (h1, h2, h5 points)
|
||||
float h1 = m_V9[(x_int)*129 + y_int];
|
||||
float h2 = m_V9[(x_int+1)*129 + y_int];
|
||||
float h5 = 2 * m_V8[x_int*128 + y_int];
|
||||
a = h2-h1;
|
||||
b = h5-h1-h2;
|
||||
float h1 = m_V9[(x_int) * 129 + y_int];
|
||||
float h2 = m_V9[(x_int + 1) * 129 + y_int];
|
||||
float h5 = 2 * m_V8[x_int * 128 + y_int];
|
||||
a = h2 - h1;
|
||||
b = h5 - h1 - h2;
|
||||
c = h1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2 triangle (h1, h3, h5 points)
|
||||
float h1 = m_V9[x_int*129 + y_int ];
|
||||
float h3 = m_V9[x_int*129 + y_int+1];
|
||||
float h5 = 2 * m_V8[x_int*128 + y_int];
|
||||
float h1 = m_V9[x_int * 129 + y_int ];
|
||||
float h3 = m_V9[x_int * 129 + y_int + 1];
|
||||
float h5 = 2 * m_V8[x_int * 128 + y_int];
|
||||
a = h5 - h1 - h3;
|
||||
b = h3 - h1;
|
||||
c = h1;
|
||||
|
|
@ -309,9 +309,9 @@ float GridMap::getHeightFromFloat(float x, float y) const
|
|||
if (x > y)
|
||||
{
|
||||
// 3 triangle (h2, h4, h5 points)
|
||||
float h2 = m_V9[(x_int+1)*129 + y_int ];
|
||||
float h4 = m_V9[(x_int+1)*129 + y_int+1];
|
||||
float h5 = 2 * m_V8[x_int*128 + y_int];
|
||||
float h2 = m_V9[(x_int + 1) * 129 + y_int ];
|
||||
float h4 = m_V9[(x_int + 1) * 129 + y_int + 1];
|
||||
float h5 = 2 * m_V8[x_int * 128 + y_int];
|
||||
a = h2 + h4 - h5;
|
||||
b = h4 - h2;
|
||||
c = h5 - h4;
|
||||
|
|
@ -319,9 +319,9 @@ float GridMap::getHeightFromFloat(float x, float y) const
|
|||
else
|
||||
{
|
||||
// 4 triangle (h3, h4, h5 points)
|
||||
float h3 = m_V9[(x_int)*129 + y_int+1];
|
||||
float h4 = m_V9[(x_int+1)*129 + y_int+1];
|
||||
float h5 = 2 * m_V8[x_int*128 + y_int];
|
||||
float h3 = m_V9[(x_int) * 129 + y_int + 1];
|
||||
float h4 = m_V9[(x_int + 1) * 129 + y_int + 1];
|
||||
float h5 = 2 * m_V8[x_int * 128 + y_int];
|
||||
a = h4 - h3;
|
||||
b = h3 + h4 - h5;
|
||||
c = h5 - h4;
|
||||
|
|
@ -336,8 +336,8 @@ float GridMap::getHeightFromUint8(float x, float y) const
|
|||
if (!m_uint8_V8 || !m_uint8_V9)
|
||||
return m_gridHeight;
|
||||
|
||||
x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
|
||||
x = MAP_RESOLUTION * (32 - x / SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y / SIZE_OF_GRIDS);
|
||||
|
||||
int x_int = (int)x;
|
||||
int y_int = (int)y;
|
||||
|
|
@ -347,17 +347,17 @@ float GridMap::getHeightFromUint8(float x, float y) const
|
|||
y_int &= (MAP_RESOLUTION - 1);
|
||||
|
||||
int32 a, b, c;
|
||||
uint8* V9_h1_ptr = &m_uint8_V9[x_int*128 + x_int + y_int];
|
||||
if (x+y < 1)
|
||||
uint8* V9_h1_ptr = &m_uint8_V9[x_int * 128 + x_int + y_int];
|
||||
if (x + y < 1)
|
||||
{
|
||||
if (x > y)
|
||||
{
|
||||
// 1 triangle (h1, h2, h5 points)
|
||||
int32 h1 = V9_h1_ptr[ 0];
|
||||
int32 h2 = V9_h1_ptr[129];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
|
||||
a = h2-h1;
|
||||
b = h5-h1-h2;
|
||||
int32 h5 = 2 * m_uint8_V8[x_int * 128 + y_int];
|
||||
a = h2 - h1;
|
||||
b = h5 - h1 - h2;
|
||||
c = h1;
|
||||
}
|
||||
else
|
||||
|
|
@ -365,7 +365,7 @@ float GridMap::getHeightFromUint8(float x, float y) const
|
|||
// 2 triangle (h1, h3, h5 points)
|
||||
int32 h1 = V9_h1_ptr[0];
|
||||
int32 h3 = V9_h1_ptr[1];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int * 128 + y_int];
|
||||
a = h5 - h1 - h3;
|
||||
b = h3 - h1;
|
||||
c = h1;
|
||||
|
|
@ -378,7 +378,7 @@ float GridMap::getHeightFromUint8(float x, float y) const
|
|||
// 3 triangle (h2, h4, h5 points)
|
||||
int32 h2 = V9_h1_ptr[129];
|
||||
int32 h4 = V9_h1_ptr[130];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int * 128 + y_int];
|
||||
a = h2 + h4 - h5;
|
||||
b = h4 - h2;
|
||||
c = h5 - h4;
|
||||
|
|
@ -388,7 +388,7 @@ float GridMap::getHeightFromUint8(float x, float y) const
|
|||
// 4 triangle (h3, h4, h5 points)
|
||||
int32 h3 = V9_h1_ptr[ 1];
|
||||
int32 h4 = V9_h1_ptr[130];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
|
||||
int32 h5 = 2 * m_uint8_V8[x_int * 128 + y_int];
|
||||
a = h4 - h3;
|
||||
b = h3 + h4 - h5;
|
||||
c = h5 - h4;
|
||||
|
|
@ -396,7 +396,7 @@ float GridMap::getHeightFromUint8(float x, float y) const
|
|||
}
|
||||
|
||||
// Calculate height
|
||||
return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
|
||||
return (float)((a * x) + (b * y) + c) * m_gridIntHeightMultiplier + m_gridHeight;
|
||||
}
|
||||
|
||||
float GridMap::getHeightFromUint16(float x, float y) const
|
||||
|
|
@ -404,8 +404,8 @@ float GridMap::getHeightFromUint16(float x, float y) const
|
|||
if (!m_uint16_V8 || !m_uint16_V9)
|
||||
return m_gridHeight;
|
||||
|
||||
x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
|
||||
x = MAP_RESOLUTION * (32 - x / SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y / SIZE_OF_GRIDS);
|
||||
|
||||
int x_int = (int)x;
|
||||
int y_int = (int)y;
|
||||
|
|
@ -415,17 +415,17 @@ float GridMap::getHeightFromUint16(float x, float y) const
|
|||
y_int &= (MAP_RESOLUTION - 1);
|
||||
|
||||
int32 a, b, c;
|
||||
uint16* V9_h1_ptr = &m_uint16_V9[x_int*128 + x_int + y_int];
|
||||
if (x+y < 1)
|
||||
uint16* V9_h1_ptr = &m_uint16_V9[x_int * 128 + x_int + y_int];
|
||||
if (x + y < 1)
|
||||
{
|
||||
if (x > y)
|
||||
{
|
||||
// 1 triangle (h1, h2, h5 points)
|
||||
int32 h1 = V9_h1_ptr[ 0];
|
||||
int32 h2 = V9_h1_ptr[129];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
|
||||
a = h2-h1;
|
||||
b = h5-h1-h2;
|
||||
int32 h5 = 2 * m_uint16_V8[x_int * 128 + y_int];
|
||||
a = h2 - h1;
|
||||
b = h5 - h1 - h2;
|
||||
c = h1;
|
||||
}
|
||||
else
|
||||
|
|
@ -433,7 +433,7 @@ float GridMap::getHeightFromUint16(float x, float y) const
|
|||
// 2 triangle (h1, h3, h5 points)
|
||||
int32 h1 = V9_h1_ptr[0];
|
||||
int32 h3 = V9_h1_ptr[1];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int * 128 + y_int];
|
||||
a = h5 - h1 - h3;
|
||||
b = h3 - h1;
|
||||
c = h1;
|
||||
|
|
@ -446,7 +446,7 @@ float GridMap::getHeightFromUint16(float x, float y) const
|
|||
// 3 triangle (h2, h4, h5 points)
|
||||
int32 h2 = V9_h1_ptr[129];
|
||||
int32 h4 = V9_h1_ptr[130];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int * 128 + y_int];
|
||||
a = h2 + h4 - h5;
|
||||
b = h4 - h2;
|
||||
c = h5 - h4;
|
||||
|
|
@ -456,7 +456,7 @@ float GridMap::getHeightFromUint16(float x, float y) const
|
|||
// 4 triangle (h3, h4, h5 points)
|
||||
int32 h3 = V9_h1_ptr[ 1];
|
||||
int32 h4 = V9_h1_ptr[130];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
|
||||
int32 h5 = 2 * m_uint16_V8[x_int * 128 + y_int];
|
||||
a = h4 - h3;
|
||||
b = h3 + h4 - h5;
|
||||
c = h5 - h4;
|
||||
|
|
@ -464,7 +464,7 @@ float GridMap::getHeightFromUint16(float x, float y) const
|
|||
}
|
||||
|
||||
// Calculate height
|
||||
return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
|
||||
return (float)((a * x) + (b * y) + c) * m_gridIntHeightMultiplier + m_gridHeight;
|
||||
}
|
||||
|
||||
float GridMap::getLiquidLevel(float x, float y)
|
||||
|
|
@ -472,19 +472,19 @@ float GridMap::getLiquidLevel(float x, float y)
|
|||
if (!m_liquid_map)
|
||||
return m_liquidLevel;
|
||||
|
||||
x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
|
||||
x = MAP_RESOLUTION * (32 - x / SIZE_OF_GRIDS);
|
||||
y = MAP_RESOLUTION * (32 - y / SIZE_OF_GRIDS);
|
||||
|
||||
int cx_int = ((int)x & (MAP_RESOLUTION-1)) - m_liquid_offY;
|
||||
int cy_int = ((int)y & (MAP_RESOLUTION-1)) - m_liquid_offX;
|
||||
int cx_int = ((int)x & (MAP_RESOLUTION - 1)) - m_liquid_offY;
|
||||
int cy_int = ((int)y & (MAP_RESOLUTION - 1)) - m_liquid_offX;
|
||||
|
||||
if (cx_int < 0 || cx_int >=m_liquid_height)
|
||||
if (cx_int < 0 || cx_int >= m_liquid_height)
|
||||
return INVALID_HEIGHT_VALUE;
|
||||
|
||||
if (cy_int < 0 || cy_int >=m_liquid_width)
|
||||
if (cy_int < 0 || cy_int >= m_liquid_width)
|
||||
return INVALID_HEIGHT_VALUE;
|
||||
|
||||
return m_liquid_map[cx_int*m_liquid_width + cy_int];
|
||||
return m_liquid_map[cx_int * m_liquid_width + cy_int];
|
||||
}
|
||||
|
||||
uint8 GridMap::getTerrainType(float x, float y)
|
||||
|
|
@ -492,11 +492,11 @@ uint8 GridMap::getTerrainType(float x, float y)
|
|||
if (!m_liquid_type)
|
||||
return (uint8)m_liquidType;
|
||||
|
||||
x = 16 * (32 - x/SIZE_OF_GRIDS);
|
||||
y = 16 * (32 - y/SIZE_OF_GRIDS);
|
||||
x = 16 * (32 - x / SIZE_OF_GRIDS);
|
||||
y = 16 * (32 - y / SIZE_OF_GRIDS);
|
||||
int lx = (int)x & 15;
|
||||
int ly = (int)y & 15;
|
||||
return m_liquid_type[lx*16 + ly];
|
||||
return m_liquid_type[lx * 16 + ly];
|
||||
}
|
||||
|
||||
// Get water state on map
|
||||
|
|
@ -507,33 +507,33 @@ GridMapLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 Re
|
|||
return LIQUID_MAP_NO_WATER;
|
||||
|
||||
// Get cell
|
||||
float cx = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
|
||||
float cy = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
|
||||
float cx = MAP_RESOLUTION * (32 - x / SIZE_OF_GRIDS);
|
||||
float cy = MAP_RESOLUTION * (32 - y / SIZE_OF_GRIDS);
|
||||
|
||||
int x_int = (int)cx & (MAP_RESOLUTION-1);
|
||||
int y_int = (int)cy & (MAP_RESOLUTION-1);
|
||||
int x_int = (int)cx & (MAP_RESOLUTION - 1);
|
||||
int y_int = (int)cy & (MAP_RESOLUTION - 1);
|
||||
|
||||
// Check water type in cell
|
||||
uint8 type = m_liquid_type ? m_liquid_type[(x_int>>3)*16 + (y_int>>3)] : m_liquidType;
|
||||
uint8 type = m_liquid_type ? m_liquid_type[(x_int >> 3) * 16 + (y_int >> 3)] : m_liquidType;
|
||||
if (type == 0)
|
||||
return LIQUID_MAP_NO_WATER;
|
||||
|
||||
// Check req liquid type mask
|
||||
if (ReqLiquidType && !(ReqLiquidType&type))
|
||||
if (ReqLiquidType && !(ReqLiquidType & type))
|
||||
return LIQUID_MAP_NO_WATER;
|
||||
|
||||
// Check water level:
|
||||
// Check water height map
|
||||
int lx_int = x_int - m_liquid_offY;
|
||||
if (lx_int < 0 || lx_int >=m_liquid_height)
|
||||
if (lx_int < 0 || lx_int >= m_liquid_height)
|
||||
return LIQUID_MAP_NO_WATER;
|
||||
|
||||
int ly_int = y_int - m_liquid_offX;
|
||||
if (ly_int < 0 || ly_int >=m_liquid_width)
|
||||
if (ly_int < 0 || ly_int >= m_liquid_width)
|
||||
return LIQUID_MAP_NO_WATER;
|
||||
|
||||
// Get water level
|
||||
float liquid_level = m_liquid_map ? m_liquid_map[lx_int*m_liquid_width + ly_int] : m_liquidLevel;
|
||||
float liquid_level = m_liquid_map ? m_liquid_map[lx_int * m_liquid_width + ly_int] : m_liquidLevel;
|
||||
|
||||
// Get ground level (sub 0.2 for fix some errors)
|
||||
float ground_level = getHeight(x, y);
|
||||
|
|
@ -566,17 +566,17 @@ GridMapLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 Re
|
|||
return LIQUID_MAP_ABOVE_WATER;
|
||||
}
|
||||
|
||||
bool GridMap::ExistMap(uint32 mapid,int gx,int gy)
|
||||
bool GridMap::ExistMap(uint32 mapid, int gx, int gy)
|
||||
{
|
||||
int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
|
||||
int len = sWorld.GetDataPath().length() + strlen("maps/%03u%02u%02u.map") + 1;
|
||||
char* tmp = new char[len];
|
||||
snprintf(tmp, len, (char*)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy);
|
||||
snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%03u%02u%02u.map").c_str(), mapid, gx, gy);
|
||||
|
||||
FILE* pf=fopen(tmp,"rb");
|
||||
FILE* pf = fopen(tmp, "rb");
|
||||
|
||||
if (!pf)
|
||||
{
|
||||
sLog.outError("Check existing of map file '%s': not exist!",tmp);
|
||||
sLog.outError("Check existing of map file '%s': not exist!", tmp);
|
||||
delete[] tmp;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -587,7 +587,7 @@ bool GridMap::ExistMap(uint32 mapid,int gx,int gy)
|
|||
header.versionMagic != *((uint32 const*)(MAP_VERSION_MAGIC)) ||
|
||||
!IsAcceptableClientBuild(header.buildMagic))
|
||||
{
|
||||
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
|
||||
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", tmp);
|
||||
delete [] tmp;
|
||||
fclose(pf); //close file before return
|
||||
return false;
|
||||
|
|
@ -598,18 +598,18 @@ bool GridMap::ExistMap(uint32 mapid,int gx,int gy)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GridMap::ExistVMap(uint32 mapid,int gx,int gy)
|
||||
bool GridMap::ExistVMap(uint32 mapid, int gx, int gy)
|
||||
{
|
||||
if (VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager())
|
||||
{
|
||||
if (vmgr->isMapLoadingEnabled())
|
||||
{
|
||||
// x and y are swapped !! => fixed now
|
||||
bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, gx,gy);
|
||||
bool exists = vmgr->existsMap((sWorld.GetDataPath() + "vmaps").c_str(), mapid, gx, gy);
|
||||
if (!exists)
|
||||
{
|
||||
std::string name = vmgr->getDirFileName(mapid,gx,gy);
|
||||
sLog.outError("VMap file '%s' is missing or point to wrong version vmap file, redo vmaps with latest vmap_assembler.exe program", (sWorld.GetDataPath()+"vmaps/"+name).c_str());
|
||||
std::string name = vmgr->getDirFileName(mapid, gx, gy);
|
||||
sLog.outError("VMap file '%s' is missing or point to wrong version vmap file, redo vmaps with latest vmap_assembler.exe program", (sWorld.GetDataPath() + "vmaps/" + name).c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -747,7 +747,7 @@ float TerrainInfo::GetHeight(float x, float y, float z, bool pUseVmaps, float ma
|
|||
float z2 = z + 2.f;
|
||||
if (GridMap* gmap = const_cast<TerrainInfo*>(this)->GetGrid(x, y))
|
||||
{
|
||||
float _mapheight = gmap->getHeight(x,y);
|
||||
float _mapheight = gmap->getHeight(x, y);
|
||||
|
||||
// look from a bit higher pos to find the floor, ignore under surface case
|
||||
if (z2 > _mapheight)
|
||||
|
|
@ -790,7 +790,7 @@ float TerrainInfo::GetHeight(float x, float y, float z, bool pUseVmaps, float ma
|
|||
|
||||
// we are already under the surface or vmap height above map heigt
|
||||
// or if the distance of the vmap height is less the land height distance
|
||||
if (z < mapHeight || vmapHeight > mapHeight || fabs(mapHeight-z) > fabs(vmapHeight-z))
|
||||
if (z < mapHeight || vmapHeight > mapHeight || fabs(mapHeight - z) > fabs(vmapHeight - z))
|
||||
return vmapHeight;
|
||||
else
|
||||
return mapHeight; // better use .map surface height
|
||||
|
|
@ -816,14 +816,14 @@ inline bool IsOutdoorWMO(uint32 mogpFlags, int32 adtId, int32 rootId, int32 grou
|
|||
return false;
|
||||
}
|
||||
|
||||
outdoor = mogpFlags&0x8;
|
||||
outdoor = mogpFlags & 0x8;
|
||||
|
||||
if (wmoEntry)
|
||||
{
|
||||
if (wmoEntry->Flags & 4)
|
||||
return true;
|
||||
|
||||
if ((wmoEntry->Flags & 2)!=0)
|
||||
if ((wmoEntry->Flags & 2) != 0)
|
||||
outdoor = false;
|
||||
}
|
||||
return outdoor;
|
||||
|
|
@ -839,7 +839,7 @@ bool TerrainInfo::IsOutdoors(float x, float y, float z) const
|
|||
return true;
|
||||
|
||||
AreaTableEntry const* atEntry = 0;
|
||||
WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
|
||||
WMOAreaTableEntry const* wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
|
||||
if (wmoEntry)
|
||||
{
|
||||
DEBUG_LOG("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
|
||||
|
|
@ -859,7 +859,7 @@ bool TerrainInfo::GetAreaInfo(float x, float y, float z, uint32& flags, int32& a
|
|||
// check if there's terrain between player height and object height
|
||||
if (GridMap* gmap = const_cast<TerrainInfo*>(this)->GetGrid(x, y))
|
||||
{
|
||||
float _mapheight = gmap->getHeight(x,y);
|
||||
float _mapheight = gmap->getHeight(x, y);
|
||||
// z + 2.0f condition taken from GetHeight(), not sure if it's such a great choice...
|
||||
if (z + 2.0f > _mapheight && _mapheight > vmap_z)
|
||||
return false;
|
||||
|
|
@ -917,17 +917,17 @@ uint8 TerrainInfo::GetTerrainType(float x, float y) const
|
|||
|
||||
uint32 TerrainInfo::GetAreaId(float x, float y, float z) const
|
||||
{
|
||||
return TerrainManager::GetAreaIdByAreaFlag(GetAreaFlag(x,y,z),m_mapId);
|
||||
return TerrainManager::GetAreaIdByAreaFlag(GetAreaFlag(x, y, z), m_mapId);
|
||||
}
|
||||
|
||||
uint32 TerrainInfo::GetZoneId(float x, float y, float z) const
|
||||
{
|
||||
return TerrainManager::GetZoneIdByAreaFlag(GetAreaFlag(x,y,z),m_mapId);
|
||||
return TerrainManager::GetZoneIdByAreaFlag(GetAreaFlag(x, y, z), m_mapId);
|
||||
}
|
||||
|
||||
void TerrainInfo::GetZoneAndAreaId(uint32& zoneid, uint32& areaid, float x, float y, float z) const
|
||||
{
|
||||
TerrainManager::GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(x,y,z),m_mapId);
|
||||
TerrainManager::GetZoneAndAreaIdByAreaFlag(zoneid, areaid, GetAreaFlag(x, y, z), m_mapId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -999,7 +999,7 @@ bool TerrainInfo::IsUnderWater(float x, float y, float z) const
|
|||
{
|
||||
if (const_cast<TerrainInfo*>(this)->GetGrid(x, y))
|
||||
{
|
||||
if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER)
|
||||
if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1038,8 +1038,8 @@ float TerrainInfo::GetWaterOrGroundLevel(float x, float y, float z, float* pGrou
|
|||
GridMap* TerrainInfo::GetGrid(const float x, const float y)
|
||||
{
|
||||
// half opt method
|
||||
int gx=(int)(32-x/SIZE_OF_GRIDS); //grid x
|
||||
int gy=(int)(32-y/SIZE_OF_GRIDS); //grid y
|
||||
int gx = (int)(32 - x / SIZE_OF_GRIDS); //grid x
|
||||
int gy = (int)(32 - y / SIZE_OF_GRIDS); //grid y
|
||||
|
||||
//quick check if GridMap already loaded
|
||||
GridMap* pMap = m_GridMaps[gx][gy];
|
||||
|
|
@ -1061,11 +1061,11 @@ GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y)
|
|||
GridMap* map = new GridMap();
|
||||
|
||||
// map file name
|
||||
char* tmp=NULL;
|
||||
int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
|
||||
char* tmp = NULL;
|
||||
int len = sWorld.GetDataPath().length() + strlen("maps/%03u%02u%02u.map") + 1;
|
||||
tmp = new char[len];
|
||||
snprintf(tmp, len, (char*)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),m_mapId, x, y);
|
||||
sLog.outDetail("Loading map %s",tmp);
|
||||
snprintf(tmp, len, (char*)(sWorld.GetDataPath() + "maps/%03u%02u%02u.map").c_str(), m_mapId, x, y);
|
||||
sLog.outDetail("Loading map %s", tmp);
|
||||
|
||||
if (!map->loadData(tmp))
|
||||
{
|
||||
|
|
@ -1080,17 +1080,17 @@ GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y)
|
|||
const MapEntry* i_mapEntry = sMapStore.LookupEntry(m_mapId);
|
||||
const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld.GetDefaultDbcLocale()] : "UNNAMEDMAP\x0";
|
||||
|
||||
int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld.GetDataPath()+ "vmaps").c_str(), m_mapId, x, y);
|
||||
int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld.GetDataPath() + "vmaps").c_str(), m_mapId, x, y);
|
||||
switch (vmapLoadResult)
|
||||
{
|
||||
case VMAP::VMAP_LOAD_RESULT_OK:
|
||||
sLog.outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x,y,x,y);
|
||||
sLog.outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x, y, x, y);
|
||||
break;
|
||||
case VMAP::VMAP_LOAD_RESULT_ERROR:
|
||||
sLog.outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x,y,x,y);
|
||||
sLog.outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x, y, x, y);
|
||||
break;
|
||||
case VMAP::VMAP_LOAD_RESULT_IGNORED:
|
||||
DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x,y,x,y);
|
||||
DEBUG_LOG("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", mapName, m_mapId, x, y, x, y);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1191,9 +1191,9 @@ void TerrainManager::UnloadAll()
|
|||
i_TerrainMap.clear();
|
||||
}
|
||||
|
||||
uint32 TerrainManager::GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id)
|
||||
uint32 TerrainManager::GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id)
|
||||
{
|
||||
AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
|
||||
AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id);
|
||||
|
||||
if (entry)
|
||||
return entry->ID;
|
||||
|
|
@ -1201,9 +1201,9 @@ uint32 TerrainManager::GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
uint32 TerrainManager::GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id)
|
||||
uint32 TerrainManager::GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id)
|
||||
{
|
||||
AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
|
||||
AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id);
|
||||
|
||||
if (entry)
|
||||
return (entry->zone != 0) ? entry->zone : entry->ID;
|
||||
|
|
@ -1211,9 +1211,9 @@ uint32 TerrainManager::GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void TerrainManager::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id)
|
||||
void TerrainManager::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag, uint32 map_id)
|
||||
{
|
||||
AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id);
|
||||
AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id);
|
||||
|
||||
areaid = entry ? entry->ID : 0;
|
||||
zoneid = entry ? ((entry->zone != 0) ? entry->zone : entry->ID) : 0;
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
|
|||
|
||||
//TODO: move all terrain/vmaps data info query functions
|
||||
//from 'Map' class into this class
|
||||
float GetHeight(float x, float y, float z, bool pCheckVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const;
|
||||
float GetHeight(float x, float y, float z, bool pCheckVMap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
|
||||
float GetWaterLevel(float x, float y, float z, float* pGround = NULL) const;
|
||||
float GetWaterOrGroundLevel(float x, float y, float z, float* pGround = NULL, bool swim = false) const;
|
||||
bool IsInWater(float x, float y, float z, GridMapLiquidData* data = 0) const;
|
||||
|
|
@ -226,7 +226,7 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable<AtomicLong>
|
|||
|
||||
GridMapLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData* data = 0) const;
|
||||
|
||||
uint16 GetAreaFlag(float x, float y, float z, bool* isOutdoors=0) const;
|
||||
uint16 GetAreaFlag(float x, float y, float z, bool* isOutdoors = 0) const;
|
||||
uint8 GetTerrainType(float x, float y) const;
|
||||
|
||||
uint32 GetAreaId(float x, float y, float z) const;
|
||||
|
|
@ -293,20 +293,20 @@ class MANGOS_DLL_DECL TerrainManager : public MaNGOS::Singleton<TerrainManager,
|
|||
}
|
||||
uint32 GetAreaId(uint32 mapid, float x, float y, float z) const
|
||||
{
|
||||
return TerrainManager::GetAreaIdByAreaFlag(GetAreaFlag(mapid, x, y, z),mapid);
|
||||
return TerrainManager::GetAreaIdByAreaFlag(GetAreaFlag(mapid, x, y, z), mapid);
|
||||
}
|
||||
uint32 GetZoneId(uint32 mapid, float x, float y, float z) const
|
||||
{
|
||||
return TerrainManager::GetZoneIdByAreaFlag(GetAreaFlag(mapid, x, y, z),mapid);
|
||||
return TerrainManager::GetZoneIdByAreaFlag(GetAreaFlag(mapid, x, y, z), mapid);
|
||||
}
|
||||
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, uint32 mapid, float x, float y, float z)
|
||||
{
|
||||
TerrainManager::GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(mapid, x, y, z),mapid);
|
||||
TerrainManager::GetZoneAndAreaIdByAreaFlag(zoneid, areaid, GetAreaFlag(mapid, x, y, z), mapid);
|
||||
}
|
||||
|
||||
static uint32 GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id);
|
||||
static uint32 GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id);
|
||||
static void GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id);
|
||||
static uint32 GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id);
|
||||
static uint32 GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id);
|
||||
static void GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag, uint32 map_id);
|
||||
|
||||
private:
|
||||
TerrainManager();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ using namespace MaNGOS;
|
|||
|
||||
void VisibleChangesNotifier::Visit(CameraMapType& m)
|
||||
{
|
||||
for (CameraMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
iter->getSource()->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ void VisibleNotifier::Notify()
|
|||
// but exist one case when this possible and object not out of range: transports
|
||||
if (Transport* transport = player.GetTransport())
|
||||
{
|
||||
for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin(); itr!=transport->GetPassengers().end(); ++itr)
|
||||
for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr)
|
||||
{
|
||||
if (i_clientGUIDs.find((*itr)->GetObjectGuid()) != i_clientGUIDs.end())
|
||||
{
|
||||
|
|
@ -58,7 +58,7 @@ void VisibleNotifier::Notify()
|
|||
|
||||
// generate outOfRange for not iterate objects
|
||||
i_data.AddOutOfRangeGUID(i_clientGUIDs);
|
||||
for (GuidSet::iterator itr = i_clientGUIDs.begin(); itr!=i_clientGUIDs.end(); ++itr)
|
||||
for (GuidSet::iterator itr = i_clientGUIDs.begin(); itr != i_clientGUIDs.end(); ++itr)
|
||||
{
|
||||
player.m_clientGUIDs.erase(*itr);
|
||||
|
||||
|
|
@ -141,13 +141,13 @@ void ObjectMessageDeliverer::Visit(CameraMapType& m)
|
|||
|
||||
void MessageDistDeliverer::Visit(CameraMapType& m)
|
||||
{
|
||||
for (CameraMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* owner = iter->getSource()->GetOwner();
|
||||
|
||||
if ((i_toSelf || owner != &i_player) &&
|
||||
(!i_ownTeamOnly || owner->GetTeam() == i_player.GetTeam()) &&
|
||||
(!i_dist || iter->getSource()->GetBody()->IsWithinDist(&i_player,i_dist)))
|
||||
(!i_dist || iter->getSource()->GetBody()->IsWithinDist(&i_player, i_dist)))
|
||||
{
|
||||
if (!i_player.InSamePhase(iter->getSource()->GetBody()))
|
||||
continue;
|
||||
|
|
@ -160,9 +160,9 @@ void MessageDistDeliverer::Visit(CameraMapType& m)
|
|||
|
||||
void ObjectMessageDistDeliverer::Visit(CameraMapType& m)
|
||||
{
|
||||
for (CameraMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CameraMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (!i_dist || iter->getSource()->GetBody()->IsWithinDist(&i_object,i_dist))
|
||||
if (!i_dist || iter->getSource()->GetBody()->IsWithinDist(&i_object, i_dist))
|
||||
{
|
||||
if (!i_object.InSamePhase(iter->getSource()->GetBody()))
|
||||
continue;
|
||||
|
|
@ -186,7 +186,7 @@ void ObjectUpdater::Visit(GridRefManager<T>& m)
|
|||
bool CannibalizeObjectCheck::operator()(Corpse* u)
|
||||
{
|
||||
// ignore bones
|
||||
if (u->GetType()==CORPSE_BONES)
|
||||
if (u->GetType() == CORPSE_BONES)
|
||||
return false;
|
||||
|
||||
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGuid());
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
WorldObjectSearcher(WorldObject*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(GameObjectMapType& m);
|
||||
void Visit(PlayerMapType& m);
|
||||
|
|
@ -223,7 +223,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
WorldObjectListSearcher(std::list<WorldObject*>& objects, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects), i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
|
|
@ -245,34 +245,34 @@ namespace MaNGOS
|
|||
|
||||
void Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
||||
void Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
void Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
||||
void Visit(CorpseMapType& m)
|
||||
{
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
||||
void Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
|
@ -290,7 +290,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
GameObjectSearcher(GameObject*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(GameObjectMapType& m);
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
UnitSearcher(Unit*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType& m);
|
||||
void Visit(PlayerMapType& m);
|
||||
|
|
@ -356,7 +356,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
UnitLastSearcher(Unit*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType& m);
|
||||
void Visit(PlayerMapType& m);
|
||||
|
|
@ -373,7 +373,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
UnitListSearcher(std::list<Unit*>& objects, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects), i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
|
|
@ -391,7 +391,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
CreatureSearcher(Creature*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
|
|
@ -407,7 +407,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
CreatureLastSearcher(Creature*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
CreatureListSearcher(std::list<Creature*>& objects, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects), i_check(check) {}
|
||||
|
||||
void Visit(CreatureMapType& m);
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ namespace MaNGOS
|
|||
|
||||
void Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
|
@ -458,7 +458,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
PlayerSearcher(Player*& result, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ namespace MaNGOS
|
|||
Check& i_check;
|
||||
|
||||
PlayerListSearcher(std::list<Player*>& objects, Check& check)
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects),i_check(check) {}
|
||||
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_objects(objects), i_check(check) {}
|
||||
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ namespace MaNGOS
|
|||
|
||||
void Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
|
@ -511,8 +511,8 @@ namespace MaNGOS
|
|||
|
||||
void Visit(CameraMapType& m)
|
||||
{
|
||||
for (CameraMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->GetBody()->InSamePhase(i_searcher) && itr->getSource()->GetBody()->IsWithinDist(i_searcher,i_dist))
|
||||
for (CameraMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->GetBody()->InSamePhase(i_searcher) && itr->getSource()->GetBody()->IsWithinDist(i_searcher, i_dist))
|
||||
i_do(itr->getSource()->GetOwner());
|
||||
}
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
|
||||
|
|
@ -547,7 +547,7 @@ namespace MaNGOS
|
|||
{
|
||||
if (i_fobj->isHonorOrXPTarget(u) ||
|
||||
u->getDeathState() != CORPSE || u->IsDeadByDefault() || u->IsTaxiFlying() ||
|
||||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1)))==0 ||
|
||||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID - 1))) == 0 ||
|
||||
(u->GetDisplayId() != u->GetNativeDisplayId()))
|
||||
return false;
|
||||
|
||||
|
|
@ -566,7 +566,7 @@ namespace MaNGOS
|
|||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() ||
|
||||
if (u->getDeathState() != CORPSE || u->IsTaxiFlying() ||
|
||||
u->HasAuraType(SPELL_AURA_GHOST) || (u->GetDisplayId() != u->GetNativeDisplayId()))
|
||||
return false;
|
||||
|
||||
|
|
@ -574,9 +574,9 @@ namespace MaNGOS
|
|||
}
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() || u->IsDeadByDefault() ||
|
||||
if (u->getDeathState() != CORPSE || u->IsTaxiFlying() || u->IsDeadByDefault() ||
|
||||
(u->GetDisplayId() != u->GetNativeDisplayId()) ||
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)!=0)
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) != 0)
|
||||
return false;
|
||||
|
||||
return i_fobj->IsWithinDistInMap(u, i_range);
|
||||
|
|
@ -603,7 +603,7 @@ namespace MaNGOS
|
|||
bool operator()(Creature* u)
|
||||
{
|
||||
if (i_fobj->IsFriendlyTo(u) || u->isAlive() || u->IsTaxiFlying() ||
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD)==0)
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
|
||||
return false;
|
||||
|
||||
return i_fobj->IsWithinDistInMap(u, i_range);
|
||||
|
|
@ -631,7 +631,7 @@ namespace MaNGOS
|
|||
class GameObjectFocusCheck
|
||||
{
|
||||
public:
|
||||
GameObjectFocusCheck(Unit const* unit,uint32 focusId) : i_unit(unit), i_focusId(focusId) {}
|
||||
GameObjectFocusCheck(Unit const* unit, uint32 focusId) : i_unit(unit), i_focusId(focusId) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_unit; }
|
||||
bool operator()(GameObject* go) const
|
||||
{
|
||||
|
|
@ -678,7 +678,7 @@ namespace MaNGOS
|
|||
class NearestGameObjectEntryInObjectRangeCheck
|
||||
{
|
||||
public:
|
||||
NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj,uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) {}
|
||||
NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj, uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||
bool operator()(GameObject* go)
|
||||
{
|
||||
|
|
@ -713,7 +713,7 @@ namespace MaNGOS
|
|||
if (go->GetEntry() == i_entry && go->IsWithinDist3d(i_x, i_y, i_z, i_range))
|
||||
{
|
||||
// use found GO range as new range limit for next check
|
||||
i_range = go->GetDistance(i_x,i_y,i_z);
|
||||
i_range = go->GetDistance(i_x, i_y, i_z);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -851,7 +851,7 @@ namespace MaNGOS
|
|||
return u->isAlive()
|
||||
&& i_obj->IsWithinDistInMap(u, i_range)
|
||||
&& !i_funit->IsFriendlyTo(u)
|
||||
&& u->isVisibleForOrDetect(i_funit,i_funit,false);
|
||||
&& u->isVisibleForOrDetect(i_funit, i_funit, false);
|
||||
}
|
||||
private:
|
||||
WorldObject const* i_obj;
|
||||
|
|
@ -902,7 +902,7 @@ namespace MaNGOS
|
|||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isTargetableForAttack() && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
!i_funit->IsFriendlyTo(u) && u->isVisibleForOrDetect(i_funit,i_funit,false))
|
||||
!i_funit->IsFriendlyTo(u) && u->isVisibleForOrDetect(i_funit, i_funit, false))
|
||||
{
|
||||
i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
|
||||
return true;
|
||||
|
|
@ -936,7 +936,7 @@ namespace MaNGOS
|
|||
return false;
|
||||
|
||||
// ignore totems as AoE targets
|
||||
if (u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
return false;
|
||||
|
||||
// check visibility only for unit-like original casters
|
||||
|
|
@ -971,10 +971,10 @@ namespace MaNGOS
|
|||
if (!u->isTargetableForAttack())
|
||||
return false;
|
||||
|
||||
if (u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
return false;
|
||||
|
||||
if ((i_targetForPlayer ? !i_obj->IsFriendlyTo(u) : i_obj->IsHostileTo(u))&& i_obj->IsWithinDistInMap(u, i_range))
|
||||
if ((i_targetForPlayer ? !i_obj->IsFriendlyTo(u) : i_obj->IsHostileTo(u)) && i_obj->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
@ -1016,7 +1016,7 @@ namespace MaNGOS
|
|||
public:
|
||||
explicit AnyStealthedCheck(WorldObject const* fobj) : i_fobj(fobj) {}
|
||||
WorldObject const& GetFocusObject() const { return *i_fobj; }
|
||||
bool operator()(Unit* u) { return u->GetVisibility()==VISIBILITY_GROUP_STEALTH; }
|
||||
bool operator()(Unit* u) { return u->GetVisibility() == VISIBILITY_GROUP_STEALTH; }
|
||||
private:
|
||||
WorldObject const* i_fobj;
|
||||
};
|
||||
|
|
@ -1065,7 +1065,7 @@ namespace MaNGOS
|
|||
{
|
||||
if (u == i_obj)
|
||||
return false;
|
||||
if (!u->CanAssistTo(i_obj,i_enemy))
|
||||
if (!u->CanAssistTo(i_obj, i_enemy))
|
||||
return false;
|
||||
|
||||
if (!i_obj->IsWithinDistInMap(u, i_range))
|
||||
|
|
@ -1091,7 +1091,7 @@ namespace MaNGOS
|
|||
class NearestCreatureEntryWithLiveStateInObjectRangeCheck
|
||||
{
|
||||
public:
|
||||
NearestCreatureEntryWithLiveStateInObjectRangeCheck(WorldObject const& obj,uint32 entry, bool onlyAlive, bool onlyDead, float range)
|
||||
NearestCreatureEntryWithLiveStateInObjectRangeCheck(WorldObject const& obj, uint32 entry, bool onlyAlive, bool onlyDead, float range)
|
||||
: i_obj(obj), i_entry(entry), i_onlyAlive(onlyAlive), i_onlyDead(onlyDead), i_range(range) {}
|
||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||
bool operator()(Creature* u)
|
||||
|
|
@ -1122,7 +1122,7 @@ namespace MaNGOS
|
|||
WorldObject const& GetFocusObject() const { return *m_pObject; }
|
||||
bool operator()(Unit* pUnit)
|
||||
{
|
||||
if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit,m_fRange,false))
|
||||
if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit, m_fRange, false))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ inline void MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType& m)
|
|||
if (!i_creature.isAlive())
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->getSource();
|
||||
if (player->isAlive() && !player->IsTaxiFlying())
|
||||
|
|
@ -130,7 +130,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
|
|||
return;
|
||||
|
||||
// Evade target
|
||||
if (target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode())
|
||||
if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
//Check player targets and remove if in GM mode or GM invisibility (for not self casting case)
|
||||
|
|
@ -171,7 +171,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
|
|||
holder->AddAura(Aur, eff_index);
|
||||
target->AddAuraToModList(Aur);
|
||||
holder->SetInUse(true);
|
||||
Aur->ApplyModifier(true,true);
|
||||
Aur->ApplyModifier(true, true);
|
||||
holder->SetInUse(false);
|
||||
}
|
||||
else if (holder->GetAuraDuration() >= 0 && uint32(holder->GetAuraDuration()) < i_dynobject.GetDuration())
|
||||
|
|
@ -194,7 +194,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
|
|||
template<>
|
||||
inline void MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
VisitHelper(itr->getSource());
|
||||
}
|
||||
|
||||
|
|
@ -561,14 +561,14 @@ template<class Builder>
|
|||
void MaNGOS::LocalizedPacketDo<Builder>::operator()(Player* p)
|
||||
{
|
||||
int32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
|
||||
uint32 cache_idx = loc_idx+1;
|
||||
uint32 cache_idx = loc_idx + 1;
|
||||
WorldPacket* data;
|
||||
|
||||
// create if not cached yet
|
||||
if (i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
|
||||
if (i_data_cache.size() < cache_idx + 1 || !i_data_cache[cache_idx])
|
||||
{
|
||||
if (i_data_cache.size() < cache_idx+1)
|
||||
i_data_cache.resize(cache_idx+1);
|
||||
if (i_data_cache.size() < cache_idx + 1)
|
||||
i_data_cache.resize(cache_idx + 1);
|
||||
|
||||
data = new WorldPacket(SMSG_MESSAGECHAT, 200);
|
||||
|
||||
|
|
@ -586,14 +586,14 @@ template<class Builder>
|
|||
void MaNGOS::LocalizedPacketListDo<Builder>::operator()(Player* p)
|
||||
{
|
||||
int32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
|
||||
uint32 cache_idx = loc_idx+1;
|
||||
uint32 cache_idx = loc_idx + 1;
|
||||
WorldPacketList* data_list;
|
||||
|
||||
// create if not cached yet
|
||||
if (i_data_cache.size() < cache_idx+1 || i_data_cache[cache_idx].empty())
|
||||
if (i_data_cache.size() < cache_idx + 1 || i_data_cache[cache_idx].empty())
|
||||
{
|
||||
if (i_data_cache.size() < cache_idx+1)
|
||||
i_data_cache.resize(cache_idx+1);
|
||||
if (i_data_cache.size() < cache_idx + 1)
|
||||
i_data_cache.resize(cache_idx + 1);
|
||||
|
||||
data_list = &i_data_cache[cache_idx];
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ bool Group::LoadGroupFromDB(Field* fields)
|
|||
m_lootThreshold = ItemQualities(fields[4].GetUInt16());
|
||||
|
||||
for (int i = 0; i < TARGET_ICON_COUNT; ++i)
|
||||
m_targetIcons[i] = ObjectGuid(fields[5+i].GetUInt64());
|
||||
m_targetIcons[i] = ObjectGuid(fields[5 + i].GetUInt64());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -279,7 +279,7 @@ uint32 Group::RemoveInvite(Player* player)
|
|||
|
||||
void Group::RemoveAllInvites()
|
||||
{
|
||||
for (InvitesList::iterator itr = m_invitees.begin(); itr!=m_invitees.end(); ++itr)
|
||||
for (InvitesList::iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
(*itr)->SetGroupInvite(NULL);
|
||||
|
||||
m_invitees.clear();
|
||||
|
|
@ -317,8 +317,8 @@ bool Group::AddMember(ObjectGuid guid, const char* name)
|
|||
{
|
||||
// reset the new member's instances, unless he is currently in one of them
|
||||
// including raid/heroic instances that they are not permanently bound to!
|
||||
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,false);
|
||||
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,true);
|
||||
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, false);
|
||||
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, true);
|
||||
|
||||
if (player->getLevel() >= LEVELREQUIREMENT_HEROIC)
|
||||
{
|
||||
|
|
@ -373,7 +373,7 @@ uint32 Group::RemoveMember(ObjectGuid guid, uint8 method)
|
|||
}
|
||||
else
|
||||
{
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data.Initialize(SMSG_GROUP_LIST, 1 + 1 + 1 + 1 + 8 + 4 + 4 + 8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(0) << uint32(0) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
|
@ -384,7 +384,7 @@ uint32 Group::RemoveMember(ObjectGuid guid, uint8 method)
|
|||
|
||||
if (leaderChanged)
|
||||
{
|
||||
WorldPacket data(SMSG_GROUP_SET_LEADER, (m_memberSlots.front().name.size()+1));
|
||||
WorldPacket data(SMSG_GROUP_SET_LEADER, (m_memberSlots.front().name.size() + 1));
|
||||
data << m_memberSlots.front().name;
|
||||
BroadcastPacket(&data, true);
|
||||
}
|
||||
|
|
@ -406,7 +406,7 @@ void Group::ChangeLeader(ObjectGuid guid)
|
|||
|
||||
_setLeader(guid);
|
||||
|
||||
WorldPacket data(SMSG_GROUP_SET_LEADER, slot->name.size()+1);
|
||||
WorldPacket data(SMSG_GROUP_SET_LEADER, slot->name.size() + 1);
|
||||
data << slot->name;
|
||||
BroadcastPacket(&data, true);
|
||||
SendUpdate();
|
||||
|
|
@ -456,7 +456,7 @@ void Group::Disband(bool hideDestroy)
|
|||
}
|
||||
else
|
||||
{
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data.Initialize(SMSG_GROUP_LIST, 1 + 1 + 1 + 1 + 8 + 4 + 4 + 8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(0) << uint32(0) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
|
@ -489,7 +489,7 @@ void Group::Disband(bool hideDestroy)
|
|||
|
||||
void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1));
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1));
|
||||
data << r.lootedTargetGUID; // creature guid what we're looting
|
||||
data << uint32(mapid); // 3.3.3 mapid
|
||||
data << uint32(r.itemSlot); // item slot in loot
|
||||
|
|
@ -513,7 +513,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r)
|
|||
|
||||
// dependent from player
|
||||
RollVoteMask mask = r.GetVoteMaskFor(p);
|
||||
data.put<uint8>(voteMaskPos,uint8(mask));
|
||||
data.put<uint8>(voteMaskPos, uint8(mask));
|
||||
|
||||
p->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
|
@ -521,7 +521,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r)
|
|||
|
||||
void Group::SendLootRoll(ObjectGuid const& targetGuid, uint8 rollNumber, uint8 rollType, const Roll& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1));
|
||||
WorldPacket data(SMSG_LOOT_ROLL, (8 + 4 + 8 + 4 + 4 + 4 + 1 + 1 + 1));
|
||||
data << r.lootedTargetGUID; // creature guid what we're looting
|
||||
data << uint32(r.itemSlot); // unknown, maybe amount of players, or item slot in loot
|
||||
data << targetGuid;
|
||||
|
|
@ -545,7 +545,7 @@ void Group::SendLootRoll(ObjectGuid const& targetGuid, uint8 rollNumber, uint8 r
|
|||
|
||||
void Group::SendLootRollWon(ObjectGuid const& targetGuid, uint8 rollNumber, RollVote rollType, const Roll& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1));
|
||||
WorldPacket data(SMSG_LOOT_ROLL_WON, (8 + 4 + 4 + 4 + 4 + 8 + 1 + 1));
|
||||
data << r.lootedTargetGUID; // creature guid what we're looting
|
||||
data << uint32(r.itemSlot); // item slot in loot
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
|
|
@ -568,14 +568,14 @@ void Group::SendLootRollWon(ObjectGuid const& targetGuid, uint8 rollNumber, Roll
|
|||
|
||||
void Group::SendLootAllPassed(Roll const& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4));
|
||||
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8 + 4 + 4 + 4 + 4));
|
||||
data << r.lootedTargetGUID; // creature guid what we're looting
|
||||
data << uint32(r.itemSlot); // item slot in loot
|
||||
data << uint32(r.itemid); // The itemEntryId for the item that shall be rolled for
|
||||
data << uint32(r.itemRandomPropId); // Item random property ID
|
||||
data << uint32(r.itemRandomSuffix); // Item random suffix ID
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player* p = sObjectMgr.GetPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
|
|
@ -632,7 +632,7 @@ void Group::NeedBeforeGreed(WorldObject* pSource, Loot* loot)
|
|||
|
||||
void Group::MasterLoot(WorldObject* pSource, Loot* loot)
|
||||
{
|
||||
for (LootItemList::iterator i=loot->items.begin(); i != loot->items.end(); ++i)
|
||||
for (LootItemList::iterator i = loot->items.begin(); i != loot->items.end(); ++i)
|
||||
{
|
||||
ItemPrototype const* item = ObjectMgr::GetItemPrototype(i->itemid);
|
||||
if (!item)
|
||||
|
|
@ -955,7 +955,7 @@ void Group::SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid)
|
|||
|
||||
m_targetIcons[id] = targetGuid;
|
||||
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+8+1+8));
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1 + 8 + 1 + 8));
|
||||
data << uint8(0); // set targets
|
||||
data << whoGuid;
|
||||
data << uint8(id);
|
||||
|
|
@ -975,7 +975,7 @@ static void GetDataForXPAtKill_helper(Player* player, Unit const* victim, uint32
|
|||
not_gray_member_with_max_level = player;
|
||||
}
|
||||
|
||||
void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player*& member_with_max_level, Player*& not_gray_member_with_max_level, Player* additional)
|
||||
void Group::GetDataForXPAtKill(Unit const* victim, uint32& count, uint32& sum_level, Player*& member_with_max_level, Player*& not_gray_member_with_max_level, Player* additional)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
|
|
@ -991,7 +991,7 @@ void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_lev
|
|||
continue;
|
||||
|
||||
++count;
|
||||
GetDataForXPAtKill_helper(member,victim,sum_level,member_with_max_level,not_gray_member_with_max_level);
|
||||
GetDataForXPAtKill_helper(member, victim, sum_level, member_with_max_level, not_gray_member_with_max_level);
|
||||
}
|
||||
|
||||
if (additional)
|
||||
|
|
@ -999,7 +999,7 @@ void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_lev
|
|||
if (additional->IsAtGroupRewardDistance(victim)) // at req. distance
|
||||
{
|
||||
++count;
|
||||
GetDataForXPAtKill_helper(additional,victim,sum_level,member_with_max_level,not_gray_member_with_max_level);
|
||||
GetDataForXPAtKill_helper(additional, victim, sum_level, member_with_max_level, not_gray_member_with_max_level);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1009,7 +1009,7 @@ void Group::SendTargetIconList(WorldSession* session)
|
|||
if (!session)
|
||||
return;
|
||||
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+TARGET_ICON_COUNT*9));
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1 + TARGET_ICON_COUNT * 9));
|
||||
data << uint8(1); // list targets
|
||||
|
||||
for (int i = 0; i < TARGET_ICON_COUNT; ++i)
|
||||
|
|
@ -1032,7 +1032,7 @@ void Group::SendUpdate()
|
|||
if (!player || !player->GetSession() || player->GetGroup() != this)
|
||||
continue;
|
||||
// guess size
|
||||
WorldPacket data(SMSG_GROUP_LIST, (1+1+1+1+8+4+GetMembersCount()*20));
|
||||
WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 8 + 4 + GetMembersCount() * 20));
|
||||
data << uint8(m_groupType); // group type (flags in 3.3)
|
||||
data << uint8(citr->group); // groupid
|
||||
data << uint8(GetFlags(*citr)); // group flags
|
||||
|
|
@ -1044,7 +1044,7 @@ void Group::SendUpdate()
|
|||
}
|
||||
data << GetObjectGuid(); // group guid
|
||||
data << uint32(0); // 3.3, this value increments every time SMSG_GROUP_LIST is sent
|
||||
data << uint32(GetMembersCount()-1);
|
||||
data << uint32(GetMembersCount() - 1);
|
||||
for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
|
||||
{
|
||||
if (citr->guid == citr2->guid)
|
||||
|
|
@ -1062,7 +1062,7 @@ void Group::SendUpdate()
|
|||
}
|
||||
|
||||
data << m_leaderGuid; // leader guid
|
||||
if (GetMembersCount()-1)
|
||||
if (GetMembersCount() - 1)
|
||||
{
|
||||
data << uint8(m_lootMethod); // loot method
|
||||
data << m_looterGuid; // looter guid
|
||||
|
|
@ -1212,7 +1212,7 @@ bool Group::_addMember(ObjectGuid guid, const char* name, bool isAssistant, uint
|
|||
{
|
||||
// insert into group table
|
||||
CharacterDatabase.PExecute("INSERT INTO group_member(groupId,memberGuid,assistant,subgroup) VALUES('%u','%u','%u','%u')",
|
||||
m_Id, member.guid.GetCounter(), ((member.assistant==1)?1:0), member.group);
|
||||
m_Id, member.guid.GetCounter(), ((member.assistant == 1) ? 1 : 0), member.group);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -1373,7 +1373,7 @@ bool Group::_setAssistantFlag(ObjectGuid guid, const bool& state)
|
|||
|
||||
slot->assistant = state;
|
||||
if (!isBGGroup())
|
||||
CharacterDatabase.PExecute("UPDATE group_member SET assistant='%u' WHERE memberGuid='%u'", (state==true)?1:0, guid.GetCounter());
|
||||
CharacterDatabase.PExecute("UPDATE group_member SET assistant='%u' WHERE memberGuid='%u'", (state == true) ? 1 : 0, guid.GetCounter());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1780,7 +1780,7 @@ InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, Player* player)
|
|||
Difficulty difficulty = player->GetDifficulty(mapEntry->IsRaid());
|
||||
|
||||
// some instances only have one difficulty
|
||||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty);
|
||||
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
|
||||
if (!mapDiff)
|
||||
difficulty = DUNGEON_DIFFICULTY_NORMAL;
|
||||
|
||||
|
|
@ -1794,7 +1794,7 @@ InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, Player* player)
|
|||
InstanceGroupBind* Group::GetBoundInstance(Map* aMap, Difficulty difficulty)
|
||||
{
|
||||
// some instances only have one difficulty
|
||||
MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(),difficulty);
|
||||
MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(), difficulty);
|
||||
if (!mapDiff)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -1873,7 +1873,7 @@ static void RewardGroupAtKill_helper(Player* pGroupGuy, Unit* pVictim, uint32 co
|
|||
{
|
||||
// honor can be in PvP and !PvP (racial leader) cases (for alive)
|
||||
if (pGroupGuy->isAlive())
|
||||
pGroupGuy->RewardHonor(pVictim,count);
|
||||
pGroupGuy->RewardHonor(pVictim, count);
|
||||
|
||||
// xp and reputation only in !PvP case
|
||||
if (!PvP)
|
||||
|
|
@ -1882,24 +1882,24 @@ static void RewardGroupAtKill_helper(Player* pGroupGuy, Unit* pVictim, uint32 co
|
|||
|
||||
// if is in dungeon then all receive full reputation at kill
|
||||
// rewarded any alive/dead/near_corpse group member
|
||||
pGroupGuy->RewardReputation(pVictim,is_dungeon ? 1.0f : rate);
|
||||
pGroupGuy->RewardReputation(pVictim, is_dungeon ? 1.0f : rate);
|
||||
|
||||
// XP updated only for alive group member
|
||||
if (pGroupGuy->isAlive() && not_gray_member_with_max_level &&
|
||||
pGroupGuy->getLevel() <= not_gray_member_with_max_level->getLevel())
|
||||
{
|
||||
uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp*rate) : uint32((xp*rate/2)+1);
|
||||
uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp * rate) : uint32((xp * rate / 2) + 1);
|
||||
|
||||
pGroupGuy->GiveXP(itr_xp, pVictim);
|
||||
if (Pet* pet = pGroupGuy->GetPet())
|
||||
pet->GivePetXP(itr_xp/2);
|
||||
pet->GivePetXP(itr_xp / 2);
|
||||
}
|
||||
|
||||
// quest objectives updated only for alive group member or dead but with not released body
|
||||
if (pGroupGuy->isAlive()|| !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (pGroupGuy->isAlive() || !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
{
|
||||
// normal creature (not pet/etc) can be only in !PvP case
|
||||
if (pVictim->GetTypeId()==TYPEID_UNIT)
|
||||
if (pVictim->GetTypeId() == TYPEID_UNIT)
|
||||
if (CreatureInfo const* normalInfo = ObjectMgr::GetCreatureTemplate(pVictim->GetEntry()))
|
||||
pGroupGuy->KilledMonster(normalInfo, pVictim->GetObjectGuid());
|
||||
}
|
||||
|
|
@ -1925,7 +1925,7 @@ void Group::RewardGroupAtKill(Unit* pVictim, Player* player_tap)
|
|||
Player* member_with_max_level = NULL;
|
||||
Player* not_gray_member_with_max_level = NULL;
|
||||
|
||||
GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level,not_gray_member_with_max_level,player_tap);
|
||||
GetDataForXPAtKill(pVictim, count, sum_level, member_with_max_level, not_gray_member_with_max_level, player_tap);
|
||||
|
||||
if (member_with_max_level)
|
||||
{
|
||||
|
|
@ -1935,7 +1935,7 @@ void Group::RewardGroupAtKill(Unit* pVictim, Player* player_tap)
|
|||
/// skip in check PvP case (for speed, not used)
|
||||
bool is_raid = PvP ? false : sMapStore.LookupEntry(pVictim->GetMapId())->IsRaid() && isRaidGroup();
|
||||
bool is_dungeon = PvP ? false : sMapStore.LookupEntry(pVictim->GetMapId())->IsDungeon();
|
||||
float group_rate = MaNGOS::XP::xp_in_group_rate(count,is_raid);
|
||||
float group_rate = MaNGOS::XP::xp_in_group_rate(count, is_raid);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
|
|
@ -1944,7 +1944,7 @@ void Group::RewardGroupAtKill(Unit* pVictim, Player* player_tap)
|
|||
continue;
|
||||
|
||||
// will proccessed later
|
||||
if (pGroupGuy==player_tap)
|
||||
if (pGroupGuy == player_tap)
|
||||
continue;
|
||||
|
||||
if (!pGroupGuy->IsAtGroupRewardDistance(pVictim))
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ class MANGOS_DLL_SPEC Group
|
|||
typedef std::list<MemberSlot> MemberSlotList;
|
||||
typedef MemberSlotList::const_iterator member_citerator;
|
||||
|
||||
typedef UNORDERED_MAP< uint32 /*mapId*/, InstanceGroupBind> BoundInstancesMap;
|
||||
typedef UNORDERED_MAP < uint32 /*mapId*/, InstanceGroupBind > BoundInstancesMap;
|
||||
protected:
|
||||
typedef MemberSlotList::iterator member_witerator;
|
||||
typedef std::set<Player*> InvitesList;
|
||||
|
|
@ -225,7 +225,7 @@ class MANGOS_DLL_SPEC Group
|
|||
void SetLooterGuid(ObjectGuid guid) { m_looterGuid = guid; }
|
||||
void UpdateLooterGuid(WorldObject* pSource, bool ifneed = false);
|
||||
void SetLootThreshold(ItemQualities threshold) { m_lootThreshold = threshold; }
|
||||
void Disband(bool hideDestroy=false);
|
||||
void Disband(bool hideDestroy = false);
|
||||
|
||||
// properties accessories
|
||||
uint32 GetId() const { return m_Id; }
|
||||
|
|
@ -254,7 +254,7 @@ class MANGOS_DLL_SPEC Group
|
|||
bool IsAssistant(ObjectGuid guid) const
|
||||
{
|
||||
member_citerator mslot = _getMemberCSlot(guid);
|
||||
if (mslot==m_memberSlots.end())
|
||||
if (mslot == m_memberSlots.end())
|
||||
return false;
|
||||
|
||||
return mslot->assistant;
|
||||
|
|
@ -272,7 +272,7 @@ class MANGOS_DLL_SPEC Group
|
|||
MemberSlotList const& GetMemberSlots() const { return m_memberSlots; }
|
||||
GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
|
||||
uint32 GetMembersCount() const { return m_memberSlots.size(); }
|
||||
void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player*& member_with_max_level, Player*& not_gray_member_with_max_level, Player* additional = NULL);
|
||||
void GetDataForXPAtKill(Unit const* victim, uint32& count, uint32& sum_level, Player*& member_with_max_level, Player*& not_gray_member_with_max_level, Player* additional = NULL);
|
||||
uint8 GetMemberGroup(ObjectGuid guid) const
|
||||
{
|
||||
member_citerator mslot = _getMemberCSlot(guid);
|
||||
|
|
@ -333,7 +333,7 @@ class MANGOS_DLL_SPEC Group
|
|||
void SendUpdate();
|
||||
void UpdatePlayerOutOfRange(Player* pPlayer);
|
||||
// ignore: GUID of player that will be ignored
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, ObjectGuid ignore = ObjectGuid());
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, ObjectGuid ignore = ObjectGuid());
|
||||
void BroadcastReadyCheck(WorldPacket* packet);
|
||||
void OfflineReadyCheck();
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ class MANGOS_DLL_SPEC Group
|
|||
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }
|
||||
|
||||
protected:
|
||||
bool _addMember(ObjectGuid guid, const char* name, bool isAssistant=false);
|
||||
bool _addMember(ObjectGuid guid, const char* name, bool isAssistant = false);
|
||||
bool _addMember(ObjectGuid guid, const char* name, bool isAssistant, uint8 group);
|
||||
bool _removeMember(ObjectGuid guid); // returns true if leader has changed
|
||||
void _setLeader(ObjectGuid guid);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
void WorldSession::SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res)
|
||||
{
|
||||
WorldPacket data(SMSG_PARTY_COMMAND_RESULT, (4+member.size()+1+4+4));
|
||||
WorldPacket data(SMSG_PARTY_COMMAND_RESULT, (4 + member.size() + 1 + 4 + 4));
|
||||
data << uint32(operation);
|
||||
data << member; // max len 48
|
||||
data << uint32(res);
|
||||
|
|
@ -432,7 +432,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
|
|||
/********************/
|
||||
|
||||
// everything is fine, do it
|
||||
WorldPacket data(MSG_MINIMAP_PING, (8+4+4));
|
||||
WorldPacket data(MSG_MINIMAP_PING, (8 + 4 + 4));
|
||||
data << GetPlayer()->GetObjectGuid();
|
||||
data << float(x);
|
||||
data << float(y);
|
||||
|
|
@ -455,7 +455,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
|
|||
|
||||
//DEBUG_LOG("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
|
||||
|
||||
WorldPacket data(MSG_RANDOM_ROLL, 4+4+4+8);
|
||||
WorldPacket data(MSG_RANDOM_ROLL, 4 + 4 + 4 + 8);
|
||||
data << uint32(minimum);
|
||||
data << uint32(maximum);
|
||||
data << uint32(roll);
|
||||
|
|
@ -567,7 +567,7 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recv_data)
|
|||
/********************/
|
||||
|
||||
// everything is fine, do it
|
||||
group->SetAssistant(guid, (flag==0?false:true));
|
||||
group->SetAssistant(guid, (flag == 0 ? false : true));
|
||||
}
|
||||
|
||||
void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recv_data)
|
||||
|
|
@ -814,7 +814,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)
|
|||
Player* player = ObjectAccessor::FindPlayer(guid, false);
|
||||
if (!player)
|
||||
{
|
||||
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);
|
||||
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3 + 4 + 2);
|
||||
data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related
|
||||
data << guid.WriteAsPacked();
|
||||
data << uint32(GROUP_UPDATE_FLAG_STATUS);
|
||||
|
|
@ -825,7 +825,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)
|
|||
|
||||
Pet* pet = player->GetPet();
|
||||
|
||||
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 4+2+2+2+1+2*6+8+1+8);
|
||||
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 4 + 2 + 2 + 2 + 1 + 2 * 6 + 8 + 1 + 8);
|
||||
data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related
|
||||
data << player->GetPackGUID();
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ void GuardAI::MoveInLineOfSight(Unit* u)
|
|||
u->isInAccessablePlaceFor(m_creature))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(u);
|
||||
if (m_creature->IsWithinDistInMap(u,attackRadius))
|
||||
if (m_creature->IsWithinDistInMap(u, attackRadius))
|
||||
{
|
||||
//Need add code to let guard support player
|
||||
AttackStart(u);
|
||||
|
|
@ -117,8 +117,8 @@ void GuardAI::UpdateAI(const uint32 /*diff*/)
|
|||
|
||||
bool GuardAI::IsVisible(Unit* pl) const
|
||||
{
|
||||
return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_FLOAT_SIGHT_GUARDER))
|
||||
&& pl->isVisibleForOrDetect(m_creature,m_creature,true);
|
||||
return m_creature->IsWithinDist(pl, sWorld.getConfig(CONFIG_FLOAT_SIGHT_GUARDER))
|
||||
&& pl->isVisibleForOrDetect(m_creature, m_creature, true);
|
||||
}
|
||||
|
||||
void GuardAI::AttackStart(Unit* u)
|
||||
|
|
@ -126,7 +126,7 @@ void GuardAI::AttackStart(Unit* u)
|
|||
if (!u)
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(u,true))
|
||||
if (m_creature->Attack(u, true))
|
||||
{
|
||||
i_victimGuid = u->GetObjectGuid();
|
||||
m_creature->AddThreat(u);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ bool Guild::AddMember(ObjectGuid plGuid, uint32 plRank)
|
|||
newmember.accountId = fields[4].GetInt32();
|
||||
delete result;
|
||||
if (newmember.Level < 1 || newmember.Level > STRONG_MAX_LEVEL ||
|
||||
!((1 << (newmember.Class-1)) & CLASSMASK_ALL_PLAYABLE))
|
||||
!((1 << (newmember.Class - 1)) & CLASSMASK_ALL_PLAYABLE))
|
||||
{
|
||||
sLog.outError("%s has a broken data in field `characters` table, cannot add him to guild.", plGuid.GetString().c_str());
|
||||
return false;
|
||||
|
|
@ -319,7 +319,7 @@ bool Guild::LoadRanksFromDB(QueryResult* guildRanksResult)
|
|||
{
|
||||
if (!guildRanksResult)
|
||||
{
|
||||
sLog.outError("Guild %u has broken `guild_rank` data, creating new...",m_Id);
|
||||
sLog.outError("Guild %u has broken `guild_rank` data, creating new...", m_Id);
|
||||
CreateDefaultGuildRanks(0);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -431,8 +431,8 @@ bool Guild::LoadMembersFromDB(QueryResult* guildMembersResult)
|
|||
newmember.BankRemMoney = fields[6].GetUInt32();
|
||||
for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||
{
|
||||
newmember.BankResetTimeTab[i] = fields[7+(2*i)].GetUInt32();
|
||||
newmember.BankRemSlotsTab[i] = fields[8+(2*i)].GetUInt32();
|
||||
newmember.BankResetTimeTab[i] = fields[7 + (2 * i)].GetUInt32();
|
||||
newmember.BankRemSlotsTab[i] = fields[8 + (2 * i)].GetUInt32();
|
||||
}
|
||||
|
||||
newmember.Name = fields[19].GetCppString();
|
||||
|
|
@ -456,7 +456,7 @@ bool Guild::LoadMembersFromDB(QueryResult* guildMembersResult)
|
|||
// the zone through xy coords .. this is a bit redundant, but shouldn't be called often
|
||||
newmember.ZoneId = Player::GetZoneIdFromDB(newmember.guid);
|
||||
}
|
||||
if (!((1 << (newmember.Class-1)) & CLASSMASK_ALL_PLAYABLE)) // can be at broken `class` field
|
||||
if (!((1 << (newmember.Class - 1)) & CLASSMASK_ALL_PLAYABLE)) // can be at broken `class` field
|
||||
{
|
||||
sLog.outError("%s has a broken data in field `characters`.`class`, deleting him from guild!", newmember.guid.GetString().c_str());
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guid = '%u'", lowguid);
|
||||
|
|
@ -559,7 +559,7 @@ bool Guild::DelMember(ObjectGuid guid, bool isDisbanding)
|
|||
|
||||
void Guild::BroadcastToGuild(WorldSession* session, const std::string& msg, uint32 language)
|
||||
{
|
||||
if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(),GR_RIGHT_GCHATSPEAK))
|
||||
if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(), GR_RIGHT_GCHATSPEAK))
|
||||
{
|
||||
WorldPacket data;
|
||||
ChatHandler::FillMessageData(&data, session, CHAT_MSG_GUILD, language, msg.c_str());
|
||||
|
|
@ -568,7 +568,7 @@ void Guild::BroadcastToGuild(WorldSession* session, const std::string& msg, uint
|
|||
{
|
||||
Player* pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first));
|
||||
|
||||
if (pl && pl->GetSession() && HasRankRight(pl->GetRank(),GR_RIGHT_GCHATLISTEN) && !pl->GetSocial()->HasIgnore(session->GetPlayer()->GetObjectGuid()))
|
||||
if (pl && pl->GetSession() && HasRankRight(pl->GetRank(), GR_RIGHT_GCHATLISTEN) && !pl->GetSocial()->HasIgnore(session->GetPlayer()->GetObjectGuid()))
|
||||
pl->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
|
@ -585,7 +585,7 @@ void Guild::BroadcastToOfficers(WorldSession* session, const std::string& msg, u
|
|||
|
||||
Player* pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first));
|
||||
|
||||
if (pl && pl->GetSession() && HasRankRight(pl->GetRank(),GR_RIGHT_OFFCHATLISTEN) && !pl->GetSocial()->HasIgnore(session->GetPlayer()->GetObjectGuid()))
|
||||
if (pl && pl->GetSession() && HasRankRight(pl->GetRank(), GR_RIGHT_OFFCHATLISTEN) && !pl->GetSocial()->HasIgnore(session->GetPlayer()->GetObjectGuid()))
|
||||
pl->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
|
@ -614,7 +614,7 @@ void Guild::BroadcastPacketToRank(WorldPacket* packet, uint32 rankId)
|
|||
}
|
||||
}
|
||||
|
||||
void Guild::CreateRank(std::string name_,uint32 rights)
|
||||
void Guild::CreateRank(std::string name_, uint32 rights)
|
||||
{
|
||||
if (m_Ranks.size() >= GUILD_RANKS_MAX_COUNT)
|
||||
return;
|
||||
|
|
@ -636,9 +636,9 @@ void Guild::CreateRank(std::string name_,uint32 rights)
|
|||
CharacterDatabase.PExecute("INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", m_Id, new_rank_id, name_.c_str(), rights);
|
||||
}
|
||||
|
||||
void Guild::AddRank(const std::string& name_,uint32 rights, uint32 money)
|
||||
void Guild::AddRank(const std::string& name_, uint32 rights, uint32 money)
|
||||
{
|
||||
m_Ranks.push_back(RankInfo(name_,rights,money));
|
||||
m_Ranks.push_back(RankInfo(name_, rights, money));
|
||||
}
|
||||
|
||||
void Guild::DelRank()
|
||||
|
|
@ -727,7 +727,7 @@ void Guild::Disband()
|
|||
void Guild::Roster(WorldSession* session /*= NULL*/)
|
||||
{
|
||||
// we can only guess size
|
||||
WorldPacket data(SMSG_GUILD_ROSTER, (4+MOTD.length()+1+GINFO.length()+1+4+m_Ranks.size()*(4+4+GUILD_BANK_MAX_TABS*(4+4))+members.size()*50));
|
||||
WorldPacket data(SMSG_GUILD_ROSTER, (4 + MOTD.length() + 1 + GINFO.length() + 1 + 4 + m_Ranks.size() * (4 + 4 + GUILD_BANK_MAX_TABS * (4 + 4)) + members.size() * 50));
|
||||
data << uint32(members.size());
|
||||
data << MOTD;
|
||||
data << GINFO;
|
||||
|
|
@ -768,7 +768,7 @@ void Guild::Roster(WorldSession* session /*= NULL*/)
|
|||
data << uint8(itr->second.Class);
|
||||
data << uint8(0); // new 2.4.0
|
||||
data << uint32(itr->second.ZoneId);
|
||||
data << float(float(time(NULL)-itr->second.LogoutTime) / DAY);
|
||||
data << float(float(time(NULL) - itr->second.LogoutTime) / DAY);
|
||||
data << itr->second.Pnote;
|
||||
data << itr->second.OFFnote;
|
||||
}
|
||||
|
|
@ -782,7 +782,7 @@ void Guild::Roster(WorldSession* session /*= NULL*/)
|
|||
|
||||
void Guild::Query(WorldSession* session)
|
||||
{
|
||||
WorldPacket data(SMSG_GUILD_QUERY_RESPONSE, (8*32+200));// we can only guess size
|
||||
WorldPacket data(SMSG_GUILD_QUERY_RESPONSE, (8 * 32 + 200)); // we can only guess size
|
||||
|
||||
data << uint32(m_Id);
|
||||
data << m_Name;
|
||||
|
|
@ -860,7 +860,7 @@ void Guild::DisplayGuildEventLog(WorldSession* session)
|
|||
if (itr->EventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || itr->EventType == GUILD_EVENT_LOG_DEMOTE_PLAYER)
|
||||
data << uint8(itr->NewRank);
|
||||
// Event timestamp
|
||||
data << uint32(time(NULL)-itr->TimeStamp);
|
||||
data << uint32(time(NULL) - itr->TimeStamp);
|
||||
}
|
||||
session->SendPacket(&data);
|
||||
DEBUG_LOG("WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)");
|
||||
|
|
@ -958,7 +958,7 @@ void Guild::DisplayGuildBankContent(WorldSession* session, uint8 TabId)
|
|||
|
||||
void Guild::DisplayGuildBankMoneyUpdate(WorldSession* session)
|
||||
{
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST, 8+1+4+1+1);
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST, 8 + 1 + 4 + 1 + 1);
|
||||
|
||||
data << uint64(GetGuildBankMoney());
|
||||
data << uint8(0); // TabId, default 0
|
||||
|
|
@ -1006,7 +1006,7 @@ void Guild::DisplayGuildBankContentUpdate(uint8 TabId, int32 slot1, int32 slot2)
|
|||
if (!player)
|
||||
continue;
|
||||
|
||||
if (!IsMemberHaveRights(itr->first,TabId,GUILD_BANK_RIGHT_VIEW_TAB))
|
||||
if (!IsMemberHaveRights(itr->first, TabId, GUILD_BANK_RIGHT_VIEW_TAB))
|
||||
continue;
|
||||
|
||||
data.put<uint32>(rempos, uint32(GetMemberSlotWithdrawRem(player->GetGUIDLow(), TabId)));
|
||||
|
|
@ -1041,10 +1041,10 @@ void Guild::DisplayGuildBankContentUpdate(uint8 TabId, GuildItemPosCountVec cons
|
|||
if (!player)
|
||||
continue;
|
||||
|
||||
if (!IsMemberHaveRights(itr->first,TabId,GUILD_BANK_RIGHT_VIEW_TAB))
|
||||
if (!IsMemberHaveRights(itr->first, TabId, GUILD_BANK_RIGHT_VIEW_TAB))
|
||||
continue;
|
||||
|
||||
data.put<uint32>(rempos,uint32(GetMemberSlotWithdrawRem(player->GetGUIDLow(), TabId)));
|
||||
data.put<uint32>(rempos, uint32(GetMemberSlotWithdrawRem(player->GetGUIDLow(), TabId)));
|
||||
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
|
@ -1171,13 +1171,13 @@ void Guild::LoadGuildBankFromDB()
|
|||
|
||||
if (TabId >= GetPurchasedTabs())
|
||||
{
|
||||
sLog.outError("Guild::LoadGuildBankFromDB: Invalid tab for item (GUID: %u id: #%u) in guild bank, skipped.", ItemGuid,ItemEntry);
|
||||
sLog.outError("Guild::LoadGuildBankFromDB: Invalid tab for item (GUID: %u id: #%u) in guild bank, skipped.", ItemGuid, ItemEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (SlotId >= GUILD_BANK_MAX_SLOTS)
|
||||
{
|
||||
sLog.outError("Guild::LoadGuildBankFromDB: Invalid slot for item (GUID: %u id: #%u) in guild bank, skipped.", ItemGuid,ItemEntry);
|
||||
sLog.outError("Guild::LoadGuildBankFromDB: Invalid slot for item (GUID: %u id: #%u) in guild bank, skipped.", ItemGuid, ItemEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1185,7 +1185,7 @@ void Guild::LoadGuildBankFromDB()
|
|||
|
||||
if (!proto)
|
||||
{
|
||||
sLog.outError("Guild::LoadGuildBankFromDB: Unknown item (GUID: %u id: #%u) in guild bank, skipped.", ItemGuid,ItemEntry);
|
||||
sLog.outError("Guild::LoadGuildBankFromDB: Unknown item (GUID: %u id: #%u) in guild bank, skipped.", ItemGuid, ItemEntry);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1224,7 +1224,7 @@ bool Guild::MemberMoneyWithdraw(uint32 amount, uint32 LowGuid)
|
|||
if (MoneyWithDrawRight < amount || GetGuildBankMoney() < amount)
|
||||
return false;
|
||||
|
||||
SetBankMoney(GetGuildBankMoney()-amount);
|
||||
SetBankMoney(GetGuildBankMoney() - amount);
|
||||
|
||||
if (MoneyWithDrawRight < WITHDRAW_MONEY_UNLIMITED)
|
||||
{
|
||||
|
|
@ -1290,11 +1290,11 @@ uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId)
|
|||
if (itr->second.RankId == GR_GUILDMASTER)
|
||||
return WITHDRAW_SLOT_UNLIMITED;
|
||||
|
||||
if ((GetBankRights(itr->second.RankId,TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||
if ((GetBankRights(itr->second.RankId, TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||
return 0;
|
||||
|
||||
uint32 curTime = uint32(time(NULL)/MINUTE);
|
||||
if (curTime - itr->second.BankResetTimeTab[TabId] >= 24*HOUR/MINUTE)
|
||||
uint32 curTime = uint32(time(NULL) / MINUTE);
|
||||
if (curTime - itr->second.BankResetTimeTab[TabId] >= 24 * HOUR / MINUTE)
|
||||
{
|
||||
itr->second.BankResetTimeTab[TabId] = curTime;
|
||||
itr->second.BankRemSlotsTab[TabId] = GetBankSlotPerDay(itr->second.RankId, TabId);
|
||||
|
|
@ -1313,9 +1313,9 @@ uint32 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid)
|
|||
if (itr->second.RankId == GR_GUILDMASTER)
|
||||
return WITHDRAW_MONEY_UNLIMITED;
|
||||
|
||||
uint32 curTime = uint32(time(NULL)/MINUTE); // minutes
|
||||
uint32 curTime = uint32(time(NULL) / MINUTE); // minutes
|
||||
// 24 hours
|
||||
if (curTime > itr->second.BankResetTimeMoney + 24*HOUR/MINUTE)
|
||||
if (curTime > itr->second.BankResetTimeMoney + 24 * HOUR / MINUTE)
|
||||
{
|
||||
itr->second.BankResetTimeMoney = curTime;
|
||||
itr->second.BankRemMoney = GetBankMoneyPerDay(itr->second.RankId);
|
||||
|
|
@ -1533,7 +1533,7 @@ void Guild::DisplayGuildBankLogs(WorldSession* session, uint8 TabId)
|
|||
if (TabId == GUILD_BANK_MAX_TABS)
|
||||
{
|
||||
// Here we display money logs
|
||||
WorldPacket data(MSG_GUILD_BANK_LOG_QUERY, m_GuildBankEventLog_Money.size()*(4*4+1)+1+1);
|
||||
WorldPacket data(MSG_GUILD_BANK_LOG_QUERY, m_GuildBankEventLog_Money.size() * (4 * 4 + 1) + 1 + 1);
|
||||
data << uint8(TabId); // Here GUILD_BANK_MAX_TABS
|
||||
data << uint8(m_GuildBankEventLog_Money.size()); // number of log entries
|
||||
for (GuildBankEventLog::const_iterator itr = m_GuildBankEventLog_Money.begin(); itr != m_GuildBankEventLog_Money.end(); ++itr)
|
||||
|
|
@ -1562,7 +1562,7 @@ void Guild::DisplayGuildBankLogs(WorldSession* session, uint8 TabId)
|
|||
else
|
||||
{
|
||||
// here we display current tab logs
|
||||
WorldPacket data(MSG_GUILD_BANK_LOG_QUERY, m_GuildBankEventLog_Item[TabId].size()*(4*4+1+1)+1+1);
|
||||
WorldPacket data(MSG_GUILD_BANK_LOG_QUERY, m_GuildBankEventLog_Item[TabId].size() * (4 * 4 + 1 + 1) + 1 + 1);
|
||||
data << uint8(TabId); // Here a real Tab Id
|
||||
// number of log entries
|
||||
data << uint8(m_GuildBankEventLog_Item[TabId].size());
|
||||
|
|
@ -1870,7 +1870,7 @@ InventoryResult Guild::CanStoreItem(uint8 tab, uint8 slot, GuildItemPosCountVec&
|
|||
// in specific slot
|
||||
if (slot != NULL_SLOT)
|
||||
{
|
||||
InventoryResult res = _CanStoreItem_InSpecificSlot(tab,slot,dest,count,swap,pItem);
|
||||
InventoryResult res = _CanStoreItem_InSpecificSlot(tab, slot, dest, count, swap, pItem);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
|
|
@ -1921,14 +1921,14 @@ void Guild::SetGuildBankTabText(uint8 TabId, std::string text)
|
|||
CharacterDatabase.PExecute("UPDATE guild_bank_tab SET TabText='%s' WHERE guildid='%u' AND TabId='%u'", text.c_str(), m_Id, uint32(TabId));
|
||||
|
||||
// announce
|
||||
SendGuildBankTabText(NULL,TabId);
|
||||
SendGuildBankTabText(NULL, TabId);
|
||||
}
|
||||
|
||||
void Guild::SendGuildBankTabText(WorldSession* session, uint8 TabId)
|
||||
{
|
||||
GuildBankTab const* tab = m_TabListMap[TabId];
|
||||
|
||||
WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1+tab->Text.size()+1);
|
||||
WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1 + tab->Text.size() + 1);
|
||||
data << uint8(TabId);
|
||||
data << tab->Text;
|
||||
|
||||
|
|
@ -2000,7 +2000,7 @@ void Guild::SwapItems(Player* pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankTa
|
|||
else // non split
|
||||
{
|
||||
GuildItemPosCountVec gDest;
|
||||
InventoryResult msg = CanStoreItem(BankTabDst,BankTabSlotDst,gDest,pItemSrc->GetCount(), pItemSrc, false);
|
||||
InventoryResult msg = CanStoreItem(BankTabDst, BankTabSlotDst, gDest, pItemSrc->GetCount(), pItemSrc, false);
|
||||
if (msg == EQUIP_ERR_OK) // merge to
|
||||
{
|
||||
CharacterDatabase.BeginTransaction();
|
||||
|
|
@ -2106,7 +2106,7 @@ void Guild::MoveFromBankToChar(Player* pl, uint8 BankTab, uint8 BankTabSlot, uin
|
|||
CharacterDatabase.BeginTransaction();
|
||||
LogBankEvent(GUILD_BANK_LOG_WITHDRAW_ITEM, BankTab, pl->GetGUIDLow(), pItemBank->GetEntry(), SplitedAmount);
|
||||
|
||||
pItemBank->SetCount(pItemBank->GetCount()-SplitedAmount);
|
||||
pItemBank->SetCount(pItemBank->GetCount() - SplitedAmount);
|
||||
pItemBank->FSetState(ITEM_CHANGED);
|
||||
pItemBank->SaveToDB(); // not in inventory and can be save standalone
|
||||
pl->MoveItemToInventory(dest, pNewItem, true);
|
||||
|
|
@ -2162,7 +2162,7 @@ void Guild::MoveFromBankToChar(Player* pl, uint8 BankTab, uint8 BankTabSlot, uin
|
|||
GuildItemPosCountVec gDest;
|
||||
if (pItemChar)
|
||||
{
|
||||
msg = CanStoreItem(BankTab,BankTabSlot,gDest,pItemChar->GetCount(),pItemChar,true);
|
||||
msg = CanStoreItem(BankTab, BankTabSlot, gDest, pItemChar->GetCount(), pItemChar, true);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
pl->SendEquipError(msg, pItemChar, NULL);
|
||||
|
|
@ -2180,8 +2180,8 @@ void Guild::MoveFromBankToChar(Player* pl, uint8 BankTab, uint8 BankTabSlot, uin
|
|||
// logging item move to bank
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )",
|
||||
pl->GetName(),pl->GetSession()->GetAccountId(),
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
pItemChar->GetProto()->Name1, pItemChar->GetEntry(), pItemChar->GetCount(),
|
||||
m_Id);
|
||||
}
|
||||
|
|
@ -2256,8 +2256,8 @@ void Guild::MoveFromCharToBank(Player* pl, uint8 PlayerBag, uint8 PlayerSlot, ui
|
|||
// logging item move to bank (before items merge
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )",
|
||||
pl->GetName(),pl->GetSession()->GetAccountId(),
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
pItemChar->GetProto()->Name1, pItemChar->GetEntry(), SplitedAmount, m_Id);
|
||||
}
|
||||
|
||||
|
|
@ -2265,7 +2265,7 @@ void Guild::MoveFromCharToBank(Player* pl, uint8 PlayerBag, uint8 PlayerSlot, ui
|
|||
LogBankEvent(GUILD_BANK_LOG_DEPOSIT_ITEM, BankTab, pl->GetGUIDLow(), pItemChar->GetEntry(), SplitedAmount);
|
||||
|
||||
pl->ItemRemovedQuestCheck(pItemChar->GetEntry(), SplitedAmount);
|
||||
pItemChar->SetCount(pItemChar->GetCount()-SplitedAmount);
|
||||
pItemChar->SetCount(pItemChar->GetCount() - SplitedAmount);
|
||||
pItemChar->SetState(ITEM_CHANGED);
|
||||
pl->SaveInventoryAndGoldToDB();
|
||||
StoreItem(BankTab, dest, pNewItem);
|
||||
|
|
@ -2282,8 +2282,8 @@ void Guild::MoveFromCharToBank(Player* pl, uint8 PlayerBag, uint8 PlayerSlot, ui
|
|||
// logging item move to bank
|
||||
if (pl->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )",
|
||||
pl->GetName(),pl->GetSession()->GetAccountId(),
|
||||
sLog.outCommand(pl->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u )",
|
||||
pl->GetName(), pl->GetSession()->GetAccountId(),
|
||||
pItemChar->GetProto()->Name1, pItemChar->GetEntry(), pItemChar->GetCount(),
|
||||
m_Id);
|
||||
}
|
||||
|
|
@ -2365,7 +2365,7 @@ void Guild::BroadcastEvent(GuildEvents event, ObjectGuid guid, char const* str1
|
|||
{
|
||||
uint8 strCount = !str1 ? 0 : (!str2 ? 1 : (!str3 ? 2 : 3));
|
||||
|
||||
WorldPacket data(SMSG_GUILD_EVENT, 1 + 1 + 1*strCount + (!guid ? 0 : 8));
|
||||
WorldPacket data(SMSG_GUILD_EVENT, 1 + 1 + 1 * strCount + (!guid ? 0 : 8));
|
||||
data << uint8(event);
|
||||
data << uint8(strCount);
|
||||
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ class Guild
|
|||
_do(player);
|
||||
}
|
||||
|
||||
void CreateRank(std::string name,uint32 rights);
|
||||
void CreateRank(std::string name, uint32 rights);
|
||||
void DelRank();
|
||||
std::string GetRankName(uint32 rankId);
|
||||
uint32 GetRankRights(uint32 rankId);
|
||||
|
|
@ -418,7 +418,7 @@ class Guild
|
|||
void SetGuildBankTabInfo(uint8 TabId, std::string name, std::string icon);
|
||||
uint8 GetPurchasedTabs() const { return m_TabListMap.size(); }
|
||||
uint32 GetBankRights(uint32 rankId, uint8 TabId) const;
|
||||
bool IsMemberHaveRights(uint32 LowGuid, uint8 TabId,uint32 rights) const;
|
||||
bool IsMemberHaveRights(uint32 LowGuid, uint8 TabId, uint32 rights) const;
|
||||
bool CanMemberViewTab(uint32 LowGuid, uint8 TabId) const;
|
||||
// Load
|
||||
void LoadGuildBankFromDB();
|
||||
|
|
@ -440,11 +440,11 @@ class Guild
|
|||
// Guild Bank Event Logs
|
||||
void LoadGuildBankEventLogFromDB();
|
||||
void DisplayGuildBankLogs(WorldSession* session, uint8 TabId);
|
||||
void LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uint32 ItemOrMoney, uint8 ItemStackCount=0, uint8 DestTabId=0);
|
||||
void LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uint32 ItemOrMoney, uint8 ItemStackCount = 0, uint8 DestTabId = 0);
|
||||
bool AddGBankItemToDB(uint32 GuildId, uint32 BankTab , uint32 BankTabSlot , uint32 GUIDLow, uint32 Entry);
|
||||
|
||||
protected:
|
||||
void AddRank(const std::string& name,uint32 rights,uint32 money);
|
||||
void AddRank(const std::string& name, uint32 rights, uint32 money);
|
||||
|
||||
uint32 m_Id;
|
||||
std::string m_Name;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
|||
// Put record into guildlog
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_INVITE_PLAYER, GetPlayer()->GetObjectGuid(), player->GetObjectGuid());
|
||||
|
||||
WorldPacket data(SMSG_GUILD_INVITE, (8+10)); // guess size
|
||||
WorldPacket data(SMSG_GUILD_INVITE, (8 + 10)); // guess size
|
||||
data << GetPlayer()->GetName();
|
||||
data << guild->GetName();
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
|
@ -206,7 +206,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
|
|||
if (!sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr.GetPlayerTeamByGUID(guild->GetLeaderGuid()))
|
||||
return;
|
||||
|
||||
if (!guild->AddMember(GetPlayer()->GetObjectGuid(),guild->GetLowestRank()))
|
||||
if (!guild->AddMember(GetPlayer()->GetObjectGuid(), guild->GetLowestRank()))
|
||||
return;
|
||||
// Put record into guild log
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_JOIN_GUILD, GetPlayer()->GetObjectGuid());
|
||||
|
|
@ -503,7 +503,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
|||
{
|
||||
DEBUG_LOG("WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE");
|
||||
|
||||
std::string name,PNOTE;
|
||||
std::string name, PNOTE;
|
||||
recvPacket >> name;
|
||||
|
||||
if (!normalizePlayerName(name))
|
||||
|
|
@ -678,9 +678,9 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
|
|||
guild->Roster(); // broadcast for tab rights update
|
||||
}
|
||||
|
||||
void WorldSession::SendGuildCommandResult(uint32 typecmd, const std::string& str,uint32 cmdresult)
|
||||
void WorldSession::SendGuildCommandResult(uint32 typecmd, const std::string& str, uint32 cmdresult)
|
||||
{
|
||||
WorldPacket data(SMSG_GUILD_COMMAND_RESULT, (8+str.size()+1));
|
||||
WorldPacket data(SMSG_GUILD_COMMAND_RESULT, (8 + str.size() + 1));
|
||||
data << typecmd;
|
||||
data << str;
|
||||
data << cmdresult;
|
||||
|
|
@ -750,14 +750,14 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
|||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->GetMoney() < 10*GOLD)
|
||||
if (GetPlayer()->GetMoney() < 10 * GOLD)
|
||||
{
|
||||
//"You can't afford to do that."
|
||||
SendSaveGuildEmblem(ERR_GUILDEMBLEM_NOTENOUGHMONEY);
|
||||
return;
|
||||
}
|
||||
|
||||
GetPlayer()->ModifyMoney(-10*GOLD);
|
||||
GetPlayer()->ModifyMoney(-10 * GOLD);
|
||||
guild->SetEmblem(EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor);
|
||||
|
||||
//"Guild Emblem saved."
|
||||
|
|
@ -797,7 +797,7 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */)
|
|||
{
|
||||
uint32 rankId = GetPlayer()->GetRank();
|
||||
|
||||
WorldPacket data(MSG_GUILD_PERMISSIONS, 4*15+1);
|
||||
WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1);
|
||||
data << uint32(rankId); // guild rank id
|
||||
data << uint32(pGuild->GetRankRights(rankId)); // rank rights
|
||||
// money per day left
|
||||
|
|
@ -898,7 +898,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recv_data)
|
|||
|
||||
CharacterDatabase.BeginTransaction();
|
||||
|
||||
pGuild->SetBankMoney(pGuild->GetGuildBankMoney()+money);
|
||||
pGuild->SetBankMoney(pGuild->GetGuildBankMoney() + money);
|
||||
GetPlayer()->ModifyMoney(-int(money));
|
||||
GetPlayer()->SaveGoldToDB();
|
||||
|
||||
|
|
@ -907,8 +907,8 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recv_data)
|
|||
// logging money
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
|
||||
_player->GetName(),_player->GetSession()->GetAccountId(),money,GuildId);
|
||||
sLog.outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
|
||||
_player->GetName(), _player->GetSession()->GetAccountId(), money, GuildId);
|
||||
}
|
||||
|
||||
// log
|
||||
|
|
@ -944,7 +944,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recv_data)
|
|||
if (!pGuild->GetPurchasedTabs())
|
||||
return;
|
||||
|
||||
if (pGuild->GetGuildBankMoney()<money) // not enough money in bank
|
||||
if (pGuild->GetGuildBankMoney() < money) // not enough money in bank
|
||||
return;
|
||||
|
||||
if (!pGuild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_WITHDRAW_GOLD))
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature& owner)
|
|||
Movement::MoveSplineInit init(owner);
|
||||
float x, y, z, o;
|
||||
// at apply we can select more nice return points base at current movegen
|
||||
if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner,x,y,z))
|
||||
if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner, x, y, z))
|
||||
{
|
||||
owner.GetRespawnCoord(x, y, z, &o);
|
||||
init.SetFacing(o);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ HostileRefManager::~HostileRefManager()
|
|||
void HostileRefManager::threatAssist(Unit* pVictim, float pThreat, SpellEntry const* pThreatSpell, bool pSingleTarget)
|
||||
{
|
||||
uint32 size = pSingleTarget ? 1 : getSize(); // if pSingleTarget do not devide threat
|
||||
float threat = pThreat/size;
|
||||
float threat = pThreat / size;
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
{
|
||||
|
|
@ -149,7 +149,7 @@ void HostileRefManager::deleteReference(Unit* pCreature)
|
|||
//=================================================
|
||||
// set state for one reference, defined by Unit
|
||||
|
||||
void HostileRefManager::setOnlineOfflineState(Unit* pCreature,bool pIsOnline)
|
||||
void HostileRefManager::setOnlineOfflineState(Unit* pCreature, bool pIsOnline)
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
|
|||
// send threat to all my hateres for the pVictim
|
||||
// The pVictim is hated than by them as well
|
||||
// use for buffs and healing threat functionality
|
||||
void threatAssist(Unit* pVictim, float threat, SpellEntry const* threatSpell = 0, bool pSingleTarget=false);
|
||||
void threatAssist(Unit* pVictim, float threat, SpellEntry const* threatSpell = 0, bool pSingleTarget = false);
|
||||
|
||||
void addThreatPercent(int32 pValue);
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
|
|||
void setOnlineOfflineState(bool pIsOnline);
|
||||
|
||||
// set state for one reference, defined by Unit
|
||||
void setOnlineOfflineState(Unit* pCreature,bool pIsOnline);
|
||||
void setOnlineOfflineState(Unit* pCreature, bool pIsOnline);
|
||||
|
||||
// delete one reference, defined by Unit
|
||||
void deleteReference(Unit* pCreature);
|
||||
|
|
@ -68,7 +68,7 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
|
|||
void SetThreatRedirection(ObjectGuid guid, uint32 pct)
|
||||
{
|
||||
m_redirectionTargetGuid = guid;
|
||||
m_redirectionMod = pct/100.0f;
|
||||
m_redirectionMod = pct / 100.0f;
|
||||
}
|
||||
|
||||
void ResetThreatRedirection()
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void InstanceData::SaveToDB()
|
|||
bool InstanceData::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
{
|
||||
sLog.outError("Achievement system call InstanceData::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
instance->GetId(),criteria_id);
|
||||
instance->GetId(), criteria_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
|||
|
||||
if (!set)
|
||||
{
|
||||
sLog.outErrorDb("Item set %u for item (id %u) not found, mods not applied.", setid,proto->ItemId);
|
||||
sLog.outErrorDb("Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
|||
break;
|
||||
|
||||
if (x < player->ItemSetEff.size())
|
||||
player->ItemSetEff[x]=eff;
|
||||
player->ItemSetEff[x] = eff;
|
||||
else
|
||||
player->ItemSetEff.push_back(eff);
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
|||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(set->spells[x]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog.outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x],setid);
|
||||
sLog.outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ void RemoveItemsSetItem(Player* player, ItemPrototype const* proto)
|
|||
|
||||
if (!set)
|
||||
{
|
||||
sLog.outErrorDb("Item set #%u for item #%u not found, mods not removed.", setid,proto->ItemId);
|
||||
sLog.outErrorDb("Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
|||
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
|
||||
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
SetSpellCharges(i,itemProto->Spells[i].SpellCharges);
|
||||
SetSpellCharges(i, itemProto->Spells[i].SpellCharges);
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_DURATION, itemProto->Duration);
|
||||
|
||||
|
|
@ -444,7 +444,7 @@ bool Item::LoadFromDB(uint32 guidLow, Field* fields, ObjectGuid ownerGuid)
|
|||
return false;
|
||||
|
||||
// update max durability (and durability) if need
|
||||
if (proto->MaxDurability!= GetUInt32Value(ITEM_FIELD_MAXDURABILITY))
|
||||
if (proto->MaxDurability != GetUInt32Value(ITEM_FIELD_MAXDURABILITY))
|
||||
{
|
||||
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, proto->MaxDurability);
|
||||
if (GetUInt32Value(ITEM_FIELD_DURABILITY) > proto->MaxDurability)
|
||||
|
|
@ -633,7 +633,7 @@ uint32 Item::GetSpell()
|
|||
case ITEM_SUBCLASS_WEAPON_DAGGER: return 1180;
|
||||
case ITEM_SUBCLASS_WEAPON_THROWN: return 2567;
|
||||
case ITEM_SUBCLASS_WEAPON_SPEAR: return 3386;
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW:return 5011;
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW: return 5011;
|
||||
case ITEM_SUBCLASS_WEAPON_WAND: return 5009;
|
||||
default: return 0;
|
||||
}
|
||||
|
|
@ -702,7 +702,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
|
|||
{
|
||||
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != int32(item_rand->ID))
|
||||
{
|
||||
SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID,item_rand->ID);
|
||||
SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, item_rand->ID);
|
||||
SetState(ITEM_CHANGED);
|
||||
}
|
||||
for (uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i)
|
||||
|
|
@ -733,7 +733,7 @@ bool Item::UpdateItemSuffixFactor()
|
|||
uint32 suffixFactor = GenerateEnchSuffixFactor(GetEntry());
|
||||
if (GetItemSuffixFactor() == suffixFactor)
|
||||
return false;
|
||||
SetUInt32Value(ITEM_FIELD_PROPERTY_SEED,suffixFactor);
|
||||
SetUInt32Value(ITEM_FIELD_PROPERTY_SEED, suffixFactor);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -792,7 +792,7 @@ void Item::AddToUpdateQueueOf(Player* player)
|
|||
return;
|
||||
|
||||
player->m_itemUpdateQueue.push_back(this);
|
||||
uQueuePos = player->m_itemUpdateQueue.size() -1;
|
||||
uQueuePos = player->m_itemUpdateQueue.size() - 1;
|
||||
}
|
||||
|
||||
void Item::RemoveFromUpdateQueueOf(Player* player)
|
||||
|
|
@ -980,7 +980,7 @@ bool Item::GemsFitSockets() const
|
|||
bool fits = true;
|
||||
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
{
|
||||
uint8 SocketColor = GetProto()->Socket[enchant_slot-SOCK_ENCHANTMENT_SLOT].Color;
|
||||
uint8 SocketColor = GetProto()->Socket[enchant_slot - SOCK_ENCHANTMENT_SLOT].Color;
|
||||
|
||||
uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
|
||||
if (!enchant_id)
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ class MANGOS_DLL_SPEC Item : public Object
|
|||
void SetOwnerGuid(ObjectGuid guid) { SetGuidValue(ITEM_FIELD_OWNER, guid); }
|
||||
Player* GetOwner()const;
|
||||
|
||||
void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_BINDED,val); }
|
||||
void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_BINDED, val); }
|
||||
bool IsSoulBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_BINDED); }
|
||||
bool IsBoundAccountWide() const { return GetProto()->Flags & ITEM_FLAG_BOA; }
|
||||
bool IsBindedNotWith(Player const* player) const;
|
||||
|
|
@ -350,7 +350,7 @@ class MANGOS_DLL_SPEC Item : public Object
|
|||
|
||||
// spell charges (signed but stored as unsigned)
|
||||
int32 GetSpellCharges(uint8 index/*0..5*/ = 0) const { return GetInt32Value(ITEM_FIELD_SPELL_CHARGES + index); }
|
||||
void SetSpellCharges(uint8 index/*0..5*/, int32 value) { SetInt32Value(ITEM_FIELD_SPELL_CHARGES + index,value); }
|
||||
void SetSpellCharges(uint8 index/*0..5*/, int32 value) { SetInt32Value(ITEM_FIELD_SPELL_CHARGES + index, value); }
|
||||
bool HasMaxCharges() const;
|
||||
void RestoreCharges();
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ uint32 GetItemEnchantMod(uint32 entry)
|
|||
|
||||
if (tab == RandomItemEnch.end())
|
||||
{
|
||||
sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it doesn't have records in `item_enchantment_template` table.",entry);
|
||||
sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it doesn't have records in `item_enchantment_template` table.", entry);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket& recv_data)
|
|||
{
|
||||
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
if (Bag* pBag = (Bag*)_player->GetItemByPos(INVENTORY_SLOT_BAG_0,i))
|
||||
if (Bag* pBag = (Bag*)_player->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
{
|
||||
if (bagGuid == pBag->GetObjectGuid())
|
||||
{
|
||||
|
|
@ -738,7 +738,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
|
|||
|
||||
if (!vItems && !tItems)
|
||||
{
|
||||
WorldPacket data(SMSG_LIST_INVENTORY, (8+1+1));
|
||||
WorldPacket data(SMSG_LIST_INVENTORY, (8 + 1 + 1));
|
||||
data << ObjectGuid(vendorguid);
|
||||
data << uint8(0); // count==0, next will be error code
|
||||
data << uint8(0); // "Vendor has no inventory"
|
||||
|
|
@ -751,7 +751,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
|
|||
|
||||
uint8 count = 0;
|
||||
|
||||
WorldPacket data(SMSG_LIST_INVENTORY, (8+1+numitems*8*4));
|
||||
WorldPacket data(SMSG_LIST_INVENTORY, (8 + 1 + numitems * 8 * 4));
|
||||
data << ObjectGuid(vendorguid);
|
||||
|
||||
size_t count_pos = data.wpos();
|
||||
|
|
@ -803,7 +803,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
|
|||
// reputation discount
|
||||
uint32 price = (crItem->ExtendedCost == 0 || pProto->Flags2 & ITEM_FLAG2_EXT_COST_REQUIRES_GOLD) ? uint32(floor(pProto->BuyPrice * discountMod)) : 0;
|
||||
|
||||
data << uint32(vendorslot +1); // client size expected counting from 1
|
||||
data << uint32(vendorslot + 1); // client size expected counting from 1
|
||||
data << uint32(pProto->ItemId);
|
||||
data << uint32(pProto->DisplayInfoID);
|
||||
data << uint32(crItem->maxcount <= 0 ? 0xFFFFFFFF : pCreature->GetVendorItemCurrentCount(crItem));
|
||||
|
|
@ -1042,7 +1042,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recv_data)
|
|||
|
||||
void WorldSession::SendEnchantmentLog(ObjectGuid targetGuid, ObjectGuid casterGuid, uint32 itemId, uint32 spellId)
|
||||
{
|
||||
WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 2.0.10
|
||||
WorldPacket data(SMSG_ENCHANTMENTLOG, (8 + 8 + 4 + 4 + 1)); // last check 2.0.10
|
||||
data << ObjectGuid(targetGuid);
|
||||
data << ObjectGuid(casterGuid);
|
||||
data << uint32(itemId);
|
||||
|
|
@ -1054,7 +1054,7 @@ void WorldSession::SendEnchantmentLog(ObjectGuid targetGuid, ObjectGuid casterGu
|
|||
void WorldSession::SendItemEnchantTimeUpdate(ObjectGuid playerGuid, ObjectGuid itemGuid, uint32 slot, uint32 duration)
|
||||
{
|
||||
// last check 2.0.10
|
||||
WorldPacket data(SMSG_ITEM_ENCHANT_TIME_UPDATE, (8+4+4+8));
|
||||
WorldPacket data(SMSG_ITEM_ENCHANT_TIME_UPDATE, (8 + 4 + 4 + 8));
|
||||
data << ObjectGuid(itemGuid);
|
||||
data << uint32(slot);
|
||||
data << uint32(duration);
|
||||
|
|
@ -1076,7 +1076,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket& recv_data)
|
|||
std::string name = pProto->Name1;
|
||||
sObjectMgr.GetItemLocaleStrings(pProto->ItemId, loc_idx, &name);
|
||||
// guess size
|
||||
WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+10));
|
||||
WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4 + 10));
|
||||
data << uint32(pProto->ItemId);
|
||||
data << name;
|
||||
data << uint32(pProto->InventoryType);
|
||||
|
|
@ -1223,7 +1223,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
|||
if (!gemGuid.IsItem())
|
||||
return;
|
||||
|
||||
for (int j = i+1; j < MAX_GEM_SOCKETS; ++j)
|
||||
for (int j = i + 1; j < MAX_GEM_SOCKETS; ++j)
|
||||
if (gemGuids[j] == gemGuid)
|
||||
return;
|
||||
}
|
||||
|
|
@ -1402,7 +1402,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
|||
bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();// current socketbonus state
|
||||
if (SocketBonusActivated != SocketBonusToBeActivated) // if there was a change...
|
||||
{
|
||||
_player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT, false);
|
||||
_player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false);
|
||||
itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetProto()->socketBonus : 0), 0, 0);
|
||||
_player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true);
|
||||
//it is not displayed, client has an inbuilt system to determine if the bonus is activated
|
||||
|
|
@ -1471,7 +1471,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket& recv_data)
|
|||
|
||||
DEBUG_LOG("CMSG_ITEM_TEXT_QUERY item guid: %u", itemGuid.GetCounter());
|
||||
|
||||
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10));// guess size
|
||||
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4 + 10)); // guess size
|
||||
|
||||
if (Item* item = _player->GetItemByGuid(itemGuid))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ struct ItemPrototype
|
|||
return false;
|
||||
}
|
||||
|
||||
uint32 GetMaxStackSize() const { return Stackable > 0 ? uint32(Stackable) : uint32(0x7FFFFFFF-1); }
|
||||
uint32 GetMaxStackSize() const { return Stackable > 0 ? uint32(Stackable) : uint32(0x7FFFFFFF - 1); }
|
||||
|
||||
float getDPS() const
|
||||
{
|
||||
|
|
@ -641,16 +641,16 @@ struct ItemPrototype
|
|||
return 0;
|
||||
float temp = 0;
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
||||
temp+=Damage[i].DamageMin + Damage[i].DamageMax;
|
||||
return temp*500/Delay;
|
||||
temp += Damage[i].DamageMin + Damage[i].DamageMax;
|
||||
return temp * 500 / Delay;
|
||||
}
|
||||
|
||||
int32 getFeralBonus(int32 extraDPS = 0) const
|
||||
{
|
||||
// 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc
|
||||
if (Class == ITEM_CLASS_WEAPON && (1<<SubClass)&0x02A5F3)
|
||||
if (Class == ITEM_CLASS_WEAPON && (1 << SubClass) & 0x02A5F3)
|
||||
{
|
||||
int32 bonus = int32((extraDPS + getDPS())*14.0f) - 767;
|
||||
int32 bonus = int32((extraDPS + getDPS()) * 14.0f) - 767;
|
||||
if (bonus < 0)
|
||||
return 0;
|
||||
return bonus;
|
||||
|
|
@ -658,7 +658,7 @@ struct ItemPrototype
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool IsPotion() const { return Class==ITEM_CLASS_CONSUMABLE && SubClass==ITEM_SUBCLASS_POTION; }
|
||||
bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; }
|
||||
bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAG_CONJURED); }
|
||||
bool IsVellum() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -711,8 +711,8 @@ enum MangosStrings
|
|||
LANG_YOUR_BG_LEVEL_REQ_ERROR = 715,
|
||||
// = 716, not used
|
||||
LANG_BG_STARTED_ANNOUNCE_WORLD = 717,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN= 718,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT= 719,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN = 718,
|
||||
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT = 719,
|
||||
|
||||
LANG_BG_GROUP_TOO_LARGE = 720, // "Your group is too large for this battleground. Please regroup to join."
|
||||
LANG_ARENA_GROUP_TOO_LARGE = 721, // "Your group is too large for this arena. Please regroup to join."
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue