PDA

View Full Version : Increase Spell Damage based on INT


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.

trevius
03-01-2009, 11:07 PM
Thanks for the submission, Secrets. It definitely looks like something useful for custom servers wanting to use something different. It would be nice if you could stack focus effects and other bonuses with it. It would also be really cool if you could make a rule that enables or disables this system completely. If that rule was added, I see no reason why this couldn't be added to the normal SVN souce code as an option (with default rule value set to false of course).

Secrets
03-02-2009, 09:55 AM
Thanks for the submission, Secrets. It definitely looks like something useful for custom servers wanting to use something different. It would be nice if you could stack focus effects and other bonuses with it. It would also be really cool if you could make a rule that enables or disables this system completely. If that rule was added, I see no reason why this couldn't be added to the normal SVN souce code as an option (with default rule value set to false of course).

I'm sure it's possible to have a boolean rule above effect_value = (effect_value * caster->itembonuses.INT / (RuleI(Spells,SpellModDivideByDOT)));

specifying if it was enabled or not. That's really the only line I changed from current SVN. Same with the other one. I'll look at doing this in a bit.

ChaosSlayerZ
03-03-2009, 12:53 AM
I'm surprised SOE never did this yet, though I guess that's what makes EQ, well, EQ.


actualy they did- in EQ2

BTW another thign you will need to add as Rules are:

- exactly much INT is beein converted into a bonus on % based - 1% per X INT?

- point after which INT converts into a bonus (for exmaple 150 - only INt over 150 counts into bonus, so ist actual int -150 =X)


ANother thing - again taking from EQ2 - code simular bonus to WIS - in eq2 WIS augments your Heals and effect from Buffs - so while healers can get extra healign power out of their wis - other casters while don't have heals, will be able to increase effect on their buffs, runes, damage shields and so on but building up their WIS even if they are INt casters.

again will need:

-rule to turn it on
-rule of convertion ratio
-rule of starting of point

Bristlebane[nj]
03-06-2009, 12:41 AM
Works nice , thanks for releasing Secrets... maybe you can release the other codes you did on your other server :P