PDA

View Full Version : COMMITTED: SE_ApplyEffect


Caryatis
07-06-2010, 10:56 PM
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 (http://lucy.allakhazam.com/spell.html?id=15047&source=Live) and Talisman of Unity (http://lucy.allakhazam.com/spell.html?id=19475&source=Live)

Code...

spell_effects.cpp - line 2815 - add this
case SE_ApplyEffect:

spells.cpp - line 3849 - add this
TryApplyEffect(spelltar, spell_id);

mob.h - line 782 - add this
void TryApplyEffect(Mob *target, uint32 spell_id);

mob.cpp - line 3075 - add this
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
spells.cpp - line 3849 - add this
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...

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
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
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
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
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