fix: Fixes curses and spell effects (#1112)
* * Fix statmod naming mismatch: everything in code searches for "[Magic] {type} Offset" but stat reductions are being added as "[Magic] {type} Curse"
* Clarifies and cleans up curses
* Fixes blood oath
* * NobleSacrifice remove all curses in one go
* Dont need a method
* Fix extra parentheses
Co-authored-by: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
This commit is contained in:
parent
ad0e1702a3
commit
bd4e6fc30e
10 changed files with 126 additions and 126 deletions
|
|
@ -1238,24 +1238,22 @@ namespace Server.Items
|
|||
0x100
|
||||
);
|
||||
|
||||
StatMod mod;
|
||||
|
||||
mod = target.GetStatMod("[Magic] Str Offset");
|
||||
var mod = target.GetStatMod("[Magic] Str Curse");
|
||||
if (mod?.Offset < 0)
|
||||
{
|
||||
target.RemoveStatMod("[Magic] Str Offset");
|
||||
target.RemoveStatMod("[Magic] Str Curse");
|
||||
}
|
||||
|
||||
mod = target.GetStatMod("[Magic] Dex Offset");
|
||||
mod = target.GetStatMod("[Magic] Dex Curse");
|
||||
if (mod?.Offset < 0)
|
||||
{
|
||||
target.RemoveStatMod("[Magic] Dex Offset");
|
||||
target.RemoveStatMod("[Magic] Dex Curse");
|
||||
}
|
||||
|
||||
mod = target.GetStatMod("[Magic] Int Offset");
|
||||
mod = target.GetStatMod("[Magic] Int Curse");
|
||||
if (mod?.Offset < 0)
|
||||
{
|
||||
target.RemoveStatMod("[Magic] Int Offset");
|
||||
target.RemoveStatMod("[Magic] Int Curse");
|
||||
}
|
||||
|
||||
target.Paralyzed = false;
|
||||
|
|
|
|||
|
|
@ -41,12 +41,15 @@ namespace Server.Items
|
|||
|
||||
public static bool IsWounded(Mobile m) => _table.ContainsKey(m);
|
||||
|
||||
private static void StopTimer(Mobile m)
|
||||
private static bool StopTimer(Mobile m)
|
||||
{
|
||||
if (_table.Remove(m, out var timerToken))
|
||||
{
|
||||
timerToken.Cancel();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void BeginWound(Mobile m, TimeSpan duration)
|
||||
|
|
@ -58,11 +61,16 @@ namespace Server.Items
|
|||
m.YellowHealthbar = true;
|
||||
}
|
||||
|
||||
public static void EndWound(Mobile m)
|
||||
public static bool EndWound(Mobile m)
|
||||
{
|
||||
StopTimer(m);
|
||||
m.YellowHealthbar = false;
|
||||
m.SendLocalizedMessage(1060208); // You are no longer mortally wounded.
|
||||
if (StopTimer(m))
|
||||
{
|
||||
m.YellowHealthbar = false;
|
||||
m.SendLocalizedMessage(1060208); // You are no longer mortally wounded.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue