[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
This commit is contained in:
Kinglykrab 2021-11-03 17:47:15 -04:00 committed by GitHub
parent 6e26e8953c
commit 17aaab1f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 4342 additions and 2117 deletions

View File

@ -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;
};

View File

@ -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*/
};

View File

@ -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*/
};

View File

@ -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();
}

View File

@ -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*/
};

View File

@ -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();
}

View File

@ -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*/
};

View File

@ -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();
}

View File

@ -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;
};

View File

@ -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();
}

View File

@ -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*/
};

View File

@ -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<float>(atof(row[9]));
sp[tempid].aoerange=static_cast<float>(atof(row[10]));
sp[tempid].pushback=static_cast<float>(atof(row[11]));
sp[tempid].pushup=static_cast<float>(atof(row[12]));
sp[tempid].aoe_range=static_cast<float>(atof(row[10]));
sp[tempid].push_back=static_cast<float>(atof(row[11]));
sp[tempid].push_up=static_cast<float>(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<float>(atoi(row[194]));
sp[tempid].directional_end = static_cast<float>(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<float>(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);

View File

@ -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<int32>(spells[spell_id].range); }
else if (id == "aoerange") { return static_cast<int32>(spells[spell_id].aoerange); }
else if (id == "pushback") { return static_cast<int32>(spells[spell_id].pushback); }
else if (id == "pushup") { return static_cast<int32>(spells[spell_id].pushup); }
else if (id == "aoe_range") { return static_cast<int32>(spells[spell_id].aoe_range); }
else if (id == "push_back") { return static_cast<int32>(spells[spell_id].push_back); }
else if (id == "push_up") { return static_cast<int32>(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<int32>(spells[spell_id].directional_start); }
else if (id == "directional_end") { return static_cast<int32>(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<int32>(spells[spell_id].min_dist); }
else if (id == "min_dist_mod") { return static_cast<int32>(spells[spell_id].min_dist_mod); }
else if (id == "max_dist") { return static_cast<int32>(spells[spell_id].max_dist); }
else if (id == "persistdeath") { return spells[spell_id].persist_death; }
else if (id == "min_dist") { return static_cast<int32>(spells[spell_id].min_distance); }
else if (id == "min_dist_mod") { return static_cast<int32>(spells[spell_id].min_distance_mod); }
else if (id == "max_dist") { return static_cast<int32>(spells[spell_id].max_distance); }
else if (id == "min_range") { return static_cast<int32>(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;
}

View File

@ -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);

View File

@ -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

View File

@ -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<int, std
int rank_id = atoi(row[0]);
effect.slot = atoi(row[1]);
effect.effect_id = atoi(row[2]);
effect.base1 = atoi(row[3]);
effect.base2 = atoi(row[4]);
effect.base_value = atoi(row[3]);
effect.limit_value = atoi(row[4]);
if(effect.slot < 1)
continue;

View File

@ -29,8 +29,8 @@ struct RankEffect
{
int slot;
int effect_id;
int base1;
int base2;
int base_value;
int limit_value;
};
}

View File

@ -874,7 +874,7 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage)
bool DoLoSCheck = true;
float max_dist = static_cast<float>(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 0));
float min_dist = static_cast<float>(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 1));
float min_distance = static_cast<float>(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;
}

View File

@ -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<float>(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<float>(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<float>(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<float>(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<float>(base2);
proc_spell_id = base_value;
ProcMod = static_cast<float>(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)) {

View File

@ -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();
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -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;

View File

@ -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,

View File

@ -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<BotSpell> 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<BotSpell>::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<BotSpell>::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
}
}

View File

@ -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<int> 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<int> 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;

View File

@ -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.
}

View File

@ -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);

View File

@ -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) {

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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<glm::vec3>(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

View File

@ -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<EQ::Any> *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<EQ::Any> *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<EQ::Any> *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<EQ::Any> *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<EQ::Any> *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<EQ::Any> *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<SPDat_Spell_Struct*>(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

View File

@ -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<EQ::Any> *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,

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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();

View File

@ -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<SPDat_Spell_Struct*>(&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);

View File

@ -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() {

View File

@ -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<MercSpell> 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
}
}

View File

@ -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<float>(new_x));
spu->delta_y = FloatToEQ13(static_cast<float>(new_y));
spu->delta_z = FloatToEQ13(static_cast<float>(pushup));
spu->delta_z = FloatToEQ13(static_cast<float>(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<int>(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<int>(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<int>(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<int>(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<int>(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<int>(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<float>(spells[buffs[slot].spellid].base[i]);
value = static_cast<float>(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);
}

View File

@ -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);

View File

@ -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; i<parentlist->numentries; 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; i<spell_effects_list->numentries; 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];

View File

@ -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;
}

View File

@ -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; }

View File

@ -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;
}

2138
zone/perl_spell.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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();

View File

@ -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:

View File

@ -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;
}

View File

@ -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; }

View File

@ -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
}

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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<float>(spells[spell_id].basediff) - act_skill;
float diff = par_skill + static_cast<float>(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<uint32>(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<uint32>(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<Paste>
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<Mob *> 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;

View File

@ -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:

View File

@ -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;

View File

@ -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()