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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2010, 09:45 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default COMMITTED: SE_SympatheticProc(formerly SE_Leap)

While this effect is quite new and not really relevant to any server without Underfoot loot and spells, it is pretty cool and would be easy to add to any server that wanted it.

First off, it was mislabeled SE_Leap, which is actually spell effect 384(Battle Leap).

For those not familiar with this effect, it is an item focus(only found on prim and secondary slots on live) that has chance to proc another spell when you cast a spell. Seems to have 10% base proc rate, however that can be altered in the spell if wanted. Here is a list of the stock sympathetic procs... Lucy sucks for this effect.

Basic run down of the 4 basic varieties...
- If you cast a beneficial spell -> can proc a beneficial spell on target(ie heal proc off heal spell)
- If you cast a beneficial spell -> can proc a detrimental spell on yourself(ie a cursed item, has chance to do something nasty to you).

- If you cast a detrimental spell -> can proc a detrimental spell on target(ie dd proc after a dd cast)
- If you cast a detrimental spell -> can proc a beneficial spell on yourself(ie get healed after a DD)

If you look through the list, there are quite a few different ways to exploit this effect(mana back on DDs, group heals on beneficials, a temp pet proc, etc.)

code...
spdat.h
Code:
Index: spdat.h
===================================================================
--- spdat.h	(revision 1610)
+++ spdat.h	(working copy)
@@ -520,7 +520,7 @@
 #define SE_Knockdown				380 //small knock back + stun or feign?
 //#define SE_Unknown381				381	//not used
 #define SE_BlockDS					382 //something to do with blocking a % of certain ds?
-#define SE_Leap						383 //used to leap forward? probably something like a small knock back reverse to push you forward
+#define SE_SympatheticProc			383 //focus on items that has chance to proc a spell when you cast
 //#define SE_Unknown384				384	//not used
 //#define SE_Unknown385				385	//not used
 //last effect
spells.cpp
Code:
Index: spells.cpp
===================================================================
--- spells.cpp	(revision 1610)
+++ spells.cpp	(working copy)
@@ -1065,6 +1065,9 @@
 		}
 	}
 	
+	if(IsClient()) 
+		TrySympatheticProc(target, spell_id);
+	
 	// we're done casting, now try to apply the spell
 	if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot) )
 	{
spell effects
Code:
Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp	(revision 1610)
+++ spell_effects.cpp	(working copy)
@@ -2812,6 +2812,7 @@
 			case SE_LimitCastTime:
 			case SE_NoCombatSkills:
 			case SE_TriggerOnCast:
+			case SE_SympatheticProc:
 			{
 				break;
 			}
@@ -3860,6 +3861,21 @@
 			}
 			break;
 		}
+		case SE_SympatheticProc:
+		{
+			if(type == focusSympatheticProc)
+			{
+				if(MakeRandomInt(0, 1000) <= focus_spell.base[i])
+				{
+					value = focus_id;
+				}
+				else
+				{
+					value = 0;
+				}
+			}
+			break;
+		}
 #if EQDEBUG >= 6
 		//this spits up a lot of garbage when calculating spell focuses
 		//since they have all kinds of extra effects on them.
mob.h
Code:
Index: mob.h
===================================================================
--- mob.h	(revision 1610)
+++ mob.h	(working copy)
@@ -87,6 +87,7 @@
 	focusResistRate,
 	focusSpellHateMod,
 	focusTriggerOnCast,
+	focusSympatheticProc,
 } focusType;
 
 enum {
@@ -778,6 +779,7 @@
 	bool TryDeathSave();
 	void DoBuffWearOffEffect(uint32 index);
 	void TryTriggerOnCast(Mob *target, uint32 spell_id);
+	void TrySympatheticProc(Mob *target, uint32 spell_id);
 
 	static int32 GetAppearanceValue(EmuAppearance iAppearance);
 	void SendAppearancePacket(int32 type, int32 value, bool WholeZone = true, bool iIgnoreSelf = false, Client *specific_target=NULL);
mob.cpp
Code:
Index: mob.cpp
===================================================================
--- mob.cpp	(revision 1610)
+++ mob.cpp	(working copy)
@@ -3036,4 +3036,44 @@
 			}
 		}
 	}
}
+
+void Mob::TrySympatheticProc(Mob *target, uint32 spell_id)
+{
+	if(target == NULL || !IsValidSpell(spell_id))
+	{
+		return;
+	}
+	
+	int focus_spell = this->CastToClient()->GetFocusEffect(focusSympatheticProc,spell_id);
+	if(focus_spell > 0)
+	{
+		int focus_trigger = spells[focus_spell].base2[0];
+		// For beneficial spells, if the triggered spell is also beneficial then proc it on the target
+		// if the triggered spell is detrimental, then it will trigger on the caster(ie cursed items)
+		if(IsBeneficialSpell(spell_id))
+		{
+			if(IsBeneficialSpell(focus_trigger))
+			{
+				SpellOnTarget(focus_trigger, target);
+			}
+			else
+			{
+				SpellOnTarget(focus_trigger, this);
+			}
+		}
+		// For detrimental spells, if the triggered spell is beneficial, then it will land on the caster
+		// if the triggered spell is also detrimental, then it will land on the target
+		else
+		{
+			if(IsBeneficialSpell(focus_trigger))
+			{
+				SpellOnTarget(focus_trigger, this);
+			}
+			else
+			{
+				SpellOnTarget(focus_trigger, target);
+			}
+		}
+	}
 }
\ No newline at end of file
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 05:16 PM.


 

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