*Correct target requirement for eyes of the beast and add some crash preventing checks to charm code.
--HG-- branch : trunk
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
DELETE FROM `spell_proc_event` WHERE `entry` IN (49223, 49599);
|
DELETE FROM `spell_proc_event` WHERE `entry` IN (49223, 49599,49188 , 56822, 59057, 55666, 55667, 55668, 55669, 55670, 58616);
|
||||||
INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
|
INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
|
||||||
( 49223, 0x00, 15, 0x00000011, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dirge
|
( 49223, 0x00, 15, 0x00000011, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dirge
|
||||||
( 49599, 0x00, 15, 0x00000011, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dirge
|
( 49599, 0x00, 15, 0x00000011, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Dirge
|
||||||
|
|||||||
+14
-9
@@ -4998,17 +4998,22 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||||||
return SPELL_FAILED_ALREADY_HAVE_CHARM;
|
return SPELL_FAILED_ALREADY_HAVE_CHARM;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit *target = m_targets.getUnitTarget();
|
// Skip TARGET_UNIT_PET - pet is always valid
|
||||||
if(!target || target->GetTypeId() == TYPEID_UNIT
|
if (m_spellInfo->EffectImplicitTargetA[i] != TARGET_UNIT_PET
|
||||||
&& ((Creature*)target)->isVehicle())
|
&& m_spellInfo->EffectImplicitTargetB[i] != TARGET_UNIT_PET)
|
||||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
{
|
||||||
|
Unit *target = m_targets.getUnitTarget();
|
||||||
|
if(!target || target->GetTypeId() == TYPEID_UNIT
|
||||||
|
&& ((Creature*)target)->isVehicle())
|
||||||
|
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||||
|
|
||||||
if(target->GetCharmerGUID())
|
if(target->GetCharmerGUID())
|
||||||
return SPELL_FAILED_CHARMED;
|
return SPELL_FAILED_CHARMED;
|
||||||
|
|
||||||
int32 damage = CalculateDamage(i, target);
|
int32 damage = CalculateDamage(i, target);
|
||||||
if(damage && int32(target->getLevel()) > damage)
|
if(damage && int32(target->getLevel()) > damage)
|
||||||
return SPELL_FAILED_HIGHLEVEL;
|
return SPELL_FAILED_HIGHLEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-1
@@ -14033,6 +14033,10 @@ void Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
|||||||
if(GetTypeId() == TYPEID_PLAYER && ((Player*)this)->GetTransport())
|
if(GetTypeId() == TYPEID_PLAYER && ((Player*)this)->GetTransport())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Already charmed
|
||||||
|
if(GetCharmerGUID())
|
||||||
|
return;
|
||||||
|
|
||||||
CastStop();
|
CastStop();
|
||||||
CombatStop(); //TODO: CombatStop(true) may cause crash (interrupt spells)
|
CombatStop(); //TODO: CombatStop(true) may cause crash (interrupt spells)
|
||||||
DeleteThreatList();
|
DeleteThreatList();
|
||||||
@@ -14122,7 +14126,7 @@ void Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
|||||||
case CHARM_TYPE_CONVERT:
|
case CHARM_TYPE_CONVERT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::RemoveCharmedBy(Unit *charmer)
|
void Unit::RemoveCharmedBy(Unit *charmer)
|
||||||
@@ -14130,6 +14134,10 @@ void Unit::RemoveCharmedBy(Unit *charmer)
|
|||||||
if(!isCharmed())
|
if(!isCharmed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Charm was not set for unit - return
|
||||||
|
if (charmer && charmer->m_Controlled.find(this) == charmer->m_Controlled.end())
|
||||||
|
return;
|
||||||
|
|
||||||
if(!charmer)
|
if(!charmer)
|
||||||
charmer = GetCharmer();
|
charmer = GetCharmer();
|
||||||
else if(charmer != GetCharmer()) // one aura overrides another?
|
else if(charmer != GetCharmer()) // one aura overrides another?
|
||||||
|
|||||||
Reference in New Issue
Block a user