Skip to content

Commit 2545908

Browse files
sogladevactions-userHelias
authored
feat(action): add SMART_ACTION_DISABLE_REWARD (#3316)
Co-authored-by: i18n Sync Bot <[email protected]> Co-authored-by: Stefano Borzì <[email protected]>
1 parent 06cbdc4 commit 2545908

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

apps/keira/src/assets/i18n/de.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
"DETECTION_RANGE": "Steuert den Bereich, in dem Kreaturen Spieler erkennen und sehen.",
256256
"ITEMID1": "Dies ist die Gegenstandsnummer der Ausrüstung, die in der rechten Hand aus Item.dbc verwendet wird.",
257257
"ITEMID2": "Dies ist die Gegenstandsnummer der Ausrüstung, die in der linken Hand aus Item.dbc verwendet wird.",
258-
"ItemID3": "This is the item number of the equipment used in the ranged slot from Item.dbc.",
258+
"ItemID3": "Dies ist die Gegenstandsnummer der Ausrüstung, die im Fernkampf-Slot aus Item.dbc verwendet wird.",
259259
"FactionHint": "When refering to the Creature's Faction ID it's the column on the left 'ID' in the selector, more information check 'faction' in the wiki."
260260
},
261261
"TEMPLATE_ADDON": {

libs/shared/sai-editor/src/constants/sai-actions.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export enum SAI_ACTIONS {
178178
MOVEMENT_PAUSE = 235,
179179
MOVEMENT_RESUME = 236,
180180
WORLD_SCRIPT = 237,
181+
DISABLE_REWARD = 238,
181182
}
182183
export const SAI_ACTIONS_KEYS = getEnumKeys(SAI_ACTIONS);
183184
export const SAI_ACTION_TOOLTIPS: Record<string, string> = {};
@@ -448,7 +449,8 @@ SAI_ACTION_PARAM2_TOOLTIPS[SAI_ACTIONS.UPDATE_TEMPLATE] = ''; // TODO
448449
// SMART_ACTION_DIE
449450
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.DIE] = 'Kills the target.';
450451
SAI_ACTION_PARAM1_NAMES[SAI_ACTIONS.DIE] = 'Kill Timer';
451-
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.DIE] = 'Time in milliseconds after which the creature kills itself. Leave as 0 to kill it instantly.';
452+
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.DIE] =
453+
'Time in milliseconds after which the creature kills itself. Leave as 0 to kill it instantly.';
452454

453455
// SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
454456
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.SET_IN_COMBAT_WITH_ZONE] =
@@ -676,7 +678,8 @@ SAI_ACTION_PARAM2_TOOLTIPS[SAI_ACTIONS.MOVE_TO_POS] = BOOLEAN_VALUE_TOOLTIP;
676678
SAI_ACTION_PARAM3_TOOLTIPS[SAI_ACTIONS.MOVE_TO_POS] =
677679
'0 = aggro/threat will make it focus on player instead, 1 = Fixated to run to the xyzo position no matter what';
678680
SAI_ACTION_PARAM4_TOOLTIPS[SAI_ACTIONS.MOVE_TO_POS] = 'Absolute distance between the target and the source';
679-
SAI_ACTION_PARAM5_TOOLTIPS[SAI_ACTIONS.MOVE_TO_POS] = '0/1 Uses CombatReach as the minimum distance between target and source. If ContactDistance > 0, then it will be added on top of CombatReach distance';
681+
SAI_ACTION_PARAM5_TOOLTIPS[SAI_ACTIONS.MOVE_TO_POS] =
682+
'0/1 Uses CombatReach as the minimum distance between target and source. If ContactDistance > 0, then it will be added on top of CombatReach distance';
680683

681684
// SMART_ACTION_RESPAWN_TARGET
682685
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.RESPAWN_TARGET] =
@@ -1202,14 +1205,16 @@ SAI_ACTION_PARAM2_NAMES[SAI_ACTIONS.SET_GUID] = 'Index';
12021205
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.SET_GUID] = '0/1 (0 = Self Guid, 1 = Invoker Guid)';
12031206

