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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2010, 09:37 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default COMMITTED: Melee Lifetap

Im sure SKs will love me for this but its currently not working correctly. It is set as a bool, so its either on or off. The spells that utilize this effect also all come with a limit on the effect. This code corrects this, so you can set a spell that will only return 5% of your melee dmg as lifetap(for example).

attack
Code:
Index: attack.cpp
===================================================================
--- attack.cpp	(revision 1607)
+++ attack.cpp	(working copy)
@@ -1309,10 +1309,14 @@
 	//////    Send Attack Damage
 	///////////////////////////////////////////////////////////
 	other->Damage(this, damage, SPELL_UNKNOWN, skillinuse);
-	if(damage > 0 && (spellbonuses.MeleeLifetap || itembonuses.MeleeLifetap)) {
+	if(damage > 0 && (spellbonuses.MeleeLifetap || itembonuses.MeleeLifetap)) {
+		int lifetap_amt = spellbonuses.MeleeLifetap + itembonuses.MeleeLifetap;
+		if(lifetap_amt > 100)
+			lifetap_amt = 100;
+		lifetap_amt = damage * lifetap_amt / 100;
 		mlog(COMBAT__DAMAGE, "Melee lifetap healing for %d damage.", damage);
 		//heal self for damage done..
-		HealDamage(damage);
+		HealDamage(lifetap_amt);
 	}
 	
 	//break invis when you attack
bonuses
Code:
Index: bonuses.cpp
===================================================================
--- bonuses.cpp	(revision 1607)
+++ bonuses.cpp	(working copy)
@@ -1075,7 +1075,8 @@
 				
 			case SE_MeleeLifetap:
 			{
-				newbon->MeleeLifetap = true;
+				if(newbon->MeleeLifetap < spells[spell_id].base[i])
+					newbon->MeleeLifetap = spells[spell_id].base[i];
 				break;
 			}
mob.h
Code:
Index: mob.h
===================================================================
--- mob.h	(revision 1607)
+++ mob.h	(working copy)
@@ -268,7 +268,7 @@
 	sint16 DoTShielding;
 
 	sint8 HundredHands;		//extra haste, stacks with all other haste  i
-	bool MeleeLifetap;  //i
+	sint8 MeleeLifetap;  //i
 	int XPRateMod;
 
 	sint8	Packrat;	//weight reduction for items, 1 point = 10%
Reply With Quote
Reply


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 01:55 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3