diff options
79 files changed, 897 insertions, 901 deletions
diff --git a/contrib/extractor/VC71_ad.vcproj b/contrib/extractor/VC71_ad.vcproj index b1154138251..2bd27e526ea 100644 --- a/contrib/extractor/VC71_ad.vcproj +++ b/contrib/extractor/VC71_ad.vcproj @@ -52,10 +52,10 @@ BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" - PrecompiledHeaderFile="c:\windows\temp/ad.pch" - AssemblerListingLocation="c:\windows\temp/" - ObjectFile="c:\windows\temp/" - ProgramDataBaseFileName="c:\windows\temp/" + PrecompiledHeaderFile="$(IntDir)ad.pch" + AssemblerListingLocation="$(IntDir)\" + ObjectFile="$(IntDir)\" + ProgramDataBaseFileName="$(IntDir)\" BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="true" @@ -149,10 +149,10 @@ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" RuntimeLibrary="0" UsePrecompiledHeader="0" - PrecompiledHeaderFile="c:\windows\temp/ad.pch" - AssemblerListingLocation="c:\windows\temp/" - ObjectFile="c:\windows\temp/" - ProgramDataBaseFileName="c:\windows\temp/" + PrecompiledHeaderFile="$(IntDir)ad.pch" + AssemblerListingLocation="$(IntDir)\" + ObjectFile="$(IntDir)\" + ProgramDataBaseFileName="$(IntDir)\" WarningLevel="3" SuppressStartupBanner="true" /> diff --git a/contrib/extractor/VC80_ad.vcproj b/contrib/extractor/VC80_ad.vcproj index ddf423c4bde..30657907fd8 100644 --- a/contrib/extractor/VC80_ad.vcproj +++ b/contrib/extractor/VC80_ad.vcproj @@ -54,10 +54,11 @@ BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" - PrecompiledHeaderFile="c:\windows\temp/ad.pch" - AssemblerListingLocation="c:\windows\temp/" - ObjectFile="c:\windows\temp/" - ProgramDataBaseFileName="c:\windows\temp/" + PrecompiledHeaderFile="$(IntDir)ad.pch" + AssemblerListingLocation="$(IntDir)\" + ObjectFile="$(IntDir)\" + ProgramDataBaseFileName="$(IntDir)\" + XMLDocumentationFileName="$(IntDir)\" BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="true" @@ -80,7 +81,7 @@ OutputFile="ad debug.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories="./debug/" + AdditionalLibraryDirectories="./debug" IgnoreDefaultLibraryNames="LIBCD.lib" GenerateDebugInformation="true" ProgramDatabaseFile="./ad debug.pdb" @@ -153,9 +154,10 @@ RuntimeLibrary="0" UsePrecompiledHeader="0" PrecompiledHeaderFile="c:\windows\temp/ad.pch" - AssemblerListingLocation="c:\windows\temp/" - ObjectFile="c:\windows\temp/" - ProgramDataBaseFileName="c:\windows\temp/" + AssemblerListingLocation="$(IntDir)\" + ObjectFile="$(IntDir)\" + ProgramDataBaseFileName="$(IntDir)\" + XMLDocumentationFileName="$(IntDir)\" WarningLevel="3" SuppressStartupBanner="true" /> @@ -176,7 +178,7 @@ OutputFile="./ad.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories="./release/" + AdditionalLibraryDirectories="./release" IgnoreDefaultLibraryNames="LIBC.lib" ProgramDatabaseFile="./ad.pdb" SubSystem="1" diff --git a/contrib/extractor/VC90_ad.vcproj b/contrib/extractor/VC90_ad.vcproj index 148c33643c3..14aa824a0e9 100644 --- a/contrib/extractor/VC90_ad.vcproj +++ b/contrib/extractor/VC90_ad.vcproj @@ -4,6 +4,7 @@ Version="9,00" Name="ad" ProjectGUID="{D7552D4F-408F-4F8E-859B-366659150CF4}" + RootNamespace="ad" TargetFrameworkVersion="131072" > <Platforms> @@ -53,11 +54,13 @@ BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" - PrecompiledHeaderFile="c:\windows\temp/ad.pch" - AssemblerListingLocation="c:\windows\temp/" - ObjectFile="c:\windows\temp/" - ProgramDataBaseFileName="c:\windows\temp/" + PrecompiledHeaderFile="$(IntDir)ad.pch" + AssemblerListingLocation="$(IntDir)\" + ObjectFile="$(IntDir)\" + ProgramDataBaseFileName="$(IntDir)\" + XMLDocumentationFileName="$(IntDir)\" BrowseInformation="1" + BrowseInformationFile="$(IntDir)" WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="4" @@ -149,10 +152,11 @@ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" RuntimeLibrary="0" UsePrecompiledHeader="0" - PrecompiledHeaderFile="c:\windows\temp/ad.pch" - AssemblerListingLocation="c:\windows\temp/" - ObjectFile="c:\windows\temp/" - ProgramDataBaseFileName="c:\windows\temp/" + PrecompiledHeaderFile="$(IntDir)ad.pch" + AssemblerListingLocation="$(IntDir)\" + ObjectFile="$(IntDir)\" + ProgramDataBaseFileName="$(IntDir)\" + XMLDocumentationFileName="$(IntDir)\" WarningLevel="3" SuppressStartupBanner="true" /> diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index e4f90d5b40b..1ee90c41029 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -73,7 +73,7 @@ bool ScriptedAI::IsVisible(Unit* who) const void ScriptedAI::MoveInLineOfSight(Unit *who) { - if(m_creature->getVictim() || !m_creature->IsHostileTo(who) || !who->isInAccessablePlaceFor(m_creature)) + if(m_creature->getVictim() || !m_creature->IsHostileTo(who) || !who->isInAccessiblePlaceFor(m_creature)) return; if(!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) @@ -786,7 +786,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who) { - if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index d403bcb4111..2f01490bbec 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1195,7 +1195,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI if (m_creature->isCivilian() && m_creature->IsNeutralToAll()) return; - if (m_creature->canAttack(who) && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (m_creature->canAttack(who) && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp index 04efb0c952d..0197fe24b29 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp @@ -60,7 +60,7 @@ void npc_escortAI::MoveInLineOfSight(Unit *who) if (IsBeingEscorted && !Attack) return; - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp index a886a0d4902..055e0cbdbb9 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -172,7 +172,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature)) { if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index 382b92fb1fc..3db39e4f477 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) ) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp index 7a7be749d49..ab9cd0f083b 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if(!Intro && m_creature->IsWithinDistInMap(who, 100)) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp index 26c530530d5..16bd012e576 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -178,7 +178,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp index 81beb63166a..3d6233ca3f7 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp @@ -189,7 +189,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp index 00b29611d78..e2ab402c7ff 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp @@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) return; - if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); @@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI { if(!who || (!who->isAlive())) return; - if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp index 02002f044b9..99dc4dbc82c 100644 --- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp +++ b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp @@ -286,7 +286,7 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI } } - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp index 5e834842bd7..bd926a2e7cc 100644 --- a/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp +++ b/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp @@ -41,14 +41,14 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI { if( who->HasAura(16468,0) ) { - if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature) ) + if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature) ) { DoCast(who,16472); ((Player*)who)->AreaExploredOrEventHappens(4866); } } - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp index 2d66eed17ec..a59ecc8e4b6 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp @@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI } } - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index 993007d441c..6adc833e8a8 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -278,7 +278,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index 7b2bc68198e..53aa7c48d35 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI if(m_creature->HasAura(AURA_BANISH, 0)) return; - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp index d3c628f6897..924b15397ed 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -1,182 +1,182 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: boss_the_lurker_below
-SD%Complete: 10
-SDComment:
-SDCategory: The Lurker Below
-EndScriptData */
-
-#include "precompiled.h"
-#include "def_serpent_shrine.h"
-#include "../../../creature/simple_ai.h"
-#include "Spell.h"
-
-#define SPELL_SPOUT 37433
-#define SPELL_SPOUT_2 42835
-#define SPELL_KNOCKBACK 19813
-#define SPELL_GEYSER 37478
-#define SPELL_WHIRL 37660
-#define SPELL_WATERBOLT 37138
-#define SPELL_SUBMERGE 37550
-#define SPELL_EMERGE 20568
-
-#define EMOTE_SPOUT "takes a deep breath."
-
-#define MOB_COILFANG_GUARDIAN 21873
-#define MOB_COILFANG_AMBUSHER 21865
-
-//Ambusher spells
-#define SPELL_SPREAD_SHOT 37790
-#define SPELL_SHOOT 37770
-
-//Guardian spells
-#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one.
-#define SPELL_HAMSTRING 26211
-
-struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public ScriptedAI
-{
- boss_the_lurker_belowAI(Creature *c) : ScriptedAI(c) {Reset();}
-
- void Reset()
- {
-
- }
-
- void MoveInLineOfSight(Unit *who)
- {
-
- }
-
- void Aggro(Unit *who)
- {
-
- }
-
- void UpdateAI(const uint32 diff)
- {
-
- }
-};
-
-CreatureAI* GetAI_mob_coilfang_guardian(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 5000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = SPELL_HAMSTRING;
- ai->Spell[1].Cooldown = 10000;
- ai->Spell[1].First_Cast = 2000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- return ai;
-}
-
-struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
-{
- mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
- {
- Reset();
- SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT);
- if(TempSpell)
- TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg
- }
-
- uint32 MultiShotTimer;
- uint32 ShootBowTimer;
-
- void Reset()
- {
- MultiShotTimer = 10000;
- ShootBowTimer = 4000;
-
- }
-
- void Aggro(Unit *who)
- {
-
- }
-
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || m_creature->getVictim()) return;
-
- if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
- {
- AttackStart(who);
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if(MultiShotTimer < diff)
- {
- if(m_creature->getVictim())
- DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true);
-
- MultiShotTimer = 10000;
- ShootBowTimer += 1500;//add global cooldown
- }else MultiShotTimer -= diff;
-
- if(ShootBowTimer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM, 0);
- int bp0 = 1100;
- if(target)
- m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true);
- ShootBowTimer = 4000;
- MultiShotTimer += 1500;//add global cooldown
- }else ShootBowTimer -= diff;
- }
-};
-
-CreatureAI* GetAI_mob_coilfang_ambusher(Creature *_Creature)
-{
- return new mob_coilfang_ambusherAI (_Creature);
-}
-
-CreatureAI* GetAI_boss_the_lurker_below(Creature *_Creature)
-{
- return new boss_the_lurker_belowAI (_Creature);
-}
-
-void AddSC_boss_the_lurker_below()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_the_lurker_below";
- newscript->GetAI = GetAI_boss_the_lurker_below;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_coilfang_guardian";
- newscript->GetAI = GetAI_mob_coilfang_guardian;
- m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="mob_coilfang_ambusher";
- newscript->GetAI = GetAI_mob_coilfang_ambusher;
- m_scripts[nrscripts++] = newscript;
-}
-
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_the_lurker_below +SD%Complete: 10 +SDComment: +SDCategory: The Lurker Below +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "../../../creature/simple_ai.h" +#include "Spell.h" + +#define SPELL_SPOUT 37433 +#define SPELL_SPOUT_2 42835 +#define SPELL_KNOCKBACK 19813 +#define SPELL_GEYSER 37478 +#define SPELL_WHIRL 37660 +#define SPELL_WATERBOLT 37138 +#define SPELL_SUBMERGE 37550 +#define SPELL_EMERGE 20568 + +#define EMOTE_SPOUT "takes a deep breath." + +#define MOB_COILFANG_GUARDIAN 21873 +#define MOB_COILFANG_AMBUSHER 21865 + +//Ambusher spells +#define SPELL_SPREAD_SHOT 37790 +#define SPELL_SHOOT 37770 + +//Guardian spells +#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. +#define SPELL_HAMSTRING 26211 + +struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public ScriptedAI +{ + boss_the_lurker_belowAI(Creature *c) : ScriptedAI(c) {Reset();} + + void Reset() + { + + } + + void MoveInLineOfSight(Unit *who) + { + + } + + void Aggro(Unit *who) + { + + } + + void UpdateAI(const uint32 diff) + { + + } +}; + +CreatureAI* GetAI_mob_coilfang_guardian(Creature *_Creature) +{ + SimpleAI* ai = new SimpleAI (_Creature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->Spell[1].Enabled = true; + ai->Spell[1].Spell_Id = SPELL_HAMSTRING; + ai->Spell[1].Cooldown = 10000; + ai->Spell[1].First_Cast = 2000; + ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; + + return ai; +} + +struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI +{ + mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) + { + Reset(); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT); + if(TempSpell) + TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg + } + + uint32 MultiShotTimer; + uint32 ShootBowTimer; + + void Reset() + { + MultiShotTimer = 10000; + ShootBowTimer = 4000; + + } + + void Aggro(Unit *who) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + if(MultiShotTimer < diff) + { + if(m_creature->getVictim()) + DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); + + MultiShotTimer = 10000; + ShootBowTimer += 1500;//add global cooldown + }else MultiShotTimer -= diff; + + if(ShootBowTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + int bp0 = 1100; + if(target) + m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); + ShootBowTimer = 4000; + MultiShotTimer += 1500;//add global cooldown + }else ShootBowTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_coilfang_ambusher(Creature *_Creature) +{ + return new mob_coilfang_ambusherAI (_Creature); +} + +CreatureAI* GetAI_boss_the_lurker_below(Creature *_Creature) +{ + return new boss_the_lurker_belowAI (_Creature); +} + +void AddSC_boss_the_lurker_below() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_the_lurker_below"; + newscript->GetAI = GetAI_boss_the_lurker_below; + m_scripts[nrscripts++] = newscript; + + newscript = new Script; + newscript->Name="mob_coilfang_guardian"; + newscript->GetAI = GetAI_mob_coilfang_guardian; + m_scripts[nrscripts++] = newscript; + + newscript = new Script; + newscript->Name="mob_coilfang_ambusher"; + newscript->GetAI = GetAI_mob_coilfang_ambusher; + m_scripts[nrscripts++] = newscript; +} + diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp index 38f27d7d382..fa6a57a7fe4 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { //no attack radius check - it attacks the first target that moves in his los who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp index 6421eedac22..3c77b1a0acf 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp @@ -452,7 +452,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI } void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; @@ -582,7 +582,7 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; @@ -696,7 +696,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI } void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp index 09e118cc68f..21e9362a762 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI void MoveInLineOfSight(Unit* who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp index 87216d56163..9d8335c527b 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp @@ -186,7 +186,7 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!IntroOnce && m_creature->IsWithinDistInMap(who, 75)) { diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp index 9217da40564..50a4f867b4c 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp @@ -99,7 +99,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp index abfa4598af1..4add49e17b4 100644 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp +++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp @@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp index 309d85936db..2256c064e11 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp @@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp index 6ad9fa310de..b49f0e391f3 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp @@ -421,7 +421,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public ScriptedAI if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp index f80eb5c0a3f..f928a41e1e0 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp @@ -349,7 +349,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI if( IsRunning ) return; - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp index 1b66ed8811f..fcd8cf2c607 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI if( !Intro ) return; - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp index 1792a691604..ddbfbb65bf2 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp @@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; - if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) ) + if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) ) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; @@ -495,7 +495,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp index d1397d8dcfd..2ddb8be73c7 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -345,7 +345,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI if (!who || m_creature->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) { float attackRadius = m_creature->GetAttackDistance(who); if (attackRadius < PULL_RANGE) diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index e8836e374be..0c45fff79f4 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -51,7 +51,7 @@ AggressorAI::MoveInLineOfSight(Unit *u) if( !i_creature.getVictim() && !i_creature.hasUnitState(UNIT_STAT_STUNNED) && i_creature.canAttack(u) && ( i_creature.IsHostileTo( u ) /*|| u->getVictim() && i_creature.IsFriendlyTo( u->getVictim() )*/ ) && - u->isInAccessablePlaceFor(&i_creature) ) + u->isInAccessiblePlaceFor(&i_creature) ) { float attackRadius = i_creature.GetAttackDistance(u); if(i_creature.IsWithinDistInMap(u, attackRadius) && i_creature.IsWithinLOSInMap(u) ) diff --git a/src/game/AuctionHouse.cpp b/src/game/AuctionHouse.cpp index abeeac206b7..ca549f4d404 100644 --- a/src/game/AuctionHouse.cpp +++ b/src/game/AuctionHouse.cpp @@ -178,7 +178,7 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri } } -//this function sends mail, when auction is cancelled to old bidder +//this function sends mail, when auction is canceled to old bidder void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry* auction ) { uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); @@ -245,7 +245,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data ) SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); return; } - // prevent sending bag with items (cheat: can be placed in bag after adding equiped empty bag to auction) + // prevent sending bag with items (cheat: can be placed in bag after adding equipped empty bag to auction) if(!it) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_ITEM_NOT_FOUND); diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index bd47c146bf0..88eadd3cb2f 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -627,12 +627,12 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id, uint8 arenatype // try to build the selection pools bool bAllyOK = BuildSelectionPool(bgTypeId, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam, NORMAL_ALLIANCE, arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime); if(bAllyOK) - sLog.outDebug("Battleground: ally pool succesfully build"); + sLog.outDebug("Battleground: ally pool successfully build"); else sLog.outDebug("Battleground: ally pool wasn't created"); bool bHordeOK = BuildSelectionPool(bgTypeId, queue_id, MinPlayersPerTeam, MaxPlayersPerTeam, NORMAL_HORDE, arenatype, isRated, arenaMinRating, arenaMaxRating, discardTime); if(bHordeOK) - sLog.outDebug("Battleground: horde pool succesfully built"); + sLog.outDebug("Battleground: horde pool successfully built"); else sLog.outDebug("Battleground: horde pool wasn't created"); diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index ac67e6137e4..f239fc4ebd6 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1024,7 +1024,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s if(!text) return NULL; - // skip speces + // skip spaces while(*text==' '||*text=='\t'||*text=='\b') ++text; @@ -1072,7 +1072,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes, if(!text) return NULL; - // skip speces + // skip spaces while(*text==' '||*text=='\t'||*text=='\b') ++text; diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 2dc48cdefc0..9f3422dbc28 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -336,11 +336,11 @@ void Creature::Update(uint32 diff) switch( m_deathState ) { case JUST_ALIVED: - // Dont must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. + // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry()); break; case JUST_DIED: - // Dont must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. + // Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry()); break; case DEAD: @@ -506,7 +506,7 @@ void Creature::RegenerateHealth() uint32 addvalue = 0; - // Not only pet, but any controelled creature + // Not only pet, but any controlled creature if(GetCharmerOrOwnerGUID()) { float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH); @@ -863,7 +863,7 @@ void Creature::sendPreparedGossip(Player* player) } // in case non empty gossip menu (that not included quests list size) show it - // (quest entries from quest menu wiill be included in list) + // (quest entries from quest menu will be included in list) player->PlayerTalkClass->SendGossipMenu(GetNpcTextId(), GetGUID()); } @@ -1147,7 +1147,7 @@ void Creature::SetLootRecipient(Unit *unit) void Creature::SaveToDB() { // this should only be used when the creature has already been loaded - // perferably after adding to map, because mapid may not be valid otherwise + // preferably after adding to map, because mapid may not be valid otherwise CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid); if(!data) { @@ -1556,7 +1556,7 @@ float Creature::GetAttackDistance(Unit const* pl) const // "The aggro radius of a mob having the same level as the player is roughly 20 yards" float RetDistance = 20; - // "Aggro Radius varries with level difference at a rate of roughly 1 yard/level" + // "Aggro Radius varies with level difference at a rate of roughly 1 yard/level" // radius grow if playlevel < creaturelevel RetDistance -= (float)leveldif; @@ -1583,7 +1583,7 @@ void Creature::setDeathState(DeathState s) m_deathTimer = m_corpseDelay*1000; // always save boss respawn time at death to prevent crash cheating - if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY) || isWorldBoss()) + if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss()) SaveRespawnTime(); if(!IsStopped()) @@ -1875,7 +1875,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const if(!canAttack(pVictim)) return true; - if(!pVictim->isInAccessablePlaceFor(this)) + if(!pVictim->isInAccessiblePlaceFor(this)) return true; if(sMapStore.LookupEntry(GetMapId())->Instanceable()) @@ -1885,7 +1885,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const float AttackDist = GetAttackDistance(pVictim); uint32 ThreatRadius = sWorld.getConfig(CONFIG_THREAT_RADIUS); - //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and ouf of combat every update tick. + //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. return ( length > (ThreatRadius > AttackDist ? ThreatRadius : AttackDist)); } @@ -1954,7 +1954,7 @@ bool Creature::LoadCreaturesAddon(bool reload) return true; } -/// Send a message to LocalDefense channel for players oposition team in the zone +/// Send a message to LocalDefense channel for players opposition team in the zone void Creature::SendZoneUnderAttackMessage(Player* attacker) { uint32 enemy_team = attacker->GetTeam(); diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index 8718226464d..6d005c2806a 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -1,181 +1,181 @@ -/*
- * Copyright (C) 2005-2008 MaNGOS
- *
- * Copyright (C) 2008 Trinity
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "Common.h"
-#include "Language.h"
-#include "WorldPacket.h"
-#include "Log.h"
-#include "GMTicketMgr.h"
-#include "ObjectAccessor.h"
-#include "Player.h"
-#include "Chat.h"
-
-void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text)
-{
- int len = text ? strlen(text) : 0;
- WorldPacket data( SMSG_GMTICKET_GETTICKET, (4+len+1+4+2+4+4) );
- data << uint32(status); // standard 0x0A, 0x06 if text present
- if(status == 6)
- {
- data << text; // ticket text
- data << uint8(0x7); // ticket category
- data << float(0); // time from ticket creation?
- data << float(0); // const
- data << float(0); // const
- data << uint8(0); // const
- data << uint8(0); // const
- }
- SendPacket( &data );
-}
-
-void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ )
-{
- WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
- data << (uint32)time(NULL);
- data << (uint32)0;
- SendPacket( &data );
-
- GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow());
- if(ticket)
- SendGMTicketGetTicket(0x06,ticket->GetText());
- else
- SendGMTicketGetTicket(0x0A,0);
-}
-
-void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data )
-{
- CHECK_PACKET_SIZE(recv_data,1);
-
- std::string ticketText;
- recv_data >> ticketText;
-
- CharacterDatabase.escape_string(ticketText);
-
- if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
- ticket->SetText(ticketText.c_str());
- else
- sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
-}
-
-void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/ )
-{
- ticketmgr.Delete(GetPlayer()->GetGUIDLow());
-
- WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 );
- data << uint32(9);
- SendPacket( &data );
-
- SendGMTicketGetTicket(0x0A, 0);
-}
-
-void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
-{
- CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4);
-
- uint32 map;
- float x, y, z;
- std::string ticketText = "";
- uint32 unk1, unk2;
-
- recv_data >> map >> x >> y >> z; // last check 2.4.3
- recv_data >> ticketText;
-
- // recheck
- CHECK_PACKET_SIZE(recv_data,4*4+(ticketText.size()+1)+2*4);
-
- recv_data >> unk1 >> unk2;
- // note: the packet might contain more data, but the exact structure of that is unknown
-
- sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s, unk1 %u, unk2 %u", map, x, y, z, ticketText.c_str(), unk1, unk2);
-
- CharacterDatabase.escape_string(ticketText);
-
- if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()))
- {
- WorldPacket data( SMSG_GMTICKET_CREATE, 4 );
- data << uint32(1);
- SendPacket( &data );
- return;
- }
-
- ticketmgr.Create(_player->GetGUIDLow(), ticketText.c_str());
-
- WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
- data << (uint32)time(NULL);
- data << (uint32)0;
- SendPacket( &data );
-
- data.Initialize( SMSG_GMTICKET_CREATE, 4 );
- data << uint32(2);
- SendPacket( &data );
- DEBUG_LOG("update the ticket\n");
-
- //TODO: Guard player map
- HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers();
- for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
- {
- if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets())
- ChatHandler(itr->second).PSendSysMessage(LANG_COMMAND_TICKETNEW,GetPlayer()->GetName());
- }
-}
-
-void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/ )
-{
- WorldPacket data( SMSG_GMTICKET_SYSTEMSTATUS,4 );
- data << uint32(1); // we can also disable ticket system by sending 0 value
-
- SendPacket( &data );
-}
-
-void WorldSession::HandleGMSurveySubmit( WorldPacket & recv_data)
-{
- // GM survey is shown after SMSG_GM_TICKET_STATUS_UPDATE with status = 3
- CHECK_PACKET_SIZE(recv_data,4+4);
- uint32 x;
- recv_data >> x; // answer range? (6 = 0-5?)
- sLog.outDebug("SURVEY: X = %u", x);
-
- uint8 result[10];
- memset(result, 0, sizeof(result));
- for( int i = 0; i < 10; ++i)
- {
- CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+4);
- uint32 questionID;
- recv_data >> questionID; // GMSurveyQuestions.dbc
- if (!questionID)
- break;
-
- CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1+1);
- uint8 value;
- std::string unk_text;
- recv_data >> value; // answer
- recv_data >> unk_text; // always empty?
-
- result[i] = value;
- sLog.outDebug("SURVEY: ID %u, value %u, text %s", questionID, value, unk_text.c_str());
- }
-
- CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1);
- std::string comment;
- recv_data >> comment; // addional comment
- sLog.outDebug("SURVEY: comment %s", comment.c_str());
-
- // TODO: chart this data in some way
-}
+/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "Common.h" +#include "Language.h" +#include "WorldPacket.h" +#include "Log.h" +#include "GMTicketMgr.h" +#include "ObjectAccessor.h" +#include "Player.h" +#include "Chat.h" + +void WorldSession::SendGMTicketGetTicket(uint32 status, char const* text) +{ + int len = text ? strlen(text) : 0; + WorldPacket data( SMSG_GMTICKET_GETTICKET, (4+len+1+4+2+4+4) ); + data << uint32(status); // standard 0x0A, 0x06 if text present + if(status == 6) + { + data << text; // ticket text + data << uint8(0x7); // ticket category + data << float(0); // time from ticket creation? + data << float(0); // const + data << float(0); // const + data << uint8(0); // const + data << uint8(0); // const + } + SendPacket( &data ); +} + +void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/ ) +{ + WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); + data << (uint32)time(NULL); + data << (uint32)0; + SendPacket( &data ); + + GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow()); + if(ticket) + SendGMTicketGetTicket(0x06,ticket->GetText()); + else + SendGMTicketGetTicket(0x0A,0); +} + +void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data ) +{ + CHECK_PACKET_SIZE(recv_data,1); + + std::string ticketText; + recv_data >> ticketText; + + CharacterDatabase.escape_string(ticketText); + + if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) + ticket->SetText(ticketText.c_str()); + else + sLog.outError("Ticket update: Player %s (GUID: %u) doesn't have active ticket", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); +} + +void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/ ) +{ + ticketmgr.Delete(GetPlayer()->GetGUIDLow()); + + WorldPacket data( SMSG_GMTICKET_DELETETICKET, 4 ); + data << uint32(9); + SendPacket( &data ); + + SendGMTicketGetTicket(0x0A, 0); +} + +void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) +{ + CHECK_PACKET_SIZE(recv_data, 4*4+1+2*4); + + uint32 map; + float x, y, z; + std::string ticketText = ""; + uint32 unk1, unk2; + + recv_data >> map >> x >> y >> z; // last check 2.4.3 + recv_data >> ticketText; + + // recheck + CHECK_PACKET_SIZE(recv_data,4*4+(ticketText.size()+1)+2*4); + + recv_data >> unk1 >> unk2; + // note: the packet might contain more data, but the exact structure of that is unknown + + sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s, unk1 %u, unk2 %u", map, x, y, z, ticketText.c_str(), unk1, unk2); + + CharacterDatabase.escape_string(ticketText); + + if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) + { + WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); + data << uint32(1); + SendPacket( &data ); + return; + } + + ticketmgr.Create(_player->GetGUIDLow(), ticketText.c_str()); + + WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 ); + data << (uint32)time(NULL); + data << (uint32)0; + SendPacket( &data ); + + data.Initialize( SMSG_GMTICKET_CREATE, 4 ); + data << uint32(2); + SendPacket( &data ); + DEBUG_LOG("update the ticket\n"); + + //TODO: Guard player map + HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers(); + for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr) + { + if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets()) + ChatHandler(itr->second).PSendSysMessage(LANG_COMMAND_TICKETNEW,GetPlayer()->GetName()); + } +} + +void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/ ) +{ + WorldPacket data( SMSG_GMTICKET_SYSTEMSTATUS,4 ); + data << uint32(1); // we can also disable ticket system by sending 0 value + + SendPacket( &data ); +} + +void WorldSession::HandleGMSurveySubmit( WorldPacket & recv_data) +{ + // GM survey is shown after SMSG_GM_TICKET_STATUS_UPDATE with status = 3 + CHECK_PACKET_SIZE(recv_data,4+4); + uint32 x; + recv_data >> x; // answer range? (6 = 0-5?) + sLog.outDebug("SURVEY: X = %u", x); + + uint8 result[10]; + memset(result, 0, sizeof(result)); + for( int i = 0; i < 10; ++i) + { + CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+4); + uint32 questionID; + recv_data >> questionID; // GMSurveyQuestions.dbc + if (!questionID) + break; + + CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1+1); + uint8 value; + std::string unk_text; + recv_data >> value; // answer + recv_data >> unk_text; // always empty? + + result[i] = value; + sLog.outDebug("SURVEY: ID %u, value %u, text %s", questionID, value, unk_text.c_str()); + } + + CHECK_PACKET_SIZE(recv_data,recv_data.rpos()+1); + std::string comment; + recv_data >> comment; // addional comment + sLog.outDebug("SURVEY: comment %s", comment.c_str()); + + // TODO: chart this data in some way +} diff --git a/src/game/GMTicketMgr.cpp b/src/game/GMTicketMgr.cpp index 623382628b7..a085167a2bc 100644 --- a/src/game/GMTicketMgr.cpp +++ b/src/game/GMTicketMgr.cpp @@ -1,82 +1,82 @@ -/*
- * Copyright (C) 2005-2008 MaNGOS
- *
- * Copyright (C) 2008 Trinity
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "Common.h"
-#include "Database/DatabaseEnv.h"
-#include "Database/SQLStorage.h"
-#include "GMTicketMgr.h"
-#include "ObjectMgr.h"
-#include "ProgressBar.h"
-#include "Policies/SingletonImp.h"
-#include "Player.h"
-#include "ObjectDefines.h"
-
-INSTANTIATE_SINGLETON_1(GMTicketMgr);
-
-void GMTicketMgr::LoadGMTickets()
-{
- m_GMTicketMap.clear(); // For reload case
-
- QueryResult *result = CharacterDatabase.Query(
- // 0 1 2
- "SELECT guid, ticket_text,UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket");
-
- if( !result )
- {
- barGoLink bar( 1 );
-
- bar.step();
-
- sLog.outString();
- sLog.outErrorDb(">> Loaded `character_ticket`, table is empty!");
- return;
- }
-
- barGoLink bar( result->GetRowCount() );
-
- uint32 count = 0;
-
- do
- {
- bar.step();
-
- Field* fields = result->Fetch();
-
- uint32 guid = fields[0].GetUInt32();
- m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), time_t(fields[2].GetUInt64()));
- ++count;
-
- } while (result->NextRow());
- delete result;
-
- sLog.outString();
- sLog.outString( ">> Loaded %d GM tickets", count );
-}
-
-void GMTicketMgr::DeleteAll()
-{
- for(GMTicketMap::iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr)
- {
- if(Player* owner = objmgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER)))
- owner->GetSession()->SendGMTicketGetTicket(0x0A,0);
- }
- CharacterDatabase.PExecute("DELETE FROM character_ticket");
- m_GMTicketMap.clear();
-}
+/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "Common.h" +#include "Database/DatabaseEnv.h" +#include "Database/SQLStorage.h" +#include "GMTicketMgr.h" +#include "ObjectMgr.h" +#include "ProgressBar.h" +#include "Policies/SingletonImp.h" +#include "Player.h" +#include "ObjectDefines.h" + +INSTANTIATE_SINGLETON_1(GMTicketMgr); + +void GMTicketMgr::LoadGMTickets() +{ + m_GMTicketMap.clear(); // For reload case + + QueryResult *result = CharacterDatabase.Query( + // 0 1 2 + "SELECT guid, ticket_text,UNIX_TIMESTAMP(ticket_lastchange) FROM character_ticket"); + + if( !result ) + { + barGoLink bar( 1 ); + + bar.step(); + + sLog.outString(); + sLog.outString(">> Loaded `character_ticket`, table is empty."); + return; + } + + barGoLink bar( result->GetRowCount() ); + + uint32 count = 0; + + do + { + bar.step(); + + Field* fields = result->Fetch(); + + uint32 guid = fields[0].GetUInt32(); + m_GMTicketMap[guid] = GMTicket(guid, fields[1].GetCppString(), time_t(fields[2].GetUInt64())); + ++count; + + } while (result->NextRow()); + delete result; + + sLog.outString(); + sLog.outString( ">> Loaded %d GM tickets", count ); +} + +void GMTicketMgr::DeleteAll() +{ + for(GMTicketMap::iterator itr = m_GMTicketMap.begin(); itr != m_GMTicketMap.end(); ++itr) + { + if(Player* owner = objmgr.GetPlayer(MAKE_NEW_GUID(itr->first,0,HIGHGUID_PLAYER))) + owner->GetSession()->SendGMTicketGetTicket(0x0A,0); + } + CharacterDatabase.PExecute("DELETE FROM character_ticket"); + m_GMTicketMap.clear(); +} diff --git a/src/game/GMTicketMgr.h b/src/game/GMTicketMgr.h index 38ba9429990..a7b7a02ea17 100644 --- a/src/game/GMTicketMgr.h +++ b/src/game/GMTicketMgr.h @@ -1,118 +1,118 @@ -/*
- * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _GMTICKETMGR_H
-#define _GMTICKETMGR_H
-
-#include "Policies/Singleton.h"
-#include "Database/DatabaseEnv.h"
-#include "Util.h"
-#include <map>
-
-class GMTicket
-{
- public:
- explicit GMTicket()
- {
- }
-
- GMTicket(uint32 guid, std::string text, time_t update) : m_guid(guid), m_text(text), m_lastUpdate(update)
- {
-
- }
-
- const char* GetText() const
- {
- return m_text.c_str();
- }
-
- uint64 GetLastUpdate() const
- {
- return m_lastUpdate;
- }
-
- void SetText(const char* text)
- {
- m_text = text ? text : "";
- m_lastUpdate = time(NULL);
- CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", m_text.c_str(), m_guid);
- }
-
- void DeleteFromDB() const
- {
- CharacterDatabase.PExecute("DELETE FROM character_ticket WHERE guid = '%u' LIMIT 1", m_guid);
- }
-
- void SaveToDB() const
- {
- CharacterDatabase.BeginTransaction();
- DeleteFromDB();
- CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, GetText());
- CharacterDatabase.CommitTransaction();
- }
- private:
- uint32 m_guid;
- std::string m_text;
- time_t m_lastUpdate;
-};
-typedef std::map<uint32, GMTicket> GMTicketMap;
-
-class GMTicketMgr
-{
- public:
- GMTicketMgr() { }
- ~GMTicketMgr() { }
-
- void LoadGMTickets();
-
- GMTicket* GetGMTicket(uint32 guid)
- {
- GMTicketMap::iterator itr = m_GMTicketMap.find(guid);
- if(itr == m_GMTicketMap.end())
- return NULL;
- return &(itr->second);
- }
-
- size_t GetTicketCount() const
- {
- return m_GMTicketMap.size();
- }
-
- void Delete(uint32 guid)
- {
- GMTicketMap::iterator itr = m_GMTicketMap.find(guid);
- if(itr == m_GMTicketMap.end())
- return;
- itr->second.DeleteFromDB();
- m_GMTicketMap.erase(itr);
- }
-
- void DeleteAll();
-
- void Create(uint32 guid, const char* text)
- {
- GMTicket t = GMTicket(guid, text, time(NULL));
- t.SaveToDB();
- m_GMTicketMap[guid] = t;
- }
- private:
- GMTicketMap m_GMTicketMap;
-};
-
-#define ticketmgr Trinity::Singleton<GMTicketMgr>::Instance()
+/* + * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _GMTICKETMGR_H +#define _GMTICKETMGR_H + +#include "Policies/Singleton.h" +#include "Database/DatabaseEnv.h" +#include "Util.h" +#include <map> + +class GMTicket +{ + public: + explicit GMTicket() + { + } + + GMTicket(uint32 guid, std::string text, time_t update) : m_guid(guid), m_text(text), m_lastUpdate(update) + { + + } + + const char* GetText() const + { + return m_text.c_str(); + } + + uint64 GetLastUpdate() const + { + return m_lastUpdate; + } + + void SetText(const char* text) + { + m_text = text ? text : ""; + m_lastUpdate = time(NULL); + CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", m_text.c_str(), m_guid); + } + + void DeleteFromDB() const + { + CharacterDatabase.PExecute("DELETE FROM character_ticket WHERE guid = '%u' LIMIT 1", m_guid); + } + + void SaveToDB() const + { + CharacterDatabase.BeginTransaction(); + DeleteFromDB(); + CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, GetText()); + CharacterDatabase.CommitTransaction(); + } + private: + uint32 m_guid; + std::string m_text; + time_t m_lastUpdate; +}; +typedef std::map<uint32, GMTicket> GMTicketMap; + +class GMTicketMgr +{ + public: + GMTicketMgr() { } + ~GMTicketMgr() { } + + void LoadGMTickets(); + + GMTicket* GetGMTicket(uint32 guid) + { + GMTicketMap::iterator itr = m_GMTicketMap.find(guid); + if(itr == m_GMTicketMap.end()) + return NULL; + return &(itr->second); + } + + size_t GetTicketCount() const + { + return m_GMTicketMap.size(); + } + + void Delete(uint32 guid) + { + GMTicketMap::iterator itr = m_GMTicketMap.find(guid); + if(itr == m_GMTicketMap.end()) + return; + itr->second.DeleteFromDB(); + m_GMTicketMap.erase(itr); + } + + void DeleteAll(); + + void Create(uint32 guid, const char* text) + { + GMTicket t = GMTicket(guid, text, time(NULL)); + t.SaveToDB(); + m_GMTicketMap[guid] = t; + } + private: + GMTicketMap m_GMTicketMap; +}; + +#define ticketmgr Trinity::Singleton<GMTicketMgr>::Instance() #endif
\ No newline at end of file diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 595759a5451..f725e8063c8 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -65,7 +65,7 @@ GameObject::~GameObject() { if(m_uint32Values) // field array can be not exist if GameOBject not loaded { - // crash possable at access to deleted GO in Unit::m_gameobj + // crash possible at access to deleted GO in Unit::m_gameobj uint64 owner_guid = GetOwnerGUID(); if(owner_guid) { @@ -73,7 +73,7 @@ GameObject::~GameObject() if(owner) owner->RemoveGameObject(this,false); else if(!IS_PLAYER_GUID(owner_guid)) - sLog.outError("Delete GameObject (GUID: %u Entry: %u ) that have references in not found creature %u GO list. Crash possable later.",GetGUIDLow(),GetGOInfo()->id,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()->id,GUID_LOPART(owner_guid)); } } } @@ -209,7 +209,7 @@ void GameObject::Update(uint32 /*p_time*/) ((Player*)caster)->SendMessageToSet(&data,true); } - m_lootState = GO_READY; // can be succesfully open with some chance + m_lootState = GO_READY; // can be successfully open with some chance } return; } @@ -286,7 +286,7 @@ void GameObject::Update(uint32 /*p_time*/) float radius = goInfo->trap.radius; if(!radius) { - if(goInfo->trap.cooldown != 3) // cast in other case (at some triggring/linked go/etc explicit call) + if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call) return; else { @@ -433,7 +433,7 @@ void GameObject::Update(uint32 /*p_time*/) m_respawnTime = time(NULL) + m_respawnDelayTime; // if option not set then object will be saved at grid unload - if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) + if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) SaveRespawnTime(); ObjectAccessor::UpdateObjectVisibility(this); @@ -486,7 +486,7 @@ void GameObject::getFishLoot(Loot *fishloot) void GameObject::SaveToDB() { // this should only be used when the gameobject has already been loaded - // perferably after adding to map, because mapid may not be valid otherwise + // preferably after adding to map, because mapid may not be valid otherwise GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid); if(!data) { @@ -1284,4 +1284,4 @@ void GameObject::CastSpell(Unit* target, uint32 spell) } //trigger->setDeathState(JUST_DIED); //trigger->RemoveCorpse(); -}
\ No newline at end of file +} diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 92c5b00e514..be7e9af5135 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1462,7 +1462,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, boo InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()]; if(bind.save) { - // when a boss is killed or when copying the players's binds to the group + // when a boss is killed or when copying the player's binds to the group if(permanent != bind.perm || save != bind.save) if(!load) CharacterDatabase.PExecute("UPDATE group_instance SET instance = '%u', permanent = '%u' WHERE leaderGuid = '%u' AND instance = '%u'", save->GetInstanceId(), permanent, GUID_LOPART(GetLeaderGUID()), bind.save->GetInstanceId()); } diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index 5e049d77b71..8c6a8d3f774 100644 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -45,7 +45,7 @@ void GuardAI::MoveInLineOfSight(Unit *u) if( !i_creature.getVictim() && i_creature.canAttack(u) && ( u->IsHostileToPlayers() || i_creature.IsHostileTo(u) /*|| u->getVictim() && i_creature.IsFriendlyTo(u->getVictim())*/ ) && - u->isInAccessablePlaceFor(&i_creature)) + u->isInAccessiblePlaceFor(&i_creature)) { float attackRadius = i_creature.GetAttackDistance(u); if(i_creature.IsWithinDistInMap(u,attackRadius)) diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 2fafd68bb8c..2fe6b2108b2 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -1928,7 +1928,7 @@ uint8 Guild::CanStoreItem( uint8 tab, uint8 slot, GuildItemPosCountVec &dest, ui return EQUIP_ERR_OK; } - // not specific slot or have spece for partly store only in specific slot + // not specific slot or have space for partly store only in specific slot // search stack in tab for merge to if( pItem->GetMaxStackCount() > 1 ) diff --git a/src/game/Guild.h b/src/game/Guild.h index 0e0e99b2cd4..839b8dd17f0 100644 --- a/src/game/Guild.h +++ b/src/game/Guild.h @@ -331,6 +331,18 @@ class Guild { return (members.find(LowGuid) != members.end()); } + MemberSlot* GetMemberSlot(std::string const& name, uint64& guid) + { + for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr) + { + if(itr->second.name == name) + { + guid = itr->first; + return &itr->second; + } + } + return NULL; + } void Roster(WorldSession *session); void Query(WorldSession *session); diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index e503db9f299..9462f7a1bb1 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -173,26 +173,20 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) return; } - uint64 plGuid = objmgr.GetPlayerGUIDByName(plName); - - if(!plGuid) + uint64 plGuid; + MemberSlot* slot = guild->GetMemberSlot(plName, plGuid); + if(!slot) { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND); + SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); return; } - if(plGuid == guild->GetLeader()) + if(slot->RankId == GR_GUILDMASTER) { SendGuildCommandResult(GUILD_QUIT_S, "", GUILD_LEADER_LEAVE); return; } - if(!guild->IsMember(GUID_LOPART(plGuid))) - { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); - return; - } - guild->DelMember(plGuid); // Put record into guildlog guild->LogGuildEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), 0); @@ -301,29 +295,25 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) return; } - uint64 plGuid = objmgr.GetPlayerGUIDByName(plName); - - if(!plGuid) + uint64 plGuid; + MemberSlot* slot = guild->GetMemberSlot(plName, plGuid); + + if(!slot) { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND); + SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); return; } - else if(plGuid == GetPlayer()->GetGUID()) + + if(plGuid == GetPlayer()->GetGUID()) { SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_NAME_INVALID); return; } - int32 plRankId = guild->GetRank(GUID_LOPART(plGuid)); - if(plRankId == -1) - { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); - return; - } - if(plRankId < 2 || (plRankId-1) < GetPlayer()->GetRank()) + if(slot->RankId < 2 || (slot->RankId-1) < GetPlayer()->GetRank()) return; - uint32 newRankId = plRankId < guild->GetNrRanks() ? plRankId-1 : guild->GetNrRanks()-1; + uint32 newRankId = slot->RankId < guild->GetNrRanks() ? slot->RankId-1 : guild->GetNrRanks()-1; guild->ChangeRank(plGuid, newRankId); // Put record into guildlog @@ -365,11 +355,12 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) return; } - uint64 plGuid = objmgr.GetPlayerGUIDByName(plName); + uint64 plGuid; + MemberSlot* slot = guild->GetMemberSlot(plName, plGuid); - if( !plGuid ) + if (!slot) { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND); + SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); return; } @@ -379,26 +370,19 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) return; } - int32 plRankId = guild->GetRank(GUID_LOPART(plGuid)); - if(plRankId == -1) - { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); - return; - } - - if((plRankId+1) >= guild->GetNrRanks() || plRankId <= this->GetPlayer()->GetRank()) + if((slot->RankId+1) >= guild->GetNrRanks() || slot->RankId <= GetPlayer()->GetRank()) return; - guild->ChangeRank(plGuid, (plRankId+1)); + guild->ChangeRank(plGuid, (slot->RankId+1)); // Put record into guildlog - guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (plRankId+1)); + guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (slot->RankId+1)); WorldPacket data(SMSG_GUILD_EVENT, (2+30)); // guess size data << (uint8)GE_DEMOTION; data << (uint8)3; data << GetPlayer()->GetName(); data << plName; - data << guild->GetRankName(plRankId+1); + data << guild->GetRankName(slot->RankId+1); guild->BroadcastPacket(&data); } @@ -497,13 +481,10 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) return; } - uint64 newLeaderGUID = objmgr.GetPlayerGUIDByName(name); - if (!newLeaderGUID) - { - SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_FOUND); - return; - } - if(!guild->IsMember(GUID_LOPART(newLeaderGUID))) + uint64 newLeaderGUID; + MemberSlot* slot = guild->GetMemberSlot(name, newLeaderGUID); + + if (!slot) { SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_IN_GUILD_S); return; @@ -583,15 +564,10 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) return; } - uint64 plGuid = objmgr.GetPlayerGUIDByName(name); + uint64 plGuid; + MemberSlot* slot = guild->GetMemberSlot(name, plGuid); - if (!plGuid) - { - SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_FOUND); - return; - } - - if (!guild->IsMember(GUID_LOPART(plGuid))) + if (!slot) { SendGuildCommandResult(GUILD_INVITE_S, name, GUILD_PLAYER_NOT_IN_GUILD_S); return; @@ -628,15 +604,10 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) return; } - uint64 plGuid = objmgr.GetPlayerGUIDByName(plName); - - if (!plGuid) - { - SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_FOUND); - return; - } + uint64 plGuid; + MemberSlot* slot = guild->GetMemberSlot(plName, plGuid); - if (!guild->IsMember(GUID_LOPART(plGuid))) + if (!slot) { SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S); return; diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 62efe7dd234..5f9daa44336 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -555,7 +555,7 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data ) } else { - // prevent sell more items that exist in stack (possable only not from client) + // prevent sell more items that exist in stack (possible only not from client) if(count > pItem->GetCount()) { _player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0); @@ -1027,7 +1027,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) return; } - if(item==gift) // not possable with pacjket from real client + if(item==gift) // not possible with pacjket from real client { _player->SendEquipError( EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL ); return; diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index 03683385b10..3e1e4fe1919 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -78,7 +78,7 @@ enum ItemBondingType { NO_BIND = 0, BIND_WHEN_PICKED_UP = 1, - BIND_WHEN_EQUIPED = 2, + BIND_WHEN_EQUIPPED = 2, BIND_WHEN_USE = 3, BIND_QUEST_ITEM = 4, BIND_QUEST_ITEM1 = 5 // not used in game diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index f3c4e1803be..a3379c4d79b 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -112,7 +112,7 @@ static void AttemptAddMore(Player* _player) if(!group->Create(_player->GetGUID(), _player->GetName())) { delete group; - return; // cann't create group (??) + return; // can't create group (??) } objmgr.AddGroup(group); @@ -254,7 +254,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type) { uint32 number = 0; - // start preper packet; + // start prepare packet; WorldPacket data(MSG_LOOKING_FOR_GROUP); data << uint32(type); // type data << uint32(entry); // entry from LFGDungeons.dbc diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index e14a5bcddab..a2f37d02480 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -52,7 +52,6 @@ #include "BattleGroundMgr.h" #include "InstanceSaveMgr.h" #include "InstanceData.h" -#include "AccountMgr.h" //reload commands bool ChatHandler::HandleReloadCommand(const char* arg) diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 2f362b7763e..436774d4218 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -534,7 +534,7 @@ void Loot::NotifyQuestItemRemoved(uint8 questIndex) // when a free for all questitem is looted // all players will get notified of it being removed // (other questitems can be looted by each group member) - // bit inefficient but isnt called often + // bit inefficient but isn't called often std::set<uint64>::iterator i_next; for(std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next) diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index de92fdbc936..d91206bf6d9 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -375,7 +375,7 @@ void WorldSession::SendReturnToSender(uint8 messageType, uint32 sender_acc, uint return; } - // preper mail and send in other case + // prepare mail and send in other case bool needItemDelay = false; if(mi && !mi->empty()) @@ -467,7 +467,7 @@ void WorldSession::HandleTakeItem(WorldPacket & recv_data ) else if(!receive) sender_accId = objmgr.GetPlayerAccountIdByGUID(sender_guid); - // check player existanse + // check player existence if(receive || sender_accId) { WorldSession::SendMailTo(receive, MAIL_NORMAL, MAIL_STATIONERY_NORMAL, m->receiver, m->sender, m->subject, 0, NULL, m->COD, 0, MAIL_CHECK_MASK_COD_PAYMENT); diff --git a/src/game/Map.cpp b/src/game/Map.cpp index d21c9721962..2dde5708b1a 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -677,7 +677,7 @@ Map::Remove(T *obj, bool remove) if( remove ) { // if option set then object already saved at this moment - if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) + if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) obj->SaveRespawnTime(); DeleteFromWorld(obj); } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 6da8f5a4db0..9e810e4baec 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -258,7 +258,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) data << uint8(0); // new 2.4.0 data << uint32( pzoneid ); // player zone id - // 49 is maximum player count sent to client - can be overriden + // 49 is maximum player count sent to client - can be overridden // through config, but is unstable if ((++clientcount) == sWorld.getConfig(CONFIG_MAX_WHO)) break; @@ -1280,6 +1280,8 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) return; } + normalizePlayerName (charname); + Player *plr = objmgr.GetPlayer(charname.c_str()); if(!plr) diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 87d51e5daf6..78cabe07bab 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -140,7 +140,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() if(!mEntry->IsMountAllowed()) _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); - // battleground state preper + // battleground state prepare // only add to bg group and object, if the player was invited (else he entered through command) if(_player->InBattleGround() && _player->IsInvitedForBattleGroundInstance(_player->GetBattleGroundId())) { diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index 7347e9d1bdc..39727db2985 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -255,7 +255,7 @@ ObjectGridUnloader::Visit(GridRefManager<T> &m) { T *obj = m.getFirst()->getSource(); // if option set then object already saved at this moment - if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) + if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) obj->SaveRespawnTime(); ///- object must be out of world before delete obj->RemoveFromWorld(); @@ -276,7 +276,7 @@ ObjectGridUnloader::Visit(CreatureMapType &m) { Creature *obj = m.getFirst()->getSource(); // if option set then object already saved at this moment - if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY)) + if(!sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) obj->SaveRespawnTime(); ///- object will get delinked from the manager when deleted delete obj; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index aead2c68964..446971968e0 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -892,7 +892,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* return; } - // replace by new strucutres array + // replace by new structures array const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1]; int i=0; @@ -3132,7 +3132,7 @@ void ObjectMgr::LoadQuests() { sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", qinfo->GetQuestId(),qinfo->SrcItemId); - qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward comptibility with DB + qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB } } else if(qinfo->SrcItemCount>0) @@ -3535,7 +3535,7 @@ void ObjectMgr::LoadQuests() Quest const* quest = GetQuestTemplate(quest_id); - // some quest referenced in spells not exist (outdataed spells) + // some quest referenced in spells not exist (outdated spells) if(!quest) continue; @@ -3895,7 +3895,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) // this will prevent quest completing without objective const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); - // continue; - quest objective requiremet set and command can be allowed + // continue; - quest objective requirement set and command can be allowed } if(float(tmp.datalong2) > DEFAULT_VISIBILITY_DISTANCE) @@ -4069,7 +4069,7 @@ void ObjectMgr::LoadEventScripts() { std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first); if (itr2 == evt_scripts.end()) - sLog.outErrorDb("Table `event_scripts` has script (Id: %u) not refering to any gameobject_template type 10 data2 field or type 3 data6 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT); + sLog.outErrorDb("Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field or type 3 data6 field or any spell effect %u", itr->first, SPELL_EFFECT_SEND_EVENT); } } @@ -4236,7 +4236,7 @@ void ObjectMgr::LoadInstanceTemplate() } } - // the reset_delay must be atleast one day + // the reset_delay must be at least one day temp->reset_delay = std::max((uint32)1, (uint32)(temp->reset_delay * sWorld.getRate(RATE_INSTANCE_RESET_TIME))); } @@ -4537,7 +4537,7 @@ void ObjectMgr::LoadQuestAreaTriggers() // this will prevent quest completing without objective const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); - // continue; - quest modified to required obkective and trigger can be allowed. + // continue; - quest modified to required objective and trigger can be allowed. } mQuestAreaTriggerMap[trigger_ID] = quest_ID; @@ -4834,7 +4834,7 @@ void ObjectMgr::LoadGraveyardZones() } if(!AddGraveYardLink(safeLocId,zoneId,team,false)) - sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Garveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId); + sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId); } while( result->NextRow() ); delete result; @@ -5235,7 +5235,7 @@ uint32 ObjectMgr::GenerateAuctionID() ++m_auctionid; if(m_auctionid>=0xFFFFFFFF) { - sLog.outError("Auctions ids overflow!! Can't continue, shuting down server. "); + sLog.outError("Auctions ids overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_auctionid; @@ -5246,7 +5246,7 @@ uint32 ObjectMgr::GenerateMailID() ++m_mailid; if(m_mailid>=0xFFFFFFFF) { - sLog.outError("Mail ids overflow!! Can't continue, shuting down server. "); + sLog.outError("Mail ids overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_mailid; @@ -5257,7 +5257,7 @@ uint32 ObjectMgr::GenerateItemTextID() ++m_ItemTextId; if(m_ItemTextId>=0xFFFFFFFF) { - sLog.outError("Item text ids overflow!! Can't continue, shuting down server. "); + sLog.outError("Item text ids overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_ItemTextId; @@ -5285,7 +5285,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiItemGuid; if(m_hiItemGuid>=0xFFFFFFFF) { - sLog.outError("Item guid overflow!! Can't continue, shuting down server. "); + sLog.outError("Item guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiItemGuid; @@ -5293,7 +5293,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiCreatureGuid; if(m_hiCreatureGuid>=0x00FFFFFF) { - sLog.outError("Creature guid overflow!! Can't continue, shuting down server. "); + sLog.outError("Creature guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiCreatureGuid; @@ -5301,7 +5301,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiPetGuid; if(m_hiPetGuid>=0x00FFFFFF) { - sLog.outError("Pet guid overflow!! Can't continue, shuting down server. "); + sLog.outError("Pet guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiPetGuid; @@ -5309,7 +5309,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiCharGuid; if(m_hiCharGuid>=0xFFFFFFFF) { - sLog.outError("Players guid overflow!! Can't continue, shuting down server. "); + sLog.outError("Players guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiCharGuid; @@ -5317,7 +5317,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiGoGuid; if(m_hiGoGuid>=0x00FFFFFF) { - sLog.outError("Gameobject guid overflow!! Can't continue, shuting down server. "); + sLog.outError("Gameobject guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiGoGuid; @@ -5325,7 +5325,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiCorpseGuid; if(m_hiCorpseGuid>=0xFFFFFFFF) { - sLog.outError("Corpse guid overflow!! Can't continue, shuting down server. "); + sLog.outError("Corpse guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiCorpseGuid; @@ -5333,7 +5333,7 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) ++m_hiDoGuid; if(m_hiDoGuid>=0xFFFFFFFF) { - sLog.outError("DynamicObject guid overflow!! Can't continue, shuting down server. "); + sLog.outError("DynamicObject guid overflow!! Can't continue, shutting down server. "); sWorld.m_stopEvent = true; } return m_hiDoGuid; @@ -6177,7 +6177,7 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo return true; } - if(strictMask & 0x1) // basic latin + if(strictMask & 0x1) // basic Latin { if(isBasicLatinString(wstr,numericOrSpace)) return true; @@ -6511,7 +6511,7 @@ void ObjectMgr::LoadSpellDisabledEntrys() void ObjectMgr::LoadFishingBaseSkillLevel() { - mFishingBaseForArea.clear(); // for relaod case + mFishingBaseForArea.clear(); // for reload case uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level"); @@ -6827,7 +6827,7 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial) void ObjectMgr::LoadGameTele() { - m_GameTeleMap.clear(); // for relaod case + m_GameTeleMap.clear(); // for reload case uint32 count = 0; QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele"); diff --git a/src/game/OutdoorPvP.cpp b/src/game/OutdoorPvP.cpp index 2c77b2c453b..df72ed28140 100644 --- a/src/game/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP.cpp @@ -321,7 +321,7 @@ bool OutdoorPvPObjective::DelCreature(uint32 type) } sLog.outDebug("deleting opvp creature type %u",type); uint32 guid = cr->GetDBTableGUIDLow(); - // dont save respawn time + // Don't save respawn time cr->SetRespawnTime(0); cr->RemoveCorpse(); cr->CleanupsBeforeDelete(); @@ -379,7 +379,7 @@ bool OutdoorPvPObjective::DelCapturePoint() if(cr) { uint32 guid = cr->GetDBTableGUIDLow(); - // dont save respawn time + // Don't save respawn time cr->SetRespawnTime(0); cr->RemoveCorpse(); cr->CleanupsBeforeDelete(); diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index fb1b3121090..e8fa449fe61 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -49,7 +49,7 @@ void PetAI::MoveInLineOfSight(Unit *u) if( !i_pet.getVictim() && i_pet.GetCharmInfo() && i_pet.GetCharmInfo()->HasReactState(REACT_AGGRESSIVE) && i_pet.IsHostileTo( u ) && i_pet.canAttack(u) && - u->isInAccessablePlaceFor(&i_pet)) + u->isInAccessiblePlaceFor(&i_pet)) { float attackRadius = i_pet.GetAttackDistance(u); if(i_pet.IsWithinDistInMap(u, attackRadius) && i_pet.GetDistanceZ(u) <= CREATURE_Z_ATTACK_RANGE) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7f3747ed1b8..8ec5b2fb52b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -797,7 +797,7 @@ void Player::StopMirrorTimer(MirrorTimerType Type) GetSession()->SendPacket( &data ); } -void Player::EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage) +void Player::EnvironmentalDamage(uint64 guid, EnvironmentalDamageType type, uint32 damage) { WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21)); data << (uint64)guid; @@ -1544,7 +1544,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (isPossessedByPlayer()) ((Player*)GetCharmer())->RemovePossess(); - // The player was ported to another map and looses the duel immediatly. + // The player was ported to another map and looses the duel immediately. // We have to perform this check before the teleport, otherwise the // ObjectAccessor won't find the flag. if (duel && GetMapId()!=mapid) @@ -6690,7 +6690,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply) SetBaseWeaponDamage(attType, MAXDAMAGE, damage); } - if(!IsUseEquipedWeapon(slot==EQUIPMENT_SLOT_MAINHAND)) + if(!IsUseEquippedWeapon(slot==EQUIPMENT_SLOT_MAINHAND)) return; if (proto->Delay) @@ -8468,7 +8468,7 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable) cons if(!useable) return item; - if( item->IsBroken() || !IsUseEquipedWeapon(attackType==BASE_ATTACK) ) + if( item->IsBroken() || !IsUseEquippedWeapon(attackType==BASE_ATTACK) ) return NULL; return item; @@ -10138,7 +10138,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo if( pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM || - pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) ) + pItem->GetProto()->Bonding == BIND_WHEN_EQUIPPED && IsBagPos(pos) ) pItem->SetBinding( true ); if( bag == INVENTORY_SLOT_BAG_0 ) @@ -10184,7 +10184,7 @@ Item* Player::_StoreItem( uint16 pos, Item *pItem, uint32 count, bool clone, boo { if( pItem2->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem2->GetProto()->Bonding == BIND_QUEST_ITEM || - pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) ) + pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPPED && IsBagPos(pos) ) pItem2->SetBinding( true ); pItem2->SetCount( pItem2->GetCount() + count ); @@ -10369,7 +10369,7 @@ void Player::VisualizeItem( uint8 slot, Item *pItem) return; // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory) - if( pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM ) + if( pItem->GetProto()->Bonding == BIND_WHEN_EQUIPPED || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM ) pItem->SetBinding( true ); sLog.outDebug( "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); @@ -17331,7 +17331,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) cons // GM invisibility checks early, invisibility if any detectable, so if not stealth then visible if(u->GetVisibility() == VISIBILITY_GROUP_STEALTH) { - // if player is dead then he can't detect anyone in anycases + // if player is dead then he can't detect anyone in any cases //do not know what is the use of this detect // stealth and detected and visible for some seconds if(!isAlive()) diff --git a/src/game/Player.h b/src/game/Player.h index 48a80f9cd5e..e7d72ab8162 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -785,7 +785,7 @@ enum TeleportToOptions }; /// Type of environmental damages -enum EnviromentalDamage +enum EnvironmentalDamageType { DAMAGE_EXHAUSTED = 0, DAMAGE_DROWNING = 1, @@ -1123,7 +1123,7 @@ class TRINITY_DLL_SPEC Player : public Unit uint32 GetWeaponProficiency() const { return m_WeaponProficiency; } uint32 GetArmorProficiency() const { return m_ArmorProficiency; } bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; } - bool IsUseEquipedWeapon( bool mainhand ) const + bool IsUseEquippedWeapon( bool mainhand ) const { // disarm applied only to mainhand weapon return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED) ); @@ -1933,10 +1933,10 @@ class TRINITY_DLL_SPEC Player : public Unit void SetRestTime(uint32 v) { m_restTime = v;}; /*********************************************************/ - /*** ENVIROMENTAL SYSTEM ***/ + /*** ENVIRONMENTAL SYSTEM ***/ /*********************************************************/ - void EnvironmentalDamage(uint64 guid, EnviromentalDamage type, uint32 damage); + void EnvironmentalDamage(uint64 guid, EnvironmentalDamageType type, uint32 damage); /*********************************************************/ /*** FLOOD FILTER SYSTEM ***/ diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 56a9a14bcc7..13a02d52841 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -199,7 +199,7 @@ enum ItemQualities // *********************************** #define SPELL_ATTR_UNK0 0x00000001 // 0 -#define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilites have this flag +#define SPELL_ATTR_RANGED 0x00000002 // 1 All ranged abilities have this flag #define SPELL_ATTR_ON_NEXT_SWING_1 0x00000004 // 2 on next swing #define SPELL_ATTR_UNK3 0x00000008 // 3 not set in 2.4.2 #define SPELL_ATTR_UNK4 0x00000010 // 4 @@ -736,7 +736,7 @@ enum Mechanics (1<<MECHANIC_SHACKLE )|(1<<MECHANIC_TURN )|(1<<MECHANIC_HORROR)| \ (1<<MECHANIC_DAZE )|(1<<MECHANIC_SAPPED ) ) -// Spell dispell type +// Spell dispel type enum DispelType { DISPEL_NONE = 0, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 5065bc4f27d..fdedd0e7d78 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -365,7 +365,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before. m_casttime = 0; // setup to correct value in Spell::prepare, don't must be used before. - m_timer = 0; // will set to castime in preper + m_timer = 0; // will set to castime in prepare m_needAliveTargetMask = 0; @@ -1679,7 +1679,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap) if(Player* target = ((Player*)m_caster)->GetNextRandomRaidMember(radius)) TagUnitMap.push_back(target); }break; - // TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some sceals, fire shield from imp, etc..) + // TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some seals, fire shield from imp, etc..) case TARGET_SINGLE_PARTY: { Unit *target = m_targets.getUnitTarget(); diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 4f2b9b56233..cf628515925 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -213,7 +213,7 @@ enum AuraType SPELL_AURA_MOD_SPEED_NOT_STACK = 171, SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172, SPELL_AURA_ALLOW_CHAMPION_SPELLS = 173, - SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT + SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175, SPELL_AURA_SPIRIT_OF_REDEMPTION = 176, SPELL_AURA_AOE_CHARM = 177, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index e97c2ab06ff..30afbdcfa7c 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -215,7 +215,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI &Aura::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE &Aura::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell - &Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemended in Unit::MagicSpellHitResult + &Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult &Aura::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT &Aura::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA &Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE @@ -229,7 +229,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK &Aura::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK &Aura::HandleUnused, //173 SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell - &Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT) + &Aura::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus (by default intellect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT) &Aura::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus &Aura::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end &Aura::HandleNULL, //177 SPELL_AURA_AOE_CHARM @@ -242,7 +242,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst &Aura::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult - &Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemended in Unit::GetUnitCriticalChance + &Aura::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance &Aura::HandleNoImmediateEffect, //188 SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance &Aura::HandleModRating, //189 SPELL_AURA_MOD_RATING &Aura::HandleNULL, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN @@ -1054,7 +1054,7 @@ void Aura::_RemoveAura() ((Player*)caster)->SendCooldownEvent(GetSpellProto()); } } - else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove proccess. + else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove process. UpdateSlotCounterAndDuration(false); } @@ -1204,12 +1204,12 @@ void Aura::TriggerSpell() uint64 originalCasterGUID = GetCasterGUID(); - SpellEntry const *triggredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); + SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); SpellEntry const *auraSpellInfo = GetSpellProto(); uint32 auraId = auraSpellInfo->Id; // specific code for cases with no trigger spell provided in field - if (triggredSpellInfo == NULL) + if (triggeredSpellInfo == NULL) { switch(auraSpellInfo->SpellFamilyName) { @@ -1217,7 +1217,7 @@ void Aura::TriggerSpell() { switch(auraId) { - // Firestone Passive (1-5 rangs) + // Firestone Passive (1-5 ranks) case 758: case 17945: case 17947: @@ -1251,7 +1251,7 @@ void Aura::TriggerSpell() // case 812: break; // // Polymorphic Ray // case 6965: break; -// // Fire Nova (1-7 Rangs) +// // Fire Nova (1-7 ranks) // case 8350: // case 8508: // case 8509: @@ -1823,8 +1823,8 @@ void Aura::TriggerSpell() break; } // Reget trigger spell proto - triggredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); - if(triggredSpellInfo == NULL) + triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); + if(triggeredSpellInfo == NULL) { sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex()); return; @@ -1832,7 +1832,7 @@ void Aura::TriggerSpell() } else { - // Spell exist but require costum code + // Spell exist but require custom code switch(auraId) { // Curse of Idiocy @@ -1842,14 +1842,14 @@ void Aura::TriggerSpell() // BUT: // 1) target show casting at each triggered cast: target don't must show casting animation for any triggered spell // but must show affect apply like item casting - // 2) maybe aura must be replace by new with accumulative stat mods insteed stacking + // 2) maybe aura must be replace by new with accumulative stat mods instead stacking // prevent cast by triggered auras if(m_caster_guid == m_target->GetGUID()) return; // stop triggering after each affected stats lost > 90 - int32 intelectLoss = 0; + int32 intellectLoss = 0; int32 spiritLoss = 0; Unit::AuraList const& mModStat = m_target->GetAurasByType(SPELL_AURA_MOD_STAT); @@ -1859,14 +1859,14 @@ void Aura::TriggerSpell() { switch((*i)->GetModifier()->m_miscvalue) { - case STAT_INTELLECT: intelectLoss += (*i)->GetModifier()->m_amount; break; + case STAT_INTELLECT: intellectLoss += (*i)->GetModifier()->m_amount; break; case STAT_SPIRIT: spiritLoss += (*i)->GetModifier()->m_amount; break; default: break; } } } - if(intelectLoss <= -90 && spiritLoss <= -90) + if(intellectLoss <= -90 && spiritLoss <= -90) return; caster = target; @@ -1881,9 +1881,9 @@ void Aura::TriggerSpell() } } } - m_target->CastSpell(target, triggredSpellInfo, true, 0, this, originalCasterGUID); + m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, originalCasterGUID); /*// All ok cast by default case - Spell *spell = new Spell(m_target, triggredSpellInfo, true, originalCasterGUID ); + Spell *spell = new Spell(m_target, triggeredSpellInfo, true, originalCasterGUID ); SpellCastTargets targets; targets.setUnitTarget( target ); @@ -2008,7 +2008,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) // Dark Fiend if(GetId()==45934) { - // Kill target if dispeled + // Kill target if dispelled if (m_removeMode==AURA_REMOVE_BY_DISPEL) m_target->DealDamage(m_target, m_target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); return; @@ -2565,7 +2565,8 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) } else { - m_target->SetDisplayId(m_target->GetNativeDisplayId()); + if(modelid > 0) + m_target->SetDisplayId(m_target->GetNativeDisplayId()); m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, FORM_NONE); if(m_target->getClass() == CLASS_DRUID) m_target->setPowerType(POWER_MANA); @@ -2716,7 +2717,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) Aura* handledAura = *otherTransforms.begin(); for(Unit::AuraList::const_iterator i = otherTransforms.begin();i != otherTransforms.end(); ++i) { - // negative auras are prefered + // negative auras are preferred if(!IsPositiveSpell((*i)->GetSpellProto()->Id)) { handledAura = *i; @@ -3116,7 +3117,7 @@ void Aura::HandleAuraModDisarm(bool apply, bool Real) if (m_target->GetTypeId() != TYPEID_PLAYER) return; - // main-hand attack speed already set to special value for feral form already and don't must chnage and reset at remove. + // main-hand attack speed already set to special value for feral form already and don't must change and reset at remove. if (((Player *)m_target)->IsInFeralForm()) return; @@ -3438,7 +3439,7 @@ void Aura::HandleAuraModSilence(bool apply, bool Real) if (currentSpell && currentSpell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE) { uint32 state = currentSpell->getState(); - // Stop spells on prepere or casting state + // Stop spells on prepare or casting state if ( state == SPELL_STATE_PREPARING || state == SPELL_STATE_CASTING ) { currentSpell->cancel(); @@ -4011,7 +4012,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) int32 mws = caster->GetAttackTime(BASE_ATTACK); float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE); float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE); - // WARNING! in 3.0 multipler 0.00743f change to 0.6 + // WARNING! in 3.0 multiplier 0.00743f change to 0.6 m_modifier.m_amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.00743f); } return; @@ -4039,7 +4040,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) // Rip if (m_spellProto->SpellFamilyFlags & 0x000000000000800000LL) { - // $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, wheather 4 or 5 CPs are being used] + // $AP * min(0.06*$cp, 0.24)/6 [Yes, there is no difference, whether 4 or 5 CPs are being used] if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER) { uint8 cp = ((Player*)caster)->GetComboPoints(); @@ -4092,7 +4093,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) // Rupture if (m_spellProto->SpellFamilyFlags & 0x000000000000100000LL) { - // Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP inrease the contribution from AP] + // Dmg/tick = $AP*min(0.01*$cp, 0.03) [Like Rip: only the first three CP increase the contribution from AP] if (apply && !loading && caster && caster->GetTypeId() == TYPEID_PLAYER) { uint8 cp = ((Player*)caster)->GetComboPoints(); @@ -4422,9 +4423,9 @@ void Aura::HandleAuraModResistenceOfStatPercent(bool apply, bool Real) if(m_modifier.m_miscvalue != SPELL_SCHOOL_MASK_NORMAL) { - // support required adding replace UpdateArmor by loop by UpdateResistence at intelect update + // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update // and include in UpdateResistence same code as in UpdateArmor for aura mod apply. - sLog.outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) need adding support for non-armor resistences!"); + sLog.outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) need adding support for non-armor resistances!"); return; } @@ -4887,7 +4888,7 @@ void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real) if(m_modifier.m_miscvalue != STAT_INTELLECT) { // support required adding UpdateAttackPowerAndDamage calls at stat update - sLog.outError("Aura SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT (212) need support non-intelect stats!"); + sLog.outError("Aura SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT (212) need support non-intellect stats!"); return; } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 079ebd059b4..739fa96cee2 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -809,7 +809,7 @@ void Spell::EffectDummy(uint32 i) } case 13567: // Dummy Trigger { - // can be used for different aura triggreing, so select by aura + // can be used for different aura triggering, so select by aura if(!m_triggeredByAuraSpell || !unitTarget) return; @@ -1352,7 +1352,7 @@ void Spell::EffectDummy(uint32 i) case 19266: spellid = 19254; break; // Rank 6 case 25461: spellid = 25460; break; // Rank 7 default: - sLog.outError("Spell::EffectDummy: Spell 28598 triggered by unhandeled spell %u",m_triggeredByAuraSpell->Id); + sLog.outError("Spell::EffectDummy: Spell 28598 triggered by unhandled spell %u",m_triggeredByAuraSpell->Id); return; } m_caster->CastSpell(unitTarget, spellid, true, NULL); @@ -2665,31 +2665,31 @@ void Spell::EffectEnergize(uint32 i) return; // Some level depends spells - int multipler = 0; + int multiplier = 0; int level_diff = 0; switch (m_spellInfo->Id) { // Restore Energy case 9512: level_diff = m_caster->getLevel() - 40; - multipler = 2; + multiplier = 2; break; // Blood Fury case 24571: level_diff = m_caster->getLevel() - 60; - multipler = 10; + multiplier = 10; break; // Burst of Energy case 24532: level_diff = m_caster->getLevel() - 60; - multipler = 4; + multiplier = 4; break; default: break; } if (level_diff > 0) - damage -= multipler * level_diff; + damage -= multiplier * level_diff; if(damage < 0) return; @@ -3292,7 +3292,7 @@ void Spell::EffectDispel(uint32 i) if(!unitTarget) return; - // Fill possible dispell list + // Fill possible dispel list std::vector <Aura *> dispel_list; // Create dispel mask by dispel type @@ -3327,7 +3327,7 @@ void Spell::EffectDispel(uint32 i) std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid) std::list < uint32 > fail_list; // spell_id int32 list_size = dispel_list.size(); - // Dispell N = damage buffs (or while exist buffs for dispel) + // dispel N = damage buffs (or while exist buffs for dispel) for (int32 count=0; count < damage && list_size > 0; ++count) { // Random select buff for dispel @@ -3351,8 +3351,8 @@ void Spell::EffectDispel(uint32 i) // Remove buff from list for prevent doubles for (std::vector<Aura *>::iterator j = dispel_list.begin(); j != dispel_list.end(); ) { - Aura *dispeled = *j; - if (dispeled->GetId() == aur->GetId() && dispeled->GetCasterGUID() == aur->GetCasterGUID()) + Aura *dispelled = *j; + if (dispelled->GetId() == aur->GetId() && dispelled->GetCasterGUID() == aur->GetCasterGUID()) { j = dispel_list.erase(j); --list_size; @@ -3368,14 +3368,14 @@ void Spell::EffectDispel(uint32 i) WorldPacket data(SMSG_SPELLDISPELLOG, 8+8+4+1+4+count*5); data.append(unitTarget->GetPackGUID()); // Victim GUID data.append(m_caster->GetPackGUID()); // Caster GUID - data << uint32(m_spellInfo->Id); // Dispell spell id + data << uint32(m_spellInfo->Id); // dispel spell id data << uint8(0); // not used data << uint32(count); // count for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first); data << uint32(spellInfo->Id); // Spell Id - data << uint8(0); // 0 - dispeled !=0 cleansed + data << uint8(0); // 0 - dispelled !=0 cleansed unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster); } m_caster->SendMessageToSet(&data, true); @@ -3408,7 +3408,7 @@ void Spell::EffectDispel(uint32 i) WorldPacket data(SMSG_DISPEL_FAILED, 8+8+4+4*fail_list.size()); data << uint64(m_caster->GetGUID()); // Caster GUID data << uint64(unitTarget->GetGUID()); // Victim GUID - data << uint32(m_spellInfo->Id); // Dispell spell id + data << uint32(m_spellInfo->Id); // dispel spell id for (std::list< uint32 >::iterator j = fail_list.begin(); j != fail_list.end(); ++j) data << uint32(*j); // Spell Id m_caster->SendMessageToSet(&data, true); @@ -6224,7 +6224,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i) { std::list < std::pair<uint32,uint64> > success_list; int32 list_size = steal_list.size(); - // Dispell N = damage buffs (or while exist buffs for dispel) + // dispel N = damage buffs (or while exist buffs for dispel) for (int32 count=0; count < damage && list_size > 0; ++count) { // Random select buff for dispel @@ -6253,7 +6253,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i) WorldPacket data(SMSG_SPELLSTEALLOG, 8+8+4+1+4+count*5); data.append(unitTarget->GetPackGUID()); // Victim GUID data.append(m_caster->GetPackGUID()); // Caster GUID - data << uint32(m_spellInfo->Id); // Dispell spell id + data << uint32(m_spellInfo->Id); // dispel spell id data << uint8(0); // not used data << uint32(count); // count for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index d1db3bf311c..9ea0c48b54e 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -485,7 +485,7 @@ bool IsPositiveSpell(uint32 spellId) SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId); if (!spellproto) return false; - // spells with atleast one negative effect are considered negative + // spells with at least one negative effect are considered negative // some self-applied spells have negative effects but in self casting case negative check ignored. for (int i = 0; i < 3; i++) if (!IsPositiveEffect(spellId, i)) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 9757648e8d2..7de9c54c6cb 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -428,7 +428,7 @@ inline Mechanics GetEffectMechanic(SpellEntry const* spellInfo, int32 effect) inline uint32 GetDispellMask(DispelType dispel) { - // If dispell all + // If dispel all if (dispel == DISPEL_ALL) return DISPEL_ALL_MASK; else diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 205e4e12ba2..0e766136696 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -68,7 +68,7 @@ bool Player::UpdateStats(Stats stat) case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); UpdateAllSpellCritChances(); - UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intelect currently + UpdateAttackPowerAndDamage(true); //SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, only intellect currently UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently break; @@ -384,7 +384,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl weapon_mindamage = lvl*0.85*att_speed; weapon_maxdamage = lvl*1.25*att_speed; } - else if(!IsUseEquipedWeapon(attType==BASE_ATTACK)) //check if player not in form but still can't use weapon (broken/etc) + else if(!IsUseEquippedWeapon(attType==BASE_ATTACK)) //check if player not in form but still can't use weapon (broken/etc) { weapon_mindamage = BASE_MINDAMAGE; weapon_maxdamage = BASE_MAXDAMAGE; diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp index e3c43223ee2..4a525cc0591 100644 --- a/src/game/TaxiHandler.cpp +++ b/src/game/TaxiHandler.cpp @@ -201,7 +201,7 @@ void WorldSession::HandleTaxiNextDestinationOpcode(WorldPacket& /*recv_data*/) // in taxi flight packet received in 2 case: // 1) end taxi path in far (multi-node) flight // 2) switch from one map to other in case multim-map taxi path - // we need proccess only (1) + // we need process only (1) uint32 curDest = GetPlayer()->m_taxi.GetTaxiDestination(); if(!curDest) return; diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index c85959b561f..94f12f5394a 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -132,11 +132,11 @@ void HostilReference::updateOnlineStatus() !getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT))) { Creature* creature = (Creature* ) getSourceUnit(); - online = getTarget()->isInAccessablePlaceFor(creature); + online = getTarget()->isInAccessiblePlaceFor(creature); if(!online) { if(creature->AI()->canReachByRangeAttack(getTarget())) - online = true; // not accessable but stays online + online = true; // not accessible but stays online } else accessible = true; @@ -155,7 +155,7 @@ void HostilReference::setOnlineOfflineState(bool pIsOnline) { iOnline = pIsOnline; if(!iOnline) - setAccessibleState(false); // if not online that not accessable as well + setAccessibleState(false); // if not online that not accessible as well fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_ONLINE_STATUS, this)); } } @@ -278,7 +278,7 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe Unit* target = currentRef->getTarget(); assert(target); // if the ref has status online the target must be there ! - // some units are prefered in comparison to others + // some units are preferred in comparison to others if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) || target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING) ) ) diff --git a/src/game/ThreatManager.h b/src/game/ThreatManager.h index 04d965630fd..1cecee3a4be 100644 --- a/src/game/ThreatManager.h +++ b/src/game/ThreatManager.h @@ -74,8 +74,8 @@ class TRINITY_DLL_SPEC HostilReference : public Reference<Unit, ThreatManager> bool isOnline() const { return iOnline; } // The Unit might be in water and the creature can not enter the water, but has range attack - // in this case online = true, but accessable = false - bool isAccessable() const { return iAccessible; } + // in this case online = true, but accessible = false + bool isAccessible() const { return iAccessible; } // used for temporary setting a threat and reducting it later again. // the threat modification is stored diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1c793cc71bf..d1a1c128744 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -387,10 +387,15 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uin WorldPacket data( SMSG_MONSTER_MOVE, (GetPackGUID().size()+4+4+4+4+1+4+4+4+pathSize*4*3) ); data.append(GetPackGUID()); - data << GetPositionX( ) - << GetPositionY( ) - << GetPositionZ( ); - data << GetOrientation( ); + data << GetPositionX(); + data << GetPositionY(); + data << GetPositionZ(); + + // unknown field - unrelated to orientation + // seems to increment about 1000 for every 1.7 seconds + // for now, we'll just use mstime + data << getMSTime(); + data << uint8( 0 ); data << uint32( MovementFlags ); data << uint32( traveltime ); @@ -868,7 +873,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa { if(getVictim()) { - // if have target and damage pVictim just call AI recation + // if have target and damage pVictim just call AI reaction if(pVictim != getVictim() && pVictim->GetTypeId()==TYPEID_UNIT && ((Creature*)pVictim)->AI()) ((Creature*)pVictim)->AI()->AttackedBy(this); } @@ -982,7 +987,7 @@ void Unit::CastStop(uint32 except_spellid) InterruptSpell(i,false); } -void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) +void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); @@ -992,10 +997,10 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte return; } - CastSpell(Victim,spellInfo,triggered,castItem,triggredByAura, originalCaster); + CastSpell(Victim,spellInfo,triggered,castItem,triggeredByAura, originalCaster); } -void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) +void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster) { assert(Victim); if(!spellInfo) @@ -1007,8 +1012,8 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I if (castItem) DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); - if(!originalCaster && triggredByAura) - originalCaster = triggredByAura->GetCasterGUID(); + if(!originalCaster && triggeredByAura) + originalCaster = triggeredByAura->GetCasterGUID(); Spell *spell = new Spell(this, spellInfo, triggered, originalCaster ); @@ -1016,10 +1021,10 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I targets.setUnitTarget( Victim ); targets.setDestination( Victim->GetPositionX(), Victim->GetPositionY(), Victim->GetPositionZ(), false); spell->m_CastItem = castItem; - spell->prepare(&targets, triggredByAura); + spell->prepare(&targets, triggeredByAura); } -void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) +void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); @@ -1029,10 +1034,10 @@ void Unit::CastCustomSpell(Unit* Victim,uint32 spellId, int32 const* bp0, int32 return; } - CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggredByAura, originalCaster); + CastCustomSpell(Victim,spellInfo,bp0,bp1,bp2,triggered,castItem,triggeredByAura, originalCaster); } -void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) +void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster) { if(!spellInfo) { @@ -1043,8 +1048,8 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const if (castItem) DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); - if(!originalCaster && triggredByAura) - originalCaster = triggredByAura->GetCasterGUID(); + if(!originalCaster && triggeredByAura) + originalCaster = triggeredByAura->GetCasterGUID(); Spell *spell = new Spell(this, spellInfo, triggered, originalCaster); @@ -1060,11 +1065,11 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const SpellCastTargets targets; targets.setUnitTarget( Victim ); spell->m_CastItem = castItem; - spell->prepare(&targets, triggredByAura); + spell->prepare(&targets, triggeredByAura); } // used for scripting -void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) +void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); @@ -1074,11 +1079,11 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, return; } - CastSpell(x, y, z,spellInfo,triggered,castItem,triggredByAura, originalCaster); + CastSpell(x, y, z,spellInfo,triggered,castItem,triggeredByAura, originalCaster); } // used for scripting -void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggredByAura, uint64 originalCaster) +void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, uint64 originalCaster) { if(!spellInfo) { @@ -1089,15 +1094,15 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo if (castItem) DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); - if(!originalCaster && triggredByAura) - originalCaster = triggredByAura->GetCasterGUID(); + if(!originalCaster && triggeredByAura) + originalCaster = triggeredByAura->GetCasterGUID(); Spell *spell = new Spell(this, spellInfo, triggered, originalCaster ); SpellCastTargets targets; targets.setDestination(x, y, z); spell->m_CastItem = castItem; - spell->prepare(&targets, triggredByAura); + spell->prepare(&targets, triggeredByAura); } void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *damage, CleanDamage *cleanDamage, bool *crit, bool isTriggeredSpell) @@ -1105,7 +1110,7 @@ void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *da // TODO this in only generic way, check for exceptions DEBUG_LOG("DealFlatDamage (BEFORE) >> DMG:%u", *damage); - // Per-damage calss calculation + // Per-damage class calculation switch (spellInfo->DmgClass) { // Melee and Ranged Spells @@ -1711,7 +1716,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe RemainingDamage -= currentAbsorb; } - // only split damage if not damaing yourself + // only split damage if not damaging yourself if(pVictim != this) { AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT); @@ -2191,7 +2196,7 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex else if (attType == OFF_ATTACK) hitInfo = HITINFO_LEFTSWING; else - return; // ignore ranaged case + return; // ignore ranged case uint32 extraAttacks = m_extraAttacks; @@ -2305,7 +2310,7 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt } else { - // parry can be avoided only by some abilites + // parry can be avoided only by some abilities parry_chance = pVictim->GetUnitParryChance(); // block might be bypassed by it as well block_chance = pVictim->GetUnitBlockChance(); @@ -2319,7 +2324,7 @@ MeleeHitOutcome Unit::RollPhysicalOutcomeAgainst (Unit const *pVictim, WeaponAtt // Increase from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL aura crit_chance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, spellInfo->SchoolMask); - if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents fpr speed + if( dodge_chance != 0.0f ) // if dodge chance is already 0, ignore talents for speed { AuraList const& mCanNotBeDodge = GetAurasByType(SPELL_AURA_IGNORE_COMBAT_RESULT); for(AuraList::const_iterator i = mCanNotBeDodge.begin(); i != mCanNotBeDodge.end(); ++i) @@ -2885,7 +2890,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool } // TODO need use this code for spell hit result calculation - // now code commented for compotability + // now code commented for computability switch (spell->DmgClass) { case SPELL_DAMAGE_CLASS_RANGED: @@ -3057,7 +3062,7 @@ float Unit::GetUnitBlockChance() const if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block) return GetFloatValue(PLAYER_BLOCK_PERCENTAGE); } - // is player but has no block ability or no not broken shield equiped + // is player but has no block ability or no not broken shield equipped return 0.0f; } else @@ -3138,7 +3143,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target) if(((Player*)this)->IsInFeralForm()) return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact - // weaon skill or (unarmed for base attack) + // weapon skill or (unarmed for base attack) uint32 skill = item ? item->GetSkill() : SKILL_UNARMED; // in PvP use full skill instead current skill value @@ -3456,7 +3461,7 @@ bool Unit::isInLine(Unit const* target, float distance) const return abs(sin(angle)) * distance < width; } -bool Unit::isInAccessablePlaceFor(Creature const* c) const +bool Unit::isInAccessiblePlaceFor(Creature const* c) const { if(IsInWater()) return c->canSwim(); @@ -3492,13 +3497,13 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const float Unit::GetTotalAuraMultiplier(AuraType auratype) const { - float multipler = 1.0f; + float multiplier = 1.0f; AuraList const& mTotalAuraList = GetAurasByType(auratype); for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) - multipler *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f; + multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f; - return multipler; + return multiplier; } int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const @@ -3541,16 +3546,16 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const { - float multipler = 1.0f; + float multiplier = 1.0f; AuraList const& mTotalAuraList = GetAurasByType(auratype); for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) { Modifier* mod = (*i)->GetModifier(); if (mod->m_miscvalue & misc_mask) - multipler *= (100.0f + mod->m_amount)/100.0f; + multiplier *= (100.0f + mod->m_amount)/100.0f; } - return multipler; + return multiplier; } int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const @@ -3599,16 +3604,16 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const { - float multipler = 1.0f; + float multiplier = 1.0f; AuraList const& mTotalAuraList = GetAurasByType(auratype); for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) { Modifier* mod = (*i)->GetModifier(); if (mod->m_miscvalue == misc_value) - multipler *= (100.0f + mod->m_amount)/100.0f; + multiplier *= (100.0f + mod->m_amount)/100.0f; } - return multipler; + return multiplier; } int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const @@ -3724,7 +3729,7 @@ bool Unit::AddAura(Aura *Aur) if (!RemoveNoStackAurasDueToAura(Aur)) { delete Aur; - return false; // couldnt remove conflicting aura with higher rank + return false; // couldn't remove conflicting aura with higher rank } } @@ -3866,7 +3871,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) for(int j = 0; j < 3; ++j) { // prevent remove dummy triggered spells at next effect aura add - switch(spellProto->Effect[j]) // main spell auras added added after triggred spell + switch(spellProto->Effect[j]) // main spell auras added added after triggered spell { case SPELL_EFFECT_DUMMY: switch(spellId) @@ -3879,7 +3884,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) if(is_triggered_by_spell) break; - // prevent remove form main spell by triggred passive spells + // prevent remove form main spell by triggered passive spells switch(i_spellProto->EffectApplyAuraName[j]) // main aura added before triggered spell { case SPELL_AURA_MOD_SHAPESHIFT: @@ -4048,7 +4053,7 @@ void Unit::RemoveAurasWithDispelType( DispelType type ) { // Create dispel mask by dispel type uint32 dispelMask = GetDispellMask(type); - // Dispel all existing auras vs current dispell type + // Dispel all existing auras vs current dispel type AuraMap& auras = GetAuras(); for(AuraMap::iterator itr = auras.begin(); itr != auras.end(); ) { @@ -4481,7 +4486,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic sLog.outDebug("ProcDamageAndSpell: invoked due to spell id %u %s", procSpell->Id, (isTriggeredSpell?"(triggered)":"")); // Assign melee/ranged proc flags for magic attacks, that are actually melee/ranged abilities - // not assign for spell proc triggered spell to prevent infinity (or unexpacted 2-3 times) melee damage spell proc call with melee damage effect + // not assign for spell proc triggered spell to prevent infinity (or unexpected 2-3 times) melee damage spell proc call with melee damage effect // That is the question though if it's fully correct if(procSpell && !isTriggeredSpell) { @@ -4508,7 +4513,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic // Not much to do if no flags are set. if (procAttacker) { - // procces auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set + // processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcEffectAuraTypes,attType, procSpell, damage, damageSchoolMask); ProcDamageAndSpellFor(false,pVictim,procAttacker,attackerProcCastAuraTypes,attType, procSpell, damage, damageSchoolMask); } @@ -4517,7 +4522,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic // Not much to do if no flags are set or there is no victim if(pVictim && pVictim->isAlive() && procVictim) { - // procces auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set + // processing auras that not generate casts at proc event before auras that generate casts to prevent proc aura added at prev. proc aura execute in set pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcEffectAuraTypes,attType,procSpell, damage, damageSchoolMask); pVictim->ProcDamageAndSpellFor(true,this,procVictim,victimProcCastAuraTypes,attType,procSpell, damage, damageSchoolMask); } @@ -4706,7 +4711,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint case 18765: case 35429: { - // prevent chain of triggred spell from same triggred spell + // prevent chain of triggered spell from same triggered spell if(procSpell && procSpell->Id==26654) return false; @@ -5728,7 +5733,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint return false; uint32 spellId = 0; - // Every Lightning Bolt and Chain Lightning spell have dublicate vs half damage and zero cost + // Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost switch (procSpell->Id) { // Lightning Bolt @@ -5771,7 +5776,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, SpellEntry const *dummySpell, uint if (procSpell->SpellFamilyFlags & 0x0000000000000002LL) ((Player*)this)->RemoveSpellCooldown(spellId); - // Hmmm.. in most case spells alredy set half basepoints but... + // Hmmm.. in most case spells already set half basepoints but... // Lightning Bolt (2-10 rank) have full basepoint and half bonus from level // As on wiki: // BUG: Rank 2 to 10 (and maybe 11) of Lightning Bolt will proc another Bolt with FULL damage (not halved). This bug is known and will probably be fixed soon. @@ -5989,7 +5994,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB if( pVictim == this ) return false; - // custom chnace + // custom chance float chance = 0; switch (triggeredByAura->GetId()) { @@ -7053,7 +7058,7 @@ void Unit::RemoveAllAttackers() AttackerSet::iterator iter = m_attackers.begin(); if(!(*iter)->AttackStop()) { - sLog.outError("WORLD: Unit has an attacker that isnt attacking it!"); + sLog.outError("WORLD: Unit has an attacker that isn't attacking it!"); m_attackers.erase(iter); } } @@ -8374,7 +8379,7 @@ void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType ty float Unit::GetWeaponProcChance() const { // normalized proc chance for weapon attack speed - // (odd formulae...) + // (odd formula...) if(isAttackReady(BASE_ATTACK)) return (GetAttackTime(BASE_ATTACK) * 1.8f / 1000.0f); else if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK)) @@ -9063,7 +9068,7 @@ bool Unit::SelectHostilTarget() assert(GetTypeId()== TYPEID_UNIT); Unit* target = NULL; - //This function only useful once AI has been initilazied + //This function only useful once AI has been initialized if (!((Creature*)this)->AI()) return false; @@ -9095,7 +9100,7 @@ bool Unit::SelectHostilTarget() { for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr) { - if( (*itr)->IsInMap(this) && canAttack(*itr) && (*itr)->isInAccessablePlaceFor((Creature*)this) ) + if( (*itr)->IsInMap(this) && canAttack(*itr) && (*itr)->isInAccessiblePlaceFor((Creature*)this) ) return false; } } @@ -9337,7 +9342,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f { if(unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END) { - sLog.outError("ERROR in HandleStatModifier(): nonexisted UnitMods or wrong UnitModifierType!"); + sLog.outError("ERROR in HandleStatModifier(): non existed UnitMods or wrong UnitModifierType!"); return false; } @@ -9407,7 +9412,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co { if( unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END) { - sLog.outError("ERROR: trial to access nonexisted modifier value from UnitMods!"); + sLog.outError("ERROR: trial to access non existed modifier value from UnitMods!"); return 0.0f; } @@ -9437,7 +9442,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const { if(unitMod >= UNIT_MOD_END) { - sLog.outError("ERROR: trial to access nonexisted UnitMods in GetTotalAuraModValue()!"); + sLog.outError("ERROR: trial to access non existed UnitMods in GetTotalAuraModValue()!"); return 0.0f; } @@ -9737,7 +9742,7 @@ void Unit::CleanupsBeforeDelete() if(m_uint32Values) // only for fully created object { InterruptNonMeleeSpells(true); - m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted ans will deleated at call in Map::RemoveAllObjectsInRemoveList + m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList CombatStop(); ClearComboPointHolders(); DeleteThreatList(); @@ -10047,7 +10052,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag if(!found) { sLog.outError("Spell aura %u (id:%u effect:%u) has been deleted before call spell proc event handler",*aur,i->triggeredByAura_SpellPair.first,i->triggeredByAura_SpellPair.second); - sLog.outError("It can be deleted one from early proccesed auras:"); + sLog.outError("It can be deleted one from early processed auras:"); for(ProcTriggeredList::iterator i2 = procTriggered.begin(); i != i2; ++i2) sLog.outError(" Spell aura %u (id:%u effect:%u)",*aur,i2->triggeredByAura_SpellPair.first,i2->triggeredByAura_SpellPair.second); sLog.outError(" <end of list>"); @@ -10297,7 +10302,7 @@ void Unit::StopMoving() clearUnitState(UNIT_STAT_MOVING); // send explicit stop packet - // rely on vmaps here because for exemple stormwind is in air + // rely on vmaps here because for example stormwind is in air float z = MapManager::Instance().GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); //if (fabs(GetPositionZ() - z) < 2.0f) // Relocate(GetPositionX(), GetPositionY(), z); diff --git a/src/game/Unit.h b/src/game/Unit.h index 94951593f2b..6f58e8655c4 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -213,7 +213,7 @@ enum HitInfo HITINFO_LEFTSWING = 0x00000004, HITINFO_MISS = 0x00000010, HITINFO_ABSORB = 0x00000020, // plays absorb sound - HITINFO_RESIST = 0x00000040, // resisted atleast some damage + HITINFO_RESIST = 0x00000040, // resisted at least some damage HITINFO_CRITICALHIT = 0x00000080, HITINFO_UNK2 = 0x00000100, // wotlk? HITINFO_UNK3 = 0x00002000, // wotlk? @@ -927,17 +927,17 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool canAttack(Unit const* target) const; virtual bool IsInWater() const; virtual bool IsUnderWater() const; - bool isInAccessablePlaceFor(Creature const* c) const; + bool isInAccessiblePlaceFor(Creature const* c) const; void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false); void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype, bool critical = false); uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true); - void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); - void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); - void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); - void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); - void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); - void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggredByAura = NULL, uint64 originalCaster = 0); + void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); + void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); + void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); + void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); + void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); + void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const; @@ -1362,10 +1362,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject //void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*) void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask ); - bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); - bool HandleProcTriggerSpell(Unit *pVictim,uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attType,uint32 cooldown); - bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); - bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell,uint32 cooldown); + bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); + bool HandleProcTriggerSpell(Unit *pVictim,uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags,WeaponAttackType attType,uint32 cooldown); + bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); + bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell,uint32 cooldown); uint32 m_state; // Even derived shouldn't modify uint32 m_CombatTimer; diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index b2233012070..ef3a8a04ef3 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -153,7 +153,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint32 &di // Only one text is set if( !behavior->text[1].empty() ) { - // Select one from max 5 texts (0 and 1 laready checked) + // Select one from max 5 texts (0 and 1 already checked) int i = 2; for( ; i < 5; ++i ) if( behavior->text[i].empty() ) diff --git a/src/game/World.cpp b/src/game/World.cpp index b599e617f04..ab7b6fe04fa 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -720,7 +720,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2; } - m_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY] = sConfig.GetBoolDefault("SaveRespawnTimeImmediately",true); + m_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfig.GetBoolDefault("SaveRespawnTimeImmediately",true); m_configs[CONFIG_WEATHER] = sConfig.GetBoolDefault("ActivateWeather",true); if(reload) @@ -2455,7 +2455,7 @@ void World::ShutdownCancel() m_ShutdownTimer = 0; SendServerMessage(msgid); - DEBUG_LOG("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); + DEBUG_LOG("Server %s canceled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); } /// Send a server message to the user(s) diff --git a/src/game/World.h b/src/game/World.h index b42a4d61394..c1ceb6891a5 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -132,7 +132,7 @@ enum WorldConfigs CONFIG_SKILL_GAIN_GATHERING, CONFIG_SKILL_GAIN_WEAPON, CONFIG_MAX_OVERSPEED_PINGS, - CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY, + CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY, CONFIG_WEATHER, CONFIG_EXPANSION, CONFIG_CHATFLOOD_MESSAGE_COUNT, diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 8ac04561733..69f1598d743 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -485,7 +485,7 @@ void WorldSession::Handle_NULL( WorldPacket& recvPacket ) void WorldSession::Handle_EarlyProccess( WorldPacket& recvPacket ) { - sLog.outError( "SESSION: received opcode %s (0x%.4X) that must be proccessed in WorldSocket::OnRead", + sLog.outError( "SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode()); } diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 620c2116c30..56d5e3d86b3 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -263,7 +263,7 @@ int WorldSocket::handle_input (ACE_HANDLE) if ((errno == EWOULDBLOCK) || (errno == EAGAIN)) { - return Update (); // interesting line ,isnt it ? + return Update (); // interesting line ,isn't it ? } DEBUG_LOG ("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); @@ -469,7 +469,7 @@ int WorldSocket::handle_input_missing_data (void) if (m_Header.space () > 0) { - //couldnt recieve the whole header this time + //couldn't recieve the whole header this time ACE_ASSERT (message_block.length () == 0); errno = EWOULDBLOCK; return -1; @@ -503,7 +503,7 @@ int WorldSocket::handle_input_missing_data (void) if (m_RecvPct.space () > 0) { - //couldnt recieve the whole data this time + //couldn't recieve the whole data this time ACE_ASSERT (message_block.length () == 0); errno = EWOULDBLOCK; return -1; diff --git a/src/game/WorldSocketMgr.cpp b/src/game/WorldSocketMgr.cpp index 36203e8fb01..a11960f33f5 100644 --- a/src/game/WorldSocketMgr.cpp +++ b/src/game/WorldSocketMgr.cpp @@ -165,7 +165,7 @@ protected: while (!m_Reactor->reactor_event_loop_done ()) { - // dont be too smart to move this outside the loop + // Don't be too smart to move this outside the loop // the run_reactor_event_loop will modify interval ACE_Time_Value interval (0, 10000); diff --git a/src/shared/Database/DBCStores.cpp b/src/shared/Database/DBCStores.cpp index 2f4c6464b23..020cd53e61d 100644 --- a/src/shared/Database/DBCStores.cpp +++ b/src/shared/Database/DBCStores.cpp @@ -329,7 +329,7 @@ void LoadDBCStores(std::string dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTalentTabStore, dbcPath,"TalentTab.dbc"); - // preper fast data access to bit pos of talent ranks for use at inspecting + // prepare fast data access to bit pos of talent ranks for use at inspecting { // fill table by amount of talent ranks and fill sTalentTabBitSizeInInspect // store in with (row,col,talent)->size key for correct sorting by (row,col) |