Skip to content

Commit ff00e32

Browse files
ConstmarConstantinescu Marius
andauthored
Another Merchant's Tale (#377)
Co-authored-by: Constantinescu Marius <const_mar@hotmail.com>
1 parent 1f87239 commit ff00e32

File tree

1 file changed

+183
-0
lines changed

1 file changed

+183
-0
lines changed
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
2+
> [!IMPORTANT]
3+
> Play around with the projections and use them or blacklist actions as you feel necessary
4+
5+
Darya The Sea-maid
6+
7+
### [Script] Darya Serenade Script - Copy and install from clipboard in scripts section
8+
```
9+
using Dalamud.Game.ClientState.Objects.Types;
10+
using ECommons;
11+
using ECommons.DalamudServices;
12+
using ECommons.Logging;
13+
using ECommons.Schedulers;
14+
using Splatoon.SplatoonScripting;
15+
using System.Collections.Generic;
16+
using System.Linq;
17+
using System.Numerics;
18+
19+
namespace SplatoonScriptsOfficial.Duties.Dawntrail.AnotherMerchantTale;
20+
21+
public class Darya_Serenade_Script : SplatoonScript
22+
{
23+
public override HashSet<uint>? ValidTerritories { get; } = [1317];
24+
public override Metadata? Metadata => new(1, "Poneglyph");
25+
26+
private bool isWaitingForVFX = false;
27+
private List<string> capturedElements = new();
28+
private List<TickScheduler> activeSchedulers = new();
29+
30+
private const string VFX_CHOCOBO = "vfx/common/eff/m0941_chocobo_c0h.avfx";
31+
private const string VFX_SEAHORSE = "vfx/common/eff/m0941_seahorse_c0h.avfx";
32+
private const string VFX_PUFFER = "vfx/common/eff/m0941_puffer_c0h.avfx";
33+
private const string VFX_CRAB = "vfx/common/eff/m0941_crab_c0h.avfx";
34+
private const string VFX_TURTLE = "vfx/common/eff/m0941_turtle_c0h.avfx";
35+
36+
public override void OnSetup()
37+
{
38+
Controller.RegisterElementFromCode("Chocobo", "{\"Name\":\"Chocobo\",\"type\":4,\"refY\":40.0,\"radius\":45.0,\"coneAngleMin\":-30,\"coneAngleMax\":30,\"color\":3355462399,\"fillIntensity\":0.8,\"thicc\":0.0,\"refActorModelID\":4777,\"refActorComparisonType\":1,\"includeRotation\":true,\"DistanceSourceX\":375.0,\"DistanceSourceY\":522.0,\"DistanceSourceZ\":-29.5,\"DistanceMax\":13.3}");
39+
Controller.RegisterElementFromCode("Seahorse", "{\"Name\":\"Seahorse\",\"type\":3,\"refY\":40.0,\"radius\":4.0,\"color\":3355508719,\"fillIntensity\":0.8,\"thicc\":0.0,\"refActorModelID\":4773,\"refActorComparisonType\":1,\"includeRotation\":true,\"DistanceSourceX\":375.0,\"DistanceSourceY\":522.0,\"DistanceSourceZ\":-29.5,\"DistanceMax\":13.3}");
40+
Controller.RegisterElementFromCode("Puffer", "{\"Name\":\"Puffer\",\"type\":4,\"refY\":40.0,\"radius\":20.0,\"coneAngleMin\":-90,\"coneAngleMax\":90,\"color\":3355479807,\"fillIntensity\":0.8,\"thicc\":0.0,\"refActorModelID\":4778,\"refActorComparisonType\":1,\"includeRotation\":true,\"DistanceSourceX\":375.0,\"DistanceSourceY\":522.0,\"DistanceSourceZ\":-29.5,\"DistanceMax\":13.3}");
41+
Controller.RegisterElementFromCode("Crab", "{\"Name\":\"Crab\",\"type\":3,\"refY\":40.0,\"radius\":4.0,\"fillIntensity\":0.8,\"thicc\":0.0,\"refActorModelID\":4776,\"refActorComparisonType\":1,\"includeRotation\":true}");
42+
Controller.RegisterElementFromCode("Turtle", "{\"Name\":\"Turtle\",\"type\":3,\"refY\":40.0,\"radius\":4.0,\"color\":3355508509,\"fillIntensity\":0.8,\"thicc\":0.0,\"refActorModelID\":4775,\"refActorComparisonType\":1,\"includeRotation\":true}");
43+
OnReset();
44+
}
45+
46+
public override void OnStartingCast(uint source, uint castId)
47+
{
48+
if (castId == 45773)
49+
{
50+
isWaitingForVFX = true;
51+
capturedElements.Clear();
52+
}
53+
54+
if (castId == 45844)
55+
{
56+
if (capturedElements.Count == 4)
57+
{
58+
ExecuteDisplay();
59+
}
60+
}
61+
}
62+
63+
public override void OnVFXSpawn(uint target, string vfxPath)
64+
{
65+
if (!isWaitingForVFX) return;
66+
67+
string? detected = vfxPath switch
68+
{
69+
VFX_CHOCOBO => "Chocobo",
70+
VFX_SEAHORSE => "Seahorse",
71+
VFX_PUFFER => "Puffer",
72+
VFX_CRAB => "Crab",
73+
VFX_TURTLE => "Turtle",
74+
_ => null
75+
};
76+
77+
if (detected != null)
78+
{
79+
capturedElements.Add(detected);
80+
81+
if (capturedElements.Count == 4)
82+
{
83+
isWaitingForVFX = false;
84+
ExecuteDisplay();
85+
}
86+
}
87+
}
88+
89+
private void ExecuteDisplay()
90+
{
91+
var timings = new (uint StartAt, uint Duration)[]
92+
{
93+
(1000, 7000),
94+
(8000, 3000),
95+
(10500, 3500),
96+
(14000, 3000)
97+
};
98+
99+
for (int i = 0; i < capturedElements.Count && i < timings.Length; i++)
100+
{
101+
string elementName = capturedElements[i];
102+
var (startAt, duration) = timings[i];
103+
int stepNum = i + 1;
104+
105+
activeSchedulers.Add(new TickScheduler(() =>
106+
{
107+
if (Controller.TryGetElementByName(elementName, out var element))
108+
{
109+
element.Enabled = true;
110+
111+
activeSchedulers.Add(new TickScheduler(() =>
112+
{
113+
element.Enabled = false;
114+
}, duration));
115+
}
116+
}, startAt));
117+
}
118+
}
119+
120+
public override void OnReset()
121+
{
122+
isWaitingForVFX = false;
123+
capturedElements.Clear();
124+
foreach (var sched in activeSchedulers) sched?.Dispose();
125+
activeSchedulers.Clear();
126+
Controller.GetRegisteredElements().Each(x => x.Value.Enabled = false);
127+
}
128+
}
129+
```
130+
131+
### Defamations
132+
```
133+
~Lv2~{"Name":"Defamations","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"Defamation","type":1,"radius":15.0,"Filled":false,"fillIntensity":0.44,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/lockon3_t0h.avfx","refActorVFXMax":3000}]}
134+
```
135+
136+
### Stack
137+
```
138+
~Lv2~{"Name":"Stack","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"Stack","type":1,"radius":5.0,"color":3355508515,"Filled":false,"fillIntensity":0.5,"refActorName":"*","refActorRequireBuff":true,"refActorBuffId":[4726]}]}
139+
```
140+
141+
### Swimming in the Air
142+
```
143+
~Lv2~{"Name":"Swimming in the Air","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"Swimming in the Air","type":1,"radius":12.0,"color":4278190335,"fillIntensity":0.3,"refActorNPCID":2015003,"refActorComparisonType":4,"mechanicType":1}]}
144+
```
145+
146+
### Divebomb
147+
```
148+
~Lv2~{"Name":"Divebomb","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"ew","type":3,"refY":-25.0,"offY":25.0,"radius":0.25,"fillIntensity":0.3,"thicc":0.0,"refActorTargetingYou":1,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/bahamut_wyvn_glider_target_02tm.avfx","refActorVFXMax":7000},{"Name":"ns","type":3,"refX":-25.0,"offX":25.0,"radius":0.25,"fillIntensity":0.3,"thicc":0.0,"refActorTargetingYou":1,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/bahamut_wyvn_glider_target_02tm.avfx","refActorVFXMax":7000}]}
149+
```
150+
151+
### Surging Current
152+
```
153+
~Lv2~{"Name":"Surging Current","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"Surging Current","type":4,"radius":30.0,"coneAngleMin":-45,"coneAngleMax":45,"fillIntensity":0.2,"castAnimation":2,"animationColor":2516582655,"thicc":0.0,"refActorNPCNameID":14291,"refActorRequireCast":true,"refActorCastId":[45866],"refActorUseCastTime":true,"refActorCastTimeMax":5.7,"refActorComparisonType":6,"includeRotation":true}]}```
154+
```
155+
156+
Lone Swordmaster
157+
158+
### Malefic sides
159+
```
160+
~Lv2~{"Name":"Malefic Sides","Group":"Another Merchant's Tale","ZoneLockH":[1317],"UseTriggers":true,"Triggers":[{"TimeBegin":60.0}],"ElementsL":[{"Name":"g w","type":3,"refX":-2.0,"refY":-2.0,"offX":-2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorTargetingYou":1,"refActorComparisonType":7,"refActorVFXPath":"vfx/channeling/eff/chn_ambd_w_p.avfx","refActorVFXMax":20000},{"Name":"g e","type":3,"refX":2.0,"refY":-2.0,"offX":2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorTargetingYou":1,"refActorComparisonType":7,"refActorVFXPath":"vfx/channeling/eff/chn_ambd_e_p.avfx","refActorVFXMax":20000},{"Name":"g s","type":3,"refX":-2.0,"refY":2.0,"offX":2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/channeling/eff/chn_ambd_s_p.avfx","refActorVFXMax":20000},{"Name":"g n","type":3,"refX":-2.0,"refY":-2.0,"offX":2.0,"offY":-2.0,"radius":0.2,"fillIntensity":1.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/channeling/eff/chn_ambd_n_p.avfx","refActorVFXMax":20000},{"Name":"n-w n","type":3,"refX":-2.0,"refY":-2.0,"offX":2.0,"offY":-2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorRequireBuff":true,"refActorBuffId":[4782]},{"Name":"n-w w","type":3,"refX":-2.0,"refY":-2.0,"offX":-2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorTargetingYou":1,"refActorRequireBuff":true,"refActorBuffId":[4782]},{"Name":"n-e n","type":3,"refX":-2.0,"refY":-2.0,"offX":2.0,"offY":-2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorRequireBuff":true,"refActorBuffId":[4781]},{"Name":"n-e e","type":3,"refX":2.0,"refY":-2.0,"offX":2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorTargetingYou":1,"refActorRequireBuff":true,"refActorBuffId":[4781]},{"Name":"s-e e","type":3,"refX":2.0,"refY":-2.0,"offX":2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorTargetingYou":1,"refActorRequireBuff":true,"refActorBuffId":[4777]},{"Name":"s-e s","type":3,"refX":-2.0,"refY":2.0,"offX":2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorRequireBuff":true,"refActorBuffId":[4777]},{"Name":"s-w s","type":3,"refX":-2.0,"refY":2.0,"offX":2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorRequireBuff":true,"refActorBuffId":[4778]},{"Name":"s-w w","type":3,"refX":-2.0,"refY":-2.0,"offX":-2.0,"offY":2.0,"radius":0.2,"fillIntensity":1.0,"refActorName":"*","refActorTargetingYou":1,"refActorRequireBuff":true,"refActorBuffId":[4778]},{"Name":"s-e-w","type":4,"refX":-2.0,"refY":-2.0,"radius":2.0,"Donut":0.5,"coneAngleMin":45,"coneAngleMax":315,"color":4294967295,"fillIntensity":1.0,"refActorTargetingYou":1,"refActorPlaceholder":["<1>"],"refActorRequireBuff":true,"refActorBuffId":[4779],"refActorComparisonType":5,"includeRotation":true,"RotationOverride":true,"RotationOverrideAngleOnlyMode":true,"RotationOverridePoint":{}},{"Name":"n-e-w","type":4,"refX":-2.0,"refY":-2.0,"radius":2.0,"Donut":0.5,"coneAngleMin":-135,"coneAngleMax":135,"color":4294967295,"fillIntensity":1.0,"refActorTargetingYou":1,"refActorPlaceholder":["<1>"],"refActorRequireBuff":true,"refActorBuffId":[4783],"refActorComparisonType":5,"includeRotation":true,"RotationOverride":true,"RotationOverrideAngleOnlyMode":true,"RotationOverridePoint":{}},{"Name":"n-s-w","type":4,"refX":-2.0,"refY":-2.0,"radius":2.0,"Donut":0.5,"coneAngleMin":-225,"coneAngleMax":45,"color":4294967295,"fillIntensity":1.0,"refActorTargetingYou":1,"refActorPlaceholder":["<1>"],"refActorRequireBuff":true,"refActorBuffId":[4786],"refActorComparisonType":5,"includeRotation":true,"RotationOverride":true,"RotationOverrideAngleOnlyMode":true,"RotationOverridePoint":{}},{"Name":"n-s-e","type":4,"refX":-2.0,"refY":-2.0,"radius":2.0,"Donut":0.5,"coneAngleMin":-45,"coneAngleMax":225,"color":4294967295,"fillIntensity":1.0,"refActorTargetingYou":1,"refActorPlaceholder":["<1>"],"refActorRequireBuff":true,"refActorBuffId":[4785],"refActorComparisonType":5,"includeRotation":true,"RotationOverride":true,"RotationOverrideAngleOnlyMode":true,"RotationOverridePoint":{}}]}```
161+
```
162+
163+
### Heaven Mechanic
164+
```
165+
~Lv2~{"Name":"Heaven","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"Near to Heaven 2 Swords","type":1,"refActorNPCNameID":14323,"refActorRequireCast":true,"refActorCastId":[47568],"refActorUseCastTime":true,"refActorCastTimeMax":25.0,"refActorUseOvercast":true,"refActorComparisonType":6,"Conditional":true,"ConditionalReset":true,"Nodraw":true},{"Name":"1","type":1,"radius":8.0,"fillIntensity":0.5,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num01_s5p.avfx","refActorVFXMax":6000},{"Name":"2","type":1,"radius":8.0,"Donut":20.0,"color":4278190335,"fillIntensity":0.2,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num02_s5p.avfx","refActorVFXMin":3500,"refActorVFXMax":25000},{"Name":"Swords","type":1,"radius":5.0,"color":3371412498,"Filled":false,"fillIntensity":0.5,"overlayText":"Stack","refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/lockon5_line_1p.avfx","refActorVFXMax":25000},{"Name":"Far from Heaven 2 Swords","type":1,"refActorNPCNameID":14323,"refActorRequireCast":true,"refActorCastId":[47569],"refActorUseCastTime":true,"refActorCastTimeMax":999.0,"refActorUseOvercast":true,"refActorComparisonType":6,"Conditional":true,"ConditionalReset":true,"Nodraw":true},{"Name":"1","type":1,"radius":8.0,"Donut":20.0,"color":4278190335,"fillIntensity":0.2,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num01_s5p.avfx","refActorVFXMax":6000},{"Name":"2","type":1,"radius":8.0,"fillIntensity":0.5,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num02_s5p.avfx","refActorVFXMin":3500,"refActorVFXMax":25000},{"Name":"Swords","type":1,"radius":5.0,"color":3371412498,"Filled":false,"fillIntensity":0.5,"overlayText":"Stack","refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/lockon5_line_1p.avfx","refActorVFXMax":25000},{"Name":"Near to Heaven 1 Sword","type":1,"refActorNPCNameID":14323,"refActorRequireCast":true,"refActorCastId":[47566],"refActorUseCastTime":true,"refActorCastTimeMax":25.0,"refActorUseOvercast":true,"refActorComparisonType":6,"Conditional":true,"ConditionalReset":true,"Nodraw":true},{"Name":"1","type":1,"radius":8.0,"fillIntensity":0.5,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num01_s5p.avfx","refActorVFXMax":6000},{"Name":"2","type":1,"radius":8.0,"Donut":20.0,"color":4278190335,"fillIntensity":0.2,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num02_s5p.avfx","refActorVFXMin":3500,"refActorVFXMax":25000},{"Name":"Swords","type":1,"radius":5.0,"color":3371412498,"Filled":false,"fillIntensity":0.5,"overlayText":"Go away!","refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/lockon5_line_1p.avfx","refActorVFXMax":25000},{"Name":"Far from Heaven 1 Sword","type":1,"refActorNPCNameID":14323,"refActorRequireCast":true,"refActorCastId":[47567],"refActorUseCastTime":true,"refActorCastTimeMax":25.0,"refActorUseOvercast":true,"refActorComparisonType":6,"Conditional":true,"ConditionalReset":true,"Nodraw":true},{"Name":"1","type":1,"radius":8.0,"Donut":20.0,"color":4278190335,"fillIntensity":0.2,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num01_s5p.avfx","refActorVFXMax":6000},{"Name":"2","type":1,"radius":8.0,"fillIntensity":0.5,"thicc":0.0,"refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/sph_lockon2_num02_s5p.avfx","refActorVFXMin":3500,"refActorVFXMax":25000},{"Name":"Swords","type":1,"radius":5.0,"color":3371412498,"Filled":false,"fillIntensity":0.5,"overlayText":"Go away!","refActorComparisonType":7,"refActorVFXPath":"vfx/lockon/eff/lockon5_line_1p.avfx","refActorVFXMax":25000}]}```
166+
```
167+
168+
### Rock
169+
```
170+
~Lv2~{"Name":"Rock","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"Rock","type":1,"radius":2.5,"color":4278190080,"fillIntensity":1.0,"overrideFillColor":true,"originFillColor":1694498815,"endFillColor":4278190080,"thicc":0.0,"refActorName":"Fallen Rock"}]}```
171+
```
172+
173+
Pari of Plenty
174+
175+
### Icy Bauble
176+
```
177+
~Lv2~{"Name":"Icy Bauble","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"","type":3,"refX":40.0,"offX":-40.0,"radius":5.0,"color":3372191232,"fillIntensity":0.4,"refActorDataID":19059,"refActorComparisonType":3,"onlyVisible":true},{"Name":"","type":3,"refY":40.0,"offY":-40.0,"radius":5.0,"color":3372191232,"fillIntensity":0.4,"refActorDataID":19059,"refActorComparisonType":3,"onlyVisible":true}]}```
178+
```
179+
180+
### Cleaves
181+
```
182+
~Lv2~{"Name":"Cleaves","Group":"Another Merchant's Tale","ZoneLockH":[1317],"ElementsL":[{"Name":"","type":4,"radius":35.0,"coneAngleMin":-90,"coneAngleMax":90,"color":3365338880,"fillIntensity":0.2,"thicc":0.0,"refActorRequireCast":true,"refActorCastId":[45478],"refActorComparisonType":7,"includeRotation":true,"refActorVFXPath":"vfx/lockon/eff/m0973_turning_r_left_8sec_c0e1.avfx","refActorVFXMax":9999000},{"Name":"","type":4,"radius":35.0,"coneAngleMin":90,"coneAngleMax":270,"color":3365338880,"fillIntensity":0.2,"thicc":0.0,"refActorRequireCast":true,"refActorCastId":[45478],"refActorComparisonType":7,"includeRotation":true,"refActorVFXPath":"vfx/lockon/eff/m0973_turning_r_right_8sec_c0e1.avfx","refActorVFXMax":9999000},{"Name":"","type":4,"radius":35.0,"coneAngleMin":-90,"coneAngleMax":90,"color":3365338880,"fillIntensity":0.2,"thicc":0.0,"refActorRequireCast":true,"refActorCastId":[45479],"refActorComparisonType":7,"includeRotation":true,"refActorVFXPath":"vfx/lockon/eff/m0973_turning_right_8sec_c0e1.avfx","refActorVFXMax":9999000},{"Name":"","type":4,"radius":35.0,"coneAngleMin":90,"coneAngleMax":270,"color":3365338880,"fillIntensity":0.2,"thicc":0.0,"refActorRequireCast":true,"refActorCastId":[45479],"refActorComparisonType":7,"includeRotation":true,"refActorVFXPath":"vfx/lockon/eff/m0973_turning_left_8sec_c0e1.avfx","refActorVFXMax":9999000}]}
183+
```

0 commit comments

Comments
 (0)