Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Limiana committed Dec 17, 2024
2 parents 2f6d3be + 44af794 commit b48f80a
Show file tree
Hide file tree
Showing 6 changed files with 1,179 additions and 943 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
~Lv2~{"Name":"Fulgent Blade 7","Group":"FRU","ZoneLockH":[1238],"ElementsL":[{"Name":"1","type":3,"refY":40.0,"offY":35.0,"radius":40.0,"refActorDataID":9020,"refActorRequireCast":true,"refActorCastId":[40307],"refActorUseCastTime":true,"refActorCastTimeMax":0.5,"refActorComparisonType":3,"includeRotation":true,"refActorTetherTimeMin":0.0,"refActorTetherTimeMax":0.0},{"Name":"2","type":3,"refY":-40.0,"offY":-35.0,"radius":40.42,"refActorDataID":9020,"refActorRequireCast":true,"refActorCastId":[40307],"refActorUseCastTime":true,"refActorCastTimeMax":0.5,"refActorComparisonType":3,"includeRotation":true,"refActorTetherTimeMin":0.0,"refActorTetherTimeMax":0.0}],"Freezing":true,"FreezeFor":20.7,"IntervalBetweenFreezes":0.8,"FreezeDisplayDelay":18.7}
```

## [JP] [WIP] [Script] Paradise Regained
!!! Guide pending !!!
```
https://github.com/PunishXIV/Splatoon/raw/main/SplatoonScripts/Duties/Dawntrail/The%20Futures%20Rewritten/P5%20Paradise%20Regained.cs
```

# Outdated
## Wings
Do not really work
```
~Lv2~{"Name":"P5 WingsDarkandLight T1 Left1","Group":"FRU","ZoneLockH":[1238],"DCond":5,"ElementsL":[{"Name":"1","type":4,"radius":20.0,"coneAngleMin":-45,"coneAngleMax":180,"color":3355508699,"fillIntensity":0.5,"refActorTargetingYou":1,"refActorNPCNameID":13561,"refActorComparisonType":6,"includeRotation":true,"onlyVisible":true,"FaceMe":true,"refActorTetherTimeMin":0.0,"refActorTetherTimeMax":0.0,"faceplayer":"<t2>"}],"UseTriggers":true,"Triggers":[{"Type":2,"Duration":3.0,"Match":" (13561>40313)","MatchDelay":6.7}]}
~Lv2~{"Name":"P5 WingsDarkandLight T2 Left2","Group":"FRU","ZoneLockH":[1238],"DCond":5,"ElementsL":[{"Name":"1","type":4,"radius":20.0,"coneAngleMin":-45,"coneAngleMax":180,"color":3355508699,"fillIntensity":0.5,"refActorTargetingYou":1,"refActorNPCNameID":13561,"refActorComparisonType":6,"includeRotation":true,"onlyVisible":true,"FaceMe":true,"refActorTetherTimeMin":0.0,"refActorTetherTimeMax":0.0,"faceplayer":"<t1>"}],"UseTriggers":true,"Triggers":[{"Type":2,"Duration":6.7,"Match":" (13561>40233)"}]}
~Lv2~{"Name":"P5 WingsDarkandLight T1 Right1","Group":"FRU","ZoneLockH":[1238],"DCond":5,"ElementsL":[{"Name":"1","type":4,"radius":20.0,"coneAngleMin":-180,"coneAngleMax":45,"color":3355459317,"fillIntensity":0.5,"refActorTargetingYou":1,"refActorNPCNameID":13561,"refActorComparisonType":6,"includeRotation":true,"onlyVisible":true,"FaceMe":true,"refActorTetherTimeMin":0.0,"refActorTetherTimeMax":0.0,"faceplayer":"<t1>"}],"UseTriggers":true,"Triggers":[{"Type":2,"Duration":6.7,"Match":" (13561>40313)"}]}
~Lv2~{"Name":"P5 WingsDarkandLight T2 Right2","Group":"FRU","ZoneLockH":[1238],"DCond":5,"ElementsL":[{"Name":"1","type":4,"radius":20.0,"coneAngleMin":-180,"coneAngleMax":45,"color":3355459317,"fillIntensity":0.5,"refActorTargetingYou":1,"refActorNPCNameID":13561,"refActorComparisonType":6,"includeRotation":true,"onlyVisible":true,"FaceMe":true,"refActorTetherTimeMin":0.0,"refActorTetherTimeMax":0.0,"faceplayer":"<t2>"}],"UseTriggers":true,"Triggers":[{"Type":2,"Duration":3.0,"Match":" (13561>40233)","MatchDelay":6.7}]}
```

## [JP] [WIP] [Script] Paradise Regained
!!! Guide pending !!!
```
https://github.com/PunishXIV/Splatoon/raw/main/SplatoonScripts/Duties/Dawntrail/The%20Futures%20Rewritten/P5%20Paradise%20Regained.cs
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Dalamud.Game.ClientState.Objects.Types;
using ECommons;
using ECommons.Configuration;
using ECommons.ExcelServices;
using ECommons.GameHelpers;
using ECommons.Hooks.ActionEffectTypes;
using ECommons.ImGuiMethods;
Expand All @@ -19,8 +18,6 @@ namespace SplatoonScriptsOfficial.Duties.Dawntrail.The_Futures_Rewritten;

