Add spaces after commas

This commit is contained in:
leak
2011-04-29 20:47:02 +02:00
parent 01a79947d5
commit 1003f30448
645 changed files with 9439 additions and 9439 deletions
+2 -2
View File
@@ -177,13 +177,13 @@ extern int main(int argc, char **argv)
ULONG_PTR appAff;
ULONG_PTR sysAff;
if (GetProcessAffinityMask(hProcess,&appAff,&sysAff))
if (GetProcessAffinityMask(hProcess, &appAff, &sysAff))
{
ULONG_PTR curAff = Aff & appAff; // remove non accessible processors
if (!curAff)
sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for authserver. Accessible processors bitmask (hex): %x", Aff, appAff);
else if (SetProcessAffinityMask(hProcess,curAff))
else if (SetProcessAffinityMask(hProcess, curAff))
sLog->outString("Using processors (bitmask, hex): %x", curAff);
else
sLog->outError("Can't set used processors (hex): %x", curAff);
+4 -4
View File
@@ -50,11 +50,11 @@ enum eStatus
STATUS_AUTHED
};
// 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 paltform
// 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 paltform
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#pragma pack(push, 1)
#endif
typedef struct AUTH_LOGON_CHALLENGE_C
@@ -169,7 +169,7 @@ public:
Patches::const_iterator begin() const { return _patches.begin(); }
Patches::const_iterator end() const { return _patches.end(); }
void LoadPatchMD5(char*);
bool GetHash(char * pat,uint8 mymd5[16]);
bool GetHash(char * pat, uint8 mymd5[16]);
private:
void LoadPatchesInfo();
@@ -909,7 +909,7 @@ bool AuthSocket::_HandleXferResume()
// Launch a PatcherRunnable thread starting at given patch file offset
uint64 start;
socket().recv_skip(1);
socket().recv((char*)&start,sizeof(start));
socket().recv((char*)&start, sizeof(start));
fseek(pPatch, long(start), 0);
ACE_Based::Thread u(new PatcherRunnable(this));
@@ -63,7 +63,7 @@ namespace VMAP
virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) = 0;
virtual float getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist) = 0;
/**
test if we hit an object. return true if we hit one. rx,ry,rz will hold the hit position or the dest position, if no intersection was found
test if we hit an object. return true if we hit one. rx, ry, rz will hold the hit position or the dest position, if no intersection was found
return a position, that is pReduceDist closer to the origin
*/
virtual bool getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float pModifyDist) = 0;
@@ -31,7 +31,7 @@ namespace VMAP
char lc = str[str.length()-1];
if(lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(0,str.length()-1);
str = str.substr(0, str.length()-1);
}
else
{
@@ -43,7 +43,7 @@ namespace VMAP
char lc = str[0];
if(lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(1,str.length()-1);
str = str.substr(1, str.length()-1);
}
else
{
@@ -161,8 +161,8 @@ namespace VMAP
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
if (instanceTree != iInstanceMapTrees.end())
{
Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
Vector3 pos1 = convertPositionToInternalRep(x1, y1, z1);
Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2);
if (pos1 != pos2)
{
result = instanceTree->second->isInLineOfSight(pos1, pos2);
@@ -186,11 +186,11 @@ namespace VMAP
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
if (instanceTree != iInstanceMapTrees.end())
{
Vector3 pos1 = convertPositionToInternalRep(x1,y1,z1);
Vector3 pos2 = convertPositionToInternalRep(x2,y2,z2);
Vector3 pos1 = convertPositionToInternalRep(x1, y1, z1);
Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2);
Vector3 resultPos;
result = instanceTree->second->getObjectHitPos(pos1, pos2, resultPos, pModifyDist);
resultPos = convertPositionToMangosRep(resultPos.x,resultPos.y,resultPos.z);
resultPos = convertPositionToMangosRep(resultPos.x, resultPos.y, resultPos.z);
rx = resultPos.x;
ry = resultPos.y;
rz = resultPos.z;
@@ -212,7 +212,7 @@ namespace VMAP
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
if (instanceTree != iInstanceMapTrees.end())
{
Vector3 pos = convertPositionToInternalRep(x,y,z);
Vector3 pos = convertPositionToInternalRep(x, y, z);
height = instanceTree->second->getHeight(pos, maxSearchDist);
if (!(height < G3D::inf()))
{
+3 -3
View File
@@ -226,7 +226,7 @@ namespace VMAP
float StaticMapTree::getHeight(const Vector3& pPos, float maxSearchDist) const
{
float height = G3D::inf();
Vector3 dir = Vector3(0,0,-1);
Vector3 dir = Vector3(0, 0, -1);
G3D::Ray ray(pPos, dir); // direction with length of 1
float maxDist = maxSearchDist;
if (getIntersectionTime(ray, maxDist, false))
@@ -356,7 +356,7 @@ namespace VMAP
}
if (!iTreeValues)
{
sLog->outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u,%u]", tileX, tileY);
sLog->outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u, %u]", tileX, tileY);
return false;
}
bool result = true;
@@ -382,7 +382,7 @@ namespace VMAP
// acquire model instance
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name);
if (!model)
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u,%u]", tileX, tileY);
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
// update tree
uint32 referencedVal;
+8 -8
View File
@@ -262,12 +262,12 @@ namespace VMAP
int readOperation = 1;
// temporary use defines to simplify read/check code (close file and return at fail)
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN(V, S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }readOperation++;
#define READ_OR_RETURN_WITH_DELETE(V,S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN_WITH_DELETE(V, S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); delete V; return(false); }readOperation++;
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
#define CMP_OR_RETURN(V, S) if(strcmp((V), (S)) != 0) { \
fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
READ_OR_RETURN(&ident, 8);
@@ -362,8 +362,8 @@ namespace VMAP
if (!rf)
{
printf("ERROR: Can't open model file in form: %s",pModelFilename.c_str());
printf("... or form: %s",filename.c_str() );
printf("ERROR: Can't open model file in form: %s", pModelFilename.c_str());
printf("... or form: %s", filename.c_str() );
return false;
}
@@ -372,11 +372,11 @@ namespace VMAP
int readOperation = 1;
// temporary use defines to simplify read/check code (close file and return at fail)
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN(V, S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }readOperation++;
#define READ_OR_RETURN_WITH_DELETE(V,S) if(fread((V), (S), 1, rf) != 1) { \
#define READ_OR_RETURN_WITH_DELETE(V, S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); printf("readfail, op = %i\n", readOperation); delete V; return(false); }readOperation++;
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
#define CMP_OR_RETURN(V, S) if(strcmp((V), (S)) != 0) { \
fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
READ_OR_RETURN(&ident, 8);
+2 -2
View File
@@ -456,7 +456,7 @@ namespace VMAP
}
#ifdef VMAP_DEBUG
const GroupModel &gm = prims[entry];
printf("%10u %8X %7.3f,%7.3f,%7.3f | %7.3f,%7.3f,%7.3f | z=%f, p_z=%f\n", gm.GetWmoID(), gm.GetMogpFlags(),
printf("%10u %8X %7.3f, %7.3f, %7.3f | %7.3f, %7.3f, %7.3f | z=%f, p_z=%f\n", gm.GetWmoID(), gm.GetMogpFlags(),
gm.GetBound().low().x, gm.GetBound().low().y, gm.GetBound().low().z,
gm.GetBound().high().x, gm.GetBound().high().y, gm.GetBound().high().z, group_Z, point.z);
#endif
@@ -507,7 +507,7 @@ namespace VMAP
bool result = true;
uint32 chunkSize, count;
result = fwrite(VMAP_MAGIC,1,8,wf) == 8;
result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false;
chunkSize = sizeof(uint32) + sizeof(uint32);
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false;
+2 -2
View File
@@ -269,7 +269,7 @@ AOEAI::AOEAI(Creature *c) : CreatureAI(c)
me->SetVisible(true);//visible to see all spell anims
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//can't be targeted
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1);//can't be damaged
me->SetDisplayId(11686);//invisible model,around a size of a player
me->SetDisplayId(11686);//invisible model, around a size of a player
}
bool AOEAI::CanAIAttack(const Unit * /*who*/) const
@@ -284,7 +284,7 @@ void AOEAI::AttackStart(Unit * /*who*/)
void AOEAI::UpdateAI(const uint32 /*diff*/)
{
if (!me->HasAura(me->m_spells[0]))
me->CastSpell(me, me->m_spells[0],false);
me->CastSpell(me, me->m_spells[0], false);
}
//////////////
+1 -1
View File
@@ -62,7 +62,7 @@ void GuardAI::MoveInLineOfSight(Unit* unit)
unit->isInAccessiblePlaceFor(me))
{
float attackRadius = me->GetAttackDistance(unit);
if (me->IsWithinDistInMap(unit,attackRadius))
if (me->IsWithinDistInMap(unit, attackRadius))
{
//Need add code to let guard support player
AttackStart(unit);
+6 -6
View File
@@ -116,7 +116,7 @@ void PetAI::UpdateAI(const uint32 diff)
HandleReturnMovement();
}
else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim
me->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST, me->GetFollowAngle());
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
if (!me->GetCharmInfo())
return;
@@ -183,7 +183,7 @@ void PetAI::UpdateAI(const uint32 diff)
bool spellUsed = false;
for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
{
Unit* Target = ObjectAccessor::GetUnit(*me,*tar);
Unit* Target = ObjectAccessor::GetUnit(*me, *tar);
//only buff targets that are in combat, unless the spell can only be cast while out of combat
if (!Target)
@@ -352,12 +352,12 @@ void PetAI::HandleReturnMovement()
// Return to previous position where stay was clicked
if (!me->GetCharmInfo()->IsCommandAttack())
{
float x,y,z;
float x, y, z;
me->GetCharmInfo()->GetStayPosition(x, y, z);
me->GetCharmInfo()->SetIsReturning(true);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(me->GetGUIDLow(),x,y,z);
me->GetMotionMaster()->MovePoint(me->GetGUIDLow(), x, y, z);
}
}
}
@@ -389,7 +389,7 @@ void PetAI::DoAttack(Unit *target, bool chase)
if (chase)
{
if (me->Attack(target,true))
if (me->Attack(target, true))
{
me->GetCharmInfo()->SetIsAtStay(false);
me->GetCharmInfo()->SetIsFollowing(false);
@@ -403,7 +403,7 @@ void PetAI::DoAttack(Unit *target, bool chase)
me->GetCharmInfo()->SetIsAtStay(true);
me->GetCharmInfo()->SetIsFollowing(false);
me->GetCharmInfo()->SetIsReturning(false);
me->Attack(target,true);
me->Attack(target, true);
}
}
+2 -2
View File
@@ -102,7 +102,7 @@ void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid)
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
if (Unit *pTemp = Unit::GetUnit(*me,(*itr)->getUnitGuid()))
if (Unit *pTemp = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (pTemp->GetTypeId() == TYPEID_PLAYER)
me->AddAura(spellid, pTemp);
}
@@ -117,7 +117,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
if (Unit *pTemp = Unit::GetUnit(*me,(*itr)->getUnitGuid()))
if (Unit *pTemp = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (pTemp->GetTypeId() == TYPEID_PLAYER)
me->CastSpell(pTemp, spellid, triggered);
}
+15 -15
View File
@@ -27,14 +27,14 @@ template<class T>
inline
const T& RAND(const T& v1, const T& v2)
{
return (urand(0,1)) ? v1 : v2;
return (urand(0, 1)) ? v1 : v2;
}
template<class T>
inline
const T& RAND(const T& v1, const T& v2, const T& v3)
{
switch (urand(0,2))
switch (urand(0, 2))
{
default:
case 0: return v1;
@@ -47,7 +47,7 @@ template<class T>
inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4)
{
switch (urand(0,3))
switch (urand(0, 3))
{
default:
case 0: return v1;
@@ -61,7 +61,7 @@ template<class T>
inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5)
{
switch (urand(0,4))
switch (urand(0, 4))
{
default:
case 0: return v1;
@@ -76,7 +76,7 @@ template<class T>
inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6)
{
switch (urand(0,5))
switch (urand(0, 5))
{
default:
case 0: return v1;
@@ -92,7 +92,7 @@ template<class T>
inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7)
{
switch (urand(0,6))
switch (urand(0, 6))
{
default:
case 0: return v1;
@@ -109,7 +109,7 @@ template<class T>
inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8)
{
switch (urand(0,7))
switch (urand(0, 7))
{
default:
case 0: return v1;
@@ -128,7 +128,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9)
{
switch (urand(0,8))
switch (urand(0, 8))
{
default:
case 0: return v1;
@@ -148,7 +148,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10)
{
switch (urand(0,9))
switch (urand(0, 9))
{
default:
case 0: return v1;
@@ -169,7 +169,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10, const T& v11)
{
switch (urand(0,10))
switch (urand(0, 10))
{
default:
case 0: return v1;
@@ -191,7 +191,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10, const T& v11, const T& v12)
{
switch (urand(0,11))
switch (urand(0, 11))
{
default:
case 0: return v1;
@@ -214,7 +214,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10, const T& v11, const T& v12, const T& v13)
{
switch (urand(0,12))
switch (urand(0, 12))
{
default:
case 0: return v1;
@@ -238,7 +238,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10, const T& v11, const T& v12, const T& v13, const T& v14)
{
switch (urand(0,13))
switch (urand(0, 13))
{
default:
case 0: return v1;
@@ -263,7 +263,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10, const T& v11, const T& v12, const T& v13, const T& v14, const T& v15)
{
switch (urand(0,14))
switch (urand(0, 14))
{
default:
case 0: return v1;
@@ -289,7 +289,7 @@ inline
const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8,
const T& v9, const T& v10, const T& v11, const T& v12, const T& v13, const T& v14, const T& v15, const T& v16)
{
switch (urand(0,15))
switch (urand(0, 15))
{
default:
case 0: return v1;
+43 -43
View File
@@ -125,14 +125,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.timer.repeatMin,event.timer.repeatMax);
pHolder.UpdateRepeatTimer(me, event.timer.repeatMin, event.timer.repeatMax);
break;
case EVENT_T_TIMER_OOC:
if (me->isInCombat())
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.timer.repeatMin,event.timer.repeatMax);
pHolder.UpdateRepeatTimer(me, event.timer.repeatMin, event.timer.repeatMax);
break;
case EVENT_T_HP:
{
@@ -145,7 +145,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax);
break;
}
case EVENT_T_MANA:
@@ -159,14 +159,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax);
break;
}
case EVENT_T_AGGRO:
break;
case EVENT_T_KILL:
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.kill.repeatMin,event.kill.repeatMax);
pHolder.UpdateRepeatTimer(me, event.kill.repeatMin, event.kill.repeatMax);
break;
case EVENT_T_DEATH:
case EVENT_T_EVADE:
@@ -175,15 +175,15 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
//Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.spell_hit.repeatMin,event.spell_hit.repeatMax);
pHolder.UpdateRepeatTimer(me, event.spell_hit.repeatMin, event.spell_hit.repeatMax);
break;
case EVENT_T_RANGE:
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.range.repeatMin,event.range.repeatMax);
pHolder.UpdateRepeatTimer(me, event.range.repeatMin, event.range.repeatMax);
break;
case EVENT_T_OOC_LOS:
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.ooc_los.repeatMin,event.ooc_los.repeatMax);
pHolder.UpdateRepeatTimer(me, event.ooc_los.repeatMin, event.ooc_los.repeatMax);
break;
case EVENT_T_RESET:
case EVENT_T_SPAWNED:
@@ -199,7 +199,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax);
break;
}
case EVENT_T_TARGET_CASTING:
@@ -207,7 +207,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.target_casting.repeatMin,event.target_casting.repeatMax);
pHolder.UpdateRepeatTimer(me, event.target_casting.repeatMin, event.target_casting.repeatMax);
break;
case EVENT_T_FRIENDLY_HP:
{
@@ -221,7 +221,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = pUnit;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.friendly_hp.repeatMin,event.friendly_hp.repeatMax);
pHolder.UpdateRepeatTimer(me, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax);
break;
}
case EVENT_T_FRIENDLY_IS_CC:
@@ -240,7 +240,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = *(pList.begin());
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.friendly_is_cc.repeatMin,event.friendly_is_cc.repeatMax);
pHolder.UpdateRepeatTimer(me, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax);
break;
}
case EVENT_T_FRIENDLY_MISSING_BUFF:
@@ -256,7 +256,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
pActionInvoker = *(pList.begin());
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.friendly_buff.repeatMin,event.friendly_buff.repeatMax);
pHolder.UpdateRepeatTimer(me, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax);
break;
}
case EVENT_T_SUMMONED_UNIT:
@@ -270,7 +270,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.summon_unit.repeatMin,event.summon_unit.repeatMax);
pHolder.UpdateRepeatTimer(me, event.summon_unit.repeatMin, event.summon_unit.repeatMax);
break;
}
case EVENT_T_TARGET_MANA:
@@ -284,7 +284,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax);
pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax);
break;
}
case EVENT_T_REACHED_HOME:
@@ -299,7 +299,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.buffed.repeatMin,event.buffed.repeatMax);
pHolder.UpdateRepeatTimer(me, event.buffed.repeatMin, event.buffed.repeatMax);
break;
}
case EVENT_T_TARGET_BUFFED:
@@ -315,7 +315,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
return false;
//Repeat Timers
pHolder.UpdateRepeatTimer(me,event.buffed.repeatMin,event.buffed.repeatMax);
pHolder.UpdateRepeatTimer(me, event.buffed.repeatMin, event.buffed.repeatMax);
break;
}
default:
@@ -353,8 +353,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
int32 temp = 0;
if (action.text.TextId2 && action.text.TextId3)
temp = RAND(action.text.TextId1,action.text.TextId2,action.text.TextId3);
else if (action.text.TextId2 && urand(0,1))
temp = RAND(action.text.TextId1, action.text.TextId2, action.text.TextId3);
else if (action.text.TextId2 && urand(0, 1))
temp = action.text.TextId2;
else
temp = action.text.TextId1;
@@ -410,7 +410,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(action.morph.creatureId))
{
uint32 display_id = sObjectMgr->ChooseDisplayId(0,ci);
uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci);
me->SetDisplayId(display_id);
}
}
@@ -527,7 +527,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i)
if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid()))
if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid()))
me->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent);
break;
}
@@ -632,16 +632,16 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_QUEST_EVENT_ALL:
if (pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER)
{
if (Unit* Temp = Unit::GetUnit(*me,pActionInvoker->GetGUID()))
if (Unit* Temp = Unit::GetUnit(*me, pActionInvoker->GetGUID()))
if (Temp->GetTypeId() == TYPEID_PLAYER)
Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId,me);
Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId, me);
}
break;
case ACTION_T_CAST_EVENT_ALL:
{
std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i)
if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid()))
if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid()))
if (Temp->GetTypeId() == TYPEID_PLAYER)
Temp->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId);
break;
@@ -769,9 +769,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
// TRINITY ONLY
case ACTION_T_MOVE_RANDOM_POINT: //dosen't work in combat
{
float x,y,z;
float x, y, z;
me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)action.raw.param1);
me->GetMotionMaster()->MovePoint(0,x,y,z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
break;
}
case ACTION_T_SET_STAND_STATE:
@@ -796,8 +796,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
{
GameObject* pObject = NULL;
float x,y,z;
me->GetPosition(x,y,z);
float x, y, z;
me->GetPosition(x, y, z);
pObject = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2);
if (!pObject)
{
@@ -885,7 +885,7 @@ void CreatureEventAI::Reset()
//Reset all out of combat timers
case EVENT_T_TIMER_OOC:
{
if ((*i).UpdateRepeatTimer(me,event.timer.initialMin,event.timer.initialMax))
if ((*i).UpdateRepeatTimer(me, event.timer.initialMin, event.timer.initialMax))
(*i).Enabled = true;
break;
}
@@ -985,7 +985,7 @@ void CreatureEventAI::EnterCombat(Unit *enemy)
break;
//Reset all in combat timers
case EVENT_T_TIMER:
if ((*i).UpdateRepeatTimer(me,event.timer.initialMin,event.timer.initialMax))
if ((*i).UpdateRepeatTimer(me, event.timer.initialMin, event.timer.initialMax))
(*i).Enabled = true;
break;
//All normal events need to be re-enabled and their time set to 0
@@ -1111,7 +1111,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
case EVENT_T_RANGE:
if (me->getVictim())
if (me->IsInMap(me->getVictim()))
if (me->IsInRange(me->getVictim(),(float)(*i).Event.range.minDist,(float)(*i).Event.range.maxDist))
if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist))
ProcessEvent(*i);
break;
}
@@ -1163,13 +1163,13 @@ inline Unit* CreatureEventAI::GetTargetByType(uint32 Target, Unit* pActionInvoke
case TARGET_T_HOSTILE:
return me->getVictim();
case TARGET_T_HOSTILE_SECOND_AGGRO:
return SelectTarget(SELECT_TARGET_TOPAGGRO,1);
return SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
case TARGET_T_HOSTILE_LAST_AGGRO:
return SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0);
return SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
case TARGET_T_HOSTILE_RANDOM:
return SelectTarget(SELECT_TARGET_RANDOM,0);
return SelectTarget(SELECT_TARGET_RANDOM, 0);
case TARGET_T_HOSTILE_RANDOM_NOT_TOP:
return SelectTarget(SELECT_TARGET_RANDOM,1);
return SelectTarget(SELECT_TARGET_RANDOM, 1);
case TARGET_T_ACTION_INVOKER:
return pActionInvoker;
default:
@@ -1236,13 +1236,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;
}
@@ -1250,18 +1250,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;
}
sLog->outDebug(LOG_FILTER_DATABASE_AI, "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);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "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)
@@ -1271,7 +1271,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit*
((Unit*)pSource)->HandleEmoteCommand((*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)
@@ -1329,7 +1329,7 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge
return false;
//Unit is out of range of this spell
if (!me->IsInRange(Target,TempRange->minRangeHostile,TempRange->maxRangeHostile))
if (!me->IsInRange(Target, TempRange->minRangeHostile, TempRange->maxRangeHostile))
return false;
return true;
@@ -1389,7 +1389,7 @@ bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& e
{
// zone ID check
uint32 zone, area;
me->GetZoneAndAreaId(zone,area);
me->GetZoneAndAreaId(zone, area);
return zone == event.spawned.conditionValue1 || area == event.spawned.conditionValue1;
}
default:
+3 -3
View File
@@ -36,7 +36,7 @@ enum EventAI_Type
EVENT_T_TIMER = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
EVENT_T_TIMER_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax
EVENT_T_HP = 2, // HPMax%, HPMin%, RepeatMin, RepeatMax
EVENT_T_MANA = 3, // ManaMax%,ManaMin% RepeatMin, RepeatMax
EVENT_T_MANA = 3, // ManaMax%, ManaMin% RepeatMin, RepeatMax
EVENT_T_AGGRO = 4, // NONE
EVENT_T_KILL = 5, // RepeatMin, RepeatMax
EVENT_T_DEATH = 6, // NONE
@@ -105,9 +105,9 @@ enum EventAI_ActionType
ACTION_T_DIE = 37, // No Params
ACTION_T_ZONE_COMBAT_PULSE = 38, // No Params
ACTION_T_CALL_FOR_HELP = 39, // Radius
ACTION_T_SET_SHEATH = 40, // Sheath (0-passive,1-melee,2-ranged)
ACTION_T_SET_SHEATH = 40, // Sheath (0-passive, 1-melee, 2-ranged)
ACTION_T_FORCE_DESPAWN = 41, // No Params
ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat,1-percent from max health)
ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat, 1-percent from max health)
ACTION_T_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to unmount)
ACTION_T_SET_PHASE_MASK = 97,
@@ -34,7 +34,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
m_CreatureEventAI_TextMap.clear();
// Load EventAI Text
sObjectMgr->LoadTrinityStrings("creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
sObjectMgr->LoadTrinityStrings("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()
// 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->GetTrinityStringLocale(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;
@@ -133,9 +133,9 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
temp.orientation = fields[4].GetFloat();
temp.SpawnTimeSecs = fields[5].GetUInt32();
if (!Trinity::IsValidMapCoord(temp.position_x,temp.position_y,temp.position_z,temp.orientation))
if (!Trinity::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation))
{
sLog->outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f,%f,%f,%f), skipping.", i,temp.position_x,temp.position_y,temp.position_z,temp.orientation);
sLog->outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation);
continue;
}
@@ -189,7 +189,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);
@@ -351,7 +351,7 @@ 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 (temp.receive_emote.condition)
@@ -362,7 +362,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
cond.mConditionValue2 = temp.receive_emote.conditionValue2;
if (!sConditionMgr->isConditionTypeValid(&cond))
{
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;
}
}
@@ -462,7 +462,7 @@ 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))
@@ -509,7 +509,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
//output as debug for now, also because there's no general rule all spells have RecoveryTime
if (temp.event_param3 < spell->RecoveryTime)
sLog->outDebug("CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,action.cast.spellId, spell->RecoveryTime, temp.event_param3);
sLog->outDebug("CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1, action.cast.spellId, spell->RecoveryTime, temp.event_param3);
}
}
*/
@@ -618,7 +618,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
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);
std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
// equal case processed at call
}
break;
@@ -19,8 +19,8 @@
#define CAST_CRE(a) (SCRIPT_CAST_TYPE<Creature*>(a))
#define CAST_SUM(a) (SCRIPT_CAST_TYPE<TempSummon*>(a))
#define CAST_PET(a) (SCRIPT_CAST_TYPE<Pet*>(a))
#define CAST_AI(a,b) (SCRIPT_CAST_TYPE<a*>(b))
#define CAST_INST(a,b) (SCRIPT_CAST_TYPE<a*>(b))
#define CAST_AI(a, b) (SCRIPT_CAST_TYPE<a*>(b))
#define CAST_INST(a, b) (SCRIPT_CAST_TYPE<a*>(b))
#define GET_SPELL(a) (const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(a)))
@@ -79,11 +79,11 @@ enum eTradeskill
// d - Action (identifys this Menu Item)
// e - Text to be displayed in pop up box
// f - Money value in pop up box
#define ADD_GOSSIP_ITEM(a,b,c,d) PlayerTalkClass->GetGossipMenu().AddMenuItem(a,b,c,d,"",0)
#define ADD_GOSSIP_ITEM_EXTENDED(a,b,c,d,e,f,g) PlayerTalkClass->GetGossipMenu().AddMenuItem(a,b,c,d,e,f,g)
#define ADD_GOSSIP_ITEM(a, b, c, d) PlayerTalkClass->GetGossipMenu().AddMenuItem(a, b, c, d, "", 0)
#define ADD_GOSSIP_ITEM_EXTENDED(a, b, c, d, e, f, g) PlayerTalkClass->GetGossipMenu().AddMenuItem(a, b, c, d, e, f, g)
// This fuction Sends the current menu to show to client, a - NPCTEXTID(uint32) , b - npc guid(uint64)
#define SEND_GOSSIP_MENU(a,b) PlayerTalkClass->SendGossipMenu(a,b)
#define SEND_GOSSIP_MENU(a, b) PlayerTalkClass->SendGossipMenu(a, b)
// Closes the Menu
#define CLOSE_GOSSIP_MENU() PlayerTalkClass->CloseGossip()
@@ -54,7 +54,7 @@ SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
Kill_Spell = 0;
Kill_Target_Type = 0;
memset(Spell,0,sizeof(Spell));
memset(Spell, 0, sizeof(Spell));
EnterEvadeMode();
}
@@ -97,7 +97,7 @@ void SimpleAI::EnterCombat(Unit *who)
Spell_Timer[9] = Spell[9].First_Cast;
else Spell_Timer[9] = 1000;
uint8 random_text = urand(0,2);
uint8 random_text = urand(0, 2);
//Random text
if (Aggro_TextId[random_text])
@@ -110,7 +110,7 @@ void SimpleAI::EnterCombat(Unit *who)
void SimpleAI::KilledUnit(Unit *victim)
{
uint8 random_text = urand(0,2);
uint8 random_text = urand(0, 2);
//Random yell
if (Kill_TextId[random_text])
@@ -134,13 +134,13 @@ void SimpleAI::KilledUnit(Unit *victim)
pTarget = me->getVictim();
break;
case CAST_HOSTILE_SECOND_AGGRO:
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1);
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
break;
case CAST_HOSTILE_LAST_AGGRO:
pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0);
pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
break;
case CAST_HOSTILE_RANDOM:
pTarget = SelectTarget(SELECT_TARGET_RANDOM,0);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
break;
case CAST_KILLEDUNIT_VICTIM:
pTarget = victim;
@@ -158,7 +158,7 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
if (me->GetHealth() > damage)
return;
uint8 random_text = urand(0,2);
uint8 random_text = urand(0, 2);
//Random yell
if (Death_TextId[random_text])
@@ -182,13 +182,13 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
pTarget = me->getVictim();
break;
case CAST_HOSTILE_SECOND_AGGRO:
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1);
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
break;
case CAST_HOSTILE_LAST_AGGRO:
pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0);
pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
break;
case CAST_HOSTILE_RANDOM:
pTarget = SelectTarget(SELECT_TARGET_RANDOM,0);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
break;
case CAST_JUSTDIED_KILLER:
pTarget = killer;
@@ -233,13 +233,13 @@ void SimpleAI::UpdateAI(const uint32 diff)
pTarget = me->getVictim();
break;
case CAST_HOSTILE_SECOND_AGGRO:
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1);
pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
break;
case CAST_HOSTILE_LAST_AGGRO:
pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0);
pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
break;
case CAST_HOSTILE_RANDOM:
pTarget = SelectTarget(SELECT_TARGET_RANDOM,0);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
break;
}
@@ -253,7 +253,7 @@ void SimpleAI::UpdateAI(const uint32 diff)
//Yell and sound use the same number so that you can make
//the Creature yell with the correct sound effect attached
uint8 random_text = urand(0,2);
uint8 random_text = urand(0, 2);
//Random yell
if (Spell[i].TextId[random_text])
+6 -6
View File
@@ -344,7 +344,7 @@ void SmartAI::UpdateAI(const uint32 diff)
{
if (mFollowArrivedTimer < diff)
{
if (me->FindNearestCreature(mFollowArrivedEntry,INTERACTION_DISTANCE, true))
if (me->FindNearestCreature(mFollowArrivedEntry, INTERACTION_DISTANCE, true))
{
if (Player* plr = me->GetPlayer(*me, mFollowGuid))
{
@@ -744,7 +744,7 @@ void SmartAI::sQuestReward(Player* player, Quest const* quest, uint32 opt)
bool SmartAI::sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT,caster,spellId,(uint32)effIndex);
GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT, caster, spellId, (uint32)effIndex);
return true;
}
@@ -843,7 +843,7 @@ void SmartGameObjectAI::Reset()
bool SmartGameObjectAI::GossipHello(Player* player)
{
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello");
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0 ,0 , false, NULL, go);
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0 , 0 , false, NULL, go);
return false;
}
@@ -863,14 +863,14 @@ bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/,
// Called when a player accepts a quest from the gameobject.
bool SmartGameObjectAI::QuestAccept(Player* player, Quest const* quest)
{
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId() ,0 , false, NULL, go);
GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId() , 0 , false, NULL, go);
return false;
}
// Called when a player selects a quest reward.
bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 opt)
{
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId() ,opt , false, NULL, go);
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId() , opt , false, NULL, go);
return false;
}
@@ -880,7 +880,7 @@ uint32 SmartGameObjectAI::GetDialogStatus(Player* /*player*/) { return 100; }
// Called when the gameobject is destroyed (destructible buildings only).
void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId ,0 , false, NULL, go);
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId , 0 , false, NULL, go);
}
void SmartGameObjectAI::SetData(uint32 id, uint32 value)
@@ -56,7 +56,7 @@ void SmartWaypointMgr::LoadFromDB()
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
uint32 id = fields[1].GetUInt32();
float x,y,z;
float x, y, z;
x = fields[2].GetFloat();
y = fields[3].GetFloat();
z = fields[4].GetFloat();
@@ -88,13 +88,13 @@ enum SMART_EVENT
SMART_EVENT_HEALT_PCT = 2, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax
SMART_EVENT_MANA_PCT = 3, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax
SMART_EVENT_AGGRO = 4, //1 // NONE
SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1,playerOnly2,else creature entry3
SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3
SMART_EVENT_DEATH = 6, //1 // NONE
SMART_EVENT_EVADE = 7, //1 // NONE
SMART_EVENT_SPELLHIT = 8, //1 // SpellID, School, CooldownMin, CooldownMax
SMART_EVENT_RANGE = 9, //1 // MinDist, MaxDist, RepeatMin, RepeatMax
SMART_EVENT_OOC_LOS = 10, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax
SMART_EVENT_RESPAWN = 11, //1 // type, MapId,ZoneId
SMART_EVENT_RESPAWN = 11, //1 // type, MapId, ZoneId
SMART_EVENT_TARGET_HEALTH_PCT = 12, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax
SMART_EVENT_TARGET_CASTING = 13, //1 // RepeatMin, RepeatMax
SMART_EVENT_FRIENDLY_HEALTH = 14, //1 // HPDeficit, Radius, RepeatMin, RepeatMax
@@ -105,7 +105,7 @@ enum SMART_EVENT
SMART_EVENT_ACCEPTED_QUEST = 19, //1 // QuestID(0any)
SMART_EVENT_REWARD_QUEST = 20, //1 // QuestID(0any)
SMART_EVENT_REACHED_HOME = 21, //1 // NONE
SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1,val2,val3
SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
SMART_EVENT_HAS_AURA = 23, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
SMART_EVENT_TARGET_BUFFED = 24, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
SMART_EVENT_RESET = 25, //1 // Called after combat, when the creature respawn and spawn.
@@ -370,7 +370,7 @@ enum SMART_ACTION
SMART_ACTION_ACTIVATE_GOBJECT = 9, //
SMART_ACTION_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3...
SMART_ACTION_CAST = 11, // SpellId, CastFlags
SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID,summonType, duration in ms, storageID, attackInvoker,
SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID, summonType, duration in ms, storageID, attackInvoker,
SMART_ACTION_THREAT_SINGLE_PCT = 13, // Threat%
SMART_ACTION_THREAT_ALL_PCT = 14, // Threat%
SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS = 15, // QuestID
@@ -387,7 +387,7 @@ enum SMART_ACTION
SMART_ACTION_CALL_GROUPEVENTHAPPENS = 26, // QuestID
SMART_ACTION_CALL_CASTEDCREATUREORGO = 27, // CreatureId, SpellId
SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid
SMART_ACTION_FOLLOW = 29, // Distance, Angle, EndCreatureEntry, credit, creditType (0monsterkill,1event)
SMART_ACTION_FOLLOW = 29, // Distance, Angle, EndCreatureEntry, credit, creditType (0monsterkill, 1event)
SMART_ACTION_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3...
SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax
SMART_ACTION_RESET_GOBJECT = 32, //
@@ -398,7 +398,7 @@ enum SMART_ACTION
SMART_ACTION_DIE = 37, // No Params
SMART_ACTION_SET_IN_COMBAT_WITH_ZONE = 38, // No Params
SMART_ACTION_CALL_FOR_HELP = 39, // Radius
SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed,1-melee,2-ranged)
SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed, 1-melee, 2-ranged)
SMART_ACTION_FORCE_DESPAWN = 41, // timer
SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue(+pct, -flat)
SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to unmount)
@@ -431,7 +431,7 @@ enum SMART_ACTION
SMART_ACTION_PLAYMOVIE = 68, // entry
SMART_ACTION_MOVE_TO_POS = 69, // xyz
SMART_ACTION_RESPAWN_TARGET = 70, //
SMART_ACTION_EQUIP = 71, // entry, slotmask slot1,slot2,slot3 ,only slots with mask set will be sent to client, bits are 1,2,4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set
SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set
SMART_ACTION_CLOSE_GOSSIP = 72, // none
SMART_ACTION_TRIGGER_TIMED_EVENT = 73, // id(>1)
SMART_ACTION_REMOVE_TIMED_EVENT = 74, // id(>1)
@@ -903,7 +903,7 @@ struct SmartTarget
raw.param3 = p3;
}
SMARTAI_TARGETS type;
float x,y,z,o;
float x, y, z, o;
union
{
struct
@@ -993,16 +993,16 @@ enum eSmartAI
enum SmartScriptType
{
SMART_SCRIPT_TYPE_CREATURE = 0,//done
SMART_SCRIPT_TYPE_GAMEOBJECT = 1,//done
SMART_SCRIPT_TYPE_AREATRIGGER = 2,//done
SMART_SCRIPT_TYPE_EVENT = 3,//
SMART_SCRIPT_TYPE_GOSSIP = 4,//
SMART_SCRIPT_TYPE_QUEST = 5,//
SMART_SCRIPT_TYPE_SPELL = 6,//
SMART_SCRIPT_TYPE_TRANSPORT = 7,//
SMART_SCRIPT_TYPE_INSTANCE = 8,//
SMART_SCRIPT_TYPE_TIMED_ACTIONLIST = 9,//
SMART_SCRIPT_TYPE_CREATURE = 0, //done
SMART_SCRIPT_TYPE_GAMEOBJECT = 1, //done
SMART_SCRIPT_TYPE_AREATRIGGER = 2, //done
SMART_SCRIPT_TYPE_EVENT = 3, //
SMART_SCRIPT_TYPE_GOSSIP = 4, //
SMART_SCRIPT_TYPE_QUEST = 5, //
SMART_SCRIPT_TYPE_SPELL = 6, //
SMART_SCRIPT_TYPE_TRANSPORT = 7, //
SMART_SCRIPT_TYPE_INSTANCE = 8, //
SMART_SCRIPT_TYPE_TIMED_ACTIONLIST = 9, //
SMART_SCRIPT_TYPE_MAX = 10
};
+6 -6
View File
@@ -39,8 +39,8 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
return AOR_NAME_ALREDY_EXIST; // username does already exist
}
LoginDatabase.PExecute("INSERT INTO account(username,sha_pass_hash,joindate) VALUES('%s','%s',NOW())", username.c_str(), CalculateShaPassHash(username, password).c_str());
LoginDatabase.Execute("INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist,account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL");
LoginDatabase.PExecute("INSERT INTO account(username, sha_pass_hash, joindate) VALUES('%s', '%s', NOW())", username.c_str(), CalculateShaPassHash(username, password).c_str());
LoginDatabase.Execute("INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL");
return AOR_OK; // everything's fine
}
@@ -52,7 +52,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
return AOR_NAME_NOT_EXIST; // account doesn't exist
// existed characters list
result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'",accid);
result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'", accid);
if (result)
{
do
@@ -110,7 +110,7 @@ AccountOpResult AccountMgr::ChangeUsername(uint32 accid, std::string new_uname,
std::string safe_new_uname = new_uname;
LoginDatabase.escape_string(safe_new_uname);
LoginDatabase.PExecute("UPDATE account SET v='0',s='0',username='%s',sha_pass_hash='%s' WHERE id='%d'", safe_new_uname.c_str(),
LoginDatabase.PExecute("UPDATE account SET v='0', s='0', username='%s', sha_pass_hash='%s' WHERE id='%d'", safe_new_uname.c_str(),
CalculateShaPassHash(new_uname, new_passwd).c_str(), accid);
return AOR_OK;
@@ -221,7 +221,7 @@ bool AccountMgr::normalizeString(std::string& utf8str)
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;
#ifdef _MSC_VER
#pragma warning(disable: 4996)
@@ -231,7 +231,7 @@ bool AccountMgr::normalizeString(std::string& utf8str)
#pragma warning(default: 4996)
#endif
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 -55
View File
@@ -48,7 +48,7 @@ namespace Trinity
: i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {}
void operator()(WorldPacket& data, LocaleConstant loc_idx)
{
char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx);
char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
data << uint8(i_msgtype);
data << uint32(LANG_UNIVERSAL);
@@ -73,7 +73,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{
if (dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE)
{
sLog->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID,dataType);
sLog->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType);
return false;
}
@@ -113,7 +113,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id))
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,creature.id);
criteria->ID, criteria->requiredType, dataType, creature.id);
return false;
}
return true;
@@ -121,19 +121,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!classRace.class_id && !classRace.race_id)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
criteria->ID, criteria->requiredType,dataType);
criteria->ID, criteria->requiredType, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,classRace.class_id);
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,classRace.race_id);
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
return true;
@@ -141,7 +141,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (health.percent < 1 || health.percent > 100)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,health.percent);
criteria->ID, criteria->requiredType, dataType, health.percent);
return false;
}
return true;
@@ -149,7 +149,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (player_dead.own_team_flag > 1)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).",
criteria->ID, criteria->requiredType,dataType,player_dead.own_team_flag);
criteria->ID, criteria->requiredType, dataType, player_dead.own_team_flag);
return false;
}
return true;
@@ -160,19 +160,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!spellEntry)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id);
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id);
return false;
}
if (aura.effect_idx >= 3)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.",
criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.effect_idx);
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx);
return false;
}
if (!spellEntry->EffectApplyAuraName[aura.effect_idx])
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.",
criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id,aura.effect_idx);
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx);
return false;
}
return true;
@@ -181,7 +181,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!GetAreaEntryByAreaID(area.id))
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,area.id);
criteria->ID, criteria->requiredType, dataType, area.id);
return false;
}
return true;
@@ -189,7 +189,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (level.minlevel > STRONG_MAX_LEVEL)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,level.minlevel);
criteria->ID, criteria->requiredType, dataType, level.minlevel);
return false;
}
return true;
@@ -197,7 +197,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (gender.gender > GENDER_NONE)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,gender.gender);
criteria->ID, criteria->requiredType, dataType, gender.gender);
return false;
}
return true;
@@ -213,7 +213,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (difficulty.difficulty >= MAX_DIFFICULTY)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,difficulty.difficulty);
criteria->ID, criteria->requiredType, dataType, difficulty.difficulty);
return false;
}
return true;
@@ -221,7 +221,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (map_players.maxcount <= 0)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,map_players.maxcount);
criteria->ID, criteria->requiredType, dataType, map_players.maxcount);
return false;
}
return true;
@@ -229,7 +229,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (team.team != ALLIANCE && team.team != HORDE)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,team.team);
criteria->ID, criteria->requiredType, dataType, team.team);
return false;
}
return true;
@@ -237,7 +237,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (drunk.state >= MAX_DRUNKEN)
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,drunk.state);
criteria->ID, criteria->requiredType, dataType, drunk.state);
return false;
}
return true;
@@ -245,7 +245,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!sHolidaysStore.LookupEntry(holiday.id))
{
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,holiday.id);
criteria->ID, criteria->requiredType, dataType, holiday.id);
return false;
}
return true;
@@ -255,7 +255,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (equipped_item.item_quality >= MAX_ITEM_QUALITY)
{
sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.",
criteria->ID, criteria->requiredType,dataType,equipped_item.item_quality);
criteria->ID, criteria->requiredType, dataType, equipped_item.item_quality);
return false;
}
return true;
@@ -268,7 +268,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
}
return true;
default:
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType,dataType);
sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
return false;
}
}
@@ -303,15 +303,15 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
return (player->GetTeam() == source->GetTeam()) == (player_dead.own_team_flag != 0);
return false;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA:
return source->HasAuraEffect(aura.spell_id,aura.effect_idx);
return source->HasAuraEffect(aura.spell_id, aura.effect_idx);
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA:
{
uint32 zone_id,area_id;
source->GetZoneAndAreaId(zone_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_DATA_TYPE_T_AURA:
return target && target->HasAuraEffect(aura.spell_id,aura.effect_idx);
return target && target->HasAuraEffect(aura.spell_id, aura.effect_idx);
case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE:
return miscvalue1 >= value.minvalue;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL:
@@ -341,7 +341,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
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_DATA_INSTANCE_SCRIPT:
{
@@ -400,14 +400,14 @@ void AchievementMgr::Reset()
{
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)
{
WorldPacket data(SMSG_CRITERIA_DELETED,4);
WorldPacket data(SMSG_CRITERIA_DELETED, 4);
data << uint32(iter->first);
m_player->SendDirectMessage(&data);
}
@@ -454,8 +454,8 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
void AchievementMgr::DeleteFromDB(uint32 lowguid)
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("DELETE FROM character_achievement WHERE guid = %u",lowguid);
trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u",lowguid);
trans->PAppend("DELETE FROM character_achievement WHERE guid = %u", lowguid);
trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u", lowguid);
CharacterDatabase.CommitTransaction(trans);
}
@@ -606,8 +606,8 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ
if (!criteria)
{
// we will remove not existed criteria for all characters
sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.",id);
CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u",id);
sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id);
CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u", id);
continue;
}
@@ -637,9 +637,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
if (Guild* guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID);
Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID);
Trinity::LocalizedPacketDo<Trinity::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))
@@ -708,7 +708,7 @@ void AchievementMgr::CheckAllAchievementCriteria()
static const uint32 achievIdByArenaSlot[MAX_ARENA_SLOT] = { 1057, 1107, 1108 };
static const uint32 achievIdForDungeon[][4] =
{
// ach_cr_id,is_dungeon,is_raid,is_heroic_dungeon
// ach_cr_id, is_dungeon, is_raid, is_heroic_dungeon
{ 321, true, true, true },
{ 916, false, true, false },
{ 917, false, true, false },
@@ -798,7 +798,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
if (!data || !data->Meets(GetPlayer(), unit))
continue;
SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE);
@@ -814,7 +814,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
if (!data || !data->Meets(GetPlayer(), unit))
continue;
SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE);
@@ -1008,7 +1008,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
if (!data || !data->Meets(GetPlayer(), unit))
continue;
// miscvalue1 is the ingame fallheight*100 as stored in dbc
@@ -1050,7 +1050,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
if (!data || !data->Meets(GetPlayer(), unit))
continue;
break;
}
@@ -1072,7 +1072,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!data)
continue;
if (!data->Meets(GetPlayer(),unit))
if (!data->Meets(GetPlayer(), unit))
continue;
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
@@ -1089,7 +1089,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!data)
continue;
if (!data->Meets(GetPlayer(),unit))
if (!data->Meets(GetPlayer(), unit))
continue;
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
@@ -1116,7 +1116,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
if (!data || !data->Meets(GetPlayer(), unit))
continue;
}
@@ -1139,7 +1139,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(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, 0);
@@ -1275,7 +1275,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{
// those requirements couldn't be found in the dbc
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
if (!data || !data->Meets(GetPlayer(),unit))
if (!data || !data->Meets(GetPlayer(), unit))
continue;
}
@@ -1359,7 +1359,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if (!data)
continue;
if (!data->Meets(GetPlayer(),unit))
if (!data->Meets(GetPlayer(), unit))
continue;
}
@@ -1763,7 +1763,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
{
AchievementCriteriaEntry const* criteria = *itr;
bool completed = IsCompletedCriteria(criteria,entry);
bool completed = IsCompletedCriteria(criteria, entry);
// found an uncompleted criteria, but DONT return false yet - there might be a completed criteria with ACHIEVEMENT_CRITERIA_COMPLETE_FLAG_ALL
if (completed)
@@ -1867,7 +1867,7 @@ void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry *entr
if (criteriaProgress == m_criteriaProgress.end())
return;
WorldPacket data(SMSG_CRITERIA_DELETED,4);
WorldPacket data(SMSG_CRITERIA_DELETED, 4);
data << uint32(entry->ID);
m_player->SendDirectMessage(&data);
@@ -1978,7 +1978,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, b
// mail
if (reward->sender)
{
Item* item = reward->itemId ? Item::CreateItem(reward->itemId,1,GetPlayer ()) : NULL;
Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer ()) : NULL;
int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex();
@@ -2128,7 +2128,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria);
}
sLog->outString(">> Loaded %lu achievement criteria in %u ms",(unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime));
sLog->outString(">> Loaded %lu achievement criteria in %u ms", (unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
@@ -2156,7 +2156,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
++count;
}
sLog->outString(">> Loaded %u achievement references in %u ms",count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString(">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
@@ -2323,15 +2323,15 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!sAchievementStore.LookupEntry(achievement_id))
{
// we will remove not existed achievement for all characters
sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.",achievement_id);
CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u",achievement_id);
sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.", achievement_id);
CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u", achievement_id);
continue;
}
m_allCompletedAchievements.insert(achievement_id);
} while (result->NextRow());
sLog->outString(">> Loaded %lu completed achievements in %u ms",(unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
sLog->outString(">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
@@ -2449,8 +2449,8 @@ void AchievementGlobalMgr::LoadRewardLocales()
m_achievementRewardLocales.clear(); // need for reload case
QueryResult result = WorldDatabase.Query("SELECT entry,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,"
"subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8"
QueryResult result = WorldDatabase.Query("SELECT entry, subject_loc1, text_loc1, subject_loc2, text_loc2, subject_loc3, text_loc3, subject_loc4, text_loc4, "
"subject_loc5, text_loc5, subject_loc6, text_loc6, subject_loc7, text_loc7, subject_loc8, text_loc8"
" FROM locales_achievement_reward");
if (!result)
+16 -16
View File
@@ -30,8 +30,8 @@
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, AchievementCriteriaEntryList> AchievementCriteriaListByAchievement;
typedef std::map<uint32, AchievementEntryList> AchievementListByReferencedId;
struct CriteriaProgress
{
@@ -52,17 +52,17 @@ enum AchievementCriteriaDataType
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, // spell_id effect_idx
ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8, // minvalue value provided with achievement update must be not less that limit
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9, // minlevel minlevel of target
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10,// gender 0=male; 1=female
ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11,// scripted requirement
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12,// difficulty normal/heroic difficulty for current event map
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13,// count "with less than %u people in the zone"
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14,// team HORDE(67), ALLIANCE(469)
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15,// drunken_state 0 (enum DrunkenState) of player
ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16,// holiday_id 0 event in holiday time
ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17,// min_score max_score player's team win bg and opposition team have team score in range
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18,// 0 0 maker instance script call for check current criteria requirements fit
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19,// item_level item_quality for equipped item in slot to check item level and quality
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20,// map_id 0 player must be on map with id in map_id
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10, // gender 0=male; 1=female
ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11, // scripted requirement
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12, // difficulty normal/heroic difficulty for current event map
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13, // count "with less than %u people in the zone"
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14, // team HORDE(67), ALLIANCE(469)
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15, // drunken_state 0 (enum DrunkenState) of player
ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16, // holiday_id 0 event in holiday time
ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17, // min_score max_score player's team win bg and opposition team have team score in range
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality
ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, // map_id 0 player must be on map with id in map_id
};
#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 21 // maximum value in AchievementCriteriaDataType enum
@@ -207,7 +207,7 @@ struct AchievementCriteriaDataSet
Storage storage;
};
typedef std::map<uint32,AchievementCriteriaDataSet> AchievementCriteriaDataMap;
typedef std::map<uint32, AchievementCriteriaDataSet> AchievementCriteriaDataMap;
struct AchievementReward
{
@@ -218,7 +218,7 @@ struct AchievementReward
std::string text;
};
typedef std::map<uint32,AchievementReward> AchievementRewards;
typedef std::map<uint32, AchievementReward> AchievementRewards;
struct AchievementRewardLocale
{
@@ -226,7 +226,7 @@ struct AchievementRewardLocale
StringVector text;
};
typedef std::map<uint32,AchievementRewardLocale> AchievementRewardLocales;
typedef std::map<uint32, AchievementRewardLocale> AchievementRewardLocales;
struct CompletedAchievementData
{
@@ -114,20 +114,20 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction&
if (bidder_security > SEC_PLAYER) // not do redundant DB requests
{
if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid,bidder_name))
if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid, bidder_name))
bidder_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
}
}
if (bidder_security > SEC_PLAYER)
{
std::string owner_name;
if (!sObjectMgr->GetPlayerNameByGUID(auction->owner,owner_name))
if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, owner_name))
owner_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner);
sLog->outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)",
bidder_name.c_str(),bidder_accId,pItem->GetTemplate()->Name1.c_str(),pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid);
sLog->outCommand(bidder_accId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)",
bidder_name.c_str(), bidder_accId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid);
}
}
@@ -159,7 +159,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction&
MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str())
.AddItem(pItem)
.SendMailTo(trans, MailReceiver(bidder,auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
.SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
}
}
@@ -188,7 +188,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran
sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str());
MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str())
.SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED);
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED);
}
}
@@ -226,7 +226,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans
}
MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str())
.AddMoney(profit)
.SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY));
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY));
}
}
@@ -252,14 +252,14 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact
MailDraft(subject.str(), "") // TODO: fix body
.AddItem(pItem)
.SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0);
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0);
}
}
//this function sends mail to old bidder
void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans)
{
uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER);
uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
Player *oldBidder = sObjectMgr->GetPlayer(oldBidder_guid);
uint32 oldBidder_accId = 0;
@@ -331,7 +331,7 @@ void AuctionHouseMgr::LoadAuctionItems()
ItemTemplate const *proto = sObjectMgr->GetItemTemplate(item_template);
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;
}
@@ -777,7 +777,7 @@ void Battleground::EndBattleground(uint32 winner)
if (member)
plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, member->PersonalRating);
winner_arena_team->MemberWon(plr,loser_matchmaker_rating, winner_change);
winner_arena_team->MemberWon(plr, loser_matchmaker_rating, winner_change);
}
else
{
@@ -1081,16 +1081,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);
@@ -683,7 +683,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
uint32 scriptId = 0;
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO,Weight,ScriptName FROM battleground_template");
QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, Weight, ScriptName FROM battleground_template");
if (!result)
{
@@ -911,7 +911,7 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, const uint6
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()))
{
uint32 count = 0;
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
@@ -943,7 +943,7 @@ void BattlegroundMgr::SendToBattleground(Player *pl, uint32 instanceId, Battlegr
}
else
{
sLog->outError("player %u is trying to port to non-existent bg instance %u",pl->GetGUIDLow(), instanceId);
sLog->outError("player %u is trying to port to non-existent bg instance %u", pl->GetGUIDLow(), instanceId);
}
}
@@ -1143,7 +1143,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
uint32 bgTypeId = fields[1].GetUInt32();
if (!sBattlemasterListStore.LookupEntry(bgTypeId))
{
sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId);
sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
continue;
}
@@ -443,7 +443,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b
ginfo->RemoveInviteTime = getMSTime() + INVITE_ACCEPT_WAIT_TIME;
// loop through the players
for (std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
for (std::map<uint64, PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
{
// get the player
Player* plr = sObjectMgr->GetPlayer(itr->first);
@@ -471,7 +471,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b
uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID());
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.", plr->GetName(), plr->GetGUIDLow(), bg->GetInstanceID(), queueSlot, bg->GetTypeID());
// send status packet
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType);
@@ -783,7 +783,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);
@@ -1080,7 +1080,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))
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "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);
@@ -94,19 +94,19 @@ void BattlegroundAB::Update(uint32 diff)
// 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)
{
// FIXME: team and node names not localized
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE,NULL,LANG_BG_AB_ALLY,_GetNodeNameId(node));
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node));
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_ALLIANCE);
}
else
{
// FIXME: team and node names not localized
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE,NULL,LANG_BG_AB_HORDE,_GetNodeNameId(node));
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node));
PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_HORDE);
}
}
@@ -187,8 +187,8 @@ void BattlegroundAB::StartingEventCloseDoors()
SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
// Starting base spirit guides
_NodeOccupied(BG_AB_SPIRIT_ALIANCE,ALLIANCE);
_NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE);
_NodeOccupied(BG_AB_SPIRIT_ALIANCE, ALLIANCE);
_NodeOccupied(BG_AB_SPIRIT_HORDE, HORDE);
}
void BattlegroundAB::StartingEventOpenDoors()
@@ -363,10 +363,10 @@ 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)
{
if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
sLog->outError("Failed to spawn spirit guide! point: %u, team: %u,", node, team);
sLog->outError("Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
uint8 capturedNodes = 0;
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
@@ -383,7 +383,7 @@ void BattlegroundAB::_NodeOccupied(uint8 node,Team team)
return;
Creature* trigger = GetBGCreature(node+7);//0-6 spirit guides
if (!trigger)
trigger = AddCreature(WORLD_TRIGGER,node+7,team,BG_AB_NodePositions[node][0],BG_AB_NodePositions[node][1],BG_AB_NodePositions[node][2],BG_AB_NodePositions[node][3]);
trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]);
//add bonus honor aura trigger creature when node is accupied
//cast bonus aura (+50% honor in 25yards)
@@ -437,7 +437,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
uint8 node = BG_AB_NODE_STABLES;
GameObject* obj=GetBgMap()->GetGameObject(m_BgObjects[node*8+7]);
while ((node < BG_AB_DYNAMIC_NODES_COUNT) && ((!obj) || (!source->IsWithinDistInMap(obj,10))))
while ((node < BG_AB_DYNAMIC_NODES_COUNT) && ((!obj) || (!source->IsWithinDistInMap(obj, 10))))
{
++node;
obj=GetBgMap()->GetGameObject(m_BgObjects[node*8+BG_AB_OBJECT_AURA_CONTESTED]);
@@ -472,9 +472,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
// FIXME: team and node names not localized
if (teamIndex == 0)
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_AB_ALLY);
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_AB_ALLY);
else
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_AB_HORDE);
SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_AB_HORDE);
sound = BG_AB_SOUND_NODE_CLAIMED;
}
@@ -496,9 +496,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
// FIXME: node names not localized
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
@@ -512,13 +512,13 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
_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);
// FIXME: node names not localized
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;
}
@@ -538,9 +538,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
// FIXME: node names not localized
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;
}
@@ -550,9 +550,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
{
// FIXME: team and node names not localized
if (teamIndex == BG_TEAM_ALLIANCE)
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node));
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node));
else
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node));
SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node));
}
PlaySoundToAll(sound);
}
@@ -561,22 +561,22 @@ bool BattlegroundAB::SetupBattleground()
{
for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i,BG_AB_OBJECTID_NODE_BANNER_0 + i,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i,BG_AB_OBJECTID_BANNER_CONT_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_H + 8*i,BG_AB_OBJECTID_BANNER_CONT_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_ALLY + 8*i,BG_AB_OBJECTID_BANNER_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_HORDE + 8*i,BG_AB_OBJECTID_BANNER_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_AURA_ALLY + 8*i,BG_AB_OBJECTID_AURA_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_AURA_HORDE + 8*i,BG_AB_OBJECTID_AURA_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i,BG_AB_OBJECTID_AURA_C,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_H + 8*i, BG_AB_OBJECTID_BANNER_CONT_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_ALLY + 8*i, BG_AB_OBJECTID_BANNER_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_HORDE + 8*i, BG_AB_OBJECTID_BANNER_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_AURA_ALLY + 8*i, BG_AB_OBJECTID_AURA_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_AURA_HORDE + 8*i, BG_AB_OBJECTID_AURA_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i, BG_AB_OBJECTID_AURA_C, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
)
{
sLog->outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!");
return false;
}
}
if (!AddObject(BG_AB_OBJECT_GATE_A,BG_AB_OBJECTID_GATE_A,BG_AB_DoorPositions[0][0],BG_AB_DoorPositions[0][1],BG_AB_DoorPositions[0][2],BG_AB_DoorPositions[0][3],BG_AB_DoorPositions[0][4],BG_AB_DoorPositions[0][5],BG_AB_DoorPositions[0][6],BG_AB_DoorPositions[0][7],RESPAWN_IMMEDIATELY)
|| !AddObject(BG_AB_OBJECT_GATE_H,BG_AB_OBJECTID_GATE_H,BG_AB_DoorPositions[1][0],BG_AB_DoorPositions[1][1],BG_AB_DoorPositions[1][2],BG_AB_DoorPositions[1][3],BG_AB_DoorPositions[1][4],BG_AB_DoorPositions[1][5],BG_AB_DoorPositions[1][6],BG_AB_DoorPositions[1][7],RESPAWN_IMMEDIATELY)
if (!AddObject(BG_AB_OBJECT_GATE_A, BG_AB_OBJECTID_GATE_A, BG_AB_DoorPositions[0][0], BG_AB_DoorPositions[0][1], BG_AB_DoorPositions[0][2], BG_AB_DoorPositions[0][3], BG_AB_DoorPositions[0][4], BG_AB_DoorPositions[0][5], BG_AB_DoorPositions[0][6], BG_AB_DoorPositions[0][7], RESPAWN_IMMEDIATELY)
|| !AddObject(BG_AB_OBJECT_GATE_H, BG_AB_OBJECTID_GATE_H, BG_AB_DoorPositions[1][0], BG_AB_DoorPositions[1][1], BG_AB_DoorPositions[1][2], BG_AB_DoorPositions[1][3], BG_AB_DoorPositions[1][4], BG_AB_DoorPositions[1][5], BG_AB_DoorPositions[1][6], BG_AB_DoorPositions[1][7], RESPAWN_IMMEDIATELY)
)
{
sLog->outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!");
@@ -698,7 +698,7 @@ void BattlegroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE);
break;
default:
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
break;
}
}
@@ -196,7 +196,7 @@ const float BG_AB_DoorPositions[2][8] = {
{708.0903f, 708.4479f, -17.8342f, -2.391099f, 0.050291f, 0.015127f, 0.929217f, -0.365784f}
};
// Tick intervals and given points: case 0,1,2,3,4,5 captured nodes
// Tick intervals and given points: case 0, 1, 2, 3, 4, 5 captured nodes
const uint32 BG_AB_TickIntervals[6] = {0, 12000, 9000, 6000, 3000, 1000};
const uint32 BG_AB_TickPoints[6] = {0, 10, 10, 10, 10, 30};
@@ -251,7 +251,7 @@ class BattlegroundAB : public Battleground
void AddPlayer(Player *plr);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
virtual bool SetupBattleground();
virtual void Reset();
@@ -277,7 +277,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);
void _NodeDeOccupied(uint8 node);
int32 _GetNodeNameId(uint8 node);
@@ -53,12 +53,12 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer)
return;
Battleground::HandleKillPlayer(player, killer);
UpdateScore(player->GetTeam(),-1);
UpdateScore(player->GetTeam(), -1);
}
void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i",unit->GetEntry());
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry());
if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint32 entry = unit->GetEntry();
@@ -75,17 +75,17 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
*/
if (entry == BG_AV_CreatureInfo[AV_NPC_A_BOSS][0])
{
CastSpellOnTeam(23658,HORDE); //this is a spell which finishes a quest where a player has to kill the boss
RewardReputationToTeam(729,BG_AV_REP_BOSS,HORDE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),HORDE);
CastSpellOnTeam(23658, HORDE); //this is a spell which finishes a quest where a player has to kill the boss
RewardReputationToTeam(729, BG_AV_REP_BOSS, HORDE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS), HORDE);
EndBattleground(HORDE);
DelCreature(AV_CPLACE_TRIGGER17);
}
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0])
{
CastSpellOnTeam(23658,ALLIANCE); //this is a spell which finishes a quest where a player has to kill the boss
RewardReputationToTeam(730,BG_AV_REP_BOSS,ALLIANCE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),ALLIANCE);
CastSpellOnTeam(23658, ALLIANCE); //this is a spell which finishes a quest where a player has to kill the boss
RewardReputationToTeam(730, BG_AV_REP_BOSS, ALLIANCE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS), ALLIANCE);
EndBattleground(ALLIANCE);
DelCreature(AV_CPLACE_TRIGGER19);
}
@@ -97,15 +97,15 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
return;
}
m_CaptainAlive[0]=false;
RewardReputationToTeam(729,BG_AV_REP_CAPTAIN,HORDE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN),HORDE);
UpdateScore(ALLIANCE,(-1)*BG_AV_RES_CAPTAIN);
RewardReputationToTeam(729, BG_AV_REP_CAPTAIN, HORDE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN), HORDE);
UpdateScore(ALLIANCE, (-1)*BG_AV_RES_CAPTAIN);
//spawn destroyed aura
for (uint8 i=0; i <= 9; i++)
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+i,RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+i, RESPAWN_IMMEDIATELY);
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature,GetTrinityString(LANG_BG_AV_A_CAPTAIN_DEAD),LANG_UNIVERSAL);
YellToAll(creature, GetTrinityString(LANG_BG_AV_A_CAPTAIN_DEAD), LANG_UNIVERSAL);
DelCreature(AV_CPLACE_TRIGGER16);
}
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
@@ -116,21 +116,21 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
return;
}
m_CaptainAlive[1]=false;
RewardReputationToTeam(730,BG_AV_REP_CAPTAIN,ALLIANCE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN),ALLIANCE);
UpdateScore(HORDE,(-1)*BG_AV_RES_CAPTAIN);
RewardReputationToTeam(730, BG_AV_REP_CAPTAIN, ALLIANCE);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN), ALLIANCE);
UpdateScore(HORDE, (-1)*BG_AV_RES_CAPTAIN);
//spawn destroyed aura
for (uint8 i=0; i <= 9; i++)
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE+i,RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE+i, RESPAWN_IMMEDIATELY);
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature,GetTrinityString(LANG_BG_AV_H_CAPTAIN_DEAD),LANG_UNIVERSAL);
YellToAll(creature, GetTrinityString(LANG_BG_AV_H_CAPTAIN_DEAD), LANG_UNIVERSAL);
DelCreature(AV_CPLACE_TRIGGER18);
}
else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4][0])
ChangeMineOwner(AV_NORTH_MINE,killer->GetTeam());
ChangeMineOwner(AV_NORTH_MINE, killer->GetTeam());
else if (entry == BG_AV_CreatureInfo[AV_NPC_S_MINE_N_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_S_MINE_A_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_S_MINE_H_4][0])
ChangeMineOwner(AV_SOUTH_MINE,killer->GetTeam());
ChangeMineOwner(AV_SOUTH_MINE, killer->GetTeam());
}
void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
@@ -139,7 +139,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
return;//maybe we should log this, cause this must be a cheater or a big bug
uint8 team = GetTeamIndexByTeamId(player->GetTeam());
//TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed", questid);
switch(questid)
{
case AV_QUEST_A_SCRAPS1:
@@ -147,9 +147,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
case AV_QUEST_H_SCRAPS1:
case AV_QUEST_H_SCRAPS2:
m_Team_QuestStatus[team][0]+=20;
if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25,50,75 turn ins
if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25, 50, 75 turn ins
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..", questid);
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
{
@@ -162,23 +162,23 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
case AV_QUEST_A_COMMANDER1:
case AV_QUEST_H_COMMANDER1:
m_Team_QuestStatus[team][1]++;
RewardReputationToTeam(team,1,player->GetTeam());
RewardReputationToTeam(team, 1, player->GetTeam());
if (m_Team_QuestStatus[team][1] == 30)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
break;
case AV_QUEST_A_COMMANDER2:
case AV_QUEST_H_COMMANDER2:
m_Team_QuestStatus[team][2]++;
RewardReputationToTeam(team,1,player->GetTeam());
RewardReputationToTeam(team, 1, player->GetTeam());
if (m_Team_QuestStatus[team][2] == 60)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
break;
case AV_QUEST_A_COMMANDER3:
case AV_QUEST_H_COMMANDER3:
m_Team_QuestStatus[team][3]++;
RewardReputationToTeam(team,1,player->GetTeam());
RewardReputationToTeam(team, 1, player->GetTeam());
if (m_Team_QuestStatus[team][1] == 120)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
break;
case AV_QUEST_A_BOSS1:
case AV_QUEST_H_BOSS1:
@@ -187,16 +187,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
case AV_QUEST_H_BOSS2:
m_Team_QuestStatus[team][4]++;
if (m_Team_QuestStatus[team][4] >= 200)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
break;
case AV_QUEST_A_NEAR_MINE:
case AV_QUEST_H_NEAR_MINE:
m_Team_QuestStatus[team][5]++;
if (m_Team_QuestStatus[team][5] == 28)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
if (m_Team_QuestStatus[team][6] == 7)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
}
break;
case AV_QUEST_A_OTHER_MINE:
@@ -204,9 +204,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][6]++;
if (m_Team_QuestStatus[team][6] == 7)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
if (m_Team_QuestStatus[team][5] == 20)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
}
break;
case AV_QUEST_A_RIDER_HIDE:
@@ -214,9 +214,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][7]++;
if (m_Team_QuestStatus[team][7] == 25)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
if (m_Team_QuestStatus[team][8] == 25)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
}
break;
case AV_QUEST_A_RIDER_TAME:
@@ -224,13 +224,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][8]++;
if (m_Team_QuestStatus[team][8] == 25)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
if (m_Team_QuestStatus[team][7] == 25)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
}
break;
default:
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all", questid);
return; //was no interesting quest at all
break;
}
@@ -269,14 +269,14 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
{
type -= AV_CPLACE_MAX;
cinfoid=uint16(BG_AV_StaticCreaturePos[type][4]);
creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid][0],(type+AV_CPLACE_MAX),BG_AV_StaticCreatureInfo[cinfoid][1],BG_AV_StaticCreaturePos[type][0],BG_AV_StaticCreaturePos[type][1],BG_AV_StaticCreaturePos[type][2],BG_AV_StaticCreaturePos[type][3]);
level = (BG_AV_StaticCreatureInfo[cinfoid][2] == BG_AV_StaticCreatureInfo[cinfoid][3]) ? BG_AV_StaticCreatureInfo[cinfoid][2] : urand(BG_AV_StaticCreatureInfo[cinfoid][2],BG_AV_StaticCreatureInfo[cinfoid][3]);
creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid][0], (type+AV_CPLACE_MAX), BG_AV_StaticCreatureInfo[cinfoid][1], BG_AV_StaticCreaturePos[type][0], BG_AV_StaticCreaturePos[type][1], BG_AV_StaticCreaturePos[type][2], BG_AV_StaticCreaturePos[type][3]);
level = (BG_AV_StaticCreatureInfo[cinfoid][2] == BG_AV_StaticCreatureInfo[cinfoid][3]) ? BG_AV_StaticCreatureInfo[cinfoid][2] : urand(BG_AV_StaticCreatureInfo[cinfoid][2], BG_AV_StaticCreatureInfo[cinfoid][3]);
isStatic = true;
}
else
{
creature = AddCreature(BG_AV_CreatureInfo[cinfoid][0],type,BG_AV_CreatureInfo[cinfoid][1],BG_AV_CreaturePos[type][0],BG_AV_CreaturePos[type][1],BG_AV_CreaturePos[type][2],BG_AV_CreaturePos[type][3]);
level = (BG_AV_CreatureInfo[cinfoid][2] == BG_AV_CreatureInfo[cinfoid][3]) ? BG_AV_CreatureInfo[cinfoid][2] : urand(BG_AV_CreatureInfo[cinfoid][2],BG_AV_CreatureInfo[cinfoid][3]);
creature = AddCreature(BG_AV_CreatureInfo[cinfoid][0], type, BG_AV_CreatureInfo[cinfoid][1], BG_AV_CreaturePos[type][0], BG_AV_CreaturePos[type][1], BG_AV_CreaturePos[type][2], BG_AV_CreaturePos[type][3]);
level = (BG_AV_CreatureInfo[cinfoid][2] == BG_AV_CreatureInfo[cinfoid][3]) ? BG_AV_CreatureInfo[cinfoid][2] : urand(BG_AV_CreatureInfo[cinfoid][2], BG_AV_CreatureInfo[cinfoid][3]);
}
if (!creature)
return NULL;
@@ -329,7 +329,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
}
if (triggerSpawnID && newFaction)
{
if (Creature* trigger = AddCreature(WORLD_TRIGGER,triggerSpawnID,BG_AV_CreatureInfo[creature->GetEntry()][1],BG_AV_CreaturePos[triggerSpawnID][0],BG_AV_CreaturePos[triggerSpawnID][1],BG_AV_CreaturePos[triggerSpawnID][2],BG_AV_CreaturePos[triggerSpawnID][3]))
if (Creature* trigger = AddCreature(WORLD_TRIGGER, triggerSpawnID, BG_AV_CreatureInfo[creature->GetEntry()][1], BG_AV_CreaturePos[triggerSpawnID][0], BG_AV_CreaturePos[triggerSpawnID][1], BG_AV_CreaturePos[triggerSpawnID][2], BG_AV_CreaturePos[triggerSpawnID][3]))
{
trigger->setFaction(newFaction);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
@@ -355,19 +355,19 @@ void BattlegroundAV::Update(uint32 diff)
{
if (i == 0)
{
CastSpellOnTeam(AV_BUFF_A_CAPTAIN,ALLIANCE);
CastSpellOnTeam(AV_BUFF_A_CAPTAIN, ALLIANCE);
Creature* creature = GetBGCreature(AV_CPLACE_MAX + 61);
if (creature)
YellToAll(creature,LANG_BG_AV_A_CAPTAIN_BUFF,LANG_COMMON);
YellToAll(creature, LANG_BG_AV_A_CAPTAIN_BUFF, LANG_COMMON);
}
else
{
CastSpellOnTeam(AV_BUFF_H_CAPTAIN,HORDE);
CastSpellOnTeam(AV_BUFF_H_CAPTAIN, HORDE);
Creature* creature = GetBGCreature(AV_CPLACE_MAX + 59); //TODO: make the captains a dynamic creature
if (creature)
YellToAll(creature,LANG_BG_AV_H_CAPTAIN_BUFF,LANG_ORCISH);
YellToAll(creature, LANG_BG_AV_H_CAPTAIN_BUFF, LANG_ORCISH);
}
m_CaptainBuffTimer[i] = 120000 + urand(0,4)* 60000; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times
m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60000; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times
}
}
//add points from mine owning, and look if he neutral team wanrts to reclaim the mine
@@ -377,12 +377,12 @@ void BattlegroundAV::Update(uint32 diff)
if (m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE)
{
if (m_Mine_Timer <= 0)
UpdateScore(m_Mine_Owner[mine],1);
UpdateScore(m_Mine_Owner[mine], 1);
if (m_Mine_Reclaim_Timer[mine] > diff)
m_Mine_Reclaim_Timer[mine] -= diff;
else{ //we don't need to set this timer to 0 cause this codepart wont get called when this thing is 0
ChangeMineOwner(mine,AV_NEUTRAL_TEAM);
ChangeMineOwner(mine, AV_NEUTRAL_TEAM);
}
}
}
@@ -411,11 +411,11 @@ void BattlegroundAV::StartingEventOpenDoors()
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff");
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
SpawnBGObject(i,RESPAWN_IMMEDIATELY);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++)
SpawnBGObject(i,RESPAWN_IMMEDIATELY);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for (uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population
ChangeMineOwner(mine, AV_NEUTRAL_TEAM,true);
ChangeMineOwner(mine, AV_NEUTRAL_TEAM, true);
UpdateWorldState(AV_SHOW_H_SCORE, 1);
UpdateWorldState(AV_SHOW_A_SCORE, 1);
@@ -439,8 +439,8 @@ void BattlegroundAV::EndBattleground(uint32 winner)
{
//calculate bonuskills for both teams:
//first towers:
uint8 kills[2]={0,0}; //0=ally 1=horde
uint8 rep[2]={0,0}; //0=ally 1=horde
uint8 kills[2]={0, 0}; //0=ally 1=horde
uint8 rep[2]={0, 0}; //0=ally 1=horde
for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i)
{
if (m_Nodes[i].State == POINT_CONTROLED)
@@ -466,16 +466,16 @@ void BattlegroundAV::EndBattleground(uint32 winner)
rep[i] += BG_AV_REP_SURVIVING_CAPTAIN;
}
if (rep[i] != 0)
RewardReputationToTeam((i == 0)?730:729,rep[i],(i == 0)?ALLIANCE:HORDE);
RewardReputationToTeam((i == 0)?730:729, rep[i], (i == 0)?ALLIANCE:HORDE);
if (kills[i] != 0)
RewardHonorToTeam(GetBonusHonor(kills[i]),(i == 0)?ALLIANCE:HORDE);
RewardHonorToTeam(GetBonusHonor(kills[i]), (i == 0)?ALLIANCE:HORDE);
}
//TODO add enterevademode for all attacking creatures
Battleground::EndBattleground(winner);
}
void BattlegroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
void BattlegroundAV::RemovePlayer(Player* plr, uint64 /*guid*/)
{
if (!plr)
{
@@ -563,7 +563,7 @@ void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
((BattlegroundAVScore*)itr->second)->SecondaryObjectives += value;
break;
default:
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
break;
}
}
@@ -572,7 +572,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
{
uint32 object = GetObjectThroughNode(node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i",node,object);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i", node, object);
//despawn banner
SpawnBGObject(object, RESPAWN_ONE_DAY);
@@ -587,17 +587,17 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
if (m_BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp])
DelCreature(AV_CPLACE_A_MARSHAL_SOUTH + tmp);
else
sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist",AV_CPLACE_A_MARSHAL_SOUTH + tmp);
sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
//spawn destroyed aura
for (uint8 i=0; i <= 9; i++)
SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10),RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10), RESPAWN_IMMEDIATELY);
UpdateScore((owner == ALLIANCE) ? HORDE : ALLIANCE, (-1)*BG_AV_RES_TOWER);
RewardReputationToTeam((owner == ALLIANCE)?730:729,BG_AV_REP_TOWER,owner);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_TOWER),owner);
RewardReputationToTeam((owner == ALLIANCE)?730:729, BG_AV_REP_TOWER, owner);
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_TOWER), owner);
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp),RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp),RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp), RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp), RESPAWN_ONE_DAY);
}
else
{
@@ -605,28 +605,28 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
SpawnBGObject(object-11, RESPAWN_IMMEDIATELY);
else
SpawnBGObject(object+11, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node,RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_IMMEDIATELY);
PopulateNode(node);
if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
{
for (uint8 i = 0; i < 4; i++)
{
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i, RESPAWN_ONE_DAY);
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i, RESPAWN_IMMEDIATELY);
}
}
}
//send a nice message to all :)
char buf[256];
if (IsTower(node))
sprintf(buf, GetTrinityString(LANG_BG_AV_TOWER_TAKEN) , GetNodeName(node),(owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
sprintf(buf, GetTrinityString(LANG_BG_AV_TOWER_TAKEN) , GetNodeName(node), (owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
else
sprintf(buf, GetTrinityString(LANG_BG_AV_GRAVE_TAKEN) , GetNodeName(node),(owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) :GetTrinityString(LANG_BG_AV_HORDE));
sprintf(buf, GetTrinityString(LANG_BG_AV_GRAVE_TAKEN) , GetNodeName(node), (owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) :GetTrinityString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature,buf,LANG_UNIVERSAL);
YellToAll(creature, buf, LANG_UNIVERSAL);
}
void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
@@ -645,7 +645,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
if (!initial)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north,1=south)",mine);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north, 1=south)", mine);
if (mine == AV_SOUTH_MINE)
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
if (m_BgCreatures[i])
@@ -656,7 +656,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
}
SendMineWorldStates(mine);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north,1=south)",mine);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north, 1=south)", mine);
uint16 miner;
//also neutral team exists.. after a big time, the neutral team tries to conquer the mine
if (mine == AV_NORTH_MINE)
@@ -686,14 +686,14 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
else
cinfo = AV_NPC_S_MINE_N_S;
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
AddAVCreature(cinfo,i);
AddAVCreature(cinfo, i);
}
for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++)
AddAVCreature(miner,i);
AddAVCreature(miner, i);
//the next chooses randomly between 2 cretures
for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MIN:AV_CPLACE_MINE_S_2_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MAX:AV_CPLACE_MINE_S_2_MAX); i++)
AddAVCreature(miner+(urand(1,2)),i);
AddAVCreature(miner+3,(mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3);
AddAVCreature(miner+(urand(1, 2)), i);
AddAVCreature(miner+3, (mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3);
//because the gameobjects in this mine have changed, update all surrounding players:
// for (uint16 i = ((mine == AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MIN:BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i <= ((mine == AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MAX:BG_AV_OBJECT_MINE_SUPPLY_N_MAX); i++)
// {
@@ -706,7 +706,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
sprintf(buf, GetTrinityString(LANG_BG_AV_MINE_TAKEN), GetTrinityString((mine == AV_NORTH_MINE) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH), (team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature,buf,LANG_UNIVERSAL);
YellToAll(creature, buf, LANG_UNIVERSAL);
}
else
{
@@ -719,7 +719,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
return;
}
bool BattlegroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team)
bool BattlegroundAV::PlayerCanDoMineQuest(int32 GOId, uint32 team)
{
if (GOId == BG_AV_OBJECTID_MINE_N)
return (m_Mine_Owner[AV_NORTH_MINE] == team);
@@ -752,17 +752,17 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
if (m_BgCreatures[node])
DelCreature(node);
if (!AddSpiritGuide(node, BG_AV_CreaturePos[node][0], BG_AV_CreaturePos[node][1], BG_AV_CreaturePos[node][2], BG_AV_CreaturePos[node][3], owner))
sLog->outError("AV: couldn't spawn spiritguide at node %i",node);
sLog->outError("AV: couldn't spawn spiritguide at node %i", node);
}
for (uint8 i=0; i<4; i++)
AddAVCreature(creatureid,c_place+i);
AddAVCreature(creatureid, c_place+i);
if (node >= BG_AV_NODES_MAX)//fail safe
return;
Creature* trigger = GetBGCreature(node + 302);//0-302 other creatures
if (!trigger)
trigger = AddCreature(WORLD_TRIGGER,node + 302,owner,BG_AV_CreaturePos[node + 302][0],BG_AV_CreaturePos[node + 302][1],BG_AV_CreaturePos[node + 302][2],BG_AV_CreaturePos[node + 302][3]);
trigger = AddCreature(WORLD_TRIGGER, node + 302, owner, BG_AV_CreaturePos[node + 302][0], BG_AV_CreaturePos[node + 302][1], BG_AV_CreaturePos[node + 302][2], BG_AV_CreaturePos[node + 302][3]);
//add bonus honor aura trigger creature when node is accupied
//cast bonus aura (+50% honor in 25yards)
@@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i",object);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i", object);
if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER)
return BG_AV_Nodes(object);
if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT)
@@ -817,7 +817,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
{ //this function is the counterpart to GetNodeThroughObject()
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i",node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i", node);
if (m_Nodes[node].Owner == ALLIANCE)
{
if (m_Nodes[node].State == POINT_ASSAULTED)
@@ -848,7 +848,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
}
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i",node);
sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
ASSERT(false);
return 0;
}
@@ -860,7 +860,7 @@ void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
if (GetStatus() != STATUS_IN_PROGRESS)
return;
int32 object = GetObjectType(target_obj->GetGUID());
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV using gameobject %i with type %i", target_obj->GetEntry(), object);
if (object < 0)
return;
switch(target_obj->GetEntry())
@@ -896,13 +896,13 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM)
{ //until snowfall doesn't belong to anyone it is better handled in assault-code
ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); //currently the only neutral grave
EventPlayerAssaultsPoint(player,object);
EventPlayerAssaultsPoint(player, object);
return;
}
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i",object,node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node);
if (m_Nodes[node].PrevOwner != team)
{
sLog->outError("BG_AV: player defends point which doesn't belong to his team %i",node);
sLog->outError("BG_AV: player defends point which doesn't belong to his team %i", node);
return;
}
@@ -914,38 +914,38 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
if (!IsTower(node))
{
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(team)+3*node,RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(team)+3*node, RESPAWN_IMMEDIATELY);
}
// despawn old go
SpawnBGObject(object, RESPAWN_ONE_DAY);
DefendNode(node,team);
DefendNode(node, team);
PopulateNode(node);
UpdateNodeWorldState(node);
if (IsTower(node))
{
//spawn big flag+aura on top of tower
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
}
else if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
{
for (uint8 i = 0; i < 4; i++)
{
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
SpawnBGObject(((team == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i, RESPAWN_ONE_DAY);
SpawnBGObject(((team == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i, RESPAWN_IMMEDIATELY);
}
}
//send a nice message to all :)
char buf[256];
sprintf(buf, GetTrinityString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node),(team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
sprintf(buf, GetTrinityString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature,buf,LANG_UNIVERSAL);
YellToAll(creature, buf, LANG_UNIVERSAL);
//update the statistic for the defending player
UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1);
if (IsTower(node))
@@ -961,7 +961,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
BG_AV_Nodes node = GetNodeThroughObject(object);
uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner
uint32 team = player->GetTeam();
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i",object,node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i", object, node);
if (owner == team || team == m_Nodes[node].TotalOwner)
return; //surely a gm used this object
@@ -974,7 +974,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
SpawnBGObject(BG_AV_OBJECT_FLAG_C_A_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY);
else
SpawnBGObject(BG_AV_OBJECT_FLAG_C_H_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_IMMEDIATELY); //neutral aura spawn
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_IMMEDIATELY); //neutral aura spawn
}
else if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) //recapping, when no team owns this node realy
{
@@ -985,7 +985,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
SpawnBGObject(object+11, RESPAWN_IMMEDIATELY);
}
//eyecandy
uint32 spawn,despawn;
uint32 spawn, despawn;
if (team == ALLIANCE)
{
despawn = (m_Nodes[node].State == POINT_ASSAULTED)?BG_AV_OBJECT_SNOW_EYECANDY_PH : BG_AV_OBJECT_SNOW_EYECANDY_H;
@@ -998,8 +998,8 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
}
for (uint8 i = 0; i < 4; i++)
{
SpawnBGObject(despawn+i,RESPAWN_ONE_DAY);
SpawnBGObject(spawn+i,RESPAWN_IMMEDIATELY);
SpawnBGObject(despawn+i, RESPAWN_ONE_DAY);
SpawnBGObject(spawn+i, RESPAWN_IMMEDIATELY);
}
}
@@ -1013,16 +1013,16 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
SpawnBGObject(object+22, RESPAWN_IMMEDIATELY);
if (IsTower(node))
{ //spawning/despawning of bigflag+aura
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
}
else
{
//spawning/despawning of aura
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_IMMEDIATELY); //neutral aura spawn
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node,RESPAWN_ONE_DAY); //teeamaura despawn
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_IMMEDIATELY); //neutral aura spawn
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_ONE_DAY); //teeamaura despawn
// Those who are waiting to resurrect at this object are taken to the closest own object's graveyard
std::vector<uint64> ghost_list = m_ReviveQueue[m_BgCreatures[node]];
if (!ghost_list.empty())
@@ -1046,7 +1046,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
}
SpawnBGObject(object, RESPAWN_ONE_DAY); //delete old banner
AssaultNode(node,team);
AssaultNode(node, team);
UpdateNodeWorldState(node);
//send a nice message to all :)
@@ -1054,7 +1054,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
sprintf(buf, (IsTower(node)) ? GetTrinityString(LANG_BG_AV_TOWER_ASSAULTED) : GetTrinityString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature,buf,LANG_UNIVERSAL);
YellToAll(creature, buf, LANG_UNIVERSAL);
//update the statistic for the assaulting player
UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_ASSAULTED : SCORE_GRAVEYARDS_ASSAULTED, 1);
PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_ASSAULTS:AV_SOUND_HORDE_ASSAULTS);
@@ -1069,8 +1069,8 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
for (uint8 j =1; j <= 3; j+=2)
{//j=1=assaulted j=3=controled
stateok = (m_Nodes[i].State == j);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0);
}
}
@@ -1079,8 +1079,8 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
for (uint8 j =1; j <= 3; j+=2)
{//j=1=assaulted j=3=controled //i dont have j=2=destroyed cause destroyed is the same like enemy-team controll
stateok = (m_Nodes[i].State == j || (m_Nodes[i].State == POINT_DESTROYED && j == 3));
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0);
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0);
}
if (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].Owner == AV_NEUTRAL_TEAM) //cause neutral teams aren't handled generic
data << uint32(AV_SNOWFALL_N) << uint32(1);
@@ -1118,17 +1118,17 @@ uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used
if (state == POINT_ASSAULTED)
return 3;
}
sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i",state,team);
sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i", state, team);
return 5; //this will crash the game, but i want to know if something is wrong here
}
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 == AV_NEUTRAL_TEAM) //currently only snowfall is supported as neutral node (i don't want to make an extra row (neutral states) in worldstatesarray just for one node
UpdateWorldState(AV_SNOWFALL_N,0);
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)
@@ -1138,7 +1138,7 @@ void BattlegroundAV::SendMineWorldStates(uint32 mine)
// ASSERT(m_Mine_PrevOwner[mine] == ALLIANCE || m_Mine_PrevOwner[mine] == HORDE || m_Mine_PrevOwner[mine] == AV_NEUTRAL_TEAM);
// ASSERT(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE || m_Mine_Owner[mine] == AV_NEUTRAL_TEAM);
uint8 owner,prevowner,mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array
uint8 owner, prevowner, mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array
mine2 = (mine == AV_NORTH_MINE)?0:1;
if (m_Mine_PrevOwner[mine] == ALLIANCE)
prevowner = 0;
@@ -1153,9 +1153,9 @@ void BattlegroundAV::SendMineWorldStates(uint32 mine)
else
owner = 1;
UpdateWorldState(BG_AV_MineWorldStates[mine2][owner],1);
UpdateWorldState(BG_AV_MineWorldStates[mine2][owner], 1);
if (prevowner != owner)
UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner],0);
UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner], 0);
}
WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveYard(Player* player)
@@ -1193,9 +1193,9 @@ bool BattlegroundAV::SetupBattleground()
// Create starting objects
if (
// alliance gates
!AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0][0],BG_AV_DoorPositons[0][1],BG_AV_DoorPositons[0][2],BG_AV_DoorPositons[0][3],0,0,sin(BG_AV_DoorPositons[0][3]/2),cos(BG_AV_DoorPositons[0][3]/2),RESPAWN_IMMEDIATELY)
!AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0][0], BG_AV_DoorPositons[0][1], BG_AV_DoorPositons[0][2], BG_AV_DoorPositons[0][3], 0, 0, sin(BG_AV_DoorPositons[0][3]/2), cos(BG_AV_DoorPositons[0][3]/2), RESPAWN_IMMEDIATELY)
// horde gates
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0],BG_AV_DoorPositons[1][1],BG_AV_DoorPositons[1][2],BG_AV_DoorPositons[1][3],0,0,sin(BG_AV_DoorPositons[1][3]/2),cos(BG_AV_DoorPositons[1][3]/2),RESPAWN_IMMEDIATELY))
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0], BG_AV_DoorPositons[1][1], BG_AV_DoorPositons[1][2], BG_AV_DoorPositons[1][3], 0, 0, sin(BG_AV_DoorPositons[1][3]/2), cos(BG_AV_DoorPositons[1][3]/2), RESPAWN_IMMEDIATELY))
{
sLog->outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1");
return false;
@@ -1206,14 +1206,14 @@ bool BattlegroundAV::SetupBattleground()
{
if (i <= BG_AV_NODES_FROSTWOLF_HUT)
{
if (!AddObject(i,BG_AV_OBJECTID_BANNER_A_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(i+11,BG_AV_OBJECTID_BANNER_CONT_A_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(i+33,BG_AV_OBJECTID_BANNER_H_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(i+22,BG_AV_OBJECTID_BANNER_CONT_H_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
if (!AddObject(i, BG_AV_OBJECTID_BANNER_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(i+11, BG_AV_OBJECTID_BANNER_CONT_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(i+33, BG_AV_OBJECTID_BANNER_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(i+22, BG_AV_OBJECTID_BANNER_CONT_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
//aura
|| !AddObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_N,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY))
|| !AddObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!2");
return false;
@@ -1223,12 +1223,12 @@ bool BattlegroundAV::SetupBattleground()
{
if (i <= BG_AV_NODES_STONEHEART_BUNKER) //alliance towers
{
if (!AddObject(i,BG_AV_OBJECTID_BANNER_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(i+22,BG_AV_OBJECTID_BANNER_CONT_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_A,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_N,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_A,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PH,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(i, BG_AV_OBJECTID_BANNER_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(i+22, BG_AV_OBJECTID_BANNER_CONT_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_A, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PH, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!3");
return false;
@@ -1236,12 +1236,12 @@ bool BattlegroundAV::SetupBattleground()
}
else //horde towers
{
if (!AddObject(i+7,BG_AV_OBJECTID_BANNER_CONT_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(i+29,BG_AV_OBJECTID_BANNER_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_N,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_H,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PA,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_H,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(i+7, BG_AV_OBJECTID_BANNER_CONT_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(i+29, BG_AV_OBJECTID_BANNER_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PA, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_H, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!4");
return false;
@@ -1249,9 +1249,9 @@ bool BattlegroundAV::SetupBattleground()
}
for (uint8 j=0; j <= 9; j++) //burning aura
{
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i",i);
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
return false;
}
}
@@ -1263,17 +1263,17 @@ bool BattlegroundAV::SetupBattleground()
{
if (j<5)
{
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_SMOKE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_SMOKE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i",i);
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
return false;
}
}
else
{
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i",i);
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
return false;
}
}
@@ -1281,34 +1281,34 @@ bool BattlegroundAV::SetupBattleground()
}
for (uint16 i= 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_N_MAX-BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i++)
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i,BG_AV_OBJECTID_MINE_N,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i, BG_AV_OBJECTID_MINE_N, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i",i);
sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
return false;
}
}
for (uint16 i= 0 ; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++)
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i,BG_AV_OBJECTID_MINE_S,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2),RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i",i);
sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
return false;
}
}
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N ,BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3],0,0,sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N , BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3], 0, 0, sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
return false;
}
for (uint8 i = 0; i < 4; i++)
{
if (!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A+i, BG_AV_OBJECTID_SNOWFALL_CANDY_A ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY))
if (!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A+i, BG_AV_OBJECTID_SNOWFALL_CANDY_A , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY))
{
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i",i);
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
return false;
}
}
@@ -1319,7 +1319,7 @@ bool BattlegroundAV::SetupBattleground()
for (i = 0; i < BG_AV_OBJECT_MAX; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i,RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i, RESPAWN_IMMEDIATELY);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++)
@@ -1327,7 +1327,7 @@ bool BattlegroundAV::SetupBattleground()
for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
if (i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT)
SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i),RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i), RESPAWN_IMMEDIATELY);
}
for (i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2)
{
@@ -1342,7 +1342,7 @@ bool BattlegroundAV::SetupBattleground()
//snowfall and the doors
for (i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY);
//creatures
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes");
@@ -1354,7 +1354,7 @@ bool BattlegroundAV::SetupBattleground()
//all creatures which don't get despawned through the script are static
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures");
for (i=0; i < AV_STATICCPLACE_MAX; i++)
AddAVCreature(0,i+AV_CPLACE_MAX);
AddAVCreature(0, i+AV_CPLACE_MAX);
//mainspiritguides:
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures");
AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE);
@@ -1362,8 +1362,8 @@ bool BattlegroundAV::SetupBattleground()
//spawn the marshals (those who get deleted, if a tower gets destroyed)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures");
for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++)
AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH));
AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD);
AddAVCreature(i, AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH));
AddAVCreature(AV_NPC_HERALD, AV_CPLACE_HERALD);
return true;
}
@@ -1387,7 +1387,7 @@ const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
case BG_AV_NODES_FROSTWOLF_WTOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_W);
case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
default:
sLog->outError("tried to get name for node %u",node);
sLog->outError("tried to get name for node %u", node);
break;
}
@@ -1469,19 +1469,19 @@ void BattlegroundAV::ResetBGSubclass()
m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS;
m_IsInformedNearVictory[i]=false;
m_CaptainAlive[i] = true;
m_CaptainBuffTimer[i] = 120000 + urand(0,4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times
m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times
m_Mine_Owner[i] = AV_NEUTRAL_TEAM;
m_Mine_PrevOwner[i] = m_Mine_Owner[i];
}
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_STONEHEART_GRAVE; ++i) //alliance graves
InitNode(i,ALLIANCE,false);
InitNode(i, ALLIANCE, false);
for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers
InitNode(i,ALLIANCE,true);
InitNode(i, ALLIANCE, true);
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_GRAVE; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) //horde graves
InitNode(i,HORDE,false);
InitNode(i, HORDE, false);
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) //horde towers
InitNode(i,HORDE,true);
InitNode(BG_AV_NODES_SNOWFALL_GRAVE,AV_NEUTRAL_TEAM,false); //give snowfall neutral owner
InitNode(i, HORDE, true);
InitNode(BG_AV_NODES_SNOWFALL_GRAVE, AV_NEUTRAL_TEAM, false); //give snowfall neutral owner
m_Mine_Timer=AV_MINE_TICK_TIMER;
for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
File diff suppressed because it is too large Load Diff
@@ -107,7 +107,7 @@ void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer)
return;
}
Battleground::HandleKillPlayer(player,killer);
Battleground::HandleKillPlayer(player, killer);
UpdateArenaWorldState();
CheckArenaWinConditions();
@@ -115,7 +115,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;
}
@@ -142,7 +142,7 @@ void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
// HandleTriggerBuff(buff_guid, Source);
}
void BattlegroundBE::FillInitialWorldStates(WorldPacket &data)
@@ -183,7 +183,7 @@ void BattlegroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
return;
//there is nothing special in this score
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
}
@@ -130,7 +130,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
return;
}
Battleground::HandleKillPlayer(player,killer);
Battleground::HandleKillPlayer(player, killer);
UpdateArenaWorldState();
CheckArenaWinConditions();
@@ -569,7 +569,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
if (obj)
obj->Delete();
else
sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID()));
SetDroppedFlagGUID(0);
}
@@ -687,9 +687,9 @@ void BattlegroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
m_PointState[Point] = EY_POINT_NO_OWNER;
if (Team == ALLIANCE)
SendMessageToAll(m_LosingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
SendMessageToAll(m_LosingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
else
SendMessageToAll(m_LosingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
SendMessageToAll(m_LosingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source);
UpdatePointsIcons(Team, Point);
UpdatePointsCount(Team);
@@ -731,9 +731,9 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
m_PointState[Point] = EY_POINT_UNDER_CONTROL;
if (Team == ALLIANCE)
SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source);
else
SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source);
SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source);
if (m_BgCreatures[Point])
DelCreature(Point);
@@ -744,7 +744,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
sLog->outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
// SpawnBGCreature(Point,RESPAWN_IMMEDIATELY);
// SpawnBGCreature(Point, RESPAWN_IMMEDIATELY);
UpdatePointsIcons(Team, Point);
UpdatePointsCount(Team);
@@ -754,7 +754,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
Creature* trigger = GetBGCreature(Point + 6);//0-5 spirit guides
if (!trigger)
trigger = AddCreature(WORLD_TRIGGER,Point+6,Team,BG_EY_TriggerPositions[Point][0],BG_EY_TriggerPositions[Point][1],BG_EY_TriggerPositions[Point][2],BG_EY_TriggerPositions[Point][3]);
trigger = AddCreature(WORLD_TRIGGER, Point+6, Team, BG_EY_TriggerPositions[Point][0], BG_EY_TriggerPositions[Point][1], BG_EY_TriggerPositions[Point][2], BG_EY_TriggerPositions[Point][3]);
//add bonus honor aura trigger creature when node is accupied
//cast bonus aura (+50% honor in 25yards)
@@ -910,7 +910,7 @@ WorldSafeLocsEntry const *BattlegroundEY::GetClosestGraveYard(Player* player)
{
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
if (!entry)
sLog->outError("BattlegroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
sLog->outError("BattlegroundEY: Not found graveyard: %u", m_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);
@@ -348,7 +348,7 @@ class BattlegroundEY : public Battleground
void RespawnFlag(bool send_message);
void RespawnFlagAfterDrop();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, uint64 guid);
void HandleBuffUse(uint64 const& buff_guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void HandleKillPlayer(Player *player, Player *killer);
@@ -63,10 +63,10 @@ BattlegroundIC::~BattlegroundIC()
void BattlegroundIC::HandlePlayerResurrect(Player* player)
{
if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
player->CastSpell(player,SPELL_QUARRY,true);
player->CastSpell(player, SPELL_QUARRY, true);
if (nodePoint[NODE_TYPE_REFINERY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
player->CastSpell(player,SPELL_OIL_REFINERY,true);
player->CastSpell(player, SPELL_OIL_REFINERY, true);
}
void BattlegroundIC::SendTransportInit(Player* player)
@@ -95,8 +95,8 @@ void BattlegroundIC::DoAction(uint32 action, uint64 var)
if (!plr || !gunshipAlliance || !gunshipHorde)
return;
plr->CastSpell(plr,SPELL_PARACHUTE,true); // this must be changed, there is a trigger in each transport that casts the spell.
plr->CastSpell(plr,SPELL_SLOW_FALL,true);
plr->CastSpell(plr, SPELL_PARACHUTE, true); // this must be changed, there is a trigger in each transport that casts the spell.
plr->CastSpell(plr, SPELL_SLOW_FALL, true);
plr->SetTransport(plr->GetTeamId() == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde);
@@ -105,7 +105,7 @@ void BattlegroundIC::DoAction(uint32 action, uint64 var)
plr->m_movementInfo.t_pos.m_positionZ = TransportMovementInfo.GetPositionZ();
plr->m_movementInfo.t_guid = (plr->GetTeamId() == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->GetGUID();
plr->TeleportTo(GetMapId(),TeleportToTransportPosition.GetPositionX(),TeleportToTransportPosition.GetPositionY(),TeleportToTransportPosition.GetPositionZ(),TeleportToTransportPosition.GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT);
plr->TeleportTo(GetMapId(), TeleportToTransportPosition.GetPositionX(), TeleportToTransportPosition.GetPositionY(), TeleportToTransportPosition.GetPositionZ(), TeleportToTransportPosition.GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
}
void BattlegroundIC::Update(uint32 diff)
@@ -148,7 +148,7 @@ void BattlegroundIC::Update(uint32 diff)
}
}
// we need to confirm this is blizzlike,not sure if it is every 3 minutes
// we need to confirm this is blizzlike, not sure if it is every 3 minutes
for (uint8 u = (nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_A : BG_IC_NPC_GLAIVE_THROWER_1_H); u < (nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_2_A : BG_IC_NPC_GLAIVE_THROWER_2_H); u++)
{
if (Creature* glaiveThrower = GetBGCreature(u))
@@ -176,9 +176,9 @@ void BattlegroundIC::Update(uint32 diff)
{
if (siege->isAlive())
{
if (siege->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE))
if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE))
// following sniffs the vehicle always has UNIT_FLAG_UNK_14
siege->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_OOC_NOT_ATTACKABLE);
siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_OOC_NOT_ATTACKABLE);
else
siege->SetHealth(siege->GetMaxHealth());
}
@@ -205,7 +205,7 @@ void BattlegroundIC::Update(uint32 diff)
{
if (nodePoint[i].timer <= diff)
{
uint32 nextBanner = GetNextBanner(&nodePoint[i],nodePoint[i].faction,true);
uint32 nextBanner = GetNextBanner(&nodePoint[i], nodePoint[i].faction, true);
nodePoint[i].last_entry = nodePoint[i].gameobject_entry;
nodePoint[i].gameobject_entry = nextBanner;
@@ -219,14 +219,14 @@ void BattlegroundIC::Update(uint32 diff)
float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() };
DelObject(nodePoint[i].gameobject_type);
AddObject(nodePoint[i].gameobject_type,nodePoint[i].gameobject_entry,cords[0],cords[1],cords[2],cords[3],0,0,0,0,RESPAWN_ONE_DAY);
AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(nodePoint[i].gameobject_type)->SetUInt32Value(GAMEOBJECT_FACTION, nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]);
UpdateNodeWorldState(&nodePoint[i]);
HandleCapturedNodes(&nodePoint[i],false);
HandleCapturedNodes(&nodePoint[i], false);
SendMessage2ToAll(LANG_BG_IC_TEAM_HAS_TAKEN_NODE,CHAT_MSG_BG_SYSTEM_NEUTRAL,NULL,(nodePoint[i].faction == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE),nodePoint[i].string);
SendMessage2ToAll(LANG_BG_IC_TEAM_HAS_TAKEN_NODE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (nodePoint[i].faction == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE), nodePoint[i].string);
nodePoint[i].needChange = false;
nodePoint[i].timer = BANNER_STATE_CHANGE_TIME;
@@ -242,7 +242,7 @@ void BattlegroundIC::Update(uint32 diff)
nodePoint[i].nodeState == NODE_STATE_CONTROLLED_H)
{
factionReinforcements[nodePoint[i].faction] += 1;
RewardHonorToTeam(RESOURCE_HONOR_AMOUNT,nodePoint[i].faction == TEAM_ALLIANCE ? ALLIANCE : HORDE);
RewardHonorToTeam(RESOURCE_HONOR_AMOUNT, nodePoint[i].faction == TEAM_ALLIANCE ? ALLIANCE : HORDE);
UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[nodePoint[i].faction]);
}
}
@@ -272,11 +272,11 @@ void BattlegroundIC::StartingEventOpenDoors()
for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTERS_SPAWNS; i++)
{
if (!AddObject(BG_IC_Teleporters[i].type,BG_IC_Teleporters[i].entry,
BG_IC_Teleporters[i].x,BG_IC_Teleporters[i].y,
BG_IC_Teleporters[i].z,BG_IC_Teleporters[i].o,
0,0,0,0,RESPAWN_ONE_DAY))
sLog->outError("Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u",BG_IC_Teleporters[i].entry);
if (!AddObject(BG_IC_Teleporters[i].type, BG_IC_Teleporters[i].entry,
BG_IC_Teleporters[i].x, BG_IC_Teleporters[i].y,
BG_IC_Teleporters[i].z, BG_IC_Teleporters[i].o,
0, 0, 0, 0, RESPAWN_ONE_DAY))
sLog->outError("Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
}
}
@@ -302,10 +302,10 @@ void BattlegroundIC::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
if (nodePoint[NODE_TYPE_QUARRY].nodeState == (plr->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
plr->CastSpell(plr,SPELL_QUARRY,true);
plr->CastSpell(plr, SPELL_QUARRY, true);
if (nodePoint[NODE_TYPE_REFINERY].nodeState == (plr->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H))
plr->CastSpell(plr,SPELL_OIL_REFINERY,true);
plr->CastSpell(plr, SPELL_OIL_REFINERY, true);
SendTransportInit(plr);
}
@@ -339,7 +339,7 @@ void BattlegroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
((BattlegroundICScore*)itr->second)->BasesDefended += value;
break;
default:
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
break;
}
}
@@ -353,7 +353,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPacket& data)
for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; i++)
{
uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry,(GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED ? true : false));
uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry, (GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED ? true : false));
data << uint32(uws) << uint32(1);
}
@@ -365,39 +365,39 @@ bool BattlegroundIC::SetupBattleground()
{
for (uint8 i = 0; i < MAX_NORMAL_GAMEOBJECTS_SPAWNS; i++)
{
if (!AddObject(BG_IC_ObjSpawnlocs[i].type,BG_IC_ObjSpawnlocs[i].entry,
BG_IC_ObjSpawnlocs[i].x,BG_IC_ObjSpawnlocs[i].y,
BG_IC_ObjSpawnlocs[i].z,BG_IC_ObjSpawnlocs[i].o,
0,0,0,0,RESPAWN_ONE_DAY))
if (!AddObject(BG_IC_ObjSpawnlocs[i].type, BG_IC_ObjSpawnlocs[i].entry,
BG_IC_ObjSpawnlocs[i].x, BG_IC_ObjSpawnlocs[i].y,
BG_IC_ObjSpawnlocs[i].z, BG_IC_ObjSpawnlocs[i].o,
0, 0, 0, 0, RESPAWN_ONE_DAY))
{
sLog->outError("Isle of Conquest: There was an error spawning gameobject %u",BG_IC_ObjSpawnlocs[i].entry);
sLog->outError("Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry);
return false;
}
}
for (uint8 i = 0; i < MAX_NORMAL_NPCS_SPAWNS; i++)
{
if (!AddCreature(BG_IC_NpcSpawnlocs[i].entry,BG_IC_NpcSpawnlocs[i].type,BG_IC_NpcSpawnlocs[i].team,
BG_IC_NpcSpawnlocs[i].x,BG_IC_NpcSpawnlocs[i].y,
BG_IC_NpcSpawnlocs[i].z,BG_IC_NpcSpawnlocs[i].o,
if (!AddCreature(BG_IC_NpcSpawnlocs[i].entry, BG_IC_NpcSpawnlocs[i].type, BG_IC_NpcSpawnlocs[i].team,
BG_IC_NpcSpawnlocs[i].x, BG_IC_NpcSpawnlocs[i].y,
BG_IC_NpcSpawnlocs[i].z, BG_IC_NpcSpawnlocs[i].o,
RESPAWN_ONE_DAY))
{
sLog->outError("Isle of Conquest: There was an error spawning creature %u",BG_IC_NpcSpawnlocs[i].entry);
sLog->outError("Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry);
return false;
}
}
if (!AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+5,BG_IC_SpiritGuidePos[5][0], BG_IC_SpiritGuidePos[5][1],BG_IC_SpiritGuidePos[5][2], BG_IC_SpiritGuidePos[5][3],ALLIANCE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+6,BG_IC_SpiritGuidePos[6][0], BG_IC_SpiritGuidePos[6][1],BG_IC_SpiritGuidePos[6][2], BG_IC_SpiritGuidePos[6][3],HORDE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+3,BG_IC_SpiritGuidePos[7][0], BG_IC_SpiritGuidePos[7][1],BG_IC_SpiritGuidePos[7][2], BG_IC_SpiritGuidePos[7][3],ALLIANCE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+4,BG_IC_SpiritGuidePos[8][0], BG_IC_SpiritGuidePos[8][1],BG_IC_SpiritGuidePos[8][2], BG_IC_SpiritGuidePos[8][3],HORDE))
if (!AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+5, BG_IC_SpiritGuidePos[5][0], BG_IC_SpiritGuidePos[5][1], BG_IC_SpiritGuidePos[5][2], BG_IC_SpiritGuidePos[5][3], ALLIANCE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+6, BG_IC_SpiritGuidePos[6][0], BG_IC_SpiritGuidePos[6][1], BG_IC_SpiritGuidePos[6][2], BG_IC_SpiritGuidePos[6][3], HORDE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+3, BG_IC_SpiritGuidePos[7][0], BG_IC_SpiritGuidePos[7][1], BG_IC_SpiritGuidePos[7][2], BG_IC_SpiritGuidePos[7][3], ALLIANCE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+4, BG_IC_SpiritGuidePos[8][0], BG_IC_SpiritGuidePos[8][1], BG_IC_SpiritGuidePos[8][2], BG_IC_SpiritGuidePos[8][3], HORDE))
{
sLog->outError("Isle of Conquest: Failed to spawn initial spirit guide!");
return false;
}
gunshipHorde = CreateTransport(GO_HORDE_GUNSHIP,TRANSPORT_PERIOD_TIME);
gunshipAlliance = CreateTransport(GO_ALLIANCE_GUNSHIP,TRANSPORT_PERIOD_TIME);
gunshipHorde = CreateTransport(GO_HORDE_GUNSHIP, TRANSPORT_PERIOD_TIME);
gunshipAlliance = CreateTransport(GO_ALLIANCE_GUNSHIP, TRANSPORT_PERIOD_TIME);
if (!gunshipAlliance || !gunshipHorde)
{
@@ -433,19 +433,19 @@ void BattlegroundIC::HandleKillUnit(Creature *unit, Player* killer)
uint32 entry = unit->GetEntry();
if (entry == NPC_HIGH_COMMANDER_HALFORD_WYRMBANE)
{
RewardHonorToTeam(WINNER_HONOR_AMOUNT,HORDE);
RewardHonorToTeam(WINNER_HONOR_AMOUNT, HORDE);
EndBattleground(HORDE);
}
else if (entry == NPC_OVERLORD_AGMAR)
{
RewardHonorToTeam(WINNER_HONOR_AMOUNT,ALLIANCE);
RewardHonorToTeam(WINNER_HONOR_AMOUNT, ALLIANCE);
EndBattleground(ALLIANCE);
}
//Achievement Mowed Down
// TO-DO: This should be done on the script of each vehicle of the BG.
if (unit->IsVehicle())
killer->CastSpell(killer,SPELL_DESTROYED_VEHICLE_ACHIEVEMENT,true);
killer->CastSpell(killer, SPELL_DESTROYED_VEHICLE_ACHIEVEMENT, true);
}
void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer)
@@ -466,7 +466,7 @@ void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer)
void BattlegroundIC::EndBattleground(uint32 winner)
{
SendMessage2ToAll(LANG_BG_IC_TEAM_WINS,CHAT_MSG_BG_SYSTEM_NEUTRAL,NULL, (winner == ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE));
SendMessage2ToAll(LANG_BG_IC_TEAM_WINS, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (winner == ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE));
Battleground::EndBattleground(winner);
}
@@ -507,7 +507,7 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
if (nodePoint[i].faction == player->GetTeamId())
return;
uint32 nextBanner = GetNextBanner(&nodePoint[i],player->GetTeamId(),false);
uint32 nextBanner = GetNextBanner(&nodePoint[i], player->GetTeamId(), false);
// we set the new settings of the nodePoint
nodePoint[i].faction = player->GetTeamId();
@@ -531,8 +531,8 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
UpdatePlayerScore(player, SCORE_BASES_ASSAULTED, 1);
SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_1,CHAT_MSG_BG_SYSTEM_NEUTRAL,player,nodePoint[i].string);
SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_2,CHAT_MSG_BG_SYSTEM_NEUTRAL,player,nodePoint[i].string, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE));
SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_1, CHAT_MSG_BG_SYSTEM_NEUTRAL, player, nodePoint[i].string);
SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_2, CHAT_MSG_BG_SYSTEM_NEUTRAL, player, nodePoint[i].string, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE));
HandleContestedNodes(&nodePoint[i]);
} else if (nextBanner == nodePoint[i].banners[BANNER_A_CONTROLLED] ||
nextBanner == nodePoint[i].banners[BANNER_H_CONTROLLED])
@@ -540,8 +540,8 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
{
nodePoint[i].timer = BANNER_STATE_CHANGE_TIME;
nodePoint[i].needChange = false;
SendMessage2ToAll(LANG_BG_IC_TEAM_DEFENDED_NODE,CHAT_MSG_BG_SYSTEM_NEUTRAL,player,nodePoint[i].string);
HandleCapturedNodes(&nodePoint[i],true);
SendMessage2ToAll(LANG_BG_IC_TEAM_DEFENDED_NODE, CHAT_MSG_BG_SYSTEM_NEUTRAL, player, nodePoint[i].string);
HandleCapturedNodes(&nodePoint[i], true);
UpdatePlayerScore(player, SCORE_BASES_DEFENDED, 1);
}
@@ -553,7 +553,7 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() };
DelObject(nodePoint[i].gameobject_type);
AddObject(nodePoint[i].gameobject_type,nodePoint[i].gameobject_entry,cords[0],cords[1],cords[2],cords[3],0,0,0,0,RESPAWN_ONE_DAY);
AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(nodePoint[i].gameobject_type)->SetUInt32Value(GAMEOBJECT_FACTION, nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]);
@@ -587,9 +587,9 @@ void BattlegroundIC::UpdateNodeWorldState(ICNodePoint* nodePoint)
// with this we are sure we dont bug the client
for (uint8 i = 0; i < 4; i++)
UpdateWorldState(nodePoint->worldStates[i],0);
UpdateWorldState(nodePoint->worldStates[i], 0);
UpdateWorldState(worldstate,1);
UpdateWorldState(worldstate, 1);
}
uint32 BattlegroundIC::GetNextBanner(ICNodePoint* nodePoint, uint32 team, bool returnDefinitve)
@@ -637,7 +637,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
BG_IC_SpiritGuidePos[nodePoint->nodeType][0], BG_IC_SpiritGuidePos[nodePoint->nodeType][1],
BG_IC_SpiritGuidePos[nodePoint->nodeType][2], BG_IC_SpiritGuidePos[nodePoint->nodeType][3],
(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)))
sLog->outError("Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u,", nodePoint->nodeType, nodePoint->faction);
sLog->outError("Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", nodePoint->nodeType, nodePoint->faction);
}
switch(nodePoint->gameobject_type)
@@ -651,9 +651,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
{
uint8 type = BG_IC_GO_HANGAR_TELEPORTER_1+u;
AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
BG_IC_HangarTeleporters[u].GetPositionX(),BG_IC_HangarTeleporters[u].GetPositionY(),
BG_IC_HangarTeleporters[u].GetPositionZ(),BG_IC_HangarTeleporters[u].GetOrientation(),
0,0,0,0,RESPAWN_ONE_DAY);
BG_IC_HangarTeleporters[u].GetPositionX(), BG_IC_HangarTeleporters[u].GetPositionY(),
BG_IC_HangarTeleporters[u].GetPositionZ(), BG_IC_HangarTeleporters[u].GetOrientation(),
0, 0, 0, 0, RESPAWN_ONE_DAY);
}
//sLog->outError("BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
@@ -663,12 +663,12 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
// we should spawn teleporters
break;
case BG_IC_GO_QUARRY_BANNER:
RemoveAuraOnTeam(SPELL_QUARRY,(nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_QUARRY,(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
RemoveAuraOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
break;
case BG_IC_GO_REFINERY_BANNER:
RemoveAuraOnTeam(SPELL_OIL_REFINERY,(nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_OIL_REFINERY,(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
RemoveAuraOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
break;
case BG_IC_GO_DOCKS_BANNER:
@@ -711,9 +711,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H,type,nodePoint->faction,
BG_IC_DocksVehiclesGlaives[i].GetPositionX(),BG_IC_DocksVehiclesGlaives[i].GetPositionY(),
BG_IC_DocksVehiclesGlaives[i].GetPositionZ(),BG_IC_DocksVehiclesGlaives[i].GetOrientation(),
if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, nodePoint->faction,
BG_IC_DocksVehiclesGlaives[i].GetPositionX(), BG_IC_DocksVehiclesGlaives[i].GetPositionY(),
BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
@@ -726,9 +726,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(NPC_CATAPULT,type,nodePoint->faction,
BG_IC_DocksVehiclesCatapults[i].GetPositionX(),BG_IC_DocksVehiclesCatapults[i].GetPositionY(),
BG_IC_DocksVehiclesCatapults[i].GetPositionZ(),BG_IC_DocksVehiclesCatapults[i].GetOrientation(),
if (AddCreature(NPC_CATAPULT, type, nodePoint->faction,
BG_IC_DocksVehiclesCatapults[i].GetPositionX(), BG_IC_DocksVehiclesCatapults[i].GetPositionY(),
BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
@@ -761,9 +761,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(NPC_DEMOLISHER,type,nodePoint->faction,
BG_IC_WorkshopVehicles[i].GetPositionX(),BG_IC_WorkshopVehicles[i].GetPositionY(),
BG_IC_WorkshopVehicles[i].GetPositionZ(),BG_IC_WorkshopVehicles[i].GetOrientation(),
if (AddCreature(NPC_DEMOLISHER, type, nodePoint->faction,
BG_IC_WorkshopVehicles[i].GetPositionX(), BG_IC_WorkshopVehicles[i].GetPositionY(),
BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
@@ -784,14 +784,14 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
uint8 siegeType = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_A : BG_IC_NPC_SIEGE_ENGINE_H);
if (!GetBGCreature(siegeType) || !GetBGCreature(siegeType)->isAlive())
{
AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H),siegeType,nodePoint->faction,
BG_IC_WorkshopVehicles[4].GetPositionX(),BG_IC_WorkshopVehicles[4].GetPositionY(),
BG_IC_WorkshopVehicles[4].GetPositionZ(),BG_IC_WorkshopVehicles[4].GetOrientation(),
AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H), siegeType, nodePoint->faction,
BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(),
BG_IC_WorkshopVehicles[4].GetPositionZ(), BG_IC_WorkshopVehicles[4].GetOrientation(),
RESPAWN_ONE_DAY);
if (Creature* siegeEngine = GetBGCreature(siegeType))
{
siegeEngine->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE);
siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE);
siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
@@ -799,15 +799,15 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
for (uint8 i = 0; i < MAX_WORKSHOP_BOMBS_SPAWNS_PER_FACTION; i++)
{
AddObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i,GO_SEAFORIUM_BOMBS,
workshopBombs[i].GetPositionX(),workshopBombs[i].GetPositionY(),
workshopBombs[i].GetPositionZ(),workshopBombs[i].GetOrientation(),
0,0,0,0,10);
AddObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i, GO_SEAFORIUM_BOMBS,
workshopBombs[i].GetPositionX(), workshopBombs[i].GetPositionY(),
workshopBombs[i].GetPositionZ(), workshopBombs[i].GetOrientation(),
0, 0, 0, 0, 10);
if (GameObject* seaforiumBombs = GetBGObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i))
{
seaforiumBombs->SetRespawnTime(10);
seaforiumBombs->SetUInt32Value(GAMEOBJECT_FACTION,BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
seaforiumBombs->SetUInt32Value(GAMEOBJECT_FACTION, BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
break;
@@ -824,7 +824,7 @@ void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedE
uint32 uws_close = GetWorldStateFromGateEntry(go->GetEntry(), false);
if (uws_open)
{
UpdateWorldState(uws_close,0);
UpdateWorldState(uws_close, 0);
UpdateWorldState(uws_open, 1);
}
DoorOpen((pl->GetTeamId() == TEAM_ALLIANCE ? BG_IC_GO_HORDE_KEEP_PORTCULLIS : BG_IC_GO_DOODAD_PORTCULLISACTIVE02));
@@ -850,7 +850,7 @@ void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedE
break;
}
SendMessage2ToAll(lang_entry,CHAT_MSG_BG_SYSTEM_NEUTRAL,NULL,(pl->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (pl->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
}
void BattlegroundIC::EventPlayerDamagedGO(Player* /*plr*/, GameObject* /*go*/, uint32 /*eventType*/)
@@ -897,9 +897,9 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player)
return good_entry;
}
Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period)
Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
{
Transport* t = new Transport(period,0);
Transport* t = new Transport(period, 0);
const GameObjectTemplate* goinfo = sObjectMgr->GetGameObjectTemplate(goEntry);
@@ -915,7 +915,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period)
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId);
sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
delete t;
return NULL;
}
@@ -928,7 +928,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period)
float o = 1;
// creates the Gameobject
if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT),goEntry, mapid, x, y, z, o, 100, 0))
if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT), goEntry, mapid, x, y, z, o, 100, 0))
{
delete t;
return NULL;
@@ -938,7 +938,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period)
t->SetMap(GetBgMap());
for (uint8 i = 0; i < 5; i++)
t->AddNPCPassenger(0,(goEntry == GO_HORDE_GUNSHIP ? NPC_HORDE_GUNSHIP_CANNON : NPC_ALLIANCE_GUNSHIP_CANNON), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionX() : allianceGunshipPassengers[i].GetPositionX()) , (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionY() : allianceGunshipPassengers[i].GetPositionY()),(goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionZ() : allianceGunshipPassengers[i].GetPositionZ()), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetOrientation() : allianceGunshipPassengers[i].GetOrientation()));
t->AddNPCPassenger(0, (goEntry == GO_HORDE_GUNSHIP ? NPC_HORDE_GUNSHIP_CANNON : NPC_ALLIANCE_GUNSHIP_CANNON), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionX() : allianceGunshipPassengers[i].GetPositionX()) , (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionY() : allianceGunshipPassengers[i].GetPositionY()), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionZ() : allianceGunshipPassengers[i].GetPositionZ()), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetOrientation() : allianceGunshipPassengers[i].GetOrientation()));
return t;
}
@@ -445,44 +445,44 @@ enum BG_IC_MaxSpawns
const ICNpc BG_IC_NpcSpawnlocs[MAX_NORMAL_NPCS_SPAWNS]=
{
{BG_IC_NPC_OVERLORD_AGMAR,NPC_OVERLORD_AGMAR,TEAM_HORDE,1295.44f,-765.733f,70.0541f,0.0f},//Overlord Agmar 1
{BG_IC_NPC_HIGH_COMMANDER_HALFORD_WYRMBANE,NPC_HIGH_COMMANDER_HALFORD_WYRMBANE,TEAM_ALLIANCE,224.983f,-831.573f,60.9034f,0.0f},//High Commander Halford Wyrmbane 2
{BG_IC_NPC_KOR_KRON_GUARD_1,NPC_KOR_KRON_GUARD,TEAM_HORDE,1296.01f,-773.256f,69.958f,0.292168f}, // 3
{BG_IC_NPC_KOR_KRON_GUARD_2,NPC_KOR_KRON_GUARD,TEAM_HORDE,1295.94f,-757.756f,69.9587f,6.02165f}, // 4
{BG_IC_NPC_KOR_KRON_GUARD_3,NPC_KOR_KRON_GUARD,TEAM_HORDE,1295.09f,-760.927f,69.9587f,5.94311f}, // 5
{BG_IC_NPC_KOR_KRON_GUARD_4,NPC_KOR_KRON_GUARD,TEAM_HORDE,1295.13f,-769.7f,69.95f,0.34f}, // 6
{BG_IC_NPC_OVERLORD_AGMAR, NPC_OVERLORD_AGMAR, TEAM_HORDE, 1295.44f, -765.733f, 70.0541f, 0.0f}, //Overlord Agmar 1
{BG_IC_NPC_HIGH_COMMANDER_HALFORD_WYRMBANE, NPC_HIGH_COMMANDER_HALFORD_WYRMBANE, TEAM_ALLIANCE, 224.983f, -831.573f, 60.9034f, 0.0f}, //High Commander Halford Wyrmbane 2
{BG_IC_NPC_KOR_KRON_GUARD_1, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1296.01f, -773.256f, 69.958f, 0.292168f}, // 3
{BG_IC_NPC_KOR_KRON_GUARD_2, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1295.94f, -757.756f, 69.9587f, 6.02165f}, // 4
{BG_IC_NPC_KOR_KRON_GUARD_3, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1295.09f, -760.927f, 69.9587f, 5.94311f}, // 5
{BG_IC_NPC_KOR_KRON_GUARD_4, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1295.13f, -769.7f, 69.95f, 0.34f}, // 6
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_1,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,223.969f,-822.958f,60.8151f,0.46337f}, // 7
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_2,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,224.211f,-826.952f,60.8188f,6.25961f}, // 8
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_3,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,223.119f,-838.386f,60.8145f,5.64857f}, // 9
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_4,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,223.889f,-835.102f,60.8201f,6.21642f},// 10
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_1, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 223.969f, -822.958f, 60.8151f, 0.46337f}, // 7
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_2, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 224.211f, -826.952f, 60.8188f, 6.25961f}, // 8
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_3, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 223.119f, -838.386f, 60.8145f, 5.64857f}, // 9
{BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_4, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 223.889f, -835.102f, 60.8201f, 6.21642f}, // 10
{BG_IC_NPC_KEEP_CANNON_1,NPC_KEEP_CANNON,TEAM_ALLIANCE,415.825f,-754.634f,87.799f,1.78024f},// 11
{BG_IC_NPC_KEEP_CANNON_2,NPC_KEEP_CANNON,TEAM_ALLIANCE,410.142f,-755.332f,87.7991f,1.78024f},// 12
{BG_IC_NPC_KEEP_CANNON_3,NPC_KEEP_CANNON,TEAM_ALLIANCE,424.33f,-879.352f,88.0446f,0.436332f},// 13
{BG_IC_NPC_KEEP_CANNON_4,NPC_KEEP_CANNON,TEAM_ALLIANCE,425.602f,-786.646f,87.7991f,5.74213f},// 14
{BG_IC_NPC_KEEP_CANNON_5,NPC_KEEP_CANNON,TEAM_ALLIANCE,426.743f,-884.939f,87.9613f,0.436332f},// 15
{BG_IC_NPC_KEEP_CANNON_6,NPC_KEEP_CANNON,TEAM_ALLIANCE,404.736f,-755.495f,87.7989f,1.78024f},// 16
{BG_IC_NPC_KEEP_CANNON_7,NPC_KEEP_CANNON,TEAM_ALLIANCE,428.375f,-780.797f,87.7991f,5.79449f},// 17
{BG_IC_NPC_KEEP_CANNON_8,NPC_KEEP_CANNON,TEAM_ALLIANCE,429.175f,-890.436f,88.0446f,0.436332f},// 18
{BG_IC_NPC_KEEP_CANNON_9,NPC_KEEP_CANNON,TEAM_ALLIANCE,430.872f,-775.278f,87.7991f,5.88176f},// 19
{BG_IC_NPC_KEEP_CANNON_10,NPC_KEEP_CANNON,TEAM_ALLIANCE,408.056f,-911.283f,88.0445f,4.64258f},// 20
{BG_IC_NPC_KEEP_CANNON_11,NPC_KEEP_CANNON,TEAM_ALLIANCE,413.609f,-911.566f,88.0447f,4.66003f},// 21
{BG_IC_NPC_KEEP_CANNON_12,NPC_KEEP_CANNON,TEAM_ALLIANCE,402.554f,-910.557f,88.0446f,4.57276f},// 22
{BG_IC_NPC_KEEP_CANNON_1, NPC_KEEP_CANNON, TEAM_ALLIANCE, 415.825f, -754.634f, 87.799f, 1.78024f}, // 11
{BG_IC_NPC_KEEP_CANNON_2, NPC_KEEP_CANNON, TEAM_ALLIANCE, 410.142f, -755.332f, 87.7991f, 1.78024f}, // 12
{BG_IC_NPC_KEEP_CANNON_3, NPC_KEEP_CANNON, TEAM_ALLIANCE, 424.33f, -879.352f, 88.0446f, 0.436332f}, // 13
{BG_IC_NPC_KEEP_CANNON_4, NPC_KEEP_CANNON, TEAM_ALLIANCE, 425.602f, -786.646f, 87.7991f, 5.74213f}, // 14
{BG_IC_NPC_KEEP_CANNON_5, NPC_KEEP_CANNON, TEAM_ALLIANCE, 426.743f, -884.939f, 87.9613f, 0.436332f}, // 15
{BG_IC_NPC_KEEP_CANNON_6, NPC_KEEP_CANNON, TEAM_ALLIANCE, 404.736f, -755.495f, 87.7989f, 1.78024f}, // 16
{BG_IC_NPC_KEEP_CANNON_7, NPC_KEEP_CANNON, TEAM_ALLIANCE, 428.375f, -780.797f, 87.7991f, 5.79449f}, // 17
{BG_IC_NPC_KEEP_CANNON_8, NPC_KEEP_CANNON, TEAM_ALLIANCE, 429.175f, -890.436f, 88.0446f, 0.436332f}, // 18
{BG_IC_NPC_KEEP_CANNON_9, NPC_KEEP_CANNON, TEAM_ALLIANCE, 430.872f, -775.278f, 87.7991f, 5.88176f}, // 19
{BG_IC_NPC_KEEP_CANNON_10, NPC_KEEP_CANNON, TEAM_ALLIANCE, 408.056f, -911.283f, 88.0445f, 4.64258f}, // 20
{BG_IC_NPC_KEEP_CANNON_11, NPC_KEEP_CANNON, TEAM_ALLIANCE, 413.609f, -911.566f, 88.0447f, 4.66003f}, // 21
{BG_IC_NPC_KEEP_CANNON_12, NPC_KEEP_CANNON, TEAM_ALLIANCE, 402.554f, -910.557f, 88.0446f, 4.57276f}, // 22
{BG_IC_NPC_KEEP_CANNON_13,NPC_KEEP_CANNON,TEAM_HORDE,1158.91f,-660.144f,87.9332f,0.750492f},// 23
{BG_IC_NPC_KEEP_CANNON_14,NPC_KEEP_CANNON,TEAM_HORDE,1156.22f,-866.809f,87.8754f,5.27089f},// 24
{BG_IC_NPC_KEEP_CANNON_15,NPC_KEEP_CANNON,TEAM_HORDE,1163.74f,-663.67f,88.3571f,0.558505f},// 25
{BG_IC_NPC_KEEP_CANNON_16,NPC_KEEP_CANNON,TEAM_HORDE,1135.18f,-683.896f,88.0409f,3.9619f},// 26
{BG_IC_NPC_KEEP_CANNON_17,NPC_KEEP_CANNON,TEAM_HORDE,1138.91f,-836.359f,88.3728f,2.18166f},// 27
{BG_IC_NPC_KEEP_CANNON_18,NPC_KEEP_CANNON,TEAM_HORDE,1162.08f,-863.717f,88.358f,5.48033f},// 28
{BG_IC_NPC_KEEP_CANNON_19,NPC_KEEP_CANNON,TEAM_HORDE,1167.13f,-669.212f,87.9682f,0.383972f},// 29
{BG_IC_NPC_KEEP_CANNON_20,NPC_KEEP_CANNON,TEAM_HORDE,1137.72f,-688.517f,88.4023f,3.9619f},// 30
{BG_IC_NPC_KEEP_CANNON_21,NPC_KEEP_CANNON,TEAM_HORDE,1135.29f,-840.878f,88.0252f,2.30383f},// 31
{BG_IC_NPC_KEEP_CANNON_22,NPC_KEEP_CANNON,TEAM_HORDE,1144.33f,-833.309f,87.9268f,2.14675f},// 32
{BG_IC_NPC_KEEP_CANNON_23,NPC_KEEP_CANNON,TEAM_HORDE,1135.29f,-840.878f,88.0252f,2.30383f},// 33
{BG_IC_NPC_KEEP_CANNON_24,NPC_KEEP_CANNON,TEAM_HORDE,1142.59f,-691.946f,87.9756f,3.9619f},// 34
{BG_IC_NPC_KEEP_CANNON_25,NPC_KEEP_CANNON,TEAM_HORDE,1166.13f,-858.391f,87.9653f,5.63741f},// 35
{BG_IC_NPC_KEEP_CANNON_13, NPC_KEEP_CANNON, TEAM_HORDE, 1158.91f, -660.144f, 87.9332f, 0.750492f}, // 23
{BG_IC_NPC_KEEP_CANNON_14, NPC_KEEP_CANNON, TEAM_HORDE, 1156.22f, -866.809f, 87.8754f, 5.27089f}, // 24
{BG_IC_NPC_KEEP_CANNON_15, NPC_KEEP_CANNON, TEAM_HORDE, 1163.74f, -663.67f, 88.3571f, 0.558505f}, // 25
{BG_IC_NPC_KEEP_CANNON_16, NPC_KEEP_CANNON, TEAM_HORDE, 1135.18f, -683.896f, 88.0409f, 3.9619f}, // 26
{BG_IC_NPC_KEEP_CANNON_17, NPC_KEEP_CANNON, TEAM_HORDE, 1138.91f, -836.359f, 88.3728f, 2.18166f}, // 27
{BG_IC_NPC_KEEP_CANNON_18, NPC_KEEP_CANNON, TEAM_HORDE, 1162.08f, -863.717f, 88.358f, 5.48033f}, // 28
{BG_IC_NPC_KEEP_CANNON_19, NPC_KEEP_CANNON, TEAM_HORDE, 1167.13f, -669.212f, 87.9682f, 0.383972f}, // 29
{BG_IC_NPC_KEEP_CANNON_20, NPC_KEEP_CANNON, TEAM_HORDE, 1137.72f, -688.517f, 88.4023f, 3.9619f}, // 30
{BG_IC_NPC_KEEP_CANNON_21, NPC_KEEP_CANNON, TEAM_HORDE, 1135.29f, -840.878f, 88.0252f, 2.30383f}, // 31
{BG_IC_NPC_KEEP_CANNON_22, NPC_KEEP_CANNON, TEAM_HORDE, 1144.33f, -833.309f, 87.9268f, 2.14675f}, // 32
{BG_IC_NPC_KEEP_CANNON_23, NPC_KEEP_CANNON, TEAM_HORDE, 1135.29f, -840.878f, 88.0252f, 2.30383f}, // 33
{BG_IC_NPC_KEEP_CANNON_24, NPC_KEEP_CANNON, TEAM_HORDE, 1142.59f, -691.946f, 87.9756f, 3.9619f}, // 34
{BG_IC_NPC_KEEP_CANNON_25, NPC_KEEP_CANNON, TEAM_HORDE, 1166.13f, -858.391f, 87.9653f, 5.63741f}, // 35
};
const Position BG_IC_WorkshopVehicles[5] =
@@ -510,9 +510,9 @@ const Position BG_IC_DocksVehiclesCatapults[4] =
const Position BG_IC_HangarTeleporters[3] =
{
{827.958f,-994.467f,134.071f,0.0f}, // Gunship Portal
{738.613f,-1106.58f,134.745f,2.54818f}, // Gunship Portal
{672.283f,-1156.99f,133.706f,1.37881f}, // Gunship Portal
{827.958f, -994.467f, 134.071f, 0.0f}, // Gunship Portal
{738.613f, -1106.58f, 134.745f, 2.54818f}, // Gunship Portal
{672.283f, -1156.99f, 133.706f, 1.37881f}, // Gunship Portal
};
struct ICGo
@@ -527,128 +527,128 @@ struct ICGo
const ICGo BG_IC_Teleporters[MAX_FORTRESS_TELEPORTERS_SPAWNS] =
{
{BG_IC_GO_TELEPORTER_1_1,GO_TELEPORTER_1,1143.25f,-779.599f,48.629f,1.64061f}, // Teleporter
{BG_IC_GO_TELEPORTER_1_2,GO_TELEPORTER_1,1236.53f,-669.415f,48.2729f,0.104719f}, // Teleporter
{BG_IC_GO_TELEPORTER_2_1,GO_TELEPORTER_2,1233.27f,-844.526f,48.8824f,-0.0174525f}, // Teleporter
{BG_IC_GO_TELEPORTER_3_1,GO_TELEPORTER_3,311.92f,-913.972f,48.8159f,3.08918f}, // Teleporter
{BG_IC_GO_TELEPORTER_2_2,GO_TELEPORTER_2,1235.53f,-683.872f,49.304f,-3.08918f}, // Teleporter
{BG_IC_GO_TELEPORTER_4_1,GO_TELEPORTER_4,397.089f,-859.382f,48.8993f,1.64061f}, // Teleporter
{BG_IC_GO_TELEPORTER_3_2,GO_TELEPORTER_3,324.635f,-749.128f,49.3602f,0.0174525f}, // Teleporter
{BG_IC_GO_TELEPORTER_3_3,GO_TELEPORTER_3,425.675f,-857.09f,48.5104f,-1.6057f}, // Teleporter
{BG_IC_GO_TELEPORTER_4_2,GO_TELEPORTER_4,323.54f,-888.361f,48.9197f,0.0349063f}, // Teleporter
{BG_IC_GO_TELEPORTER_4_3,GO_TELEPORTER_4,326.285f,-777.366f,49.0208f,3.12412f}, // Teleporter
{BG_IC_GO_TELEPORTER_1_3,GO_TELEPORTER_1,1235.09f,-857.898f,48.9163f,3.07177f}, // Teleporter
{BG_IC_GO_TELEPORTER_2_3,GO_TELEPORTER_2,1158.76f,-746.182f,48.6277f,-1.51844f}, // Teleporter
{BG_IC_GO_TELEPORTER_1_1, GO_TELEPORTER_1, 1143.25f, -779.599f, 48.629f, 1.64061f}, // Teleporter
{BG_IC_GO_TELEPORTER_1_2, GO_TELEPORTER_1, 1236.53f, -669.415f, 48.2729f, 0.104719f}, // Teleporter
{BG_IC_GO_TELEPORTER_2_1, GO_TELEPORTER_2, 1233.27f, -844.526f, 48.8824f, -0.0174525f}, // Teleporter
{BG_IC_GO_TELEPORTER_3_1, GO_TELEPORTER_3, 311.92f, -913.972f, 48.8159f, 3.08918f}, // Teleporter
{BG_IC_GO_TELEPORTER_2_2, GO_TELEPORTER_2, 1235.53f, -683.872f, 49.304f, -3.08918f}, // Teleporter
{BG_IC_GO_TELEPORTER_4_1, GO_TELEPORTER_4, 397.089f, -859.382f, 48.8993f, 1.64061f}, // Teleporter
{BG_IC_GO_TELEPORTER_3_2, GO_TELEPORTER_3, 324.635f, -749.128f, 49.3602f, 0.0174525f}, // Teleporter
{BG_IC_GO_TELEPORTER_3_3, GO_TELEPORTER_3, 425.675f, -857.09f, 48.5104f, -1.6057f}, // Teleporter
{BG_IC_GO_TELEPORTER_4_2, GO_TELEPORTER_4, 323.54f, -888.361f, 48.9197f, 0.0349063f}, // Teleporter
{BG_IC_GO_TELEPORTER_4_3, GO_TELEPORTER_4, 326.285f, -777.366f, 49.0208f, 3.12412f}, // Teleporter
{BG_IC_GO_TELEPORTER_1_3, GO_TELEPORTER_1, 1235.09f, -857.898f, 48.9163f, 3.07177f}, // Teleporter
{BG_IC_GO_TELEPORTER_2_3, GO_TELEPORTER_2, 1158.76f, -746.182f, 48.6277f, -1.51844f}, // Teleporter
{BG_IC_GO_TELEPORTER_EFFECTS_A_1,GO_TELEPORTER_EFFECTS_A,425.686f,-857.092f,48.51f,-1.62316f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_2,GO_TELEPORTER_EFFECTS_A,324.634f,-749.148f,49.359f,0.0174525f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_3,GO_TELEPORTER_EFFECTS_A,311.911f,-913.986f,48.8157f,3.08918f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_4,GO_TELEPORTER_EFFECTS_A,326.266f,-777.347f,49.0215f,3.12412f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_5,GO_TELEPORTER_EFFECTS_A,323.55f,-888.347f,48.9198f,0.0174525f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_6,GO_TELEPORTER_EFFECTS_A,397.116f,-859.378f,48.8989f,1.64061f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_1, GO_TELEPORTER_EFFECTS_A, 425.686f, -857.092f, 48.51f, -1.62316f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_2, GO_TELEPORTER_EFFECTS_A, 324.634f, -749.148f, 49.359f, 0.0174525f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_3, GO_TELEPORTER_EFFECTS_A, 311.911f, -913.986f, 48.8157f, 3.08918f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_4, GO_TELEPORTER_EFFECTS_A, 326.266f, -777.347f, 49.0215f, 3.12412f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_5, GO_TELEPORTER_EFFECTS_A, 323.55f, -888.347f, 48.9198f, 0.0174525f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_A_6, GO_TELEPORTER_EFFECTS_A, 397.116f, -859.378f, 48.8989f, 1.64061f}, // Teleporter Effects (Alliance)
{BG_IC_GO_TELEPORTER_EFFECTS_H_1,GO_TELEPORTER_EFFECTS_H,1143.25f,-779.623f,48.6291f,1.62316f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_2,GO_TELEPORTER_EFFECTS_H,1158.64f,-746.148f,48.6277f,-1.50098f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_3,GO_TELEPORTER_EFFECTS_H,1233.25f,-844.573f,48.8836f,0.0174525f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_4,GO_TELEPORTER_EFFECTS_H,1235.07f,-857.957f,48.9163f,3.05433f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_5,GO_TELEPORTER_EFFECTS_H,1236.46f,-669.344f,48.2684f,0.087266f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_6,GO_TELEPORTER_EFFECTS_H,1235.6f,-683.806f,49.3028f,-3.07177f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_1, GO_TELEPORTER_EFFECTS_H, 1143.25f, -779.623f, 48.6291f, 1.62316f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_2, GO_TELEPORTER_EFFECTS_H, 1158.64f, -746.148f, 48.6277f, -1.50098f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_3, GO_TELEPORTER_EFFECTS_H, 1233.25f, -844.573f, 48.8836f, 0.0174525f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_4, GO_TELEPORTER_EFFECTS_H, 1235.07f, -857.957f, 48.9163f, 3.05433f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_5, GO_TELEPORTER_EFFECTS_H, 1236.46f, -669.344f, 48.2684f, 0.087266f}, // Teleporter Effects (Horde)
{BG_IC_GO_TELEPORTER_EFFECTS_H_6, GO_TELEPORTER_EFFECTS_H, 1235.6f, -683.806f, 49.3028f, -3.07177f}, // Teleporter Effects (Horde)
};
const ICGo BG_IC_ObjSpawnlocs[MAX_NORMAL_GAMEOBJECTS_SPAWNS] =
{
{BG_IC_GO_ALLIANCE_GATE_1,GO_ALLIANCE_GATE_1,351.615f,-762.75f,48.9162f,-1.5708f}, // Alliance Gate || Left
{BG_IC_GO_ALLIANCE_GATE_2,GO_ALLIANCE_GATE_2,351.024f,-903.326f,48.9247f,1.5708f}, // Alliance Gate || Right
{BG_IC_GO_ALLIANCE_GATE_3,GO_ALLIANCE_GATE_3,413.479f,-833.95f,48.5238f,3.14159f}, // Alliance Gate || Front
{BG_IC_GO_ALLIANCE_GATE_1, GO_ALLIANCE_GATE_1, 351.615f, -762.75f, 48.9162f, -1.5708f}, // Alliance Gate || Left
{BG_IC_GO_ALLIANCE_GATE_2, GO_ALLIANCE_GATE_2, 351.024f, -903.326f, 48.9247f, 1.5708f}, // Alliance Gate || Right
{BG_IC_GO_ALLIANCE_GATE_3, GO_ALLIANCE_GATE_3, 413.479f, -833.95f, 48.5238f, 3.14159f}, // Alliance Gate || Front
{BG_IC_GO_HORDE_GATE_1,GO_HORDE_GATE_1,1150.9f,-762.606f,47.5077f,3.14159f}, // Horde Gate || Front
{BG_IC_GO_HORDE_GATE_2,GO_HORDE_GATE_2,1218.74f,-851.155f,48.2533f,-1.5708f}, // Horde Gate || Left
{BG_IC_GO_HORDE_GATE_3,GO_HORDE_GATE_3,1217.9f,-676.948f,47.6341f,1.5708f}, // Horde Gate || Right
{BG_IC_GO_HORDE_GATE_1, GO_HORDE_GATE_1, 1150.9f, -762.606f, 47.5077f, 3.14159f}, // Horde Gate || Front
{BG_IC_GO_HORDE_GATE_2, GO_HORDE_GATE_2, 1218.74f, -851.155f, 48.2533f, -1.5708f}, // Horde Gate || Left
{BG_IC_GO_HORDE_GATE_3, GO_HORDE_GATE_3, 1217.9f, -676.948f, 47.6341f, 1.5708f}, // Horde Gate || Right
{BG_IC_GO_HORDE_BANNER,GO_HORDE_BANNER,1284.76f,-705.668f,48.9163f,-3.08918f}, // Horde Banner
{BG_IC_GO_ALLIANCE_BANNER,GO_ALLIANCE_BANNER,299.153f,-784.589f,48.9162f,-0.157079f}, // Alliance Banner
{BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, 1284.76f, -705.668f, 48.9163f, -3.08918f}, // Horde Banner
{BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, 299.153f, -784.589f, 48.9162f, -0.157079f}, // Alliance Banner
{BG_IC_GO_WORKSHOP_BANNER,GO_WORKSHOP_BANNER,776.229f,-804.283f,6.45052f,1.6057f}, // Workshop Banner
{BG_IC_GO_DOCKS_BANNER,GO_DOCKS_BANNER,726.385f,-360.205f,17.8153f,-1.62316f}, // Docks Banner
{BG_IC_GO_HANGAR_BANNER,GO_HANGAR_BANNER,807.78f,-1000.07f,132.381f,-1.93732f}, // Hangar Banner
{BG_IC_GO_QUARRY_BANNER,GO_QUARRY_BANNER,251.016f,-1159.32f,17.2376f,-2.25147f}, // Quarry Banner
{BG_IC_GO_REFINERY_BANNER,GO_REFINERY_BANNER,1269.5f,-400.809f,37.6253f,-1.76278f}, // Refinery Banner
{BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, 776.229f, -804.283f, 6.45052f, 1.6057f}, // Workshop Banner
{BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, 726.385f, -360.205f, 17.8153f, -1.62316f}, // Docks Banner
{BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, 807.78f, -1000.07f, 132.381f, -1.93732f}, // Hangar Banner
{BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, 251.016f, -1159.32f, 17.2376f, -2.25147f}, // Quarry Banner
{BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, 1269.5f, -400.809f, 37.6253f, -1.76278f}, // Refinery Banner
{BG_IC_GO_BENCH_1,GO_BENCH_1,834.208f,-461.826f,22.3067f,1.5708f}, // Bench
{BG_IC_GO_BENCH_2,GO_BENCH_2,826.153f,-461.985f,22.5149f,1.5708f}, // Bench
{BG_IC_GO_BENCH_3,GO_BENCH_3,817.446f,-470.47f,25.372f,-1.56207f}, // Bench
{BG_IC_GO_BENCH_4,GO_BENCH_4,827.001f,-474.415f,25.372f,1.57952f}, // Bench
{BG_IC_GO_BENCH_5,GO_BENCH_5,819.264f,-461.961f,22.7614f,1.57952f}, // Bench
{BG_IC_GO_BENCH_1, GO_BENCH_1, 834.208f, -461.826f, 22.3067f, 1.5708f}, // Bench
{BG_IC_GO_BENCH_2, GO_BENCH_2, 826.153f, -461.985f, 22.5149f, 1.5708f}, // Bench
{BG_IC_GO_BENCH_3, GO_BENCH_3, 817.446f, -470.47f, 25.372f, -1.56207f}, // Bench
{BG_IC_GO_BENCH_4, GO_BENCH_4, 827.001f, -474.415f, 25.372f, 1.57952f}, // Bench
{BG_IC_GO_BENCH_5, GO_BENCH_5, 819.264f, -461.961f, 22.7614f, 1.57952f}, // Bench
{BG_IC_GO_BONFIRE_1,GO_BONFIRE_1,1162.91f,-734.578f,48.8948f,-2.9845f}, // Bonfire
{BG_IC_GO_BONFIRE_2,GO_BONFIRE_2,1282.34f,-799.762f,87.1357f,-3.13286f}, // Bonfire
{BG_IC_GO_BONFIRE_3,GO_BONFIRE_3,1358.06f,-732.178f,87.1606f,-3.13284f}, // Bonfire
{BG_IC_GO_BONFIRE_4,GO_BONFIRE_4,1281.76f,-732.844f,87.1574f,-3.13246f}, // Bonfire
{BG_IC_GO_BONFIRE_5,GO_BONFIRE_5,1358.81f,-797.899f,87.2953f,3.13312f}, // Bonfire
{BG_IC_GO_BONFIRE_6,GO_BONFIRE_6,1162.21f,-790.543f,48.9162f,2.27765f}, // Bonfire
{BG_IC_GO_BONFIRE_1, GO_BONFIRE_1, 1162.91f, -734.578f, 48.8948f, -2.9845f}, // Bonfire
{BG_IC_GO_BONFIRE_2, GO_BONFIRE_2, 1282.34f, -799.762f, 87.1357f, -3.13286f}, // Bonfire
{BG_IC_GO_BONFIRE_3, GO_BONFIRE_3, 1358.06f, -732.178f, 87.1606f, -3.13284f}, // Bonfire
{BG_IC_GO_BONFIRE_4, GO_BONFIRE_4, 1281.76f, -732.844f, 87.1574f, -3.13246f}, // Bonfire
{BG_IC_GO_BONFIRE_5, GO_BONFIRE_5, 1358.81f, -797.899f, 87.2953f, 3.13312f}, // Bonfire
{BG_IC_GO_BONFIRE_6, GO_BONFIRE_6, 1162.21f, -790.543f, 48.9162f, 2.27765f}, // Bonfire
{BG_IC_GO_BRAZIER_1,GO_BRAZIER_1,1262.21f,-751.358f,48.8133f,2.26893f}, // Brazier
{BG_IC_GO_BRAZIER_2,GO_BRAZIER_2,1262.58f,-781.861f,48.8132f,2.04203f}, // Brazier
{BG_IC_GO_BRAZIER_3,GO_BRAZIER_3,223.818f,-839.352f,60.7917f,1.09083f}, // Brazier
{BG_IC_GO_BRAZIER_4,GO_BRAZIER_4,224.277f,-822.77f,60.7917f,2.06822f}, // Brazier
{BG_IC_GO_BRAZIER_1, GO_BRAZIER_1, 1262.21f, -751.358f, 48.8133f, 2.26893f}, // Brazier
{BG_IC_GO_BRAZIER_2, GO_BRAZIER_2, 1262.58f, -781.861f, 48.8132f, 2.04203f}, // Brazier
{BG_IC_GO_BRAZIER_3, GO_BRAZIER_3, 223.818f, -839.352f, 60.7917f, 1.09083f}, // Brazier
{BG_IC_GO_BRAZIER_4, GO_BRAZIER_4, 224.277f, -822.77f, 60.7917f, 2.06822f}, // Brazier
{BG_IC_GO_CHAIR_1,GO_CHAIR_1,632.876f,-282.461f,5.45364f,-0.851094f}, // Chair
{BG_IC_GO_CHAIR_2,GO_CHAIR_2,635.796f,-276.295f,5.48659f,-3.03273f}, // Chair
{BG_IC_GO_CHAIR_3_1,GO_CHAIR_3,762.245f,-444.795f,22.8526f,-1.98095f}, // Chair
{BG_IC_GO_CHAIR_4,GO_CHAIR_4,632.156f,-304.503f,5.4879f,1.15603f}, // Chair
{BG_IC_GO_CHAIR_5,GO_CHAIR_5,643.86f,-270.204f,5.48898f,2.36903f}, // Chair
{BG_IC_GO_CHAIR_6_1,GO_CHAIR_6,902.234f,-455.508f,18.3935f,-1.00356f}, // Chair
{BG_IC_GO_CHAIR_7,GO_CHAIR_7,810.237f,-461.2f,25.4627f,1.5708f}, // Chair
{BG_IC_GO_CHAIR_3_2,GO_CHAIR_3,1117.19f,-365.674f,18.8456f,0.968657f}, // Chair
{BG_IC_GO_CHAIR_6_2,GO_CHAIR_6,1066.19f,-337.214f,18.8225f,0.453785f}, // Chair
{BG_IC_GO_CHAIR_8_1,GO_CHAIR_8,798.324f,-444.951f,22.5601f,-1.02102f}, // Chair
{BG_IC_GO_CHAIR_8_2,GO_CHAIR_8,1081.81f,-358.637f,18.5531f,1.92859f}, // Chair
{BG_IC_GO_CHAIR_9,GO_CHAIR_9,814.931f,-470.816f,33.6373f,-3.12412f}, // Chair
{BG_IC_GO_CHAIR_1, GO_CHAIR_1, 632.876f, -282.461f, 5.45364f, -0.851094f}, // Chair
{BG_IC_GO_CHAIR_2, GO_CHAIR_2, 635.796f, -276.295f, 5.48659f, -3.03273f}, // Chair
{BG_IC_GO_CHAIR_3_1, GO_CHAIR_3, 762.245f, -444.795f, 22.8526f, -1.98095f}, // Chair
{BG_IC_GO_CHAIR_4, GO_CHAIR_4, 632.156f, -304.503f, 5.4879f, 1.15603f}, // Chair
{BG_IC_GO_CHAIR_5, GO_CHAIR_5, 643.86f, -270.204f, 5.48898f, 2.36903f}, // Chair
{BG_IC_GO_CHAIR_6_1, GO_CHAIR_6, 902.234f, -455.508f, 18.3935f, -1.00356f}, // Chair
{BG_IC_GO_CHAIR_7, GO_CHAIR_7, 810.237f, -461.2f, 25.4627f, 1.5708f}, // Chair
{BG_IC_GO_CHAIR_3_2, GO_CHAIR_3, 1117.19f, -365.674f, 18.8456f, 0.968657f}, // Chair
{BG_IC_GO_CHAIR_6_2, GO_CHAIR_6, 1066.19f, -337.214f, 18.8225f, 0.453785f}, // Chair
{BG_IC_GO_CHAIR_8_1, GO_CHAIR_8, 798.324f, -444.951f, 22.5601f, -1.02102f}, // Chair
{BG_IC_GO_CHAIR_8_2, GO_CHAIR_8, 1081.81f, -358.637f, 18.5531f, 1.92859f}, // Chair
{BG_IC_GO_CHAIR_9, GO_CHAIR_9, 814.931f, -470.816f, 33.6373f, -3.12412f}, // Chair
{BG_IC_GO_DOODAD_HU_PORTCULLIS01_1,GO_DOODAD_HU_PORTCULLIS01,401.024f,-780.724f,49.9482f,-2.52896f}, // Doodad_HU_Portcullis01
{BG_IC_GO_DOODAD_HU_PORTCULLIS01_2,GO_DOODAD_HU_PORTCULLIS01,399.802f,-885.208f,50.1939f,2.516f}, // Doodad_HU_Portcullis01
{BG_IC_GO_DOODAD_HU_PORTCULLIS01_1, GO_DOODAD_HU_PORTCULLIS01, 401.024f, -780.724f, 49.9482f, -2.52896f}, // Doodad_HU_Portcullis01
{BG_IC_GO_DOODAD_HU_PORTCULLIS01_2, GO_DOODAD_HU_PORTCULLIS01, 399.802f, -885.208f, 50.1939f, 2.516f}, // Doodad_HU_Portcullis01
{BG_IC_GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01,GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01,413.479f,-833.95f,48.5238f,3.14159f}, // Doodad_ND_Human_Gate_ClosedFX_Door01
{BG_IC_GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01, GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01, 413.479f, -833.95f, 48.5238f, 3.14159f}, // Doodad_ND_Human_Gate_ClosedFX_Door01
{BG_IC_GO_DOODAD_PORTCULLISACTIVE01,GO_DOODAD_PORTCULLISACTIVE01,-832.595f,51.4109f,-0.0261791f, 0.0f}, // Doodad_PortcullisActive01
{BG_IC_GO_DOODAD_PORTCULLISACTIVE01, GO_DOODAD_PORTCULLISACTIVE01, -832.595f, 51.4109f, -0.0261791f, 0.0f}, // Doodad_PortcullisActive01
{BG_IC_GO_DOODAD_PORTCULLISACTIVE02,GO_DOODAD_PORTCULLISACTIVE02,273.033f,-832.199f,51.4109f,-0.0261791f}, // Doodad_PortcullisActive02
{BG_IC_GO_DOODAD_PORTCULLISACTIVE02, GO_DOODAD_PORTCULLISACTIVE02, 273.033f, -832.199f, 51.4109f, -0.0261791f}, // Doodad_PortcullisActive02
{BG_IC_GO_DOODAD_VR_PORTCULLIS01_1,GO_DOODAD_VR_PORTCULLIS01,1156.89f,-843.998f,48.6322f,0.732934f}, // Doodad_VR_Portcullis01
{BG_IC_GO_DOODAD_VR_PORTCULLIS01_2,GO_DOODAD_VR_PORTCULLIS01,1157.05f,-682.36f,48.6322f,-0.829132f}, // Doodad_VR_Portcullis01
{BG_IC_GO_DOODAD_VR_PORTCULLIS01_1, GO_DOODAD_VR_PORTCULLIS01, 1156.89f, -843.998f, 48.6322f, 0.732934f}, // Doodad_VR_Portcullis01
{BG_IC_GO_DOODAD_VR_PORTCULLIS01_2, GO_DOODAD_VR_PORTCULLIS01, 1157.05f, -682.36f, 48.6322f, -0.829132f}, // Doodad_VR_Portcullis01
{BG_IC_GO_FLAGPOLE_1_1,GO_FLAGPOLE_1,-400.809f,37.6253f,-1.76278f, 0.0f}, // Flagpole
{BG_IC_GO_FLAGPOLE_2_1,GO_FLAGPOLE_2,1284.76f,-705.668f,48.9163f,-3.08918f}, // Flagpole
{BG_IC_GO_FLAGPOLE_2_2,GO_FLAGPOLE_2,299.153f,-784.589f,48.9162f,-0.157079f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_2,GO_FLAGPOLE_1,726.385f,-360.205f,17.8153f,-1.6057f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_3,GO_FLAGPOLE_1,807.78f,-1000.07f,132.381f,-1.91986f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_4,GO_FLAGPOLE_1,776.229f,-804.283f,6.45052f,1.6057f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_5,GO_FLAGPOLE_1,251.016f,-1159.32f,17.2376f,-2.25147f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_1, GO_FLAGPOLE_1, -400.809f, 37.6253f, -1.76278f, 0.0f}, // Flagpole
{BG_IC_GO_FLAGPOLE_2_1, GO_FLAGPOLE_2, 1284.76f, -705.668f, 48.9163f, -3.08918f}, // Flagpole
{BG_IC_GO_FLAGPOLE_2_2, GO_FLAGPOLE_2, 299.153f, -784.589f, 48.9162f, -0.157079f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_2, GO_FLAGPOLE_1, 726.385f, -360.205f, 17.8153f, -1.6057f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_3, GO_FLAGPOLE_1, 807.78f, -1000.07f, 132.381f, -1.91986f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_4, GO_FLAGPOLE_1, 776.229f, -804.283f, 6.45052f, 1.6057f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_5, GO_FLAGPOLE_1, 251.016f, -1159.32f, 17.2376f, -2.25147f}, // Flagpole
{BG_IC_GO_HORDE_KEEP_PORTCULLIS,GO_HORDE_KEEP_PORTCULLIS,1283.05f,-765.878f,50.8297f,-3.13286f}, // Horde Keep Portcullis
{BG_IC_GO_HORDE_KEEP_PORTCULLIS, GO_HORDE_KEEP_PORTCULLIS, 1283.05f, -765.878f, 50.8297f, -3.13286f}, // Horde Keep Portcullis
{BG_IC_GO_STOVE_1_1,GO_STOVE_1,903.291f,-457.345f,18.1356f,2.23402f}, // Stove
{BG_IC_GO_STOVE_2_1,GO_STOVE_2,761.462f,-446.684f,22.5602f,0.244344f}, // Stove
{BG_IC_GO_STOVE_1_2,GO_STOVE_1,11068.13f,-336.373f,18.5647f,-2.59181f}, // Stove
{BG_IC_GO_STOVE_2_2,GO_STOVE_2,1118.32f,-363.969f,18.5532f,-3.08918f}, // Stove
{BG_IC_GO_STOVE_1_1, GO_STOVE_1, 903.291f, -457.345f, 18.1356f, 2.23402f}, // Stove
{BG_IC_GO_STOVE_2_1, GO_STOVE_2, 761.462f, -446.684f, 22.5602f, 0.244344f}, // Stove
{BG_IC_GO_STOVE_1_2, GO_STOVE_1, 11068.13f, -336.373f, 18.5647f, -2.59181f}, // Stove
{BG_IC_GO_STOVE_2_2, GO_STOVE_2, 1118.32f, -363.969f, 18.5532f, -3.08918f}, // Stove
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_1,GO_HUGE_SEAFORIUM_BOMB_A,297.3212f,-851.321167f,48.91627f,-0.94247663f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_2,GO_HUGE_SEAFORIUM_BOMB_A,298.104156f,-861.026062f,48.916275f,-2.75761318f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_3,GO_HUGE_SEAFORIUM_BOMB_A,300.371521f,-818.732666f,48.91625f,0.785396755f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_4,GO_HUGE_SEAFORIUM_BOMB_A,302.1354f,-810.7083f,48.91625f,-1.04719758f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_1, GO_HUGE_SEAFORIUM_BOMB_A, 297.3212f, -851.321167f, 48.91627f, -0.94247663f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_2, GO_HUGE_SEAFORIUM_BOMB_A, 298.104156f, -861.026062f, 48.916275f, -2.75761318f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_3, GO_HUGE_SEAFORIUM_BOMB_A, 300.371521f, -818.732666f, 48.91625f, 0.785396755f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_4, GO_HUGE_SEAFORIUM_BOMB_A, 302.1354f, -810.7083f, 48.91625f, -1.04719758f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_1,GO_HUGE_SEAFORIUM_BOMB_H,1268.30908f, -745.783f, 48.9187775f, 0.785396755f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_2,GO_HUGE_SEAFORIUM_BOMB_H,1268.50867f, -738.1215f, 48.9175f, -1.04719758f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_3,GO_HUGE_SEAFORIUM_BOMB_H,1273.066f, -786.572937f, 48.9419174f, -0.94247663f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_4,GO_HUGE_SEAFORIUM_BOMB_H,1273.849f, -796.2778f, 48.9364281f, -2.75761318f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_1, GO_HUGE_SEAFORIUM_BOMB_H, 1268.30908f, -745.783f, 48.9187775f, 0.785396755f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_2, GO_HUGE_SEAFORIUM_BOMB_H, 1268.50867f, -738.1215f, 48.9175f, -1.04719758f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_3, GO_HUGE_SEAFORIUM_BOMB_H, 1273.066f, -786.572937f, 48.9419174f, -0.94247663f},
{BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_4, GO_HUGE_SEAFORIUM_BOMB_H, 1273.849f, -796.2778f, 48.9364281f, -2.75761318f},
{BG_IC_GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01,GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01,1150.9f,-762.606f,47.0f,3.14159f} // Doodad_ND_WinterOrc_Wall_GateFX_Door01 -> this was not sniffed because I only had alliance sniffs
{BG_IC_GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01, GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01, 1150.9f, -762.606f, 47.0f, 3.14159f} // Doodad_ND_WinterOrc_Wall_GateFX_Door01 -> this was not sniffed because I only had alliance sniffs
};
const Position workshopBombs[2] =
{
{750.601f,-864.597f,13.4754f,1.93731f},
{785.509f,-864.715f,13.3993f,2.47837f}
{750.601f, -864.597f, 13.4754f, 1.93731f},
{785.509f, -864.715f, 13.3993f, 2.47837f}
};
enum Spells
@@ -780,7 +780,7 @@ enum ICNodeState
const uint32 BG_IC_GraveyardIds[MAX_NODE_TYPES+2] = {0, 0, 1480, 1481, 1482, 1485, 1486, 1483, 1484};
const Position TransportMovementInfo = {7.305609f, -0.095246f, 34.51022f, 0.0f};
const Position TeleportToTransportPosition = {661.0f,-1244.0f,288.0f,0.0f};
const Position TeleportToTransportPosition = {661.0f, -1244.0f, 288.0f, 0.0f};
const float BG_IC_SpiritGuidePos[MAX_NODE_TYPES+2][4] =
{
@@ -831,13 +831,13 @@ struct ICNodePoint
const ICNodePoint nodePointInitial[7] =
{
{BG_IC_GO_REFINERY_BANNER,GO_REFINERY_BANNER,TEAM_NEUTRAL,NODE_TYPE_REFINERY,{GO_ALLIANCE_BANNER_REFINERY,GO_ALLIANCE_BANNER_REFINERY_CONT,GO_HORDE_BANNER_REFINERY,GO_HORDE_BANNER_REFINERY_CONT},false,0,0,{BG_IC_REFINERY_UNCONTROLLED,BG_IC_REFINERY_CONFLICT_A,BG_IC_REFINERY_CONFLICT_H,BG_IC_REFINERY_CONTROLLED_A,BG_IC_REFINERY_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_REFINERY},
{BG_IC_GO_QUARRY_BANNER,GO_QUARRY_BANNER,TEAM_NEUTRAL,NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY,GO_ALLIANCE_BANNER_QUARRY_CONT,GO_HORDE_BANNER_QUARRY,GO_HORDE_BANNER_QUARRY_CONT},false,0,0,{BG_IC_QUARRY_UNCONTROLLED,BG_IC_QUARRY_CONFLICT_A,BG_IC_QUARRY_CONFLICT_H,BG_IC_QUARRY_CONTROLLED_A,BG_IC_QUARRY_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_QUARRY},
{BG_IC_GO_DOCKS_BANNER,GO_DOCKS_BANNER,TEAM_NEUTRAL,NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK,GO_ALLIANCE_BANNER_DOCK_CONT,GO_HORDE_BANNER_DOCK,GO_HORDE_BANNER_DOCK_CONT},false,0,0,{BG_IC_DOCKS_UNCONTROLLED, BG_IC_DOCKS_CONFLICT_A, BG_IC_DOCKS_CONFLICT_H, BG_IC_DOCKS_CONTROLLED_A,BG_IC_DOCKS_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_DOCKS},
{BG_IC_GO_HANGAR_BANNER,GO_HANGAR_BANNER,TEAM_NEUTRAL,NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR,GO_ALLIANCE_BANNER_HANGAR_CONT,GO_HORDE_BANNER_HANGAR,GO_HORDE_BANNER_HANGAR_CONT},false,0,0,{BG_IC_HANGAR_UNCONTROLLED,BG_IC_HANGAR_CONFLICT_A, BG_IC_HANGAR_CONFLICT_H, BG_IC_HANGAR_CONTROLLED_A, BG_IC_HANGAR_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_HANGAR},
{BG_IC_GO_WORKSHOP_BANNER,GO_WORKSHOP_BANNER,TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP,GO_ALLIANCE_BANNER_WORKSHOP_CONT,GO_HORDE_BANNER_WORKSHOP,GO_HORDE_BANNER_WORKSHOP_CONT},false,0,0,{BG_IC_WORKSHOP_UNCONTROLLED,BG_IC_WORKSHOP_CONFLICT_A,BG_IC_WORKSHOP_CONFLICT_H,BG_IC_WORKSHOP_CONTROLLED_A,BG_IC_WORKSHOP_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_WORKSHOP},
{BG_IC_GO_ALLIANCE_BANNER,GO_ALLIANCE_BANNER,TEAM_ALLIANCE,NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A,GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT,GO_HORDE_BANNER_GRAVEYARD_A,GO_HORDE_BANNER_GRAVEYARD_A_CONT},false,0,0,{BG_IC_ALLIANCE_KEEP_UNCONTROLLED,BG_IC_ALLIANCE_KEEP_CONFLICT_A,BG_IC_ALLIANCE_KEEP_CONFLICT_H,BG_IC_ALLIANCE_KEEP_CONTROLLED_A,BG_IC_ALLIANCE_KEEP_CONTROLLED_H},NODE_STATE_CONTROLLED_A,LANG_BG_IC_ALLIANCE_KEEP},
{BG_IC_GO_HORDE_BANNER,GO_HORDE_BANNER,TEAM_HORDE,NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H,GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT,GO_HORDE_BANNER_GRAVEYARD_H,GO_HORDE_BANNER_GRAVEYARD_H_CONT},false,0,0,{BG_IC_HORDE_KEEP_UNCONTROLLED,BG_IC_HORDE_KEEP_CONFLICT_A,BG_IC_HORDE_KEEP_CONFLICT_H,BG_IC_HORDE_KEEP_CONTROLLED_A,BG_IC_HORDE_KEEP_CONTROLLED_H},NODE_STATE_CONTROLLED_H,LANG_BG_IC_HORDE_KEEP},
{BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, TEAM_NEUTRAL, NODE_TYPE_REFINERY, {GO_ALLIANCE_BANNER_REFINERY, GO_ALLIANCE_BANNER_REFINERY_CONT, GO_HORDE_BANNER_REFINERY, GO_HORDE_BANNER_REFINERY_CONT}, false, 0, 0, {BG_IC_REFINERY_UNCONTROLLED, BG_IC_REFINERY_CONFLICT_A, BG_IC_REFINERY_CONFLICT_H, BG_IC_REFINERY_CONTROLLED_A, BG_IC_REFINERY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_REFINERY},
{BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, TEAM_NEUTRAL, NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY, GO_ALLIANCE_BANNER_QUARRY_CONT, GO_HORDE_BANNER_QUARRY, GO_HORDE_BANNER_QUARRY_CONT}, false, 0, 0, {BG_IC_QUARRY_UNCONTROLLED, BG_IC_QUARRY_CONFLICT_A, BG_IC_QUARRY_CONFLICT_H, BG_IC_QUARRY_CONTROLLED_A, BG_IC_QUARRY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_QUARRY},
{BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, TEAM_NEUTRAL, NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK, GO_ALLIANCE_BANNER_DOCK_CONT, GO_HORDE_BANNER_DOCK, GO_HORDE_BANNER_DOCK_CONT}, false, 0, 0, {BG_IC_DOCKS_UNCONTROLLED, BG_IC_DOCKS_CONFLICT_A, BG_IC_DOCKS_CONFLICT_H, BG_IC_DOCKS_CONTROLLED_A, BG_IC_DOCKS_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_DOCKS},
{BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, TEAM_NEUTRAL, NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR, GO_ALLIANCE_BANNER_HANGAR_CONT, GO_HORDE_BANNER_HANGAR, GO_HORDE_BANNER_HANGAR_CONT}, false, 0, 0, {BG_IC_HANGAR_UNCONTROLLED, BG_IC_HANGAR_CONFLICT_A, BG_IC_HANGAR_CONFLICT_H, BG_IC_HANGAR_CONTROLLED_A, BG_IC_HANGAR_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_HANGAR},
{BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP, GO_ALLIANCE_BANNER_WORKSHOP_CONT, GO_HORDE_BANNER_WORKSHOP, GO_HORDE_BANNER_WORKSHOP_CONT}, false, 0, 0, {BG_IC_WORKSHOP_UNCONTROLLED, BG_IC_WORKSHOP_CONFLICT_A, BG_IC_WORKSHOP_CONFLICT_H, BG_IC_WORKSHOP_CONTROLLED_A, BG_IC_WORKSHOP_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_WORKSHOP},
{BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, TEAM_ALLIANCE, NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A, GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT, GO_HORDE_BANNER_GRAVEYARD_A, GO_HORDE_BANNER_GRAVEYARD_A_CONT}, false, 0, 0, {BG_IC_ALLIANCE_KEEP_UNCONTROLLED, BG_IC_ALLIANCE_KEEP_CONFLICT_A, BG_IC_ALLIANCE_KEEP_CONFLICT_H, BG_IC_ALLIANCE_KEEP_CONTROLLED_A, BG_IC_ALLIANCE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_A, LANG_BG_IC_ALLIANCE_KEEP},
{BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, TEAM_HORDE, NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H, GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT, GO_HORDE_BANNER_GRAVEYARD_H, GO_HORDE_BANNER_GRAVEYARD_H_CONT}, false, 0, 0, {BG_IC_HORDE_KEEP_UNCONTROLLED, BG_IC_HORDE_KEEP_CONFLICT_A, BG_IC_HORDE_KEEP_CONFLICT_H, BG_IC_HORDE_KEEP_CONTROLLED_A, BG_IC_HORDE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_H, LANG_BG_IC_HORDE_KEEP},
};
enum HonorRewards
@@ -869,7 +869,7 @@ class BattlegroundIC : public Battleground
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleground();
void SpawnLeader(uint32 teamid);
@@ -908,7 +908,7 @@ class BattlegroundIC : public Battleground
Transport* gunshipAlliance;
Transport* gunshipHorde;
uint32 GetNextBanner(ICNodePoint* nodePoint,uint32 team, bool returnDefinitve);
uint32 GetNextBanner(ICNodePoint* nodePoint, uint32 team, bool returnDefinitve);
uint32 GetGateIDFromEntry(uint32 id)
{
@@ -957,7 +957,7 @@ class BattlegroundIC : public Battleground
void UpdateNodeWorldState(ICNodePoint* nodePoint);
void HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture);
void HandleContestedNodes(ICNodePoint* nodePoint);
Transport* CreateTransport(uint32 goEntry,uint32 period);
Transport* CreateTransport(uint32 goEntry, uint32 period);
void SendTransportInit(Player* player);
};
#endif
@@ -104,7 +104,7 @@ void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer)
return;
}
Battleground::HandleKillPlayer(player,killer);
Battleground::HandleKillPlayer(player, killer);
UpdateArenaWorldState();
CheckArenaWinConditions();
@@ -112,7 +112,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;
}
@@ -135,7 +135,7 @@ void BattlegroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
// HandleTriggerBuff(buff_guid, Source);
}
void BattlegroundNA::FillInitialWorldStates(WorldPacket &data)
@@ -57,7 +57,7 @@ void BattlegroundRB::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
}
void BattlegroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattlegroundRB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
{
}
@@ -75,5 +75,5 @@ void BattlegroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
if (itr == m_PlayerScores.end()) // player not found...
return;
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
}
@@ -41,7 +41,7 @@ class BattlegroundRB : public Battleground
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
/* Scorekeeping */
@@ -104,7 +104,7 @@ void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer)
return;
}
Battleground::HandleKillPlayer(player,killer);
Battleground::HandleKillPlayer(player, killer);
UpdateArenaWorldState();
CheckArenaWinConditions();
@@ -112,7 +112,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;
}
@@ -136,7 +136,7 @@ void BattlegroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
// HandleTriggerBuff(buff_guid, Source);
}
void BattlegroundRL::FillInitialWorldStates(WorldPacket &data)
@@ -46,7 +46,7 @@ BattlegroundSA::~BattlegroundSA()
void BattlegroundSA::Reset()
{
TotalTime = 0;
Attackers = ((urand(0,1)) ? TEAM_ALLIANCE : TEAM_HORDE);
Attackers = ((urand(0, 1)) ? TEAM_ALLIANCE : TEAM_HORDE);
for (uint8 i = 0; i <= 5; i++)
GateStatus[i] = BG_SA_GATE_OK;
ShipsStarted = false;
@@ -83,7 +83,7 @@ bool BattlegroundSA::ResetObjs()
for (uint8 i = 0; i < BG_SA_BOAT_ONE; i++)
{
if (!AddObject(i,BG_SA_ObjEntries[i],BG_SA_ObjSpawnlocs[i][0],BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3],0,0,0,0,RESPAWN_ONE_DAY))
if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
}
@@ -99,18 +99,18 @@ bool BattlegroundSA::ResetObjs()
boatid= Attackers ? BG_SA_BOAT_TWO_H : BG_SA_BOAT_TWO_A;
break;
}
if (!AddObject(i,boatid,BG_SA_ObjSpawnlocs[i][0],
if (!AddObject(i, boatid, BG_SA_ObjSpawnlocs[i][0],
BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2]+(Attackers ? -3.750f: 0),
BG_SA_ObjSpawnlocs[i][3],0,0,0,0,RESPAWN_ONE_DAY))
BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
}
for (uint8 i = BG_SA_SIGIL_1; i < BG_SA_CENTRAL_FLAG; i++)
{
if (!AddObject(i,BG_SA_ObjEntries[i],
BG_SA_ObjSpawnlocs[i][0],BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY))
if (!AddObject(i, BG_SA_ObjEntries[i],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
}
@@ -125,8 +125,8 @@ bool BattlegroundSA::ResetObjs()
for (uint8 i = 0; i < BG_SA_NPC_SPARKLIGHT; i++)
{
if (!AddCreature(BG_SA_NpcEntries[i], i, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
BG_SA_NpcSpawnlocs[i][0],BG_SA_NpcSpawnlocs[i][1],
BG_SA_NpcSpawnlocs[i][2],BG_SA_NpcSpawnlocs[i][3],600))
BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1],
BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3], 600))
return false;
}
@@ -156,7 +156,7 @@ bool BattlegroundSA::ResetObjs()
if (!sg)
{
sLog->outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]);
sLog->outError("SOTA: Can't find GY entry %u", BG_SA_GYEntries[i]);
return false;
}
@@ -169,7 +169,7 @@ bool BattlegroundSA::ResetObjs()
{
GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE);
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((Attackers == TEAM_HORDE)? ALLIANCE : HORDE)))
sLog->outError("SOTA: couldn't spawn GY: %u",i);
sLog->outError("SOTA: couldn't spawn GY: %u", i);
}
}
@@ -179,7 +179,7 @@ bool BattlegroundSA::ResetObjs()
AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1:0)),
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY);
0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF);
}
@@ -188,7 +188,7 @@ bool BattlegroundSA::ResetObjs()
AddObject(i, BG_SA_ObjEntries[i],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY);
0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, defF);
}
@@ -197,7 +197,7 @@ bool BattlegroundSA::ResetObjs()
AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY);
0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF);
}
@@ -220,8 +220,8 @@ bool BattlegroundSA::ResetObjs()
UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 0);
UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 0);
UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN,1);
UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN,0);
UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 1);
UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 0);
}
else
{
@@ -233,8 +233,8 @@ bool BattlegroundSA::ResetObjs()
UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 1);
UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 1);
UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN,0);
UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN,1);
UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 0);
UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 1);
}
UpdateWorldState(BG_SA_PURPLE_GATEWS, 1);
@@ -443,9 +443,9 @@ void BattlegroundSA::AddPlayer(Player *plr)
{
if (plr->GetTeamId() == Attackers)
{
plr->CastSpell(plr,12438,true);//Without this player falls before boat loads...
plr->CastSpell(plr, 12438, true);//Without this player falls before boat loads...
if (urand(0,1))
if (urand(0, 1))
plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0);
else
plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0);
@@ -465,7 +465,7 @@ void BattlegroundSA::AddPlayer(Player *plr)
m_PlayerScores[plr->GetGUID()] = sc;
}
void BattlegroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattlegroundSA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
{
}
@@ -487,7 +487,7 @@ void BattlegroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
else if (type == SCORE_DESTROYED_WALL)
((BattlegroundSAScore*)itr->second)->gates_destroyed += value;
else
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
}
void BattlegroundSA::TeleportPlayers()
@@ -511,9 +511,9 @@ void BattlegroundSA::TeleportPlayers()
if (plr->GetTeamId() == Attackers)
{
plr->CastSpell(plr,12438,true); //Without this player falls before boat loads...
plr->CastSpell(plr, 12438, true); //Without this player falls before boat loads...
if (urand(0,1))
if (urand(0, 1))
plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0);
else
plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0);
@@ -635,9 +635,9 @@ void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroye
if (i < 5)
DelObject(i+9);
UpdatePlayerScore(pl,SCORE_DESTROYED_WALL, 1);
UpdatePlayerScore(pl, SCORE_DESTROYED_WALL, 1);
if (rewardHonor)
UpdatePlayerScore(pl,SCORE_BONUS_HONOR,(GetBonusHonorFromKill(1)));
UpdatePlayerScore(pl, SCORE_BONUS_HONOR, (GetBonusHonorFromKill(1)));
}
}
}
@@ -648,9 +648,9 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player)
WorldSafeLocsEntry const* ret;
WorldSafeLocsEntry const* closest;
float dist, nearest;
float x,y,z;
float x, y, z;
player->GetPosition(x,y,z);
player->GetPosition(x, y, z);
if (player->GetTeamId() == Attackers)
safeloc = BG_SA_GYEntries[BG_SA_BEACH_GY];
@@ -727,9 +727,9 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
case BG_SA_LEFT_CAPTURABLE_GY:
flag = BG_SA_LEFT_FLAG;
DelObject(flag);
AddObject(flag,(BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)),
BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY);
AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)),
BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
npc = BG_SA_NPC_RIGSPARK;
AddCreature(BG_SA_NpcEntries[npc], npc, Attackers,
@@ -747,8 +747,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
flag = BG_SA_RIGHT_FLAG;
DelObject(flag);
AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)),
BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY);
BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
npc = BG_SA_NPC_SPARKLIGHT;
AddCreature(BG_SA_NpcEntries[npc], npc, Attackers,
@@ -766,8 +766,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
flag = BG_SA_CENTRAL_FLAG;
DelObject(flag);
AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)),
BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY);
BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
@@ -170,10 +170,10 @@ const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
{ 1236.213f, 92.287f, 64.965f, 5.751f },
{ 1215.11f, 57.772f, 64.739f, 5.78f } ,
//Demolishers
{ 1611.597656f,-117.270073f,8.719355f,2.513274f},
{ 1575.562500f,-158.421875f,5.024450f,2.129302f},
{ 1618.047729f,61.424641f,7.248210f,3.979351f},
{ 1575.103149f,98.873344f,2.830360f,3.752458f},
{ 1611.597656f, -117.270073f, 8.719355f, 2.513274f},
{ 1575.562500f, -158.421875f, 5.024450f, 2.129302f},
{ 1618.047729f, 61.424641f, 7.248210f, 3.979351f},
{ 1575.103149f, 98.873344f, 2.830360f, 3.752458f},
//trigger
{ 1453.49f, -250.453f, 30.896f, 4.2883f},
{ 1377.05f, 97.036f, 30.8605f, 2.46539f},
@@ -240,19 +240,19 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] =
{ 1230.75f, -210.724f, 67.611f, 0.5023f },
{ 1217.8f, 79.532f, 66.58f, 5.745f },
//Flagpoles
{ 1215.114258f,-65.711861f,70.084267f,-3.124123f},
{1338.863892f,-153.336533f,30.895121f,-2.530723f},
{1309.124268f,9.410645f,30.893402f,-1.623156f},
{ 1215.114258f, -65.711861f, 70.084267f, -3.124123f},
{1338.863892f, -153.336533f, 30.895121f, -2.530723f},
{1309.124268f, 9.410645f, 30.893402f, -1.623156f},
//Flags
{ 1215.108032f,-65.715767f,70.084267f,-3.124123f},
{ 1338.859253f,-153.327316f,30.895077f,-2.530723f},
{ 1309.192017f,9.416233f,30.893402f,1.518436f},
{ 1215.108032f, -65.715767f, 70.084267f, -3.124123f},
{ 1338.859253f, -153.327316f, 30.895077f, -2.530723f},
{ 1309.192017f, 9.416233f, 30.893402f, 1.518436f},
//Portal
{1468.380005f, -225.798996f, 30.896200f, 0.0f}, //blue
{1394.270020f, 72.551399f, 31.054300f, 0.0f},//green
{1065.260010f, -89.79501f, 81.073402f, 0.0f},//yellow
{1216.069946f, 47.904301f, 54.278198f,0.0f}, //purple
{1255.569946f, -233.548996f, 56.43699f, 0.0f},//red
{1394.270020f, 72.551399f, 31.054300f, 0.0f}, //green
{1065.260010f, -89.79501f, 81.073402f, 0.0f}, //yellow
{1216.069946f, 47.904301f, 54.278198f, 0.0f}, //purple
{1255.569946f, -233.548996f, 56.43699f, 0.0f}, //red
//Bombs
{1333.45f, 211.354f, 31.0538f, 5.03666f},
{1334.29f, 209.582f, 31.0532f, 1.28088f},
@@ -346,8 +346,8 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] =
190723,
192549,
192834,
0,// Boat
0,// Boat
0, // Boat
0, // Boat
192687,
192685,
192689,
@@ -481,7 +481,7 @@ class BattlegroundSA : public Battleground
void EndBattleground(uint32 winner);
/// CAlled when a player leave battleground
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
/* Scorekeeping */
@@ -566,7 +566,7 @@ class BattlegroundSA : public Battleground
bool SignaledRoundTwoHalfMin;
/// for know if second round has been init
bool InitSecondRound;
std::map<uint32/*id*/,uint32/*timer*/> DemoliserRespawnList;
std::map<uint32/*id*/, uint32/*timer*/> DemoliserRespawnList;
};
#endif
@@ -38,13 +38,13 @@ enum BG_WSG_Rewards
};
uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = {
{20,40,40}, // normal honor
{60,40,80} // holiday
{20, 40, 40}, // normal honor
{60, 40, 80} // holiday
};
uint32 BG_WSG_Reputation[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = {
{0,35,0}, // normal honor
{0,45,0} // holiday
{0, 35, 0}, // normal honor
{0, 45, 0} // holiday
};
BattlegroundWS::BattlegroundWS()
@@ -143,9 +143,9 @@ void BattlegroundWS::Update(uint32 diff)
if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes
{
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true);
plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true);
plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
m_FlagDebuffState = 1;
}
else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes
@@ -153,12 +153,12 @@ void BattlegroundWS::Update(uint32 diff)
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
{
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true);
plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
}
if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
{
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true);
plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
}
m_FlagDebuffState = 2;
}
@@ -242,7 +242,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
if (GetStatus() != STATUS_IN_PROGRESS)
return;
RespawnFlag(team,false);
RespawnFlag(team, false);
if (team == ALLIANCE)
{
SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY);
@@ -260,9 +260,9 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
if (obj)
obj->Delete();
else
sLog->outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team)));
sLog->outError("unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
SetDroppedFlagGUID(0,team);
SetDroppedFlagGUID(0, team);
m_BothFlagsKept = false;
}
@@ -509,9 +509,9 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER;
UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER);
if (m_FlagDebuffState == 1)
Source->CastSpell(Source,WS_SPELL_FOCUSED_ASSAULT,true);
Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true);
if (m_FlagDebuffState == 2)
Source->CastSpell(Source,WS_SPELL_BRUTAL_ASSAULT,true);
Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true);
UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1);
}
//called in HandleGameObjectUseOpcode:
@@ -543,9 +543,9 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER;
UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER);
if (m_FlagDebuffState == 1)
Source->CastSpell(Source,WS_SPELL_FOCUSED_ASSAULT,true);
Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true);
if (m_FlagDebuffState == 2)
Source->CastSpell(Source,WS_SPELL_BRUTAL_ASSAULT,true);
Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true);
UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1);
}
//called in HandleGameObjectUseOpcode:
@@ -652,7 +652,7 @@ void BattlegroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
}
//if (buff_guid)
// HandleTriggerBuff(buff_guid,Source);
// HandleTriggerBuff(buff_guid, Source);
}
bool BattlegroundWS::SetupBattleground()
+5 -5
View File
@@ -76,7 +76,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
uint64 banned_guid = atol(*iter);
if (banned_guid)
{
sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid);
sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) loaded banned guid:" UI64FMTD "", name.c_str(), banned_guid);
banned.insert(banned_guid);
}
}
@@ -88,7 +88,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
stmt->setString(0, name);
stmt->setUInt32(1, m_Team);
CharacterDatabase.Execute(stmt);
sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) saved in database", name.c_str());
sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) saved in database", name.c_str());
}
m_IsSaved = true;
@@ -116,7 +116,7 @@ void Channel::UpdateChannelInDB() const
stmt->setUInt32(5, m_Team);
CharacterDatabase.Execute(stmt);
sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) updated in database", m_name.c_str());
sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) updated in database", m_name.c_str());
}
}
@@ -137,7 +137,7 @@ void Channel::CleanOldChannelsInDB()
stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) * DAY);
CharacterDatabase.Execute(stmt);
sLog->outDebug(LOG_FILTER_CHATSYS,"Cleaned out unused custom chat channels.");
sLog->outDebug(LOG_FILTER_CHATSYS, "Cleaned out unused custom chat channels.");
}
}
@@ -576,7 +576,7 @@ void Channel::List(Player* player)
}
}
data.put<uint32>(pos,count);
data.put<uint32>(pos, count);
SendToOne(&data, p);
}
+5 -5
View File
@@ -44,12 +44,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, team);
Channel *nchan = new Channel(name, channel_id, team);
channels[wname] = nchan;
return nchan;
}
@@ -60,7 +60,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);
@@ -70,7 +70,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);
}
@@ -83,7 +83,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);
+1 -1
View File
@@ -31,7 +31,7 @@ class ChannelMgr
{
public:
uint32 team;
typedef std::map<std::wstring,Channel*> ChannelMap;
typedef std::map<std::wstring, Channel*> ChannelMap;
ChannelMgr() {team = 0;}
~ChannelMgr();
+43 -43
View File
@@ -240,28 +240,28 @@ ChatCommand * ChatHandler::getCommandTable()
static ChatCommand serverIdleRestartCommandTable[] =
{
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand serverIdleShutdownCommandTable[] =
{
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand serverRestartCommandTable[] =
{
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand serverShutdownCommandTable[] =
{
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
@@ -401,7 +401,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL },
{ "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL },
{ "combatstop", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL },
{ "flusharenapoints",SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL },
{ "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL },
{ "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL },
{ "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL },
@@ -443,7 +443,7 @@ ChatCommand * ChatHandler::getCommandTable()
added += appendCommandTable(commandTableCache + added, *it);
}
QueryResult result = WorldDatabase.Query("SELECT name,security,help FROM command");
QueryResult result = WorldDatabase.Query("SELECT name, security, help FROM command");
if (result)
{
do
@@ -499,7 +499,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 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)
@@ -620,7 +620,7 @@ void ChatHandler::PSendSysMessage(int32 entry, ...)
va_list ap;
char str [2048];
va_start(ap, entry);
vsnprintf(str,2048,format, ap);
vsnprintf(str, 2048, format, ap);
va_end(ap);
SendSysMessage(str);
}
@@ -630,7 +630,7 @@ void ChatHandler::PSendSysMessage(const char *format, ...)
va_list ap;
char str [2048];
va_start(ap, format);
vsnprintf(str,2048,format, ap);
vsnprintf(str, 2048, format, ap);
va_end(ap);
SendSysMessage(str);
}
@@ -661,7 +661,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
if (!hasStringAbbr(table[j].Name, cmd.c_str()))
continue;
if (strcmp(table[j].Name,cmd.c_str()) != 0)
if (strcmp(table[j].Name, cmd.c_str()) != 0)
continue;
else
{
@@ -683,7 +683,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
else
SendSysMessage(LANG_CMD_SYNTAX);
ShowHelpForCommand(table[i].ChildCommands,text);
ShowHelpForCommand(table[i].ChildCommands, text);
}
return true;
@@ -704,8 +704,8 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
{
Player* p = m_session->GetPlayer();
uint64 sel_guid = p->GetSelection();
sLog->outCommand(m_session->GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]",
fullcmd.c_str(),p->GetName(),m_session->GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]",
fullcmd.c_str(), p->GetName(), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(),
GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName() : "", GUID_LOPART(sel_guid));
}
}
@@ -756,12 +756,12 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
// expected subcommand by full name DB content
else if (*text)
{
sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.",text,fullcommand.c_str());
sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
return false;
}
if (table[i].SecurityLevel != security)
sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u",fullcommand.c_str(),table[i].SecurityLevel,security);
sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
table[i].SecurityLevel = security;
table[i].Help = help;
@@ -772,9 +772,9 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
if (!cmd.empty())
{
if (table == getCommandTable())
sLog->outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str());
sLog->outErrorDb("Table `command` have not existed command '%s', skip.", cmd.c_str());
else
sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str());
sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
}
return false;
@@ -910,10 +910,10 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, ch
if (table == getCommandTable())
{
SendSysMessage(LANG_AVIABLE_CMD);
PSendSysMessage("%s",list.c_str());
PSendSysMessage("%s", list.c_str());
}
else
PSendSysMessage(LANG_SUBCMDS_LIST,cmd,list.c_str());
PSendSysMessage(LANG_SUBCMDS_LIST, cmd, list.c_str());
return true;
}
@@ -944,7 +944,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd)
SendSysMessage(table[i].Help.c_str());
if (table[i].ChildCommands)
if (ShowHelpForSubCommands(table[i].ChildCommands,table[i].Name,subcmd ? subcmd : ""))
if (ShowHelpForSubCommands(table[i].ChildCommands, table[i].Name, subcmd ? subcmd : ""))
return true;
return !table[i].Help.empty();
@@ -965,14 +965,14 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd)
SendSysMessage(table[i].Help.c_str());
if (table[i].ChildCommands)
if (ShowHelpForSubCommands(table[i].ChildCommands,"",""))
if (ShowHelpForSubCommands(table[i].ChildCommands, "", ""))
return true;
return !table[i].Help.empty();
}
}
return ShowHelpForSubCommands(table,"",cmd);
return ShowHelpForSubCommands(table, "", cmd);
}
//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
@@ -1079,7 +1079,7 @@ Unit* ChatHandler::getSelectedUnit()
if (guid == 0)
return m_session->GetPlayer();
return ObjectAccessor::GetUnit(*m_session->GetPlayer(),guid);
return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
}
WorldObject *ChatHandler::getSelectedObject()
@@ -1092,7 +1092,7 @@ WorldObject *ChatHandler::getSelectedObject()
if (guid == 0)
return GetNearbyGameObject();
return ObjectAccessor::GetUnit(*m_session->GetPlayer(),guid);
return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
}
Creature* ChatHandler::getSelectedCreature()
@@ -1100,7 +1100,7 @@ Creature* ChatHandler::getSelectedCreature()
if (!m_session)
return NULL;
return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection());
return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(), m_session->GetPlayer()->GetSelection());
}
char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1)
@@ -1132,9 +1132,9 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
if (!cLinkType)
return NULL; // end of data
if (strcmp(cLinkType,linkType) != 0)
if (strcmp(cLinkType, linkType) != 0)
{
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after retturn from function
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after retturn from function
SendSysMessage(LANG_WRONG_LINK_TYPE);
return NULL;
}
@@ -1147,7 +1147,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
*something1 = strtok(NULL, ":|"); // extract something
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
return cKey;
}
@@ -1193,7 +1193,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
for (int i = 0; linkTypes[i]; ++i)
{
if (strcmp(cLinkType,linkTypes[i]) == 0)
if (strcmp(cLinkType, linkTypes[i]) == 0)
{
char* cKeys = strtok(NULL, "|"); // extract keys and values
char* cKeysTail = strtok(NULL, "");
@@ -1203,14 +1203,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
*something1 = strtok(NULL, ":|"); // extract something
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
if (found_idx)
*found_idx = i;
return cKey;
}
}
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
SendSysMessage(LANG_WRONG_LINK_TYPE);
return NULL;
}
@@ -1228,7 +1228,7 @@ GameObject* ChatHandler::GetNearbyGameObject()
return obj;
}
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry)
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry)
{
if (!m_session)
return NULL;
@@ -1244,8 +1244,8 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
Trinity::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl,obj,go_check);
Trinity::GameObjectWithDbGUIDCheck go_check(*pl, lowguid);
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check);
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
cell.Visit(p, object_checker, *pl->GetMap());
@@ -1278,11 +1278,11 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
// number or [name] Shift-click form |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r
// number or [name] Shift-click form |color|Hglyph:glyph_slot_id:glyph_prop_id|h[%s]|h|r
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
// number or [name] Shift-click form |color|Htalent:talent_id,rank|h[name]|h|r
// number or [name] Shift-click form |color|Htrade:spell_id,skill_id,max_value,cur_value|h[name]|h|r
// number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r
// number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r
int type = 0;
char* param1_str = NULL;
char* idS = extractKeyFromLink(text,spellKeys,&type,&param1_str);
char* idS = extractKeyFromLink(text, spellKeys, &type, &param1_str);
if (!idS)
return 0;
@@ -1330,7 +1330,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 false;
@@ -1364,7 +1364,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
// |color|Hcreature:creature_guid|h[name]|h|r
// |color|Hgameobject:go_guid|h[name]|h|r
// |color|Hplayer:name|h[name]|h|r
char* idS = extractKeyFromLink(text,guidKeys,&type);
char* idS = extractKeyFromLink(text, guidKeys, &type);
if (!idS)
return 0;
@@ -1389,7 +1389,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
uint32 lowguid = (uint32)atol(idS);
if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid))
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT);
return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT);
else
return 0;
}
@@ -1398,7 +1398,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
uint32 lowguid = (uint32)atol(idS);
if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT);
return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT);
else
return 0;
}
@@ -1411,7 +1411,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
std::string ChatHandler::extractPlayerNameFromLink(char* text)
{
// |color|Hplayer:name|h[name]|h|r
char* name_str = extractKeyFromLink(text,"Hplayer");
char* name_str = extractKeyFromLink(text, "Hplayer");
if (!name_str)
return "";
@@ -1422,7 +1422,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text)
return name;
}
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/,std::string* player_name /*= NULL*/)
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/, std::string* player_name /*= NULL*/)
{
if (args && *args)
{
+6 -6
View File
@@ -63,14 +63,14 @@ class ChatHandler
FillMessageData(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, 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 *GetTrinityString(int32 entry) const;
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, ...);
std::string PGetParseString(int32 entry, ...) const;
@@ -118,7 +118,7 @@ class ChatHandler
std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); }
GameObject* GetNearbyGameObject();
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry);
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry);
bool HasSentErrorMessage() { return sentErrorMessage;}
void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
static bool LoadCommandTable() { return load_command_table;}
@@ -352,11 +352,11 @@ class ChatHandler
// Utility methods for commands
bool LookupPlayerSearchCommand(QueryResult result, int32 limit);
bool HandleBanListHelper(QueryResult result);
bool HandleBanHelper(BanMode mode,char const* args);
bool HandleBanHelper(BanMode mode, char const* args);
bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
bool HandleUnBanHelper(BanMode mode,char const* args);
bool HandleUnBanHelper(BanMode mode, char const* args);
void HandleCharacterLevel(Player* player, uint64 player_guid, uint32 oldlevel, uint32 newlevel);
void HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id);
void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id);
// Stores informations about a deleted character
struct DeletedInfo
+1 -1
View File
@@ -37,7 +37,7 @@
// |color|Hquest:quest_id:quest_level|h[name]|h|r - client, quest list name shift-click
// |color|Hskill:skill_id|h[name]|h|r
// |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click
// |color|Htalent:talent_id,rank|h[name]|h|r - client, talent icon shift-click
// |color|Htalent:talent_id, rank|h[name]|h|r - client, talent icon shift-click
// |color|Htaxinode:id|h[name]|h|r
// |color|Htele:id|h[name]|h|r
// |color|Htitle:id|h[name]|h|r
+37 -37
View File
@@ -78,7 +78,7 @@ bool ChatHandler::HandleGMAnnounceCommand(const char* args)
if (!*args)
return false;
sWorld->SendGMText(LANG_GM_BROADCAST,args);
sWorld->SendGMText(LANG_GM_BROADCAST, args);
return true;
}
@@ -121,7 +121,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
{
uint64 guid = extractGuidFromLink((char*)args);
if (guid)
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(),guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
if (!obj)
{
@@ -145,7 +145,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
Cell cell(cell_val);
uint32 zone_id, area_id;
obj->GetZoneAndAreaId(zone_id,area_id);
obj->GetZoneAndAreaId(zone_id, area_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(obj->GetMapId());
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zone_id);
@@ -154,7 +154,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
float zone_x = obj->GetPositionX();
float zone_y = obj->GetPositionY();
Map2ZoneCoordinates(zone_x,zone_y,zone_id);
Map2ZoneCoordinates(zone_x, zone_y, zone_id);
Map const *map = obj->GetMap();
float ground_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), MAX_HEIGHT);
@@ -166,8 +166,8 @@ bool ChatHandler::HandleGPSCommand(const char* args)
int gx = 63 - p.x_coord;
int gy = 63 - p.y_coord;
uint32 have_map = Map::ExistMap(obj->GetMapId(),gx,gy) ? 1 : 0;
uint32 have_vmap = Map::ExistVMap(obj->GetMapId(),gx,gy) ? 1 : 0;
uint32 have_map = Map::ExistMap(obj->GetMapId(), gx, gy) ? 1 : 0;
uint32 have_vmap = Map::ExistVMap(obj->GetMapId(), gx, gy) ? 1 : 0;
if(have_vmap)
{
@@ -202,7 +202,7 @@ bool ChatHandler::HandleSummonCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
Player* _player = m_session->GetPlayer();
@@ -234,7 +234,7 @@ bool ChatHandler::HandleSummonCommand(const char* args)
// only allow if gm mode is on
if (!_player->isGameMaster())
{
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,nameLink.c_str());
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -262,13 +262,13 @@ bool ChatHandler::HandleSummonCommand(const char* args)
(m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()))
// the last check is a bit excessive, but let it be, just in case
{
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,nameLink.c_str());
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
}
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),"");
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
if (needReportToTarget(target))
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str());
@@ -283,9 +283,9 @@ bool ChatHandler::HandleSummonCommand(const char* args)
target->SaveRecallPosition();
// before GM
float x,y,z;
m_session->GetPlayer()->GetClosePoint(x,y,z,target->GetObjectSize());
target->TeleportTo(m_session->GetPlayer()->GetMapId(),x,y,z,target->GetOrientation());
float x, y, z;
m_session->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
target->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
target->SetPhaseMask(m_session->GetPlayer()->GetPhaseMask(), true);
}
else
@@ -296,7 +296,7 @@ bool ChatHandler::HandleSummonCommand(const char* args)
std::string nameLink = playerLink(target_name);
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),GetTrinityString(LANG_OFFLINE));
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetTrinityString(LANG_OFFLINE));
// in point where GM stay
Player::SavePositionInDB(m_session->GetPlayer()->GetMapId(),
@@ -317,7 +317,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
Player* _player = m_session->GetPlayer();
@@ -342,7 +342,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
// only allow if gm mode is on
if (!_player->isGameMaster())
{
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chrNameLink.c_str());
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -367,7 +367,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
// we are in group, we can go only if we are in the player group
if (_player->GetGroup() != target->GetGroup())
{
PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chrNameLink.c_str());
PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -377,7 +377,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
// we are not in group, let's verify our GM mode
if (!_player->isGameMaster())
{
PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chrNameLink.c_str());
PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -415,8 +415,8 @@ bool ChatHandler::HandleAppearCommand(const char* args)
_player->SaveRecallPosition();
// to point to see at target with same orientation
float x,y,z;
target->GetContactPoint(_player,x,y,z);
float x, y, z;
target->GetContactPoint(_player, x, y, z);
_player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
_player->SetPhaseMask(target->GetPhaseMask(), true);
@@ -432,10 +432,10 @@ bool ChatHandler::HandleAppearCommand(const char* args)
PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
// to point where player stay (if loaded)
float x,y,z,o;
float x, y, z, o;
uint32 map;
bool in_flight;
if (!Player::LoadPositionFromDB(map,x,y,z,o,in_flight,target_guid))
if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, target_guid))
return false;
// stop flight if need
@@ -448,7 +448,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
else
_player->SaveRecallPosition();
_player->TeleportTo(map, x, y, z,_player->GetOrientation());
_player->TeleportTo(map, x, y, z, _player->GetOrientation());
}
return true;
@@ -458,7 +458,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
bool ChatHandler::HandleRecallCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args,&target))
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
@@ -537,7 +537,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
std::string namepart = args;
std::wstring wnamepart;
if (!Utf8toWStr (namepart,wnamepart))
if (!Utf8toWStr (namepart, wnamepart))
return false;
bool found = false;
@@ -621,7 +621,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
std::string namepart = str;
std::wstring wnamepart;
if (!Utf8toWStr(namepart,wnamepart))
if (!Utf8toWStr(namepart, wnamepart))
return false;
// converting string that we try to find to lower case
@@ -655,7 +655,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
if (reply.str().empty())
SendSysMessage(LANG_COMMAND_TELE_NOLOCATION);
else
PSendSysMessage(LANG_COMMAND_TELE_LOCATION,reply.str().c_str());
PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str().c_str());
if (limitReached)
PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
@@ -709,7 +709,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
char* tail1 = strtok(NULL, "");
@@ -733,12 +733,12 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
std::string text = msgText;
// from console show not existed sender
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
//- TODO: Fix poor design
SQLTransaction trans = CharacterDatabase.BeginTransaction();
MailDraft(subject, text)
.SendMailTo(trans, MailReceiver(target,GUID_LOPART(target_guid)),sender);
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(target_guid)), sender);
CharacterDatabase.CommitTransaction(trans);
@@ -751,7 +751,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
bool ChatHandler::HandleGroupSummonCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args,&target))
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
@@ -764,7 +764,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
if (!grp)
{
PSendSysMessage(LANG_NOT_IN_GROUP,nameLink.c_str());
PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
SetSentErrorMessage(true);
return false;
}
@@ -810,13 +810,13 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
if (plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId())
{
// cannot summon from instance to instance
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,plNameLink.c_str());
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str());
SetSentErrorMessage(true);
return false;
}
}
PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(),"");
PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
if (needReportToTarget(pl))
ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
@@ -831,9 +831,9 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
pl->SaveRecallPosition();
// before GM
float x,y,z;
m_session->GetPlayer()->GetClosePoint(x,y,z,pl->GetObjectSize());
pl->TeleportTo(m_session->GetPlayer()->GetMapId(),x,y,z,pl->GetOrientation());
float x, y, z;
m_session->GetPlayer()->GetClosePoint(x, y, z, pl->GetObjectSize());
pl->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, pl->GetOrientation());
}
return true;
+40 -40
View File
@@ -48,7 +48,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
{
char* nameStr;
char* delayStr;
extractOptFirstArg((char*)args,&nameStr,&delayStr);
extractOptFirstArg((char*)args, &nameStr, &delayStr);
if (!delayStr)
return false;
@@ -60,7 +60,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
return false;
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
@@ -73,7 +73,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
uint32 notspeaktime = (uint32) atoi(delayStr);
// must have strong lesser security level
if (HasLowerSecurity (target,target_guid,true))
if (HasLowerSecurity (target, target_guid, true))
return false;
time_t mutetime = time(NULL) + notspeaktime*60;
@@ -81,7 +81,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if (target)
target->GetSession()->m_muteTime = mutetime;
LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'",uint64(mutetime), account_id);
LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'", uint64(mutetime), account_id);
if (target)
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str());
@@ -99,7 +99,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
@@ -110,7 +110,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
target = session->GetPlayer();
// must have strong lesser security level
if (HasLowerSecurity (target,target_guid,true))
if (HasLowerSecurity (target, target_guid, true))
return false;
if (target)
@@ -236,7 +236,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
uint32 accId = 0;
@@ -289,11 +289,11 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
uint32 security = 0;
std::string last_login = GetTrinityString(LANG_ERROR);
QueryResult result = LoginDatabase.PQuery("SELECT a.username,aa.gmlevel,a.email,a.last_ip,a.last_login "
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login "
"FROM account a "
"LEFT JOIN account_access aa "
"ON (a.id = aa.id) "
"WHERE a.id = '%u'",accId);
"WHERE a.id = '%u'", accId);
if (result)
{
Field* fields = result->Fetch();
@@ -348,7 +348,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
case CLASS_DRUID: Class_s = "Druid"; break;
}
std::string timeStr = secsToTimeString(total_player_time,true,true);
std::string timeStr = secsToTimeString(total_player_time, true, true);
uint32 gold = money /GOLD;
uint32 silv = (money % GOLD) / SILVER;
uint32 copp = (money % GOLD) % SILVER;
@@ -363,7 +363,7 @@ bool ChatHandler::HandleCharacterRenameCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
if (target)
@@ -396,7 +396,7 @@ bool ChatHandler::HandleCharacterCustomizeCommand(const char* args)
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
if (target)
@@ -422,7 +422,7 @@ bool ChatHandler::HandleCharacterChangeFactionCommand(const char * args)
uint64 target_guid;
std::string target_name;
if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if(!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
if(target)
@@ -449,7 +449,7 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
Player* target;
uint64 target_guid;
std::string target_name;
if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
if(!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
if(target)
@@ -474,7 +474,7 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
bool ChatHandler::HandleCharacterReputationCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args,&target))
if (!extractPlayerTarget((char*)args, &target))
return false;
LocaleConstant loc = GetSessionDbcLocale();
@@ -521,7 +521,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
std::wstring wnamepart;
// converting string that we try to find to lower case
if (!Utf8toWStr(namepart,wnamepart))
if (!Utf8toWStr(namepart, wnamepart))
return false;
wstrToLower(wnamepart);
@@ -552,9 +552,9 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
if (m_session)
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active);
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active);
else
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active);
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active);
if (!found)
found = true;
@@ -570,7 +570,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
bool ChatHandler::HandleCombatStopCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args,&target))
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
@@ -594,9 +594,9 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
LoginDatabase.escape_string (ip);
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip = '%s'", ip.c_str ());
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str ());
return LookupPlayerSearchCommand (result,limit);
return LookupPlayerSearchCommand (result, limit);
}
bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
@@ -613,9 +613,9 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
LoginDatabase.escape_string (account);
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE username = '%s'", account.c_str ());
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE username = '%s'", account.c_str ());
return LookupPlayerSearchCommand (result,limit);
return LookupPlayerSearchCommand (result, limit);
}
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
@@ -630,9 +630,9 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
LoginDatabase.escape_string (email);
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE email = '%s'", email.c_str ());
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ());
return LookupPlayerSearchCommand (result,limit);
return LookupPlayerSearchCommand (result, limit);
}
bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
@@ -659,10 +659,10 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
uint32 acc_id = fields[0].GetUInt32();
std::string acc_name = fields[1].GetString();
QueryResult chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
QueryResult chars = CharacterDatabase.PQuery("SELECT guid, name FROM characters WHERE account = '%u'", acc_id);
if (chars)
{
PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT,acc_name.c_str(),acc_id);
PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id);
uint64 guid = 0;
std::string name;
@@ -673,7 +673,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
guid = charfields[0].GetUInt64();
name = charfields[1].GetString();
PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER,name.c_str(),guid);
PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
++i;
} while (chars->NextRow() && (limit == -1 || i < limit));
@@ -700,7 +700,7 @@ bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
bool ChatHandler::HandleRepairitemsCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args,&target))
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
@@ -807,7 +807,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
}
// prepare visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1);
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
@@ -817,7 +817,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
pet->GetMap()->Add(pet->ToCreature());
// visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel());
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
player->SetMinion(pet, true);
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
@@ -858,7 +858,7 @@ bool ChatHandler::HandlePetLearnCommand(const char* args)
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
{
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spellId);
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
SetSentErrorMessage(true);
return false;
}
@@ -931,7 +931,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
std::string namepart = args;
std::wstring wnamepart;
if (!Utf8toWStr(namepart,wnamepart))
if (!Utf8toWStr(namepart, wnamepart))
return false;
// converting string that we try to find to lower case
@@ -983,13 +983,13 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
: "";
char titleNameStr[80];
snprintf(titleNameStr,80,name.c_str(),targetName);
snprintf(titleNameStr, 80, name.c_str(), targetName);
// send title in "id (idx:idx) - [namedlink locale]" format
if (m_session)
PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr);
PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
else
PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,titleNameStr,localeNames[loc],knownStr,activeStr);
PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[loc], knownStr, activeStr);
++counter;
}
@@ -1006,7 +1006,7 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
return false;
Player* target;
if (!extractPlayerTarget((char*)args,&target))
if (!extractPlayerTarget((char*)args, &target))
return false;
LocaleConstant loc = GetSessionDbcLocale();
@@ -1028,13 +1028,13 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
: "";
char titleNameStr[80];
snprintf(titleNameStr,80,name.c_str(),targetName);
snprintf(titleNameStr, 80, name.c_str(), targetName);
// send title in "id (idx:idx) - [namedlink locale]" format
if (m_session)
PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr);
PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
else
PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,name.c_str(),localeNames[loc],knownStr,activeStr);
PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
}
}
return true;
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -55,7 +55,7 @@ bool Condition::Meets(Player * player, Unit* invoker)
condMeets = (mConditionValue2 && player->HasItemCount(mConditionValue1, mConditionValue2)) || (!mConditionValue2 && !player->HasItemCount(mConditionValue1, mConditionValue2));//HasItemCount returns false if 0 count is used
break;
case CONDITION_ITEM_EQUIPPED:
condMeets = player->HasItemOrGemWithIdEquipped(mConditionValue1,1);
condMeets = player->HasItemOrGemWithIdEquipped(mConditionValue1, 1);
break;
case CONDITION_ZONEID:
condMeets = player->GetZoneId() == mConditionValue1;
@@ -252,12 +252,12 @@ ConditionList ConditionMgr::GetConditionReferences(uint32 refId)
return conditions;
}
bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionList& conditions, Unit* invoker)
bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, const ConditionList& conditions, Unit* invoker)
{
std::map<uint32, bool>ElseGroupMap;
for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
{
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u",(*i)->mConditionType,(*i)->mConditionValue1);
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->mConditionType, (*i)->mConditionValue1);
if ((*i)->isLoaded())
{
std::map<uint32, bool>::const_iterator itr = ElseGroupMap.find((*i)->mElseGroup);
@@ -377,7 +377,7 @@ void ConditionMgr::LoadConditions(bool isReload)
sObjectMgr->LoadGossipMenuItems();
}
QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference,"
QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, "
" ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions");
if (!result)
@@ -888,14 +888,14 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
cond->mConditionValue3 &= ~(1 << i);
sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)"
",TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)"
", TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)"
"TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52) in effect %u", cond->mSourceEntry, uint32(i));
}
}
if (!targetfound && !cond->mConditionValue3) // cond->mConditionValue3 already errored up there
{
sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)"
",TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)"
", TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)"
"TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52)", cond->mSourceEntry);
return false;
}
@@ -1026,7 +1026,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (cond->mConditionType == CONDITION_NONE || cond->mConditionType >= CONDITION_MAX)
{
sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType),cond->mSourceEntry);
sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType), cond->mSourceEntry);
return false;
}
+23 -23
View File
@@ -73,28 +73,28 @@ enum LevelConditionType
enum ConditionSourceType
{
CONDITION_SOURCE_TYPE_NONE = 0,//DONE
CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE = 1,//DONE
CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE = 2,//DONE
CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE = 3,//DONE
CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE = 4,//DONE
CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE = 5,//DONE
CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE = 6,//DONE
CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE = 7,//DONE
CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE = 8,//DONE
CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE = 9,//DONE
CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE = 10,//DONE
CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE = 11,//DONE
CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE = 12,//DONE
CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET = 13,//DONE
CONDITION_SOURCE_TYPE_GOSSIP_MENU = 14,//DONE
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15,//DONE
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,//DONE
CONDITION_SOURCE_TYPE_SPELL = 17,//DONE
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,//DONE
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,//DONE
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,//DONE
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,//DONE
CONDITION_SOURCE_TYPE_NONE = 0, //DONE
CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE = 1, //DONE
CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE = 2, //DONE
CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE = 3, //DONE
CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE = 4, //DONE
CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE = 5, //DONE
CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE = 6, //DONE
CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE = 7, //DONE
CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE = 8, //DONE
CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE = 9, //DONE
CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE = 10, //DONE
CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE = 11, //DONE
CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE = 12, //DONE
CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET = 13, //DONE
CONDITION_SOURCE_TYPE_GOSSIP_MENU = 14, //DONE
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15, //DONE
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16, //DONE
CONDITION_SOURCE_TYPE_SPELL = 17, //DONE
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18, //DONE
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19, //DONE
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20, //DONE
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, //DONE
CONDITION_SOURCE_TYPE_MAX = 22//MAX
};
@@ -166,7 +166,7 @@ class ConditionMgr
bool addToLootTemplate(Condition* cond, LootTemplate* loot);
bool addToGossipMenus(Condition* cond);
bool addToGossipMenuItems(Condition* cond);
bool IsPlayerMeetToConditionList(Player* player,const ConditionList& conditions, Unit* invoker = NULL);
bool IsPlayerMeetToConditionList(Player* player, const ConditionList& conditions, Unit* invoker = NULL);
bool isGroupable(ConditionSourceType sourceType) const
{
+3 -3
View File
@@ -43,7 +43,7 @@ void DisableMgr::LoadDisables()
m_DisableMap.clear();
QueryResult result = WorldDatabase.Query("SELECT sourceType,entry,flags,params_0,params_1 FROM disables");
QueryResult result = WorldDatabase.Query("SELECT sourceType, entry, flags, params_0, params_1 FROM disables");
uint32 total_count = 0;
@@ -91,14 +91,14 @@ void DisableMgr::LoadDisables()
if (flags & SPELL_DISABLE_MAP)
{
Tokens tokens(params_0, ',');
Tokens tokens(params_0, ', ');
for (uint8 i = 0; i < tokens.size(); )
data.params[0].insert(atoi(tokens[i++]));
}
if (flags & SPELL_DISABLE_AREA)
{
Tokens tokens(params_1, ',');
Tokens tokens(params_1, ', ');
for (uint8 i = 0; i < tokens.size(); )
data.params[1].insert(atoi(tokens[i++]));
}
+1 -1
View File
@@ -278,7 +278,7 @@ enum Difficulty
enum SpawnMask
{
SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY),// any any maps without spawn modes
SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY), // any any maps without spawn modes
SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL),
SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC),
+15 -15
View File
@@ -26,8 +26,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
{
@@ -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);
@@ -196,9 +196,9 @@ typedef std::list<std::string> StoreProblemList;
uint32 DBCFileCount = 0;
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;
@@ -327,9 +327,9 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sGlyphSlotStore, dbcPath, "GlyphSlot.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtBarberShopCostBaseStore, dbcPath, "gtBarberShopCostBase.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtCombatRatingsStore, dbcPath, "gtCombatRatings.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritBaseStore,dbcPath, "gtChanceToMeleeCritBase.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritBaseStore, dbcPath, "gtChanceToMeleeCritBase.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritStore, dbcPath, "gtChanceToMeleeCrit.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritBaseStore,dbcPath, "gtChanceToSpellCritBase.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritBaseStore, dbcPath, "gtChanceToSpellCritBase.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritStore, dbcPath, "gtChanceToSpellCrit.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc");
//LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sGtOCTRegenMPStore, dbcPath, "gtOCTRegenMP.dbc"); -- not used currently
@@ -376,7 +376,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore,dbcPath, "ScalingStatDistribution.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc");
@@ -692,7 +692,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);
@@ -725,7 +725,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;
@@ -761,7 +761,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT
return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask;
}
void Zone2MapCoordinates(float& x,float& y,uint32 zone)
void Zone2MapCoordinates(float& x, float& y, uint32 zone)
{
WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
@@ -769,12 +769,12 @@ void Zone2MapCoordinates(float& x,float& y,uint32 zone)
if (!maEntry)
return;
std::swap(x,y); // at client map coords swapped
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
}
void Map2ZoneCoordinates(float& x,float& y,uint32 zone)
void Map2ZoneCoordinates(float& x, float& y, uint32 zone)
{
WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
@@ -784,12 +784,12 @@ void Map2ZoneCoordinates(float& x,float& y,uint32 zone)
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
std::swap(x, y); // client have map coords swapped
}
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;
}
+2 -2
View File
@@ -34,7 +34,7 @@ TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id);
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id);
uint32 GetAreaFlagByMapId(uint32 mapid);
WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
@@ -54,7 +54,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT
void Zone2MapCoordinates(float &x, float &y, uint32 zone);
void 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);
MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
+15 -15
View File
@@ -32,11 +32,11 @@
// Structures using to access raw DBC data and required packing to portability
// 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
// 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
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#pragma pack(push, 1)
#endif
struct AchievementEntry
@@ -254,13 +254,13 @@ struct AchievementCriteriaEntry
// ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38
struct
{
uint32 teamtype; // 3 {2,3,5}
uint32 teamtype; // 3 {2, 3, 5}
} highest_team_rating;
// ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING = 39
struct
{
uint32 teamtype; // 3 {2,3,5}
uint32 teamtype; // 3 {2, 3, 5}
uint32 teamrating; // 4
} reach_team_rating;
@@ -1214,7 +1214,7 @@ struct MapEntry
float entrance_x; // 60 entrance x coordinate (if exist single entry)
float entrance_y; // 61 entrance y coordinate (if exist single entry)
// 62 -1, 0 and 720
uint32 addon; // 63 (0-original maps,1-tbc addon)
uint32 addon; // 63 (0-original maps, 1-tbc addon)
uint32 unk_time; // 64 some kind of time?
//uint32 maxPlayers; // 65 max players
@@ -1584,9 +1584,9 @@ struct SpellEntry
};
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;
struct SpellCastTimesEntry
{
@@ -1599,7 +1599,7 @@ struct SpellCastTimesEntry
struct SpellDifficultyEntry
{
uint32 ID; // 0
int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N,25N,10H,25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2
int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N, 25N, 10H, 25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2
};
struct SpellFocusObjectEntry
@@ -1920,7 +1920,7 @@ struct WorldMapAreaEntry
float x1; // 6
float x2; // 7
int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally)
// int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1,x2,y1,y2 coordinates)
// int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1, x2, y1, y2 coordinates)
// uint32 someMapID; // 10
};
@@ -1974,18 +1974,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
{
@@ -1995,7 +1995,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
+6 -6
View File
@@ -785,7 +785,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
uint64 frontGuid = check.front();
check.pop_front();
// Check all-but-new compatibilities (New,A,B,C,D) --> check(A,B,C,D)
// Check all-but-new compatibilities (New, A, B, C, D) --> check(A, B, C, D)
if (!CheckCompatibility(check, pProposal)) // Group not compatible
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) not compatibles (%s not compatibles)", strGuids.c_str(), ConcatenateGuids(check).c_str());
@@ -1140,7 +1140,7 @@ LfgAnswer LFGMgr::GetCompatibles(std::string key)
/**
Given a list of dungeons remove the dungeons players have restrictions.
@param[in,out] dungeons Dungeons to check restrictions
@param[in, out] dungeons Dungeons to check restrictions
@param[in] players Set of players to check their dungeon restrictions
@param[out] lockMap Map of players Lock status info of given dungeons (Empty if dungeons is not empty)
*/
@@ -1795,8 +1795,8 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
return;
// if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day.
if (player->CanRewardQuest(qReward,false))
player->RewardQuest(qReward,0,NULL,false);
if (player->CanRewardQuest(qReward, false))
player->RewardQuest(qReward, 0, NULL, false);
else
{
index = 1;
@@ -1804,11 +1804,11 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player)
if (!qReward)
return;
// we give reward without informing client (retail does this)
player->RewardQuest(qReward,0,NULL,false);
player->RewardQuest(qReward, 0, NULL, false);
}
// Give rewards
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u,%s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not");
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u, %s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not");
player->GetSession()->SendLfgPlayerReward(dungeon->Entry(), GetDungeon(gguid, false), index, reward, qReward);
}
+5 -5
View File
@@ -77,11 +77,11 @@ class Corpse : public WorldObject, public GridObject<Corpse>
Player* lootRecipient;
bool lootForBody;
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); }
void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); }
bool IsExpired(time_t t) const;
+80 -80
View File
@@ -92,7 +92,7 @@ uint32 CreatureTemplate::GetRandomValidModelId() const
if (Modelid3) modelIDs[c++] = Modelid3;
if (Modelid4) modelIDs[c++] = Modelid4;
return ((c>0) ? modelIDs[urand(0,c-1)] : 0);
return ((c>0) ? modelIDs[urand(0, c-1)] : 0);
}
uint32 CreatureTemplate::GetFirstValidModelId() const
@@ -243,10 +243,10 @@ void Creature::RemoveCorpse(bool setSpawnTime)
if(setSpawnTime)
m_respawnTime = time(NULL) + respawnDelay;
float x,y,z,o;
float x, y, z, o;
GetRespawnCoord(x, y, z, &o);
SetHomePosition(x,y,z,o);
GetMap()->CreatureRelocation(this,x,y,z,o);
SetHomePosition(x, y, z, o);
GetMap()->CreatureRelocation(this, x, y, z, o);
}
/**
@@ -289,13 +289,13 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
// equal to player Race field, but creature does not have race
SetByteValue(UNIT_FIELD_BYTES_0, 0, 0);
// known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE
// known valid are: CLASS_WARRIOR, CLASS_PALADIN, CLASS_ROGUE, CLASS_MAGE
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
// Cancel load if no model defined
if (!(cinfo->GetFirstValidModelId()))
{
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
return false;
}
@@ -303,7 +303,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID);
if (!minfo) // Cancel load if no model defined
{
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
return false;
}
@@ -319,8 +319,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
SetName(normalInfo->Name); // at normal entry always
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius);
SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach);
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
@@ -344,7 +344,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
{
if (!InitEntry(Entry,team,data))
if (!InitEntry(Entry, team, data))
return false;
CreatureTemplate const* cInfo = GetCreatureInfo();
@@ -370,7 +370,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
SetAttackTime(BASE_ATTACK, cInfo->baseattacktime);
SetAttackTime(OFF_ATTACK, cInfo->baseattacktime);
SetAttackTime(RANGED_ATTACK,cInfo->rangeattacktime);
SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime);
SetUInt32Value(UNIT_FIELD_FLAGS, unit_flags);
@@ -410,7 +410,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_NO_TAUNT)
{
ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
// TODO: In fact monster move flags should be set - not movement flags.
@@ -437,11 +437,11 @@ void Creature::Update(uint32 diff)
{
case JUST_ALIVED:
// Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting.
sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry());
sLog->outError("Creature (GUID: %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 (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry());
sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry());
break;
case DEAD:
{
@@ -462,7 +462,7 @@ void Creature::Update(uint32 diff)
if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day)
SetRespawnTime(DAY);
else
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5,MINUTE); // else copy time from master and add a little
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little
SaveRespawnTime(); // also save to DB immediately
}
}
@@ -687,7 +687,7 @@ void Creature::DoFleeToGetAssistance()
UpdateSpeed(MOVE_RUN, false);
if (!pCreature)
//SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
//SetFeared(true, getVictim()->GetGUID(), 0 , sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
//TODO: use 31365
SetControlled(true, UNIT_STAT_FLEEING);
else
@@ -737,7 +737,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
{
ASSERT(map);
SetMap(map);
SetPhaseMask(phaseMask,false);
SetPhaseMask(phaseMask, false);
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
@@ -828,7 +828,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS)
{
sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
GetGUIDLow(),GetEntry());
GetGUIDLow(), GetEntry());
return false;
}
@@ -842,15 +842,15 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
pPlayer->PlayerTalkClass->ClearMenus();
switch(GetCreatureInfo()->trainer_class)
{
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913,GetGUID()); break;
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090,GetGUID()); break;
case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328,GetGUID()); break;
case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635,GetGUID()); break;
case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436,GetGUID()); break;
case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797,GetGUID()); break;
case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003,GetGUID()); break;
case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836,GetGUID()); break;
case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985,GetGUID()); break;
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break;
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break;
case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328, GetGUID()); break;
case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635, GetGUID()); break;
case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436, GetGUID()); break;
case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797, GetGUID()); break;
case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003, GetGUID()); break;
case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836, GetGUID()); break;
case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985, GetGUID()); break;
}
}
return false;
@@ -860,7 +860,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
if (pPlayer->getClass() != CLASS_HUNTER)
{
pPlayer->PlayerTalkClass->ClearMenus();
pPlayer->PlayerTalkClass->SendGossipMenu(3620,GetGUID());
pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetGUID());
return false;
}
break;
@@ -872,16 +872,16 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
pPlayer->PlayerTalkClass->ClearMenus();
switch(GetCreatureInfo()->trainer_class)
{
case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865,GetGUID()); break;
case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881,GetGUID()); break;
case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861,GetGUID()); break;
case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break;
case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863,GetGUID()); break;
case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break;
case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816,GetGUID()); break;
case RACE_UNDEAD_PLAYER:pPlayer->PlayerTalkClass->SendGossipMenu(624,GetGUID()); break;
case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break;
case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break;
case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break;
case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break;
case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861, GetGUID()); break;
case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863, GetGUID()); break;
case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816, GetGUID()); break;
case RACE_UNDEAD_PLAYER:pPlayer->PlayerTalkClass->SendGossipMenu(624, GetGUID()); break;
case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
}
}
return false;
@@ -893,7 +893,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
if (msg)
{
pPlayer->PlayerTalkClass->ClearMenus();
pPlayer->PlayerTalkClass->SendGossipMenu(11031,GetGUID());
pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetGUID());
}
return false;
}
@@ -918,9 +918,9 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
pPlayer->PlayerTalkClass->ClearMenus();
switch(bgTypeId)
{
case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616,GetGUID()); break;
case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599,GetGUID()); break;
case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642,GetGUID()); break;
case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break;
case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break;
case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break;
case BATTLEGROUND_EY:
case BATTLEGROUND_NA:
case BATTLEGROUND_BE:
@@ -928,7 +928,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
case BATTLEGROUND_RL:
case BATTLEGROUND_SA:
case BATTLEGROUND_DS:
case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024,GetGUID()); break;
case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break;
default: break;
}
return false;
@@ -1097,26 +1097,26 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
std::ostringstream ss;
ss << "INSERT INTO creature VALUES ("
<< m_DBTableGuid << ","
<< GetEntry() << ","
<< mapid <<","
<< uint32(spawnMask) << "," // cast to prevent save as symbol
<< uint16(GetPhaseMask()) << "," // prevent out of range error
<< displayId <<","
<< GetEquipmentId() <<","
<< GetPositionX() << ","
<< GetPositionY() << ","
<< GetPositionZ() << ","
<< GetOrientation() << ","
<< m_respawnDelay << "," //respawn time
<< (float) m_respawnradius << "," //spawn distance (float)
<< (uint32) (0) << "," //currentwaypoint
<< GetHealth() << "," //curhealth
<< GetPower(POWER_MANA) << "," //curmana
<< (m_isDeadByDefault ? 1 : 0) << "," //is_dead
<< GetDefaultMovementType() << "," //default movement generator type
<< npcflag << ","
<< unit_flags << ","
<< m_DBTableGuid << ", "
<< GetEntry() << ", "
<< mapid <<", "
<< uint32(spawnMask) << ", " // cast to prevent save as symbol
<< uint16(GetPhaseMask()) << ", " // prevent out of range error
<< displayId <<", "
<< GetEquipmentId() <<", "
<< GetPositionX() << ", "
<< GetPositionY() << ", "
<< GetPositionZ() << ", "
<< GetOrientation() << ", "
<< m_respawnDelay << ", " //respawn time
<< (float) m_respawnradius << ", " //spawn distance (float)
<< (uint32) (0) << ", " //currentwaypoint
<< GetHealth() << ", " //curhealth
<< GetPower(POWER_MANA) << ", " //curmana
<< (m_isDeadByDefault ? 1 : 0) << ", " //is_dead
<< GetDefaultMovementType() << ", " //default movement generator type
<< npcflag << ", "
<< unit_flags << ", "
<< dynamicflags << ")";
trans->Append(ss.str().c_str());
@@ -1165,8 +1165,8 @@ void Creature::SelectLevel(const CreatureTemplate *cinfo)
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod);
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod);
SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE,cinfo->minrangedmg * damagemod);
SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE,cinfo->maxrangedmg * damagemod);
SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg * damagemod);
SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg * damagemod);
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod);
@@ -1268,25 +1268,25 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
if (!data)
{
sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid);
sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ", guid);
return false;
}
m_DBTableGuid = guid;
if (map->GetInstanceId() == 0)
{
if (map->GetCreature(MAKE_NEW_GUID(guid,data->id,HIGHGUID_UNIT)))
if (map->GetCreature(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT)))
return false;
}
else
guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT);
uint16 team = 0;
if (!Create(guid,map,data->phaseMask,data->id,0,team,data->posX,data->posY,data->posZ,data->orientation,data))
if (!Create(guid, map, data->phaseMask, data->id, 0, team, data->posX, data->posY, data->posZ, data->orientation, data))
return false;
//We should set first home position, because then AI calls home movement
SetHomePosition(data->posX,data->posY,data->posZ,data->orientation);
SetHomePosition(data->posX, data->posY, data->posZ, data->orientation);
m_respawnradius = data->spawndist;
@@ -1294,15 +1294,15 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
m_isDeadByDefault = data->is_dead;
m_deathState = m_isDeadByDefault ? DEAD : ALIVE;
m_respawnTime = sObjectMgr->GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
m_respawnTime = sObjectMgr->GetCreatureRespawnTime(m_DBTableGuid, GetInstanceId());
if (m_respawnTime) // respawn on Update
{
m_deathState = DEAD;
if (canFly())
{
float tz = map->GetHeight(data->posX,data->posY,data->posZ,false);
float tz = map->GetHeight(data->posX, data->posY, data->posZ, false);
if (data->posZ - tz > 0.1)
Relocate(data->posX,data->posY,tz);
Relocate(data->posX, data->posY, tz);
}
}
@@ -1317,12 +1317,12 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
if (curhealth < 1)
curhealth = 1;
}
SetPower(POWER_MANA,data->curmana);
SetPower(POWER_MANA, data->curmana);
}
else
{
curhealth = GetMaxHealth();
SetPower(POWER_MANA,GetMaxPower(POWER_MANA));
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
}
SetHealth(m_deathState == ALIVE ? curhealth : 0);
@@ -1507,7 +1507,7 @@ void Creature::setDeathState(DeathState s)
if (s == JUST_DIED)
{
SetUInt64Value(UNIT_FIELD_TARGET,0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
SetUInt64Value(UNIT_FIELD_TARGET, 0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
setActive(false);
@@ -1823,7 +1823,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
Unit *target = NULL;
if (dist > ATTACK_DISTANCE)
sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.",GetGUIDLow(),GetEntry());
sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.", GetGUIDLow(), GetEntry());
{
Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
@@ -1995,7 +1995,7 @@ void Creature::SaveRespawnTime()
if (isSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData))
return;
sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime);
}
// this should not be called by petAI or
@@ -2115,9 +2115,9 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
{
uint32 enemy_team = attacker->GetTeam();
WorldPacket data(SMSG_ZONE_UNDER_ATTACK,4);
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
data << (uint32)GetAreaId();
sWorld->SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE));
sWorld->SendGlobalMessage(&data, NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE));
}
void Creature::SetInCombatWithZone()
@@ -2351,7 +2351,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
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));
m_vendorItemCounts.push_back(VendorItemCount(vItem->item, new_count));
return new_count;
}
+8 -8
View File
@@ -64,11 +64,11 @@ enum CreatureFlagsExtra
CREATURE_FLAG_EXTRA_NO_SKILLGAIN | CREATURE_FLAG_EXTRA_TAUNT_DIMINISH | CREATURE_FLAG_EXTRA_ALL_DIMINISH | \
CREATURE_FLAG_EXTRA_GUARD)
// 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
// 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
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#pragma pack(push, 1)
#endif
#define MAX_KILL_CREDIT 2
@@ -401,7 +401,7 @@ struct TrainerSpellData
TrainerSpell const* Find(uint32 spell_id) const;
};
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
@@ -534,11 +534,11 @@ class Creature : public Unit, public GridObject<Creature>
std::string GetScriptName() const;
uint32 GetScriptId() const;
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId,TargetGuid,IsBossEmote); }
void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId,receiver,IsBossWhisper); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId, TargetGuid, IsBossEmote); }
void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId, receiver, IsBossWhisper); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); }
// override WorldObject function for proper name localization
const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const;
@@ -70,7 +70,7 @@ void GossipMenu::AddMenuItem(uint8 Icon, const std::string& Message, bool Coded)
void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, bool Coded)
{
AddMenuItem(Icon, std::string(Message ? Message : ""),Coded);
AddMenuItem(Icon, std::string(Message ? Message : ""), Coded);
}
void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, uint32 dtSender, uint32 dtAction, char const* BoxMessage, uint32 BoxMoney, bool Coded)
@@ -206,7 +206,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id)
PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poi_id);
if (!poi)
{
sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id);
sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.", poi_id);
return;
}
@@ -159,7 +159,7 @@ void TempSummon::Update(uint32 diff)
}
default:
UnSummon();
sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ",GetEntry(),m_type);
sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
break;
}
}
@@ -84,7 +84,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit* caster, uint32 spellId, Positio
Relocate(pos);
if (!IsPositionValid())
{
sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,GetPositionX(),GetPositionY());
sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
return false;
}
@@ -61,7 +61,7 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject>
void Say(int32 textId, uint32 language, uint64 targetGuid) { MonsterSay(textId, language, targetGuid); }
void Yell(int32 textId, uint32 language, uint64 targetGuid) { MonsterYell(textId, language, targetGuid); }
void TextEmote(int32 textId, uint64 targetGuid) { MonsterTextEmote(textId, targetGuid); }
void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId, receiver); }
void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); }
void YellToZone(int32 textId, uint32 language, uint64 targetGuid) { MonsterYellToZone(textId, language, targetGuid); }
protected:
@@ -100,10 +100,10 @@ void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/)
// Possible crash at access to deleted GO in Unit::m_gameobj
if (uint64 owner_guid = GetOwnerGUID())
{
Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid);
Unit* owner = ObjectAccessor::GetUnit(*this, owner_guid);
if (owner)
owner->RemoveGameObject(this,false);
owner->RemoveGameObject(this, false);
else
{
const char * ownerType = "creature";
@@ -144,9 +144,9 @@ void GameObject::RemoveFromWorld()
if (uint64 owner_guid = GetOwnerGUID())
{
if (Unit * owner = GetOwner())
owner->RemoveGameObject(this,false);
owner->RemoveGameObject(this, false);
else
sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->entry,GUID_LOPART(owner_guid));
sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.", GetGUIDLow(), GetGOInfo()->entry, GUID_LOPART(owner_guid));
}
WorldObject::RemoveFromWorld();
sObjectAccessor->RemoveObject(this);
@@ -158,14 +158,14 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
ASSERT(map);
SetMap(map);
Relocate(x,y,z,ang);
Relocate(x, y, z, ang);
if (!IsPositionValid())
{
sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y);
sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
return false;
}
SetPhaseMask(phaseMask,false);
SetPhaseMask(phaseMask, false);
SetZoneScript();
if (m_zoneScript)
@@ -178,7 +178,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
if (!goinfo)
{
sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f", guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
return false;
}
@@ -188,14 +188,14 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
{
sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type);
sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.", guidlow, name_id, goinfo->type);
return false;
}
SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0);
SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1);
UpdateRotationFields(rotation2,rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3
UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3
SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size);
@@ -302,7 +302,7 @@ void GameObject::Update(uint32 diff)
UpdateData udata;
WorldPacket packet;
BuildValuesUpdateBlockForPlayer(&udata,caster->ToPlayer());
BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer());
udata.BuildPacket(&packet);
caster->ToPlayer()->GetSession()->SendPacket(&packet);
@@ -334,7 +334,7 @@ void GameObject::Update(uint32 diff)
if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day)
SetRespawnTime(DAY);
else
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5,MINUTE); // else copy time from master and add a little
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little
SaveRespawnTime(); // also save to DB immediately
return;
}
@@ -352,7 +352,7 @@ void GameObject::Update(uint32 diff)
{
caster->FinishSpell(CURRENT_CHANNELED_SPELL);
WorldPacket data(SMSG_FISH_ESCAPED,0);
WorldPacket data(SMSG_FISH_ESCAPED, 0);
caster->ToPlayer()->GetSession()->SendPacket(&data);
}
// can be delete
@@ -629,12 +629,12 @@ 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, true))
// else use zone loot (must exist in like case)
fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true);
fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner, true);
}
void GameObject::SaveToDB()
@@ -687,8 +687,8 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
<< m_DBTableGuid << ", "
<< GetEntry() << ", "
<< mapid << ", "
<< uint32(spawnMask) << "," // cast to prevent save as symbol
<< uint16(GetPhaseMask()) << "," // prevent out of range error
<< uint32(spawnMask) << ", " // cast to prevent save as symbol
<< uint16(GetPhaseMask()) << ", " // prevent out of range error
<< GetPositionX() << ", "
<< GetPositionY() << ", "
<< GetPositionZ() << ", "
@@ -713,7 +713,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;
}
@@ -737,7 +737,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
m_DBTableGuid = guid;
if (map->GetInstanceId() != 0) guid = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);
if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit))
if (!Create(guid, entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit))
return false;
if (data->spawntimesecs >= 0)
@@ -838,7 +838,7 @@ Unit* GameObject::GetOwner() const
void GameObject::SaveRespawnTime()
{
if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault)
sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
sObjectMgr->SaveGORespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime);
}
bool GameObject::isAlwaysVisibleFor(WorldObject const* seer) const
@@ -892,7 +892,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(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(),pTarget->GetTeam())))
if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam())))
return false;
return true;
}
@@ -947,8 +947,8 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO,go_check);
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
cell.Visit(p, object_checker, *GetMap(), *target, range);
@@ -963,7 +963,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
{
GameObject* ok = NULL;
CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY()));
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
Trinity::NearestGameObjectFishingHole u_check(*this, range);
@@ -993,7 +993,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;
@@ -1161,7 +1161,7 @@ void GameObject::Use(Unit* user)
if (itr != ChairListSlots.end())
{
itr->second = player->GetGUID(); //this slot in now used by player
player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->chair.height);
return;
}
@@ -1269,7 +1269,7 @@ void GameObject::Use(Unit* user)
case GO_READY: // ready for loot
{
uint32 zone, subzone;
GetZoneAndAreaId(zone,subzone);
GetZoneAndAreaId(zone, subzone);
int32 zone_skill = sObjectMgr->GetFishingBaseSkillLevel(subzone);
if (!zone_skill)
@@ -1277,23 +1277,23 @@ void GameObject::Use(Unit* user)
//provide error, no fishable zone or area should be 0
if (!zone_skill)
sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.",subzone);
sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
int32 skill = player->GetSkillValue(SKILL_FISHING);
int32 chance;
if (skill < zone_skill)
{
chance = int32(pow((double)skill/zone_skill,2) * 100);
chance = int32(pow((double)skill/zone_skill, 2) * 100);
if (chance < 1)
chance = 1;
}
else
chance = 100;
int32 roll = irand(1,100);
int32 roll = irand(1, 100);
sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll);
sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
if (chance >= roll)
@@ -1301,7 +1301,7 @@ void GameObject::Use(Unit* user)
player->UpdateFishingSkill();
// prevent removing GO at spell cancel
player->RemoveGameObject(this,false);
player->RemoveGameObject(this, false);
SetOwnerGUID(player->GetGUID());
//TODO: find reasonable value for fishing hole search
@@ -1312,7 +1312,7 @@ void GameObject::Use(Unit* user)
SetLootState(GO_JUST_DEACTIVATED);
}
else
player->SendLoot(GetGUID(),LOOT_FISHING);
player->SendLoot(GetGUID(), LOOT_FISHING);
}
// TODO: else: junk
@@ -1571,7 +1571,7 @@ void GameObject::Use(Unit* user)
Player* player = user->ToPlayer();
// 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);
@@ -1592,7 +1592,7 @@ void GameObject::Use(Unit* user)
if (!spellInfo)
{
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this))
sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType());
sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
else
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
return;
@@ -1648,7 +1648,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
void GameObject::SendCustomAnim(uint32 anim)
{
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4);
WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4);
data << GetGUID();
data << uint32(anim);
SendMessageToSet(&data, true);
@@ -28,11 +28,11 @@
class GameObjectAI;
// 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
// 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
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#pragma pack(push, 1)
#endif
#define MAX_GAMEOBJECT_QUEST_ITEMS 6
@@ -636,11 +636,11 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f);
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); }
void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); }
void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); }
void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); }
void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); }
void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); }
void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); }
// overwrite WorldObject function for proper name localization
const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const;
@@ -792,7 +792,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
std::set<uint32> m_unique_users;
uint32 m_usetimes;
typedef std::map<uint32,uint64> ChairSlotAndUser;
typedef std::map<uint32, uint64> ChairSlotAndUser;
ChairSlotAndUser ChairListSlots;
uint32 m_DBTableGuid; ///< For new or temporary gameobjects is 0 for saved it is lowguid
+23 -23
View File
@@ -26,7 +26,7 @@
#include "ScriptMgr.h"
#include "ConditionMgr.h"
void AddItemsSetItem(Player* player,Item* item)
void AddItemsSetItem(Player* player, Item* item)
{
ItemTemplate const* proto = item->GetTemplate();
uint32 setid = proto->ItemSet;
@@ -35,7 +35,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;
}
@@ -109,7 +109,7 @@ void AddItemsSetItem(Player* player,Item* item)
}
}
void RemoveItemsSetItem(Player*player,ItemTemplate const *proto)
void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
{
uint32 setid = proto->ItemSet;
@@ -117,7 +117,7 @@ void RemoveItemsSetItem(Player*player,ItemTemplate 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;
}
@@ -152,7 +152,7 @@ void RemoveItemsSetItem(Player*player,ItemTemplate const *proto)
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
{
// spell can be not active if not fit form requirement
player->ApplyEquipSpell(eff->spells[z],NULL,false);
player->ApplyEquipSpell(eff->spells[z], NULL, false);
eff->spells[z]=NULL;
break;
}
@@ -272,7 +272,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
SetSpellCharges(i,itemProto->Spells[i].SpellCharges);
SetSpellCharges(i, itemProto->Spells[i].SpellCharges);
SetUInt32Value(ITEM_FIELD_DURATION, abs(itemProto->Duration));
SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, 0);
@@ -293,7 +293,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
{
@@ -507,7 +507,7 @@ uint32 Item::GetSkill()
const static uint32 item_armor_skills[MAX_ITEM_SUBCLASS_ARMOR] =
{
0,SKILL_CLOTH,SKILL_LEATHER,SKILL_MAIL,SKILL_PLATE_MAIL,0,SKILL_SHIELD,0,0,0,0
0, SKILL_CLOTH, SKILL_LEATHER, SKILL_MAIL, SKILL_PLATE_MAIL, 0, SKILL_SHIELD, 0, 0, 0, 0
};
ItemTemplate const* proto = GetTemplate();
@@ -585,7 +585,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
// item can have not null only one from field values
if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
{
sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix);
sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
return 0;
}
@@ -596,7 +596,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomPropertiesEntry const *random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'",randomPropId);
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
return 0;
}
@@ -609,7 +609,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomSuffixEntry const *random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.",randomPropId);
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
return 0;
}
@@ -629,11 +629,11 @@ 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, GetOwner());
}
for (uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i)
SetEnchantment(EnchantmentSlot(i),item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2],0,0);
SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2], 0, 0);
}
}
else
@@ -644,13 +644,13 @@ void Item::SetItemRandomProperties(int32 randomPropId)
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != -int32(item_rand->ID) ||
!GetItemSuffixFactor())
{
SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID,-int32(item_rand->ID));
SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, -int32(item_rand->ID));
UpdateItemSuffixFactor();
SetState(ITEM_CHANGED, GetOwner());
}
for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_0 + 3; ++i)
SetEnchantment(EnchantmentSlot(i),item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0],0,0);
SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0);
}
}
}
@@ -753,7 +753,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const
if (Player* owner = GetOwner())
{
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK)
if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK)
return false;
if (owner->GetLootGUID() == GetGUID())
return false;
@@ -881,9 +881,9 @@ void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint
if ((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges))
return;
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET,id);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET, id);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET, duration);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET, charges);
SetState(ITEM_CHANGED, GetOwner());
}
@@ -892,7 +892,7 @@ void Item::SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player*
if (GetEnchantmentDuration(slot) == duration)
return;
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET, duration);
SetState(ITEM_CHANGED, owner);
// Cannot use GetOwner() here, has to be passed as an argument to avoid freeze due to hashtable locking
}
@@ -902,7 +902,7 @@ void Item::SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges)
if (GetEnchantmentCharges(slot) == charges)
return;
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges);
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET, charges);
SetState(ITEM_CHANGED, GetOwner());
}
@@ -1112,8 +1112,8 @@ void Item::SaveRefundDataToDB()
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow());
trans->PAppend("INSERT INTO item_refund_instance (`item_guid`,`player_guid`,`paidMoney`,`paidExtendedCost`)"
" VALUES('%u','%u','%u','%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost());
trans->PAppend("INSERT INTO item_refund_instance (`item_guid`, `player_guid`, `paidMoney`, `paidExtendedCost`)"
" VALUES('%u', '%u', '%u', '%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost());
CharacterDatabase.CommitTransaction(trans);
}
+1 -1
View File
@@ -314,7 +314,7 @@ class 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); }
Loot loot;
bool m_lootGenerated;
@@ -90,7 +90,7 @@ uint32 GetItemEnchantMod(int32 entry)
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
if (tab == RandomItemEnch.end())
{
sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry);
sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
return 0;
}
@@ -535,11 +535,11 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS
return 0;
}
// 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
// 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
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#pragma pack(push, 1)
#endif
struct _Damage
+62 -62
View File
@@ -317,7 +317,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
}
else
{
if (flags3 & 0x8000) // probably x,y,z coords there
if (flags3 & 0x8000) // probably x, y, z coords there
{
*data << (float)0;
*data << (float)0;
@@ -1141,7 +1141,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
bool Object::PrintIndexError(uint32 index, bool set) const
{
sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType);
sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
// ASSERT must fail after function call
return false;
@@ -1349,15 +1349,15 @@ bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool
bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const
{
if (!IsInMap(obj)) return false;
float ox,oy,oz;
obj->GetPosition(ox,oy,oz);
float ox, oy, oz;
obj->GetPosition(ox, oy, oz);
return(IsWithinLOS(ox, oy, oz));
}
bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const
{
float x,y,z;
GetPosition(x,y,z);
float x, y, z;
GetPosition(x, y, z);
VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
return vMapManager->isInLineOfSight(GetMapId(), x, y, z+2.0f, ox, oy, oz+2.0f);
}
@@ -1571,40 +1571,40 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran
Trinity::NormalizeMapCoord(rand_x);
Trinity::NormalizeMapCoord(rand_y);
UpdateGroundPositionZ(rand_x,rand_y,rand_z); // update to LOS height if available
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
}
void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const
{
float new_z = GetBaseMap()->GetHeight(x,y,z,true);
float new_z = GetBaseMap()->GetHeight(x, y, z, true);
if (new_z > INVALID_HEIGHT)
z = new_z+ 0.05f; // just to be sure that we are not a few pixel under the surface
}
bool Position::IsPositionValid() const
{
return Trinity::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation);
return Trinity::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
}
void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGuid)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true);
BuildMonsterChat(&data, CHAT_MSG_MONSTER_SAY, text, language, GetName(), TargetGuid);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true);
}
void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true);
BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, text, language, GetName(), TargetGuid);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true);
}
void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid);
SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true);
BuildMonsterChat(&data, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, text, LANG_UNIVERSAL, GetName(), TargetGuid);
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true);
}
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
@@ -1614,7 +1614,7 @@ void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossW
return;
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetName(),receiver);
BuildMonsterChat(&data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, text, LANG_UNIVERSAL, GetName(), receiver);
player->GetSession()->SendPacket(&data);
}
@@ -1884,10 +1884,10 @@ namespace Trinity
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {}
void operator()(WorldPacket& data, LocaleConstant loc_idx)
{
char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx);
char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx);
// TODO: i_object.GetName() also must be localized?
i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID);
i_object.BuildMonsterChat(&data, i_msgtype, text, i_language, i_object.GetNameForLocaleIdx(loc_idx), i_targetGUID);
}
private:
@@ -1907,9 +1907,9 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid)
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid);
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId, language, TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
@@ -1922,16 +1922,16 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid)
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId, language, TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid)
{
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid);
Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId, language, TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
uint32 zoneid = GetZoneId();
@@ -1950,9 +1950,9 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid);
Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, TargetGuid);
Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do);
Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), say_do);
TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
}
@@ -1967,7 +1967,7 @@ void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisp
char const* text = sObjectMgr->GetTrinityString(textId, loc_idx);
WorldPacket data(SMSG_MESSAGECHAT, 200);
BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver);
BuildMonsterChat(&data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, text, LANG_UNIVERSAL, GetNameForLocaleIdx(loc_idx), receiver);
player->GetSession()->SendPacket(&data);
}
@@ -2060,7 +2060,7 @@ void WorldObject::AddObjectToRemoveList()
Map* map = FindMap();
if (!map)
{
sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId());
sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).", GetTypeId(), GetEntry(), GetGUIDLow(), GetMapId());
return;
}
@@ -2196,7 +2196,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",pet->GetGUIDLow(),pet->GetEntry(),pet->GetPositionX(),pet->GetPositionY());
sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
return NULL;
}
@@ -2215,7 +2215,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->setPowerType(POWER_MANA);
pet->SetUInt32Value(UNIT_NPC_FLAGS , 0);
pet->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pet->InitStatsForLevel(getLevel());
SetMinion(pet, true);
@@ -2287,7 +2287,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
}
Map *map = GetMap();
GameObject *go = new GameObject();
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
delete go;
return NULL;
@@ -2385,16 +2385,16 @@ namespace Trinity
if (c == i_searcher || c == &i_object)
return;
float x,y,z;
float x, y, z;
if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) ||
!c->GetMotionMaster()->GetDestination(x,y,z))
!c->GetMotionMaster()->GetDestination(x, y, z))
{
x = c->GetPositionX();
y = c->GetPositionY();
}
add(c,x,y);
add(c, x, y);
}
template<class T>
@@ -2404,19 +2404,19 @@ namespace Trinity
if (u == i_searcher || u == &i_object)
return;
float x,y;
float x, y;
x = u->GetPositionX();
y = u->GetPositionY();
add(u,x,y);
add(u, x, y);
}
// we must add used pos that can fill places around center
void add(WorldObject* u, float x, float y) const
{
// u is too nearest/far away to i_object
if (!i_object.IsInRange2d(x,y,i_selector.m_dist - i_selector.m_size,i_selector.m_dist + i_selector.m_size))
if (!i_object.IsInRange2d(x, y, i_selector.m_dist - i_selector.m_size, i_selector.m_dist + i_selector.m_size))
return;
float angle = i_object.GetAngle(u)-i_angle;
@@ -2428,8 +2428,8 @@ namespace Trinity
angle += 2.0f * M_PI;
// dist include size of u
float dist2d = i_object.GetDistance2d(x,y);
i_selector.AddUsedPos(u->GetObjectSize(),angle,dist2d + i_object.GetObjectSize());
float dist2d = i_object.GetDistance2d(x, y);
i_selector.AddUsedPos(u->GetObjectSize(), angle, dist2d + i_object.GetObjectSize());
}
private:
WorldObject const& i_object;
@@ -2453,15 +2453,15 @@ void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float abs
void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
{
GetNearPoint2D(x,y,distance2d+searcher_size,absAngle);
GetNearPoint2D(x, y, distance2d+searcher_size, absAngle);
z = GetPositionZ();
UpdateGroundPositionZ(x,y,z);
UpdateGroundPositionZ(x, y, z);
/*
// if detection disabled, return first point
if (!sWorld->getIntConfig(CONFIG_DETECT_POS_COLLISION))
{
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
return;
}
@@ -2471,7 +2471,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
bool first_los_conflict = false; // first point LOS problems
// prepare selector for work
ObjectPosSelector selector(GetPositionX(),GetPositionY(),GetObjectSize(),distance2d+searcher_size);
ObjectPosSelector selector(GetPositionX(), GetPositionY(), GetObjectSize(), distance2d+searcher_size);
// adding used positions around object
{
@@ -2480,8 +2480,8 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearUsedPosDo u_do(*this,searcher,absAngle,selector);
Trinity::WorldObjectWorker<Trinity::NearUsedPosDo> worker(this,u_do);
Trinity::NearUsedPosDo u_do(*this, searcher, absAngle, selector);
Trinity::WorldObjectWorker<Trinity::NearUsedPosDo> worker(this, u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::NearUsedPosDo>, GridTypeMapContainer > grid_obj_worker(worker);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::NearUsedPosDo>, WorldTypeMapContainer > world_obj_worker(worker);
@@ -2494,9 +2494,9 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
// maybe can just place in primary position
if (selector.CheckOriginal())
{
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
if (IsWithinLOS(x,y,z))
if (IsWithinLOS(x, y, z))
return;
first_los_conflict = true; // first point have LOS problems
@@ -2507,11 +2507,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
// special case when one from list empty and then empty side preferred
if (selector.FirstAngle(angle))
{
GetNearPoint2D(x,y,distance2d,absAngle+angle);
GetNearPoint2D(x, y, distance2d, absAngle+angle);
z = GetPositionZ();
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
if (IsWithinLOS(x,y,z))
if (IsWithinLOS(x, y, z))
return;
}
@@ -2521,11 +2521,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
// select in positions after current nodes (selection one by one)
while (selector.NextAngle(angle)) // angle for free pos
{
GetNearPoint2D(x,y,distance2d,absAngle+angle);
GetNearPoint2D(x, y, distance2d, absAngle+angle);
z = GetPositionZ();
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
if (IsWithinLOS(x,y,z))
if (IsWithinLOS(x, y, z))
return;
}
@@ -2537,7 +2537,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
x = first_x;
y = first_y;
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
return;
}
@@ -2546,11 +2546,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
{
if (!selector.FirstAngle(angle)) // _used_ pos
{
GetNearPoint2D(x,y,distance2d,absAngle+angle);
GetNearPoint2D(x, y, distance2d, absAngle+angle);
z = GetPositionZ();
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
if (IsWithinLOS(x,y,z))
if (IsWithinLOS(x, y, z))
return;
}
}
@@ -2561,11 +2561,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
// select in positions after current nodes (selection one by one)
while (selector.NextUsedAngle(angle)) // angle for used pos but maybe without LOS problem
{
GetNearPoint2D(x,y,distance2d,absAngle+angle);
GetNearPoint2D(x, y, distance2d, absAngle+angle);
z = GetPositionZ();
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
if (IsWithinLOS(x,y,z))
if (IsWithinLOS(x, y, z))
return;
}
@@ -2573,7 +2573,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float
x = first_x;
y = first_y;
UpdateGroundPositionZ(x,y,z); // update to LOS height if available
UpdateGroundPositionZ(x, y, z); // update to LOS height if available
*/
}
@@ -2599,7 +2599,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
floor = GetMap()->GetHeight(destx, desty, pos.m_positionZ, true);
destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor;
bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(GetMapId(),pos.m_positionX,pos.m_positionY,pos.m_positionZ+0.5f,destx,desty,destz+0.5f,destx,desty,destz,-0.5f);
bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(GetMapId(), pos.m_positionX, pos.m_positionY, pos.m_positionZ+0.5f, destx, desty, destz+0.5f, destx, desty, destz, -0.5f);
// collision occured
if (col)
@@ -2647,7 +2647,7 @@ void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update)
void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/)
{
WorldPacket data(SMSG_PLAY_OBJECT_SOUND,4+8);
WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 4+8);
data << uint32(sound_id);
data << uint64(GetGUID());
if (target)
+13 -13
View File
@@ -214,7 +214,7 @@ class Object
void SetFloatValue(uint16 index, float value);
void SetByteValue(uint16 index, uint8 offset, uint8 value);
void SetUInt16Value(uint16 index, uint8 offset, uint16 value);
void SetInt16Value(uint16 index, uint8 offset, int16 value) { SetUInt16Value(index,offset,(uint16)value); }
void SetInt16Value(uint16 index, uint8 offset, int16 value) { SetUInt16Value(index, offset, (uint16)value); }
void SetStatFloatValue(uint16 index, float value);
void SetStatInt32Value(uint16 index, int32 value);
@@ -271,21 +271,21 @@ class Object
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
{
if (apply) SetFlag(index,flag); else RemoveFlag(index,flag);
if (apply) SetFlag(index, flag); else RemoveFlag(index, flag);
}
void SetFlag64(uint16 index, uint64 newFlag)
{
uint64 oldval = GetUInt64Value(index);
uint64 newval = oldval | newFlag;
SetUInt64Value(index,newval);
SetUInt64Value(index, newval);
}
void RemoveFlag64(uint16 index, uint64 oldFlag)
{
uint64 oldval = GetUInt64Value(index);
uint64 newval = oldval & ~oldFlag;
SetUInt64Value(index,newval);
SetUInt64Value(index, newval);
}
void ToggleFlag64(uint16 index, uint64 flag)
@@ -304,7 +304,7 @@ class Object
void ApplyModFlag64(uint16 index, uint64 flag, bool apply)
{
if (apply) SetFlag64(index,flag); else RemoveFlag64(index,flag);
if (apply) SetFlag64(index, flag); else RemoveFlag64(index, flag);
}
void ClearUpdateMask(bool remove);
@@ -503,7 +503,7 @@ struct MovementInfo
MovementInfo()
{
pos.Relocate(0,0,0,0);
pos.Relocate(0, 0, 0, 0);
guid = 0;
flags = 0;
flags2 = 0;
@@ -511,7 +511,7 @@ struct MovementInfo
splineElevation = 0;
pitch = j_zspeed = j_sinAngle = j_cosAngle = j_xyspeed = 0.0f;
t_guid = 0;
t_pos.Relocate(0,0,0,0);
t_pos.Relocate(0, 0, 0, 0);
t_seat = -1;
}
@@ -597,11 +597,11 @@ class WorldObject : public Object, public WorldLocation
}
void GetNearPoint2D(float &x, float &y, float distance, float absAngle) const;
void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d,float absAngle) const;
void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const;
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d = 0, float angle = 0) const
{
// angle calculated from current orientation
GetNearPoint(NULL,x,y,z,size,distance2d,GetOrientation() + angle);
GetNearPoint(NULL, x, y, z, size, distance2d, GetOrientation() + angle);
}
void MovePosition(Position &pos, float dist, float angle);
void GetNearPosition(Position &pos, float dist, float angle)
@@ -624,7 +624,7 @@ class WorldObject : public Object, public WorldLocation
void GetContactPoint(const WorldObject* obj, float &x, float &y, float &z, float distance2d = CONTACT_DISTANCE) const
{
// angle to face `obj` to `this` using distance includes size of `obj`
GetNearPoint(obj,x,y,z,obj->GetObjectSize(),distance2d,GetAngle(obj));
GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
}
float GetObjectSize() const
@@ -705,11 +705,11 @@ class WorldObject : public Object, public WorldLocation
// use only if you will sure about placing both object at same map
bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const
{
return obj && _IsWithinDist(obj,dist2compare,is3D);
return obj && _IsWithinDist(obj, dist2compare, is3D);
}
bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const
{
return obj && IsInMap(obj) && _IsWithinDist(obj,dist2compare,is3D);
return obj && IsInMap(obj) && _IsWithinDist(obj, dist2compare, is3D);
}
bool IsWithinLOS(float x, float y, float z) const;
bool IsWithinLOSInMap(const WorldObject* obj) const;
@@ -717,7 +717,7 @@ class WorldObject : public Object, public WorldLocation
bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const;
bool IsInRange2d(float x, float y, float minRange, float maxRange) const;
bool IsInRange3d(float x, float y, float z, float minRange, float maxRange) const;
bool isInFront(WorldObject const* target,float distance, float arc = M_PI) const;
bool isInFront(WorldObject const* target, float distance, float arc = M_PI) const;
bool isInBack(WorldObject const* target, float distance, float arc = M_PI) const;
bool IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size = 0) const;
@@ -18,8 +18,8 @@
#include "ObjectPosSelector.h"
ObjectPosSelector::ObjectPosSelector(float x,float y,float size,float dist)
: m_center_x(x),m_center_y(y),m_size(size),m_dist(dist)
ObjectPosSelector::ObjectPosSelector(float x, float y, float size, float dist)
: m_center_x(x), m_center_y(y), m_size(size), m_dist(dist)
{
m_anglestep = acos(m_dist/(m_dist+2*m_size));
@@ -53,12 +53,12 @@ ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos
return &*itr;
}
void ObjectPosSelector::AddUsedPos(float size,float angle,float dist)
void ObjectPosSelector::AddUsedPos(float size, float angle, float dist)
{
if(angle>=0)
m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle,UsedPos(1.0,size,dist)));
m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle, UsedPos(1.0, size, dist)));
else
m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle,UsedPos(-1.0,size,dist)));
m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle, UsedPos(-1.0, size, dist)));
}
void ObjectPosSelector::InitializeAngle()
@@ -76,9 +76,9 @@ void ObjectPosSelector::InitializeAngle()
bool ObjectPosSelector::FirstAngle(float& angle)
{
if(m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() )
return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(),1.0,USED_POS_PLUS,angle);
return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0, USED_POS_PLUS, angle);
else if(m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() )
return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(),-1.0,USED_POS_MINUS,angle);
return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0, USED_POS_MINUS, angle);
return false;
}
@@ -118,9 +118,9 @@ bool ObjectPosSelector::NextPosibleAngle( float& angle )
{
bool ok;
if(m_smallStepOk[USED_POS_PLUS])
ok = NextSmallStepAngle(1.0,USED_POS_PLUS,angle);
ok = NextSmallStepAngle(1.0, USED_POS_PLUS, angle);
else
ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS],1.0,USED_POS_PLUS,angle);
ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS], 1.0, USED_POS_PLUS, angle);
if(!ok)
++m_nextUsedPos[USED_POS_PLUS]; // increase. only at fail (original or checked)
@@ -131,9 +131,9 @@ bool ObjectPosSelector::NextPosibleAngle( float& angle )
{
bool ok;
if(m_smallStepOk[USED_POS_MINUS])
ok = NextSmallStepAngle(-1.0,USED_POS_MINUS,angle);
ok = NextSmallStepAngle(-1.0, USED_POS_MINUS, angle);
else
ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS],-1.0,USED_POS_MINUS,angle);
ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0, USED_POS_MINUS, angle);
if(!ok)
++m_nextUsedPos[USED_POS_MINUS];
@@ -143,12 +143,12 @@ bool ObjectPosSelector::NextPosibleAngle( float& angle )
{
if( m_smallStepOk[USED_POS_PLUS] && (!m_smallStepOk[USED_POS_MINUS] || m_smallStepAngle[USED_POS_PLUS] <= m_smallStepAngle[USED_POS_MINUS]) )
{
return NextSmallStepAngle(1.0,USED_POS_PLUS,angle);
return NextSmallStepAngle(1.0, USED_POS_PLUS, angle);
}
// -- direction less updated
else if( m_smallStepOk[USED_POS_MINUS] )
{
return NextSmallStepAngle(-1.0,USED_POS_MINUS,angle);
return NextSmallStepAngle(-1.0, USED_POS_MINUS, angle);
}
}
@@ -34,7 +34,7 @@ struct ObjectPosSelector
{
struct UsedPos
{
UsedPos(float sign_, float size_,float dist_) : sign(sign_), size(size_),dist(dist_) {}
UsedPos(float sign_, float size_, float dist_) : sign(sign_), size(size_), dist(dist_) {}
float sign;
@@ -42,11 +42,11 @@ struct ObjectPosSelector
float dist; // dist to central point (including central point size)
};
typedef std::multimap<float,UsedPos> UsedPosList; // abs(angle)->Node
typedef std::multimap<float, UsedPos> UsedPosList; // abs(angle)->Node
ObjectPosSelector(float x,float y,float size,float dist);
ObjectPosSelector(float x, float y, float size, float dist);
void AddUsedPos(float size,float angle,float dist);
void AddUsedPos(float size, float angle, float dist);
void InitializeAngle();
bool FirstAngle(float& angle);
@@ -68,8 +68,8 @@ struct ObjectPosSelector
bool CheckOriginal() const
{
return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_PLUS].begin(),1.0,0)) &&
(m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_MINUS].begin(),-1.0,0));
return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_PLUS].begin(), 1.0, 0)) &&
(m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_MINUS].begin(), -1.0, 0));
}
bool IsNonBalanced() const { return m_UsedPosLists[USED_POS_PLUS].empty() != m_UsedPosLists[USED_POS_MINUS].empty(); }
@@ -31,7 +31,7 @@ UpdateData::UpdateData() : m_blockCount(0)
void UpdateData::AddOutOfRangeGUID(std::set<uint64>& guids)
{
m_outOfRangeGUIDs.insert(guids.begin(),guids.end());
m_outOfRangeGUIDs.insert(guids.begin(), guids.end());
}
void UpdateData::AddOutOfRangeGUID(const uint64 &guid)
@@ -57,7 +57,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION));
if (z_res != Z_OK)
{
sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
@@ -70,7 +70,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflate(&c_stream, Z_NO_FLUSH);
if (z_res != Z_OK)
{
sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
@@ -85,7 +85,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflate(&c_stream, Z_FINISH);
if (z_res != Z_STREAM_END)
{
sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
@@ -93,7 +93,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
z_res = deflateEnd(&c_stream);
if (z_res != Z_OK)
{
sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res));
sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
*dst_size = 0;
return;
}
+43 -43
View File
@@ -124,13 +124,13 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
// 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType "
"FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '%u' OR slot > '%u') ",
ownerid, petentry,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
ownerid, petentry, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT);
else
// any current or other non-stabled pet (for hunter "call pet")
// 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType "
"FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u') ",
ownerid,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
ownerid, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT);
if (!result)
return false;
@@ -212,7 +212,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
// this enables popup window (pet dismiss, cancel)
break;
case HUNTER_PET:
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); //class=warrior,gender=none,power=focus
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); //class=warrior, gender=none, power=focus
SetSheath(SHEATH_STATE_MELEE);
SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED);
@@ -394,7 +394,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
CharacterDatabase.escape_string(name);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
// remove current data
trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", owner,m_charmInfo->GetPetNumber());
trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", owner, m_charmInfo->GetPetNumber());
// prevent duplicate using slot (except PET_SAVE_NOT_IN_SLOT)
if (mode <= PET_SAVE_LAST_STABLE_SLOT)
@@ -404,7 +404,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
// prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT
if (getPetType() == HUNTER_PET && (mode == PET_SAVE_AS_CURRENT||mode > PET_SAVE_LAST_STABLE_SLOT))
trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u')",
owner,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
owner, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT);
// save pet
std::ostringstream ss;
ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType) "
@@ -682,7 +682,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
void Pet::Remove(PetSaveMode mode, bool returnreagent)
{
m_owner->RemovePet(this,mode,returnreagent);
m_owner->RemovePet(this, mode, returnreagent);
}
void Pet::GivePetXP(uint32 xp)
@@ -997,11 +997,11 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier));
// 14AP == 1dps, wolf's strike speed == 2s so dmg = basedmg + AP / 14 * 2
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE,float((petlevel * 4 - petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14)));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE,float((petlevel * 4 + petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14)));
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14)));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14)));
SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(m_owner->GetArmor()) * 0.35f); // Bonus Armor (35% of player armor)
SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE,float(m_owner->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina)
SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(m_owner->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina)
if (!HasAura(58877))//prevent apply twice for the 2 wolves
AddAura(58877, this);//Spirit Hunt, passive, Spirit Wolves' attacks heal them and their master for 150% of damage done.
break;
@@ -1080,7 +1080,7 @@ void Pet::_LoadSpellCooldowns()
m_CreatureSpellCooldowns.clear();
m_CreatureCategoryCooldowns.clear();
QueryResult result = CharacterDatabase.PQuery("SELECT spell,time FROM pet_spell_cooldown WHERE guid = '%u'",m_charmInfo->GetPetNumber());
QueryResult result = CharacterDatabase.PQuery("SELECT spell, time FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber());
if (result)
{
@@ -1099,7 +1099,7 @@ void Pet::_LoadSpellCooldowns()
if (!sSpellStore.LookupEntry(spell_id))
{
sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.",m_charmInfo->GetPetNumber(),spell_id);
sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
continue;
}
@@ -1110,7 +1110,7 @@ void Pet::_LoadSpellCooldowns()
data << uint32(spell_id);
data << uint32(uint32(db_time-curTime)*IN_MILLISECONDS);
_AddCreatureSpellCooldown(spell_id,db_time);
_AddCreatureSpellCooldown(spell_id, db_time);
sLog->outDebug(LOG_FILTER_PETS, "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime));
}
@@ -1134,7 +1134,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans)
m_CreatureSpellCooldowns.erase(itr++);
else
{
trans->PAppend("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second));
trans->PAppend("INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second));
++itr;
}
}
@@ -1142,7 +1142,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans)
void Pet::_LoadSpells()
{
QueryResult result = CharacterDatabase.PQuery("SELECT spell,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
QueryResult result = CharacterDatabase.PQuery("SELECT spell, active FROM pet_spell WHERE guid = '%u'", m_charmInfo->GetPetNumber());
if (result)
{
@@ -1174,10 +1174,10 @@ void Pet::_SaveSpells(SQLTransaction& trans)
continue;
case PETSPELL_CHANGED:
trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first);
trans->PAppend("INSERT INTO pet_spell (guid,spell,active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active);
trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active);
break;
case PETSPELL_NEW:
trans->PAppend("INSERT INTO pet_spell (guid,spell,active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active);
trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active);
break;
case PETSPELL_UNCHANGED:
continue;
@@ -1188,9 +1188,9 @@ void Pet::_SaveSpells(SQLTransaction& trans)
void Pet::_LoadAuras(uint32 timediff)
{
sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u",GetGUIDLow());
sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow());
QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber());
if (result)
{
@@ -1217,7 +1217,7 @@ void Pet::_LoadAuras(uint32 timediff)
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
if (!spellproto)
{
sLog->outError("Unknown aura (spellid %u), ignore.",spellid);
sLog->outError("Unknown aura (spellid %u), ignore.", spellid);
continue;
}
@@ -1246,7 +1246,7 @@ void Pet::_LoadAuras(uint32 timediff)
aura->Remove();
continue;
}
aura->SetLoadedState(maxduration,remaintime,remaincharges,stackcount,recalculatemask,&damage[0]);
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
aura->ApplyForTargets();
sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
@@ -1288,15 +1288,15 @@ void Pet::_SaveAuras(SQLTransaction& trans)
}
}
trans->PAppend("INSERT INTO pet_aura (guid,caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges) "
trans->PAppend("INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) "
"VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')",
m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(), itr->second->GetId(), effMask, recalculateMask,
itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2],
itr->second->GetMaxDuration(), itr->second->GetDuration(),itr->second->GetCharges());
itr->second->GetMaxDuration(), itr->second->GetDuration(), itr->second->GetCharges());
}
}
bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpellState state /*= PETSPELL_NEW*/, PetSpellType type /*= PETSPELL_NORMAL*/)
bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpellState state /*= PETSPELL_NEW*/, PetSpellType type /*= PETSPELL_NORMAL*/)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (!spellInfo)
@@ -1304,11 +1304,11 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
// do pet spell book cleanup
if (state == PETSPELL_UNCHANGED) // spell load case
{
sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.",spell_id);
CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'",spell_id);
sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spell_id);
CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'", spell_id);
}
else
sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.",spell_id);
sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.", spell_id);
return false;
}
@@ -1366,7 +1366,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
// skip unknown ranks
if (!HasSpell(rankSpellId))
continue;
removeSpell(rankSpellId,false,false);
removeSpell(rankSpellId, false, false);
}
}
}
@@ -1376,21 +1376,21 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
{
if (itr2->second.state == PETSPELL_REMOVED) continue;
if (sSpellMgr->IsRankSpellDueToSpell(spellInfo,itr2->first))
if (sSpellMgr->IsRankSpellDueToSpell(spellInfo, itr2->first))
{
// replace by new high rank
if (sSpellMgr->IsHighRankOfSpell(spell_id,itr2->first))
if (sSpellMgr->IsHighRankOfSpell(spell_id, itr2->first))
{
newspell.active = itr2->second.active;
if (newspell.active == ACT_ENABLED)
ToggleAutocast(itr2->first, false);
unlearnSpell(itr2->first,false,false);
unlearnSpell(itr2->first, false, false);
break;
}
// ignore new lesser rank
else if (sSpellMgr->IsHighRankOfSpell(itr2->first,spell_id))
else if (sSpellMgr->IsHighRankOfSpell(itr2->first, spell_id))
return false;
}
}
@@ -1445,7 +1445,7 @@ void Pet::InitLevelupSpellsForLevel()
{
// will called first if level down
if (itr->first > level)
unlearnSpell(itr->second,true); // will learn prev rank if any
unlearnSpell(itr->second, true); // will learn prev rank if any
// will called if level up
else
learnSpell(itr->second); // will unlearn prev rank if any
@@ -1465,7 +1465,7 @@ void Pet::InitLevelupSpellsForLevel()
// will called first if level down
if (spellEntry->spellLevel > level)
unlearnSpell(spellEntry->Id,true);
unlearnSpell(spellEntry->Id, true);
// will called if level up
else
learnSpell(spellEntry->Id);
@@ -1475,7 +1475,7 @@ void Pet::InitLevelupSpellsForLevel()
bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
{
if (removeSpell(spell_id,learn_prev,clear_ab))
if (removeSpell(spell_id, learn_prev, clear_ab))
{
if (!m_loading)
{
@@ -1571,7 +1571,7 @@ bool Pet::resetTalents(bool no_cost)
// not need after this call
if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS,true);
owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true);
CreatureTemplate const * ci = GetCreatureInfo();
if (!ci)
@@ -1634,9 +1634,9 @@ bool Pet::resetTalents(bool no_cost)
uint32 itrFirstId = sSpellMgr->GetFirstSpellInChain(itr->first);
// unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j], itrFirstId))
{
unlearnSpell(itr->first,false);
unlearnSpell(itr->first, false);
itr = m_spells.begin();
continue;
}
@@ -1664,7 +1664,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
{
// not need after this call
if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS,true);
owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true);
// reset for online
if (online_pet)
@@ -1675,7 +1675,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
QueryResult resultPets = CharacterDatabase.PQuery(
"SELECT id FROM character_pet WHERE owner = '%u' AND id <> '%u'",
owner->GetGUIDLow(),except_petnumber);
owner->GetGUIDLow(), except_petnumber);
// no offline pets
if (!resultPets)
@@ -1684,7 +1684,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
QueryResult result = CharacterDatabase.PQuery(
"SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet "
"WHERE character_pet.owner = '%u' AND character_pet.id = pet_spell.guid AND character_pet.id <> %u",
owner->GetGUIDLow(),except_petnumber);
owner->GetGUIDLow(), except_petnumber);
if (!result)
return;
@@ -1700,7 +1700,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
uint32 id = fields[0].GetUInt32();
if (need_comma)
ss << ",";
ss << ", ";
ss << id;
@@ -1721,7 +1721,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
continue;
if (need_execute)
ss << ",";
ss << ", ";
ss << spell;
@@ -1855,7 +1855,7 @@ bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint3
ASSERT(map);
SetMap(map);
SetPhaseMask(phaseMask,false);
SetPhaseMask(phaseMask, false);
Object::_Create(guidlow, pet_number, HIGHGUID_PET);
m_DBTableGuid = guidlow;
+3 -3
View File
@@ -138,9 +138,9 @@ class Pet : public Guardian
bool Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature);
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo,Unit * owner);
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit * owner);
bool CreateBaseAtTamed(CreatureTemplate const * cinfo, Map * map, uint32 phaseMask);
bool LoadPetFromDB(Player* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false);
bool LoadPetFromDB(Player* owner, uint32 petentry = 0, uint32 petnumber = 0, bool current = false);
bool isBeingLoaded() const { return m_loading;}
void SavePetToDB(PetSaveMode mode);
void Remove(PetSaveMode mode, bool returnreagent = false);
@@ -195,7 +195,7 @@ class Pet : public Guardian
void _LoadSpells();
void _SaveSpells(SQLTransaction& trans);
bool addSpell(uint32 spell_id,ActiveStates active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
bool addSpell(uint32 spell_id, ActiveStates active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
bool learnSpell(uint32 spell_id);
void learnSpellHighRank(uint32 spellid);
void InitLevelupSpellsForLevel();
File diff suppressed because it is too large Load Diff
+32 -32
View File
@@ -188,7 +188,7 @@ struct ActionButton
#define MAX_ACTION_BUTTONS 144 //checked in 3.2.0
typedef std::map<uint8,ActionButton> ActionButtonList;
typedef std::map<uint8, ActionButton> ActionButtonList;
struct PlayerCreateInfoItem
{
@@ -238,7 +238,7 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
struct PlayerInfo
{
// existence checked by displayId != 0
PlayerInfo() : displayId_m(0),displayId_f(0),levelInfo(NULL)
PlayerInfo() : displayId_m(0), displayId_f(0), levelInfo(NULL)
{
}
@@ -687,8 +687,8 @@ enum TransferAbortReason
TRANSFER_ABORT_NOT_FOUND = 0x03, // Transfer Aborted: instance not found
TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x04, // You have entered too many instances recently.
TRANSFER_ABORT_ZONE_IN_COMBAT = 0x06, // Unable to zone in while an encounter is in progress.
TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x07, // You must have <TBC,WotLK> expansion installed to access this area.
TRANSFER_ABORT_DIFFICULTY = 0x08, // <Normal,Heroic,Epic> difficulty mode is not available for %s.
TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x07, // You must have <TBC, WotLK> expansion installed to access this area.
TRANSFER_ABORT_DIFFICULTY = 0x08, // <Normal, Heroic, Epic> difficulty mode is not available for %s.
TRANSFER_ABORT_UNIQUE_MESSAGE = 0x09, // Until you've escaped TLK's grasp, you cannot leave this place!
TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x0A, // Additional instances cannot be launched, please try again later.
TRANSFER_ABORT_NEED_GROUP = 0x0B, // 3.1
@@ -890,7 +890,7 @@ class PlayerTaxi
else
return false;
}
void AppendTaximaskTo(ByteBuffer& data,bool all);
void AppendTaximaskTo(ByteBuffer& data, bool all);
// Destinations
bool LoadTaxiDestinationsFromString(const std::string& values, uint32 team);
@@ -1086,8 +1086,8 @@ class Player : public Unit, public GridObject<Player>
bool ToggleAFK();
bool ToggleDND();
bool isAFK() const { return HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_AFK); }
bool isDND() const { return HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_DND); }
bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); }
bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); }
uint8 chatTag() const;
std::string afkMsg;
std::string dndMsg;
@@ -1131,7 +1131,7 @@ class Player : public Unit, public GridObject<Player>
void setDeathState(DeathState s); // overwrite Unit::setDeathState
void InnEnter (time_t time,uint32 mapid, float x,float y,float z)
void InnEnter (time_t time, uint32 mapid, float x, float y, float z)
{
inn_pos_mapid = mapid;
inn_pos_x = x;
@@ -1162,7 +1162,7 @@ class Player : public Unit, public GridObject<Player>
void Say(const std::string& text, const uint32 language);
void Yell(const std::string& text, const uint32 language);
void TextEmote(const std::string& text);
void Whisper(const std::string& text, const uint32 language,uint64 receiver);
void Whisper(const std::string& text, const uint32 language, uint64 receiver);
void BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const;
/*********************************************************/
@@ -1189,12 +1189,12 @@ class Player : public Unit, public GridObject<Player>
Item* GetShield(bool useable = false) const;
static uint8 GetAttackBySlot(uint8 slot); // MAX_ATTACK if not weapon slot
std::vector<Item *> &GetItemUpdateQueue() { return m_itemUpdateQueue; }
static bool IsInventoryPos(uint16 pos) { return IsInventoryPos(pos >> 8,pos & 255); }
static bool IsInventoryPos(uint16 pos) { return IsInventoryPos(pos >> 8, pos & 255); }
static bool IsInventoryPos(uint8 bag, uint8 slot);
static bool IsEquipmentPos(uint16 pos) { return IsEquipmentPos(pos >> 8,pos & 255); }
static bool IsEquipmentPos(uint16 pos) { return IsEquipmentPos(pos >> 8, pos & 255); }
static bool IsEquipmentPos(uint8 bag, uint8 slot);
static bool IsBagPos(uint16 pos);
static bool IsBankPos(uint16 pos) { return IsBankPos(pos >> 8,pos & 255); }
static bool IsBankPos(uint16 pos) { return IsBankPos(pos >> 8, pos & 255); }
static bool IsBankPos(uint8 bag, uint8 slot);
bool IsValidPos(uint16 pos, bool explicit_pos) { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos);
@@ -1205,8 +1205,8 @@ class Player : public Unit, public GridObject<Player>
bool CanNoReagentCast(SpellEntry const* spellInfo) const;
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const;
InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(),pItem->GetCount(),pItem); }
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry,count,NULL); }
InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); }
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry, count, NULL); }
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const
{
return _CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count);
@@ -1219,7 +1219,7 @@ class Player : public Unit, public GridObject<Player>
return _CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL);
}
InventoryResult CanStoreItems(Item** pItem,int count) const;
InventoryResult CanStoreItems(Item** pItem, int count) const;
InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const;
InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item *pItem, bool swap, bool not_loading = true) const;
@@ -1240,7 +1240,7 @@ class Player : public Unit, public GridObject<Player>
void AutoUnequipOffhandIfNeed(bool force = false);
bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count);
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false);
void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG,NULL_SLOT,loot_id,store,broadcast); }
void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); }
void StoreLootItem(uint8 lootSlot, Loot* loot);
InventoryResult _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const;
@@ -1289,7 +1289,7 @@ class Player : public Unit, public GridObject<Player>
bool IsUseEquipedWeapon(bool mainhand) const
{
// disarm applied only to mainhand weapon
return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED));
return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED));
}
bool IsTwoHandUsed() const
{
@@ -1473,7 +1473,7 @@ class Player : public Unit, public GridObject<Player>
static float GetFloatValueFromArray(Tokens const& data, uint16 index);
static uint32 GetZoneIdFromDB(uint64 guid);
static uint32 GetLevelFromDB(uint64 guid);
static bool LoadPositionFromDB(uint32& mapid, float& x,float& y,float& z,float& o, bool& in_flight, uint64 guid);
static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid);
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; }
@@ -1485,10 +1485,10 @@ class Player : public Unit, public GridObject<Player>
void SaveInventoryAndGoldToDB(SQLTransaction& trans); // fast save function for item/money cheating preventing
void SaveGoldToDB(SQLTransaction& trans);
static void SetUInt32ValueInArray(Tokens& data,uint16 index, uint32 value);
static void SetFloatValueInArray(Tokens& data,uint16 index, float value);
static void SetUInt32ValueInArray(Tokens& data, uint16 index, uint32 value);
static void SetFloatValueInArray(Tokens& data, uint16 index, float value);
static void Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair);
static void SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint32 zone,uint64 guid);
static void SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, uint64 guid);
static void DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmChars = true, bool deleteFinally = false);
static void DeleteOldCharacters();
@@ -1500,7 +1500,7 @@ class Player : public Unit, public GridObject<Player>
void SetBindPoint(uint64 guid);
void SendTalentWipeConfirm(uint64 guid);
void ResetPetTalents();
void CalcRage(uint32 damage,bool attacker);
void CalcRage(uint32 damage, bool attacker);
void RegenerateAll();
void Regenerate(Powers power);
void RegenerateHealth();
@@ -1707,7 +1707,7 @@ class Player : public Unit, public GridObject<Player>
m_resurrectHealth = health;
m_resurrectMana = mana;
}
void clearResurrectRequestData() { setResurrectRequestData(0,0,0.0f,0.0f,0.0f,0,0); }
void clearResurrectRequestData() { setResurrectRequestData(0, 0, 0.0f, 0.0f, 0.0f, 0, 0); }
bool isRessurectRequestedBy(uint64 guid) const { return m_resurrectGUID == guid; }
bool isRessurectRequested() const { return m_resurrectGUID != 0; }
void ResurectUsingRequestData();
@@ -1737,7 +1737,7 @@ class Player : public Unit, public GridObject<Player>
(*itr)->SetPvP(state);
}
void UpdatePvP(bool state, bool override=false);
void UpdateZone(uint32 newZone,uint32 newArea);
void UpdateZone(uint32 newZone, uint32 newArea);
void UpdateArea(uint32 newArea);
void UpdateZoneDependentAuras(uint32 zone_id); // zones
@@ -1766,7 +1766,7 @@ class Player : public Unit, public GridObject<Player>
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); }
void UninviteFromGroup();
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0 , const char* reason = NULL);
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(),GetGUID(), method); }
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
void SendUpdateToOutOfRangeGroupMembers();
void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); }
@@ -1992,7 +1992,7 @@ class Player : public Unit, public GridObject<Player>
void UpdateSkillsForLevel();
void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
void ModifySkillBonus(uint32 skillid,int32 val, bool talent);
void ModifySkillBonus(uint32 skillid, int32 val, bool talent);
/*********************************************************/
/*** PVP SYSTEM ***/
@@ -2044,11 +2044,11 @@ class Player : public Unit, public GridObject<Player>
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const * aura, bool apply);
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect const * aura, bool apply);
void _ApplyItemMods(Item *item,uint8 slot,bool apply);
void _ApplyItemMods(Item *item, uint8 slot, bool apply);
void _RemoveAllItemMods();
void _ApplyAllItemMods();
void _ApplyAllLevelScaleItemMods(bool apply);
void _ApplyItemBonuses(ItemTemplate const *proto,uint8 slot,bool apply, bool only_level_scale = false);
void _ApplyItemBonuses(ItemTemplate const *proto, uint8 slot, bool apply, bool only_level_scale = false);
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply);
void _ApplyAmmoBonuses();
bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot);
@@ -2060,7 +2060,7 @@ class Player : public Unit, public GridObject<Player>
void ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply, bool form_change = false);
void UpdateEquipSpellsAtFormChange();
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx);
void CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex);
void CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex);
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item *item, ItemTemplate const * proto);
void SendEquipmentSetList();
@@ -2225,7 +2225,7 @@ class Player : public Unit, public GridObject<Player>
/*********************************************************/
/*** VARIOUS SYSTEMS ***/
/*********************************************************/
void UpdateFallInformationIfNeed(MovementInfo const& minfo,uint16 opcode);
void UpdateFallInformationIfNeed(MovementInfo const& minfo, uint16 opcode);
Unit *m_mover;
WorldObject *m_seer;
void SetFallInformation(uint32 time, float z)
@@ -2759,8 +2759,8 @@ class Player : public Unit, public GridObject<Player>
uint32 _pendingBindTimer;
};
void AddItemsSetItem(Player*player,Item *item);
void RemoveItemsSetItem(Player*player,ItemTemplate const *proto);
void AddItemsSetItem(Player*player, Item *item);
void RemoveItemsSetItem(Player*player, ItemTemplate const *proto);
// "the bodies of template functions must be made available in a header file"
template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
@@ -106,7 +106,7 @@ void PlayerSocial::SetFriendNote(uint32 friend_guid, std::string note)
if (itr == m_playerSocialMap.end()) // not exist
return;
utf8truncate(note,48); // DB and client size limitation
utf8truncate(note, 48); // DB and client size limitation
CharacterDatabase.escape_string(note);
CharacterDatabase.PExecute("UPDATE character_social SET note = '%s' WHERE guid = '%u' AND friend = '%u'", note.c_str(), GetPlayerGUID(), friend_guid);
@@ -77,7 +77,7 @@ void MapManager::LoadTransports()
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId);
sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
delete t;
continue;
}
@@ -109,7 +109,7 @@ void MapManager::LoadTransports()
while (result->NextRow());
// check transport data DB integrity
result = WorldDatabase.Query("SELECT gameobject.guid,gameobject.id,transports.name FROM gameobject,transports WHERE gameobject.id = transports.entry");
result = WorldDatabase.Query("SELECT gameobject.guid, gameobject.id, transports.name FROM gameobject, transports WHERE gameobject.id = transports.entry");
if (result) // wrong data found
{
do
@@ -119,7 +119,7 @@ void MapManager::LoadTransports()
uint32 guid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
std::string name = fields[2].GetString();
sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.",entry,name.c_str(),guid);
sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid);
}
while (result->NextRow());
}
@@ -195,13 +195,13 @@ Transport::~Transport()
bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags)
{
Relocate(x,y,z,ang);
Relocate(x, y, z, ang);
// instance id and phaseMask isn't set to values different from std.
if (!IsPositionValid())
{
sLog->outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow,x,y);
guidlow, x, y);
return false;
}
@@ -211,7 +211,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!goinfo)
{
sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f",guidlow, mapid, x, y, z, ang);
sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
return false;
}
@@ -559,7 +559,7 @@ void Transport::Update(uint32 p_diff)
m_curr = GetNextWayPoint();
m_next = GetNextWayPoint();
DoEventIfAny(*m_curr,false);
DoEventIfAny(*m_curr, false);
// first check help in case client-server transport coordinates de-synchronization
if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport)
@@ -568,7 +568,7 @@ void Transport::Update(uint32 p_diff)
}
else
{
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x,m_next->second.y) + float(M_PI));
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI));
UpdateNPCPositions(); // COME BACK MARKER
}
@@ -577,7 +577,7 @@ void Transport::Update(uint32 p_diff)
m_nextNodeTime = m_curr->first;
if (m_curr == m_WayPoints.begin())
sLog->outDebug(LOG_FILTER_TRANSPORTS," ************ BEGIN ************** %s", m_name.c_str());
sLog->outDebug(LOG_FILTER_TRANSPORTS, " ************ BEGIN ************** %s", m_name.c_str());
sLog->outDebug(LOG_FILTER_TRANSPORTS, "%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
}
@@ -671,7 +671,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
if(!pCreature->IsPositionValid())
{
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", pCreature->GetGUIDLow(), pCreature->GetEntry(), pCreature->GetPositionX(), pCreature->GetPositionY());
delete pCreature;
return 0;
}
@@ -700,7 +700,7 @@ void Transport::UpdatePosition(MovementInfo* mi)
float transport_y = mi->pos.m_positionY - (mi->t_pos.m_positionY * cos(transport_o) + mi->t_pos.m_positionX*sin(transport_o));
float transport_z = mi->pos.m_positionZ - mi->t_pos.m_positionZ;
Relocate(transport_x,transport_y,transport_z,transport_o);
Relocate(transport_x, transport_y, transport_z, transport_o);
UpdateNPCPositions();
}
+13 -13
View File
@@ -449,7 +449,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
break;
}
float att_speed = GetAPMultiplier(attType,normalized);
float att_speed = GetAPMultiplier(attType, normalized);
float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed;
float base_pct = GetModifierValue(unitMod, BASE_PCT);
@@ -501,16 +501,16 @@ void Player::UpdateDamagePhysical(WeaponAttackType attType)
{
case BASE_ATTACK:
default:
SetStatFloatValue(UNIT_FIELD_MINDAMAGE,mindamage);
SetStatFloatValue(UNIT_FIELD_MAXDAMAGE,maxdamage);
SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage);
break;
case OFF_ATTACK:
SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE,mindamage);
SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE,maxdamage);
SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxdamage);
break;
case RANGED_ATTACK:
SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE,mindamage);
SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE,maxdamage);
SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxdamage);
break;
}
}
@@ -901,16 +901,16 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
{
case BASE_ATTACK:
default:
SetStatFloatValue(UNIT_FIELD_MINDAMAGE,mindamage);
SetStatFloatValue(UNIT_FIELD_MAXDAMAGE,maxdamage);
SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage);
break;
case OFF_ATTACK:
SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE,mindamage);
SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE,maxdamage);
SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxdamage);
break;
case RANGED_ATTACK:
SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE,mindamage);
SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE,maxdamage);
SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxdamage);
break;
}
}
File diff suppressed because it is too large Load Diff
+32 -32
View File
@@ -152,7 +152,7 @@ enum SpellFacingFlags
#define BASE_MAXDAMAGE 2.0f
#define BASE_ATTACK_TIME 2000
// byte value (UNIT_FIELD_BYTES_1,0)
// byte value (UNIT_FIELD_BYTES_1, 0)
enum UnitStandStateType
{
UNIT_STAND_STATE_STAND = 0,
@@ -167,7 +167,7 @@ enum UnitStandStateType
UNIT_STAND_STATE_SUBMERGED = 9
};
// byte flag value (UNIT_FIELD_BYTES_1,2)
// byte flag value (UNIT_FIELD_BYTES_1, 2)
enum UnitStandFlags
{
UNIT_STAND_FLAGS_UNK1 = 0x01,
@@ -178,7 +178,7 @@ enum UnitStandFlags
UNIT_STAND_FLAGS_ALL = 0xFF
};
// byte flags value (UNIT_FIELD_BYTES_1,3)
// byte flags value (UNIT_FIELD_BYTES_1, 3)
enum UnitBytes1_Flags
{
UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01,
@@ -982,7 +982,7 @@ enum CommandStates
#define UNIT_ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF)
#define UNIT_ACTION_BUTTON_TYPE(X) ((uint32(X) & 0xFF000000) >> 24)
#define MAKE_UNIT_ACTION_BUTTON(A,T) (uint32(A) | (uint32(T) << 24))
#define MAKE_UNIT_ACTION_BUTTON(A, T) (uint32(A) | (uint32(T) << 24))
struct UnitActionBarEntry
{
@@ -1001,12 +1001,12 @@ struct UnitActionBarEntry
void SetActionAndType(uint32 action, ActiveStates type)
{
packedData = MAKE_UNIT_ACTION_BUTTON(action,type);
packedData = MAKE_UNIT_ACTION_BUTTON(action, type);
}
void SetType(ActiveStates type)
{
packedData = MAKE_UNIT_ACTION_BUTTON(UNIT_ACTION_BUTTON_ACTION(packedData),type);
packedData = MAKE_UNIT_ACTION_BUTTON(UNIT_ACTION_BUTTON_ACTION(packedData), type);
}
void SetAction(uint32 action)
@@ -1061,9 +1061,9 @@ struct CharmInfo
void LoadPetActionBar(const std::string& data);
void BuildActionBar(WorldPacket* data);
void SetSpellAutocast(uint32 spell_id, bool state);
void SetActionBar(uint8 index, uint32 spellOrAction,ActiveStates type)
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
{
PetActionBar[index].SetActionAndType(spellOrAction,type);
PetActionBar[index].SetActionAndType(spellOrAction, type);
}
UnitActionBarEntry const* GetActionBarEntry(uint8 index) const { return &(PetActionBar[index]); }
@@ -1168,14 +1168,14 @@ class Unit : public WorldObject
DiminishingLevels GetDiminishing(DiminishingGroup group);
void IncrDiminishing(DiminishingGroup group);
float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration);
float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration);
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
void ClearDiminishings() { m_Diminishing.clear(); }
//target dependent range checks
uint32 GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry);
uint32 GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry);
uint32 GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry);
uint32 GetSpellMaxRangeForTarget(Unit* target, const SpellRangeEntry * rangeEntry);
uint32 GetSpellMinRangeForTarget(Unit* target, const SpellRangeEntry * rangeEntry);
uint32 GetSpellRadiusForTarget(Unit* target, const SpellRadiusEntry * radiusEntry);
virtual void Update(uint32 time);
@@ -1260,7 +1260,7 @@ class Unit : public WorldObject
void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); }
uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); }
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school,val); }
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school, val); }
uint32 GetHealth() const { return GetUInt32Value(UNIT_FIELD_HEALTH); }
uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); }
@@ -1294,8 +1294,8 @@ class Unit : public WorldObject
return (uint32)f_BaseAttackTime;
}
void SetAttackTime(WeaponAttackType att, uint32 val) { SetFloatValue(UNIT_FIELD_BASEATTACKTIME+att,val*m_modAttackSpeedPct[att]); }
void ApplyAttackTimePercentMod(WeaponAttackType att,float val, bool apply);
void SetAttackTime(WeaponAttackType att, uint32 val) { SetFloatValue(UNIT_FIELD_BASEATTACKTIME+att, val*m_modAttackSpeedPct[att]); }
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply);
void ApplyCastTimePercentMod(float val, bool apply);
SheathState GetSheath() const { return SheathState(GetByteValue(UNIT_FIELD_BYTES_2, 0)); }
@@ -1341,8 +1341,8 @@ class Unit : public WorldObject
bool IsStandState() const;
void SetStandState(uint8 state);
void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, 2,flags); }
void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, 2,flags); }
void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, 2, flags); }
void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, 2, flags); }
bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); }
uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); }
@@ -1398,9 +1398,9 @@ class Unit : public WorldObject
{
switch(attacktype)
{
case BASE_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED);
case OFF_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_DISARM_OFFHAND);
case RANGED_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_DISARM_RANGED);
case BASE_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED);
case OFF_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISARM_OFFHAND);
case RANGED_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISARM_RANGED);
}
return true;
}
@@ -1468,7 +1468,7 @@ class Unit : public WorldObject
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false);
int32 HealBySpell(Unit * pVictim, SpellEntry const * spellInfo, uint32 addHealth, bool critical = false);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect const * triggeredByAura = NULL, uint64 originalCaster = 0);
@@ -1489,7 +1489,7 @@ class Unit : public WorldObject
void SendAttackStateUpdate(CalcDamageInfo *damageInfo);
void SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log);
void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
void SendSpellNonMeleeDamageLog(Unit *target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo);
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo);
void SendSpellDamageImmune(Unit *target, uint32 spellId);
@@ -1515,7 +1515,7 @@ class Unit : public WorldObject
void SendMovementFlagUpdate();
template<typename PathElem, typename PathNode>
void SendMonsterMoveByPath(Path<PathElem,PathNode> const& path, uint32 start, uint32 end);
void SendMonsterMoveByPath(Path<PathElem, PathNode> const& path, uint32 start, uint32 end);
void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference);
void SendClearThreatListOpcode();
@@ -1610,8 +1610,8 @@ class Unit : public WorldObject
void RemoveBindSightAuras();
void RemoveCharmAuras();
Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0);
Pet* CreateTamedPetFrom(uint32 creatureEntry,uint32 spell_id = 0);
Pet* CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id = 0);
Pet* CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id = 0);
bool InitTamedPet(Pet * pet, uint8 level, uint32 spell_id);
// aura apply/remove helpers - you should better not use these
@@ -1647,10 +1647,10 @@ class Unit : public WorldObject
void RemoveAurasDueToSpell(uint32 spellId, uint64 caster = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAuraFromStack(uint32 spellId, uint64 caster = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
inline void RemoveAuraFromStack(AuraMap::iterator &iter,AuraRemoveMode removeMode);
inline void RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode removeMode);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
void RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId);
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except = NULL, bool negative = true, bool positive = true);
void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0);
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
@@ -1722,7 +1722,7 @@ class Unit : public WorldObject
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellEntry const * affectedSpell) const;
float GetResistanceBuffMods(SpellSchools school, bool positive) const { return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school); }
void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school,val); }
void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val); }
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply) { ApplyModSignedFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); }
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply) { ApplyPercentModFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); }
void InitStatBuffMods()
@@ -1824,10 +1824,10 @@ class Unit : public WorldObject
virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0;
virtual void UpdateDamagePhysical(WeaponAttackType attType) = 0;
float GetTotalAttackPowerValue(WeaponAttackType attType) const;
float GetWeaponDamageRange(WeaponAttackType attType ,WeaponDamageRange type) const;
void SetBaseWeaponDamage(WeaponAttackType attType ,WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
float GetWeaponDamageRange(WeaponAttackType attType , WeaponDamageRange type) const;
void SetBaseWeaponDamage(WeaponAttackType attType , WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
bool isInFrontInMap(Unit const* target,float distance, float arc = M_PI) const;
bool isInFrontInMap(Unit const* target, float distance, float arc = M_PI) const;
void SetInFront(Unit const* target)
{
if (!HasUnitState(UNIT_STAT_CANNOT_TURN))
@@ -2235,7 +2235,7 @@ namespace Trinity
}
template<typename Elem, typename Node>
inline void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 start, uint32 end)
inline void Unit::SendMonsterMoveByPath(Path<Elem, Node> const& path, uint32 start, uint32 end)
{
uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32);
uint32 pathSize = end - start;
+45 -45
View File
@@ -203,7 +203,7 @@ void GameEventMgr::LoadFromDB()
{
uint32 oldMSTime = getMSTime();
QueryResult result = WorldDatabase.Query("SELECT eventEntry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event");
QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event");
if (!result)
{
mGameEvent.clear();
@@ -238,7 +238,7 @@ void GameEventMgr::LoadFromDB()
if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
{
sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id);
sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
continue;
}
@@ -246,7 +246,7 @@ void GameEventMgr::LoadFromDB()
{
if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))
{
sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id);
sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id);
pGameEvent.holiday_id = HOLIDAY_NONE;
}
}
@@ -385,7 +385,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -428,7 +428,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -469,7 +469,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventModelEquip.size())
{
sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -526,7 +526,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventCreatureQuests.size())
{
sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -567,7 +567,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventGameObjectQuests.size())
{
sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -609,7 +609,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -650,7 +650,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -692,7 +692,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -703,7 +703,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition);
sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
continue;
}
@@ -741,11 +741,11 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid,npcflag));
mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid, npcflag));
++count;
}
@@ -779,7 +779,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventVendors.size())
{
sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -845,7 +845,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -887,7 +887,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`",event_id);
sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -962,11 +962,11 @@ uint32 GameEventMgr::StartSystem() // return the next
void GameEventMgr::StartArenaSeason()
{
QueryResult result = WorldDatabase.PQuery("SELECT eventEntry FROM game_event_arena_seasons WHERE season = '%i'",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
QueryResult result = WorldDatabase.PQuery("SELECT eventEntry FROM game_event_arena_seasons WHERE season = '%i'", sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
if (!result)
{
sLog->outError("ArenaSeason (%i) must be an existant Arena Season",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
sLog->outError("ArenaSeason (%i) must be an existant Arena Season", sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
return;
}
@@ -974,8 +974,8 @@ void GameEventMgr::StartArenaSeason()
uint16 eventId = fields[0].GetUInt16();
StartEvent(eventId,true);
sLog->outString("Arena Season %i started...",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
StartEvent(eventId, true);
sLog->outString("Arena Season %i started...", sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
sLog->outString();
}
@@ -989,7 +989,7 @@ uint32 GameEventMgr::Update() // return the next e
{
// must do the activating first, and after that the deactivating
// so first queue it
//sLog->outErrorDb("Checking event %u",itr);
//sLog->outErrorDb("Checking event %u", itr);
if (CheckOneGameEvent(itr))
{
// if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so
@@ -1010,14 +1010,14 @@ uint32 GameEventMgr::Update() // return the next e
// changed, save to DB the gameevent state, will be updated in next update cycle
SaveWorldEventStateToDB(itr);
//sLog->outDebug("GameEvent %u is active",itr->first);
//sLog->outDebug("GameEvent %u is active", itr->first);
// queue for activation
if (!IsActiveEvent(itr))
activate.insert(itr);
}
else
{
//sLog->outDebug("GameEvent %u is not active",itr->first);
//sLog->outDebug("GameEvent %u is not active", itr->first);
if (IsActiveEvent(itr))
deactivate.insert(itr);
else
@@ -1109,14 +1109,14 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
// get the creature data from the low guid to get the entry, to be able to find out the whole guid
if (CreatureData const* data = sObjectMgr->GetCreatureData(itr->first))
{
Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first,data->id,HIGHGUID_UNIT));
Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT));
// if we found the creature, modify its npcflag
if (cr)
{
uint32 npcflag = GetNPCFlag(cr);
if (const CreatureTemplate * ci = cr->GetCreatureInfo())
npcflag |= ci->npcflag;
cr->SetUInt32Value(UNIT_NPC_FLAGS,npcflag);
cr->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
// reset gossip options, since the flag change might have added / removed some
//cr->ResetGossipOptions();
}
@@ -1168,7 +1168,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
{
Creature* pCreature = new Creature;
//sLog->outDebug("Spawning creature %u",*itr);
//sLog->outDebug("Spawning creature %u", *itr);
if (!pCreature->LoadFromDB(*itr, map))
delete pCreature;
else
@@ -1234,7 +1234,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin(); itr != mGameEventCreatureGuids[internal_event_id].end(); ++itr)
{
// check if it's needed by another event, if so, don't remove
if (event_id > 0 && hasCreatureActiveEventExcept(*itr,event_id))
if (event_id > 0 && hasCreatureActiveEventExcept(*itr, event_id))
continue;
// Remove the creature from grid
if (CreatureData const* data = sObjectMgr->GetCreatureData(*itr))
@@ -1256,7 +1256,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin(); itr != mGameEventGameobjectGuids[internal_event_id].end(); ++itr)
{
// check if it's needed by another event, if so, don't remove
if (event_id >0 && hasGameObjectActiveEventExcept(*itr,event_id))
if (event_id >0 && hasGameObjectActiveEventExcept(*itr, event_id))
continue;
// Remove the gameobject from grid
if (GameObjectData const* data = sObjectMgr->GetGOData(*itr))
@@ -1269,7 +1269,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
}
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",internal_event_id,mGameEventPoolIds.size());
sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size());
return;
}
@@ -1289,7 +1289,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
continue;
// Update if spawned
Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL);
Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL);
if (pCreature)
{
if (activate)
@@ -1304,8 +1304,8 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
{
pCreature->SetDisplayId(itr->second.modelid);
pCreature->SetNativeDisplayId(itr->second.modelid);
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius);
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach);
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
}
}
}
@@ -1319,8 +1319,8 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
{
pCreature->SetDisplayId(itr->second.modelid_prev);
pCreature->SetNativeDisplayId(itr->second.modelid_prev);
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius);
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach);
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
}
}
}
@@ -1331,7 +1331,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
if (data2 && activate)
{
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(data2->id);
uint32 displayID = sObjectMgr->ChooseDisplayId(0,cinfo,data2);
uint32 displayID = sObjectMgr->ChooseDisplayId(0, cinfo, data2);
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID);
if (data2->equipmentId == 0)
@@ -1423,13 +1423,13 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate)
for (itr = mGameEventCreatureQuests[event_id].begin(); itr != mGameEventCreatureQuests[event_id].end(); ++itr)
{
QuestRelations* CreatureQuestMap = sObjectMgr->GetCreatureQuestRelationMap();
if (activate) // Add the pair(id,quest) to the multimap
if (activate) // Add the pair(id, quest) to the multimap
CreatureQuestMap->insert(QuestRelations::value_type(itr->first, itr->second));
else
{
if (!hasCreatureQuestActiveEventExcept(itr->second,event_id))
if (!hasCreatureQuestActiveEventExcept(itr->second, event_id))
{
// Remove the pair(id,quest) from the multimap
// Remove the pair(id, quest) from the multimap
QuestRelations::iterator qitr = CreatureQuestMap->find(itr->first);
if (qitr == CreatureQuestMap->end())
continue;
@@ -1448,13 +1448,13 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate)
for (itr = mGameEventGameObjectQuests[event_id].begin(); itr != mGameEventGameObjectQuests[event_id].end(); ++itr)
{
QuestRelations* GameObjectQuestMap = sObjectMgr->GetGOQuestRelationMap();
if (activate) // Add the pair(id,quest) to the multimap
if (activate) // Add the pair(id, quest) to the multimap
GameObjectQuestMap->insert(QuestRelations::value_type(itr->first, itr->second));
else
{
if (!hasGameObjectQuestActiveEventExcept(itr->second,event_id))
if (!hasGameObjectQuestActiveEventExcept(itr->second, event_id))
{
// Remove the pair(id,quest) from the multimap
// Remove the pair(id, quest) from the multimap
QuestRelations::iterator qitr = GameObjectQuestMap->find(itr->first);
if (qitr == GameObjectQuestMap->end())
continue;
@@ -1512,7 +1512,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id)
// not in correct phase, return
if (mGameEvent[event_id].state != GAMEEVENT_WORLD_CONDITIONS)
return;
std::map<uint32,GameEventFinishCondition>::iterator citr = mGameEvent[event_id].conditions.find(condition);
std::map<uint32, GameEventFinishCondition>::iterator citr = mGameEvent[event_id].conditions.find(condition);
// condition is registered
if (citr != mGameEvent[event_id].conditions.end())
{
@@ -1552,7 +1552,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id)
bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
{
for (std::map<uint32,GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
for (std::map<uint32, GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
if (itr->second.done < itr->second.reqNum)
// return false if a condition doesn't match
return false;
@@ -1585,7 +1585,7 @@ void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id)
void GameEventMgr::SendWorldStateUpdate(Player * plr, uint16 event_id)
{
std::map<uint32,GameEventFinishCondition>::iterator itr;
std::map<uint32, GameEventFinishCondition>::iterator itr;
for (itr = mGameEvent[event_id].conditions.begin(); itr !=mGameEvent[event_id].conditions.end(); ++itr)
{
if (itr->second.done_world_state)
+1 -1
View File
@@ -59,7 +59,7 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid)
case HIGHGUID_UNIT: return GetCreature(p, guid);
case HIGHGUID_PET: return GetPet(p, guid);
case HIGHGUID_DYNAMICOBJECT: return GetDynamicObject(p, guid);
case HIGHGUID_CORPSE: return GetCorpse(p,guid);
case HIGHGUID_CORPSE: return GetCorpse(p, guid);
default: return NULL;
}
}
File diff suppressed because it is too large Load Diff
+45 -45
View File
@@ -49,11 +49,11 @@ class Guild;
class ArenaTeam;
class Item;
// 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
// 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
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#pragma pack(push, 1)
#endif
struct PageText
@@ -356,7 +356,7 @@ struct SpellClickInfo
};
typedef std::multimap<uint32, SpellClickInfo> SpellClickInfoMap;
typedef std::pair<SpellClickInfoMap::const_iterator,SpellClickInfoMap::const_iterator> SpellClickInfoMapBounds;
typedef std::pair<SpellClickInfoMap::const_iterator, SpellClickInfoMap::const_iterator> SpellClickInfoMapBounds;
struct AreaTrigger
{
@@ -368,17 +368,17 @@ struct AreaTrigger
};
typedef std::set<uint32> CellGuidSet;
typedef std::map<uint32/*player guid*/,uint32/*instance*/> CellCorpseSet;
typedef std::map<uint32/*player guid*/, uint32/*instance*/> CellCorpseSet;
struct CellObjectGuids
{
CellGuidSet creatures;
CellGuidSet gameobjects;
CellCorpseSet corpses;
};
typedef UNORDERED_MAP<uint32/*cell_id*/,CellObjectGuids> CellObjectGuidsMap;
typedef UNORDERED_MAP<uint32/*(mapid,spawnMode) pair*/,CellObjectGuidsMap> MapObjectGuids;
typedef UNORDERED_MAP<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap;
typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids;
typedef UNORDERED_MAP<uint64/*(instance,guid) pair*/,time_t> RespawnTimes;
typedef UNORDERED_MAP<uint64/*(instance, guid) pair*/, time_t> RespawnTimes;
// Trinity string ranges
#define MIN_TRINITY_STRING_ID 1 // 'trinity_string'
@@ -396,23 +396,23 @@ struct TrinityStringLocale
StringVector Content;
};
typedef std::map<uint64,uint64> LinkedRespawnMap;
typedef UNORDERED_MAP<uint32,CreatureData> CreatureDataMap;
typedef UNORDERED_MAP<uint32,GameObjectData> GameObjectDataMap;
typedef UNORDERED_MAP<uint32,CreatureLocale> CreatureLocaleMap;
typedef UNORDERED_MAP<uint32,GameObjectLocale> GameObjectLocaleMap;
typedef UNORDERED_MAP<uint32,ItemLocale> ItemLocaleMap;
typedef UNORDERED_MAP<uint32,ItemSetNameLocale> ItemSetNameLocaleMap;
typedef UNORDERED_MAP<uint32,QuestLocale> QuestLocaleMap;
typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap;
typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
typedef UNORDERED_MAP<int32,TrinityStringLocale> TrinityStringLocaleMap;
typedef UNORDERED_MAP<uint32,GossipMenuItemsLocale> GossipMenuItemsLocaleMap;
typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap;
typedef std::map<uint64, uint64> LinkedRespawnMap;
typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataMap;
typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataMap;
typedef UNORDERED_MAP<uint32, CreatureLocale> CreatureLocaleMap;
typedef UNORDERED_MAP<uint32, GameObjectLocale> GameObjectLocaleMap;
typedef UNORDERED_MAP<uint32, ItemLocale> ItemLocaleMap;
typedef UNORDERED_MAP<uint32, ItemSetNameLocale> ItemSetNameLocaleMap;
typedef UNORDERED_MAP<uint32, QuestLocale> QuestLocaleMap;
typedef UNORDERED_MAP<uint32, NpcTextLocale> NpcTextLocaleMap;
typedef UNORDERED_MAP<uint32, PageTextLocale> PageTextLocaleMap;
typedef UNORDERED_MAP<int32, TrinityStringLocale> TrinityStringLocaleMap;
typedef UNORDERED_MAP<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleMap;
typedef UNORDERED_MAP<uint32, PointOfInterestLocale> PointOfInterestLocaleMap;
typedef std::multimap<uint32,uint32> QuestRelations;
typedef std::multimap<uint32, uint32> QuestRelations;
typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator> QuestRelationBounds;
typedef std::multimap<uint32,ItemRequiredTarget> ItemRequiredTargetMap;
typedef std::multimap<uint32, ItemRequiredTarget> ItemRequiredTargetMap;
typedef std::pair<ItemRequiredTargetMap::const_iterator, ItemRequiredTargetMap::const_iterator> ItemRequiredTargetMapBounds;
struct PetLevelInfo
@@ -436,7 +436,7 @@ struct MailLevelReward
};
typedef std::list<MailLevelReward> MailLevelRewardList;
typedef UNORDERED_MAP<uint8,MailLevelRewardList> MailLevelRewardMap;
typedef UNORDERED_MAP<uint8, MailLevelRewardList> MailLevelRewardMap;
// We assume the rate is in general the same for all three types below, but chose to keep three for scalability and customization
struct RepRewardRate
@@ -501,10 +501,10 @@ struct GossipMenus
ConditionList conditions;
};
typedef std::multimap<uint32,GossipMenus> GossipMenusMap;
typedef std::multimap<uint32, GossipMenus> GossipMenusMap;
typedef std::pair<GossipMenusMap::const_iterator, GossipMenusMap::const_iterator> GossipMenusMapBounds;
typedef std::pair<GossipMenusMap::iterator, GossipMenusMap::iterator> GossipMenusMapBoundsNonConst;
typedef std::multimap<uint32,GossipMenuItems> GossipMenuItemsMap;
typedef std::multimap<uint32, GossipMenuItems> GossipMenuItemsMap;
typedef std::pair<GossipMenuItemsMap::const_iterator, GossipMenuItemsMap::const_iterator> GossipMenuItemsMapBounds;
typedef std::pair<GossipMenuItemsMap::iterator, GossipMenuItemsMap::iterator> GossipMenuItemsMapBoundsNonConst;
@@ -540,7 +540,7 @@ struct GraveYardData
uint32 safeLocId;
uint32 team;
};
typedef std::multimap<uint32,GraveYardData> GraveYardMap;
typedef std::multimap<uint32, GraveYardData> GraveYardMap;
// NPC gossip text id
typedef UNORDERED_MAP<uint32, uint32> CacheNpcTextIdMap;
@@ -594,7 +594,7 @@ struct DungeonEncounter
};
typedef std::list<DungeonEncounter const*> DungeonEncounterList;
typedef UNORDERED_MAP<uint32,DungeonEncounterList> DungeonEncounterMap;
typedef UNORDERED_MAP<uint32, DungeonEncounterList> DungeonEncounterMap;
class PlayerDumpReader;
@@ -698,7 +698,7 @@ class ObjectMgr
if (class_ >= MAX_CLASSES) return NULL;
return &playerClassInfo[class_];
}
void GetPlayerClassLevelInfo(uint32 class_,uint8 level, PlayerClassLevelInfo* info) const;
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo* info) const;
PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const
{
@@ -762,7 +762,7 @@ class ObjectMgr
AccessRequirement const* GetAccessRequirement(uint32 mapid, Difficulty difficulty) const
{
AccessRequirementMap::const_iterator itr = mAccessRequirements.find(MAKE_PAIR32(mapid,difficulty));
AccessRequirementMap::const_iterator itr = mAccessRequirements.find(MAKE_PAIR32(mapid, difficulty));
if (itr != mAccessRequirements.end())
return &itr->second;
return NULL;
@@ -911,7 +911,7 @@ class ObjectMgr
void ValidateSpellScripts();
bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value);
bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string",MIN_TRINITY_STRING_ID,MAX_TRINITY_STRING_ID); }
bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); }
void LoadDbScriptStrings();
void LoadCreatureClassLevelStats();
void LoadCreatureLocales();
@@ -1008,7 +1008,7 @@ class ObjectMgr
typedef std::multimap<int32, uint32> ExclusiveQuestGroups;
ExclusiveQuestGroups mExclusiveQuestGroups;
MailLevelReward const* GetMailLevelReward(uint32 level,uint32 raceMask)
MailLevelReward const* GetMailLevelReward(uint32 level, uint32 raceMask)
{
MailLevelRewardMap::const_iterator map_itr = m_mailLevelRewardMap.find(level);
if (map_itr == m_mailLevelRewardMap.end())
@@ -1023,7 +1023,7 @@ class ObjectMgr
CellObjectGuids const& GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
{
return mMapObjectGuids[MAKE_PAIR32(mapid,spawnMode)][cell_id];
return mMapObjectGuids[MAKE_PAIR32(mapid, spawnMode)][cell_id];
}
CreatureData const* GetCreatureData(uint32 guid) const
@@ -1120,7 +1120,7 @@ class ObjectMgr
return &itr->second;
}
const char *GetTrinityString(int32 entry, LocaleConstant locale_idx) const;
const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry,DBCLocaleIndex); }
const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); }
LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
@@ -1144,14 +1144,14 @@ class ObjectMgr
time_t GetCreatureRespawnTime(uint32 loguid, uint32 instance)
{
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_CreatureRespawnTimesMtx, 0);
return mCreatureRespawnTimes[MAKE_PAIR64(loguid,instance)];
return mCreatureRespawnTimes[MAKE_PAIR64(loguid, instance)];
}
void SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t);
void RemoveCreatureRespawnTime(uint32 loguid, uint32 instance);
time_t GetGORespawnTime(uint32 loguid, uint32 instance)
{
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_GORespawnTimesMtx, 0);
return mGORespawnTimes[MAKE_PAIR64(loguid,instance)];
return mGORespawnTimes[MAKE_PAIR64(loguid, instance)];
}
void SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t);
void RemoveGORespawnTime(uint32 loguid, uint32 instance);
@@ -1214,7 +1214,7 @@ class ObjectMgr
return &iter->second;
}
void AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
bool RemoveVendorItem(uint32 entry, uint32 item, bool savetodb = true); // for event
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
@@ -1225,26 +1225,26 @@ class ObjectMgr
SpellClickInfoMapBounds GetSpellClickInfoMapBounds(uint32 creature_id) const
{
return SpellClickInfoMapBounds(mSpellClickInfoMap.lower_bound(creature_id),mSpellClickInfoMap.upper_bound(creature_id));
return SpellClickInfoMapBounds(mSpellClickInfoMap.lower_bound(creature_id), mSpellClickInfoMap.upper_bound(creature_id));
}
GossipMenusMapBounds GetGossipMenusMapBounds(uint32 uiMenuId) const
{
return GossipMenusMapBounds(m_mGossipMenusMap.lower_bound(uiMenuId),m_mGossipMenusMap.upper_bound(uiMenuId));
return GossipMenusMapBounds(m_mGossipMenusMap.lower_bound(uiMenuId), m_mGossipMenusMap.upper_bound(uiMenuId));
}
GossipMenusMapBoundsNonConst GetGossipMenusMapBoundsNonConst(uint32 uiMenuId)
{
return GossipMenusMapBoundsNonConst(m_mGossipMenusMap.lower_bound(uiMenuId),m_mGossipMenusMap.upper_bound(uiMenuId));
return GossipMenusMapBoundsNonConst(m_mGossipMenusMap.lower_bound(uiMenuId), m_mGossipMenusMap.upper_bound(uiMenuId));
}
GossipMenuItemsMapBounds GetGossipMenuItemsMapBounds(uint32 uiMenuId) const
{
return GossipMenuItemsMapBounds(m_mGossipMenuItemsMap.lower_bound(uiMenuId),m_mGossipMenuItemsMap.upper_bound(uiMenuId));
return GossipMenuItemsMapBounds(m_mGossipMenuItemsMap.lower_bound(uiMenuId), m_mGossipMenuItemsMap.upper_bound(uiMenuId));
}
GossipMenuItemsMapBoundsNonConst GetGossipMenuItemsMapBoundsNonConst(uint32 uiMenuId)
{
return GossipMenuItemsMapBoundsNonConst(m_mGossipMenuItemsMap.lower_bound(uiMenuId),m_mGossipMenuItemsMap.upper_bound(uiMenuId));
return GossipMenuItemsMapBoundsNonConst(m_mGossipMenuItemsMap.lower_bound(uiMenuId), m_mGossipMenuItemsMap.upper_bound(uiMenuId));
}
// for wintergrasp only
@@ -1368,7 +1368,7 @@ class ObjectMgr
CreatureBaseStatsMap m_creatureBaseStatsMap;
typedef std::map<uint32,PetLevelInfo*> PetLevelInfoMap;
typedef std::map<uint32, PetLevelInfo*> PetLevelInfoMap;
// PetLevelInfoMap[creature_id][level]
PetLevelInfoMap petInfo; // [creature_id][level]
@@ -1381,10 +1381,10 @@ class ObjectMgr
typedef std::vector<uint32> PlayerXPperLevel; // [level]
PlayerXPperLevel mPlayerXPperLevel;
typedef std::map<uint32,uint32> BaseXPMap; // [area level][base xp]
typedef std::map<uint32, uint32> BaseXPMap; // [area level][base xp]
BaseXPMap mBaseXPTable;
typedef std::map<uint32,int32> FishingBaseSkillMap; // [areaId][base skill level]
typedef std::map<uint32, int32> FishingBaseSkillMap; // [areaId][base skill level]
FishingBaseSkillMap mFishingBaseForArea;
typedef std::map<uint32, StringVector> HalfNameMap;
@@ -1441,7 +1441,7 @@ class ObjectMgr
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
// scripting access functions
bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
bool LoadTrinityStrings(char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
uint32 GetScriptId(const char *name);
#endif
+3 -3
View File
@@ -120,7 +120,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);
Cell r_zone(cell_pair);
r_zone.data.Part.nocreate = this->data.Part.nocreate;
m.Visit(r_zone, visitor);
@@ -218,7 +218,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)
{
@@ -254,7 +254,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 = this->data.Part.nocreate;
m.Visit(r_zone, visitor);
+3 -3
View File
@@ -65,7 +65,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;
@@ -180,12 +180,12 @@ namespace Trinity
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
+3 -3
View File
@@ -47,7 +47,7 @@ class 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)
{
grid.LockGrid();
loader.Load(grid);
@@ -57,7 +57,7 @@ class 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)
{
grid.LockGrid();
stoper.Stop(grid);
@@ -66,7 +66,7 @@ class 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)
{
grid.LockGrid();
unloader.Unload(grid);
+3 -3
View File
@@ -38,7 +38,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c
ObjectGridStoper stoper(grid);
stoper.StopN();
grid.SetGridState(GRID_STATE_IDLE);
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId());
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to IDLE state", x, y, m.GetId());
}
else
{
@@ -52,7 +52,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui
{
m.ResetGridExpiry(grid);
grid.SetGridState(GRID_STATE_REMOVAL);
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId());
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", x, y, m.GetId());
}
void
@@ -65,7 +65,7 @@ RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 &x, c
{
if (!m.UnloadGrid(x, y, false))
{
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId());
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId());
m.ResetGridExpiry(grid);
}
}
+2 -2
View File
@@ -33,10 +33,10 @@ class GridInfo
{
public:
GridInfo()
: i_timer(0), vis_Update(0, irand(0,DEFAULT_VISIBILITY_NOTIFY_PERIOD)),
: i_timer(0), vis_Update(0, irand(0, DEFAULT_VISIBILITY_NOTIFY_PERIOD)),
i_unloadActiveLockCount(0), i_unloadExplicitLock(false), i_unloadReferenceLock(false) {}
GridInfo(time_t expiry, bool unload = true )
: i_timer(expiry), vis_Update(0, irand(0,DEFAULT_VISIBILITY_NOTIFY_PERIOD)),
: i_timer(expiry), vis_Update(0, irand(0, DEFAULT_VISIBILITY_NOTIFY_PERIOD)),
i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload), i_unloadReferenceLock(false) {}
const TimeTracker& getTimeTracker() const { return i_timer; }
bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock || i_unloadReferenceLock; }
@@ -129,7 +129,7 @@ void PlayerRelocationNotifier::Visit(PlayerMapType &m)
vis_guids.erase(plr->GetGUID());
i_player.UpdateVisibilityOf(plr,i_data,i_visibleNow);
i_player.UpdateVisibilityOf(plr, i_data, i_visibleNow);
if (plr->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
continue;
@@ -148,7 +148,7 @@ void PlayerRelocationNotifier::Visit(CreatureMapType &m)
vis_guids.erase(c->GetGUID());
i_player.UpdateVisibilityOf(c,i_data,i_visibleNow);
i_player.UpdateVisibilityOf(c, i_data, i_visibleNow);
if (relocated_for_ai && !c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
CreatureUnitRelocationWorker(c, &i_player);

Some files were not shown because too many files have changed in this diff Show More