Skip to content

Commit b318b29

Browse files
committed
Ninja First-Look & Job Skill Adjustments
1 parent fd6f595 commit b318b29

File tree

15 files changed

+645
-50
lines changed

15 files changed

+645
-50
lines changed

Zolian.GameServer/Zolian.GameServer.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@
4242
<PackageReference Include="Chaos-Networking" Version="2.4.3" />
4343
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
4444
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
45-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.4">
45+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6">
4646
<TreatAsUsed>true</TreatAsUsed>
4747
</PackageReference>
48-
<PackageReference Include="Sentry" Version="5.6.0" />
49-
<PackageReference Include="Sentry.Extensions.Logging" Version="5.6.0" />
50-
<PackageReference Include="Sentry.Profiling" Version="5.6.0" />
51-
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.1" />
48+
<PackageReference Include="Sentry" Version="5.11.2" />
49+
<PackageReference Include="Sentry.Extensions.Logging" Version="5.11.2" />
50+
<PackageReference Include="Sentry.Profiling" Version="5.11.2" />
51+
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
5252
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
5353
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
5454
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
55-
<PackageReference Include="ServiceStack" Version="8.7.2" />
56-
<PackageReference Include="ServiceStack.Text" Version="8.7.2" />
55+
<PackageReference Include="ServiceStack" Version="8.8.0" />
56+
<PackageReference Include="ServiceStack.Text" Version="8.8.0" />
5757
</ItemGroup>
5858

5959
<ItemGroup>

Zolian.Server.Base/GameScripts/Affects/BuffAffects.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,69 @@ public override void OnItemChange(Aisling affected, Buff buff)
711711
}
712712
}
713713

