Merge branch 'ioncannon/quest_system' into Jorge/quest_system

This commit is contained in:
CuriousJorge 2022-02-05 18:26:03 -05:00
commit 2cbb48621b
97 changed files with 673 additions and 532 deletions

View file

@ -15,7 +15,7 @@ function onTrigger(player, argc)
if player then
if player.target then
print("hi")
local id = player.target.actorId
local id = player.target.Id
print("hi")
player.currentParty:AddMember(id);
player.target.currentParty = player.currentParty;

View file

@ -8,9 +8,8 @@ properties = {
function onTrigger(player, argc, actorName)
if (actorName ~= nil) then
zone = player:GetZone();
actor = zone:DespawnActor(actorName);
if (actorName ~= nil) then
actor = player.CurrentArea:DespawnActor(actorName);
end
end;

View file

@ -23,7 +23,7 @@ function onTrigger(player)
player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation));
player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.actorId));
player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.Id));
player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId()));
player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));
end

View file

@ -46,13 +46,13 @@ function onTrigger(player, argc, command, var1, var2, var3)
q2 = GetStaticActor(var1);
if q2 ~= nil then
q3 = q2.actorId;
q3 = q2.Id;
message = ("removing quest "..var1);
printf(q3);
q4 = bit32.band(q3, 0xA0F00000);
printf(q4);
--player:RemoveQuest(quest.actorName);
--player:RemoveQuest(quest.Name);
end
else
message = ("remove error: either incorrect ID or quest "..var1.." isn't active on character");

View file

@ -18,11 +18,11 @@ function onTrigger(player, argc, zone)
if player then
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
zone = zone or player:GetZoneID();
zone = zone or player.CurrentArea.ZoneId;
player:SendMessage(messageID, "[reloadzones] ", string.format("Reloading zone: %u", zone));
--[[ todo: get this working legit
player:GetZone():Clear();
player:GetZone():AddActorToZone(player);
player.CurrentArea:Clear();
player.CurrentArea:AddActorToZone(player);
player:SendInstanceUpdate();
]]
end;

View file

@ -20,16 +20,24 @@ function onTrigger(player, argc, actorClassId, width, height)
local rot = pos[4];
local zone = pos[5];
<<<<<<< HEAD
actorClassId = tonumber(actorClassId);
if (actorClassId ~= nil) then
zone = player:GetZone();
local w = tonumber(width) or 0;
=======
actorClassId = tonumber(actorClassId);
if (actorClassId ~= nil) then
local w = tonumber(width) or 0;
>>>>>>> ioncannon/quest_system
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
<<<<<<< HEAD
actor = zone:SpawnActor(actorClassId, "test", x + (i - (w / 2) * 3), y, z + (j - (h / 2) * 3), rot);
actor.SetAppearance(1001149)
end
@ -40,4 +48,16 @@ function onTrigger(player, argc, actorClassId, width, height)
player:SendMessage(0x20, "", "This actor class id cannot be spawned.");
end
=======
actor = player.CurrentArea: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
>>>>>>> ioncannon/quest_system
end;

View file

@ -108,7 +108,7 @@ function onTrigger(player, argc, name, width, height, blockCount)
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);
local actor = player.CurrentArea:SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true);
actor.ChangeNpcAppearance(modelIds[name]);
actor.SetMaxHP(5000);
actor.SetHP(5000);

View file

@ -18,7 +18,7 @@ function onTrigger(player, argc)
player:SendGameMessage(player, worldMaster, 34108, 0x20);
player:SendGameMessage(player, worldMaster, 50011, 0x20);
director = player:GetZone():CreateDirector("Quest/QuestDirectorMan0l001");
director = player.CurrentArea:CreateDirector("Quest/QuestDirectorMan0l001");
player:AddDirector(director);
player:SetLoginDirector(director);

View file

@ -31,7 +31,7 @@ function onTrigger(player, argc, animation, regionId, layoutId, maxLayoutId)
actorClassId = tonumber(actorClassId);
if (actorClassId ~= nil) then
zone = player:GetZone();
zone = player.CurrentArea;
actor = zone:SpawnActor(actorClassId, "mapobj", pos[1], pos[2], pos[3], tonumber(regionId), tonumber(layoutId));
print("test");

View file

@ -16,7 +16,7 @@ function onTrigger(player, argc)
if player and player.currentTarget then
local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
actor.Ability(23459, actor.actorId);
actor.Ability(23459, actor.Id);
else
print(sender.."unable to add experience, ensure player name is valid.");

View file

@ -24,13 +24,13 @@ function onTrigger(player, argc, weather, updateTime, zonewide)
message = string.format("changed weather to %u ", weather);
if zonewide ~= 0 then
message = string.format(message.."for zone %u", player:GetZoneID());
message = string.format(message.."for zone %u", player.CurrentArea.ZoneId);
else
message = message..player:GetName();
end;
-- weatherid, updateTime
player:GetZone():ChangeWeather(weather, updateTime, player, zonewide ~= 0);
player.CurrentArea:ChangeWeather(weather, updateTime, player, zonewide ~= 0);
player:SendMessage(messageID, sender, message);
end;
print(sender..message);

View file

@ -159,7 +159,7 @@ function onTrigger(player, argc, width, height, blockCount)
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);
local actor = player.CurrentArea.SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true);
--actor.ChangeNpcAppearance(2200905);
actor.SetMaxHP(500);
actor.SetHP(500);