View Single Post
  #1  
Old 10-18-2008, 10:01 AM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default Check For SpellEffect Fix

I ran into this issue primarily with Levitate. If anyone can think of another effect that this might be useful for it should be a reasonably simple implementation.

Basically, lets say you cast Flight of Eagles and then a Bard uses Selo's Song of Travel (Invis/Levi/Movement song). As soon as EITHER buff fades, you lose levi, even though you still have the other buff supposedly giving you levi.

This is my fix.

{mob.h}
insert anywhere
Code:
bool    AffectedExcludingSlot(int slot, int effect);
{spell_effects.cpp}
append
Code:
bool Mob::AffectedExcludingSlot(int slot, int effect)
{
	for (int i = 0; i <= EFFECT_COUNT; i++)
	{
		if (i == slot)
			continue;

		if (IsEffectInSpell(buffs[i].spellid, effect))
			return true;
	}
	return false;
}
in void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
find
Code:
case SE_Levitate:
			{
				SendAppearancePacket(AT_Levitate, 0);
				break;
			}
replace with
Code:
case SE_Levitate:
			{
				if (!AffectedExcludingSlot(slot, SE_Levitate))
					SendAppearancePacket(AT_Levitate, 0);
				break;
			}
Reply With Quote