[svn] * Raise modify scale limit from 3 to 10 for players
* Implement immunity totems from periodic damage spell effects. Source: Mangos * Implemented second choice aggro targets for creatures. Source: Mangos --HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -1241,7 +1241,7 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
float Scale = (float)atof((char*)args);
|
float Scale = (float)atof((char*)args);
|
||||||
if (Scale > 3.0f || Scale <= 0.0f)
|
if (Scale > 10.0f || Scale <= 0.0f)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_BAD_VALUE);
|
SendSysMessage(LANG_BAD_VALUE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|||||||
@@ -267,12 +267,27 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
|||||||
{
|
{
|
||||||
HostilReference* currentRef = NULL;
|
HostilReference* currentRef = NULL;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
std::list<HostilReference*>::iterator lastRef = iThreatList.end();
|
||||||
|
lastRef--;
|
||||||
|
|
||||||
for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter)
|
for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter)
|
||||||
{
|
{
|
||||||
currentRef = (*iter);
|
currentRef = (*iter);
|
||||||
|
|
||||||
Unit* target = currentRef->getTarget();
|
Unit* target = currentRef->getTarget();
|
||||||
assert(target); // if the ref has status online the target must be there !
|
assert(target); // if the ref has status online the target must be there !
|
||||||
|
|
||||||
|
// some units are prefered in comparison to others
|
||||||
|
if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) ||
|
||||||
|
target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING)
|
||||||
|
) )
|
||||||
|
{
|
||||||
|
// current victim is a second choice target, so don't compare threat with it below
|
||||||
|
if(currentRef == pCurrentVictim)
|
||||||
|
pCurrentVictim = NULL;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(!pAttacker->IsOutOfThreatArea(target)) // skip non attackable currently targets
|
if(!pAttacker->IsOutOfThreatArea(target)) // skip non attackable currently targets
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -161,3 +161,19 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto)
|
|||||||
if(spellProto->SpellIconID==2056)
|
if(spellProto->SpellIconID==2056)
|
||||||
m_type = TOTEM_STATUE; //Jewelery statue
|
m_type = TOTEM_STATUE; //Jewelery statue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Totem::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
|
||||||
|
{
|
||||||
|
for (int i=0;i<3;i++)
|
||||||
|
{
|
||||||
|
switch(spellInfo->EffectApplyAuraName[i])
|
||||||
|
{
|
||||||
|
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||||
|
case SPELL_AURA_PERIODIC_LEECH:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Creature::IsImmunedToSpell(spellInfo, useCharges);
|
||||||
|
}
|
||||||
@@ -54,6 +54,8 @@ class Totem : public Creature
|
|||||||
void UpdateMaxPower(Powers /*power*/) {}
|
void UpdateMaxPower(Powers /*power*/) {}
|
||||||
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
|
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
|
||||||
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
|
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
|
||||||
|
|
||||||
|
bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TotemType m_type;
|
TotemType m_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user