Merge branch 'Jorge/quest_system' into ioncannon/quest_system

This commit is contained in:
Filip Maj 2022-02-13 18:57:08 -05:00
commit cfe6ef2e5e
50 changed files with 1554 additions and 684 deletions

View file

@ -1,14 +1,17 @@
properties = {
permissions = 0,
parameters = "s",
parameters = "ss",
description =
[[
Plays music <id> to player.
!music <id>
!music <id> <transition_type>
]],
}
function onTrigger(player, argc, music)
function onTrigger(player, argc, music, transition)
music = tonumber(music) or 0;
player:ChangeMusic(music);
transition = tonumber(transition) or nil;
player:SendMessage(0x20, "", tostring(argc).." "..tostring(music).." "..tostring(transition));
player:ChangeMusic(music, transition);
end;

View file

@ -22,6 +22,5 @@ function onTrigger(player, argc, actorClassId)
if actor then
actor:ChangeNpcAppearance(actorClassId);
player:SendMessage(messageID, sender, string.format("appearance %u", actorClassId));
end;
end;
end
end

View file

@ -29,7 +29,7 @@ function onTrigger(player, argc, actorClassId, width, height)
--local x, y, z = player.GetPos();
for i = 0, w do
for j = 0, h do
actor = player.CurrentArea:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]);
actor = player.CurrentArea:SpawnActor(actorClassId, "test", x + (i - (w / 2) * 3), y, z + (j - (h / 2) * 3), rot);
actor.SetAppearance(1001149)
end
end

View file

@ -56,7 +56,8 @@ function onTrigger(player, argc, p1, p2, p3, p4, privateArea, privateAreaType, n
local x = tonumber(applyPositionOffset(p2, player_x)) or player_x;
local y = tonumber(applyPositionOffset(p3, player_y)) or player_y;
local z = tonumber(applyPositionOffset(p4, player_z)) or player_z;
if privateArea == "" then privateArea = nil end;
if privateArea == nil then privateArea = nil end;
if privateAreaType == nila then privateAreaType = 0 end;
player:SendMessage(messageID, sender, string.format("setting coordinates X:%d Y:%d Z:%d to new zone (%d) private area:%s", x, y, z, zone, privateArea or "unspecified"));
worldManager:DoZoneChange(player, zone, privateArea, tonumber(privateAreaType), 0x02, x, y, z, 0.00);
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