mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
Updated Map Server namespace. Moved all other data folders (www and sql) to data folder. Renamed boot name to Project Meteor.
This commit is contained in:
parent
18ef69f3d1
commit
91549bff7a
1823 changed files with 102704 additions and 901 deletions
19
Data/scripts/commands/Ability.lua
Normal file
19
Data/scripts/commands/Ability.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
local attackMagicHandlers = {
|
||||
|
||||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Ability(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end
|
5
Data/scripts/commands/AbilityCure.lua
Normal file
5
Data/scripts/commands/AbilityCure.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
require("global")
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
|
||||
end
|
20
Data/scripts/commands/ActivateCommand.lua
Normal file
20
Data/scripts/commands/ActivateCommand.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
ActivateCommand Script
|
||||
|
||||
Switches between active and passive mode states
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName)
|
||||
|
||||
if (player.currentMainState == 0x0000) then
|
||||
player.Engage(0, 0x0002);
|
||||
elseif (player.currentMainState == 0x0002) then
|
||||
player.Disengage(0x0000);
|
||||
end
|
||||
player:endEvent();
|
||||
sendSignal("playerActive");
|
||||
end;
|
20
Data/scripts/commands/AttackAbility.lua
Normal file
20
Data/scripts/commands/AttackAbility.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
local attackMagicHandlers = {
|
||||
|
||||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Ability(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
|
||||
end
|
19
Data/scripts/commands/AttackMagic.lua
Normal file
19
Data/scripts/commands/AttackMagic.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
local attackMagicHandlers = {
|
||||
|
||||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end;
|
26
Data/scripts/commands/AttackWeaponSkill.lua
Normal file
26
Data/scripts/commands/AttackWeaponSkill.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
|
||||
--Are they in active mode?
|
||||
if (player:GetState() != 2) then
|
||||
player:SendGameMessage(GetWorldMaster(), 32503, 0x20);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
if not player.aiContainer.IsEngaged() then
|
||||
player.Engage(targetActor);
|
||||
end;
|
||||
player.WeaponSkill(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end;
|
30
Data/scripts/commands/BazaarCheckCommand.lua
Normal file
30
Data/scripts/commands/BazaarCheckCommand.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
--[[
|
||||
|
||||
BazaarCheckCommand Script
|
||||
|
||||
Handles what happens when you examine a player's bazaar
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, bazaarActorId)
|
||||
|
||||
local bazaarActor = nil;
|
||||
|
||||
if (name ~= nil) then
|
||||
bazaarActor = player:GetZone():FindPCInZone(name);
|
||||
elseif (bazaarActorId ~= nil) then
|
||||
bazaarActor = player:GetZone():FindActorInArea(bazaarActorId);
|
||||
end
|
||||
|
||||
if (bazaarActor ~= nil) then
|
||||
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", "Currently disabled due to freezing characters.");
|
||||
--callClientFunction(player, "delegateCommand", GetStaticActor("BazaarCheckCommand"), "processChackBazaar");
|
||||
else
|
||||
--Show error
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
58
Data/scripts/commands/BazaarDealCommand.lua
Normal file
58
Data/scripts/commands/BazaarDealCommand.lua
Normal file
|
@ -0,0 +1,58 @@
|
|||
--[[
|
||||
|
||||
BazaarDealCommand Script
|
||||
|
||||
Handles various bazaar transfer options
|
||||
|
||||
All bazaar args have a Reward (The item the person who fufills the request gets) and a Seek (The item the player wants, either gil or an item).
|
||||
|
||||
Args:
|
||||
|
||||
rewardItem: Item reference to what will be given to the buyer. If it's gil the itemID will be given instead. If offering an item to seek; reward/seek are combined and put here.
|
||||
seekItem: Item reference to what the buyer will give us. If it's gil the itemID will be given instead,
|
||||
bazaarMode: The tag value to set in the bazaar item's data.
|
||||
arg1: Always nil
|
||||
bazaarActor: The actor who owns this bazaar
|
||||
rewardAmount: The amount of rewardItem the buyer will get.
|
||||
seekAmount: The amount of seekItem we want.
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarMode, arg1, bazaarActor, rewardAmount, seekAmount, arg2, arg3, type9ItemIds)
|
||||
|
||||
local rewarding = nil;
|
||||
local seeking = nil;
|
||||
|
||||
--Handle special case for offering an item.
|
||||
if (seekItem == nil) then
|
||||
rewarding = player:GetItemPackage(rewardItem.offerPackageId):GetItemAtSlot(rewardItem.offerSlot);
|
||||
seeking = player:GetItemPackage(rewardItem.seekPackageId):GetItemAtSlot(rewardItem.seekSlot);
|
||||
end
|
||||
|
||||
--Handle Reward
|
||||
if (rewarding == nil) then
|
||||
if (type(rewardItem) == "number") then
|
||||
rewarding = player:GetItemPackage(INVENTORY_CURRENCY):GetItemByCatelogId(rewardItem);
|
||||
else
|
||||
rewarding = player:GetItem(rewardItem);
|
||||
end
|
||||
end
|
||||
|
||||
--Handle Seek
|
||||
if (seeking == nil) then
|
||||
if (type(seekItem) == "number") then
|
||||
seeking = player:GetItemPackage(INVENTORY_CURRENCY):GetItemByCatelogId(seekItem);
|
||||
else
|
||||
seeking = player:GetItem(seekItem);
|
||||
end
|
||||
end
|
||||
|
||||
result = GetWorldManager():AddToBazaar(player, rewarding, seeking, rewardAmount, seekAmount, bazaarMode);
|
||||
|
||||
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
55
Data/scripts/commands/BazaarTradeCommand.lua
Normal file
55
Data/scripts/commands/BazaarTradeCommand.lua
Normal file
|
@ -0,0 +1,55 @@
|
|||
--[[
|
||||
|
||||
BazaarTradeCommand Script
|
||||
|
||||
Handles bazaar trade
|
||||
|
||||
All bazaar args have a Reward (The item the person who fufills the request gets) and a Seek (The item the player wants, either gil or an item).
|
||||
|
||||
--]]
|
||||
|
||||
--TODO REFACTOR
|
||||
|
||||
function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost, seekAmount, arg1, bazaarActorId, rewardAmount, rewardItemId, nameIndex, arg2, type9ItemIds)
|
||||
|
||||
local originalReward = nil;
|
||||
local originalSeek = nil;
|
||||
local bazaarActor = nil;
|
||||
|
||||
--Get the bazaar actor
|
||||
if (bazaarActorId ~= nil) then
|
||||
bazaarActor = player:GetZone():FindActorInArea(bazaarActorId);
|
||||
end
|
||||
|
||||
--Abort if no actor
|
||||
if (bazaarActor == nil) then
|
||||
player:SendGameMessage(player, worldMaster, 25111, 0x20);
|
||||
player:EndEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
--If seekItem is a number, we are buying an item (ExecuteBazaarBuy)
|
||||
if (type(seekItemOrCost) == "number") then
|
||||
if (player:GetCurrentGil() >= seekItemOrCost) then
|
||||
if (GetWorldManager():BazaarBuyOperation(bazaarActor, player, bazaarActor:GetItem(rewardItem), rewardAmount, seekItemOrCost)) then
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 25111, 0x20);
|
||||
end
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 40252, 0x20);
|
||||
end
|
||||
else --Else we are fufilling a sought out item (ExecuteBazaarSell)
|
||||
local rewardItem = bazaarActor:GetItem(rewardItem);
|
||||
local seekItem = player:GetItem(seekItemOrCost);
|
||||
if (rewardItem ~= nil and seekItem ~= nil) then
|
||||
if (GetWorldManager():BazaarSellOperation(bazaarActor, player, rewardItem, rewardAmount, seekItem, seekAmount)) then
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 25111, 0x20);
|
||||
end
|
||||
else
|
||||
end
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
22
Data/scripts/commands/BazaarUndealCommand.lua
Normal file
22
Data/scripts/commands/BazaarUndealCommand.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
--[[
|
||||
|
||||
BazaarUndealCommand Script
|
||||
|
||||
Handles canceling bazaar items
|
||||
|
||||
25107 - Your bazaar is either full or already contains that unique item.
|
||||
25111 - Unable to complete transaction.
|
||||
25112 - You are unable to remove the item from your bazaar. You cannot hold any more items.
|
||||
25113 - Offered and sought items cannot be identical.
|
||||
25114 - Items in less than mint condition cannot be offered.
|
||||
25115 - Items in less than mint condition cannot be placed in your bazaar.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, rewardItem, seekItem, bazaarType, narg, bazaarActor, rewardAmount, seekAmount, narg, narg, type9ItemIds)
|
||||
|
||||
GetWorldManager():RemoveFromBazaar(player, player:GetItem(rewardItem));
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
23
Data/scripts/commands/BonusPointCommand.lua
Normal file
23
Data/scripts/commands/BonusPointCommand.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
--[[
|
||||
|
||||
BonusPointCommand Script
|
||||
|
||||
Functions:
|
||||
|
||||
operateUI(pointsAvailable, pointsLimit, str, vit, dex, int, min, pie)
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, actor, triggerName)
|
||||
--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);
|
||||
result = callClientFunction(player, "delegateCommand", actor, "operateUI", 100, 100, 10, 10, 10, 10, 10, 10);
|
||||
|
||||
--Do Save
|
||||
if (result == true) then
|
||||
end
|
||||
|
||||
player:endEvent();
|
||||
end
|
6
Data/scripts/commands/ChangeJobCommand.lua
Normal file
6
Data/scripts/commands/ChangeJobCommand.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
function onEventStarted(player, caller, commandRequest, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
|
||||
|
||||
player:SetCurrentJob(17);
|
||||
|
||||
player:EndEvent();
|
||||
end
|
19
Data/scripts/commands/CheckCommand.lua
Normal file
19
Data/scripts/commands/CheckCommand.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
--[[
|
||||
|
||||
CheckCommand Script
|
||||
|
||||
Handles player examining someone
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
|
||||
|
||||
actor = player:GetActorInInstance(checkedActorId);
|
||||
|
||||
if (actor ~= nil) then
|
||||
player:examinePlayer(actor);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
45
Data/scripts/commands/ChocoboRideCommand.lua
Normal file
45
Data/scripts/commands/ChocoboRideCommand.lua
Normal file
|
@ -0,0 +1,45 @@
|
|||
--[[
|
||||
|
||||
ChocoboRideCommand Script
|
||||
|
||||
Handles mounting and dismounting the Chocobo and Goobbue
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, isGoobbue)
|
||||
|
||||
if (player:GetState() == 0) then
|
||||
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (isGoobbue ~= true) then
|
||||
player:ChangeMusic(83);
|
||||
player:SendGameMessage(player, worldMaster, 26001, 0x20);
|
||||
player:SetMountState(1);
|
||||
else
|
||||
player:ChangeMusic(98);
|
||||
player:SendGameMessage(player, worldMaster, 26019, 0x20);
|
||||
player:SetMountState(2);
|
||||
end
|
||||
|
||||
player:ChangeSpeed(0.0, 5.0, 10.0, 10.0);
|
||||
player:ChangeState(15);
|
||||
else
|
||||
player:ChangeMusic(player:GetZone().bgmDay);
|
||||
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (player:GetMountState() == 1) then
|
||||
player:SendGameMessage(player, worldMaster, 26003, 0x20);
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 26021, 0x20);
|
||||
end
|
||||
|
||||
player:SetMountState(0);
|
||||
player:ChangeSpeed(0.0, 2.0, 5.0, 5.0)
|
||||
player:ChangeState(0);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
144
Data/scripts/commands/CmnAttackWeaponSkill.lua
Normal file
144
Data/scripts/commands/CmnAttackWeaponSkill.lua
Normal file
|
@ -0,0 +1,144 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
CmnAttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
local function handleTEST(player)
|
||||
end
|
||||
|
||||
local weaponskillHandlers = {
|
||||
[0xA0F067F4] = nil,
|
||||
[0xA0F067F5] = nil,
|
||||
[0xA0F067F7] = nil,
|
||||
[0xA0F067F8] = nil,
|
||||
[0xA0F067FA] = nil,
|
||||
[0xA0F067FB] = nil,
|
||||
[0xA0F067FD] = nil,
|
||||
[0xA0F067FE] = nil,
|
||||
[0xA0F06800] = nil,
|
||||
[0xA0F06801] = nil,
|
||||
[0xA0F06802] = nil,
|
||||
[0xA0F06804] = nil,
|
||||
[0xA0F06805] = nil,
|
||||
[0xA0F06806] = nil,
|
||||
[0xA0F06808] = nil,
|
||||
[0xA0F0680A] = nil,
|
||||
[0xA0F0680B] = nil,
|
||||
[0xA0F0680D] = nil,
|
||||
[0xA0F0680E] = nil,
|
||||
[0xA0F06810] = nil,
|
||||
[0xA0F06812] = nil,
|
||||
[0xA0F06814] = nil,
|
||||
[0xA0F068A8] = nil,
|
||||
[0xA0F068A9] = nil,
|
||||
[0xA0F068AB] = nil,
|
||||
[0xA0F068AC] = nil,
|
||||
[0xA0F068AE] = nil,
|
||||
[0xA0F068AF] = nil,
|
||||
[0xA0F068B2] = nil,
|
||||
[0xA0F068B3] = nil,
|
||||
[0xA0F068B5] = nil,
|
||||
[0xA0F068B7] = nil,
|
||||
[0xA0F068B8] = nil,
|
||||
[0xA0F068B9] = nil,
|
||||
[0xA0F068BB] = nil,
|
||||
[0xA0F068BC] = nil,
|
||||
[0xA0F068BE] = nil,
|
||||
[0xA0F068BF] = nil,
|
||||
[0xA0F068C1] = nil,
|
||||
[0xA0F068C3] = nil,
|
||||
[0xA0F068C5] = nil,
|
||||
[0xA0F0695C] = nil,
|
||||
[0xA0F0695D] = nil,
|
||||
[0xA0F0695E] = nil,
|
||||
[0xA0F06960] = nil,
|
||||
[0xA0F06961] = nil,
|
||||
[0xA0F06963] = nil,
|
||||
[0xA0F06964] = nil,
|
||||
[0xA0F06966] = nil,
|
||||
[0xA0F06967] = nil,
|
||||
[0xA0F06968] = nil,
|
||||
[0xA0F0696A] = nil,
|
||||
[0xA0F0696B] = nil,
|
||||
[0xA0F0696D] = nil,
|
||||
[0xA0F0696E] = nil,
|
||||
[0xA0F06970] = nil,
|
||||
[0xA0F06971] = nil,
|
||||
[0xA0F06973] = nil,
|
||||
[0xA0F06974] = nil,
|
||||
[0xA0F06976] = nil,
|
||||
[0xA0F06978] = nil,
|
||||
[0xA0F06B78] = nil,
|
||||
[0xA0F06B79] = nil,
|
||||
[0xA0F06B7B] = nil,
|
||||
[0xA0F06B7C] = nil,
|
||||
[0xA0F06B7E] = nil,
|
||||
[0xA0F06B7F] = nil,
|
||||
[0xA0F06B81] = nil,
|
||||
[0xA0F06B82] = nil,
|
||||
[0xA0F06B84] = nil,
|
||||
[0xA0F06B85] = nil,
|
||||
[0xA0F06B8A] = nil,
|
||||
[0xA0F06B8C] = nil,
|
||||
[0xA0F06B8E] = nil,
|
||||
[0xA0F06B90] = nil,
|
||||
[0xA0F06B91] = nil,
|
||||
[0xA0F06B93] = nil,
|
||||
[0xA0F06B95] = nil,
|
||||
[0xA0F06B97] = nil,
|
||||
[0xA0F06C2C] = nil,
|
||||
[0xA0F06C2D] = nil,
|
||||
[0xA0F06C2F] = nil,
|
||||
[0xA0F06C31] = nil,
|
||||
[0xA0F06C32] = nil,
|
||||
[0xA0F06C34] = nil,
|
||||
[0xA0F06C35] = nil,
|
||||
[0xA0F06C36] = nil,
|
||||
[0xA0F06C38] = nil,
|
||||
[0xA0F06C39] = nil,
|
||||
[0xA0F06C3B] = nil,
|
||||
[0xA0F06C3C] = nil,
|
||||
[0xA0F06C3E] = nil,
|
||||
[0xA0F06C3F] = nil,
|
||||
[0xA0F06C41] = nil,
|
||||
[0xA0F06C43] = nil,
|
||||
[0xA0F06C45] = nil,
|
||||
[0xA0F06C47] = nil,
|
||||
[0xA0F06C49] = nil,
|
||||
[0xA0F06C4B] = nil,
|
||||
[0xA0F06D94] = nil,
|
||||
[0xA0F06D95] = nil,
|
||||
[0xA0F06D96] = nil,
|
||||
[0xA0F06F92] = nil,
|
||||
[0xA0F06F93] = nil,
|
||||
[0xA0F06F95] = nil,
|
||||
[0xA0F06F96] = nil,
|
||||
[0xA0F070E6] = nil,
|
||||
[0xA0F070E7] = nil,
|
||||
[0xA0F070E9] = nil,
|
||||
[0xA0F070EA] = nil
|
||||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName)
|
||||
|
||||
--Are they in active mode?
|
||||
if (player:GetState() != 2) then
|
||||
player:SendGameMessage(GetWorldMaster(), 32503, 0x20);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
if (weaponskillHandlers[command.actorId] ~= nil) then
|
||||
weaponskillHandlers[command.actorId](player);
|
||||
else
|
||||
player:SendMessage(0x20, "", "That weaponskill is not implemented yet.");
|
||||
end
|
||||
|
||||
player:endEvent();
|
||||
|
||||
end
|
18
Data/scripts/commands/ConfirmGroupCommand.lua
Normal file
18
Data/scripts/commands/ConfirmGroupCommand.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
--[[
|
||||
|
||||
ConfirmGroupCommand Script
|
||||
|
||||
Handles what happens when you resolve an invite to a group
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, groupType, result)
|
||||
|
||||
--Accept/Refuse happened, else just close the window
|
||||
if (result == 1 or result == 2) then
|
||||
GetWorldManager():GroupInviteResult(player, groupType, result);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
20
Data/scripts/commands/ConfirmTradeCommand.lua
Normal file
20
Data/scripts/commands/ConfirmTradeCommand.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
--[[
|
||||
|
||||
ConfirmTradeCommand Script
|
||||
|
||||
Handles what happens when you accept/refuse a trade
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, groupType, result)
|
||||
|
||||
--Accept
|
||||
if (result == 1) then
|
||||
GetWorldManager():AcceptTrade(player);
|
||||
--Refuse
|
||||
elseif (result == 2) then
|
||||
GetWorldManager():RefuseTrade(player);
|
||||
end
|
||||
player:EndEvent();
|
||||
|
||||
end
|
5
Data/scripts/commands/CureMagic.lua
Normal file
5
Data/scripts/commands/CureMagic.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
|
||||
player:endEvent();
|
||||
end
|
5
Data/scripts/commands/CuregaMagic.lua
Normal file
5
Data/scripts/commands/CuregaMagic.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
|
||||
player:endEvent();
|
||||
end
|
26
Data/scripts/commands/DevideAttackWeaponSkill.lua
Normal file
26
Data/scripts/commands/DevideAttackWeaponSkill.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
|
||||
--Are they in active mode?
|
||||
if (player:GetState() != 2) then
|
||||
player:SendGameMessage(GetWorldMaster(), 32503, 0x20);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
if not player.aiContainer.IsEngaged() then
|
||||
player.Engage(targetActor);
|
||||
end;
|
||||
player.WeaponSkill(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end;
|
23
Data/scripts/commands/DiceCommand.lua
Normal file
23
Data/scripts/commands/DiceCommand.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
--[[
|
||||
|
||||
DiceCommand Script
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, maxNumber)
|
||||
|
||||
if (maxNumber == nil or maxNumber > 1000 or maxNumber < 1) then
|
||||
maxNumber = 100;
|
||||
end
|
||||
|
||||
result = math.random(0, maxNumber);
|
||||
|
||||
worldMaster = GetWorldMaster();
|
||||
player:SendGameMessage(player, worldMaster, 25342, 0x20, result, maxNumber);
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
||||
|
||||
function onEventUpdate(player, npc)
|
||||
end
|
56
Data/scripts/commands/DummyCommand.lua
Normal file
56
Data/scripts/commands/DummyCommand.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
--[[
|
||||
|
||||
HarvestJudge
|
||||
|
||||
Operates the harvesting system for mining, logging, and fishing.
|
||||
|
||||
Functions:
|
||||
|
||||
loadTextData(commandActor): Loads all gamesheets needed and instantiates a HarvestJudge.
|
||||
targetCancel(commandActor): Cancels the player's target.
|
||||
turnToTarget(commandActor, harvestType, direction): Turns to a direction (name's a lie, angle must be computed lol)
|
||||
openInputWidget(commandActor, harvestType, nodeGrade): Inits the widget system (call first).
|
||||
orderInputWidget(commandActor, nodeHP [max 100], ?, harvestType): Updates the node HP.
|
||||
textInputWidget(commandActor, harvestType, ?, textId, ?, ?, ?): Sets the result text after a minigame is performed.
|
||||
askInputWidget(commandActor, harvestType, inputPageNumber, showTutorial, showFishWait, showFishWaitAndJig, updateFishHP, showRareCatalystEffect): Gets user input after opening a ask widget.
|
||||
closeInputWidget(commandActor, harvestType): Closes the widget system (call last).
|
||||
rangeInputWidget(harvestType, inputPageNumber, goodMin, goodMax, bool): Unknown, currently crashing...
|
||||
|
||||
Notes:
|
||||
|
||||
HarvestType Ids:
|
||||
|
||||
20002: Mine
|
||||
20003: Log
|
||||
20004: Fish
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
|
||||
|
||||
harvestJudge = GetStaticActor("HarvestJudge");
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "loadTextData", commandactor);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "targetCancel", commandactor);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "turnToTarget", commandactor, 0x55F2, 2);
|
||||
|
||||
player:ChangeState(50);
|
||||
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandactor, 0x55F2, 2);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandactor, 3, false, 0x55f2);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandactor, 0x55f2, harvestJudge, nil, nil, nil, nil, 0);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandactor, 0x55f2, 1, 0, false, false, nil, false);
|
||||
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandactor, 0x55f2, harvestJudge, 60, nil, nil, nil, 0);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandactor, 0x55f2, 2, 0, false, false, nil, false);
|
||||
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandactor, 0x55f2, harvestJudge, 46,0, 0, 0, 0);
|
||||
callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandactor, 0x55f2, 2, 0, false, false, nil, false);
|
||||
|
||||
|
||||
player:ChangeState(0);
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
5
Data/scripts/commands/EffectMagic.lua
Normal file
5
Data/scripts/commands/EffectMagic.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
|
||||
player:endEvent();
|
||||
end
|
24
Data/scripts/commands/EmoteSitCommand.lua
Normal file
24
Data/scripts/commands/EmoteSitCommand.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
--[[
|
||||
|
||||
EmoteSitCommand Script
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, emoteId)
|
||||
|
||||
if (player:GetState() == 0) then
|
||||
if (emoteId == 0x2712) then
|
||||
player:ChangeState(11);
|
||||
else
|
||||
player:ChangeState(13);
|
||||
end
|
||||
else
|
||||
player:ChangeState(0);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
||||
|
||||
function onEventUpdate(player, npc)
|
||||
end
|
90
Data/scripts/commands/EmoteStandardCommand.lua
Normal file
90
Data/scripts/commands/EmoteStandardCommand.lua
Normal file
|
@ -0,0 +1,90 @@
|
|||
--[[
|
||||
|
||||
EmoteStandardCommand Script
|
||||
|
||||
Returns the correct animation and log description when an emote is activated.
|
||||
If 'motion' parameter is used, it returns the blank description id 10105
|
||||
|
||||
--]]
|
||||
|
||||
emoteTable = {
|
||||
[101] = {animId = 1, descId = 21001}, --Surprised
|
||||
[102] = {animId = 2, descId = 21011}, --Angry
|
||||
[103] = {animId = 3, descId = 21021}, --Furious
|
||||
[104] = {animId = 4, descId = 21031}, --Blush
|
||||
[105] = {animId = 5, descId = 21041}, --Bow
|
||||
[106] = {animId = 6, descId = 21051}, --Cheer
|
||||
[107] = {animId = 7, descId = 21061}, --Clap
|
||||
[108] = {animId = 8, descId = 21071}, --Beckon
|
||||
[109] = {animId = 9, descId = 21081}, --Comfort
|
||||
[110] = {animId = 10, descId = 21091}, --Cry
|
||||
[111] = {animId = 11, descId = 21101}, --Dance
|
||||
[112] = {animId = 12, descId = 21111}, --Doubt
|
||||
[113] = {animId = 13, descId = 21121}, --Doze
|
||||
[114] = {animId = 14, descId = 21131}, --Fume
|
||||
[115] = {animId = 15, descId = 21141}, --Goodbye
|
||||
[116] = {animId = 16, descId = 21151}, --Wave
|
||||
[117] = {animId = 17, descId = 21161}, --Huh
|
||||
[118] = {animId = 18, descId = 21171}, --Joy
|
||||
[119] = {animId = 19, descId = 21181}, --Kneel
|
||||
[120] = {animId = 20, descId = 21191}, --Chuckle
|
||||
[121] = {animId = 21, descId = 21201}, --Laugh
|
||||
[122] = {animId = 22, descId = 21211}, --Lookout
|
||||
[123] = {animId = 23, descId = 21221}, --Me
|
||||
[124] = {animId = 24, descId = 21231}, --No
|
||||
[125] = {animId = 25, descId = 21241}, --Deny
|
||||
[126] = {animId = 26, descId = 21251}, --Panic
|
||||
[127] = {animId = 27, descId = 21261}, --Point
|
||||
[128] = {animId = 28, descId = 21271}, --Poke
|
||||
[129] = {animId = 29, descId = 21281}, --Congratulate
|
||||
[130] = {animId = 30, descId = 21291}, --Psych
|
||||
[131] = {animId = 31, descId = 21301}, --Salute
|
||||
[132] = {animId = 32, descId = 21311}, --Shocked
|
||||
[133] = {animId = 33, descId = 21321}, --Shrug
|
||||
[134] = {animId = 34, descId = 21331}, --Rally
|
||||
[135] = {animId = 35, descId = 21341}, --Soothe
|
||||
[136] = {animId = 36, descId = 21351}, --Stagger
|
||||
[137] = {animId = 37, descId = 21361}, --Stretch
|
||||
[138] = {animId = 38, descId = 21371}, --Sulk
|
||||
[139] = {animId = 39, descId = 21381}, --Think
|
||||
[140] = {animId = 40, descId = 21391}, --Upset
|
||||
[141] = {animId = 41, descId = 21401}, --Welcome
|
||||
[142] = {animId = 42, descId = 21411}, --Yes
|
||||
[143] = {animId = 43, descId = 21421}, --Thumbs Up
|
||||
[144] = {animId = 44, descId = 21423}, --Examine Self
|
||||
[145] = {animId = 53, descId = 21425}, --Pose
|
||||
[146] = {animId = 50, descId = 21427}, --Storm Salute
|
||||
[147] = {animId = 51, descId = 21429}, --Serpent Salute
|
||||
[148] = {animId = 52, descId = 21431}, --Flame Salute
|
||||
[149] = {animId = 45, descId = 21433}, --Blow Kiss
|
||||
[151] = {animId = 47, descId = 21435}, --Grovel
|
||||
[152] = {animId = 48, descId = 21437}, --Happy
|
||||
[153] = {animId = 49, descId = 21439}, --Disappointed
|
||||
[154] = {animId = 46, descId = 10105}, --Air Quotes
|
||||
[155] = {animId = 54, descId = 21442}, --Pray
|
||||
[156] = {animId = 55, descId = 21445}, --Fire Dance
|
||||
};
|
||||
|
||||
|
||||
function onEventStarted(player, actor, triggerName, emoteId, showText, arg2, arg3, targetId)
|
||||
|
||||
if (targetId == nil) then
|
||||
targetId = 0;
|
||||
end
|
||||
|
||||
if (player:GetState() == 0 or player:GetState() == 11 or player:GetState() == 13) then
|
||||
emote = emoteTable[emoteId];
|
||||
if (emote ~= nil) then
|
||||
if showText == 1 then
|
||||
player:doEmote(targetId, emote.animId, emote.descId);
|
||||
else
|
||||
player:doEmote(targetId, emote.animId, 10105);
|
||||
end
|
||||
else
|
||||
player:SendMessage(0x20, "", string.format("Not implemented; EmoteId: %d", emoteId));
|
||||
end
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
85
Data/scripts/commands/EquipAbilityCommand.lua
Normal file
85
Data/scripts/commands/EquipAbilityCommand.lua
Normal file
|
@ -0,0 +1,85 @@
|
|||
require ("global")
|
||||
--player: Player that called this command
|
||||
--equipAbilityWidget: Widget that calls this command
|
||||
--triggername: Event Starter ?
|
||||
--slot: Which slot the ability will go into
|
||||
--commandid: command being equipped
|
||||
|
||||
|
||||
function onEventStarted(player, equipAbilityWidget, triggername, slot, commandid, unkown, arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
local worldManager = GetWorldManager();
|
||||
local ability = worldManager:GetBattleCommand(commandid);
|
||||
|
||||
|
||||
--Equip
|
||||
if (commandid > 0) then
|
||||
--[[]]
|
||||
--Can the player equip any more cross class actions
|
||||
if (player.charaWork.parameterTemp.otherClassAbilityCount[0] >= player.charaWork.parameterTemp.otherClassAbilityCount[1]) then
|
||||
--"You cannot set any more actions."
|
||||
player:SendGameMessage(GetWorldMaster(), 30720, 0x20, 0, 0);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
--Is the player high enough level in that class to equip the ability
|
||||
if (player.charaWork.battleSave.skillLevel[ability.job - 1] < ability.level) then
|
||||
--"You have not yet acquired that action."
|
||||
player:SendGameMessage(GetWorldMaster(), 30742, 0x20, 0, 0);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
local oldSlot = player:FindFirstCommandSlotById(commandid);
|
||||
local isEquipped = oldSlot < player.charaWork.commandBorder + 30;
|
||||
--If slot is 0, find the first open slot
|
||||
if (slot == 0) then
|
||||
--If the ability is already equipped and slot is 0, then it can't be equipped again
|
||||
--If the slot isn't 0, it's a move or a swap command
|
||||
if (isEquipped == true) then
|
||||
--"That action is already set to an action slot."
|
||||
player:SendGameMessage(GetWorldMaster(), 30719, 0x20, 0);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
slot = player:FindFirstCommandSlotById(0) - player.charaWork.commandBorder;
|
||||
|
||||
--If the first open slot is outside the hotbar, then the hotbar is full
|
||||
if(slot >= 30) then
|
||||
--"You cannot set any more actions."
|
||||
player:SendGameMessage(Server.GetWorldManager().GetActor(), 30720, 0x20, 0);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
else
|
||||
slot = slot - 1;
|
||||
end
|
||||
|
||||
if(isEquipped == true) then
|
||||
player:SwapAbilities(oldSlot, slot + player.charaWork.commandBorder);
|
||||
else
|
||||
local tslot = slot + player.charaWork.commandBorder;
|
||||
player:EquipAbility(player.GetCurrentClassOrJob(), commandid, tslot, true);
|
||||
end
|
||||
|
||||
--Unequip
|
||||
elseif (commandid == 0) then
|
||||
commandid = player.charaWork.command[slot + player.charaWork.commandBorder - 1];
|
||||
ability = worldManager.GetBattleCommand(commandid);
|
||||
--Is the ability a part of the player's current class?
|
||||
--This check isn't correct because of jobs having different ids
|
||||
local classId = player:GetCurrentClassOrJob();
|
||||
local jobId = player:ConvertClassIdToJobId(classId);
|
||||
|
||||
if(ability.job == classId or ability.job == jobId) then
|
||||
--"Actions of your current class or job cannot be removed."
|
||||
player:SendGameMessage(GetWorldMaster(), 30745, 0x20, 0, 0);
|
||||
elseif (commandid != 0) then
|
||||
player:UnequipAbility(slot);
|
||||
end
|
||||
end
|
||||
|
||||
player:endEvent();
|
||||
end
|
220
Data/scripts/commands/EquipCommand.lua
Normal file
220
Data/scripts/commands/EquipCommand.lua
Normal file
|
@ -0,0 +1,220 @@
|
|||
--[[
|
||||
|
||||
EquipCommand Script
|
||||
|
||||
Notes:
|
||||
|
||||
Gearset activating could be optimized a bit more by doing the item packets in one go.
|
||||
|
||||
The param "equippedItem" has the vars: actorId, unknown, slot, and inventoryType.
|
||||
The param "itemDBIds" has the vars: item1 and item2.
|
||||
|
||||
--]]
|
||||
|
||||
EQUIPSLOT_MAINHAND = 0;
|
||||
EQUIPSLOT_OFFHAND = 1;
|
||||
EQUIPSLOT_THROWINGWEAPON = 4;
|
||||
EQUIPSLOT_PACK = 5;
|
||||
EQUIPSLOT_POUCH = 6;
|
||||
EQUIPSLOT_HEAD = 8;
|
||||
EQUIPSLOT_UNDERSHIRT = 9;
|
||||
EQUIPSLOT_BODY = 10;
|
||||
EQUIPSLOT_UNDERGARMENT = 11;
|
||||
EQUIPSLOT_LEGS = 12;
|
||||
EQUIPSLOT_HANDS = 13;
|
||||
EQUIPSLOT_FEET = 14;
|
||||
EQUIPSLOT_WAIST = 15;
|
||||
EQUIPSLOT_NECK = 16;
|
||||
EQUIPSLOT_EARS = 17;
|
||||
EQUIPSLOT_WRIST = 19;
|
||||
EQUIPSLOT_RFINGER = 21;
|
||||
EQUIPSLOT_LFINGER = 22;
|
||||
|
||||
GRAPHICSLOT_MAINHAND = 5;
|
||||
GRAPHICSLOT_OFFHAND = 6;
|
||||
GRAPHICSLOT_SPMAINHAND = 7;
|
||||
GRAPHICSLOT_SPOFFHAND = 8;
|
||||
GRAPHICSLOT_THROWING = 9;
|
||||
GRAPHICSLOT_PACK = 10;
|
||||
GRAPHICSLOT_POUCH = 11;
|
||||
GRAPHICSLOT_HEAD = 12;
|
||||
GRAPHICSLOT_BODY = 13;
|
||||
GRAPHICSLOT_LEGS = 14;
|
||||
GRAPHICSLOT_HANDS = 15;
|
||||
GRAPHICSLOT_FEET = 16;
|
||||
GRAPHICSLOT_WAIST = 17;
|
||||
GRAPHICSLOT_NECK = 18;
|
||||
GRAPHICSLOT_R_EAR = 19;
|
||||
GRAPHICSLOT_L_EAR = 20;
|
||||
GRAPHICSLOT_R_WRIST = 21;
|
||||
GRAPHICSLOT_L_WRIST = 22;
|
||||
GRAPHICSLOT_R_RINGFINGER = 23;
|
||||
GRAPHICSLOT_L_RINGFINGER = 24;
|
||||
GRAPHICSLOT_R_INDEXFINGER = 25;
|
||||
GRAPHICSLOT_L_INDEXFINGER = 26;
|
||||
|
||||
function onEventStarted(player, actor, triggerName, equippedItem, param1, param2, param3, param4, param5, param6, param7, equipSlot, itemDBIds)
|
||||
equipSlot = equipSlot-1;
|
||||
|
||||
--Equip Item
|
||||
if (equippedItem ~= nil) then
|
||||
item = player:GetItemPackage(equippedItem.itemPackage):GetItemAtSlot(equippedItem.slot);
|
||||
equipItem(player, equipSlot, item);
|
||||
player:SendAppearance();
|
||||
--Unequip Item
|
||||
else
|
||||
item = player:GetEquipment():GetItemAtSlot(equipSlot);
|
||||
if (unequipItem(player, equipSlot, item) == true) then --Returns true only if something changed (didn't error out)
|
||||
player:SendAppearance();
|
||||
end
|
||||
end
|
||||
|
||||
player.CalculateBaseStats(); --player.RecalculateStats();
|
||||
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
function loadGearset(player, classId)
|
||||
player:GetEquipment():ToggleDBWrite(false);
|
||||
local gearset = player:GetGearset(classId);
|
||||
|
||||
if gearset == nil then
|
||||
return;
|
||||
end
|
||||
|
||||
for slot = 0, 34 do
|
||||
|
||||
if (slot ~= EQUIPSLOT_MAINHAND and slot ~= EQUIPSLOT_UNDERSHIRT and slot ~= EQUIPSLOT_UNDERGARMENT) then
|
||||
itemAtSlot = player:GetEquipment():GetItemAtSlot(slot);
|
||||
itemAtGearsetSlot = gearset[slot];
|
||||
|
||||
if (itemAtSlot ~= nil or itemAtGearsetSlot ~= nil) then
|
||||
if (itemAtSlot ~= nil and itemAtGearsetSlot == nil) then
|
||||
unequipItem(player, slot, itemAtSlot);
|
||||
elseif (itemAtSlot == nil and itemAtGearsetSlot ~= nil) then
|
||||
equipItem(player, slot, itemAtGearsetSlot);
|
||||
elseif (itemAtGearsetSlot.uniqueId ~= itemAtSlot.uniqueId) then
|
||||
unequipItem(player, slot, itemAtSlot);
|
||||
equipItem(player, slot, itemAtGearsetSlot)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
player:GetEquipment():ToggleDBWrite(true);
|
||||
end
|
||||
|
||||
function equipItem(player, equipSlot, item)
|
||||
if (item ~= nil) then
|
||||
local classId = nil;
|
||||
local worldMaster = GetWorldMaster();
|
||||
local gItem = GetItemGamedata(item.itemId);
|
||||
|
||||
--If it's the mainhand, begin class change based on weapon
|
||||
if (equipSlot == EQUIPSLOT_MAINHAND) then
|
||||
if (gItem:IsNailWeapon()) then classId = 2;
|
||||
elseif (gItem:IsSwordWeapon()) then classId = 3;
|
||||
elseif (gItem:IsAxeWeapon()) then classId = 4;
|
||||
elseif (gItem:IsBowWeapon()) then classId = 7;
|
||||
elseif (gItem:IsLanceWeapon()) then classId = 8;
|
||||
|
||||
elseif (gItem:IsThaumaturgeWeapon()) then classId = 22;
|
||||
elseif (gItem:IsConjurerWeapon()) then classId = 23;
|
||||
|
||||
elseif (gItem:IsCarpenterWeapon()) then classId = 29;
|
||||
elseif (gItem:IsBlackSmithWeapon()) then classId = 30;
|
||||
elseif (gItem:IsArmorerWeapon()) then classId = 31;
|
||||
elseif (gItem:IsGoldSmithWeapon()) then classId = 32;
|
||||
elseif (gItem:IsTannerWeapon()) then classId = 33;
|
||||
elseif (gItem:IsWeaverWeapon()) then classId = 34;
|
||||
elseif (gItem:IsAlchemistWeapon()) then classId = 35;
|
||||
elseif (gItem:IsCulinarianWeapon()) then classId = 36;
|
||||
|
||||
elseif (gItem:IsMinerWeapon()) then classId = 39;
|
||||
elseif (gItem:IsBotanistWeapon()) then classId = 40;
|
||||
elseif (gItem:IsFishingWeapon()) then classId = 41;
|
||||
end
|
||||
|
||||
if (classId ~= nil) then
|
||||
player:SendGameMessage(player, worldMaster, 30103, 0x20, 0, 0, player, classId);
|
||||
player:PrepareClassChange(classId);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--Item Equipped message
|
||||
player:SendGameMessage(player, worldMaster, 30601, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1);
|
||||
|
||||
--Load gearset for new class and begin class change
|
||||
if (classId ~= nil) then
|
||||
loadGearset(player, classId);
|
||||
player:DoClassChange(classId);
|
||||
end
|
||||
|
||||
player:GetEquipment():Set(equipSlot, item);
|
||||
|
||||
if (equipSlot == EQUIPSLOT_MAINHAND and gItem:IsNailWeapon() == false) then graphicSlot = GRAPHICSLOT_MAINHAND;
|
||||
elseif (equipSlot == EQUIPSLOT_OFFHAND) then graphicSlot = GRAPHICSLOT_OFFHAND;
|
||||
elseif (equipSlot == EQUIPSLOT_THROWINGWEAPON) then graphicSlot = GRAPHICSLOT_THROWING;
|
||||
elseif (equipSlot == EQUIPSLOT_PACK) then graphicSlot = GRAPHICSLOT_PACK;
|
||||
elseif (equipSlot == EQUIPSLOT_HEAD) then graphicSlot = GRAPHICSLOT_HEAD;
|
||||
elseif (equipSlot == EQUIPSLOT_BODY) then graphicSlot = GRAPHICSLOT_BODY;
|
||||
elseif (equipSlot == EQUIPSLOT_LEGS) then graphicSlot = GRAPHICSLOT_LEGS;
|
||||
elseif (equipSlot == EQUIPSLOT_HANDS) then graphicSlot = GRAPHICSLOT_HANDS;
|
||||
elseif (equipSlot == EQUIPSLOT_FEET) then graphicSlot = GRAPHICSLOT_FEET;
|
||||
elseif (equipSlot == EQUIPSLOT_WAIST) then graphicSlot = GRAPHICSLOT_WAIST;
|
||||
elseif (equipSlot == EQUIPSLOT_NECK) then graphicSlot = GRAPHICSLOT_NECK;
|
||||
elseif (equipSlot == EQUIPSLOT_RFINGER) then graphicSlot = GRAPHICSLOT_R_RINGFINGER;
|
||||
elseif (equipSlot == EQUIPSLOT_LFINGER) then graphicSlot = GRAPHICSLOT_L_RINGFINGER;
|
||||
end
|
||||
|
||||
--Graphic Slot was set, otherwise it's a special case
|
||||
if (graphicSlot ~= nil) then
|
||||
player:GraphicChange(graphicSlot, item);
|
||||
elseif (gItem:IsNailWeapon()) then
|
||||
player:GraphicChange(GRAPHICSLOT_MAINHAND, item);
|
||||
player:GraphicChange(GRAPHICSLOT_OFFHAND, item);
|
||||
elseif (equipSlot == EQUIPSLOT_EARS) then
|
||||
player:GraphicChange(GRAPHICSLOT_R_EAR, item);
|
||||
player:GraphicChange(GRAPHICSLOT_L_EAR, item);
|
||||
elseif (equipSlot == EQUIPSLOT_WRIST) then
|
||||
player:GraphicChange(GRAPHICSLOT_R_WRIST, item);
|
||||
player:GraphicChange(GRAPHICSLOT_L_WRIST, item);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function unequipItem(player, equipSlot, item)
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (item ~= nil and (equipSlot == EQUIPSLOT_MAINHAND or equipSlot == EQUIPSLOT_UNDERSHIRT or equipSlot == EQUIPSLOT_UNDERGARMENT)) then
|
||||
player:SendGameMessage(player, worldMaster, 30730, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1); --Unable to unequip
|
||||
elseif (item ~= nil) then
|
||||
player:SendGameMessage(player, worldMaster, 30602, 0x20, equipSlot+1, item.itemId, item.quality, 0, 0, 1); --Item Removed
|
||||
player:GetEquipment():Clear(equipSlot);
|
||||
|
||||
if (equipSlot == EQUIPSLOT_BODY) then --Show Undershirt
|
||||
item = player:GetEquipment():GetItemAtSlot(EQUIPSLOT_UNDERSHIRT);
|
||||
player:GraphicChange(GRAPHICSLOT_BODY, item);
|
||||
elseif (equipSlot == EQUIPSLOT_LEGS) then --Show Undergarment
|
||||
item = player:GetEquipment():GetItemAtSlot(EQUIPSLOT_UNDERGARMENT);
|
||||
player:GraphicChange(GRAPHICSLOT_LEGS, item);
|
||||
elseif (equipSlot == EQUIPSLOT_HANDS) then player:GraphicChange(15, 0, 1, 0, 0);
|
||||
elseif (equipSlot == EQUIPSLOT_FEET) then player:GraphicChange(16, 0, 1, 0, 0);
|
||||
else
|
||||
if (equipSlot == EQUIPSLOT_MAINHAND) then player:GraphicChange(GRAPHICSLOT_MAINHAND, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_OFFHAND) then player:GraphicChange(GRAPHICSLOT_OFFHAND, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_THROWINGWEAPON) then player:GraphicChange(GRAPHICSLOT_THROWING, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_PACK) then player:GraphicChange(GRAPHICSLOT_PACK, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_HEAD) then player:GraphicChange(GRAPHICSLOT_HEAD, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_WAIST) then player:GraphicChange(GRAPHICSLOT_WAIST, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_NECK) then player:GraphicChange(GRAPHICSLOT_NECK, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_EARS) then player:GraphicChange(GRAPHICSLOT_L_EAR, nil); player:GraphicChange(GRAPHICSLOT_R_EAR, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_WRIST) then player:GraphicChange(GRAPHICSLOT_L_WRIST, nil); player:GraphicChange(GRAPHICSLOT_R_WRIST, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_RFINGER) then player:GraphicChange(GRAPHICSLOT_R_RINGFINGER, nil);
|
||||
elseif (equipSlot == EQUIPSLOT_LFINGER) then player:GraphicChange(GRAPHICSLOT_L_RINGFINGER, nil);
|
||||
end
|
||||
end
|
||||
return true;
|
||||
end
|
||||
end
|
5
Data/scripts/commands/EsunaMagic.lua
Normal file
5
Data/scripts/commands/EsunaMagic.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
|
||||
player:endEvent();
|
||||
end
|
13
Data/scripts/commands/ItemMovePackageCommand.lua
Normal file
13
Data/scripts/commands/ItemMovePackageCommand.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
--[[
|
||||
|
||||
ItemMovePackageCommand Script
|
||||
|
||||
Handles moving items across item packages (IE: Taking loot)
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
13
Data/scripts/commands/ItemTransferCommand.lua
Normal file
13
Data/scripts/commands/ItemTransferCommand.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
--[[
|
||||
|
||||
ItemTransferCommand Script
|
||||
|
||||
Handles giving an item to another party member.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, targetPlayer, arg2, arg3, arg4, arg5, type9ItemIds)
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
15
Data/scripts/commands/ItemWasteCommand.lua
Normal file
15
Data/scripts/commands/ItemWasteCommand.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
--[[
|
||||
|
||||
ItemWasteCommand Script
|
||||
|
||||
Notes:
|
||||
|
||||
The param "invActionInfo" has the vars: actorId, unknown, slot, and inventoryType.
|
||||
The param "itemDBIds" has the vars: item1 and item2.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, itemReference, targetPackage, sourcePackage, arg1, arg2, unknown, arg3, arg4, arg5, type9ItemIds)
|
||||
player:GetItemPackage(itemReference.itemPackage):RemoveItemAtSlot(itemReference.slot);
|
||||
player:EndEvent();
|
||||
end
|
16
Data/scripts/commands/JournalCommand.lua
Normal file
16
Data/scripts/commands/JournalCommand.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
JournalCommand Script
|
||||
|
||||
Fired when you try to abandon a quest
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName, questId)
|
||||
|
||||
player:AbandonQuest(questId);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
12
Data/scripts/commands/LinkshellAppointCommand.lua
Normal file
12
Data/scripts/commands/LinkshellAppointCommand.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
--[[
|
||||
|
||||
LinkshellAppointCommand Script
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, linkshellName, memberName, rank)
|
||||
|
||||
GetWorldManager():RequestWorldLinkshellRankChange(player, linkshellName, memberName, rank);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
15
Data/scripts/commands/LinkshellChangeCommand.lua
Normal file
15
Data/scripts/commands/LinkshellChangeCommand.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
--[[
|
||||
|
||||
LinkshellChangeCommand Script
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, linkshellName, arg1, arg2)
|
||||
|
||||
if (linkshellName == nil) then
|
||||
linkshellName = "";
|
||||
end
|
||||
GetWorldManager():RequestWorldLinkshellChangeActive(player, linkshellName);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
14
Data/scripts/commands/LinkshellInviteCancelCommand.lua
Normal file
14
Data/scripts/commands/LinkshellInviteCancelCommand.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
--[[
|
||||
|
||||
LinkshellInviteCancelCommand Script
|
||||
|
||||
Handles what happens when you cancel an invite to a linkshell
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, arg1, arg2, arg3, arg4, actorId)
|
||||
|
||||
GetWorldManager():RequestWorldLinkshellCancelInvite(player);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
14
Data/scripts/commands/LinkshellInviteCommand.lua
Normal file
14
Data/scripts/commands/LinkshellInviteCommand.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
--[[
|
||||
|
||||
LinkshellInviteCommand Script
|
||||
|
||||
Handles what happens when you invite a player to a linkshell
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, linkshellName, arg1, arg2, arg3, actorId)
|
||||
|
||||
GetWorldManager():RequestWorldLinkshellInviteMember(player, linkshellName, actorId);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
12
Data/scripts/commands/LinkshellKickCommand.lua
Normal file
12
Data/scripts/commands/LinkshellKickCommand.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
--[[
|
||||
|
||||
LinkshellKickCommand Script
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, linkshellName, kickedName)
|
||||
|
||||
GetWorldManager():RequestWorldLinkshellKick(player, linkshellName, kickedName);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
12
Data/scripts/commands/LinkshellResignCommand.lua
Normal file
12
Data/scripts/commands/LinkshellResignCommand.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
--[[
|
||||
|
||||
LinkshellLeaveCommand Script
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, linkshellName)
|
||||
|
||||
GetWorldManager():RequestWorldLinkshellLeave(player, linkshellName);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
27
Data/scripts/commands/LogoutCommand.lua
Normal file
27
Data/scripts/commands/LogoutCommand.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
--[[
|
||||
|
||||
LogoutCommand Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventConfirm()
|
||||
eventCountDown()
|
||||
eventLogoutFade()
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, command, triggerName)
|
||||
|
||||
choice = callClientFunction(player, "delegateCommand", command, "eventConfirm");
|
||||
|
||||
if (choice == 1) then
|
||||
player:QuitGame();
|
||||
elseif (choice == 2) then
|
||||
player:Logout();
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
56
Data/scripts/commands/NegotiationCommand.lua
Normal file
56
Data/scripts/commands/NegotiationCommand.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
--[[
|
||||
|
||||
NegotiationCommand Script
|
||||
|
||||
Functions:
|
||||
|
||||
openListWidget(player, originId, 10 bools to show/hide) - Shows a list of things to Parley for based on a sequential list from xtx_negotiationTable.
|
||||
openAskWidget(player, title, difficulty, desiredItemId, requiredItemId) - Opens the widget asking if the player will Parley.
|
||||
openNegotiationWidget(player, title, itemId, maxTurns, time, ability1, ability2, ability3, ability4, ability5) - Inits the widget system (call first).
|
||||
inputNegotiationWidget(player, ?, abort, resumeTimer) - Begins player input.
|
||||
closeNegotiationWidget(player) - Closes the Parley widget.
|
||||
negotiationEmote(player, animId) - Plays an animation
|
||||
|
||||
updateNegotiationWidget(player, gridIndex, key, itemIconId, pointValue, ?, ?) - Updates the Parley UI depending on the first argument:
|
||||
|
||||
< 12: Places Item
|
||||
13: Plays SFX + ???
|
||||
14: Sets the Negotiation Gauge (max, value)
|
||||
15: Sets the Achievement Gauge (max, value)
|
||||
|
||||
16: Additional Item 1 (bool)
|
||||
17: Additional Item 2(bool)
|
||||
18: Additional Item 3(bool)
|
||||
|
||||
19: Set the last chosen items (index[1-6], iconId)
|
||||
|
||||
20:
|
||||
21:
|
||||
|
||||
22: Clear Timer
|
||||
23: Play player move SFX
|
||||
24: Play opponent move SFX
|
||||
25: Play times up SFX and close ability widget
|
||||
26:
|
||||
27:
|
||||
28: Pauses the Timer
|
||||
29: Resumes the Timer
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, arg5)
|
||||
|
||||
negotiationJudge = GetStaticActor("NegotiationJudge");
|
||||
|
||||
callClientFunction(player, "delegateCommand", negotiationJudge, "negotiationEmote", player, 403087360);
|
||||
--callClientFunction(player, "delegateCommand", negotiationJudge, "openAskWidget", player, 1302, 5, 1000019, 1000019);
|
||||
--callClientFunction(player, "delegateCommand", negotiationJudge, "openListWidget", player, 3711, true, true, true, true, false, false, false, false, false, false);
|
||||
callClientFunction(player, "delegateCommand", negotiationJudge, "openNegotiationWidget", player, 1302, 1000019, 15, 20, 0, 0, 0, 0, 0);
|
||||
callClientFunction(player, "delegateCommand", negotiationJudge, "updateNegotiationWidget", player, 2, 2007, 60662, 5, false, false);
|
||||
callClientFunction(player, "delegateCommand", negotiationJudge, "inputNegotiationWidget", player, 1, false, true);
|
||||
callClientFunction(player, "delegateCommand", negotiationJudge, "closeNegotiationWidget", player);
|
||||
|
||||
player:EndEvent();
|
||||
end
|
45
Data/scripts/commands/NpcLinkshellChatCommand.lua
Normal file
45
Data/scripts/commands/NpcLinkshellChatCommand.lua
Normal file
|
@ -0,0 +1,45 @@
|
|||
require ("global")
|
||||
|
||||
--[[
|
||||
|
||||
NpcLinkshellChatCommand Script
|
||||
|
||||
Handler for when a player clicks a npc ls to talk to. If adding new linkshells to the handle, make sure to add
|
||||
it to the handler table (with correct offset), and that your function is above the handler. If padding is needed
|
||||
to hit some ID, add "nils".
|
||||
|
||||
--]]
|
||||
|
||||
|
||||
local function handleAdventurersGuild(player)
|
||||
if (player:HasQuest(110006) == true) then
|
||||
local man0g1Quest = player:GetQuest("Man0g1");
|
||||
player:SendGameMessage(man0g1Quest, 330, 39, 1300018, nil);
|
||||
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
|
19
Data/scripts/commands/PartyBreakupCommand.lua
Normal file
19
Data/scripts/commands/PartyBreakupCommand.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
--[[
|
||||
|
||||
PartyBreakupCommand Script
|
||||
|
||||
Handles disbanding the party.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName)
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (player:IsPartyLeader()) then
|
||||
player:PartyDisband(name)
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 30540, 0x20);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
28
Data/scripts/commands/PartyDisbandCommand.lua
Normal file
28
Data/scripts/commands/PartyDisbandCommand.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
--[[
|
||||
|
||||
PartyKickCommand Script
|
||||
|
||||
Handles requesting to kick (oust) and various errors.
|
||||
|
||||
TextIds:
|
||||
|
||||
30404 - Ousted Sheet/ActorId Version
|
||||
30410 - You are Ousted
|
||||
30428 - Ousted String Version
|
||||
30540 - You are not party leader
|
||||
30555 - Unable to oust
|
||||
30575 - Cannot oust due to not pt member
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, name)
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (player:IsPartyLeader()) then
|
||||
player:PartyKickPlayer(name);
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 30540, 0x20);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
19
Data/scripts/commands/PartyInviteCommand.lua
Normal file
19
Data/scripts/commands/PartyInviteCommand.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
--[[
|
||||
|
||||
PartyInviteCommand Script
|
||||
|
||||
Handles what happens when you invite
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId)
|
||||
|
||||
if (name ~= nil) then
|
||||
GetWorldManager():CreateInvitePartyGroup(player, name);
|
||||
elseif (actorId ~= nil) then
|
||||
GetWorldManager():CreateInvitePartyGroup(player, actorId);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
32
Data/scripts/commands/PartyKickCommand.lua
Normal file
32
Data/scripts/commands/PartyKickCommand.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
--[[
|
||||
|
||||
PartyKickCommand Script
|
||||
|
||||
Handles requesting to kick (oust) and various errors.
|
||||
|
||||
TextIds:
|
||||
|
||||
30404 - Ousted Sheet/ActorId Version
|
||||
30410 - You are Ousted
|
||||
30428 - Ousted String Version
|
||||
30540 - You are not party leader
|
||||
30555 - Unable to oust
|
||||
30575 - Cannot oust due to not pt member
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, name, arg2, arg3, arg4, actorId)
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (player:IsPartyLeader()) then
|
||||
if (name == nil) then
|
||||
player:PartyOustPlayer(actorId);
|
||||
else
|
||||
player:PartyOustPlayer(name);
|
||||
end
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 30540, 0x20);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
23
Data/scripts/commands/PartyLeaderCommand.lua
Normal file
23
Data/scripts/commands/PartyLeaderCommand.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
--[[
|
||||
|
||||
PartyLeaderCommand Script
|
||||
|
||||
Handles requesting to change party leader and various errors.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, name, arg2, arg3, arg4, actorId)
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if (player:IsPartyLeader()) then
|
||||
if (name == nil) then
|
||||
player:PartyPromote(actorId);
|
||||
else
|
||||
player:PartyPromote(name);
|
||||
end
|
||||
else
|
||||
player:SendGameMessage(player, worldMaster, 30540, 0x20);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
12
Data/scripts/commands/PartyResignCommand.lua
Normal file
12
Data/scripts/commands/PartyResignCommand.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
--[[
|
||||
|
||||
PartyResignCommand Script
|
||||
|
||||
Handles leaving a party
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName)
|
||||
player:PartyLeave(name);
|
||||
player:EndEvent();
|
||||
end
|
57
Data/scripts/commands/PartyTargetCommand.lua
Normal file
57
Data/scripts/commands/PartyTargetCommand.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
--[[
|
||||
|
||||
PartyTargetCommand Script
|
||||
|
||||
Handles placing marks on targets
|
||||
|
||||
--]]
|
||||
require("global")
|
||||
|
||||
markers = { -- [id] = {overheadIcon, textIcon}
|
||||
[0] = {0, 0}, -- Clear
|
||||
[1] = {1000, 304},-- Watch my HP!
|
||||
[2] = {2000, 305},-- Watch my MP!
|
||||
[3] = {3000, 306},-- Watch my TP!
|
||||
[5] = {5000, 308},-- I need enhancing magic!
|
||||
[6] = {6000, 309},-- I am enfeebled!
|
||||
[7] = {7000, 310},-- Good!
|
||||
[8] = {8000, 311},-- Bad!
|
||||
|
||||
[100] = {-7000, 296}, -- Attack this target!
|
||||
[101] = {-6000, 297}, -- Focus on this target!
|
||||
[102] = {-5000, 298}, -- Stop this target!
|
||||
[104] = {-4000, 299}, -- Do not attack this target!
|
||||
[105] = {-3000, 300}, -- General mark Spade
|
||||
[106] = {-2000, 301}, -- General mark Club
|
||||
[107] = {-1000, 302}, -- General mark Diamond
|
||||
}
|
||||
|
||||
|
||||
function onEventStarted(player, actor, triggerName, commandValue, category, unk1, unk2, targetActor, unk3, unk4, unk5, unk6)
|
||||
|
||||
workName = "charaWork.parameterTemp.targetInformation";
|
||||
uiFunc = "charaWork/stateForAll";
|
||||
|
||||
markerIndex = markers[commandValue][1] or 0;
|
||||
iconIndex = markers[commandValue][2] or 0;
|
||||
categoryKind = tonumber(category) or -1;
|
||||
worldMaster = GetWorldMaster();
|
||||
|
||||
if categoryKind == -1 then
|
||||
return
|
||||
end
|
||||
|
||||
player:SetWorkValue(player, workName, uiFunc, markerIndex);
|
||||
|
||||
if iconIndex != 0 then
|
||||
if categoryKind == 1 then
|
||||
player:SendGameMessage(player, worldMaster, 30422, 0x20, player, iconIndex);
|
||||
elseif categoryKind == 2 then
|
||||
player:SendGameMessage(player, worldMaster, 30412, 0x20, player, iconIndex);
|
||||
end
|
||||
elseif iconIndex == 0 then
|
||||
player:SendGameMessage(player, worldMaster, 30413, 0x20, player, 0);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
26
Data/scripts/commands/PlaceDrivenCommand.lua
Normal file
26
Data/scripts/commands/PlaceDrivenCommand.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
--[[
|
||||
|
||||
PlaceDrivenCommand Script
|
||||
|
||||
Notes:
|
||||
|
||||
|
||||
--]]
|
||||
require("global")
|
||||
|
||||
function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7)
|
||||
|
||||
actor = player:GetActorInInstance(ownerActorId);
|
||||
|
||||
if (actor != nil) then
|
||||
if (actor:GetActorClassId() == 1200052) then
|
||||
player:kickEvent(actor, "commandJudgeMode", "commandJudgeMode");
|
||||
else
|
||||
printf("TEST");
|
||||
player:kickEvent(actor, "pushCommand", "pushCommand");
|
||||
end
|
||||
else
|
||||
player:endEvent();
|
||||
end
|
||||
|
||||
end
|
7
Data/scripts/commands/PointSearchAbility.lua
Normal file
7
Data/scripts/commands/PointSearchAbility.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
|
||||
|
||||
player.Cast(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end
|
5
Data/scripts/commands/RaiseMagic.lua
Normal file
5
Data/scripts/commands/RaiseMagic.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
|
||||
player:endEvent();
|
||||
end
|
9
Data/scripts/commands/RequestInformationCommand.lua
Normal file
9
Data/scripts/commands/RequestInformationCommand.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
--[[
|
||||
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, questId)
|
||||
player:SendDataPacket("requestedData", "activegl", 7, nil, nil, nil, nil, nil, nil, nil);
|
||||
-- player:SendRequestedInfo("requestedData", "glHist", 10, 0x1D4F2, 1009, 12464, 11727, 12485, 12526);
|
||||
end
|
23
Data/scripts/commands/RequestQuestJournalCommand.lua
Normal file
23
Data/scripts/commands/RequestQuestJournalCommand.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
--[[
|
||||
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, trigger, questId, mapCode)
|
||||
|
||||
quest = player:GetQuest(questId);
|
||||
|
||||
if (quest == nil) then
|
||||
player:EndEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
if (mapCode == nil) then
|
||||
player:SendDataPacket("requestedData", "qtdata", quest:GetQuestId(), quest:GetPhase());
|
||||
player:EndEvent();
|
||||
else
|
||||
player:SendDataPacket("requestedData", "qtmap", quest:GetQuestId());
|
||||
player:EndEvent();
|
||||
end
|
||||
|
||||
end
|
15
Data/scripts/commands/ShotCommand.lua
Normal file
15
Data/scripts/commands/ShotCommand.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Ability(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end;
|
19
Data/scripts/commands/SongMagic.lua
Normal file
19
Data/scripts/commands/SongMagic.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require ("global")
|
||||
require ("utils")
|
||||
|
||||
--[[
|
||||
|
||||
AttackWeaponSkill Script
|
||||
|
||||
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
||||
|
||||
--]]
|
||||
|
||||
local attackMagicHandlers = {
|
||||
|
||||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
player.Cast(command.actorId, targetActor);
|
||||
player:endEvent();
|
||||
end;
|
126
Data/scripts/commands/TeleportCommand.lua
Normal file
126
Data/scripts/commands/TeleportCommand.lua
Normal file
|
@ -0,0 +1,126 @@
|
|||
--[[
|
||||
|
||||
TeleportCommand Script
|
||||
|
||||
Functions:
|
||||
|
||||
eventRegion(numAnima)
|
||||
eventAetheryte(region, animaCost1, animaCost2, animaCost3, animaCost4, animaCost5, animaCost6)
|
||||
eventConfirm(isReturn, isInBattle, cityReturnNum, 138821, forceAskReturnOnly)
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
require ("aetheryte")
|
||||
require ("utils")
|
||||
|
||||
teleportMenuToAetheryte = {
|
||||
[1] = {
|
||||
[1] = 1280001,
|
||||
[2] = 1280002,
|
||||
[3] = 1280003,
|
||||
[4] = 1280004,
|
||||
[5] = 1280005,
|
||||
[6] = 1280006
|
||||
},
|
||||
[2] = {
|
||||
[1] = 1280092,
|
||||
[2] = 1280093,
|
||||
[3] = 1280094,
|
||||
[4] = 1280095,
|
||||
[5] = 1280096
|
||||
},
|
||||
[3] = {
|
||||
[1] = 1280061,
|
||||
[2] = 1280062,
|
||||
[3] = 1280063,
|
||||
[4] = 1280064,
|
||||
[5] = 1280065,
|
||||
[6] = 1280066
|
||||
},
|
||||
[4] = {
|
||||
[1] = 1280031,
|
||||
[2] = 1280032,
|
||||
[3] = 1280033,
|
||||
[4] = 1280034,
|
||||
[5] = 1280035,
|
||||
[6] = 1280036
|
||||
},
|
||||
[5] = {
|
||||
[1] = 1280121,
|
||||
[2] = 1280122
|
||||
}
|
||||
}
|
||||
|
||||
function onEventStarted(player, actor, triggerName, isTeleport)
|
||||
|
||||
local worldMaster = GetWorldMaster();
|
||||
|
||||
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);
|
||||
|
||||
--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]);
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
player:endEvent();
|
||||
end
|
97
Data/scripts/commands/TradeExecuteCommand.lua
Normal file
97
Data/scripts/commands/TradeExecuteCommand.lua
Normal file
|
@ -0,0 +1,97 @@
|
|||
--[[
|
||||
|
||||
TradeExecuteCommand Script
|
||||
|
||||
Handles all trading between players
|
||||
|
||||
Functions:
|
||||
|
||||
processTradeCommandOpenTray() - Opens the trade widget.
|
||||
processTradeCommandCloseTray() - Closes the trade widget.
|
||||
processTradeCommandReply(command, params) - Operates the trade widget.
|
||||
processUpdateTradeCommandTrayData() - ?
|
||||
|
||||
Commands:
|
||||
|
||||
set: TradeWidget resets "Set Mode" (turned on once item selected while waiting for reply).
|
||||
back: TradeWidget resets "Choose Mode" (turned on when ui operation is done).
|
||||
fix: You have accepted the deal.
|
||||
targetfix: Target has accepted the deal.
|
||||
doedit: You have canceled your accept.
|
||||
reedit: Target has canceled their accept.
|
||||
|
||||
--]]
|
||||
|
||||
require ("global")
|
||||
|
||||
function onEventStarted(player, actor, triggerName)
|
||||
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandOpenTray");
|
||||
|
||||
tradeOffering = player:GetTradeOfferings();
|
||||
|
||||
while (true) do
|
||||
widgetOpen, chosenOperation, tradeSlot, itemActor, quantity, itemPackageId, itemSlot = callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processUpdateTradeCommandTrayData");
|
||||
|
||||
--Abort script if client script dead
|
||||
if (widgetOpen == false or widgetOpen == nil) then
|
||||
player:FinishTradeTransaction();
|
||||
break;
|
||||
end
|
||||
|
||||
--Handle you/target canceling/finishing the trade
|
||||
if (not player:IsTrading() or not player:GetOtherTrader():IsTrading()) then
|
||||
player:FinishTradeTransaction();
|
||||
break;
|
||||
end
|
||||
|
||||
--Handle target accepting
|
||||
if (player:GetOtherTrader():IsTradeAccepted() == true) then
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "targetfix");
|
||||
else
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "reedit");
|
||||
end
|
||||
|
||||
--Check if both accepted the trade
|
||||
if (player:IsTradeAccepted() and player:GetOtherTrader():IsTradeAccepted()) then
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandCloseTray");
|
||||
GetWorldManager():CompleteTrade(player, player:GetOtherTrader());
|
||||
break;
|
||||
end
|
||||
|
||||
--Clear Item
|
||||
if (chosenOperation == 1) then
|
||||
player:RemoveTradeItem(tradeSlot - 1);
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set");
|
||||
--Clear All
|
||||
elseif (chosenOperation == 2) then
|
||||
player:ClearTradeItems();
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set");
|
||||
--Item Chosen
|
||||
elseif (chosenOperation == 3) then
|
||||
player:AddTradeItem(tradeSlot - 1, itemActor, quantity);
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set", 2, 2, 2, 2);
|
||||
--Gil Chosen
|
||||
elseif (chosenOperation == 4) then
|
||||
player:AddTradeItem(tradeSlot - 1, itemActor, quantity);
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "set");
|
||||
--Cancel
|
||||
elseif (chosenOperation == 11) then
|
||||
player:FinishTradeTransaction();
|
||||
break;
|
||||
--OK
|
||||
elseif (chosenOperation == 12) then
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "fix");
|
||||
player:AcceptTrade(true);
|
||||
--Reedit
|
||||
elseif (chosenOperation == 13) then
|
||||
callClientFunction(player, "delegateCommand", GetStaticActor("TradeExecuteCommand"), "processTradeCommandReply", "doedit");
|
||||
player:AcceptTrade(false);
|
||||
end
|
||||
|
||||
wait(1);
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
|
||||
end
|
14
Data/scripts/commands/TradeOfferCancelCommand.lua
Normal file
14
Data/scripts/commands/TradeOfferCancelCommand.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
--[[
|
||||
|
||||
TradeOfferCommand Script
|
||||
|
||||
Handles what happens a player cancels a trade
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, commandId, result)
|
||||
|
||||
GetWorldManager():CancelTrade(player);
|
||||
player:EndEvent();
|
||||
|
||||
end
|
27
Data/scripts/commands/TradeOfferCommand.lua
Normal file
27
Data/scripts/commands/TradeOfferCommand.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
--[[
|
||||
|
||||
TradeOfferCommand Script
|
||||
|
||||
Handles what happens when you invite to trade
|
||||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, actorId)
|
||||
|
||||
local otherActor = nil;
|
||||
|
||||
--ActorID Search
|
||||
if (actorId ~= nil) then
|
||||
otherActor = player:GetZone():FindActorInArea(actorId);
|
||||
--Name Search
|
||||
elseif (name ~= nil) then
|
||||
otherActor = player:GetZone():FindPCInZone(name);
|
||||
end
|
||||
|
||||
if (otherActor ~= nil) then
|
||||
GetWorldManager():CreateTradeGroup(player, otherActor);
|
||||
else
|
||||
end
|
||||
|
||||
player:EndEvent();
|
||||
end
|
18
Data/scripts/commands/ability/aegis_boon.lua
Normal file
18
Data/scripts/commands/ability/aegis_boon.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27164: Swift Aegis Boon
|
||||
if caster.HasTrait(27164) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 15000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
22
Data/scripts/commands/ability/barrage.lua
Normal file
22
Data/scripts/commands/ability/barrage.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
skill.statusMagnitude = 4;
|
||||
|
||||
--27242: Enhanced Barrage: Adds an additional attack to barrage ( 4 -> 5 )
|
||||
if caster.HasTrait(27242) then
|
||||
skill.statusMagnitude = 5;
|
||||
end
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
23
Data/scripts/commands/ability/battle_voice.lua
Normal file
23
Data/scripts/commands/ability/battle_voice.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Only the bard gets the Battle Voice effect
|
||||
if caster == target then
|
||||
local effect = GetWorldManager():GetStatusEffect(223253);
|
||||
effect.SetDuration(30);
|
||||
caster.statusEffects.AddStatusEffect(effect, caster, actionContainer);
|
||||
end
|
||||
|
||||
local effect = GetWorldManager():GetStatusEffect(223029);
|
||||
effect.SetDuration(60);
|
||||
caster.statusEffects.AddStatusEffect(effect, caster, actionContainer);
|
||||
end;
|
31
Data/scripts/commands/ability/berserk.lua
Normal file
31
Data/scripts/commands/ability/berserk.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27205: Enhanced Berserk: Increases the effect of Berserk by 20%
|
||||
if caster.HasTrait(27205) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--223207: Berserk
|
||||
--223208: Rampage
|
||||
--Remove Rampage effect. I'm assuming no message is sent like LNC surges
|
||||
caster.statusEffects.RemoveStatusEffect(223208);
|
||||
|
||||
--If caster has berserk already, remove it and send a message.
|
||||
local buff = caster.statusEffects.GetStatusEffectById(223207)
|
||||
|
||||
if buff ~= nil then
|
||||
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
|
||||
else
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end
|
||||
end;
|
19
Data/scripts/commands/ability/blindside.lua
Normal file
19
Data/scripts/commands/ability/blindside.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27121: Enhanced Blindside
|
||||
if caster.HasTrait(27121) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
39
Data/scripts/commands/ability/blissful_mind.lua
Normal file
39
Data/scripts/commands/ability/blissful_mind.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27362: Enhanced Blissful Mind
|
||||
if caster.HasTrait(27362) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Blissful Mind
|
||||
--223228: Blissful Mind
|
||||
--223242: Fully Blissful Mind
|
||||
local buff = caster.statusEffects.GetStatusEffectById(223228) or caster.statusEffects.GetStatusEffectById(223242);
|
||||
|
||||
--If we have a buff then Blissful Mind removes that buff and restores MP. Otherwise, it adds the Blissful Mind effect
|
||||
if buff ~= nil then
|
||||
local amount = buff.GetExtra();
|
||||
caster.AddMP(amount);
|
||||
|
||||
actionContainer.AddMPAction(caster.actorId, 33007, amount);
|
||||
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
|
||||
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
|
||||
local amount = caster.GetHP() * 0.25;
|
||||
|
||||
caster.DelHP(amount, actionContainer);
|
||||
skill.statusMagnitude = amount;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end
|
||||
end;
|
24
Data/scripts/commands/ability/blood_for_blood.lua
Normal file
24
Data/scripts/commands/ability/blood_for_blood.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27283: Enhanced Blood for Blood: Increases damage dealt to enemies by B4B by 25%
|
||||
if caster.HasTrait(27283) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
|
||||
--27284: Swift Blood for Blood: Reduces recast time of B4B by 15 seconds
|
||||
if caster.HasTrait(27284) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 15000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/bloodbath.lua
Normal file
19
Data/scripts/commands/ability/bloodbath.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27202: Swift Bloodbath
|
||||
if caster.HasTrait(27202) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 15000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
20
Data/scripts/commands/ability/chameleon.lua
Normal file
20
Data/scripts/commands/ability/chameleon.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27245: Swift Chameleon
|
||||
if caster.HasTrait(27245) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 60000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Need a way to get all targets with hate for player
|
||||
--target.hateContainer.UpdateHate(caster, -840);
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
21
Data/scripts/commands/ability/cleric_stance.lua
Normal file
21
Data/scripts/commands/ability/cleric_stance.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
local buff = caster.statusEffects.GetStatusEffectById(223227)
|
||||
|
||||
if buff ~= nil then
|
||||
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
|
||||
else
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end
|
||||
end;
|
19
Data/scripts/commands/ability/collusion.lua
Normal file
19
Data/scripts/commands/ability/collusion.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--8032701: Fighter's Gauntlets: Reduces Collusion cooldown by 10 seconds
|
||||
if caster.HasItemEquippedInSlot(8032701, 13) then
|
||||
skill.recastTimeMs = skill.recastTimeMs - 10000;
|
||||
end
|
||||
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
20
Data/scripts/commands/ability/convert.lua
Normal file
20
Data/scripts/commands/ability/convert.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
newMP = math.min(caster.GetHP(), caster.GetMaxMP())
|
||||
newHP = math.min(caster.GetMP(), caster.GetMaxHP())
|
||||
caster.SetHP(newHP)
|
||||
caster.SetMP(newMP)
|
||||
|
||||
--Set effect id
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
24
Data/scripts/commands/ability/cover.lua
Normal file
24
Data/scripts/commands/ability/cover.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--This is for the "Cover" effect the caster receives.
|
||||
local coverTier = 1
|
||||
--8032701: Gallant Surcoat: Enhances Cover
|
||||
if caster.HasItemEquippedInSlot(8032701, 10) then
|
||||
coverTier = 2;
|
||||
end
|
||||
|
||||
caster.statusEffects.AddStatusEffect(223063, coverTier, 0, 15, 0);
|
||||
|
||||
--Apply Covered to target
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/dark_seal.lua
Normal file
19
Data/scripts/commands/ability/dark_seal.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27320: Swift Dark Seal
|
||||
if caster.HasTrait(27320) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 30000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/decoy.lua
Normal file
19
Data/scripts/commands/ability/decoy.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27244: Enhanced Decoy: Renders Decoy capable of evading melee attacks
|
||||
if caster.HasTrait(27244) then
|
||||
ability.statusId = 223238;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
17
Data/scripts/commands/ability/default.lua
Normal file
17
Data/scripts/commands/ability/default.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, skill)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, skill)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
20
Data/scripts/commands/ability/divine_veil.lua
Normal file
20
Data/scripts/commands/ability/divine_veil.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--8051401: Gallant Cuisses
|
||||
if caster.HasItemEquippedInSlot(8051401, 12) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
16
Data/scripts/commands/ability/dragonfire_dive.lua
Normal file
16
Data/scripts/commands/ability/dragonfire_dive.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.amount = skill.basePotency;
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
29
Data/scripts/commands/ability/dread_spike.lua
Normal file
29
Data/scripts/commands/ability/dread_spike.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Need a better way to do this
|
||||
|
||||
for i = 223212,223217 do
|
||||
local buff = caster.statusEffects.GetStatusEffectById(i);
|
||||
|
||||
if buff ~= nil then
|
||||
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
|
||||
skill.statusTier = 2;
|
||||
break;
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
16
Data/scripts/commands/ability/elusive_jump.lua
Normal file
16
Data/scripts/commands/ability/elusive_jump.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--How to do enmity?
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/enduring_march.lua
Normal file
19
Data/scripts/commands/ability/enduring_march.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27203: Enhanced Outmaneuver
|
||||
if caster.HasTrait(27203) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/excruciate.lua
Normal file
19
Data/scripts/commands/ability/excruciate.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27321: Enhanced Excruciate: Increases critical rate bonus from Excruciate.
|
||||
if caster.HasTrait(27321) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/featherfoot.lua
Normal file
19
Data/scripts/commands/ability/featherfoot.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27123: Enhanced Featherfoot
|
||||
if caster.HasTrait(27123) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/fists_of_earth.lua
Normal file
19
Data/scripts/commands/ability/fists_of_earth.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27124: Enhanced Fists of Earth
|
||||
if caster.HasTrait(27125) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/fists_of_fire.lua
Normal file
19
Data/scripts/commands/ability/fists_of_fire.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27124: Enhanced Fists of Fire
|
||||
if caster.HasTrait(27124) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/fists_of_wind.lua
Normal file
19
Data/scripts/commands/ability/fists_of_wind.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27124: Enhanced Fists of Fire
|
||||
if caster.HasTrait(27124) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
27
Data/scripts/commands/ability/flash.lua
Normal file
27
Data/scripts/commands/ability/flash.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27161: Enhanced Flash: Adds Blind effect to flash
|
||||
if caster.HasTrait(27161) then
|
||||
ability.statusChance = 1;
|
||||
end
|
||||
|
||||
--27162: Enhanced Flash II: Expands Flash to affect enemies near target
|
||||
if caster.HasTrait(27162) then
|
||||
ability.aoeTarget = TargetFindAOEType.Circle;
|
||||
end
|
||||
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.enmity = 400;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/foresight.lua
Normal file
19
Data/scripts/commands/ability/foresight.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27201: Swift Foresight
|
||||
if caster.HasTrait(27201) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 15000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
28
Data/scripts/commands/ability/hallowed_ground.lua
Normal file
28
Data/scripts/commands/ability/hallowed_ground.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27245: Swift Chameleon
|
||||
if caster.HasTrait(27245) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 60000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--Get all targets with hate on caster and spread 1140 enmity between them.
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--[[
|
||||
local enemies = caster.GetTargetsWithHate()
|
||||
local enmity = 1140 / enemies.Count
|
||||
for enemy in enemies do
|
||||
enemy.hateContainer.updateHate(enmity);
|
||||
end]]
|
||||
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/hawks_eye.lua
Normal file
19
Data/scripts/commands/ability/hawks_eye.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27240: Enhanced Hawks Eye
|
||||
--Increases accuracy gained by 50%. (Hawks Eye normally gives 12.5% of your accuracy, Traited it gives 18.75%)
|
||||
if caster.HasTrait(27240) then
|
||||
ability.statusTier = 2
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
17
Data/scripts/commands/ability/hundred_fists.lua
Normal file
17
Data/scripts/commands/ability/hundred_fists.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
require("modifiers");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Take off 1/3 of attack delay. Not sure if this is the exact amount HF reduces by
|
||||
skill.statusMagnitude = 0.33 * caster.GetMod(modifiersGlobal.Delay);
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
29
Data/scripts/commands/ability/invigorate.lua
Normal file
29
Data/scripts/commands/ability/invigorate.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require("global");
|
||||
require("Ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27280: Enhanced Invigorate: Increases duration of Invigorate by 15 seconds
|
||||
if caster.HasTrait(27280) then
|
||||
ability.statusDuration = ability.statusDuration + 15;
|
||||
end
|
||||
|
||||
--Drachen Mail: Increases Invigorate TP tick from 100 to 120.
|
||||
local magnitude = 100;
|
||||
|
||||
--8032704: Drachen Mail
|
||||
if caster.HasItemEquippedInSlot(8032704, 10) then
|
||||
magnitude = 120;
|
||||
end
|
||||
|
||||
ability.statusMagnitude = magnitude;
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
17
Data/scripts/commands/ability/jump.lua
Normal file
17
Data/scripts/commands/ability/jump.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/keen_flurry.lua
Normal file
19
Data/scripts/commands/ability/keen_flurry.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27285: Enhanced Keen Flurry: Reduces recast time of WS used during KF by 50%
|
||||
if caster.HasTrait(27285) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
52
Data/scripts/commands/ability/life_surge.lua
Normal file
52
Data/scripts/commands/ability/life_surge.lua
Normal file
|
@ -0,0 +1,52 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27282: Enhanced Life Surge: Increases effect of Life Surge by 20%
|
||||
if caster.HasTrait(27282) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Need a better way to do this
|
||||
--223212: Power Surge I
|
||||
--223213: Power Surge II
|
||||
--223212: Power Surge III
|
||||
--No message is sent when PS is removed by Life Surge
|
||||
caster.statusEffects.RemoveStatusEffect(223212);
|
||||
caster.statusEffects.RemoveStatusEffect(223213);
|
||||
caster.statusEffects.RemoveStatusEffect(223214);
|
||||
|
||||
|
||||
--Using this ability moves to the next LS buff
|
||||
local removeId = 0;
|
||||
--223215: Life Surge I
|
||||
--223216: Life Surge II
|
||||
--223217: Life Surge III
|
||||
if caster.statusEffects.HasStatusEffect(223215) then
|
||||
removeId = 223215;
|
||||
skill.statusId = 223216;
|
||||
skill.statusTier = 2;
|
||||
elseif caster.statusEffects.HasStatusEffect(223216) then
|
||||
removeId = 223216;
|
||||
skill.statusId = 223217;
|
||||
skill.statusTier = 3;
|
||||
elseif caster.statusEffects.HasStatusEffect(223217) then
|
||||
effect = caster.statusEffects.GetStatusEffectById(223217)
|
||||
effect.RefreshTime();
|
||||
skill.statusId = 223217;
|
||||
end
|
||||
|
||||
if not (removeId == 0) then
|
||||
caster.statusEffects.ReplaceEffect(caster.statusEffects.GetStatusEffectById(removeId), skill.statusId, skill.statusTier, skill.statusMagnitude, skill.statusDuration);
|
||||
end
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
20
Data/scripts/commands/ability/light_shot.lua
Normal file
20
Data/scripts/commands/ability/light_shot.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--For some reason, light shot's hitNum is always 1 (or 0, idk), even with barrage.
|
||||
--If you set the hitnum like any other multi-hit WS it will play the animation repeatedly.
|
||||
action.hitNum = 1;
|
||||
|
||||
action.amount = skill.basePotency;
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/necrogenesis.lua
Normal file
19
Data/scripts/commands/ability/necrogenesis.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27322: Swift Dark Seal
|
||||
if caster.HasTrait(27322) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 30000;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/outmaneuver.lua
Normal file
19
Data/scripts/commands/ability/outmaneuver.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27164: Enhanced Outmaneuver
|
||||
if caster.HasTrait(27164) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
Data/scripts/commands/ability/parsimony.lua
Normal file
19
Data/scripts/commands/ability/parsimony.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27323: Enhanced Parsimony: Increases MP gained from Parsimony by 25%
|
||||
if caster.HasTrait(27323) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
30
Data/scripts/commands/ability/power_surge.lua
Normal file
30
Data/scripts/commands/ability/power_surge.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27281: Enhanced Power Surge: Increases effect of Power Surge by 50%
|
||||
if caster.HasTrait(27281) then
|
||||
ability.statusTier = 2;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
caster.statusEffects.RemoveStatusEffect(223215);
|
||||
caster.statusEffects.RemoveStatusEffect(223216);
|
||||
caster.statusEffects.RemoveStatusEffect(223217);
|
||||
|
||||
--If caster has any of the power surge effects
|
||||
local buff = caster.statusEffects.GetStatusEffectById(223212) or caster.statusEffects.GetStatusEffectById(223213) or caster.statusEffects.GetStatusEffectById(223214);
|
||||
|
||||
if buff ~= nil then
|
||||
caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329);
|
||||
else
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end
|
||||
end;
|
21
Data/scripts/commands/ability/provoke.lua
Normal file
21
Data/scripts/commands/ability/provoke.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27200: Enhanced Provoke: Adds Attack Down effect to Provoke.
|
||||
if caster.HasTrait(27200) then
|
||||
ability.statusChance = 1.0;
|
||||
end
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--http://forum.square-enix.com/ffxiv/threads/47393-Tachi-s-Guide-to-Paladin-%28post-1.22b%29
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.enmity = 750;
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue