Skip to content

Commit 5caca20

Browse files
committed
Chaos 2 -> 14 Monsters & Maps
1 parent aad6bb7 commit 5caca20

File tree

23 files changed

+336
-151
lines changed

23 files changed

+336
-151
lines changed
6.58 KB
Binary file not shown.
4.04 KB
Binary file not shown.
-64 Bytes
Binary file not shown.
86.7 KB
Binary file not shown.

Zolian.Server.Base/Enums/MonsterEnums.cs

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,17 @@ public enum MonsterType
1212
None,
1313
Physical,
1414
Magical,
15-
GodlyStr,
16-
GodlyInt,
17-
GodlyWis,
18-
GodlyCon,
19-
GodlyDex,
20-
Above99P,
21-
Above99M,
22-
Above150P,
23-
Above150M,
24-
Above200P,
25-
Above200M,
26-
Above250P,
27-
Above250M,
28-
MasterStr,
29-
MasterInt,
30-
MasterWis,
31-
MasterCon,
32-
MasterDex,
33-
Forsaken,
34-
Above300P,
35-
Above300M,
36-
Above350P,
37-
Above350M,
38-
Above400P,
39-
Above400M,
40-
Above450P,
41-
Above450M,
42-
Above500P,
43-
Above500M,
44-
DivineStr,
45-
DivineInt,
46-
DivineWis,
47-
DivineCon,
48-
DivineDex,
4915
MiniBoss,
5016
Rift,
5117
Boss
5218
}
5319

5420
/// <summary>
55-
/// Common - 75% AC & Will Save
56-
/// Tank - 98% AC & 50% Will Save
57-
/// Caster - 50% AC & 98% Will Save
21+
/// Common - 55% AC & 75% Will Save
22+
/// Tank - 70% AC & 50% Will Save
23+
/// Caster - 40% AC & 90% Will Save
24+
/// <see cref="GameScripts.Formulas.WillSavingThrow" />
25+
/// <see cref="GameScripts.Formulas.Ac" />
5826
/// </summary>
5927
public enum MonsterArmorType
6028
{

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

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,55 @@ public override void OnEnded(Sprite affected, Debuff debuff)
14111411
}
14121412
}
14131413

1414+
public class DebuffDeepSleep : Debuff
1415+
{
1416+
public override byte Icon => 6;
1417+
public override int Length => 120;
1418+
public override string Name => "Deep Sleep";
1419+
1420+
public override void OnApplied(Sprite affected, Debuff debuff)
1421+
{
1422+
if (affected.Debuffs.TryAdd(debuff.Name, debuff))
1423+
{
1424+
DebuffSpell = debuff;
1425+
DebuffSpell.TimeLeft = DebuffSpell.Length;
1426+
}
1427+
1428+
if (affected is Damageable damageable)
1429+
{
1430+
damageable.SendAnimationNearby(32, null, affected.Serial);
1431+
damageable.SendTargetedClientMethod(PlayerScope.NearbyAislings, client => client.SendSound(29, false));
1432+
}
1433+
1434+
if (affected is not Aisling aisling) return;
1435+
aisling.PlayerSaveDirty = true;
1436+
}
1437+
1438+
public override void OnDurationUpdate(Sprite affected, Debuff debuff)
1439+
{
1440+
base.OnDurationUpdate(affected, debuff);
1441+
1442+
if (affected is Damageable damageable)
1443+
{
1444+
damageable.SendAnimationNearby(32, null, affected.Serial);
1445+
damageable.SendTargetedClientMethod(PlayerScope.NearbyAislings, client => client.SendSound(65, false));
1446+
}
1447+
1448+
if (affected is not Aisling aisling) return;
1449+
aisling.Client.SendServerMessage(ServerMessageType.OrangeBar1, "You've been placed in a dream like state");
1450+
}
1451+
1452+
public override void OnEnded(Sprite affected, Debuff debuff)
1453+
{
1454+
affected.Debuffs.TryRemove(debuff.Name, out _);
1455+
1456+
if (affected is not Aisling aisling) return;
1457+
aisling.Client.SendEffect(byte.MinValue, Icon);
1458+
aisling.Client.SendServerMessage(ServerMessageType.OrangeBar1, "Was that a dream?");
1459+
aisling.PlayerSaveDirty = true;
1460+
aisling.Client.SendAttributes(StatUpdateType.Full);
1461+
}
1462+
}
14141463

