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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2010, 10:56 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default COMMITTED: SE_ApplyEffect

Very similiar to the other 2 casting effects, this effect also casts a series a spells on your target, however it is not dependant on a buff and there are no limits on which effects land(all seem to have 100% proc rates).

Summer's Viridity and Talisman of Unity

Code...

spell_effects.cpp - line 2815 - add this
Code:
case SE_ApplyEffect:
spells.cpp - line 3849 - add this
Code:
TryApplyEffect(spelltar, spell_id);
mob.h - line 782 - add this
Code:
void TryApplyEffect(Mob *target, uint32 spell_id);
mob.cpp - line 3075 - add this
Code:
void Mob::TryApplyEffect(Mob *target, uint32 spell_id)
{
	if(target == NULL || !IsValidSpell(spell_id))
	{
		return;
	}

	for(int i = 0; i < EFFECT_COUNT; i++)
	{
		if (spells[spell_id].effectid[i] == SE_ApplyEffect)
		{
			if(MakeRandomInt(0, 100) <= spells[spell_id].base[i]) 
			{
				SpellOnTarget(spells[spell_id].base2[i], target);
			}
		}
	}
}
Reply With Quote
  #2  
Old 07-11-2010, 02:05 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by Caryatis View Post
spells.cpp - line 3849 - add this
Code:
TryApplyEffect(spelltar, spell_id);
I assume you meant line 2849?
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 07-11-2010, 02:22 AM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

that was pretty wrong lol, in clean source it would be 3047 but to be more accurate...

Code:
	        SpellOnTarget(recourse_spell, this);
			}
		}

	TryApplyEffect(spelltar, spell_id);

	if(spell_id == 982)	// Cazic Touch, hehe =P
After the recourse effects, although before(2849) should have the same function.
Reply With Quote
  #4  
Old 07-14-2010, 10:36 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

To avoid confusion, I made a diff.


spell_effects
Code:
Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp	(revision 1602)
+++ spell_effects.cpp	(working copy)
@@ -2812,6 +2812,7 @@
 			case SE_LimitCastTime:
 			case SE_NoCombatSkills:
 			case SE_TriggerOnCast:
+			case SE_ApplyEffect:
 			{
 				break;
 			}
spells.cpp
Code:
Index: spells.cpp
===================================================================
--- spells.cpp	(revision 1602)
+++ spells.cpp	(working copy)
@@ -3045,6 +3045,8 @@
 		}
 
 	TryTriggerOnCast(spelltar, spell_id);
+	
+	TryApplyEffect(spelltar, spell_id);
 
 	if(spell_id == 982)	// Cazic Touch, hehe =P
 	{
mob.h
Code:
Index: mob.h
===================================================================
--- mob.h	(revision 1602)
+++ mob.h	(working copy)
@@ -778,6 +778,7 @@
 	bool TryDeathSave();
 	void DoBuffWearOffEffect(uint32 index);
 	void TryTriggerOnCast(Mob *target, uint32 spell_id);
+	void TryApplyEffect(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 1602)
+++ mob.cpp	(working copy)
@@ -3036,4 +3036,23 @@
 			}
 		}
 	}
+}
+
+void Mob::TryApplyEffect(Mob *target, uint32 spell_id)
+{
+	if(target == NULL || !IsValidSpell(spell_id))
+	{
+		return;
+	}
+
+	for(int i = 0; i < EFFECT_COUNT; i++)
+	{
+		if (spells[spell_id].effectid[i] == SE_ApplyEffect)
+		{
+			if(MakeRandomInt(0, 100) <= spells[spell_id].base[i]) 
+			{
+				SpellOnTarget(spells[spell_id].base2[i], 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 04:32 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