Minor script fixes

=============
ChocoboRideCommand - Fixed the mount speed to be retail accurate.
TeleportCommand            - Added anima costs, mount check, and placeholder for Favoured destinations
nudge/spawn/warpid        - Plus 1 to GetPos() arrays
This commit is contained in:
CuriousJorge 2022-01-28 02:29:45 -05:00
parent 26fd79bea5
commit bad51717c2
5 changed files with 253 additions and 174 deletions

View file

@ -26,11 +26,11 @@ vertical = {
function onTrigger(player, argc, arg1, arg2)
local pos = player:GetPos();
local x = pos[0];
local y = pos[1];
local z = pos[2];
local rot = pos[3];
local zone = pos[4];
local x = pos[1];
local y = pos[2];
local z = pos[3];
local rot = pos[4];
local zone = pos[5];
local angle = rot + (math.pi/2);
local worldManager = GetWorldManager();

View file

@ -8,36 +8,36 @@ properties = {
function onTrigger(player, argc, actorClassId, width, height)
if (actorClassId == nil) then
player:SendMessage(0x20, "", "No actor class id provided.");
return;
end
if (actorClassId == nil) then
player:SendMessage(0x20, "", "No actor class id provided.");
return;
end
local pos = player:GetPos();
local x = pos[0];
local y = pos[1];
local z = pos[2];
local rot = pos[3];
local zone = pos[4];
local x = pos[1];
local y = pos[2];
local z = pos[3];
local rot = pos[4];
local zone = pos[5];
actorClassId = tonumber(actorClassId);
if (actorClassId ~= nil) then
zone = player:GetZone();
local w = tonumber(width) or 0;
actorClassId = tonumber(actorClassId);
if (actorClassId ~= nil) then
zone = player:GetZone();
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
player:SendMessage(0x20, "", "This actor class id cannot be spawned.");
end
actor = zone:SpawnActor(actorClassId, "test", x + (i - (w / 2) * 3), y, z + (j - (h / 2) * 3), rot);
actor.SetAppearance(1001149)
end
end
end
if (actor == nil) then
player:SendMessage(0x20, "", "This actor class id cannot be spawned.");
end
end;

View file

@ -18,22 +18,23 @@ function onTrigger(player, argc, uID)
end;
actor = GetWorldManager():GetActorInWorldByUniqueId(uID);
actorId = actor:GetActorClassId();
if (actor ~= nil) then
local actorPos = actor:GetPos();
local playerPos = player:GetPos();
if actorPos[4] == playerPos[4] then
worldManager:DoPlayerMoveInZone(player, actorPos[0], actorPos[1], actorPos[2], actorPos[3], 0x00);
if actorPos[5] == playerPos[5] then
worldManager:DoPlayerMoveInZone(player, actorPos[1], actorPos[2], actorPos[3], actorPos[4], 0x00);
else
worldManager:DoZoneChange(player, actorPos[4], nil, 0, 0x02, actorPos[0], actorPos[1], actorPos[2], actorPos[3]);
worldManager:DoZoneChange(player, actorPos[5], nil, 0, 0x02, actorPos[1], actorPos[2], actorPos[3], actorPos[4]);
end
message = string.format("Moving to %s 's coordinates @ zone %s, %.3f %.3f %.3f ", uID, actorPos[4], actorPos[0], actorPos[1], actorPos[2]);
message = string.format("Moving to %s 's coordinates @ zone %s, %.3f %.3f %.3f ", uID, actorPos[5], actorPos[1], actorPos[2], actorPos[3]);
end ;
player:SendMessage(messageID, sender, message);
player:SendMessage(0x20, "", "Actor Class Id: "..actorId);
end