Implemented support for allowing most focus effects to now be usable

by NPCs (ie Heal/Damage focus, cast time, spell range ect) from
both spell buffs and items.
Rule for enabling spell focus is TRUE by default
Rule for enabling item focus is FALSE by default.

Consilidated a number of redundant client / mob functions
to use the same pathway for calculating effect values.
This commit is contained in:
KayenEQ
2014-12-08 01:22:01 -05:00
parent f81f62670e
commit 70f570dbd9
15 changed files with 250 additions and 361 deletions
+11 -20
View File
@@ -176,7 +176,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
BuffFadeByEffect(SE_Sanctuary);
if(IsClient()){
int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);
int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);//Client only
if (zone->random.Roll(chance)) {
Message_StringID(13, SILENCED_STRING);
@@ -1043,7 +1043,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
// Check for consumables and Reagent focus items
// first check for component reduction
if(IsClient()) {
int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);
int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only
if(zone->random.Roll(reg_focus)) {
mlog(SPELLS__CASTING, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus);
} else {
@@ -2237,7 +2237,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
{
recast -= GetAA(aaTouchoftheWicked) * 420;
}
int reduction = CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id);
int reduction = CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id);//Client only
if(reduction)
recast -= reduction;
@@ -4189,14 +4189,8 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
//Get resist modifier and adjust it based on focus 2 resist about eq to 1% resist chance
int resist_modifier = (use_resist_override) ? resist_override : spells[spell_id].ResistDiff;
if(caster->IsClient())
{
if(IsValidSpell(spell_id))
{
int focus_resist = caster->CastToClient()->GetFocusEffect(focusResistRate, spell_id);
resist_modifier -= 2 * focus_resist;
}
}
int focus_resist = caster->GetFocusEffect(focusResistRate, spell_id);
resist_modifier -= 2 * focus_resist;
//Check for fear resist
bool IsFear = false;
@@ -4580,17 +4574,14 @@ float Mob::GetAOERange(uint16 spell_id) {
if(range == 0)
range = 10; //something....
if (IsClient()) {
if(IsBardSong(spell_id) && IsBeneficialSpell(spell_id)) {
//Live AA - Extended Notes, SionachiesCrescendo
float song_bonus = static_cast<float>(aabonuses.SongRange + spellbonuses.SongRange + itembonuses.SongRange);
range += range*song_bonus /100.0f;
}
range = CastToClient()->GetActSpellRange(spell_id, range);
if(IsBardSong(spell_id) && IsBeneficialSpell(spell_id)) {
//Live AA - Extended Notes, SionachiesCrescendo
float song_bonus = static_cast<float>(aabonuses.SongRange + spellbonuses.SongRange + itembonuses.SongRange);
range += range*song_bonus /100.0f;
}
range = GetActSpellRange(spell_id, range);
return(range);
}