aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-21 22:48:52 -0600
committermegamage <none@none>2009-03-21 22:48:52 -0600
commit3c5a24f4cda9943482f9c325123d6532bfe9afb3 (patch)
treebda5e0fa286917c0180e84737744ac7f448e4a78 /src
parentb522a34247b1a5c30d918c2f0debca74b1ff4cf9 (diff)
[7516] Add form/mounting/self control loss limitations to 48505 and ranks. Author: Sarjuuk
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp5
-rw-r--r--src/game/SpellEffects.cpp14
2 files changed, 17 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 6133026222d..367baf29d6a 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -6111,9 +6111,12 @@ bool Player::SetOneFactionReputation(FactionEntry const* factionEntry, int32 sta
//Calculate total reputation percent player gain with quest/creature level
int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, bool for_quest)
{
+ // for grey creature kill received 20%, in other case 100.
+ int32 percent = (!for_quest && (creatureOrQuestLevel <= MaNGOS::XP::GetGrayLevel(getLevel()))) ? 20 : 100;
+
int32 repMod = GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN);
- int32 percent = rep > 0 ? repMod : -repMod;
+ percent += rep > 0 ? repMod : -repMod;
if(percent <=0)
return 0;
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 1d92b6aa6ec..66cc9f56d3e 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1504,7 +1504,19 @@ void Spell::EffectDummy(uint32 i)
// Starfall
if (m_spellInfo->SpellFamilyFlags[2] & 0x100)
{
- m_caster->CastSpell(unitTarget, damage, true, NULL);
+ //Shapeshifting into an animal form or mounting cancels the effect.
+ if(m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted())
+ {
+ if(m_triggeredByAuraSpell)
+ m_caster->RemoveAurasDueToSpell(m_triggeredByAuraSpell->Id);
+ return;
+ }
+
+ //Any effect which causes you to lose control of your character will supress the starfall effect.
+ if(m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
+ return;
+
+ m_caster->CastSpell(unitTarget, damage, true);
return;
}
break;