Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

BuffStack fix #1427

Open
wants to merge 1 commit into
base: indev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,11 @@ public void AddBuff(IBuff b)
_game.PacketNotifier.NotifyNPC_BuffAdd2(b);
}
// Activate the buff for BuffScripts
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
{
b.ActivateBuff();
}

}
// If the buff is supposed to replace any existing buff instances of the same name
else if (b.BuffAddType == BuffAddType.REPLACE_EXISTING)
Expand Down Expand Up @@ -1219,7 +1223,11 @@ public void AddBuff(IBuff b)
}

// New buff means new script, so we need to activate it.
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
{
b.ActivateBuff();
}

}
else if (b.BuffAddType == BuffAddType.RENEW_EXISTING)
{
Expand Down Expand Up @@ -1326,7 +1334,10 @@ public void AddBuff(IBuff b)
_game.PacketNotifier.NotifyNPC_BuffUpdateCount(b, b.Duration, b.TimeElapsed);
}
}
b.ActivateBuff();
for(int i = 0; i < b.MaxStacks; ++i)
{
b.ActivateBuff();
}
}
// If the buff is supposed to add a stack to any existing buffs of the same name and refresh their timer.
// Essentially the method is: have one parent buff which has the stacks, and just refresh its time, this means no overlapping buff instances, but functionally it is the same.
Expand Down