mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-06 14:32:24 +00:00
Mostly cosmetic changes to CheckAggroAmount funcs
Also changed some silliness
This commit is contained in:
parent
85d6db1de1
commit
d51e60cf8b
166
zone/aggro.cpp
166
zone/aggro.cpp
@ -1116,38 +1116,33 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//offensive spell aggro
|
//offensive spell aggro
|
||||||
int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
int32 Mob::CheckAggroAmount(uint16 spell_id, bool isproc)
|
||||||
uint16 spell_id = spellid;
|
{
|
||||||
int32 AggroAmount = 0;
|
int32 AggroAmount = 0;
|
||||||
int32 nonModifiedAggro = 0;
|
int32 nonModifiedAggro = 0;
|
||||||
uint16 slevel = GetLevel();
|
uint16 slevel = GetLevel();
|
||||||
|
|
||||||
for (int o = 0; o < EFFECT_COUNT; o++) {
|
for (int o = 0; o < EFFECT_COUNT; o++) {
|
||||||
switch(spells[spell_id].effectid[o]) {
|
switch (spells[spell_id].effectid[o]) {
|
||||||
case SE_CurrentHPOnce:
|
case SE_CurrentHPOnce:
|
||||||
case SE_CurrentHP:{
|
case SE_CurrentHP: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if(val < 0)
|
if(val < 0)
|
||||||
AggroAmount -= val;
|
AggroAmount -= val;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_MovementSpeed: {
|
case SE_MovementSpeed: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
|
||||||
AggroAmount += (2 + ((slevel * slevel) / 8));
|
AggroAmount += (2 + ((slevel * slevel) / 8));
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_AttackSpeed:
|
case SE_AttackSpeed:
|
||||||
case SE_AttackSpeed2:
|
case SE_AttackSpeed2:
|
||||||
case SE_AttackSpeed3:{
|
case SE_AttackSpeed3: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 100)
|
if (val < 100)
|
||||||
{
|
|
||||||
AggroAmount += (5 + ((slevel * slevel) / 5));
|
AggroAmount += (5 + ((slevel * slevel) / 5));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_Stun: {
|
case SE_Stun: {
|
||||||
@ -1179,33 +1174,27 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
|||||||
}
|
}
|
||||||
case SE_ATK:
|
case SE_ATK:
|
||||||
case SE_ACv2:
|
case SE_ACv2:
|
||||||
case SE_ArmorClass: {
|
case SE_ArmorClass: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
AggroAmount -= val * 2;
|
||||||
AggroAmount -= val*2;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_ResistMagic:
|
case SE_ResistMagic:
|
||||||
case SE_ResistFire:
|
case SE_ResistFire:
|
||||||
case SE_ResistCold:
|
case SE_ResistCold:
|
||||||
case SE_ResistPoison:
|
case SE_ResistPoison:
|
||||||
case SE_ResistDisease:{
|
case SE_ResistDisease: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
AggroAmount -= val * 3;
|
||||||
AggroAmount -= val*3;
|
break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case SE_ResistAll:{
|
case SE_ResistAll: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
AggroAmount -= val * 6;
|
||||||
AggroAmount -= val*6;
|
break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case SE_STR:
|
case SE_STR:
|
||||||
case SE_STA:
|
case SE_STA:
|
||||||
@ -1213,37 +1202,33 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
|||||||
case SE_AGI:
|
case SE_AGI:
|
||||||
case SE_INT:
|
case SE_INT:
|
||||||
case SE_WIS:
|
case SE_WIS:
|
||||||
case SE_CHA:{
|
case SE_CHA: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
AggroAmount -= val * 2;
|
||||||
AggroAmount -= val*2;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_AllStats:{
|
case SE_AllStats: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
AggroAmount -= val * 6;
|
||||||
AggroAmount -= val*6;
|
break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case SE_BardAEDot:{
|
case SE_BardAEDot: {
|
||||||
AggroAmount += slevel*2;
|
AggroAmount += slevel * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_SpinTarget:{
|
case SE_SpinTarget: {
|
||||||
AggroAmount += (5 + ((slevel * slevel) / 5));
|
AggroAmount += (5 + ((slevel * slevel) / 5));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_Amnesia:
|
case SE_Amnesia:
|
||||||
case SE_Silence:{
|
case SE_Silence: {
|
||||||
AggroAmount += slevel*2;
|
AggroAmount += slevel * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_Destroy:{
|
case SE_Destroy: {
|
||||||
AggroAmount += slevel*2;
|
AggroAmount += slevel * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_Harmony:
|
case SE_Harmony:
|
||||||
@ -1264,59 +1249,49 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
|||||||
case SE_Accuracy:
|
case SE_Accuracy:
|
||||||
case SE_DamageShield:
|
case SE_DamageShield:
|
||||||
case SE_SpellDamageShield:
|
case SE_SpellDamageShield:
|
||||||
case SE_ReverseDS:{
|
case SE_ReverseDS: {
|
||||||
AggroAmount += slevel*2;
|
AggroAmount += slevel * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_CurrentMana:
|
case SE_CurrentMana:
|
||||||
case SE_ManaRegen_v2:
|
case SE_ManaRegen_v2:
|
||||||
case SE_ManaPool:
|
case SE_ManaPool:
|
||||||
case SE_CurrentEndurance:{
|
case SE_CurrentEndurance: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
AggroAmount -= val * 2;
|
||||||
AggroAmount -= val*2;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_CancelMagic:
|
case SE_CancelMagic:
|
||||||
case SE_DispelDetrimental:{
|
case SE_DispelDetrimental: {
|
||||||
AggroAmount += slevel;
|
AggroAmount += slevel;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_ReduceHate:
|
case SE_ReduceHate:
|
||||||
case SE_Calm:{
|
case SE_Calm: {
|
||||||
int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
nonModifiedAggro = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id);
|
||||||
nonModifiedAggro = val;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsAEDurationSpell(spell_id))
|
if (IsAEDurationSpell(spell_id))
|
||||||
{
|
|
||||||
AggroAmount /= 2;
|
AggroAmount /= 2;
|
||||||
}
|
|
||||||
|
|
||||||
if(spells[spell_id].HateAdded > 0)
|
if (spells[spell_id].HateAdded > 0)
|
||||||
{
|
|
||||||
AggroAmount = spells[spell_id].HateAdded;
|
AggroAmount = spells[spell_id].HateAdded;
|
||||||
}
|
|
||||||
|
|
||||||
if (IsBardSong(spell_id))
|
if (IsBardSong(spell_id))
|
||||||
AggroAmount = AggroAmount * RuleI(Aggro, SongAggroMod) / 100;
|
AggroAmount = AggroAmount * RuleI(Aggro, SongAggroMod) / 100;
|
||||||
if (GetOwner() && IsPet())
|
if (GetOwner() && IsPet())
|
||||||
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
|
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
|
||||||
|
|
||||||
if(AggroAmount > 0)
|
if (AggroAmount > 0) {
|
||||||
{
|
|
||||||
|
|
||||||
int HateMod = RuleI(Aggro, SpellAggroMod);
|
int HateMod = RuleI(Aggro, SpellAggroMod);
|
||||||
|
|
||||||
if(IsClient())
|
if (IsClient())
|
||||||
{
|
|
||||||
HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id);
|
HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id);
|
||||||
}
|
|
||||||
|
|
||||||
//Live AA - Spell casting subtlety
|
//Live AA - Spell casting subtlety
|
||||||
HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod;
|
HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod;
|
||||||
@ -1333,32 +1308,29 @@ int32 Mob::CheckAggroAmount(uint16 spellid, bool isproc) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return AggroAmount + spells[spell_id].bonushate + nonModifiedAggro;
|
||||||
|
|
||||||
AggroAmount += spells[spell_id].bonushate + nonModifiedAggro;
|
|
||||||
return AggroAmount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//healing and buffing aggro
|
//healing and buffing aggro
|
||||||
int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) {
|
int32 Mob::CheckHealAggroAmount(uint16 spell_id, uint32 heal_possible)
|
||||||
uint16 spell_id = spellid;
|
{
|
||||||
int32 AggroAmount = 0;
|
int32 AggroAmount = 0;
|
||||||
|
|
||||||
for (int o = 0; o < EFFECT_COUNT; o++) {
|
for (int o = 0; o < EFFECT_COUNT; o++) {
|
||||||
switch(spells[spell_id].effectid[o]) {
|
switch (spells[spell_id].effectid[o]) {
|
||||||
case SE_CurrentHP: {
|
case SE_CurrentHP: {
|
||||||
AggroAmount += IsBuffSpell(spell_id) ? spells[spell_id].mana / 4 : spells[spell_id].mana;
|
AggroAmount += IsBuffSpell(spell_id) ? spells[spell_id].mana / 4 : spells[spell_id].mana;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_Rune: {
|
case SE_Rune: {
|
||||||
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[0], spells[spell_id].base[0], spells[spell_id].max[o], this->GetLevel(), spellid) * 2;
|
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[0], spells[spell_id].base[0], spells[spell_id].max[o], GetLevel(), spell_id) * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SE_HealOverTime:{
|
case SE_HealOverTime: {
|
||||||
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], this->GetLevel(), spell_id);
|
AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], GetLevel(), spell_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:{
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1368,14 +1340,11 @@ int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) {
|
|||||||
if (GetOwner() && IsPet())
|
if (GetOwner() && IsPet())
|
||||||
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
|
AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100;
|
||||||
|
|
||||||
if(AggroAmount > 0)
|
if (AggroAmount > 0) {
|
||||||
{
|
|
||||||
int HateMod = RuleI(Aggro, SpellAggroMod);
|
int HateMod = RuleI(Aggro, SpellAggroMod);
|
||||||
|
|
||||||
if(IsClient())
|
if (IsClient())
|
||||||
{
|
|
||||||
HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id);
|
HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id);
|
||||||
}
|
|
||||||
|
|
||||||
//Live AA - Spell casting subtlety
|
//Live AA - Spell casting subtlety
|
||||||
HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod;
|
HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod;
|
||||||
@ -1387,12 +1356,9 @@ int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) {
|
|||||||
//confirmed by EQ devs to be 100 exactly at level 85. From their wording it doesn't seem like it's affected
|
//confirmed by EQ devs to be 100 exactly at level 85. From their wording it doesn't seem like it's affected
|
||||||
//by hate modifiers either.
|
//by hate modifiers either.
|
||||||
//AggroAmount += (slevel*slevel/72); // Moved Below
|
//AggroAmount += (slevel*slevel/72); // Moved Below
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AggroAmount < 0)
|
||||||
if(AggroAmount < 0)
|
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return AggroAmount;
|
return AggroAmount;
|
||||||
|
|||||||
@ -762,8 +762,8 @@ public:
|
|||||||
bool Charmed() const { return charmed; }
|
bool Charmed() const { return charmed; }
|
||||||
static uint32 GetLevelHP(uint8 tlevel);
|
static uint32 GetLevelHP(uint8 tlevel);
|
||||||
uint32 GetZoneID() const; //for perl
|
uint32 GetZoneID() const; //for perl
|
||||||
virtual int32 CheckAggroAmount(uint16 spellid, bool isproc = false);
|
virtual int32 CheckAggroAmount(uint16 spell_id, bool isproc = false);
|
||||||
virtual int32 CheckHealAggroAmount(uint16 spellid, uint32 heal_possible = 0);
|
virtual int32 CheckHealAggroAmount(uint16 spell_id, uint32 heal_possible = 0);
|
||||||
virtual uint32 GetAA(uint32 aa_id) const { return(0); }
|
virtual uint32 GetAA(uint32 aa_id) const { return(0); }
|
||||||
|
|
||||||
uint16 GetInstrumentMod(uint16 spell_id) const;
|
uint16 GetInstrumentMod(uint16 spell_id) const;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user