mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
* 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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user