*Fix diminishing returns for spells casted on a pet.

--HG--
branch : trunk
This commit is contained in:
QAston committed 2009-02-13 18:43:17 +01:00
1 parent 0421212873
commit edcb8840c3
2 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -10659,13 +10659,13 @@ void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Un
if(duration == -1 || group == DIMINISHING_NONE || caster->IsFriendlyTo(this) )
return;
// test pet/charm masters instead pets/charmeds
Unit const* targetOwner = GetCharmerOrOwner();
Unit const* casterOwner = caster->GetCharmerOrOwner();
// Duration of crowd control abilities on pvp target is limited by 10 sec. (2.2.0)
if(duration > 10000 && IsDiminishingReturnsGroupDurationLimited(group))
{
// test pet/charm masters instead pets/charmeds
Unit const* targetOwner = GetCharmerOrOwner();
Unit const* casterOwner = caster->GetCharmerOrOwner();
Unit const* target = targetOwner ? targetOwner : this;
Unit const* source = casterOwner ? casterOwner : caster;
@@ -10676,7 +10676,7 @@ void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Un
float mod = 1.0f;
// Some diminishings applies to mobs too (for example, Stun)
if((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && GetTypeId() == TYPEID_PLAYER) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL)
if((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && (targetOwner ? targetOwner->GetTypeId():GetTypeId()) == TYPEID_PLAYER) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL)
{
DiminishingLevels diminish = Level;
switch(diminish)