From 17aaab1f9d4208dd5a5c64bc67189ed471651372 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:47:15 -0400 Subject: [PATCH] [Quest API] Add Spell methods to Perl. (#1631) * [Quest API] Add Spell methods to Perl. - Add quest::getspell(spell_id) to Perl. - Add eq.get_spell(spell_id) to Lua. These methods return a spell object. Exports $spell object references to spell events. * Formatting. * Remove comment. * Update spdat.cpp * Amplication typo. * Fix conflicts. * Remove repository changes. * Fix typing. * Update spell_effects.cpp --- common/eq_packet_structs.h | 8 +- common/patches/rof2_structs.h | 4 +- common/patches/rof_structs.h | 4 +- common/patches/sod.cpp | 4 +- common/patches/sod_structs.h | 4 +- common/patches/sof.cpp | 4 +- common/patches/sof_structs.h | 4 +- common/patches/titanium.cpp | 4 +- common/patches/titanium_structs.h | 4 +- common/patches/uf.cpp | 4 +- common/patches/uf_structs.h | 4 +- common/shareddb.cpp | 114 +- common/spdat.cpp | 324 ++--- common/spdat.h | 120 +- zone/CMakeLists.txt | 1 + zone/aa.cpp | 24 +- zone/aa_rank_effects.h | 4 +- zone/aggro.cpp | 52 +- zone/attack.cpp | 44 +- zone/beacon.cpp | 8 +- zone/bonuses.cpp | 940 ++++++------- zone/bot.cpp | 394 +++--- zone/bot_command.cpp | 190 +-- zone/bot_database.cpp | 6 +- zone/botspellsai.cpp | 72 +- zone/client.cpp | 20 +- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 30 +- zone/client_process.cpp | 10 +- zone/command.cpp | 52 +- zone/common.h | 2 +- zone/effects.cpp | 28 +- zone/embparser.cpp | 53 +- zone/embparser.h | 4 +- zone/embparser_api.cpp | 31 + zone/embperl.cpp | 2 + zone/groups.cpp | 4 +- zone/lua_general.cpp | 11 + zone/lua_mob.cpp | 4 +- zone/lua_mob.h | 2 +- zone/lua_parser.cpp | 8 +- zone/lua_spell.cpp | 102 +- zone/merc.cpp | 66 +- zone/mob.cpp | 158 +-- zone/mob.h | 14 +- zone/mob_ai.cpp | 44 +- zone/npc.cpp | 6 +- zone/npc.h | 6 +- zone/perl_mob.cpp | 16 +- zone/perl_spell.cpp | 2138 +++++++++++++++++++++++++++++ zone/perlparser.h | 2 +- zone/pets.cpp | 8 +- zone/questmgr.cpp | 25 +- zone/questmgr.h | 5 +- zone/raids.cpp | 4 +- zone/special_attacks.cpp | 8 +- zone/spell_effects.cpp | 997 +++++++------- zone/spells.cpp | 234 ++-- zone/trap.cpp | 2 +- zone/zonedb.cpp | 16 +- zone/zonedb.h | 4 +- 61 files changed, 4342 insertions(+), 2117 deletions(-) create mode 100644 zone/perl_spell.cpp diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 6f1a437a8..304411d03 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -4342,8 +4342,8 @@ struct AARankPrereq_Struct struct AARankEffect_Struct { int32 effect_id; - int32 base1; - int32 base2; + int32 base_value; + int32 limit_value; int32 slot; }; @@ -4351,8 +4351,8 @@ struct AARankEffect_Struct struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; }; diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index a37e25d61..229a3b3e7 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -4361,8 +4361,8 @@ struct UseAA_Struct { struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; /*16*/ }; diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index d98827ce9..27365a36d 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -4305,8 +4305,8 @@ struct UseAA_Struct { struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; /*16*/ }; diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 8470b7296..034679bd5 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -1874,8 +1874,8 @@ namespace SoD for(auto i = 0; i < eq->total_abilities; ++i) { eq->abilities[i].skill_id = inapp->ReadUInt32(); - eq->abilities[i].base1 = inapp->ReadUInt32(); - eq->abilities[i].base2 = inapp->ReadUInt32(); + eq->abilities[i].base_value = inapp->ReadUInt32(); + eq->abilities[i].limit_value = inapp->ReadUInt32(); eq->abilities[i].slot = inapp->ReadUInt32(); } diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 12bfacac7..37392fc18 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -3748,8 +3748,8 @@ struct UseAA_Struct { struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; /*16*/ }; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 760a9008b..56fbba8f4 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1545,8 +1545,8 @@ namespace SoF for(auto i = 0; i < eq->total_abilities; ++i) { eq->abilities[i].skill_id = inapp->ReadUInt32(); - eq->abilities[i].base1 = inapp->ReadUInt32(); - eq->abilities[i].base2 = inapp->ReadUInt32(); + eq->abilities[i].base_value = inapp->ReadUInt32(); + eq->abilities[i].limit_value = inapp->ReadUInt32(); eq->abilities[i].slot = inapp->ReadUInt32(); } diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index 60542db38..3129e3b0b 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -3673,8 +3673,8 @@ struct UseAA_Struct { struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; /*16*/ }; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index bb35d9f87..200beebf5 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1338,8 +1338,8 @@ namespace Titanium for(auto i = 0; i < eq->total_abilities; ++i) { eq->abilities[i].skill_id = inapp->ReadUInt32(); - eq->abilities[i].base1 = inapp->ReadUInt32(); - eq->abilities[i].base2 = inapp->ReadUInt32(); + eq->abilities[i].base_value = inapp->ReadUInt32(); + eq->abilities[i].limit_value = inapp->ReadUInt32(); eq->abilities[i].slot = inapp->ReadUInt32(); } diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h index 2846288bc..cf918717a 100644 --- a/common/patches/titanium_structs.h +++ b/common/patches/titanium_structs.h @@ -3180,8 +3180,8 @@ struct UseAA_Struct { struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; }; diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index f1bf60e6a..81c76aa62 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -2139,8 +2139,8 @@ namespace UF for(auto i = 0; i < eq->total_abilities; ++i) { eq->abilities[i].skill_id = inapp->ReadUInt32(); - eq->abilities[i].base1 = inapp->ReadUInt32(); - eq->abilities[i].base2 = inapp->ReadUInt32(); + eq->abilities[i].base_value = inapp->ReadUInt32(); + eq->abilities[i].limit_value = inapp->ReadUInt32(); eq->abilities[i].slot = inapp->ReadUInt32(); } diff --git a/common/patches/uf_structs.h b/common/patches/uf_structs.h index f3d7f0e2c..a0ee2ba8d 100644 --- a/common/patches/uf_structs.h +++ b/common/patches/uf_structs.h @@ -3803,8 +3803,8 @@ struct UseAA_Struct { struct AA_Ability { /*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; +/*04*/ uint32 base_value; +/*08*/ uint32 limit_value; /*12*/ uint32 slot; /*16*/ }; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 18619ee6e..7f913edf3 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1682,7 +1682,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe for(auto row = results.begin(); row != results.end(); ++row) { int spellID = atoi(row[0]); if((spellID > 0) && (spellID <= iMaxSpellID)) - sp[spellID].DamageShieldType = atoi(row[1]); + sp[spellID].damage_shield_type = atoi(row[1]); } } @@ -1762,48 +1762,48 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { strn0cpy(sp[tempid].spell_fades, row[8], sizeof(sp[tempid].spell_fades)); sp[tempid].range=static_cast(atof(row[9])); - sp[tempid].aoerange=static_cast(atof(row[10])); - sp[tempid].pushback=static_cast(atof(row[11])); - sp[tempid].pushup=static_cast(atof(row[12])); + sp[tempid].aoe_range=static_cast(atof(row[10])); + sp[tempid].push_back=static_cast(atof(row[11])); + sp[tempid].push_up=static_cast(atof(row[12])); sp[tempid].cast_time=atoi(row[13]); sp[tempid].recovery_time=atoi(row[14]); sp[tempid].recast_time=atoi(row[15]); - sp[tempid].buffdurationformula=atoi(row[16]); - sp[tempid].buffduration=atoi(row[17]); - sp[tempid].AEDuration=atoi(row[18]); + sp[tempid].buff_duration_formula=atoi(row[16]); + sp[tempid].buff_duration=atoi(row[17]); + sp[tempid].aoe_duration=atoi(row[18]); sp[tempid].mana=atoi(row[19]); int y=0; for(y=0; y< EFFECT_COUNT;y++) - sp[tempid].base[y]=atoi(row[20+y]); // effect_base_value + sp[tempid].base_value[y]=atoi(row[20+y]); // effect_base_value for(y=0; y < EFFECT_COUNT; y++) - sp[tempid].base2[y]=atoi(row[32+y]); // effect_limit_value + sp[tempid].limit_value[y]=atoi(row[32+y]); // effect_limit_value for(y=0; y< EFFECT_COUNT;y++) - sp[tempid].max[y]=atoi(row[44+y]); + sp[tempid].max_value[y]=atoi(row[44+y]); for(y=0; y< 4;y++) - sp[tempid].components[y]=atoi(row[58+y]); + sp[tempid].component[y]=atoi(row[58+y]); for(y=0; y< 4;y++) - sp[tempid].component_counts[y]=atoi(row[62+y]); + sp[tempid].component_count[y]=atoi(row[62+y]); for(y=0; y< 4;y++) - sp[tempid].NoexpendReagent[y]=atoi(row[66+y]); + sp[tempid].no_expend_reagent[y]=atoi(row[66+y]); for(y=0; y< EFFECT_COUNT;y++) sp[tempid].formula[y]=atoi(row[70+y]); - sp[tempid].goodEffect=atoi(row[83]); - sp[tempid].Activated=atoi(row[84]); - sp[tempid].resisttype=atoi(row[85]); + sp[tempid].good_effect=atoi(row[83]); + sp[tempid].activated=atoi(row[84]); + sp[tempid].resist_type=atoi(row[85]); for(y=0; y< EFFECT_COUNT;y++) - sp[tempid].effectid[y]=atoi(row[86+y]); + sp[tempid].effect_id[y]=atoi(row[86+y]); - sp[tempid].targettype = (SpellTargetType) atoi(row[98]); - sp[tempid].basediff=atoi(row[99]); + sp[tempid].target_type = (SpellTargetType) atoi(row[98]); + sp[tempid].base_difficulty=atoi(row[99]); int tmp_skill = atoi(row[100]);; @@ -1812,15 +1812,15 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { else sp[tempid].skill = (EQ::skills::SkillType) tmp_skill; - sp[tempid].zonetype=atoi(row[101]); - sp[tempid].EnvironmentType=atoi(row[102]); - sp[tempid].TimeOfDay=atoi(row[103]); + sp[tempid].zone_type=atoi(row[101]); + sp[tempid].environment_type=atoi(row[102]); + sp[tempid].time_of_day=atoi(row[103]); for(y=0; y < PLAYER_CLASS_COUNT;y++) sp[tempid].classes[y]=atoi(row[104+y]); - sp[tempid].CastingAnim=atoi(row[120]); - sp[tempid].SpellAffectIndex=atoi(row[123]); + sp[tempid].casting_animation=atoi(row[120]); + sp[tempid].spell_affect_index=atoi(row[123]); sp[tempid].disallow_sit=atoi(row[124]); sp[tempid].deity_agnostic=atoi(row[125]); @@ -1829,32 +1829,32 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].new_icon=atoi(row[144]); sp[tempid].uninterruptable=atoi(row[146]) != 0; - sp[tempid].ResistDiff=atoi(row[147]); - sp[tempid].dot_stacking_exempt = atoi(row[148]) != 0; - sp[tempid].RecourseLink = atoi(row[150]); + sp[tempid].resist_difficulty=atoi(row[147]); + sp[tempid].unstackable_dot = atoi(row[148]) != 0; + sp[tempid].recourse_link = atoi(row[150]); sp[tempid].no_partial_resist = atoi(row[151]) != 0; sp[tempid].short_buff_box = atoi(row[154]); - sp[tempid].descnum = atoi(row[155]); - sp[tempid].typedescnum = atoi(row[156]); - sp[tempid].effectdescnum = atoi(row[157]); + sp[tempid].description_id = atoi(row[155]); + sp[tempid].type_description_id = atoi(row[156]); + sp[tempid].effect_description_id = atoi(row[157]); sp[tempid].npc_no_los = atoi(row[159]) != 0; sp[tempid].feedbackable = atoi(row[160]) != 0; sp[tempid].reflectable = atoi(row[161]) != 0; - sp[tempid].bonushate=atoi(row[162]); + sp[tempid].bonus_hate=atoi(row[162]); sp[tempid].ldon_trap = atoi(row[165]) != 0; - sp[tempid].EndurCost=atoi(row[166]); - sp[tempid].EndurTimerIndex=atoi(row[167]); - sp[tempid].IsDisciplineBuff = atoi(row[168]) != 0; - sp[tempid].HateAdded=atoi(row[173]); - sp[tempid].EndurUpkeep=atoi(row[174]); - sp[tempid].numhitstype = atoi(row[175]); - sp[tempid].numhits = atoi(row[176]); - sp[tempid].pvpresistbase=atoi(row[177]); - sp[tempid].pvpresistcalc=atoi(row[178]); - sp[tempid].pvpresistcap=atoi(row[179]); + sp[tempid].endurance_cost=atoi(row[166]); + sp[tempid].timer_id=atoi(row[167]); + sp[tempid].is_discipline = atoi(row[168]) != 0; + sp[tempid].hate_added=atoi(row[173]); + sp[tempid].endurance_upkeep=atoi(row[174]); + sp[tempid].hit_number_type = atoi(row[175]); + sp[tempid].hit_number = atoi(row[176]); + sp[tempid].pvp_resist_base=atoi(row[177]); + sp[tempid].pvp_resist_per_level=atoi(row[178]); + sp[tempid].pvp_resist_cap=atoi(row[179]); sp[tempid].spell_category=atoi(row[180]); sp[tempid].pvp_duration = atoi(row[181]); sp[tempid].pvp_duration_cap = atoi(row[182]); @@ -1862,11 +1862,11 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].cast_not_standing = atoi(row[184]) != 0; sp[tempid].can_mgb=atoi(row[185]); sp[tempid].dispel_flag = atoi(row[186]); - sp[tempid].MinResist = atoi(row[189]); - sp[tempid].MaxResist = atoi(row[190]); + sp[tempid].min_resist = atoi(row[189]); + sp[tempid].max_resist = atoi(row[190]); sp[tempid].viral_targets = atoi(row[191]); sp[tempid].viral_timer = atoi(row[192]); - sp[tempid].NimbusEffect = atoi(row[193]); + sp[tempid].nimbus_effect = atoi(row[193]); sp[tempid].directional_start = static_cast(atoi(row[194])); sp[tempid].directional_end = static_cast(atoi(row[195])); sp[tempid].sneak = atoi(row[196]) != 0; @@ -1874,29 +1874,29 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].no_detrimental_spell_aggro = atoi(row[198]) != 0; sp[tempid].suspendable = atoi(row[200]) != 0; sp[tempid].viral_range = atoi(row[201]); - sp[tempid].songcap = atoi(row[202]); + sp[tempid].song_cap = atoi(row[202]); sp[tempid].no_block = atoi(row[205]); - sp[tempid].spellgroup=atoi(row[207]); + sp[tempid].spell_group=atoi(row[207]); sp[tempid].rank = atoi(row[208]); sp[tempid].no_resist=atoi(row[209]); - sp[tempid].CastRestriction = atoi(row[211]); - sp[tempid].AllowRest = atoi(row[212]) != 0; - sp[tempid].InCombat = atoi(row[213]) != 0; - sp[tempid].OutofCombat = atoi(row[214]) != 0; + sp[tempid].cast_restriction = atoi(row[211]); + sp[tempid].allow_rest = atoi(row[212]) != 0; + sp[tempid].can_cast_in_combat = atoi(row[213]) != 0; + sp[tempid].can_cast_out_of_combat = atoi(row[214]) != 0; sp[tempid].override_crit_chance = atoi(row[217]); - sp[tempid].aemaxtargets = atoi(row[218]); + sp[tempid].aoe_max_targets = atoi(row[218]); sp[tempid].no_heal_damage_item_mod = atoi(row[219]); sp[tempid].caster_requirement_id = atoi(row[220]); sp[tempid].spell_class = atoi(row[221]); sp[tempid].spell_subclass = atoi(row[222]); - sp[tempid].persistdeath = atoi(row[224]) != 0; - sp[tempid].min_dist = atof(row[227]); - sp[tempid].min_dist_mod = atof(row[228]); - sp[tempid].max_dist = atof(row[229]); - sp[tempid].max_dist_mod = atof(row[230]); + sp[tempid].persist_death = atoi(row[224]) != 0; + sp[tempid].min_distance = atof(row[227]); + sp[tempid].min_distance_mod = atof(row[228]); + sp[tempid].max_distance = atof(row[229]); + sp[tempid].max_distance_mod = atof(row[230]); sp[tempid].min_range = static_cast(atoi(row[231])); sp[tempid].no_remove = atoi(row[232]) != 0; - sp[tempid].DamageShieldType = 0; + sp[tempid].damage_shield_type = 0; } LoadDamageShieldTypes(sp, max_spells); diff --git a/common/spdat.cpp b/common/spdat.cpp index 719af4069..e52da4da1 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -87,7 +87,7 @@ bool IsTargetableAESpell(uint16 spell_id) { - if (IsValidSpell(spell_id) && spells[spell_id].targettype == ST_AETarget) { + if (IsValidSpell(spell_id) && spells[spell_id].target_type == ST_AETarget) { return true; } @@ -103,8 +103,8 @@ bool IsLifetapSpell(uint16 spell_id) { // Ancient Lifebane: 2115 if (IsValidSpell(spell_id) && - (spells[spell_id].targettype == ST_Tap || - spells[spell_id].targettype == ST_TargetAETap || + (spells[spell_id].target_type == ST_Tap || + spells[spell_id].target_type == ST_TargetAETap || spell_id == 2115)) return true; @@ -124,7 +124,7 @@ bool IsStunSpell(uint16 spell_id) bool IsSummonSpell(uint16 spellid) { for (int o = 0; o < EFFECT_COUNT; o++) { - uint32 tid = spells[spellid].effectid[o]; + uint32 tid = spells[spellid].effect_id[o]; if (tid == SE_SummonPet || tid == SE_SummonItem || tid == SE_SummonPC) return true; } @@ -140,10 +140,10 @@ bool IsEvacSpell(uint16 spellid) bool IsDamageSpell(uint16 spellid) { for (int o = 0; o < EFFECT_COUNT; o++) { - uint32 tid = spells[spellid].effectid[o]; + uint32 tid = spells[spellid].effect_id[o]; if ((tid == SE_CurrentHPOnce || tid == SE_CurrentHP) && - spells[spellid].targettype != ST_Tap && spells[spellid].buffduration < 1 && - spells[spellid].base[o] < 0) + spells[spellid].target_type != ST_Tap && spells[spellid].buff_duration < 1 && + spells[spellid].base_value[o] < 0) return true; } @@ -163,8 +163,8 @@ bool IsCureSpell(uint16 spell_id) bool CureEffect = false; for(int i = 0; i < EFFECT_COUNT; i++){ - if (sp.effectid[i] == SE_DiseaseCounter || sp.effectid[i] == SE_PoisonCounter - || sp.effectid[i] == SE_CurseCounter || sp.effectid[i] == SE_CorruptionCounter) + if (sp.effect_id[i] == SE_DiseaseCounter || sp.effect_id[i] == SE_PoisonCounter + || sp.effect_id[i] == SE_CurseCounter || sp.effect_id[i] == SE_CorruptionCounter) CureEffect = true; } @@ -179,8 +179,8 @@ bool IsSlowSpell(uint16 spell_id) const SPDat_Spell_Struct &sp = spells[spell_id]; for(int i = 0; i < EFFECT_COUNT; i++) - if ((sp.effectid[i] == SE_AttackSpeed && sp.base[i] < 100) || - (sp.effectid[i] == SE_AttackSpeed4)) + if ((sp.effect_id[i] == SE_AttackSpeed && sp.base_value[i] < 100) || + (sp.effect_id[i] == SE_AttackSpeed4)) return true; return false; @@ -191,8 +191,8 @@ bool IsHasteSpell(uint16 spell_id) const SPDat_Spell_Struct &sp = spells[spell_id]; for(int i = 0; i < EFFECT_COUNT; i++) - if(sp.effectid[i] == SE_AttackSpeed) - return (sp.base[i] < 100); + if(sp.effect_id[i] == SE_AttackSpeed) + return (sp.base_value[i] < 100); return false; } @@ -210,7 +210,7 @@ bool IsPercentalHealSpell(uint16 spell_id) bool IsGroupOnlySpell(uint16 spell_id) { - return IsValidSpell(spell_id) && spells[spell_id].goodEffect == 2; + return IsValidSpell(spell_id) && spells[spell_id].good_effect == 2; } bool IsBeneficialSpell(uint16 spell_id) @@ -219,10 +219,10 @@ bool IsBeneficialSpell(uint16 spell_id) return false; // You'd think just checking goodEffect flag would be enough? - if (spells[spell_id].goodEffect == 1) { + if (spells[spell_id].good_effect == 1) { // If the target type is ST_Self or ST_Pet and is a SE_CancleMagic spell // it is not Beneficial - SpellTargetType tt = spells[spell_id].targettype; + SpellTargetType tt = spells[spell_id].target_type; if (tt != ST_Self && tt != ST_Pet && IsEffectInSpell(spell_id, SE_CancelMagic)) return false; @@ -231,14 +231,14 @@ bool IsBeneficialSpell(uint16 spell_id) // We need to check more things! if (tt == ST_Target || tt == ST_AETarget || tt == ST_Animal || tt == ST_Undead || tt == ST_Pet) { - uint16 sai = spells[spell_id].SpellAffectIndex; + uint16 sai = spells[spell_id].spell_affect_index; // If the resisttype is magic and SpellAffectIndex is Calm/memblur/dispell sight // it's not beneficial - if (spells[spell_id].resisttype == RESIST_MAGIC) { + if (spells[spell_id].resist_type == RESIST_MAGIC) { // checking these SAI cause issues with the rng defensive proc line // So I guess instead of fixing it for real, just a quick hack :P - if (spells[spell_id].effectid[0] != SE_DefensiveProc && + if (spells[spell_id].effect_id[0] != SE_DefensiveProc && (sai == SAI_Calm || sai == SAI_Dispell_Sight || sai == SAI_Memory_Blur || sai == SAI_Calm_Song)) return false; @@ -252,7 +252,7 @@ bool IsBeneficialSpell(uint16 spell_id) } // And finally, if goodEffect is not 0 or if it's a group spell it's beneficial - return spells[spell_id].goodEffect != 0 || IsGroupSpell(spell_id); + return spells[spell_id].good_effect != 0 || IsGroupSpell(spell_id); } bool IsDetrimentalSpell(uint16 spell_id) @@ -364,8 +364,8 @@ bool IsImprovedDamageSpell(uint16 spell_id) bool IsAEDurationSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && - (spells[spell_id].targettype == ST_AETarget || spells[spell_id].targettype == ST_UndeadAE) && - spells[spell_id].AEDuration != 0) + (spells[spell_id].target_type == ST_AETarget || spells[spell_id].target_type == ST_UndeadAE) && + spells[spell_id].aoe_duration != 0) return true; return false; @@ -383,7 +383,7 @@ bool IsPureNukeSpell(uint16 spell_id) effect_count++; if (effect_count == 1 && IsEffectInSpell(spell_id, SE_CurrentHP) && - spells[spell_id].buffduration == 0 && IsDamageSpell(spell_id)) + spells[spell_id].buff_duration == 0 && IsDamageSpell(spell_id)) return true; return false; @@ -392,7 +392,7 @@ bool IsPureNukeSpell(uint16 spell_id) bool IsAENukeSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && IsPureNukeSpell(spell_id) && - spells[spell_id].aoerange > 0) + spells[spell_id].aoe_range > 0) return true; return false; @@ -401,7 +401,7 @@ bool IsAENukeSpell(uint16 spell_id) bool IsPBAENukeSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && IsPureNukeSpell(spell_id) && - spells[spell_id].aoerange > 0 && spells[spell_id].targettype == ST_AECaster) + spells[spell_id].aoe_range > 0 && spells[spell_id].target_type == ST_AECaster) return true; return false; @@ -410,7 +410,7 @@ bool IsPBAENukeSpell(uint16 spell_id) bool IsAERainNukeSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && IsPureNukeSpell(spell_id) && - spells[spell_id].aoerange > 0 && spells[spell_id].AEDuration > 1000) + spells[spell_id].aoe_range > 0 && spells[spell_id].aoe_duration > 1000) return true; return false; @@ -424,12 +424,12 @@ bool IsPartialCapableSpell(uint16 spell_id) // spell uses 600 (partial) scale if first effect is damage, else it uses 200 scale. // this includes DoTs. no_partial_resist excludes spells like necro snares for (int o = 0; o < EFFECT_COUNT; o++) { - auto tid = spells[spell_id].effectid[o]; + auto tid = spells[spell_id].effect_id[o]; if (IsBlankSpellEffect(spell_id, o)) continue; - if ((tid == SE_CurrentHPOnce || tid == SE_CurrentHP) && spells[spell_id].base[o] < 0) + if ((tid == SE_CurrentHPOnce || tid == SE_CurrentHP) && spells[spell_id].base_value[o] < 0) return true; return false; @@ -452,9 +452,9 @@ bool IsResistableSpell(uint16 spell_id) bool IsGroupSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && - (spells[spell_id].targettype == ST_AEBard || - spells[spell_id].targettype == ST_Group || - spells[spell_id].targettype == ST_GroupTeleport)) + (spells[spell_id].target_type == ST_AEBard || + spells[spell_id].target_type == ST_Group || + spells[spell_id].target_type == ST_GroupTeleport)) return true; return false; @@ -464,7 +464,7 @@ bool IsGroupSpell(uint16 spell_id) bool IsTGBCompatibleSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && - (!IsDetrimentalSpell(spell_id) && spells[spell_id].buffduration != 0 && + (!IsDetrimentalSpell(spell_id) && spells[spell_id].buff_duration != 0 && !IsBardSong(spell_id) && !IsEffectInSpell(spell_id, SE_Illusion))) return true; @@ -473,7 +473,7 @@ bool IsTGBCompatibleSpell(uint16 spell_id) bool IsBardSong(uint16 spell_id) { - if (IsValidSpell(spell_id) && spells[spell_id].classes[BARD - 1] < 255 && !spells[spell_id].IsDisciplineBuff) + if (IsValidSpell(spell_id) && spells[spell_id].classes[BARD - 1] < 255 && !spells[spell_id].is_discipline) return true; return false; @@ -487,7 +487,7 @@ bool IsEffectInSpell(uint16 spellid, int effect) return false; for (j = 0; j < EFFECT_COUNT; j++) - if (spells[spellid].effectid[j] == effect) + if (spells[spellid].effect_id[j] == effect) return true; return false; @@ -498,15 +498,15 @@ bool IsEffectInSpell(uint16 spellid, int effect) // the blanks bool IsBlankSpellEffect(uint16 spellid, int effect_index) { - int effect, base, formula; + int effect, base_value, formula; - effect = spells[spellid].effectid[effect_index]; - base = spells[spellid].base[effect_index]; + effect = spells[spellid].effect_id[effect_index]; + base_value = spells[spellid].base_value[effect_index]; formula = spells[spellid].formula[effect_index]; // SE_CHA is "spacer" // SE_Stacking* are also considered blank where this is used - if (effect == SE_Blank || (effect == SE_CHA && base == 0 && formula == 100) || + if (effect == SE_Blank || (effect == SE_CHA && base_value == 0 && formula == 100) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) return true; @@ -561,7 +561,7 @@ int GetSpellEffectIndex(uint16 spell_id, int effect) return -1; for (i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == effect) + if (spells[spell_id].effect_id[i] == effect) return i; return -1; @@ -591,7 +591,7 @@ bool BeneficialSpell(uint16 spell_id) /*|| spells[spell_id].stacking == 27*/ ) return true; - switch (spells[spell_id].goodEffect) { + switch (spells[spell_id].good_effect) { case 1: case 3: return true; @@ -602,7 +602,7 @@ bool BeneficialSpell(uint16 spell_id) bool GroupOnlySpell(uint16 spell_id) { - switch (spells[spell_id].goodEffect) { + switch (spells[spell_id].good_effect) { case 2: case 3: return true; @@ -623,9 +623,9 @@ int32 CalculatePoisonCounters(uint16 spell_id) int32 Counters = 0; for (int i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == SE_PoisonCounter && - spells[spell_id].base[i] > 0) - Counters += spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_PoisonCounter && + spells[spell_id].base_value[i] > 0) + Counters += spells[spell_id].base_value[i]; return Counters; } @@ -637,9 +637,9 @@ int32 CalculateDiseaseCounters(uint16 spell_id) int32 Counters = 0; for (int i = 0; i < EFFECT_COUNT; i++) - if(spells[spell_id].effectid[i] == SE_DiseaseCounter && - spells[spell_id].base[i] > 0) - Counters += spells[spell_id].base[i]; + if(spells[spell_id].effect_id[i] == SE_DiseaseCounter && + spells[spell_id].base_value[i] > 0) + Counters += spells[spell_id].base_value[i]; return Counters; } @@ -651,9 +651,9 @@ int32 CalculateCurseCounters(uint16 spell_id) int32 Counters = 0; for (int i = 0; i < EFFECT_COUNT; i++) - if(spells[spell_id].effectid[i] == SE_CurseCounter && - spells[spell_id].base[i] > 0) - Counters += spells[spell_id].base[i]; + if(spells[spell_id].effect_id[i] == SE_CurseCounter && + spells[spell_id].base_value[i] > 0) + Counters += spells[spell_id].base_value[i]; return Counters; } @@ -665,9 +665,9 @@ int32 CalculateCorruptionCounters(uint16 spell_id) int32 Counters = 0; for (int i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == SE_CorruptionCounter && - spells[spell_id].base[i] > 0) - Counters += spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_CorruptionCounter && + spells[spell_id].base_value[i] > 0) + Counters += spells[spell_id].base_value[i]; return Counters; } @@ -695,7 +695,7 @@ bool IsDisciplineBuff(uint16 spell_id) if (!IsValidSpell(spell_id)) return false; - if (spells[spell_id].IsDisciplineBuff && spells[spell_id].targettype == ST_Self) + if (spells[spell_id].is_discipline && spells[spell_id].target_type == ST_Self) return true; return false; @@ -707,7 +707,7 @@ bool IsDiscipline(uint16 spell_id) return false; if (spells[spell_id].mana == 0 && - (spells[spell_id].EndurCost || spells[spell_id].EndurUpkeep)) + (spells[spell_id].endurance_cost || spells[spell_id].endurance_upkeep)) return true; return false; @@ -719,7 +719,7 @@ bool IsCombatSkill(uint16 spell_id) return false; //Check if Discipline - if ((spells[spell_id].mana == 0 && (spells[spell_id].EndurCost || spells[spell_id].EndurUpkeep))) + if ((spells[spell_id].mana == 0 && (spells[spell_id].endurance_cost || spells[spell_id].endurance_upkeep))) return true; return false; @@ -738,7 +738,7 @@ bool IsRuneSpell(uint16 spell_id) { if (IsValidSpell(spell_id)) for (int i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == SE_Rune) + if (spells[spell_id].effect_id[i] == SE_Rune) return true; return false; @@ -748,7 +748,7 @@ bool IsMagicRuneSpell(uint16 spell_id) { if(IsValidSpell(spell_id)) for(int i = 0; i < EFFECT_COUNT; i++) - if(spells[spell_id].effectid[i] == SE_AbsorbMagicAtt) + if(spells[spell_id].effect_id[i] == SE_AbsorbMagicAtt) return true; return false; @@ -758,8 +758,8 @@ bool IsManaTapSpell(uint16 spell_id) { if (IsValidSpell(spell_id)) for (int i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == SE_CurrentMana && - spells[spell_id].targettype == ST_Tap) + if (spells[spell_id].effect_id[i] == SE_CurrentMana && + spells[spell_id].target_type == ST_Tap) return true; return false; @@ -788,8 +788,8 @@ bool IsPartialDeathSaveSpell(uint16 spell_id) return false; for (int i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == SE_DeathSave && - spells[spell_id].base[i] == 1) + if (spells[spell_id].effect_id[i] == SE_DeathSave && + spells[spell_id].base_value[i] == 1) return true; return false; @@ -802,8 +802,8 @@ bool IsFullDeathSaveSpell(uint16 spell_id) return false; for (int i = 0; i < EFFECT_COUNT; i++) - if (spells[spell_id].effectid[i] == SE_DeathSave && - spells[spell_id].base[i] == 2) + if (spells[spell_id].effect_id[i] == SE_DeathSave && + spells[spell_id].base_value[i] == 2) return true; return false; @@ -852,7 +852,7 @@ bool IsGateSpell(uint16 spell_id) bool IsPlayerIllusionSpell(uint16 spell_id) { if (IsEffectInSpell(spell_id, SE_Illusion) && - spells[spell_id].targettype == ST_Self) + spells[spell_id].target_type == ST_Self) return true; return false; @@ -861,7 +861,7 @@ bool IsPlayerIllusionSpell(uint16 spell_id) int GetSpellEffectDescNum(uint16 spell_id) { if (IsValidSpell(spell_id)) - return spells[spell_id].effectdescnum; + return spells[spell_id].effect_description_id; return -1; } @@ -872,12 +872,12 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { LogSpells("DamageShieldType for spell [{}] ([{}]) is [{}]", spell_id, - spells[spell_id].name, spells[spell_id].DamageShieldType); + spells[spell_id].name, spells[spell_id].damage_shield_type); - if (spells[spell_id].DamageShieldType) - return (DmgShieldType) spells[spell_id].DamageShieldType; + if (spells[spell_id].damage_shield_type) + return (DmgShieldType) spells[spell_id].damage_shield_type; - switch (spells[spell_id].resisttype) { + switch (spells[spell_id].resist_type) { case RESIST_COLD: return DS_TORMENT; case RESIST_FIRE: @@ -907,12 +907,12 @@ bool IsLDoNObjectSpell(uint16 spell_id) int32 GetSpellResistType(uint16 spell_id) { - return spells[spell_id].resisttype; + return spells[spell_id].resist_type; } int32 GetSpellTargetType(uint16 spell_id) { - return (int32)spells[spell_id].targettype; + return (int32)spells[spell_id].target_type; } bool IsHealOverTimeSpell(uint16 spell_id) @@ -937,7 +937,7 @@ bool IsFastHealSpell(uint16 spell_id) const int MaxFastHealCastingTime = 2000; if (spells[spell_id].cast_time <= MaxFastHealCastingTime && - spells[spell_id].effectid[0] == 0 && spells[spell_id].base[0] > 0 && + spells[spell_id].effect_id[0] == 0 && spells[spell_id].base_value[0] > 0 && !IsGroupSpell(spell_id)) return true; @@ -949,7 +949,7 @@ bool IsVeryFastHealSpell(uint16 spell_id) const int MaxFastHealCastingTime = 1000; if (spells[spell_id].cast_time <= MaxFastHealCastingTime && - spells[spell_id].effectid[0] == 0 && spells[spell_id].base[0] > 0 && + spells[spell_id].effect_id[0] == 0 && spells[spell_id].base_value[0] > 0 && !IsGroupSpell(spell_id)) return true; @@ -958,8 +958,8 @@ bool IsVeryFastHealSpell(uint16 spell_id) bool IsRegularSingleTargetHealSpell(uint16 spell_id) { - if(spells[spell_id].effectid[0] == 0 && spells[spell_id].base[0] > 0 && - spells[spell_id].targettype == ST_Target && spells[spell_id].buffduration == 0 && + if(spells[spell_id].effect_id[0] == 0 && spells[spell_id].base_value[0] > 0 && + spells[spell_id].target_type == ST_Target && spells[spell_id].buff_duration == 0 && !IsCompleteHealSpell(spell_id) && !IsHealOverTimeSpell(spell_id) && !IsGroupSpell(spell_id)) return true; @@ -985,7 +985,7 @@ bool IsGroupCompleteHealSpell(uint16 spell_id) bool IsGroupHealOverTimeSpell(uint16 spell_id) { - if( IsGroupSpell(spell_id) && IsHealOverTimeSpell(spell_id) && spells[spell_id].buffduration < 10) + if( IsGroupSpell(spell_id) && IsHealOverTimeSpell(spell_id) && spells[spell_id].buff_duration < 10) return true; return false; @@ -1016,8 +1016,8 @@ bool IsResistDebuffSpell(uint16 spell_id) bool IsSelfConversionSpell(uint16 spell_id) { if (GetSpellTargetType(spell_id) == ST_Self && IsEffectInSpell(spell_id, SE_CurrentMana) && - IsEffectInSpell(spell_id, SE_CurrentHP) && spells[spell_id].base[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 && - spells[spell_id].base[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0) + IsEffectInSpell(spell_id, SE_CurrentHP) && spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentMana)] > 0 && + spells[spell_id].base_value[GetSpellEffectIndex(spell_id, SE_CurrentHP)] < 0) return true; else return false; @@ -1026,7 +1026,7 @@ bool IsSelfConversionSpell(uint16 spell_id) // returns true for both detrimental and beneficial buffs bool IsBuffSpell(uint16 spell_id) { - if (IsValidSpell(spell_id) && (spells[spell_id].buffduration || spells[spell_id].buffdurationformula)) + if (IsValidSpell(spell_id) && (spells[spell_id].buff_duration || spells[spell_id].buff_duration_formula)) return true; return false; @@ -1034,7 +1034,7 @@ bool IsBuffSpell(uint16 spell_id) bool IsPersistDeathSpell(uint16 spell_id) { - if (IsValidSpell(spell_id) && spells[spell_id].persistdeath) + if (IsValidSpell(spell_id) && spells[spell_id].persist_death) return true; return false; @@ -1051,8 +1051,8 @@ bool IsSuspendableSpell(uint16 spell_id) uint32 GetMorphTrigger(uint32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) - if (spells[spell_id].effectid[i] == SE_CastOnFadeEffect) - return spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_CastOnFadeEffect) + return spells[spell_id].base_value[i]; return 0; } @@ -1060,9 +1060,9 @@ uint32 GetMorphTrigger(uint32 spell_id) bool IsCastonFadeDurationSpell(uint16 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) { - if (spells[spell_id].effectid[i] == SE_CastOnFadeEffect - || spells[spell_id].effectid[i] == SE_CastOnFadeEffectNPC - || spells[spell_id].effectid[i] == SE_CastOnFadeEffectAlways){ + if (spells[spell_id].effect_id[i] == SE_CastOnFadeEffect + || spells[spell_id].effect_id[i] == SE_CastOnFadeEffectNPC + || spells[spell_id].effect_id[i] == SE_CastOnFadeEffectAlways){ return true; } @@ -1073,7 +1073,7 @@ bool IsCastonFadeDurationSpell(uint16 spell_id) bool IsPowerDistModSpell(uint16 spell_id) { if (IsValidSpell(spell_id) && - (spells[spell_id].max_dist_mod || spells[spell_id].min_dist_mod) && spells[spell_id].max_dist > spells[spell_id].min_dist) + (spells[spell_id].max_distance_mod || spells[spell_id].min_distance_mod) && spells[spell_id].max_distance > spells[spell_id].min_distance) return true; return false; @@ -1082,8 +1082,8 @@ bool IsPowerDistModSpell(uint16 spell_id) uint32 GetPartialMeleeRuneReduction(uint32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) - if (spells[spell_id].effectid[i] == SE_MitigateMeleeDamage) - return spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_MitigateMeleeDamage) + return spells[spell_id].base_value[i]; return 0; } @@ -1091,8 +1091,8 @@ uint32 GetPartialMeleeRuneReduction(uint32 spell_id) uint32 GetPartialMagicRuneReduction(uint32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) - if (spells[spell_id].effectid[i] == SE_MitigateSpellDamage) - return spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_MitigateSpellDamage) + return spells[spell_id].base_value[i]; return 0; } @@ -1100,8 +1100,8 @@ uint32 GetPartialMagicRuneReduction(uint32 spell_id) uint32 GetPartialMeleeRuneAmount(uint32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) - if (spells[spell_id].effectid[i] == SE_MitigateMeleeDamage) - return spells[spell_id].max[i]; + if (spells[spell_id].effect_id[i] == SE_MitigateMeleeDamage) + return spells[spell_id].max_value[i]; return 0; } @@ -1109,8 +1109,8 @@ uint32 GetPartialMeleeRuneAmount(uint32 spell_id) uint32 GetPartialMagicRuneAmount(uint32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) - if (spells[spell_id].effectid[i] == SE_MitigateSpellDamage) - return spells[spell_id].max[i]; + if (spells[spell_id].effect_id[i] == SE_MitigateSpellDamage) + return spells[spell_id].max_value[i]; return 0; } @@ -1119,7 +1119,7 @@ uint32 GetPartialMagicRuneAmount(uint32 spell_id) bool DetrimentalSpellAllowsRest(uint16 spell_id) { if (IsValidSpell(spell_id)) - return spells[spell_id].AllowRest; + return spells[spell_id].allow_rest; return false; } @@ -1138,7 +1138,7 @@ bool IsStackableDot(uint16 spell_id) if (!IsValidSpell(spell_id)) return false; const auto &spell = spells[spell_id]; - if (spell.dot_stacking_exempt || spell.goodEffect || !spell.buffdurationformula) + if (spell.unstackable_dot || spell.good_effect || !spell.buff_duration_formula) return false; return IsEffectInSpell(spell_id, SE_CurrentHP) || IsEffectInSpell(spell_id, SE_GravityEffect); } @@ -1307,7 +1307,7 @@ bool IsFocusLimit(int spa) uint32 GetNimbusEffect(uint16 spell_id) { if (IsValidSpell(spell_id)) - return (int32)spells[spell_id].NimbusEffect; + return (int32)spells[spell_id].nimbus_effect; return 0; } @@ -1321,9 +1321,9 @@ int32 GetFuriousBash(uint16 spell_id) int32 mod = 0; for (int i = 0; i < EFFECT_COUNT; ++i) - if (spells[spell_id].effectid[i] == SE_SpellHateMod) - mod = spells[spell_id].base[i]; - else if (spells[spell_id].effectid[i] == SE_LimitEffect && spells[spell_id].base[i] == 999) + if (spells[spell_id].effect_id[i] == SE_SpellHateMod) + mod = spells[spell_id].base_value[i]; + else if (spells[spell_id].effect_id[i] == SE_LimitEffect && spells[spell_id].base_value[i] == 999) found_effect_limit = true; if (found_effect_limit) @@ -1344,8 +1344,8 @@ bool IsSpellUsableThisZoneType(uint16 spell_id, uint8 zone_type) { //check if spell can be cast in any zone (-1 or 255), then if spell zonetype matches zone's zonetype // || spells[spell_id].zonetype == 255 comparing signed 8 bit int to 255 is always false - if (IsValidSpell(spell_id) && (spells[spell_id].zonetype == -1 || - spells[spell_id].zonetype == zone_type)) + if (IsValidSpell(spell_id) && (spells[spell_id].zone_type == -1 || + spells[spell_id].zone_type == zone_type)) return true; return false; @@ -1358,11 +1358,11 @@ const char* GetSpellName(uint16 spell_id) bool SpellRequiresTarget(int spell_id) { - if (spells[spell_id].targettype == ST_AEClientV1 || - spells[spell_id].targettype == ST_Self || - spells[spell_id].targettype == ST_AECaster || - spells[spell_id].targettype == ST_Ring || - spells[spell_id].targettype == ST_Beam) { + if (spells[spell_id].target_type == ST_AEClientV1 || + spells[spell_id].target_type == ST_Self || + spells[spell_id].target_type == ST_AECaster || + spells[spell_id].target_type == ST_Ring || + spells[spell_id].target_type == ST_Beam) { return false; } return true; @@ -1377,7 +1377,7 @@ bool IsInstrumentModAppliedToSpellEffect(int32 spell_id, int effect) //Only modify instant endurance or mana effects (Ie. Mana drain, Crescendo line) case SE_CurrentEndurance: case SE_CurrentMana: { - if (spells[spell_id].buffduration == 0) { + if (spells[spell_id].buff_duration == 0) { return true; } //Mana regen is not modified. @@ -1483,94 +1483,94 @@ int GetSpellStatValue(uint32 spell_id, const char* stat_identifier, uint8 slot) } if (slot < 12) { - if (id == "base") { return spells[spell_id].base[slot]; } - else if (id == "base2") { return spells[spell_id].base2[slot]; } - else if (id == "max") { return spells[spell_id].max[slot]; } + if (id == "base") { return spells[spell_id].base_value[slot]; } + else if (id == "base2") { return spells[spell_id].limit_value[slot]; } + else if (id == "max") { return spells[spell_id].max_value[slot]; } else if (id == "formula") { return spells[spell_id].formula[slot]; } - else if (id == "effectid") { return spells[spell_id].effectid[slot]; } + else if (id == "effectid") { return spells[spell_id].effect_id[slot]; } } if (slot < 4) { - if (id == "components") { return spells[spell_id].components[slot]; } - else if (id == "component_counts") { return spells[spell_id].component_counts[slot]; } - else if (id == "noexpendreagent") { return spells[spell_id].NoexpendReagent[slot]; } + if (id == "components") { return spells[spell_id].component[slot]; } + else if (id == "component_counts") { return spells[spell_id].component_count[slot]; } + else if (id == "noexpendreagent") { return spells[spell_id].no_expend_reagent[slot]; } } if (id == "range") { return static_cast(spells[spell_id].range); } - else if (id == "aoerange") { return static_cast(spells[spell_id].aoerange); } - else if (id == "pushback") { return static_cast(spells[spell_id].pushback); } - else if (id == "pushup") { return static_cast(spells[spell_id].pushup); } + else if (id == "aoe_range") { return static_cast(spells[spell_id].aoe_range); } + else if (id == "push_back") { return static_cast(spells[spell_id].push_back); } + else if (id == "push_up") { return static_cast(spells[spell_id].push_up); } else if (id == "cast_time") { return spells[spell_id].cast_time; } else if (id == "recovery_time") { return spells[spell_id].recovery_time; } else if (id == "recast_time") { return spells[spell_id].recast_time; } - else if (id == "buffdurationformula") { return spells[spell_id].buffdurationformula; } - else if (id == "buffduration") { return spells[spell_id].buffduration; } - else if (id == "aeduration") { return spells[spell_id].AEDuration; } + else if (id == "buff_duration_formula") { return spells[spell_id].buff_duration_formula; } + else if (id == "buff_duration") { return spells[spell_id].buff_duration; } + else if (id == "aeduration") { return spells[spell_id].aoe_duration; } else if (id == "mana") { return spells[spell_id].mana; } //else if (id == "LightType") {stat = spells[spell_id].LightType; } - Not implemented - else if (id == "goodeffect") { return spells[spell_id].goodEffect; } - else if (id == "activated") { return spells[spell_id].Activated; } - else if (id == "resisttype") { return spells[spell_id].resisttype; } - else if (id == "targettype") { return spells[spell_id].targettype; } - else if (id == "basediff") { return spells[spell_id].basediff; } + else if (id == "goodeffect") { return spells[spell_id].good_effect; } + else if (id == "activated") { return spells[spell_id].activated; } + else if (id == "resisttype") { return spells[spell_id].resist_type; } + else if (id == "targettype") { return spells[spell_id].target_type; } + else if (id == "basediff") { return spells[spell_id].base_difficulty; } else if (id == "skill") { return spells[spell_id].skill; } - else if (id == "zonetype") { return spells[spell_id].zonetype; } - else if (id == "environmenttype") { return spells[spell_id].EnvironmentType; } - else if (id == "timeofday") { return spells[spell_id].TimeOfDay; } - else if (id == "castinganim") { return spells[spell_id].CastingAnim; } - else if (id == "spellaffectindex") { return spells[spell_id].SpellAffectIndex; } + else if (id == "zonetype") { return spells[spell_id].zone_type; } + else if (id == "environmenttype") { return spells[spell_id].environment_type; } + else if (id == "timeofday") { return spells[spell_id].time_of_day; } + else if (id == "castinganim") { return spells[spell_id].casting_animation; } + else if (id == "spellaffectindex") { return spells[spell_id].spell_affect_index; } else if (id == "disallow_sit") { return spells[spell_id].disallow_sit; } //else if (id == "spellanim") {stat = spells[spell_id].spellanim; } - Not implemented else if (id == "uninterruptable") { return spells[spell_id].uninterruptable; } - else if (id == "resistdiff") { return spells[spell_id].ResistDiff; } - else if (id == "dot_stacking_exempt") { return spells[spell_id].dot_stacking_exempt; } - else if (id == "recourselink") { return spells[spell_id].RecourseLink; } + else if (id == "resistdiff") { return spells[spell_id].resist_difficulty; } + else if (id == "dot_stacking_exempt") { return spells[spell_id].unstackable_dot; } + else if (id == "recourselink") { return spells[spell_id].recourse_link; } else if (id == "no_partial_resist") { return spells[spell_id].no_partial_resist; } else if (id == "short_buff_box") { return spells[spell_id].short_buff_box; } - else if (id == "descnum") { return spells[spell_id].descnum; } - else if (id == "effectdescnum") { return spells[spell_id].effectdescnum; } + else if (id == "descnum") { return spells[spell_id].description_id; } + else if (id == "effectdescnum") { return spells[spell_id].effect_description_id; } else if (id == "npc_no_los") { return spells[spell_id].npc_no_los; } else if (id == "feedbackable") { return spells[spell_id].feedbackable; } else if (id == "reflectable") { return spells[spell_id].reflectable; } - else if (id == "bonushate") { return spells[spell_id].bonushate; } - else if (id == "endurcost") { return spells[spell_id].EndurCost; } - else if (id == "endurtimerindex") { return spells[spell_id].EndurTimerIndex; } - else if (id == "isdisciplinebuff") { return spells[spell_id].IsDisciplineBuff; } - else if (id == "hateadded") { return spells[spell_id].HateAdded; } - else if (id == "endurupkeep") { return spells[spell_id].EndurUpkeep; } - else if (id == "numhitstype") { return spells[spell_id].numhitstype; } - else if (id == "numhits") { return spells[spell_id].numhits; } - else if (id == "pvpresistbase") { return spells[spell_id].pvpresistbase; } - else if (id == "pvpresistcalc") { return spells[spell_id].pvpresistcalc; } - else if (id == "pvpresistcap") { return spells[spell_id].pvpresistcap; } + else if (id == "bonushate") { return spells[spell_id].bonus_hate; } + else if (id == "endurcost") { return spells[spell_id].endurance_cost; } + else if (id == "endurtimerindex") { return spells[spell_id].timer_id; } + else if (id == "isdisciplinebuff") { return spells[spell_id].is_discipline; } + else if (id == "hateadded") { return spells[spell_id].hate_added; } + else if (id == "endurupkeep") { return spells[spell_id].endurance_upkeep; } + else if (id == "numhitstype") { return spells[spell_id].hit_number_type; } + else if (id == "numhits") { return spells[spell_id].hit_number; } + else if (id == "pvpresistbase") { return spells[spell_id].pvp_resist_base; } + else if (id == "pvpresistcalc") { return spells[spell_id].pvp_resist_per_level; } + else if (id == "pvpresistcap") { return spells[spell_id].pvp_resist_cap; } else if (id == "spell_category") { return spells[spell_id].spell_category; } else if (id == "can_mgb") { return spells[spell_id].can_mgb; } else if (id == "dispel_flag") { return spells[spell_id].dispel_flag; } - else if (id == "minresist") { return spells[spell_id].MinResist; } - else if (id == "maxresist") { return spells[spell_id].MaxResist; } + else if (id == "minresist") { return spells[spell_id].min_resist; } + else if (id == "maxresist") { return spells[spell_id].max_resist; } else if (id == "viral_targets") { return spells[spell_id].viral_targets; } else if (id == "viral_timer") { return spells[spell_id].viral_timer; } - else if (id == "nimbuseffect") { return spells[spell_id].NimbusEffect; } + else if (id == "nimbuseffect") { return spells[spell_id].nimbus_effect; } else if (id == "directional_start") { return static_cast(spells[spell_id].directional_start); } else if (id == "directional_end") { return static_cast(spells[spell_id].directional_end); } else if (id == "not_focusable") { return spells[spell_id].not_focusable; } else if (id == "suspendable") { return spells[spell_id].suspendable; } else if (id == "viral_range") { return spells[spell_id].viral_range; } - else if (id == "spellgroup") { return spells[spell_id].spellgroup; } + else if (id == "spellgroup") { return spells[spell_id].spell_group; } else if (id == "rank") { return spells[spell_id].rank; } else if (id == "no_resist") { return spells[spell_id].no_resist; } - else if (id == "castrestriction") { return spells[spell_id].CastRestriction; } - else if (id == "allowrest") { return spells[spell_id].AllowRest; } - else if (id == "incombat") { return spells[spell_id].InCombat; } - else if (id == "outofcombat") { return spells[spell_id].OutofCombat; } - else if (id == "aemaxtargets") { return spells[spell_id].aemaxtargets; } + else if (id == "castrestriction") { return spells[spell_id].cast_restriction; } + else if (id == "allowrest") { return spells[spell_id].allow_rest; } + else if (id == "incombat") { return spells[spell_id].can_cast_in_combat; } + else if (id == "outofcombat") { return spells[spell_id].can_cast_out_of_combat; } + else if (id == "aemaxtargets") { return spells[spell_id].aoe_max_targets; } else if (id == "no_heal_damage_item_mod") { return spells[spell_id].no_heal_damage_item_mod; } - else if (id == "persistdeath") { return spells[spell_id].persistdeath; } - else if (id == "min_dist") { return static_cast(spells[spell_id].min_dist); } - else if (id == "min_dist_mod") { return static_cast(spells[spell_id].min_dist_mod); } - else if (id == "max_dist") { return static_cast(spells[spell_id].max_dist); } + else if (id == "persistdeath") { return spells[spell_id].persist_death; } + else if (id == "min_dist") { return static_cast(spells[spell_id].min_distance); } + else if (id == "min_dist_mod") { return static_cast(spells[spell_id].min_distance_mod); } + else if (id == "max_dist") { return static_cast(spells[spell_id].max_distance); } else if (id == "min_range") { return static_cast(spells[spell_id].min_range); } - else if (id == "damageshieldtype") { return spells[spell_id].DamageShieldType; } + else if (id == "damageshieldtype") { return spells[spell_id].damage_shield_type; } return 0; } diff --git a/common/spdat.h b/common/spdat.h index b4535cf1d..9710e1825 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -561,7 +561,7 @@ const uint32 SPELL_TYPES_INNATE = (SpellType_Nuke | SpellType_Lifetap | SpellTyp // These should not be used to determine spell category.. // They are a graphical affects (effects?) index only // TODO: import sai list -enum SpellAffectIndex { +enum spell_affect_index { SAI_Summon_Mount_Unclass = -1, SAI_Direct_Damage = 0, SAI_Heal_Cure = 1, @@ -1252,44 +1252,44 @@ struct SPDat_Spell_Struct /* 007 */ char cast_on_other[64]; // Message when spell is cast on someone else -- CASTEDOTHERTXT /* 008 */ char spell_fades[64]; // Spell fades -- SPELLGONE /* 009 */ float range; // -- RANGE -/* 010 */ float aoerange; // -- IMPACTRANGE -/* 011 */ float pushback; // -- OUTFORCE -/* 012 */ float pushup; // -- UPFORCE +/* 010 */ float aoe_range; // -- IMPACTRANGE +/* 011 */ float push_back; // -- OUTFORCE +/* 012 */ float push_up; // -- UPFORCE /* 013 */ uint32 cast_time; // Cast time -- CASTINGTIME /* 014 */ uint32 recovery_time; // Recovery time -- RECOVERYDELAY /* 015 */ uint32 recast_time; // Recast same spell time -- SPELLDELAY -/* 016 */ uint32 buffdurationformula; // -- DURATIONBASE -/* 017 */ uint32 buffduration; // -- DURATIONCAP -/* 018 */ uint32 AEDuration; // sentinel, rain of something -- IMPACTDURATION +/* 016 */ uint32 buff_duration_formula; // -- DURATIONBASE +/* 017 */ uint32 buff_duration; // -- DURATIONCAP +/* 018 */ uint32 aoe_duration; // sentinel, rain of something -- IMPACTDURATION /* 019 */ uint16 mana; // Mana Used -- MANACOST -/* 020 */ int base[EFFECT_COUNT]; //various purposes -- BASEAFFECT1 .. BASEAFFECT12 -/* 032 */ int base2[EFFECT_COUNT]; //various purposes -- BASE_EFFECT2_1 ... BASE_EFFECT2_12 -/* 044 */ int32 max[EFFECT_COUNT]; // -- AFFECT1CAP ... AFFECT12CAP +/* 020 */ int base_value[EFFECT_COUNT]; //various purposes -- BASEAFFECT1 .. BASEAFFECT12 +/* 032 */ int limit_value[EFFECT_COUNT]; //various purposes -- BASE_EFFECT2_1 ... BASE_EFFECT2_12 +/* 044 */ int32 max_value[EFFECT_COUNT]; // -- AFFECT1CAP ... AFFECT12CAP /* 056 */ //uint16 icon; // Spell icon -- IMAGENUMBER /* 057 */ //uint16 memicon; // Icon on membarthing -- MEMIMAGENUMBER -/* 058 */ int32 components[4]; // reagents -- EXPENDREAGENT1 ... EXPENDREAGENT4 -/* 062 */ int component_counts[4]; // amount of regents used -- EXPENDQTY1 ... EXPENDQTY4 -/* 066 */ int NoexpendReagent[4]; // focus items (Need but not used; Flame Lick has a Fire Beetle Eye focus.) +/* 058 */ int32 component[4]; // reagents -- EXPENDREAGENT1 ... EXPENDREAGENT4 +/* 062 */ int component_count[4]; // amount of regents used -- EXPENDQTY1 ... EXPENDQTY4 +/* 066 */ int no_expend_reagent[4]; // focus items (Need but not used; Flame Lick has a Fire Beetle Eye focus.) // If it is a number between 1-4 it means components[number] is a focus and not to expend it // If it is a valid itemid it means this item is a focus as well // -- NOEXPENDREAGENT1 ... NOEXPENDREAGENT4 /* 070 */ uint16 formula[EFFECT_COUNT]; // Spell's value formula -- LEVELAFFECT1MOD ... LEVELAFFECT12MOD /* 082 */ //int LightType; // probaly another effecttype flag -- LIGHTTYPE -/* 083 */ int8 goodEffect; //0=detrimental, 1=Beneficial, 2=Beneficial, Group Only -- BENEFICIAL -/* 084 */ int Activated; // probably another effecttype flag -- ACTIVATED -/* 085 */ int resisttype; // -- RESISTTYPE -/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects -- SPELLAFFECT1 ... SPELLAFFECT12 -/* 098 */ SpellTargetType targettype; // Spell's Target -- TYPENUMBER -/* 099 */ int basediff; // base difficulty fizzle adjustment -- BASEDIFFICULTY +/* 083 */ int8 good_effect; //0=detrimental, 1=Beneficial, 2=Beneficial, Group Only -- BENEFICIAL +/* 084 */ int activated; // probably another effecttype flag -- ACTIVATED +/* 085 */ int resist_type; // -- RESISTTYPE +/* 086 */ int effect_id[EFFECT_COUNT]; // Spell's effects -- SPELLAFFECT1 ... SPELLAFFECT12 +/* 098 */ SpellTargetType target_type; // Spell's Target -- TYPENUMBER +/* 099 */ int base_difficulty; // base difficulty fizzle adjustment -- BASEDIFFICULTY /* 100 */ EQ::skills::SkillType skill; // -- CASTINGSKILL -/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any -- ZONETYPE -/* 102 */ int8 EnvironmentType; // -- ENVIRONMENTTYPE -/* 103 */ int8 TimeOfDay; // -- TIMEOFDAY +/* 101 */ int8 zone_type; // 01=Outdoors, 02=dungeons, ff=Any -- ZONETYPE +/* 102 */ int8 environment_type; // -- ENVIRONMENTTYPE +/* 103 */ int8 time_of_day; // -- TIMEOFDAY /* 104 */ uint8 classes[PLAYER_CLASS_COUNT]; // Classes, and their min levels -- WARRIORMIN ... BERSERKERMIN -/* 120 */ uint8 CastingAnim; // -- CASTINGANIM +/* 120 */ uint8 casting_animation; // -- CASTINGANIM /* 121 */ //uint8 TargetAnim; // -- TARGETANIM /* 122 */ //uint32 TravelType; // -- TRAVELTYPE -/* 123 */ uint16 SpellAffectIndex; // -- SPELLAFFECTINDEX +/* 123 */ uint16 spell_affect_index; // -- SPELLAFFECTINDEX /* 124 */ int8 disallow_sit; // 124: high-end Yaulp spells (V, VI, VII, VIII [Rk 1, 2, & 3], & Gallenite's Bark of Fury -- CANCELONSIT /* 125 */ int8 deity_agnostic;// 125: Words of the Skeptic -- DEITY_AGNOSTIC /* 126 */ int8 deities[16]; // Deity check. 201 - 216 per http://www.eqemulator.net/wiki/wikka.php?wakka=DeityList @@ -1301,36 +1301,36 @@ struct SPDat_Spell_Struct /* 144 */ int16 new_icon; // Spell icon used by the client in uifiles/default/spells??.tga, both for spell gems & buff window. Looks to depreciate icon & memicon -- NEW_ICON /* 145 */ //int16 spellanim; // Doesn't look like it's the same as #doanim, so not sure what this is, particles I think -- SPELL_EFFECT_INDEX /* 146 */ bool uninterruptable; // Looks like anything != 0 is uninterruptable. Values are mostly -1, 0, & 1 (Fetid Breath = 90?) -- NO_INTERRUPT -/* 147 */ int16 ResistDiff; // -- RESIST_MOD -/* 148 */ bool dot_stacking_exempt; // -- NOT_STACKABLE_DOT +/* 147 */ int16 resist_difficulty; // -- RESIST_MOD +/* 148 */ bool unstackable_dot; // -- NOT_STACKABLE_DOT /* 149 */ //int deletable; // -- DELETE_OK -/* 150 */ uint16 RecourseLink; // -- REFLECT_SPELLINDEX +/* 150 */ uint16 recourse_link; // -- REFLECT_SPELLINDEX /* 151 */ bool no_partial_resist; // 151: -1, 0, or 1 -- NO_PARTIAL_SAVE /* 152 */ //bool small_targets_only; // -- SMALL_TARGETS_ONLY /* 153 */ //bool uses_persistent_particles; // -- USES_PERSISTENT_PARTICLES /* 154 */ int8 short_buff_box; // != 0, goes to short buff box. -- BARD_BUFF_BOX -/* 155 */ int descnum; // eqstr of description of spell -- DESCRIPTION_INDEX -/* 156 */ int typedescnum; // eqstr of type description -- PRIMARY_CATEGORY -/* 157 */ int effectdescnum; // eqstr of effect description -- SECONDARY_CATEGORY_1 +/* 155 */ int description_id; // eqstr of description of spell -- DESCRIPTION_INDEX +/* 156 */ int type_description_id; // eqstr of type description -- PRIMARY_CATEGORY +/* 157 */ int effect_description_id; // eqstr of effect description -- SECONDARY_CATEGORY_1 /* 158 */ //int secondary_category_2; //Category Desc ID 3 -- SECONDARY_CATEGORY_2 /* 159 */ bool npc_no_los; // -- NO_NPC_LOS /* 160 */ bool feedbackable; // -- FEEDBACKABLE /* 161 */ bool reflectable; // -- REFLECTABLE -/* 162 */ int bonushate; // -- HATE_MOD +/* 162 */ int bonus_hate; // -- HATE_MOD /* 163 */ //int resist_per_level; // -- RESIST_PER_LEVEL /* 164 */ //int resist_cap; // for most spells this appears to mimic ResistDiff -- RESIST_CAP /* 165 */ bool ldon_trap; //Flag found on all LDON trap / chest related spells. -- AFFECT_INANIMATE -/* 166 */ int EndurCost; // -- STAMINA_COST -/* 167 */ int8 EndurTimerIndex; // bad name, used for all spells -- TIMER_INDEX -/* 168 */ bool IsDisciplineBuff; //Will goto the combat window when cast -- IS_SKILL +/* 166 */ int endurance_cost; // -- STAMINA_COST +/* 167 */ int8 timer_id; // bad name, used for all spells -- TIMER_INDEX +/* 168 */ bool is_discipline; //Will goto the combat window when cast -- IS_SKILL /* 169 - 172*/ //These are zero for ALL spells, also removed from live -- ATTACK_OPENING, DEFENSE_OPENING, SKILL_OPENING, NPC_ERROR_OPENING -/* 173 */ int HateAdded; // -- SPELL_HATE_GIVEN -/* 174 */ int EndurUpkeep; // -- ENDUR_UPKEEP -/* 175 */ int numhitstype; // defines which type of behavior will tick down the numhit counter. -- LIMITED_USE_TYPE -/* 176 */ int numhits; // -- LIMITED_USE_COUNT -/* 177 */ int pvpresistbase; // -- PVP_RESIST_MOD -/* 178 */ int pvpresistcalc; // -- PVP_RESIST_PER_LEVEL -/* 179 */ int pvpresistcap; // -- PVP_RESIST_CAP +/* 173 */ int hate_added; // -- SPELL_HATE_GIVEN +/* 174 */ int endurance_upkeep; // -- ENDUR_UPKEEP +/* 175 */ int hit_number_type; // defines which type of behavior will tick down the numhit counter. -- LIMITED_USE_TYPE +/* 176 */ int hit_number; // -- LIMITED_USE_COUNT +/* 177 */ int pvp_resist_base; // -- PVP_RESIST_MOD +/* 178 */ int pvp_resist_per_level; // -- PVP_RESIST_PER_LEVEL +/* 179 */ int pvp_resist_cap; // -- PVP_RESIST_CAP /* 180 */ int spell_category; // -- GLOBAL_GROUP /* 181 */ int pvp_duration; // buffdurationformula for PvP -- PVP_DURATION /* 182 */ int pvp_duration_cap; // buffduration for PvP -- PVP_DURATION_CAP @@ -1340,11 +1340,11 @@ struct SPDat_Spell_Struct /* 186 */ int dispel_flag; // -- NO_DISPELL /* 187 */ //int npc_category; // -- NPC_MEM_CATEGORY /* 188 */ //int npc_usefulness; // -- NPC_USEFULNESS -/* 189 */ int MinResist; // -- MIN_RESIST -/* 190 */ int MaxResist; // -- MAX_RESIST -/* 191 */ int viral_targets; // -- MIN_SPREAD_TIME -/* 192 */ int viral_timer; // -- MAX_SPREAD_TIME -/* 193 */ int NimbusEffect; // -- DURATION_PARTICLE_EFFECT +/* 189 */ int min_resist; // -- MIN_RESIST +/* 190 */ int max_resist; // -- MAX_RESIST +/* 191 */ uint8 viral_targets; // -- MIN_SPREAD_TIME +/* 192 */ uint8 viral_timer; // -- MAX_SPREAD_TIME +/* 193 */ int nimbus_effect; // -- DURATION_PARTICLE_EFFECT /* 194 */ float directional_start; //Cone Start Angle: -- CONE_START_ANGLE /* 195 */ float directional_end; // Cone End Angle: -- CONE_END_ANGLE /* 196 */ bool sneak; // effect can only be used if sneaking (rogue 'Daggerfall' ect) -- SNEAK_ATTACK @@ -1353,35 +1353,35 @@ struct SPDat_Spell_Struct /* 199 */ //bool show_wear_off_message; // -- SHOW_WEAR_OFF_MESSAGE /* 200 */ bool suspendable; // buff is suspended in suspended buff zones -- IS_COUNTDOWN_HELD /* 201 */ int viral_range; // -- SPREAD_RADIUS -/* 202 */ int songcap; // individual song cap -- BASE_EFFECTS_FOCUS_CAP +/* 202 */ int song_cap; // individual song cap -- BASE_EFFECTS_FOCUS_CAP /* 203 */ //bool stacks_with_self; // -- STACKS_WITH_SELF /* 204 */ //int not_shown_to_player; // client skips this -- NOT_SHOWN_TO_PLAYER /* 205 */ bool no_block; // -- NO_BUFF_BLOCK /* 206 */ //int8 anim_variation; // -- ANIM_VARIATION -/* 207 */ int spellgroup; // -- SPELL_GROUP +/* 207 */ int spell_group; // -- SPELL_GROUP /* 208 */ int rank; //increments AA effects with same name -- SPELL_GROUP_RANK /* 209 */ int no_resist; //makes spells unresistable, which makes charms unbreakable as well. -- NO_RESIST /* 210 */ // bool allow_spellscribe; // -- ALLOW_SPELLSCRIBE -/* 211 */ int CastRestriction; //Various restriction categories for spells most seem targetable race related but have also seen others for instance only castable if target hp 20% or lower or only if target out of combat -- SPELL_REQ_ASSOCIATION_ID -/* 212 */ bool AllowRest; // -- BYPASS_REGEN_CHECK -/* 213 */ bool InCombat; //Allow spell if target is in combat -- CAN_CAST_IN_COMBAT -/* 214 */ bool OutofCombat; //Allow spell if target is out of combat -- CAN_CAST_OUT_OF_COMBAT +/* 211 */ int cast_restriction; //Various restriction categories for spells most seem targetable race related but have also seen others for instance only castable if target hp 20% or lower or only if target out of combat -- SPELL_REQ_ASSOCIATION_ID +/* 212 */ bool allow_rest; // -- BYPASS_REGEN_CHECK +/* 213 */ bool can_cast_in_combat; //Allow spell if target is in combat -- CAN_CAST_IN_COMBAT +/* 214 */ bool can_cast_out_of_combat; //Allow spell if target is out of combat -- CAN_CAST_OUT_OF_COMBAT /* 215 */ //bool show_dot_message; // -- SHOW_DOT_MESSAGE /* 216 */ //bool invalid; // -- INVALID /* 217 */ int override_crit_chance; //Places a cap on the max chance to critical -- OVERRIDE_CRIT_CHANCE -/* 218 */ int aemaxtargets; //Is used for various AE effects -- MAX_TARGETS +/* 218 */ int aoe_max_targets; //Is used for various AE effects -- MAX_TARGETS /* 219 */ int no_heal_damage_item_mod; // -- NO_HEAL_DAMAGE_ITEM_MOD /* 220 */ int caster_requirement_id; // -- CASTER_REQUIREMENT_ID /* 221 */ int spell_class; // -- SPELL_CLASS /* 222 */ int spell_subclass; // -- SPELL_SUBCLASS /* 223 */ //int ai_valid_targets; // -- AI_VALID_TARGETS -/* 224 */ bool persistdeath; // buff doesn't get stripped on death -- NO_STRIP_ON_DEATH +/* 224 */ bool persist_death; // buff doesn't get stripped on death -- NO_STRIP_ON_DEATH /* 225 */ //float base_effects_focus_slope; // -- BASE_EFFECTS_FOCUS_SLOPE /* 226 */ //float base_effects_focus_offset; // -- BASE_EFFECTS_FOCUS_OFFSET -/* 227 */ float min_dist; //spell power modified by distance from caster (Min Distance) -- DISTANCE_MOD_CLOSE_DIST -/* 228 */ float min_dist_mod; //spell power modified by distance from caster (Modifier at Min Distance) -- DISTANCE_MOD_CLOSE_MULT -/* 229 */ float max_dist; //spell power modified by distance from caster (Max Distance) -- DISTANCE_MOD_FAR_DIST -/* 230 */ float max_dist_mod; //spell power modified by distance from caster (Modifier at Max Distance) -- DISTANCE_MOD_FAR_MULT +/* 227 */ float min_distance; //spell power modified by distance from caster (Min Distance) -- DISTANCE_MOD_CLOSE_DIST +/* 228 */ float min_distance_mod; //spell power modified by distance from caster (Modifier at Min Distance) -- DISTANCE_MOD_CLOSE_MULT +/* 229 */ float max_distance; //spell power modified by distance from caster (Max Distance) -- DISTANCE_MOD_FAR_DIST +/* 230 */ float max_distance_mod; //spell power modified by distance from caster (Modifier at Max Distance) -- DISTANCE_MOD_FAR_MULT /* The client also does this * v26 = *(float *)&v4->DistanceModFarDist - *(float *)&v4->DistanceModCloseDist; * if ( v26 > -0.00000011920929 && v26 < 0.00000011920929 ) @@ -1395,7 +1395,7 @@ struct SPDat_Spell_Struct /* 234 */ //bool only_during_fast_regen; // -- ONLY_DURING_FAST_REGEN /* 235 */ //bool is_beta_only; // -- IS_BETA_ONLY /* 236 */ //int spell_subgroup; // -- SPELL_SUBGROUP - uint8 DamageShieldType; // This field does not exist in spells_us.txt + uint8 damage_shield_type; // This field does not exist in spells_us.txt }; extern const SPDat_Spell_Struct* spells; @@ -1508,7 +1508,7 @@ bool IsBardOnlyStackEffect(int effect); bool IsCastWhileInvis(uint16 spell_id); bool IsEffectIgnoredInStacking(int spa); bool IsFocusLimit(int spa); -bool SpellRequiresTarget(int targettype); +bool SpellRequiresTarget(int target_type); bool IsVirusSpell(int32 spell_id); int GetViralMinSpreadTime(int32 spell_id); int GetViralMaxSpreadTime(int32 spell_id); diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 9f519b498..dd4188c25 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -121,6 +121,7 @@ SET(zone_sources perl_player_corpse.cpp perl_questitem.cpp perl_raids.cpp + perl_spell.cpp perlpacket.cpp petitions.cpp pets.cpp diff --git a/zone/aa.cpp b/zone/aa.cpp index fff2ae727..f114abb93 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -69,10 +69,10 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u for (int x = 0; x < MAX_SWARM_PETS; x++) { - if (spells[spell_id].effectid[x] == SE_TemporaryPets) + if (spells[spell_id].effect_id[x] == SE_TemporaryPets) { - pet.count = spells[spell_id].base[x]; - pet.duration = spells[spell_id].max[x]; + pet.count = spells[spell_id].base_value[x]; + pet.duration = spells[spell_id].max_value[x]; } } @@ -764,7 +764,7 @@ void Client::InspectBuffs(Client* Inspector, int Rank) continue; ib->spell_id[packet_index] = buffs[i].spellid; if (Rank > 1) - ib->tics_remaining[packet_index] = spells[buffs[i].spellid].buffdurationformula == DF_Permanent ? 0xFFFFFFFF : buffs[i].ticsremaining; + ib->tics_remaining[packet_index] = spells[buffs[i].spellid].buff_duration_formula == DF_Permanent ? 0xFFFFFFFF : buffs[i].ticsremaining; packet_index++; } @@ -904,8 +904,8 @@ void Client::SendAlternateAdvancementRank(int aa_id, int level) { outapp->SetWritePosition(sizeof(AARankInfo_Struct)); for(auto &effect : rank->effects) { outapp->WriteSInt32(effect.effect_id); - outapp->WriteSInt32(effect.base1); - outapp->WriteSInt32(effect.base2); + outapp->WriteSInt32(effect.base_value); + outapp->WriteSInt32(effect.limit_value); outapp->WriteSInt32(effect.slot); } @@ -1229,7 +1229,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { } // // Modern clients don't require pet targeted for AA casts that are ST_Pet - if (spells[rank->spell].targettype == ST_Pet || spells[rank->spell].targettype == ST_SummonedPet) + if (spells[rank->spell].target_type == ST_Pet || spells[rank->spell].target_type == ST_SummonedPet) target_id = GetPetID(); // extra handling for cast_not_standing spells @@ -1249,7 +1249,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) { else { // Bards can cast instant cast AAs while they are casting another song if (spells[rank->spell].cast_time == 0 && GetClass() == BARD && IsBardSong(casting_spell_id)) { - if (!SpellFinished(rank->spell, entity_list.GetMob(target_id), EQ::spells::CastingSlot::AltAbility, spells[rank->spell].mana, -1, spells[rank->spell].ResistDiff, false)) { + if (!SpellFinished(rank->spell, entity_list.GetMob(target_id), EQ::spells::CastingSlot::AltAbility, spells[rank->spell].mana, -1, spells[rank->spell].resist_difficulty, false)) { return; } ExpendAlternateAdvancementCharge(ability->id); @@ -1285,8 +1285,8 @@ int Mob::GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in) { } for(auto &effect : rank->effects) { - if(effect.effect_id == SE_HastenedAASkill && effect.base2 == ability_in->id) { - return effect.base1; + if(effect.effect_id == SE_HastenedAASkill && effect.limit_value == ability_in->id) { + return effect.base_value; } } } @@ -1744,8 +1744,8 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 0)); - float min_dist = static_cast(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 1)); + float min_distance = static_cast(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 1)); if (GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 2)) DoLoSCheck = false; //Ignore line of sight check @@ -884,12 +884,12 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage) max_dist = max_dist * max_dist; - if (!min_dist) - min_dist = size_mod; //Default to melee range + if (!min_distance) + min_distance = size_mod; //Default to melee range else - min_dist = min_dist * min_dist; + min_distance = min_distance * min_distance; - if ((DoLoSCheck && CheckLastLosState()) && (_DistNoRoot >= min_dist && _DistNoRoot <= max_dist)) + if ((DoLoSCheck && CheckLastLosState()) && (_DistNoRoot >= min_distance && _DistNoRoot <= max_dist)) SetPseudoRoot(true); else SetPseudoRoot(false); @@ -1003,16 +1003,16 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) default_aggro = target_hp / 15; for (int o = 0; o < EFFECT_COUNT; o++) { - switch (spells[spell_id].effectid[o]) { + switch (spells[spell_id].effect_id[o]) { case SE_CurrentHPOnce: case SE_CurrentHP: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if(val < 0) AggroAmount -= val; break; } case SE_MovementSpeed: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 0) AggroAmount += default_aggro; break; @@ -1020,7 +1020,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) case SE_AttackSpeed: case SE_AttackSpeed2: case SE_AttackSpeed3: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 100) AggroAmount += default_aggro; break; @@ -1038,7 +1038,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) break; case SE_ACv2: case SE_ArmorClass: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 0) AggroAmount += default_aggro; break; @@ -1056,19 +1056,19 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) case SE_INT: case SE_WIS: case SE_CHA: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 0) AggroAmount += 10; break; } case SE_ResistAll: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 0) AggroAmount += 50; break; } case SE_AllStats: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 0) AggroAmount += 70; break; @@ -1110,7 +1110,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) case SE_ManaRegen_v2: case SE_ManaPool: case SE_CurrentEndurance: { - int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); if (val < 0) AggroAmount -= val * 2; break; @@ -1122,7 +1122,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) break; case SE_ReduceHate: case SE_InstantHate: - nonModifiedAggro = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base[o], spells[spell_id].max[o], slevel, spell_id); + nonModifiedAggro = CalcSpellEffectValue_formula(spells[spell_id].formula[o], spells[spell_id].base_value[o], spells[spell_id].max_value[o], slevel, spell_id); break; } } @@ -1133,8 +1133,8 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) if (dispel && target && target->GetHateAmount(this) < 100) AggroAmount += 50; - if (spells[spell_id].HateAdded > 0) // overrides the hate (ex. tash) - AggroAmount = spells[spell_id].HateAdded; + if (spells[spell_id].hate_added > 0) // overrides the hate (ex. tash) + AggroAmount = spells[spell_id].hate_added; if (GetOwner() && IsPet()) AggroAmount = AggroAmount * RuleI(Aggro, PetSpellAggroMod) / 100; @@ -1149,10 +1149,10 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc) // initial aggro gets a bonus 100 besides for dispel or hate override // We add this 100 in AddToHateList so we need to account for the oddities here - if (dispel && spells[spell_id].HateAdded > 0 && !on_hatelist) + if (dispel && spells[spell_id].hate_added > 0 && !on_hatelist) AggroAmount -= 100; - return AggroAmount + spells[spell_id].bonushate + nonModifiedAggro; + return AggroAmount + spells[spell_id].bonus_hate + nonModifiedAggro; } //healing and buffing aggro @@ -1163,7 +1163,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib bool ignore_default_buff = false; // rune/hot don't use the default 9, HP buffs that heal (virtue) do use the default for (int o = 0; o < EFFECT_COUNT; o++) { - switch (spells[spell_id].effectid[o]) { + switch (spells[spell_id].effect_id[o]) { case SE_CurrentHP: case SE_PercentalHeal: { @@ -1173,7 +1173,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib } // hate based on base healing power of the spell int val = CalcSpellEffectValue_formula(spells[spell_id].formula[o], - spells[spell_id].base[o], spells[spell_id].max[o], GetLevel(), spell_id); + spells[spell_id].base_value[o], spells[spell_id].max_value[o], GetLevel(), spell_id); if (val > 0) { if (heal_possible < val) val = heal_possible; // capped to amount healed @@ -1189,7 +1189,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possib } case SE_Rune: AggroAmount += CalcSpellEffectValue_formula(spells[spell_id].formula[o], - spells[spell_id].base[o], spells[spell_id].max[o], GetLevel(), spell_id) * 2; + spells[spell_id].base_value[o], spells[spell_id].max_value[o], GetLevel(), spell_id) * 2; ignore_default_buff = true; break; case SE_HealOverTime: @@ -1269,7 +1269,7 @@ bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) { if(!caster) return false; - if(spells[spell_id].ResistDiff <= -600) + if(spells[spell_id].resist_difficulty <= -600) return true; float resist_check = 0; @@ -1284,9 +1284,9 @@ bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) { return true; if (RuleB(Spells, CharismaCharmDuration)) - resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster,false,0,true,true); + resist_check = ResistSpell(spells[spell_id].resist_type, spell_id, caster,false,0,true,true); else - resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, false,0, false, true); + resist_check = ResistSpell(spells[spell_id].resist_type, spell_id, caster, false,0, false, true); //2: The mob makes a resistance check against the charm if (resist_check == 100) @@ -1310,7 +1310,7 @@ bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) { { // Assume this is a harmony/pacify spell // If 'Lull' spell resists, do a second resist check with a charisma modifier AND regular resist checks. If resists agian you gain aggro. - resist_check = ResistSpell(spells[spell_id].resisttype, spell_id, caster, false,0,true); + resist_check = ResistSpell(spells[spell_id].resist_type, spell_id, caster, false,0,true); if (resist_check == 100) return true; } diff --git a/zone/attack.cpp b/zone/attack.cpp index c78615ac8..f9f086f7f 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1555,7 +1555,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b float chance = aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] / 1000.0f; if (zone->random.Roll(chance)) SpellFinished(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID], other, EQ::spells::CastingSlot::Item, 0, -1, - spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].ResistDiff); + spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].resist_difficulty); } other->Damage(this, my_hit.damage_done, SPELL_UNKNOWN, my_hit.skill, true, -1, false, m_specialattacks); @@ -2195,7 +2195,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQ::skills::SkillTyp if (IsLDoNTrapped()) { MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); - SpellFinished(GetLDoNTrapSpellID(), other, EQ::spells::CastingSlot::Item, 0, -1, spells[GetLDoNTrapSpellID()].ResistDiff, false); + SpellFinished(GetLDoNTrapSpellID(), other, EQ::spells::CastingSlot::Item, 0, -1, spells[GetLDoNTrapSpellID()].resist_difficulty, false); SetLDoNTrapSpellID(0); SetLDoNTrapped(false); SetLDoNTrapDetected(false); @@ -3141,7 +3141,7 @@ int32 Mob::ReduceDamage(int32 damage) if (spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_EXISTS]) { slot = spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT]; if (slot >= 0) { - if (--buffs[slot].numhits == 0) { + if (--buffs[slot].hit_number == 0) { if (!TryFadeEffect(slot)) BuffFadeBySlot(slot, true); @@ -3230,7 +3230,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if (!iBuffTic && spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_EXISTS]) { slot = spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT]; if (slot >= 0) { - if (--buffs[slot].numhits == 0) { + if (--buffs[slot].hit_number == 0) { if (!TryFadeEffect(slot)) BuffFadeBySlot(slot, true); @@ -4918,14 +4918,14 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[base_spell_id].effectid[i] == SE_SkillProc || spells[base_spell_id].effectid[i] == SE_SkillProcSuccess) { - proc_spell_id = spells[base_spell_id].base[i]; - ProcMod = static_cast(spells[base_spell_id].base2[i]); + if (spells[base_spell_id].effect_id[i] == SE_SkillProc || spells[base_spell_id].effect_id[i] == SE_SkillProcSuccess) { + proc_spell_id = spells[base_spell_id].base_value[i]; + ProcMod = static_cast(spells[base_spell_id].limit_value[i]); } - else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= EQ::skills::HIGHEST_SKILL) { + else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) { - if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) { + if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); if (zone->random.Roll(final_chance)) { ExecWeaponProc(nullptr, proc_spell_id, on); @@ -4962,14 +4962,14 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui ProcMod = 0; for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[base_spell_id].effectid[i] == SE_SkillProc || spells[base_spell_id].effectid[i] == SE_SkillProcSuccess) { - proc_spell_id = spells[base_spell_id].base[i]; - ProcMod = static_cast(spells[base_spell_id].base2[i]); + if (spells[base_spell_id].effect_id[i] == SE_SkillProc || spells[base_spell_id].effect_id[i] == SE_SkillProcSuccess) { + proc_spell_id = spells[base_spell_id].base_value[i]; + ProcMod = static_cast(spells[base_spell_id].limit_value[i]); } - else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= EQ::skills::HIGHEST_SKILL) { + else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) { - if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) { + if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); if (zone->random.Roll(final_chance)) { ExecWeaponProc(nullptr, proc_spell_id, on); @@ -4991,8 +4991,8 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui CanProc = true; uint32 effect_id = 0; - int32 base1 = 0; - int32 base2 = 0; + int32 base_value = 0; + int32 limit_value = 0; uint32 slot = 0; for (int e = 0; e < MAX_SKILL_PROCS; e++) { @@ -5020,17 +5020,17 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui for (auto &effect : rank->effects) { effect_id = effect.effect_id; - base1 = effect.base1; - base2 = effect.base2; + base_value = effect.base_value; + limit_value = effect.limit_value; slot = effect.slot; if (effect_id == SE_SkillProc || effect_id == SE_SkillProcSuccess) { - proc_spell_id = base1; - ProcMod = static_cast(base2); + proc_spell_id = base_value; + ProcMod = static_cast(limit_value); } - else if (effect_id == SE_LimitToSkill && base1 <= EQ::skills::HIGHEST_SKILL) { + else if (effect_id == SE_LimitToSkill && base_value <= EQ::skills::HIGHEST_SKILL) { - if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) { + if (CanProc && base_value == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); if (zone->random.Roll(final_chance)) { diff --git a/zone/beacon.cpp b/zone/beacon.cpp index 11b0de0fd..60b572dd2 100644 --- a/zone/beacon.cpp +++ b/zone/beacon.cpp @@ -98,7 +98,7 @@ bool Beacon::Process() { // NPCs should never be affected by an AE they cast. PB AEs shouldn't affect caster either // I don't think any other cases that get here matter - bool affect_caster = (!caster->IsNPC() && !caster->IsAIControlled()) && spells[spell_id].targettype != ST_AECaster; + bool affect_caster = (!caster->IsNPC() && !caster->IsAIControlled()) && spells[spell_id].target_type != ST_AECaster; entity_list.AESpell(caster, this, spell_id, affect_caster, resist_adjust, &max_targets); } else @@ -127,10 +127,10 @@ void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 resist_adj caster_id = caster->GetID(); spell_id = cast_spell_id; this->resist_adjust = resist_adjust; - spell_iterations = spells[spell_id].AEDuration / 2500; + spell_iterations = spells[spell_id].aoe_duration / 2500; spell_iterations = spell_iterations < 1 ? 1 : spell_iterations; // at least 1 - if (spells[spell_id].aemaxtargets) - max_targets = spells[spell_id].aemaxtargets; + if (spells[spell_id].aoe_max_targets) + max_targets = spells[spell_id].aoe_max_targets; spell_timer.Start(2500); spell_timer.Trigger(); } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 4a251b136..bdc02009c 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -650,27 +650,27 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) return; uint32 effect = 0; - int32 base1 = 0; - int32 base2 = 0; // only really used for SE_RaiseStatCap & SE_ReduceSkillTimer in aa_effects table + int32 base_value = 0; + int32 limit_value = 0; // only really used for SE_RaiseStatCap & SE_ReduceSkillTimer in aa_effects table uint32 slot = 0; for (const auto &e : rank.effects) { effect = e.effect_id; - base1 = e.base1; - base2 = e.base2; + base_value = e.base_value; + limit_value = e.limit_value; slot = e.slot; // we default to 0 (SE_CurrentHP) for the effect, so if there aren't any base1/2 values, we'll just skip it - if (effect == 0 && base1 == 0 && base2 == 0) + if (effect == 0 && base_value == 0 && limit_value == 0) continue; // IsBlankSpellEffect() - if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || + if (effect == SE_Blank || (effect == SE_CHA && base_value == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; LogAA("Applying Effect [{}] from AA [{}] in slot [{}] (base1: [{}], base2: [{}]) on [{}]", - effect, rank.id, slot, base1, base2, GetCleanName()); + effect, rank.id, slot, base_value, limit_value, GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true, effect); if (focus) { @@ -681,373 +681,373 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) switch (effect) { case SE_ACv2: case SE_ArmorClass: - newbon->AC += base1; + newbon->AC += base_value; break; // Note: AA effects that use accuracy are skill limited, while spell effect is not. case SE_Accuracy: // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if ((base2 == ALL_SKILLS) && (newbon->Accuracy[EQ::skills::HIGHEST_SKILL + 1] < base1)) - newbon->Accuracy[EQ::skills::HIGHEST_SKILL + 1] = base1; - else if (newbon->Accuracy[base2] < base1) - newbon->Accuracy[base2] += base1; + if ((limit_value == ALL_SKILLS) && (newbon->Accuracy[EQ::skills::HIGHEST_SKILL + 1] < base_value)) + newbon->Accuracy[EQ::skills::HIGHEST_SKILL + 1] = base_value; + else if (newbon->Accuracy[limit_value] < base_value) + newbon->Accuracy[limit_value] += base_value; break; case SE_CurrentHP: // regens - newbon->HPRegen += base1; + newbon->HPRegen += base_value; break; case SE_CurrentEndurance: - newbon->EnduranceRegen += base1; + newbon->EnduranceRegen += base_value; break; case SE_MovementSpeed: - newbon->movementspeed += base1; // should we let these stack? + newbon->movementspeed += base_value; // should we let these stack? /*if (base1 > newbon->movementspeed) //or should we use a total value? newbon->movementspeed = base1;*/ break; case SE_STR: - newbon->STR += base1; + newbon->STR += base_value; break; case SE_DEX: - newbon->DEX += base1; + newbon->DEX += base_value; break; case SE_AGI: - newbon->AGI += base1; + newbon->AGI += base_value; break; case SE_STA: - newbon->STA += base1; + newbon->STA += base_value; break; case SE_INT: - newbon->INT += base1; + newbon->INT += base_value; break; case SE_WIS: - newbon->WIS += base1; + newbon->WIS += base_value; break; case SE_CHA: - newbon->CHA += base1; + newbon->CHA += base_value; break; case SE_WaterBreathing: // handled by client break; case SE_CurrentMana: - newbon->ManaRegen += base1; + newbon->ManaRegen += base_value; break; case SE_ManaPool: - newbon->Mana += base1; + newbon->Mana += base_value; break; case SE_ItemManaRegenCapIncrease: - newbon->ItemManaRegenCap += base1; + newbon->ItemManaRegenCap += base_value; break; case SE_ResistFire: - newbon->FR += base1; + newbon->FR += base_value; break; case SE_ResistCold: - newbon->CR += base1; + newbon->CR += base_value; break; case SE_ResistPoison: - newbon->PR += base1; + newbon->PR += base_value; break; case SE_ResistDisease: - newbon->DR += base1; + newbon->DR += base_value; break; case SE_ResistMagic: - newbon->MR += base1; + newbon->MR += base_value; break; case SE_ResistCorruption: - newbon->Corrup += base1; + newbon->Corrup += base_value; break; case SE_IncreaseSpellHaste: break; case SE_IncreaseRange: break; case SE_MaxHPChange: - newbon->MaxHP += base1; + newbon->MaxHP += base_value; break; case SE_Packrat: - newbon->Packrat += base1; + newbon->Packrat += base_value; break; case SE_TwoHandBash: break; case SE_SetBreathLevel: break; case SE_RaiseStatCap: - switch (base2) { + switch (limit_value) { // are these #define'd somewhere? case 0: // str - newbon->STRCapMod += base1; + newbon->STRCapMod += base_value; break; case 1: // sta - newbon->STACapMod += base1; + newbon->STACapMod += base_value; break; case 2: // agi - newbon->AGICapMod += base1; + newbon->AGICapMod += base_value; break; case 3: // dex - newbon->DEXCapMod += base1; + newbon->DEXCapMod += base_value; break; case 4: // wis - newbon->WISCapMod += base1; + newbon->WISCapMod += base_value; break; case 5: // int - newbon->INTCapMod += base1; + newbon->INTCapMod += base_value; break; case 6: // cha - newbon->CHACapMod += base1; + newbon->CHACapMod += base_value; break; case 7: // mr - newbon->MRCapMod += base1; + newbon->MRCapMod += base_value; break; case 8: // cr - newbon->CRCapMod += base1; + newbon->CRCapMod += base_value; break; case 9: // fr - newbon->FRCapMod += base1; + newbon->FRCapMod += base_value; break; case 10: // pr - newbon->PRCapMod += base1; + newbon->PRCapMod += base_value; break; case 11: // dr - newbon->DRCapMod += base1; + newbon->DRCapMod += base_value; break; case 12: // corruption - newbon->CorrupCapMod += base1; + newbon->CorrupCapMod += base_value; break; } break; case SE_SpellSlotIncrease: break; case SE_MysticalAttune: - newbon->BuffSlotIncrease += base1; + newbon->BuffSlotIncrease += base_value; break; case SE_TotalHP: - newbon->HP += base1; + newbon->HP += base_value; break; case SE_StunResist: - newbon->StunResist += base1; + newbon->StunResist += base_value; break; case SE_SpellCritChance: - newbon->CriticalSpellChance += base1; + newbon->CriticalSpellChance += base_value; break; case SE_SpellCritDmgIncrease: - newbon->SpellCritDmgIncrease += base1; + newbon->SpellCritDmgIncrease += base_value; break; case SE_DotCritDmgIncrease: - newbon->DotCritDmgIncrease += base1; + newbon->DotCritDmgIncrease += base_value; break; case SE_ResistSpellChance: - newbon->ResistSpellChance += base1; + newbon->ResistSpellChance += base_value; break; case SE_CriticalHealChance: - newbon->CriticalHealChance += base1; + newbon->CriticalHealChance += base_value; break; case SE_CriticalHealOverTime: - newbon->CriticalHealOverTime += base1; + newbon->CriticalHealOverTime += base_value; break; case SE_CriticalDoTChance: - newbon->CriticalDoTChance += base1; + newbon->CriticalDoTChance += base_value; break; case SE_ReduceSkillTimer: - newbon->SkillReuseTime[base2] += base1; + newbon->SkillReuseTime[limit_value] += base_value; break; case SE_Fearless: newbon->Fearless = true; break; case SE_PersistantCasting: - newbon->PersistantCasting += base1; + newbon->PersistantCasting += base_value; break; case SE_DelayDeath: - newbon->DelayDeath += base1; + newbon->DelayDeath += base_value; break; case SE_FrontalStunResist: - newbon->FrontalStunResist += base1; + newbon->FrontalStunResist += base_value; break; case SE_ImprovedBindWound: - newbon->BindWound += base1; + newbon->BindWound += base_value; break; case SE_MaxBindWound: - newbon->MaxBindWound += base1; + newbon->MaxBindWound += base_value; break; case SE_SeeInvis: - newbon->SeeInvis = base1; + newbon->SeeInvis = base_value; break; case SE_BaseMovementSpeed: - newbon->BaseMovementSpeed += base1; + newbon->BaseMovementSpeed += base_value; break; case SE_IncreaseRunSpeedCap: - newbon->IncreaseRunSpeedCap += base1; + newbon->IncreaseRunSpeedCap += base_value; break; case SE_ConsumeProjectile: - newbon->ConsumeProjectile += base1; + newbon->ConsumeProjectile += base_value; break; case SE_ForageAdditionalItems: - newbon->ForageAdditionalItems += base1; + newbon->ForageAdditionalItems += base_value; break; case SE_Salvage: - newbon->SalvageChance += base1; + newbon->SalvageChance += base_value; break; case SE_ArcheryDamageModifier: - newbon->ArcheryDamageModifier += base1; + newbon->ArcheryDamageModifier += base_value; break; case SE_DoubleRangedAttack: - newbon->DoubleRangedAttack += base1; + newbon->DoubleRangedAttack += base_value; break; case SE_DamageShield: - newbon->DamageShield += base1; + newbon->DamageShield += base_value; break; case SE_CharmBreakChance: - newbon->CharmBreakChance += base1; + newbon->CharmBreakChance += base_value; break; case SE_OffhandRiposteFail: - newbon->OffhandRiposteFail += base1; + newbon->OffhandRiposteFail += base_value; break; case SE_ItemAttackCapIncrease: - newbon->ItemATKCap += base1; + newbon->ItemATKCap += base_value; break; case SE_GivePetGroupTarget: newbon->GivePetGroupTarget = true; break; case SE_ItemHPRegenCapIncrease: - newbon->ItemHPRegenCap += base1; + newbon->ItemHPRegenCap += base_value; break; case SE_Ambidexterity: - newbon->Ambidexterity += base1; + newbon->Ambidexterity += base_value; break; case SE_PetMaxHP: - newbon->PetMaxHP += base1; + newbon->PetMaxHP += base_value; break; case SE_AvoidMeleeChance: - newbon->AvoidMeleeChanceEffect += base1; + newbon->AvoidMeleeChanceEffect += base_value; break; case SE_CombatStability: - newbon->CombatStability += base1; + newbon->CombatStability += base_value; break; case SE_AddSingingMod: - switch (base2) { + switch (limit_value) { case EQ::item::ItemTypeWindInstrument: - newbon->windMod += base1; + newbon->windMod += base_value; break; case EQ::item::ItemTypeStringedInstrument: - newbon->stringedMod += base1; + newbon->stringedMod += base_value; break; case EQ::item::ItemTypeBrassInstrument: - newbon->brassMod += base1; + newbon->brassMod += base_value; break; case EQ::item::ItemTypePercussionInstrument: - newbon->percussionMod += base1; + newbon->percussionMod += base_value; break; case EQ::item::ItemTypeSinging: - newbon->singingMod += base1; + newbon->singingMod += base_value; break; } break; case SE_SongModCap: - newbon->songModCap += base1; + newbon->songModCap += base_value; break; case SE_PetCriticalHit: - newbon->PetCriticalHit += base1; + newbon->PetCriticalHit += base_value; break; case SE_PetAvoidance: - newbon->PetAvoidance += base1; + newbon->PetAvoidance += base_value; break; case SE_ShieldBlock: - newbon->ShieldBlock += base1; + newbon->ShieldBlock += base_value; break; case SE_ShieldEquipDmgMod: - newbon->ShieldEquipDmgMod += base1; + newbon->ShieldEquipDmgMod += base_value; break; case SE_SecondaryDmgInc: newbon->SecondaryDmgInc = true; break; case SE_ChangeAggro: - newbon->hatemod += base1; + newbon->hatemod += base_value; break; case SE_EndurancePool: - newbon->Endurance += base1; + newbon->Endurance += base_value; break; case SE_ChannelChanceItems: - newbon->ChannelChanceItems += base1; + newbon->ChannelChanceItems += base_value; break; case SE_ChannelChanceSpells: - newbon->ChannelChanceSpells += base1; + newbon->ChannelChanceSpells += base_value; break; case SE_DoubleSpecialAttack: - newbon->DoubleSpecialAttack += base1; + newbon->DoubleSpecialAttack += base_value; break; case SE_TripleBackstab: - newbon->TripleBackstab += base1; + newbon->TripleBackstab += base_value; break; case SE_FrontalBackstabMinDmg: newbon->FrontalBackstabMinDmg = true; break; case SE_FrontalBackstabChance: - newbon->FrontalBackstabChance += base1; + newbon->FrontalBackstabChance += base_value; break; case SE_Double_Backstab_Front: - newbon->Double_Backstab_Front += base1; + newbon->Double_Backstab_Front += base_value; break; case SE_BlockBehind: - newbon->BlockBehind += base1; + newbon->BlockBehind += base_value; break; case SE_StrikeThrough: case SE_StrikeThrough2: - newbon->StrikeThrough += base1; + newbon->StrikeThrough += base_value; break; case SE_DoubleAttackChance: - newbon->DoubleAttackChance += base1; + newbon->DoubleAttackChance += base_value; break; case SE_GiveDoubleAttack: - newbon->GiveDoubleAttack += base1; + newbon->GiveDoubleAttack += base_value; break; case SE_ProcChance: - newbon->ProcChanceSPA += base1; + newbon->ProcChanceSPA += base_value; break; case SE_RiposteChance: - newbon->RiposteChance += base1; + newbon->RiposteChance += base_value; break; case SE_DodgeChance: - newbon->DodgeChance += base1; + newbon->DodgeChance += base_value; break; case SE_ParryChance: - newbon->ParryChance += base1; + newbon->ParryChance += base_value; break; case SE_IncreaseBlockChance: - newbon->IncreaseBlockChance += base1; + newbon->IncreaseBlockChance += base_value; break; case SE_Flurry: - newbon->FlurryChance += base1; + newbon->FlurryChance += base_value; break; case SE_PetFlurry: - newbon->PetFlurry += base1; + newbon->PetFlurry += base_value; break; case SE_BardSongRange: - newbon->SongRange += base1; + newbon->SongRange += base_value; break; case SE_RootBreakChance: - newbon->RootBreakChance += base1; + newbon->RootBreakChance += base_value; break; case SE_UnfailingDivinity: - newbon->UnfailingDivinity += base1; + newbon->UnfailingDivinity += base_value; break; case SE_CrippBlowChance: - newbon->CrippBlowChance += base1; + newbon->CrippBlowChance += base_value; break; case SE_HitChance: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base2 == ALL_SKILLS) - newbon->HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->HitChanceEffect[base2] += base1; + newbon->HitChanceEffect[limit_value] += base_value; } case SE_ProcOnKillShot: for (int i = 0; i < MAX_SPELL_TRIGGER * 3; i += 3) { if (!newbon->SpellOnKill[i] || - ((newbon->SpellOnKill[i] == base2) && (newbon->SpellOnKill[i + 1] < base1))) { + ((newbon->SpellOnKill[i] == limit_value) && (newbon->SpellOnKill[i + 1] < base_value))) { // base1 = chance, base2 = SpellID to be triggered, base3 = min npc level - newbon->SpellOnKill[i] = base2; - newbon->SpellOnKill[i + 1] = base1; + newbon->SpellOnKill[i] = limit_value; + newbon->SpellOnKill[i + 1] = base_value; if (GetLevel() > 15) newbon->SpellOnKill[i + 2] = @@ -1064,8 +1064,8 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) for (int i = 0; i < MAX_SPELL_TRIGGER * 2; i += 2) { if (!newbon->SpellOnDeath[i]) { // base1 = SpellID to be triggered, base2 = chance to fire - newbon->SpellOnDeath[i] = base1; - newbon->SpellOnDeath[i + 1] = base2; + newbon->SpellOnDeath[i] = base_value; + newbon->SpellOnDeath[i + 1] = limit_value; break; } } @@ -1074,131 +1074,131 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_CriticalHitChance: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base2 == ALL_SKILLS) - newbon->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->CriticalHitChance[base2] += base1; + newbon->CriticalHitChance[limit_value] += base_value; } break; case SE_CriticalDamageMob: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; // base1 = effect value, base2 = skill restrictions(-1 for all) - if (base2 == ALL_SKILLS) - newbon->CritDmgMod[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->CritDmgMod[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->CritDmgMod[base2] += base1; + newbon->CritDmgMod[limit_value] += base_value; break; } case SE_Critical_Melee_Damage_Mod_Max: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - int skill = base2 == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : base2; - if (base1 < 0 && newbon->CritDmgModNoStack[skill] > base1) - newbon->CritDmgModNoStack[skill] = base1; - else if (base1 > 0 && newbon->CritDmgModNoStack[skill] < base1) - newbon->CritDmgModNoStack[skill] = base1; + int skill = limit_value == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : limit_value; + if (base_value < 0 && newbon->CritDmgModNoStack[skill] > base_value) + newbon->CritDmgModNoStack[skill] = base_value; + else if (base_value > 0 && newbon->CritDmgModNoStack[skill] < base_value) + newbon->CritDmgModNoStack[skill] = base_value; break; } case SE_CriticalSpellChance: { - newbon->CriticalSpellChance += base1; + newbon->CriticalSpellChance += base_value; - if (base2 > newbon->SpellCritDmgIncNoStack) - newbon->SpellCritDmgIncNoStack = base2; + if (limit_value > newbon->SpellCritDmgIncNoStack) + newbon->SpellCritDmgIncNoStack = limit_value; break; } case SE_ResistFearChance: { - if (base1 == 100) // If we reach 100% in a single spell/item then we should be immune to + if (base_value == 100) // If we reach 100% in a single spell/item then we should be immune to // negative fear resist effects until our immunity is over newbon->Fearless = true; - newbon->ResistFearChance += base1; // these should stack + newbon->ResistFearChance += base_value; // these should stack break; } case SE_SkillDamageAmount: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base2 == ALL_SKILLS) - newbon->SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->SkillDamageAmount[base2] += base1; + newbon->SkillDamageAmount[limit_value] += base_value; break; } case SE_SkillAttackProc: { // You can only have one of these per client. [AA Dragon Punch] - newbon->SkillAttackProc[SBIndex::SKILLPROC_CHANCE] = base1; // Chance base 1000 = 100% proc rate - newbon->SkillAttackProc[SBIndex::SKILLPROC_SKILL] = base2; // Skill to Proc Off + newbon->SkillAttackProc[SBIndex::SKILLPROC_CHANCE] = base_value; // Chance base 1000 = 100% proc rate + newbon->SkillAttackProc[SBIndex::SKILLPROC_SKILL] = limit_value; // Skill to Proc Off newbon->SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID] = rank.spell; // spell to proc break; } case SE_DamageModifier: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base2 == ALL_SKILLS) - newbon->DamageModifier[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->DamageModifier[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->DamageModifier[base2] += base1; + newbon->DamageModifier[limit_value] += base_value; break; } case SE_DamageModifier2: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base2 == ALL_SKILLS) - newbon->DamageModifier2[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->DamageModifier2[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->DamageModifier2[base2] += base1; + newbon->DamageModifier2[limit_value] += base_value; break; } case SE_Skill_Base_Damage_Mod: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base2 == ALL_SKILLS) - newbon->DamageModifier3[EQ::skills::HIGHEST_SKILL + 1] += base1; + if (limit_value == ALL_SKILLS) + newbon->DamageModifier3[EQ::skills::HIGHEST_SKILL + 1] += base_value; else - newbon->DamageModifier3[base2] += base1; + newbon->DamageModifier3[limit_value] += base_value; break; } case SE_SlayUndead: { - if (newbon->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] < base1) - newbon->SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = base1; // Rate - newbon->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = base2; // Damage Modifier + if (newbon->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] < base_value) + newbon->SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = base_value; // Rate + newbon->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = limit_value; // Damage Modifier break; } case SE_DoubleRiposte: { - newbon->DoubleRiposte += base1; + newbon->DoubleRiposte += base_value; break; } case SE_GiveDoubleRiposte: { // 0=Regular Riposte 1=Skill Attack Riposte 2=Skill - if (base2 == 0) { - if (newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] < base1) - newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = base1; + if (limit_value == 0) { + if (newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] < base_value) + newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = base_value; } // Only for special attacks. - else if (base2 > 0 && (newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE] < base1)) { - newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE] = base1; - newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL] = base2; + else if (limit_value > 0 && (newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE] < base_value)) { + newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE] = base_value; + newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL] = limit_value; } break; @@ -1207,48 +1207,48 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) // Physically raises skill cap ie if 55/55 it will raise to 55/60 case SE_RaiseSkillCap: { - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (newbon->RaiseSkillCap[base2] < base1) - newbon->RaiseSkillCap[base2] = base1; + if (newbon->RaiseSkillCap[limit_value] < base_value) + newbon->RaiseSkillCap[limit_value] = base_value; break; } case SE_MasteryofPast: { - if (newbon->MasteryofPast < base1) - newbon->MasteryofPast = base1; + if (newbon->MasteryofPast < base_value) + newbon->MasteryofPast = base_value; break; } case SE_CastingLevel: { - newbon->adjusted_casting_skill += base1; + newbon->adjusted_casting_skill += base_value; break; } case SE_CastingLevel2: { - newbon->effective_casting_level += base1; + newbon->effective_casting_level += base_value; break; } case SE_DivineSave: { - if (newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] < base1) { - newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] = base1; - newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = base2; + if (newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] < base_value) { + newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] = base_value; + newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = limit_value; } break; } case SE_SpellEffectResistChance: { for (int e = 0; e < MAX_RESISTABLE_EFFECTS * 2; e += 2) { - if (newbon->SEResist[e + 1] && (newbon->SEResist[e] == base2) && - (newbon->SEResist[e + 1] < base1)) { - newbon->SEResist[e] = base2; // Spell Effect ID - newbon->SEResist[e + 1] = base1; // Resist Chance + if (newbon->SEResist[e + 1] && (newbon->SEResist[e] == limit_value) && + (newbon->SEResist[e + 1] < base_value)) { + newbon->SEResist[e] = limit_value; // Spell Effect ID + newbon->SEResist[e + 1] = base_value; // Resist Chance break; } else if (!newbon->SEResist[e + 1]) { - newbon->SEResist[e] = base2; // Spell Effect ID - newbon->SEResist[e + 1] = base1; // Resist Chance + newbon->SEResist[e] = limit_value; // Spell Effect ID + newbon->SEResist[e + 1] = base_value; // Resist Chance break; } } @@ -1258,68 +1258,68 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_MitigateDamageShield: { //AA that increase mitigation are set to negative. - if (base1 < 0) { - base1 = base1 * (-1); + if (base_value < 0) { + base_value = base_value * (-1); } - newbon->DSMitigationOffHand += base1; + newbon->DSMitigationOffHand += base_value; break; } case SE_FinishingBlow: { // base1 = chance, base2 = damage - if (newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] < base2) { - newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base1; - newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = base2; + if (newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] < limit_value) { + newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base_value; + newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = limit_value; } break; } case SE_FinishingBlowLvl: { // base1 = level, base2 = ??? (Set to 200 in AA data, possible proc rate mod?) - if (newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base1) { - newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base1; - newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2; + if (newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base_value) { + newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base_value; + newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = limit_value; } break; } case SE_StunBashChance: - newbon->StunBashChance += base1; + newbon->StunBashChance += base_value; break; case SE_IncreaseChanceMemwipe: - newbon->IncreaseChanceMemwipe += base1; + newbon->IncreaseChanceMemwipe += base_value; break; case SE_CriticalMend: - newbon->CriticalMend += base1; + newbon->CriticalMend += base_value; break; case SE_HealRate: - newbon->HealRate += base1; + newbon->HealRate += base_value; break; case SE_MeleeLifetap: { - if ((base1 < 0) && (newbon->MeleeLifetap > base1)) - newbon->MeleeLifetap = base1; + if ((base_value < 0) && (newbon->MeleeLifetap > base_value)) + newbon->MeleeLifetap = base_value; - else if (newbon->MeleeLifetap < base1) - newbon->MeleeLifetap = base1; + else if (newbon->MeleeLifetap < base_value) + newbon->MeleeLifetap = base_value; break; } case SE_Vampirism: - newbon->Vampirism += base1; + newbon->Vampirism += base_value; break; case SE_FrenziedDevastation: - newbon->FrenziedDevastation += base2; + newbon->FrenziedDevastation += limit_value; break; case SE_SpellProcChance: - newbon->SpellProcChance += base1; + newbon->SpellProcChance += base_value; break; case SE_Berserk: @@ -1327,59 +1327,59 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; case SE_Metabolism: - newbon->Metabolism += base1; + newbon->Metabolism += base_value; break; case SE_ImprovedReclaimEnergy: { - if ((base1 < 0) && (newbon->ImprovedReclaimEnergy > base1)) - newbon->ImprovedReclaimEnergy = base1; + if ((base_value < 0) && (newbon->ImprovedReclaimEnergy > base_value)) + newbon->ImprovedReclaimEnergy = base_value; - else if (newbon->ImprovedReclaimEnergy < base1) - newbon->ImprovedReclaimEnergy = base1; + else if (newbon->ImprovedReclaimEnergy < base_value) + newbon->ImprovedReclaimEnergy = base_value; break; } case SE_HeadShot: { - if (newbon->HeadShot[SBIndex::FINISHING_EFFECT_DMG] < base2) { - newbon->HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base1; - newbon->HeadShot[SBIndex::FINISHING_EFFECT_DMG] = base2; + if (newbon->HeadShot[SBIndex::FINISHING_EFFECT_DMG] < limit_value) { + newbon->HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base_value; + newbon->HeadShot[SBIndex::FINISHING_EFFECT_DMG] = limit_value; } break; } case SE_HeadShotLevel: { - if (newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base1) - newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base1; - newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2; + if (newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base_value) + newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base_value; + newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = limit_value; break; } case SE_Assassinate: { - if (newbon->Assassinate[SBIndex::FINISHING_EFFECT_DMG] < base2) { - newbon->Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base1; - newbon->Assassinate[SBIndex::FINISHING_EFFECT_DMG] = base2; + if (newbon->Assassinate[SBIndex::FINISHING_EFFECT_DMG] < limit_value) { + newbon->Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base_value; + newbon->Assassinate[SBIndex::FINISHING_EFFECT_DMG] = limit_value; } break; } case SE_AssassinateLevel: { - if (newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base1) { - newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base1; - newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2; + if (newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base_value) { + newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base_value; + newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = limit_value; } break; } case SE_PetMeleeMitigation: - newbon->PetMeleeMitigation += base1; + newbon->PetMeleeMitigation += base_value; break; case SE_FactionModPct: { - if ((base1 < 0) && (newbon->FactionModPct > base1)) - newbon->FactionModPct = base1; + if ((base_value < 0) && (newbon->FactionModPct > base_value)) + newbon->FactionModPct = base_value; - else if (newbon->FactionModPct < base1) - newbon->FactionModPct = base1; + else if (newbon->FactionModPct < base_value) + newbon->FactionModPct = base_value; break; } @@ -1389,10 +1389,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_LimitToSkill: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (base1 <= EQ::skills::HIGHEST_SKILL) - newbon->LimitToSkill[base1] = true; + if (base_value <= EQ::skills::HIGHEST_SKILL) + newbon->LimitToSkill[base_value] = true; break; } @@ -1424,32 +1424,32 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) } case SE_MeleeMitigation: - newbon->MeleeMitigationEffect += base1; + newbon->MeleeMitigationEffect += base_value; break; case SE_ATK: - newbon->ATK += base1; + newbon->ATK += base_value; break; case SE_IncreaseExtTargetWindow: - newbon->extra_xtargets += base1; + newbon->extra_xtargets += base_value; break; case SE_PC_Pet_Rampage: { - newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += base1; //Chance to rampage - if (newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2) - newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest + newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += base_value; //Chance to rampage + if (newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < limit_value) + newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = limit_value; //Damage modifer - take highest break; } case SE_PC_Pet_AE_Rampage: { - newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += base1; //Chance to rampage - if (newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2) - newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest + newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += base_value; //Chance to rampage + if (newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < limit_value) + newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = limit_value; //Damage modifer - take highest break; } case SE_PC_Pet_Flurry_Chance: - newbon->PC_Pet_Flurry += base1; //Chance to Flurry + newbon->PC_Pet_Flurry += base_value; //Chance to Flurry break; case SE_ShroudofStealth: @@ -1457,53 +1457,53 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; case SE_ReduceFallDamage: - newbon->ReduceFallDamage += base1; + newbon->ReduceFallDamage += base_value; break; case SE_ReduceTradeskillFail:{ - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - newbon->ReduceTradeskillFail[base2] += base1; + newbon->ReduceTradeskillFail[limit_value] += base_value; break; } case SE_TradeSkillMastery: - if (newbon->TradeSkillMastery < base1) - newbon->TradeSkillMastery = base1; + if (newbon->TradeSkillMastery < base_value) + newbon->TradeSkillMastery = base_value; break; case SE_NoBreakAESneak: - if (newbon->NoBreakAESneak < base1) - newbon->NoBreakAESneak = base1; + if (newbon->NoBreakAESneak < base_value) + newbon->NoBreakAESneak = base_value; break; case SE_FeignedCastOnChance: - if (newbon->FeignedCastOnChance < base1) - newbon->FeignedCastOnChance = base1; + if (newbon->FeignedCastOnChance < base_value) + newbon->FeignedCastOnChance = base_value; break; case SE_AddPetCommand: - if (base1 && base2 < PET_MAXCOMMANDS) - newbon->PetCommands[base2] = true; + if (base_value && limit_value < PET_MAXCOMMANDS) + newbon->PetCommands[limit_value] = true; break; case SE_FeignedMinion: - if (newbon->FeignedMinionChance < base1) - newbon->FeignedMinionChance = base1; + if (newbon->FeignedMinionChance < base_value) + newbon->FeignedMinionChance = base_value; break; case SE_AdditionalAura: - newbon->aura_slots += base1; + newbon->aura_slots += base_value; break; case SE_IncreaseTrapCount: - newbon->trap_slots += base1; + newbon->trap_slots += base_value; break; case SE_ForageSkill: - newbon->GrantForage += base1; + newbon->GrantForage += base_value; // we need to grant a skill point here // I'd rather not do this here, but whatever, probably fine if (IsClient()) { @@ -1514,88 +1514,88 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; case SE_Attack_Accuracy_Max_Percent: - newbon->Attack_Accuracy_Max_Percent += base1; + newbon->Attack_Accuracy_Max_Percent += base_value; break; case SE_AC_Mitigation_Max_Percent: - newbon->AC_Mitigation_Max_Percent += base1; + newbon->AC_Mitigation_Max_Percent += base_value; break; case SE_AC_Avoidance_Max_Percent: - newbon->AC_Avoidance_Max_Percent += base1; + newbon->AC_Avoidance_Max_Percent += base_value; break; case SE_Damage_Taken_Position_Mod: { //Mitigate if damage taken from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; - else if (base1 < 0 && newbon->Damage_Taken_Position_Mod[base2] > base1) - newbon->Damage_Taken_Position_Mod[base2] = base1; - else if (base1 > 0 && newbon->Damage_Taken_Position_Mod[base2] < base1) - newbon->Damage_Taken_Position_Mod[base2] = base1; + else if (base_value < 0 && newbon->Damage_Taken_Position_Mod[limit_value] > base_value) + newbon->Damage_Taken_Position_Mod[limit_value] = base_value; + else if (base_value > 0 && newbon->Damage_Taken_Position_Mod[limit_value] < base_value) + newbon->Damage_Taken_Position_Mod[limit_value] = base_value; break; } case SE_Melee_Damage_Position_Mod: { - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; - else if (base1 < 0 && newbon->Melee_Damage_Position_Mod[base2] > base1) - newbon->Melee_Damage_Position_Mod[base2] = base1; - else if (base1 > 0 && newbon->Melee_Damage_Position_Mod[base2] < base1) - newbon->Melee_Damage_Position_Mod[base2] = base1; + else if (base_value < 0 && newbon->Melee_Damage_Position_Mod[limit_value] > base_value) + newbon->Melee_Damage_Position_Mod[limit_value] = base_value; + else if (base_value > 0 && newbon->Melee_Damage_Position_Mod[limit_value] < base_value) + newbon->Melee_Damage_Position_Mod[limit_value] = base_value; break; } case SE_Damage_Taken_Position_Amt: { //Mitigate if damage taken from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; - newbon->Damage_Taken_Position_Amt[base2] += base1; + newbon->Damage_Taken_Position_Amt[limit_value] += base_value; break; } case SE_Melee_Damage_Position_Amt: { //Mitigate if damage taken from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; - newbon->Melee_Damage_Position_Amt[base2] += base1; + newbon->Melee_Damage_Position_Amt[limit_value] += base_value; break; } case SE_DS_Mitigation_Amount: - newbon->DS_Mitigation_Amount += base1; + newbon->DS_Mitigation_Amount += base_value; break; case SE_DS_Mitigation_Percentage: - newbon->DS_Mitigation_Percentage += base1; + newbon->DS_Mitigation_Percentage += base_value; break; case SE_Pet_Crit_Melee_Damage_Pct_Owner: - newbon->Pet_Crit_Melee_Damage_Pct_Owner += base1; + newbon->Pet_Crit_Melee_Damage_Pct_Owner += base_value; break; case SE_Pet_Add_Atk: - newbon->Pet_Add_Atk += base1; + newbon->Pet_Add_Atk += base_value; break; case SE_Weapon_Stance: { - if (IsValidSpell(base1)) { //base1 is the spell_id of buff - if (base2 <= WEAPON_STANCE_TYPE_MAX) { //0=2H, 1=Shield, 2=DW - if (IsValidSpell(newbon->WeaponStance[base2])) { //Check if we already a spell_id saved for this effect - if (spells[newbon->WeaponStance[base2]].rank < spells[base1].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked). - newbon->WeaponStance[base2] = base1; //Overwrite with new effect + if (IsValidSpell(base_value)) { //base1 is the spell_id of buff + if (limit_value <= WEAPON_STANCE_TYPE_MAX) { //0=2H, 1=Shield, 2=DW + if (IsValidSpell(newbon->WeaponStance[limit_value])) { //Check if we already a spell_id saved for this effect + if (spells[newbon->WeaponStance[limit_value]].rank < spells[base_value].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked). + newbon->WeaponStance[limit_value] = base_value; //Overwrite with new effect SetWeaponStanceEnabled(true); } } else { - newbon->WeaponStance[base2] = base1; //If no prior effect exists, then apply + newbon->WeaponStance[limit_value] = base_value; //If no prior effect exists, then apply SetWeaponStanceEnabled(true); } } @@ -1605,18 +1605,18 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_ExtraAttackChance: { - if (newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] < base1) { - newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = base1; - newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + if (newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] < base_value) { + newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = base_value; + newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } break; } case SE_AddExtraAttackPct_1h_Primary: { - if (newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] < base1) { - newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = base1; - newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + if (newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] < base_value) { + newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = base_value; + newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } break; } @@ -1624,18 +1624,18 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_AddExtraAttackPct_1h_Secondary: { - if (newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] < base1) { - newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = base1; - newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + if (newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] < base_value) { + newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = base_value; + newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } break; } case SE_Double_Melee_Round: { - if (newbon->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] < base1) { - newbon->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] = base1; - newbon->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_DMG_BONUS] = base2; + if (newbon->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] < base_value) { + newbon->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] = base_value; + newbon->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_DMG_BONUS] = limit_value; } break; @@ -1643,52 +1643,52 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_ExtendedShielding: { - if (newbon->ExtendedShielding < base1) { - newbon->ExtendedShielding = base1; + if (newbon->ExtendedShielding < base_value) { + newbon->ExtendedShielding = base_value; } break; } case SE_ShieldDuration: { - if (newbon->ShieldDuration < base1) { - newbon->ShieldDuration = base1; + if (newbon->ShieldDuration < base_value) { + newbon->ShieldDuration = base_value; } break; } case SE_Worn_Endurance_Regen_Cap: - newbon->ItemEnduranceRegenCap += base1; + newbon->ItemEnduranceRegenCap += base_value; break; case SE_SecondaryForte: - if (newbon->SecondaryForte < base1) { - newbon->SecondaryForte = base1; + if (newbon->SecondaryForte < base_value) { + newbon->SecondaryForte = base_value; } break; case SE_ZoneSuspendMinion: - newbon->ZoneSuspendMinion = base1; + newbon->ZoneSuspendMinion = base_value; break; case SE_Reflect: - if (newbon->reflect[SBIndex::REFLECT_CHANCE] < base1) { - newbon->reflect[SBIndex::REFLECT_CHANCE] = base1; + if (newbon->reflect[SBIndex::REFLECT_CHANCE] < base_value) { + newbon->reflect[SBIndex::REFLECT_CHANCE] = base_value; } - if (newbon->reflect[SBIndex::REFLECT_RESISTANCE_MOD] < base2) { - newbon->reflect[SBIndex::REFLECT_RESISTANCE_MOD] = base2; + if (newbon->reflect[SBIndex::REFLECT_RESISTANCE_MOD] < limit_value) { + newbon->reflect[SBIndex::REFLECT_RESISTANCE_MOD] = limit_value; } break; case SE_SpellDamageShield: - newbon->SpellDamageShield += base1; + newbon->SpellDamageShield += base_value; break; case SE_Amplification: - newbon->Amplification += base1; + newbon->Amplification += base_value; break; // to do @@ -1756,7 +1756,7 @@ void Mob::CalcSpellBonuses(StatBonuses* newbon) if(buffs[i].spellid != SPELL_UNKNOWN){ ApplySpellsBonuses(buffs[i].spellid, buffs[i].casterlevel, newbon, buffs[i].casterid, 0, buffs[i].ticsremaining, i, buffs[i].instrument_mod); - if (buffs[i].numhits > 0) + if (buffs[i].hit_number > 0) Numhits(true); } } @@ -1781,7 +1781,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne uint8 WornType, int32 ticsremaining, int buffslot, int instrument_mod, bool IsAISpellEffect, uint16 effect_id, int32 se_base, int32 se_limit, int32 se_max) { - int i, effect_value, base2, max, effectid; + int i, effect_value, limit_value, max_value, spell_effect_id; bool AdditiveWornBonus = false; if(!IsAISpellEffect && !IsValidSpell(spell_id)) @@ -1800,11 +1800,11 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if (WornType){ if (RuleB(Spells, UseAdditiveFocusFromWornSlot)) { - new_bonus->FocusEffectsWorn[focus] += spells[spell_id].base[i]; + new_bonus->FocusEffectsWorn[focus] += spells[spell_id].base_value[i]; } } else { - new_bonus->FocusEffects[focus] = static_cast(spells[spell_id].effectid[i]); + new_bonus->FocusEffects[focus] = static_cast(spells[spell_id].effect_id[i]); } continue; } @@ -1813,21 +1813,21 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne AdditiveWornBonus = true; } - effectid = spells[spell_id].effectid[i]; + spell_effect_id = spells[spell_id].effect_id[i]; effect_value = CalcSpellEffectValue(spell_id, i, casterlevel, instrument_mod, nullptr, ticsremaining, casterId); - base2 = spells[spell_id].base2[i]; - max = spells[spell_id].max[i]; + limit_value = spells[spell_id].limit_value[i]; + max_value = spells[spell_id].max_value[i]; } //Use AISpellEffects else { - effectid = effect_id; + spell_effect_id = effect_id; effect_value = se_base; - base2 = se_limit; - max = se_max; + limit_value = se_limit; + max_value = se_max; i = EFFECT_COUNT; //End the loop } - switch (effectid) + switch (spell_effect_id) { case SE_CurrentHP: //regens if(effect_value > 0) { @@ -1841,7 +1841,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_ChangeFrenzyRad: { - if (max != 0 && GetLevel() > max) + if (max_value != 0 && GetLevel() > max_value) break; if(new_bonus->AggroRange == -1 || effect_value < new_bonus->AggroRange) @@ -1853,7 +1853,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_Harmony: { - if (max != 0 && GetLevel() > max) + if (max_value != 0 && GetLevel() > max_value) break; // Harmony effect as buff - kinda tricky // harmony could stack with a lull spell, which has better aggro range @@ -2010,7 +2010,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_CHA: { - if (spells[spell_id].base[i] != 0) { + if (spells[spell_id].base_value[i] != 0) { new_bonus->CHA += effect_value; } break; @@ -2076,7 +2076,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_RaiseStatCap: { - switch(spells[spell_id].base2[i]) + switch(spells[spell_id].limit_value[i]) { //are these #define'd somewhere? case 0: //str @@ -2147,8 +2147,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->DamageShield += effect_value; new_bonus->DamageShieldSpellID = spell_id; //When using npc_spells_effects MAX value can be set to determine DS Type - if (IsAISpellEffect && max) - new_bonus->DamageShieldType = GetDamageShieldType(spell_id, max); + if (IsAISpellEffect && max_value) + new_bonus->DamageShieldType = GetDamageShieldType(spell_id, max_value); else new_bonus->DamageShieldType = GetDamageShieldType(spell_id); @@ -2160,8 +2160,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->ReverseDamageShield += effect_value; new_bonus->ReverseDamageShieldSpellID = spell_id; - if (IsAISpellEffect && max) - new_bonus->ReverseDamageShieldType = GetDamageShieldType(spell_id, max); + if (IsAISpellEffect && max_value) + new_bonus->ReverseDamageShieldType = GetDamageShieldType(spell_id, max_value); else new_bonus->ReverseDamageShieldType = GetDamageShieldType(spell_id); break; @@ -2175,8 +2175,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne else if (new_bonus->reflect[SBIndex::REFLECT_CHANCE] < effect_value) { new_bonus->reflect[SBIndex::REFLECT_CHANCE] = effect_value; - new_bonus->reflect[SBIndex::REFLECT_RESISTANCE_MOD] = base2; - new_bonus->reflect[SBIndex::REFLECT_DMG_EFFECTIVENESS] = max; + new_bonus->reflect[SBIndex::REFLECT_RESISTANCE_MOD] = limit_value; + new_bonus->reflect[SBIndex::REFLECT_DMG_EFFECTIVENESS] = max_value; } break; @@ -2196,28 +2196,28 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_CriticalHitChance: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; if (AdditiveWornBonus) { - if(base2 == ALL_SKILLS) + if(limit_value == ALL_SKILLS) new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] += effect_value; else - new_bonus->CriticalHitChance[base2] += effect_value; + new_bonus->CriticalHitChance[limit_value] += effect_value; } else if(effect_value < 0) { - if (base2 == ALL_SKILLS && new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] > effect_value) + if (limit_value == ALL_SKILLS && new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] > effect_value) new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] = effect_value; - else if(base2 != ALL_SKILLS && new_bonus->CriticalHitChance[base2] > effect_value) - new_bonus->CriticalHitChance[base2] = effect_value; + else if(limit_value != ALL_SKILLS && new_bonus->CriticalHitChance[limit_value] > effect_value) + new_bonus->CriticalHitChance[limit_value] = effect_value; } - else if (base2 == ALL_SKILLS && new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] < effect_value) + else if (limit_value == ALL_SKILLS && new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] < effect_value) new_bonus->CriticalHitChance[EQ::skills::HIGHEST_SKILL + 1] = effect_value; - else if(base2 != ALL_SKILLS && new_bonus->CriticalHitChance[base2] < effect_value) - new_bonus->CriticalHitChance[base2] = effect_value; + else if(limit_value != ALL_SKILLS && new_bonus->CriticalHitChance[limit_value] < effect_value) + new_bonus->CriticalHitChance[limit_value] = effect_value; break; } @@ -2332,7 +2332,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_MeleeLifetap: { if (AdditiveWornBonus) - new_bonus->MeleeLifetap += spells[spell_id].base[i]; + new_bonus->MeleeLifetap += spells[spell_id].base_value[i]; else if((effect_value < 0) && (new_bonus->MeleeLifetap > effect_value)) new_bonus->MeleeLifetap = effect_value; @@ -2394,7 +2394,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->MeleeSkillCheck < effect_value) { new_bonus->MeleeSkillCheck = effect_value; - new_bonus->MeleeSkillCheckSkill = base2==ALL_SKILLS?255:base2; + new_bonus->MeleeSkillCheckSkill = limit_value==ALL_SKILLS?255:limit_value; } break; } @@ -2402,17 +2402,17 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_HitChance: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; if (AdditiveWornBonus){ - if(base2 == ALL_SKILLS) + if(limit_value == ALL_SKILLS) new_bonus->HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] += effect_value; else - new_bonus->HitChanceEffect[base2] += effect_value; + new_bonus->HitChanceEffect[limit_value] += effect_value; } - else if(base2 == ALL_SKILLS){ + else if(limit_value == ALL_SKILLS){ if ((effect_value < 0) && (new_bonus->HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] > effect_value)) new_bonus->HitChanceEffect[EQ::skills::HIGHEST_SKILL + 1] = effect_value; @@ -2424,12 +2424,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne else { - if ((effect_value < 0) && (new_bonus->HitChanceEffect[base2] > effect_value)) - new_bonus->HitChanceEffect[base2] = effect_value; + if ((effect_value < 0) && (new_bonus->HitChanceEffect[limit_value] > effect_value)) + new_bonus->HitChanceEffect[limit_value] = effect_value; - else if (!new_bonus->HitChanceEffect[base2] || - ((new_bonus->HitChanceEffect[base2] > 0) && (new_bonus->HitChanceEffect[base2] < effect_value))) - new_bonus->HitChanceEffect[base2] = effect_value; + else if (!new_bonus->HitChanceEffect[limit_value] || + ((new_bonus->HitChanceEffect[limit_value] > 0) && (new_bonus->HitChanceEffect[limit_value] < effect_value))) + new_bonus->HitChanceEffect[limit_value] = effect_value; } break; @@ -2439,9 +2439,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_DamageModifier: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - int skill = base2 == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : base2; + int skill = limit_value == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : limit_value; if (effect_value < 0 && new_bonus->DamageModifier[skill] > effect_value) new_bonus->DamageModifier[skill] = effect_value; else if (effect_value > 0 && new_bonus->DamageModifier[skill] < effect_value) @@ -2452,9 +2452,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_DamageModifier2: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - int skill = base2 == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : base2; + int skill = limit_value == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : limit_value; if (effect_value < 0 && new_bonus->DamageModifier2[skill] > effect_value) new_bonus->DamageModifier2[skill] = effect_value; else if (effect_value > 0 && new_bonus->DamageModifier2[skill] < effect_value) @@ -2465,9 +2465,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_Skill_Base_Damage_Mod: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - int skill = base2 == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : base2; + int skill = limit_value == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : limit_value; if (effect_value < 0 && new_bonus->DamageModifier3[skill] > effect_value) new_bonus->DamageModifier3[skill] = effect_value; else if (effect_value > 0 && new_bonus->DamageModifier3[skill] < effect_value) @@ -2478,9 +2478,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_MinDamageModifier: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - int skill = base2 == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : base2; + int skill = limit_value == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : limit_value; if (effect_value < 0 && new_bonus->MinDamageModifier[skill] > effect_value) new_bonus->MinDamageModifier[skill] = effect_value; else if (effect_value > 0 && new_bonus->MinDamageModifier[skill] < effect_value) @@ -2513,11 +2513,11 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if (AdditiveWornBonus) { new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] += effect_value; - new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } if (new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] < effect_value) { new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value; - new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } break; } @@ -2526,12 +2526,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if (AdditiveWornBonus) { new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] += effect_value; - new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } if (new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] < effect_value) { new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value; - new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } break; } @@ -2540,12 +2540,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if (AdditiveWornBonus) { new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] += effect_value; - new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } if (new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] < effect_value) { new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value; - new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1; + new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = limit_value ? limit_value : 1; } break; } @@ -2554,12 +2554,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if (AdditiveWornBonus) { new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] += effect_value; - new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_DMG_BONUS] += base2; + new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_DMG_BONUS] += limit_value; } if (new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] < effect_value) { new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_CHANCE] = effect_value; - new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_DMG_BONUS] = base2; + new_bonus->DoubleMeleeRound[SBIndex::DOUBLE_MELEE_ROUND_DMG_BONUS] = limit_value; } break; } @@ -2578,8 +2578,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->DeathSave[SBIndex::DEATH_SAVE_TYPE] = effect_value; //1='Partial' 2='Full' new_bonus->DeathSave[SBIndex::DEATH_SAVE_BUFFSLOT] = buffslot; //These are used in later expansion spell effects. - new_bonus->DeathSave[SBIndex::DEATH_SAVE_MIN_LEVEL_FOR_HEAL] = base2;//Min level for HealAmt - new_bonus->DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT] = max;//HealAmt + new_bonus->DeathSave[SBIndex::DEATH_SAVE_MIN_LEVEL_FOR_HEAL] = limit_value;//Min level for HealAmt + new_bonus->DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT] = max_value;//HealAmt } break; } @@ -2594,7 +2594,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne else if(new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] < effect_value) { new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] = effect_value; - new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = base2; + new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = limit_value; } break; } @@ -2606,7 +2606,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_Accuracy: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; if ((effect_value < 0) && (new_bonus->Accuracy[EQ::skills::HIGHEST_SKILL + 1] > effect_value)) new_bonus->Accuracy[EQ::skills::HIGHEST_SKILL + 1] = effect_value; @@ -2632,21 +2632,21 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_SkillDamageTaken: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; //When using npc_spells_effects if MAX value set, use stackable quest based modifier. - if (IsAISpellEffect && max){ - if(base2 == ALL_SKILLS) + if (IsAISpellEffect && max_value){ + if(limit_value == ALL_SKILLS) SkillDmgTaken_Mod[EQ::skills::HIGHEST_SKILL + 1] = effect_value; else - SkillDmgTaken_Mod[base2] = effect_value; + SkillDmgTaken_Mod[limit_value] = effect_value; } else { - if(base2 == ALL_SKILLS) + if(limit_value == ALL_SKILLS) new_bonus->SkillDmgTaken[EQ::skills::HIGHEST_SKILL + 1] += effect_value; else - new_bonus->SkillDmgTaken[base2] += effect_value; + new_bonus->SkillDmgTaken[limit_value] += effect_value; } break; @@ -2660,8 +2660,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { new_bonus->CriticalSpellChance += effect_value; - if (base2 > new_bonus->SpellCritDmgIncNoStack) - new_bonus->SpellCritDmgIncNoStack = base2; + if (limit_value > new_bonus->SpellCritDmgIncNoStack) + new_bonus->SpellCritDmgIncNoStack = limit_value; break; } @@ -2701,8 +2701,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne spells that do decrease the mitigation with just negative base values. To be consistent all values that increase mitigation will be set to positives */ - if (max > 0 && effect_value < 0) { - effect_value = max; + if (max_value > 0 && effect_value < 0) { + effect_value = max_value; } new_bonus->DSMitigationOffHand += effect_value; @@ -2720,9 +2720,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if(!new_bonus->SpellOnKill[e]) { // Base2 = Spell to fire | Base1 = % chance | Base3 = min level - new_bonus->SpellOnKill[e] = base2; + new_bonus->SpellOnKill[e] = limit_value; new_bonus->SpellOnKill[e+1] = effect_value; - new_bonus->SpellOnKill[e+2] = max; + new_bonus->SpellOnKill[e+2] = max_value; break; } } @@ -2736,7 +2736,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if(!new_bonus->SpellOnDeath[e]) { // Base2 = Spell to fire | Base1 = % chance - new_bonus->SpellOnDeath[e] = base2; + new_bonus->SpellOnDeath[e] = limit_value; new_bonus->SpellOnDeath[e+1] = effect_value; break; } @@ -2747,21 +2747,21 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_CriticalDamageMob: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if(base2 == ALL_SKILLS) + if(limit_value == ALL_SKILLS) new_bonus->CritDmgMod[EQ::skills::HIGHEST_SKILL + 1] += effect_value; else - new_bonus->CritDmgMod[base2] += effect_value; + new_bonus->CritDmgMod[limit_value] += effect_value; break; } case SE_Critical_Melee_Damage_Mod_Max: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - int skill = base2 == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : base2; + int skill = limit_value == ALL_SKILLS ? EQ::skills::HIGHEST_SKILL + 1 : limit_value; if (effect_value < 0 && new_bonus->CritDmgModNoStack[skill] > effect_value) new_bonus->CritDmgModNoStack[skill] = effect_value; else if (effect_value > 0 && new_bonus->CritDmgModNoStack[skill] < effect_value) { @@ -2772,20 +2772,20 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_ReduceSkillTimer: { - if(new_bonus->SkillReuseTime[base2] < effect_value) - new_bonus->SkillReuseTime[base2] = effect_value; + if(new_bonus->SkillReuseTime[limit_value] < effect_value) + new_bonus->SkillReuseTime[limit_value] = effect_value; break; } case SE_SkillDamageAmount: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if(base2 == ALL_SKILLS) + if(limit_value == ALL_SKILLS) new_bonus->SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] += effect_value; else - new_bonus->SkillDamageAmount[base2] += effect_value; + new_bonus->SkillDamageAmount[limit_value] += effect_value; break; } @@ -2822,11 +2822,11 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] != 0 && new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] > effect_value){ new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value; - new_bonus->HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2; + new_bonus->HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = limit_value; } else if(new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] == 0){ new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value; - new_bonus->HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2; + new_bonus->HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = limit_value; } break; } @@ -2834,11 +2834,11 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] != 0 && new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] > effect_value){ new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value; - new_bonus->ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2; + new_bonus->ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = limit_value; } else if(new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] == 0) { new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value; - new_bonus->ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2; + new_bonus->ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = limit_value; } break; @@ -2847,12 +2847,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] != 0 && new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] > effect_value) { new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value; - new_bonus->EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2; + new_bonus->EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = limit_value; } else if(new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] == 0){ new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value; - new_bonus->EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2; + new_bonus->EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = limit_value; } break; @@ -2888,29 +2888,29 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { //Lower the ratio the more favorable if((!new_bonus->HPToManaConvert) || (new_bonus->HPToManaConvert >= effect_value)) - new_bonus->HPToManaConvert = spells[spell_id].base[i]; + new_bonus->HPToManaConvert = spells[spell_id].base_value[i]; break; } case SE_SkillDamageAmount2: { // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if(base2 == ALL_SKILLS) + if(limit_value == ALL_SKILLS) new_bonus->SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1] += effect_value; else - new_bonus->SkillDamageAmount2[base2] += effect_value; + new_bonus->SkillDamageAmount2[limit_value] += effect_value; break; } case SE_NegateAttacks: { if (!new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] || - ((new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] && new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT]) && (new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] < max))){ + ((new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] && new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT]) && (new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] < max_value))){ new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] = 1; new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT] = buffslot; - new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] = max; + new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] = max_value; } break; } @@ -2920,8 +2920,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] < effect_value){ new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value; new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = buffslot; - new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = base2; - new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max; + new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = limit_value; + new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max_value; } break; } @@ -2932,7 +2932,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] < effect_value){ new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] = effect_value; new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = buffslot; - new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER] = base2; + new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER] = limit_value; } break; } @@ -2942,7 +2942,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] < effect_value){ new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] = effect_value; new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = buffslot; - new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER] = base2; + new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER] = limit_value; } break; } @@ -2952,8 +2952,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] < effect_value){ new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value; new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = buffslot; - new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = base2; - new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max; + new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = limit_value; + new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max_value; } break; } @@ -2963,8 +2963,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] < effect_value){ new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value; new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = buffslot; - new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = base2; - new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max; + new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = limit_value; + new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max_value; } break; } @@ -2981,7 +2981,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if (new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] < effect_value) { new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] = effect_value; - new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_DRAIN_PER_HP] = base2; + new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_DRAIN_PER_HP] = limit_value; } break; } @@ -3097,7 +3097,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne break; case SE_AddSingingMod: - switch (base2) { + switch (limit_value) { case EQ::item::ItemTypeWindInstrument: new_bonus->windMod += effect_value; break; @@ -3191,13 +3191,13 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { for(int e = 0; e < MAX_RESISTABLE_EFFECTS*2; e+=2) { - if(new_bonus->SEResist[e+1] && (new_bonus->SEResist[e] == base2) && (new_bonus->SEResist[e+1] < effect_value)){ - new_bonus->SEResist[e] = base2; //Spell Effect ID + if(new_bonus->SEResist[e+1] && (new_bonus->SEResist[e] == limit_value) && (new_bonus->SEResist[e+1] < effect_value)){ + new_bonus->SEResist[e] = limit_value; //Spell Effect ID new_bonus->SEResist[e+1] = effect_value; //Resist Chance break; } else if (!new_bonus->SEResist[e+1]){ - new_bonus->SEResist[e] = base2; //Spell Effect ID + new_bonus->SEResist[e] = limit_value; //Spell Effect ID new_bonus->SEResist[e+1] = effect_value; //Resist Chance break; } @@ -3220,7 +3220,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_GiveDoubleRiposte: { //Only allow for regular double riposte chance. - if(new_bonus->GiveDoubleRiposte[base2] == 0){ + if(new_bonus->GiveDoubleRiposte[limit_value] == 0){ if(new_bonus->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] < effect_value) new_bonus->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = effect_value; } @@ -3231,7 +3231,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] < effect_value) new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = effect_value; // Rate - new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = base2; // Damage Modifier + new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = limit_value; // Damage Modifier break; } @@ -3247,7 +3247,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_ImprovedTaunt: if (new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL] < effect_value) { new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL] = effect_value; - new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_AGGRO_MOD] = base2; + new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_AGGRO_MOD] = limit_value; new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT] = buffslot; } break; @@ -3258,7 +3258,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne break; case SE_FrenziedDevastation: - new_bonus->FrenziedDevastation += base2; + new_bonus->FrenziedDevastation += limit_value; break; case SE_Root: @@ -3366,9 +3366,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_HeadShot: { - if(new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_DMG] < base2){ + if(new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_DMG] < limit_value){ new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value; - new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_DMG] = base2; + new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_DMG] = limit_value; } break; } @@ -3377,16 +3377,16 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < effect_value) { new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value; - new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2; + new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = limit_value; } break; } case SE_Assassinate: { - if(new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_DMG] < base2){ + if(new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_DMG] < limit_value){ new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value; - new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_DMG] = base2; + new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_DMG] = limit_value; } break; } @@ -3395,7 +3395,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne { if(new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < effect_value) { new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value; - new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2; + new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = limit_value; } break; } @@ -3403,9 +3403,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_FinishingBlow: { //base1 = chance, base2 = damage - if (new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] < base2){ + if (new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] < limit_value){ new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value; - new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = base2; + new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = limit_value; } break; } @@ -3415,7 +3415,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne //base1 = level, base2 = ??? (Set to 200 in AA data, possible proc rate mod?) if (new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < effect_value){ new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value; - new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2; + new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = limit_value; } break; } @@ -3444,7 +3444,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_LimitToSkill:{ // Bad data or unsupported new skill - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; if (effect_value <= EQ::skills::HIGHEST_SKILL){ new_bonus->LimitToSkill[effect_value] = true; @@ -3484,15 +3484,15 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_PC_Pet_Rampage: { new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += effect_value; //Chance to rampage - if (new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2) - new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest + if (new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < limit_value) + new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = limit_value; //Damage modifer - take highest break; } case SE_PC_Pet_AE_Rampage: { new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += effect_value; //Chance to rampage - if (new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2) - new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest + if (new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < limit_value) + new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = limit_value; //Damage modifer - take highest break; } @@ -3510,10 +3510,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_ReduceTradeskillFail:{ - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - new_bonus->ReduceTradeskillFail[base2] += effect_value; + new_bonus->ReduceTradeskillFail[limit_value] += effect_value; break; } @@ -3523,11 +3523,11 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne break; case SE_RaiseSkillCap: { - if (base2 > EQ::skills::HIGHEST_SKILL) + if (limit_value > EQ::skills::HIGHEST_SKILL) break; - if (new_bonus->RaiseSkillCap[base2] < effect_value) - new_bonus->RaiseSkillCap[base2] = effect_value; + if (new_bonus->RaiseSkillCap[limit_value] < effect_value) + new_bonus->RaiseSkillCap[limit_value] = effect_value; break; } @@ -3567,48 +3567,48 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_Damage_Taken_Position_Mod: { //Mitigate if damage taken from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; if (AdditiveWornBonus) - new_bonus->Damage_Taken_Position_Mod[base2] += effect_value; - else if (effect_value < 0 && new_bonus->Damage_Taken_Position_Mod[base2] > effect_value) - new_bonus->Damage_Taken_Position_Mod[base2] = effect_value; - else if (effect_value > 0 && new_bonus->Damage_Taken_Position_Mod[base2] < effect_value) - new_bonus->Damage_Taken_Position_Mod[base2] = effect_value; + new_bonus->Damage_Taken_Position_Mod[limit_value] += effect_value; + else if (effect_value < 0 && new_bonus->Damage_Taken_Position_Mod[limit_value] > effect_value) + new_bonus->Damage_Taken_Position_Mod[limit_value] = effect_value; + else if (effect_value > 0 && new_bonus->Damage_Taken_Position_Mod[limit_value] < effect_value) + new_bonus->Damage_Taken_Position_Mod[limit_value] = effect_value; break; } case SE_Melee_Damage_Position_Mod: { //Increase damage by percent from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; if (AdditiveWornBonus) - new_bonus->Melee_Damage_Position_Mod[base2] += effect_value; - else if (effect_value < 0 && new_bonus->Melee_Damage_Position_Mod[base2] > effect_value) - new_bonus->Melee_Damage_Position_Mod[base2] = effect_value; - else if (effect_value > 0 && new_bonus->Melee_Damage_Position_Mod[base2] < effect_value) - new_bonus->Melee_Damage_Position_Mod[base2] = effect_value; + new_bonus->Melee_Damage_Position_Mod[limit_value] += effect_value; + else if (effect_value < 0 && new_bonus->Melee_Damage_Position_Mod[limit_value] > effect_value) + new_bonus->Melee_Damage_Position_Mod[limit_value] = effect_value; + else if (effect_value > 0 && new_bonus->Melee_Damage_Position_Mod[limit_value] < effect_value) + new_bonus->Melee_Damage_Position_Mod[limit_value] = effect_value; break; } case SE_Damage_Taken_Position_Amt: { //Mitigate if damage taken from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; - new_bonus->Damage_Taken_Position_Amt[base2] += effect_value; + new_bonus->Damage_Taken_Position_Amt[limit_value] += effect_value; break; } case SE_Melee_Damage_Position_Amt: { //Mitigate if damage taken from behind base2 = 0, from front base2 = 1 - if (base2 < 0 || base2 > 2) + if (limit_value < 0 || limit_value > 2) break; - new_bonus->Melee_Damage_Position_Amt[base2] += effect_value; + new_bonus->Melee_Damage_Position_Amt[limit_value] += effect_value; break; } @@ -3666,10 +3666,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_Weapon_Stance: { if (IsValidSpell(effect_value)) { //base1 is the spell_id of buff - if (base2 <= WEAPON_STANCE_TYPE_MAX) { //0=2H, 1=Shield, 2=DW - if (IsValidSpell(new_bonus->WeaponStance[base2])) { //Check if we already a spell_id saved for this effect - if (spells[new_bonus->WeaponStance[base2]].rank < spells[effect_value].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked). - new_bonus->WeaponStance[base2] = effect_value; //Overwrite with new effect + if (limit_value <= WEAPON_STANCE_TYPE_MAX) { //0=2H, 1=Shield, 2=DW + if (IsValidSpell(new_bonus->WeaponStance[limit_value])) { //Check if we already a spell_id saved for this effect + if (spells[new_bonus->WeaponStance[limit_value]].rank < spells[effect_value].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked). + new_bonus->WeaponStance[limit_value] = effect_value; //Overwrite with new effect SetWeaponStanceEnabled(true); if (WornType) { @@ -3681,7 +3681,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne } } else { - new_bonus->WeaponStance[base2] = effect_value; //If no prior effect exists, then apply + new_bonus->WeaponStance[limit_value] = effect_value; //If no prior effect exists, then apply SetWeaponStanceEnabled(true); if (WornType) { @@ -3709,7 +3709,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne //Non-Focused Effect to modify incoming spell damage by resist type. case SE_FcSpellVulnerability: - ModVulnerability(base2, effect_value); + ModVulnerability(limit_value, effect_value); break; } } @@ -3985,7 +3985,7 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff uint16 effect = 0; if (!AA) - effect = spells[spell_id].effectid[effect_index]; + effect = spells[spell_id].effect_id[effect_index]; else effect = aa_effect; @@ -4097,10 +4097,10 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id) bool negate_aabonus = false; bool negate_itembonus = false; - if (spells[spell_id].effectid[i] == SE_NegateSpellEffect) { + if (spells[spell_id].effect_id[i] == SE_NegateSpellEffect) { //Set negate types - switch (spells[spell_id].base[i]) + switch (spells[spell_id].base_value[i]) { case NEGATE_SPA_ALL_BONUSES: negate_spellbonus = true; @@ -4139,7 +4139,7 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id) //Negate focus effects for (int e = 0; e < HIGHEST_FOCUS + 1; e++) { - if (spellbonuses.FocusEffects[e] == spells[spell_id].base2[i]) + if (spellbonuses.FocusEffects[e] == spells[spell_id].limit_value[i]) { if (negate_spellbonus) { spellbonuses.FocusEffects[e] = effect_value; } continue; @@ -4147,7 +4147,7 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id) } //Negate bonuses - switch (spells[spell_id].base2[i]) + switch (spells[spell_id].limit_value[i]) { case SE_CurrentHP: if (negate_spellbonus) { spellbonuses.HPRegen = effect_value; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 9f9f723b9..e86bf579a 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -257,30 +257,30 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to } for (int x1 = 0; x1 < EFFECT_COUNT; x1++) { - switch (spell.effectid[x1]) { + switch (spell.effect_id[x1]) { case SE_IllusionCopy: case SE_Illusion: { - if (spell.base[x1] == -1) { + if (spell.base_value[x1] == -1) { if (gender == 1) gender = 0; else if (gender == 0) gender = 1; SendIllusionPacket(GetRace(), gender, 0xFF, 0xFF); } - else if (spell.base[x1] == -2) // WTF IS THIS + else if (spell.base_value[x1] == -2) // WTF IS THIS { if (GetRace() == 128 || GetRace() == 130 || GetRace() <= 12) - SendIllusionPacket(GetRace(), GetGender(), spell.base2[x1], spell.max[x1]); + SendIllusionPacket(GetRace(), GetGender(), spell.limit_value[x1], spell.max_value[x1]); } - else if (spell.max[x1] > 0) + else if (spell.max_value[x1] > 0) { - SendIllusionPacket(spell.base[x1], 0xFF, spell.base2[x1], spell.max[x1]); + SendIllusionPacket(spell.base_value[x1], 0xFF, spell.limit_value[x1], spell.max_value[x1]); } else { - SendIllusionPacket(spell.base[x1], 0xFF, 0xFF, 0xFF); + SendIllusionPacket(spell.base_value[x1], 0xFF, 0xFF, 0xFF); } - switch (spell.base[x1]) { + switch (spell.base_value[x1]) { case OGRE: SendAppearancePacket(AT_Size, 9); break; @@ -367,17 +367,17 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to case SE_AddMeleeProc: case SE_WeaponProc: { - AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid, buffs[j1].casterlevel); + AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, buffs[j1].casterlevel); break; } case SE_DefensiveProc: { - AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); + AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); break; } case SE_RangedProc: { - AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); + AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); break; } } @@ -4937,8 +4937,8 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp bool LimitSpellSkill = false; bool SpellSkill_Found = false; uint32 effect = 0; - int32 base1 = 0; - int32 base2 = 0; + int32 base_value = 0; + int32 limit_value = 0; uint32 slot = 0; bool LimitFound = false; int FocusCount = 0; @@ -4953,8 +4953,8 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp for(auto &eff : rank->effects) { effect = eff.effect_id; - base1 = eff.base1; - base2 = eff.base2; + base_value = eff.base_value; + limit_value = eff.limit_value; slot = eff.slot; //AA Foci's can contain multiple focus effects within the same AA. @@ -4979,22 +4979,22 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp case SE_Blank: break; case SE_LimitResist: - if(base1) { - if(spell.resisttype != base1) + if(base_value) { + if(spell.resist_type != base_value) LimitFound = true; } break; case SE_LimitInstant: - if(spell.buffduration) + if(spell.buff_duration) LimitFound = true; break; case SE_LimitMaxLevel: spell_level = spell.classes[(GetClass() % 17) - 1]; - lvldiff = spell_level - base1; + lvldiff = spell_level - base_value; //every level over cap reduces the effect by base2 percent unless from a clicky when ItemCastsUseFocus is true if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) { - if(base2 > 0) { - lvlModifier -= (base2 * lvldiff); + if(limit_value > 0) { + lvlModifier -= (limit_value * lvldiff); if(lvlModifier < 1) LimitFound = true; } @@ -5003,37 +5003,37 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp } break; case SE_LimitMinLevel: - if((spell.classes[(GetClass() % 17) - 1]) < base1) + if((spell.classes[(GetClass() % 17) - 1]) < base_value) LimitFound = true; break; case SE_LimitCastTimeMin: - if (spell.cast_time < base1) + if (spell.cast_time < base_value) LimitFound = true; break; case SE_LimitSpell: - if(base1 < 0) { - if (spell_id == (base1*-1)) + if(base_value < 0) { + if (spell_id == (base_value*-1)) LimitFound = true; } else { - if (spell_id != base1) + if (spell_id != base_value) LimitFound = true; } break; case SE_LimitMinDur: - if (base1 > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration)) + if (base_value > CalcBuffDuration_formula(GetLevel(), spell.buff_duration_formula, spell.buff_duration)) LimitFound = true; break; case SE_LimitEffect: - if(base1 < 0) { - if(IsEffectInSpell(spell_id,(base1*-1))) + if(base_value < 0) { + if(IsEffectInSpell(spell_id,(base_value*-1))) LimitFound = true; } else { - if(!IsEffectInSpell(spell_id,base1)) + if(!IsEffectInSpell(spell_id,base_value)) LimitFound = true; } break; case SE_LimitSpellType: - switch(base1) { + switch(base_value) { case 0: if (!IsDetrimentalSpell(spell_id)) LimitFound = true; @@ -5046,110 +5046,110 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp break; case SE_LimitManaMin: - if(spell.mana < base1) + if(spell.mana < base_value) LimitFound = true; break; case SE_LimitTarget: - if(base1 < 0) { - if(-base1 == spell.targettype) + if(base_value < 0) { + if(-base_value == spell.target_type) LimitFound = true; } else { - if(base1 != spell.targettype) + if(base_value != spell.target_type) LimitFound = true; } break; case SE_LimitCombatSkills: - if((base1 == 1 && !IsDiscipline(spell_id)) || (base1 == 0 && IsDiscipline(spell_id))) + if((base_value == 1 && !IsDiscipline(spell_id)) || (base_value == 0 && IsDiscipline(spell_id))) LimitFound = true; break; case SE_LimitSpellGroup: - if((base1 > 0 && base1 != spell.spellgroup) || (base1 < 0 && base1 == spell.spellgroup)) + if((base_value > 0 && base_value != spell.spell_group) || (base_value < 0 && base_value == spell.spell_group)) LimitFound = true; break; case SE_LimitCastingSkill: LimitSpellSkill = true; - if(base1 == spell.skill) + if(base_value == spell.skill) SpellSkill_Found = true; break; case SE_LimitClass: //Do not use this limit more then once per spell. If multiple class, treat value like items would. - if (!PassLimitClass(base1, GetClass())) + if (!PassLimitClass(base_value, GetClass())) LimitFound = true; break; //Handle Focus Effects case SE_ImprovedDamage: - if (type == focusImprovedDamage && base1 > value) - value = base1; + if (type == focusImprovedDamage && base_value > value) + value = base_value; break; case SE_ImprovedDamage2: - if (type == focusImprovedDamage2 && base1 > value) - value = base1; + if (type == focusImprovedDamage2 && base_value > value) + value = base_value; break; case SE_ImprovedHeal: - if (type == focusImprovedHeal && base1 > value) - value = base1; + if (type == focusImprovedHeal && base_value > value) + value = base_value; break; case SE_ReduceManaCost: if (type == focusManaCost) - value = base1; + value = base_value; break; case SE_IncreaseSpellHaste: - if (type == focusSpellHaste && base1 > value) - value = base1; + if (type == focusSpellHaste && base_value > value) + value = base_value; break; case SE_IncreaseSpellDuration: - if (type == focusSpellDuration && base1 > value) - value = base1; + if (type == focusSpellDuration && base_value > value) + value = base_value; break; case SE_SpellDurationIncByTic: - if (type == focusSpellDurByTic && base1 > value) - value = base1; + if (type == focusSpellDurByTic && base_value > value) + value = base_value; break; case SE_SwarmPetDuration: - if (type == focusSwarmPetDuration && base1 > value) - value = base1; + if (type == focusSwarmPetDuration && base_value > value) + value = base_value; break; case SE_IncreaseRange: - if (type == focusRange && base1 > value) - value = base1; + if (type == focusRange && base_value > value) + value = base_value; break; case SE_ReduceReagentCost: - if (type == focusReagentCost && base1 > value) - value = base1; + if (type == focusReagentCost && base_value > value) + value = base_value; break; case SE_PetPowerIncrease: - if (type == focusPetPower && base1 > value) - value = base1; + if (type == focusPetPower && base_value > value) + value = base_value; break; case SE_SpellResistReduction: - if (type == focusResistRate && base1 > value) - value = base1; + if (type == focusResistRate && base_value > value) + value = base_value; break; case SE_SpellHateMod: if (type == focusSpellHateMod) { if(value != 0) { if(value > 0) { - if(base1 > value) - value = base1; + if(base_value > value) + value = base_value; } else { - if(base1 < value) - value = base1; + if(base_value < value) + value = base_value; } } else - value = base1; + value = base_value; } break; case SE_ReduceReuseTimer: { if(type == focusReduceRecastTime) - value = (base1 / 1000); + value = (base_value / 1000); break; } case SE_TriggerOnCast: { if(type == focusTriggerOnCast) { - if(zone->random.Int(0, 100) <= base1) - value = base2; + if(zone->random.Int(0, 100) <= base_value) + value = limit_value; else { value = 0; LimitFound = true; @@ -5159,19 +5159,19 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp } case SE_FcSpellVulnerability: { if(type == focusSpellVulnerability) - value = base1; + value = base_value; break; } case SE_BlockNextSpellFocus: { if(type == focusBlockNextSpell) { - if(zone->random.Int(1, 100) <= base1) + if(zone->random.Int(1, 100) <= base_value) value = 1; } break; } case SE_FcTwincast: { if(type == focusTwincast) - value = base1; + value = base_value; break; } //case SE_SympatheticProc: @@ -5193,57 +5193,57 @@ int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 sp //} case SE_FcDamageAmt: { if(type == focusFcDamageAmt) - value = base1; + value = base_value; break; } case SE_FcDamageAmt2: { if(type == focusFcDamageAmt2) - value = base1; + value = base_value; break; } case SE_FcDamageAmtCrit: { if(type == focusFcDamageAmtCrit) - value = base1; + value = base_value; break; } case SE_FcDamageAmtIncoming: { if(type == focusFcDamageAmtIncoming) - value = base1; + value = base_value; break; } case SE_FcHealAmtIncoming: if(type == focusFcHealAmtIncoming) - value = base1; + value = base_value; break; case SE_FcHealPctCritIncoming: if (type == focusFcHealPctCritIncoming) - value = base1; + value = base_value; break; case SE_FcHealAmtCrit: if(type == focusFcHealAmtCrit) - value = base1; + value = base_value; break; case SE_FcHealAmt: if(type == focusFcHealAmt) - value = base1; + value = base_value; break; case SE_FcHealPctIncoming: if(type == focusFcHealPctIncoming) - value = base1; + value = base_value; break; case SE_FcBaseEffects: { if (type == focusFcBaseEffects) - value = base1; + value = base_value; break; } case SE_FcDamagePctCrit: { if(type == focusFcDamagePctCrit) - value = base1; + value = base_value; break; } case SE_FcIncreaseNumHits: { if(type == focusIncreaseNumHits) - value = base1; + value = base_value; break; } @@ -5375,7 +5375,7 @@ int32 Bot::GetBotFocusEffect(focusType bottype, uint16 spell_id) { realTotal2 = CalcBotFocusEffect(bottype, focusspell_tracker, spell_id); // For effects like gift of mana that only fire once, save the spellid into an array that consists of all available buff slots. - if(buff_tracker >= 0 && buffs[buff_tracker].numhits > 0) + if(buff_tracker >= 0 && buffs[buff_tracker].hit_number > 0) m_spellHitsLeft[buff_tracker] = focusspell_tracker; } @@ -5432,18 +5432,18 @@ int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_i bool LimitSpellSkill = false; bool SpellSkill_Found = false; for (int i = 0; i < EFFECT_COUNT; i++) { - switch (focus_spell.effectid[i]) { + switch (focus_spell.effect_id[i]) { case SE_Blank: break; case SE_LimitResist:{ - if(focus_spell.base[i]) { - if(spell.resisttype != focus_spell.base[i]) + if(focus_spell.base_value[i]) { + if(spell.resist_type != focus_spell.base_value[i]) return 0; } break; } case SE_LimitInstant: { - if(spell.buffduration) + if(spell.buff_duration) return 0; break; } @@ -5451,10 +5451,10 @@ int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_i if (IsNPC()) break; spell_level = spell.classes[(GetClass() % 17) - 1]; - lvldiff = (spell_level - focus_spell.base[i]); + lvldiff = (spell_level - focus_spell.base_value[i]); if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) { - if(focus_spell.base2[i] > 0) { - lvlModifier -= (focus_spell.base2[i] * lvldiff); + if(focus_spell.limit_value[i] > 0) { + lvlModifier -= (focus_spell.limit_value[i] * lvldiff); if(lvlModifier < 1) return 0; } @@ -5466,44 +5466,44 @@ int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_i case SE_LimitMinLevel: if (IsNPC()) break; - if (spell.classes[(GetClass() % 17) - 1] < focus_spell.base[i]) + if (spell.classes[(GetClass() % 17) - 1] < focus_spell.base_value[i]) return 0; break; case SE_LimitCastTimeMin: - if (spells[spell_id].cast_time < (uint32)focus_spell.base[i]) + if (spells[spell_id].cast_time < (uint32)focus_spell.base_value[i]) return 0; break; case SE_LimitSpell: - if(focus_spell.base[i] < 0) { - if (spell_id == (focus_spell.base[i] * -1)) + if(focus_spell.base_value[i] < 0) { + if (spell_id == (focus_spell.base_value[i] * -1)) return 0; } else { - if (spell_id != focus_spell.base[i]) + if (spell_id != focus_spell.base_value[i]) return 0; } break; case SE_LimitMinDur: - if (focus_spell.base[i] > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration)) + if (focus_spell.base_value[i] > CalcBuffDuration_formula(GetLevel(), spell.buff_duration_formula, spell.buff_duration)) return 0; break; case SE_LimitEffect: - if(focus_spell.base[i] < 0) { - if(IsEffectInSpell(spell_id,focus_spell.base[i])) + if(focus_spell.base_value[i] < 0) { + if(IsEffectInSpell(spell_id,focus_spell.base_value[i])) return 0; } else { - if(focus_spell.base[i] == SE_SummonPet) { + if(focus_spell.base_value[i] == SE_SummonPet) { if(!IsEffectInSpell(spell_id, SE_SummonPet) && !IsEffectInSpell(spell_id, SE_NecPet) && !IsEffectInSpell(spell_id, SE_SummonBSTPet)) { return 0; } - } else if(!IsEffectInSpell(spell_id,focus_spell.base[i])) + } else if(!IsEffectInSpell(spell_id,focus_spell.base_value[i])) return 0; } break; case SE_LimitSpellType: - switch(focus_spell.base[i]) { + switch(focus_spell.base_value[i]) { case 0: if (!IsDetrimentalSpell(spell_id)) return 0; @@ -5513,153 +5513,153 @@ int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_i return 0; break; default: - LogInfo("CalcFocusEffect: unknown limit spelltype [{}]", focus_spell.base[i]); + LogInfo("CalcFocusEffect: unknown limit spelltype [{}]", focus_spell.base_value[i]); } break; case SE_LimitManaMin: - if(spell.mana < focus_spell.base[i]) + if(spell.mana < focus_spell.base_value[i]) return 0; break; case SE_LimitTarget: - if((focus_spell.base[i] < 0) && -focus_spell.base[i] == spell.targettype) + if((focus_spell.base_value[i] < 0) && -focus_spell.base_value[i] == spell.target_type) return 0; - else if (focus_spell.base[i] > 0 && focus_spell.base[i] != spell.targettype) + else if (focus_spell.base_value[i] > 0 && focus_spell.base_value[i] != spell.target_type) return 0; break; case SE_LimitCombatSkills: - if(focus_spell.base[i] == 1 && !IsDiscipline(spell_id)) + if(focus_spell.base_value[i] == 1 && !IsDiscipline(spell_id)) return 0; - else if(focus_spell.base[i] == 0 && IsDiscipline(spell_id)) + else if(focus_spell.base_value[i] == 0 && IsDiscipline(spell_id)) return 0; break; case SE_LimitSpellGroup: - if(focus_spell.base[i] > 0 && focus_spell.base[i] != spell.spellgroup) + if(focus_spell.base_value[i] > 0 && focus_spell.base_value[i] != spell.spell_group) return 0; - else if(focus_spell.base[i] < 0 && focus_spell.base[i] == spell.spellgroup) + else if(focus_spell.base_value[i] < 0 && focus_spell.base_value[i] == spell.spell_group) return 0; break; case SE_LimitCastingSkill: LimitSpellSkill = true; - if(focus_spell.base[i] == spell.skill) + if(focus_spell.base_value[i] == spell.skill) SpellSkill_Found = true; break; case SE_LimitClass: - if (!PassLimitClass(focus_spell.base[i], GetClass())) + if (!PassLimitClass(focus_spell.base_value[i], GetClass())) return 0; break; case SE_ImprovedDamage: if (bottype == focusImprovedDamage) { if(best_focus) { - if (focus_spell.base2[i] != 0) - value = focus_spell.base2[i]; + if (focus_spell.limit_value[i] != 0) + value = focus_spell.limit_value[i]; else - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } - else if (focus_spell.base2[i] == 0 || focus_spell.base[i] == focus_spell.base2[i]) - value = focus_spell.base[i]; + else if (focus_spell.limit_value[i] == 0 || focus_spell.base_value[i] == focus_spell.limit_value[i]) + value = focus_spell.base_value[i]; else - value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]); + value = zone->random.Int(focus_spell.base_value[i], focus_spell.limit_value[i]); } break; case SE_ImprovedDamage2: if (bottype == focusImprovedDamage2) { if(best_focus) { - if (focus_spell.base2[i] != 0) - value = focus_spell.base2[i]; + if (focus_spell.limit_value[i] != 0) + value = focus_spell.limit_value[i]; else - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } - else if (focus_spell.base2[i] == 0 || focus_spell.base[i] == focus_spell.base2[i]) - value = focus_spell.base[i]; + else if (focus_spell.limit_value[i] == 0 || focus_spell.base_value[i] == focus_spell.limit_value[i]) + value = focus_spell.base_value[i]; else - value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]); + value = zone->random.Int(focus_spell.base_value[i], focus_spell.limit_value[i]); } break; case SE_ImprovedHeal: if (bottype == focusImprovedHeal) { if(best_focus) { - if (focus_spell.base2[i] != 0) - value = focus_spell.base2[i]; + if (focus_spell.limit_value[i] != 0) + value = focus_spell.limit_value[i]; else - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } - else if (focus_spell.base2[i] == 0 || focus_spell.base[i] == focus_spell.base2[i]) - value = focus_spell.base[i]; + else if (focus_spell.limit_value[i] == 0 || focus_spell.base_value[i] == focus_spell.limit_value[i]) + value = focus_spell.base_value[i]; else - value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]); + value = zone->random.Int(focus_spell.base_value[i], focus_spell.limit_value[i]); } break; case SE_ReduceManaCost: if (bottype == focusManaCost) { if(best_focus) { - if (focus_spell.base2[i] != 0) - value = focus_spell.base2[i]; + if (focus_spell.limit_value[i] != 0) + value = focus_spell.limit_value[i]; else - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } - else if (focus_spell.base2[i] == 0 || focus_spell.base[i] == focus_spell.base2[i]) - value = focus_spell.base[i]; + else if (focus_spell.limit_value[i] == 0 || focus_spell.base_value[i] == focus_spell.limit_value[i]) + value = focus_spell.base_value[i]; else - value = zone->random.Int(focus_spell.base[i], focus_spell.base2[i]); + value = zone->random.Int(focus_spell.base_value[i], focus_spell.limit_value[i]); } break; case SE_IncreaseSpellHaste: - if (bottype == focusSpellHaste && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusSpellHaste && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_IncreaseSpellDuration: - if (bottype == focusSpellDuration && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusSpellDuration && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_SpellDurationIncByTic: - if (bottype == focusSpellDurByTic && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusSpellDurByTic && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_SwarmPetDuration: - if (bottype == focusSwarmPetDuration && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusSwarmPetDuration && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_IncreaseRange: - if (bottype == focusRange && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusRange && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_ReduceReagentCost: - if (bottype == focusReagentCost && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusReagentCost && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_PetPowerIncrease: - if (bottype == focusPetPower && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusPetPower && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_SpellResistReduction: - if (bottype == focusResistRate && focus_spell.base[i] > value) - value = focus_spell.base[i]; + if (bottype == focusResistRate && focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; break; case SE_SpellHateMod: if (bottype == focusSpellHateMod) { if(value != 0) { if(value > 0) { - if(focus_spell.base[i] > value) - value = focus_spell.base[i]; + if(focus_spell.base_value[i] > value) + value = focus_spell.base_value[i]; } else { - if(focus_spell.base[i] < value) - value = focus_spell.base[i]; + if(focus_spell.base_value[i] < value) + value = focus_spell.base_value[i]; } } else - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_ReduceReuseTimer: { if(bottype == focusReduceRecastTime) - value = (focus_spell.base[i] / 1000); + value = (focus_spell.base_value[i] / 1000); break; } case SE_TriggerOnCast: { if(bottype == focusTriggerOnCast) { - if(zone->random.Int(0, 100) <= focus_spell.base[i]) - value = focus_spell.base2[i]; + if(zone->random.Int(0, 100) <= focus_spell.base_value[i]) + value = focus_spell.limit_value[i]; else value = 0; } @@ -5667,24 +5667,24 @@ int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_i } case SE_FcSpellVulnerability: { if(bottype == focusSpellVulnerability) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_BlockNextSpellFocus: { if(bottype == focusBlockNextSpell) { - if(zone->random.Int(1, 100) <= focus_spell.base[i]) + if(zone->random.Int(1, 100) <= focus_spell.base_value[i]) value = 1; } break; } case SE_FcTwincast: { if(bottype == focusTwincast) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_SympatheticProc: { if(bottype == focusSympatheticProc) { - float ProcChance = GetSympatheticProcChances(spell_id, focus_spell.base[i]); + float ProcChance = GetSympatheticProcChances(spell_id, focus_spell.base_value[i]); if(zone->random.Real(0, 1) <= ProcChance) value = focus_id; else @@ -5694,59 +5694,59 @@ int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_i } case SE_FcDamageAmt: { if(bottype == focusFcDamageAmt) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_FcDamageAmt2: { if(bottype == focusFcDamageAmt2) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_FcDamageAmtCrit: { if(bottype == focusFcDamageAmtCrit) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_FcHealAmtIncoming: if(bottype == focusFcHealAmtIncoming) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; case SE_FcHealPctCritIncoming: if (bottype == focusFcHealPctCritIncoming) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; case SE_FcHealAmtCrit: if(bottype == focusFcHealAmtCrit) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; case SE_FcHealAmt: if(bottype == focusFcHealAmt) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; case SE_FcHealPctIncoming: if(bottype == focusFcHealPctIncoming) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; case SE_FcBaseEffects: { if (bottype == focusFcBaseEffects) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_FcDamagePctCrit: { if(bottype == focusFcDamagePctCrit) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } case SE_FcIncreaseNumHits: { if(bottype == focusIncreaseNumHits) - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; break; } default: - LogSpells("CalcFocusEffect: unknown effectid [{}]", focus_spell.effectid[i]); + LogSpells("CalcFocusEffect: unknown effectid [{}]", focus_spell.effect_id[i]); break; } } @@ -6673,7 +6673,7 @@ void Bot::SetAttackTimer() { } int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { - if (spells[spell_id].targettype == ST_Self) + if (spells[spell_id].target_type == ST_Self) return value; bool Critical = false; @@ -6757,7 +6757,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { value_BaseEffect = (value + (value*GetBotFocusEffect(focusFcBaseEffects, spell_id) / 100)); value = value_BaseEffect; value += int(value_BaseEffect*GetBotFocusEffect(focusImprovedHeal, spell_id) / 100); - if(spells[spell_id].buffduration < 1) { + if(spells[spell_id].buff_duration < 1) { chance += (itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance); chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id); if (spellbonuses.CriticalHealDecay) @@ -6798,7 +6798,7 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) { auto min_cap = casttime / 2; uint8 botlevel = GetLevel(); uint8 botclass = GetClass(); - if (botlevel >= 51 && casttime >= 3000 && !spells[spell_id].goodEffect && + if (botlevel >= 51 && casttime >= 3000 && !spells[spell_id].good_effect && (botclass == SHADOWKNIGHT || botclass == RANGER || botclass == PALADIN || botclass == BEASTLORD)) { int level_mod = std::min(15, botlevel - 50); cast_reducer += level_mod * 3; @@ -6994,7 +6994,7 @@ int32 Bot::GetActSpellDuration(uint16 spell_id, int32 duration) { float Bot::GetAOERange(uint16 spell_id) { float range; - range = spells[spell_id].aoerange; + range = spells[spell_id].aoe_range; if(range == 0) range = spells[spell_id].range; @@ -7099,7 +7099,7 @@ bool Bot::SpellOnTarget(uint16 spell_id, Mob* spelltar) { return false; if(spelltar) { - if(spelltar->IsBot() && (spells[spell_id].targettype == ST_GroupTeleport)) { + if(spelltar->IsBot() && (spells[spell_id].target_type == ST_GroupTeleport)) { switch(spell_id) { // Paladin case 3577: // Wave of Life @@ -7175,7 +7175,7 @@ bool Bot::SpellOnTarget(uint16 spell_id, Mob* spelltar) { if(spelltar->IsPet()) { for(int i= 0; i < EFFECT_COUNT; ++i) { - if(spells[spell_id].effectid[i] == SE_Illusion) + if(spells[spell_id].effect_id[i] == SE_Illusion) return false; } } @@ -7193,13 +7193,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { Result = Mob::IsImmuneToSpell(spell_id, caster); if(!Result) { if(caster->IsBot()) { - if(spells[spell_id].targettype == ST_Undead) { + if(spells[spell_id].target_type == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { LogSpells("Bot's target is not an undead"); return true; } } - if(spells[spell_id].targettype == ST_Summoned) { + if(spells[spell_id].target_type == ST_Summoned) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Summoned) && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3)) { LogSpells("Bot's target is not a summoned creature"); return true; @@ -7216,7 +7216,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { bool Bot::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot) { bool Result = false; - SpellTargetType targetType = spells[spell_id].targettype; + SpellTargetType targetType = spells[spell_id].target_type; if(targetType == ST_GroupClientAndPet) { if((spell_id == 1768 && zone->GetZoneID() == 202) || (!IsDetrimentalSpell(spell_id))) { CastAction = SingleTarget; @@ -7351,13 +7351,13 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe int spelltype = BotGetSpellType(i); bool spellequal = (j == thespell); bool spelltypeequal = ((spelltype == 2) || (spelltype == 16) || (spelltype == 32)); - bool spelltypetargetequal = ((spelltype == 8) && (spells[thespell].targettype == ST_Self)); + bool spelltypetargetequal = ((spelltype == 8) && (spells[thespell].target_type == ST_Self)); bool spelltypeclassequal = ((spelltype == 1024) && (GetClass() == SHAMAN)); bool slotequal = (slot == EQ::spells::CastingSlot::Item); if(spellequal || slotequal) { if((spelltypeequal || spelltypetargetequal) || spelltypeclassequal || slotequal) { - if(((spells[thespell].effectid[0] == 0) && (spells[thespell].base[0] < 0)) && - (spellTarget->GetHP() < ((spells[thespell].base[0] * (-1)) + 100))) { + if(((spells[thespell].effect_id[0] == 0) && (spells[thespell].base_value[0] < 0)) && + (spellTarget->GetHP() < ((spells[thespell].base_value[0] * (-1)) + 100))) { LogSpells("Bot::DoFinishedSpellSingleTarget - GroupBuffing failure"); return false; } @@ -8040,7 +8040,7 @@ void Bot::DoEnduranceUpkeep() { uint32 buff_count = GetMaxTotalSlots(); for (buffs_i = 0; buffs_i < buff_count; buffs_i++) { if (buffs[buffs_i].spellid != SPELL_UNKNOWN) { - int upkeep = spells[buffs[buffs_i].spellid].EndurUpkeep; + int upkeep = spells[buffs[buffs_i].spellid].endurance_upkeep; if(upkeep > 0) { if(cost_redux > 0) { if(upkeep <= cost_redux) @@ -9523,17 +9523,17 @@ bool Bot::UseDiscipline(uint32 spell_id, uint32 target) { return false; } - if(GetEndurance() > spell.EndurCost) - SetEndurance(GetEndurance() - spell.EndurCost); + if(GetEndurance() > spell.endurance_cost) + SetEndurance(GetEndurance() - spell.endurance_cost); else return false; if(spell.recast_time > 0) { - if(CheckDisciplineRecastTimers(this, spells[spell_id].EndurTimerIndex)) { - if(spells[spell_id].EndurTimerIndex > 0 && spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS) - SetDisciplineRecastTimer(spells[spell_id].EndurTimerIndex, spell.recast_time); + if(CheckDisciplineRecastTimers(this, spells[spell_id].timer_id)) { + if(spells[spell_id].timer_id > 0 && spells[spell_id].timer_id < MAX_DISCIPLINE_TIMERS) + SetDisciplineRecastTimer(spells[spell_id].timer_id, spell.recast_time); } else { - uint32 remain = (GetDisciplineRemainingTime(this, spells[spell_id].EndurTimerIndex) / 1000); + uint32 remain = (GetDisciplineRemainingTime(this, spells[spell_id].timer_id) / 1000); GetOwner()->Message(Chat::White, "%s can use this discipline in %d minutes %d seconds.", GetCleanName(), (remain / 60), (remain % 60)); return false; } diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 1a922379e..bd826078b 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -130,11 +130,11 @@ public: for (int spell_id = 2; spell_id < SPDAT_RECORDS; ++spell_id) { if (spells[spell_id].player_1[0] == '\0') continue; - if (spells[spell_id].targettype != ST_Target && spells[spell_id].CastRestriction != 0) // watch + if (spells[spell_id].target_type != ST_Target && spells[spell_id].cast_restriction != 0) // watch continue; auto target_type = BCEnum::TT_None; - switch (spells[spell_id].targettype) { + switch (spells[spell_id].target_type) { case ST_GroupTeleport: target_type = BCEnum::TT_GroupV1; break; @@ -147,7 +147,7 @@ public: //target_type = BCEnum::TT_AEBard; break; case ST_Target: - switch (spells[spell_id].CastRestriction) { + switch (spells[spell_id].cast_restriction) { case 0: target_type = BCEnum::TT_Single; break; @@ -213,15 +213,15 @@ public: STBaseEntry* entry_prototype = nullptr; while (true) { - switch (spells[spell_id].effectid[EFFECTIDTOINDEX(1)]) { + switch (spells[spell_id].effect_id[EFFECTIDTOINDEX(1)]) { case SE_BindAffinity: entry_prototype = new STBaseEntry(BCEnum::SpT_BindAffinity); break; case SE_Charm: - if (spells[spell_id].SpellAffectIndex != 12) + if (spells[spell_id].spell_affect_index != 12) break; entry_prototype = new STCharmEntry(); - if (spells[spell_id].ResistDiff <= -1000) + if (spells[spell_id].resist_difficulty <= -1000) entry_prototype->SafeCastToCharm()->dire = true; break; case SE_Teleport: @@ -248,11 +248,11 @@ public: } break; case SE_ModelSize: - if (spells[spell_id].base[EFFECTIDTOINDEX(1)] > 100) { + if (spells[spell_id].base_value[EFFECTIDTOINDEX(1)] > 100) { entry_prototype = new STSizeEntry; entry_prototype->SafeCastToSize()->size_type = BCEnum::SzT_Enlarge; } - else if (spells[spell_id].base[EFFECTIDTOINDEX(1)] > 0 && spells[spell_id].base[EFFECTIDTOINDEX(1)] < 100) { + else if (spells[spell_id].base_value[EFFECTIDTOINDEX(1)] > 0 && spells[spell_id].base_value[EFFECTIDTOINDEX(1)] < 100) { entry_prototype = new STSizeEntry; entry_prototype->SafeCastToSize()->size_type = BCEnum::SzT_Reduce; } @@ -261,42 +261,42 @@ public: entry_prototype = new STBaseEntry(BCEnum::SpT_Identify); break; case SE_Invisibility: - if (spells[spell_id].SpellAffectIndex != 9) + if (spells[spell_id].spell_affect_index != 9) break; entry_prototype = new STInvisibilityEntry; entry_prototype->SafeCastToInvisibility()->invis_type = BCEnum::IT_Living; break; case SE_SeeInvis: - if (spells[spell_id].SpellAffectIndex != 5) + if (spells[spell_id].spell_affect_index != 5) break; entry_prototype = new STInvisibilityEntry; entry_prototype->SafeCastToInvisibility()->invis_type = BCEnum::IT_See; break; case SE_InvisVsUndead: - if (spells[spell_id].SpellAffectIndex != 9) + if (spells[spell_id].spell_affect_index != 9) break; entry_prototype = new STInvisibilityEntry; entry_prototype->SafeCastToInvisibility()->invis_type = BCEnum::IT_Undead; break; case SE_InvisVsAnimals: - if (spells[spell_id].SpellAffectIndex != 9) + if (spells[spell_id].spell_affect_index != 9) break; entry_prototype = new STInvisibilityEntry; entry_prototype->SafeCastToInvisibility()->invis_type = BCEnum::IT_Animal; break; case SE_Mez: - if (spells[spell_id].SpellAffectIndex != 12) + if (spells[spell_id].spell_affect_index != 12) break; entry_prototype = new STBaseEntry(BCEnum::SpT_Mesmerize); break; case SE_Revive: - if (spells[spell_id].SpellAffectIndex != 1) + if (spells[spell_id].spell_affect_index != 1) break; entry_prototype = new STResurrectEntry(); entry_prototype->SafeCastToResurrect()->aoe = BCSpells::IsCasterCentered(target_type); break; case SE_Rune: - if (spells[spell_id].SpellAffectIndex != 2) + if (spells[spell_id].spell_affect_index != 2) break; entry_prototype = new STBaseEntry(BCEnum::SpT_Rune); break; @@ -312,7 +312,7 @@ public: if (entry_prototype) break; - switch (spells[spell_id].effectid[EFFECTIDTOINDEX(2)]) { + switch (spells[spell_id].effect_id[EFFECTIDTOINDEX(2)]) { case SE_Succor: entry_prototype = new STEscapeEntry; std::string is_lesser = spells[spell_id].name; @@ -323,7 +323,7 @@ public: if (entry_prototype) break; - switch (spells[spell_id].effectid[EFFECTIDTOINDEX(3)]) { + switch (spells[spell_id].effect_id[EFFECTIDTOINDEX(3)]) { case SE_Lull: entry_prototype = new STBaseEntry(BCEnum::SpT_Lull); break; @@ -336,8 +336,8 @@ public: if (entry_prototype) break; - while (spells[spell_id].typedescnum == 27) { - if (!spells[spell_id].goodEffect) + while (spells[spell_id].type_description_id == 27) { + if (!spells[spell_id].good_effect) break; if (spells[spell_id].skill != EQ::skills::SkillOffense && spells[spell_id].skill != EQ::skills::SkillDefense) break; @@ -353,38 +353,38 @@ public: if (entry_prototype) break; - switch (spells[spell_id].SpellAffectIndex) { + switch (spells[spell_id].spell_affect_index) { case 1: { bool valid_spell = false; entry_prototype = new STCureEntry; for (int i = EffectIDFirst; i <= EffectIDLast; ++i) { int effect_index = EFFECTIDTOINDEX(i); - if (spells[spell_id].effectid[effect_index] != SE_Blind && spells[spell_id].base[effect_index] >= 0) + if (spells[spell_id].effect_id[effect_index] != SE_Blind && spells[spell_id].base_value[effect_index] >= 0) continue; - else if (spells[spell_id].effectid[effect_index] == SE_Blind && !spells[spell_id].goodEffect) + else if (spells[spell_id].effect_id[effect_index] == SE_Blind && !spells[spell_id].good_effect) continue; - switch (spells[spell_id].effectid[effect_index]) { + switch (spells[spell_id].effect_id[effect_index]) { case SE_Blind: - entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Blindness)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Blindness)] += spells[spell_id].base_value[effect_index]; break; case SE_DiseaseCounter: - entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Disease)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Disease)] += spells[spell_id].base_value[effect_index]; break; case SE_PoisonCounter: - entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Poison)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Poison)] += spells[spell_id].base_value[effect_index]; break; case SE_CurseCounter: - entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Curse)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Curse)] += spells[spell_id].base_value[effect_index]; break; case SE_CorruptionCounter: - entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Corruption)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToCure()->cure_value[AILMENTIDTOINDEX(BCEnum::AT_Corruption)] += spells[spell_id].base_value[effect_index]; break; default: continue; } - entry_prototype->SafeCastToCure()->cure_total += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToCure()->cure_total += spells[spell_id].base_value[effect_index]; valid_spell = true; } if (!valid_spell) { @@ -400,32 +400,32 @@ public: for (int i = EffectIDFirst; i <= EffectIDLast; ++i) { int effect_index = EFFECTIDTOINDEX(i); - if (spells[spell_id].base[effect_index] <= 0) + if (spells[spell_id].base_value[effect_index] <= 0) continue; - switch (spells[spell_id].effectid[effect_index]) { + switch (spells[spell_id].effect_id[effect_index]) { case SE_ResistFire: - entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Fire)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Fire)] += spells[spell_id].base_value[effect_index]; break; case SE_ResistCold: - entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Cold)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Cold)] += spells[spell_id].base_value[effect_index]; break; case SE_ResistPoison: - entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Poison)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Poison)] += spells[spell_id].base_value[effect_index]; break; case SE_ResistDisease: - entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Disease)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Disease)] += spells[spell_id].base_value[effect_index]; break; case SE_ResistMagic: - entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Magic)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Magic)] += spells[spell_id].base_value[effect_index]; break; case SE_ResistCorruption: - entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Corruption)] += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_value[RESISTANCEIDTOINDEX(BCEnum::RT_Corruption)] += spells[spell_id].base_value[effect_index]; break; default: continue; } - entry_prototype->SafeCastToResistance()->resist_total += spells[spell_id].base[effect_index]; + entry_prototype->SafeCastToResistance()->resist_total += spells[spell_id].base_value[effect_index]; valid_spell = true; } if (!valid_spell) { @@ -437,7 +437,7 @@ public: } case 7: case 10: - if (spells[spell_id].effectdescnum != 65) + if (spells[spell_id].effect_description_id != 65) break; if (IsEffectInSpell(spell_id, SE_NegateIfCombat)) break; @@ -622,18 +622,18 @@ private: if (RuleI(Bots, CommandSpellRank) == 1) { spells_list->sort([](STBaseEntry* l, STBaseEntry* r) { - if (spells[l->spell_id].spellgroup < spells[r->spell_id].spellgroup) + if (spells[l->spell_id].spell_group < spells[r->spell_id].spell_group) return true; - if (spells[l->spell_id].spellgroup == spells[r->spell_id].spellgroup && l->caster_class < r->caster_class) + if (spells[l->spell_id].spell_group == spells[r->spell_id].spell_group && l->caster_class < r->caster_class) return true; - if (spells[l->spell_id].spellgroup == spells[r->spell_id].spellgroup && l->caster_class == r->caster_class && spells[l->spell_id].rank < spells[r->spell_id].rank) + if (spells[l->spell_id].spell_group == spells[r->spell_id].spell_group && l->caster_class == r->caster_class && spells[l->spell_id].rank < spells[r->spell_id].rank) return true; return false; }); spells_list->unique([removed_spells_list](STBaseEntry* l, STBaseEntry* r) { std::string r_name = spells[r->spell_id].name; - if (spells[l->spell_id].spellgroup == spells[r->spell_id].spellgroup && l->caster_class == r->caster_class && spells[l->spell_id].rank < spells[r->spell_id].rank) { + if (spells[l->spell_id].spell_group == spells[r->spell_id].spell_group && l->caster_class == r->caster_class && spells[l->spell_id].rank < spells[r->spell_id].rank) { removed_spells_list->push_back(r); return true; } @@ -673,18 +673,18 @@ private: // needs rework if (RuleI(Bots, CommandSpellRank) == 2 || RuleI(Bots, CommandSpellRank) == 3) { spells_list->sort([](STBaseEntry* l, STBaseEntry* r) { - if (spells[l->spell_id].spellgroup < spells[r->spell_id].spellgroup) + if (spells[l->spell_id].spell_group < spells[r->spell_id].spell_group) return true; - if (spells[l->spell_id].spellgroup == spells[r->spell_id].spellgroup && l->caster_class < r->caster_class) + if (spells[l->spell_id].spell_group == spells[r->spell_id].spell_group && l->caster_class < r->caster_class) return true; - if (spells[l->spell_id].spellgroup == spells[r->spell_id].spellgroup && l->caster_class == r->caster_class && spells[l->spell_id].rank > spells[r->spell_id].rank) + if (spells[l->spell_id].spell_group == spells[r->spell_id].spell_group && l->caster_class == r->caster_class && spells[l->spell_id].rank > spells[r->spell_id].rank) return true; return false; }); spells_list->unique([removed_spells_list](STBaseEntry* l, STBaseEntry* r) { std::string l_name = spells[l->spell_id].name; - if (spells[l->spell_id].spellgroup == spells[r->spell_id].spellgroup && l->caster_class == r->caster_class && spells[l->spell_id].rank > spells[r->spell_id].rank) { + if (spells[l->spell_id].spell_group == spells[r->spell_id].spell_group && l->caster_class == r->caster_class && spells[l->spell_id].rank > spells[r->spell_id].rank) { removed_spells_list->push_back(r); return true; } @@ -786,15 +786,15 @@ private: continue; case BCEnum::SpT_Charm: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { - if (LT_SPELLS(l, r, ResistDiff)) + if (LT_SPELLS(l, r, resist_difficulty)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && LT_STBASE(l, r, target_type)) + if (EQ_SPELLS(l, r, resist_difficulty) && LT_STBASE(l, r, target_type)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max, 1)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max_value, 1)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 1) && LT_STBASE(l, r, spell_level)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 1) && LT_STBASE(l, r, spell_level)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -883,11 +883,11 @@ private: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { if (LT_STBASE(l, r, target_type)) return true; - if (EQ_STBASE(l, r, target_type) && LT_SPELLS(l, r, zonetype)) + if (EQ_STBASE(l, r, target_type) && LT_SPELLS(l, r, zone_type)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS(l, r, zonetype) && GT_STBASE(l, r, spell_level)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS(l, r, zone_type) && GT_STBASE(l, r, spell_level)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS(l, r, zonetype) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS(l, r, zone_type) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -895,15 +895,15 @@ private: continue; case BCEnum::SpT_Lull: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { - if (LT_SPELLS(l, r, ResistDiff)) + if (LT_SPELLS(l, r, resist_difficulty)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && LT_STBASE(l, r, target_type)) + if (EQ_SPELLS(l, r, resist_difficulty) && LT_STBASE(l, r, target_type)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max, 3)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max_value, 3)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 3) && LT_STBASE(l, r, spell_level)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 3) && LT_STBASE(l, r, spell_level)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 3) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 3) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -911,15 +911,15 @@ private: continue; case BCEnum::SpT_Mesmerize: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { - if (GT_SPELLS(l, r, ResistDiff)) + if (GT_SPELLS(l, r, resist_difficulty)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && LT_STBASE(l, r, target_type)) + if (EQ_SPELLS(l, r, resist_difficulty) && LT_STBASE(l, r, target_type)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max, 1)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max_value, 1)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 1) && GT_STBASE(l, r, spell_level)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 1) && GT_STBASE(l, r, spell_level)) return true; - if (EQ_SPELLS(l, r, ResistDiff) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_SPELLS(l, r, resist_difficulty) && EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -929,11 +929,11 @@ private: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { if (LT_STBASE(l, r, target_type)) return true; - if (EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, base, 2)) + if (EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, base_value, 2)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base, 2) && LT_STBASE(l, r, spell_level)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base_value, 2) && LT_STBASE(l, r, spell_level)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base, 2) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base_value, 2) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -951,13 +951,13 @@ private: continue; case BCEnum::SpT_Resurrect: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { - if (GT_SPELLS_EFFECT_ID(l, r, base, 1)) + if (GT_SPELLS_EFFECT_ID(l, r, base_value, 1)) return true; - if (EQ_SPELLS_EFFECT_ID(l, r, base, 1) && LT_STBASE(l, r, target_type)) + if (EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && LT_STBASE(l, r, target_type)) return true; - if (EQ_SPELLS_EFFECT_ID(l, r, base, 1) && EQ_STBASE(l, r, target_type) && LT_STBASE(l, r, spell_level)) + if (EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && EQ_STBASE(l, r, target_type) && LT_STBASE(l, r, spell_level)) return true; - if (EQ_SPELLS_EFFECT_ID(l, r, base, 1) && EQ_STBASE(l, r, target_type) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && EQ_STBASE(l, r, target_type) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -967,11 +967,11 @@ private: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { if (LT_STBASE(l, r, target_type)) return true; - if (EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max, 1)) + if (EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, max_value, 1)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 1) && LT_STBASE(l, r, spell_level)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 1) && LT_STBASE(l, r, spell_level)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, max_value, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; return false; @@ -999,19 +999,19 @@ private: if (l_size_type < r_size_type) return true; if (l_size_type == BCEnum::SzT_Enlarge && r_size_type == BCEnum::SzT_Enlarge) { - if (EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, base, 1)) + if (EQ_STBASE(l, r, target_type) && GT_SPELLS_EFFECT_ID(l, r, base_value, 1)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base, 1) && GT_STBASE(l, r, spell_level)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && GT_STBASE(l, r, spell_level)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; } if (l_size_type == BCEnum::SzT_Reduce && r_size_type == BCEnum::SzT_Reduce) { - if (EQ_STBASE(l, r, target_type) && LT_SPELLS_EFFECT_ID(l, r, base, 1)) + if (EQ_STBASE(l, r, target_type) && LT_SPELLS_EFFECT_ID(l, r, base_value, 1)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base, 1) && GT_STBASE(l, r, spell_level)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && GT_STBASE(l, r, spell_level)) return true; - if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) + if (EQ_STBASE(l, r, target_type) && EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && EQ_STBASE(l, r, spell_level) && LT_STBASE(l, r, caster_class)) return true; } @@ -1028,11 +1028,11 @@ private: continue; case BCEnum::SpT_SummonCorpse: spell_list->sort([](const STBaseEntry* l, const STBaseEntry* r) { - if (GT_SPELLS_EFFECT_ID(l, r, base, 1)) + if (GT_SPELLS_EFFECT_ID(l, r, base_value, 1)) return true; - if (EQ_SPELLS_EFFECT_ID(l, r, base, 1) && LT_STBASE(l, r, spell_level)) + if (EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && LT_STBASE(l, r, spell_level)) return true; - if (EQ_SPELLS_EFFECT_ID(l, r, base, 1) && EQ_STBASE(l, r, spell_level) && EQ_STBASE(l, r, caster_class)) + if (EQ_SPELLS_EFFECT_ID(l, r, base_value, 1) && EQ_STBASE(l, r, spell_level) && EQ_STBASE(l, r, caster_class)) return true; return false; @@ -1167,18 +1167,18 @@ private: spell_dump << StringFormat(" /mn:%05u/RD:%06i/zt:%02i/d#:%06i/td#:%05i/ed#:%05i/SAI:%03u", spells[spell_id].mana, - spells[spell_id].ResistDiff, - spells[spell_id].zonetype, - spells[spell_id].descnum, - spells[spell_id].typedescnum, - spells[spell_id].effectdescnum, - spells[spell_id].SpellAffectIndex + spells[spell_id].resist_difficulty, + spells[spell_id].zone_type, + spells[spell_id].description_id, + spells[spell_id].type_description_id, + spells[spell_id].effect_description_id, + spells[spell_id].spell_affect_index ); for (int i = EffectIDFirst; i <= 3/*EffectIDLast*/; ++i) { int effect_index = EFFECTIDTOINDEX(i); spell_dump << StringFormat(" /e%02i:%04i/b%02i:%06i/m%02i:%06i", - i, spells[spell_id].effectid[effect_index], i, spells[spell_id].base[effect_index], i, spells[spell_id].max[effect_index]); + i, spells[spell_id].effect_id[effect_index], i, spells[spell_id].base_value[effect_index], i, spells[spell_id].max_value[effect_index]); } switch (list_entry->BCST()) { @@ -2935,7 +2935,7 @@ void bot_command_charm(Client *c, const Seperator *sep) return; } - if (spells[local_entry->spell_id].max[EFFECTIDTOINDEX(1)] < target_mob->GetLevel()) + if (spells[local_entry->spell_id].max_value[EFFECTIDTOINDEX(1)] < target_mob->GetLevel()) continue; my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob, true); @@ -3790,7 +3790,7 @@ void bot_command_mesmerize(Client *c, const Seperator *sep) if (!target_mob) continue; - if (spells[local_entry->spell_id].max[EFFECTIDTOINDEX(1)] < target_mob->GetLevel()) + if (spells[local_entry->spell_id].max_value[EFFECTIDTOINDEX(1)] < target_mob->GetLevel()) continue; my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob); @@ -4705,7 +4705,7 @@ void bot_command_summon_corpse(Client *c, const Seperator *sep) if (!target_mob) continue; - if (spells[local_entry->spell_id].base[EFFECTIDTOINDEX(1)] < target_mob->GetLevel()) + if (spells[local_entry->spell_id].base_value[EFFECTIDTOINDEX(1)] < target_mob->GetLevel()) continue; my_bot = ActionableBots::Select_ByMinLevelAndClass(c, local_entry->target_type, sbl, local_entry->spell_level, local_entry->caster_class, target_mob); @@ -9029,7 +9029,7 @@ bool helper_spell_check_fail(STBaseEntry* local_entry) { if (!local_entry) return true; - if (spells[local_entry->spell_id].zonetype && zone->GetZoneType() && !(spells[local_entry->spell_id].zonetype & zone->GetZoneType())) + if (spells[local_entry->spell_id].zone_type && zone->GetZoneType() && !(spells[local_entry->spell_id].zone_type & zone->GetZoneType())) return true; return false; diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index b9d0bd6cd..4b8d602a6 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -766,7 +766,7 @@ bool BotDatabase::LoadBuffs(Bot* bot_inst) else if (CalculateCorruptionCounters(bot_buffs[buff_count].spellid) > 0) bot_buffs[buff_count].counters = atoi(row[7]); - bot_buffs[buff_count].numhits = atoi(row[8]); + bot_buffs[buff_count].hit_number = atoi(row[8]); bot_buffs[buff_count].melee_rune = atoi(row[9]); bot_buffs[buff_count].magic_rune = atoi(row[10]); bot_buffs[buff_count].dot_rune = atoi(row[11]); @@ -843,13 +843,13 @@ bool BotDatabase::SaveBuffs(Bot* bot_inst) bot_inst->GetBotID(), bot_buffs[buff_index].spellid, bot_buffs[buff_index].casterlevel, - spells[bot_buffs[buff_index].spellid].buffdurationformula, + spells[bot_buffs[buff_index].spellid].buff_duration_formula, bot_buffs[buff_index].ticsremaining, ((CalculatePoisonCounters(bot_buffs[buff_index].spellid) > 0) ? (bot_buffs[buff_index].counters) : (0)), ((CalculateDiseaseCounters(bot_buffs[buff_index].spellid) > 0) ? (bot_buffs[buff_index].counters) : (0)), ((CalculateCurseCounters(bot_buffs[buff_index].spellid) > 0) ? (bot_buffs[buff_index].counters) : (0)), ((CalculateCorruptionCounters(bot_buffs[buff_index].spellid) > 0) ? (bot_buffs[buff_index].counters) : (0)), - bot_buffs[buff_index].numhits, + bot_buffs[buff_index].hit_number, bot_buffs[buff_index].melee_rune, bot_buffs[buff_index].magic_rune, bot_buffs[buff_index].dot_rune, diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index e03c996fd..22eb103c5 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -232,7 +232,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { break; // Can we cast this spell on this target? - if(!(spells[botSpell.SpellId].targettype==ST_GroupTeleport || spells[botSpell.SpellId].targettype == ST_Target || tar == this) + if(!(spells[botSpell.SpellId].target_type==ST_GroupTeleport || spells[botSpell.SpellId].target_type == ST_Target || tar == this) && !(tar->CanBuffStack(botSpell.SpellId, botLevel, true) >= 0)) break; @@ -331,14 +331,14 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { continue; // can not cast buffs for your own pet only on another pet that isn't yours - if((spells[selectedBotSpell.SpellId].targettype == ST_Pet) && (tar != this->GetPet())) + if((spells[selectedBotSpell.SpellId].target_type == ST_Pet) && (tar != this->GetPet())) continue; // Validate target - if(!((spells[selectedBotSpell.SpellId].targettype == ST_Target || spells[selectedBotSpell.SpellId].targettype == ST_Pet || tar == this || - spells[selectedBotSpell.SpellId].targettype == ST_Group || spells[selectedBotSpell.SpellId].targettype == ST_GroupTeleport || - (botClass == BARD && spells[selectedBotSpell.SpellId].targettype == ST_AEBard)) + if(!((spells[selectedBotSpell.SpellId].target_type == ST_Target || spells[selectedBotSpell.SpellId].target_type == ST_Pet || tar == this || + spells[selectedBotSpell.SpellId].target_type == ST_Group || spells[selectedBotSpell.SpellId].target_type == ST_GroupTeleport || + (botClass == BARD && spells[selectedBotSpell.SpellId].target_type == ST_AEBard)) && !tar->IsImmuneToSpell(selectedBotSpell.SpellId, this) && (tar->CanBuffStack(selectedBotSpell.SpellId, botLevel, true) >= 0))) { continue; @@ -606,7 +606,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { if(CheckSpellRecastTimers(this, itr->SpellIndex)) { - if(!(!tar->IsImmuneToSpell(selectedBotSpell.SpellId, this) && (spells[selectedBotSpell.SpellId].buffduration < 1 || tar->CanBuffStack(selectedBotSpell.SpellId, botLevel, true) >= 0))) + if(!(!tar->IsImmuneToSpell(selectedBotSpell.SpellId, this) && (spells[selectedBotSpell.SpellId].buff_duration < 1 || tar->CanBuffStack(selectedBotSpell.SpellId, botLevel, true) >= 0))) continue; //short duration buffs or other buffs only to be cast during combat. @@ -644,14 +644,14 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { continue; // can not cast buffs for your own pet only on another pet that isn't yours - if((spells[selectedBotSpell.SpellId].targettype == ST_Pet) && (tar != this->GetPet())) + if((spells[selectedBotSpell.SpellId].target_type == ST_Pet) && (tar != this->GetPet())) continue; // Validate target - if(!((spells[selectedBotSpell.SpellId].targettype == ST_Target || spells[selectedBotSpell.SpellId].targettype == ST_Pet || tar == this || - spells[selectedBotSpell.SpellId].targettype == ST_Group || spells[selectedBotSpell.SpellId].targettype == ST_GroupTeleport || - (botClass == BARD && spells[selectedBotSpell.SpellId].targettype == ST_AEBard)) + if(!((spells[selectedBotSpell.SpellId].target_type == ST_Target || spells[selectedBotSpell.SpellId].target_type == ST_Pet || tar == this || + spells[selectedBotSpell.SpellId].target_type == ST_Group || spells[selectedBotSpell.SpellId].target_type == ST_GroupTeleport || + (botClass == BARD && spells[selectedBotSpell.SpellId].target_type == ST_AEBard)) && !tar->IsImmuneToSpell(selectedBotSpell.SpellId, this) && (tar->CanBuffStack(selectedBotSpell.SpellId, botLevel, true) >= 0))) { continue; @@ -846,9 +846,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { continue; if (!CheckSpellRecastTimers(this, iter.SpellIndex)) continue; - if (spells[iter.SpellId].zonetype != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zonetype != zone->GetZoneType()) // is this bit or index? + if (spells[iter.SpellId].zone_type != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zone_type != zone->GetZoneType()) // is this bit or index? continue; - if (spells[iter.SpellId].targettype != ST_Target) + if (spells[iter.SpellId].target_type != ST_Target) continue; if (tar->CanBuffStack(iter.SpellId, botLevel, true) < 0) continue; @@ -868,7 +868,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { case BEASTLORD: { botSpell = GetBestBotSpellForDiseaseBasedSlow(this); - if(botSpell.SpellId == 0 || ((tar->GetMR() - 50) < (tar->GetDR() + spells[botSpell.SpellId].ResistDiff))) + if(botSpell.SpellId == 0 || ((tar->GetMR() - 50) < (tar->GetDR() + spells[botSpell.SpellId].resist_difficulty))) botSpell = GetBestBotSpellForMagicBasedSlow(this); break; } @@ -962,9 +962,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { continue; if (!CheckSpellRecastTimers(this, iter.SpellIndex)) continue; - if (spells[iter.SpellId].zonetype != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zonetype != zone->GetZoneType()) // is this bit or index? + if (spells[iter.SpellId].zone_type != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zone_type != zone->GetZoneType()) // is this bit or index? continue; - if (spells[iter.SpellId].targettype != ST_Target) + if (spells[iter.SpellId].target_type != ST_Target) continue; if (tar->CanBuffStack(iter.SpellId, botLevel, true) < 0) continue; @@ -989,9 +989,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { continue; if (!CheckSpellRecastTimers(this, iter.SpellIndex)) continue; - if (spells[iter.SpellId].zonetype != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zonetype != zone->GetZoneType()) // is this bit or index? + if (spells[iter.SpellId].zone_type != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zone_type != zone->GetZoneType()) // is this bit or index? continue; - switch (spells[iter.SpellId].targettype) { + switch (spells[iter.SpellId].target_type) { case ST_AEBard: case ST_AECaster: case ST_GroupTeleport: @@ -1021,9 +1021,9 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { continue; if (!CheckSpellRecastTimers(this, iter.SpellIndex)) continue; - if (spells[iter.SpellId].zonetype != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zonetype != zone->GetZoneType()) // is this bit or index? + if (spells[iter.SpellId].zone_type != -1 && zone->GetZoneType() != -1 && spells[iter.SpellId].zone_type != zone->GetZoneType()) // is this bit or index? continue; - switch (spells[iter.SpellId].targettype) { + switch (spells[iter.SpellId].target_type) { case ST_AEBard: case ST_AECaster: case ST_GroupTeleport: @@ -1088,11 +1088,11 @@ bool Bot::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain } else dist2 = DistanceSquared(m_Position, tar->GetPosition()); - if (((((spells[AIspells[i].spellid].targettype==ST_GroupTeleport && AIspells[i].type==2) - || spells[AIspells[i].spellid].targettype==ST_AECaster - || spells[AIspells[i].spellid].targettype==ST_Group - || spells[AIspells[i].spellid].targettype==ST_AEBard) - && dist2 <= spells[AIspells[i].spellid].aoerange*spells[AIspells[i].spellid].aoerange) + if (((((spells[AIspells[i].spellid].target_type==ST_GroupTeleport && AIspells[i].type==2) + || spells[AIspells[i].spellid].target_type==ST_AECaster + || spells[AIspells[i].spellid].target_type==ST_Group + || spells[AIspells[i].spellid].target_type==ST_AEBard) + && dist2 <= spells[AIspells[i].spellid].aoe_range*spells[AIspells[i].spellid].aoe_range) || dist2 <= GetActSpellRange(AIspells[i].spellid, spells[AIspells[i].spellid].range)*GetActSpellRange(AIspells[i].spellid, spells[AIspells[i].spellid].range)) && (mana_cost <= GetMana() || GetMana() == GetMaxMana())) { result = NPC::AIDoSpellCast(i, tar, mana_cost, oDontDoAgainBefore); @@ -1119,8 +1119,8 @@ bool Bot::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain AIspells[i].time_cancast = Timer::GetCurrentTime() + spells[AIspells[i].spellid].recast_time; - if(spells[AIspells[i].spellid].EndurTimerIndex > 0) { - SetSpellRecastTimer(spells[AIspells[i].spellid].EndurTimerIndex, spells[AIspells[i].spellid].recast_time); + if(spells[AIspells[i].spellid].timer_id > 0) { + SetSpellRecastTimer(spells[AIspells[i].spellid].timer_id, spells[AIspells[i].spellid].recast_time); } } @@ -1575,7 +1575,7 @@ bool Bot::AIHealRotation(Mob* tar, bool useFastHeals) { return false; // Can we cast this spell on this target? - if (!(spells[botSpell.SpellId].targettype == ST_GroupTeleport || spells[botSpell.SpellId].targettype == ST_Target || tar == this) + if (!(spells[botSpell.SpellId].target_type == ST_GroupTeleport || spells[botSpell.SpellId].target_type == ST_Target || tar == this) && !(tar->CanBuffStack(botSpell.SpellId, botLevel, true) >= 0)) return false; @@ -1630,7 +1630,7 @@ std::list Bot::GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, } if(IsEffectInSpell(botSpellList[i].spellid, spellEffect)) { - if(spells[botSpellList[i].spellid].targettype == targetType) { + if(spells[botSpellList[i].spellid].target_type == targetType) { BotSpell botSpell; botSpell.SpellId = botSpellList[i].spellid; botSpell.SpellIndex = i; @@ -1999,7 +1999,7 @@ BotSpell Bot::GetBestBotSpellForMagicBasedSlow(Bot* botCaster) { for (std::list::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) { // Assuming all the spells have been loaded into this list by level and in descending order - if (IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resisttype == RESIST_MAGIC && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) { + if (IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resist_type == RESIST_MAGIC && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) { result.SpellId = botSpellListItr->SpellId; result.SpellIndex = botSpellListItr->SpellIndex; result.ManaCost = botSpellListItr->ManaCost; @@ -2024,7 +2024,7 @@ BotSpell Bot::GetBestBotSpellForDiseaseBasedSlow(Bot* botCaster) { for(std::list::iterator botSpellListItr = botSpellList.begin(); botSpellListItr != botSpellList.end(); ++botSpellListItr) { // Assuming all the spells have been loaded into this list by level and in descending order - if(IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resisttype == RESIST_DISEASE && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) { + if(IsSlowSpell(botSpellListItr->SpellId) && spells[botSpellListItr->SpellId].resist_type == RESIST_DISEASE && CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) { result.SpellId = botSpellListItr->SpellId; result.SpellIndex = botSpellListItr->SpellIndex; result.ManaCost = botSpellListItr->ManaCost; @@ -2265,26 +2265,26 @@ BotSpell Bot::GetBestBotWizardNukeSpellByTargetResists(Bot* botCaster, Mob* targ bool spellSelected = false; if(CheckSpellRecastTimers(botCaster, botSpellListItr->SpellIndex)) { - if(selectLureNuke && (spells[botSpellListItr->SpellId].ResistDiff < lureResisValue)) { + if(selectLureNuke && (spells[botSpellListItr->SpellId].resist_difficulty < lureResisValue)) { spellSelected = true; } else if(IsPureNukeSpell(botSpellListItr->SpellId)) { if(((target->GetMR() < target->GetCR()) || (target->GetMR() < target->GetFR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_MAGIC) - && (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue)) + && (spells[botSpellListItr->SpellId].resist_difficulty > lureResisValue)) { spellSelected = true; } else if(((target->GetCR() < target->GetMR()) || (target->GetCR() < target->GetFR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_COLD) - && (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue)) + && (spells[botSpellListItr->SpellId].resist_difficulty > lureResisValue)) { spellSelected = true; } else if(((target->GetFR() < target->GetCR()) || (target->GetFR() < target->GetMR())) && (GetSpellResistType(botSpellListItr->SpellId) == RESIST_FIRE) - && (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue)) + && (spells[botSpellListItr->SpellId].resist_difficulty > lureResisValue)) { spellSelected = true; } - else if((GetSpellResistType(botSpellListItr->SpellId) == RESIST_MAGIC) && (spells[botSpellListItr->SpellId].ResistDiff > lureResisValue) && !IsStunSpell(botSpellListItr->SpellId)) { + else if((GetSpellResistType(botSpellListItr->SpellId) == RESIST_MAGIC) && (spells[botSpellListItr->SpellId].resist_difficulty > lureResisValue) && !IsStunSpell(botSpellListItr->SpellId)) { firstWizardMagicNukeSpellFound.SpellId = botSpellListItr->SpellId; firstWizardMagicNukeSpellFound.SpellIndex = botSpellListItr->SpellIndex; firstWizardMagicNukeSpellFound.ManaCost = botSpellListItr->ManaCost; @@ -2527,7 +2527,7 @@ int32 Bot::GetSpellRecastTimer(Bot *caster, int timer_index) { bool Bot::CheckSpellRecastTimers(Bot *caster, int SpellIndex) { if(caster) { if(caster->AIspells[SpellIndex].time_cancast < Timer::GetCurrentTime()) { //checks spell recast - if(GetSpellRecastTimer(caster, spells[caster->AIspells[SpellIndex].spellid].EndurTimerIndex) < Timer::GetCurrentTime()) { //checks for spells on the same timer + if(GetSpellRecastTimer(caster, spells[caster->AIspells[SpellIndex].spellid].timer_id) < Timer::GetCurrentTime()) { //checks for spells on the same timer return true; //can cast spell } } diff --git a/zone/client.cpp b/zone/client.cpp index ed29a3981..a1afb485f 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -4005,9 +4005,9 @@ void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) { else { PendingTranslocateData.zone_id = ts->ZoneID = ZoneID(Spell.teleport_zone); PendingTranslocateData.instance_id = 0; - PendingTranslocateData.y = ts->y = Spell.base[0]; - PendingTranslocateData.x = ts->x = Spell.base[1]; - PendingTranslocateData.z = ts->z = Spell.base[2]; + PendingTranslocateData.y = ts->y = Spell.base_value[0]; + PendingTranslocateData.x = ts->x = Spell.base_value[1]; + PendingTranslocateData.z = ts->z = Spell.base_value[2]; PendingTranslocateData.heading = 0.0; } @@ -4965,7 +4965,7 @@ void Client::HandleLDoNOpen(NPC *target) if(target->GetLDoNTrapSpellID() != 0) { MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); - target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQ::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); + target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQ::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].resist_difficulty); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); target->SetLDoNTrapDetected(false); @@ -5087,7 +5087,7 @@ void Client::HandleLDoNDisarm(NPC *target, uint16 skill, uint8 type) break; case -1: MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); - target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQ::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); + target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQ::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].resist_difficulty); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); target->SetLDoNTrapDetected(false); @@ -5106,7 +5106,7 @@ void Client::HandleLDoNPickLock(NPC *target, uint16 skill, uint8 type) if(target->IsLDoNTrapped()) { MessageString(Chat::Red, LDON_ACCIDENT_SETOFF2); - target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQ::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].ResistDiff); + target->SpellFinished(target->GetLDoNTrapSpellID(), this, EQ::spells::CastingSlot::Item, 0, -1, spells[target->GetLDoNTrapSpellID()].resist_difficulty); target->SetLDoNTrapSpellID(0); target->SetLDoNTrapped(false); target->SetLDoNTrapDetected(false); @@ -8577,8 +8577,8 @@ void Client::ShowNumHits() uint32 buffcount = GetMaxTotalSlots(); for (uint32 buffslot = 0; buffslot < buffcount; buffslot++) { const Buffs_Struct &curbuff = buffs[buffslot]; - if (curbuff.spellid != SPELL_UNKNOWN && curbuff.numhits) - Message(0, "You have %d hits left on %s", curbuff.numhits, GetSpellName(curbuff.spellid)); + if (curbuff.spellid != SPELL_UNKNOWN && curbuff.hit_number) + Message(0, "You have %d hits left on %s", curbuff.hit_number, GetSpellName(curbuff.spellid)); } return; } @@ -10055,7 +10055,7 @@ std::vector Client::GetLearnableDisciplines(uint8 min_level, uint8 max_leve continue; if (spells[spell_id].skill == 52) continue; - if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effectid[EFFECT_COUNT - 1] == 10) + if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effect_id[EFFECT_COUNT - 1] == 10) continue; if (HasDisciplineLearned(spell_id)) continue; @@ -10121,7 +10121,7 @@ std::vector Client::GetScribeableSpells(uint8 min_level, uint8 max_level) { continue; if (spells[spell_id].skill == 52) continue; - if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effectid[EFFECT_COUNT - 1] == 10) + if (RuleB(Spells, UseCHAScribeHack) && spells[spell_id].effect_id[EFFECT_COUNT - 1] == 10) continue; if (HasSpellScribed(spell_id)) continue; diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index e124daf9e..ae2e6487a 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1521,7 +1521,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) uint32 effectmod = 10; int effectmodcap = 0; if (RuleB(Character, UseSpellFileSongCap)) { - effectmodcap = spells[spell_id].songcap / 10; + effectmodcap = spells[spell_id].song_cap / 10; if (effectmodcap) { effectmodcap += 10; //Actual calculated cap is 100 greater than songcap value. } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 6f4b630f0..9273290b3 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -651,30 +651,30 @@ void Client::CompleteConnect() } for (int x1 = 0; x1 < EFFECT_COUNT; x1++) { - switch (spell.effectid[x1]) { + switch (spell.effect_id[x1]) { case SE_IllusionCopy: case SE_Illusion: { - if (spell.base[x1] == -1) { + if (spell.base_value[x1] == -1) { if (gender == 1) gender = 0; else if (gender == 0) gender = 1; SendIllusionPacket(GetRace(), gender, 0xFF, 0xFF); } - else if (spell.base[x1] == -2) // WTF IS THIS + else if (spell.base_value[x1] == -2) // WTF IS THIS { if (GetRace() == 128 || GetRace() == 130 || GetRace() <= 12) - SendIllusionPacket(GetRace(), GetGender(), spell.base2[x1], spell.max[x1]); + SendIllusionPacket(GetRace(), GetGender(), spell.limit_value[x1], spell.max_value[x1]); } - else if (spell.max[x1] > 0) + else if (spell.max_value[x1] > 0) { - SendIllusionPacket(spell.base[x1], 0xFF, spell.base2[x1], spell.max[x1]); + SendIllusionPacket(spell.base_value[x1], 0xFF, spell.limit_value[x1], spell.max_value[x1]); } else { - SendIllusionPacket(spell.base[x1], 0xFF, 0xFF, 0xFF); + SendIllusionPacket(spell.base_value[x1], 0xFF, 0xFF, 0xFF); } - switch (spell.base[x1]) { + switch (spell.base_value[x1]) { case OGRE: SendAppearancePacket(AT_Size, 9); break; @@ -761,17 +761,17 @@ void Client::CompleteConnect() case SE_AddMeleeProc: case SE_WeaponProc: { - AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid, buffs[j1].casterlevel); + AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid, buffs[j1].casterlevel); break; } case SE_DefensiveProc: { - AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); + AddDefensiveProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); break; } case SE_RangedProc: { - AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); + AddRangedProc(GetProcID(buffs[j1].spellid, x1), 100 + spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); break; } } @@ -1510,7 +1510,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) m_pp.buffs[i].unknown003 = 0; m_pp.buffs[i].duration = buffs[i].ticsremaining; m_pp.buffs[i].counters = buffs[i].counters; - m_pp.buffs[i].num_hits = buffs[i].numhits; + m_pp.buffs[i].num_hits = buffs[i].hit_number; } else { m_pp.buffs[i].spellid = SPELLBOOK_UNKNOWN; @@ -3956,7 +3956,7 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and //isdetrimentalspell() is much more complex - if (spid == 0xFFFF || (IsValidSpell(spid) && (spells[spid].goodEffect == 0))) + if (spid == 0xFFFF || (IsValidSpell(spid) && (spells[spid].good_effect == 0))) QueuePacket(app); else BuffFadeBySpellID(spid); @@ -8877,7 +8877,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) IsFeared() || IsMezzed() || DivineAura() || - (spells[spell_id].targettype == ST_Ring) || + (spells[spell_id].target_type == ST_Ring) || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id)) || (IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()) || @@ -8890,7 +8890,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } // Modern clients don't require pet targeted for item clicks that are ST_Pet - if (spell_id > 0 && (spells[spell_id].targettype == ST_Pet || spells[spell_id].targettype == ST_SummonedPet)) + if (spell_id > 0 && (spells[spell_id].target_type == ST_Pet || spells[spell_id].target_type == ST_SummonedPet)) target_id = GetPetID(); LogDebug("OP ItemVerifyRequest: spell=[{}], target=[{}], inv=[{}]", spell_id, target_id, slot_id); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index ea11764bf..d82bfa10a 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -978,7 +978,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); LogSpells("Player [{}] got a [{}] Rezz, spellid [{}] in zone[{}], instance id [{}]", - this->name, (uint16)spells[SpellID].base[0], + this->name, (uint16)spells[SpellID].base_value[0], SpellID, ZoneID, InstanceID); this->BuffFadeNonPersistDeath(); @@ -997,12 +997,12 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I SetMana(GetMaxMana()); SetHP(GetMaxHP()); } - if(spells[SpellID].base[0] < 100 && spells[SpellID].base[0] > 0 && PendingRezzXP > 0) + if(spells[SpellID].base_value[0] < 100 && spells[SpellID].base_value[0] > 0 && PendingRezzXP > 0) { - SetEXP(((int)(GetEXP()+((float)((PendingRezzXP / 100) * spells[SpellID].base[0])))), + SetEXP(((int)(GetEXP()+((float)((PendingRezzXP / 100) * spells[SpellID].base_value[0])))), GetAAXP(),true); } - else if (spells[SpellID].base[0] == 100 && PendingRezzXP > 0) { + else if (spells[SpellID].base_value[0] == 100 && PendingRezzXP > 0) { SetEXP((GetEXP() + PendingRezzXP), GetAAXP(), true); } @@ -1832,7 +1832,7 @@ void Client::DoEnduranceUpkeep() { uint32 buff_count = GetMaxTotalSlots(); for (buffs_i = 0; buffs_i < buff_count; buffs_i++) { if (buffs[buffs_i].spellid != SPELL_UNKNOWN) { - int upkeep = spells[buffs[buffs_i].spellid].EndurUpkeep; + int upkeep = spells[buffs[buffs_i].spellid].endurance_upkeep; if(upkeep > 0) { has_effect = true; if(cost_redux > 0) { diff --git a/zone/command.cpp b/zone/command.cpp index c973f6cb4..45024464b 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -2998,12 +2998,12 @@ void command_castspell(Client *c, const Seperator *sep) else if (c->GetTarget() == 0) if(c->Admin() >= commandInstacast) - c->SpellFinished(spellid, 0, EQ::spells::CastingSlot::Item, 0, -1, spells[spellid].ResistDiff); + c->SpellFinished(spellid, 0, EQ::spells::CastingSlot::Item, 0, -1, spells[spellid].resist_difficulty); else c->CastSpell(spellid, 0, EQ::spells::CastingSlot::Item, 0); else if(c->Admin() >= commandInstacast) - c->SpellFinished(spellid, c->GetTarget(), EQ::spells::CastingSlot::Item, 0, -1, spells[spellid].ResistDiff); + c->SpellFinished(spellid, c->GetTarget(), EQ::spells::CastingSlot::Item, 0, -1, spells[spellid].resist_difficulty); else c->CastSpell(spellid, c->GetTarget()->GetID(), EQ::spells::CastingSlot::Item, 0); } @@ -5608,40 +5608,40 @@ void command_spellinfo(Client *c, const Seperator *sep) c->Message(Chat::White, " cast_on_you: %s", s->cast_on_you); c->Message(Chat::White, " spell_fades: %s", s->spell_fades); c->Message(Chat::White, " range: %f", s->range); - c->Message(Chat::White, " aoerange: %f", s->aoerange); - c->Message(Chat::White, " pushback: %f", s->pushback); - c->Message(Chat::White, " pushup: %f", s->pushup); + c->Message(Chat::White, " aoe_range: %f", s->aoe_range); + c->Message(Chat::White, " push_back: %f", s->push_back); + c->Message(Chat::White, " push_up: %f", s->push_up); c->Message(Chat::White, " cast_time: %d", s->cast_time); c->Message(Chat::White, " recovery_time: %d", s->recovery_time); c->Message(Chat::White, " recast_time: %d", s->recast_time); - c->Message(Chat::White, " buffdurationformula: %d", s->buffdurationformula); - c->Message(Chat::White, " buffduration: %d", s->buffduration); - c->Message(Chat::White, " AEDuration: %d", s->AEDuration); + c->Message(Chat::White, " buff_duration_formula: %d", s->buff_duration_formula); + c->Message(Chat::White, " buff_duration: %d", s->buff_duration); + c->Message(Chat::White, " AEDuration: %d", s->aoe_duration); c->Message(Chat::White, " mana: %d", s->mana); - c->Message(Chat::White, " base[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base[0], s->base[1], s->base[2], s->base[3], s->base[4], s->base[5], s->base[6], s->base[7], s->base[8], s->base[9], s->base[10], s->base[11]); - c->Message(Chat::White, " base22[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base2[0], s->base2[1], s->base2[2], s->base2[3], s->base2[4], s->base2[5], s->base2[6], s->base2[7], s->base2[8], s->base2[9], s->base2[10], s->base2[11]); - c->Message(Chat::White, " max[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->max[0], s->max[1], s->max[2], s->max[3], s->max[4], s->max[5], s->max[6], s->max[7], s->max[8], s->max[9], s->max[10], s->max[11]); - c->Message(Chat::White, " components[4]: %d, %d, %d, %d", s->components[0], s->components[1], s->components[2], s->components[3]); - c->Message(Chat::White, " component_counts[4]: %d, %d, %d, %d", s->component_counts[0], s->component_counts[1], s->component_counts[2], s->component_counts[3]); - c->Message(Chat::White, " NoexpendReagent[4]: %d, %d, %d, %d", s->NoexpendReagent[0], s->NoexpendReagent[1], s->NoexpendReagent[2], s->NoexpendReagent[3]); + c->Message(Chat::White, " base[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base_value[0], s->base_value[1], s->base_value[2], s->base_value[3], s->base_value[4], s->base_value[5], s->base_value[6], s->base_value[7], s->base_value[8], s->base_value[9], s->base_value[10], s->base_value[11]); + c->Message(Chat::White, " base22[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->limit_value[0], s->limit_value[1], s->limit_value[2], s->limit_value[3], s->limit_value[4], s->limit_value[5], s->limit_value[6], s->limit_value[7], s->limit_value[8], s->limit_value[9], s->limit_value[10], s->limit_value[11]); + c->Message(Chat::White, " max[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->max_value[0], s->max_value[1], s->max_value[2], s->max_value[3], s->max_value[4], s->max_value[5], s->max_value[6], s->max_value[7], s->max_value[8], s->max_value[9], s->max_value[10], s->max_value[11]); + c->Message(Chat::White, " components[4]: %d, %d, %d, %d", s->component[0], s->component[1], s->component[2], s->component[3]); + c->Message(Chat::White, " component_counts[4]: %d, %d, %d, %d", s->component_count[0], s->component_count[1], s->component_count[2], s->component_count[3]); + c->Message(Chat::White, " NoexpendReagent[4]: %d, %d, %d, %d", s->no_expend_reagent[0], s->no_expend_reagent[1], s->no_expend_reagent[2], s->no_expend_reagent[3]); c->Message(Chat::White, " formula[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->formula[0], s->formula[1], s->formula[2], s->formula[3], s->formula[4], s->formula[5], s->formula[6], s->formula[7], s->formula[8], s->formula[9], s->formula[10], s->formula[11]); - c->Message(Chat::White, " goodEffect: %d", s->goodEffect); - c->Message(Chat::White, " Activated: %d", s->Activated); - c->Message(Chat::White, " resisttype: %d", s->resisttype); - c->Message(Chat::White, " effectid[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->effectid[0], s->effectid[1], s->effectid[2], s->effectid[3], s->effectid[4], s->effectid[5], s->effectid[6], s->effectid[7], s->effectid[8], s->effectid[9], s->effectid[10], s->effectid[11]); - c->Message(Chat::White, " targettype: %d", s->targettype); - c->Message(Chat::White, " basediff: %d", s->basediff); + c->Message(Chat::White, " goodEffect: %d", s->good_effect); + c->Message(Chat::White, " Activated: %d", s->activated); + c->Message(Chat::White, " resisttype: %d", s->resist_type); + c->Message(Chat::White, " effectid[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->effect_id[0], s->effect_id[1], s->effect_id[2], s->effect_id[3], s->effect_id[4], s->effect_id[5], s->effect_id[6], s->effect_id[7], s->effect_id[8], s->effect_id[9], s->effect_id[10], s->effect_id[11]); + c->Message(Chat::White, " targettype: %d", s->target_type); + c->Message(Chat::White, " basediff: %d", s->base_difficulty); c->Message(Chat::White, " skill: %d", s->skill); - c->Message(Chat::White, " zonetype: %d", s->zonetype); - c->Message(Chat::White, " EnvironmentType: %d", s->EnvironmentType); - c->Message(Chat::White, " TimeOfDay: %d", s->TimeOfDay); + c->Message(Chat::White, " zonetype: %d", s->zone_type); + c->Message(Chat::White, " EnvironmentType: %d", s->environment_type); + c->Message(Chat::White, " TimeOfDay: %d", s->time_of_day); c->Message(Chat::White, " classes[15]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->classes[0], s->classes[1], s->classes[2], s->classes[3], s->classes[4], s->classes[5], s->classes[6], s->classes[7], s->classes[8], s->classes[9], s->classes[10], s->classes[11], s->classes[12], s->classes[13], s->classes[14]); - c->Message(Chat::White, " CastingAnim: %d", s->CastingAnim); - c->Message(Chat::White, " SpellAffectIndex: %d", s->SpellAffectIndex); - c->Message(Chat::White, " RecourseLink: %d", s->RecourseLink); + c->Message(Chat::White, " CastingAnim: %d", s->casting_animation); + c->Message(Chat::White, " SpellAffectIndex: %d", s->spell_affect_index); + c->Message(Chat::White, " RecourseLink: %d", s->recourse_link); } } diff --git a/zone/common.h b/zone/common.h index 82b17470e..733a4e3fd 100644 --- a/zone/common.h +++ b/zone/common.h @@ -318,7 +318,7 @@ struct Buffs_Struct { char caster_name[64]; int32 ticsremaining; uint32 counters; - uint32 numhits; //the number of physical hits this buff can take before it fades away, lots of druid armor spells take advantage of this mixed with powerful effects + uint32 hit_number; //the number of physical hits this buff can take before it fades away, lots of druid armor spells take advantage of this mixed with powerful effects uint32 melee_rune; uint32 magic_rune; uint32 dot_rune; diff --git a/zone/effects.cpp b/zone/effects.cpp index 849038ab1..0d9c412d0 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -42,7 +42,7 @@ float Mob::GetActSpellRange(uint16 spell_id, float range, bool IsBard) int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { - if (spells[spell_id].targettype == ST_Self) + if (spells[spell_id].target_type == ST_Self) return value; if (IsNPC()) @@ -320,7 +320,7 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { int16 critical_chance = 0; int8 critical_modifier = 1; - if (spells[spell_id].buffduration < 1) { + if (spells[spell_id].buff_duration < 1) { critical_chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance; if (spellbonuses.CriticalHealDecay) { @@ -353,7 +353,7 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { value += int(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id) / 100); // Instant Heals - if (spells[spell_id].buffduration < 1) { + if (spells[spell_id].buff_duration < 1) { if (target) { value += int(base_value * target->GetFocusEffect(focusFcHealPctIncoming, spell_id)/100); //SPA 393 Add before critical @@ -756,7 +756,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return(false); } - if(GetEndurance() < spell.EndurCost) { + if(GetEndurance() < spell.endurance_cost) { Message(11, "You are too fatigued to use this skill right now."); return(false); } @@ -768,11 +768,11 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { } // the client does this check before calling CastSpell, should prevent discs being eaten - if (spell.buffdurationformula != 0 && spell.targettype == ST_Self && HasDiscBuff()) + if (spell.buff_duration_formula != 0 && spell.target_type == ST_Self && HasDiscBuff()) return false; //Check the disc timer - pTimerType DiscTimer = pTimerDisciplineReuseStart + spell.EndurTimerIndex; + pTimerType DiscTimer = pTimerDisciplineReuseStart + spell.timer_id; if(!p_timers.Expired(&database, DiscTimer, false)) { // lets not set the reuse timer in case CastSpell fails (or we would have to turn off the timer, but CastSpell will set it as well) /*char val1[20]={0};*/ //unused /*char val2[20]={0};*/ //unused @@ -805,7 +805,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return true; } - SendDisciplineTimer(spells[spell_id].EndurTimerIndex, reduced_recast); + SendDisciplineTimer(spells[spell_id].timer_id, reduced_recast); } else { @@ -924,7 +924,7 @@ void EntityList::AESpell( ) { const auto &cast_target_position = - spells[spell_id].targettype == ST_Ring ? + spells[spell_id].target_type == ST_Ring ? caster_mob->GetTargetRingLocation() : static_cast(center_mob->GetPosition()); @@ -951,8 +951,8 @@ void EntityList::AESpell( if (max_targets) { // rains pass this in since they need to preserve the count through waves max_targets_allowed = *max_targets; } - else if (spells[spell_id].aemaxtargets) { - max_targets_allowed = spells[spell_id].aemaxtargets; + else if (spells[spell_id].aoe_max_targets) { + max_targets_allowed = spells[spell_id].aoe_max_targets; } else if (IsTargetableAESpell(spell_id) && is_detrimental_spell && !is_npc && !IsEffectInSpell(spell_id, SE_Lull) && !IsEffectInSpell(spell_id, SE_Mez)) { max_targets_allowed = 4; @@ -984,15 +984,15 @@ void EntityList::AESpell( continue; } - if (spells[spell_id].targettype == ST_TargetAENoPlayersPets && current_mob->IsPetOwnerClient()) { + if (spells[spell_id].target_type == ST_TargetAENoPlayersPets && current_mob->IsPetOwnerClient()) { continue; } - if (spells[spell_id].targettype == ST_AreaClientOnly && !current_mob->IsClient()) { + if (spells[spell_id].target_type == ST_AreaClientOnly && !current_mob->IsClient()) { continue; } - if (spells[spell_id].targettype == ST_AreaNPCOnly && !current_mob->IsNPC()) { + if (spells[spell_id].target_type == ST_AreaNPCOnly && !current_mob->IsNPC()) { continue; } @@ -1026,7 +1026,7 @@ void EntityList::AESpell( } if (is_npc && current_mob->IsNPC() && - spells[spell_id].targettype != ST_AreaNPCOnly) { //check npc->npc casting + spells[spell_id].target_type != ST_AreaNPCOnly) { //check npc->npc casting FACTION_VALUE faction_value = current_mob->GetReverseFactionCon(caster_mob); if (is_detrimental_spell) { //affect mobs that are on our hate list, or diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 635a48b4c..c74b7de42 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -171,7 +171,7 @@ void PerlembParser::ReloadQuests() } int PerlembParser::EventCommon( - QuestEventID event, uint32 objid, const char *data, NPC *npcmob, EQ::ItemInstance *item_inst, Mob *mob, + QuestEventID event, uint32 objid, const char *data, NPC *npcmob, EQ::ItemInstance *item_inst, const SPDat_Spell_Struct* spell, Mob *mob, uint32 extradata, bool global, std::vector *extra_pointers ) { @@ -252,17 +252,17 @@ int PerlembParser::EventCommon( } if (isPlayerQuest || isGlobalPlayerQuest) { - return SendCommands(package_name.c_str(), sub_name, 0, mob, mob, nullptr); + return SendCommands(package_name.c_str(), sub_name, 0, mob, mob, nullptr, nullptr); } else if (isItemQuest) { - return SendCommands(package_name.c_str(), sub_name, 0, mob, mob, item_inst); + return SendCommands(package_name.c_str(), sub_name, 0, mob, mob, item_inst, nullptr); } else if (isSpellQuest) { if (mob) { - return SendCommands(package_name.c_str(), sub_name, 0, mob, mob, nullptr); + return SendCommands(package_name.c_str(), sub_name, 0, mob, mob, nullptr, spell); } else { - return SendCommands(package_name.c_str(), sub_name, 0, npcmob, mob, nullptr); + return SendCommands(package_name.c_str(), sub_name, 0, npcmob, mob, nullptr, spell); } } else { - return SendCommands(package_name.c_str(), sub_name, objid, npcmob, mob, nullptr); + return SendCommands(package_name.c_str(), sub_name, objid, npcmob, mob, nullptr, nullptr); } } @@ -271,7 +271,7 @@ int PerlembParser::EventNPC( std::vector *extra_pointers ) { - return EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data, false, extra_pointers); + return EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, nullptr, init, extra_data, false, extra_pointers); } int PerlembParser::EventGlobalNPC( @@ -279,7 +279,7 @@ int PerlembParser::EventGlobalNPC( std::vector *extra_pointers ) { - return EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data, true, extra_pointers); + return EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, nullptr, init, extra_data, true, extra_pointers); } int PerlembParser::EventPlayer( @@ -287,7 +287,7 @@ int PerlembParser::EventPlayer( std::vector *extra_pointers ) { - return EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data, false, extra_pointers); + return EventCommon(evt, 0, data.c_str(), nullptr, nullptr, nullptr, client, extra_data, false, extra_pointers); } int PerlembParser::EventGlobalPlayer( @@ -295,7 +295,7 @@ int PerlembParser::EventGlobalPlayer( std::vector *extra_pointers ) { - return EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data, true, extra_pointers); + return EventCommon(evt, 0, data.c_str(), nullptr, nullptr, nullptr, client, extra_data, true, extra_pointers); } int PerlembParser::EventItem( @@ -304,7 +304,7 @@ int PerlembParser::EventItem( ) { // needs pointer validation on 'item' argument - return EventCommon(evt, item->GetID(), nullptr, nullptr, item, client, extra_data, false, extra_pointers); + return EventCommon(evt, item->GetID(), nullptr, nullptr, item, nullptr, client, extra_data, false, extra_pointers); } int PerlembParser::EventSpell( @@ -312,7 +312,7 @@ int PerlembParser::EventSpell( std::vector *extra_pointers ) { - return EventCommon(evt, spell_id, data.c_str(), npc, nullptr, client, extra_data, false, extra_pointers); + return EventCommon(evt, spell_id, data.c_str(), npc, nullptr, &spells[spell_id], client, extra_data, false, extra_pointers); } bool PerlembParser::HasQuestSub(uint32 npcid, QuestEventID evt) @@ -775,10 +775,11 @@ void PerlembParser::ExportVar(const char *pkgprefix, const char *varname, const int PerlembParser::SendCommands( const char *pkgprefix, const char *event, - uint32 npcid, + uint32 object_id, Mob *other, Mob *mob, - EQ::ItemInstance *item_inst + EQ::ItemInstance *item_inst, + const SPDat_Spell_Struct *spell ) { if (!perl) { @@ -787,10 +788,10 @@ int PerlembParser::SendCommands( int ret_value = 0; if (mob && mob->IsClient()) { - quest_manager.StartQuest(other, mob->CastToClient(), item_inst); + quest_manager.StartQuest(other, mob->CastToClient(), item_inst, spell); } else { - quest_manager.StartQuest(other, nullptr, nullptr); + quest_manager.StartQuest(other); } try { @@ -804,6 +805,7 @@ int PerlembParser::SendCommands( std::string cl = (std::string) "$" + (std::string) pkgprefix + (std::string) "::client"; std::string np = (std::string) "$" + (std::string) pkgprefix + (std::string) "::npc"; std::string qi = (std::string) "$" + (std::string) pkgprefix + (std::string) "::questitem"; + std::string sp = (std::string) "$" + (std::string) pkgprefix + (std::string) "::spell"; std::string enl = (std::string) "$" + (std::string) pkgprefix + (std::string) "::entity_list"; if (clear_vars_.find(cl) != clear_vars_.end()) { std::string eval_str = cl; @@ -823,6 +825,12 @@ int PerlembParser::SendCommands( perl->eval(eval_str.c_str()); } + if (clear_vars_.find(sp) != clear_vars_.end()) { + std::string eval_str = sp; + eval_str += " = undef;"; + perl->eval(eval_str.c_str()); + } + if (clear_vars_.find(enl) != clear_vars_.end()) { std::string eval_str = enl; eval_str += " = undef;"; @@ -860,6 +868,14 @@ int PerlembParser::SendCommands( sv_setref_pv(questitem, "QuestItem", curi); } + if (spell) { + const SPDat_Spell_Struct* current_spell = quest_manager.GetQuestSpell(); + SPDat_Spell_Struct* real_spell = const_cast(current_spell); + snprintf(namebuf, 64, "%s::spell", pkgprefix); + SV *spell = get_sv(namebuf, true); + sv_setref_pv(spell, "Spell", (void *) real_spell); + } + snprintf(namebuf, 64, "%s::entity_list", pkgprefix); SV *el = get_sv(namebuf, true); sv_setref_pv(el, "EntityList", &entity_list); @@ -873,10 +889,12 @@ int PerlembParser::SendCommands( std::string cl = (std::string) "$" + (std::string) pkgprefix + (std::string) "::client"; std::string np = (std::string) "$" + (std::string) pkgprefix + (std::string) "::npc"; std::string qi = (std::string) "$" + (std::string) pkgprefix + (std::string) "::questitem"; + std::string sp = (std::string) "$" + (std::string) pkgprefix + (std::string) "::spell"; std::string enl = (std::string) "$" + (std::string) pkgprefix + (std::string) "::entity_list"; clear_vars_[cl] = 1; clear_vars_[np] = 1; clear_vars_[qi] = 1; + clear_vars_[sp] = 1; clear_vars_[enl] = 1; } #endif @@ -967,6 +985,9 @@ void PerlembParser::MapFunctions() "package QuestItem;" "&boot_QuestItem;" // load quest Item XS + "package Spell;" + "&boot_Spell;" // load quest Spell XS + "package HateEntry;" "&boot_HateEntry;" // load quest Hate XS diff --git a/zone/embparser.h b/zone/embparser.h index 76d6d9717..52bba1589 100644 --- a/zone/embparser.h +++ b/zone/embparser.h @@ -90,9 +90,9 @@ private: void ExportVar(const char *pkgprefix, const char *varname, float value); void ExportVarComplex(const char *pkgprefix, const char *varname, const char *value); - int EventCommon(QuestEventID event, uint32 objid, const char * data, NPC* npcmob, EQ::ItemInstance* item_inst, Mob* mob, + int EventCommon(QuestEventID event, uint32 objid, const char * data, NPC* npcmob, EQ::ItemInstance* item_inst, const SPDat_Spell_Struct* spell, Mob* mob, uint32 extradata, bool global, std::vector *extra_pointers); - int SendCommands(const char *pkgprefix, const char *event, uint32 npcid, Mob* other, Mob* mob, EQ::ItemInstance *item_inst); + int SendCommands(const char *pkgprefix, const char *event, uint32 spell_id, Mob* other, Mob* mob, EQ::ItemInstance *item_inst, const SPDat_Spell_Struct *spell); void MapFunctions(); void GetQuestTypes(bool &isPlayerQuest, bool &isGlobalPlayerQuest, bool &isGlobalNPC, bool &isItemQuest, diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index fda5cd9b1..b0b1a312e 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -138,6 +138,21 @@ XS(XS_QuestItem_new) { XSRETURN(1); } +//Any creation of new Spells gets the current Spell +XS(XS_Spell_new); +XS(XS_Spell_new) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::Spell::new()"); + + const SPDat_Spell_Struct* spell = quest_manager.GetQuestSpell(); + ST(0) = sv_newmortal(); + if (spell) + sv_setref_pv(ST(0), "Spell", (void *) spell); + + XSRETURN(1); +} + //Any creation of new quest items gets the current quest item XS(XS_MobList_new); XS(XS_MobList_new) { @@ -7993,6 +8008,21 @@ XS(XS__countspawnednpcs) { } } +XS(XS__getspell); +XS(XS__getspell) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: quest::getspell(uint32 spell_id)"); + { + dXSTARG; + uint32 spell_id = (uint32) SvUV(ST(0)); + const SPDat_Spell_Struct* spell = quest_manager.getspell(spell_id); + ST(0) = sv_newmortal(); + sv_setref_pv(ST(0), "Spell", (void *) spell); + XSRETURN(1); + } +} + /* This is the callback perl will look for to setup the quest package's XSUBs @@ -8301,6 +8331,7 @@ EXTERN_C XS(boot_quest) { newXS(strcpy(buf, "getinventoryslotname"), XS__getinventoryslotname, file); newXS(strcpy(buf, "getraididbycharid"), XS__getraididbycharid, file); newXS(strcpy(buf, "getracename"), XS__getracename, file); + newXS(strcpy(buf, "getspell"), XS__getspell, file); newXS(strcpy(buf, "getspellname"), XS__getspellname, file); newXS(strcpy(buf, "get_spell_level"), XS__get_spell_level, file); newXS(strcpy(buf, "getspellstat"), XS__getspellstat, file); diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 1300df0b2..9be785566 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -34,6 +34,7 @@ EXTERN_C XS(boot_Group); EXTERN_C XS(boot_Raid); EXTERN_C XS(boot_Inventory); EXTERN_C XS(boot_QuestItem); +EXTERN_C XS(boot_Spell); EXTERN_C XS(boot_HateEntry); EXTERN_C XS(boot_Object); EXTERN_C XS(boot_Doors); @@ -90,6 +91,7 @@ EXTERN_C void xs_init(pTHX) newXS(strcpy(buf, "Raid::boot_Raid"), boot_Raid, file); newXS(strcpy(buf, "Inventory::boot_Inventory"), boot_Inventory, file); newXS(strcpy(buf, "QuestItem::boot_QuestItem"), boot_QuestItem, file); + newXS(strcpy(buf, "Spell::boot_Spell"), boot_Spell, file); newXS(strcpy(buf, "HateEntry::boot_HateEntry"), boot_HateEntry, file); newXS(strcpy(buf, "Object::boot_Object"), boot_Object, file); newXS(strcpy(buf, "Doors::boot_Doors"), boot_Doors, file); diff --git a/zone/groups.cpp b/zone/groups.cpp index 13188dcb9..aa4fc857a 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -824,7 +824,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { if(members[z] == caster) { caster->SpellOnTarget(spell_id, caster); #ifdef GROUP_BUFF_PETS - if(spells[spell_id].targettype != ST_GroupNoPets && caster->GetPet() && caster->HasPetAffinity() && !caster->GetPet()->IsCharmed()) + if(spells[spell_id].target_type != ST_GroupNoPets && caster->GetPet() && caster->HasPetAffinity() && !caster->GetPet()->IsCharmed()) caster->SpellOnTarget(spell_id, caster->GetPet()); #endif } @@ -835,7 +835,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { members[z]->CalcSpellPowerDistanceMod(spell_id, distance); caster->SpellOnTarget(spell_id, members[z]); #ifdef GROUP_BUFF_PETS - if(spells[spell_id].targettype != ST_GroupNoPets && members[z]->GetPet() && members[z]->HasPetAffinity() && !members[z]->GetPet()->IsCharmed()) + if(spells[spell_id].target_type != ST_GroupNoPets && members[z]->GetPet() && members[z]->HasPetAffinity() && !members[z]->GetPet()->IsCharmed()) caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 57a426516..af3cc0e4b 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -19,6 +19,7 @@ #include "lua_npc.h" #include "lua_entity_list.h" #include "lua_expedition.h" +#include "lua_spell.h" #include "quest_parser_collection.h" #include "questmgr.h" #include "qglobals.h" @@ -1452,6 +1453,10 @@ Lua_ItemInst lua_get_quest_item() { return quest_manager.GetQuestItem(); } +Lua_Spell lua_get_quest_spell() { + return quest_manager.GetQuestSpell(); +} + std::string lua_get_encounter() { return quest_manager.GetEncounter(); } @@ -3342,6 +3347,10 @@ uint32 lua_count_spawned_npcs(luabind::adl::object table) { return entity_list.CountSpawnedNPCs(npc_ids); } +Lua_Spell lua_get_spell(uint32 spell_id) { + return Lua_Spell(spell_id); +} + #define LuaCreateNPCParse(name, c_type, default_value) do { \ cur = table[#name]; \ if(luabind::type(cur) != LUA_TNIL) { \ @@ -3750,6 +3759,7 @@ luabind::scope lua_register_general() { luabind::def("get_initiator", &lua_get_initiator), luabind::def("get_owner", &lua_get_owner), luabind::def("get_quest_item", &lua_get_quest_item), + luabind::def("get_quest_spell", &lua_get_quest_spell), luabind::def("get_encounter", &lua_get_encounter), luabind::def("map_opcodes", &lua_map_opcodes), luabind::def("clear_opcode", &lua_clear_opcode), @@ -3783,6 +3793,7 @@ luabind::scope lua_register_general() { luabind::def("get_spell_stat", (int(*)(uint32,std::string,uint8))&lua_get_spell_stat), luabind::def("is_npc_spawned", &lua_is_npc_spawned), luabind::def("count_spawned_npcs", &lua_count_spawned_npcs), + luabind::def("get_spell", &lua_get_spell), /* Cross Zone diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 181a7dde5..ed201ec9c 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -1891,9 +1891,9 @@ void Lua_Mob::WearChange(int material_slot, int texture, uint32 color) { self->WearChange(material_slot, texture, color); } -void Lua_Mob::DoKnockback(Lua_Mob caster, uint32 pushback, uint32 pushup) { +void Lua_Mob::DoKnockback(Lua_Mob caster, uint32 push_back, uint32 push_up) { Lua_Safe_Call_Void(); - self->DoKnockback(caster, pushback, pushup); + self->DoKnockback(caster, push_back, push_up); } void Lua_Mob::AddNimbusEffect(int effect_id) { diff --git a/zone/lua_mob.h b/zone/lua_mob.h index 144d9dbb5..e2e964b3b 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -362,7 +362,7 @@ public: void DelGlobal(const char *varname); void SetSlotTint(int material_slot, int red_tint, int green_tint, int blue_tint); void WearChange(int material_slot, int texture, uint32 color); - void DoKnockback(Lua_Mob caster, uint32 pushback, uint32 pushup); + void DoKnockback(Lua_Mob caster, uint32 push_back, uint32 push_up); void AddNimbusEffect(int effect_id); void RemoveNimbusEffect(int effect_id); void RemoveAllNimbusEffects(); diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index a1aee9a41..2b1f89574 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -327,7 +327,7 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M arg_function(this, L, npc, init, data, extra_data, extra_pointers); Client *c = (init && init->IsClient()) ? init->CastToClient() : nullptr; - quest_manager.StartQuest(npc, c, nullptr); + quest_manager.StartQuest(npc, c); if(lua_pcall(L, 1, 1, 0)) { std::string error = lua_tostring(L, -1); AddError(error); @@ -420,7 +420,7 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client * auto arg_function = PlayerArgumentDispatch[evt]; arg_function(this, L, client, data, extra_data, extra_pointers); - quest_manager.StartQuest(client, client, nullptr); + quest_manager.StartQuest(client, client); if(lua_pcall(L, 1, 1, 0)) { std::string error = lua_tostring(L, -1); AddError(error); @@ -584,7 +584,7 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc, auto arg_function = SpellArgumentDispatch[evt]; arg_function(this, L, npc, client, spell_id, data, extra_data, extra_pointers); - quest_manager.StartQuest(npc, client, nullptr); + quest_manager.StartQuest(npc, client, nullptr, const_cast(&spells[spell_id])); if(lua_pcall(L, 1, 1, 0)) { std::string error = lua_tostring(L, -1); AddError(error); @@ -650,7 +650,7 @@ int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std:: auto arg_function = EncounterArgumentDispatch[evt]; arg_function(this, L, enc, data, extra_data, extra_pointers); - quest_manager.StartQuest(enc, nullptr, nullptr, encounter_name); + quest_manager.StartQuest(enc, nullptr, nullptr, nullptr, encounter_name); if(lua_pcall(L, 1, 1, 0)) { std::string error = lua_tostring(L, -1); AddError(error); diff --git a/zone/lua_spell.cpp b/zone/lua_spell.cpp index 5e7dcff73..4675f4415 100644 --- a/zone/lua_spell.cpp +++ b/zone/lua_spell.cpp @@ -66,17 +66,17 @@ float Lua_Spell::GetRange() { float Lua_Spell::GetAoeRange() { Lua_Safe_Call_Real(); - return self->aoerange; + return self->aoe_range; } float Lua_Spell::GetPushBack() { Lua_Safe_Call_Real(); - return self->pushback; + return self->push_back; } float Lua_Spell::GetPushUp() { Lua_Safe_Call_Real(); - return self->pushup; + return self->push_up; } uint32 Lua_Spell::GetCastTime() { @@ -96,17 +96,17 @@ uint32 Lua_Spell::GetRecastTime() { uint32 Lua_Spell::GetBuffdurationFormula() { Lua_Safe_Call_Int(); - return self->buffdurationformula; + return self->buff_duration_formula; } uint32 Lua_Spell::GetBuffDuration() { Lua_Safe_Call_Int(); - return self->buffduration; + return self->buff_duration; } uint32 Lua_Spell::GetAEDuration() { Lua_Safe_Call_Int(); - return self->AEDuration; + return self->aoe_duration; } int Lua_Spell::GetMana() { @@ -121,7 +121,7 @@ int Lua_Spell::GetBase(int i) { return 0; } - return self->base[i]; + return self->base_value[i]; } int Lua_Spell::GetBase2(int i) { @@ -131,7 +131,7 @@ int Lua_Spell::GetBase2(int i) { return 0; } - return self->base2[i]; + return self->limit_value[i]; } int Lua_Spell::GetMax(int i) { @@ -141,7 +141,7 @@ int Lua_Spell::GetMax(int i) { return 0; } - return self->max[i]; + return self->max_value[i]; } int Lua_Spell::GetComponents(int i) { @@ -151,7 +151,7 @@ int Lua_Spell::GetComponents(int i) { return 0; } - return self->components[i]; + return self->component[i]; } int Lua_Spell::GetComponentCounts(int i) { @@ -161,7 +161,7 @@ int Lua_Spell::GetComponentCounts(int i) { return 0; } - return self->component_counts[i]; + return self->component_count[i]; } int Lua_Spell::GetNoexpendReagent(int i) { @@ -171,7 +171,7 @@ int Lua_Spell::GetNoexpendReagent(int i) { return 0; } - return self->NoexpendReagent[i]; + return self->no_expend_reagent[i]; } int Lua_Spell::GetFormula(int i) { @@ -186,17 +186,17 @@ int Lua_Spell::GetFormula(int i) { int Lua_Spell::GetGoodEffect() { Lua_Safe_Call_Int(); - return self->goodEffect; + return self->good_effect; } int Lua_Spell::GetActivated() { Lua_Safe_Call_Int(); - return self->Activated; + return self->activated; } int Lua_Spell::GetResistType() { Lua_Safe_Call_Int(); - return self->resisttype; + return self->resist_type; } int Lua_Spell::GetEffectID(int i) { @@ -206,17 +206,17 @@ int Lua_Spell::GetEffectID(int i) { return 0; } - return self->effectid[i]; + return self->effect_id[i]; } int Lua_Spell::GetTargetType() { Lua_Safe_Call_Int(); - return self->targettype; + return self->target_type; } int Lua_Spell::GetBaseDiff() { Lua_Safe_Call_Int(); - return self->basediff; + return self->base_difficulty; } int Lua_Spell::GetSkill() { @@ -226,17 +226,17 @@ int Lua_Spell::GetSkill() { int Lua_Spell::GetZoneType() { Lua_Safe_Call_Int(); - return self->zonetype; + return self->zone_type; } int Lua_Spell::GetEnvironmentType() { Lua_Safe_Call_Int(); - return self->EnvironmentType; + return self->environment_type; } int Lua_Spell::GetTimeOfDay() { Lua_Safe_Call_Int(); - return self->TimeOfDay; + return self->time_of_day; } int Lua_Spell::GetClasses(int i) { @@ -251,12 +251,12 @@ int Lua_Spell::GetClasses(int i) { int Lua_Spell::GetCastingAnim() { Lua_Safe_Call_Int(); - return self->CastingAnim; + return self->casting_animation; } int Lua_Spell::GetSpellAffectIndex() { Lua_Safe_Call_Int(); - return self->SpellAffectIndex; + return self->spell_affect_index; } int Lua_Spell::GetDisallowSit() { @@ -281,12 +281,12 @@ int Lua_Spell::GetUninterruptable() { int Lua_Spell::GetResistDiff() { Lua_Safe_Call_Int(); - return self->ResistDiff; + return self->resist_difficulty; } int Lua_Spell::GetRecourseLink() { Lua_Safe_Call_Int(); - return self->RecourseLink; + return self->recourse_link; } int Lua_Spell::GetShortBuffBox() { @@ -296,57 +296,57 @@ int Lua_Spell::GetShortBuffBox() { int Lua_Spell::GetDescNum() { Lua_Safe_Call_Int(); - return self->descnum; + return self->description_id; } int Lua_Spell::GetEffectDescNum() { Lua_Safe_Call_Int(); - return self->effectdescnum; + return self->effect_description_id; } int Lua_Spell::GetBonusHate() { Lua_Safe_Call_Int(); - return self->bonushate; + return self->bonus_hate; } int Lua_Spell::GetEndurCost() { Lua_Safe_Call_Int(); - return self->EndurCost; + return self->endurance_cost; } int Lua_Spell::GetEndurTimerIndex() { Lua_Safe_Call_Int(); - return self->EndurUpkeep; + return self->endurance_upkeep; } int Lua_Spell::GetHateAdded() { Lua_Safe_Call_Int(); - return self->HateAdded; + return self->hate_added; } int Lua_Spell::GetEndurUpkeep() { Lua_Safe_Call_Int(); - return self->EndurUpkeep; + return self->endurance_upkeep; } int Lua_Spell::GetNumHits() { Lua_Safe_Call_Int(); - return self->numhits; + return self->hit_number; } int Lua_Spell::GetPVPResistBase() { Lua_Safe_Call_Int(); - return self->pvpresistbase; + return self->pvp_resist_base; } int Lua_Spell::GetPVPResistCalc() { Lua_Safe_Call_Int(); - return self->pvpresistcalc; + return self->pvp_resist_per_level; } int Lua_Spell::GetPVPResistCap() { Lua_Safe_Call_Int(); - return self->pvpresistcap; + return self->pvp_resist_cap; } int Lua_Spell::GetSpellCategory() { @@ -376,12 +376,12 @@ int Lua_Spell::GetDispelFlag() { int Lua_Spell::GetMinResist() { Lua_Safe_Call_Int(); - return self->MinResist; + return self->min_resist; } int Lua_Spell::GetMaxResist() { Lua_Safe_Call_Int(); - return self->MaxResist; + return self->max_resist; } int Lua_Spell::GetViralTargets() { @@ -396,7 +396,7 @@ int Lua_Spell::GetViralTimer() { int Lua_Spell::GetNimbusEffect() { Lua_Safe_Call_Int(); - return self->NimbusEffect; + return self->nimbus_effect; } float Lua_Spell::GetDirectionalStart() { @@ -411,7 +411,7 @@ float Lua_Spell::GetDirectionalEnd() { int Lua_Spell::GetSpellGroup() { Lua_Safe_Call_Int(); - return self->spellgroup; + return self->spell_group; } int Lua_Spell::GetPowerfulFlag() { @@ -421,27 +421,27 @@ int Lua_Spell::GetPowerfulFlag() { int Lua_Spell::GetCastRestriction() { Lua_Safe_Call_Int(); - return self->CastRestriction; + return self->cast_restriction; } bool Lua_Spell::GetAllowRest() { Lua_Safe_Call_Bool(); - return self->AllowRest; + return self->allow_rest; } bool Lua_Spell::GetInCombat() { Lua_Safe_Call_Bool(); - return self->InCombat; + return self->can_cast_in_combat; } bool Lua_Spell::GetOutOfCombat() { Lua_Safe_Call_Bool(); - return self->OutofCombat; + return self->can_cast_out_of_combat; } int Lua_Spell::GetAEMaxTargets() { Lua_Safe_Call_Int(); - return self->aemaxtargets; + return self->aoe_max_targets; } int Lua_Spell::GetMaxTargets() { @@ -451,27 +451,27 @@ int Lua_Spell::GetMaxTargets() { bool Lua_Spell::GetPersistDeath() { Lua_Safe_Call_Bool(); - return self->persistdeath; + return self->persist_death; } float Lua_Spell::GetMinDist() { Lua_Safe_Call_Real(); - return self->min_dist; + return self->min_distance; } float Lua_Spell::GetMinDistMod() { Lua_Safe_Call_Real(); - return self->min_dist_mod; + return self->min_distance_mod; } float Lua_Spell::GetMaxDist() { Lua_Safe_Call_Real(); - return self->max_dist; + return self->max_distance; } float Lua_Spell::GetMaxDistMod() { Lua_Safe_Call_Real(); - return self->max_dist_mod; + return self->max_distance_mod; } float Lua_Spell::GetMinRange() { @@ -481,7 +481,7 @@ float Lua_Spell::GetMinRange() { int Lua_Spell::GetDamageShieldType() { Lua_Safe_Call_Int(); - return self->DamageShieldType; + return self->damage_shield_type; } int Lua_Spell::GetRank() { diff --git a/zone/merc.cpp b/zone/merc.cpp index 2a68e8907..306c1aeec 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1117,7 +1117,7 @@ void Merc::DoEnduranceUpkeep() { uint32 buff_count = GetMaxTotalSlots(); for (buffs_i = 0; buffs_i < buff_count; buffs_i++) { if (buffs[buffs_i].spellid != SPELL_UNKNOWN) { - int upkeep = spells[buffs[buffs_i].spellid].EndurUpkeep; + int upkeep = spells[buffs[buffs_i].spellid].endurance_upkeep; if(upkeep > 0) { has_effect = true; if(cost_redux > 0) { @@ -1982,11 +1982,11 @@ bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDon } else dist2 = DistanceSquared(m_Position, tar->GetPosition()); - if (((((spells[spellid].targettype==ST_GroupTeleport && mercSpell.type==SpellType_Heal) - || spells[spellid].targettype==ST_AECaster - || spells[spellid].targettype==ST_Group - || spells[spellid].targettype==ST_AEBard) - && dist2 <= spells[spellid].aoerange*spells[spellid].aoerange) + if (((((spells[spellid].target_type==ST_GroupTeleport && mercSpell.type==SpellType_Heal) + || spells[spellid].target_type==ST_AECaster + || spells[spellid].target_type==ST_Group + || spells[spellid].target_type==ST_AEBard) + && dist2 <= spells[spellid].aoe_range*spells[spellid].aoe_range) || dist2 <= GetActSpellRange(spellid, spells[spellid].range)*GetActSpellRange(spellid, spells[spellid].range)) && (mana_cost <= GetMana() || GetMana() == GetMaxMana())) { SetRunAnimSpeed(0); @@ -2007,8 +2007,8 @@ bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDon else { //handle spell recast and recast timers SetSpellTimeCanCast(mercSpell.spellid, spells[spellid].recast_time); - if(spells[spellid].EndurTimerIndex > 0) { - SetSpellRecastTimer(spells[spellid].EndurTimerIndex, spellid, spells[spellid].recast_time); + if(spells[spellid].timer_id > 0) { + SetSpellRecastTimer(spells[spellid].timer_id, spellid, spells[spellid].recast_time); } } @@ -2177,13 +2177,13 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) { itr != buffSpellList.end(); ++itr) { MercSpell selectedMercSpell = *itr; - if(!((spells[selectedMercSpell.spellid].targettype == ST_Target || spells[selectedMercSpell.spellid].targettype == ST_Pet || - spells[selectedMercSpell.spellid].targettype == ST_Group || spells[selectedMercSpell.spellid].targettype == ST_GroupTeleport || - spells[selectedMercSpell.spellid].targettype == ST_Self))) { + if(!((spells[selectedMercSpell.spellid].target_type == ST_Target || spells[selectedMercSpell.spellid].target_type == ST_Pet || + spells[selectedMercSpell.spellid].target_type == ST_Group || spells[selectedMercSpell.spellid].target_type == ST_GroupTeleport || + spells[selectedMercSpell.spellid].target_type == ST_Self))) { continue; } - if(spells[selectedMercSpell.spellid].targettype == ST_Self) { + if(spells[selectedMercSpell.spellid].target_type == ST_Self) { if( !this->IsImmuneToSpell(selectedMercSpell.spellid, this) && (this->CanBuffStack(selectedMercSpell.spellid, mercLevel, true) >= 0)) { @@ -2237,8 +2237,8 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) { //don't cast group spells on pets if(IsGroupSpell(selectedMercSpell.spellid) - || spells[selectedMercSpell.spellid].targettype == ST_Group - || spells[selectedMercSpell.spellid].targettype == ST_GroupTeleport ) { + || spells[selectedMercSpell.spellid].target_type == ST_Group + || spells[selectedMercSpell.spellid].target_type == ST_GroupTeleport ) { continue; } @@ -2337,11 +2337,11 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) { itr != buffSpellList.end(); ++itr) { MercSpell selectedMercSpell = *itr; - if(!(spells[selectedMercSpell.spellid].targettype == ST_Self)) { + if(!(spells[selectedMercSpell.spellid].target_type == ST_Self)) { continue; } - if (spells[selectedMercSpell.spellid].skill == EQ::skills::SkillBackstab && spells[selectedMercSpell.spellid].targettype == ST_Self) { + if (spells[selectedMercSpell.spellid].skill == EQ::skills::SkillBackstab && spells[selectedMercSpell.spellid].target_type == ST_Self) { if(!hidden) { continue; } @@ -2535,7 +2535,7 @@ bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTarget for (auto itr = npc_list.begin(); itr != npc_list.end(); ++itr) { NPC* npc = *itr; - if(DistanceSquaredNoZ(npc->GetPosition(), tar->GetPosition()) <= spells[spell_id].aoerange * spells[spell_id].aoerange) { + if(DistanceSquaredNoZ(npc->GetPosition(), tar->GetPosition()) <= spells[spell_id].aoe_range * spells[spell_id].aoe_range) { if(!npc->IsMezzed()) { numTargets++; } @@ -2667,7 +2667,7 @@ int32 Merc::GetFocusEffect(focusType type, uint16 spell_id) { realTotal2 = CalcFocusEffect(type, focusspell_tracker, spell_id); // For effects like gift of mana that only fire once, save the spellid into an array that consists of all available buff slots. - if(buff_tracker >= 0 && buffs[buff_tracker].numhits > 0) { + if(buff_tracker >= 0 && buffs[buff_tracker].hit_number > 0) { m_spellHitsLeft[buff_tracker] = focusspell_tracker; } } @@ -3047,7 +3047,7 @@ std::list Merc::GetMercSpellsForSpellEffectAndTargetType(Merc* caster } if(IsEffectInSpell(mercSpellList[i].spellid, spellEffect) && caster->CheckStance(mercSpellList[i].stance)) { - if(spells[mercSpellList[i].spellid].targettype == targetType) { + if(spells[mercSpellList[i].spellid].target_type == targetType) { MercSpell MercSpell; MercSpell.spellid = mercSpellList[i].spellid; MercSpell.stance = mercSpellList[i].stance; @@ -3395,9 +3395,9 @@ MercSpell Merc::GetBestMercSpellForAETaunt(Merc* caster) { for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) { // Assuming all the spells have been loaded into this list by level and in descending order - if((spells[mercSpellListItr->spellid].targettype == ST_AECaster - || spells[mercSpellListItr->spellid].targettype == ST_AETarget - || spells[mercSpellListItr->spellid].targettype == ST_UndeadAE) + if((spells[mercSpellListItr->spellid].target_type == ST_AECaster + || spells[mercSpellListItr->spellid].target_type == ST_AETarget + || spells[mercSpellListItr->spellid].target_type == ST_UndeadAE) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) { result.spellid = mercSpellListItr->spellid; result.stance = mercSpellListItr->stance; @@ -3430,7 +3430,7 @@ MercSpell Merc::GetBestMercSpellForTaunt(Merc* caster) { for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) { // Assuming all the spells have been loaded into this list by level and in descending order - if((spells[mercSpellListItr->spellid].targettype == ST_Target) + if((spells[mercSpellListItr->spellid].target_type == ST_Target) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) { result.spellid = mercSpellListItr->spellid; result.stance = mercSpellListItr->stance; @@ -3900,22 +3900,22 @@ MercSpell Merc::GetBestMercSpellForNukeByTargetResists(Merc* caster, Mob* target // Assuming all the spells have been loaded into this list by level and in descending order if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) { - if(selectLureNuke && (spells[mercSpellListItr->spellid].ResistDiff < lureResisValue)) { + if(selectLureNuke && (spells[mercSpellListItr->spellid].resist_difficulty < lureResisValue)) { spellSelected = true; } else { if(((target->GetMR() < target->GetCR()) || (target->GetMR() < target->GetFR())) && (GetSpellResistType(mercSpellListItr->spellid) == RESIST_MAGIC) - && (spells[mercSpellListItr->spellid].ResistDiff > lureResisValue)) + && (spells[mercSpellListItr->spellid].resist_difficulty > lureResisValue)) { spellSelected = true; } else if(((target->GetCR() < target->GetMR()) || (target->GetCR() < target->GetFR())) && (GetSpellResistType(mercSpellListItr->spellid) == RESIST_COLD) - && (spells[mercSpellListItr->spellid].ResistDiff > lureResisValue)) + && (spells[mercSpellListItr->spellid].resist_difficulty > lureResisValue)) { spellSelected = true; } else if(((target->GetFR() < target->GetCR()) || (target->GetFR() < target->GetMR())) && (GetSpellResistType(mercSpellListItr->spellid) == RESIST_FIRE) - && (spells[mercSpellListItr->spellid].ResistDiff > lureResisValue)) + && (spells[mercSpellListItr->spellid].resist_difficulty > lureResisValue)) { spellSelected = true; } @@ -4003,9 +4003,9 @@ bool Merc::UseDiscipline(int32 spell_id, int32 target) { if(spell.recast_time > 0) { - if(CheckDisciplineRecastTimers(this, spell_id, spells[spell_id].EndurTimerIndex)) { - if(spells[spell_id].EndurTimerIndex > 0) { - SetDisciplineRecastTimer(spells[spell_id].EndurTimerIndex, spell_id, spell.recast_time); + if(CheckDisciplineRecastTimers(this, spell_id, spells[spell_id].timer_id)) { + if(spells[spell_id].timer_id > 0) { + SetDisciplineRecastTimer(spells[spell_id].timer_id, spell_id, spell.recast_time); } SetSpellTimeCanCast(spell_id, spells[spell_id].recast_time); @@ -4015,8 +4015,8 @@ bool Merc::UseDiscipline(int32 spell_id, int32 target) { } } - if(GetEndurance() > spell.EndurCost) { - SetEndurance(GetEndurance() - spell.EndurCost); + if(GetEndurance() > spell.endurance_cost) { + SetEndurance(GetEndurance() - spell.endurance_cost); } else { //too fatigued to use this skill right now. return(false); @@ -4055,7 +4055,7 @@ bool Merc::CheckSpellRecastTimers(Merc *caster, uint16 spell_id) { if(caster) { MercSpell mercSpell = GetMercSpellBySpellID(caster, spell_id); if(mercSpell.spellid > 0 && mercSpell.time_cancast < Timer::GetCurrentTime()) { //checks spell recast - if(GetSpellRecastTimer(caster, spells[spell_id].EndurTimerIndex) < Timer::GetCurrentTime()) { //checks for spells on the same timer + if(GetSpellRecastTimer(caster, spells[spell_id].timer_id) < Timer::GetCurrentTime()) { //checks for spells on the same timer return true; //can cast spell } } diff --git a/zone/mob.cpp b/zone/mob.cpp index a60a9f563..1c5752d9a 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1672,7 +1672,7 @@ void Mob::ShowBuffs(Client* client) { uint32 buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) { if (buffs[i].spellid != SPELL_UNKNOWN) { - if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) + if (spells[buffs[i].spellid].buff_duration_formula == DF_Permanent) client->Message(Chat::White, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); else client->Message(Chat::White, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); @@ -1706,7 +1706,7 @@ void Mob::ShowBuffList(Client* client) { uint32 buff_count = GetMaxTotalSlots(); for (i = 0; i < buff_count; i++) { if (buffs[i].spellid != SPELL_UNKNOWN) { - if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) + if (spells[buffs[i].spellid].buff_duration_formula == DF_Permanent) client->Message(Chat::White, " %i: %s: Permanent", i, spells[buffs[i].spellid].name); else client->Message(Chat::White, " %i: %s: %i tics left", i, spells[buffs[i].spellid].name, buffs[i].ticsremaining); @@ -2283,11 +2283,11 @@ void Mob::CameraEffect(uint32 duration, uint32 intensity, Client *c, bool global safe_delete(outapp); } -void Mob::SendSpellEffect(uint32 effectid, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect, Client *c) { +void Mob::SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect, Client *c) { auto outapp = new EQApplicationPacket(OP_SpellEffect, sizeof(SpellEffect_Struct)); SpellEffect_Struct* se = (SpellEffect_Struct*) outapp->pBuffer; - se->EffectID = effectid; // ID of the Particle Effect + se->EffectID = effect_id; // ID of the Particle Effect se->EntityID = GetID(); se->EntityID2 = GetID(); // EntityID again se->Duration = duration; // In Milliseconds @@ -2307,8 +2307,8 @@ void Mob::SendSpellEffect(uint32 effectid, uint32 duration, uint32 finish_delay, safe_delete(outapp); if (perm_effect) { - if(!IsNimbusEffectActive(effectid)) { - SetNimbusEffect(effectid); + if(!IsNimbusEffectActive(effect_id)) { + SetNimbusEffect(effect_id); } } @@ -3149,7 +3149,7 @@ int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) int32 cast_reducer_amt = GetFocusEffect(focusFcCastTimeAmt, spell_id); int32 cast_reducer_no_limit = GetFocusEffect(focusFcCastTimeMod2, spell_id); - if (level > 50 && casttime >= 3000 && !spells[spell_id].goodEffect && + if (level > 50 && casttime >= 3000 && !spells[spell_id].good_effect && (GetClass() == RANGER || GetClass() == SHADOWKNIGHT || GetClass() == PALADIN || GetClass() == BEASTLORD)) { int level_mod = std::min(15, GetLevel() - 50); cast_reducer += level_mod * 3; @@ -3209,12 +3209,12 @@ void Mob::ExecWeaponProc(const EQ::ItemInstance *inst, uint16 spell_id, Mob *on, twinproc = true; if (IsBeneficialSpell(spell_id) && (!IsNPC() || (IsNPC() && CastToNPC()->GetInnateProcSpellID() != spell_id))) { // NPC innate procs don't take this path ever - SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff, true, level_override); + SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty, true, level_override); if(twinproc) SpellOnTarget(spell_id, this, 0, false, 0, true, level_override); } else if(!(on->IsClient() && on->CastToClient()->dead)) { //dont proc on dead clients - SpellFinished(spell_id, on, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff, true, level_override); + SpellFinished(spell_id, on, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty, true, level_override); if(twinproc) SpellOnTarget(spell_id, on, 0, false, 0, true, level_override); } @@ -3384,10 +3384,10 @@ int Mob::CountDispellableBuffs() if(buffs[x].counters) continue; - if(spells[buffs[x].spellid].goodEffect == 0) + if(spells[buffs[x].spellid].good_effect == 0) continue; - if(buffs[x].spellid != SPELL_UNKNOWN && spells[buffs[x].spellid].buffdurationformula != DF_Permanent) + if(buffs[x].spellid != SPELL_UNKNOWN && spells[buffs[x].spellid].buff_duration_formula != DF_Permanent) val++; } return val; @@ -3406,9 +3406,9 @@ int Mob::GetSnaredAmount() for(int j = 0; j < EFFECT_COUNT; j++) { - if (spells[buffs[i].spellid].effectid[j] == SE_MovementSpeed) + if (spells[buffs[i].spellid].effect_id[j] == SE_MovementSpeed) { - int val = CalcSpellEffectValue_formula(spells[buffs[i].spellid].formula[j], spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); + int val = CalcSpellEffectValue_formula(spells[buffs[i].spellid].formula[j], spells[buffs[i].spellid].base_value[j], spells[buffs[i].spellid].max_value[j], buffs[i].casterlevel, buffs[i].spellid); //int effect = CalcSpellEffectValue(buffs[i].spellid, spells[buffs[i].spellid].effectid[j], buffs[i].casterlevel); if (val < 0 && std::abs(val) > worst_snare) worst_snare = std::abs(val); @@ -3545,8 +3545,8 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect) for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_SpellTrigger || spells[spell_id].effectid[i] == SE_Chance_Best_in_Spell_Grp) - total_chance += spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_SpellTrigger || spells[spell_id].effect_id[i] == SE_Chance_Best_in_Spell_Grp) + total_chance += spells[spell_id].base_value[i]; } if (total_chance == 100) @@ -3556,9 +3556,9 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect) for (int i = 0; i < EFFECT_COUNT; i++){ //Find spells with SPA 340 and add the cummulative percent chances to the roll array - if ((spells[spell_id].effectid[i] == SE_SpellTrigger) || (spells[spell_id].effectid[i] == SE_Chance_Best_in_Spell_Grp)){ + if ((spells[spell_id].effect_id[i] == SE_SpellTrigger) || (spells[spell_id].effect_id[i] == SE_Chance_Best_in_Spell_Grp)){ - cummulative_chance = current_chance + spells[spell_id].base[i]; + cummulative_chance = current_chance + spells[spell_id].base_value[i]; chance_array[i] = cummulative_chance; current_chance = cummulative_chance; } @@ -3575,19 +3575,19 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect) } //If the chances don't add to 100, then each effect gets a chance to fire, chance for no trigger as well. - else if (zone->random.Roll(spells[spell_id].base[effect])) { + else if (zone->random.Roll(spells[spell_id].base_value[effect])) { CastSpell = true; //In this case effect_slot is what was passed into function. } if (CastSpell) { - if (spells[spell_id].effectid[effect_slot] == SE_SpellTrigger && IsValidSpell(spells[spell_id].base2[effect_slot])) { - SpellFinished(spells[spell_id].base2[effect_slot], target, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].base2[effect_slot]].ResistDiff); + if (spells[spell_id].effect_id[effect_slot] == SE_SpellTrigger && IsValidSpell(spells[spell_id].limit_value[effect_slot])) { + SpellFinished(spells[spell_id].limit_value[effect_slot], target, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].limit_value[effect_slot]].resist_difficulty); return true; } - else if (IsClient() & spells[spell_id].effectid[effect_slot] == SE_Chance_Best_in_Spell_Grp) { - uint32 best_spell_id = CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].base2[effect_slot]); + else if (IsClient() & spells[spell_id].effect_id[effect_slot] == SE_Chance_Best_in_Spell_Grp) { + uint32 best_spell_id = CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].limit_value[effect_slot]); if (IsValidSpell(best_spell_id)) { - SpellFinished(best_spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[best_spell_id].ResistDiff); + SpellFinished(best_spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[best_spell_id].resist_difficulty); } return true;//Do nothing if you don't have the any spell in spell group scribed. } @@ -3604,9 +3604,9 @@ void Mob::TryTriggerOnCastRequirement() int spell_id = buffs[e].spellid; if (IsValidSpell(spell_id)) { for (int i = 0; i < EFFECT_COUNT; i++) { - if ((spells[spell_id].effectid[i] == SE_TriggerOnReqTarget) || (spells[spell_id].effectid[i] == SE_TriggerOnReqCaster)) { - if (PassCastRestriction(spells[spell_id].base2[i])) { - SpellFinished(spells[spell_id].base[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + if ((spells[spell_id].effect_id[i] == SE_TriggerOnReqTarget) || (spells[spell_id].effect_id[i] == SE_TriggerOnReqCaster)) { + if (PassCastRestriction(spells[spell_id].limit_value[i])) { + SpellFinished(spells[spell_id].base_value[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); if (!TryFadeEffect(e)) { BuffFadeBySlot(e); } @@ -3633,7 +3633,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id) if(zone->random.Roll(focus)) { Message(Chat::Spells,"You twincast %s!", spells[spell_id].name); - SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } } } @@ -3651,7 +3651,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id) { if(zone->random.Roll(focus)) { - SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } } } @@ -3672,9 +3672,9 @@ void Mob::TryOnSpellFinished(Mob *caster, Mob *target, uint16 spell_id) if (IsEffectInSpell(spell_id, SE_Health_Transfer)){ for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_Health_Transfer) { + if (spells[spell_id].effect_id[i] == SE_Health_Transfer) { int new_hp = GetMaxHP(); - new_hp -= GetMaxHP() * spells[spell_id].base[i] / 1000; + new_hp -= GetMaxHP() * spells[spell_id].base_value[i] / 1000; if (new_hp > 0) SetHP(new_hp); @@ -3930,13 +3930,13 @@ bool Mob::TryFadeEffect(int slot) for(int i = 0; i < EFFECT_COUNT; i++) { - if (!spells[buffs[slot].spellid].effectid[i]) + if (!spells[buffs[slot].spellid].effect_id[i]) continue; - if (spells[buffs[slot].spellid].effectid[i] == SE_CastOnFadeEffectAlways || - spells[buffs[slot].spellid].effectid[i] == SE_CastOnRuneFadeEffect) + if (spells[buffs[slot].spellid].effect_id[i] == SE_CastOnFadeEffectAlways || + spells[buffs[slot].spellid].effect_id[i] == SE_CastOnRuneFadeEffect) { - uint16 spell_id = spells[buffs[slot].spellid].base[i]; + uint16 spell_id = spells[buffs[slot].spellid].base_value[i]; BuffFadeBySlot(slot); if(spell_id) @@ -3948,10 +3948,10 @@ bool Mob::TryFadeEffect(int slot) if(IsValidSpell(spell_id)) { if (IsBeneficialSpell(spell_id)) { - SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } else if(!(IsClient() && CastToClient()->dead)) { - SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } return true; } @@ -3985,7 +3985,7 @@ void Mob::TrySympatheticProc(Mob *target, uint32 spell_id) SpellFinished(focus_trigger, target); else - SpellFinished(focus_trigger, this, EQ::spells::CastingSlot::Item, 0, -1, spells[focus_trigger].ResistDiff); + SpellFinished(focus_trigger, this, EQ::spells::CastingSlot::Item, 0, -1, spells[focus_trigger].resist_difficulty); } // For detrimental spells, if the triggered spell is beneficial, then it will land on the caster // if the triggered spell is also detrimental, then it will land on the target @@ -3995,7 +3995,7 @@ void Mob::TrySympatheticProc(Mob *target, uint32 spell_id) SpellFinished(focus_trigger, this); else - SpellFinished(focus_trigger, target, EQ::spells::CastingSlot::Item, 0, -1, spells[focus_trigger].ResistDiff); + SpellFinished(focus_trigger, target, EQ::spells::CastingSlot::Item, 0, -1, spells[focus_trigger].resist_difficulty); } CheckNumHitsRemaining(NumHit::MatchingSpells, -1, focus_spell); @@ -4260,7 +4260,7 @@ int Mob::QGVarDuration(const char *fmt) return duration; } -void Mob::DoKnockback(Mob *caster, uint32 pushback, uint32 pushup) +void Mob::DoKnockback(Mob *caster, uint32 push_back, uint32 push_up) { if(IsClient()) { @@ -4275,8 +4275,8 @@ void Mob::DoKnockback(Mob *caster, uint32 pushback, uint32 pushup) look_heading -= 360; //x and y are crossed mkay - double new_x = pushback * sin(double(look_heading * 3.141592 / 180.0)); - double new_y = pushback * cos(double(look_heading * 3.141592 / 180.0)); + double new_x = push_back * sin(double(look_heading * 3.141592 / 180.0)); + double new_y = push_back * cos(double(look_heading * 3.141592 / 180.0)); spu->spawn_id = GetID(); spu->x_pos = FloatToEQ19(GetX()); @@ -4284,7 +4284,7 @@ void Mob::DoKnockback(Mob *caster, uint32 pushback, uint32 pushup) spu->z_pos = FloatToEQ19(GetZ()); spu->delta_x = FloatToEQ13(static_cast(new_x)); spu->delta_y = FloatToEQ13(static_cast(new_y)); - spu->delta_z = FloatToEQ13(static_cast(pushup)); + spu->delta_z = FloatToEQ13(static_cast(push_up)); spu->heading = FloatToEQ12(GetHeading()); // for ref: these were not passed on to other 5 clients while on Titanium standard (change to RoF2 standard: 11/16/2019) //eq->padding0002 = 0; @@ -4305,12 +4305,12 @@ void Mob::TrySpellOnKill(uint8 level, uint16 spell_id) { if(IsEffectInSpell(spell_id, SE_ProcOnSpellKillShot)) { for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_ProcOnSpellKillShot) + if (spells[spell_id].effect_id[i] == SE_ProcOnSpellKillShot) { - if (IsValidSpell(spells[spell_id].base2[i]) && spells[spell_id].max[i] <= level) + if (IsValidSpell(spells[spell_id].limit_value[i]) && spells[spell_id].max_value[i] <= level) { - if(zone->random.Roll(spells[spell_id].base[i])) - SpellFinished(spells[spell_id].base2[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff); + if(zone->random.Roll(spells[spell_id].base_value[i])) + SpellFinished(spells[spell_id].limit_value[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].limit_value[i]].resist_difficulty); } } } @@ -4325,17 +4325,17 @@ void Mob::TrySpellOnKill(uint8 level, uint16 spell_id) if(aabonuses.SpellOnKill[i] && IsValidSpell(aabonuses.SpellOnKill[i]) && (level >= aabonuses.SpellOnKill[i + 2])) { if(zone->random.Roll(static_cast(aabonuses.SpellOnKill[i + 1]))) - SpellFinished(aabonuses.SpellOnKill[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff); + SpellFinished(aabonuses.SpellOnKill[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnKill[i]].resist_difficulty); } if(itembonuses.SpellOnKill[i] && IsValidSpell(itembonuses.SpellOnKill[i]) && (level >= itembonuses.SpellOnKill[i + 2])){ if(zone->random.Roll(static_cast(itembonuses.SpellOnKill[i + 1]))) - SpellFinished(itembonuses.SpellOnKill[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff); + SpellFinished(itembonuses.SpellOnKill[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnKill[i]].resist_difficulty); } if(spellbonuses.SpellOnKill[i] && IsValidSpell(spellbonuses.SpellOnKill[i]) && (level >= spellbonuses.SpellOnKill[i + 2])) { if(zone->random.Roll(static_cast(spellbonuses.SpellOnKill[i + 1]))) - SpellFinished(spellbonuses.SpellOnKill[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnKill[i]].ResistDiff); + SpellFinished(spellbonuses.SpellOnKill[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnKill[i]].resist_difficulty); } } @@ -4352,19 +4352,19 @@ bool Mob::TrySpellOnDeath() for(int i = 0; i < MAX_SPELL_TRIGGER*2; i+=2) { if(IsClient() && aabonuses.SpellOnDeath[i] && IsValidSpell(aabonuses.SpellOnDeath[i])) { if(zone->random.Roll(static_cast(aabonuses.SpellOnDeath[i + 1]))) { - SpellFinished(aabonuses.SpellOnDeath[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnDeath[i]].ResistDiff); + SpellFinished(aabonuses.SpellOnDeath[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[aabonuses.SpellOnDeath[i]].resist_difficulty); } } if(itembonuses.SpellOnDeath[i] && IsValidSpell(itembonuses.SpellOnDeath[i])) { if(zone->random.Roll(static_cast(itembonuses.SpellOnDeath[i + 1]))) { - SpellFinished(itembonuses.SpellOnDeath[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[itembonuses.SpellOnDeath[i]].ResistDiff); + SpellFinished(itembonuses.SpellOnDeath[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[itembonuses.SpellOnDeath[i]].resist_difficulty); } } if(spellbonuses.SpellOnDeath[i] && IsValidSpell(spellbonuses.SpellOnDeath[i])) { if(zone->random.Roll(static_cast(spellbonuses.SpellOnDeath[i + 1]))) { - SpellFinished(spellbonuses.SpellOnDeath[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spellbonuses.SpellOnDeath[i]].ResistDiff); + SpellFinished(spellbonuses.SpellOnDeath[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spellbonuses.SpellOnDeath[i]].resist_difficulty); } } } @@ -4611,7 +4611,7 @@ void Mob::DoGravityEffect() { for (int i = 0; i < EFFECT_COUNT; i++) { - if(spells[buffs[slot].spellid].effectid[i] == SE_GravityEffect) { + if(spells[buffs[slot].spellid].effect_id[i] == SE_GravityEffect) { int casterId = buffs[slot].casterid; if(casterId) @@ -4623,7 +4623,7 @@ void Mob::DoGravityEffect() caster_x = caster->GetX(); caster_y = caster->GetY(); - value = static_cast(spells[buffs[slot].spellid].base[i]); + value = static_cast(spells[buffs[slot].spellid].base_value[i]); if(value == 0) continue; @@ -4683,33 +4683,33 @@ void Mob::DoGravityEffect() } } -void Mob::AddNimbusEffect(int effectid) +void Mob::AddNimbusEffect(int effect_id) { - SetNimbusEffect(effectid); + SetNimbusEffect(effect_id); auto outapp = new EQApplicationPacket(OP_AddNimbusEffect, sizeof(RemoveNimbusEffect_Struct)); auto ane = (RemoveNimbusEffect_Struct *)outapp->pBuffer; ane->spawnid = GetID(); - ane->nimbus_effect = effectid; + ane->nimbus_effect = effect_id; entity_list.QueueClients(this, outapp); safe_delete(outapp); } -void Mob::RemoveNimbusEffect(int effectid) +void Mob::RemoveNimbusEffect(int effect_id) { - if (effectid == nimbus_effect1) + if (effect_id == nimbus_effect1) nimbus_effect1 = 0; - else if (effectid == nimbus_effect2) + else if (effect_id == nimbus_effect2) nimbus_effect2 = 0; - else if (effectid == nimbus_effect3) + else if (effect_id == nimbus_effect3) nimbus_effect3 = 0; auto outapp = new EQApplicationPacket(OP_RemoveNimbusEffect, sizeof(RemoveNimbusEffect_Struct)); RemoveNimbusEffect_Struct* rne = (RemoveNimbusEffect_Struct*)outapp->pBuffer; rne->spawnid = GetID(); - rne->nimbus_effect = effectid; + rne->nimbus_effect = effect_id; entity_list.QueueClients(this, outapp); safe_delete(outapp); } @@ -4818,11 +4818,11 @@ void Mob::CastOnCurer(uint32 spell_id) { for(int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_CastOnCurer) + if (spells[spell_id].effect_id[i] == SE_CastOnCurer) { - if(IsValidSpell(spells[spell_id].base[i])) + if(IsValidSpell(spells[spell_id].base_value[i])) { - SpellFinished(spells[spell_id].base[i], this); + SpellFinished(spells[spell_id].base_value[i], this); } } } @@ -4832,11 +4832,11 @@ void Mob::CastOnCure(uint32 spell_id) { for(int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_CastOnCure) + if (spells[spell_id].effect_id[i] == SE_CastOnCure) { - if(IsValidSpell(spells[spell_id].base[i])) + if(IsValidSpell(spells[spell_id].base_value[i])) { - SpellFinished(spells[spell_id].base[i], this); + SpellFinished(spells[spell_id].base_value[i], this); } } } @@ -4849,11 +4849,11 @@ void Mob::CastOnNumHitFade(uint32 spell_id) for(int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_CastonNumHitFade) + if (spells[spell_id].effect_id[i] == SE_CastonNumHitFade) { - if(IsValidSpell(spells[spell_id].base[i])) + if(IsValidSpell(spells[spell_id].base_value[i])) { - SpellFinished(spells[spell_id].base[i], this); + SpellFinished(spells[spell_id].base_value[i], this); } } } @@ -4940,8 +4940,8 @@ bool Mob::PassLimitToSkill(uint16 spell_id, uint16 skill) { return false; for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spell_id].effectid[i] == SE_LimitToSkill){ - if (spells[spell_id].base[i] == skill){ + if (spells[spell_id].effect_id[i] == SE_LimitToSkill){ + if (spells[spell_id].base_value[i] == skill){ return true; } } @@ -4984,11 +4984,11 @@ int8 Mob::GetDecayEffectValue(uint16 spell_id, uint16 spelleffect) { for (int slot = 0; slot < buff_count; slot++){ if (IsValidSpell(buffs[slot].spellid)){ for (int i = 0; i < EFFECT_COUNT; i++){ - if(spells[buffs[slot].spellid].effectid[i] == spelleffect) { + if(spells[buffs[slot].spellid].effect_id[i] == spelleffect) { - int critchance = spells[buffs[slot].spellid].base[i]; - int decay = spells[buffs[slot].spellid].base2[i]; - int lvldiff = spell_level - spells[buffs[slot].spellid].max[i]; + int critchance = spells[buffs[slot].spellid].base_value[i]; + int decay = spells[buffs[slot].spellid].limit_value[i]; + int lvldiff = spell_level - spells[buffs[slot].spellid].max_value[i]; if(lvldiff > 0 && decay > 0) { @@ -5192,7 +5192,7 @@ FACTION_VALUE Mob::GetSpecialFactionCon(Mob* iOther) { } } -bool Mob::HasSpellEffect(int effectid) +bool Mob::HasSpellEffect(int effect_id) { int i; @@ -5201,7 +5201,7 @@ bool Mob::HasSpellEffect(int effectid) { if(buffs[i].spellid == SPELL_UNKNOWN) { continue; } - if(IsEffectInSpell(buffs[i].spellid, effectid)) + if(IsEffectInSpell(buffs[i].spellid, effect_id)) { return(1); } diff --git a/zone/mob.h b/zone/mob.h index 72ccb8447..c3da39e27 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -290,7 +290,7 @@ public: void BardPulse(uint16 spell_id, Mob *caster); //Spell - void SendSpellEffect(uint32 effectid, uint32 duration, uint32 finish_delay, bool zone_wide, + void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect = false, Client *c = nullptr); bool IsBeneficialAllowed(Mob *target); virtual int GetCasterLevel(uint16 spell_id); @@ -361,7 +361,7 @@ public: virtual void DoBuffTic(const Buffs_Struct &buff, int slot, Mob* caster = nullptr); void BuffFadeBySpellID(uint16 spell_id); void BuffFadeBySpellIDAndCaster(uint16 spell_id, uint16 caster_id); - void BuffFadeByEffect(int effectid, int skipslot = -1); + void BuffFadeByEffect(int effect_id, int skipslot = -1); void BuffFadeAll(); void BuffFadeNonPersistDeath(); void BuffFadeDetrimental(); @@ -412,8 +412,8 @@ public: inline virtual uint32 GetNimbusEffect1() const { return nimbus_effect1; } inline virtual uint32 GetNimbusEffect2() const { return nimbus_effect2; } inline virtual uint32 GetNimbusEffect3() const { return nimbus_effect3; } - void AddNimbusEffect(int effectid); - void RemoveNimbusEffect(int effectid); + void AddNimbusEffect(int effect_id); + void RemoveNimbusEffect(int effect_id); void RemoveAllNimbusEffects(); inline const glm::vec3& GetTargetRingLocation() const { return m_TargetRing; } inline float GetTargetRingX() const { return m_TargetRing.x; } @@ -814,7 +814,7 @@ public: int32 GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts = nullptr); int32 GetPositionalDmgTaken(Mob *attacker); int32 GetPositionalDmgTakenAmt(Mob *attacker); - void DoKnockback(Mob *caster, uint32 pushback, uint32 pushup); + void DoKnockback(Mob *caster, uint32 push_back, uint32 push_up); int16 CalcResistChanceBonus(); int16 CalcFearResistChance(); void TrySpellOnKill(uint8 level, uint16 spell_id); @@ -1117,7 +1117,7 @@ public: //uint32 GetInstrumentMod(uint16 spell_id) const; uint32 GetInstrumentMod(uint16 spell_id); int CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level = 1, uint32 instrument_mod = 10, Mob *caster = nullptr, int ticsremaining = 0,uint16 casterid=0); - int CalcSpellEffectValue_formula(int formula, int base, int max, int caster_level, uint16 spell_id, int ticsremaining = 0); + int CalcSpellEffectValue_formula(int formula, int base_value, int max_value, int caster_level, uint16 spell_id, int ticsremaining = 0); virtual int CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int caster_level2, Mob* caster1 = nullptr, Mob* caster2 = nullptr, int buffslot = -1); uint32 GetCastedSpellInvSlot() const { return casting_spell_inventory_slot; } @@ -1194,7 +1194,7 @@ public: inline void SetEmoteID(uint16 emote) { emoteid = emote; } inline uint16 GetEmoteID() { return emoteid; } - bool HasSpellEffect(int effectid); + bool HasSpellEffect(int effect_id); int mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id); float mod_hit_chance(float chancetohit, EQ::skills::SkillType skillinuse, Mob* attacker); float mod_riposte_chance(float ripostchance, Mob* attacker); diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 8e7b2bcd5..a7cb29947 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -115,11 +115,11 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates // should probably match that eventually. This should be good enough for now I guess .... if ( ( - (spells[AIspells[i].spellid].targettype == ST_HateList || spells[AIspells[i].spellid].targettype == ST_AETargetHateList) || + (spells[AIspells[i].spellid].target_type == ST_HateList || spells[AIspells[i].spellid].target_type == ST_AETargetHateList) || ( // note: I think this check is actually wrong and we should be checking range instead in all cases, BUT if range is 0, range check is skipped? Works for now - (spells[AIspells[i].spellid].targettype==ST_AECaster || spells[AIspells[i].spellid].targettype==ST_AEBard || spells[AIspells[i].spellid].targettype==ST_AEClientV1) - && dist2 <= spells[AIspells[i].spellid].aoerange*spells[AIspells[i].spellid].aoerange + (spells[AIspells[i].spellid].target_type==ST_AECaster || spells[AIspells[i].spellid].target_type==ST_AEBard || spells[AIspells[i].spellid].target_type==ST_AEClientV1) + && dist2 <= spells[AIspells[i].spellid].aoe_range*spells[AIspells[i].spellid].aoe_range ) || dist2 <= spells[AIspells[i].spellid].range*spells[AIspells[i].spellid].range ) @@ -135,7 +135,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates switch (AIspells[i].type) { case SpellType_Heal: { if ( - (spells[AIspells[i].spellid].targettype == ST_Target || tar == this) + (spells[AIspells[i].spellid].target_type == ST_Target || tar == this) && tar->DontHealMeBefore() < Timer::GetCurrentTime() && !(tar->IsPet() && tar->GetOwner()->IsClient()) //no buffing PC's pets ) { @@ -174,7 +174,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates } case SpellType_Buff: { if ( - (spells[AIspells[i].spellid].targettype == ST_Target || tar == this) + (spells[AIspells[i].spellid].target_type == ST_Target || tar == this) && tar->DontBuffMeBefore() < Timer::GetCurrentTime() && !tar->IsImmuneToSpell(AIspells[i].spellid, this) && tar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0 @@ -2497,7 +2497,7 @@ create table npc_spells_entries ( */ bool IsSpellInList(DBnpcspells_Struct* spell_list, uint16 iSpellID); -bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base, int32 limit, int32 max); +bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value); bool NPC::AI_AddNPCSpells(uint32 iDBSpellsID) { // ok, this function should load the list, and the parent list then shove them into the struct and sort @@ -2708,12 +2708,12 @@ bool NPC::AI_AddNPCSpellsEffects(uint32 iDBSpellsEffectsID) { if (parentlist) { for (i=0; inumentries; i++) { if (GetLevel() >= parentlist->entries[i].minlevel && GetLevel() <= parentlist->entries[i].maxlevel && parentlist->entries[i].spelleffectid > 0) { - if (!IsSpellEffectInList(spell_effects_list, parentlist->entries[i].spelleffectid, parentlist->entries[i].base, - parentlist->entries[i].limit, parentlist->entries[i].max)) + if (!IsSpellEffectInList(spell_effects_list, parentlist->entries[i].spelleffectid, parentlist->entries[i].base_value, + parentlist->entries[i].limit, parentlist->entries[i].max_value)) { AddSpellEffectToNPCList(parentlist->entries[i].spelleffectid, - parentlist->entries[i].base, parentlist->entries[i].limit, - parentlist->entries[i].max); + parentlist->entries[i].base_value, parentlist->entries[i].limit, + parentlist->entries[i].max_value); } } } @@ -2722,8 +2722,8 @@ bool NPC::AI_AddNPCSpellsEffects(uint32 iDBSpellsEffectsID) { for (i=0; inumentries; i++) { if (GetLevel() >= spell_effects_list->entries[i].minlevel && GetLevel() <= spell_effects_list->entries[i].maxlevel && spell_effects_list->entries[i].spelleffectid > 0) { AddSpellEffectToNPCList(spell_effects_list->entries[i].spelleffectid, - spell_effects_list->entries[i].base, spell_effects_list->entries[i].limit, - spell_effects_list->entries[i].max); + spell_effects_list->entries[i].base_value, spell_effects_list->entries[i].limit, + spell_effects_list->entries[i].max_value); } } @@ -2737,13 +2737,13 @@ void NPC::ApplyAISpellEffects(StatBonuses* newbon) for (int i = 0; i < AIspellsEffects.size(); i++) ApplySpellsBonuses(0, 0, newbon, 0, 0, 0, -1, 10, true, AIspellsEffects[i].spelleffectid, - AIspellsEffects[i].base, AIspellsEffects[i].limit, AIspellsEffects[i].max); + AIspellsEffects[i].base_value, AIspellsEffects[i].limit, AIspellsEffects[i].max_value); return; } // adds a spell to the list, taking into account priority and resorting list as needed. -void NPC::AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base, int32 limit, int32 max) +void NPC::AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value) { if(!iSpellEffectID) @@ -2753,16 +2753,16 @@ void NPC::AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base, int32 limit AISpellsEffects_Struct t; t.spelleffectid = iSpellEffectID; - t.base = base; + t.base_value = base_value; t.limit = limit; - t.max = max; + t.max_value = max_value; AIspellsEffects.push_back(t); } -bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base, int32 limit, int32 max) { +bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value) { for (uint32 i=0; i < spelleffect_list->numentries; i++) { - if (spelleffect_list->entries[i].spelleffectid == iSpellEffectID && spelleffect_list->entries[i].base == base - && spelleffect_list->entries[i].limit == limit && spelleffect_list->entries[i].max == max) + if (spelleffect_list->entries[i].spelleffectid == iSpellEffectID && spelleffect_list->entries[i].base_value == base_value + && spelleffect_list->entries[i].limit == limit && spelleffect_list->entries[i].max_value == max_value) return true; } return false; @@ -2922,7 +2922,7 @@ DBnpcspells_Struct *ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) if (row[9]) entry.resist_adjust = atoi(row[9]); else if (IsValidSpell(spell_id)) - entry.resist_adjust = spells[spell_id].ResistDiff; + entry.resist_adjust = spells[spell_id].resist_difficulty; spell_set.entries.push_back(entry); } @@ -3015,9 +3015,9 @@ DBnpcspellseffects_Struct *ZoneDatabase::GetNPCSpellsEffects(uint32 iDBSpellsEff npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].spelleffectid = spell_effect_id; npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].minlevel = atoi(row[1]); npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].maxlevel = atoi(row[2]); - npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].base = atoi(row[3]); + npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].base_value = atoi(row[3]); npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].limit = atoi(row[4]); - npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].max = atoi(row[5]); + npc_spellseffects_cache[iDBSpellsEffectsID]->entries[entryIndex].max_value = atoi(row[5]); } return npc_spellseffects_cache[iDBSpellsEffectsID]; diff --git a/zone/npc.cpp b/zone/npc.cpp index 3b635ca57..ef9932ba3 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1052,7 +1052,7 @@ void NPC::Depop(bool StartSpawnTimer) { bool NPC::DatabaseCastAccepted(int spell_id) { for (int i=0; i < EFFECT_COUNT; i++) { - switch(spells[spell_id].effectid[i]) { + switch(spells[spell_id].effect_id[i]) { case SE_Stamina: { if(IsEngaged() && GetHPRatio() < 100) return true; @@ -1062,7 +1062,7 @@ bool NPC::DatabaseCastAccepted(int spell_id) { } case SE_CurrentHPOnce: case SE_CurrentHP: { - if(this->GetHPRatio() < 100 && spells[spell_id].buffduration == 0) + if(this->GetHPRatio() < 100 && spells[spell_id].buff_duration == 0) return true; else return false; @@ -1095,7 +1095,7 @@ bool NPC::DatabaseCastAccepted(int spell_id) { break; } default: - if(spells[spell_id].goodEffect == 1 && !(spells[spell_id].buffduration == 0 && this->GetHPRatio() == 100) && !IsEngaged()) + if(spells[spell_id].good_effect == 1 && !(spells[spell_id].buff_duration == 0 && this->GetHPRatio() == 100) && !IsEngaged()) return true; return false; } diff --git a/zone/npc.h b/zone/npc.h index 2c43b79c1..6f0c221f4 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -70,9 +70,9 @@ struct AISpells_Struct { struct AISpellsEffects_Struct { uint16 spelleffectid; - int32 base; + int32 base_value; int32 limit; - int32 max; + int32 max_value; }; struct AISpellsVar_Struct { @@ -445,7 +445,7 @@ public: uint32 GetAdventureTemplate() const { return adventure_template_id; } void AddSpellToNPCList(int16 iPriority, uint16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp); - void AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base, int32 limit, int32 max); + void AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value); void RemoveSpellFromNPCList(uint16 spell_id); Timer *GetRefaceTimer() const { return reface_timer; } const uint32 GetAltCurrencyType() const { return NPCTypedata->alt_currency_type; } diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 4c32c5a87..f207b47b8 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -2800,7 +2800,7 @@ XS(XS_Mob_SpellFinished) { if (items > 4) { resist_diff = (int16) SvUV(ST(4)); } else { - resist_diff = spells[spell_id].ResistDiff; + resist_diff = spells[spell_id].resist_difficulty; } THIS->SpellFinished(spell_id, spell_target, EQ::spells::CastingSlot::Item, mana_cost, -1, resist_diff); @@ -2855,7 +2855,7 @@ XS(XS_Mob_BuffFadeByEffect) { Perl_croak(aTHX_ "Usage: Mob::BuffFadeByEffect(THIS, int effect_id, int skip_slot = -1)"); // @categories Script Utility, Spells and Disciplines { Mob *THIS; - int effectid = (int) SvIV(ST(1)); + int effect_id = (int) SvIV(ST(1)); int skipslot; VALIDATE_THIS_IS_MOB; if (items < 3) @@ -2864,7 +2864,7 @@ XS(XS_Mob_BuffFadeByEffect) { skipslot = (int) SvIV(ST(2)); } - THIS->BuffFadeByEffect(effectid, skipslot); + THIS->BuffFadeByEffect(effect_id, skipslot); } XSRETURN_EMPTY; } @@ -5093,8 +5093,8 @@ XS(XS_Mob_DoKnockback) { { Mob *THIS; Mob *caster; - uint32 pushback = (uint16) SvUV(ST(2)); - uint32 pushup = (uint16) SvUV(ST(2)); + uint32 push_back = (uint16) SvUV(ST(2)); + uint32 push_up = (uint16) SvUV(ST(2)); VALIDATE_THIS_IS_MOB; if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV *) SvRV(ST(1))); @@ -5104,7 +5104,7 @@ XS(XS_Mob_DoKnockback) { if (caster == nullptr) Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); - THIS->DoKnockback(caster, pushback, pushup); + THIS->DoKnockback(caster, push_back, push_up); } XSRETURN_EMPTY; } @@ -5116,9 +5116,9 @@ XS(XS_Mob_RemoveNimbusEffect) { Perl_croak(aTHX_ "Usage: Mob::RemoveNimbusEffect(THIS, int32 effect_id)"); // @categories Script Utility { Mob *THIS; - int32 effectid = (int32) SvIV(ST(1)); + int32 effect_id = (int32) SvIV(ST(1)); VALIDATE_THIS_IS_MOB; - THIS->RemoveNimbusEffect(effectid); + THIS->RemoveNimbusEffect(effect_id); } XSRETURN_EMPTY; } diff --git a/zone/perl_spell.cpp b/zone/perl_spell.cpp new file mode 100644 index 000000000..85aa27d05 --- /dev/null +++ b/zone/perl_spell.cpp @@ -0,0 +1,2138 @@ +#include "../common/features.h" + +#ifdef EMBPERL_XS_CLASSES + +#include "../common/global_define.h" +#include "embperl.h" + +#ifdef seed +#undef seed +#endif + +#include "../common/spdat.h" + +#ifdef THIS /* this macro seems to leak out on some systems */ +#undef THIS +#endif + +#define VALIDATE_THIS_IS_SPELL \ + do { \ + if (sv_derived_from(ST(0), "Spell")) { \ + IV tmp = SvIV((SV*)SvRV(ST(0))); \ + THIS = INT2PTR(SPDat_Spell_Struct*, tmp); \ + } else { \ + Perl_croak(aTHX_ "THIS is not of type SPDat_Spell_Struct"); \ + } \ + if (THIS == nullptr) { \ + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); \ + } \ + } while (0); + +XS(XS_Spell_GetActivated); +XS(XS_Spell_GetActivated) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetActivated(THIS)"); + { + SPDat_Spell_Struct* THIS; + int activated; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + activated = THIS->activated; + XSprePUSH; + PUSHi((IV) activated); + } + XSRETURN(1); +} + +XS(XS_Spell_GetAllowRest); +XS(XS_Spell_GetAllowRest) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetAllowRest(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool allow_rest; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + allow_rest = THIS->allow_rest; + ST(0) = boolSV(allow_rest); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetAOEDuration); +XS(XS_Spell_GetAOEDuration) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetAOEDuration(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint32 aoe_duration; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + aoe_duration = THIS->aoe_duration; + XSprePUSH; + PUSHu((UV) aoe_duration); + } + XSRETURN(1); +} + +XS(XS_Spell_GetAOEMaxTargets); +XS(XS_Spell_GetAOEMaxTargets) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetAOEMaxTargets(THIS)"); + { + SPDat_Spell_Struct* THIS; + int aoe_max_targets; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + aoe_max_targets = THIS->aoe_max_targets; + XSprePUSH; + PUSHi((IV) aoe_max_targets); + } + XSRETURN(1); +} + +XS(XS_Spell_GetAOERange); +XS(XS_Spell_GetAOERange) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetAOERange(THIS)"); + { + SPDat_Spell_Struct* THIS; + float aoe_range; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + aoe_range = THIS->aoe_range; + XSprePUSH; + PUSHn((double) aoe_range); + } + XSRETURN(1); +} + +XS(XS_Spell_GetBaseDifficulty); +XS(XS_Spell_GetBaseDifficulty) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetBaseDifficulty(THIS)"); + { + SPDat_Spell_Struct* THIS; + int base_difficulty; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + base_difficulty = THIS->base_difficulty; + XSprePUSH; + PUSHi((IV) base_difficulty); + } + XSRETURN(1); +} + +XS(XS_Spell_GetBaseValue); +XS(XS_Spell_GetBaseValue) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetBaseValue(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int base_value; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + base_value = THIS->base_value[slot]; + XSprePUSH; + PUSHi((IV) base_value); + } + XSRETURN(1); +} + +XS(XS_Spell_GetBonusHate); +XS(XS_Spell_GetBonusHate) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetBonusHate(THIS)"); + { + SPDat_Spell_Struct* THIS; + int bonus_hate; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + bonus_hate = THIS->bonus_hate; + XSprePUSH; + PUSHi((IV) bonus_hate); + } + XSRETURN(1); +} + +XS(XS_Spell_GetBuffDuration); +XS(XS_Spell_GetBuffDuration) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetBuffDuration(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint32 buff_duration; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + buff_duration = THIS->buff_duration; + XSprePUSH; + PUSHu((UV) buff_duration); + } + XSRETURN(1); +} + +XS(XS_Spell_GetBuffDurationFormula); +XS(XS_Spell_GetBuffDurationFormula) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetBuffDurationFormula(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint32 buff_duration_formula; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + buff_duration_formula = THIS->buff_duration_formula; + XSprePUSH; + PUSHu((UV) buff_duration_formula); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCanCastInCombat); +XS(XS_Spell_GetCanCastInCombat) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCanCastInCombat(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool can_cast_in_combat; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + can_cast_in_combat = THIS->can_cast_in_combat; + ST(0) = boolSV(can_cast_in_combat); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCanCastOutOfCombat); +XS(XS_Spell_GetCanCastOutOfCombat) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCanCastOutOfCombat(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool can_cast_out_of_combat; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + can_cast_out_of_combat = THIS->can_cast_out_of_combat; + ST(0) = boolSV(can_cast_out_of_combat); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCanMGB); +XS(XS_Spell_GetCanMGB) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCanMGB(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool can_mgb; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + can_mgb = THIS->can_mgb; + ST(0) = boolSV(can_mgb); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCastNotStanding); +XS(XS_Spell_GetCastNotStanding) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCastNotStanding(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool cast_not_standing; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + cast_not_standing = THIS->cast_not_standing; + ST(0) = boolSV(cast_not_standing); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCastOnOther); +XS(XS_Spell_GetCastOnOther) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCastOnOther(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string cast_on_other; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + cast_on_other = THIS->cast_on_other; + sv_setpv(TARG, cast_on_other.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetCastOnYou); +XS(XS_Spell_GetCastOnYou) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCastOnYou(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string cast_on_you; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + cast_on_you = THIS->cast_on_you; + sv_setpv(TARG, cast_on_you.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetCastRestriction); +XS(XS_Spell_GetCastRestriction) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCastRestriction(THIS)"); + { + SPDat_Spell_Struct* THIS; + int cast_restriction; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + cast_restriction = THIS->cast_restriction; + XSprePUSH; + PUSHi((IV) cast_restriction); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCastTime); +XS(XS_Spell_GetCastTime) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCastTime(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint32 cast_time; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + cast_time = THIS->cast_time; + XSprePUSH; + PUSHu((UV) cast_time); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCasterRequirementID); +XS(XS_Spell_GetCasterRequirementID) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCasterRequirementID(THIS)"); + { + SPDat_Spell_Struct* THIS; + int caster_requirement_id; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + caster_requirement_id = THIS->caster_requirement_id; + XSprePUSH; + PUSHi((IV) caster_requirement_id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetCastingAnimation); +XS(XS_Spell_GetCastingAnimation) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetCastingAnimation(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint8 casting_animation; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + casting_animation = THIS->casting_animation; + XSprePUSH; + PUSHu((UV) casting_animation); + } + XSRETURN(1); +} + +XS(XS_Spell_GetClasses); +XS(XS_Spell_GetClasses) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetClasses(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + uint8 classes; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + classes = THIS->classes[slot]; + XSprePUSH; + PUSHu((UV) classes); + } + XSRETURN(1); +} + +XS(XS_Spell_GetComponent); +XS(XS_Spell_GetComponent) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetComponent(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int component; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + component = THIS->component[slot]; + XSprePUSH; + PUSHi((IV) component); + } + XSRETURN(1); +} + +XS(XS_Spell_GetComponentCount); +XS(XS_Spell_GetComponentCount) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetComponentCount(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int component_count; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + component_count = THIS->component_count[slot]; + XSprePUSH; + PUSHi((IV) component_count); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDeities); +XS(XS_Spell_GetDeities) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetDeities(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int8 deities; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + deities = THIS->deities[slot]; + XSprePUSH; + PUSHi((IV) deities); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDeityAgnostic); +XS(XS_Spell_GetDeityAgnostic) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetDeityAgnostic(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 deity_agnostic; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + deity_agnostic = THIS->deity_agnostic; + XSprePUSH; + PUSHi((IV) deity_agnostic); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDescriptionID); +XS(XS_Spell_GetDescriptionID) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetDescriptionID(THIS)"); + { + SPDat_Spell_Struct* THIS; + int description_id; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + description_id = THIS->description_id; + XSprePUSH; + PUSHi((IV) description_id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDirectionalEnd); +XS(XS_Spell_GetDirectionalEnd) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetDirectionalEnd(THIS)"); + { + SPDat_Spell_Struct* THIS; + float directional_end; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + directional_end = THIS->directional_end; + XSprePUSH; + PUSHn((double) directional_end); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDirectionalStart); +XS(XS_Spell_GetDirectionalStart) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetDirectionalStart(THIS)"); + { + SPDat_Spell_Struct* THIS; + float directional_start; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + directional_start = THIS->directional_start; + XSprePUSH; + PUSHn((double) directional_start); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDisallowSit); +XS(XS_Spell_GetDisallowSit) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetDisallowSit(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 disallow_sit; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + disallow_sit = THIS->disallow_sit; + XSprePUSH; + PUSHi((IV) disallow_sit); + } + XSRETURN(1); +} + +XS(XS_Spell_GetDispelFlag); +XS(XS_Spell_GetDispelFlag) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetDispelFlag(THIS)"); + { + SPDat_Spell_Struct* THIS; + int dispel_flag; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + dispel_flag = THIS->dispel_flag; + XSprePUSH; + PUSHi((IV) dispel_flag); + } + XSRETURN(1); +} + +XS(XS_Spell_GetEffectDescriptionID); +XS(XS_Spell_GetEffectDescriptionID) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetEffectDescriptionID(THIS)"); + { + SPDat_Spell_Struct* THIS; + int effect_description_id; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + effect_description_id = THIS->effect_description_id; + XSprePUSH; + PUSHi((IV) effect_description_id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetEffectID); +XS(XS_Spell_GetEffectID) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetEffectID(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int effect_id; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + effect_id = THIS->effect_id[slot]; + XSprePUSH; + PUSHi((IV) effect_id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetEnduranceCost); +XS(XS_Spell_GetEnduranceCost) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetEnduranceCost(THIS)"); + { + SPDat_Spell_Struct* THIS; + int endurance_cost; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + endurance_cost = THIS->endurance_cost; + XSprePUSH; + PUSHi((IV) endurance_cost); + } + XSRETURN(1); +} + +XS(XS_Spell_GetEnduranceUpkeep); +XS(XS_Spell_GetEnduranceUpkeep) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetEnduranceUpkeep(THIS)"); + { + SPDat_Spell_Struct* THIS; + int endurance_upkeep; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + endurance_upkeep = THIS->endurance_upkeep; + XSprePUSH; + PUSHi((IV) endurance_upkeep); + } + XSRETURN(1); +} + +XS(XS_Spell_GetEnvironmentType); +XS(XS_Spell_GetEnvironmentType) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetEnvironmentType(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 environment_type; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + environment_type = THIS->environment_type; + XSprePUSH; + PUSHi((IV) environment_type); + } + XSRETURN(1); +} + +XS(XS_Spell_GetFeedbackable); +XS(XS_Spell_GetFeedbackable) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetFeedbackable(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool feedbackable; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + feedbackable = THIS->feedbackable; + ST(0) = boolSV(feedbackable); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetFormula); +XS(XS_Spell_GetFormula) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetFormula(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + uint16 formula; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + formula = THIS->formula[slot]; + XSprePUSH; + PUSHu((UV) formula); + } + XSRETURN(1); +} + +XS(XS_Spell_GetGoodEffect); +XS(XS_Spell_GetGoodEffect) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetGoodEffect(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 good_effect; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + good_effect = THIS->good_effect; + XSprePUSH; + PUSHi((IV) good_effect); + } + XSRETURN(1); +} + +XS(XS_Spell_GetHateAdded); +XS(XS_Spell_GetHateAdded) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetHateAdded(THIS)"); + { + SPDat_Spell_Struct* THIS; + int hate_added; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + hate_added = THIS->hate_added; + XSprePUSH; + PUSHi((IV) hate_added); + } + XSRETURN(1); +} + +XS(XS_Spell_GetHitNumber); +XS(XS_Spell_GetHitNumber) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetHitNumber(THIS)"); + { + SPDat_Spell_Struct* THIS; + int hit_number; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + hit_number = THIS->hit_number; + XSprePUSH; + PUSHi((IV) hit_number); + } + XSRETURN(1); +} + +XS(XS_Spell_GetHitNumberType); +XS(XS_Spell_GetHitNumberType) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetHitNumberType(THIS)"); + { + SPDat_Spell_Struct* THIS; + int hit_number_type; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + hit_number_type = THIS->hit_number_type; + XSprePUSH; + PUSHi((IV) hit_number_type); + } + XSRETURN(1); +} + +XS(XS_Spell_GetID); +XS(XS_Spell_GetID) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetID(THIS)"); + { + SPDat_Spell_Struct* THIS; + int id; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + id = THIS->id; + XSprePUSH; + PUSHi((IV) id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetIsDiscipline); +XS(XS_Spell_GetIsDiscipline) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetIsDiscipline(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool is_discipline; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + is_discipline = THIS->is_discipline; + ST(0) = boolSV(is_discipline); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetLDoNTrap); +XS(XS_Spell_GetLDoNTrap) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetLDoNTrap(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool ldon_trap; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + ldon_trap = THIS->ldon_trap; + ST(0) = boolSV(ldon_trap); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetLimitValue); +XS(XS_Spell_GetLimitValue) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetLimitValue(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int limit_value; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + limit_value = THIS->limit_value[slot]; + XSprePUSH; + PUSHi((IV) limit_value); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMana); +XS(XS_Spell_GetMana) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMana(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint16 mana; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + mana = THIS->mana; + XSprePUSH; + PUSHu((UV) mana); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMaxDistance); +XS(XS_Spell_GetMaxDistance) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMaxDistance(THIS)"); + { + SPDat_Spell_Struct* THIS; + float max_distance; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + max_distance = THIS->max_distance; + XSprePUSH; + PUSHn((double) max_distance); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMaxDistanceMod); +XS(XS_Spell_GetMaxDistanceMod) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMaxDistanceMod(THIS)"); + { + SPDat_Spell_Struct* THIS; + float max_distance_mod; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + max_distance_mod = THIS->max_distance_mod; + XSprePUSH; + PUSHn((double) max_distance_mod); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMaxResist); +XS(XS_Spell_GetMaxResist) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMaxResist(THIS)"); + { + SPDat_Spell_Struct* THIS; + int max_resist; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + max_resist = THIS->max_resist; + XSprePUSH; + PUSHi((IV) max_resist); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMaxValue); +XS(XS_Spell_GetMaxValue) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetMaxValue(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int max_value; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + max_value = THIS->max_value[slot]; + XSprePUSH; + PUSHi((IV) max_value); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMinDistance); +XS(XS_Spell_GetMinDistance) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMinDistance(THIS)"); + { + SPDat_Spell_Struct* THIS; + float min_distance; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + min_distance = THIS->min_distance; + XSprePUSH; + PUSHn((double) min_distance); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMinDistanceMod); +XS(XS_Spell_GetMinDistanceMod) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMinDistanceMod(THIS)"); + { + SPDat_Spell_Struct* THIS; + float min_distance_mod; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + min_distance_mod = THIS->min_distance_mod; + XSprePUSH; + PUSHn((double) min_distance_mod); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMinRange); +XS(XS_Spell_GetMinRange) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMinRange(THIS)"); + { + SPDat_Spell_Struct* THIS; + float min_range; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + min_range = THIS->min_range; + XSprePUSH; + PUSHn((double) min_range); + } + XSRETURN(1); +} + +XS(XS_Spell_GetMinResist); +XS(XS_Spell_GetMinResist) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetMinResist(THIS)"); + { + SPDat_Spell_Struct* THIS; + int min_resist; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + min_resist = THIS->min_resist; + XSprePUSH; + PUSHi((IV) min_resist); + } + XSRETURN(1); +} + +XS(XS_Spell_GetName); +XS(XS_Spell_GetName) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetName(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string name; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + name = THIS->name; + sv_setpv(TARG, name.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetNewIcon); +XS(XS_Spell_GetNewIcon) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNewIcon(THIS)"); + { + SPDat_Spell_Struct* THIS; + int16 new_icon; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + new_icon = THIS->new_icon; + XSprePUSH; + PUSHi((IV) new_icon); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNimbusEffect); +XS(XS_Spell_GetNimbusEffect) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNimbusEffect(THIS)"); + { + SPDat_Spell_Struct* THIS; + int nimbus_effect; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + nimbus_effect = THIS->nimbus_effect; + XSprePUSH; + PUSHi((IV) nimbus_effect); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoBlock); +XS(XS_Spell_GetNoBlock) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNoBlock(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool no_block; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_block = THIS->no_block; + ST(0) = boolSV(no_block); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoDetrimentalSpellAggro); +XS(XS_Spell_GetNoDetrimentalSpellAggro) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNoDetrimentalSpellAggro(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool no_detrimental_spell_aggro; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_detrimental_spell_aggro = THIS->no_detrimental_spell_aggro; + ST(0) = boolSV(no_detrimental_spell_aggro); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoExpendReagent); +XS(XS_Spell_GetNoExpendReagent) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Spell::GetNoExpendReagent(THIS, uint8 slot)"); + { + SPDat_Spell_Struct* THIS; + int no_expend_reagent; + uint8 slot = (uint8) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_expend_reagent = THIS->no_expend_reagent[slot]; + XSprePUSH; + PUSHi((IV) no_expend_reagent); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoHealDamageItemMod); +XS(XS_Spell_GetNoHealDamageItemMod) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNoHealDamageItemMod(THIS)"); + { + SPDat_Spell_Struct* THIS; + int no_heal_damage_item_mod; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_heal_damage_item_mod = THIS->no_heal_damage_item_mod; + XSprePUSH; + PUSHi((IV) no_heal_damage_item_mod); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoPartialResist); +XS(XS_Spell_GetNoPartialResist) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNoPartialResist(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool no_partial_resist; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_partial_resist = THIS->no_partial_resist; + ST(0) = boolSV(no_partial_resist); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoRemove); +XS(XS_Spell_GetNoRemove) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNoRemove(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool no_remove; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_remove = THIS->no_remove; + ST(0) = boolSV(no_remove); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNoResist); +XS(XS_Spell_GetNoResist) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNoResist(THIS)"); + { + SPDat_Spell_Struct* THIS; + int no_resist; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + no_resist = THIS->no_resist; + XSprePUSH; + PUSHi((IV) no_resist); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNotFocusable); +XS(XS_Spell_GetNotFocusable) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNotFocusable(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool not_focusable; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + not_focusable = THIS->not_focusable; + ST(0) = boolSV(not_focusable); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetNPCNoLOS); +XS(XS_Spell_GetNPCNoLOS) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetNPCNoLOS(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool npc_no_los; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + npc_no_los = THIS->npc_no_los; + ST(0) = boolSV(npc_no_los); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetOtherCasts); +XS(XS_Spell_GetOtherCasts) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetOtherCasts(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string other_casts; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + other_casts = THIS->other_casts; + sv_setpv(TARG, other_casts.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetOverrideCritChance); +XS(XS_Spell_GetOverrideCritChance) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetOverrideCritChance(THIS)"); + { + SPDat_Spell_Struct* THIS; + int override_crit_chance; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + override_crit_chance = THIS->override_crit_chance; + XSprePUSH; + PUSHi((IV) override_crit_chance); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPCNPCOnlyFlag); +XS(XS_Spell_GetPCNPCOnlyFlag) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPCNPCOnlyFlag(THIS)"); + { + SPDat_Spell_Struct* THIS; + int pcnpc_only_flag; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + pcnpc_only_flag = THIS->pcnpc_only_flag; + XSprePUSH; + PUSHi((IV) pcnpc_only_flag); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPersistDeath); +XS(XS_Spell_GetPersistDeath) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPersistDeath(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool persist_death; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + persist_death = THIS->persist_death; + ST(0) = boolSV(persist_death); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPlayer_1); +XS(XS_Spell_GetPlayer_1) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPlayer_1(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string player_1; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + player_1 = THIS->player_1; + sv_setpv(TARG, player_1.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetPushBack); +XS(XS_Spell_GetPushBack) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPushBack(THIS)"); + { + SPDat_Spell_Struct* THIS; + float push_back; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + push_back = THIS->push_back; + XSprePUSH; + PUSHn((double) push_back); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPushUp); +XS(XS_Spell_GetPushUp) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPushUp(THIS)"); + { + SPDat_Spell_Struct* THIS; + float push_up; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + push_up = THIS->push_up; + XSprePUSH; + PUSHn((double) push_up); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPVPDuration); +XS(XS_Spell_GetPVPDuration) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPVPDuration(THIS)"); + { + SPDat_Spell_Struct* THIS; + int pvp_duration; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + pvp_duration = THIS->pvp_duration; + XSprePUSH; + PUSHi((IV) pvp_duration); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPVPDurationCap); +XS(XS_Spell_GetPVPDurationCap) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPVPDurationCap(THIS)"); + { + SPDat_Spell_Struct* THIS; + int pvp_duration_cap; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + pvp_duration_cap = THIS->pvp_duration_cap; + XSprePUSH; + PUSHi((IV) pvp_duration_cap); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPVPResistBase); +XS(XS_Spell_GetPVPResistBase) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPVPResistBase(THIS)"); + { + SPDat_Spell_Struct* THIS; + int pvp_resist_base; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + pvp_resist_base = THIS->pvp_resist_base; + XSprePUSH; + PUSHi((IV) pvp_resist_base); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPVPResistCap); +XS(XS_Spell_GetPVPResistCap) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPVPResistCap(THIS)"); + { + SPDat_Spell_Struct* THIS; + int pvp_resist_cap; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + pvp_resist_cap = THIS->pvp_resist_cap; + XSprePUSH; + PUSHi((IV) pvp_resist_cap); + } + XSRETURN(1); +} + +XS(XS_Spell_GetPVPResistPerLevel); +XS(XS_Spell_GetPVPResistPerLevel) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetPVPResistPerLevel(THIS)"); + { + SPDat_Spell_Struct* THIS; + int pvp_resist_per_level; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + pvp_resist_per_level = THIS->pvp_resist_per_level; + XSprePUSH; + PUSHi((IV) pvp_resist_per_level); + } + XSRETURN(1); +} + +XS(XS_Spell_GetRange); +XS(XS_Spell_GetRange) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetRange(THIS)"); + { + SPDat_Spell_Struct* THIS; + float range; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + range = THIS->range; + XSprePUSH; + PUSHn((double) range); + } + XSRETURN(1); +} + +XS(XS_Spell_GetRank); +XS(XS_Spell_GetRank) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetRank(THIS)"); + { + SPDat_Spell_Struct* THIS; + int rank; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + rank = THIS->rank; + XSprePUSH; + PUSHi((IV) rank); + } + XSRETURN(1); +} + +XS(XS_Spell_GetRecastTime); +XS(XS_Spell_GetRecastTime) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetRecastTime(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint32 recast_time; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + recast_time = THIS->recast_time; + XSprePUSH; + PUSHu((UV) recast_time); + } + XSRETURN(1); +} + +XS(XS_Spell_GetRecourseLink); +XS(XS_Spell_GetRecourseLink) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetRecourseLink(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint16 recourse_link; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + recourse_link = THIS->recourse_link; + XSprePUSH; + PUSHu((UV) recourse_link); + } + XSRETURN(1); +} + +XS(XS_Spell_GetRecoveryTime); +XS(XS_Spell_GetRecoveryTime) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetRecoveryTime(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint32 recovery_time; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + recovery_time = THIS->recovery_time; + XSprePUSH; + PUSHu((UV) recovery_time); + } + XSRETURN(1); +} + +XS(XS_Spell_GetReflectable); +XS(XS_Spell_GetReflectable) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetReflectable(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool reflectable; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + reflectable = THIS->reflectable; + ST(0) = boolSV(reflectable); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetResistDifficulty); +XS(XS_Spell_GetResistDifficulty) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetResistDifficulty(THIS)"); + { + SPDat_Spell_Struct* THIS; + int16 resist_difficulty; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + resist_difficulty = THIS->resist_difficulty; + XSprePUSH; + PUSHi((IV) resist_difficulty); + } + XSRETURN(1); +} + +XS(XS_Spell_GetResistType); +XS(XS_Spell_GetResistType) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetResistType(THIS)"); + { + SPDat_Spell_Struct* THIS; + int resist_type; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + resist_type = THIS->resist_type; + XSprePUSH; + PUSHi((IV) resist_type); + } + XSRETURN(1); +} + +XS(XS_Spell_GetShortBuffBox); +XS(XS_Spell_GetShortBuffBox) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetShortBuffBox(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 short_buff_box; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + short_buff_box = THIS->short_buff_box; + XSprePUSH; + PUSHi((IV) short_buff_box); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSkill); +XS(XS_Spell_GetSkill) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSkill(THIS)"); + { + SPDat_Spell_Struct* THIS; + EQ::skills::SkillType skill; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + skill = THIS->skill; + XSprePUSH; + PUSHi((IV) skill); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSneak); +XS(XS_Spell_GetSneak) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSneak(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool sneak; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + sneak = THIS->sneak; + ST(0) = boolSV(sneak); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSongCap); +XS(XS_Spell_GetSongCap) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSongCap(THIS)"); + { + SPDat_Spell_Struct* THIS; + int song_cap; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + song_cap = THIS->song_cap; + XSprePUSH; + PUSHi((IV) song_cap); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSpellAffectIndex); +XS(XS_Spell_GetSpellAffectIndex) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSpellAffectIndex(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint16 spell_affect_index; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + spell_affect_index = THIS->spell_affect_index; + XSprePUSH; + PUSHu((UV) spell_affect_index); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSpellCategory); +XS(XS_Spell_GetSpellCategory) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSpellCategory(THIS)"); + { + SPDat_Spell_Struct* THIS; + int spell_category; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + spell_category = THIS->spell_category; + XSprePUSH; + PUSHi((IV) spell_category); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSpellClass); +XS(XS_Spell_GetSpellClass) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSpellClass(THIS)"); + { + SPDat_Spell_Struct* THIS; + int spell_class; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + spell_class = THIS->spell_class; + XSprePUSH; + PUSHi((IV) spell_class); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSpellFades); +XS(XS_Spell_GetSpellFades) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSpellFades(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string spell_fades; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + spell_fades = THIS->spell_fades; + sv_setpv(TARG, spell_fades.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetSpellGroup); +XS(XS_Spell_GetSpellGroup) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSpellGroup(THIS)"); + { + SPDat_Spell_Struct* THIS; + int spell_group; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + spell_group = THIS->spell_group; + XSprePUSH; + PUSHi((IV) spell_group); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSpellSubclass); +XS(XS_Spell_GetSpellSubclass) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSpellSubclass(THIS)"); + { + SPDat_Spell_Struct* THIS; + int spell_subclass; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + spell_subclass = THIS->spell_subclass; + XSprePUSH; + PUSHi((IV) spell_subclass); + } + XSRETURN(1); +} + +XS(XS_Spell_GetSuspendable); +XS(XS_Spell_GetSuspendable) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetSuspendable(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool suspendable; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + suspendable = THIS->suspendable; + ST(0) = boolSV(suspendable); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetTargetType); +XS(XS_Spell_GetTargetType) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetTargetType(THIS)"); + { + SPDat_Spell_Struct* THIS; + SpellTargetType target_type; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + target_type = THIS->target_type; + XSprePUSH; + PUSHi((IV) target_type); + } + XSRETURN(1); +} + +XS(XS_Spell_GetTeleportZone); +XS(XS_Spell_GetTeleportZone) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetTeleportZone(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string teleport_zone; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + teleport_zone = THIS->teleport_zone; + sv_setpv(TARG, teleport_zone.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetTimeOfDay); +XS(XS_Spell_GetTimeOfDay) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetTimeOfDay(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 time_of_day; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + time_of_day = THIS->time_of_day; + XSprePUSH; + PUSHi((IV) time_of_day); + } + XSRETURN(1); +} + +XS(XS_Spell_GetTimerID); +XS(XS_Spell_GetTimerID) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetTimerID(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 timer_id; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + timer_id = THIS->timer_id; + XSprePUSH; + PUSHi((IV) timer_id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetTypeDescriptionID); +XS(XS_Spell_GetTypeDescriptionID) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetTypeDescriptionID(THIS)"); + { + SPDat_Spell_Struct* THIS; + int type_description_id; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + type_description_id = THIS->type_description_id; + XSprePUSH; + PUSHi((IV) type_description_id); + } + XSRETURN(1); +} + +XS(XS_Spell_GetUninterruptable); +XS(XS_Spell_GetUninterruptable) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetUninterruptable(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool uninterruptable; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + uninterruptable = THIS->uninterruptable; + ST(0) = boolSV(uninterruptable); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetUnstackableDOT); +XS(XS_Spell_GetUnstackableDOT) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetUnstackableDOT(THIS)"); + { + SPDat_Spell_Struct* THIS; + bool unstackable_dot; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + unstackable_dot = THIS->unstackable_dot; + ST(0) = boolSV(unstackable_dot); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Spell_GetViralRange); +XS(XS_Spell_GetViralRange) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetViralRange(THIS)"); + { + SPDat_Spell_Struct* THIS; + int viral_range; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + viral_range = THIS->viral_range; + XSprePUSH; + PUSHi((IV) viral_range); + } + XSRETURN(1); +} + +XS(XS_Spell_GetViralTargets); +XS(XS_Spell_GetViralTargets) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetViralTargets(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint8 viral_targets; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + viral_targets = THIS->viral_targets; + XSprePUSH; + PUSHu((UV) viral_targets); + } + XSRETURN(1); +} + +XS(XS_Spell_GetViralTimer); +XS(XS_Spell_GetViralTimer) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetViralTimer(THIS)"); + { + SPDat_Spell_Struct* THIS; + uint8 viral_timer; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + viral_timer = THIS->viral_timer; + XSprePUSH; + PUSHu((UV) viral_timer); + } + XSRETURN(1); +} + +XS(XS_Spell_GetYouCast); +XS(XS_Spell_GetYouCast) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetYouCast(THIS)"); + { + SPDat_Spell_Struct* THIS; + std::string you_cast; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + you_cast = THIS->you_cast; + sv_setpv(TARG, you_cast.c_str()); + XSprePUSH; + PUSHTARG; + } + XSRETURN(1); +} + +XS(XS_Spell_GetZoneType); +XS(XS_Spell_GetZoneType) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: Spell::GetZoneType(THIS)"); + { + SPDat_Spell_Struct* THIS; + int8 zone_type; + dXSTARG; + VALIDATE_THIS_IS_SPELL; + + zone_type = THIS->zone_type; + XSprePUSH; + PUSHi((IV) zone_type); + } + XSRETURN(1); +} + +#ifdef __cplusplus +extern "C" +#endif + +XS(boot_Spell); +XS(boot_Spell) { + dXSARGS; + char file[256]; + strncpy(file, __FILE__, 256); + file[255] = 0; + if (items != 1) + fprintf(stderr, "boot_Spell does not take any arguments."); + + char buf[128]; + XS_VERSION_BOOTCHECK; + newXSproto(strcpy(buf, "GetActivated"), XS_Spell_GetActivated, file, "$"); + newXSproto(strcpy(buf, "GetAllowRest"), XS_Spell_GetAllowRest, file, "$"); + newXSproto(strcpy(buf, "GetAOEDuration"), XS_Spell_GetAOEDuration, file, "$"); + newXSproto(strcpy(buf, "GetAOEMaxTargets"), XS_Spell_GetAOEMaxTargets, file, "$"); + newXSproto(strcpy(buf, "GetAOERange"), XS_Spell_GetAOERange, file, "$"); + newXSproto(strcpy(buf, "GetBaseDifficulty"), XS_Spell_GetBaseDifficulty, file, "$"); + newXSproto(strcpy(buf, "GetBaseValue"), XS_Spell_GetBaseValue, file, "$$"); + newXSproto(strcpy(buf, "GetBonusHate"), XS_Spell_GetBonusHate, file, "$"); + newXSproto(strcpy(buf, "GetBuffDuration"), XS_Spell_GetBuffDuration, file, "$"); + newXSproto(strcpy(buf, "GetBuffDurationFormula"), XS_Spell_GetBuffDurationFormula, file, "$"); + newXSproto(strcpy(buf, "GetCanCastInCombat"), XS_Spell_GetCanCastInCombat, file, "$"); + newXSproto(strcpy(buf, "GetCanCastOutOfCombat"), XS_Spell_GetCanCastOutOfCombat, file, "$"); + newXSproto(strcpy(buf, "GetCanMGB"), XS_Spell_GetCanMGB, file, "$"); + newXSproto(strcpy(buf, "GetCastNotStanding"), XS_Spell_GetCastNotStanding, file, "$"); + newXSproto(strcpy(buf, "GetCastOnOther"), XS_Spell_GetCastOnOther, file, "$"); + newXSproto(strcpy(buf, "GetCastOnYou"), XS_Spell_GetCastOnYou, file, "$"); + newXSproto(strcpy(buf, "GetCastRestriction"), XS_Spell_GetCastRestriction, file, "$"); + newXSproto(strcpy(buf, "GetCastTime"), XS_Spell_GetCastTime, file, "$"); + newXSproto(strcpy(buf, "GetCasterRequirementID"), XS_Spell_GetCasterRequirementID, file, "$"); + newXSproto(strcpy(buf, "GetCastingAnimation"), XS_Spell_GetCastingAnimation, file, "$"); + newXSproto(strcpy(buf, "GetClasses"), XS_Spell_GetClasses, file, "$$"); + newXSproto(strcpy(buf, "GetComponent"), XS_Spell_GetComponent, file, "$$"); + newXSproto(strcpy(buf, "GetComponentCount"), XS_Spell_GetComponentCount, file, "$$"); + newXSproto(strcpy(buf, "GetDeities"), XS_Spell_GetDeities, file, "$$"); + newXSproto(strcpy(buf, "GetDeityAgnostic"), XS_Spell_GetDeityAgnostic, file, "$"); + newXSproto(strcpy(buf, "GetDescriptionID"), XS_Spell_GetDescriptionID, file, "$"); + newXSproto(strcpy(buf, "GetDirectionalEnd"), XS_Spell_GetDirectionalEnd, file, "$"); + newXSproto(strcpy(buf, "GetDirectionalStart"), XS_Spell_GetDirectionalStart, file, "$"); + newXSproto(strcpy(buf, "GetDisallowSit"), XS_Spell_GetDisallowSit, file, "$"); + newXSproto(strcpy(buf, "GetDispelFlag"), XS_Spell_GetDispelFlag, file, "$"); + newXSproto(strcpy(buf, "GetEffectDescriptionID"), XS_Spell_GetEffectDescriptionID, file, "$"); + newXSproto(strcpy(buf, "GetEffectID"), XS_Spell_GetEffectID, file, "$$"); + newXSproto(strcpy(buf, "GetEnduranceCost"), XS_Spell_GetEnduranceCost, file, "$"); + newXSproto(strcpy(buf, "GetEnduranceUpkeep"), XS_Spell_GetEnduranceUpkeep, file, "$"); + newXSproto(strcpy(buf, "GetEnvironmentType"), XS_Spell_GetEnvironmentType, file, "$"); + newXSproto(strcpy(buf, "GetFeedbackable"), XS_Spell_GetFeedbackable, file, "$"); + newXSproto(strcpy(buf, "GetFormula"), XS_Spell_GetFormula, file, "$$"); + newXSproto(strcpy(buf, "GetGoodEffect"), XS_Spell_GetGoodEffect, file, "$"); + newXSproto(strcpy(buf, "GetHateAdded"), XS_Spell_GetHateAdded, file, "$"); + newXSproto(strcpy(buf, "GetHitNumber"), XS_Spell_GetHitNumber, file, "$"); + newXSproto(strcpy(buf, "GetHitNumberType"), XS_Spell_GetHitNumberType, file, "$"); + newXSproto(strcpy(buf, "GetID"), XS_Spell_GetID, file, "$"); + newXSproto(strcpy(buf, "GetIsDiscipline"), XS_Spell_GetIsDiscipline, file, "$"); + newXSproto(strcpy(buf, "GetLDoNTrap"), XS_Spell_GetLDoNTrap, file, "$"); + newXSproto(strcpy(buf, "GetLimitValue"), XS_Spell_GetLimitValue, file, "$$"); + newXSproto(strcpy(buf, "GetMana"), XS_Spell_GetMana, file, "$"); + newXSproto(strcpy(buf, "GetMaxDistance"), XS_Spell_GetMaxDistance, file, "$"); + newXSproto(strcpy(buf, "GetMaxDistanceMod"), XS_Spell_GetMaxDistanceMod, file, "$"); + newXSproto(strcpy(buf, "GetMaxResist"), XS_Spell_GetMaxResist, file, "$"); + newXSproto(strcpy(buf, "GetMaxValue"), XS_Spell_GetMaxValue, file, "$$"); + newXSproto(strcpy(buf, "GetMinDistance"), XS_Spell_GetMinDistance, file, "$"); + newXSproto(strcpy(buf, "GetMinDistanceMod"), XS_Spell_GetMinDistanceMod, file, "$"); + newXSproto(strcpy(buf, "GetMinRange"), XS_Spell_GetMinRange, file, "$"); + newXSproto(strcpy(buf, "GetMinResist"), XS_Spell_GetMinResist, file, "$"); + newXSproto(strcpy(buf, "GetName"), XS_Spell_GetName, file, "$"); + newXSproto(strcpy(buf, "GetNewIcon"), XS_Spell_GetNewIcon, file, "$"); + newXSproto(strcpy(buf, "GetNimbusEffect"), XS_Spell_GetNimbusEffect, file, "$"); + newXSproto(strcpy(buf, "GetNoBlock"), XS_Spell_GetNoBlock, file, "$"); + newXSproto(strcpy(buf, "GetNoDetrimentalSpellAggro"), XS_Spell_GetNoDetrimentalSpellAggro, file, "$"); + newXSproto(strcpy(buf, "GetNoExpendReagent"), XS_Spell_GetNoExpendReagent, file, "$$"); + newXSproto(strcpy(buf, "GetNoHealDamageItemMod"), XS_Spell_GetNoHealDamageItemMod, file, "$"); + newXSproto(strcpy(buf, "GetNoPartialResist"), XS_Spell_GetNoPartialResist, file, "$"); + newXSproto(strcpy(buf, "GetNoRemove"), XS_Spell_GetNoRemove, file, "$"); + newXSproto(strcpy(buf, "GetNoResist"), XS_Spell_GetNoResist, file, "$"); + newXSproto(strcpy(buf, "GetNotFocusable"), XS_Spell_GetNotFocusable, file, "$"); + newXSproto(strcpy(buf, "GetNPCNoLOS"), XS_Spell_GetNPCNoLOS, file, "$"); + newXSproto(strcpy(buf, "GetOtherCasts"), XS_Spell_GetOtherCasts, file, "$"); + newXSproto(strcpy(buf, "GetOverrideCritChance"), XS_Spell_GetOverrideCritChance, file, "$"); + newXSproto(strcpy(buf, "GetPCNPCOnlyFlag"), XS_Spell_GetPCNPCOnlyFlag, file, "$"); + newXSproto(strcpy(buf, "GetPersistDeath"), XS_Spell_GetPersistDeath, file, "$"); + newXSproto(strcpy(buf, "GetPlayer_1"), XS_Spell_GetPlayer_1, file, "$"); + newXSproto(strcpy(buf, "GetPushBack"), XS_Spell_GetPushBack, file, "$"); + newXSproto(strcpy(buf, "GetPushUp"), XS_Spell_GetPushUp, file, "$"); + newXSproto(strcpy(buf, "GetPVPDuration"), XS_Spell_GetPVPDuration, file, "$"); + newXSproto(strcpy(buf, "GetPVPDurationCap"), XS_Spell_GetPVPDurationCap, file, "$"); + newXSproto(strcpy(buf, "GetPVPResistBase"), XS_Spell_GetPVPResistBase, file, "$"); + newXSproto(strcpy(buf, "GetPVPResistCap"), XS_Spell_GetPVPResistCap, file, "$"); + newXSproto(strcpy(buf, "GetPVPResistPerLevel"), XS_Spell_GetPVPResistPerLevel, file, "$"); + newXSproto(strcpy(buf, "GetRange"), XS_Spell_GetRange, file, "$"); + newXSproto(strcpy(buf, "GetRank"), XS_Spell_GetRank, file, "$"); + newXSproto(strcpy(buf, "GetRecastTime"), XS_Spell_GetRecastTime, file, "$"); + newXSproto(strcpy(buf, "GetRecourseLink"), XS_Spell_GetRecourseLink, file, "$"); + newXSproto(strcpy(buf, "GetRecoveryTime"), XS_Spell_GetRecoveryTime, file, "$"); + newXSproto(strcpy(buf, "GetReflectable"), XS_Spell_GetReflectable, file, "$"); + newXSproto(strcpy(buf, "GetResistDifficulty"), XS_Spell_GetResistDifficulty, file, "$"); + newXSproto(strcpy(buf, "GetResistType"), XS_Spell_GetResistType, file, "$"); + newXSproto(strcpy(buf, "GetShortBuffBox"), XS_Spell_GetShortBuffBox, file, "$"); + newXSproto(strcpy(buf, "GetSkill"), XS_Spell_GetSkill, file, "$"); + newXSproto(strcpy(buf, "GetSneak"), XS_Spell_GetSneak, file, "$"); + newXSproto(strcpy(buf, "GetSongCap"), XS_Spell_GetSongCap, file, "$"); + newXSproto(strcpy(buf, "GetSpellAffectIndex"), XS_Spell_GetSpellAffectIndex, file, "$"); + newXSproto(strcpy(buf, "GetSpellCategory"), XS_Spell_GetSpellCategory, file, "$"); + newXSproto(strcpy(buf, "GetSpellClass"), XS_Spell_GetSpellClass, file, "$"); + newXSproto(strcpy(buf, "GetSpellFades"), XS_Spell_GetSpellFades, file, "$"); + newXSproto(strcpy(buf, "GetSpellGroup"), XS_Spell_GetSpellGroup, file, "$"); + newXSproto(strcpy(buf, "GetSpellSubclass"), XS_Spell_GetSpellSubclass, file, "$"); + newXSproto(strcpy(buf, "GetSuspendable"), XS_Spell_GetSuspendable, file, "$"); + newXSproto(strcpy(buf, "GetTargetType"), XS_Spell_GetTargetType, file, "$"); + newXSproto(strcpy(buf, "GetTeleportZone"), XS_Spell_GetTeleportZone, file, "$"); + newXSproto(strcpy(buf, "GetTimeOfDay"), XS_Spell_GetTimeOfDay, file, "$"); + newXSproto(strcpy(buf, "GetTimerID"), XS_Spell_GetTimerID, file, "$"); + newXSproto(strcpy(buf, "GetTypeDescriptionID"), XS_Spell_GetTypeDescriptionID, file, "$"); + newXSproto(strcpy(buf, "GetUninterruptable"), XS_Spell_GetUninterruptable, file, "$"); + newXSproto(strcpy(buf, "GetUnstackableDOT"), XS_Spell_GetUnstackableDOT, file, "$"); + newXSproto(strcpy(buf, "GetViralRange"), XS_Spell_GetViralRange, file, "$"); + newXSproto(strcpy(buf, "GetViralTargets"), XS_Spell_GetViralTargets, file, "$"); + newXSproto(strcpy(buf, "GetViralTimer"), XS_Spell_GetViralTimer, file, "$"); + newXSproto(strcpy(buf, "GetYouCast"), XS_Spell_GetYouCast, file, "$"); + newXSproto(strcpy(buf, "GetZoneType"), XS_Spell_GetZoneType, file, "$"); + XSRETURN_YES; +} + +#endif //EMBPERL_XS_CLASSES diff --git a/zone/perlparser.h b/zone/perlparser.h index 60020306f..686018543 100644 --- a/zone/perlparser.h +++ b/zone/perlparser.h @@ -32,7 +32,7 @@ public: PerlXSParser(); // ~PerlXSParser(); - virtual void SendCommands(const char * pkgprefix, const char *event, uint32 npcid, Mob* other, Mob* mob, ItemInst* iteminst); + virtual void SendCommands(const char * pkgprefix, const char *event, uint32 object_id, Mob* other, Mob* mob, ItemInst* iteminst, const SPDat_Spell_Struct *spell); protected: void map_funs(); diff --git a/zone/pets.cpp b/zone/pets.cpp index 1c833f088..4ca6b7752 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -560,7 +560,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) { buffs[i].casterlevel = pet_buffs[i].level; buffs[i].casterid = 0; buffs[i].counters = pet_buffs[i].counters; - buffs[i].numhits = spells[pet_buffs[i].spellid].numhits; + buffs[i].hit_number = spells[pet_buffs[i].spellid].hit_number; buffs[i].instrument_mod = pet_buffs[i].bard_modifier; } else { @@ -575,14 +575,14 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) { for (int j1=0; j1 < GetPetMaxTotalSlots(); j1++) { if (buffs[j1].spellid <= (uint32)SPDAT_RECORDS) { for (int x1=0; x1 < EFFECT_COUNT; x1++) { - switch (spells[buffs[j1].spellid].effectid[x1]) { + switch (spells[buffs[j1].spellid].effect_id[x1]) { case SE_WeaponProc: // We need to reapply buff based procs // We need to do this here so suspended pets also regain their procs. - if (spells[buffs[j1].spellid].base2[x1] == 0) { + if (spells[buffs[j1].spellid].limit_value[x1] == 0) { AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100, buffs[j1].spellid); } else { - AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100+spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); + AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100+spells[buffs[j1].spellid].limit_value[x1], buffs[j1].spellid); } break; case SE_Charm: diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 54a2524ab..4da5c2b1d 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -57,6 +57,7 @@ QuestManager quest_manager; Mob *owner = nullptr; \ Client *initiator = nullptr; \ EQ::ItemInstance* questitem = nullptr; \ + const SPDat_Spell_Struct* questspell = nullptr; \ bool depop_npc = false; \ std::string encounter; \ do { \ @@ -65,6 +66,7 @@ QuestManager quest_manager; owner = e.owner; \ initiator = e.initiator; \ questitem = e.questitem; \ + questspell = e.questspell; \ depop_npc = e.depop_npc; \ encounter = e.encounter; \ } \ @@ -118,11 +120,12 @@ void QuestManager::Process() { } } -void QuestManager::StartQuest(Mob *_owner, Client *_initiator, EQ::ItemInstance* _questitem, std::string encounter) { +void QuestManager::StartQuest(Mob *_owner, Client *_initiator, EQ::ItemInstance* _questitem, const SPDat_Spell_Struct* _questspell, std::string encounter) { running_quest run; run.owner = _owner; run.initiator = _initiator; run.questitem = _questitem; + run.questspell = _questspell; run.depop_npc = false; run.encounter = encounter; quests_running_.push(run); @@ -372,14 +375,14 @@ void QuestManager::castspell(int spell_id, int target_id) { if (owner) { Mob *tgt = entity_list.GetMob(target_id); if(tgt != nullptr) - owner->SpellFinished(spell_id, tgt, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + owner->SpellFinished(spell_id, tgt, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } } void QuestManager::selfcast(int spell_id) { QuestManagerCurrentQuestVars(); if (initiator) - initiator->SpellFinished(spell_id, initiator, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + initiator->SpellFinished(spell_id, initiator, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } void QuestManager::addloot(int item_id, int charges, bool equipitem, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6) { @@ -3314,6 +3317,15 @@ EQ::ItemInstance *QuestManager::GetQuestItem() const { return nullptr; } +const SPDat_Spell_Struct *QuestManager::GetQuestSpell() { + if(!quests_running_.empty()) { + running_quest e = quests_running_.top(); + return e.questspell; + } + + return nullptr; +} + std::string QuestManager::GetEncounter() const { if(!quests_running_.empty()) { running_quest e = quests_running_.top(); @@ -3706,3 +3718,10 @@ void QuestManager::WorldWideTaskUpdate(uint8 update_type, uint32 task_identifier worldserver.SendPacket(pack); safe_delete(pack); } + +const SPDat_Spell_Struct* QuestManager::getspell(uint32 spell_id) { + if (spells[spell_id].id) { + return &spells[spell_id]; + } + return nullptr; +} diff --git a/zone/questmgr.h b/zone/questmgr.h index 4098fd75a..2b14e4fe6 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -38,6 +38,7 @@ class QuestManager { Mob *owner; Client *initiator; EQ::ItemInstance* questitem; + const SPDat_Spell_Struct* questspell; bool depop_npc; std::string encounter; }; @@ -51,7 +52,7 @@ public: QuestManager(); virtual ~QuestManager(); - void StartQuest(Mob *_owner, Client *_initiator = nullptr, EQ::ItemInstance* _questitem = nullptr, std::string encounter = ""); + void StartQuest(Mob *_owner, Client *_initiator = nullptr, EQ::ItemInstance* _questitem = nullptr, const SPDat_Spell_Struct* _questspell = nullptr, std::string encounter = ""); void EndQuest(); bool QuestsRunning() { return !quests_running_.empty(); } @@ -325,12 +326,14 @@ public: std::string getinventoryslotname(int16 slot_id); int getitemstat(uint32 item_id, std::string stat_identifier); int getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot = 0); + const SPDat_Spell_Struct *getspell(uint32 spell_id); Client *GetInitiator() const; NPC *GetNPC() const; Mob *GetOwner() const; EQ::InventoryProfile* GetInventory() const; EQ::ItemInstance *GetQuestItem() const; + const SPDat_Spell_Struct *GetQuestSpell(); std::string GetEncounter() const; inline bool ProximitySayInUse() { return HaveProximitySays; } diff --git a/zone/raids.cpp b/zone/raids.cpp index 55e6d9e55..ef883b917 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -535,7 +535,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) if(members[x].member == caster) { caster->SpellOnTarget(spellid, caster); #ifdef GROUP_BUFF_PETS - if(spells[spellid].targettype != ST_GroupNoPets && caster->GetPet() && caster->HasPetAffinity() && !caster->GetPet()->IsCharmed()) + if(spells[spellid].target_type != ST_GroupNoPets && caster->GetPet() && caster->HasPetAffinity() && !caster->GetPet()->IsCharmed()) caster->SpellOnTarget(spellid, caster->GetPet()); #endif } @@ -546,7 +546,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) if(distance <= range2){ caster->SpellOnTarget(spellid, members[x].member); #ifdef GROUP_BUFF_PETS - if(spells[spellid].targettype != ST_GroupNoPets && members[x].member->GetPet() && members[x].member->HasPetAffinity() && !members[x].member->GetPet()->IsCharmed()) + if(spells[spellid].target_type != ST_GroupNoPets && members[x].member->GetPet() && members[x].member->HasPetAffinity() && !members[x].member->GetPet()->IsCharmed()) caster->SpellOnTarget(spellid, members[x].member->GetPet()); #endif } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 6e4b4b9a7..db3efff05 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -201,7 +201,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int32 bas float chance = aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] / 1000.0f; if (zone->random.Roll(chance)) SpellFinished(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID], who, EQ::spells::CastingSlot::Item, 0, -1, - spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].ResistDiff); + spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].resist_difficulty); } who->Damage(this, my_hit.damage_done, SPELL_UNKNOWN, skill, false); @@ -1039,7 +1039,7 @@ void Mob::ProjectileAttack() if (ProjectileAtk[i].skill == EQ::skills::SkillConjuration) { if (IsValidSpell(ProjectileAtk[i].wpn_dmg)) SpellOnTarget(ProjectileAtk[i].wpn_dmg, target, false, true, - spells[ProjectileAtk[i].wpn_dmg].ResistDiff, + spells[ProjectileAtk[i].wpn_dmg].resist_difficulty, true); } else { CastToNPC()->DoRangedAttackDmg( @@ -1059,7 +1059,7 @@ void Mob::ProjectileAttack() else if (ProjectileAtk[i].skill == EQ::skills::SkillConjuration && IsValidSpell(ProjectileAtk[i].wpn_dmg)) SpellOnTarget(ProjectileAtk[i].wpn_dmg, target, false, true, - spells[ProjectileAtk[i].wpn_dmg].ResistDiff, true); + spells[ProjectileAtk[i].wpn_dmg].resist_difficulty, true); } } @@ -2208,7 +2208,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQ::skills::Sk float chance = aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] / 1000.0f; if (zone->random.Roll(chance)) SpellFinished(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID], other, EQ::spells::CastingSlot::Item, 0, -1, - spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].ResistDiff); + spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].resist_difficulty); } other->Damage(this, damage, SPELL_UNKNOWN, skillinuse); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index da3b45fe1..7f7cb7759 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -140,18 +140,18 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { buffs[buffslot].melee_rune = 0; buffs[buffslot].magic_rune = 0; - buffs[buffslot].numhits = 0; + buffs[buffslot].hit_number = 0; - if (spells[spell_id].numhits > 0) { + if (spells[spell_id].hit_number > 0) { - int numhit = spells[spell_id].numhits; + int numhit = spells[spell_id].hit_number; numhit += numhit * caster->GetFocusEffect(focusFcLimitUse, spell_id) / 100; numhit += caster->GetFocusEffect(focusIncreaseNumHits, spell_id); - buffs[buffslot].numhits = numhit; + buffs[buffslot].hit_number = numhit; } - if (spells[spell_id].EndurUpkeep > 0) + if (spells[spell_id].endurance_upkeep > 0) SetEndurUpkeep(true); if (IsClient() && CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater) @@ -204,7 +204,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(IsBlankSpellEffect(spell_id, i)) continue; - effect = spell.effectid[i]; + effect = spell.effect_id[i]; effect_value = CalcSpellEffectValue(spell_id, i, caster_level, instrument_mod, caster ? caster : this); if(spell_id == SPELL_LAY_ON_HANDS && caster && caster->GetAA(aaImprovedLayOnHands)) @@ -237,7 +237,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (buffslot >= 0) break; - if (spells[spell_id].base2[i] && !PassCastRestriction(spells[spell_id].base2[i])) { + if (spells[spell_id].limit_value[i] && !PassCastRestriction(spells[spell_id].limit_value[i])) { break; //no messages are given on live if this fails. } @@ -252,7 +252,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove //handles AAs and what not... if(caster) { if (reflect_effectiveness) { - dmg = caster->GetActReflectedSpellDamage(spell_id, (int32)(spells[spell_id].base[i] * partial / 100), reflect_effectiveness); + dmg = caster->GetActReflectedSpellDamage(spell_id, (int32)(spells[spell_id].base_value[i] * partial / 100), reflect_effectiveness); } else { dmg = caster->GetActSpellDamage(spell_id, dmg, this); @@ -299,7 +299,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove // hack fix for client health not reflecting server value last_hp = 0; - if (spells[spell_id].base2[i] && !PassCastRestriction(spells[spell_id].base2[i])) { + if (spells[spell_id].limit_value[i] && !PassCastRestriction(spells[spell_id].limit_value[i])) { break; } @@ -317,15 +317,15 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_PercentalHeal: { #ifdef SPELL_EFFECT_SPAM - snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max[i], effect_value); + snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max_value[i], effect_value); #endif - int32 val = GetMaxHP() * spell.base[i] / 100; + int32 val = GetMaxHP() * spell.base_value[i] / 100; //This effect can also do damage by percent. if (val < 0) { - if (spell.max[i] && -val > spell.max[i]) - val = -spell.max[i]; + if (spell.max_value[i] && -val > spell.max_value[i]) + val = -spell.max_value[i]; if (caster) val = caster->GetActSpellDamage(spell_id, val, this); @@ -334,8 +334,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove else { - if (spell.max[i] && val > spell.max[i]) - val = spell.max[i]; + if (spell.max_value[i] && val > spell.max_value[i]) + val = spell.max_value[i]; if(caster) val = caster->GetActSpellHealing(spell_id, val, this); @@ -418,8 +418,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "Translocate: %s %d %d %d heading %d", - spell.teleport_zone, spell.base[1], spell.base[0], - spell.base[2], spell.base[3] + spell.teleport_zone, spell.base_value[1], spell.base_value[0], + spell.base_value[2], spell.base_value[3] ); #endif if(IsClient()) @@ -438,10 +438,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove float x, y, z, heading; const char *target_zone = nullptr; - x = static_cast(spell.base[1]); - y = static_cast(spell.base[0]); - z = static_cast(spell.base[2]); - heading = static_cast(spell.base[3]); + x = static_cast(spell.base_value[1]); + y = static_cast(spell.base_value[0]); + z = static_cast(spell.base_value[2]); + heading = static_cast(spell.base_value[3]); if(!strcmp(spell.teleport_zone, "same")) { @@ -510,10 +510,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove float x, y, z, heading; const char *target_zone = nullptr; - x = static_cast(spell.base[1]); - y = static_cast(spell.base[0]); - z = static_cast(spell.base[2]); - heading = static_cast(spell.base[3]); + x = static_cast(spell.base_value[1]); + y = static_cast(spell.base_value[0]); + z = static_cast(spell.base_value[2]); + heading = static_cast(spell.base_value[3]); if(!strcmp(spell.teleport_zone, "same")) { @@ -537,7 +537,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (effect == SE_GateCastersBindpoint && caster && caster->IsClient()) { // Teleport Bind uses caster's bind point - int index = spells[spell_id].base[i] - 1; + int index = spells[spell_id].base_value[i] - 1; if (index < 0 || index > 4) index = 0; x = caster->CastToClient()->GetBindX(index); @@ -583,7 +583,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "Invisibility"); #endif - SetInvisible(spell.base[i]); + SetInvisible(spell.base_value[i]); break; } @@ -610,7 +610,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "See Invisible"); #endif - see_invis = spell.base[i]; + see_invis = spell.base_value[i]; break; } @@ -650,7 +650,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif //Added client messages to give some indication this effect is active. // Is there a message generated? Too disgusted by raids. - uint32 time = spell.base[i] * 10 * 1000; + uint32 time = spell.base_value[i] * 10 * 1000; if (caster && caster->IsClient()) { if (caster->IsGrouped()) { auto group = caster->GetGroup(); @@ -688,7 +688,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif //Typically we check for immunities else where but since stun immunities are different and only //Block the stun part and not the whole spell, we do it here, also do the message here so we wont get the message on a resist - int max_level = spell.max[i]; + int max_level = spell.max_value[i]; //max_level of 0 means we assume a default of 55. if (max_level == 0) max_level = RuleI(Spells, BaseImmunityLevel); @@ -725,7 +725,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Charm: { #ifdef SPELL_EFFECT_SPAM - snprintf(effect_desc, _EDLEN, "Charm: %+i (up to lvl %d)", effect_value, spell.max[i]); + snprintf(effect_desc, _EDLEN, "Charm: %+i (up to lvl %d)", effect_value, spell.max_value[i]); #endif if (!caster) { // can't be someone's pet unless we know who that someone is @@ -936,7 +936,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(caster && caster->IsClient() && caster != this) caster->CastToClient()->QueuePacket(message_packet); - CastToClient()->SetBindPoint(spells[spell_id].base[i] - 1); + CastToClient()->SetBindPoint(spells[spell_id].base_value[i] - 1); Save(); safe_delete(action_packet); safe_delete(message_packet); @@ -987,7 +987,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(caster->IsClient() && caster != this) caster->CastToClient()->QueuePacket(message_packet); - CastToClient()->SetBindPoint(spells[spell_id].base[i] - 1); + CastToClient()->SetBindPoint(spells[spell_id].base_value[i] - 1); Save(); safe_delete(action_packet); safe_delete(message_packet); @@ -1025,7 +1025,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(caster->IsClient() && caster != this) caster->CastToClient()->QueuePacket(message_packet); - CastToClient()->SetBindPoint(spells[spell_id].base[i] - 1); + CastToClient()->SetBindPoint(spells[spell_id].base_value[i] - 1); Save(); safe_delete(action_packet); safe_delete(message_packet); @@ -1043,7 +1043,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(!spellbonuses.AntiGate){ if(zone->random.Roll(effect_value)) - Gate(spells[spell_id].base2[i] - 1); + Gate(spells[spell_id].limit_value[i] - 1); else if (caster) caster->MessageString(Chat::SpellFailure,GATE_FAIL); } @@ -1091,7 +1091,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove found on spell with value 950 (95% spells would have 7% failure rates). Further investigation is needed. ~ Kayen */ - int chance = spells[spell_id].base[i]; + int chance = spells[spell_id].base_value[i]; int buff_count = GetMaxTotalSlots(); for(int slot = 0; slot < buff_count; slot++) { if (buffs[slot].spellid != SPELL_UNKNOWN && @@ -1117,8 +1117,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } - - int chance = spells[spell_id].base[i]; + + int chance = spells[spell_id].base_value[i]; int buff_count = GetMaxTotalSlots(); for(int slot = 0; slot < buff_count; slot++) { if (buffs[slot].spellid != SPELL_UNKNOWN && @@ -1137,7 +1137,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Purify: { //Attempt to remove up to base amount of detrimental effects (excluding charm, fear, resurrection, and revival sickness). - int purify_count = spells[spell_id].base[i]; + int purify_count = spells[spell_id].base_value[i]; if (purify_count > GetMaxTotalSlots()) { purify_count = GetMaxTotalSlots(); } @@ -1171,17 +1171,17 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_SummonItem: { - const EQ::ItemData *item = database.GetItem(spell.base[i]); + const EQ::ItemData *item = database.GetItem(spell.base_value[i]); #ifdef SPELL_EFFECT_SPAM const char *itemname = item ? item->Name : "*Unknown Item*"; - snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base[i]); + snprintf(effect_desc, _EDLEN, "Summon Item: %s (id %d)", itemname, spell.base_value[i]); #endif if (!item) { - Message(Chat::Red, "Unable to summon item %d. Item not found.", spell.base[i]); + Message(Chat::Red, "Unable to summon item %d. Item not found.", spell.base_value[i]); } else if (IsClient()) { Client *c = CastToClient(); if (c->CheckLoreConflict(item)) { - c->DuplicateLoreMessage(spell.base[i]); + c->DuplicateLoreMessage(spell.base_value[i]); } else { int charges; if (item->Stackable) @@ -1199,7 +1199,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove c->SendItemPacket(EQ::invslot::slotCursor, SummonedItem, ItemPacketLimbo); safe_delete(SummonedItem); } - SummonedItem = database.CreateItem(spell.base[i], charges); + SummonedItem = database.CreateItem(spell.base_value[i], charges); } } @@ -1207,10 +1207,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove } case SE_SummonItemIntoBag: { - const EQ::ItemData *item = database.GetItem(spell.base[i]); + const EQ::ItemData *item = database.GetItem(spell.base_value[i]); #ifdef SPELL_EFFECT_SPAM const char *itemname = item ? item->Name : "*Unknown Item*"; - snprintf(effect_desc, _EDLEN, "Summon Item In Bag: %s (id %d)", itemname, spell.base[i]); + snprintf(effect_desc, _EDLEN, "Summon Item In Bag: %s (id %d)", itemname, spell.base_value[i]); #endif uint8 slot; @@ -1222,7 +1222,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove caster->Message(Chat::Red, "SE_SummonItemIntoBag but no room in summoned bag!"); } else if (IsClient()) { if (CastToClient()->CheckLoreConflict(item)) { - CastToClient()->DuplicateLoreMessage(spell.base[i]); + CastToClient()->DuplicateLoreMessage(spell.base_value[i]); } else { int charges; @@ -1236,7 +1236,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (charges < 1) charges = 1; - EQ::ItemInstance *SubItem = database.CreateItem(spell.base[i], charges); + EQ::ItemInstance *SubItem = database.CreateItem(spell.base_value[i], charges); if (SubItem != nullptr) { SummonedItem->PutItem(slot, *SubItem); safe_delete(SubItem); @@ -1292,7 +1292,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Invulnerability"); #endif if(spell_id==4789) // Touch of the Divine - Divine Save - buffs[buffslot].ticsremaining = spells[spell_id].buffduration; // Prevent focus/aa buff extension + buffs[buffslot].ticsremaining = spells[spell_id].buff_duration; // Prevent focus/aa buff extension SetInvul(true); break; @@ -1317,7 +1317,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Blind: %+i", effect_value); #endif // this should catch the cures - if (BeneficialSpell(spell_id) && spells[spell_id].buffduration == 0) + if (BeneficialSpell(spell_id) && spells[spell_id].buff_duration == 0) BuffFadeByEffect(SE_Blind); else if (!IsClient()) CalculateNewFearpoint(); @@ -1346,31 +1346,31 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_MitigateMeleeDamage: { - buffs[buffslot].melee_rune = spells[spell_id].max[i]; + buffs[buffslot].melee_rune = spells[spell_id].max_value[i]; break; } case SE_MeleeThresholdGuard: { - buffs[buffslot].melee_rune = spells[spell_id].max[i]; + buffs[buffslot].melee_rune = spells[spell_id].max_value[i]; break; } case SE_SpellThresholdGuard: { - buffs[buffslot].magic_rune = spells[spell_id].max[i]; + buffs[buffslot].magic_rune = spells[spell_id].max_value[i]; break; } case SE_MitigateSpellDamage: { - buffs[buffslot].magic_rune = spells[spell_id].max[i]; + buffs[buffslot].magic_rune = spells[spell_id].max_value[i]; break; } case SE_MitigateDotDamage: { - buffs[buffslot].dot_rune = spells[spell_id].max[i]; + buffs[buffslot].dot_rune = spells[spell_id].max_value[i]; break; } @@ -1413,7 +1413,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Illusion: race %d", effect_value); #endif // Gender Illusions - if(spell.base[i] == -1) { + if(spell.base_value[i] == -1) { // Specific Gender Illusions if(spell_id == 1732 || spell_id == 1731) { int specific_gender = -1; @@ -1453,49 +1453,49 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove // Racial Illusions else { auto gender_id = ( - spell.max[i] > 0 && + spell.max_value[i] > 0 && ( - spell.max[i] != 3 || - spell.base2[i] == 0 + spell.max_value[i] != 3 || + spell.limit_value[i] == 0 ) ? - (spell.max[i] - 1) : - Mob::GetDefaultGender(spell.base[i], GetGender()) + (spell.max_value[i] - 1) : + Mob::GetDefaultGender(spell.base_value[i], GetGender()) ); auto race_size = GetRaceGenderDefaultHeight( - spell.base[i], + spell.base_value[i], gender_id ); - - if (spell.max[i] > 0) { - if (spell.base2[i] == 0) { + + if (spell.max_value[i] > 0) { + if (spell.limit_value[i] == 0) { SendIllusionPacket( - spell.base[i], + spell.base_value[i], gender_id ); } else { - if (spell.max[i] != 3) { + if (spell.max_value[i] != 3) { SendIllusionPacket( - spell.base[i], + spell.base_value[i], gender_id, - spell.base2[i], - spell.max[i] + spell.limit_value[i], + spell.max_value[i] ); } else { SendIllusionPacket( - spell.base[i], + spell.base_value[i], gender_id, - spell.base2[i], - spell.base2[i] + spell.limit_value[i], + spell.limit_value[i] ); } } } else { SendIllusionPacket( - spell.base[i], + spell.base_value[i], gender_id, - spell.base2[i], - spell.max[i] + spell.limit_value[i], + spell.max_value[i] ); } SendAppearancePacket(AT_Size, race_size); @@ -1566,7 +1566,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Spin: %d", effect_value); #endif // the spinning is handled by the client - int max_level = spells[spell_id].max[i]; + int max_level = spells[spell_id].max_value[i]; if(max_level == 0) max_level = RuleI(Spells, BaseImmunityLevel); // Default max is 55 level limit @@ -1668,7 +1668,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(IsClient()) { CastToClient()->SetHorseId(0); // dismount if have horse - if (zone->random.Int(0, 99) > spells[spell_id].base[i]) { + if (zone->random.Int(0, 99) > spells[spell_id].base_value[i]) { CastToClient()->SetFeigned(false); entity_list.MessageCloseString(this, false, 200, 10, STRING_FEIGNFAILED, GetName()); } else { @@ -1919,10 +1919,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Weapon Proc: %s (id %d)", spells[effect_value].name, procid); #endif - if(spells[spell_id].base2[i] == 0) + if(spells[spell_id].limit_value[i] == 0) AddProcToWeapon(procid, false, 100, spell_id, caster_level); else - AddProcToWeapon(procid, false, spells[spell_id].base2[i]+100, spell_id, caster_level); + AddProcToWeapon(procid, false, spells[spell_id].limit_value[i]+100, spell_id, caster_level); break; } @@ -1932,15 +1932,15 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove snprintf(effect_desc, _EDLEN, "Melee Negate Attack Rune: %+i", effect_value); #endif if(buffslot >= 0) - buffs[buffslot].numhits = effect_value; + buffs[buffslot].hit_number = effect_value; break; } case SE_AppraiseLDonChest: { if(IsNPC()) { - int check = spell.max[0]; - int target = spell.targettype; + int check = spell.max_value[0]; + int target = spell.target_type; if(target == ST_LDoNChest_Cursed) { if(caster && caster->IsClient()) @@ -1963,8 +1963,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(IsNPC()) { - int check = spell.max[0]; - int target = spell.targettype; + int check = spell.max_value[0]; + int target = spell.target_type; if(target == ST_LDoNChest_Cursed) { if(caster && caster->IsClient()) @@ -1987,8 +1987,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(IsNPC()) { - int check = spell.max[0]; - int target = spell.targettype; + int check = spell.max_value[0]; + int target = spell.target_type; if(target == ST_LDoNChest_Cursed) { if(caster && caster->IsClient()) @@ -2281,7 +2281,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "Fading Memories"); #endif - if(zone->random.Roll(spells[spell_id].base[i])) { + if(zone->random.Roll(spells[spell_id].base_value[i])) { if(caster && caster->IsClient()) caster->CastToClient()->Escape(); @@ -2301,10 +2301,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif uint16 procid = GetProcID(spell_id, i); - if(spells[spell_id].base2[i] == 0) + if(spells[spell_id].limit_value[i] == 0) AddRangedProc(procid, 100, spell_id); else - AddRangedProc(procid, spells[spell_id].base2[i]+100, spell_id); + AddRangedProc(procid, spells[spell_id].limit_value[i]+100, spell_id); break; } @@ -2338,10 +2338,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(caster && caster->IsClient()){ //Live AE Taunt range is hardcoded at 40 (Spells for AE taunt all use zero range) Target type should be self only. float range = 40; - if (spells[spell_id].max[i])//custom support if you want to alter range of AE Taunt. - range = spells[spell_id].max[i]; + if (spells[spell_id].max_value[i])//custom support if you want to alter range of AE Taunt. + range = spells[spell_id].max_value[i]; - entity_list.AETaunt(caster->CastToClient(), range, spells[spell_id].base[i]); + entity_list.AETaunt(caster->CastToClient(), range, spells[spell_id].base_value[i]); } break; } @@ -2364,13 +2364,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove switch(spells[spell_id].skill) { case EQ::skills::SkillThrowing: - caster->DoThrowingAttackDmg(this, nullptr, nullptr, effect_value,spells[spell_id].base2[i], 0, ReuseTime); + caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base_value[i],spells[spell_id].limit_value[i], 0, ReuseTime); break; case EQ::skills::SkillArchery: - caster->DoArcheryAttackDmg(this, nullptr, nullptr, effect_value,spells[spell_id].base2[i], 0, ReuseTime); + caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base_value[i],spells[spell_id].limit_value[i], 0, ReuseTime); break; default: - caster->DoMeleeSkillAttackDmg(this, effect_value, spells[spell_id].skill, spells[spell_id].base2[i], 0, false, ReuseTime); + caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base_value[i], spells[spell_id].skill, spells[spell_id].limit_value[i], 0, false, ReuseTime); break; } break; @@ -2383,7 +2383,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #endif //meh dupe issue with npc casting this if(caster && caster->IsClient()){ - int dur = spells[spell_id].max[i]; + int dur = spells[spell_id].max_value[i]; if (!dur) dur = 60; @@ -2397,8 +2397,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(caster && caster->IsClient()) { char pet_name[64]; snprintf(pet_name, sizeof(pet_name), "%s`s doppelganger", caster->GetCleanName()); - int pet_count = spells[spell_id].base[i]; - int pet_duration = spells[spell_id].max[i]; + int pet_count = spells[spell_id].base_value[i]; + int pet_duration = spells[spell_id].max_value[i]; caster->CastToClient()->Doppelganger(spell_id, this, pet_name, pet_count, pet_duration); } break; @@ -2410,10 +2410,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove #ifdef SPELL_EFFECT_SPAM snprintf(effect_desc, _EDLEN, "Defensive Proc: %s (id %d)", spells[effect_value].name, procid); #endif - if(spells[spell_id].base2[i] == 0) + if(spells[spell_id].limit_value[i] == 0) AddDefensiveProc(procid, 100,spell_id); else - AddDefensiveProc(procid, spells[spell_id].base2[i]+100,spell_id); + AddDefensiveProc(procid, spells[spell_id].limit_value[i]+100,spell_id); break; break; @@ -2499,7 +2499,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove gid = r->GetGroup(caster->GetName()); if(gid < 11) { - r->BalanceHP(spell.base[i], gid, spell.range, caster, spell.base2[i]); + r->BalanceHP(spell.base_value[i], gid, spell.range, caster, spell.limit_value[i]); break; } } @@ -2509,7 +2509,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(!g) break; - g->BalanceHP(spell.base[i], spell.range, caster, spell.base2[i]); + g->BalanceHP(spell.base_value[i], spell.range, caster, spell.limit_value[i]); break; } @@ -2527,7 +2527,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove gid = r->GetGroup(caster->GetName()); if(gid < 11) { - r->BalanceMana(spell.base[i], gid, spell.range, caster, spell.base2[i]); + r->BalanceMana(spell.base_value[i], gid, spell.range, caster, spell.limit_value[i]); break; } } @@ -2537,7 +2537,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(!g) break; - g->BalanceMana(spell.base[i], spell.range, caster, spell.base2[i]); + g->BalanceMana(spell.base_value[i], spell.range, caster, spell.limit_value[i]); break; } @@ -2559,7 +2559,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_SuspendPet: { if(IsClient()) - CastToClient()->SuspendMinion(spell.base[i]); + CastToClient()->SuspendMinion(spell.base_value[i]); break; } @@ -2616,8 +2616,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if(!caster->IsClient()) break; - int32 max_mana = spell.base[i]; - int ratio = spell.base2[i]; + int32 max_mana = spell.base_value[i]; + int ratio = spell.limit_value[i]; uint32 heal_amt = 0; if (caster->GetMana() <= max_mana){ @@ -2656,16 +2656,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_ManaDrainWithDmg: { int mana_damage = 0; - int32 mana_to_use = GetMana() - spell.base[i]; + int32 mana_to_use = GetMana() - spell.base_value[i]; if(mana_to_use > -1) { - SetMana(GetMana() - spell.base[i]); + SetMana(GetMana() - spell.base_value[i]); TryTriggerOnCastRequirement(); // we take full dmg(-10 to make the damage the right sign) - mana_damage = spell.base[i] / -10 * spell.base2[i]; + mana_damage = spell.base_value[i] / -10 * spell.limit_value[i]; Damage(caster, mana_damage, spell_id, spell.skill, false, i, true); } else { - mana_damage = GetMana() / -10 * spell.base2[i]; + mana_damage = GetMana() / -10 * spell.limit_value[i]; SetMana(0); Damage(caster, mana_damage, spell_id, spell.skill, false, i, true); } @@ -2676,16 +2676,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { if(IsClient()) { int end_damage = 0; - int32 end_to_use = CastToClient()->GetEndurance() - spell.base[i]; + int32 end_to_use = CastToClient()->GetEndurance() - spell.base_value[i]; if(end_to_use > -1) { - CastToClient()->SetEndurance(CastToClient()->GetEndurance() - spell.base[i]); + CastToClient()->SetEndurance(CastToClient()->GetEndurance() - spell.base_value[i]); TryTriggerOnCastRequirement(); // we take full dmg(-10 to make the damage the right sign) - end_damage = spell.base[i] / -10 * spell.base2[i]; + end_damage = spell.base_value[i] / -10 * spell.limit_value[i]; Damage(caster, end_damage, spell_id, spell.skill, false, i, true); } else { - end_damage = CastToClient()->GetEndurance() / -10 * spell.base2[i]; + end_damage = CastToClient()->GetEndurance() / -10 * spell.limit_value[i]; CastToClient()->SetEndurance(0); Damage(caster, end_damage, spell_id, spell.skill, false, i, true); } @@ -2695,7 +2695,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_SetBodyType: { - SetBodyType((bodyType)spell.base[i], false); + SetBodyType((bodyType)spell.base_value[i], false); break; } @@ -2716,7 +2716,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove { float value, x_vector, y_vector, hypot; - value = (float)spell.base[i]; // distance away from target + value = (float)spell.base_value[i]; // distance away from target x_vector = target_x - my_x; y_vector = target_y - my_y; @@ -2748,8 +2748,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_ManaBurn: { - int32 max_mana = spell.base[i]; - int ratio = spell.base2[i]; + int32 max_mana = spell.base_value[i]; + int ratio = spell.limit_value[i]; int32 dmg = 0; if (caster){ @@ -2778,23 +2778,23 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Taunt: { if (caster && IsNPC()){ - caster->Taunt(this->CastToNPC(), false, spell.base[i], true, spell.base2[i]); + caster->Taunt(this->CastToNPC(), false, spell.base_value[i], true, spell.limit_value[i]); } break; } case SE_AttackSpeed: - if (spell.base[i] < 100) + if (spell.base_value[i] < 100) SlowMitigation(caster); break; case SE_AttackSpeed2: - if (spell.base[i] < 100) + if (spell.base_value[i] < 100) SlowMitigation(caster); break; case SE_AttackSpeed3: - if (spell.base[i] < 0) + if (spell.base_value[i] < 0) SlowMitigation(caster); break; @@ -2805,7 +2805,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_AddHatePct: { if (IsNPC()){ - int32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base[i]) / 100; + int32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base_value[i]) / 100; if (new_hate <= 0) new_hate = 1; @@ -2842,7 +2842,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (buffslot >= 0) break; - if(!spells[spell_id].uninterruptable && IsCasting() && zone->random.Roll(spells[spell_id].base[i])) + if(!spells[spell_id].uninterruptable && IsCasting() && zone->random.Roll(spells[spell_id].base_value[i])) InterruptSpell(); break; @@ -2863,9 +2863,9 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_ApplyEffect: { - if (caster && IsValidSpell(spells[spell_id].base2[i])){ - if(zone->random.Roll(spells[spell_id].base[i])) - caster->SpellFinished(spells[spell_id].base2[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff); + if (caster && IsValidSpell(spells[spell_id].limit_value[i])){ + if(zone->random.Roll(spells[spell_id].base_value[i])) + caster->SpellFinished(spells[spell_id].limit_value[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].limit_value[i]].resist_difficulty); } break; } @@ -2881,10 +2881,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Instant_Mana_Pct: { - effect_value = spells[spell_id].base[i]; + effect_value = spells[spell_id].base_value[i]; int32 amt = abs(GetMaxMana() * effect_value / 10000); - if (spells[spell_id].max[i] && amt > spells[spell_id].max[i]) - amt = spells[spell_id].max[i]; + if (spells[spell_id].max_value[i] && amt > spells[spell_id].max_value[i]) + amt = spells[spell_id].max_value[i]; if (effect_value < 0) { SetMana(GetMana() - amt); @@ -2896,11 +2896,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove } case SE_Instant_Endurance_Pct: { - effect_value = spells[spell_id].base[i]; + effect_value = spells[spell_id].base_value[i]; if (IsClient()) { int32 amt = abs(CastToClient()->GetMaxEndurance() * effect_value / 10000); - if (spells[spell_id].max[i] && amt > spells[spell_id].max[i]) - amt = spells[spell_id].max[i]; + if (spells[spell_id].max_value[i] && amt > spells[spell_id].max_value[i]) + amt = spells[spell_id].max_value[i]; if (effect_value < 0) { CastToClient()->SetEndurance(CastToClient()->GetEndurance() - amt); @@ -2914,7 +2914,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove /*Calc for base1 is found in TryOnSpellFinished() due to needing to account for AOE functionality since effect can potentially kill caster*/ case SE_Health_Transfer: { - effect_value = spells[spell_id].base2[i]; + effect_value = spells[spell_id].limit_value[i]; int32 amt = abs(caster->GetMaxHP() * effect_value / 1000); if (effect_value < 0) @@ -2937,11 +2937,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (caster && !caster->IsClient()) break; - if (zone->random.Roll(spells[spell_id].base[i])) { - uint32 best_spell_id = caster->CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].base2[i]); + if (zone->random.Roll(spells[spell_id].base_value[i])) { + uint32 best_spell_id = caster->CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].limit_value[i]); if (caster && IsValidSpell(best_spell_id)) - caster->SpellFinished(best_spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[best_spell_id].ResistDiff); + caster->SpellFinished(best_spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[best_spell_id].resist_difficulty); } break; } @@ -2951,20 +2951,20 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (caster && caster->IsClient() && GetCastedSpellInvSlot() > 0) break; - if (zone->random.Roll(spells[spell_id].base[i]) && IsValidSpell(spells[spell_id].base2[i])) - caster->SpellFinished(spells[spell_id].base2[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].base2[i]].ResistDiff); + if (zone->random.Roll(spells[spell_id].base_value[i]) && IsValidSpell(spells[spell_id].limit_value[i])) + caster->SpellFinished(spells[spell_id].limit_value[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[spell_id].limit_value[i]].resist_difficulty); break; } case SE_Hatelist_To_Tail_Index: { - if (caster && zone->random.Roll(spells[spell_id].base[i])) + if (caster && zone->random.Roll(spells[spell_id].base_value[i])) caster->SetBottomRampageList(); break; } case SE_Hatelist_To_Top_Index: { - if (caster && zone->random.Roll(spells[spell_id].base[i])) + if (caster && zone->random.Roll(spells[spell_id].base_value[i])) caster->SetTopRampageList(); break; } @@ -2984,11 +2984,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove break; } - if (spells[spell_id].max[i] == 0 || GetLevel() <= spells[spell_id].max[i]) { - if (IsClient() && spells[spell_id].base2[i]) - Stun(spells[spell_id].base2[i]); + if (spells[spell_id].max_value[i] == 0 || GetLevel() <= spells[spell_id].max_value[i]) { + if (IsClient() && spells[spell_id].limit_value[i]) + Stun(spells[spell_id].limit_value[i]); else - Stun(spells[spell_id].base[i]); + Stun(spells[spell_id].base_value[i]); } else caster->MessageString(Chat::SpellFailure, FEAR_TOO_HIGH); @@ -2999,9 +2999,9 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (IsPet()) { Mob* petowner = GetOwner(); if (petowner) { - int shield_duration = spells[spell_id].base[i] * 12 * 1000; - int shield_target_mitigation = spells[spell_id].base2[i] ? spells[spell_id].base2[i] : 50; - int shielder_mitigation = spells[spell_id].max[i] ? spells[spell_id].base2[i] : 50; + int shield_duration = spells[spell_id].base_value[i] * 12 * 1000; + int shield_target_mitigation = spells[spell_id].limit_value[i] ? spells[spell_id].limit_value[i] : 50; + int shielder_mitigation = spells[spell_id].max_value[i] ? spells[spell_id].limit_value[i] : 50; ShieldAbility(petowner->GetID(), 25, shield_duration, shield_target_mitigation, shielder_mitigation); break; } @@ -3336,20 +3336,20 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, return 0; int formula = spells[spell_id].formula[effect_id]; - int base = spells[spell_id].base[effect_id]; - int max = spells[spell_id].max[effect_id]; + int base_value = spells[spell_id].base_value[effect_id]; + int max_value = spells[spell_id].max_value[effect_id]; int effect_value = 0; int oval = 0; if (IsBlankSpellEffect(spell_id, effect_id)) return 0; - effect_value = CalcSpellEffectValue_formula(formula, base, max, caster_level, spell_id, ticsremaining); + effect_value = CalcSpellEffectValue_formula(formula, base_value, max_value, caster_level, spell_id, ticsremaining); // this doesn't actually need to be a song to get mods, just the right skill - if (EQ::skills::IsBardInstrumentSkill(spells[spell_id].skill) - && IsInstrumentModAppliedToSpellEffect(spell_id, spells[spell_id].effectid[effect_id])) { + if (EQ::skills::IsBardInstrumentSkill(spells[spell_id].skill) + && IsInstrumentModAppliedToSpellEffect(spell_id, spells[spell_id].effect_id[effect_id])) { oval = effect_value; effect_value = effect_value * static_cast(instrument_mod) / 10; LogSpells("Effect value [{}] altered with bard modifier of [{}] to yeild [{}]", @@ -3390,13 +3390,13 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, } } - effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster, caster_id); + effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effect_id[effect_id], caster, caster_id); return effect_value; } // generic formula calculations -int Mob::CalcSpellEffectValue_formula(int formula, int base, int max, int caster_level, uint16 spell_id, int ticsremaining) +int Mob::CalcSpellEffectValue_formula(int formula, int base_value, int max_value, int caster_level, uint16 spell_id, int ticsremaining) { /* i need those formulas checked!!!! @@ -3425,7 +3425,7 @@ i need those formulas checked!!!! 0x77 = min + level / 8 */ - int result = 0, updownsign = 1, ubase = base; + int result = 0, updownsign = 1, ubase = base_value; if(ubase < 0) ubase = 0 - ubase; @@ -3438,7 +3438,7 @@ Strangely, damage spells have a negative base and positive max, but snare has both of them negative, yet their range should work the same: (meaning they both start at a negative value and the value gets lower) */ - if (max < base && max != 0) + if (max_value < base_value && max_value != 0) { // values are calculated down updownsign = -1; @@ -3450,7 +3450,7 @@ snare has both of them negative, yet their range should work the same: } LogSpells("CSEV: spell [{}], formula [{}], base [{}], max [{}], lvl [{}]. Up/Down [{}]", - spell_id, formula, base, max, caster_level, updownsign); + spell_id, formula, base_value, max_value, caster_level, updownsign); switch(formula) { @@ -3473,7 +3473,7 @@ snare has both of them negative, yet their range should work the same: case 107: { - int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration) - std::max((ticsremaining - 1), 0); + int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0); if (ticdif < 0) ticdif = 0; result = updownsign * (ubase - ticdif); @@ -3482,7 +3482,7 @@ snare has both of them negative, yet their range should work the same: } case 108: { - int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration) - std::max((ticsremaining - 1), 0); + int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0); if (ticdif < 0) ticdif = 0; result = updownsign * (ubase - (2 * ticdif)); @@ -3536,7 +3536,7 @@ snare has both of them negative, yet their range should work the same: break; case 120: { - int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration) - std::max((ticsremaining - 1), 0); + int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0); if (ticdif < 0) ticdif = 0; result = updownsign * (ubase - (5 * ticdif)); @@ -3547,7 +3547,7 @@ snare has both of them negative, yet their range should work the same: result = ubase + (caster_level / 3); break; case 122: { - int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration) - std::max((ticsremaining - 1), 0); + int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0); if(ticdif < 0) ticdif = 0; @@ -3556,7 +3556,7 @@ snare has both of them negative, yet their range should work the same: break; } case 123: // added 2/6/04 - result = zone->random.Int(ubase, std::abs(max)); + result = zone->random.Int(ubase, std::abs(max_value)); break; case 124: // check sign @@ -3649,7 +3649,7 @@ snare has both of them negative, yet their range should work the same: //these are used in stacking effects... formula unknown case 201: case 203: - result = max; + result = max_value; break; default: { @@ -3659,7 +3659,7 @@ snare has both of them negative, yet their range should work the same: { // These work like splurt, accept instead of being hard coded to 12, it is formula - 1000. // Formula 1999 seems to have a slightly different effect, so is not included here - int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration) - std::max((ticsremaining - 1), 0); + int ticdif = CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration) - std::max((ticsremaining - 1), 0); if(ticdif < 0) ticdif = 0; @@ -3679,25 +3679,25 @@ snare has both of them negative, yet their range should work the same: int oresult = result; // now check result against the allowed maximum - if (max != 0) + if (max_value != 0) { if (updownsign == 1) { - if (result > max) - result = max; + if (result > max_value) + result = max_value; } else { - if (result < max) - result = max; + if (result < max_value) + result = max_value; } } // if base is less than zero, then the result need to be negative too - if (base < 0 && result > 0) + if (base_value < 0 && result > 0) result *= -1; - LogSpells("Result: [{}] (orig [{}]), cap [{}] [{}]", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + LogSpells("Result: [{}] (orig [{}]), cap [{}] [{}]", result, oresult, max_value, (base_value < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3717,8 +3717,8 @@ void Mob::BuffProcess() continue; // DF_Permanent uses -1 DF_Aura uses -4 but we need to check negatives for some spells for some reason? - if (spells[buffs[buffs_i].spellid].buffdurationformula != DF_Permanent && - spells[buffs[buffs_i].spellid].buffdurationformula != DF_Aura) { + if (spells[buffs[buffs_i].spellid].buff_duration_formula != DF_Permanent && + spells[buffs[buffs_i].spellid].buff_duration_formula != DF_Aura) { if(!zone->BuffTimersSuspended() || !IsSuspendableSpell(buffs[buffs_i].spellid)) { --buffs[buffs_i].ticsremaining; @@ -3744,7 +3744,7 @@ void Mob::BuffProcess() { CastToClient()->SendBuffDurationPacket(buffs[buffs_i], buffs_i); // Hack to get UF to play nicer, RoF seems fine without it - if (CastToClient()->ClientVersion() == EQ::versions::ClientVersion::UF && buffs[buffs_i].numhits > 0) + if (CastToClient()->ClientVersion() == EQ::versions::ClientVersion::UF && buffs[buffs_i].hit_number > 0) CastToClient()->SendBuffNumHitPacket(buffs[buffs_i], buffs_i); buffs[buffs_i].UpdateClient = false; } @@ -3784,14 +3784,13 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) if (IsBlankSpellEffect(buff.spellid, i)) continue; - effect = spell.effectid[i]; + effect = spell.effect_id[i]; // I copied the calculation into each case which needed it instead of // doing it every time up here, since most buff effects dont need it switch (effect) { - case SE_CurrentHP: { - - if (spells[buff.spellid].base2[i] && !PassCastRestriction(spells[buff.spellid].base2[i])) { + case SE_CurrentHP: { + if (spells[buff.spellid].limit_value[i] && !PassCastRestriction(spells[buff.spellid].limit_value[i])) { break; } @@ -3918,7 +3917,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) if (zone->random.Roll(RuleI(Spells, RootBreakCheckChance))) { float resist_check = - ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster, 0, 0, 0, 0, true); + ResistSpell(spells[buff.spellid].resist_type, buff.spellid, caster, 0, 0, 0, 0, true); if (resist_check == 100) break; @@ -3931,7 +3930,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) case SE_Fear: { if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) { - float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster,0,0,true); + float resist_check = ResistSpell(spells[buff.spellid].resist_type, buff.spellid, caster,0,0,true); if (resist_check == 100) break; @@ -3975,7 +3974,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) case SE_InterruptCasting: { if (IsCasting()) { const auto &spell = spells[casting_spell_id]; - if (!spell.cast_not_standing && zone->random.Roll(spells[buff.spellid].base[i])) { + if (!spell.cast_not_standing && zone->random.Roll(spells[buff.spellid].base_value[i])) { InterruptSpell(); } } @@ -3987,7 +3986,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) case SE_CastOnFadeEffectNPC: case SE_CastOnFadeEffectAlways: { if (buff.ticsremaining == 0) { - SpellFinished(spells[buff.spellid].base[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[buff.spellid].base[i]].ResistDiff); + SpellFinished(spells[buff.spellid].base_value[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spells[buff.spellid].base_value[i]].resist_difficulty); } break; } @@ -4006,7 +4005,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) ((int(GetY()) - buff.caston_y) * (int(GetY()) - buff.caston_y)) + ((int(GetZ()) - buff.caston_z) * (int(GetZ()) - buff.caston_z)); - if (distance > (spells[buff.spellid].base[i] * spells[buff.spellid].base[i])) { + if (distance > (spells[buff.spellid].base_value[i] * spells[buff.spellid].base_value[i])) { if (!TryFadeEffect(slot)) BuffFadeBySlot(slot, true); @@ -4017,7 +4016,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) case SE_AddHateOverTimePct: { if (IsNPC()) { - uint32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base[i]) / 100; + uint32 new_hate = CastToNPC()->GetHateAmount(caster) * (100 + spell.base_value[i]) / 100; if (new_hate <= 0) new_hate = 1; @@ -4027,10 +4026,10 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) } case SE_Duration_HP_Pct: { - effect_value = spells[buff.spellid].base[i]; + effect_value = spells[buff.spellid].base_value[i]; int32 amt = abs(GetMaxHP() * effect_value / 100); - if (spells[buff.spellid].max[i] && amt > spells[buff.spellid].max[i]) - amt = spells[buff.spellid].max[i]; + if (spells[buff.spellid].max_value[i] && amt > spells[buff.spellid].max_value[i]) + amt = spells[buff.spellid].max_value[i]; if (effect_value < 0) { Damage(this, amt, 0, EQ::skills::SkillEvocation, false); @@ -4042,10 +4041,10 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) } case SE_Duration_Mana_Pct: { - effect_value = spells[buff.spellid].base[i]; + effect_value = spells[buff.spellid].base_value[i]; int32 amt = abs(GetMaxMana() * effect_value / 100); - if (spells[buff.spellid].max[i] && amt > spells[buff.spellid].max[i]) - amt = spells[buff.spellid].max[i]; + if (spells[buff.spellid].max_value[i] && amt > spells[buff.spellid].max_value[i]) + amt = spells[buff.spellid].max_value[i]; if (effect_value < 0) { @@ -4058,12 +4057,12 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) } case SE_Duration_Endurance_Pct: { - effect_value = spells[buff.spellid].base[i]; + effect_value = spells[buff.spellid].base_value[i]; if (IsClient()) { int32 amt = abs(CastToClient()->GetMaxEndurance() * effect_value / 100); - if (spells[buff.spellid].max[i] && amt > spells[buff.spellid].max[i]) - amt = spells[buff.spellid].max[i]; + if (spells[buff.spellid].max_value[i] && amt > spells[buff.spellid].max_value[i]) + amt = spells[buff.spellid].max_value[i]; if (effect_value < 0) { CastToClient()->SetEndurance(CastToClient()->GetEndurance() - amt); @@ -4129,7 +4128,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if(IsBlankSpellEffect(buffs[slot].spellid, i)) continue; - switch (spells[buffs[slot].spellid].effectid[i]) + switch (spells[buffs[slot].spellid].effect_id[i]) { case SE_AddMeleeProc: case SE_WeaponProc: @@ -4315,7 +4314,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) for (unsigned int j = 0; j < buff_count; j++) { if (IsValidSpell(tar->GetBuffs()[j].spellid)) { auto spell = spells[tar->GetBuffs()[j].spellid]; - if (spell.goodEffect == 0 && IsEffectInSpell(spell.id, SE_CurrentHP) && tar->GetBuffs()[j].casterid == GetID()) { + if (spell.good_effect == 0 && IsEffectInSpell(spell.id, SE_CurrentHP) && tar->GetBuffs()[j].casterid == GetID()) { tar->BuffFadeBySpellID(spell.id); } } @@ -4329,7 +4328,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) for (unsigned int j = 0; j < buff_count; j++) { if (IsValidSpell(GetBuffs()[j].spellid )) { auto spell = spells[this->GetBuffs()[j].spellid]; - if (spell.goodEffect == 0 && IsEffectInSpell(spell.id, SE_CurrentHP)) { + if (spell.good_effect == 0 && IsEffectInSpell(spell.id, SE_CurrentHP)) { BuffFadeBySpellID(spell.id); } } @@ -4500,7 +4499,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) for(uint32 d = 0; d < buff_max; d++) { - if(IsValidSpell(buffs[d].spellid) && (buffs[d].numhits > 0)) { + if(IsValidSpell(buffs[d].spellid) && (buffs[d].hit_number > 0)) { Numhits(true); found_numhits = true; } @@ -4510,8 +4509,8 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) Numhits(false); } - if (spells[buffs[slot].spellid].NimbusEffect > 0) - RemoveNimbusEffect(spells[buffs[slot].spellid].NimbusEffect); + if (spells[buffs[slot].spellid].nimbus_effect > 0) + RemoveNimbusEffect(spells[buffs[slot].spellid].nimbus_effect); buffs[slot].spellid = SPELL_UNKNOWN; if(IsPet() && GetOwner() && GetOwner()->IsClient()) { @@ -4563,8 +4562,8 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) int spell_level = 0; int lvldiff = 0; uint32 effect = 0; - int32 base1 = 0; - int32 base2 = 0; + int32 base_value = 0; + int32 limit_value = 0; uint32 slot = 0; int index_id = -1; @@ -4589,8 +4588,8 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) for (const auto &e : rank.effects) { effect = e.effect_id; - base1 = e.base1; - base2 = e.base2; + base_value = e.base_value; + limit_value = e.limit_value; slot = e.slot; /* @@ -4632,24 +4631,24 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) // Handle Focus Limits case SE_LimitResist: - if (base1 < 0) { - if (spell.resisttype == -base1) { // Exclude + if (base_value < 0) { + if (spell.resist_type == -base_value) { // Exclude LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitResist] = true; - if (spell.resisttype == base1) { // Include + if (spell.resist_type == base_value) { // Include LimitInclude[IncludeFoundSELimitResist] = true; } } break; case SE_LimitInstant: - if (base1 == 1 && spell.buffduration) { // Fail if not instant + if (base_value == 1 && spell.buff_duration) { // Fail if not instant LimitFailure = true; } - if (base1 == 0 && (spell.buffduration == 0)) { // Fail if instant + if (base_value == 0 && (spell.buff_duration == 0)) { // Fail if instant LimitFailure = true; } @@ -4657,12 +4656,12 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) case SE_LimitMaxLevel: spell_level = spell.classes[(GetClass() % 17) - 1]; - lvldiff = spell_level - base1; + lvldiff = spell_level - base_value; // every level over cap reduces the effect by base2 percent unless from a clicky when // ItemCastsUseFocus is true if (lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) { - if (base2 > 0) { - lvlModifier -= base2 * lvldiff; + if (limit_value > 0) { + lvlModifier -= limit_value * lvldiff; if (lvlModifier < 1) { LimitFailure = true; } @@ -4674,59 +4673,59 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) break; case SE_LimitMinLevel: - if ((spell.classes[(GetClass() % 17) - 1]) < base1) { + if ((spell.classes[(GetClass() % 17) - 1]) < base_value) { LimitFailure = true; } break; case SE_LimitCastTimeMin: - if (static_cast(spell.cast_time) < base1) { + if (static_cast(spell.cast_time) < base_value) { LimitFailure = true; } break; case SE_LimitCastTimeMax: - if (static_cast(spell.cast_time) > base1) { + if (static_cast(spell.cast_time) > base_value) { LimitFailure = true; } break; case SE_LimitSpell: - if (base1 < 0) { // Exclude - if (spell_id == -base1) { + if (base_value < 0) { // Exclude + if (spell_id == -base_value) { LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitSpell] = true; - if (spell_id == base1) { // Include + if (spell_id == base_value) { // Include LimitInclude[IncludeFoundSELimitSpell] = true; } } break; case SE_LimitMinDur: - if (base1 > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration)) { + if (base_value > CalcBuffDuration_formula(GetLevel(), spell.buff_duration_formula, spell.buff_duration)) { LimitFailure = true; } break; case SE_LimitEffect: - if (base1 < 0) { - if (IsEffectInSpell(spell_id, -base1)) { // Exclude + if (base_value < 0) { + if (IsEffectInSpell(spell_id, -base_value)) { // Exclude LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitEffect] = true; // they use 33 here for all classes ... unsure if the type check is really needed - if (base1 == SE_SummonPet && type == focusReagentCost) { + if (base_value == SE_SummonPet && type == focusReagentCost) { if (IsSummonPetSpell(spell_id) || IsSummonSkeletonSpell(spell_id)) { LimitInclude[IncludeFoundSELimitEffect] = true; } } else { - if (IsEffectInSpell(spell_id, base1)) { // Include + if (IsEffectInSpell(spell_id, base_value)) { // Include LimitInclude[IncludeFoundSELimitEffect] = true; } } @@ -4734,7 +4733,7 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) break; case SE_LimitSpellType: - switch (base1) { + switch (base_value) { case 0: if (!IsDetrimentalSpell(spell_id)) { LimitFailure = true; @@ -4749,92 +4748,92 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) break; case SE_LimitManaMin: - if (spell.mana < base1) { + if (spell.mana < base_value) { LimitFailure = true; } break; case SE_LimitManaMax: - if (spell.mana > base1) { + if (spell.mana > base_value) { LimitFailure = true; } break; case SE_LimitTarget: - if (base1 < 0) { - if (-base1 == spell.targettype) { // Exclude + if (base_value < 0) { + if (-base_value == spell.target_type) { // Exclude LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitTarget] = true; - if (base1 == spell.targettype) { // Include + if (base_value == spell.target_type) { // Include LimitInclude[IncludeFoundSELimitTarget] = true; } } break; case SE_LimitCombatSkills: - if (base1 == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) { // Exclude Discs / Procs + if (base_value == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) { // Exclude Discs / Procs LimitFailure = true; } - else if (base1 == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) { // Exclude Spells + else if (base_value == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) { // Exclude Spells LimitFailure = true; } break; case SE_LimitSpellGroup: - if (base1 < 0) { - if (-base1 == spell.spellgroup) { // Exclude + if (base_value < 0) { + if (-base_value == spell.spell_group) { // Exclude LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitSpellGroup] = true; - if (base1 == spell.spellgroup) { // Include + if (base_value == spell.spell_group) { // Include LimitInclude[IncludeFoundSELimitSpellGroup] = true; } } break; case SE_LimitCastingSkill: - if (base1 < 0) { - if (-base1 == spell.skill) { + if (base_value < 0) { + if (-base_value == spell.skill) { LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitCastingSkill] = true; - if (base1 == spell.skill) { + if (base_value == spell.skill) { LimitInclude[IncludeFoundSELimitCastingSkill] = true; } } break; case SE_LimitSpellClass: - if (base1 < 0) { // Exclude - if (-base1 == spell.spell_class) { + if (base_value < 0) { // Exclude + if (-base_value == spell.spell_class) { LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitSpellClass] = true; - if (base1 == spell.spell_class) { // Include + if (base_value == spell.spell_class) { // Include LimitInclude[IncludeFoundSELimitSpellClass] = true; } } break; case SE_LimitSpellSubclass: - if (base1 < 0) { // Exclude - if (-base1 == spell.spell_subclass) { + if (base_value < 0) { // Exclude + if (-base_value == spell.spell_subclass) { LimitFailure = true; } } else { LimitInclude[IncludeExistsSELimitSpellSubclass] = true; - if (base1 == spell.spell_subclass) { // Include + if (base_value == spell.spell_subclass) { // Include LimitInclude[IncludeFoundSELimitSpellSubclass] = true; } } @@ -4843,75 +4842,75 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) case SE_LimitClass: // Do not use this limit more then once per spell. If multiple class, treat value like items // would. - if (!PassLimitClass(base1, GetClass())) { + if (!PassLimitClass(base_value, GetClass())) { LimitFailure = true; } break; case SE_LimitRace: - if (base1 != GetRace()) { + if (base_value != GetRace()) { LimitFailure = true; } break; case SE_LimitUseMin: - if (base1 > spell.numhits) { + if (base_value > spell.hit_number) { LimitFailure = true; } break; case SE_LimitUseType: - if (base1 != spell.numhitstype) { + if (base_value != spell.hit_number_type) { LimitFailure = true; } break; case SE_Ff_DurationMax: - if (base1 > spell.buffduration) { + if (base_value > spell.buff_duration) { LimitFailure = true; } break; case SE_Ff_Endurance_Min: - if (spell.EndurCost < base1) { + if (spell.endurance_cost < base_value) { LimitFailure = true; } break; case SE_Ff_Endurance_Max: - if (spell.EndurCost > base1) { + if (spell.endurance_cost > base_value) { LimitFailure = true; } break; case SE_Ff_ReuseTimeMin: - if (spell.recast_time < base1) { + if (spell.recast_time < base_value) { LimitFailure = true; } break; case SE_Ff_ReuseTimeMax: - if (spell.recast_time > base1) { + if (spell.recast_time > base_value) { LimitFailure = true; } break; case SE_Ff_Value_Min: - index_id = GetSpellEffectIndex(spell_id, base2); - if (index_id >= 0 && spell.base[index_id] < base1) { + index_id = GetSpellEffectIndex(spell_id, limit_value); + if (index_id >= 0 && spell.base_value[index_id] < base_value) { LimitFailure = true; } break; case SE_Ff_Value_Max: - index_id = GetSpellEffectIndex(spell_id, base2); - if (index_id >= 0 && spell.base[index_id] > base1) { + index_id = GetSpellEffectIndex(spell_id, limit_value); + if (index_id >= 0 && spell.base_value[index_id] > base_value) { LimitFailure = true; } break; case SE_Ff_Override_NotFocusable: - if (base1 == 1) { + if (base_value == 1) { not_focusable = false; } break; @@ -4921,7 +4920,7 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) LimitFailure = true; } else { - focus_reuse_time = base2; + focus_reuse_time = limit_value; } break; @@ -4933,98 +4932,98 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) // Handle Focus Effects case SE_ImprovedDamage: - if (type == focusImprovedDamage && base1 > value) { - value = base1; + if (type == focusImprovedDamage && base_value > value) { + value = base_value; } break; case SE_ImprovedDamage2: - if (type == focusImprovedDamage2 && base1 > value) { - value = base1; + if (type == focusImprovedDamage2 && base_value > value) { + value = base_value; } break; case SE_Fc_Amplify_Mod: - if (type == focusFcAmplifyMod && base1 > value) { - value = base1; + if (type == focusFcAmplifyMod && base_value > value) { + value = base_value; } break; case SE_ImprovedHeal: - if (type == focusImprovedHeal && base1 > value) { - value = base1; + if (type == focusImprovedHeal && base_value > value) { + value = base_value; } break; case SE_ReduceManaCost: if (type == focusManaCost) { - value = base1; + value = base_value; } break; case SE_IncreaseSpellHaste: - if (type == focusSpellHaste && base1 > value) { - value = base1; + if (type == focusSpellHaste && base_value > value) { + value = base_value; } break; case SE_Fc_CastTimeMod2: - if (type == focusFcCastTimeMod2 && base1 > value) { - value = base1; + if (type == focusFcCastTimeMod2 && base_value > value) { + value = base_value; } break; case SE_Fc_CastTimeAmt: - if (type == focusFcCastTimeAmt && base1 > value) { - value = base1; + if (type == focusFcCastTimeAmt && base_value > value) { + value = base_value; } break; case SE_IncreaseSpellDuration: - if (type == focusSpellDuration && base1 > value) { - value = base1; + if (type == focusSpellDuration && base_value > value) { + value = base_value; } break; case SE_SpellDurationIncByTic: - if (type == focusSpellDurByTic && base1 > value) { - value = base1; + if (type == focusSpellDurByTic && base_value > value) { + value = base_value; } break; case SE_SwarmPetDuration: - if (type == focusSwarmPetDuration && base1 > value) { - value = base1; + if (type == focusSwarmPetDuration && base_value > value) { + value = base_value; } break; case SE_IncreaseRange: - if (type == focusRange && base1 > value) { - value = base1; + if (type == focusRange && base_value > value) { + value = base_value; } break; case SE_ReduceReagentCost: - if (type == focusReagentCost && base1 > value) { - value = base1; + if (type == focusReagentCost && base_value > value) { + value = base_value; } break; case SE_PetPowerIncrease: - if (type == focusPetPower && base1 > value) { - value = base1; + if (type == focusPetPower && base_value > value) { + value = base_value; } break; case SE_SpellResistReduction: - if (type == focusResistRate && base1 > value) { - value = base1; + if (type == focusResistRate && base_value > value) { + value = base_value; } break; case SE_Fc_ResistIncoming: - if (type == focusFcResistIncoming && base1 > value) { - value = base1; + if (type == focusFcResistIncoming && base_value > value) { + value = base_value; } break; @@ -5032,32 +5031,32 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) if (type == focusSpellHateMod) { if (value != 0) { if (value > 0) { - if (base1 > value) { - value = base1; + if (base_value > value) { + value = base_value; } } else { - if (base1 < value) { - value = base1; + if (base_value < value) { + value = base_value; } } } else { - value = base1; + value = base_value; } } break; case SE_ReduceReuseTimer: if (type == focusReduceRecastTime) { - value = base1 / 1000; + value = base_value / 1000; } break; case SE_TriggerOnCast: if (type == focusTriggerOnCast) { - if (zone->random.Roll(base1)) { - value = base2; + if (zone->random.Roll(base_value)) { + value = limit_value; } else { value = 0; @@ -5068,19 +5067,19 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) case SE_FcSpellVulnerability: if (type == focusSpellVulnerability) { - value = base1; + value = base_value; } break; case SE_Fc_Spell_Damage_Pct_IncomingPC: if (type == focusFcSpellDamagePctIncomingPC) { - value = base1; + value = base_value; } break; case SE_BlockNextSpellFocus: if (type == focusBlockNextSpell) { - if (zone->random.Roll(base1)) { + if (zone->random.Roll(base_value)) { value = 1; } } @@ -5088,123 +5087,123 @@ int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) case SE_FcTwincast: if (type == focusTwincast && !IsEffectInSpell(spell_id, SE_TwinCastBlocker)) { - value = base1; + value = base_value; } break; // Note if using these as AA, make sure this is first focus used. case SE_SympatheticProc: if (type == focusSympatheticProc) { - value = base2; + value = limit_value; } break; case SE_FcDamageAmt: if (type == focusFcDamageAmt) { - value = base1; + value = base_value; } break; case SE_FcDamageAmt2: if (type == focusFcDamageAmt2) { - value = base1; + value = base_value; } break; case SE_Fc_Amplify_Amt: if (type == focusFcAmplifyAmt) { - value = base1; + value = base_value; } break; case SE_FcDamageAmtCrit: if (type == focusFcDamageAmtCrit) { - value = base1; + value = base_value; } break; case SE_FcDamageAmtIncoming: if (type == focusFcDamageAmtIncoming) { - value = base1; + value = base_value; } break; case SE_Fc_Spell_Damage_Amt_IncomingPC: if (type == focusFcSpellDamageAmtIncomingPC) { - value = base1; + value = base_value; } break; case SE_FcHealAmtIncoming: if (type == focusFcHealAmtIncoming) { - value = base1; + value = base_value; } break; case SE_FcHealPctCritIncoming: if (type == focusFcHealPctCritIncoming) { - value = base1; + value = base_value; } break; case SE_FcHealAmtCrit: if (type == focusFcHealAmtCrit) { - value = base1; + value = base_value; } break; case SE_FcHealAmt: if (type == focusFcHealAmt) { - value = base1; + value = base_value; } break; case SE_FcHealPctIncoming: if (type == focusFcHealPctIncoming) { - value = base1; + value = base_value; } break; case SE_FcBaseEffects: if (type == focusFcBaseEffects) { - value = base1; + value = base_value; } break; case SE_FcDamagePctCrit: if (type == focusFcDamagePctCrit) { - value = base1; + value = base_value; } break; case SE_FcIncreaseNumHits: if (type == focusIncreaseNumHits) { - value = base1; + value = base_value; } break; case SE_FcLimitUse: if (type == focusFcLimitUse) { - value = base1; + value = base_value; } break; case SE_FcMute: if (type == focusFcMute) { - value = base1; + value = base_value; } break; case SE_FcStunTimeMod: if (type == focusFcStunTimeMod) { - value = base1; + value = base_value; } break; case SE_Fc_Cast_Spell_On_Land: if (type == focusFcCastSpellOnLand) { - if (zone->random.Roll(base1)) { - value = base2; + if (zone->random.Roll(base_value)) { + value = limit_value; } break; } @@ -5278,30 +5277,30 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo for (int i = 0; i < EFFECT_COUNT; i++) { - switch (focus_spell.effectid[i]) { + switch (focus_spell.effect_id[i]) { case SE_Blank: break; case SE_LimitResist: - if (focus_spell.base[i] < 0) { - if (spell.resisttype == -focus_spell.base[i]) { // Exclude + if (focus_spell.base_value[i] < 0) { + if (spell.resist_type == -focus_spell.base_value[i]) { // Exclude return 0; } } else { LimitInclude[IncludeExistsSELimitResist] = true; - if (spell.resisttype == focus_spell.base[i]) { // Include + if (spell.resist_type == focus_spell.base_value[i]) { // Include LimitInclude[IncludeFoundSELimitResist] = true; } } break; case SE_LimitInstant: - if (focus_spell.base[i] == 1 && spell.buffduration) { // Fail if not instant + if (focus_spell.base_value[i] == 1 && spell.buff_duration) { // Fail if not instant return 0; } - if (focus_spell.base[i] == 0 && (spell.buffduration == 0)) { // Fail if instant + if (focus_spell.base_value[i] == 0 && (spell.buff_duration == 0)) { // Fail if instant return 0; } @@ -5312,13 +5311,13 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo break; } spell_level = spell.classes[(GetClass() % 17) - 1]; - lvldiff = spell_level - focus_spell.base[i]; + lvldiff = spell_level - focus_spell.base_value[i]; // every level over cap reduces the effect by focus_spell.base2[i] percent unless from a clicky // when ItemCastsUseFocus is true if (lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) { - if (focus_spell.base2[i] > 0) { - lvlModifier -= focus_spell.base2[i] * lvldiff; + if (focus_spell.limit_value[i] > 0) { + lvlModifier -= focus_spell.limit_value[i] * lvldiff; if (lvlModifier < 1) { return 0; } @@ -5333,60 +5332,60 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo if (IsNPC()) { break; } - if (spell.classes[(GetClass() % 17) - 1] < focus_spell.base[i]) { + if (spell.classes[(GetClass() % 17) - 1] < focus_spell.base_value[i]) { return (0); } break; case SE_LimitCastTimeMin: - if (spells[spell_id].cast_time < (uint16) focus_spell.base[i]) { + if (spells[spell_id].cast_time < (uint16) focus_spell.base_value[i]) { return (0); } break; case SE_LimitCastTimeMax: - if (spells[spell_id].cast_time > (uint16) focus_spell.base[i]) { + if (spells[spell_id].cast_time > (uint16) focus_spell.base_value[i]) { return (0); } break; case SE_LimitSpell: - if (focus_spell.base[i] < 0) { // Exclude - if (spell_id == -focus_spell.base[i]) { + if (focus_spell.base_value[i] < 0) { // Exclude + if (spell_id == -focus_spell.base_value[i]) { return (0); } } else { LimitInclude[IncludeExistsSELimitSpell] = true; - if (spell_id == focus_spell.base[i]) { // Include + if (spell_id == focus_spell.base_value[i]) { // Include LimitInclude[IncludeFoundSELimitSpell] = true; } } break; case SE_LimitMinDur: - if (focus_spell.base[i] > - CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration)) { + if (focus_spell.base_value[i] > + CalcBuffDuration_formula(GetLevel(), spell.buff_duration_formula, spell.buff_duration)) { return (0); } break; case SE_LimitEffect: - if (focus_spell.base[i] < 0) { - if (IsEffectInSpell(spell_id, -focus_spell.base[i])) { // Exclude + if (focus_spell.base_value[i] < 0) { + if (IsEffectInSpell(spell_id, -focus_spell.base_value[i])) { // Exclude return 0; } } else { LimitInclude[IncludeExistsSELimitEffect] = true; - if (IsEffectInSpell(spell_id, focus_spell.base[i])) { // Include + if (IsEffectInSpell(spell_id, focus_spell.base_value[i])) { // Include LimitInclude[IncludeFoundSELimitEffect] = true; } } break; case SE_LimitSpellType: - switch (focus_spell.base[i]) { + switch (focus_spell.base_value[i]) { case 0: if (!IsDetrimentalSpell(spell_id)) { return 0; @@ -5398,71 +5397,71 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo } break; default: - LogInfo("CalcFocusEffect: unknown limit spelltype [{}]", focus_spell.base[i]); + LogInfo("CalcFocusEffect: unknown limit spelltype [{}]", focus_spell.base_value[i]); break; } break; case SE_LimitManaMin: - if (spell.mana < focus_spell.base[i]) { + if (spell.mana < focus_spell.base_value[i]) { return 0; } break; case SE_LimitManaMax: - if (spell.mana > focus_spell.base[i]) { + if (spell.mana > focus_spell.base_value[i]) { return 0; } break; case SE_LimitTarget: - if (focus_spell.base[i] < 0) { - if (-focus_spell.base[i] == spell.targettype) { // Exclude + if (focus_spell.base_value[i] < 0) { + if (-focus_spell.base_value[i] == spell.target_type) { // Exclude return 0; } } else { LimitInclude[IncludeExistsSELimitTarget] = true; - if (focus_spell.base[i] == spell.targettype) { // Include + if (focus_spell.base_value[i] == spell.target_type) { // Include LimitInclude[IncludeFoundSELimitTarget] = true; } } break; case SE_LimitCombatSkills: - if (focus_spell.base[i] == 0 && + if (focus_spell.base_value[i] == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) { // Exclude Discs / Procs return 0; } - else if (focus_spell.base[i] == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) { // Exclude Spells + else if (focus_spell.base_value[i] == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) { // Exclude Spells return 0; } break; case SE_LimitSpellGroup: - if (focus_spell.base[i] < 0) { - if (-focus_spell.base[i] == spell.spellgroup) { // Exclude + if (focus_spell.base_value[i] < 0) { + if (-focus_spell.base_value[i] == spell.spell_group) { // Exclude return 0; } } else { LimitInclude[IncludeExistsSELimitSpellGroup] = true; - if (focus_spell.base[i] == spell.spellgroup) { // Include + if (focus_spell.base_value[i] == spell.spell_group) { // Include LimitInclude[IncludeFoundSELimitSpellGroup] = true; } } break; case SE_LimitCastingSkill: - if (focus_spell.base[i] < 0) { - if (-focus_spell.base[i] == spell.skill) { + if (focus_spell.base_value[i] < 0) { + if (-focus_spell.base_value[i] == spell.skill) { return 0; } } else { LimitInclude[IncludeExistsSELimitCastingSkill] = true; - if (focus_spell.base[i] == spell.skill) { + if (focus_spell.base_value[i] == spell.skill) { LimitInclude[IncludeFoundSELimitCastingSkill] = true; } } @@ -5471,70 +5470,70 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo case SE_LimitClass: // Do not use this limit more then once per spell. If multiple class, treat value like items // would. - if (!PassLimitClass(focus_spell.base[i], GetClass())) { + if (!PassLimitClass(focus_spell.base_value[i], GetClass())) { return 0; } break; case SE_LimitRace: - if (focus_spell.base[i] != GetRace()) { + if (focus_spell.base_value[i] != GetRace()) { return 0; } break; case SE_LimitUseMin: - if (focus_spell.base[i] > spell.numhits) { + if (focus_spell.base_value[i] > spell.hit_number) { return 0; } break; case SE_LimitUseType: - if (focus_spell.base[i] != spell.numhitstype) { + if (focus_spell.base_value[i] != spell.hit_number_type) { return 0; } break; case SE_CastonFocusEffect: - if (focus_spell.base[i] > 0) { - Caston_spell_id = focus_spell.base[i]; + if (focus_spell.base_value[i] > 0) { + Caston_spell_id = focus_spell.base_value[i]; } break; case SE_LimitSpellClass: - if (focus_spell.base[i] < 0) { // Exclude - if (-focus_spell.base[i] == spell.spell_class) { + if (focus_spell.base_value[i] < 0) { // Exclude + if (-focus_spell.base_value[i] == spell.spell_class) { return 0; } } else { LimitInclude[IncludeExistsSELimitSpellClass] = true; - if (focus_spell.base[i] == spell.spell_class) { // Include + if (focus_spell.base_value[i] == spell.spell_class) { // Include LimitInclude[IncludeFoundSELimitSpellClass] = true; } } break; case SE_LimitSpellSubclass: - if (focus_spell.base[i] < 0) { // Exclude - if (-focus_spell.base[i] == spell.spell_subclass) { + if (focus_spell.base_value[i] < 0) { // Exclude + if (-focus_spell.base_value[i] == spell.spell_subclass) { return 0; } } else { LimitInclude[IncludeExistsSELimitSpellSubclass] = true; - if (focus_spell.base[i] == spell.spell_subclass) { // Include + if (focus_spell.base_value[i] == spell.spell_subclass) { // Include LimitInclude[IncludeFoundSELimitSpellSubclass] = true; } } break; case SE_Ff_Same_Caster://hmm do i need to pass casterid from buff slot here - if (focus_spell.base[i] == 0) { + if (focus_spell.base_value[i] == 0) { if (casterid == GetID()) { return 0; }//Mob casting is same as target, fail if you are casting on yourself. } - else if (focus_spell.base[i] == 1) { + else if (focus_spell.base_value[i] == 1) { if (casterid != GetID()) { return 0; }//Mob casting is not same as target, fail if you are not casting on yourself. @@ -5543,51 +5542,51 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo case SE_Ff_CasterClass: // Do not use this limit more then once per spell. If multiple class, treat value like items would. - if (!PassLimitClass(focus_spell.base[i], GetClass())) { + if (!PassLimitClass(focus_spell.base_value[i], GetClass())) { return 0; } break; case SE_Ff_DurationMax: - if (focus_spell.base[i] > spell.buffduration) { + if (focus_spell.base_value[i] > spell.buff_duration) { return 0; } break; case SE_Ff_Endurance_Min: - if (spell.EndurCost < focus_spell.base[i]) { + if (spell.endurance_cost < focus_spell.base_value[i]) { return 0; } break; case SE_Ff_Endurance_Max: - if (spell.EndurCost > focus_spell.base[i]) { + if (spell.endurance_cost > focus_spell.base_value[i]) { return 0; } break; case SE_Ff_ReuseTimeMin: - if (spell.recast_time < focus_spell.base[i]) { + if (spell.recast_time < focus_spell.base_value[i]) { return 0; } break; case SE_Ff_ReuseTimeMax: - if (spell.recast_time > focus_spell.base[i]) { + if (spell.recast_time > focus_spell.base_value[i]) { return 0; } break; case SE_Ff_Value_Min: - index_id = GetSpellEffectIndex(spell_id, focus_spell.base2[i]); - if (index_id >= 0 && spell.base[index_id] < focus_spell.base[i]) { + index_id = GetSpellEffectIndex(spell_id, focus_spell.limit_value[i]); + if (index_id >= 0 && spell.base_value[index_id] < focus_spell.base_value[i]) { return 0; } break; case SE_Ff_Value_Max: - index_id = GetSpellEffectIndex(spell_id, focus_spell.base2[i]); - if (index_id >= 0 && spell.base[index_id] > focus_spell.base[i]) { + index_id = GetSpellEffectIndex(spell_id, focus_spell.limit_value[i]); + if (index_id >= 0 && spell.base_value[index_id] > focus_spell.base_value[i]) { return 0; } break; @@ -5597,123 +5596,123 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; } else { - focus_reuse_time = focus_spell.base2[i]; + focus_reuse_time = focus_spell.limit_value[i]; } break; // handle effects case SE_ImprovedDamage: if (type == focusImprovedDamage) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_ImprovedDamage2: if (type == focusImprovedDamage2) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_Fc_Amplify_Mod: - if (type == focusFcAmplifyMod && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusFcAmplifyMod && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_ImprovedHeal: if (type == focusImprovedHeal) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_ReduceManaCost: if (type == focusManaCost) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_IncreaseSpellHaste: - if (type == focusSpellHaste && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusSpellHaste && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_Fc_CastTimeMod2: - if (type == focusFcCastTimeMod2 && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusFcCastTimeMod2 && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_Fc_CastTimeAmt: - if (type == focusFcCastTimeAmt && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusFcCastTimeAmt && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_IncreaseSpellDuration: - if (type == focusSpellDuration && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusSpellDuration && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_SpellDurationIncByTic: - if (type == focusSpellDurByTic && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusSpellDurByTic && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_SwarmPetDuration: - if (type == focusSwarmPetDuration && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusSwarmPetDuration && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_IncreaseRange: - if (type == focusRange && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusRange && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_ReduceReagentCost: if (type == focusReagentCost) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_PetPowerIncrease: - if (type == focusPetPower && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusPetPower && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_SpellResistReduction: if (type == focusResistRate) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_Fc_ResistIncoming: - if (type == focusFcResistIncoming && focus_spell.base[i] > value) { - value = focus_spell.base[i]; + if (type == focusFcResistIncoming && focus_spell.base_value[i] > value) { + value = focus_spell.base_value[i]; } break; case SE_SpellHateMod: if (type == focusSpellHateMod) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_ReduceReuseTimer: if (type == focusReduceRecastTime) { - value = focus_spell.base[i] / 1000; + value = focus_spell.base_value[i] / 1000; } break; case SE_TriggerOnCast: if (type == focusTriggerOnCast) { - if (zone->random.Roll(focus_spell.base[i])) { - value = focus_spell.base2[i]; + if (zone->random.Roll(focus_spell.base_value[i])) { + value = focus_spell.limit_value[i]; } else { value = 0; @@ -5723,7 +5722,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo case SE_BlockNextSpellFocus: if (type == focusBlockNextSpell) { - if (zone->random.Roll(focus_spell.base[i])) { + if (zone->random.Roll(focus_spell.base_value[i])) { value = 1; } } @@ -5737,140 +5736,140 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo case SE_FcSpellVulnerability: if (type == focusSpellVulnerability) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_Fc_Spell_Damage_Pct_IncomingPC: if (type == focusFcSpellDamagePctIncomingPC) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_FcTwincast: if (type == focusTwincast && !IsEffectInSpell(spell_id, SE_TwinCastBlocker)) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcDamageAmt: if (type == focusFcDamageAmt) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcDamageAmt2: if (type == focusFcDamageAmt2) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_Fc_Amplify_Amt: if (type == focusFcAmplifyAmt) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcDamageAmtCrit: if (type == focusFcDamageAmtCrit) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcDamageAmtIncoming: if (type == focusFcDamageAmtIncoming) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_Fc_Spell_Damage_Amt_IncomingPC: if (type == focusFcSpellDamageAmtIncomingPC) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcHealAmtIncoming: if (type == focusFcHealAmtIncoming) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcDamagePctCrit: if (type == focusFcDamagePctCrit) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcHealPctCritIncoming: if (type == focusFcHealPctCritIncoming) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_FcHealAmtCrit: if (type == focusFcHealAmtCrit) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcHealAmt: if (type == focusFcHealAmt) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcHealPctIncoming: if (type == focusFcHealPctIncoming) { - value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); + value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } break; case SE_FcBaseEffects: if (type == focusFcBaseEffects) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcIncreaseNumHits: if (type == focusIncreaseNumHits) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcLimitUse: if (type == focusFcLimitUse) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcMute: if (type == focusFcMute) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcStunTimeMod: if (type == focusFcStunTimeMod) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcTimerRefresh: if (type == focusFcTimerRefresh) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_FcTimerLockout: if (type == focusFcTimerLockout) { - value = focus_spell.base[i]; + value = focus_spell.base_value[i]; } break; case SE_Fc_Cast_Spell_On_Land: if (type == focusFcCastSpellOnLand) { - if (zone->random.Roll(focus_spell.base[i])) { - value = focus_spell.base2[i]; + if (zone->random.Roll(focus_spell.base_value[i])) { + value = focus_spell.limit_value[i]; } break; } @@ -5880,7 +5879,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo // since they have all kinds of extra effects on them. default: LogInfo("CalcFocusEffect: unknown effectid [{}]", - focus_spell.effectid[i]); + focus_spell.effect_id[i]); #endif } } @@ -5899,7 +5898,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo EQ::spells::CastingSlot::Item, 0, -1, - spells[Caston_spell_id].ResistDiff + spells[Caston_spell_id].resist_difficulty ); } } @@ -6018,12 +6017,12 @@ bool Mob::TryTriggerOnCastProc(uint16 focusspellid, uint16 spell_id, uint16 proc if (IsValidSpell(proc_spellid) && spell_id != focusspellid && spell_id != proc_spellid) { Mob* proc_target = GetTarget(); if (proc_target) { - SpellFinished(proc_spellid, proc_target, EQ::spells::CastingSlot::Item, 0, -1, spells[proc_spellid].ResistDiff); + SpellFinished(proc_spellid, proc_target, EQ::spells::CastingSlot::Item, 0, -1, spells[proc_spellid].resist_difficulty); return true; } // Edge cases where proc spell does not require a target such as PBAE, allows proc to still occur even if target potentially dead. Live spells exist with PBAE procs. else if (!SpellRequiresTarget(proc_spellid)) { - SpellFinished(proc_spellid, this, EQ::spells::CastingSlot::Item, 0, -1, spells[proc_spellid].ResistDiff); + SpellFinished(proc_spellid, this, EQ::spells::CastingSlot::Item, 0, -1, spells[proc_spellid].resist_difficulty); return true; } } @@ -6059,7 +6058,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { proc_spellid = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id); if (IsValidSpell(proc_spellid)){ - ProcChance = GetSympatheticProcChances(spell_id, spells[TempItem->Focus.Effect].base[0], TempItem->ProcRate); + ProcChance = GetSympatheticProcChances(spell_id, spells[TempItem->Focus.Effect].base_value[0], TempItem->ProcRate); if(zone->random.Roll(ProcChance)) SympatheticProcList.push_back(proc_spellid); } @@ -6078,7 +6077,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { if (TempItemAug && TempItemAug->Focus.Effect > 0 && IsValidSpell(TempItemAug->Focus.Effect)) { proc_spellid = CalcFocusEffect(type, TempItemAug->Focus.Effect, spell_id); if (IsValidSpell(proc_spellid)){ - ProcChance = GetSympatheticProcChances(spell_id, spells[TempItemAug->Focus.Effect].base[0], TempItemAug->ProcRate); + ProcChance = GetSympatheticProcChances(spell_id, spells[TempItemAug->Focus.Effect].base_value[0], TempItemAug->ProcRate); if(zone->random.Roll(ProcChance)) SympatheticProcList.push_back(proc_spellid); } @@ -6133,7 +6132,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { proc_spellid = CalcAAFocus(type, *rank, spell_id); if (IsValidSpell(proc_spellid)) { - ProcChance = GetSympatheticProcChances(spell_id, rank->effects[0].base1); + ProcChance = GetSympatheticProcChances(spell_id, rank->effects[0].base_value); if (zone->random.Roll(ProcChance)) SympatheticProcList.push_back(proc_spellid); } @@ -6381,7 +6380,7 @@ int32 Client::GetFocusEffect(focusType type, uint16 spell_id) realTotal2 = CalcFocusEffect(type, focusspell_tracker, spell_id); // For effects like gift of mana that only fire once, save the spellid into an array that consists of all available buff slots. - if(buff_tracker >= 0 && buffs[buff_tracker].numhits > 0) { + if(buff_tracker >= 0 && buffs[buff_tracker].hit_number > 0) { m_spellHitsLeft[buff_tracker] = focusspell_tracker; } } @@ -6537,7 +6536,7 @@ int32 NPC::GetFocusEffect(focusType type, uint16 spell_id) { realTotal2 = CalcFocusEffect(type, focusspell_tracker, spell_id); // For effects like gift of mana that only fire once, save the spellid into an array that consists of all available buff slots. - if(buff_tracker >= 0 && buffs[buff_tracker].numhits > 0) { + if(buff_tracker >= 0 && buffs[buff_tracker].hit_number > 0) { m_spellHitsLeft[buff_tracker] = focusspell_tracker; } } @@ -6577,16 +6576,16 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) //Spell specific procs [Type 7,10,11] if (IsValidSpell(spell_id)) { for (int d = 0; d < buff_max; d++) { - if (buffs[d].spellid == spell_id && buffs[d].numhits > 0 && - spells[buffs[d].spellid].numhitstype == static_cast(type)) { + if (buffs[d].spellid == spell_id && buffs[d].hit_number > 0 && + spells[buffs[d].spellid].hit_number_type == static_cast(type)) { #ifdef BOTS buff_name = spells[buffs[d].spellid].name; - buff_counter = (buffs[d].numhits - 1); + buff_counter = (buffs[d].hit_number - 1); buff_update = true; #endif - if (--buffs[d].numhits == 0) { + if (--buffs[d].hit_number == 0) { CastOnNumHitFade(buffs[d].spellid); if (!TryFadeEffect(d)) BuffFadeBySlot(d, true); @@ -6597,11 +6596,11 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) } } else if (type == NumHit::MatchingSpells) { if (buff_slot >= 0) { - if (--buffs[buff_slot].numhits == 0) { + if (--buffs[buff_slot].hit_number == 0) { #ifdef BOTS buff_name = spells[buffs[buff_slot].spellid].name; - buff_counter = (buffs[buff_slot].numhits - 1); + buff_counter = (buffs[buff_slot].hit_number - 1); buff_update = true; #endif @@ -6620,11 +6619,11 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) #ifdef BOTS buff_name = spells[buffs[d].spellid].name; - buff_counter = (buffs[d].numhits - 1); + buff_counter = (buffs[d].hit_number - 1); buff_update = true; #endif - if (--buffs[d].numhits == 0) { + if (--buffs[d].hit_number == 0) { CastOnNumHitFade(buffs[d].spellid); m_spellHitsLeft[d] = 0; if (!TryFadeEffect(d)) @@ -6637,16 +6636,16 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) } } else { for (int d = 0; d < buff_max; d++) { - if (IsValidSpell(buffs[d].spellid) && buffs[d].numhits > 0 && - spells[buffs[d].spellid].numhitstype == static_cast(type)) { + if (IsValidSpell(buffs[d].spellid) && buffs[d].hit_number > 0 && + spells[buffs[d].spellid].hit_number_type == static_cast(type)) { #ifdef BOTS buff_name = spells[buffs[d].spellid].name; - buff_counter = (buffs[d].numhits - 1); + buff_counter = (buffs[d].hit_number - 1); buff_update = true; #endif - if (--buffs[d].numhits == 0) { + if (--buffs[d].hit_number == 0) { CastOnNumHitFade(buffs[d].spellid); if (!TryFadeEffect(d)) BuffFadeBySlot(d, true); @@ -6684,7 +6683,7 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) uint16 Mob::GetProcID(uint16 spell_id, uint8 effect_index) { if (!RuleB(Spells, SHDProcIDOffByOne)) // UF+ spell files - return spells[spell_id].base[effect_index]; + return spells[spell_id].base_value[effect_index]; // We should actually just be checking if the mob is SHD, but to not force // custom servers to create new spells, we will still do this @@ -6701,9 +6700,9 @@ uint16 Mob::GetProcID(uint16 spell_id, uint8 effect_index) } if (sk && !other) - return spells[spell_id].base[effect_index] + 1; + return spells[spell_id].base_value[effect_index] + 1; else - return spells[spell_id].base[effect_index]; + return spells[spell_id].base_value[effect_index]; } bool Mob::TryDivineSave() @@ -6896,8 +6895,8 @@ float Mob::GetSympatheticProcChances(uint16 spell_id, int16 ProcRateMod, int32 I int16 Mob::GetSympatheticSpellProcRate(uint16 spell_id) { for (int i = 0; i < EFFECT_COUNT; i++){ - if (spells[spell_id].effectid[i] == SE_SympatheticProc) - return spells[spell_id].base[i]; + if (spells[spell_id].effect_id[i] == SE_SympatheticProc) + return spells[spell_id].base_value[i]; } return 0; @@ -6906,8 +6905,8 @@ int16 Mob::GetSympatheticSpellProcRate(uint16 spell_id) uint16 Mob::GetSympatheticSpellProcID(uint16 spell_id) { for (int i = 0; i < EFFECT_COUNT; i++){ - if (spells[spell_id].effectid[i] == SE_SympatheticProc) - return spells[spell_id].base2[i]; + if (spells[spell_id].effect_id[i] == SE_SympatheticProc) + return spells[spell_id].limit_value[i]; } return 0; @@ -6948,17 +6947,17 @@ int32 Mob::GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill, int32 temp_dmg = 0; for (int e = 0; e < EFFECT_COUNT; e++) { - if (spells[buffs[i].spellid].effectid[e] == SE_FcDamageAmtIncoming){ - temp_dmg += spells[buffs[i].spellid].base[e]; + if (spells[buffs[i].spellid].effect_id[e] == SE_FcDamageAmtIncoming){ + temp_dmg += spells[buffs[i].spellid].base_value[e]; continue; } if (!skill_found){ - if ((spells[buffs[i].spellid].effectid[e] == SE_LimitToSkill) || - (spells[buffs[i].spellid].effectid[e] == SE_LimitCastingSkill)){ + if ((spells[buffs[i].spellid].effect_id[e] == SE_LimitToSkill) || + (spells[buffs[i].spellid].effect_id[e] == SE_LimitCastingSkill)){ limit_exists = true; - if (spells[buffs[i].spellid].base[e] == skill) + if (spells[buffs[i].spellid].base_value[e] == skill) skill_found = true; } } @@ -7086,18 +7085,18 @@ uint16 Mob::GetSpellEffectResistChance(uint16 spell_id) for(int d = 0; d < MAX_RESISTABLE_EFFECTS*2; d+=2) { - if (spells[spell_id].effectid[i] == aabonuses.SEResist[d]){ + if (spells[spell_id].effect_id[i] == aabonuses.SEResist[d]){ resist_chance += aabonuses.SEResist[d+1]; found = true; } - if (spells[spell_id].effectid[i] == itembonuses.SEResist[d]){ + if (spells[spell_id].effect_id[i] == itembonuses.SEResist[d]){ resist_chance += itembonuses.SEResist[d+1]; found = true; } - if (spells[spell_id].effectid[i] == spellbonuses.SEResist[d]){ + if (spells[spell_id].effect_id[i] == spellbonuses.SEResist[d]){ resist_chance += spellbonuses.SEResist[d+1]; found = true; } @@ -8129,7 +8128,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed) { if (!spell_target) return false; - uint8 anim = spells[spell_id].CastingAnim; + uint8 anim = spells[spell_id].casting_animation; int slot = -1; //Make sure there is an avialable bolt to be cast. @@ -8193,7 +8192,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed) { //This allows limited support for server using older spell files that do not contain data for bolt graphics. else { //Only use fire graphic for fire spells. - if (spells[spell_id].resisttype == RESIST_FIRE) { + if (spells[spell_id].resist_type == RESIST_FIRE) { if (IsClient()) { if (CastToClient()->ClientVersionBit() <= 4) //Titanium needs alternate graphic. @@ -8210,7 +8209,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed) { ProjectileAnimation(spell_target, 0, 1, speed, 0.0f, 0.0f, arc); } - if (spells[spell_id].CastingAnim == 64) + if (spells[spell_id].casting_animation == 64) anim = 44; //Corrects for animation error. DoAnim(anim, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells); //Override the default projectile animation. @@ -8224,24 +8223,24 @@ void Mob::ResourceTap(int32 damage, uint16 spellid) return; for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[spellid].effectid[i] == SE_ResourceTap) { - damage = (damage * spells[spellid].base[i]) / 1000; + if (spells[spellid].effect_id[i] == SE_ResourceTap) { + damage = (damage * spells[spellid].base_value[i]) / 1000; if (damage) { - if (spells[spellid].max[i] && (damage > spells[spellid].max[i])) - damage = spells[spellid].max[i]; + if (spells[spellid].max_value[i] && (damage > spells[spellid].max_value[i])) + damage = spells[spellid].max_value[i]; - if (spells[spellid].base2[i] == 0) { // HP Tap + if (spells[spellid].limit_value[i] == 0) { // HP Tap if (damage > 0) HealDamage(damage); else Damage(this, -damage, 0, EQ::skills::SkillEvocation, false); } - if (spells[spellid].base2[i] == 1) // Mana Tap + if (spells[spellid].limit_value[i] == 1) // Mana Tap SetMana(GetMana() + damage); - if (spells[spellid].base2[i] == 2 && IsClient()) // Endurance Tap + if (spells[spellid].limit_value[i] == 2 && IsClient()) // Endurance Tap CastToClient()->SetEndurance(CastToClient()->GetEndurance() + damage); } @@ -8267,21 +8266,21 @@ void Mob::TryTriggerThreshHold(int32 damage, int effect_id, Mob* attacker){ for(int i = 0; i < EFFECT_COUNT; i++){ - if (spells[buffs[slot].spellid].effectid[i] == effect_id){ + if (spells[buffs[slot].spellid].effect_id[i] == effect_id){ - uint16 spell_id = spells[buffs[slot].spellid].base[i]; + uint16 spell_id = spells[buffs[slot].spellid].base_value[i]; - if (damage > spells[buffs[slot].spellid].base2[i]){ + if (damage > spells[buffs[slot].spellid].limit_value[i]){ BuffFadeBySlot(slot); if (IsValidSpell(spell_id)) { if (IsBeneficialSpell(spell_id)) - SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + SpellFinished(spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); else if(attacker) - SpellFinished(spell_id, attacker, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff); + SpellFinished(spell_id, attacker, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } } } @@ -8321,13 +8320,13 @@ void Mob::CastSpellOnLand(Mob* caster, int32 spell_id) //Step 3: Cast spells if (IsBeneficialSpell(trigger_spell_id)) { - SpellFinished(trigger_spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[trigger_spell_id].ResistDiff); + SpellFinished(trigger_spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[trigger_spell_id].resist_difficulty); } else { Mob* current_target = GetTarget(); //For now don't let players cast detrimental effects on themselves if they are targeting themselves. Need to confirm behavior. if (current_target && current_target->GetID() != GetID()) - SpellFinished(trigger_spell_id, current_target, EQ::spells::CastingSlot::Item, 0, -1, spells[trigger_spell_id].ResistDiff); + SpellFinished(trigger_spell_id, current_target, EQ::spells::CastingSlot::Item, 0, -1, spells[trigger_spell_id].resist_difficulty); } } if (i >= 0) @@ -8348,12 +8347,12 @@ void Mob::CalcSpellPowerDistanceMod(uint16 spell_id, float range, Mob* caster) else distance = sqrt(range); - distance = EQ::Clamp(distance, spells[spell_id].min_dist, spells[spell_id].max_dist); + distance = EQ::Clamp(distance, spells[spell_id].min_distance, spells[spell_id].max_distance); - float dm_range = spells[spell_id].max_dist - spells[spell_id].min_dist; - float dm_mod_interval = spells[spell_id].max_dist_mod - spells[spell_id].min_dist_mod; - float dist_from_min = distance - spells[spell_id].min_dist; - float mod = spells[spell_id].min_dist_mod + (dist_from_min * (dm_mod_interval/dm_range)); + float dm_range = spells[spell_id].max_distance - spells[spell_id].min_distance; + float dm_mod_interval = spells[spell_id].max_distance_mod - spells[spell_id].min_distance_mod; + float dist_from_min = distance - spells[spell_id].min_distance; + float mod = spells[spell_id].min_distance_mod + (dist_from_min * (dm_mod_interval/dm_range)); mod *= 100.0f; SetSpellPowerDistanceMod(static_cast(mod)); @@ -8431,8 +8430,8 @@ bool Mob::HarmonySpellLevelCheck(int32 spell_id, Mob *target) for (int i = 0; i < EFFECT_COUNT; i++) { // not important to check limit on SE_Lull as it doesnt have one and if the other components won't land, then SE_Lull wont either - if (spells[spell_id].effectid[i] == SE_ChangeFrenzyRad || spells[spell_id].effectid[i] == SE_Harmony) { - if ((spells[spell_id].max[i] != 0 && target->GetLevel() > spells[spell_id].max[i]) || target->GetSpecialAbility(IMMUNE_PACIFY)) { + if (spells[spell_id].effect_id[i] == SE_ChangeFrenzyRad || spells[spell_id].effect_id[i] == SE_Harmony) { + if ((spells[spell_id].max_value[i] != 0 && target->GetLevel() > spells[spell_id].max_value[i]) || target->GetSpecialAbility(IMMUNE_PACIFY)) { return false; } } @@ -8494,7 +8493,7 @@ bool Mob::NegateSpellEffect(uint16 spell_id, int effect_id) //Match each of the negate effects with the current spell effect, if found, that effect will not be applied. for (int j = 0; j < EFFECT_COUNT; j++) { - if (spells[buffs[i].spellid].base2[j] == effect_id) { + if (spells[buffs[i].spellid].limit_value[j] == effect_id) { return true; } } diff --git a/zone/spells.cpp b/zone/spells.cpp index f50acd1f1..9a7ca6647 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -191,7 +191,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, return(false); } //It appears that the Sanctuary effect is removed by a check on the client side (keep this however for redundancy) - if (spellbonuses.Sanctuary && (spells[spell_id].targettype != ST_Self && GetTarget() != this) || IsDetrimentalSpell(spell_id)) + if (spellbonuses.Sanctuary && (spells[spell_id].target_type != ST_Self && GetTarget() != this) || IsDetrimentalSpell(spell_id)) BuffFadeByEffect(SE_Sanctuary); if(IsClient()){ @@ -308,7 +308,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, } else { - return(DoCastSpell(spell_id, target_id, slot, cast_time, mana_cost, oSpellWillFinish, item_slot, timer, timer_duration, spells[spell_id].ResistDiff, aa_id)); + return(DoCastSpell(spell_id, target_id, slot, cast_time, mana_cost, oSpellWillFinish, item_slot, timer, timer_duration, spells[spell_id].resist_difficulty, aa_id)); } } @@ -392,13 +392,13 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, // and a target wasn't provided, then it's us; unless TGB is on and this // is a TGB compatible spell. if((IsGroupSpell(spell_id) || - spell.targettype == ST_AEClientV1 || - spell.targettype == ST_Self || - spell.targettype == ST_AECaster || - spell.targettype == ST_Ring || - spell.targettype == ST_Beam) && target_id == 0) + spell.target_type == ST_AEClientV1 || + spell.target_type == ST_Self || + spell.target_type == ST_AECaster || + spell.target_type == ST_Ring || + spell.target_type == ST_Beam) && target_id == 0) { - LogSpells("Spell [{}] auto-targeted the caster. Group? [{}], target type [{}]", spell_id, IsGroupSpell(spell_id), spell.targettype); + LogSpells("Spell [{}] auto-targeted the caster. Group? [{}], target type [{}]", spell_id, IsGroupSpell(spell_id), spell.target_type); target_id = GetID(); } @@ -599,7 +599,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though - if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { + if (spell_target && spells[spell_id].target_type != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { LogSpells("Spell [{}] failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) MessageString(Chat::SpellFailure, SPELL_TOO_POWERFUL); @@ -607,7 +607,7 @@ bool Mob::DoCastingChecks() } } - if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) { + if (spells[spell_id].zone_type == 1 && !zone->CanCastOutdoor()) { MessageString(Chat::Red, CAST_OUTDOORS); return false; } @@ -628,8 +628,8 @@ bool Mob::DoCastingChecks() } } - if (IsClient() && spells[spell_id].EndurTimerIndex > 0 && casting_spell_slot < CastingSlot::MaxGems) - if (!CastToClient()->IsLinkedSpellReuseTimerReady(spells[spell_id].EndurTimerIndex)) + if (IsClient() && spells[spell_id].timer_id > 0 && casting_spell_slot < CastingSlot::MaxGems) + if (!CastToClient()->IsLinkedSpellReuseTimerReady(spells[spell_id].timer_id)) return false; casting_spell_checks = true; @@ -812,7 +812,7 @@ bool Client::CheckFizzle(uint16 spell_id) // > 0 --> skill is lower, higher chance of fizzle // < 0 --> skill is better, lower chance of fizzle // the max that diff can be is +- 235 - float diff = par_skill + static_cast(spells[spell_id].basediff) - act_skill; + float diff = par_skill + static_cast(spells[spell_id].base_difficulty) - act_skill; // if you have high int/wis you fizzle less, you fizzle more if you are stupid if(GetClass() == BARD) @@ -1058,8 +1058,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(GetClass() == BARD) // bard's can move when casting any spell... { if (IsBardSong(spell_id)) { - if(spells[spell_id].buffduration == 0xFFFF) { - LogSpells("Bard song [{}] not applying bard logic because duration. dur=[{}], recast=[{}]", spells[spell_id].buffduration); + if(spells[spell_id].buff_duration == 0xFFFF) { + LogSpells("Bard song [{}] not applying bard logic because duration. dur=[{}], recast=[{}]", spells[spell_id].buff_duration); } else { // So long recast bard songs need special bard logic, although the effects don't repulse like other songs // This is basically a hack to get that effect @@ -1071,7 +1071,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo bardsong = spell_id; bardsong_slot = slot; //NOTE: theres a lot more target types than this to think about... - if (spell_target == nullptr || (spells[spell_id].targettype != ST_Target && spells[spell_id].targettype != ST_AETarget)) + if (spell_target == nullptr || (spells[spell_id].target_type != ST_Target && spells[spell_id].target_type != ST_AETarget)) bardsong_target_id = GetID(); else bardsong_target_id = spell_target->GetID(); @@ -1195,8 +1195,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo int component, component_count, inv_slot_id; bool missingreags = false; for(int t_count = 0; t_count < 4; t_count++) { - component = spells[spell_id].components[t_count]; - component_count = spells[spell_id].component_counts[t_count]; + component = spells[spell_id].component[t_count]; + component_count = spells[spell_id].component_count[t_count]; if (component == -1) continue; @@ -1204,7 +1204,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo // bard components are requirements for a certain instrument type, not a specific item if(bard_song_mode) { bool HasInstrument = true; - int InstComponent = spells[spell_id].NoexpendReagent[0]; + int InstComponent = spells[spell_id].no_expend_reagent[0]; switch (InstComponent) { case -1: @@ -1299,11 +1299,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo { int noexpend; for(int t_count = 0; t_count < 4; t_count++) { - component = spells[spell_id].components[t_count]; - noexpend = spells[spell_id].NoexpendReagent[t_count]; + component = spells[spell_id].component[t_count]; + noexpend = spells[spell_id].no_expend_reagent[t_count]; if (component == -1 || noexpend == component) continue; - component_count = spells[spell_id].component_counts[t_count]; + component_count = spells[spell_id].component_count[t_count]; LogSpells("Spell [{}]: Consuming [{}] of spell component item id [{}]", spell_id, component_count, component); // Components found, Deleting // now we go looking for and deleting the items one by one @@ -1452,8 +1452,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if((IsFromItem && RuleB(Character, SkillUpFromItems)) || !IsFromItem) { c->CheckSongSkillIncrease(spell_id); } - if (spells[spell_id].EndurTimerIndex > 0 && slot < CastingSlot::MaxGems) - c->SetLinkedSpellReuseTimer(spells[spell_id].EndurTimerIndex, spells[spell_id].recast_time / 1000); + if (spells[spell_id].timer_id > 0 && slot < CastingSlot::MaxGems) + c->SetLinkedSpellReuseTimer(spells[spell_id].timer_id, spells[spell_id].recast_time / 1000); c->MemorizeSpell(static_cast(slot), spell_id, memSpellSpellbar); } LogSpells("Bard song [{}] should be started", spell_id); @@ -1466,8 +1466,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo SendSpellBarEnable(spell_id); // this causes the delayed refresh of the spell bar gems - if (spells[spell_id].EndurTimerIndex > 0 && slot < CastingSlot::MaxGems) - c->SetLinkedSpellReuseTimer(spells[spell_id].EndurTimerIndex, spells[spell_id].recast_time / 1000); + if (spells[spell_id].timer_id > 0 && slot < CastingSlot::MaxGems) + c->SetLinkedSpellReuseTimer(spells[spell_id].timer_id, spells[spell_id].recast_time / 1000); c->MemorizeSpell(static_cast(slot), spell_id, memSpellSpellbar); // this tells the client that casting may happen again @@ -1531,7 +1531,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce // and that causes the spell to be executed differently bodyType target_bt = BT_Humanoid; - SpellTargetType targetType = spells[spell_id].targettype; + SpellTargetType targetType = spells[spell_id].target_type; bodyType mob_body = spell_target ? spell_target->GetBodyType() : BT_Humanoid; if(IsPlayerIllusionSpell(spell_id) @@ -1550,7 +1550,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if (isproc && IsNPC() && CastToNPC()->GetInnateProcSpellID() == spell_id) targetType = ST_Target; - if (spell_target && spells[spell_id].CastRestriction && !spell_target->PassCastRestriction(spells[spell_id].CastRestriction)){ + if (spell_target && spells[spell_id].cast_restriction && !spell_target->PassCastRestriction(spells[spell_id].cast_restriction)){ Message(Chat::Red, "Your target does not meet the spell requirements."); //Current live also adds description after this from dbstr_us type 39 return false; } @@ -1561,7 +1561,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce } //Must be out of combat. (If Beneficial checks casters combat state, Deterimental checks targets) - if (!spells[spell_id].InCombat && spells[spell_id].OutofCombat) { + if (!spells[spell_id].can_cast_in_combat && spells[spell_id].can_cast_out_of_combat) { if (IsDetrimentalSpell(spell_id)) { if (spell_target && ((spell_target->IsNPC() && spell_target->IsEngaged()) || @@ -1584,7 +1584,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce } // Must be in combat. (If Beneficial checks casters combat state, Deterimental checks targets) - else if (spells[spell_id].InCombat && !spells[spell_id].OutofCombat) { + else if (spells[spell_id].can_cast_in_combat && !spells[spell_id].can_cast_out_of_combat) { if (IsDetrimentalSpell(spell_id)) { if (spell_target && ((spell_target->IsNPC() && !spell_target->IsEngaged()) || @@ -1857,7 +1857,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = this; } - if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){ + if (spell_target && spell_target->IsPet() && spells[spell_id].target_type == ST_GroupNoPets){ MessageString(Chat::Red,NO_CAST_ON_PET); return false; } @@ -2064,8 +2064,8 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - LogSpells("I dont know Target Type: [{}] Spell: ([{}]) [{}]", spells[spell_id].targettype, spell_id, spells[spell_id].name); - Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + LogSpells("I dont know Target Type: [{}] Spell: ([{}]) [{}]", spells[spell_id].target_type, spell_id, spells[spell_id].name); + Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].target_type, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; } @@ -2113,7 +2113,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui } } - if( spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()){ + if( spells[spell_id].zone_type == 1 && !zone->CanCastOutdoor()){ if(IsClient()){ if(!CastToClient()->GetGM()){ MessageString(Chat::Red, CAST_OUTDOORS); @@ -2186,7 +2186,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if(IsAEDurationSpell(spell_id)) { // the spells are AE target, but we aim them on a beacon Mob *beacon_loc = spell_target ? spell_target : this; - auto beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); + auto beacon = new Beacon(beacon_loc, spells[spell_id].aoe_duration); entity_list.AddBeacon(beacon); LogSpells("Spell [{}]: AE duration beacon created, entity id [{}]", spell_id, beacon->GetName()); spell_target = nullptr; @@ -2195,7 +2195,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui } // check line of sight to target if it's a detrimental spell - if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) + if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].target_type != ST_TargetOptional) { LogSpells("Spell [{}]: cannot see target [{}]", spell_id, spell_target->GetName()); MessageString(Chat::Red,CANT_SEE_TARGET); @@ -2213,7 +2213,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui //range check our target, if we have one and it is not us float range = spells[spell_id].range + GetRangeDistTargetSizeMod(spell_target); if(IsClient() && CastToClient()->TGB() && IsTGBCompatibleSpell(spell_id) && IsGroupSpell(spell_id)) - range = spells[spell_id].aoerange; + range = spells[spell_id].aoe_range; range = GetActSpellRange(spell_id, range); if(IsPlayerIllusionSpell(spell_id) @@ -2291,7 +2291,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui if (isproc) { SpellOnTarget(spell_id, spell_target, 0, true, resist_adjust, true, level_override); } else { - if (spells[spell_id].targettype == ST_TargetOptional){ + if (spells[spell_id].target_type == ST_TargetOptional){ if (!TrySpellProjectile(spell_target, spell_id)) return false; } @@ -2344,10 +2344,10 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui // NPCs should never be affected by an AE they cast. PB AEs shouldn't affect caster either // I don't think any other cases that get here matter - bool affect_caster = !IsNPC() && spells[spell_id].targettype != ST_AECaster; + bool affect_caster = !IsNPC() && spells[spell_id].target_type != ST_AECaster; - if (spells[spell_id].targettype == ST_AETargetHateList) - hate_list.SpellCast(this, spell_id, spells[spell_id].aoerange, ae_center); + if (spells[spell_id].target_type == ST_AETargetHateList) + hate_list.SpellCast(this, spell_id, spells[spell_id].aoe_range, ae_center); else entity_list.AESpell(this, ae_center, spell_id, affect_caster, resist_adjust); } @@ -2416,7 +2416,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui SpellOnTarget(spell_id, this); #ifdef GROUP_BUFF_PETS //pet too - if (spells[spell_id].targettype != ST_GroupNoPets && GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) + if (spells[spell_id].target_type != ST_GroupNoPets && GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) SpellOnTarget(spell_id, GetPet()); #endif } @@ -2424,7 +2424,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui SpellOnTarget(spell_id, spell_target); #ifdef GROUP_BUFF_PETS //pet too - if (spells[spell_id].targettype != ST_GroupNoPets && spell_target->GetPet() && spell_target->HasPetAffinity() && !spell_target->GetPet()->IsCharmed()) + if (spells[spell_id].target_type != ST_GroupNoPets && spell_target->GetPet() && spell_target->HasPetAffinity() && !spell_target->GetPet()->IsCharmed()) SpellOnTarget(spell_id, spell_target->GetPet()); #endif } @@ -2436,7 +2436,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui { if(!IsClient()) { - hate_list.SpellCast(this, spell_id, spells[spell_id].range > spells[spell_id].aoerange ? spells[spell_id].range : spells[spell_id].aoerange); + hate_list.SpellCast(this, spell_id, spells[spell_id].range > spells[spell_id].aoe_range ? spells[spell_id].range : spells[spell_id].aoe_range); } break; } @@ -2488,8 +2488,8 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui // one may want to check if this is a disc or not, but we actually don't, there are non disc stuff that have end cost // lets not consume end for custom items that have disc procs. // One might also want to filter out USE_ITEM_SPELL_SLOT, but DISCIPLINE_SPELL_SLOT are both #defined to the same thing ... - if (spells[spell_id].EndurCost && !isproc) { - auto end_cost = spells[spell_id].EndurCost; + if (spells[spell_id].endurance_cost && !isproc) { + auto end_cost = spells[spell_id].endurance_cost; if (mgb) end_cost *= 2; SetEndurance(GetEndurance() - EQ::ClampUpper(end_cost, GetEndurance())); @@ -2514,7 +2514,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration); } - else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { + else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].is_discipline) { int recast = spells[spell_id].recast_time/1000; if (spell_id == SPELL_LAY_ON_HANDS) //lay on hands { @@ -2751,9 +2751,9 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { action->source = caster->GetID(); action->target = GetID(); action->spell = spell_id; - action->force = spells[spell_id].pushback; + action->force = spells[spell_id].push_back; action->hit_heading = GetHeading(); - action->hit_pitch = spells[spell_id].pushup; + action->hit_pitch = spells[spell_id].push_up; action->instrument_mod = caster->GetInstrumentMod(spell_id); action->effect_flag = 0; action->spell_level = action->level = buffs[buffs_i].casterlevel; @@ -2762,7 +2762,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { action->effect_flag = 4; - if (spells[spell_id].pushback != 0.0f || spells[spell_id].pushup != 0.0f) + if (spells[spell_id].push_back != 0.0f || spells[spell_id].push_up != 0.0f) { if (IsClient()) { @@ -2840,8 +2840,8 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste formula = spells[spell_id].pvp_duration; duration = spells[spell_id].pvp_duration_cap; } else { - formula = spells[spell_id].buffdurationformula; - duration = spells[spell_id].buffduration; + formula = spells[spell_id].buff_duration_formula; + duration = spells[spell_id].buff_duration; } int castlevel = caster->GetCasterLevel(spell_id); @@ -2994,7 +2994,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if (spellid1 != spellid2) { for (i = 0; i < EFFECT_COUNT; i++) { // we don't want this optimization for mana burns - if (sp1.effectid[i] != sp2.effectid[i] || sp1.effectid[i] == SE_ManaBurn) { + if (sp1.effect_id[i] != sp2.effect_id[i] || sp1.effect_id[i] == SE_ManaBurn) { effect_match = false; break; } @@ -3009,11 +3009,11 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if (!effect_match) { for(i = 0; i < EFFECT_COUNT; i++) { - effect1 = sp1.effectid[i]; - effect2 = sp2.effectid[i]; + effect1 = sp1.effect_id[i]; + effect2 = sp2.effect_id[i]; if (spellbonuses.Screech == 1) { - if (effect2 == SE_Screech && sp2.base[i] == -1) { + if (effect2 == SE_Screech && sp2.base_value[i] == -1) { MessageString(Chat::SpellFailure, SCREECH_BUFF_BLOCK, sp2.name); return -1; } @@ -3026,26 +3026,26 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, is not fully removed at the time of the trigger */ if (spellbonuses.AStacker[SBIndex::BUFFSTACKER_EXISTS]) { - if ((effect2 == SE_AStacker) && (sp2.effectid[i] <= spellbonuses.AStacker[SBIndex::BUFFSTACKER_VALUE])) + if ((effect2 == SE_AStacker) && (sp2.effect_id[i] <= spellbonuses.AStacker[SBIndex::BUFFSTACKER_VALUE])) return -1; } if (spellbonuses.BStacker[SBIndex::BUFFSTACKER_EXISTS]) { - if ((effect2 == SE_BStacker) && (sp2.effectid[i] <= spellbonuses.BStacker[SBIndex::BUFFSTACKER_VALUE])) + if ((effect2 == SE_BStacker) && (sp2.effect_id[i] <= spellbonuses.BStacker[SBIndex::BUFFSTACKER_VALUE])) return -1; if ((effect2 == SE_AStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_BStacker))) return -1; } if (spellbonuses.CStacker[SBIndex::BUFFSTACKER_EXISTS]) { - if ((effect2 == SE_CStacker) && (sp2.effectid[i] <= spellbonuses.CStacker[SBIndex::BUFFSTACKER_VALUE])) + if ((effect2 == SE_CStacker) && (sp2.effect_id[i] <= spellbonuses.CStacker[SBIndex::BUFFSTACKER_VALUE])) return -1; if ((effect2 == SE_BStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_CStacker))) return -1; } if (spellbonuses.DStacker[SBIndex::BUFFSTACKER_EXISTS]) { - if ((effect2 == SE_DStacker) && (sp2.effectid[i] <= spellbonuses.DStacker[SBIndex::BUFFSTACKER_VALUE])) + if ((effect2 == SE_DStacker) && (sp2.effect_id[i] <= spellbonuses.DStacker[SBIndex::BUFFSTACKER_VALUE])) return -1; if ((effect2 == SE_CStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_DStacker))) return -1; @@ -3053,10 +3053,10 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if(effect2 == SE_StackingCommand_Overwrite) { - overwrite_effect = sp2.base[i]; + overwrite_effect = sp2.base_value[i]; overwrite_slot = sp2.formula[i] - 201; //they use base 1 for slots, we use base 0 - overwrite_below_value = sp2.max[i]; - if(sp1.effectid[overwrite_slot] == overwrite_effect) + overwrite_below_value = sp2.max_value[i]; + if(sp1.effect_id[overwrite_slot] == overwrite_effect) { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); @@ -3075,11 +3075,11 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, } } else if (effect1 == SE_StackingCommand_Block) { - blocked_effect = sp1.base[i]; + blocked_effect = sp1.base_value[i]; blocked_slot = sp1.formula[i] - 201; - blocked_below_value = sp1.max[i]; + blocked_below_value = sp1.max_value[i]; - if (sp2.effectid[blocked_slot] == blocked_effect) + if (sp2.effect_id[blocked_slot] == blocked_effect) { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); @@ -3121,8 +3121,8 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, if(IsBlankSpellEffect(spellid1, i) || IsBlankSpellEffect(spellid2, i)) continue; - effect1 = sp1.effectid[i]; - effect2 = sp2.effectid[i]; + effect1 = sp1.effect_id[i]; + effect2 = sp2.effect_id[i]; /* Quick check, are the effects the same, if so then @@ -3142,7 +3142,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, // negative AC affects are skipped. Ex. Sun's Corona and Glacier Breath should stack // There may be more SPAs we need to add here .... // The client does just check base rather than calculating the affect change value. - if ((effect1 == SE_ArmorClass || effect1 == SE_ACv2) && sp2.base[i] < 0) + if ((effect1 == SE_ArmorClass || effect1 == SE_ACv2) && sp2.base_value[i] < 0) continue; /* @@ -3412,7 +3412,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].casterid = caster ? caster->GetID() : 0; buffs[emptyslot].ticsremaining = duration; buffs[emptyslot].counters = CalculateCounters(spell_id); - buffs[emptyslot].numhits = spells[spell_id].numhits; + buffs[emptyslot].hit_number = spells[spell_id].hit_number; buffs[emptyslot].client = caster ? caster->IsClient() : 0; buffs[emptyslot].persistant_buff = 0; buffs[emptyslot].caston_x = 0; @@ -3424,10 +3424,10 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].virus_spread_time = 0; buffs[emptyslot].instrument_mod = caster ? caster->GetInstrumentMod(spell_id) : 10; - if (level_override > 0 || buffs[emptyslot].numhits > 0) { + if (level_override > 0 || buffs[emptyslot].hit_number > 0) { buffs[emptyslot].UpdateClient = true; } else { - if (buffs[emptyslot].ticsremaining > (1 + CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration))) + if (buffs[emptyslot].ticsremaining > (1 + CalcBuffDuration_formula(caster_level, spells[spell_id].buff_duration_formula, spells[spell_id].buff_duration))) buffs[emptyslot].UpdateClient = true; } @@ -3563,8 +3563,8 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes // these target types skip pcnpc only check (according to dev quotes) // other AE spells this is redundant, oh well // 1 = PCs, 2 = NPCs - if (spells[spell_id].pcnpc_only_flag && spells[spell_id].targettype != ST_AETargetHateList && - spells[spell_id].targettype != ST_HateList) { + if (spells[spell_id].pcnpc_only_flag && spells[spell_id].target_type != ST_AETargetHateList && + spells[spell_id].target_type != ST_HateList) { if (spells[spell_id].pcnpc_only_flag == 1 && !spelltar->IsClient() && !spelltar->IsMerc() && !spelltar->IsBot()) return false; else if (spells[spell_id].pcnpc_only_flag == 2 && (spelltar->IsClient() || spelltar->IsMerc() || spelltar->IsBot())) @@ -3622,9 +3622,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes action->spell_level = action->level = caster_level; // caster level, for animation only action->type = 231; // 231 means a spell action->spell = spell_id; - action->force = spells[spell_id].pushback; + action->force = spells[spell_id].push_back; action->hit_heading = GetHeading(); - action->hit_pitch = spells[spell_id].pushup; + action->hit_pitch = spells[spell_id].push_up; action->instrument_mod = GetInstrumentMod(spell_id); action->effect_flag = 0; @@ -3806,7 +3806,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes ) ) { - if(spells[spell_id].targettype == ST_AEBard) { + if(spells[spell_id].target_type == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold LogSpells("Beneficial ae bard song [{}] can't take hold [{}] -> [{}], IBA? [{}]", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { @@ -3840,7 +3840,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes } //check for AE_Undead - if(spells[spell_id].targettype == ST_UndeadAE){ + if(spells[spell_id].target_type == ST_UndeadAE){ if(spelltar->GetBodyType() != BT_SummonedUndead && spelltar->GetBodyType() != BT_Undead && spelltar->GetBodyType() != BT_Vampire) @@ -3895,7 +3895,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes case REFLECT_SINGLE_TARGET_SPELLS_ONLY: { - if(spells[spell_id].targettype == ST_Target) { + if(spells[spell_id].target_type == ST_Target) { for(int y = 0; y < 16; y++) { if (spells[spell_id].classes[y] < 255) { can_spell_reflect = true; @@ -3915,7 +3915,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes } case RELFECT_ALL_SINGLE_TARGET_SPELLS: { - if (spells[spell_id].targettype == ST_Target) { + if (spells[spell_id].target_type == ST_Target) { can_spell_reflect = true; } break; @@ -3978,9 +3978,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes spelltar->BreakInvisibleSpells(); //Any detrimental spell cast on you will drop invisible (can be AOE, non damage ect). if (IsCharmSpell(spell_id) || IsMezSpell(spell_id) || IsFearSpell(spell_id)) - spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resisttype, spell_id, this, use_resist_adjust, resist_adjust, true, false, false, level_override); + spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resist_type, spell_id, this, use_resist_adjust, resist_adjust, true, false, false, level_override); else - spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resisttype, spell_id, this, use_resist_adjust, resist_adjust, false, false, false, level_override); + spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resist_type, spell_id, this, use_resist_adjust, resist_adjust, false, false, false, level_override); if(spell_effectiveness < 100) { @@ -3988,7 +3988,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes { LogSpells("Spell [{}] was completely resisted by [{}]", spell_id, spelltar->GetName()); - if (spells[spell_id].resisttype == RESIST_PHYSICAL){ + if (spells[spell_id].resist_type == RESIST_PHYSICAL){ MessageString(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); spelltar->MessageString(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name); } @@ -4091,8 +4091,8 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes if (spelltar) spelltar->CastSpellOnLand(this, spell_id); - if (IsValidSpell(spells[spell_id].RecourseLink) && spells[spell_id].RecourseLink != spell_id) - SpellFinished(spells[spell_id].RecourseLink, this, CastingSlot::Item, 0, -1, spells[spells[spell_id].RecourseLink].ResistDiff); + if (IsValidSpell(spells[spell_id].recourse_link) && spells[spell_id].recourse_link != spell_id) + SpellFinished(spells[spell_id].recourse_link, this, CastingSlot::Item, 0, -1, spells[spells[spell_id].recourse_link].resist_difficulty); if (IsDetrimentalSpell(spell_id)) { @@ -4108,7 +4108,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes // the complete sequence is 2 actions and 1 damage message action->effect_flag = 0x04; // this is a success flag - if(spells[spell_id].pushback != 0.0f || spells[spell_id].pushup != 0.0f) + if(spells[spell_id].push_back != 0.0f || spells[spell_id].push_up != 0.0f) { if (spelltar->IsClient()) { @@ -4248,7 +4248,7 @@ uint32 Mob::BuffCount() { bool Mob::HasBuffWithSpellGroup(int spellgroup) { for (int i = 0; i < GetMaxTotalSlots(); i++) { - if (IsValidSpell(buffs[i].spellid) && spells[buffs[i].spellid].spellgroup == spellgroup) { + if (IsValidSpell(buffs[i].spellid) && spells[buffs[i].spellid].spell_group == spellgroup) { return true; } } @@ -4364,7 +4364,7 @@ void Mob::BuffFadeBySpellIDAndCaster(uint16 spell_id, uint16 caster_id) } // removes buffs containing effectid, skipping skipslot -void Mob::BuffFadeByEffect(int effectid, int skipslot) +void Mob::BuffFadeByEffect(int effect_id, int skipslot) { int i; @@ -4373,7 +4373,7 @@ void Mob::BuffFadeByEffect(int effectid, int skipslot) { if(buffs[i].spellid == SPELL_UNKNOWN) continue; - if(IsEffectInSpell(buffs[i].spellid, effectid) && i != skipslot) + if(IsEffectInSpell(buffs[i].spellid, effect_id) && i != skipslot) BuffFadeBySlot(i, false); } @@ -4443,10 +4443,10 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) effect_index = GetSpellEffectIndex(spell_id, SE_Mez); assert(effect_index >= 0); // NPCs get to ignore the max level - if((GetLevel() > spells[spell_id].max[effect_index]) && + if((GetLevel() > spells[spell_id].max_value[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - LogSpells("Our level ([{}]) is higher than the limit of this Mez spell ([{}])", GetLevel(), spells[spell_id].max[effect_index]); + LogSpells("Our level ([{}]) is higher than the limit of this Mez spell ([{}])", GetLevel(), spells[spell_id].max_value[effect_index]); caster->MessageString(Chat::SpellFailure, CANNOT_MEZ_WITH_SPELL); AddToHateList(caster, 1,0,true,false,false,spell_id); return true; @@ -4487,7 +4487,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) caster->MessageString(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up return true; } - else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) + else if(GetLevel() > spells[spell_id].max_value[effect_index] && spells[spell_id].max_value[effect_index] != 0) { LogSpells("Level is [{}], cannot be feared by this spell", GetLevel()); caster->MessageString(Chat::Shout, FEAR_TOO_HIGH); @@ -4536,9 +4536,9 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // check level limit of charm spell effect_index = GetSpellEffectIndex(spell_id, SE_Charm); assert(effect_index >= 0); - if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) + if(GetLevel() > spells[spell_id].max_value[effect_index] && spells[spell_id].max_value[effect_index] != 0) { - LogSpells("Our level ([{}]) is higher than the limit of this Charm spell ([{}])", GetLevel(), spells[spell_id].max[effect_index]); + LogSpells("Our level ([{}]) is higher than the limit of this Charm spell ([{}])", GetLevel(), spells[spell_id].max_value[effect_index]); caster->MessageString(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up AddToHateList(caster, 1,0,true,false,false,spell_id); return true; @@ -4664,9 +4664,9 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use // PVP, we don't have the normal per_level or cap stuff implemented ... so ahh do that // and make sure the PVP versions are also handled. if (IsClient() && caster->IsClient()) { - resist_modifier = spells[spell_id].pvpresistbase; + resist_modifier = spells[spell_id].pvp_resist_base; } else { - resist_modifier = spells[spell_id].ResistDiff; + resist_modifier = spells[spell_id].resist_difficulty; } } @@ -4813,7 +4813,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use */ int16 charisma = caster->GetCHA(); - if (IsFear && (spells[spell_id].targettype != ST_Undead)){ + if (IsFear && (spells[spell_id].target_type != ST_Undead)){ if (charisma < 100) resist_modifier -= 20; @@ -4851,14 +4851,14 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use resist_chance = mod_spell_resist(resist_chance, level_mod, resist_modifier, target_resist, resist_type, spell_id, caster); //Do our min and max resist checks. - if(resist_chance > spells[spell_id].MaxResist && spells[spell_id].MaxResist != 0) + if(resist_chance > spells[spell_id].max_resist && spells[spell_id].max_resist != 0) { - resist_chance = spells[spell_id].MaxResist; + resist_chance = spells[spell_id].max_resist; } - if(resist_chance < spells[spell_id].MinResist && spells[spell_id].MinResist != 0) + if(resist_chance < spells[spell_id].min_resist && spells[spell_id].min_resist != 0) { - resist_chance = spells[spell_id].MinResist; + resist_chance = spells[spell_id].min_resist; } //Average charm duration agianst mobs with 0% chance to resist on LIVE is ~ 68 ticks. @@ -5010,7 +5010,7 @@ int16 Mob::CalcFearResistChance() */ float Mob::GetAOERange(uint16 spell_id) { - float range = spells[spell_id].aoerange; + float range = spells[spell_id].aoe_range; /** * For TGB @@ -5442,7 +5442,7 @@ uint32 Client::GetHighestScribedSpellinSpellGroup(uint32 spell_group) for (int i = 0; i < EQ::spells::SPELLBOOK_SIZE; i++) { if (IsValidSpell(m_pp.spell_book[i])) { - if (spells[m_pp.spell_book[i]].spellgroup == spell_group) { + if (spells[m_pp.spell_book[i]].spell_group == spell_group) { if (highest_rank < spells[m_pp.spell_book[i]].rank) { highest_rank = spells[m_pp.spell_book[i]].rank; highest_spell_id = m_pp.spell_book[i]; @@ -5583,7 +5583,7 @@ int16 Mob::GetBuffSlotFromType(uint16 type) { for (int i = 0; i < buff_count; i++) { if (buffs[i].spellid != SPELL_UNKNOWN) { for (int j = 0; j < EFFECT_COUNT; j++) { - if (spells[buffs[i].spellid].effectid[j] == type ) + if (spells[buffs[i].spellid].effect_id[j] == type ) return i; } } @@ -5606,11 +5606,11 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { for (int j = 0; j < EFFECT_COUNT; j++) { // adjustments necessary for offensive npc casting behavior if (bOffensive) { - if (spells[buffs[i].spellid].effectid[j] == type) { + if (spells[buffs[i].spellid].effect_id[j] == type) { int16 value = - CalcSpellEffectValue_formula(spells[buffs[i].spellid].buffdurationformula, - spells[buffs[i].spellid].base[j], - spells[buffs[i].spellid].max[j], + CalcSpellEffectValue_formula(spells[buffs[i].spellid].buff_duration_formula, + spells[buffs[i].spellid].base_value[j], + spells[buffs[i].spellid].max_value[j], buffs[i].casterlevel, buffs[i].spellid); Log(Logs::General, Logs::Normal, "FindType: type = %d; value = %d; threshold = %d", @@ -5619,7 +5619,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { return true; } } else { - if (spells[buffs[i].spellid].effectid[j] == type ) + if (spells[buffs[i].spellid].effect_id[j] == type ) return true; } } @@ -5847,7 +5847,7 @@ void Client::SendBuffDurationPacket(Buffs_Struct &buff, int slot) else if (buff.counters) sbf->buff.counters = buff.counters; sbf->buff.player_id = buff.casterid; - sbf->buff.num_hits = buff.numhits; + sbf->buff.num_hits = buff.hit_number; sbf->buff.y = buff.caston_y; sbf->buff.x = buff.caston_x; sbf->buff.z = buff.caston_z; @@ -5873,7 +5873,7 @@ void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot) bi->entries[0].buff_slot = slot; bi->entries[0].spell_id = buff.spellid; bi->entries[0].tics_remaining = buff.ticsremaining; - bi->entries[0].num_hits = buff.numhits; + bi->entries[0].num_hits = buff.hit_number; strn0cpy(bi->entries[0].caster, buff.caster_name, 64); bi->name_lengths = strlen(bi->entries[0].caster); FastQueuePacket(&outapp); @@ -5970,7 +5970,7 @@ EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target) buff->entries[index].buff_slot = i; buff->entries[index].spell_id = buffs[i].spellid; buff->entries[index].tics_remaining = buffs[i].ticsremaining; - buff->entries[index].num_hits = buffs[i].numhits; + buff->entries[index].num_hits = buffs[i].hit_number; strn0cpy(buff->entries[index].caster, buffs[i].caster_name, 64); buff->name_lengths += strlen(buff->entries[index].caster); ++index; @@ -6136,7 +6136,7 @@ void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust) //# shortest distance from line to target point float d = std::abs((*iter)->GetY() - m * (*iter)->GetX() - b) / sqrt(m * m + 1); - if (d <= spells[spell_id].aoerange) { + if (d <= spells[spell_id].aoe_range) { if (CheckLosFN((*iter)) || spells[spell_id].npc_no_los) { (*iter)->CalcSpellPowerDistanceMod(spell_id, 0, this); SpellOnTarget(spell_id, (*iter), 0, true, resist_adjust); @@ -6144,7 +6144,7 @@ void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust) } // not sure if we need this check, but probably do, need to check if it should be default limited or not - if (spells[spell_id].aemaxtargets && maxtarget_count >= spells[spell_id].aemaxtargets) + if (spells[spell_id].aoe_max_targets && maxtarget_count >= spells[spell_id].aoe_max_targets) return; } ++iter; @@ -6172,8 +6172,8 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust) std::list targets_in_range; - entity_list.GetTargetsForConeArea(this, spells[spell_id].min_range, spells[spell_id].aoerange, - spells[spell_id].aoerange / 2, spells[spell_id].pcnpc_only_flag, targets_in_range); + entity_list.GetTargetsForConeArea(this, spells[spell_id].min_range, spells[spell_id].aoe_range, + spells[spell_id].aoe_range / 2, spells[spell_id].pcnpc_only_flag, targets_in_range); auto iter = targets_in_range.begin(); while (iter != targets_in_range.end()) { @@ -6228,7 +6228,7 @@ void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust) } // my SHM breath could hit all 5 dummies I could summon in arena - if (spells[spell_id].aemaxtargets && maxtarget_count >= spells[spell_id].aemaxtargets) + if (spells[spell_id].aoe_max_targets && maxtarget_count >= spells[spell_id].aoe_max_targets) return; ++iter; diff --git a/zone/trap.cpp b/zone/trap.cpp index 327f0ef80..f3fc3d22e 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -136,7 +136,7 @@ void Trap::Trigger(Mob* trigger) entity_list.MessageClose(trigger,false,100,13,"%s",message.c_str()); } if(hiddenTrigger){ - hiddenTrigger->SpellFinished(effectvalue, trigger, EQ::spells::CastingSlot::Item, 0, -1, spells[effectvalue].ResistDiff); + hiddenTrigger->SpellFinished(effectvalue, trigger, EQ::spells::CastingSlot::Item, 0, -1, spells[effectvalue].resist_difficulty); } break; case trapTypeAlarm: diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index bc463b99b..04b4a9326 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3113,12 +3113,12 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { "caston_x, Persistent, caston_y, caston_z, ExtraDIChance) " "VALUES (%u, %u, %u, %u, %u, %d, %u, %u, %u, %u, %u, %u, %u, %i, %u, %i, %i, %i);", merc->GetMercID(), buffs[buffCount].spellid, buffs[buffCount].casterlevel, - spells[buffs[buffCount].spellid].buffdurationformula, buffs[buffCount].ticsremaining, + spells[buffs[buffCount].spellid].buff_duration_formula, buffs[buffCount].ticsremaining, CalculatePoisonCounters(buffs[buffCount].spellid) > 0 ? buffs[buffCount].counters : 0, CalculateDiseaseCounters(buffs[buffCount].spellid) > 0 ? buffs[buffCount].counters : 0, CalculateCurseCounters(buffs[buffCount].spellid) > 0 ? buffs[buffCount].counters : 0, CalculateCorruptionCounters(buffs[buffCount].spellid) > 0 ? buffs[buffCount].counters : 0, - buffs[buffCount].numhits, buffs[buffCount].melee_rune, buffs[buffCount].magic_rune, + buffs[buffCount].hit_number, buffs[buffCount].melee_rune, buffs[buffCount].magic_rune, buffs[buffCount].dot_rune, buffs[buffCount].caston_x, IsPersistent, buffs[buffCount].caston_y, buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); @@ -3167,7 +3167,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { if(CalculateCorruptionCounters(buffs[buffCount].spellid) > 0) buffs[buffCount].counters = atoi(row[7]); - buffs[buffCount].numhits = atoi(row[8]); + buffs[buffCount].hit_number = atoi(row[8]); buffs[buffCount].melee_rune = atoi(row[9]); buffs[buffCount].magic_rune = atoi(row[10]); buffs[buffCount].dot_rune = atoi(row[11]); @@ -3594,7 +3594,7 @@ void ZoneDatabase::SaveBuffs(Client *client) { "VALUES('%u', '%u', '%u', '%u', '%s', '%d', '%u', '%u', '%u', '%u', '%u', '%u', " "'%i', '%i', '%i', '%i', '%i')", client->CharacterID(), index, buffs[index].spellid, buffs[index].casterlevel, buffs[index].caster_name, buffs[index].ticsremaining, - buffs[index].counters, buffs[index].numhits, buffs[index].melee_rune, + buffs[index].counters, buffs[index].hit_number, buffs[index].melee_rune, buffs[index].magic_rune, buffs[index].persistant_buff, buffs[index].dot_rune, buffs[index].caston_x, buffs[index].caston_y, buffs[index].caston_z, buffs[index].ExtraDIChance, buffs[index].instrument_mod); @@ -3634,7 +3634,7 @@ void ZoneDatabase::LoadBuffs(Client *client) uint32 caster_level = atoi(row[2]); int32 ticsremaining = atoi(row[4]); uint32 counters = atoul(row[5]); - uint32 numhits = atoul(row[6]); + uint32 hit_number = atoul(row[6]); uint32 melee_rune = atoul(row[7]); uint32 magic_rune = atoul(row[8]); uint8 persistent = atoul(row[9]); @@ -3660,7 +3660,7 @@ void ZoneDatabase::LoadBuffs(Client *client) buffs[slot_id].ticsremaining = ticsremaining; buffs[slot_id].counters = counters; - buffs[slot_id].numhits = numhits; + buffs[slot_id].hit_number = hit_number; buffs[slot_id].melee_rune = melee_rune; buffs[slot_id].magic_rune = magic_rune; buffs[slot_id].persistant_buff = persistent ? true : false; @@ -3683,12 +3683,12 @@ void ZoneDatabase::LoadBuffs(Client *client) for (int effectIndex = 0; effectIndex < EFFECT_COUNT; ++effectIndex) { - if (spells[buffs[index].spellid].effectid[effectIndex] == SE_Charm) { + if (spells[buffs[index].spellid].effect_id[effectIndex] == SE_Charm) { buffs[index].spellid = SPELL_UNKNOWN; break; } - if (spells[buffs[index].spellid].effectid[effectIndex] == SE_Illusion) { + if (spells[buffs[index].spellid].effect_id[effectIndex] == SE_Illusion) { if (buffs[index].persistant_buff) break; diff --git a/zone/zonedb.h b/zone/zonedb.h index 03e69c242..83148ba7b 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -72,9 +72,9 @@ struct DBnpcspellseffects_entries_Struct { int16 spelleffectid; uint8 minlevel; uint8 maxlevel; - int32 base; + int32 base_value; int32 limit; - int32 max; + int32 max_value; }; #pragma pack()