5 Commits

Author SHA1 Message Date
Robert Baker
8ceee35492 Batch script to copy all files for postbuild -- Reiichi001 2022-11-18 16:34:37 +00:00
Filip Maj
40b677f871 README.md edited online with Bitbucket 2022-11-18 16:31:52 +00:00
Robert Baker
57e7ee1894 Merged in Robert-Baker/importbat-had-a-line-missing-password-fi-1590334814488 (pull request #71)
import.bat had a line missing %PASSWORD% field for importing SQL files.

Approved-by: Filip Maj
2022-01-20 03:15:59 +00:00
PW Anon
61069e6d49 Merged in issue-21 (pull request #69)
Fix to Character Name Reservation

* Ported over changes from resharc/ffxiv-classic-server and merged into new branch.


Approved-by: Filip Maj
2022-01-20 03:15:31 +00:00
Filip Maj
0521b167fb README.md edited online with Bitbucket 2021-03-24 19:58:16 +00:00
1007 changed files with 18233 additions and 28776 deletions

View File

@@ -1,204 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Meteor.Common
{
public class Bitstream
{
private byte[] Data;
public Bitstream(uint numBits, bool setAllTrue = false)
{
Debug.Assert(numBits % 8 == 0);
Debug.Assert(numBits % 4 == 0);
Data = new byte[numBits / 8];
if (setAllTrue)
SetAll(true);
}
public Bitstream(bool[] boolArray)
{
Data = Utils.ConvertBoolArrayToBinaryStream(boolArray);
}
private Bitstream(byte[] byteArray)
{
Data = byteArray;
}
public void SetAll(bool to)
{
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] = Data[i + 1] = Data[i + 2] = Data[i + 3] = (byte)(to ? 0xFF : 0x00);
}
}
public void SetTo(Bitstream result)
{
Debug.Assert(Data.Length == result.Data.Length);
for (int i = 0; i < result.Data.Length; i += 4)
{
Data[i] = result.Data[i];
Data[i + 1] = result.Data[i + 1];
Data[i + 2] = result.Data[i + 2];
Data[i + 3] = result.Data[i + 3];
}
}
public void SetTo(bool[] result)
{
Debug.Assert(Data.Length == result.Length / 8);
Data = Utils.ConvertBoolArrayToBinaryStream(result);
}
public bool Get(uint at)
{
return Get((int)at);
}
public bool Get(int at)
{
int bytePos = at / 8;
int bitPos = at % 8;
return (Data[bytePos] & (1 << bitPos)) != 0;
}
public void Set(uint at)
{
Set((int)at);
}
public void Set(int at)
{
int bytePos = at / 8;
int bitPos = at % 8;
Data[bytePos] |= (byte)(1 << bitPos);
}
public void Clear(uint at)
{
Clear((int)at);
}
public void Clear(int at)
{
int bytePos = at / 8;
int bitPos = at % 8;
Data[bytePos] &= (byte)~(1 << bitPos);
}
public void NOT()
{
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] = (byte)~Data[i];
Data[i + 1] = (byte)~Data[i + 1];
Data[i + 2] = (byte)~Data[i + 2];
Data[i + 3] = (byte)~Data[i + 3];
}
}
public void OR(Bitstream other)
{
Debug.Assert(Data.Length == other.Data.Length);
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] |= other.Data[i];
Data[i + 1] |= other.Data[i + 1];
Data[i + 2] |= other.Data[i + 2];
Data[i + 3] |= other.Data[i + 3];
}
}
public void AND(Bitstream other)
{
Debug.Assert(Data.Length == other.Data.Length);
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] &= other.Data[i];
Data[i + 1] &= other.Data[i + 1];
Data[i + 2] &= other.Data[i + 2];
Data[i + 3] &= other.Data[i + 3];
}
}
public void XOR(Bitstream other)
{
Debug.Assert(Data.Length == other.Data.Length);
for (int i = 0; i < Data.Length; i += 4)
{
Data[i] ^= other.Data[i];
Data[i + 1] ^= other.Data[i + 1];
Data[i + 2] ^= other.Data[i + 2];
Data[i + 3] ^= other.Data[i + 3];
}
}
public Bitstream Copy()
{
byte[] copy = new byte[Data.Length];
Array.Copy(Data, copy, Data.Length);
return new Bitstream(copy);
}
public byte[] GetBytes()
{
return Data;
}
public byte[] GetSlice(ushort from, ushort to)
{
int remainder = ((to - from) % 8 != 0) ? 1 : 0;
byte[] toReturn = new byte[((to - from) / 8) + remainder + 1];
toReturn[toReturn.Length - 1] = 0x3;
byte curByte = 0;
int destByteIndx = 0;
int destShiftIndx = 0;
int srcByteIndx = from / 8;
int srcShiftIndx = from % 8;
for (int i = from; i <= to; i++)
{
// Skip Zeros
if (Data[srcByteIndx] == 0)
{
srcByteIndx++;
srcShiftIndx = 0;
destByteIndx++;
i += 8;
continue;
}
bool val = (Data[srcByteIndx] & (1 << srcShiftIndx++)) != 0;
curByte |= (byte)((val ? 1 : 0) << destShiftIndx++);
if (srcShiftIndx == 8)
{
srcShiftIndx = 0;
srcByteIndx++;
}
if (destShiftIndx == 8)
{
toReturn[destByteIndx++] = curByte;
destShiftIndx = 0;
curByte = 0;
}
}
if (destByteIndx == toReturn.Length - 2)
toReturn[destByteIndx] = curByte;
return toReturn;
}
}
}

View File

@@ -87,7 +87,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="BasePacket.cs" /> <Compile Include="BasePacket.cs" />
<Compile Include="Bitfield.cs" /> <Compile Include="Bitfield.cs" />
<Compile Include="Bitstream.cs" />
<Compile Include="Blowfish.cs" /> <Compile Include="Blowfish.cs" />
<Compile Include="EfficientHashTables.cs" /> <Compile Include="EfficientHashTables.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -245,7 +245,7 @@ namespace Meteor.Common
{ {
for (var bitCount = 0; bitCount < 8; bitCount++) for (var bitCount = 0; bitCount < 8; bitCount++)
{ {
if (i + bitCount >= array.Length - 1) if (i + bitCount >= array.Length)
break; break;
data[dataCounter] = (byte)(((array[i + bitCount] ? 1 : 0) << 7 - bitCount) | data[dataCounter]); data[dataCounter] = (byte)(((array[i + bitCount] ? 1 : 0) << 7 - bitCount) | data[dataCounter]);
} }
@@ -255,26 +255,6 @@ namespace Meteor.Common
return data; return data;
} }
public static bool[] ConvertBinaryStreamToBoolArray(byte[] bytes)
{
bool[] data = new bool[bytes.Length * 8];
int boolCounter = 0;
for (int i = 0; i < bytes.Length; i ++)
{
if (bytes[i] == 0)
{
boolCounter += 8;
continue;
}
for (int bitCount = 0; bitCount < 8; bitCount++)
data[boolCounter++] = (bytes[i] >> bitCount & 1) == 1;
}
return data;
}
public static string ToStringBase63(int number) public static string ToStringBase63(int number)
{ {
var lookup = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; var lookup = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -287,20 +267,7 @@ namespace Meteor.Common
public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20) public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20)
{ {
long pos = reader.BaseStream.Position; return Encoding.ASCII.GetString(reader.ReadBytes(maxSize)).Trim(new[] { '\0' });
int size = 0;
for (int i = 0; i < maxSize; i++)
{
if (reader.ReadByte() == 0)
{
size = i;
break;
}
}
reader.BaseStream.Seek(pos, SeekOrigin.Begin);
string result = Encoding.ASCII.GetString(reader.ReadBytes(size));
reader.BaseStream.Seek(pos + maxSize, SeekOrigin.Begin);
return result;
} }
public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20) public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20)

110
Data/postbuild_copy.bat Normal file
View File

