Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/AI/CoreAI/TotemAI.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Handlers/ItemHandler.cpp
	src/server/game/Spells/Spell.cpp
	src/server/game/Spells/SpellEffects.cpp
	src/server/scripts/Spells/spell_shaman.cpp
	src/server/scripts/Spells/spell_warlock.cpp
This commit is contained in:
Vincent-Michael
2013-07-23 02:03:35 +02:00
27 changed files with 241 additions and 264 deletions

View File

@@ -259,7 +259,7 @@ public:
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
player = handler->GetSession()->GetPlayer();
else
player = (Player*)unit;
player = unit->ToPlayer();
if (!unit)
unit = player;

View File

@@ -90,8 +90,9 @@ public:
}
// check online security
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity((Player*)target, 0))
return false;
if (Player* player = target->ToPlayer())
if (handler->HasLowerSecurity(player, 0))
return false;
handler->GetSession()->GetPlayer()->RewardHonor(target, 1);
return true;

View File

@@ -654,11 +654,9 @@ public:
return false;
}
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (handler->HasLowerSecurity((Player*)target, 0, false))
if (Player* player = target->ToPlayer())
if (handler->HasLowerSecurity(player, 0, false))
return false;
}
if (target->IsAlive())
{
@@ -2226,11 +2224,9 @@ public:
return false;
}
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (handler->HasLowerSecurity((Player*)target, 0, false))
if (Player* player = target->ToPlayer())
if (handler->HasLowerSecurity(player, 0, false))
return false;
}
if (!target->IsAlive())
return true;

View File

@@ -1025,11 +1025,15 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
// can't use other spell than will of the necropolis due to spell_ranks dependency
if (sSpellMgr->GetFirstSpellInChain(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id))
SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1);
if (!firstRankSpellInfo)
return false;
uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id);
// can't use other spell than will of the necropolis due to spell_ranks dependency
if (!spellInfo->IsRankOf(firstRankSpellInfo))
return false;
uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank, true))
return false;
@@ -1053,7 +1057,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
// min pct of hp is stored in effect 0 of talent spell
uint32 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
uint8 rank = GetSpellInfo()->GetRank();
SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());

View File

@@ -636,16 +636,17 @@ class spell_pal_holy_shock : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_holy_shock_SpellScript);
bool Validate(SpellInfo const* spell) OVERRIDE
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1))
SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1);
if (!firstRankSpellInfo)
return false;
// can't use other spell than holy shock due to spell_ranks dependency
if (sSpellMgr->GetFirstSpellInChain(SPELL_PALADIN_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
if (!spellInfo->IsRankOf(firstRankSpellInfo))
return false;
uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true))
return false;
@@ -657,11 +658,11 @@ class spell_pal_holy_shock : public SpellScriptLoader
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
{
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
uint8 rank = GetSpellInfo()->GetRank();
if (caster->IsFriendlyTo(unitTarget))
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true, 0);
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true);
else
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true);
}
}

View File

@@ -589,13 +589,15 @@ class spell_pri_penance : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1))
return false;
// can't use other spell than this penance due to spell_ranks dependency
if (sSpellMgr->GetFirstSpellInChain(SPELL_PRIEST_PENANCE_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id))
SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PRIEST_PENANCE_R1);
if (!firstRankSpellInfo)
return false;
uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id);
// can't use other spell than this penance due to spell_ranks dependency
if (!spellInfo->IsRankOf(firstRankSpellInfo))
return false;
uint8 rank = spellInfo->GetRank();
if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank, true))
return false;
if (!sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank, true))
@@ -612,12 +614,12 @@ class spell_pri_penance : public SpellScriptLoader
if (!unitTarget->IsAlive())
return;
uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
uint8 rank = GetSpellInfo()->GetRank();
if (caster->IsFriendlyTo(unitTarget))
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false, 0);
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_HEAL, rank), false);
else
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false, 0);
caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PRIEST_PENANCE_R1_DAMAGE, rank), false);
}
}

View File

@@ -508,7 +508,8 @@ class spell_sha_flame_shock : public SpellScriptLoader
// Lava Flows
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
{
if (sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
SpellInfo const* firstRankSpellInfo = sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1);
if (!aurEff->GetSpellInfo()->IsRankOf(firstRankSpellInfo))
return;
int32 basepoints = aurEff->GetAmount();

View File

@@ -236,7 +236,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
// apply percent damage mods
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
ApplyPct(damage, 16 * GetSpellInfo()->GetRank());
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
@@ -440,8 +440,9 @@ class spell_warr_last_stand : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 healthModSpellBasePoints0 = int32(GetCaster()->CountPctFromMaxHealth(GetEffectValue()));
GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
Unit* caster = GetCaster();
int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
}
void Register() OVERRIDE