Misc GM command fixes + ChangeJobCommand.lua

Anim - Cleaned up some.  It had old code sitting in it for whatever reason despite not affecting anything.
Setstate, Warpplayer & Yolo - Fixed them up so they function again
ChangeJobCommand - Just the script filled out to handle the equipping/dequipping of job stones, but it can cause issues, particularly with how the server handles a 'job' vs. a class, along with checking against skill compatibility.
This commit is contained in:
CuriousJorge 2022-03-13 20:35:29 -04:00
parent b08827568c
commit 74713f3dd6
5 changed files with 109 additions and 80 deletions

View file

@ -12,64 +12,23 @@ Sets anim id for current target
}
function onTrigger(player, argc, aType, a1, a2, uID)
--if uID == nil then uID = "test"; end
local npc = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
--npc = GetWorldManager():GetActorInWorldByUniqueId(uID);
--[[ if argc == 1 then
-- aType = tonumber(aType, 16) or 0;
if aType > 4294967295 then
player:SendMessage(0x20, "[anim] ", "Error: Value too large");
return;
else
player:PlayAnimation(aType);
end
else--]]
aType = tonumber(aType) or 0;
a1 = tonumber(a1) or 0;
a2 = tonumber(a2) or 1;
a1 = bit32.band(a1, 0xFFF);
a2 = bit32.band(a2, 0xFFF);
aType = bit32.band(aType, 0xFF);
animId = bit32.bor(bit32.lshift(a2, 12), a1);
animId = bit32.bor(bit32.lshift(aType, 24), animId);
print(animId);
--[[
if npc == nil then
player:PlayAnimation(animId);
else
npc:PlayAnimation(animId);
end
--]]
function onTrigger(player, argc, aType, a1, a2)
local actor = player.CurrentArea.FindActorInArea(player.currentTarget) or nil;
if player and actor then
if (player and actor) then
a1 = bit32.band(a1, 0xFFF);
a2 = bit32.band(a2, 0xFFF);
aType = bit32.band(aType, 0xFF);
animId = bit32.bor(bit32.lshift(a2, 12), a1);
animId = bit32.bor(bit32.lshift(aType, 24), animId);
-- player:SendMessage(0x20, "[anim] ", tostring(animId));
-- player:SendMessage(0x20, "[anim] ", tostring(animId));
actor:PlayAnimation(animId);
local output = string.format("%x", animId)
local output = string.format("%x", animId)
player:SendMessage(0x20, "[anim] ", "0x"..tostring(output).. " Target:"..tostring(actor));
end;
end;
end
end
--[[ Categories:
@ -96,9 +55,11 @@ end;
33 = ?
34 = Crash
120 = ???
Notes:
------
CATEGORY
Shift 18 bits right
CMP 0xB
@ -123,24 +84,6 @@ CMP 71
ec000000
00FFFFFF
BTL:
ETC:
GL2:
KAO:
MGK: 01
SYS: 02
LIB: 046
ITM: 05-09
GL?: 0B
GL1: 0C
CBI: 0D
ABL: 0E
POP: 0F
CFT: 10
PIC: 14
WSC: 12
19: Auto Attack?
6F: Casting
71: Seems to deal with signaling monster parts

View file

@ -15,10 +15,12 @@ function onTrigger(player, argc, state)
local sender = "[setstate] ";
local s = tonumber(state);
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
local actor = player.CurrentArea:FindActorInArea(player.currentTarget) or nil;
if player and actor then
actor:ChangeState(s);
wait(0.8);
player:SendMessage(0x20, "", "state: "..s);
wait(0.8);
player:SendMessage(0x20, "", "state: "..s);
else
player:SendMessage(0x20, "", "Error: No target selected.");
end;
end;

View file

@ -38,7 +38,7 @@ function onTrigger(player, argc, name, lastName, name2, lastName2)
return;
else
local pos = p1:GetPos();
worldManager:DoZoneChange(player, pos[4], nil, 0, 0x02, pos[0], pos[1], pos[2], pos[3]);
worldManager:DoZoneChange(player, pos[5], nil, 0, 0x02, pos[1], pos[2], pos[3], pos[4]);
player:SendMessage(messageID, sender, string.format("Moving to %s %s 's coordinates.", name, lastName));
end;
elseif argc == 4 then;
@ -50,7 +50,7 @@ function onTrigger(player, argc, name, lastName, name2, lastName2)
local pos = p1:GetPos();
local pos2 = p2:GetPos();
worldManager:DoZoneChange(p1, pos2[4], nil, 0, 0x02, pos2[0], pos2[1], pos2[2], pos2[3]);
worldManager:DoZoneChange(p1, pos2[5], nil, 0, 0x02, pos2[1], pos2[2], pos2[3], pos2[4]);
player:SendMessage(messageID, sender, string.format("Moving %s %s to %s %s 's coordinates.", name, lastName, name2, lastName2));
p1:SendMessage(messageID, sender, string.format("You are being moved to %s %s 's coordinates.", name2, lastName2));
end;

View file

@ -144,11 +144,11 @@ function onTrigger(player, argc, width, height, blockCount)
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 x = tonumber(pos[1]);
local y = tonumber(pos[2]);
local z = tonumber(pos[3]);
local rot = tonumber(pos[4]);
local zone = pos[5];
local w = tonumber(width) or 0;
local h = tonumber(height) or 0;
@ -160,7 +160,7 @@ function onTrigger(player, argc, width, height, blockCount)
for i = 0, w do
for j = 0, h do
local actor = player.CurrentArea.SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true);
--actor.ChangeNpcAppearance(2200905);
actor.ChangeNpcAppearance(2200905);
actor.SetMaxHP(500);
actor.SetHP(500);
actor.SetMod(modifiersGlobal.CanBlock, 1);