View Single Post
  #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