@@ -0,0 +1,110 @@
@ECHO OFF
REM SETLOCAL
SET CWD = %~dp0
REM Echo Launch dir: "%~dp0"
REM Echo Current dir: "%CD%"
REM =============
REM COPY LOBBY CONFIG
REM =============
REM Required files: lobby_config.ini
SET /a foundlfolders = 0
if exist "%~dp0\..\Lobby Server\bin\Debug" (
SET /a foundlfolders = %foundlfolders% + 1
echo Found Lobby Debug build folder.
echo Copying lobby_config.ini if needed...
xcopy lobby_config.ini "%~dp0\..\Lobby Server\bin\Debug\" /d /y /q
)
if exist "%~dp0\..\Lobby Server\bin\Release" (
SET /a foundlfolders = %foundlfolders% + 1
echo Found Lobby Release build folder.
echo Copying lobby_config.ini if needed...
xcopy lobby_config.ini "%~dp0\..\Lobby Server\bin\Release\" /d /y /q
)
if %foundlfolders% LSS 1 (
echo Could not find debug or release folder for the Lobby server. Please compile the project first!
)
REM =============
REM COPY WORLD CONFIG
REM =============
REM Required files: world_config.ini
SET /a foundwfolders = 0
if exist "%~dp0\..\World Server\bin\Debug" (
SET /a foundwfolders = %foundwfolders% + 1
echo Found World Debug build folder.
echo Copying world_config.ini if needed...
xcopy world_config.ini "%~dp0\..\World Server\bin\Debug\" /d /y /q
)
if exist "%~dp0\..\World Server\bin\Release" (
SET /a foundwfolders = %foundwfolders% + 1
echo Found World Release build folder.
echo Copying world_config.ini if needed...
xcopy world_config.ini "%~dp0\..\World Server\bin\Release\" /d /y /q
)
if %foundwfolders% LSS 1 (
echo Could not find debug or release folder for the World server. Please compile the project first!
)
REM =============
REM COPY MAP CONFIG
REM =============
REM Required files: map_config.ini staticactors.bin scripts/
SET /a foundmfolders = 0
if exist "%~dp0\..\Map Server\bin\Debug" (
SET /a foundmfolders = %foundmfolders% + 1
echo Found Map Debug build folder.
echo Copying map_config.ini if needed...
xcopy map_config.ini "%~dp0\..\Map Server\bin\Debug\" /d /y /q
if exist staticactors.bin (
echo Copying staticactors.bin if needed...
xcopy staticactors.bin "%~dp0\..\Map Server\bin\Debug\" /d /y /q
) else (
echo Cannot copy the staticactors.bin file because it doesn't exist in data\
)
echo Copying scripts folder if needed...
xcopy scripts "%~dp0\..\Map Server\bin\Debug\scripts\" /e /d /y /s /q
)
if exist "%~dp0\..\Map Server\bin\Release" (
SET /a foundmfolders = %foundmfolders% + 1
echo Found Map Release build folder.
echo Copying map_config.ini if needed...
xcopy map_config.ini "%~dp0\..\Map Server\bin\Release\" /d /y /q
if exist staticactors.bin (
echo Copying staticactors.bin if needed...
xcopy staticactors.bin "%~dp0\..\Map Server\bin\Release\" /d /y /q
) else (
echo Cannot copy the staticactors.bin file because it doesn't exist in data\
)
echo Copying scripts folder if needed...
xcopy scripts "%~dp0\..\Map Server\bin\Release\scripts\" /e /d /y /s /q
)
if %foundmfolders% LSS 1 (
echo Could not find debug or release folder for the Map server. Please compile the project first!
)
Pause

View File

@@ -1,19 +0,0 @@
--[[
PopulaceMenuMan Script
Functions:
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
callClientFunction(player, "debugMenuEvent", player);
player:endEvent();
end

View File

@@ -1,3 +0,0 @@
function init(npc)
return false, false, 0, 0, 0, 0;
end

View File

@@ -1,9 +0,0 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
player:EndEvent();
end

View File

@@ -1,19 +1,5 @@
require ("global") require ("global")
--[[
BgKeepout Script
Used to send a msg to the player that they cannot proceed passed this point. Invisible walls are
linked to this object.
]]
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName)
player:SendGameMessage(player, GetWorldMaster(), 60001, 0x20);
player:EndEvent();
end

View File

@@ -1,95 +1,5 @@
require ("global") require ("global")
--[[ function init(npc)
return false, false, 0, 0;
Elevator Standard Script
Functions:
elevatorAskLimsa001(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Crow's Head Lift Lvl 1.
elevatorAskLimsa002(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Crow's Head Lift Lvl 2.
elevatorAskLimsa003(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Crow's Head Lift Lvl 3.
elevatorAskUldah001(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Wellhead Lift Lvl 1.
elevatorAskUldah002(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Wellhead Lift Lvl 2.
elevatorAskUldah003(eventNum) - Shows the ask dialog, and plays the event cutscenes for the Wellhead Lift Lvl 3.
elevatorQuestAskEvent(questId) - Special quest related elevator dialog.
Notes:
Script to control the elevators in Limsa Lominsa and Ul'dah. Each elevator entrance has a specific event for it's floor.
The only param is used to either show the ask dialog to the player or player the appropriate cutscene given the choice
made.
--]]
function onEventStarted(player, npc, eventType, eventName)
local actorClassId = npc.GetActorClassId();
-- Limsa; Crow's Lift Level 1
if (actorClassId == 1290007) then
local floorChoice = callClientFunction(player, "elevatorAskLimsa001", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskLimsa001", 1);
endEventAndWarp(player, 133, -447, 40, 220, -1.574);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskLimsa001", 2);
endEventAndWarp(player, 133, -458, 92, 175, -0.383);
end
-- Limsa; Crow's Lift Level 2
elseif (actorClassId == 1290008) then
local floorChoice = callClientFunction(player, "elevatorAskLimsa002", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskLimsa002", 1);
endEventAndWarp(player, 133, -447, 19, 220, -1.574);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskLimsa002", 2);
endEventAndWarp(player, 133, -458, 92, 175, -0.383);
end
-- Limsa; Crow's Lift Level 3
elseif (actorClassId == 1290009) then
local floorChoice = callClientFunction(player, "elevatorAskLimsa003", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskLimsa003", 1);
endEventAndWarp(player, 133, -447, 19, 220, -1.574);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskLimsa003", 2);
endEventAndWarp(player, 133, -447, 40, 220, -1.574);
end
-- Ul'dah; Wellhead Lift Level 1
elseif (actorClassId == 1090460) then
local floorChoice = callClientFunction(player, "elevatorAskUldah001", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskUldah001", 1);
endEventAndWarp(player, 209, -116.78, 222, 115.7, 2.85);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskUldah001", 2);
endEventAndWarp(player, 209, -121.60, 269.8, 135.28, -0.268);
end
-- Ul'dah; Wellhead Lift Level 2
elseif (actorClassId == 1090461) then
local floorChoice = callClientFunction(player, "elevatorAskUldah002", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskUldah002", 1);
endEventAndWarp(player, 175, -116.78, 198, 115.7, -2.8911);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskUldah002", 2);
endEventAndWarp(player, 209, -121.60, 269.8, 135.28, -0.268);
end
-- Ul'dah; Wellhead Lift Level 3
elseif (actorClassId == 1090462) then
local floorChoice = callClientFunction(player, "elevatorAskUldah003", 0);
if (floorChoice == 1) then
callClientFunction(player, "elevatorAskUldah003", 1);
endEventAndWarp(player, 175, -116.78, 198, 115.7, -2.8911);
elseif (floorChoice == 2) then
callClientFunction(player, "elevatorAskUldah003", 2);
endEventAndWarp(player, 209, -116.78, 222, 115.7, 2.85);
end
end
end
function endEventAndWarp(player, zoneId, x, y, z, rotation)
player:EndEvent();
GetWorldManager():DoZoneChange(player, zoneId, nil, 0, 15, x, y, z, rotation);
end end

View File

@@ -82,12 +82,15 @@ city = {
[1500394] = 3, -- Ul'dah : Edine [1500394] = 3, -- Ul'dah : Edine
} }
function onEventStarted(player, npc, eventType, eventName)
function onEventStarted(player, npc, triggerName)
local npcCity = city[npc:GetActorClassId()] or 1; local npcCity = city[npc:GetActorClassId()] or 1;
local marketPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese local wardPlaceName = CITY_INFO[npcCity][1]; -- Market Wards category name. Identical in all languages except Japanese
local exitPlaceName = CITY_INFO[npcCity][2]; -- Central Limsa Lominsa / Heartstream / The Fronds local exitPlaceName = CITY_INFO[npcCity][2]; -- Central Limsa Lominsa / Heartstream / The Fronds
local gcHQPlaceName = CITY_INFO[npcCity][3]; -- Maelstrom Command / Adders' Nest / Hall of Flames local gcHQPlaceName = CITY_INFO[npcCity][3]; -- Maelstrom Command / Adders' Nest / Hall of Flames
local questPlaceName = CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward local questAreaName = 0; --CITY_INFO[npcCity][4]; -- Sailors Ward / Peasants Ward / Merchants Ward
local wardListStart = CITY_INFO[npcCity][5]; -- Starting id for the market wards local wardListStart = CITY_INFO[npcCity][5]; -- Starting id for the market wards
local wardListCount = CITY_INFO[npcCity][6]; -- Amount of wards in the list local wardListCount = CITY_INFO[npcCity][6]; -- Amount of wards in the list
local showItemSearchCounter = false; local showItemSearchCounter = false;
@@ -95,30 +98,19 @@ function onEventStarted(player, npc, eventType, eventName)
local worldMaster = GetWorldMaster(); local worldMaster = GetWorldMaster();
local pos = player:GetPos(); local pos = player:GetPos();
local currZone = pos[5]; local currZone = pos[4];
local currRegion = player.CurrentArea.RegionId;
local quests = player:GetQuestsForNpc(npc);
-- City entrance specific stuff if (currZone == 133 or currZone == 230 or currZone == 155 or currZone == 206 or currZone == 175 or currZone == 209) then
if (currRegion == 101 or currRegion == 103 or currRegion == 104) then
exitPlaceName = 0; -- If in city, hide city menu option exitPlaceName = 0; -- If in city, hide city menu option
elseif (currZone == 232 or currZone == 234 or currZone == 233) then
-- If no quests attached to this entrence, don't show quest area gcHQPlaceName = 0; -- If in GC Office, hide office menu option
if (#quests == 0) then
questPlaceName = 0;
end
end
-- If in GC Office, hide office menu option
if (currZone == 232 or currZone == 234 or currZone == 233) then
gcHQPlaceName = 0;
end end
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, marketPlaceName, gcHQPlaceName, questPlaceName, showItemSearchCounter, itemSearchId); choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId);
while (true) do while (true) do
if choice == marketPlaceName then -- Market Wards if choice == wardPlaceName then -- Market Wards
wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0); wardSelect = callClientFunction(player, "eventPushStepPrvMarket", wardListStart, wardListCount, 0);
if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then if wardSelect and (wardSelect >= wardListStart and wardSelect <= (wardListStart+wardListCount)) then
@@ -147,14 +139,11 @@ function onEventStarted(player, npc, eventType, eventName)
wait(1); wait(1);
GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]); GetWorldManager():DoZoneChange(player, warp[1], nil, 0, 0x02, warp[2], warp[3], warp[4], warp[5]);
break; break;
elseif (choice == 2095 or choice == 3095) then -- Quest
quests[1]:OnPush(player, npc, eventName);
return;
elseif (choice == 0 or choice == -3) then -- Menu Closed elseif (choice == 0 or choice == -3) then -- Menu Closed
break; break;
end end
choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, marketPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId); choice = callClientFunction(player, "eventPushChoiceAreaOrQuest", exitPlaceName, wardPlaceName, gcHQPlaceName, questAreaName, showItemSearchCounter, itemSearchId);
end end

View File

@@ -1,63 +1,23 @@
require ("global") require ("global")
DREAM_ITEM = {
{[1] = 3010419, [2] = 3010420, [3] = 3010421}, -- Mizzenmast/Roost/Hourglass Biscuit
3010003, -- Boiled Egg
3010101, -- Grilled Carp
3010001, -- Meat Miq'abob
3010402, -- Ginger Cookie
3020001, -- Potion
3020101, -- Ether
1000003, -- 5x Crystal Shards (Fire)
1000004, -- 5x Crystal Shards (Ice)
1000005, -- 5x Crystal Shards (Wind)
1000006, -- 5x Crystal Shards (Earth)
1000007, -- 5x Crystal Shards (Lightning)
1000008 -- 5x Crystal Shards (Water)
}
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
local choice = callClientFunction(player, "askLogout", player);
choice = callClientFunction(player, "askLogout", player);
-- Quit
if (choice == 2) then if (choice == 2) then
player:SetSleeping(); player:SetSleeping();
player:QuitGame(); player:QuitGame();
-- Logout
elseif (choice == 3) then elseif (choice == 3) then
player:SetSleeping(); player:SetSleeping();
player:Logout(); player:Logout();
-- Heck the bed
elseif (choice == 4) then elseif (choice == 4) then
-- Give items based on dream player:SendMessage(33, "", "Heck the bed");
local dreamCode = player:GetLoginDreamCode();
if (dreamCode >= 21 and dreamCode <= 33) then
local innCode = player:GetInnCode();
local itemCode = DREAM_ITEM[dreamCode - 20];
-- Get biscuit for inn
if (dreamCode == 21) then
itemCode = itemCode[innCode];
end
-- If crystals you get x5 otherwise x1.
if (dreamCode > = 28 and dreamCode <= 33) then
player:AddItem(itemCode, 5);
else
player:AddItem(itemCode, 1);
end
-- Clear the code so they player doesn't keep getting things
player:SetLoginDreamCode(0);
else
-- Otherwise show standard message
player:SendGameMessage(player, npc, 7, 0x20);
end
end end
player:EndEvent(); player:EndEvent();
end end

View File

@@ -15,37 +15,10 @@ function init(npc)
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
local choice = callClientFunction(player, "eventDoorMoveAsk"); choice = callClientFunction(player, "eventDoorMoveAsk");
if (choice == 1) then if (choice == 1) then
local activeQuests = player:GetQuestsForNpc(npc);
-- Either let the player choose the quest or start it if it's the only one.
local chosenQuest;
if (#activeQuests > 1) then
local currentPage = 0;
local numPages = math.floor((#activeQuests-1)/4) + 1;
while (true) do
local page, index = callClientFunction(player, "switchEvent", activeQuests[currentPage * 4 + 1], activeQuests[currentPage * 4 + 2], possibleQuests[currentPage * 4 + 3], possibleQuests[currentPage * 4 + 4], currentPage + 1, numPages, 0x3F1);
if (page == 0) then
chosenQuest = activeQuests[(currentPage * 4) + index];
break;
elseif (page > 0) then
currentPage = page - 1;
else
player:EndEvent();
return;
end
end
elseif (#activeQuests == 1) then
chosenQuest = activeQuests[1];
end
if (chosenQuest ~= nil) then
chosenQuest:OnPush(player, npc, eventName);
return;
end
end end
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, eventType, eventName) function onEventStarted(player, npc, triggerName)
defaultFst = GetStaticActor("DftFst"); defaultFst = GetStaticActor("DftFst");
choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil); choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil);

View File

@@ -1,5 +1,3 @@
require("global");
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
@@ -9,7 +7,7 @@ function onEventStarted(player, npc, triggerName)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
player:SendGameMessage(player, worldMaster, 34109, 0x20); player:SendGameMessage(player, worldMaster, 34109, 0x20);
elseif (triggerName == "exit") then elseif (triggerName == "exit") then
GetWorldManager():DoPlayerMoveInZone(player, 356.09, 3.74, -701.62, -1.4); GetWorldManager():DoPlayerMoveInZone(player, 5);
end end
player:EndEvent(); player:EndEvent();
end end

View File

@@ -1,18 +0,0 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
if (eventType == ETYPE_PUSH) then
if (eventName == "caution") then
worldMaster = GetWorldMaster();
player:SendGameMessage(player, worldMaster, 34109, 0x20);
elseif (eventName == "exit") then
GetWorldManager():DoPlayerMoveInZone(player, 5.36433, 196, 133.656, -2.84938);
end
end
player:EndEvent();
end

View File

@@ -1,9 +0,0 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
player:EndEvent();
end

View File

@@ -1,9 +0,0 @@
require("global");
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, eventType, eventName)
player:EndEvent();
end

View File

@@ -1,37 +1,12 @@
require("global"); function init(npc)
--[[
PrivateAreaPastExit
This object contains the player inside a PrivateAreaPast, stopping them from escaping it's bounds. It is the
object that generates the circle graphic on the minimap. This object always has two push triggers, an inner
and outer inverted circle. The inner one is named "caution" and the outer one is named "exit". When the player
leaves the inner circle a warning is shown and when they leave the outer circle they either leave the instance
or get warped back to the center.
]]
function init(privAreaExit)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, privAreaExit, eventType, eventName) function onEventStarted(player, npc, triggerName)
player:EndEvent(); if (triggerName == "caution") then
worldMaster = GetWorldMaster();
if (eventName == "caution") then player:SendGameMessage(player, worldMaster, 34109, 0x20);
player:SendGameMessage(player, GetWorldMaster(), 34109, MESSAGE_TYPE_SYSTEM); -- You are about to leave the instance. elseif (triggerName == "exit") then
elseif (eventName == "exit") then
local area = privAreaExit.CurrentArea;
if (area.IsPrivate()) then
-- If you can leave, warp to public zone and show message.
if (area.CanExitPrivateArea()) then
player:SendGameMessage(player, GetWorldMaster(), 34110, MESSAGE_TYPE_SYSTEM); -- You have left the instance.
--GetWorldManager():WarpToPublicArea(player);
-- Otherwise warp back to the center of the zone.
else
--GetWorldManager():WarpToCharaPosition(player, privAreaExit);
end
end
end end
player:EndEvent();
end end

View File

@@ -1,108 +1,19 @@
--[[
TaskBoard
Operates the Task Board actor located in each of the Adventurers' Guilds.
Calls from the Noc000 static actor, which also applies to specific guild NPCs involved in that as well.
Functions: (only including those from Noc000 which apply to the Task Board)
pETaskBoardAskLimsa()
Desc: Show guild menu with valid options for Limsa Lominsa.
Params: None
Returns: Value dictating which item on the list was selected.
pETaskBoardAskUldah()
Desc: Show guild menu with valid options for Ul'dah.
Params: None
Returns: Value dictating which item on the list was selected.
pETaskBoardAskGridania()
Desc: Show guild menu with valid options for Gridania.
Params: None
Returns: Value dictating which item on the list was selected.
pETaskBoardGuild(guildId)
Desc: Plays back a message "The following tasks are available:".
Params: * guildId - Class Id from xtx_text_jobName. EN doesn't make use of it, but JP/DE/FR do. Thanks Koji.
pETaskBoardOrder(recommendedLvl itemId, hq, amount)
Desc: Takes the params and tells the player what the guild still needs turned in.
Params: * recommendedLvl - Recommended level the player be at
* itemId - Id of the item from xtx_itemName
* hq - Quality of item (1 = NQ, 2 = +1, 3 = +2 4 = +3)
* amount - Amount needed (The amount the player needs to turn-in, not the amount guild needs overall)
--]]
require ("global") require ("global")
local guildItem = {
-- [guildId] = { (recommendedLvl itemId, hq, amount, 2nd-recommendedLvl 2nd-itemId, 2nd-hq, 2nd-amount) }
[29] = {1, 4100604, 1, 1, 10, 4030706, 1, 1}, -- Carpenters'
[30] = {1, 4040004, 1, 1, 10, 4030004, 1, 1}, -- Blacksmiths'
[31] = {1, 6080009, 1, 1, 10, 8070606, 1, 1}, -- Armorers'
[32] = {1, 5020007, 1, 1, 10,10004103, 1, 1}, -- Goldsmiths'
[33] = {1, 4020107, 1, 1, 10, 8031514, 1, 1}, -- Leatherworkers'
[34] = {1, 8030819, 1, 1, 10, 8030821, 1, 1}, -- Weavers'
[35] = {1, 3011530, 1,12, 10, 3020527, 1, 4}, -- Alchemists'
[36] = {1, 3010103, 1, 6, 10, 3011503, 1, 6}, -- Culinarians'
[39] = {1,10009101, 1,10, 10,10001116, 1,10}, -- Miners'
[40] = {1,10005403, 1,10, 10,10008106, 1,10}, -- Botanists'
[41] = {1, 3011106, 1,10, 10, 3011113, 1,10} -- Fishermans'
}
local menuToGuild = { -- Get a guild id from a given task board's Return result
[1] = {0, 30, 31, 36, 41}, -- Limsa
[2] = {0, 29, 33, 40, 0}, -- Gridania
[3] = {0, 32, 34, 35, 39} -- Ul'dah
}
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
questNOC = GetStaticActor("Noc000");
local questNOC = GetStaticActor("Noc000");
local npcId = npc:GetActorClassId();
while (true) do
local guildId = 0;
if (npcId == 1200193) then -- Limsa if (npc:GetActorClassId() == 1200193) then
local choice = callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskLimsa"); callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskLimsa", nil, nil, nil);
elseif (npc:GetActorClassId() == 1200194) then
if (choice == 1 or choice == nil) then callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskUldah", nil, nil, nil);
break; -- Exited menu else
else callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskGridania", nil, nil, nil);
guildId = menuToGuild[1][choice]; end
end
elseif (npcId == 1200194) then -- Ul'dah player:EndEvent();
local choice = callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskUldah"); end
if (choice == 1 or choice == nil) then
break; -- Exited menu
else
guildId = menuToGuild[3][choice];
end
else -- Gridania
local choice = callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardAskGridania");
if (choice == 1 or choice == nil) then
break; -- Exited menu
else
guildId = menuToGuild[2][choice];
end
end
if (guildId > 0) then
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardGuild", guildId);
local gItem = guildItem[guildId]
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardOrder", unpack(gItem, 1, 4));
callClientFunction(player, "delegateEvent", player, questNOC, "pETaskBoardOrder", unpack(gItem, 5, 8));
end
end
player:EndEvent();
end

View File

@@ -107,7 +107,7 @@ function doLevequestInit(player, aetheryte)
player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); player:SendGameMessage(worldMaster, 50036, 0x20, glId, player);
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true)); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));
director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player); director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(true, glId) director:StartDirector(true, glId)

View File

@@ -33,30 +33,6 @@ end
function onEventStarted(player, aetheryte, triggerName) function onEventStarted(player, aetheryte, triggerName)
-- Main Scenario Intro Quests
if (player:HasQuest(110002) == true) then
require ("quests/man/man0l1");
local quest = player:GetQuest("Man0l1");
if (quest:GetSequence() == SEQ_003) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent025");
quest:StartSequence(SEQ_005);
end
elseif (player:HasQuest(110006) == true) then
require ("quests/man/man0g1");
local quest = player:GetQuest("Man0g1");
if (quest:GetSequence() == SEQ_005) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent013");
--quest:StartSequence(???);
end
elseif (player:HasQuest(110010) == true) then
require ("quests/man/man0u1");
local quest = player:GetQuest("Man0u1");
if (quest:GetSequence() == SEQ_005) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent013");
quest:StartSequence(SEQ_010);
end
end
if (player:GetGuildleveDirector() ~= nil) then if (player:GetGuildleveDirector() ~= nil) then
doGuildleveMenu(player, aetheryte); doGuildleveMenu(player, aetheryte);
else else
@@ -166,7 +142,7 @@ function doLevequestInit(player, aetheryte)
player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); player:SendGameMessage(worldMaster, 50036, 0x20, glId, player);
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true)); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true));
director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player); director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(true, glId); director:StartDirector(true, glId);

View File

@@ -61,7 +61,7 @@ function onEventStarted(player, npc, triggerName)
local killCount = 50; local killCount = 50;
callClientFunction(player, "caravanGuardOffer", areaName, areaName2, playerGC); callClientFunction(player, "caravanGuardOffer", areaName, areaName2, playerGC);
--callClientFunction(player, "caravanGuardReward", cargo, nil, areaName, playerGC, killCount, areaName2); --callClientFunction(player, "caravanGuardReward", cargo, nil, areaName, playerGC, killCount, areaName2);
--player:SendGameMessageLocalizedDisplayName(npc, 6, MESSAGE_TYPE_SAY, npc.displayNameId); --player:SendGameMessageDisplayIDSender(npc, 6, MESSAGE_TYPE_SAY, npc.displayNameId);
player:EndEvent(); player:EndEvent();

View File

