[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;
|
||||
|
||||
float Scale = (float)atof((char*)args);
|
||||
if (Scale > 3.0f || Scale <= 0.0f)
|
||||
if (Scale > 10.0f || Scale <= 0.0f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
|
||||
@@ -267,6 +267,10 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
||||
{
|
||||
HostilReference* currentRef = NULL;
|
||||
bool found = false;
|
||||
|
||||
std::list<HostilReference*>::iterator lastRef = iThreatList.end();
|
||||
lastRef--;
|
||||
|
||||
for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter)
|
||||
{
|
||||
currentRef = (*iter);
|
||||
@@ -274,6 +278,17 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
||||
Unit* target = currentRef->getTarget();
|
||||
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(pCurrentVictim) // select 1.3/1.1 better target in comparison current target
|
||||
|
||||
@@ -161,3 +161,19 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto)
|
||||
if(spellProto->SpellIconID==2056)
|
||||
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);
|
||||
}
|
||||
@@ -55,6 +55,8 @@ class Totem : public Creature
|
||||
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
|
||||
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
|
||||
|
||||
bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
|
||||
|
||||
protected:
|
||||
TotemType m_type;
|
||||
uint32 m_duration;
|
||||
|
||||
Reference in New Issue
Block a user