From d120bb99f5e7070c58f2014646519b59f71dc2c7 Mon Sep 17 00:00:00 2001 From: ryma Date: Fri, 22 Apr 2022 16:15:58 -0400 Subject: [PATCH] Fountain Enemy fix --- .../AttackableUnits/AttackableUnit.cs | 24 +++++++++++++++---- GameServerLib/GameObjects/Fountain.cs | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs b/GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs index 281a52dd1..d0b32606a 100644 --- a/GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs +++ b/GameServerLib/GameObjects/AttackableUnits/AttackableUnit.cs @@ -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) @@ -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) { @@ -1302,7 +1310,11 @@ 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(); + } + return; } @@ -1326,7 +1338,11 @@ 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. diff --git a/GameServerLib/GameObjects/Fountain.cs b/GameServerLib/GameObjects/Fountain.cs index ae10459e1..9fe0ef957 100644 --- a/GameServerLib/GameObjects/Fountain.cs +++ b/GameServerLib/GameObjects/Fountain.cs @@ -40,7 +40,7 @@ public void Update(float diff) { if (champion.Team != Team) { - continue; + champion.Stats.CurrentHealth -= 5000; } var hp = champion.Stats.CurrentHealth;