mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Formatting: NPC::ModifyStatsOnCharm
This commit is contained in:
parent
5c14bc92bd
commit
5381dcead1
68
zone/npc.cpp
68
zone/npc.cpp
@ -2839,43 +2839,61 @@ void NPC::DepopSwarmPets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::ModifyStatsOnCharm(bool bRemoved)
|
void NPC::ModifyStatsOnCharm(bool is_charm_removed)
|
||||||
{
|
{
|
||||||
if (bRemoved) {
|
if (is_charm_removed) {
|
||||||
if (charm_ac)
|
if (charm_ac) {
|
||||||
AC = default_ac;
|
AC = default_ac;
|
||||||
if (charm_attack_delay)
|
}
|
||||||
|
if (charm_attack_delay) {
|
||||||
attack_delay = default_attack_delay;
|
attack_delay = default_attack_delay;
|
||||||
if (charm_accuracy_rating)
|
}
|
||||||
|
if (charm_accuracy_rating) {
|
||||||
accuracy_rating = default_accuracy_rating;
|
accuracy_rating = default_accuracy_rating;
|
||||||
if (charm_avoidance_rating)
|
}
|
||||||
|
if (charm_avoidance_rating) {
|
||||||
avoidance_rating = default_avoidance_rating;
|
avoidance_rating = default_avoidance_rating;
|
||||||
if (charm_atk)
|
}
|
||||||
|
if (charm_atk) {
|
||||||
ATK = default_atk;
|
ATK = default_atk;
|
||||||
|
}
|
||||||
if (charm_min_dmg || charm_max_dmg) {
|
if (charm_min_dmg || charm_max_dmg) {
|
||||||
base_damage = round((default_max_dmg - default_min_dmg) / 1.9);
|
base_damage = round((default_max_dmg - default_min_dmg) / 1.9);
|
||||||
min_damage = default_min_dmg - round(base_damage / 10.0);
|
min_damage = default_min_dmg - round(base_damage / 10.0);
|
||||||
}
|
}
|
||||||
if (RuleB(Spells, CharmDisablesSpecialAbilities))
|
if (RuleB(Spells, CharmDisablesSpecialAbilities)) {
|
||||||
ProcessSpecialAbilities(default_special_abilities);
|
ProcessSpecialAbilities(default_special_abilities);
|
||||||
} else {
|
|
||||||
if (charm_ac)
|
|
||||||
AC = charm_ac;
|
|
||||||
if (charm_attack_delay)
|
|
||||||
attack_delay = charm_attack_delay;
|
|
||||||
if (charm_accuracy_rating)
|
|
||||||
accuracy_rating = charm_accuracy_rating;
|
|
||||||
if (charm_avoidance_rating)
|
|
||||||
avoidance_rating = charm_avoidance_rating;
|
|
||||||
if (charm_atk)
|
|
||||||
ATK = charm_atk;
|
|
||||||
if (charm_min_dmg || charm_max_dmg) {
|
|
||||||
base_damage = round((charm_max_dmg - charm_min_dmg) / 1.9);
|
|
||||||
min_damage = charm_min_dmg - round(base_damage / 10.0);
|
|
||||||
}
|
}
|
||||||
if (RuleB(Spells, CharmDisablesSpecialAbilities))
|
|
||||||
ClearSpecialAbilities();
|
SetAttackTimer();
|
||||||
|
CalcAC();
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (charm_ac) {
|
||||||
|
AC = charm_ac;
|
||||||
|
}
|
||||||
|
if (charm_attack_delay) {
|
||||||
|
attack_delay = charm_attack_delay;
|
||||||
|
}
|
||||||
|
if (charm_accuracy_rating) {
|
||||||
|
accuracy_rating = charm_accuracy_rating;
|
||||||
|
}
|
||||||
|
if (charm_avoidance_rating) {
|
||||||
|
avoidance_rating = charm_avoidance_rating;
|
||||||
|
}
|
||||||
|
if (charm_atk) {
|
||||||
|
ATK = charm_atk;
|
||||||
|
}
|
||||||
|
if (charm_min_dmg || charm_max_dmg) {
|
||||||
|
base_damage = round((charm_max_dmg - charm_min_dmg) / 1.9);
|
||||||
|
min_damage = charm_min_dmg - round(base_damage / 10.0);
|
||||||
|
}
|
||||||
|
if (RuleB(Spells, CharmDisablesSpecialAbilities)) {
|
||||||
|
ClearSpecialAbilities();
|
||||||
|
}
|
||||||
|
|
||||||
// the rest of the stats aren't cached, so lets just do these two instead of full CalcBonuses()
|
// the rest of the stats aren't cached, so lets just do these two instead of full CalcBonuses()
|
||||||
SetAttackTimer();
|
SetAttackTimer();
|
||||||
CalcAC();
|
CalcAC();
|
||||||
|
|||||||
@ -294,7 +294,7 @@ public:
|
|||||||
int32 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; }
|
int32 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; }
|
||||||
inline const char* GetAmmoIDfile() const { return ammo_idfile; }
|
inline const char* GetAmmoIDfile() const { return ammo_idfile; }
|
||||||
|
|
||||||
void ModifyStatsOnCharm(bool bRemoved);
|
void ModifyStatsOnCharm(bool is_charm_removed);
|
||||||
|
|
||||||
//waypoint crap
|
//waypoint crap
|
||||||
int GetMaxWp() const { return max_wp; }
|
int GetMaxWp() const { return max_wp; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user