Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-25-2009, 11:57 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default Increase Spell Damage based on INT

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

Code:
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)

Code:
			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)

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

Code:
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.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:33 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3