Secrets
02-25-2009, 11:57 PM
This code basically increases spell damage for both DD and DoTs by your INT, and INT only. I use it on my server instead of countless focus effects. This essentially disables spell bonuses in any other way, shape or form from focus effects. I did this so I can balance things easier.
It's better to increase spell damage serversided than have a bunch of spells with each damage being higher each level. I'm surprised SOE never did this yet, though I guess that's what makes EQ, well, EQ.
Anyway,
ruletypes.h, spell section
RULE_INT ( Spells, SpellModDivideByDD, 100) //number to divide by the stat you specify in spell_effects for DDs
RULE_INT ( Spells, SpellModDivideByDOT, 200) //number to divide by the stat you specify in spell_effects for DOTs
spell_effects.cpp, line 113 (Replaces first CurrentHP case)
case SE_CurrentHP: // nukes, heals; also regen/dot if a buff
{
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Current Hitpoints: %+i", effect_value);
#endif
// SE_CurrentHP is calculated at first tick if its a dot/buff
if (buffslot >= 0)
break;
// for offensive spells check if we have a spell rune on
sint32 dmg = effect_value;
if(dmg < 0)
{
// take partial damage into account
dmg = (sint32) (dmg * caster->itembonuses.INT / (RuleI(Spells,SpellModDivideByDD)));
#ifdef EQBOTS
// Bot AA Casting Bonuses
if(caster && caster->IsBot()) {
dmg = caster->GetBotActSpellDamage(spell_id, dmg);
}
else
#endif //EQBOTS
//handles AAs and what not...
if(caster)
dmg = caster->GetActSpellDamage(spell_id, dmg);
dmg = -dmg;
Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false);
}
else if(dmg > 0) {
//healing spell...
if(caster)
dmg = caster->GetActSpellHealing(spell_id, dmg);
HealDamage(dmg, caster);
}
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Current Hitpoints: %+i actual: %+i", effect_value, dmg);
#endif
break;
}
spell_effects.cpp, line 2817 (replaces second CurrentHP case)
case SE_CurrentHP:
{
effect_value = CalcSpellEffectValue(spell_id, i, caster_level, caster, ticsremaining);
//TODO: account for AAs and stuff
//dont know what the signon this should be... - makes sense
if (caster && caster->IsClient() &&
IsDetrimentalSpell(spell_id) &&
effect_value < 0) {
if(caster){
if(caster->IsClient() && !caster->CastToClient()->GetFeigned()){
AddToHateList(caster, -effect_value);
}
else if(!caster->IsClient())
AddToHateList(caster, -effect_value);
TryDotCritical(spell_id, caster, effect_value);
}
effect_value = (effect_value * caster->itembonuses.INT / (RuleI(Spells,SpellModDivideByDOT)));
}
if(effect_value < 0) {
effect_value = -effect_value;
Damage(caster, effect_value, spell_id, spell.skill, false, i, true);
} else if(effect_value > 0) {
//healing spell...
//healing aggro would go here; removed for now
if(caster)
effect_value = caster->GetActSpellHealing(spell_id, effect_value);
HealDamage(effect_value, caster);
}
break;
}
SQL required for adjustable rules:
INSERT INTO `rule_values` (`ruleset_id`,`rule_name`,`rule_value`) VALUES ('1','Spells:SpellModDivideByDOT','200')
INSERT INTO `rule_values` (`ruleset_id`,`rule_name`,`rule_value`) VALUES ('1','Spells:SpellModDivideByDD,'100')
Few things to note: Higher the number, the more the damage is divided by. If a spell does 5000 damage, it is multiplied by your current INT. (in this case, the emulator cap is 380 with AA) then divided by the number specified. A spell that is a DD with the default rule_value options will do 19000 at max INT if the base damage is always equal to 5000. Characters below 65 have a lower cap, and yes, this means you will have to balance NPCs around casters and balance melee around casters as well. This also effects procs, I suggest messing with the proc chance value in the database (Combat:BaseProcChance) to not overpower melee characters.
The values are all adjustable so mess with it how you see fit. It's a cheap hack, but hey, it's a unique one. Enjoy!
PS: I think healing can be edited in the same way, I just would use a case for lifetaps as well. The critbonus might want to be reduced to 50% instead of 100% as well for damage crits, to not overpower casters.
It's better to increase spell damage serversided than have a bunch of spells with each damage being higher each level. I'm surprised SOE never did this yet, though I guess that's what makes EQ, well, EQ.
Anyway,
ruletypes.h, spell section
RULE_INT ( Spells, SpellModDivideByDD, 100) //number to divide by the stat you specify in spell_effects for DDs
RULE_INT ( Spells, SpellModDivideByDOT, 200) //number to divide by the stat you specify in spell_effects for DOTs
spell_effects.cpp, line 113 (Replaces first CurrentHP case)
case SE_CurrentHP: // nukes, heals; also regen/dot if a buff
{
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Current Hitpoints: %+i", effect_value);
#endif
// SE_CurrentHP is calculated at first tick if its a dot/buff
if (buffslot >= 0)
break;
// for offensive spells check if we have a spell rune on
sint32 dmg = effect_value;
if(dmg < 0)
{
// take partial damage into account
dmg = (sint32) (dmg * caster->itembonuses.INT / (RuleI(Spells,SpellModDivideByDD)));
#ifdef EQBOTS
// Bot AA Casting Bonuses
if(caster && caster->IsBot()) {
dmg = caster->GetBotActSpellDamage(spell_id, dmg);
}
else
#endif //EQBOTS
//handles AAs and what not...
if(caster)
dmg = caster->GetActSpellDamage(spell_id, dmg);
dmg = -dmg;
Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false);
}
else if(dmg > 0) {
//healing spell...
if(caster)
dmg = caster->GetActSpellHealing(spell_id, dmg);
HealDamage(dmg, caster);
}
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Current Hitpoints: %+i actual: %+i", effect_value, dmg);
#endif
break;
}
spell_effects.cpp, line 2817 (replaces second CurrentHP case)
case SE_CurrentHP:
{
effect_value = CalcSpellEffectValue(spell_id, i, caster_level, caster, ticsremaining);
//TODO: account for AAs and stuff
//dont know what the signon this should be... - makes sense
if (caster && caster->IsClient() &&
IsDetrimentalSpell(spell_id) &&
effect_value < 0) {
if(caster){
if(caster->IsClient() && !caster->CastToClient()->GetFeigned()){
AddToHateList(caster, -effect_value);
}
else if(!caster->IsClient())
AddToHateList(caster, -effect_value);
TryDotCritical(spell_id, caster, effect_value);
}
effect_value = (effect_value * caster->itembonuses.INT / (RuleI(Spells,SpellModDivideByDOT)));
}
if(effect_value < 0) {
effect_value = -effect_value;
Damage(caster, effect_value, spell_id, spell.skill, false, i, true);
} else if(effect_value > 0) {
//healing spell...
//healing aggro would go here; removed for now
if(caster)
effect_value = caster->GetActSpellHealing(spell_id, effect_value);
HealDamage(effect_value, caster);
}
break;
}
SQL required for adjustable rules:
INSERT INTO `rule_values` (`ruleset_id`,`rule_name`,`rule_value`) VALUES ('1','Spells:SpellModDivideByDOT','200')
INSERT INTO `rule_values` (`ruleset_id`,`rule_name`,`rule_value`) VALUES ('1','Spells:SpellModDivideByDD,'100')
Few things to note: Higher the number, the more the damage is divided by. If a spell does 5000 damage, it is multiplied by your current INT. (in this case, the emulator cap is 380 with AA) then divided by the number specified. A spell that is a DD with the default rule_value options will do 19000 at max INT if the base damage is always equal to 5000. Characters below 65 have a lower cap, and yes, this means you will have to balance NPCs around casters and balance melee around casters as well. This also effects procs, I suggest messing with the proc chance value in the database (Combat:BaseProcChance) to not overpower melee characters.
The values are all adjustable so mess with it how you see fit. It's a cheap hack, but hey, it's a unique one. Enjoy!
PS: I think healing can be edited in the same way, I just would use a case for lifetaps as well. The critbonus might want to be reduced to 50% instead of 100% as well for damage crits, to not overpower casters.