714+
public class buff_RasenShoheki : Buff
715+
{
716+
public override byte Icon => 21;
717+
public override int Length => 30;
718+
public override string Name => "Rasen Shoheki";
719+
720+
public override void OnApplied(Sprite affected, Buff buff)
721+
{
722+
if (affected is Aisling berserkDebuff && affected.HasDebuff("Berserker Rage"))
723+
{
724+
berserkDebuff.Client.SendServerMessage(ServerMessageType.ActiveMessage, "You are unsure of your actions");
725+
return;
726+
}
727+
728+
if (affected.Buffs.TryAdd(buff.Name, buff))
729+
{
730+
BuffSpell = buff;
731+
BuffSpell.TimeLeft = BuffSpell.Length;
732+
}
733+
734+
if (affected is Damageable damageable)
735+
{
736+
damageable.SendAnimationNearby(185, null, affected.Serial);
737+
damageable.SendTargetedClientMethod(PlayerScope.NearbyAislings, client => client.SendSound(30, false));
738+
}
739+
740+
741+
if (affected is not Aisling aisling) return;
742+
aisling.Client.SendServerMessage(ServerMessageType.ActiveMessage, "Swirling Wind surrounds you, protecting you!");
743+
InsertBuff(aisling, buff);
744+
}
745+
746+
public override void OnDurationUpdate(Sprite affected, Buff buff)
747+
{
748+
base.OnDurationUpdate(affected, buff);
749+
var vitality = affected.CurrentHp + affected.CurrentMp;
750+
if (affected.RasenShohekiShield >= vitality)
751+
{
752+
if (affected is Aisling aisling)
753+
aisling.SendAnimationNearby(129, aisling.Position);
754+
OnEnded(affected, buff);
755+
return;
756+
}
757+
758+
if (affected is not Aisling berserkDebuff) return;
759+
// Display Rasen Shoheki animation
760+
berserkDebuff.SendAnimationNearby(299, berserkDebuff.Position);
761+
if (!affected.HasBuff("Berserker Rage")) return;
762+
berserkDebuff.Client.SendServerMessage(ServerMessageType.ActiveMessage, "You are unsure of your actions");
763+
OnEnded(berserkDebuff, buff);
764+
}
765+
766+
public override void OnEnded(Sprite affected, Buff buff)
767+
{
768+
affected.Buffs.TryRemove(buff.Name, out _);
769+
affected.RasenShohekiShield = 0;
770+
if (affected is not Aisling aisling) return;
771+
aisling.Client.SendEffect(byte.MinValue, Icon);
772+
aisling.Client.SendServerMessage(ServerMessageType.ActiveMessage, "The protection fades");
773+
DeleteBuff(aisling, buff);
774+
}
775+
}
776+
714777
public class buff_wingsOfProtect : Buff
715778
{
716779
public override byte Icon => 194;

Zolian.Server.Base/GameScripts/Affects/DebuffAffects.cs

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,102 @@ public override void OnEnded(Sprite affected, Debuff debuff)
16231623

16241624
#region DoT
16251625

1626+
public class DebuffAmaterasu : Debuff
1627+
{
1628+
private static double Modifier => 0.15;
1629+
public override byte Icon => 18;
1630+
public override int Length => 250;
1631+
public override string Name => "Amaterasu";
1632+
1633+
public override void OnApplied(Sprite affected, Debuff debuff)
1634+
{
1635+
if (affected is Aisling { FireImmunity: true } immuneCheck)
1636+
{
1637+
immuneCheck.Client.SendServerMessage(ServerMessageType.ActiveMessage, "{=qYou are immune to Fire");
1638+
return;
1639+
}
1640+
1641+
if (affected.Debuffs.TryAdd(debuff.Name, debuff))
1642+
{
1643+
DebuffSpell = debuff;
1644+
DebuffSpell.TimeLeft = DebuffSpell.Length;
1645+
}
1646+
1647+
if (affected is Damageable damageable)
1648+
{
1649+
damageable.SendAnimationNearby(293, affected.Position);
1650+
damageable.SendTargetedClientMethod(PlayerScope.NearbyAislings, client => client.SendSound(34, false));
1651+
}
1652+
1653+
if (affected is not Aisling aisling) return;
1654+
aisling.RegenTimerDisabled = true;
1655+
InsertDebuff(aisling, debuff);
1656+
aisling.Client.SendAttributes(StatUpdateType.Secondary);
1657+
}
1658+
1659+
public override void OnDurationUpdate(Sprite affected, Debuff debuff)
1660+
{
1661+
base.OnDurationUpdate(affected, debuff);
1662+
1663+
ApplyBurn(affected);
1664+
1665+
if (affected is Damageable damageable)
1666+
damageable.SendAnimationNearby(217, null, affected.Serial);
1667+
1668+
if (affected is not Aisling aisling) return;
1669+
aisling.Client.SendServerMessage(ServerMessageType.OrangeBar1, "You're on fire!");
1670+
aisling.Client.SendAttributes(StatUpdateType.Vitality);
1671+
}
1672+
1673+
public override void OnEnded(Sprite affected, Debuff debuff)
1674+
{
1675+
affected.Debuffs.TryRemove(debuff.Name, out _);
1676+
if (affected is not Aisling aisling) return;
1677+
aisling.RegenTimerDisabled = false;
1678+
aisling.Client.SendEffect(byte.MinValue, Icon);
1679+
aisling.Client.SendServerMessage(ServerMessageType.OrangeBar1, "The burning has stopped");
1680+
DeleteDebuff(aisling, debuff);
1681+
aisling.Client.SendAttributes(StatUpdateType.Vitality);
1682+
}
1683+
1684+
private static void ApplyBurn(Sprite affected)
1685+
{
1686+
if (affected is Aisling { FireImmunity: true } immuneCheck)
1687+
{
1688+
immuneCheck.Client.SendServerMessage(ServerMessageType.ActiveMessage, "{=qYou are immune to Fire");
1689+
return;
1690+
}
1691+
1692+
var cap = (int)(affected.CurrentHp * Modifier);
1693+
1694+
if (affected is Monster monster)
1695+
{
1696+
int level = monster.Level;
1697+
int maxCap;
1698+
1699+
if (level >= 500)
1700+
{
1701+
// Clamp level between 500 and 1000
1702+
level = Math.Clamp(level, 500, 1000);
1703+
1704+
// Linear scale from 1,000,000 at level 500 to 20,000,000 at level 1000
1705+
var t = (level - 500) / 500.0;
1706+
maxCap = (int)(1_000_000 + t * (20_000_000 - 1_000_000));
1707+
}
1708+
else
1709+
{
1710+
maxCap = 500_000;
1711+
}
1712+
1713+
if (cap > maxCap) cap = maxCap;
1714+
monster.CurrentHp -= cap;
1715+
return;
1716+
}
1717+
1718+
if (cap > 0) affected.CurrentHp -= cap;
1719+
}
1720+
}
1721+
16261722
public class DebuffBleeding : Debuff
16271723
{
16281724
private static double Modifier => .07;

Zolian.Server.Base/GameScripts/Items/Consumable.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,7 @@ public override void OnDropped(Sprite sprite, Position droppedPosition, Area map
14551455
switch (Item.Template.Name)
14561456
{
14571457
case "Cleric's Feather":
1458+
{
14581459
const string script = "Blink";
14591460
ServerSetup.Instance.GlobalSkillTemplateCache.TryGetValue(script, out var skill);
14601461
if (skill == null) return;
@@ -1463,6 +1464,18 @@ public override void OnDropped(Sprite sprite, Position droppedPosition, Area map
14631464
scripts.TryGetValue(skill.ScriptName, out var skillScript);
14641465
skillScript?.ItemOnDropped(aisling, droppedPosition, map);
14651466
return;
1467+
}
1468+
case "Chakra Stone":
1469+
{
1470+
const string script = "Amenotejikara";
1471+
ServerSetup.Instance.GlobalSkillTemplateCache.TryGetValue(script, out var skill);
1472+
if (skill == null) return;
1473+
var scripts = ScriptManager.Load<SkillScript>(script,
1474+
Skill.Create(1, ServerSetup.Instance.GlobalSkillTemplateCache[script]));
1475+
scripts.TryGetValue(skill.ScriptName, out var skillScript);
1476+
skillScript?.ItemOnDropped(aisling, droppedPosition, map);
1477+
return;
1478+
}
14661479
}
14671480
}
14681481
}

0 commit comments

Comments
 (0)