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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-11-2010, 03:53 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default COMMITTED: SE_SkillDamageTaken

The melee equivalent of the Spell Vulernability effect, its on things like the Anguish Warrior BP and this line of rogue disciplines. Also can use it to replicate things like the MPG Trial of Weaponry(mobs weak to different types of weapons).

spell effects
Code:
Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp	(revision 1596)
+++ spell_effects.cpp	(working copy)
@@ -2812,6 +2812,7 @@
 			case SE_LimitCastTime:
 			case SE_NoCombatSkills:
 			case SE_TriggerOnCast:
+			case SE_SkillDamageTaken:
 			{
 				break;
 			}
mob.h
Code:
Index: mob.h
===================================================================
--- mob.h	(revision 1596)
+++ mob.h	(working copy)
@@ -838,7 +838,7 @@
 	inline bool	IsSilenced() const { return silenced; }
 	inline int16	GetErrorNumber() const {return adverrorinfo;}
 
-	sint32	ReduceDamage(sint32 damage);
+	sint32	AffectMeleeDamage(sint32 damage, const SkillType skill_used);
 	sint32  ReduceMagicalDamage(sint32 damage);
 
 	virtual void DoSpecialAttackDamage(Mob *who, SkillType skill, sint32 max_damage, sint32 min_damage = 1, sint32 hate_override = -1);
attack.cpp
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,23 @@
 		}
 		return -6;
 	}
-
+	
+	// Affect melee damage
+	slot = GetBuffSlotFromType(SE_SkillDamageTaken);
+	if(slot >= 0)
+	{
+		for(int i = 0; i < EFFECT_COUNT; i++)
+		{
+			// 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 +3172,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 06:26 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