12041207
// SMART_ACTION_SCRIPTED_SPAWN
1205-
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Sets up and allows the usage of a SmartAI Scripted Spawn system, allowing us to keep unique GUIDs despawned until a script ativates them';
1208+
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] =
1209+
'Sets up and allows the usage of a SmartAI Scripted Spawn system, allowing us to keep unique GUIDs despawned until a script ativates them';
12061210
SAI_ACTION_PARAM1_NAMES[SAI_ACTIONS.SCRIPTED_SPAWN] = 'State';
12071211
SAI_ACTION_PARAM2_NAMES[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Minimum Spawn Timer';
12081212
SAI_ACTION_PARAM3_NAMES[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Maximum Spawn Timer';
12091213
SAI_ACTION_PARAM4_NAMES[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Respawn Delay';
12101214
SAI_ACTION_PARAM5_NAMES[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Corpse Delay';
12111215
SAI_ACTION_PARAM5_NAMES[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Dont Despawn';
1212-
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] = '0: Disable Respawn and await script; 1: Respawn Once; 2: Respawn and Enable Respawning';
1216+
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] =
1217+
'0: Disable Respawn and await script; 1: Respawn Once; 2: Respawn and Enable Respawning';
12131218
SAI_ACTION_PARAM2_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Delay in seconds until first spawn, if 0 respawn immediately';
12141219
SAI_ACTION_PARAM3_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Delay in seconds until first spawn, if 0 respawn immediately';
12151220
SAI_ACTION_PARAM4_TOOLTIPS[SAI_ACTIONS.SCRIPTED_SPAWN] = 'Delay in seconds to respawn after corpse is removed, if 0 use DB values';
@@ -1307,3 +1312,10 @@ SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.MOVEMENT_RESUME] = 'ms';
13071312
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.WORLD_SCRIPT] = 'Calls WorldState::HandleExternalEvent(WorldStateEvent eventId, uint32 param)';
13081313
SAI_ACTION_PARAM1_NAMES[SAI_ACTIONS.WORLD_SCRIPT] = 'eventId';
13091314
SAI_ACTION_PARAM2_NAMES[SAI_ACTIONS.WORLD_SCRIPT] = 'param';
1315+
1316+
// SMART_ACTION_DISABLE_REWARD
1317+
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.DISABLE_REWARD] = 'Allows to disable reward from a creature.';
1318+
SAI_ACTION_PARAM1_NAMES[SAI_ACTIONS.DISABLE_REWARD] = 'Disable Reputation';
1319+
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.DISABLE_REWARD] = '1 = enabled 0 = disabled';
1320+
SAI_ACTION_PARAM2_NAMES[SAI_ACTIONS.DISABLE_REWARD] = 'Disable Loot';
1321+
SAI_ACTION_PARAM2_TOOLTIPS[SAI_ACTIONS.DISABLE_REWARD] = '1 = enabled 0 = disabled';

libs/shared/sai-editor/src/constants/sai-comments.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,5 @@ SAI_ACTION_COMMENTS[SAI_ACTIONS.MOVEMENT_STOP] = `Stop Movement`;
253253
SAI_ACTION_COMMENTS[SAI_ACTIONS.MOVEMENT_PAUSE] = `Pause Movement`;
254254
SAI_ACTION_COMMENTS[SAI_ACTIONS.MOVEMENT_RESUME] = `Resume Movement`;
255255
SAI_ACTION_COMMENTS[SAI_ACTIONS.WORLD_SCRIPT] = `Run World State Script: Event: _actionParamOne_, Param: _actionParamTwo_`;
256+
SAI_ACTION_COMMENTS[SAI_ACTIONS.DISABLE_REWARD] =
257+
`Disable reward: Disable Reputation _onOffActionParamOne_, Disable Loot _onOffActionParamTwo_`;

libs/shared/sai-editor/src/sai-comment-generator.service.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,6 +1963,17 @@ describe('SaiCommentGeneratorService', () => {
19631963
},
19641964
expected: `MockEntity - In Combat - Move To [unsupported target type]`,
19651965
},
1966+
...[
1967+
{ action_param2: 0, comment: 'Off' },
1968+
{ action_param2: 1, comment: 'On' },
1969+
].map(({ action_param2, comment }) => ({
1970+
name: `SAI_ACTIONS.DISABLE_REWARD _onOffActionParamTwo_ ${comment}`,
1971+
input: {
1972+
action_type: SAI_ACTIONS.DISABLE_REWARD,
1973+
action_param2,
1974+
},
1975+
expected: `MockEntity - In Combat - Disable reward: Disable Reputation Off, Disable Loot ${comment}`,
1976+
})),
19661977
];
19671978

19681979
for (const { name, input, expected } of cases) {

libs/shared/sai-editor/src/sai-comment-generator.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,10 @@ export class SaiCommentGeneratorService {
625625
}
626626
}
627627

628+
if (actionLine.indexOf('_onOffActionParamTwo_') > -1) {
629+
actionLine = actionLine.replace('_onOffActionParamTwo_', smartScript.action_param2 === 1 ? 'On' : 'Off');
630+
}
631+
628632
if (actionLine.indexOf('_gameobjectNameActionParamOne_') > -1) {
629633
actionLine = actionLine.replace(
630634
'_gameobjectNameActionParamOne_',

0 commit comments

Comments
 (0)