14151464
public class DebuffSleep : Debuff
14161465
{

Zolian.Server.Base/GameScripts/Areas/Abel/FightHall.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public override void OnPlayerWalk(WorldClient client, Position oldLocation, Posi
4343
{
4444
_playersOnMap.TryAdd(client.Aisling.Serial, client.Aisling);
4545
}
46+
4647
public override void OnItemDropped(WorldClient client, Item itemDropped, Position locationDropped) { }
4748
public override void OnGossip(WorldClient client, string message) { }
4849
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Darkages.Network.Client;
2+
using Darkages.ScriptingBase;
3+
using Darkages.Sprites.Entity;
4+
using Darkages.Types;
5+
6+
namespace Darkages.GameScripts.Areas.Pravat;
7+
8+
[Script("ChaosDarkness")]
9+
public class ChaosDarkness : AreaScript
10+
{
11+
public ChaosDarkness(Area area) : base(area) => Area = area;
12+
public override void Update(TimeSpan elapsedTime) { }
13+
14+
public override void OnMapEnter(WorldClient client)
15+
{
16+
client.SendServerMessage(ServerMessageType.ActiveMessage, "The darkness of the Chaos has enveloped you...");
17+
}
18+
19+
public override void OnMapExit(WorldClient client) { }
20+
public override void OnPlayerWalk(WorldClient client, Position oldLocation, Position newLocation) { }
21+
public override void OnItemDropped(WorldClient client, Item itemDropped, Position locationDropped) { }
22+
public override void OnGossip(WorldClient client, string message) { }
23+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System.Collections.Concurrent;
2+
3+
using Darkages.Network.Client;
4+
using Darkages.ScriptingBase;
5+
using Darkages.Sprites;
6+
using Darkages.Sprites.Entity;
7+
using Darkages.Types;
8+
9+
namespace Darkages.GameScripts.Areas.Pravat;
10+
11+
[Script("LavaPits")]
12+
public class LavaPits : AreaScript
13+
{
14+
private readonly ConcurrentDictionary<long, Aisling> _playersOnMap = [];
15+
public LavaPits(Area area) : base(area) => Area = area;
16+
public override void Update(TimeSpan elapsedTime) { }
17+
18+
public override void OnMapEnter(WorldClient client)
19+
{
20+
_playersOnMap.TryAdd(client.Aisling.Serial, client.Aisling);
21+
client.SendServerMessage(ServerMessageType.ActiveMessage, "The heat of the Lava Pits engulfs you...");
22+
}
23+
24+
public override void OnMapExit(WorldClient client) => _playersOnMap.TryRemove(client.Aisling.Serial, out _);
25+
26+
public override void OnPlayerWalk(WorldClient client, Position oldLocation, Position newLocation)
27+
{
28+
_playersOnMap.TryAdd(client.Aisling.Serial, client.Aisling);
29+
}
30+
31+
public override void OnNpcWalk(Movable npc)
32+
{
33+
if (_playersOnMap.IsEmpty) return;
34+
35+
try
36+
{
37+
if (Area.TileContent[npc.Position.X, npc.Position.Y] == Enums.TileContent.Wall && npc is Monster monster)
38+
monster.SendAnimationNearby(223, npc.Position);
39+
}
40+
catch { }
41+
}
42+
}

Zolian.Server.Base/GameScripts/Monsters/AdvancedMonsterAI.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public override void MonsterState(TimeSpan elapsedTime)
531531
Monster.Aggressive = false;
532532

533533
if (Monster.CantMove || !Monster.WalkEnabled) return;
534-
if (walk) Monster.Walk();
534+
if (walk) Monster.PreWalkChecks();
535535

536536
return;
537537
}
@@ -546,7 +546,7 @@ public override void MonsterState(TimeSpan elapsedTime)
546546
if (Monster.WalkEnabled)
547547
{
548548
if (Monster.CantMove) return;
549-
if (walk) Monster.Walk();
549+
if (walk) Monster.PreWalkChecks();
550550
}
551551

552552
Monster.UpdateTarget();
@@ -770,7 +770,7 @@ public override void MonsterState(TimeSpan elapsedTime)
770770
Monster.Aggressive = false;
771771

772772
if (Monster.CantMove || !Monster.WalkEnabled) return;
773-
if (walk) Monster.Walk();
773+
if (walk) Monster.PreWalkChecks();
774774

775775
return;
776776
}
@@ -800,7 +800,7 @@ public override void MonsterState(TimeSpan elapsedTime)
800800
if (Monster.WalkEnabled)
801801
{
802802
if (Monster.CantMove) return;
803-
if (walk) Monster.Walk();
803+
if (walk) Monster.PreWalkChecks();
804804
}
805805

806806
Monster.UpdateTarget();
@@ -1294,7 +1294,7 @@ public override void MonsterState(TimeSpan elapsedTime)
12941294
Monster.ClearTarget();
12951295

12961296
if (Monster.CantMove || !Monster.WalkEnabled) return;
1297-
if (walk) Monster.Walk();
1297+
if (walk) Monster.PreWalkChecks();
12981298

12991299
return;
13001300
}
@@ -1321,7 +1321,7 @@ public override void MonsterState(TimeSpan elapsedTime)
13211321
if (Monster.WalkEnabled)
13221322
{
13231323
if (Monster.CantMove) return;
1324-
if (walk) Monster.Walk();
1324+
if (walk) Monster.PreWalkChecks();
13251325
var rand = Generator.RandomPercentPrecise();
13261326
if (rand >= 0.93)
13271327
{
@@ -1582,7 +1582,7 @@ public override void MonsterState(TimeSpan elapsedTime)
15821582
Monster.ClearTarget();
15831583

15841584
if (Monster.CantMove || !Monster.WalkEnabled) return;
1585-
if (walk) Monster.Walk();
1585+
if (walk) Monster.PreWalkChecks();
15861586

15871587
return;
15881588
}
@@ -1609,7 +1609,7 @@ public override void MonsterState(TimeSpan elapsedTime)
16091609
if (Monster.WalkEnabled)
16101610
{
16111611
if (Monster.CantMove) return;
1612-
if (walk) Monster.Walk();
1612+
if (walk) Monster.PreWalkChecks();
16131613
var rand = Generator.RandomPercentPrecise();
16141614
if (rand >= 0.93)
16151615
{
@@ -1891,7 +1891,7 @@ public override void MonsterState(TimeSpan elapsedTime)
18911891
Monster.Aggressive = false;
18921892

18931893
if (Monster.CantMove || !Monster.WalkEnabled) return;
1894-
if (walk) Monster.Walk();
1894+
if (walk) Monster.PreWalkChecks();
18951895

18961896
return;
18971897
}
@@ -1918,7 +1918,7 @@ public override void MonsterState(TimeSpan elapsedTime)
19181918
if (Monster.WalkEnabled)
19191919
{
19201920
if (Monster.CantMove) return;
1921-
if (walk) Monster.Walk();
1921+
if (walk) Monster.PreWalkChecks();
19221922
var rand = Generator.RandomPercentPrecise();
19231923
if (rand >= 0.93)
19241924
{
@@ -2197,7 +2197,7 @@ public override void MonsterState(TimeSpan elapsedTime)
21972197
Monster.ClearTarget();
21982198

21992199
if (Monster.CantMove || !Monster.WalkEnabled) return;
2200-
if (walk) Monster.Walk();
2200+
if (walk) Monster.PreWalkChecks();
22012201

22022202
return;
22032203
}
@@ -2224,7 +2224,7 @@ public override void MonsterState(TimeSpan elapsedTime)
22242224
if (Monster.WalkEnabled)
22252225
{
22262226
if (Monster.CantMove) return;
2227-
if (walk) Monster.Walk();
2227+
if (walk) Monster.PreWalkChecks();
22282228
var rand = Generator.RandomPercentPrecise();
22292229
if (rand >= 0.93)
22302230
{
@@ -2494,7 +2494,7 @@ public override void MonsterState(TimeSpan elapsedTime)
24942494
Monster.ClearTarget();
24952495

24962496
if (Monster.CantMove || !Monster.WalkEnabled) return;
2497-
if (walk) Monster.Walk();
2497+
if (walk) Monster.PreWalkChecks();
24982498

24992499
return;
25002500
}
@@ -2521,7 +2521,7 @@ public override void MonsterState(TimeSpan elapsedTime)
25212521
if (Monster.WalkEnabled)
25222522
{
25232523
if (Monster.CantMove) return;
2524-
if (walk) Monster.Walk();
2524+
if (walk) Monster.PreWalkChecks();
25252525
var rand = Generator.RandomPercentPrecise();
25262526
if (rand >= 0.93)
25272527
{
@@ -2774,7 +2774,7 @@ public override void MonsterState(TimeSpan elapsedTime)
27742774
Monster.Aggressive = false;
27752775

27762776
if (Monster.CantMove || !Monster.WalkEnabled) return;
2777-
if (walk) Monster.Walk();
2777+
if (walk) Monster.PreWalkChecks();
27782778

27792779
return;
27802780
}
@@ -2801,7 +2801,7 @@ public override void MonsterState(TimeSpan elapsedTime)
28012801
if (Monster.WalkEnabled)
28022802
{
28032803
if (Monster.CantMove) return;
2804-
if (walk) Monster.Walk();
2804+
if (walk) Monster.PreWalkChecks();
28052805
}
28062806

28072807
Monster.UpdateTarget(true);
@@ -3068,7 +3068,7 @@ public override void MonsterState(TimeSpan elapsedTime)
30683068
Monster.Aggressive = false;
30693069

30703070
if (Monster.CantMove || !Monster.WalkEnabled) return;
3071-
if (walk) Monster.Walk();
3071+
if (walk) Monster.PreWalkChecks();
30723072

30733073
return;
30743074
}
@@ -3095,7 +3095,7 @@ public override void MonsterState(TimeSpan elapsedTime)
30953095
if (Monster.WalkEnabled)
30963096
{
30973097
if (Monster.CantMove) return;
3098-
if (walk) Monster.Walk();
3098+
if (walk) Monster.PreWalkChecks();
30993099
}
31003100

31013101
Monster.UpdateTarget(true);

0 commit comments

Comments
 (0)