@@ -28,8 +28,7 @@ local rentalTime = 10;
local gcIssuances = { local gcIssuances = {
[1500006] = 2001004, [1500006] = 2001004,
[1500061] = 2001005, [1500061] = 2001005,
[1000840] = 2001006, [1000840] = 2001006
[1500059] = 0
}; };
local startAppearances = { local startAppearances = {
@@ -41,8 +40,7 @@ local startAppearances = {
local cityExits = { local cityExits = {
[1500006] = {133, -6.032, 46.356, 132.572, 3.034}, [1500006] = {133, -6.032, 46.356, 132.572, 3.034},
[1500061] = {150, 333.271, 5.889, -943.275, 0.794}, [1500061] = {150, 333.271, 5.889, -943.275, 0.794},
[1000840] = {170, -26.088, 181.846, -79.438, 2.579}, [1000840] = {170, -26.088, 181.846, -79.438, 2.579}
[1500059] = {172, -2133.028, 15.476, -421.471, 1.5}
}; };
function init(npc) function init(npc)
@@ -50,9 +48,8 @@ function init(npc)
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
local classId = npc:GetActorClassId();
local curLevel = 20; -- TODO: pull from character local curLevel = 20; -- TODO: pull from character
local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[classId]); local hasIssuance = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(gcIssuances[npc:GetActorClassId()]);
local hasChocobo = player.hasChocobo; local hasChocobo = player.hasChocobo;
if (hasChocobo == false) then -- Let GMs auto have the issuance for debugging if (hasChocobo == false) then -- Let GMs auto have the issuance for debugging
@@ -60,64 +57,50 @@ function onEventStarted(player, npc, triggerName)
end end
local hasFunds = (player:GetCurrentGil() >= rentalPrice); local hasFunds = (player:GetCurrentGil() >= rentalPrice);
callClientFunction(player, "eventTalkWelcome", player);
if ((classId == 1000840) and (player:HasQuest(110009))) then -- Cross-script Man0u0 dialog local menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 0);
local sequence = player:GetQuest(110009):getSequence();
if (menuChoice == 1) then -- Issuance option
if (sequence == 0) then
callClientFunction(player, "delegateEvent", player, GetStaticActor("Man0u0"), "processEvent000_13"); callClientFunction(player, "eventTalkMyChocobo", player);
elseif (sequence == 10) then local nameResponse = callClientFunction(player, "eventSetChocoboName", true);
callClientFunction(player, "delegateEvent", player, GetStaticActor("Man0u0"), "processEvent020_7");
else if (nameResponse == "") then -- Cancel Chocobo naming
player:EndEvent(); callClientFunction(player, "eventCancelChocoboName", player);
end callClientFunction(player, "eventTalkStepBreak", player);
else player:EndEvent();
callClientFunction(player, "eventTalkWelcome", player); return;
else
local menuChoice = callClientFunction(player, "eventAskMainMenu", player, curLevel, hasFunds, hasIssuance, hasChocobo, hasChocobo, 0); local appearance = startAppearances[npc:GetActorClassId()];
player:IssueChocobo(appearance, nameResponse);
if (menuChoice == 1) then -- Issuance option
callClientFunction(player, "eventAfterChocoboName", player);
callClientFunction(player, "eventTalkMyChocobo", player);
local nameResponse = callClientFunction(player, "eventSetChocoboName", true); --Add Chocobo License and remove issuance
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then
if (nameResponse == "") then -- Cancel Chocobo naming player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007);
callClientFunction(player, "eventCancelChocoboName", player); end
callClientFunction(player, "eventTalkStepBreak", player); player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[npc:GetActorClassId()], 1);
player:EndEvent();
return; --Warp with the special chocobo warp mode.
else mountChocobo(player);
local appearance = startAppearances[classId]; GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_CHOCOBO_GET, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
player:IssueChocobo(appearance, nameResponse); end
callClientFunction(player, "eventAfterChocoboName", player); elseif(menuChoice == 2) then -- Summon Bird
mountChocobo(player);
--Add Chocobo License and remove issuance GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_NO_ANIM, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(2001007) == false) then elseif(menuChoice == 3) then -- Change Barding
player:GetItemPackage(INVENTORY_KEYITEMS):AddItem(2001007); callClientFunction(player, "eventTalkStepBreak", player);
end elseif(menuChoice == 5) then -- Rent Bird
player:GetItemPackage(INVENTORY_KEYITEMS):RemoveItem(gcIssuances[classId], 1); mountChocobo(player, true, 1);
GetWorldManager():DoZoneChange(player, cityExits[npc:GetActorClassId()][1], nil, 0, SPAWN_CHOCOBO_RENTAL, cityExits[npc:GetActorClassId()][2], cityExits[npc:GetActorClassId()][3], cityExits[npc:GetActorClassId()][4], cityExits[npc:GetActorClassId()][5]);
--Warp with the special chocobo warp mode. else
mountChocobo(player); callClientFunction(player, "eventTalkStepBreak", player);
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_CHOCOBO_GET, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]); end
end
elseif(menuChoice == 2) then -- Summon Bird
mountChocobo(player);
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_NO_ANIM, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
elseif(menuChoice == 3) then -- Change Barding
callClientFunction(player, "eventTalkStepBreak", player);
elseif(menuChoice == 5) then -- Rent Bird
mountChocobo(player, true, 10);
GetWorldManager():DoZoneChange(player, cityExits[classId][1], nil, 0, SPAWN_CHOCOBO_RENTAL, cityExits[classId][2], cityExits[classId][3], cityExits[classId][4], cityExits[classId][5]);
else
callClientFunction(player, "eventTalkStepBreak", player);
end
end
player:EndEvent(); player:EndEvent();
end end
@@ -131,6 +114,6 @@ function mountChocobo(player, isRental, rentalMinutes)
player:SendMountAppearance(); player:SendMountAppearance();
player:SetMountState(1); player:SetMountState(1);
player:ChangeSpeed(0.0, 3.6, 9.0, 9.0); player:ChangeSpeed(0.0, 5.0, 10.0, 10.0);
player:ChangeState(15); player:ChangeState(15);
end end

View File

@@ -4,10 +4,10 @@ PopulaceCompanyWarp Script
Functions: Functions:
eventTalkWelcome(player) - Start Text eventTalkWelcome(player) - Start Text
eventAskMainMenu(player, index) - Shows teleport menu, hides the teleport location at index value to prevent warping to the spot you're at eventAskMainMenu(player, index) - Shows teleport menu, hides the teleport location at index value to prevent warping to the spot you're at
eventAfterWarpOtherZone(player) - Fades out for warp eventAfterWarpOtherZone(player) - Fades out for warp
eventTalkStepBreak() - Holds the client up for whatever reason? eventTalkStepBreak() - Ends talk
--]] --]]
require ("global") require ("global")
@@ -82,50 +82,39 @@ function onEventStarted(player, npc, triggerName)
npcId = npc:GetActorClassId(); npcId = npc:GetActorClassId();
city = warpNpc[npcId][2]; city = warpNpc[npcId][2];
if (city == 1) then
if city == 1 then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passLimsa) then
passCheck = 1; passCheck = 1;
else else
if (passCheck == 0) then callClientFunction(player, "eventTalkWelcome", player); end if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
end; end;
elseif (city == 2) then elseif city == 2 then
-- if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passGrid) then
passCheck = 1;
-- else
-- if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
--end;
elseif (city == 3) then
if (player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah)) then
passCheck = 1; passCheck = 1;
else else
if (passCheck == 0) then callClientFunction(player, "eventTalkWelcome", player); end if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
end;
elseif city == 3 then
if player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(passUldah) then
passCheck = 1;
else
if passCheck == 0 then callClientFunction(player, "eventTalkWelcome", player); end
end end
end end
if passCheck == 1 then
if (passCheck == 1) then
choice = callClientFunction(player, "eventAskMainMenu", player, warpNpc[npcId][1]); choice = callClientFunction(player, "eventAskMainMenu", player, warpNpc[npcId][1]);
if choice == 0 then
if (choice ~= 0) then --callClientFunction(player, "playereventTalkStepBreak");
callClientFunction(player, "eventAfterWarpOtherZone", player);
wait(1);
player:EndEvent();
local player_zone = player:GetPos()[5];
spawnType = 0x0A;
if (player_zone == aethernet[city][choice].zone) then
GetWorldManager():DoPlayerMoveInZone(player, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r, spawnType);
else
GetWorldManager():DoZoneChange(player, aethernet[city][choice].zone, nil, 0, spawnType, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r);
end;
else
player:EndEvent(); player:EndEvent();
else
-- callClientFunction(player, "eventAfterWarpOtherZone", player); -- Commented out for now to prevent double fade-to-black for warp
player:EndEvent();
GetWorldManager():DoZoneChange(player, aethernet[city][choice].zone, nil, 0, 15, aethernet[city][choice].x, aethernet[city][choice].y, aethernet[city][choice].z, aethernet[city][choice].r);
end end
end end
player:EndEvent();
end end

View File

@@ -18,51 +18,7 @@ end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc, triggerName)
-- Special case for A Slippery Stone and Cutthroat Prices
if (player:HasQuest(110737) == true) then
require ("quests/etc/etc3g3");
local quest = player:GetQuest("Etc3g3");
if (quest:GetSequence() == SEQ_000) then
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEvent_005");
if (choice == 1) then
quest:StartSequence(SEQ_001);
addPlayerToAirship(player, 2);
end
player:EndEvent();
return;
end
elseif (player:HasQuest(110728) == true) then
require ("quests/etc/etc3u3");
local quest = player:GetQuest("Etc3u3");
if (quest:GetSequence() == SEQ_000) then
local choice = callClientFunction(player, "delegateEvent", player, quest, "processEvent_005");
if (choice == 1) then
quest:StartSequence(SEQ_001);
addPlayerToAirship(player, 3);
end
player:EndEvent();
return;
end
end
-- Otherwise normal operation
callClientFunction(player, "eventIn", player, false, nil, 5); callClientFunction(player, "eventIn", player, false, nil, 5);
player:EndEvent(); player:EndEvent();
end
function addPlayerToAirship(player, city)
if (city == 1) then
-- Limsa Airship
GetWorldManager():WarpToPosition(player, -764.519, -3.146, 384.154, 1.575);
--GetWorldManager():AddPlayerToShipList(player, 2);
elseif (city == 2) then
-- Gridania Airship
GetWorldManager():WarpToPosition(player, 54.47, -7, -1198.54, -0.02);
--GetWorldManager():AddPlayerToShipList(player, 3);
elseif (city == 3) then
-- Ul'dah Airship
GetWorldManager():WarpToPosition(player, -126.580, 271.2, 156.435, -1.35);
--GetWorldManager():AddPlayerToShipList(player, 4);
end
end end

View File

@@ -1,381 +1,38 @@
--[[ --[[
PopulacePassiveGLPublisher PopulacePassiveGLPublisher Script
Operates the Local Levequest selection menus.
Functions: Functions:
askOfferPack(player) askOfferPack() - Show Classes
Desc: Show class selection menu. askOfferRank() - Show Ranks
Params: * player - The player actor. askOfferQuest(player)
Returns: Value dictating which item on the list was selected (1-8 for class, nil if exited/canceled) confirmOffer(nil, questId)
confirmMaxOffer()
askOfferRank(player) talkOfferWelcome(actor, leveAllowances)
Desc: Show Level selection menu.
Params: * player - The player actor.
Returns: Value dictating which item on the list was selected (1 = Lv01, 2 = Lv20, 3 = Lv40, nil if exited/canceled)
askOfferQuest(player, ?, questId1, questId2, questId3, questId4, questId5, questId6, questId7, questId8)
Desc: Show Leve quest selection menu with up to 8 questId entries
Params: * player - The player actor.
* ? - Unused param. Capture has a 2.
* questId 1-8 - The local levequests available up to 8 quests.
Returns: 1 through 8 for an accepted leve in the order sent, -1 for hitting "Return", and Nil for "Cancel"
confirmOffer(player, questId)
Desc: Opens prompt asking whether to activate the leve and begin it.
Params: * player - The player actor.
* questId - The quest being confirmed.
Returns: Boolean - True on Yes, false on No or hitting escape.
confirmMaxOffer(player)
Desc: Opens ask widget stating you'll be capped on leves after accepting.
Params: * player - The player actor. Unused.
Returns: Boolean - True on Accept, false on "Quit" or hitting escape.
talkOfferWelcome(player, numAllowance)
Desc: NPC intro dialog as well as stating your available leve allowances.
Params: * player - The player actor.
* numAllowance - The number of leve allowances the player still has.
talkOfferDecide() talkOfferDecide()
Desc: Makes the NPC say dialog following the acceptance of a leve.
Params: None
talkOfferMaxOver() talkOfferMaxOver()
Desc: Makes the NPC say dialog stating the player is carrying too many leves currently. selectDiscardGuildleve(player)
Params: None confirmJournal()
finishTalkTurn()
Desc: Ends the npc actor's turn towards you. Call this at the end of the script or the
npc will be stuck "facing" the player.
Params: None
selectDiscardGuildleve()
Desc: Opens the Journal widget to select a leve to discard. This is a follow-up to askDiscardGuildleve().
Params: None
Returns: Quest Actor
confirmJournal(questId, difficulty, unused, itemsCompleted, remainingMats, hasMaterials, unused)
Desc: Opens askJournalDetailWidget displaying current status of the leve.
Params: * questId - The current quest being confirmed.
* difficulty - The difficulty of the quest.
* unused - Unused param.
* itemsComplete - Sets the number of items crafted.
* remainingMats - Sets the remaining materials.
* hasMaterials - If set to 1, shows the progress section.
* unused - While loaded into widget, it doesn't do anything with this journalType (13).
Returns: True on "Exchange", Nil on "Return" or hitting Escape key
askDiscardGuildleve() askDiscardGuildleve()
Desc: Opens an ask widget, stating the player cannot accept any more guildleves and if they'd want to return one to make room. confirmDiscardGuildleve(nil, questId)
Params: None askRetryRegionalleve(questId, leveAllowances)
Returns: Boolean finishTalkTurn()
confirmDiscardGuildleve(?, questId, guildleveId)
Desc: Opens an ask widget, confirming the returning of the selected guildleve.
Params: * ? - Most likely a player actor, but unused.
* questId - The dialog is "Returning <quest>. Are you certain?". This is the questId being returned.
* guildleveId - This is mostly unused, Japanese localization has a weird switch to use this. Can be nil.
Returns: Boolean
askRetryRegionalleve(questId, numAllowance)
Desc: Opens an ask widget to re-attempt leve questId while showing leveAllowances. If no is selected, a second widget appears to confirm abandoning it.
Params: * questId - The questId being retried.
* numAllowance - The number of leve allowances the player still has.
Returns: Menu1 - Is 1 if yes is selected, 2 if no. Nil if Escape is hit (resend function in this case?)
Menu2 - Is 1 if yes is selected (leve abandoned), 2 if no. Nil if Menu1 isn't set to 2
Notes:
50141 - You have <num> leve allowances remaining.
50142 - You have run out of leve allowances. You cannot accept any more levequests at this time.
50143 - You cannot accept any more levequests at this time.
Local Leves:
~~Limsa~~
CRP: Baderon's New Counter (120007)
The Mad Fisher (120017)
Building Bridges (120039)
High Stakes (120047)
Training and Trees (120061)
BSM: Baderon's New Sword (120005)
Got Ingots (120013)
Ship Shape (120014)
A Want of Weapons (120015)
Skull Valley Delivery (120035)
Fruit's of a Vintner's Whinings (120043)
Premiums Paid (120051)
Training and Trading (120059)
Waiting on Weapons (120067)
ARM: Baderon's New Barbuts (120009)
Seeing Sallets to the See (120019)
A Step Ahead (120020)
Mailed Sailors (120021)
Running Rings (120036)
Watching the Shore (120044)
Watching the Knoll (120052)
Rings Around the Rock (120063)
Dead Ringers (120068)
GSM: Baderon's New Bands (120010)
2 x 2 Eyes (120022)
Going Brandanas (120041)
Brand New Brands (120049)
Staves to Fashion (120064)
LTW: Baderon's New Shoes (120008)
The Mad Tanner (120018)
Under Foot (120040)
Shoeing the Shore (120048)
Training and Tanning (120062)
WVR: Baderon's New Clothes (120006)
The Mad Hatter (120016)
Wear and Tear (120038)
Outfitting the Shore (120046)
Training and Tailoring (120060)
ALC: Baderon's New Soles (120011)
A Sticky Situation (120023)
Feeding Trainees (120042)
Suffering Soldiers (120050)
Training and Eating (120065)
CUL: Baderon's New Breakfast (120012)
Tall, Cool One (120024)
The Captain's Cravings (120025)
A Feast Fit for an Admiral (120026)
Supper at the Skull (120037)
The Last Supper (120045)
A Meal to Remember (120053)
Just Desserts (120066)
A Job Well Done (120069)
~~Gridania~~
CRP: A Mother's Carpentry (120203)
Shields for the Masses (120211)
Canes for the Citizens (120212)
High Tension (120213)
Bowing to Pressure (120223)
Pole Positioning (120229)
Driving up the Wall (120237)
Restocking the Stockade (120245)
Plinks Aplenty (120247)
BSM: A Mother's Metallurgy (120201)
It's All in the File (120209)
Training in Bentbranch (120221)
Re-crating the Scene (120231)
Training in Emerald Moss (120239)
ARM: A Mother's Foundry (120205)
Tending to Tendons (120217)
A Little Rusty (120225)
Springripple Rising (120233)
In Sod We Rust (120241)
GSM: A Mother's Jewelry (120206)
The Band's Bands (120218)
Dusting the Knuckles (120226)
In Arm's Reach (120234)
Knuckling Down (120242)
LTW: A Mother's Booties (120204)
Strapped for Straps (120214)
Fire and Hide (120215)
Choke Hold (120216)
Work of Friction (120224)
Hungry Like the Wolves (120230)
Back in the Harness (120238)
Morbol Measures (120246)
Harnessing Help (120248)
WVR: A Mother's Frippery (120202)
Quelling Bloody Rumors (120210)
Clearing Bentbranch (120222)
Clearing Nine Ivies (120232)
Clearing Emerald Moss (120240)
ALC: A Mother's Delicacies (120207)
Mixing It Up (120219)
Keeping It Green (120227)
Arboreal Alchemy (120235)
Growing Strains (120243)
CUL: A Mother's Muselix (120208)
Better Baker's Bounty (120220)
On a Full Belly (120228)
A Well-Deserved Dinner (120236)
Seafood Smorgasbord (120244)
~~Uldah~~
CRP: Momodi's Sturdy Supports (120403)
The Walk of Death (120413)
Pointed Ambitions (120425)
Off With Their Heads (120435)
Act of Pure Weevil (120443)
BSM: Momodi's Dancing Daggers (120401)
Pointy Props (120409)
Hammering the Point (120423)
Molten Metal (120434)
Looking to Horizon (120442)
ARM: Momodi's Sturdy Suits (120405)
Battered and Bent (120415)
Arming the Unarmed (120427)
Provisioning Drybone (120437)
Buckling Under (120445)
GSM: Momodi's Radiant Rings (120406)
A Scarcity of Scepters (120416)
Pleasure and Pain (120417)
In the Sultana's Wake (120418)
A Shining Example (120428)
A Drybone Induction (120432)
A Horizon Promotion (120440)
A Bluefog Induction (120448)
A Broken Water Promotion (120451)
LTW: Momodi's Sashed Shoes (120404)
Showing Some Leg (120414)
World-weary Souls (120426)
Camp Drybone Cares (120436)
I Would Walk 500 Malms (120444)
WVR: Momodi's Budget Breeches (120402)
Just for Kecks (120410)
Pants Make the Man (120411)
Holes in Their Defense (120412)
Hanging by a Thread (120424)
Exposed to the Elements (120433)
Busier Than the Blades (120441)
A Spot in the Shade (120449)
Fire on the Water (120452)
ALC: Momodi's Condiment Conundrum (120407)
Exports of Import (120419)
Fertile Lies (120420)
A Blind Fool (120421)
Saint Allene's Fire (120429)
Treating Steel (120431)
Blue in the Eye (120439)
Preserving the Region (120447)
Provisioning Broken Water (120450)
CUL: Momodi's Breakfast Bread (120408)
Finger Food (120422)
Irrational Behavior (120430)
Tender Victuals (120438)
Some Like It Wet (120446)
--]] --]]
require ("global") require ("global")
local limsaLocalLeves = {
{120007, 120017, 120039, 120047, 120061}, --CRP
{120005, 120013, 120014, 120015, 120035, 120043, 120051, 120059, 120067}, --BSM
{120009, 120019, 120020, 120021, 120036, 120044, 120052, 120063, 120068}, --ARM
{120010, 120022, 120041, 120049, 120064}, --GSM
{120008, 120018, 120040, 120048, 120062}, --LTW
{120006, 120016, 120038, 120046, 120060}, --WVR
{120011, 120023, 120042, 120050, 120065}, --ALC
{120012, 120024, 120025, 120026, 120037, 120045, 120053, 120066, 120069} --CUL
};
local gridaniaLocalLeves = {
{120203, 120211, 120212, 120213, 120223, 120229, 120237, 120245, 120247}, --CRP
{120201, 120209, 120221, 120231, 120239}, --BSM
{120205, 120217, 120225, 120233, 120241}, --ARM
{120206, 120218, 120226, 120234, 120242}, --GSM
{120204, 120214, 120215, 120216, 120224, 120230, 120238, 120246, 120248}, --LTW
{120202, 120210, 120222, 120232, 120240}, --WVR
{120207, 120219, 120227, 120235, 120243}, --ALC
{120208, 120220, 120228, 120236, 120244} --CUL
};
local uldahLocalLeves = {
{120403, 120413, 120425, 120435, 120443}, --CRP
{120401, 120409, 120423, 120434, 120442}, --BSM
{120405, 120415, 120427, 120437, 120445}, --ARM
{120406, 120416, 120417, 120418, 120428, 120432, 120440, 120448, 120451}, --GSM
{120404, 120414, 120426, 120436, 120444}, --LTW
{120402, 120410, 120411, 120412, 120424, 120433, 120441, 120449, 120452}, --WVR
{120407, 120419, 120420, 120421, 120429, 120431, 120439, 120447, 120450}, --ALC
{120408, 120422, 120430, 120438, 120446} --CUL
};
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, triggerName) function onEventStarted(player, npc)
callClientFunction(player, "talkOfferWelcome", player, 1);
local leveAllowances = 16;
local quest = 120438;
callClientFunction(player, "confirmJournal", quest, 1);
callClientFunction(player, "confirmJournal", quest, 2);
callClientFunction(player, "confirmJournal", quest, 3);
callClientFunction(player, "confirmJournal", quest, 4);
--[[callClientFunction(player, "talkOfferWelcome", player, leveAllowances);
while (true) do
-- Class Menu
local classChoice = callClientFunction(player, "askOfferPack");
if (classChoice != nil) then
while (true) do
-- Level Difficulty Menu
local levelChoice = callClientFunction(player, "askOfferRank");
if levelChoice != nil then
if levelChoice == 1 then
local levequest = callClientFunction(player, "askOfferQuest", player, 1, 120438, 120025);
if (levequest != nil and levequest > 0) then
player:SendMessage(0x20, "", "[DEBUG] Leve : " .. tostring(pickedLeve));
player:SendGameMessage(GetWorldMaster(), 50141, 0x20, leveAllowances);
end
elseif levelChoice == 2 then
pickedLeve = callClientFunction(player, "askOfferQuest", player, 1, 120026, 120027);
if (pickedLeve != nil) or (pickedLeve != -1) then
player:SendMessage(0x20, "", "[DEBUG] Leve : " .. tostring(pickedLeve));
player:SendGameMessage(GetWorldMaster(), 50141, 0x20, leveAllowances);
end
elseif levelChoice == 3 then
pickedLeve = callClientFunction(player, "askOfferQuest", player, 1, 120028, 120029);
if (pickedLeve != nil) or (pickedLeve != -1) then
player:SendMessage(0x20, "", "[DEBUG] Leve : " .. tostring(pickedLeve));
player:SendGameMessage(GetWorldMaster(), 50141, 0x20, leveAllowances)
end
end
else
break
end
end
else
break;
end
end]]--
callClientFunction(player, "finishTalkTurn");
player:EndEvent(); player:EndEvent();
end end
function getAvailableLeves(class, rank) function onEventUpdate(player, npc, step, menuOptionSelected, lsName, lsCrest)
--callClientFunction(player, "askOfferQuest", player, 1000);
end end

