aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/authserver/Server/AuthSocket.cpp8
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp3
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp60
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp6
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp5
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp98
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp4
8 files changed, 111 insertions, 75 deletions
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index 67d3975815f..8a2a6c67496 100644
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -321,9 +321,7 @@ bool AuthSocket::_HandleLogonChallenge()
socket().recv((char *)&buf[0], 4);
-#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
EndianConvert(*((uint16*)(buf[0])));
-#endif
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got header, body is %#04x bytes", remaining);
@@ -343,7 +341,6 @@ bool AuthSocket::_HandleLogonChallenge()
// BigEndian code, nop in little endian case
// size already converted
-#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
EndianConvert(*((uint32*)(&ch->gamename[0])));
EndianConvert(ch->build);
EndianConvert(*((uint32*)(&ch->platform[0])));
@@ -351,7 +348,6 @@ bool AuthSocket::_HandleLogonChallenge()
EndianConvert(*((uint32*)(&ch->country[0])));
EndianConvert(ch->timezone_bias);
EndianConvert(ch->ip);
-#endif
ByteBuffer pkt;
@@ -397,7 +393,7 @@ bool AuthSocket::_HandleLogonChallenge()
bool locked = false;
if (fields[2].GetUInt8() == 1) // if ip is locked
{
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString());
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[4].GetCString());
TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Player address is '%s'", ip_address.c_str());
if (strcmp(fields[4].GetCString(), ip_address.c_str()) != 0)
@@ -783,9 +779,7 @@ bool AuthSocket::_HandleReconnectChallenge()
socket().recv((char *)&buf[0], 4);
-#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
EndianConvert(*((uint16*)(buf[0])));
-#endif
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] got header, body is %#04x bytes", remaining);
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index d8c310aa055..01bdf63d464 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -2211,7 +2211,7 @@ void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /*
*ori = GetOrientation();
}
-float GameObject::GetInteractionDistance()
+float GameObject::GetInteractionDistance() const
{
switch (GetGoType())
{
@@ -2221,6 +2221,7 @@ float GameObject::GetInteractionDistance()
case GAMEOBJECT_TYPE_MAILBOX:
return 10.0f;
case GAMEOBJECT_TYPE_FISHINGHOLE:
+ case GAMEOBJECT_TYPE_FISHINGNODE:
return 20.0f + CONTACT_DISTANCE; // max spell range
default:
return INTERACTION_DISTANCE;
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index aade937cc6d..8f32f5fe080 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -831,7 +831,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
float GetStationaryZ() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); }
float GetStationaryO() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); }
- float GetInteractionDistance();
+ float GetInteractionDistance() const;
protected:
bool AIM_Initialize();
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 39448358d03..f152e4f5976 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -3800,65 +3800,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
}
break;
}
- case SPELLFAMILY_PALADIN:
- {
- // Judgement (seal trigger)
- if (m_spellInfo->GetCategory() == SPELLCATEGORY_JUDGEMENT)
- {
- if (!unitTarget || !unitTarget->IsAlive())
- return;
- uint32 spellId1 = 0;
- uint32 spellId2 = 0;
-
- // Judgement self add switch
- switch (m_spellInfo->Id)
- {
- case 53407: spellId1 = 20184; break; // Judgement of Justice
- case 20271: // Judgement of Light
- case 57774: spellId1 = 20185; break; // Judgement of Light
- case 53408: spellId1 = 20186; break; // Judgement of Wisdom
- default:
- TC_LOG_ERROR("spells", "Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id);
- return;
- }
- // all seals have aura dummy in 2 effect
- Unit::AuraApplicationMap & sealAuras = m_caster->GetAppliedAuras();
- for (Unit::AuraApplicationMap::iterator iter = sealAuras.begin(); iter != sealAuras.end();)
- {
- Aura* aura = iter->second->GetBase();
- if (aura->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL)
- {
- if (AuraEffect* aureff = aura->GetEffect(2))
- if (aureff->GetAuraType() == SPELL_AURA_DUMMY)
- {
- if (sSpellMgr->GetSpellInfo(aureff->GetAmount()))
- spellId2 = aureff->GetAmount();
- break;
- }
- if (!spellId2)
- {
- switch (iter->first)
- {
- // Seal of light, Seal of wisdom, Seal of justice
- case 20165:
- case 20166:
- case 20164:
- spellId2 = 54158;
- }
- }
- break;
- }
- else
- ++iter;
- }
- if (spellId1)
- m_caster->CastSpell(unitTarget, spellId1, true);
- if (spellId2)
- m_caster->CastSpell(unitTarget, spellId2, true);
- return;
- }
- break;
- }
case SPELLFAMILY_DEATHKNIGHT:
{
// Pestilence
@@ -5518,6 +5459,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id);
if (!summon)
return;
+
if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
((Guardian*)summon)->InitStatsForLevel(level);
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 575c2fe2860..54f4aa8b32e 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -1181,7 +1181,7 @@ class spell_dru_wild_growth : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
- if (spellInfo->Effects[EFFECT_2].IsEffect() || !spellInfo->Effects[EFFECT_2].CalcValue())
+ if (spellInfo->Effects[EFFECT_2].IsEffect() || spellInfo->Effects[EFFECT_2].CalcValue() <= 0)
return false;
return true;
}
@@ -1190,9 +1190,9 @@ class spell_dru_wild_growth : public SpellScriptLoader
{
targets.remove_if(RaidCheck(GetCaster()));
- int32 const maxTargets = GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster());
+ uint32 const maxTargets = uint32(GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster()));
- if (targets.size() > uint32(maxTargets))
+ if (targets.size() > maxTargets)
{
targets.sort(Trinity::HealthPctOrderPred());
targets.resize(maxTargets);
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index e066c8eb008..07d95aa63f5 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -290,7 +290,7 @@ enum PilgrimsBountyBuffFood
class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
{
private:
- uint32 _triggeredSpellId;
+ uint32 const _triggeredSpellId;
public:
spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
@@ -298,7 +298,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
{
PrepareAuraScript(spell_pilgrims_bounty_buff_food_AuraScript)
private:
- uint32 _triggeredSpellId;
+ uint32 const _triggeredSpellId;
public:
spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
@@ -311,6 +311,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
{
+ PreventDefaultAction();
if (_handled)
return;
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index f548255e554..23efbf3b514 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -56,6 +56,10 @@ enum PaladinSpells
SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA = 63510,
SPELL_PALADIN_IMPROVED_DEVOTION_AURA = 63514,
SPELL_PALADIN_ITEM_HEALING_TRANCE = 37706,
+ SPELL_PALADIN_JUDGEMENT_DAMAGE = 54158,
+ SPELL_PALADIN_JUDGEMENT_OF_JUSTICE = 20184,
+ SPELL_PALADIN_JUDGEMENT_OF_LIGHT = 20185,
+ SPELL_PALADIN_JUDGEMENT_OF_WISDOM = 20186,
SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790,
SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA = 63531,
SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 = 31869,
@@ -826,6 +830,96 @@ class spell_pal_item_healing_discount : public SpellScriptLoader
}
};
+// 53407 - Judgement of Justice
+// 20271 - Judgement of Light
+// 53408 - Judgement of Wisdom
+class spell_pal_judgement : public SpellScriptLoader
+{
+ public:
+ spell_pal_judgement(char const* scriptName, uint32 spellId) : SpellScriptLoader(scriptName), _spellId(spellId) { }
+
+ class spell_pal_judgement_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_judgement_SpellScript);
+
+ public:
+ spell_pal_judgement_SpellScript(uint32 spellId) : SpellScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_JUDGEMENT_DAMAGE)
+ || !sSpellMgr->GetSpellInfo(_spellId))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ uint32 spellId2 = SPELL_PALADIN_JUDGEMENT_DAMAGE;
+
+ // some seals have SPELL_AURA_DUMMY in EFFECT_2
+ Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
+ for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
+ {
+ if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
+ if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
+ {
+ spellId2 = (*i)->GetAmount();
+ break;
+ }
+ }
+
+ GetCaster()->CastSpell(GetHitUnit(), _spellId, true);
+ GetCaster()->CastSpell(GetHitUnit(), spellId2, true);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+
+ private:
+ uint32 const _spellId;
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pal_judgement_SpellScript(_spellId);
+ }
+
+ private:
+ uint32 const _spellId;
+};
+
+// 20425 - Judgement of Command
+class spell_pal_judgement_of_command : public SpellScriptLoader
+{
+ public:
+ spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { }
+
+ class spell_pal_judgement_of_command_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_judgement_of_command_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* unitTarget = GetHitUnit())
+ if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
+ GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_pal_judgement_of_command_SpellScript();
+ }
+};
+
// 633 - Lay on Hands
class spell_pal_lay_on_hands : public SpellScriptLoader
{
@@ -1114,6 +1208,10 @@ void AddSC_paladin_spell_scripts()
new spell_pal_improved_aura_effect("spell_pal_improved_devotion_aura_effect");
new spell_pal_improved_aura_effect("spell_pal_sanctified_retribution_effect");
new spell_pal_item_healing_discount();
+ new spell_pal_judgement("spell_pal_judgement_of_justice", SPELL_PALADIN_JUDGEMENT_OF_JUSTICE);
+ new spell_pal_judgement("spell_pal_judgement_of_light", SPELL_PALADIN_JUDGEMENT_OF_LIGHT);
+ new spell_pal_judgement("spell_pal_judgement_of_wisdom", SPELL_PALADIN_JUDGEMENT_OF_WISDOM);
+ new spell_pal_judgement_of_command();
new spell_pal_lay_on_hands();
new spell_pal_righteous_defense();
new spell_pal_sacred_shield();
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 678ad54955a..c92f9e30ac5 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -79,7 +79,7 @@ enum MiscSpells
class PowerCheck
{
public:
- explicit PowerCheck(Powers power) : _power(power) { }
+ explicit PowerCheck(Powers const power) : _power(power) { }
bool operator()(WorldObject* obj) const
{
@@ -90,7 +90,7 @@ class PowerCheck
}
private:
- Powers _power;
+ Powers const _power;
};
class RaidCheck