*Force creatures to choose a new, random model on spawn/respawn

*Change the damage formula to include weapon min/max damage.. previous method did not work properly at all.

--HG--
branch : trunk
This commit is contained in:
maximius
2009-09-23 22:09:20 -07:00
parent 906b00465a
commit 8ccf471bcb
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -724,6 +724,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
}
LoadCreaturesAddon();
}
SetDisplayId(GetCreatureInfo()->GetRandomValidModelId());
return bResult;
}
@@ -1843,6 +1844,8 @@ void Creature::Respawn(bool force)
else
setDeathState( JUST_ALIVED );
SetDisplayId(cinfo->GetRandomValidModelId());
//Call AI respawn virtual function
AI()->JustRespawned();
+2 -2
View File
@@ -870,8 +870,8 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
weapon_maxdamage = 0;
}
float mindamage = ((base_value * dmg_multiplier + weapon_mindamage) * base_pct + total_value) * total_pct;
float maxdamage = ((base_value * dmg_multiplier + weapon_maxdamage) * base_pct + total_value) * total_pct;
float mindamage = ((base_value + weapon_mindamage) * dmg_multiplier * base_pct + total_value) * total_pct;
float maxdamage = ((base_value + weapon_maxdamage) * dmg_multiplier * base_pct + total_value) * total_pct;
switch(attType)
{