From e5a9658b5ab883bb28f2cd60e42b51a4fd27f98b Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 26 Aug 2017 16:59:15 -0400 Subject: [PATCH] Added Parley code to experiment with. --- .../actors/chara/player/Player.cs | 3 + data/scripts/commands/NegotiationCommand.lua | 56 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 data/scripts/commands/NegotiationCommand.lua diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index b1395149..241b74dc 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -233,6 +233,8 @@ namespace FFXIVClassic_Map_Server.Actors charaWork.eventSave.bazaarTax = 5; charaWork.battleSave.potencial = 6.6f; + charaWork.battleSave.negotiationFlag[0] = true; + charaWork.commandCategory[0] = 1; charaWork.commandCategory[1] = 1; charaWork.commandCategory[32] = 1; @@ -400,6 +402,7 @@ namespace FFXIVClassic_Map_Server.Actors //Commands propPacketUtil.AddProperty("charaWork.commandBorder"); + propPacketUtil.AddProperty("charaWork.battleSave.negotiationFlag[0]"); for (int i = 0; i < charaWork.command.Length; i++) { diff --git a/data/scripts/commands/NegotiationCommand.lua b/data/scripts/commands/NegotiationCommand.lua new file mode 100644 index 00000000..11a79156 --- /dev/null +++ b/data/scripts/commands/NegotiationCommand.lua @@ -0,0 +1,56 @@ +--[[ + +NegotiationCommand Script + +Functions: + +openListWidget(player, originId, 10 bools to show/hide) - Shows a list of things to Parley for based on a sequential list from xtx_negotiationTable. +openAskWidget(player, title, difficulty, desiredItemId, requiredItemId) - Opens the widget asking if the player will Parley. +openNegotiationWidget(player, title, itemId, maxTurns, time, ability1, ability2, ability3, ability4, ability5) - Inits the widget system (call first). +inputNegotiationWidget(player, ?, abort, resumeTimer) - +closeNegotiationWidget(player) - Closes the Parley widget. +negotiationEmote(player, animId) - Plays an animation + +updateNegotiationWidget(player, gridIndex, key, itemIconId, pointValue, ?, ?) - Updates the Parley UI. + +< 12: Places Item +13: Plays SFX + ??? +14: Sets the Negotiation Gauge (max, value) +15: Sets the Achievement Gauge (max, value) + +16: Additional Item 1 (bool) +17: Additional Item 2(bool) +18: Additional Item 3(bool) + +19: Set the last chosen items (index[1-6], iconId) + +20: +21: + +22: Clear Timer +23: Play player move SFX +24: Play opponent move SFX +25: Play times up SFX and close ability widget +26: +27: +28: Pauses the Timer +29: Resumes the Timer + +--]] + +require ("global") + +function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, arg5) + + negotiationJudge = GetStaticActor("NegotiationJudge"); + + callClientFunction(player, "delegateCommand", negotiationJudge, "negotiationEmote", player, 403087360); + --callClientFunction(player, "delegateCommand", negotiationJudge, "openAskWidget", player, 1302, 5, 1000019, 1000019); + --callClientFunction(player, "delegateCommand", negotiationJudge, "openListWidget", player, 3711, true, true, true, true, false, false, false, false, false, false); + callClientFunction(player, "delegateCommand", negotiationJudge, "openNegotiationWidget", player, 1302, 1000019, 15, 20, 0, 0, 0, 0, 0); + callClientFunction(player, "delegateCommand", negotiationJudge, "updateNegotiationWidget", player, 2, 2007, 60662, 5, false, false); + callClientFunction(player, "delegateCommand", negotiationJudge, "inputNegotiationWidget", player, 1, false, true); + callClientFunction(player, "delegateCommand", negotiationJudge, "closeNegotiationWidget", player); + + player:EndEvent(); +end \ No newline at end of file