[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:
KingPin
2008-10-19 16:52:50 -05:00
parent 76adf24586
commit 0d8d686d81
4 changed files with 34 additions and 1 deletions
+1 -1
View File
@@ -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);
+15
View File
@@ -267,12 +267,27 @@ 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);
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
{
+16
View File
@@ -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);
}
+2
View File
@@ -54,6 +54,8 @@ class Totem : public Creature
void UpdateMaxPower(Powers /*power*/) {}
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
protected:
TotemType m_type;