View File

@@ -46,6 +46,7 @@ function onEventStarted(player, npc, triggerName)
local cluster = 3020413; local cluster = 3020413;
local eventMode = 2012; local eventMode = 2012;
if eventMode == 2011 then if eventMode == 2011 then
if playerGC == 0 then if playerGC == 0 then
callClientFunction(player, "eventTalkStep0", 0); callClientFunction(player, "eventTalkStep0", 0);

View File

@@ -1,97 +1,13 @@
require("global");
--[[
Populace Standard Script
Functions:
eventSwitch(questId1, questId2, questId3, questId4, currentPage, maxPages, titleId) - Shows a dialog box with which quest to trigger
when more than one quest is active for this npc.
Notes:
This scripts fires for all normal standard ENpcs in the world. Because of how the FFXIV dialog system works, everything is technically
a quest; including the DefaultTalk responses. This script checks both static default quests and any relevant ones for that actor class
id. If only one exists; it is automatically triggered otherwise a dialog box will appear for the player to choose what quest to do.
--]]
function init(npc) function init(npc)
return false, false, 0, 0; return false, false, 0, 0;
end end
function onEventStarted(player, npc, eventType, eventName) function onEventStarted(player, npc)
local chosenQuest = nil; player:SendMessage(0x20, "", "This PopulaceStandard actor has no event set. Actor Class Id: " .. tostring(npc:GetActorClassId()));
player:EndEvent();
if (eventType == 1) then
local defaultTalk = player:GetDefaultTalkQuest(npc);
local tutorialTalk = player:GetTutorialQuest(npc);
local activeQuests = player:GetQuestsForNpc(npc);
local possibleQuests = {};
-- Create the switch table for this npc
if (defaultTalk ~= nil and eventType == ETYPE_TALK) then
table.insert(possibleQuests, defaultTalk);
end
if (tutorialTalk ~= nil and eventType == ETYPE_TALK) then
table.insert(possibleQuests, tutorialTalk);
end
if (activeQuests ~= nil) then
for i=1,#activeQuests do
table.insert(possibleQuests, activeQuests[i]);
end
end
-- Either let the player choose the quest or start it if it's the only one.
if (#possibleQuests > 1) then
local currentPage = 0;
local numPages = math.floor((#possibleQuests-1)/4) + 1;
while (true) do
local page, index = callClientFunction(player, "switchEvent", possibleQuests[currentPage * 4 + 1], possibleQuests[currentPage * 4 + 2], possibleQuests[currentPage * 4 + 3], possibleQuests[currentPage * 4 + 4], currentPage + 1, numPages, 0x3F1);
if (page == 0) then
chosenQuest = possibleQuests[(currentPage * 4) + index];
break;
elseif (page > 0) then
currentPage = page - 1;
else
player:EndEvent();
return;
end
end
elseif (#possibleQuests == 1) then
chosenQuest = possibleQuests[1];
end
else
local activeQuests = player:GetQuestsForNpc(npc);
if (#activeQuests != 0) then
chosenQuest = activeQuests[1];
end
end
-- Run the quest event or tell the devs it's missing.
if (chosenQuest ~= nil) then
doQuestEvent(player, npc, chosenQuest, eventType, eventName);
else
local msg = string.format("ERROR: This PopulaceStandard actor has no defaultTalk or quest set. \nActor Class Id: %s\nEvent Name: %s", tostring(npc:GetActorClassId()), eventName);
printf(msg);
player:SendMessage(0x20, "", msg);
player:EndEvent();
end
end end
function doQuestEvent(player, npc, quest, eventType, eventName) function onEventUpdate(player, npc, blah, menuSelect)
if (eventType == 0) then player:EndEvent();
quest:OnCommand(player, npc, eventName);
elseif (eventType == 1) then
quest:OnTalk(player, npc);
elseif (eventType == 2) then
quest:OnPush(player, npc, eventName);
elseif (eventType == 3) then
quest:OnEmote(player, npc, eventName);
elseif (eventType == 5) then
quest:OnNotice(player, npc, eventName);
end
end end

View File

@@ -1,56 +0,0 @@
--[[
InstanceRaidGuide Script
Functions;
askEnterInstanceRaid(arg1) -- Opens a widget asking to enter the given Raid id.
--]]
require ("global")
function init(npc)
if ((npc == 1002090) or (npc == 1002091)) then
-- This won't work due to how init() works, but old scripts had it, keeping it here for now
return false, false, 0, 0, 491, 2;
else
return false, false, 0, 0;
end
end
function onEventStarted(player, npc, eventType, eventName)
npcId = npc:GetActorClassId()
if (npcId == 1002090) then -- Serpent Private Hodder (Stewart) : Gcl107
callClientFunction(player, "delegateEvent", player, GetStaticActor("DftFst"), "defaultTalkWithStewart_001"); -- "defaultTalkWithStewart_002" -- Post-Raid dialog?
--[[
choice = callClientFunction(player, "delegateEvent", player, GetStaticActor("Gcl107"), "processEventStewart", 15);
if (choice == 1) then
callClientFunction(player, "askEnterInstanceRaid", 15); -- Rivenroad
end
--]]
elseif (npcId == 1002091) then -- Serpent Private Dauremant (Trisselle) : Sum6w0
callClientFunction(player, "delegateEvent", player, GetStaticActor("DftFst"), "defaultTalkWithTrisselle_001"); -- "defaultTalkWithTrisselle_002" -- No idea for context.
--[[
choice = callClientFunction(player, "delegateEvent", player, GetStaticActor("Sum6w0"), "processEventTrisselle", 16)
if (choice == 1) then
callClientFunction(player, "askEnterInstanceRaid", 16); -- Rivenroad (Hard)
end
--]]
elseif (npcId == 1060022) then -- Louisoix
callClientFunction(player, "delegateEvent", player, GetStaticActor("DftFst"), "defaultTalkLouisoix_001");
end
player:EndEvent();
end

View File

@@ -19,7 +19,7 @@ function onBeginLogin(player)
end end
--For Opening. Set Director and reset position incase d/c --For Opening. Set Director and reset position incase d/c
if (player:HasQuest(110001) == true and player.CurrentArea.ZoneId == 193) then if (player:HasQuest(110001) == true and player:GetZoneID() == 193) then
director = player:GetZone():CreateDirector("OpeningDirector", false); director = player:GetZone():CreateDirector("OpeningDirector", false);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(true); director:StartDirector(true);
@@ -32,7 +32,7 @@ function onBeginLogin(player)
player.rotation = 0.025; player.rotation = 0.025;
player:GetQuest(110001):ClearQuestData(); player:GetQuest(110001):ClearQuestData();
player:GetQuest(110001):ClearQuestFlags(); player:GetQuest(110001):ClearQuestFlags();
elseif (player:HasQuest(110005) == true and player.CurrentArea.ZoneId == 166) then elseif (player:HasQuest(110005) == true and player:GetZoneID() == 166) then
director = player:GetZone():CreateDirector("OpeningDirector", false); director = player:GetZone():CreateDirector("OpeningDirector", false);
player:AddDirector(director); player:AddDirector(director);
director:StartDirector(false); director:StartDirector(false);
@@ -45,7 +45,7 @@ function onBeginLogin(player)
player.rotation = -1.26721; player.rotation = -1.26721;
player:GetQuest(110005):ClearQuestData(); player:GetQuest(110005):ClearQuestData();
player:GetQuest(110005):ClearQuestFlags(); player:GetQuest(110005):ClearQuestFlags();
elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 184) then elseif (player:HasQuest(110009) == true and player:GetZoneID() == 184) then
--director = player:GetZone():CreateDirector("OpeningDirector", false); --director = player:GetZone():CreateDirector("OpeningDirector", false);
--player:AddDirector(director); --player:AddDirector(director);
--director:StartDirector(false); --director:StartDirector(false);

View File

@@ -13,7 +13,7 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Ability(command.Id, targetActor); player.Ability(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -1,5 +1,5 @@
require("global") require("global")
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
end end

View File

@@ -8,7 +8,7 @@ Switches between active and passive mode states
--]] --]]
function onEventStarted(player, command, eventType, eventName) function onEventStarted(player, command, triggerName)
if (player.currentMainState == 0x0000) then if (player.currentMainState == 0x0000) then
player.Engage(0, 0x0002); player.Engage(0, 0x0002);

View File

@@ -13,8 +13,8 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Ability(command.Id, targetActor); player.Ability(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -13,7 +13,7 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -9,7 +9,7 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
--]] --]]
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
--Are they in active mode? --Are they in active mode?
if (player:GetState() != 2) then if (player:GetState() != 2) then
@@ -21,6 +21,6 @@ function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3,
if not player.aiContainer.IsEngaged() then if not player.aiContainer.IsEngaged() then
player.Engage(targetActor); player.Engage(targetActor);
end; end;
player.WeaponSkill(command.Id, targetActor); player.WeaponSkill(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -8,14 +8,14 @@ Handles what happens when you examine a player's bazaar
require ("global") require ("global")
function onEventStarted(player, actor, eventType, eventName, name, arg1, arg2, arg3, bazaarActorId) function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, bazaarActorId)
local bazaarActor = nil; local bazaarActor = nil;
if (name ~= nil) then if (name ~= nil) then
bazaarActor = player.CurrentArea:FindPCInZone(name); bazaarActor = player:GetZone():FindPCInZone(name);
elseif (bazaarActorId ~= nil) then elseif (bazaarActorId ~= nil) then
bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId); bazaarActor = player:GetZone():FindActorInArea(bazaarActorId);
end end
if (bazaarActor ~= nil) then if (bazaarActor ~= nil) then

View File

@@ -20,7 +20,7 @@ seekAmount: The amount of seekItem we want.
require ("global") require ("global")
function onEventStarted(player, actor, eventType, eventName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds) function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds)
local rewarding = nil; local rewarding = nil;
local seeking = nil; local seeking = nil;

View File

@@ -10,7 +10,7 @@ All bazaar args have a Reward (The item the person who fufills the request gets)
--TODO REFACTOR --TODO REFACTOR
function onEventStarted(player, actor, eventType, eventName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds) function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds)
local originalReward = nil; local originalReward = nil;
local originalSeek = nil; local originalSeek = nil;
@@ -18,7 +18,7 @@ function onEventStarted(player, actor, eventType, eventName, rewardItem, seekIte
--Get the bazaar actor --Get the bazaar actor
if (bazaarActorId ~= nil) then if (bazaarActorId ~= nil) then
bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId); bazaarActor = player:GetZone():FindActorInArea(bazaarActorId);
end end
--Abort if no actor --Abort if no actor

View File

@@ -13,7 +13,7 @@ Handles canceling bazaar items
--]] --]]
function onEventStarted(player, actor, eventType, eventName, rewardItem, seekItem, bazaarType, narg, bazaarActor, rewardAmount, seekAmount, narg, narg, type9ItemIds) function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarType, narg, bazaarActor, rewardAmount, seekAmount, narg, narg, type9ItemIds)
GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem)); GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem));

View File

@@ -10,7 +10,7 @@ operateUI(pointsAvailable, pointsLimit, str, vit, dex, int, min, pie)
require ("global") require ("global")
function onEventStarted(player, actor, eventType, eventName) function onEventStarted(player, actor, triggerName)
--local points = player:GetAttributePoints(); --local points = player:GetAttributePoints();
--player:RunEventFunction("delegateCommand", actor, "operateUI", points.available, points.limit, points.inSTR, points.inVIT, points.inDEX, points.inINT, points.inMIN, points.inPIT); --player:RunEventFunction("delegateCommand", actor, "operateUI", points.available, points.limit, points.inSTR, points.inVIT, points.inDEX, points.inINT, points.inMIN, points.inPIT);
result = callClientFunction(player, "delegateCommand", actor, "operateUI", 100, 100, 10, 10, 10, 10, 10, 10); result = callClientFunction(player, "delegateCommand", actor, "operateUI", 100, 100, 10, 10, 10, 10, 10, 10);

View File

@@ -1,90 +1,6 @@
require("global"); function onEventStarted(player, caller, commandRequest, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
--[[
ChangeJobCommand Script player:SetCurrentJob(17);
Called when the player equips/unequips a job stone or uses the /job command.
--]]
local classToJob = { -- [classId] = {jobId, jobAnim, jobKeyItem}
[2] = {15, 0x4000028, 2000202}, -- PGL -> MNK
[3] = {16, 0x4000029, 2000201}, -- GLD -> PLD
[4] = {17, 0x4000027, 2000203}, -- MRD -> WAR
[7] = {18, 0x400002D, 2000205}, -- ARC -> BRD
[8] = {19, 0x400002C, 2000204}, -- LNC -> DRG
[22] = {26, 0x400002B, 2000207}, -- THM -> BLM
[23] = {27, 0x400002A, 2000206}, -- CNJ -> WHM
}
local jobToClass = { -- [jobId] = classId
[15] = 2, -- MNK -> PGL
[16] = 3, -- PLD -> GLD
[17] = 4, -- WAR -> MRD
[18] = 7, -- BRD -> ARC
[19] = 8, -- DRG -> LNC
[26] = 22, -- BLM -> THM
[27] = 23 -- WHM -> CNJ
}
function onEventStarted(player, command, eventType, eventName, jobState)
local currentClass = player:GetCurrentClassOrJob();
local jobCheck = isJob(currentClass);
local hasKeyItem = false;
if (jobCheck == false) then
hasKeyItem = player:GetItemPackage(INVENTORY_KEYITEMS):HasItem(classToJob[currentClass][3]);
end
if (jobCheck ~= nil) then -- Valid Class/Job ids only
if (jobState == 0) then -- Toggle current class/job state
if ((jobCheck == false) and (hasKeyItem == true)) then
setPlayerJob(player, classToJob[currentClass][1], classToJob[currentClass][2]);
elseif (jobCheck == true) then
setPlayerClass(player, jobToClass[currentClass])
end
elseif (jobState == 1 and (jobCheck == false) and (hasKeyItem == true)) then -- Equipping Job stone
setPlayerJob(player, classToJob[currentClass][1], classToJob[currentClass][2]);
elseif (jobState == 2 and (jobCheck == true)) then -- Removing Job stone
setPlayerClass(player, jobToClass[currentClass]);
end
end
player:EndEvent(); player:EndEvent();
end
function setPlayerClass(player, id)
player:SetCurrentJob(0);
player:PrepareClassChange(id);
player:DoClassChange(id);
player:PlayAnimation(0x4001030);
player:SendGameMessage(player, GetWorldMaster(), 30103, 0x20, 0, 0, player, id);
end
function setPlayerJob(player, id, anim)
player:SetCurrentJob(id);
player:PrepareClassChange(id);
player:DoClassChange(jobToClass[id]);
player:PlayAnimation(anim);
player:SendGameMessage(player, GetWorldMaster(), 30103, 0x20, 0, 0, player, id);
end
function isJob(id)
local validId = {
[2] = 0, [3] = 0, [4] = 0, [7] = 0, [8] = 0, [22] = 0, [23] = 0,
[15] = 1, [16] = 1, [17] = 1, [18] = 1, [19] = 1, [26] = 1, [27] = 1
}
if (validId[id] == 0) then
return false;
elseif (validId[id] == 1) then
return true;
else
return nil;
end
end end

View File

@@ -6,7 +6,7 @@ Handles player examining someone
--]] --]]
function onEventStarted(player, commandactor, eventType, eventName, arg1, arg2, arg3, arg4, checkedActorId) function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
actor = player:GetActorInInstance(checkedActorId); actor = player:GetActorInInstance(checkedActorId);

View File

@@ -6,43 +6,44 @@ Handles mounting and dismounting the Chocobo and Goobbue
--]] --]]
require ("global") function onEventStarted(player, actor, triggerName, isGoobbue)
function onEventStarted(player, actor, eventType, eventName, isGoobbue) if (player:GetState() == 0) then
if (player:GetState() == 0) then
worldMaster = GetWorldMaster();
worldMaster = GetWorldMaster();
if (isGoobbue ~= true) then
if (isGoobbue ~= true) then player:ChangeMusic(83);
player:ChangeMusic(83, MUSIC_FADEIN); player:SendGameMessage(player, worldMaster, 26001, 0x20);
player:SendGameMessage(player, worldMaster, 26001, 0x20); player:SetMountState(1);
player:SetMountState(1); else
else player:ChangeMusic(98);
player:ChangeMusic(98, MUSIC_FADEIN); player:SendGameMessage(player, worldMaster, 26019, 0x20);
player:SendGameMessage(player, worldMaster, 26019, 0x20); player:SetMountState(2);
player:SetMountState(2); end
end
player:ChangeSpeed(0.0, 5.0, 10.0, 10.0);
player:ChangeSpeed(0.0, 3.6, 9.0, 9.0); player:ChangeState(15);
player:ChangeState(15); else
else player:ChangeMusic(player:GetZone().bgmDay);
player:ChangeMusic(player.currentArea.bgmDay, MUSIC_FADEIN);
worldMaster = GetWorldMaster();
worldMaster = GetWorldMaster();
if (player.rentalExpireTime != 0) then
if (player.rentalExpireTime != 0) then player:SendGameMessage(player, worldMaster, 26004, 0x20); --You dismount.
player:SendGameMessage(player, worldMaster, 26004, 0x20); --You dismount. else
else if (player:GetMountState() == 1) then
if (player:GetMountState() == 1) then player:SendGameMessage(player, worldMaster, 26003, 0x20); --You dismount X.
player:SendGameMessage(player, worldMaster, 26003, 0x20); --You dismount X. else
else player:SendGameMessage(player, worldMaster, 26021, 0x20); --You dismount your Gobbue.
player:SendGameMessage(player, worldMaster, 26021, 0x20); --You dismount your Gobbue. end
end end
end
player:SetMountState(0);
player:SetMountState(0); player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0) player:ChangeState(0);
player:ChangeState(0); end
end
player:EndEvent(); player:EndEvent();
end end

View File

@@ -124,7 +124,7 @@ local weaponskillHandlers = {
[0xA0F070EA] = nil [0xA0F070EA] = nil
} }
function onEventStarted(player, command, eventType, eventName) function onEventStarted(player, command, triggerName)
--Are they in active mode? --Are they in active mode?
if (player:GetState() != 2) then if (player:GetState() != 2) then
@@ -133,8 +133,8 @@ function onEventStarted(player, command, eventType, eventName)
return; return;
end end
if (weaponskillHandlers[command.Id] ~= nil) then if (weaponskillHandlers[command.actorId] ~= nil) then
weaponskillHandlers[command.Id](player); weaponskillHandlers[command.actorId](player);
else else
player:SendMessage(0x20, "", "That weaponskill is not implemented yet."); player:SendMessage(0x20, "", "That weaponskill is not implemented yet.");
end end

View File

@@ -6,7 +6,7 @@ Handles what happens when you resolve an invite to a group
--]] --]]
function onEventStarted(player, actor, eventType, eventName, groupType, result) function onEventStarted(player, actor, triggerName, groupType, result)
--Accept/Refuse happened, else just close the window --Accept/Refuse happened, else just close the window
if (result == 1 or result == 2) then if (result == 1 or result == 2) then

View File

@@ -6,7 +6,7 @@ Handles what happens when you accept/refuse a trade
--]] --]]
function onEventStarted(player, actor, eventType, eventName, groupType, result) function onEventStarted(player, actor, triggerName, groupType, result)
--Accept --Accept
if (result == 1) then if (result == 1) then

View File

@@ -11,36 +11,47 @@ loadTextData()
Params: None Params: None
start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8) start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8)
Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another
for local leve "requested items" mode. for local leve "requested items" mode.
Params: * facility - The current facility id buff the player may have. Params: * facility/widgetMode - The current facility id buff the player may have. After opening a recipe tab, start() has to be called with this
* requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode. set to -1. After the player chooses a recipe, start() has to be called with this set to -2.
* material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash. * requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode.
* material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash.
closeCraftStartWidget() closeCraftStartWidget()
Desc: Closes the Craft Start widget. Desc: Closes the Craft Start widget.
Params: None Params: None
selectRcp(itemId) selectRcp(item1, item2, item3, item4, item5, item6, item7, item8)
Desc: Selects the recipe to be crafted. May be a legacy function but still required to properly initialize the UI. Requires start() to have Desc: Opens a recipe selection window. If one recipe is provided, automatically selects that recipe.
been called. Params: * itemId1-8 - The itemIDs to show in the list. If only one provided, select it.
Params: * itemId - The itemID of the item to be crafted.
confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility) confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility)
Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first. Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first.
Params: * craftedItem - The itemID of the item to be crafted. Params: * craftedItem - The itemID of the item to be crafted.
* quantity - Quantity of crafted items. * quantity - Quantity of crafted items.
* crystalItem1 - The first required crystal itemID for crafting. * crystalItem1 - The first required crystal itemID for crafting.
* crystalQuantity1 - Quantity of the first crystal. * crystalQuantity1 - Quantity of the first crystal.
* crystalItem2 - The second required crystal itemID for crafting. * crystalItem2 - The second required crystal itemID for crafting.
* crystalQuantity2 - Quantity of the second crystal. * crystalQuantity2 - Quantity of the second crystal.
* recommendedSkill - Which itemID to display under the "Recommended Skill" panel. * recommendedSkill - Which itemID to display under the "Recommended Skill" panel.
* recommendedFacility - Which facility to display under the "Recommended Facility" panel. * recommendedFacility - Which facility to display under the "Recommended Facility" panel.
selectCraftQuest() selectCraftQuest()
Desc: Opens the journal to select the local leve that the player would like to do. Desc: Opens the journal to select the local leve that the player would like to do.
Params: None Params: None
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID -
* craftedItem -
* ?
* ?
* itemsCompleted -
* remainingMaterials -
* ?
* ?
askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts) askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts)
Desc: Opens the dialog to continue crafting for a local leve after an item was completed. Desc: Opens the dialog to continue crafting for a local leve after an item was completed.
Params: * localLeveID - The id of the current leve in progress. Params: * localLeveID - The id of the current leve in progress.
@@ -68,7 +79,7 @@ craftCommandUI(classID, hasWait, command1, command2, command3, command4, command
* command1-5 - Five possible crafting commands (crafting skills). * command1-5 - Five possible crafting commands (crafting skills).
craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8) craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8)
Desc: Displays a full list of commands for the legacy "Tuning" phase that happens after crafting. Deprecated in 1.23b. Desc: Displays only the provided commands for the "Double Down" phase that happens after crafting.
Params: * command1-8 - The list of commands available. Params: * command1-8 - The list of commands available.
updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance) updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance)
@@ -89,17 +100,6 @@ cfmQst()
Desc: Quest confirmation window for when starting a crafting quest from the journal. Desc: Quest confirmation window for when starting a crafting quest from the journal.
Params: Params:
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID - The quest id of the leve you are confirming.
* difficulty - Changes the objective.
* craftedItem? -
* ? -
* numSuccess - The number of successful crafts you did.
* remainingMaterials - The number of materials you have left.
* hasMaterials - Shows the in-progress panel of successes and attempts left.
* ? -
startRepair(craftMode, item, quality, durability, hasMateria, spiritbind) startRepair(craftMode, item, quality, durability, hasMateria, spiritbind)
Desc: Opens the repair item widget. Desc: Opens the repair item widget.
Params: * craftMode - Either 0 or 1. Anything else crashes. Params: * craftMode - Either 0 or 1. Anything else crashes.
@@ -133,289 +133,214 @@ Class ID + Starting skill
35 ALC = 22586 35 ALC = 22586
36 CUL = 22592 36 CUL = 22592
Leve objectives/rewards are in passiveGL_craft.
* Index 1:
* Index 2: Recommended Class
* Index 3: Issuing Authority
* Index 7: Levequest Location
* Index 8: Deliver Display Name
* Starts at index 14. Four sections for the four difficulties.
* Required Item, Amount, ?, Recommended Level, , Reward Item, Reward Amount, |
--]] --]]
require ("global") require ("global")
local skillAnim = {
skillAnim = {
[22553] = 0x10002000; [22553] = 0x10002000;
[22554] = 0x10001000; [22554] = 0x10001000;
[22555] = 0x10003000; [22555] = 0x10003000;
[29531] = 0x10009002; [29531] = 0x10009002;
} }
local craftStartWidgetOpen = false;
function onEventStarted(player, commandactor, eventType, eventName, arg1, arg2, arg3, arg4, checkedActorId) materialSlots = {0,0,0,0,0,0,0,0}; -- The 8 slots
local MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3; recentRecipe = {10008205, 4030706, 4070009} -- Recent Recipe list
local MENU_RECENT, MENU_AWARDED, MENU_RECENT_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10; awardedRecipe = {7020105, 7030011} -- Awarded Recipe list
materialRecipe = { -- Always 8 params because we can't have any nils here for "start" command
[6071007] = {4070402, 4070309,0,0,0,0,0,0},
[10008205] = {10008005,10008005,0,0,0,0,0,0},
[10009617] = {4040009, 4040010, 4040011,0,0,0,0,0},
[4070009] = {4070006, 10005401, 10008203,0,0,0,0,0},
[4070010] = {10008204,10008106,10005302,0,0,0,0,0}
}
materialQuest = { -- What a quest or leve will preload slots with, in addition to any extras the player does manual
[0] = {0,0,0,0,0,0,0,0},
[1] = {0,0,0,0,0,0,0,0},
[110442] = {11000075, 11000074, 0, 0, 0, 0, 0, 0}
}
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3;
MENU_RECIPE, MENU_AWARDED, MENU_RECIPE_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
local debugMessage = true; debugMessage = false;
local isRecipeRecentSent = false; isRecipeRecentSent = false;
local isRecipeAwardSent = false; isRecipeAwardSent = false;
detailWindow = true;
local craftJudge = GetStaticActor("CraftJudge"); isRequested = false; -- False = The default state. True = User picked a quest recipe/local leve
local recipeResolver = GetRecipeResolver(); facilityId = 0;
chosenQuest = 0; -- Use this to store any chosen recipe/local leve
recipeDetail = 0;
detailWindowState = 0;
craftJudge = GetStaticActor("CraftJudge");
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
chosenOperation = -1;
local operationResult; while chosenOperation ~= 0 do
local operationMode = -1;
local recipeMode = -1; player:ChangeState(30);
local chosenMaterials;
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: "..tostring(chosenOperation).." Recipe : "..tostring(recipeMode).." Quest : "..chosenQuest); end
local facilityId = 0;
local isRequestedItemsMode = false; -- False = The default state. True = User picked a quest recipe/local leve
local recentRecipes; if materialQuest[chosenQuest] then
local awardedRecipes; if debugMessage then player:SendMessage(0x20, "", "Key is valid: "..chosenQuest); end
materialSlots = materialQuest[chosenQuest];
local currentCraftQuest = nil; -- Use this to store any chosen craft quest else
local currentCraftQuestGuildleve = nil; -- Use this to store any chosen local leve if debugMessage then player:SendMessage(0x20, "", "Key is not valid: "..chosenQuest); end
end
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
player:ChangeState(30);
if isRecipeRecentSent == false then -- If Recipe button not hit, aka default state.
while operationMode ~= 0 do chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequested, unpack(materialSlots)); -- Initial window
-- Figure out the prepped materials.
local prepedMaterials = {0,0,0,0,0,0,0,0};
-- Quest requested mode materials
if (isRequestedItemsMode == true) then
prepedMaterials = recipeResolver.RecipeToMatIdTable(currentCraftQuestGuildleve.getRecipe());
-- Recent Recipes/Awarded recipes materials
elseif ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and recipeMode != 0) then
if (operationMode == MENU_RECENT) then
prepedMaterials = recipeResolver.RecipeToMatIdTable(recentRecipes[recipeMode]);
else
prepedMaterials = recipeResolver.RecipeToMatIdTable(awardedRecipes[recipeMode]);
end
end
-- Set this param correctly
local facilityIdParam = facilityId;
if ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and recipeMode != 0) then
facilityIdParam = -2;
elseif (craftStartWidgetOpen == true) then
craftStartWidgetOpen = true;
facilityIdParam = -1;
end
-- Run start and grab the result operation/recipeMode/prepped
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityIdParam, isRequestedItemsMode, unpack(prepedMaterials))};
operationMode = operationResult[1];
recipeMode = operationResult[2];
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: " .. tostring(operationMode) .. ", RecipeMode : " .. recipeMode); end
-- Operation
if operationMode == MENU_CANCEL then
closeCraftStartWidget(player, craftJudge, commandactor);
elseif (operationMode == MENU_MAINHAND or operationMode == MENU_OFFHAND) then
-- Recipe choosing loop
while (true) do
-- Figure out the number of preloaded mats
local materials = {};
-- Handle the possible args returned: Either 0 player items, 1 player item, 2+ palyer items. The rest is always the remaining prepped items.
if (type(operationResult[3]) == "number") then
materials = {unpack(operationResult, 3)};
elseif (type(operationResult[3]) ~= "number") then
for i=1,8 do
if (i - 1 < operationResult[3].numItems) then
materials[i] = player:GetItemPackage(operationResult[3].itemPackages[i-1]):GetItemAtSlot(operationResult[3].itemSlots[i-1]).itemId;
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(materials[i]));
else
materials[i] = operationResult[3 + (i - operationResult[3].numItems)];
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(materials[i]));
end
end
end
-- Choosing a recipe from the given materials
local recipes = recipeResolver.GetRecipeFromMats(unpack(materials));
local itemIds = recipeResolver.RecipesToItemIdTable(recipes);
-- No recipes found
if (#itemIds == 0) then
player:SendGameMessage(GetWorldMaster(), 40201, 0x20); -- You cannot synthesize with those materials.
break;
end
local chosenRecipeIndex = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds));
-- Hit back on recipe list
if (chosenRecipeIndex <= 0) then break end;
chosenRecipe = recipes[chosenRecipeIndex-1];
if (chosenRecipe ~= nil) then
-- Player confirms recipe
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
chosenRecipe.resultItemID,
chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
if recipeConfirmed then elseif isRecipeRecentSent == true and recipeMode == 0 then -- If recipe window/award tab was hit
closeCraftStartWidget(player, craftJudge, commandactor); chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequested, unpack(materialSlots)); -- Keep window going
isRecipeRecentSent = false;
isRecipeAwardSent = false; elseif isRecipeRecentSent == true and recipeMode > 0 then -- If recipe item picked
if recipeDetail then
-- CRAFTING STARTED chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, unpack(recipeDetail)); -- Item mat(s) for picked item.
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, currentCraftQuestGuildleve, 80, 100, 50); else
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, 10009617,0,0,0,0,0,0,0); -- Show dummy info for unfilled item
--Once crafting is over, return to the original non-quest state. end
isRequestedItemsMode = false; end
currentCraftQuestGuildleve = nil;
currentCraftQuest = nil;
if chosenOperation == MENU_CANCEL then
break; callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
end
end
end elseif (chosenOperation == MENU_MAINHAND or chosenOperation == MENU_OFFHAND) then
-- End of Recipe choosing loops
elseif operationMode == MENU_REQUEST then -- Conditional button label based on isRequestedItemsMode if isRequested == true then
closeCraftStartWidget(player, craftJudge, commandactor); recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617);
else
if isRequestedItemsMode == false then -- "Request Items" hit, close Start and open up the Quest select recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617,6071007,5030112,5030007,10009617,6071007,5030112,5030007);
end
if recipeResult == 0 then -- Closed/Return hit.
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
currentlyCrafting = -1;
elseif (recipeResult >= 1 or recipeResult <= 8) then
--item yld, xstal1, qty, xstal2, qty
recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0);
if recipeConfirmed then
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, chosenOperation, isRequested, 80, 100, 50);
end
end
elseif chosenOperation == MENU_REQUEST then -- Conditional button label based on isRequested
if isRequested == false then -- "Request Items" hit, close Start and open up the Quest select
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false; isRecipeRecentSent = false;
isRecipeAwardSent = false; isRecipeAwardSent = false;
local quest = getCraftQuest(player, craftJudge, commandactor); local questConfirmed, returnedQuest = GetCraftQuest(player, craftjudge, commandactor);
if (quest ~= nil) then chosenQuest = tonumber(returnedQuest);
isRequestedItemsMode = true;
if (quest.isCraftPassiveGuildleve()) then if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Chosen Quest: "..tostring(chosenQuest)); end
currentCraftQuestGuildleve = quest;
else if questConfirmed then
currentCraftQuest = quest; isRequested = true;
end end
end
elseif isRequestedItemsMode == true then -- "Normal Synthesis" button hit
isRequestedItemsMode = false; elseif isRequested == true then -- "Normal Synthesis" button hit
currentCraftQuestGuildleve = nil; isRequested = false;
currentCraftQuest = nil; chosenQuest = 0;
end callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
elseif operationMode == MENU_RECENT then -- "Recipes" button hit
end
elseif chosenOperation == MENU_RECIPE then -- "Recipes" button hit
if isRecipeRecentSent == false then if isRecipeRecentSent == false then
recentRecipes = player.GetRecentRecipes(); callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(recentRecipe)); -- Load up recipe list
local itemIds = recipeResolver.RecipesToItemIdTable(recentRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up recipe list
isRecipeRecentSent = true; isRecipeRecentSent = true;
end end
elseif operationMode == MENU_AWARDED then -- "Awarded Recipes" tab hit
recipeDetail = materialRecipe[recentRecipe[recipeMode]];
elseif chosenOperation == MENU_AWARDED then -- "Awarded Recipes" tab hit
if isRecipeAwardSent == false then if isRecipeAwardSent == false then
awardedRecipes = player.GetAwardedRecipes(); callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(awardedRecipe)); -- Load up Award list
local itemIds = recipeResolver.RecipesToItemIdTable(awardedRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up Award list
isRecipeAwardSent = true; isRecipeAwardSent = true;
end end
elseif ((operationMode == MENU_RECENT_DETAILED or operationMode == MENU_AWARDED_DETAILED) and recipeMode > 0) then -- Pop-up for an item's stats/craft mats on a recent recipe
local chosenRecipe = operationMode == MENU_RECENT_DETAILED and recentRecipes[recipeMode-1] or recentRecipes[awardedMode-1]; recipeDetail = materialRecipe[awardedRecipe[recipeMode]];
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
chosenRecipe.resultItemID, elseif (chosenOperation == MENU_RECIPE_DETAILED or chosenOperation == MENU_AWARDED_DETAILED) and recipeMode > 0 then -- Pop-up for an item's stats/craft mats
chosenRecipe.resultQuantity, detailWindowState = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0);
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
-- This should never call? The window with this button only appears when you select a recent recipe with not enough materials. Otherwise it just auto-fills your "table".
if (recipeConfirmed) then
closeCraftStartWidget(player, craftJudge, commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
end
else else
break; break;
end end
end end
player:ResetMusic(); player:ChangeMusic(7); -- Need way to reset music back to the zone's default
player:ChangeState(0); player:ChangeState(0);
player:EndEvent(); player:EndEvent();
end end
-- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command. -- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command.
-- Returns whether a quest was selected, and what id the quest is. -- Returns whether a quest was selected, and what id the quest is.
function getCraftQuest(player, craftJudge, commandactor); function GetCraftQuest(player, craftjudge, commandactor);
local questId = nil;
while (true) do
local questCommandId = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor);
if questCommandId then
questId = questCommandId - 0xA0F00000;
-- Craft Quest Chosen
if isCraftQuest(questId) then
local quest = player.GetQuest(questId);
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, quest.getQuestId(), 20, 1, 1, 1, 0, 0, "<Path Companion>");
if confirm == true then
player:SendGameMessage(craftJudge, 21, 0x20);
return quest;
end
-- PassiveGL Quest Chosen
elseif isLocalLeve(questId) then
local difficulty = 0;
local hasMaterials = 1;
local quest = player:getQuestGuildleve(questId);
if (quest ~= nil) then
-- Did they pickup the materials?
if (quest:hasMaterials() == false) then
player:SendGameMessage(GetWorldMaster(), 40210, 0x20); -- You have not obtained the proper materials from the client.
-- Did they use em all up?
elseif (quest:getRemainingMaterials() == 0) then
player:SendGameMessage(GetWorldMaster(), 40211, 0x20); -- You have used up all of the provided materials.
-- Confirm dialog
else
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor,
quest:getQuestId(),
quest:getCurrentDifficulty() + 1, -- Lua, 1-indexed
0,
quest:getCurrentCrafted(),
quest:getRemainingMaterials(),
quest:hasMaterials() and 1 or 0, -- Fucked up way of doing terneries on Lua
0
);
-- Quest confirmed local questOffset = 0xA0F00000;
if (confirm == true) then local questId = 0;
return quest; local requestState = false;
end local requestedMenuChoice = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor);
end
else if requestedMenuChoice then
return nil; -- Shouldn't happen unless db fucked with questId = requestedMenuChoice - questOffset;
end
-- Scenario Quest Chosen if isCraftQuest(questId) then
else confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, questId, 20, 1, 1, 1, 0, 0, "<Path Companion>");
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
player:SendGameMessage(GetWorldMaster(), 40209, 0x20); -- You cannot undertake that endeavor. if confirm == true then
end requestState = true;
else player:SendGameMessage(craftJudge, 21, 0x20);
return nil; end
end
end elseif isLocalLeve(questId) then
confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor, questId, 0, 8030421, 5, 50, 0, 0);
if confirm == true then
requestState = true;
itemSlots = { unpack(materialRecipe[4070010])};
end
elseif isScenarioQuest(questId) == true then
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
player:SendGameMessage(GetWorldMaster(), 40209, 0x20);
end
end
return requestState, questId;
end end
function isScenarioQuest(id) function isScenarioQuest(id)
if (id >= 110001 and id <= 120026) then if (id >= 110001 and id <= 120026) then
return true; return true;
else else
@@ -434,6 +359,7 @@ end
function isLocalLeve(id) function isLocalLeve(id)
if (id >= 120001 and id <= 120452) then if (id >= 120001 and id <= 120452) then
return true; return true;
else else
@@ -441,73 +367,58 @@ function isLocalLeve(id)
end end
end end
function closeCraftStartWidget(player, craftJudge, commandactor)
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
craftStartWidgetOpen = false;
end
-- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level. -- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level.
function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, startDur, startQly, startHQ) function startCrafting(player, hand, quest, startDur, startQly, startHQ)
local worldMaster = GetWorldMaster(); local worldMaster = GetWorldMaster();
local progress = 0; local craftProg = 0;
local attempts = 5; local attempts = 5;
local craftedCount = 0; local craftedCount = 0;
local craftTotal = 2; local craftTotal = 2;
local itemId = 10009617;
player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out
player:ChangeMusic(73); player:ChangeMusic(73);
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
while (true) do while true do
local progDiff = math.random(30,50);
local progDiff = math.random(25,25);
local duraDiff = math.random(1,3); local duraDiff = math.random(1,3);
local qltyDiff = math.random(0,2); local qltyDiff = math.random(0,2);
if (progress >= 100) then if craftProg >= 100 then
testChoice2 = callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, 100, 10, 20, 5020111, 69, 70, 75);
-- From Lodestone: If the HQ odds are 1% or better, players will have the option of selecting either Finish or Double Down.
-- By electing to double down, the player takes a chance on creating an HQ item at the risk of losing the completed item if the attempt fails
testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 22503, 22504);
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8); -- "You create <#3 quantity> <#1 item> <#2 quality>."
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor); callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor);
-- Handle local levequest craft success if quest then
if quest then continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalLeve", 120001, itemId, craftedCount, craftTotal, attempts);
quest:craftSuccess();
if (quest:getCurrentCrafted() >= quest:getObjectiveQuantity()) then
attentionMessage(player, 40121, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "All items for <QuestId> complete!"
else
attentionMessage(player, 40119, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "<QuestId> Successfull. (<crafted> of <attempts>)"
end
-- Continue local levequest (should this be in here??)
if (quest:getRemainingMaterials() ~= 0) then
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalleve", commandactor,
quest:getQuestId(),
quest:getRecipe().resultItemID,
quest:getCurrentCrafted(),
quest:getObjectiveQuantity(),
quest:getRemainingMaterials()
);
if (continueLeve == 1) then if continueLeve == true then
progress = 0; craftProg = 0;
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
else else
break; break;
end end
else else
break; break;
end
-- Normal synth craft success
else
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, recipe.resultItemID, 1, recipe.resultQuantity); -- "You create <#3 quantity> <#1 item> <#2 quality>."
player:getItemPackage(location):addItem(recipe.resultItemID, recipe.resultQuantity, 1);
break;
end end
end end
choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534); choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534);
--player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice); --player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice);
if (choice) then
if choice then
if skillAnim[choice] then if skillAnim[choice] then
player:PlayAnimation(skillAnim[choice]); player:PlayAnimation(skillAnim[choice]);
@@ -517,11 +428,11 @@ function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, st
player:SendGameMessage(worldMaster, 40108, 0x20, choice,2); player:SendGameMessage(worldMaster, 40108, 0x20, choice,2);
if (choice ~= 29531) then if choice ~= 29531 then
progress = progress + progDiff; craftProg = craftProg + progDiff;
if (progress >= 100) then if craftProg >= 100 then
progress = 100; craftProg = 100;
end end
startDur = startDur - duraDiff; startDur = startDur - duraDiff;
@@ -532,9 +443,12 @@ function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, st
player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff); player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff);
end end
--prg dur qly, ???, ???, ???, HQ --prg dur qly, ???, ???, ???, HQ
callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, progress, startDur, startQly, nil, nil, nil, nil, nil); callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, craftProg, startDur, startQly, nil, nil, nil, nil, nil);
--testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 29501, 24233, 29501,29501, 24223, 29501,12008,12004);
end end
end end
end
return -1;
end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -9,7 +9,7 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
--]] --]]
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
--Are they in active mode? --Are they in active mode?
if (player:GetState() != 2) then if (player:GetState() != 2) then
@@ -21,6 +21,6 @@ function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3,
if not player.aiContainer.IsEngaged() then if not player.aiContainer.IsEngaged() then
player.Engage(targetActor); player.Engage(targetActor);
end; end;
player.WeaponSkill(command.Id, targetActor); player.WeaponSkill(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -4,7 +4,7 @@ DiceCommand Script
--]] --]]
function onEventStarted(player, actor, eventType, eventName, maxNumber) function onEventStarted(player, actor, triggerName, maxNumber)
if (maxNumber == nil or maxNumber > 1000 or maxNumber < 1) then if (maxNumber == nil or maxNumber > 1000 or maxNumber < 1) then
maxNumber = 100; maxNumber = 100;

View File

@@ -62,59 +62,67 @@ rangeInputWidget()
* goodMin * goodMin
* goodMax * goodMax
* bool * bool
Notes:
* Aim = Where on the aim gauge the player chose.
* Remainder = How many attempts you get on the section portion of the minigame
* Sweetspot = Where you hit on the second portion of the minigame
--]] --]]
minerAnim = {0x14001000, 0x14002000, 0x14003000}; minerAnim = {0x14001000, 0x14002000, 0x14003000};
--[[Mooglebox - Aim --[[ Mooglebox - Aim
+5 = 0 +5 +4 +3 +2 +1 0 -1 -2 -3 -4 -5
+4 = 10 0 10 20 30 40 50 60 70 80 90 100
+3 = 20
+2 = 30
+1 = 40
0 = 50
-1 = 60
-2 = 70
-3 = 80
-4 = 90
-5 = 100
Sweetspots 1=10 2=30 3=70 4=100 for Mining Sweetspots 1=10 2=30 3=70 4=100 for Mining
remainder A=40 B=60 C=70 D=80 Remainder A=40 B=60 C=70 D=80
--]] --]]
nodeContainer = { -- harvestAttempts, #ofItemsBecauseLuaIsShitAtTableLength, Item1, Item2, etc harvestNodeContainer = { -- nodeGrade, harvestAttempts, #ofItemsBecauseICantIntoIpairs, Item1, Item2, etc
[1] = {4, 3, 1, 2, 3} [1001] = {2, 2, 3, 1, 2, 3},
[1002] = {2, 4, 5, 3005, 3003, 3002, 3001, 3004}
} }
nodeItems = { harvestNodeItems = {
--itemId, remainder, aim, sweetspot, max yield --itemId, remainder, aim, sweetspot, max yield
[1] = {10009104, 70, 30, 30, 4}, -- Rock Salt [1] = {10009104, 70, 30, 30, 4}, -- Rock Salt
[2] = {10006001, 80, 10, 30, 4}, -- Bone Chip [2] = {10006001, 80, 10, 30, 4}, -- Bone Chip
[3] = {10001006, 80, 20, 30, 3} -- Copper Ore [3] = {10001006, 80, 20, 30, 3}, -- Copper Ore
[3001] = {10001003, 80, 50, 30, 3},
[3002] = {10001006, 70, 70, 10, 4},
[3003] = {10001005, 80, 90, 70, 1},
[3004] = {10009104, 40, 10, 100, 2},
[3005] = {10001007, 40, 0, 30, 1}
} }
require ("global") require ("global")
function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2, arg3, arg4, checkedActorId) function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
debugMsg = false; debugMsg = false;
powerCurrent = 0;
powerLast = 0;
powerRange = 10; -- 'Feels' look a good amount compared to vids/ARR's minigame.
showTutorial = 0;
commandMine = 22002; commandMine = 22002;
commandLog = 22003; commandLog = 22003;
commandFish = 22004; commandFish = 22004;
remainderA, remainderB, remainderC, remainderD = 40, 60, 70, 80;
harvestNodeId = 1001; -- What the server should send eventually
currentPower = 0; harvestNode = BuildHarvestNode(player, harvestNodeId); -- [1-11] = {itemId, remainder, sweetspot, maxYield}
nodeGrade = 3; harvestGrade = harvestNodeContainer[harvestNodeId][1] or 0;
showTutorial = 0; harvestAttempts = harvestNodeContainer[harvestNodeId][2] or 0;
harvestAttempts = 2; nodeRemainder = 0;
nodeRemainder = remainderC;
item = 10001006;
harvestType = commandMine; harvestType = commandMine;
@@ -126,12 +134,12 @@ function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2,
player:ChangeState(50); player:ChangeState(50);
if harvestType == commandMine then if harvestType == commandMine then
player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, nodeGrade); player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, harvestGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, nodeGrade); callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, harvestGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0); callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
@@ -139,22 +147,42 @@ function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2,
while harvestAttempts > 0 do while harvestAttempts > 0 do
-- "Aim", 0 = Top of bar, 100 = Bottom. Mooglebox conversion is +5 = 0, 0 = 50, -5 = 100 -- "Aim", 0 = Top of bar, 100 = Bottom.
menuResult, sliderPhase, ret3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false); menuResult, sliderPhase, unk3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false);
if debugMsg then player:SendMessage(0x20, "", "menuResult: "..tostring(menuResult).." sliderPhase: "..tostring(sliderPhase).." Unk: "..tostring(unk3)); end
if debugMsg then player:SendMessage(0x20, "", tostring(menuResult).." unk: "..tostring(sliderPhase).." unk: "..tostring(ret3)); end
if menuResult == 22701 then -- Begin. if menuResult == 22701 then -- Begin.
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM);
nodeRemainder = remainderC; local aimSlot = (sliderPhase/10)+1; -- Thanks LUA index = 1
local nodeDetails = harvestNode[aimSlot];
local nodeItem = nodeDetails[1];
local nodeRemainder = nodeDetails[2];
local nodeSweetspot = nodeDetails[3];
local nodeYield = nodeDetails[4];
local isFirstSwing = true;
local sweetspotDifference;
local sweetspotDifferencePrevious;
if debugMsg then
player:SendMessage(0x20, "", "aimSlot: "..(aimSlot).." itemId:"..tostring(nodeDetails[1]).." remainder: "..tostring(nodeDetails[2]));
end
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM); -- "You set your sights on an area."
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
while true do while true do
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
-- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining -- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining
chosenCommand, currentPower = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike chosenCommand, powerCurrent = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike
if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(powerCurrent)); end
if chosenCommand == 22702 then -- Cancel. if chosenCommand == 22702 then -- Cancel.
@@ -168,23 +196,64 @@ function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2,
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
break; break;
elseif chosenCommand == 22703 then -- Strike. elseif chosenCommand == 22703 then -- Strike.
player:PlayAnimation(minerAnim[math.random(1,3)]);
nodeRemainder = nodeRemainder - 20; nodeRemainder = nodeRemainder - 20;
if nodeRemainder < 0 then if nodeRemainder < 0 then
nodeRemainder = 0; nodeRemainder = 0;
end end
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
player:PlayAnimation(minerAnim[math.random(1,3)]);
wait(2);
sweetspotDifference = math.abs(powerCurrent - nodeSweetspot);
if powerRange >= sweetspotDifference then
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
-- "You obtain <yield> <item> <quality>"
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, nodeItem, 0, nodeYield, 0);
player:SendGameMessage(player, worldMaster, 40301, MESSAGE_TYPE_SYSTEM, player, nodeItem, nodeYield); -- TODO: Refer to caps to see wtf is going on here
HarvestReward(player, nodeItem, nodeYield);
nodeRemainder = 0;
else
if isFirstSwing then
if sweetspotDifference < 19 then -- TODO: TWEAK THESE, likely need to be larger
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 45);
player:SendGameMessage(harvestJudge, 45, MESSAGE_TYPE_SYSTEM); -- "You feel something promising."
elseif sweetspotDifference > 20 then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
else
if sweetspotDifference > sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 43);
player:SendGameMessage(harvestJudge, 43, MESSAGE_TYPE_SYSTEM); -- "You are getting farther from the mark."
elseif sweetspotDifference < sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 44);
player:SendGameMessage(harvestJudge, 44, MESSAGE_TYPE_SYSTEM); -- "You are getting closer to the mark."
else
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
end
end
if not isFirstSwing then
powerLast = powerCurrent;
end;
--player:SendGameMessage(harvestJudge, 25, MESSAGE_TYPE_SYSTEM, item, 4, 1);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, item, 4, 1, 0);
if nodeRemainder == 0 then if nodeRemainder == 0 then
harvestAttempts = harvestAttempts - 1; harvestAttempts = harvestAttempts - 1;
@@ -193,13 +262,20 @@ function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2,
player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts);
else else
-- There is nothing left to gather at this location. -- There is nothing left to gather at this location.
player:ChangeMusic(101);
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
wait(2); wait(2);
break; break;
end end
if isFirstSwing and debugMsg then player:SendMessage(0x20, "", "First swing"); end
isFirstSwing = false;
sweetspotDifferencePrevious = sweetspotDifference;
elseif chosenCommand == 22710 then -- "Strike" Tutorial. elseif chosenCommand == 22710 then -- "Strike" Tutorial.
SendTutorial(player, harvestJudge, 2); SendTutorial(player, harvestJudge, 2);
end end
@@ -219,8 +295,12 @@ function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2,
end end
player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM);
if harvestAttempts == 0 then if harvestAttempts == 0 then
player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM); player:SendGameMessage(player, worldMaster, 40310, 0x20); -- "The deposit has been exhausted."
--TO:DO Despawn node + whatever logic to respawn an exsiting expired node in the area.
end end
callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType);
@@ -231,6 +311,67 @@ function onEventStarted(player, commandActor, eventType, eventName, arg1, arg2,
end end
-- Returns a table in the following format: nodeTable = { [1-11] = {itemId, remainder, sweetspot, maxYield} }
function BuildHarvestNode(player, sentNode)
if harvestNodeContainer[sentNode] then
local node = harvestNodeContainer[sentNode];
local nodeTable = {};
local nodeItems = {};
local nodeItemCount = node[3];
local grade = node[1];
local attempts = node[2];
-- Load up nodeItems[] with the harvestNodeItems{} key and Aim point
for i=1, nodeItemCount do
local nodeItemKey = node[3+i];
local item = harvestNodeItems[ node[3+i] ]
nodeItems[i] = { nodeItemKey, ((item[3] / 10)+1) };
if debugMsg then player:SendMessage(0x20, "", "nodeItems: "..nodeItems[i][1].." "..nodeItems[i][2]); end
end
-- Iterate through the 11 Aim spots
for i=1,11,1 do
local hasItem = false;
-- See if there's a nodeItems[] that has an Aim spot that matches the current loop
-- TODO: Just set nodeItems[] keys to the actual slots to skip this loop inside a loop
for j=1, nodeItemCount do
if nodeItems[j][2] == i then
hasItem = j;
break;
end
end
if hasItem then
local item = harvestNodeItems[ nodeItems[hasItem][1] ];
-- Assign itemId, remainder, sweetspot, yield to this slot
nodeTable[i] = {item[1], item[2], item[4], item[5] };
if debugMsg then
player:SendMessage(0x20, "", "nodeTable: "..i.." "..nodeTable[i][1].." "..nodeTable[i][2].." "..nodeTable[i][3].." "..nodeTable[i][3]);
end
else
nodeTable[i] = {0,0,0,0};
if debugMsg then player:SendMessage(0x20, "", "nodeTable: "..i); end
end
end
return nodeTable
end
end
function SendTutorial(player, harvestJudge, id) function SendTutorial(player, harvestJudge, id)
if id == 1 then if id == 1 then
@@ -247,4 +388,24 @@ function SendTutorial(player, harvestJudge, id)
player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM); player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM);
end end
end
function HarvestReward(player, item, qty) -- Really should get a helper function for this
local worldMaster = GetWorldMaster();
local location = INVENTORY_NORMAL;
local invCheck = player:getItemPackage(location):addItem(item, qty, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, worldMaster, 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, worldMaster, 40279, MESSAGE_TYPE_SYSTEM_ERROR, item, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
--player:SendMessage(MESSAGE_TYPE_SYSTEM, "", message);
player:SendGameMessage(player, worldMaster, 25246, MESSAGE_TYPE_SYSTEM, item, qty);
end
end end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -4,7 +4,7 @@ EmoteSitCommand Script
--]] --]]
function onEventStarted(player, actor, eventType, eventName, emoteId) function onEventStarted(player, actor, triggerName, emoteId)
if (player:GetState() == 0) then if (player:GetState() == 0) then
if (emoteId == 0x2712) then if (emoteId == 0x2712) then

