* Add support for basedmg and baserangeddmg values in creature_classlevelstats.

* Remove mindmg, maxdmg, attackpower and ranged field in creature_template and add Dmg_Mod, Rangeddmg_Mod field.

--HG--
branch : trunk
This commit is contained in:
win32
2010-01-21 13:48:27 +02:00
parent 1c310c887b
commit 2572e9ef8e
13 changed files with 507 additions and 34 deletions

View File

@@ -1580,6 +1580,7 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI
SpellTimer = 0;
CreatureInfo const *Info = m_creature->GetCreatureInfo();
CreatureBaseStats const *stats = ((CreatureBaseStats*)m_creature)->GetBaseStats(m_creature->getLevel(), Info->unit_class);
if (Info->Entry == C_VIPER)
IsViper = true;
@@ -1588,8 +1589,9 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI
//Add delta to make them not all hit the same time
uint32 delta = (rand() % 7) * 100;
float attackpower = stats->GenerateAttackPower(Info);
m_creature->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, Info->baseattacktime + delta);
m_creature->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER , Info->attackpower);
m_creature->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER , attackpower);
}
//Redefined for random target selection: