mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Merge branch 'ai-open' into develop
# Conflicts: # FFXIVClassic Lobby Server/Database.cs # FFXIVClassic Map Server/Database.cs # FFXIVClassic Map Server/FFXIVClassic Map Server.csproj # FFXIVClassic Map Server/actors/chara/player/Inventory.cs # FFXIVClassic Map Server/actors/chara/player/Player.cs # FFXIVClassic Map Server/dataobjects/Session.cs # FFXIVClassic World Server/Server.cs
This commit is contained in:
commit
1e4a1cf263
402 changed files with 20078 additions and 1348 deletions
58
data/scripts/ability.lua
Normal file
58
data/scripts/ability.lua
Normal file
|
@ -0,0 +1,58 @@
|
|||
-- todo: add enums for status effects in global.lua
|
||||
require("global")
|
||||
require("battleutils")
|
||||
|
||||
--[[
|
||||
statId - see BattleTemp.cs
|
||||
modifier - Modifier.Intelligence, Modifier.Mind (see Modifier.cs)
|
||||
multiplier -
|
||||
]]
|
||||
function HandleHealingSkill(caster, target, skill, action, statId, modifierId, multiplier, baseAmount)
|
||||
potency = potency or 1.0;
|
||||
healAmount = baseAmount;
|
||||
|
||||
-- todo: shit based on mnd
|
||||
local mind = caster.GetMod(Modifier.Mind);
|
||||
end;
|
||||
|
||||
function HandleAttackSkill(caster, target, skill, action, statId, modifierId, multiplier, baseAmount)
|
||||
-- todo: actually handle this
|
||||
damage = baseAmount or math.random(1,10) * 10;
|
||||
|
||||
return damage;
|
||||
end;
|
||||
|
||||
function HandleStoneskin(caster, target, skill, action, statId, modifierId, damage)
|
||||
--[[
|
||||
if target.statusEffects.HasStatusEffect(StatusEffect.Stoneskin) then
|
||||
-- todo: damage reduction
|
||||
return true;
|
||||
end;
|
||||
]]
|
||||
return false;
|
||||
end;
|
||||
|
||||
--For abilities that inflict statuses, like aegis boon or taunt
|
||||
function onStatusAbilityFinish(caster, target, skill, action)
|
||||
--action.CalcHitType(caster, target, skill);
|
||||
action.DoAction(caster, target, skill);
|
||||
action.TryStatus(caster, target, skill, false);
|
||||
|
||||
return action.amount;
|
||||
end;
|
||||
|
||||
function onAttackAbilityFinish(caster, target, skill, action)
|
||||
local damage = math.random(50, 150);
|
||||
action.amount = damage;
|
||||
action.DoAction(caster, target, skill);
|
||||
|
||||
return action.amount;
|
||||
end;
|
||||
|
||||
function onHealAbilityFinish(caster, target, skill, action)
|
||||
local amount = math.random(150, 250);
|
||||
action.amount = amount;
|
||||
action.DoAction(caster, target, skill);
|
||||
action.TryStatus(caster, target, skill, true);
|
||||
return action.amount;
|
||||
end;
|
117
data/scripts/ally.lua
Normal file
117
data/scripts/ally.lua
Normal file
|
@ -0,0 +1,117 @@
|
|||
require ("global")
|
||||
require ("magic")
|
||||
require ("weaponskill")
|
||||
|
||||
allyGlobal =
|
||||
{
|
||||
}
|
||||
|
||||
function allyGlobal.onSpawn(ally, target)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.onEngage(ally, target)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.onAttack(ally, target, damage)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.onDamageTaken(ally, attacker, damage)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas)
|
||||
allyGlobal.HelpPlayers(ally, contentGroupCharas)
|
||||
end
|
||||
|
||||
function allyGlobal.onDeath(ally, player, lastAttacker)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.onDespawn(ally)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.HelpPlayers(ally, contentGroupCharas, pickRandomTarget)
|
||||
print("helpPlayers");
|
||||
if contentGroupCharas and not ally.IsEngaged() then
|
||||
print("contentGroup exists");
|
||||
for chara in contentGroupCharas do
|
||||
print("looping");
|
||||
if chara then
|
||||
-- probably a player, or another ally
|
||||
-- todo: queue support actions, heal, try pull hate off player etc
|
||||
if chara.IsPlayer() then
|
||||
print("chara is a player");
|
||||
-- do stuff
|
||||
if not ally.IsEngaged() then
|
||||
if chara.IsEngaged() then
|
||||
allyGlobal.EngageTarget(ally, chara.target, nil);
|
||||
break;
|
||||
end
|
||||
end
|
||||
elseif chara.IsMonster() and chara.IsEngaged() then
|
||||
if not ally.IsEngaged() then
|
||||
print("Engaging monster that is engaged");
|
||||
allyGlobal.EngageTarget(ally, chara, nil);
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function allyGlobal.tryAggro(ally, contentGroupCharas)
|
||||
local count = 0;
|
||||
if contentGroupCharas and not ally.IsEngaged() then
|
||||
for i = 0, #contentGroupCharas - 1 do
|
||||
if contentGroupCharas[i] and ally then
|
||||
if contentGroupCharas[i].IsPlayer() then
|
||||
-- probably a player, or another ally
|
||||
-- todo: queue support actions, heal, try pull hate off player etc
|
||||
if contentGroupCharas[i].target then
|
||||
if ally.aiContainer:GetTargetFind():CanTarget(contentGroupCharas[i].target) and contentGroupCharas[i].target.IsMonster() and contentGroupCharas[i].target.hateContainer:HasHateForTarget(contentGroupCharas[i]) then
|
||||
-- do stuff
|
||||
allyGlobal.EngageTarget(ally, contentGroupCharas[i].target, nil);
|
||||
break;
|
||||
end
|
||||
end
|
||||
elseif contentGroupCharas[i].IsMonster() and contentGroupCharas[i].IsEngaged() then
|
||||
if not ally.IsEngaged() then
|
||||
print("Engaging monster that is engaged");
|
||||
allyGlobal.EngageTarget(ally, contentGroupCharas[i], nil);
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function allyGlobal.HealPlayer(ally, player)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.SupportAction(ally, player)
|
||||
|
||||
end
|
||||
|
||||
function allyGlobal.EngageTarget(ally, target, contentGroupCharas)
|
||||
if contentGroupCharas then
|
||||
for chara in contentGroupCharas do
|
||||
if chara.IsMonster() then
|
||||
if chara.allegiance ~= ally.allegiance then
|
||||
ally.Engage(chara)
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif target then
|
||||
print("Engaging");
|
||||
ally.Engage(target)
|
||||
ally.hateContainer.AddBaseHate(target);
|
||||
end
|
||||
end
|
175
data/scripts/battlenpc.lua
Normal file
175
data/scripts/battlenpc.lua
Normal file
|
@ -0,0 +1,175 @@
|
|||
local initClassItems, initRaceItems;
|
||||
|
||||
function onBeginLogin(player)
|
||||
--New character, set the initial quest
|
||||
if (player:GetPlayTime(false) == 0) then
|
||||
initialTown = player:GetInitialTown();
|
||||
|
||||
if (initialTown == 1 and player:HasQuest(110001) == false) then
|
||||
player:AddQuest(110001);
|
||||
player:SetHomePoint(1280001);
|
||||
elseif (initialTown == 2 and player:HasQuest(110005) == false) then
|
||||
player:AddQuest(110005);
|
||||
player:SetHomePoint(1280061);
|
||||
elseif (initialTown == 3 and player:HasQuest(110009) == false) then
|
||||
player:AddQuest(110009);
|
||||
player:SetHomePoint(1280031);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--For Opening. Set Director and reset position incase d/c
|
||||
if (player:HasQuest(110001) == true and player:GetZoneID() == 193) then
|
||||
director = player:GetZone():CreateDirector("OpeningDirector", false);
|
||||
player:AddDirector(director);
|
||||
director:StartDirector(true);
|
||||
player:SetLoginDirector(director);
|
||||
player:KickEvent(director, "noticeEvent", true);
|
||||
|
||||
player.positionX = 0.016;
|
||||
player.positionY = 10.35;
|
||||
player.positionZ = -36.91;
|
||||
player.rotation = 0.025;
|
||||
player:GetQuest(110001):ClearQuestData();
|
||||
player:GetQuest(110001):ClearQuestFlags();
|
||||
elseif (player:HasQuest(110005) == true and player:GetZoneID() == 166) then
|
||||
director = player:GetZone():CreateDirector("OpeningDirector", false);
|
||||
player:AddDirector(director);
|
||||
director:StartDirector(false);
|
||||
player:SetLoginDirector(director);
|
||||
player:KickEvent(director, "noticeEvent", true);
|
||||
|
||||
player.positionX = 369.5434;
|
||||
player.positionY = 4.21;
|
||||
player.positionZ = -706.1074;
|
||||
player.rotation = -1.26721;
|
||||
player:GetQuest(110005):ClearQuestData();
|
||||
player:GetQuest(110005):ClearQuestFlags();
|
||||
elseif (player:HasQuest(110009) == true and player:GetZoneID() == 184) then
|
||||
--director = player:GetZone():CreateDirector("OpeningDirector", false);
|
||||
--player:AddDirector(director);
|
||||
--director:StartDirector(false);
|
||||
--player:SetLoginDirector(director);
|
||||
--player:KickEvent(director, "noticeEvent", true);
|
||||
--
|
||||
player.positionX = 5.364327;
|
||||
player.positionY = 196.0;
|
||||
player.positionZ = 133.6561;
|
||||
player.rotation = -2.849384;
|
||||
player:GetQuest(110009):ClearQuestData();
|
||||
player:GetQuest(110009):ClearQuestFlags();
|
||||
end
|
||||
end
|
||||
|
||||
function onLogin(player)
|
||||
|
||||
if (player:GetPlayTime(false) == 0) then
|
||||
player:SendMessage(0x1D,"",">PlayTime == 0, new player!");
|
||||
|
||||
initClassItems(player);
|
||||
initRaceItems(player);
|
||||
|
||||
player:SavePlayTime();
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function initClassItems(player)
|
||||
|
||||
local slotTable;
|
||||
local invSlotTable;
|
||||
|
||||
--DoW
|
||||
if (player.charaWork.parameterSave.state_mainSkill[0] == 2) then --PUG
|
||||
player:GetInventory(0):AddItem({4020001, 8030701, 8050728, 8080601, 8090307});
|
||||
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 3) then --GLA
|
||||
player:GetInventory(0):AddItem({4030010, 8031120, 8050245, 8080601, 8090307});
|
||||
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 4) then --MRD
|
||||
player:GetInventory(0):AddItem({4040001, 8011001, 8050621, 8070346, 8090307});
|
||||
player:GetEquipment():SetEquipment({0, 8, 12, 13, 15},{0, 1, 2, 3, 4});
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 7) then --ARC
|
||||
player:GetInventory(0):AddItem({4070001, 8030601, 8050622, 8080601, 8090307});
|
||||
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 8) then --LNC
|
||||
player:GetInventory(0):AddItem({4080201, 8030801, 8051015, 8080501, 8090307});
|
||||
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
|
||||
--DoM
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 22) then --THM
|
||||
player:GetInventory(0):AddItem({5020001, 8030245, 8050346, 8080346, 8090208});
|
||||
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 23) then --CNJ
|
||||
player:GetInventory(0):AddItem({5030101, 8030445, 8050031, 8080246, 8090208});
|
||||
player:GetEquipment():SetEquipment({0, 10, 12, 14, 15},{0, 1, 2, 3, 4});
|
||||
|
||||
--DoH
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 29) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 30) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 31) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 32) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 33) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 34) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 35) then --
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 36) then --
|
||||
|
||||
--DoL
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 39) then --MIN
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 40) then --BTN
|
||||
elseif (player.charaWork.parameterSave.state_mainSkill[0] == 41) then --FSH
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function initRaceItems(player)
|
||||
|
||||
if (player.playerWork.tribe == 1) then --Hyur Midlander Male
|
||||
player:GetInventory(0):AddItem(8040001);
|
||||
player:GetInventory(0):AddItem(8060001);
|
||||
elseif (player.playerWork.tribe == 2) then --Hyur Midlander Female
|
||||
player:GetInventory(0):AddItem(8040002);
|
||||
player:GetInventory(0):AddItem(8060002);
|
||||
elseif (player.playerWork.tribe == 3) then --Hyur Highlander Male
|
||||
player:GetInventory(0):AddItem(8040003);
|
||||
player:GetInventory(0):AddItem(8060003);
|
||||
elseif (player.playerWork.tribe == 4) then --Elezen Wildwood Male
|
||||
player:GetInventory(0):AddItem(8040004);
|
||||
player:GetInventory(0):AddItem(8060004);
|
||||
elseif (player.playerWork.tribe == 5) then --Elezen Wildwood Female
|
||||
player:GetInventory(0):AddItem(8040006);
|
||||
player:GetInventory(0):AddItem(8060006);
|
||||
elseif (player.playerWork.tribe == 6) then --Elezen Duskwight Male
|
||||
player:GetInventory(0):AddItem(8040005);
|
||||
player:GetInventory(0):AddItem(8060005);
|
||||
elseif (player.playerWork.tribe == 7) then --Elezen Duskwight Female
|
||||
player:GetInventory(0):AddItem(8040007);
|
||||
player:GetInventory(0):AddItem(8060007);
|
||||
elseif (player.playerWork.tribe == 8) then --Lalafell Plainsfolk Male
|
||||
player:GetInventory(0):AddItem(8040008);
|
||||
player:GetInventory(0):AddItem(8060008);
|
||||
elseif (player.playerWork.tribe == 9) then --Lalafell Plainsfolk Female
|
||||
player:GetInventory(0):AddItem(8040010);
|
||||
player:GetInventory(0):AddItem(8060010);
|
||||
elseif (player.playerWork.tribe == 10) then --Lalafell Dunesfolk Male
|
||||
player:GetInventory(0):AddItem(8040009);
|
||||
player:GetInventory(0):AddItem(8060009);
|
||||
elseif (player.playerWork.tribe == 11) then --Lalafell Dunesfolk Female
|
||||
player:GetInventory(0):AddItem(8040011);
|
||||
player:GetInventory(0):AddItem(8060011);
|
||||
elseif (player.playerWork.tribe == 12) then --Miqo'te Seekers of the Sun
|
||||
player:GetInventory(0):AddItem(8040012);
|
||||
player:GetInventory(0):AddItem(8060012);
|
||||
elseif (player.playerWork.tribe == 13) then --Miqo'te Seekers of the Moon
|
||||
player:GetInventory(0):AddItem(8040013);
|
||||
player:GetInventory(0):AddItem(8060013);
|
||||
elseif (player.playerWork.tribe == 14) then --Roegadyn Sea Wolf
|
||||
player:GetInventory(0):AddItem(8040014);
|
||||
player:GetInventory(0):AddItem(8060014);
|
||||
elseif (player.playerWork.tribe == 15) then --Roegadyn Hellsguard
|
||||
player:GetInventory(0):AddItem(8040015);
|
||||
player:GetInventory(0):AddItem(8060015);
|
||||
end
|
||||
|
||||
player:GetEquipment():SetEquipment({9, 11},{5,6});
|
||||
|
||||
end
|
64
data/scripts/battleutils.lua
Normal file
64
data/scripts/battleutils.lua
Normal file
|
@ -0,0 +1,64 @@
|
|||
CommandType =
|
||||
{
|
||||
None = 0,
|
||||
AutoAttack = 1,
|
||||
Weaponskill = 2,
|
||||
Ability = 3,
|
||||
Spell = 4
|
||||
}
|
||||
|
||||
ActionType =
|
||||
{
|
||||
None = 0,
|
||||
Physical = 1,
|
||||
Magic = 2,
|
||||
Heal = 3,
|
||||
Status = 4
|
||||
}
|
||||
|
||||
ActionProperty =
|
||||
{
|
||||
None = 0,
|
||||
Physical = 1,
|
||||
Magic = 2,
|
||||
Heal = 4,
|
||||
Status = 8,
|
||||
Ranged = 16
|
||||
}
|
||||
|
||||
DamageTakenType =
|
||||
{
|
||||
None,
|
||||
Attack,
|
||||
Magic,
|
||||
Weaponskill,
|
||||
Ability
|
||||
}
|
||||
|
||||
HitDirection =
|
||||
{
|
||||
None = 0,
|
||||
Front = 1,
|
||||
Right = 2,
|
||||
Rear = 4,
|
||||
Left = 8
|
||||
}
|
||||
|
||||
HitType =
|
||||
{
|
||||
Miss = 0,
|
||||
Evade = 1,
|
||||
Parry = 2,
|
||||
Block = 3,
|
||||
Resist = 4,
|
||||
Hit = 5,
|
||||
Crit = 6
|
||||
}
|
||||
|
||||
TargetFindAOEType =
|
||||
{
|
||||
None = 0,
|
||||
Circle = 1,
|
||||
Cone = 2,
|
||||
Box = 3
|
||||
}
|
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
|
|
@ -8,15 +8,13 @@ Switches between active and passive mode states
|
|||
|
||||
--]]
|
||||
|
||||
function onEventStarted(player, command, triggerName)
|
||||
|
||||
if (player:GetState() == 0) then
|
||||
player:ChangeState(2);
|
||||
elseif (player:GetState() == 2) then
|
||||
player:ChangeState(0);
|
||||
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
|
||||
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;
|
|
@ -9,80 +9,6 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti
|
|||
|
||||
--]]
|
||||
|
||||
local function handlePummel(player, target)
|
||||
player:SendMessage(0x20, "", "DOING PUMMEL!!!!");
|
||||
|
||||
params = {};
|
||||
params.range = 10.0;
|
||||
params.recast = 10;
|
||||
|
||||
params.hpCost = 0;
|
||||
params.mpCost = 0;
|
||||
params.tpCost = 1000;
|
||||
|
||||
params.targetType = 2;
|
||||
params.canCrit = true;
|
||||
params.animationId = 0x12312312;
|
||||
|
||||
|
||||
end
|
||||
|
||||
local function handleSkullSunder(player)
|
||||
player:SendMessage(0x20, "", "DOING SKULL SUNDER!!!!");
|
||||
end
|
||||
|
||||
local weaponskillHandlers = {
|
||||
[0xA0F069E6] = handlePummel,
|
||||
[0xA0F069E7] = nil,
|
||||
[0xA0F069E8] = nil,
|
||||
[0xA0F069E9] = nil,
|
||||
[0xA0F069EA] = nil,
|
||||
[0xA0F069EB] = nil,
|
||||
[0xA0F069EC] = nil,
|
||||
[0xA0F069ED] = nil,
|
||||
[0xA0F069EE] = nil,
|
||||
[0xA0F069EF] = nil,
|
||||
[0xA0F06A0E] = nil,
|
||||
[0xA0F06A0F] = nil,
|
||||
[0xA0F06A10] = nil,
|
||||
[0xA0F06A11] = nil,
|
||||
[0xA0F06A12] = nil,
|
||||
[0xA0F06A13] = nil,
|
||||
[0xA0F06A14] = nil,
|
||||
[0xA0F06A15] = nil,
|
||||
[0xA0F06A16] = nil,
|
||||
[0xA0F06A17] = nil,
|
||||
[0xA0F06A36] = nil,
|
||||
[0xA0F06A37] = handleSkullSunder,
|
||||
[0xA0F06A38] = nil,
|
||||
[0xA0F06A39] = nil,
|
||||
[0xA0F06A3A] = nil,
|
||||
[0xA0F06A3B] = nil,
|
||||
[0xA0F06A3C] = nil,
|
||||
[0xA0F06A3D] = nil,
|
||||
[0xA0F06A3E] = nil,
|
||||
[0xA0F06A3F] = nil,
|
||||
[0xA0F06A5C] = nil,
|
||||
[0xA0F06A5D] = nil,
|
||||
[0xA0F06A5E] = nil,
|
||||
[0xA0F06A60] = nil,
|
||||
[0xA0F06A61] = nil,
|
||||
[0xA0F06A62] = nil,
|
||||
[0xA0F06A63] = nil,
|
||||
[0xA0F06A64] = nil,
|
||||
[0xA0F06A85] = nil,
|
||||
[0xA0F06A86] = nil,
|
||||
[0xA0F06A87] = nil,
|
||||
[0xA0F06A88] = nil,
|
||||
[0xA0F06A89] = nil,
|
||||
[0xA0F06A8A] = nil,
|
||||
[0xA0F06A8B] = nil,
|
||||
[0xA0F06A8C] = nil,
|
||||
[0xA0F06A8D] = nil,
|
||||
[0xA0F06A8E] = nil,
|
||||
[0xA0F06A8F] = nil
|
||||
}
|
||||
|
||||
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
||||
|
||||
--Are they in active mode?
|
||||
|
@ -92,27 +18,9 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta
|
|||
return;
|
||||
end
|
||||
|
||||
--Does the target exist
|
||||
target = player:getZone():FindActorInArea(targetActor);
|
||||
if (target == nil) then
|
||||
player:SendGameMessage(GetWorldMaster(), 30203, 0x20);
|
||||
player:endEvent();
|
||||
return;
|
||||
end
|
||||
|
||||
--Are you too far away?
|
||||
if (getDistanceBetweenActors(player, target) > 7) then
|
||||
player:SendGameMessage(GetWorldMaster(), 32539, 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
|
||||
if not player.aiContainer.IsEngaged() then
|
||||
player.Engage(targetActor);
|
||||
end;
|
||||
player.WeaponSkill(command.actorId, targetActor);
|
||||
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
|
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;
|
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
|
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
|
|
@ -145,6 +145,12 @@ function equipItem(player, equipSlot, item)
|
|||
--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():Equip(equipSlot, item);
|
||||
|
||||
if (equipSlot == EQUIPSLOT_MAINHAND and gItem:IsNailWeapon() == false) then graphicSlot = GRAPHICSLOT_MAINHAND;
|
||||
|
@ -170,14 +176,7 @@ function equipItem(player, equipSlot, item)
|
|||
elseif (equipSlot == EQUIPSLOT_EARS) then
|
||||
player:GraphicChange(GRAPHICSLOT_R_EAR, item);
|
||||
player:GraphicChange(GRAPHICSLOT_L_EAR, item);
|
||||
end
|
||||
|
||||
--Load gearset for new class and begin class change
|
||||
if (classId ~= nil) then
|
||||
loadGearset(player, classId);
|
||||
player:DoClassChange(classId);
|
||||
end
|
||||
|
||||
end
|
||||
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
|
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;
|
|
@ -91,7 +91,7 @@ function onEventStarted(player, actor, triggerName, isTeleport)
|
|||
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);
|
||||
player:SendGameMessage(worldMaster, 34104, 0x20);
|
||||
if (isInn) then
|
||||
--Return to Inn
|
||||
if (player:GetHomePointInn() == 1) then
|
||||
|
@ -107,7 +107,14 @@ function onEventStarted(player, actor, triggerName, isTeleport)
|
|||
if (destination ~= nil) then
|
||||
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
|
||||
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
|
||||
--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
|
||||
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
|
||||
|
||||
end
|
||||
end
|
||||
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;
|
19
data/scripts/commands/ability/battle_voice.lua
Normal file
19
data/scripts/commands/ability/battle_voice.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)
|
||||
--Only the bard gets the Battle Voice effect
|
||||
if caster == target then
|
||||
actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223253, 1, 0, 30));
|
||||
end
|
||||
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
data/scripts/commands/ability/berserk.lua
Normal file
19
data/scripts/commands/ability/berserk.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
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)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
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;
|
43
data/scripts/commands/ability/blissful_mind.lua
Normal file
43
data/scripts/commands/ability/blissful_mind.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
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();
|
||||
local remAction = caster.statusEffects.RemoveStatusEffectForBattleAction(buff, 30329);
|
||||
|
||||
caster.AddMP(amount);
|
||||
|
||||
actionContainer.AddMPAction(caster.actorId, 33007, amount);
|
||||
actionContainer.AddAction(remAction);
|
||||
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);
|
||||
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;
|
18
data/scripts/commands/ability/chameleon.lua
Normal file
18
data/scripts/commands/ability/chameleon.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
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)
|
||||
target.hateContainer.UpdateHate(caster, -840);
|
||||
end;
|
15
data/scripts/commands/ability/cleric_stance.lua
Normal file
15
data/scripts/commands/ability/cleric_stance.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
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)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
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;
|
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
|
||||
|
||||
actionContainer.AddAction(caster.statusEffects.AddStatusForBattleAction(223063, coverTier, skill.statusDuration));
|
||||
|
||||
--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;
|
24
data/scripts/commands/ability/dread_spike.lua
Normal file
24
data/scripts/commands/ability/dread_spike.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(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 remAction = caster.statusEffects.RemoveStatusEffectForBattleAction(i, 30329)
|
||||
|
||||
if remAction ~= nil then
|
||||
actionContainer.AddAction(remAction);
|
||||
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;
|
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
|
||||
action.statusMagnitude = 0.33 * caster.GetMod(modifiersGlobal.AttackDelay);
|
||||
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;
|
53
data/scripts/commands/ability/life_surge.lua
Normal file
53
data/scripts/commands/ability/life_surge.lua
Normal file
|
@ -0,0 +1,53 @@
|
|||
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, true);
|
||||
caster.statusEffects.RemoveStatusEffect(223213, true);
|
||||
caster.statusEffects.RemoveStatusEffect(223214, true);
|
||||
|
||||
|
||||
--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.RemoveStatusEffect(removeId, true);
|
||||
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;
|
24
data/scripts/commands/ability/power_surge.lua
Normal file
24
data/scripts/commands/ability/power_surge.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
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)
|
||||
--Need a better way to do this
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223215));
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223216));
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223217));
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
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;
|
29
data/scripts/commands/ability/quelling_strike.lua
Normal file
29
data/scripts/commands/ability/quelling_strike.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)
|
||||
--QS gives 300 TP by default.
|
||||
skill.statusMagnitude = 300;
|
||||
--I'm assuming that with raging strikes, that increases to 500.
|
||||
--and traited that increases again to 750 (or 450 without RS)
|
||||
if caster.statusEffects.HasStatusEffect(223221) then
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(223221));
|
||||
skill.statusMagnitude = 500;
|
||||
end
|
||||
|
||||
--27241: Enhanced Quelling Strike: Increases TP gained from QS by 50%
|
||||
if caster.HasTrait(27241) then
|
||||
skill.statusMagnitude = skill.statusMagnitude * 1.5;
|
||||
end
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
data/scripts/commands/ability/raging_strike.lua
Normal file
19
data/scripts/commands/ability/raging_strike.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27243: Enhanced Raging Strike: Increases effect of Raging Strike by 50%
|
||||
if caster.HasTrait(27241) 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/rampage.lua
Normal file
19
data/scripts/commands/ability/rampage.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27204: Enhanced Rampage
|
||||
if caster.HasTrait(27204) 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/rampart.lua
Normal file
27
data/scripts/commands/ability/rampart.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
require("battleutils")
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
|
||||
--27163: Enhanced Rampart:Expands rampart to affect party members
|
||||
if caster.HasTrait(27163) then
|
||||
ability.aoeType = TargetFindAOEType.Circle;
|
||||
end
|
||||
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--http://forum.square-enix.com/ffxiv/threads/47393-Tachi-s-Guide-to-Paladin-%28post-1.22b%29
|
||||
--180 enmity per member that has enmity on the current enemy
|
||||
--Need to figure out enmity system
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
action.enmity = 180;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
15
data/scripts/commands/ability/resonance.lua
Normal file
15
data/scripts/commands/ability/resonance.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
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)
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
data/scripts/commands/ability/sacred_prism.lua
Normal file
19
data/scripts/commands/ability/sacred_prism.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27360: Swift Sacred Prism: Reduces recast by 30 seconds
|
||||
if caster.HasTrait(27360) 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;
|
43
data/scripts/commands/ability/second_wind.lua
Normal file
43
data/scripts/commands/ability/second_wind.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
require("global");
|
||||
require("modifiers");
|
||||
require("utils")
|
||||
--require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--http://forum.square-enix.com/ffxiv/threads/51208-2nd-wind-modifier
|
||||
--The primary modifier for SW is class level.
|
||||
|
||||
--There are three other factors that contribute to SW:
|
||||
-- PGL's SW trait, which increases potency by 25%.
|
||||
-- A bonus from INT (2INT=1HP)
|
||||
-- An additional random integer (580 at level 50. +/- 3%)
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Base amount seems to be 0.215x^2 - 0.35x + 60
|
||||
--^ this isn't totally correct
|
||||
local amount = (0.215 * math.pow(caster.GetLevel(), 2)) - (0.35 * caster.GetLevel()) + 60;
|
||||
|
||||
--Heals can vary by up to 3.5%
|
||||
amount = math.Clamp(amount * (0.965 + (math.random() * 0.07)), 0, 9999);
|
||||
|
||||
--PGL gets an INT bonus for Second Wind
|
||||
if caster.GetClass() == 2 then
|
||||
amount = amount + caster.GetMod(modifiersGlobal.Intelligence) / 2;
|
||||
end;
|
||||
|
||||
--27120: Enhanced Second Wind
|
||||
if caster.HasTrait(27120) then
|
||||
amount = amount * 1.25;
|
||||
end;
|
||||
|
||||
action.amount = amount;
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
data/scripts/commands/ability/sentinel.lua
Normal file
19
data/scripts/commands/ability/sentinel.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27160: Enhanced Sentinel
|
||||
if caster.HasTrait(27160) 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/shroud_of_saints.lua
Normal file
19
data/scripts/commands/ability/shroud_of_saints.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27361: Swift Shroud of Saints
|
||||
if caster.HasTrait(27361) then
|
||||
ability.recastTimeMs = ability.recastTimeMs - 60000;
|
||||
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/taunt.lua
Normal file
19
data/scripts/commands/ability/taunt.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
--27122: Swift Taunt: Reduces recast time by 15 seconds.
|
||||
if caster.HasTrait(27121) 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/tempered_will.lua
Normal file
20
data/scripts/commands/ability/tempered_will.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)
|
||||
--Is this before or after status is gained?
|
||||
--Will probably need to switch to a flag for this because it might include more than just these 3 effects.
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228011));
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228013));
|
||||
actionContainer.AddAction(caster.statusEffects.RemoveStatusEffectForBattleAction(228021));
|
||||
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
22
data/scripts/commands/ability/vengeance.lua
Normal file
22
data/scripts/commands/ability/vengeance.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
require("global");
|
||||
require("ability");
|
||||
require("battleutils")
|
||||
|
||||
function onAbilityPrepare(caster, target, ability)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onAbilityStart(caster, target, ability)
|
||||
|
||||
--8032703: Fighter's Cuirass: Enhances Vengeance
|
||||
if caster.HasItemEquippedInSlot(8032703, 10) then
|
||||
skill.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;
|
29
data/scripts/commands/gm/addtoparty.lua
Normal file
29
data/scripts/commands/gm/addtoparty.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds target to party
|
||||
]]
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
local sender = "[addtoparty] ";
|
||||
|
||||
if player then
|
||||
if player.target then
|
||||
print("hi")
|
||||
local id = player.target.actorId
|
||||
print("hi")
|
||||
player.currentParty:AddMember(id);
|
||||
player.target.currentParty = player.currentParty;
|
||||
print("hi")
|
||||
else
|
||||
print(sender.." no target")
|
||||
end
|
||||
else
|
||||
print(sender.." no player");
|
||||
end;
|
||||
end;
|
29
data/scripts/commands/gm/ba.lua
Normal file
29
data/scripts/commands/gm/ba.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sssss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, commandId, animationId, textId, effectId, amount)
|
||||
local sender = "[battleaction] ";
|
||||
|
||||
if player then
|
||||
cid = tonumber(commandId) or 0;
|
||||
aid = tonumber(animationId) or 0;
|
||||
tid = tonumber(textId) or 0;
|
||||
print(effectId)
|
||||
eid = tonumber(effectId) or 0;
|
||||
amt = tonumber(amount) or 0;
|
||||
|
||||
player:DoBattleActionAnimation(cid, aid, tid, eid, amt);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
34
data/scripts/commands/gm/eaction.lua
Normal file
34
data/scripts/commands/gm/eaction.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Equips <commandid> in the first open slot without checking if you can.
|
||||
!eaction <commandid>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, commandid)
|
||||
local sender = "[eaction] ";
|
||||
|
||||
print(commandid);
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
classid = player:GetCurrentClassOrJob();
|
||||
commandid = tonumber(commandid) or 0;
|
||||
|
||||
local added = player:EquipAbilityInFirstOpenSlot(classid, commandid);
|
||||
|
||||
else
|
||||
print(sender.."unable to add command, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
31
data/scripts/commands/gm/effect.lua
Normal file
31
data/scripts/commands/gm/effect.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
require("global");
|
||||
require("bit32");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "iiii",
|
||||
description =
|
||||
[[
|
||||
effect
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, effectId, magnitude, tick, duration)
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "effect";
|
||||
|
||||
if player then
|
||||
player.AddHP(100000);
|
||||
player.DelHP(500);
|
||||
|
||||
effectId = tonumber(effectId) or 223180;
|
||||
magnitude = tonumber(magnitude) or 700;
|
||||
tick = tonumber(tick) or 3;
|
||||
duration = tonumber(duration) or 360;
|
||||
|
||||
while player.statusEffects.HasStatusEffect(effectId) do
|
||||
player.statusEffects.RemoveStatusEffect(effectId);
|
||||
end;
|
||||
player.statusEffects.AddStatusEffect(effectId, magnitude, tick, duration);
|
||||
end;
|
||||
end;
|
35
data/scripts/commands/gm/giveexp.lua
Normal file
35
data/scripts/commands/gm/giveexp.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, qty, name, lastName)
|
||||
local sender = "[giveexp] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
currency = 1000001;
|
||||
qty = tonumber(qty) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 0);
|
||||
player:DoBattleAction(0, 0, actionList);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
|
@ -21,9 +21,13 @@ function onTrigger(player, argc, slot, wId, eId, vId, cId)
|
|||
cId = tonumber(cId) or 0;
|
||||
|
||||
if player and argc > 0 then
|
||||
player:GraphicChange(slot, wId, eId, vId, cId);
|
||||
if argc > 2 then
|
||||
player:GraphicChange(slot, wId, eId, vId, cId);
|
||||
player:SendMessage(messageID, sender, string.format("Changing appearance on slot %u", slot));
|
||||
else
|
||||
player:GraphicChange(slot, wId);
|
||||
end
|
||||
player:SendAppearance();
|
||||
player:SendMessage(messageID, sender, string.format("Changing appearance on slot %u", slot));
|
||||
else
|
||||
player:SendMessage(messageID, sender, "No parameters sent! Usage: "..properties.description);
|
||||
end;
|
||||
|
|
25
data/scripts/commands/gm/setappearance.lua
Normal file
25
data/scripts/commands/gm/setappearance.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, appearanceId)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[setappearance] ";
|
||||
|
||||
app = tonumber(appearanceId) or 0;
|
||||
player:SendMessage(messageID, sender, string.format("appearance %u", app));
|
||||
|
||||
if player and player.target then
|
||||
player.target.ChangeNpcAppearance(app);
|
||||
player:SendMessage(messageID, sender, string.format("appearance %u", app));
|
||||
end;
|
||||
|
||||
end;
|
21
data/scripts/commands/gm/setjob.lua
Normal file
21
data/scripts/commands/gm/setjob.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, jobId)
|
||||
local sender = "[setjob] ";
|
||||
|
||||
jobId = tonumber(jobId)
|
||||
if player then
|
||||
player:SetCurrentJob(jobId);
|
||||
end;
|
||||
end;
|
33
data/scripts/commands/gm/setmaxhp.lua
Normal file
33
data/scripts/commands/gm/setmaxhp.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Sets player or <targetname>'s maximum hp to <hp> and heals them to full.
|
||||
!setmaxhp <hp> |
|
||||
!setmaxhp <hp> <targetname>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, hp, name, lastName)
|
||||
local sender = "[setmaxhp] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
hp = tonumber(hp) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
player:hpstuff(hp);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
33
data/scripts/commands/gm/setmaxmp.lua
Normal file
33
data/scripts/commands/gm/setmaxmp.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Sets player or <targetname>'s maximum hp to <hp> and heals them to full.
|
||||
!setmaxhp <hp> |
|
||||
!setmaxhp <hp> <targetname>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, hp, name, lastName)
|
||||
local sender = "[setmaxhp] ";
|
||||
|
||||
if name then
|
||||
if lastName then
|
||||
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
|
||||
else
|
||||
player = GetWorldManager():GetPCInWorld(name) or nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
if player then
|
||||
hp = tonumber(hp) or 1;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
player:hpstuff(hp);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
18
data/scripts/commands/gm/setmod.lua
Normal file
18
data/scripts/commands/gm/setmod.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ss",
|
||||
description =
|
||||
[[
|
||||
Sets a modifier of player
|
||||
!setmod <modId> <modVal> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, modId, modVal)
|
||||
local sender = "[setmod] ";
|
||||
local mod = tonumber(modId)
|
||||
local val = tonumber(modVal)
|
||||
player:SetMod(mod, val);
|
||||
end;
|
18
data/scripts/commands/gm/setproc.lua
Normal file
18
data/scripts/commands/gm/setproc.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Adds experience <qty> to player or <targetname>.
|
||||
!giveexp <qty> |
|
||||
!giveexp <qty> <targetname> |
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, procid)
|
||||
local sender = "[giveexp] ";
|
||||
local pid = tonumber(procid)
|
||||
player:SetProc(pid, true);
|
||||
end;
|
24
data/scripts/commands/gm/setsize.lua
Normal file
24
data/scripts/commands/gm/setsize.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, size)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[setappearance] ";
|
||||
|
||||
s = tonumber(size) or 0;
|
||||
|
||||
if player and player.target then
|
||||
player.target.appearanceIds[0] = s;
|
||||
player.target.zone.BroadcastPacketAroundActor(player.target, player.target.CreateAppearancePacket());
|
||||
end;
|
||||
|
||||
end;
|
24
data/scripts/commands/gm/setstate.lua
Normal file
24
data/scripts/commands/gm/setstate.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "s",
|
||||
description =
|
||||
[[
|
||||
Changes appearance for equipment with given parameters.
|
||||
!graphic <slot> <wID> <eID> <vID> <vID>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, state)
|
||||
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "[setstate] ";
|
||||
|
||||
local s = tonumber(state);
|
||||
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
|
||||
if player and actor then
|
||||
actor:ChangeState(s);
|
||||
wait(0.8);
|
||||
player:SendMessage(0x20, "", "state: "..s);
|
||||
end;
|
||||
end;
|
27
data/scripts/commands/gm/settp.lua
Normal file
27
data/scripts/commands/gm/settp.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "sss",
|
||||
description =
|
||||
[[
|
||||
Sets player or <targetname>'s maximum tp to <tp> and heals them to full.
|
||||
!setmaxtp <tp> |
|
||||
!setmaxtp <tp> <targetname>
|
||||
]],
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, tp)
|
||||
local sender = "[setmaxtp] ";
|
||||
|
||||
|
||||
|
||||
if player then
|
||||
tp = tonumber(tp) or 0;
|
||||
location = INVENTORY_CURRENCY;
|
||||
|
||||
player:SetTP(tp);
|
||||
else
|
||||
print(sender.."unable to add experience, ensure player name is valid.");
|
||||
end;
|
||||
end;
|
|
@ -6,7 +6,7 @@ properties = {
|
|||
description = "Spawns a actor",
|
||||
}
|
||||
|
||||
function onTrigger(player, argc, actorClassId)
|
||||
function onTrigger(player, argc, actorClassId, width, height)
|
||||
|
||||
if (actorClassId == nil) then
|
||||
player:SendMessage(0x20, "", "No actor class id provided.");
|
||||
|
@ -24,7 +24,16 @@ function onTrigger(player, argc, actorClassId)
|
|||
|
||||
if (actorClassId ~= nil) then
|
||||
zone = player:GetZone();
|
||||
actor = zone:SpawnActor(actorClassId, "test", pos[0], pos[1], pos[2], pos[3]);
|
||||
local w = tonumber(width) or 0;
|
||||
local h = tonumber(height) or 0;
|
||||
printf("%f %f %f", x, y, z);
|
||||
--local x, y, z = player.GetPos();
|
||||
for i = 0, w do
|
||||
for j = 0, h do
|
||||
actor = zone:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]);
|
||||
actor.SetAppearance(1001149)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (actor == nil) then
|
||||
|
|
192
data/scripts/commands/gm/yolo.lua
Normal file
192
data/scripts/commands/gm/yolo.lua
Normal file
|
@ -0,0 +1,192 @@
|
|||
require("global");
|
||||
require("modifiers");
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "ssss",
|
||||
description =
|
||||
[[
|
||||
yolo
|
||||
]],
|
||||
}
|
||||
|
||||
local quests =
|
||||
{
|
||||
[111807] = { level = 25, weight = 4, rewardexp = 1080 },
|
||||
[110868] = { level = 50, weight = 4, rewardexp = 4400 },
|
||||
[111603] = { level = 22, weight = 5, rewardexp = 1100 },
|
||||
[111602] = { level = 22, weight = 5, rewardexp = 1100 },
|
||||
[111420] = { level = 45, weight = 5, rewardexp = 4450 },
|
||||
[110811] = { level = 18, weight = 6, rewardexp = 780 },
|
||||
[110814] = { level = 18, weight = 6, rewardexp = 780 },
|
||||
[110707] = { level = 25, weight = 6, rewardexp = 1620 },
|
||||
[110682] = { level = 34, weight = 6, rewardexp = 3180 },
|
||||
[111202] = { level = 35, weight = 6, rewardexp = 3360 },
|
||||
[111222] = { level = 35, weight = 6, rewardexp = 3360 },
|
||||
[111302] = { level = 35, weight = 6, rewardexp = 3360 },
|
||||
[111223] = { level = 40, weight = 6, rewardexp = 4260 },
|
||||
[110819] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[111224] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[111225] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110867] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110869] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110708] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[110627] = { level = 45, weight = 6, rewardexp = 5340 },
|
||||
[111434] = { level = 50, weight = 6, rewardexp = 6600 },
|
||||
[110850] = { level = 1, weight = 7, rewardexp = 40 },
|
||||
[110851] = { level = 1, weight = 7, rewardexp = 40 },
|
||||
[110841] = { level = 20, weight = 7, rewardexp = 1120 },
|
||||
[110642] = { level = 20, weight = 7, rewardexp = 1120 },
|
||||
[110840] = { level = 20, weight = 7, rewardexp = 1120 },
|
||||
[110727] = { level = 21, weight = 7, rewardexp = 1401 },
|
||||
[111221] = { level = 30, weight = 7, rewardexp = 2661 },
|
||||
[111241] = { level = 30, weight = 7, rewardexp = 2661 },
|
||||
[110687] = { level = 28, weight = 9, rewardexp = 2970 },
|
||||
[110016] = { level = 34, weight = 50, rewardexp = 26500 },
|
||||
[110017] = { level = 38, weight = 50, rewardexp = 32500 },
|
||||
[110019] = { level = 46, weight = 50, rewardexp = 46000 }
|
||||
};
|
||||
|
||||
local expTable = {
|
||||
570, -- 1
|
||||
700,
|
||||
880,
|
||||
1100,
|
||||
1500,
|
||||
1800,
|
||||
2300,
|
||||
3200,
|
||||
4300,
|
||||
5000, -- 10
|
||||
5900,
|
||||
6800,
|
||||
7700,
|
||||
8700,
|
||||
9700,
|
||||
11000,
|
||||
12000,
|
||||
13000,
|
||||
15000,
|
||||
16000, -- 20
|
||||
20000,
|
||||
22000,
|
||||
23000,
|
||||
25000,
|
||||
27000,
|
||||
29000,
|
||||
31000,
|
||||
33000,
|
||||
35000,
|
||||
38000, -- 30
|
||||
45000,
|
||||
47000,
|
||||
50000,
|
||||
53000,
|
||||
56000,
|
||||
59000,
|
||||
62000,
|
||||
65000,
|
||||
68000,
|
||||
71000, -- 40
|
||||
74000,
|
||||
78000,
|
||||
81000,
|
||||
85000,
|
||||
89000,
|
||||
92000,
|
||||
96000,
|
||||
100000,
|
||||
100000,
|
||||
110000 -- 50
|
||||
};
|
||||
|
||||
local commandCost = {
|
||||
["raise"] = 150,
|
||||
["cure"] = 40,
|
||||
["cura"] = 100,
|
||||
["curaga"] = 150,
|
||||
};
|
||||
-- stone: (1, 9) (5, 12) (10, )
|
||||
-- cure: (1, 5) (5, 6) (10, )
|
||||
-- aero: (1, 9) (5, 12) (10, )
|
||||
-- protect: (1, 9) (5, 12) (10, )
|
||||
--[[
|
||||
function onTrigger(player, argc, id, level, weight)
|
||||
id = tonumber(id) or 111807;
|
||||
level = tonumber(level) or quests[id].level;
|
||||
weight = tonumber(weight) or quests[id].weight;
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "yolo";
|
||||
|
||||
if id == 1 then
|
||||
return
|
||||
end
|
||||
local message = calcSkillPoint(player, level, weight);
|
||||
if player then
|
||||
player.SendMessage(messageId, sender, string.format("calculated %s | expected %s", message, quests[id].rewardexp));
|
||||
end;
|
||||
printf("calculated %s | expected %s", message, quests[id].rewardexp);
|
||||
end;
|
||||
]]
|
||||
|
||||
|
||||
|
||||
function onTrigger(player, argc, width, height, blockCount)
|
||||
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
||||
local sender = "yolo";
|
||||
|
||||
if player then
|
||||
if false then
|
||||
local effectId = 223004;
|
||||
|
||||
player.statusEffects.RemoveStatusEffect(effectId);
|
||||
player.statusEffects.AddStatusEffect(effectId, 1, 0, 5);
|
||||
return;
|
||||
end;
|
||||
|
||||
local pos = player:GetPos();
|
||||
local x = tonumber(pos[0]);
|
||||
local y = tonumber(pos[1]);
|
||||
local z = tonumber(pos[2]);
|
||||
local rot = tonumber(pos[3]);
|
||||
local zone = pos[4];
|
||||
local w = tonumber(width) or 0;
|
||||
|
||||
local h = tonumber(height) or 0;
|
||||
local blocks = tonumber(blockCount) or 0;
|
||||
|
||||
printf("%f %f %f", x, y, z);
|
||||
--local x, y, z = player.GetPos();
|
||||
for b = 0, blocks do
|
||||
for i = 0, w do
|
||||
for j = 0, h do
|
||||
local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true);
|
||||
actor.ChangeNpcAppearance(2200905);
|
||||
actor.SetMaxHP(5000);
|
||||
actor.SetHP(5000);
|
||||
actor.SetMod(modifiersGlobal.HasShield, 1);
|
||||
actor.SetMod(modifiersGlobal.AttackRange, 3);
|
||||
actor.SetMod(modifiersGlobal.Speed, 5);
|
||||
actor.SetMobMod(mobModifiersGlobal.Roams, 1);
|
||||
actor.SetMobMod(mobModifiersGlobal.RoamDelay, 3);
|
||||
actor.moveState = 3;
|
||||
end
|
||||
end
|
||||
|
||||
x = x + 500
|
||||
end
|
||||
return;
|
||||
end
|
||||
end;
|
||||
|
||||
function calculateCommandCost(player, skillName, level)
|
||||
if skillName and level and commandCost[skillName] then
|
||||
return math.ceil((8000 + (level - 70) * 500) * (commandCost[skillName] * 0.001));
|
||||
end;
|
||||
return 1;
|
||||
end
|
||||
|
||||
function calcSkillPoint(player, lvl, weight)
|
||||
weight = weight / 100
|
||||
|
||||
return math.ceil(expTable[lvl] * weight)
|
||||
end
|
19
data/scripts/commands/gm/zonecount.lua
Normal file
19
data/scripts/commands/gm/zonecount.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
|
||||
properties = {
|
||||
permissions = 0,
|
||||
parameters = "",
|
||||
description =
|
||||
[[
|
||||
Get the amount of actors in this zone.
|
||||
!zonecount
|
||||
]]
|
||||
|
||||
}
|
||||
|
||||
function onTrigger(player, argc)
|
||||
|
||||
local message = tostring(player.zone.GetAllActors().Count);
|
||||
|
||||
player.SendMessage(0x20, "", message);
|
||||
end
|
22
data/scripts/commands/magic/aero.lua
Normal file
22
data/scripts/commands/magic/aero.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--calculate damage
|
||||
action.amount = skill.basePotency;
|
||||
action.statusMagnitude = 15;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
|
||||
--Try to apply status effect
|
||||
action.TryStatus(caster, target, skill, actionContainer, true);
|
||||
end;
|
33
data/scripts/commands/magic/aerora.lua
Normal file
33
data/scripts/commands/magic/aerora.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--Increased damage and conversion to single target
|
||||
function onCombo(caster, target, spell)
|
||||
spell.aoeType = 0;
|
||||
spell.potency = spell.potency * 1.5;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--Dispels an effect on each target.
|
||||
local effects = target.statusEffects.GetStatusEffectsByFlag2(16); --lose on dispel
|
||||
if effects != nil then
|
||||
target.statusEffects.RemoveStatusEffect(effects[0]);
|
||||
end;
|
||||
|
||||
--calculate damage
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
|
||||
--Try to apply status effect
|
||||
action.TryStatus(caster, target, skill, actionContainer, true);
|
||||
end;
|
57
data/scripts/commands/magic/ballad_of_magi.lua
Normal file
57
data/scripts/commands/magic/ballad_of_magi.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, skill)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, skill)
|
||||
--Ballad gives 20 MP a tick at 50
|
||||
--BV gives 40 MP per tick
|
||||
--Formula seems to be 0.8 * level - 20, not sure why BV gives 71 at 50 then
|
||||
local mpPerTick = (0.8 * caster.GetLevel()) - 20;
|
||||
|
||||
--8032705: Choral Shirt: Enhances Ballad of Magi
|
||||
--With Choral Shirt, Ballad gives 26 mp a tick. It could be a flat 6 or multiply by 1.3
|
||||
--Because minuet seemed like a normal addition I'm assuming this is too
|
||||
if caster.HasItemEquippedInSlot(8032705, 10) then
|
||||
mpPerTick = mpPerTick + 6;
|
||||
end
|
||||
|
||||
--223253: Battle Voice
|
||||
--Battle Voice doubles effect of songs
|
||||
if caster.statusEffects.HasStatusEffect(223253) then
|
||||
mpPerTick = mpPerTick * 2;
|
||||
--Set status tier so we can check it later when BV falls off
|
||||
skill.statusTier = 2;
|
||||
end
|
||||
|
||||
skill.statusMagnitude = mpPerTick;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--223224: Swiftsong
|
||||
--223255: Paeon of War
|
||||
--223256: Minuet of Rigor
|
||||
--
|
||||
local oldSong;
|
||||
local swiftSong = target.statusEffects.GetStatusEffectById(223224);
|
||||
local paeon = target.statusEffects.GetStatusEffectById(223255);
|
||||
local minuet = target.statusEffects.GetStatusEffectById(223256);
|
||||
if swiftSong and swiftSong.GetSource() == caster then
|
||||
oldSong = swiftSong;
|
||||
elseif paeon and paeon.GetSource() == caster then
|
||||
oldSong = paeon;
|
||||
elseif minuet and minuet.GetSource() == caster then
|
||||
oldSong = minuet;
|
||||
elseif ballad and ballad.GetSource() == caster then
|
||||
oldSong = ballad;
|
||||
end
|
||||
|
||||
if oldSong then
|
||||
target.statusEffects.RemoveStatusEffect(oldSong);
|
||||
end
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
21
data/scripts/commands/magic/blizzara.lua
Normal file
21
data/scripts/commands/magic/blizzara.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--calculate damage
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
|
||||
--Try to apply status effect
|
||||
action.TryStatus(caster, target, skill, actionContainer, true);
|
||||
end;
|
20
data/scripts/commands/magic/blizzard.lua
Normal file
20
data/scripts/commands/magic/blizzard.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--calculate damage
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
|
||||
--Try to apply status effect
|
||||
action.TryStatus(caster, target, skill, actionContainer, true);
|
||||
end;
|
26
data/scripts/commands/magic/burst.lua
Normal file
26
data/scripts/commands/magic/burst.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--Increased damage with lesser current hp
|
||||
function onCombo(caster, target, spell)
|
||||
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--calculate damage
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
|
||||
--Try to apply status effect
|
||||
action.TryStatus(caster, target, skill, actionContainer, true);
|
||||
end;
|
21
data/scripts/commands/magic/cura.lua
Normal file
21
data/scripts/commands/magic/cura.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--http://forum.square-enix.com/ffxiv/threads/41900-White-Mage-A-Guide
|
||||
--2.5 HP per Healing Magic Potency
|
||||
--0.5 HP per MND
|
||||
--this is WITH WHM AF chest, don't know formula without AF. AF seems to increase healing by 7-10%?
|
||||
action.amount = 2.5 * caster.GetMod(modifiersGlobal.MagicHeal) + 0.5 * (caster.GetMod(modifiersGlobal.Mind));
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
19
data/scripts/commands/magic/curaga.lua
Normal file
19
data/scripts/commands/magic/curaga.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--Idea: add way to sort list of targets by hp here?
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
--calculate damage
|
||||
action.amount = skill.basePotency;
|
||||
|
||||
--DoAction handles rates, buffs, dealing damage
|
||||
action.DoAction(caster, target, skill, actionContainer);
|
||||
end;
|
37
data/scripts/commands/magic/cure.lua
Normal file
37
data/scripts/commands/magic/cure.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
require("global");
|
||||
require("magic");
|
||||
require("modifiers");
|
||||
|
||||
function onMagicPrepare(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
function onMagicStart(caster, target, spell)
|
||||
return 0;
|
||||
end;
|
||||
|
||||
--http://forum.square-enix.com/ffxiv/threads/41900-White-Mage-A-Guide
|
||||
function onSkillFinish(caster, target, skill, action, actionContainer)
|
||||
|
||||
--Non-CNJ
|
||||
--1.10 per HMP
|
||||
--0 per MND
|
||||
local hpPerHMP = 1.10;
|
||||
local hpPerMND = 0;
|
||||
|
||||
--CNJ
|
||||
--With AF:
|
||||
--1.25 HP per Healing Magic Potency
|
||||
--0.25 HP per MND
|
||||
--This is WITH AF chest. Without is lower. AF is ~7-10% increase apparently
|
||||
--I'm guessing without AF hpPerHMP will be 1.1?
|
||||
if (caster.GetClass() == 23) then
|
||||
hpPerHMP = 1.25;
|
||||
hpPerMND = 0.25;
|
||||
end
|
||||
|
||||
action.amount = hpPerHMP * caster.GetMod(modifiersGlobal.MagicHeal) + hpPerMND * (caster.GetMod(modifiersGlobal.Mind));
|
||||
|
||||
--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