View File

@@ -66,7 +66,7 @@ emoteTable = {
}; };
function onEventStarted(player, actor, eventType, triggerName, emoteId, showText, arg2, arg3, targetId) function onEventStarted(player, actor, triggerName, emoteId, showText, arg2, arg3, targetId)
if (targetId == nil) then if (targetId == nil) then
targetId = 0; targetId = 0;

View File

@@ -6,7 +6,7 @@ require ("global")
--commandid: command being equipped --commandid: command being equipped
function onEventStarted(player, equipAbilityWidget, eventType, eventName, slot, commandid, unkown, arg1, arg2, arg3, arg4, arg5, arg6) function onEventStarted(player, equipAbilityWidget, triggername, slot, commandid, unkown, arg1, arg2, arg3, arg4, arg5, arg6)
local worldManager = GetWorldManager(); local worldManager = GetWorldManager();
local ability = worldManager:GetBattleCommand(commandid); local ability = worldManager:GetBattleCommand(commandid);

View File

@@ -53,7 +53,7 @@ GRAPHICSLOT_L_RINGFINGER = 24;
GRAPHICSLOT_R_INDEXFINGER = 25; GRAPHICSLOT_R_INDEXFINGER = 25;
GRAPHICSLOT_L_INDEXFINGER = 26; GRAPHICSLOT_L_INDEXFINGER = 26;
function onEventStarted(player, actor, eventType, eventName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds) function onEventStarted(player, actor, triggerName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds)
equipSlot = equipSlot-1; equipSlot = equipSlot-1;
--Equip Item --Equip Item
@@ -174,7 +174,7 @@ function equipItem(player, equipSlot, item)
if (gItem:IsWeaverWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end if (gItem:IsWeaverWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end
if (gItem:IsGoldSmithWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end if (gItem:IsGoldSmithWeapon() == true) then graphicSlot = GRAPHICSLOT_SPOFFHAND; end
end end
--Graphic Slot was set, otherwise it's a special case --Graphic Slot was set, otherwise it's a special case
if (graphicSlot ~= nil) then if (graphicSlot ~= nil) then
player:GraphicChange(graphicSlot, item); player:GraphicChange(graphicSlot, item);

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -6,7 +6,7 @@ Handles moving items across item packages (IE: Taking loot)
--]] --]]
function onEventStarted(player, actor, eventType, eventName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds) function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
player:EndEvent(); player:EndEvent();

View File

@@ -6,7 +6,7 @@ Handles giving an item to another party member.
--]] --]]
function onEventStarted(player, actor, eventType, eventName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds) function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds)
player:EndEvent(); player:EndEvent();

View File

@@ -9,7 +9,7 @@ The param "itemDBIds" has the vars: item1 and item2.
--]] --]]
function onEventStarted(player, actor, eventType, eventName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds) function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot); player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot);
player:EndEvent(); player:EndEvent();
end end

View File

@@ -8,7 +8,7 @@ Fired when you try to abandon a quest
--]] --]]
function onEventStarted(player, command, eventType, eventName, questId) function onEventStarted(player, command, triggerName, questId)
player:AbandonQuest(questId); player:AbandonQuest(questId);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellAppointCommand Script
--]] --]]
function onEventStarted(player, actor, eventType, eventName, linkshellName, memberName, rank) function onEventStarted(player, actor, triggerName, linkshellName, memberName, rank)
GetWorldManager():RequestWorldLinkshellRankChange(player, linkshellName, memberName, rank); GetWorldManager():RequestWorldLinkshellRankChange(player, linkshellName, memberName, rank);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellChangeCommand Script
--]] --]]
function onEventStarted(player, actor, eventType, eventName, linkshellName, arg1, arg2) function onEventStarted(player, actor, triggerName, linkshellName, arg1, arg2)
if (linkshellName == nil) then if (linkshellName == nil) then
linkshellName = ""; linkshellName = "";

View File

@@ -6,7 +6,7 @@ Handles what happens when you cancel an invite to a linkshell
--]] --]]
function onEventStarted(player, actor, eventType, eventName, arg1, arg2, arg3, arg4, actorId) function onEventStarted(player, actor, triggerName, arg1, arg2, arg3, arg4, actorId)
GetWorldManager():RequestWorldLinkshellCancelInvite(player); GetWorldManager():RequestWorldLinkshellCancelInvite(player);
player:EndEvent(); player:EndEvent();

View File

@@ -6,7 +6,7 @@ Handles what happens when you invite a player to a linkshell
--]] --]]
function onEventStarted(player, actor, eventType, eventName, linkshellName, arg1, arg2, arg3, actorId) function onEventStarted(player, actor, triggerName, linkshellName, arg1, arg2, arg3, actorId)
GetWorldManager():RequestWorldLinkshellInviteMember(player, linkshellName, actorId); GetWorldManager():RequestWorldLinkshellInviteMember(player, linkshellName, actorId);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellKickCommand Script
--]] --]]
function onEventStarted(player, actor, eventType, eventName, linkshellName, kickedName) function onEventStarted(player, actor, triggerName, linkshellName, kickedName)
GetWorldManager():RequestWorldLinkshellKick(player, linkshellName, kickedName); GetWorldManager():RequestWorldLinkshellKick(player, linkshellName, kickedName);
player:EndEvent(); player:EndEvent();

View File

@@ -4,7 +4,7 @@ LinkshellLeaveCommand Script
--]] --]]
function onEventStarted(player, actor, eventType, eventName, linkshellName) function onEventStarted(player, actor, triggerName, linkshellName)
GetWorldManager():RequestWorldLinkshellLeave(player, linkshellName); GetWorldManager():RequestWorldLinkshellLeave(player, linkshellName);
player:EndEvent(); player:EndEvent();

View File

@@ -8,7 +8,7 @@ Handles post-dream events.
require ("global") require ("global")
function onEventStarted(player, actor, eventType, eventName, dreamCode, innCode, narg1, narg2, bedActor) function onEventStarted(player, actor, triggerName, dreamCode, innCode, narg1, narg2, bedActor)
--In Plain Sight --In Plain Sight
if (dreamCode == 1) then if (dreamCode == 1) then

View File

@@ -12,7 +12,7 @@ eventLogoutFade()
require ("global") require ("global")
function onEventStarted(player, command, eventType, eventName) function onEventStarted(player, command, triggerName)
choice = callClientFunction(player, "delegateCommand", command, "eventConfirm"); choice = callClientFunction(player, "delegateCommand", command, "eventConfirm");

View File

@@ -40,7 +40,7 @@ updateNegotiationWidget(player, gridIndex, key, itemIconId, pointValue, ?, ?) -
require ("global") require ("global")
function onEventStarted(player, commandactor, eventType, eventName, arg1, arg2, arg3, arg4, arg5) function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, arg5)
negotiationJudge = GetStaticActor("NegotiationJudge"); negotiationJudge = GetStaticActor("NegotiationJudge");

View File

@@ -4,14 +4,42 @@ require ("global")
NpcLinkshellChatCommand Script NpcLinkshellChatCommand Script
Player class will go through all quests and see if there are active msgs for one. If there was, it will Handler for when a player clicks a npc ls to talk to. If adding new linkshells to the handle, make sure to add
return true and that quest must end the event (if needed). Otherwise if nothing caught the event, the it to the handler table (with correct offset), and that your function is above the handler. If padding is needed
event is ended here. to hit some ID, add "nils".
--]] --]]
function onEventStarted(player, command, eventType, eventName, npcLsId)
if (player:HandleNpcLs(npcLsId) == false) then local function handleAdventurersGuild(player)
player:EndEvent(); if (player:HasQuest(110006) == true) then
local man0g1Quest = player:GetQuest("Man0g1");
player:SendGameMessage(man0g1Quest, 330, 39, 1300018, nil);
end end
end end
local function handlePathOfTheTwelve(player)
player:SendMessage(0x20, "", "Test");
end
local npcLsHandlers = {
handleAdventurersGuild,
nil,
nil,
nil,
nil,
handlePathOfTheTwelve
}
function onEventStarted(player, command, triggerName, npcLsId)
if (npcLsHandlers[npcLsId] ~= nil) then
npcLsHandlers[npcLsId](player);
player:SetNpcLS(npcLsId-1, NPCLS_ACTIVE);
else
player:SendMessage(0x20, "", "That Npc Linkshell is not implemented yet.");
end
player:endEvent();
end

View File

@@ -6,7 +6,7 @@ Handles disbanding the party.
--]] --]]
function onEventStarted(player, actor, eventType, eventName) function onEventStarted(player, actor, triggerName)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -15,7 +15,7 @@ TextIds:
--]] --]]
function onEventStarted(player, actor, eventType, eventName, name) function onEventStarted(player, actor, name)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -6,7 +6,7 @@ Handles what happens when you invite
--]] --]]
function onEventStarted(player, actor, eventType, eventName, name, arg1, arg2, arg3, actorId) function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId)
if (name ~= nil) then if (name ~= nil) then
GetWorldManager():CreateInvitePartyGroup(player, name); GetWorldManager():CreateInvitePartyGroup(player, name);

View File

@@ -15,7 +15,7 @@ TextIds:
--]] --]]
function onEventStarted(player, actor, eventType, eventName, name, arg2, arg3, arg4, actorId) function onEventStarted(player, actor, triggerName, name, arg2, arg3, arg4, actorId)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -6,7 +6,7 @@ Handles requesting to change party leader and various errors.
--]] --]]
function onEventStarted(player, actor, eventType, eventName, name, arg2, arg3, arg4, actorId) function onEventStarted(player, actor, triggerName, name, arg2, arg3, arg4, actorId)
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
if (player:IsPartyLeader()) then if (player:IsPartyLeader()) then

View File

@@ -6,7 +6,7 @@ Handles leaving a party
--]] --]]
function onEventStarted(player, actor, eventType, eventName) function onEventStarted(player, actor, triggerName)
player:PartyLeave(name); player:PartyLeave(name);
player:EndEvent(); player:EndEvent();
end end

View File

@@ -27,7 +27,7 @@ markers = { -- [id] = {overheadIcon, textIcon}
} }
function onEventStarted(player, actor, eventType, eventName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6) function onEventStarted(player, actor, triggerName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6)
workName = "charaWork.parameterTemp.targetInformation"; workName = "charaWork.parameterTemp.targetInformation";
uiFunc = "charaWork/stateForAll"; uiFunc = "charaWork/stateForAll";

View File

@@ -8,16 +8,16 @@ Notes:
--]] --]]
require("global") require("global")
function onEventStarted(player, actor, eventType, eventName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7) function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7)
actor = player:GetActorInInstance(ownerActorId); actor = player:GetActorInInstance(ownerActorId);
print("TESSSSSSSSSSSSSST");
harvestCommand = GetStaticActorById(0xA0F055F7);
if (actor != nil) then if (actor != nil) then
if (actor:GetActorClassId() == 1200052) then if (actor:GetActorClassId() == 1200052) then
player:KickEventSpecial(harvestCommand, 0, "commandJudgeMode", 0, 0, 0, 0, 0x4E26, 0, nil, 0xF, actor, nil, nil, nil, nil); player:kickEvent(actor, "commandJudgeMode", "commandJudgeMode");
else else
player:kickEvent(actor, "pushCommand", false); printf("TEST");
player:kickEvent(actor, "pushCommand", "pushCommand");
end end
else else
player:endEvent(); player:endEvent();

View File

@@ -1,7 +1,7 @@
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -1,5 +1,5 @@
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end end

View File

@@ -3,7 +3,7 @@
--]] --]]
function onEventStarted(player, actor, eventType, eventName, questId) function onEventStarted(player, actor, questId)
player:SendDataPacket("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil); player:SendDataPacket("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
-- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526); -- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
end end

View File

