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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-11-2010, 05:19 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

missed one line in the attack.cpp... new one

Code:
Index: attack.cpp
===================================================================
--- attack.cpp	(revision 1596)
+++ attack.cpp	(working copy)
@@ -2861,13 +2861,14 @@
 	}
 }
 
-sint32 Mob::ReduceDamage(sint32 damage)
+sint32 Mob::AffectMeleeDamage(sint32 damage, const SkillType skill_used)
 {
-	if(damage <= 0 || (!HasRune() && !HasPartialMeleeRune()))
+	if(damage <= 0)
 	{
 		return damage;
 	}
-
+	
+	// Block attack first
 	int slot = GetBuffSlotFromType(SE_NegateAttacks);
 	if(slot >= 0 && buffs[slot].melee_rune > 0)
 	{
@@ -2878,7 +2879,26 @@
 		}
 		return -6;
 	}
-
+	
+	// Affect melee damage
+	slot = GetBuffSlotFromType(SE_SkillDamageTaken);
+	if(slot >= 0)
+	{
+		for(int i = 0; i < EFFECT_COUNT; i++)
+		{
+			if (spells[buffs[slot].spellid].effectid[i] == SE_SkillDamageTaken)
+			{
+				// Check the skill against the spell, or allow all melee skills.
+				if(skill_used == spells[buffs[slot].spellid].base2[i] || spells[buffs[slot].spellid].base2[i] == -1)
+				{
+					damage += damage * spells[buffs[slot].spellid].base[i] / 100;
+					break;
+				}
+			}
+		}
+	}
+	
+	// Do Runes...
 	slot = GetBuffSlotFromType(SE_MitigateMeleeDamage);
 	if(slot >= 0)
 	{
@@ -3155,7 +3175,7 @@
 	
 		//see if any runes want to reduce this damage
 		if(spell_id == SPELL_UNKNOWN) {
-			damage = ReduceDamage(damage);
+			damage = AffectMeleeDamage(damage, skill_used);
 			mlog(COMBAT__HITS, "Melee Damage reduced to %d", damage);
 		} else {
 			sint32 origdmg = damage;
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 02:27 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