-
Notifications
You must be signed in to change notification settings - Fork 19
Nexus Tower Scripts #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Nexus Tower Scripts #272
Changes from 16 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
7e587a4
Fix teleport GM rotation
enteryournamehere bc22bde
Paradox teleporters
enteryournamehere 11c39f3
Assembly tubes
enteryournamehere 475713f
Sentinel speed pads
enteryournamehere bdfcd5c
Sentinel area interaction things
enteryournamehere 97e17a8
Venture cannon
enteryournamehere 033cc9b
Venture League speed boost things
enteryournamehere 3d0287f
Merge branch 'dev' of github.com:UchuServer/Uchu into enhancement/nex…
enteryournamehere 4d6e746
Merge with dev (struct packets)
enteryournamehere b0381cd
Resolve conflicts
enteryournamehere 2c3e5ed
Improve teleporters
enteryournamehere eb60349
Terminate interactions
enteryournamehere 3caf92c
Darkitect cinematic script
enteryournamehere c2cc170
Paradox power panels
enteryournamehere d319460
Sentinel X-ray script (only does glowing effect)
enteryournamehere 6db265e
Add some comments
enteryournamehere 291acbf
Fix formatting
enteryournamehere d67c0ec
Merge branch 'dev' of github.com:UchuServer/Uchu into enhancement/nex…
enteryournamehere 6347ed7
Combat Challenge
enteryournamehere c401cf0
NT world teleporters
enteryournamehere 10ce166
Wishing Well + multiple ScriptName attributes
enteryournamehere dde053c
Ensure player has enough maelstrom infected bricks
enteryournamehere a3322a0
Replace insane code, support nested dictionaries.
enteryournamehere 6af0f37
More world teleporters
enteryournamehere a8bd8b0
l_wild_ambients and l_wild_ambient_crab scripts
enteryournamehere 14a9778
Fix NT portal to LEGO® Club world
enteryournamehere d08033a
Move OnMessageBoxRespond to associated GameObject
enteryournamehere 2b1f580
Combat challenge: progress mission 1010
enteryournamehere 50c556a
Spawn targets in the correct orientation
enteryournamehere eded330
Make scripts progress misison 1047
enteryournamehere cc03f37
Improve fountain drops
enteryournamehere 45b1cbf
Merge branch 'dev' of github.com:UchuServer/Uchu into enhancement/nex…
enteryournamehere 4138791
Maelstrom orb: set flag 1911
enteryournamehere 2357f39
Speedy Traveler achievement
enteryournamehere 2c2469d
Fix combat challenge targets not being destroyed
enteryournamehere f7a063d
possibly/hopefully fix combat challenge issues
enteryournamehere 155b172
Handle some possible errors
enteryournamehere 91deca4
Use GetGroup method
enteryournamehere f2ea0a9
Formatting
enteryournamehere aef2e96
Avoid possible null reference exception
enteryournamehere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,37 @@ | ||
using System.Numerics; | ||
using Uchu.World; | ||
using Uchu.World.Scripting.Native; | ||
|
||
namespace Uchu.StandardScripts.NexusTower | ||
{ | ||
[ScriptName("ScriptComponent_1535_script_name__removed")] | ||
public class ArmorSpawner : ObjectScript | ||
{ | ||
private const int ArmorCount = 3; | ||
|
||
/// <summary> | ||
/// Creates the object script. | ||
/// </summary> | ||
/// <param name="gameObject">Game object to control with the script.</param> | ||
public ArmorSpawner(GameObject gameObject) : base(gameObject) | ||
{ | ||
Listen(gameObject.OnInteract, player => { | ||
// Drop armor | ||
for (var i = 0; i < ArmorCount; i++) | ||
{ | ||
var loot = InstancingUtilities.InstantiateLoot(Lot.ThreeArmor, | ||
player, gameObject, gameObject.Transform.Position + Vector3.UnitY * 3); | ||
Start(loot); | ||
} | ||
|
||
// Terminate interaction so the player can interact again. | ||
player.Message(new TerminateInteractionMessage | ||
{ | ||
Associate = player, | ||
Terminator = gameObject, | ||
Type = TerminateType.FromInteraction, | ||
}); | ||
}); | ||
} | ||
} | ||
} |
This file contains hidden or 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,71 @@ | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using InfectedRose.Luz; | ||
using Uchu.World; | ||
using Uchu.World.Scripting.Native; | ||
|
||
namespace Uchu.StandardScripts.NexusTower | ||
{ | ||
[ScriptName("L_NT_ASSEMBLYTUBE_SERVER.lua")] | ||
public class AssemblyTube : ObjectScript | ||
{ | ||
/// <summary> | ||
/// Creates the object script. | ||
/// </summary> | ||
/// <param name="gameObject">Game object to control with the script.</param> | ||
public AssemblyTube(GameObject gameObject) : base(gameObject) | ||
{ | ||
// Get info from object settings | ||
var group = (string) gameObject.Settings["teleGroup"]; | ||
var cinematic = (string) gameObject.Settings["Cinematic"]; | ||
var animation = gameObject.Settings.ContainsKey("OverrideAnim") | ||
? (string) gameObject.Settings["OverrideAnim"] | ||
: "tube-sucker"; | ||
// nexus-tube-up also exists, don't know where it is used | ||
|
||
if (!gameObject.TryGetComponent<PhysicsComponent>(out var phys)) | ||
return; | ||
|
||
Listen(phys.OnEnter, other => | ||
{ | ||
// Should only teleport players | ||
if (!(other.GameObject is Player player)) | ||
return; | ||
|
||
// Find teleporter target location | ||
var target = Zone.GameObjects.FirstOrDefault(obj => | ||
obj.Settings.TryGetValue("groupID", out var group2) | ||
&& ((string) group2).Split(";").Contains(group)); | ||
|
||
if (target == null) | ||
return; | ||
|
||
// Show camera path. Lock player so animation can't be canceled. | ||
player.Message(new PlayCinematicMessage | ||
{ | ||
Associate = player, | ||
LockPlayer = true, | ||
PathName = cinematic, | ||
LeadIn = 0.5f, | ||
}); | ||
|
||
player.Animate(animation); | ||
|
||
// Default time in case camera path can't be found in luz file | ||
var time = 5f; | ||
// Find total camera path (cinematic) duration | ||
if (Zone.ZoneInfo.LuzFile.PathData.FirstOrDefault(p => | ||
p is LuzCameraPath && p.PathName == cinematic) is LuzCameraPath cameraPath) | ||
time = cameraPath.Waypoints.Sum(point => ((LuzCameraWaypoint) point).Time); | ||
|
||
// At the end of the cinematic, rebuild the player at the target location | ||
Task.Run(async () => | ||
{ | ||
await Task.Delay((int) (time * 1000) + 0); | ||
player.Teleport(target.Transform.Position); | ||
player.Animate("tube-resurrect"); | ||
}); | ||
}); | ||
} | ||
} | ||
} |
This file contains hidden or 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,37 @@ | ||
using Uchu.World; | ||
using Uchu.World.Scripting.Native; | ||
|
||
namespace Uchu.StandardScripts.NexusTower | ||
{ | ||
[ScriptName("ScriptComponent_1556_script_name__removed")] | ||
public class DarkitectReveal : ObjectScript | ||
{ | ||
/// <summary> | ||
/// Creates the object script. | ||
/// </summary> | ||
/// <param name="gameObject">Game object to control with the script.</param> | ||
public DarkitectReveal(GameObject gameObject) : base(gameObject) | ||
{ | ||
// Listen for players interacting with this object | ||
Listen(gameObject.OnInteract, player => | ||
{ | ||
// The client script will handle everything after it receives this message. | ||
player.Message(new NotifyClientObjectMessage | ||
{ | ||
Name = "reveal", | ||
ParamObj = player, | ||
Associate = gameObject, | ||
}); | ||
|
||
Zone.Schedule(() => | ||
{ | ||
// Set player's health to 1, as shown in the cinematic. | ||
// Wait 2 seconds before doing this to ensure it won't be visible before the cinematic starts. | ||
var stats = player.GetComponent<DestroyableComponent>(); | ||
stats.Health = 1; | ||
stats.Armor = 0; | ||
}, 2000); | ||
}); | ||
} | ||
} | ||
} |
This file contains hidden or 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,37 @@ | ||
using System.Numerics; | ||
using Uchu.World; | ||
using Uchu.World.Scripting.Native; | ||
|
||
namespace Uchu.StandardScripts.NexusTower | ||
{ | ||
[ScriptName("ScriptComponent_1534_script_name__removed")] | ||
public class HealthSpawner : ObjectScript | ||
{ | ||
private const int HealthCount = 3; | ||
|
||
/// <summary> | ||
/// Creates the object script. | ||
/// </summary> | ||
/// <param name="gameObject">Game object to control with the script.</param> | ||
public HealthSpawner(GameObject gameObject) : base(gameObject) | ||
{ | ||
Listen(gameObject.OnInteract, player => { | ||
// Drop health | ||
for (var i = 0; i < HealthCount; i++) | ||
{ | ||
var loot = InstancingUtilities.InstantiateLoot(Lot.ThreeHealth, | ||
player, gameObject, gameObject.Transform.Position + Vector3.UnitY * 3); | ||
Start(loot); | ||
} | ||
|
||
// Terminate interaction so the player can interact again. | ||
player.Message(new TerminateInteractionMessage | ||
{ | ||
Associate = player, | ||
Terminator = gameObject, | ||
Type = TerminateType.FromInteraction, | ||
}); | ||
}); | ||
} | ||
} | ||
} |
This file contains hidden or 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,32 @@ | ||
using Uchu.World; | ||
using Uchu.World.Scripting.Native; | ||
|
||
namespace Uchu.StandardScripts.NexusTower | ||
{ | ||
[ScriptName("ScriptComponent_1537_script_name__removed")] | ||
public class MaelstromConverter : ObjectScript | ||
{ | ||
/// <summary> | ||
/// Creates the object script. | ||
/// </summary> | ||
/// <param name="gameObject">Game object to control with the script.</param> | ||
public MaelstromConverter(GameObject gameObject) : base(gameObject) | ||
{ | ||
Listen(gameObject.OnInteract, player => | ||
{ | ||
// Let the player trade 25 Maelstrom Infected Bricks for 5 faction tokens | ||
var inventory = player.GetComponent<InventoryManagerComponent>(); | ||
inventory.RemoveLotAsync(Lot.MaelstromInfectedBrick, 25); | ||
enteryournamehere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
inventory.AddLotAsync(Lot.FactionTokenProxy, 5); | ||
|
||
// Terminate interaction so the player can interact again. | ||
player.Message(new TerminateInteractionMessage | ||
{ | ||
Associate = player, | ||
Terminator = gameObject, | ||
Type = TerminateType.FromInteraction, | ||
}); | ||
}); | ||
} | ||
} | ||
} |
This file contains hidden or 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,88 @@ | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Uchu.World; | ||
using Uchu.World.Scripting.Native; | ||
|
||
namespace Uchu.StandardScripts.NexusTower | ||
{ | ||
[ScriptName("L_NT_PARADOXTELE_SERVER.lua")] | ||
public class ParadoxTeleporter : ObjectScript | ||
{ | ||
/// <summary> | ||
/// Creates the object script. | ||
/// </summary> | ||
/// <param name="gameObject">Game object to control with the script.</param> | ||
public ParadoxTeleporter(GameObject gameObject) : base(gameObject) | ||
{ | ||
// Get info from object settings | ||
var group = (string) gameObject.Settings["teleGroup"]; | ||
var cinematic = (string) gameObject.Settings["Cinematic"]; | ||
|
||
// All these must have a physics component to detect the player entering. | ||
if (!gameObject.TryGetComponent<PhysicsComponent>(out var phys)) | ||
return; | ||
|
||
Listen(phys.OnEnter, other => | ||
{ | ||
// Should only teleport players. | ||
if (!(other.GameObject is Player player)) | ||
return; | ||
|
||
// Find teleporter target location. | ||
var target = Zone.GameObjects.FirstOrDefault(obj => obj.Settings.TryGetValue("groupID", out var group2) | ||
&& ((string) group2).Split(";").Contains(group)); | ||
enteryournamehere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (target == null) | ||
return; | ||
|
||
// The player shouldn't be able to move during the animation and the teleportation. | ||
player.Message(new SetStunnedMessage | ||
{ | ||
Associate = player, | ||
Originator = gameObject, | ||
StateChangeType = StunState.Push, | ||
CantAttack = true, | ||
CantJump = true, | ||
CantMove = true, | ||
CantTurn = true, | ||
}); | ||
|
||
// Show teleport animation. | ||
player.Animate("paradoxdeath"); | ||
// paradox-teleport-in and nexusteleport also exist, don't know if they're used somewhere else. | ||
|
||
// At the end of the cinematic, rebuild the player at the target location. | ||
Task.Run(async () => | ||
{ | ||
// Wait for the animation to complete. | ||
await Task.Delay(2000); | ||
|
||
// Teleport player to target location. | ||
player.Teleport(target.Transform.Position); | ||
|
||
// Show camera path. | ||
player.Message(new PlayCinematicMessage | ||
{ | ||
Associate = player, | ||
LockPlayer = true, | ||
PathName = cinematic, | ||
}); | ||
|
||
// Un-stun player. | ||
player.Message(new SetStunnedMessage | ||
{ | ||
Associate = player, | ||
Originator = gameObject, | ||
StateChangeType = StunState.Pop, | ||
CantAttack = true, | ||
CantJump = true, | ||
CantMove = true, | ||
CantTurn = true, | ||
}); | ||
|
||
// Show rebuilding animation. | ||
player.Animate("paradox-teleport-in"); | ||
}); | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.