Combat changes and bug fixes

Added the combo and proc systems
Added scripts for most weaponskill and spells as well as some abilities and status effects
Added support for multihit attacks
Added AbilityState for abilities
Added hiteffects that change based on an attack's parameters
Added positionals

Changed how targeting works for battlecommands

Fixed bug that occurred when moving or swapping hotbar commands
Fixed bug that occurred when losing status effects
This commit is contained in:
yogurt 2018-02-15 13:20:46 -06:00
parent 837c7a9223
commit b8d6a943aa
175 changed files with 4361 additions and 1213 deletions

View 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;

View file

@ -11,7 +11,7 @@ Equips <commandid> in the first open slot without checking if you can.
}
function onTrigger(player, argc, commandid)
local sender = "[givegil] ";
local sender = "[eaction] ";
print(commandid);
if name then

View file

@ -21,11 +21,14 @@ 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;
end;

View 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;

View 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;

View 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;

View 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;

View file

@ -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

View file

@ -128,7 +128,7 @@ function onTrigger(player, argc, id, level, weight)
end;
]]
function onTrigger(player, argc, skillName, level)
function onTrigger(player, argc, width, height, blockCount)
local messageId = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "yolo";
@ -147,24 +147,24 @@ function onTrigger(player, argc, skillName, level)
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;
printf("%f %f %f", x, y, z);
--local x, y, z = player.GetPos();
for i = 1, 1 do
local actor = player.GetZone().SpawnActor(2104001, 'ass', x, y, z, rot, 0, 0, true );
if player.currentContentGroup then
player.currentContentGroup:AddMember(actor.actorId)
for i = 0, blockCount do
for i = 0, w do
for j = 0, h do
local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i - (w / 2) * 3), y, z + (j - (h / 2) * 3), rot, 0, 0, true);
actor.ChangeNpcAppearance(1001149)
actor.SetLevel(50);
end
--actor.FollowTarget(player, 3.2);
end
x = x + 500
end
--actor.FollowTarget(player, 3.2);
end;
return;
end
level = tonumber(level) or 1;
if player then
player.SendMessage(messageId, sender, string.format("name %s | cost %d | level %u", skillName, calculateCommandCost(player, skillName, level), level));
end;
end;
function calculateCommandCost(player, skillName, level)

View file

@ -0,0 +1,21 @@
require("global");
properties = {
permissions = 0,
parameters = "sss",
description =
[[
Set movement speed for player. Enter no value to reset to default.
!speed <run> |
!speed <stop> <walk> <run> |
]]
}
function onTrigger(player, argc, stop, walk, run)
local message = tostring(player.zone.GetAllActors().Count);
player.SendMessage(0x20, "", message);
end