-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
767 additions
and
17 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Zolian.Server.Base/GameScripts/Areas/Abel/AtlantisEntrance.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Darkages.Network.Client; | ||
using Darkages.ScriptingBase; | ||
using Darkages.Types; | ||
using System.Numerics; | ||
using Darkages.Enums; | ||
using Darkages.Sprites.Entity; | ||
|
||
namespace Darkages.GameScripts.Areas.Abel; | ||
|
||
[Script("AtlantisEntrance")] | ||
public class AtlantisEntrance : AreaScript | ||
{ | ||
public AtlantisEntrance(Area area) : base(area) => Area = area; | ||
public override void Update(TimeSpan elapsedTime) { } | ||
public override void OnMapEnter(WorldClient client) { } | ||
public override void OnMapExit(WorldClient client) { } | ||
|
||
public override void OnPlayerWalk(WorldClient client, Position oldLocation, Position newLocation) | ||
{ | ||
var vectorMap = new Vector2(newLocation.X, newLocation.Y); | ||
if (client.Aisling.Pos != vectorMap) return; | ||
|
||
switch (newLocation.X) | ||
{ | ||
case 15 when newLocation.Y == 14: | ||
if (client.Aisling.QuestManager.ScubaGearCrafted && client.Aisling.EquipmentManager.Equipment[16]?.Item?.Template.Name == "Scuba Gear" | ||
|| client.Aisling.Race.RaceFlagIsSet(Race.Merfolk)) | ||
{ | ||
client.TransitionToMap(188, new Position(2, 19)); | ||
return; | ||
} | ||
|
||
client.SendServerMessage(ServerMessageType.ActiveMessage, "I'm afraid I'll drown if I slip under this rock! I need to find some Scuba Gear."); | ||
break; | ||
} | ||
} | ||
|
||
public override void OnItemDropped(WorldClient client, Item itemDropped, Position locationDropped) { } | ||
public override void OnGossip(WorldClient client, string message) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using Darkages.Common; | ||
using Darkages.Network.Client; | ||
using Darkages.ScriptingBase; | ||
using Darkages.Sprites; | ||
using Darkages.Types; | ||
|
||
using System.Collections.Concurrent; | ||
using System.Security.Cryptography; | ||
|
||
namespace Darkages.GameScripts.Areas.Generic; | ||
|
||
[Script("Rift")] | ||
public class Rift : AreaScript | ||
{ | ||
private readonly ConcurrentDictionary<long, Aisling> _playersOnMap = []; | ||
private WorldServerTimer AnimTimer { get; } | ||
private bool _animate; | ||
|
||
public Rift(Area area) : base(area) | ||
{ | ||
Area = area; | ||
AnimTimer = new WorldServerTimer(TimeSpan.FromMilliseconds(1 + 2000)); | ||
} | ||
|
||
public override void Update(TimeSpan elapsedTime) | ||
{ | ||
if (_playersOnMap.IsEmpty) | ||
_animate = false; | ||
|
||
if (_animate) | ||
HandleMapAnimations(elapsedTime); | ||
} | ||
|
||
public override void OnMapEnter(WorldClient client) | ||
{ | ||
_playersOnMap.TryAdd(client.Aisling.Serial, client.Aisling); | ||
client.SendServerMessage(ServerMessageType.ActiveMessage, "Strong one, temper your will!"); | ||
client.SendSound((byte)Random.Shared.Next(119), true); | ||
if (!_playersOnMap.IsEmpty) | ||
_animate = true; | ||
} | ||
|
||
public override void OnMapExit(WorldClient client) | ||
{ | ||
_playersOnMap.TryRemove(client.Aisling.Serial, out _); | ||
|
||
if (_playersOnMap.IsEmpty) | ||
_animate = false; | ||
} | ||
|
||
public override void OnPlayerWalk(WorldClient client, Position oldLocation, Position newLocation) => _playersOnMap.TryAdd(client.Aisling.Serial, client.Aisling); | ||
|
||
private void HandleMapAnimations(TimeSpan elapsedTime) | ||
{ | ||
var a = AnimTimer.Update(elapsedTime); | ||
if (!a) return; | ||
if (_playersOnMap.IsEmpty) return; | ||
|
||
for (var i = 0; i < 6; i++) | ||
{ | ||
var randA = Random.Shared.Next(0, 40); | ||
var randB = Random.Shared.Next(80, 119); | ||
_playersOnMap.Values.FirstOrDefault()?.SendAnimationNearby(384, new Position(randA, randB)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.