aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-06 14:01:44 -0600
committermegamage <none@none>2008-12-06 14:01:44 -0600
commitc5593ef779a4ba7bbe9df391bc0defd3bf6c33a1 (patch)
treeae0cb37bc8f5de0d33bddae95747d7d2162cd8ce /src/game/Unit.cpp
parent72edfea129c244cde9a18b3227f775250197ec99 (diff)
*Update to Mangos 6880. Source: Mangos.
*Skip 6878, 6871. *Main change: change cell size, add is3dDistance for IsWithinDistInMap and isVisibleForOrDetect. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 36ba1af2e3c..e397b767adf 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6499,17 +6499,14 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
{
int32 value2 = CalculateSpellDamage((*i)->GetSpellProto(),2,(*i)->GetSpellProto()->EffectBasePoints[2],this);
basepoints0 = value2 * GetMaxPower(POWER_MANA) / 100;
-
// Drain Soul
- triggered_spell_id = 18371;
- target = this;
- found = true;
+ CastCustomSpell(this, 18371, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
break;
}
}
- if(!found)
- return false;
- break; // fall through to normal cast
+ // Not remove charge (aura removed on death in any cases)
+ // Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura
+ return false;
}
break;
}
@@ -9217,7 +9214,9 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
if(itr->type == spellInfo->Dispel)
return true;
- if( !(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) && (spellInfo->Id != 42292)) // unaffected by school immunity
+ if( !(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) && // unaffected by school immunity
+ !(spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) // can remove immune (by dispell or immune it)
+ && (spellInfo->Id != 42292))
{
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for(SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
@@ -9776,14 +9775,15 @@ int32 Unit::ModifyPower(Powers power, int32 dVal)
return gain;
}
-bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList) const
+bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const
{
if(!u)
return false;
- return u->canSeeOrDetect(this, detect, inVisibleList);
+
+ return u->canSeeOrDetect(this, detect, inVisibleList, is3dDistance);
}
-bool Unit::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) const
+bool Unit::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool is3dDistance) const
{
return true;
}
@@ -10510,7 +10510,7 @@ Unit* Unit::GetUnit(WorldObject& object, uint64 guid)
bool Unit::isVisibleForInState( Player const* u, bool inVisibleList ) const
{
- return isVisibleForOrDetect(u,false,inVisibleList);
+ return isVisibleForOrDetect(u, false, inVisibleList, false);
}
uint32 Unit::GetCreatureType() const
@@ -12055,6 +12055,10 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply )
uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectType damagetype, uint32 CastingTime )
{
+ // Not apply this to creature casted spells with casttime==0
+ if(CastingTime==0 && GetTypeId()==TYPEID_UNIT && !((Creature*)this)->isPet())
+ return 3500;
+
if (CastingTime > 7000) CastingTime = 7000;
if (CastingTime < 1500) CastingTime = 1500;