Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2010, 02:19 AM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

Rewrote this effect as well to use the bonus system as well as being incorporated into GetActSpellHealing.

Code:
Index: EQEmuServer/zone/bonuses.cpp
===================================================================
--- EQEmuServer/zone/bonuses.cpp	(revision 1713)
+++ EQEmuServer/zone/bonuses.cpp	(working copy)
@@ -1206,8 +1206,11 @@
 					newbon->Accuracy = effect_value;
 				break;
 			}
+			case SE_HealRate:
+			{
+				newbon->HealRate += effect_value;
+				break;
+			}
 		}
 	}
 }
Index: EQEmuServer/zone/effects.cpp
===================================================================
--- EQEmuServer/zone/effects.cpp	(revision 1713)
+++ EQEmuServer/zone/effects.cpp	(working copy)
@@ -219,12 +219,22 @@
 }
 
 sint32 Client::GetActSpellHealing(int16 spell_id, sint32 value) {
+
 	sint32 modifier = 100;
 
 	modifier += GetFocusEffect(focusImprovedHeal, spell_id);
-						
+	
+	// Instant Heals					
 	if(spells[spell_id].buffduration < 1) {
-		//non-dot
+		
+		// Check for buffs that affect the healrate of the target
+		if (this->GetTarget())
+		{
+			value += value * GetHealRate(this->GetTarget()) / 100;
+			if(value < 1)
+				return 0;
+		}
+		
 		switch(GetAA(aaHealingAdept)) {
 		case 1:
 			modifier += 2;
Index: EQEmuServer/zone/mob.cpp
===================================================================
--- EQEmuServer/zone/mob.cpp	(revision 1713)
+++ EQEmuServer/zone/mob.cpp	(working copy)
@@ -3323,34 +3323,12 @@
 	return damage;
 }
 
-int32 Mob::GetHealRate(uint32 amount, Mob *target)
+int32 Mob::GetHealRate(Mob *target)
 {
-
-	if(target) {
-		int slot = target->GetBuffSlotFromType(SE_HealRate);
-		if(slot >= 0)
-		{
-			sint32 modify_amount = amount;
-			for(int i = 0; i < EFFECT_COUNT; i++)
-			{
-				if (spells[buffs[slot].spellid].effectid[i] == SE_HealRate)
-				{
-					// if the effect reduces the heal amount below 0, return 0.
-					if(spells[buffs[slot].spellid].base[i] < -100)
-					{
-						amount = 0;
-						break;
-					}
-					else
-					{
-						amount += (modify_amount * spells[buffs[slot].spellid].base[i] / 100);
-						break;
-					}
-				}
-			}
-		}
-	}
-	return amount;
+	if(!target)
+		return 0;
+	
+	return (target->itembonuses.HealRate + target->spellbonuses.HealRate);
 }
 
 bool Mob::TryFadeEffect(int slot)
Index: EQEmuServer/zone/mob.h
===================================================================
--- EQEmuServer/zone/mob.h	(revision 1713)
+++ EQEmuServer/zone/mob.h	(working copy)
@@ -275,6 +275,7 @@
 
 	sint8 HundredHands;		//extra haste, stacks with all other haste  i
 	sint8 MeleeLifetap;
+	sint16 HealRate;
 	int XPRateMod;
 
 	sint8	Packrat;	//weight reduction for items, 1 point = 10%
@@ -796,7 +797,7 @@
 	void TryTwincast(Mob *caster, Mob *target, uint32 spell_id);
 	void TrySympatheticProc(Mob *target, uint32 spell_id);
 	bool TryFadeEffect(int slot);
-	int32 GetHealRate(uint32 amount, Mob *target);
+	int32 GetHealRate(Mob *target);
 	sint32 GetVulnerability(sint32 damage, Mob *caster, uint32 spell_id, int32 ticsremaining);
 	sint32 GetSkillDmgTaken(const SkillType skill_used, sint32 damage);
 	void DoKnockback(Mob *caster, uint32 pushback, uint32 pushup);
Index: EQEmuServer/zone/spell_effects.cpp
===================================================================
--- EQEmuServer/zone/spell_effects.cpp	(revision 1713)
+++ EQEmuServer/zone/spell_effects.cpp	(working copy)
@@ -213,10 +213,8 @@
 				else if(dmg > 0) {
 					//healing spell...
 					if(caster)
-					{
-						dmg = GetHealRate(dmg, caster->GetTarget());
 						dmg = caster->GetActSpellHealing(spell_id, dmg);
-					}
+
 					HealDamage(dmg, caster);
 				}
 
@@ -252,8 +250,6 @@
 					dmg = -dmg;
 					Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false);
 				} else {
-					if(caster)
-						dmg = GetHealRate(dmg, caster->GetTarget());
 					HealDamage(dmg, caster);
 				}
 				break;
@@ -278,11 +274,7 @@
 					val = cap;
 
 				if(val > 0)
-				{
-					if(caster && caster->GetTarget())
-						val = GetHealRate(val, caster->GetTarget());
 					HealDamage(val, caster);
-				}
 
 				break;
 			}
@@ -3246,25 +3238,20 @@
 				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)
-				{
-					if (caster->GetTarget())
-						effect_value = GetHealRate(effect_value, caster->GetTarget());
- 					effect_value = caster->GetActSpellHealing(spell_id, effect_value);
-				}
+				// Regen spell...
+				effect_value += effect_value * (itembonuses.HealRate + spellbonuses.HealRate) / 100;
 
 				HealDamage(effect_value, caster);
 			}
-
 			break;
 		}
 		case SE_HealOverTime:
 		{
 			effect_value = CalcSpellEffectValue(spell_id, i, caster_level);
-			effect_value = GetHealRate(effect_value, this);
-			//is this affected by stuff like GetActSpellHealing??
+			if(caster)
+				// Currently returns no change as there are no AAs that affect HoTs but soon.
+				effect_value = caster->GetActSpellHealing(spell_id, effect_value);
+			effect_value += effect_value * (itembonuses.HealRate + spellbonuses.HealRate) / 100;
 			HealDamage(effect_value, caster);
 			//healing aggro would go here; removed for now
 			break;
Reply With Quote
Reply

Thread Tools
Display Modes

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