EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED: SE_ApplyEffect (https://www.eqemulator.org/forums/showthread.php?t=31611)

Caryatis 07-06-2010 10:56 PM

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);
                        }
                }
        }
}


trevius 07-11-2010 02:05 AM

Quote:

Originally Posted by Caryatis (Post 189552)
spells.cpp - line 3849 - add this
Code:

TryApplyEffect(spelltar, spell_id);

I assume you meant line 2849?

Caryatis 07-11-2010 02:22 AM

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.

Caryatis 07-14-2010 10:36 PM

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



All times are GMT -4. The time now is 02:50 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.