@@ -1,30 +1,23 @@
--[[ --[[
RequestQuestJournalCommand Script
Functions: None
Notes:
Fires when the player looks at a quest's journal entry and the map section. Check the quest sheet and quest_marker sheet
for valid entries for your quest.
--]] --]]
function onEventStarted(player, command, eventType, eventName, questId, mapCode) function onEventStarted(player, actor, trigger, questId, mapCode)
local quest = player:GetQuest(questId);
quest = player:GetQuest(questId);
if (quest ~= nil) then if (quest == nil) then
if (mapCode == nil) then player:EndEvent();
-- Get Quest Journal Data return;
local journalInfo = quest:GetJournalInformation(); end
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetSequence(), unpack(journalInfo));
else if (mapCode == nil) then
-- Get Quest Map Data player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase());
local mapMarkers = quest:GetJournalMapMarkerList(); player:EndEvent();
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId(), unpack(mapMarkers)); else
end player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId());
player:EndEvent();
end end
player:EndEvent();
end end

View File

@@ -9,7 +9,7 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
--]] --]]
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Ability(command.Id, targetActor); player.Ability(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -13,7 +13,7 @@ local attackMagicHandlers = {
} }
function onEventStarted(player, command, eventType, eventName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
player.Cast(command.Id, targetActor); player.Cast(command.actorId, targetActor);
player:endEvent(); player:endEvent();
end; end;

View File

@@ -6,7 +6,7 @@ Functions:
eventRegion(numAnima) eventRegion(numAnima)
eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6) eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6)
eventConfirm(isReturn, isInBattle, HomePointInn, HomePoint, forceAskReturnOnly) eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly)
--]] --]]
@@ -15,189 +15,112 @@ require ("aetheryte")
require ("utils") require ("utils")
teleportMenuToAetheryte = { teleportMenuToAetheryte = {
[1] = { [1] = {
[1] = 1280001, [1] = 1280001,
[2] = 1280002, [2] = 1280002,
[3] = 1280003, [3] = 1280003,
[4] = 1280004, [4] = 1280004,
[5] = 1280005, [5] = 1280005,
[6] = 1280006 [6] = 1280006
}, },
[2] = { [2] = {
[1] = 1280092, [1] = 1280092,
[2] = 1280093, [2] = 1280093,
[3] = 1280094, [3] = 1280094,
[4] = 1280095, [4] = 1280095,
[5] = 1280096 [5] = 1280096
}, },
[3] = { [3] = {
[1] = 1280061, [1] = 1280061,
[2] = 1280062, [2] = 1280062,
[3] = 1280063, [3] = 1280063,
[4] = 1280064, [4] = 1280064,
[5] = 1280065, [5] = 1280065,
[6] = 1280066 [6] = 1280066
}, },
[4] = { [4] = {
[1] = 1280031, [1] = 1280031,
[2] = 1280032, [2] = 1280032,
[3] = 1280033, [3] = 1280033,
[4] = 1280034, [4] = 1280034,
[5] = 1280035, [5] = 1280035,
[6] = 1280036 [6] = 1280036
}, },
[5] = { [5] = {
[1] = 1280121, [1] = 1280121,
[2] = 1280122 [2] = 1280122
} }
} }
zoneIdToRegionChoice = function onEventStarted(player, actor, triggerName, isTeleport)
{
[128] = 1, [129] = 1, [130] = 1, [131] = 1, [132] = 1, [133] = 1, [134] = 1, [135] = 1, [230] = 1,
[143] = 2, [144] = 2, [145] = 2, [147] = 2, [148] = 2,
[150] = 3, [151] = 3, [152] = 3, [153] = 3, [154] = 3, [155] = 3, [157] = 3, [158] = 3, [159] = 3, [160] = 3, [206] = 3,
[170] = 4, [171] = 4, [172] = 4, [173] = 4, [174] = 4, [175] = 4, [176] = 4, [178] = 4, [180] = 4, [181] = 4, [209] = 4,
[190] = 5
}
local worldMaster = GetWorldMaster();
function onEventStarted(player, actor, eventType, eventName, isTeleport) if (isTeleport == 0) then
while (true) do
regionChoice = callClientFunction(player, "delegateCommand", actor, "eventRegion", 100);
if (regionChoice == nil) then break end
while (true) do
aetheryteChoice = callClientFunction(player, "delegateCommand", actor, "eventAetheryte", regionChoice, 2, 2, 2, 4, 4, 4);
if (aetheryteChoice == nil) then break end
player:PlayAnimation(0x4000FFA);
player:SendGameMessage(worldMaster, 34101, 0x20, 2, teleportMenuToAetheryte[regionChoice][aetheryteChoice], 100, 100);
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
if (confirmChoice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34105, 0x20);
--Do teleport
destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]];
if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end
end
player:endEvent();
return;
end
end
else
player:PlayAnimation(0x4000FFA);
local choice, isInn = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);
if (choice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20);
local worldMaster = GetWorldMaster(); --bandaid fix for returning while dead, missing things like weakness and the heal number
local playerState = player:GetState(); if (player:GetHP() == 0) then
local currentAnima = 100; player:SetHP(player.GetMaxHP());
local baseAnimaCost = 6; player:ChangeState(0);
local animaCost = 0; player:PlayAnimation(0x01000066);
local favoredLocation = {1280003, 1280005, 1280062}; end
local currentRegion = zoneIdToRegionChoice[player:GetPos()[5]] or 0;
local isCity = {[1280001] = true, [1280061] = true, [1280031] = true};
local isFavoredDesination = false;
local destination = 0;
if (isInn) then
--Return to Inn
if (player:GetHomePointInn() == 1) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, -160.048, 0, -165.737, 0);
elseif (player:GetHomePointInn() == 2) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 160.048, 0, 154.263, 0);
elseif (player:GetHomePointInn() == 3) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 0.048, 0, -5.737, 0);
end
elseif (choice == 1 and isInn == nil) then
--Return to Homepoint
destination = aetheryteTeleportPositions[player:GetHomePoint()];
if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
if (isTeleport == 0) then -- Teleport hit end
while (true) do end
regionChoice = callClientFunction(player, "delegateCommand", actor, "eventRegion", currentAnima); end
end
if (regionChoice == nil) then break end
while (true) do
if (regionChoice > 0 and regionChoice < 6) then -- If Region selected
if (regionChoice == currentRegion) then -- Check if selected region matches player's region, reduce cost if so.
baseAnimaCost = baseAnimaCost - 2;
else
baseAnimaCost = 6;
end
-- Assign anima cost to the six possible slots after factoring in same region or not.
animaCost = {baseAnimaCost, baseAnimaCost, baseAnimaCost, baseAnimaCost, baseAnimaCost, baseAnimaCost};
if (isCity[teleportMenuToAetheryte[regionChoice][1]] == true) then
-- Halve the cost of applicable city aetheryte
animaCost[1] = animaCost[1] / 2;
end
elseif (regionChoice == 6) then -- Favored Destinations selected.
-- Dummy info. Favored would be half price after factoring in same region cost or not.
animaCost = {2, 3, 3, favoredLocation[1], favoredLocation[2], favoredLocation[3]};
isFavoredDesination = true;
end
aetheryteChoice = callClientFunction(
player,
"delegateCommand",
actor,
"eventAetheryte",
regionChoice,
animaCost[1],
animaCost[2],
animaCost[3],
animaCost[4],
animaCost[5],
animaCost[6]
);
if (aetheryteChoice == nil) then break end
player:PlayAnimation(0x4000FFA);
if (isFavoredDesination == true) then
destination = aetheryteTeleportPositions[favoredLocation[aetheryteChoice]];
player:SendGameMessage(worldMaster, 34101, 0x20, 2, favoredLocation[aetheryteChoice], animaCost[aetheryteChoice], currentAnima);
else
destination = aetheryteTeleportPositions[teleportMenuToAetheryte[regionChoice][aetheryteChoice]];
player:SendGameMessage(worldMaster, 34101, 0x20, 2, teleportMenuToAetheryte[regionChoice][aetheryteChoice], animaCost[aetheryteChoice], currentAnima);
end
confirmChoice = callClientFunction(player, "delegateCommand", actor, "eventConfirm", false, false, 1, 138824, false);
if (confirmChoice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34105, 0x20);
if (destination ~= 0) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
if (playerState == ACTORSTATE_MOUNTED) then
player:SetMountState(0);
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
player:ChangeState(ACTORSTATE_PASSIVE);
end
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end
end
player:endEvent();
return;
end
end
else -- Return hit
player:PlayAnimation(0x4000FFA);
local choice, isInn = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false);
if (choice == 1) then
player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20);
--bandaid fix for returning while dead, missing things like weakness and the heal number
if (player:GetHP() == 0) then
player:SetHP(player.GetMaxHP());
player:ChangeState(0);
player:PlayAnimation(0x01000066);
end
if (isInn) then
--Return to Inn
if (player:GetHomePointInn() == 1) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, -160.048, 0, -165.737, 0);
elseif (player:GetHomePointInn() == 2) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 160.048, 0, 154.263, 0);
elseif (player:GetHomePointInn() == 3) then
GetWorldManager():DoZoneChange(player, 244, nil, 0, 15, 0.048, 0, -5.737, 0);
end
elseif (choice == 1 and isInn == nil) then
--Return to Homepoint
destination = aetheryteTeleportPositions[player:GetHomePoint()];
if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
if (playerState == ACTORSTATE_MOUNTED) then
player:SetMountState(0);
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
player:ChangeState(ACTORSTATE_PASSIVE);
end
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end
end
end
end
player:endEvent();
end
player:endEvent();
end

View File

@@ -24,7 +24,7 @@ reedit: Target has canceled their accept.
require ("global") require ("global")
function onEventStarted(player, actor, eventType, eventName) function onEventStarted(player, actor, triggerName)
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray"); callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray");

View File

@@ -6,7 +6,7 @@ Handles what happens a player cancels a trade
--]] --]]
function onEventStarted(player, actor, eventType, eventName, commandId, result) function onEventStarted(player, actor, triggerName, commandId, result)
GetWorldManager():CancelTrade(player); GetWorldManager():CancelTrade(player);
player:EndEvent(); player:EndEvent();

View File

@@ -6,16 +6,16 @@ Handles what happens when you invite to trade
--]] --]]
function onEventStarted(player, actor, eventType, eventName, name, arg1, arg2, arg3, actorId) function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId)
local otherActor = nil; local otherActor = nil;
--ActorID Search --ActorID Search
if (actorId ~= nil) then if (actorId ~= nil) then
otherActor = player.CurrentArea):FindActorInArea(actorId); otherActor = player:GetZone():FindActorInArea(actorId);
--Name Search --Name Search
elseif (name ~= nil) then elseif (name ~= nil) then
otherActor = player.CurrentArea:FindPCInZone(name); otherActor = player:GetZone():FindPCInZone(name);
end end
if (otherActor ~= nil) then if (otherActor ~= nil) then

View File

@@ -24,7 +24,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer)
local amount = buff.GetExtra(); local amount = buff.GetExtra();
caster.AddMP(amount); caster.AddMP(amount);
actionContainer.AddMPAction(caster.Id, 33007, amount); actionContainer.AddMPAction(caster.actorId, 33007, amount);
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
else else
--Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full --Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full

View File

@@ -1,21 +0,0 @@
require("global");
properties = {
permissions = 0,
parameters = "s",
description = "Adds a quest by <id>.",
}
function onTrigger(player, argc, glId)
if player then
local glIdAsNumber = tonumber(glId);
if (glIdAsNumber == nil) then
player:AddQuest(glId);
else
player:AddQuest(glIdAsNumber);
end
else
print(sender.."unable to add guildleve, ensure player name is valid.");
end;
end;

View File

@@ -15,7 +15,7 @@ function onTrigger(player, argc)
if player then if player then
if player.target then if player.target then
print("hi") print("hi")
local id = player.target.Id local id = player.target.actorId
print("hi") print("hi")
player.currentParty:AddMember(id); player.currentParty:AddMember(id);
player.target.currentParty = player.currentParty; player.target.currentParty = player.currentParty;

View File

@@ -1,95 +0,0 @@
require("global");
properties = {
permissions = 0,
parameters = "dddd",
description =
[[
Sets anim id for current target
!anim <animID> |
!anim <category> <effect> <motion>
]],
}
function onTrigger(player, argc, aType, a1, a2)
local actor = player.CurrentArea.FindActorInArea(player.currentTarget) or nil;
if (player and actor) then
a1 = bit32.band(a1, 0xFFF);
a2 = bit32.band(a2, 0xFFF);
aType = bit32.band(aType, 0xFF);
animId = bit32.bor(bit32.lshift(a2, 12), a1);
animId = bit32.bor(bit32.lshift(aType, 24), animId);
-- player:SendMessage(0x20, "[anim] ", tostring(animId));
actor:PlayAnimation(animId);
local output = string.format("%x", animId)
player:SendMessage(0x20, "[anim] ", "0x"..tostring(output).. " Target:"..tostring(actor));
end
end
--[[ Categories:
1 MGK: 01 - Magic
2 SYS: 02 - System noises
3 ETC: 03 - ?? - Item sound?
4 LIB: 04 - Posing animations
5-9 ITM: 05-09 - Items
10 KAO: 0A - KAO = Face emotes?
11-12 GLI1/2/3: 0B/0C - Leve card things
13 CBI: 0D - Two small effects
14 ABL: 0E - Cooldown buffs
15 POP: 0F - Warp effects
16 CFT: 10 - Crafting?
17 BTL: 11 - More Crafting?
18 WSC: 12 - Weapon Skills Arg1 - Weapon Skill Arg2 - Player Animation
19 WSS: 13 - Mob animations
20 PIC: 14 - Gathering weapons?
21 LIU: 15 - Player Hand Emotes
22 LIN: 16 - Doesn't exist?
23 LIF: 17 - Doesn't exist?
24 LIL: 18 - Mouth
25 ATK: 19 - Autoattacks
33 = ?
34 = Crash
120 = ???
Notes:
------
CATEGORY
Shift 18 bits right
CMP 0xB
ANIMATION??????
Shift 0xC bits right
AND 0x0FFF
PARTICLE EFFECT
AND 0x0FFF
This number is in the subfolder (wsc, abi, etc)
That 12 is:
CMP 7C
CMP 6f
CMP 70
CMP 71
7C000062
ec000000
00FFFFFF
19: Auto Attack?
6F: Casting
71: Seems to deal with signaling monster parts
7C: Sheath/Unsheath
7F: Cast failed
--]]

View File

@@ -1,23 +0,0 @@
require("global");
properties = {
permissions = 0,
parameters = "",
description =
[[
Changes appearance for equipment with given parameters.
!graphic <slot> <wID> <eID> <vID> <vID>
]],
}
function onTrigger(player, argc)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[changetonpc] ";
local npc = player.CurrentArea:FindActorInArea(player.currentTarget);
if npc then
player:ChangeIntoNpc(npc);
end
end

View File

@@ -1,58 +0,0 @@
require("global");
properties = {
permissions = 0,
parameters = "dd",
description =
[[
Sets if a quest is completed.
!completedQuest <questId> true/false
]],
}
function onTrigger(player, argc, questId, flag)
print("HEY");
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[completedQuest] ";
local message = "Error";
if (argc < 1) then
return;
end
local questId = tonumber(questId);
local flag = flag or nil;
-- Fail if not valid questId
if (questId < 110001 or questId > 110001 + 2048) then
player:SendMessage(messageID, sender, "Invalid questId entered");
return;
end
-- Getting
if (arc == 1) then
player:SendMessage(messageID, sender, string.format("Quest %d completion is set to: %s", questId, tostring(player:IsQuestCompleted(questId))));
return;
-- Setting
else
-- Fail if not valid flag
if (not flag == nil) then
player:SendMessage(messageID, sender, "Invalid flag entered");
else
local boolFlag = false;
if (flag == "true" or flag == "1" or flag == "on" or flag == "O") then
boolFlag = true;
elseif (flag == "false" or flag == "0" or flag == "off" or flag == "X") then
boolFlag = false;
elseif flag == "flip" or flag == "toggle" then
boolFlag = not player:IsQuestCompleted(questId);
end
player:SetQuestComplete(questId, boolFlag);
player:SendMessage(messageID, sender, string.format("Quest %d completion set to: %s", questId, tostring(player:IsQuestCompleted(questId))));
return;
end
end
end

View File

@@ -8,8 +8,9 @@ properties = {
function onTrigger(player, argc, actorName) function onTrigger(player, argc, actorName)
if (actorName ~= nil) then if (actorName ~= nil) then
actor = player.CurrentArea:DespawnActor(actorName); zone = player:GetZone();
actor = zone:DespawnActor(actorName);
end end
end; end;

View File

@@ -1,29 +0,0 @@
require("global");
properties = {
permissions = 0,
parameters = "ssss",
description =
[[
Gets the info about the current target
]],
}
function onTrigger(player)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[Info] ";
local targetActor = player.CurrentArea.FindActorInArea(player.currentTarget) or nil;
if not targetActor then
player:SendMessage(messageID, sender, "No target selected");
return
end
player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation));
player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.Id));
player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));
player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId()));
end

View File

@@ -26,8 +26,8 @@ function onTrigger(player, argc, qty, name, lastName)
currency = 1000001; currency = 1000001;
qty = tonumber(qty) or 1; qty = tonumber(qty) or 1;
location = INVENTORY_CURRENCY; location = INVENTORY_CURRENCY;
print("ASDASDASDASDASD");
actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[1], 0); actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 0);
player:DoBattleAction(0, 0, actionList); player:DoBattleAction(0, 0, actionList);
else else
print(sender.."unable to add experience, ensure player name is valid."); print(sender.."unable to add experience, ensure player name is valid.");

Some files were not shown because too many files have changed in this diff Show More