public class P1_Burn_Strike_Tower : SplatoonScript
{
private readonly ImGuiEx.RealtimeDragDrop<Job> _dragDrop = new("DragDropJob", x => x.ToString());

private readonly Dictionary<int, List<uint>> TowerCastIds = new()
{
{ 1, [0x9CC7, 0x9CC3] },
Expand All @@ -35,7 +32,7 @@ public class P1_Burn_Strike_Tower : SplatoonScript

private State _state = State.None;
public override HashSet<uint>? ValidTerritories => [1238];
public override Metadata? Metadata => new(3, "Garume");
public override Metadata? Metadata => new(4, "Garume");


private Config C => Controller.GetConfig<Config>();
Expand Down Expand Up @@ -89,9 +86,9 @@ public override void OnScriptUpdated(uint previousVersion)
new PopupWindow(() =>
{
ImGuiEx.Text($"""
Warning: Splatoon Script
Warning: Splatoon Script
{InternalData.Name}
was updated.
was updated.
If you were using the fixed priority feature,
Please make sure to set the fixed roles again.
""");
Expand Down Expand Up @@ -139,114 +136,115 @@ public override void OnStartingCast(uint source, uint castId)
{
if (_state == State.Split) return;
if (castId is 40135 or 40129) _state = State.Start;
if (!TowerCastIds.Values.Any(x => x.Contains(castId))) return;
if (source.GetObject() is IBattleNpc npc)
switch (npc.Position.Z)
{
case < 95:
_currentTowers[0] = npc;
break;
case < 105:
_currentTowers[1] = npc;
break;
default:
_currentTowers[2] = npc;
break;
}

if (_currentTowers.Any(x => x == null)) return;
_state = State.Split;
var list = C.PriorityData.GetFirstValidList();
var players = C.PriorityData.GetPlayers(x => true);
if (list is null || players is null)
{
DuoLog.Warning("[P1 Burn Strike Tower] Priority list is not setup");
return;
}

if (TowerCastIds.Values.Any(x => x.Contains(castId)))
if (source.GetObject() is IBattleNpc npc)

if (C.FixEnabled)
{
List<string> nonFixed;
if (list.IsRole)
{
switch (npc.Position.Z)
{
case < 95:
_currentTowers[0] = npc;
break;
case < 105:
_currentTowers[1] = npc;
break;
default:
_currentTowers[2] = npc;
break;
}
var roleList = list.List
.Select(x =>
x.IsInParty(list.IsRole, out var upm) ? (upm.Name, x.Role) : ("", RolePosition.Not_Selected))
.ToDictionary(x => x.Item1, x => x.Item2);
var myRole = roleList[Player.Name];
if (C.FirstFixRole == myRole)
_myTower = _currentTowers[0];
else if (C.SecondFixRole == myRole)
_myTower = _currentTowers[1];
else if (C.ThirdFixRole == myRole)
_myTower = _currentTowers[2];
nonFixed = roleList
.Where(x => x.Value != C.FirstFixRole && x.Value != C.SecondFixRole &&
x.Value != C.ThirdFixRole).Select(x => x.Key).ToList();
}
else
{
var myIndex = C.PriorityData.GetOwnIndex(x => true);
if (myIndex == C.FirstFixIndex)
_myTower = _currentTowers[0];
else if (myIndex == C.SecondFixIndex)
_myTower = _currentTowers[1];
else if (myIndex == C.ThirdFixIndex)
_myTower = _currentTowers[2];

nonFixed = players
.Where((_, i) => i != C.FirstFixIndex && i != C.SecondFixIndex && i != C.ThirdFixIndex)
.Select(x => x.Name).ToList();
}

if (_currentTowers.Any(x => x == null)) return;
_state = State.Split;
var list = C.PriorityData.GetFirstValidList();
if (list is null)
foreach (var tower in _currentTowers)
{
if (tower is null)
{
DuoLog.Warning("[P1 Burn Strike Tower] Priority list is not 6");
return;
DuoLog.Warning("[P1 Burn Strike Tower] Tower is null");
continue;
}

if (C.FixEnabled)
{
List<string> nonFixed;
if (list.IsRole)
{
var myRole = list.List.First(x => x.IsInParty(true, out var upm) && upm.Name == Player.Name)
.Role;
if (C.FirstFixRole == myRole)
_myTower = _currentTowers[0];
else if (C.SecondFixRole == myRole)
_myTower = _currentTowers[1];
else if (C.ThirdFixRole == myRole)
_myTower = _currentTowers[2];
nonFixed = list.List.Where(x =>
x.Role != C.FirstFixRole && x.Role != C.SecondFixRole && x.Role != C.ThirdFixRole)
.Select(x => x.Name.Split("@").First()).ToList();
}
else
{
var myIndex = C.PriorityData.GetOwnIndex(x => true);
if (myIndex == C.FirstFixIndex)
_myTower = _currentTowers[0];
else if (myIndex == C.SecondFixIndex)
_myTower = _currentTowers[1];
else if (myIndex == C.ThirdFixIndex)
_myTower = _currentTowers[2];

nonFixed = list.List.Where(x =>
x.Name != list.List[C.FirstFixIndex].Name &&
x.Name != list.List[C.SecondFixIndex].Name &&
x.Name != list.List[C.ThirdFixIndex].Name).Select(x => x.Name.Split("@").First()).ToList();
}

foreach (var tower in _currentTowers)
{
if (tower is null)
{
DuoLog.Warning("[P1 Burn Strike Tower] Tower is null");
continue;
}

var towerCount = TowerCastIds.First(x => x.Value.Contains(tower.CastActionId)).Key;
var remaining = towerCount - 1;

if (remaining == 0) continue;

for (var i = 0; i < remaining; i++)
{
if (nonFixed.First() == Player.Name)
_myTower = tower;
nonFixed.RemoveAt(0);
}
}
}
var towerCount = TowerCastIds.First(x => x.Value.Contains(tower.CastActionId)).Key;
var remaining = towerCount - 1;

if (remaining == 0) continue;

else
for (var i = 0; i < remaining; i++)
{
var index = 0;
foreach (var tower in _currentTowers)
{
if (tower is null)
{
DuoLog.Warning("[P1 Burn Strike Tower] Tower is null");
continue;
}

var towerCount = TowerCastIds.First(x => x.Value.Contains(tower.CastActionId)).Key;
var lastIndex = index;
index += towerCount;

for (var i = lastIndex; i < index; i++)
if (list?.List[i].Name == Player.Name)
_myTower = tower;
}
if (nonFixed.First() == Player.Name)
_myTower = tower;
nonFixed.RemoveAt(0);
}
}
}

if (Controller.TryGetElementByName("Bait", out var bait))
else
{
var index = 0;
foreach (var tower in _currentTowers)
{
if (tower is null)
{
bait.Enabled = true;
bait.SetOffPosition(_myTower.Position);
DuoLog.Warning("[P1 Burn Strike Tower] Tower is null");
continue;
}

var towerCount = TowerCastIds.First(x => x.Value.Contains(tower.CastActionId)).Key;
var lastIndex = index;
index += towerCount;

for (var i = lastIndex; i < index; i++)
if (players[i].Name == Player.Name)
_myTower = tower;
}
}

if (Controller.TryGetElementByName("Bait", out var bait))
{
bait.Enabled = true;
bait.SetOffPosition(_myTower.Position);
}
}

private enum State
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public enum Direction

private int _tetherCount = 1;
public override HashSet<uint>? ValidTerritories => [1238];
public override Metadata? Metadata => new(3, "Garume");
public override Metadata? Metadata => new(2, "Garume");
private Config C => Controller.GetConfig<Config>();

public override void OnStartingCast(uint source, uint castId)
Expand Down Expand Up @@ -260,4 +260,4 @@ public class Config : IEzConfig
public Direction Tether3Direction = Direction.North;
public Direction Tether4Direction = Direction.South;
}
}
}
Loading

0 comments on commit b48f80a

Please sign in to comment.