mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-13 05:57:45 +00:00
fix timeline advancing, add ifrit normal encounter script
This commit is contained in:
parent
2f4efec34d
commit
8c952540d5
12 changed files with 1042 additions and 26 deletions
860
data/EncounterTimelines/IfritNormal.json
Normal file
860
data/EncounterTimelines/IfritNormal.json
Normal file
|
@ -0,0 +1,860 @@
|
||||||
|
{
|
||||||
|
"actors": [
|
||||||
|
{
|
||||||
|
"hp": 13884,
|
||||||
|
"id": 1,
|
||||||
|
"layoutId": 4126276,
|
||||||
|
"name": "Ifrit",
|
||||||
|
"phases": [
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 1,
|
||||||
|
"name": "Auto-attack",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 872,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Auto attack",
|
||||||
|
"duration": 2500,
|
||||||
|
"type": "castAction"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 2,
|
||||||
|
"name": "Phase 1",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 453,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Incinerate > VB > Incinerate > Incinerate",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 454,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "Vulcan Burst",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "VB",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 453,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Incinerate",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 453,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Incinerate",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 3,
|
||||||
|
"name": "Phase 2 Start",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"bgmId": 163
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setBGM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"battleTalkId": 2939,
|
||||||
|
"handlerActorName": "Ifrit",
|
||||||
|
"kind": 0,
|
||||||
|
"nameId": 2961,
|
||||||
|
"params": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"talkerActorName": "Ifrit"
|
||||||
|
},
|
||||||
|
"description": "Succumb to the inferno",
|
||||||
|
"duration": 1500,
|
||||||
|
"type": "battleTalk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 453,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Incinerate",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"selectorName": "Eruption",
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "snapshot"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 733,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "Eruption",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 1>",
|
||||||
|
"targetType": "selector"
|
||||||
|
},
|
||||||
|
"description": "Eruption",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 454,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "Vulcan Burst",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"conditionId": 4,
|
||||||
|
"conditionStr": "If Ifrit has 51% < HP < 70%, loop Ifrit->Phase 2 Main",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 5000,
|
||||||
|
"type": "setCondition"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 4,
|
||||||
|
"name": "Phase 2 Main",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 453,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Incinerate",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"selectorName": "Eruption",
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "snapshot"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 733,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "Eruption",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "selector"
|
||||||
|
},
|
||||||
|
"description": "Eruption",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 5,
|
||||||
|
"name": "Nail Spawn",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"battleTalkId": 2939,
|
||||||
|
"handlerActorName": "Ifrit",
|
||||||
|
"kind": 0,
|
||||||
|
"nameId": 2961,
|
||||||
|
"params": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"talkerActorName": "Ifrit"
|
||||||
|
},
|
||||||
|
"description": "Surrender thyself to the fires of judgment",
|
||||||
|
"duration": 5000,
|
||||||
|
"type": "battleTalk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"flags": 19,
|
||||||
|
"hateSource": {
|
||||||
|
"hateType": "<to-be-defined>",
|
||||||
|
"source": "<to-de-befined>"
|
||||||
|
},
|
||||||
|
"spawnActor": "Ifrit Nail 1"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 1500,
|
||||||
|
"type": "spawnBNpc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"conditionId": 6,
|
||||||
|
"conditionStr": "If Ifrit state is Combat, loop Ifrit->Phase 1",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setCondition"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {},
|
||||||
|
"description": "",
|
||||||
|
"duration": 36000,
|
||||||
|
"type": "idle"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"conditionId": 8,
|
||||||
|
"conditionStr": "If Ifrit state is Combat, push Ifrit->Hellfire",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setCondition"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 7,
|
||||||
|
"name": "Hellfire",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"conditionId": 6,
|
||||||
|
"conditionStr": "If Ifrit state is Combat, loop Ifrit->Phase 1",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setCondition"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit",
|
||||||
|
"pos": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 2000,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"flags": 119,
|
||||||
|
"targetActor": ""
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 3000,
|
||||||
|
"type": "bNpcFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 458,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 2500,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit",
|
||||||
|
"pos": [
|
||||||
|
0,
|
||||||
|
-10,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"flags": 1,
|
||||||
|
"targetActor": ""
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "bNpcFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"conditionId": 9,
|
||||||
|
"conditionStr": "If Ifrit state is Combat, loop Ifrit->Final Phase",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setCondition"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 6,
|
||||||
|
"name": "Final Phase",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 453,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit",
|
||||||
|
"targetType": "target"
|
||||||
|
},
|
||||||
|
"description": "Radiant plume begin",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"selectorName": "Eruption",
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"description": "Eruption snapshot",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "snapshot"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 733,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "Eruption",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 1>",
|
||||||
|
"targetType": "selector"
|
||||||
|
},
|
||||||
|
"description": "Subactor 1 Eruption",
|
||||||
|
"duration": 5000,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 1>",
|
||||||
|
"pos": [
|
||||||
|
-5,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "Move plumes",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 2>",
|
||||||
|
"pos": [
|
||||||
|
-5,
|
||||||
|
0,
|
||||||
|
-5
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 3>",
|
||||||
|
"pos": [
|
||||||
|
5,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 4>",
|
||||||
|
"pos": [
|
||||||
|
5,
|
||||||
|
0,
|
||||||
|
-5
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 8000,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 1>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "Cast plumes",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 2>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 3>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 4>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 1>",
|
||||||
|
"pos": [
|
||||||
|
-10,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "Move plumes out",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 2>",
|
||||||
|
"pos": [
|
||||||
|
-10,
|
||||||
|
0,
|
||||||
|
-10
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 3>",
|
||||||
|
"pos": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actorName": "Ifrit <subactor 4>",
|
||||||
|
"pos": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
-10
|
||||||
|
],
|
||||||
|
"rot": 0
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "setPos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 1>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "Cast plumes out",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 2>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 3>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "castAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"actionId": 734,
|
||||||
|
"selectorIndex": 0,
|
||||||
|
"selectorName": "<unset>",
|
||||||
|
"snapshot": false,
|
||||||
|
"snapshotTime": 0,
|
||||||
|
"sourceActor": "Ifrit <subactor 4>",
|
||||||
|
"targetType": "self"
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 5000,
|
||||||
|
"type": "castAction"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 8,
|
||||||
|
"name": "Reset",
|
||||||
|
"timepoints": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"flags": 16,
|
||||||
|
"targetActor": ""
|
||||||
|
},
|
||||||
|
"description": "",
|
||||||
|
"duration": 0,
|
||||||
|
"type": "bNpcFlags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {},
|
||||||
|
"description": "todo: despawn subactors and anything else spawned in phases",
|
||||||
|
"duration": 5000,
|
||||||
|
"type": "idle"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subactors": [
|
||||||
|
"Ifrit <subactor 1>",
|
||||||
|
"Ifrit <subactor 2>",
|
||||||
|
"Ifrit <subactor 3>",
|
||||||
|
"Ifrit <subactor 4>",
|
||||||
|
"Ifrit <subactor 5>",
|
||||||
|
"Ifrit <subactor 6>",
|
||||||
|
"Ifrit <subactor 7>",
|
||||||
|
"Ifrit <subactor 8>"
|
||||||
|
],
|
||||||
|
"type": "bnpc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hp": 445,
|
||||||
|
"id": 2,
|
||||||
|
"layoutId": 4126284,
|
||||||
|
"name": "Ifrit Control",
|
||||||
|
"phases": [],
|
||||||
|
"subactors": [],
|
||||||
|
"type": "bnpc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hp": 445,
|
||||||
|
"id": 3,
|
||||||
|
"layoutId": 4126281,
|
||||||
|
"name": "Ifrit Nail 1",
|
||||||
|
"phases": [
|
||||||
|
{
|
||||||
|
"description": "",
|
||||||
|
"id": 1,
|
||||||
|
"name": "Phase 1",
|
||||||
|
"timepoints": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subactors": [],
|
||||||
|
"type": "bnpc"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "combatState",
|
||||||
|
"description": "",
|
||||||
|
"enabled": true,
|
||||||
|
"id": 10,
|
||||||
|
"loop": false,
|
||||||
|
"paramData": {
|
||||||
|
"combatState": 0,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Reset"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "combatState",
|
||||||
|
"description": "",
|
||||||
|
"enabled": false,
|
||||||
|
"id": 1,
|
||||||
|
"loop": true,
|
||||||
|
"paramData": {
|
||||||
|
"combatState": 1,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Auto-attack"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "hpPctBetween",
|
||||||
|
"description": "",
|
||||||
|
"enabled": true,
|
||||||
|
"id": 2,
|
||||||
|
"loop": true,
|
||||||
|
"paramData": {
|
||||||
|
"hpMax": 100,
|
||||||
|
"hpMin": 71,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Phase 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "hpPctBetween",
|
||||||
|
"description": "",
|
||||||
|
"enabled": true,
|
||||||
|
"id": 3,
|
||||||
|
"loop": false,
|
||||||
|
"paramData": {
|
||||||
|
"hpMax": 71,
|
||||||
|
"hpMin": 50,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Phase 2 Start"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "hpPctBetween",
|
||||||
|
"description": "",
|
||||||
|
"enabled": false,
|
||||||
|
"id": 4,
|
||||||
|
"loop": true,
|
||||||
|
"paramData": {
|
||||||
|
"hpMax": 70,
|
||||||
|
"hpMin": 50,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Phase 2 Main"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "hpPctBetween",
|
||||||
|
"description": "",
|
||||||
|
"enabled": true,
|
||||||
|
"id": 5,
|
||||||
|
"loop": false,
|
||||||
|
"paramData": {
|
||||||
|
"hpMax": 50,
|
||||||
|
"hpMin": 0,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Nail Spawn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "combatState",
|
||||||
|
"description": "",
|
||||||
|
"enabled": false,
|
||||||
|
"id": 6,
|
||||||
|
"loop": true,
|
||||||
|
"paramData": {
|
||||||
|
"combatState": 1,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Phase 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "combatState",
|
||||||
|
"description": "",
|
||||||
|
"enabled": true,
|
||||||
|
"id": 7,
|
||||||
|
"loop": false,
|
||||||
|
"paramData": {
|
||||||
|
"combatState": 5,
|
||||||
|
"sourceActor": "Ifrit Nail 1"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Hellfire"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "combatState",
|
||||||
|
"description": "",
|
||||||
|
"enabled": false,
|
||||||
|
"id": 8,
|
||||||
|
"loop": false,
|
||||||
|
"paramData": {
|
||||||
|
"combatState": 1,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Hellfire"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"condition": "combatState",
|
||||||
|
"description": "",
|
||||||
|
"enabled": false,
|
||||||
|
"id": 9,
|
||||||
|
"loop": true,
|
||||||
|
"paramData": {
|
||||||
|
"combatState": 1,
|
||||||
|
"sourceActor": "Ifrit"
|
||||||
|
},
|
||||||
|
"targetActor": "Ifrit",
|
||||||
|
"targetPhase": "Final Phase"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Brand new timeline",
|
||||||
|
"selectors": [
|
||||||
|
{
|
||||||
|
"count": 1,
|
||||||
|
"description": "",
|
||||||
|
"excludeSelectorName": "",
|
||||||
|
"fillRandomEntries": true,
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"negate": true,
|
||||||
|
"param": 0,
|
||||||
|
"type": "topAggro"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": 1,
|
||||||
|
"name": "Eruption"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 8
|
||||||
|
}
|
104
data/actions/IfritNormal.json
Normal file
104
data/actions/IfritNormal.json
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
{
|
||||||
|
"872": {
|
||||||
|
"name": "Auto Attack",
|
||||||
|
"potency": 100,
|
||||||
|
"comboPotency": 0,
|
||||||
|
"flankPotency": 0,
|
||||||
|
"frontPotency": 0,
|
||||||
|
"rearPotency": 0,
|
||||||
|
"curePotency": 0,
|
||||||
|
"restorePercentage": 0,
|
||||||
|
"nextCombo": [],
|
||||||
|
"statuses": {
|
||||||
|
"caster": [],
|
||||||
|
"target": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"453": {
|
||||||
|
"name": "Incinerate",
|
||||||
|
"potency": 100,
|
||||||
|
"comboPotency": 0,
|
||||||
|
"flankPotency": 0,
|
||||||
|
"frontPotency": 0,
|
||||||
|
"rearPotency": 0,
|
||||||
|
"curePotency": 0,
|
||||||
|
"restorePercentage": 0,
|
||||||
|
"nextCombo": [],
|
||||||
|
"statuses": {
|
||||||
|
"caster": [],
|
||||||
|
"target": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"454": {
|
||||||
|
"name": "Vulcan Burst",
|
||||||
|
"potency": 100,
|
||||||
|
"comboPotency": 0,
|
||||||
|
"flankPotency": 0,
|
||||||
|
"frontPotency": 0,
|
||||||
|
"rearPotency": 0,
|
||||||
|
"curePotency": 0,
|
||||||
|
"restorePercentage": 0,
|
||||||
|
"nextCombo": [],
|
||||||
|
"statuses": {
|
||||||
|
"caster": [],
|
||||||
|
"target": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"458": {
|
||||||
|
"name": "Hellfire",
|
||||||
|
"potency": 400,
|
||||||
|
"comboPotency": 0,
|
||||||
|
"flankPotency": 0,
|
||||||
|
"frontPotency": 0,
|
||||||
|
"rearPotency": 0,
|
||||||
|
"curePotency": 0,
|
||||||
|
"restorePercentage": 0,
|
||||||
|
"nextCombo": [],
|
||||||
|
"statuses": {
|
||||||
|
"caster": [
|
||||||
|
{
|
||||||
|
"id": 394,
|
||||||
|
"duration": 8000,
|
||||||
|
"modifiers": [
|
||||||
|
{
|
||||||
|
"modifier": "DamageTakenPercent",
|
||||||
|
"value": -100
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"target": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"733": {
|
||||||
|
"name": "Eruption",
|
||||||
|
"potency": 200,
|
||||||
|
"comboPotency": 0,
|
||||||
|
"flankPotency": 0,
|
||||||
|
"frontPotency": 0,
|
||||||
|
"rearPotency": 0,
|
||||||
|
"curePotency": 0,
|
||||||
|
"restorePercentage": 0,
|
||||||
|
"nextCombo": [],
|
||||||
|
"statuses": {
|
||||||
|
"caster": [],
|
||||||
|
"target": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"734": {
|
||||||
|
"name": "Radiant Plume",
|
||||||
|
"potency": 200,
|
||||||
|
"comboPotency": 0,
|
||||||
|
"flankPotency": 0,
|
||||||
|
"frontPotency": 0,
|
||||||
|
"rearPotency": 0,
|
||||||
|
"curePotency": 0,
|
||||||
|
"restorePercentage": 0,
|
||||||
|
"nextCombo": [],
|
||||||
|
"statuses": {
|
||||||
|
"caster": [],
|
||||||
|
"target": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -334,6 +334,7 @@ namespace Sapphire::Encounter
|
||||||
for( auto& actor : m_actors )
|
for( auto& actor : m_actors )
|
||||||
{
|
{
|
||||||
actor.resetAllSubActors( pTeri );
|
actor.resetAllSubActors( pTeri );
|
||||||
|
actor.resetAllConditionStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,4 +354,9 @@ namespace Sapphire::Encounter
|
||||||
for( auto& actor : m_actors )
|
for( auto& actor : m_actors )
|
||||||
actor.update( pTeri, *this, now );
|
actor.update( pTeri, *this, now );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TimelinePack::valid()
|
||||||
|
{
|
||||||
|
return !m_actors.empty();
|
||||||
|
}
|
||||||
}// namespace Sapphire::Encounter
|
}// namespace Sapphire::Encounter
|
|
@ -13,7 +13,6 @@
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include <AI/TargetHelper.h>
|
#include <AI/TargetHelper.h>
|
||||||
#include <Territory/Territory.h>
|
|
||||||
#include <Common.h>
|
#include <Common.h>
|
||||||
#include <Forwards.h>
|
#include <Forwards.h>
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ namespace Sapphire::Encounter
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
|
|
||||||
std::unordered_map< std::string, Selector > m_selectors;
|
std::unordered_map< std::string, Selector > m_selectors;
|
||||||
|
|
||||||
uint64_t m_startTime{ 0 };
|
uint64_t m_startTime{ 0 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -75,6 +74,8 @@ namespace Sapphire::Encounter
|
||||||
uint64_t getStartTime() const;
|
uint64_t getStartTime() const;
|
||||||
|
|
||||||
void update( TerritoryPtr pTeri, uint64_t time );
|
void update( TerritoryPtr pTeri, uint64_t time );
|
||||||
|
|
||||||
|
bool valid();
|
||||||
};
|
};
|
||||||
|
|
||||||
class EncounterTimeline
|
class EncounterTimeline
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include <Encounter/EncounterFight.h>
|
#include <Encounter/EncounterFight.h>
|
||||||
|
|
||||||
|
#include <Encounter/EncounterTimeline.h>
|
||||||
|
|
||||||
namespace Sapphire
|
namespace Sapphire
|
||||||
{
|
{
|
||||||
class IfritEncounterFight : public EncounterFight
|
class IfritEncounterFight : public EncounterFight
|
||||||
|
@ -12,7 +14,7 @@ namespace Sapphire
|
||||||
public:
|
public:
|
||||||
IfritEncounterFight( InstanceContentPtr pInstance ) : EncounterFight( pInstance )
|
IfritEncounterFight( InstanceContentPtr pInstance ) : EncounterFight( pInstance )
|
||||||
{
|
{
|
||||||
|
pInstance->setEncounterTimeline( "IfritNormal" );
|
||||||
};
|
};
|
||||||
|
|
||||||
void init() override
|
void init() override
|
||||||
|
@ -43,6 +45,7 @@ namespace Sapphire
|
||||||
{
|
{
|
||||||
removeBNpc( NPC_IFRIT );
|
removeBNpc( NPC_IFRIT );
|
||||||
m_pInstance->removeActor( boss );
|
m_pInstance->removeActor( boss );
|
||||||
|
m_pInstance->getEncounterTimeline().reset( getInstance() );
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
@ -122,11 +125,14 @@ namespace Sapphire
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_status == EncounterFightStatus::ACTIVE && ifrit && !ifrit->hateListGetHighest()->isAlive() )
|
if( m_status == EncounterFightStatus::ACTIVE && ifrit && (!ifrit->hateListGetHighest() || !ifrit->hateListGetHighest()->isAlive() ) )
|
||||||
{
|
{
|
||||||
m_status = EncounterFightStatus::FAIL;
|
m_status = EncounterFightStatus::FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_pInstance->getEncounterTimeline().update( getInstance(), deltaTime );
|
||||||
|
|
||||||
|
//*
|
||||||
if( m_stateStack; !m_stateStack->empty() )
|
if( m_stateStack; !m_stateStack->empty() )
|
||||||
{
|
{
|
||||||
if( m_stateStack->top()->shouldFinish() )
|
if( m_stateStack->top()->shouldFinish() )
|
||||||
|
@ -138,6 +144,7 @@ namespace Sapphire
|
||||||
if( !m_stateStack->empty() )
|
if( !m_stateStack->empty() )
|
||||||
m_stateStack->top()->update( deltaTime );
|
m_stateStack->top()->update( deltaTime );
|
||||||
}
|
}
|
||||||
|
//*/
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -230,15 +230,19 @@ namespace Sapphire::Encounter
|
||||||
for( auto i = state.m_phaseInfo.m_lastTimepointIndex; i < m_timepoints.size(); )
|
for( auto i = state.m_phaseInfo.m_lastTimepointIndex; i < m_timepoints.size(); )
|
||||||
{
|
{
|
||||||
uint64_t phaseElapsed = time - state.m_phaseInfo.m_startTime;
|
uint64_t phaseElapsed = time - state.m_phaseInfo.m_startTime;
|
||||||
uint64_t timepointElapsed = time - state.m_phaseInfo.m_lastTimepointTime;
|
|
||||||
|
|
||||||
auto& tpState = state.m_phaseInfo.m_timepointStates[ i ];
|
auto& tpState = state.m_phaseInfo.m_timepointStates[ i ];
|
||||||
auto& timepoint = m_timepoints[ i ];
|
auto& timepoint = m_timepoints[ i ];
|
||||||
|
|
||||||
|
uint64_t timepointElapsed = time - tpState.m_startTime;
|
||||||
|
|
||||||
|
if( tpState.m_startTime == 0 )
|
||||||
|
timepointElapsed = 0;
|
||||||
|
|
||||||
if( timepoint.canExecute( tpState, timepointElapsed ) )
|
if( timepoint.canExecute( tpState, timepointElapsed ) )
|
||||||
{
|
{
|
||||||
timepoint.execute( tpState, self, pack, pTeri, time );
|
if( timepoint.execute( tpState, self, pack, pTeri, time ) )
|
||||||
state.m_phaseInfo.m_lastTimepointTime = time;
|
state.m_phaseInfo.m_lastTimepointTime = time;
|
||||||
}
|
}
|
||||||
else if( !timepoint.finished( tpState, timepointElapsed ) )
|
else if( !timepoint.finished( tpState, timepointElapsed ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,9 +92,13 @@ namespace Sapphire::Encounter
|
||||||
state.m_enabled = enabled;
|
state.m_enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset( ConditionState& state ) const
|
void reset( ConditionState& state, bool toDefaults = false ) const
|
||||||
{
|
{
|
||||||
state.m_startTime = 0;
|
state.m_startTime = 0;
|
||||||
|
|
||||||
|
if( toDefaults )
|
||||||
|
state.m_enabled = isDefaultEnabled();
|
||||||
|
|
||||||
m_phase.reset( state );
|
m_phase.reset( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <Actor/BNpc.h>
|
#include <Actor/BNpc.h>
|
||||||
#include <Action/Action.h>
|
#include <Action/Action.h>
|
||||||
|
|
||||||
|
#include <Territory/Territory.h>
|
||||||
|
|
||||||
namespace Sapphire::Encounter
|
namespace Sapphire::Encounter
|
||||||
{
|
{
|
||||||
void TimelineActor::addPhaseCondition( PhaseConditionPtr pCondition )
|
void TimelineActor::addPhaseCondition( PhaseConditionPtr pCondition )
|
||||||
|
@ -79,7 +81,7 @@ namespace Sapphire::Encounter
|
||||||
const auto& pCondition = condition.second;
|
const auto& pCondition = condition.second;
|
||||||
auto& state = m_conditionStates.at( condition.first );
|
auto& state = m_conditionStates.at( condition.first );
|
||||||
|
|
||||||
pCondition->reset( state );
|
pCondition->reset( state, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,6 +154,9 @@ namespace Sapphire::Encounter
|
||||||
pActor->init();
|
pActor->init();
|
||||||
|
|
||||||
pTeri->pushActor( pActor );
|
pTeri->pushActor( pActor );
|
||||||
|
|
||||||
|
for( const auto& player : pTeri->getPlayers() )
|
||||||
|
pActor->spawn( player.second );
|
||||||
}
|
}
|
||||||
|
|
||||||
return pActor;
|
return pActor;
|
||||||
|
@ -170,7 +175,7 @@ namespace Sapphire::Encounter
|
||||||
{
|
{
|
||||||
if( subActor.second )
|
if( subActor.second )
|
||||||
{
|
{
|
||||||
auto pBNpc = subActor.second;
|
auto& pBNpc = subActor.second;
|
||||||
pTeri->removeActor( pBNpc );
|
pTeri->removeActor( pBNpc );
|
||||||
// todo: despawn?
|
// todo: despawn?
|
||||||
subActor.second = nullptr;
|
subActor.second = nullptr;
|
||||||
|
|
|
@ -328,10 +328,8 @@ namespace Sapphire::Encounter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timepoint::execute( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const
|
bool Timepoint::execute( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const
|
||||||
{
|
{
|
||||||
state.m_startTime = time;
|
|
||||||
|
|
||||||
const auto& players = pTeri->getPlayers();
|
const auto& players = pTeri->getPlayers();
|
||||||
// send debug msg
|
// send debug msg
|
||||||
if( !m_description.empty() )
|
if( !m_description.empty() )
|
||||||
|
@ -342,16 +340,22 @@ namespace Sapphire::Encounter
|
||||||
playerMgr.sendDebug( *player.second, m_description );
|
playerMgr.sendDebug( *player.second, m_description );
|
||||||
}
|
}
|
||||||
|
|
||||||
update( state, self, pack, pTeri, time );
|
if( update( state, self, pack, pTeri, time ) )
|
||||||
|
{
|
||||||
|
state.m_startTime = time;
|
||||||
|
state.m_finished = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timepoint::update( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const
|
bool Timepoint::update( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const
|
||||||
{
|
{
|
||||||
state.m_lastTick = time;
|
state.m_lastTick = time;
|
||||||
|
|
||||||
// todo: separate execute and update?
|
// todo: separate execute and update?
|
||||||
if( state.m_finished )
|
if( state.m_finished )
|
||||||
return;
|
return true;
|
||||||
|
|
||||||
switch( m_type )
|
switch( m_type )
|
||||||
{
|
{
|
||||||
|
@ -391,7 +395,10 @@ namespace Sapphire::Encounter
|
||||||
if( !pBNpc->getCurrentAction() )
|
if( !pBNpc->getCurrentAction() )
|
||||||
{
|
{
|
||||||
actionMgr.handleTargetedAction( *pBNpc, pActionData->m_actionId, targetId, 0 );
|
actionMgr.handleTargetedAction( *pBNpc, pActionData->m_actionId, targetId, 0 );
|
||||||
state.m_finished = true;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,7 +412,6 @@ namespace Sapphire::Encounter
|
||||||
{
|
{
|
||||||
pBNpc->setRot( pSetPosData->m_rot );
|
pBNpc->setRot( pSetPosData->m_rot );
|
||||||
pBNpc->setPos( pSetPosData->m_x, pSetPosData->m_y, pSetPosData->m_z, true );
|
pBNpc->setPos( pSetPosData->m_x, pSetPosData->m_y, pSetPosData->m_z, true );
|
||||||
state.m_finished = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -594,11 +600,18 @@ namespace Sapphire::Encounter
|
||||||
auto pSpawnData = std::dynamic_pointer_cast< TimepointDataSpawnBNpc, TimepointData >( m_pData );
|
auto pSpawnData = std::dynamic_pointer_cast< TimepointDataSpawnBNpc, TimepointData >( m_pData );
|
||||||
auto pBNpc = pTeri->getActiveBNpcByLayoutId( pSpawnData->m_layoutId );
|
auto pBNpc = pTeri->getActiveBNpcByLayoutId( pSpawnData->m_layoutId );
|
||||||
|
|
||||||
|
// todo: probably have this info in the timepoint data
|
||||||
|
if( !pBNpc )
|
||||||
|
pBNpc = pTeri->createBNpcFromLayoutId( pSpawnData->m_layoutId, 100, Common::BNpcType::Enemy );
|
||||||
|
|
||||||
if( pBNpc )
|
if( pBNpc )
|
||||||
{
|
{
|
||||||
pBNpc->clearFlags();
|
pBNpc->clearFlags();
|
||||||
pBNpc->setFlag( pSpawnData->m_flags );
|
pBNpc->setFlag( pSpawnData->m_flags );
|
||||||
pBNpc->init();
|
pBNpc->init();
|
||||||
|
|
||||||
|
for( const auto& player : pTeri->getPlayers() )
|
||||||
|
pBNpc->spawn( player.second );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -673,10 +686,6 @@ namespace Sapphire::Encounter
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
if( m_type != TimepointDataType::CastAction )
|
|
||||||
state.m_finished = true;
|
|
||||||
|
|
||||||
state.m_finished = state.m_finished || state.m_startTime + m_duration <= time;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -293,7 +293,7 @@ namespace Sapphire::Encounter
|
||||||
|
|
||||||
void from_json( const nlohmann::json& json, const std::unordered_map< std::string, TimelineActor >& actors, uint32_t selfLayoutId );
|
void from_json( const nlohmann::json& json, const std::unordered_map< std::string, TimelineActor >& actors, uint32_t selfLayoutId );
|
||||||
// todo: separate execute/update into onStart and onTick?
|
// todo: separate execute/update into onStart and onTick?
|
||||||
void update( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const;
|
bool update( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const;
|
||||||
void execute( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const;
|
bool execute( TimepointState& state, TimelineActor& self, TimelinePack& pack, TerritoryPtr pTeri, uint64_t time ) const;
|
||||||
};
|
};
|
||||||
}// namespace Sapphire::Encounter
|
}// namespace Sapphire::Encounter
|
|
@ -971,3 +971,13 @@ const Common::TerritoryIdent& Territory::getTerritoryIdent() const
|
||||||
{
|
{
|
||||||
return m_ident;
|
return m_ident;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Territory::setEncounterTimeline( const std::string& name )
|
||||||
|
{
|
||||||
|
m_timelinePack = Encounter::EncounterTimeline::getEncounterPack( name, true );
|
||||||
|
}
|
||||||
|
|
||||||
|
Encounter::TimelinePack& Territory::getEncounterTimeline()
|
||||||
|
{
|
||||||
|
return m_timelinePack;
|
||||||
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
#include "Cell.h"
|
#include "Cell.h"
|
||||||
#include "CellHandler.h"
|
#include "CellHandler.h"
|
||||||
|
|
||||||
|
#include <Encounter/EncounterTimeline.h>
|
||||||
#include "ForwardsZone.h"
|
#include "ForwardsZone.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -76,6 +77,8 @@ namespace Sapphire
|
||||||
|
|
||||||
float m_inRangeDistance;
|
float m_inRangeDistance;
|
||||||
|
|
||||||
|
Encounter::TimelinePack m_timelinePack;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Territory();
|
Territory();
|
||||||
|
|
||||||
|
@ -199,6 +202,9 @@ namespace Sapphire
|
||||||
uint32_t getNextActionResultId();
|
uint32_t getNextActionResultId();
|
||||||
|
|
||||||
std::shared_ptr< World::Navi::NaviProvider > getNaviProvider();
|
std::shared_ptr< World::Navi::NaviProvider > getNaviProvider();
|
||||||
|
|
||||||
|
void setEncounterTimeline( const std::string& name );
|
||||||
|
Encounter::TimelinePack& getEncounterTimeline();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue