Added warp to public and private areas shortcut. Fixed counter printout bug. Fixed some commands. Fixed handling of the chocobo lender at the ferry docks.

This commit is contained in:
Filip Maj 2022-02-13 18:48:22 -05:00
parent 9f077190a3
commit 214d730a58
13 changed files with 208 additions and 124 deletions

View File

@ -0,0 +1,19 @@
--[[
PopulaceMenuMan Script
Functions:
--]]
require ("global")
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
callClientFunction(player, "debugMenuEvent", player);
player:endEvent();
end

View File

@ -28,7 +28,8 @@ local rentalTime = 10;
local gcIssuances = {
[1500006] = 2001004,
[1500061] = 2001005,
[1000840] = 2001006
[1000840] = 2001006,
[1500059] = 0
};
local startAppearances = {

View File

@ -14,7 +14,7 @@ function onTrigger(player)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[Info] ";
local targetActor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil;
local targetActor = player.CurrentArea.FindActorInArea(player.currentTarget) or nil;
if not targetActor then
player:SendMessage(messageID, sender, "No target selected");
@ -24,6 +24,6 @@ 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.Id));
player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className));
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

@ -79,7 +79,7 @@ function onTrigger(player, argc, command, var1, var2, var3)
message = string.format("\nInfo for quest %s [%d]\n", quest.Name, quest:GetQuestId());
message = message .. string.format("Current Sequence: %d\n", quest:getSequence());
message = message .. string.format("Flags: \n%s\n", flagStr)
message = message .. string.format("Counters: %d,%d,%d,%d", quest:getCounter(1), quest:getCounter(2), quest:getCounter(3), quest:getCounter(4));
message = message .. string.format("Counters: %d,%d,%d,%d", quest:getCounter(0), quest:getCounter(1), quest:getCounter(2), quest:getCounter(3));
else
message = ("Quest not active: "..var1);
end

View File

@ -10,16 +10,18 @@ Changes appearance for equipment with given parameters.
]],
}
function onTrigger(player, argc, appearanceId)
function onTrigger(player, argc, actorClassId)
local messageID = MESSAGE_TYPE_SYSTEM_ERROR;
local sender = "[setappearance] ";
app = tonumber(appearanceId) or 0;
player:SendMessage(messageID, sender, string.format("appearance %u", app));
local actorClassId = tonumber(actorClassId) or 0;
player:SendMessage(messageID, sender, string.format("appearance %u", actorClassId));
if player and player.target then
player.target.ChangeNpcAppearance(app);
player:SendMessage(messageID, sender, string.format("appearance %u", app));
local actor = player.CurrentArea:FindActorInArea(player.currentTarget);
if actor then
actor:ChangeNpcAppearance(actorClassId);
player:SendMessage(messageID, sender, string.format("appearance %u", actorClassId));
end;
end;

View File

@ -39,7 +39,8 @@ function onTrigger(player, argc, p1, p2, p3, p4, privateArea, privateAreaType, n
local player_zone = pos[5];
local worldManager = GetWorldManager();
privateAreaType = privateAreaType or 0;
if argc >= 3 then
if argc == 3 then

View File

@ -53,14 +53,24 @@ ISANDOREL = 1000152;
MERLZIRN = 1000472;
MSK_TRIGGER = 1090001;
NERVOUS_BARRACUDA = 1000096;
INTIMIDATING_BARRACUDA = 1000097;
OVEREAGER_BARRACUDA = 1000107;
SOPHISTICATED_BARRACUDA = 1000108;
SMIRKING_BARRACUDA = 1000109;
MANNSKOEN = 1000142;
TOTORUTO = 1000161;
ADVENTURER1 = 1000869;
ADVENTURER2 = 1000870;
ADVENTURER3 = 1000871;
ECHO_EXIT_TRIGGER = 1090003;
-- Quest Markers
MRKR_HOB = 11000202;
-- Quest Flags
FLAG_SEQ007_VISITED_CUL = 1;
FLAG_SEQ007_VISITED_MSK = 2;
FLAG_SEQ007_MSK_CUTSCENE = 3;
FLAG_SEQ007_MSK_CUTSCENE2 = 4;
-- Quest Data
CNTR_SEQ7_CUL = 1;
CNTR_SEQ7_MRD = 2;
function onStart(player, quest)
quest:StartSequence(SEQ_000);
@ -97,17 +107,36 @@ function onSequence(player, quest, sequence)
elseif (sequence == SEQ_006) then
quest:AddENpc(BADERON, QFLAG_PLATE);
elseif (sequence == SEQ_007) then
local isandorelFlag1 = not quest:GetFlag(FLAG_SEQ007_VISITED_MSK);
local isandorelFlag2 = not quest:GetFlag(FLAG_SEQ007_MSK_CUTSCENE);
local subseqCUL = quest:GetCounter(CNTR_SEQ7_CUL);
local subseqMRD = quest:GetCounter(CNTR_SEQ7_MRD);
-- Always active in this seqence
quest:AddENpc(BADERON);
quest:AddENpc(CHARLYS, not quest:GetFlag(FLAG_SEQ007_VISITED_CUL) and QFLAG_PLATE or QFLAG_NONE);
quest:AddENpc(ISANDOREL, ((isandorelFlag1) or (quest:GetFlag(FLAG_SEQ007_MSK_CUTSCENE) and isandorelFlag2)) and QFLAG_PLATE or QFLAG_NONE);
quest:AddENpc(MSK_TRIGGER, not quest:GetFlag(FLAG_SEQ007_MSK_CUTSCENE) and QFLAG_MAP or QFLAG_NONE, false, not quest:GetFlag(FLAG_SEQ007_MSK_CUTSCENE));
quest:AddENpc(CHARLYS, subseqCUL == 0 and QFLAG_PLATE or QFLAG_NONE);
quest:AddENpc(MERLZIRN);
-- Down and Up the MSK guild
quest:AddENpc(ISANDOREL, (subseqMRD == 0 or subseqMRD == 2) and QFLAG_PLATE or QFLAG_NONE);
if (quest:GetFlag(FLAG_SEQ007_VISITED_CUL) and quest:GetFlag(FLAG_SEQ007_VISITED_MSK)) then
if (subseqMRD == 1) then
quest:AddENpc(MSK_TRIGGER, QFLAG_MAP, false, true);
elseif (subseqMRD == 2) then
quest:AddENpc(MERLZIRN);
end
-- In Echo
quest:AddENpc(NERVOUS_BARRACUDA);
quest:AddENpc(INTIMIDATING_BARRACUDA);
quest:AddENpc(OVEREAGER_BARRACUDA);
quest:AddENpc(SOPHISTICATED_BARRACUDA);
quest:AddENpc(SMIRKING_BARRACUDA);
quest:AddENpc(MANNSKOEN);
quest:AddENpc(TOTORUTO);
quest:AddENpc(ADVENTURER1);
quest:AddENpc(ADVENTURER2);
quest:AddENpc(ADVENTURER3);
quest:AddENpc(ECHO_EXIT_TRIGGER, subseqMRD == 3 and QFLAG_MAP or QFLAG_NONE, false, subseqMRD == 3);
if (subseqCUL == 1 and subseqMRD == 4) then
player:SetNpcLS(1, 1);
end
end
@ -174,6 +203,7 @@ function seq000_onTalk(player, quest, npc, classId)
player:SetLoginDirector(director);
player:KickEvent(director, "noticeEvent", true);
quest:UpdateENPCs();
GetWorldManager():DoZoneChange(player, 133, nil, 0, 15, player.positionX, player.positionY, player.positionZ, player.rotation);
return;
elseif (classId == MYTESYN) then
@ -190,42 +220,61 @@ function seq000_onTalk(player, quest, npc, classId)
end
function seq007_onTalk(player, quest, npc, classId)
local subseqCUL = quest:GetCounter(CNTR_SEQ7_CUL);
local subseqMRD = quest:GetCounter(CNTR_SEQ7_MRD);
if (classId == BADERON) then
if (quest:GetFlag(FLAG_SEQ007_VISITED_CUL)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent027_3");
elseif (quest:GetFlag(FLAG_SEQ007_VISITED_MSK)) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent027_4");
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent027_2");
end
player:EndEvent();
if (subseqCUL == 1) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent027_3");
elseif (subseqMRD == 4) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent027_4");
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent027_2");
end
elseif (classId == CHARLYS) then
if (not quest:GetFlag(FLAG_SEQ007_VISITED_CUL)) then
if (subseqCUL == 0) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent030");
quest:SetFlag(FLAG_SEQ007_VISITED_CUL);
--give 100gil
quest:IncCounter(CNTR_SEQ7_CUL);
--give 1000g
else
callClientFunction(player, "delegateEvent", player, quest, "processEvent030_2");
end
player:EndEvent();
elseif (classId == ISANDOREL) then
if (quest:GetFlag(FLAG_SEQ007_VISITED_MSK) and quest:GetFlag(FLAG_SEQ007_MSK_CUTSCENE)) then
if (subseqMRD == 2) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050");
quest:SetFlag(FLAG_SEQ007_MSK_CUTSCENE2);
player:EndEvent();
local pos = player:GetPos();
GetWorldManager():DoZoneChange(player, 230, "PrivateAreaMasterPast", 3, 15, pos[1], pos[2], pos[3], pos[4]);
elseif (not quest:GetFlag(FLAG_SEQ007_VISITED_MSK)) then
quest:IncCounter(CNTR_SEQ7_MRD);
GetWorldManager():WarpToPrivateArea(player, "PrivateAreaMasterPast", 3);
elseif (subseqMRD == 0) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent035");
quest:SetFlag(FLAG_SEQ007_VISITED_MSK);
else
quest:IncCounter(CNTR_SEQ7_MRD);
elseif (subseqMRD == 1) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent035_2");
end
player:EndEvent();
elseif (classId == MERLZIRN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent40_2");
player:EndEvent();
elseif (classId == INTIMIDATING_BARRACUDA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_2");
elseif (classId == TOTORUTO) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_4");
elseif (classId == MANNSKOEN) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_6");
elseif (classId == NERVOUS_BARRACUDA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_7");
elseif (classId == OVEREAGER_BARRACUDA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_8");
elseif (classId == SOPHISTICATED_BARRACUDA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_9");
elseif (classId == SMIRKING_BARRACUDA) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_10");
elseif (classId == ADVENTURER2) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_13");
elseif (classId == ADVENTURER3) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_14");
elseif (classId == ADVENTURER1) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent050_15");
end
player:EndEvent();
end
function onPush(player, quest, npc)
@ -235,9 +284,16 @@ function onPush(player, quest, npc)
if (sequence == SEQ_007) then
if (classId == MSK_TRIGGER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent040");
quest:SetFlag(FLAG_SEQ007_MSK_CUTSCENE);
quest:IncCounter(CNTR_SEQ7_MRD);
player:EndEvent();
quest:UpdateENPCs();
GetWorldManager():DoZoneChange(player, 230, nil, 0, 15, -620.0, 29.476, -70.050, 0.791);
elseif (classId == ECHO_EXIT_TRIGGER) then
callClientFunction(player, "delegateEvent", player, quest, "processEvent060");
quest:IncCounter(CNTR_SEQ7_MRD);
player:EndEvent();
quest:UpdateENPCs();
GetWorldManager():WarpToPublicArea(player);
end
end
end
@ -271,11 +327,7 @@ function onNpcLS(player, quest, npcLSId)
end
function getJournalInformation(player, quest)
if (quest:GetFlag(FLAG_SEQ007_VISITED_CUL) and quest:GetFlag(FLAG_SEQ007_VISITED_MSK)) then
return 0, 5, 20;
else
return;
end
return 0, quest:GetCounter(CNTR_SEQ7_CUL) * 5, quest:GetCounter(CNTR_SEQ7_MRD) * 5;
end

View File

@ -1,47 +0,0 @@
/*
MySQL Data Transfer
Source Host: localhost
Source Database: ffxiv_server
Target Host: localhost
Target Database: ffxiv_server
Date: 3/7/2017 8:30:07 AM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for server_zones_spawnlocations
-- ----------------------------
CREATE TABLE `server_zones_spawnlocations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`zoneId` int(10) unsigned NOT NULL,
`privateAreaName` varchar(32) DEFAULT NULL,
`spawnType` tinyint(3) unsigned DEFAULT '0',
`spawnX` float NOT NULL,
`spawnY` float NOT NULL,
`spawnZ` float NOT NULL,
`spawnRotation` float NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `server_zones_spawnlocations` VALUES ('1', '155', null, '15', '58.92', '4', '-1219.07', '0.52');
INSERT INTO `server_zones_spawnlocations` VALUES ('2', '133', null, '15', '-444.266', '39.518', '191', '1.9');
INSERT INTO `server_zones_spawnlocations` VALUES ('3', '175', null, '15', '-110.157', '202', '171.345', '0');
INSERT INTO `server_zones_spawnlocations` VALUES ('4', '193', null, '15', '0.016', '10.35', '-36.91', '0.025');
INSERT INTO `server_zones_spawnlocations` VALUES ('5', '166', null, '15', '356.09', '3.74', '-701.62', '-1.4');
INSERT INTO `server_zones_spawnlocations` VALUES ('6', '184', null, '15', '5.36433', '196', '133.656', '-2.84938');
INSERT INTO `server_zones_spawnlocations` VALUES ('7', '128', null, '15', '-8.48', '45.36', '139.5', '2.02');
INSERT INTO `server_zones_spawnlocations` VALUES ('8', '230', 'PrivateAreaMasterPast', '15', '-838.1', '6', '231.94', '1.1');
INSERT INTO `server_zones_spawnlocations` VALUES ('9', '193', null, '16', '-5', '16.35', '6', '0.5');
INSERT INTO `server_zones_spawnlocations` VALUES ('10', '166', null, '16', '356.09', '3.74', '-701.62', '-1.4');
INSERT INTO `server_zones_spawnlocations` VALUES ('11', '244', null, '15', '0.048', '0', '-5.737', '0');
INSERT INTO `server_zones_spawnlocations` VALUES ('12', '244', null, '15', '-160.048', '0', '-165.737', '0');
INSERT INTO `server_zones_spawnlocations` VALUES ('13', '244', null, '15', '160.048', '0', '154.263', '0');
INSERT INTO `server_zones_spawnlocations` VALUES ('14', '150', null, '15', '333.271', '5.889', '-943.275', '0.794');
INSERT INTO `server_zones_spawnlocations` VALUES ('15', '133', null, '15', '-8.062', '45.429', '139.364', '2.955');
INSERT INTO `server_zones_spawnlocations` VALUES ('16', '170', null, '15', '-27.015', '181.798', '-79.72', '2.513');
INSERT INTO `server_zones_spawnlocations` VALUES ('17', '184', null, '16', '-24.34', '192', '34.22', '0.78');
INSERT INTO `server_zones_spawnlocations` VALUES ('18', '184', null, '15', '-24.34', '192', '34.22', '0.78');
INSERT INTO `server_zones_spawnlocations` VALUES ('19', '184', null, '15', '-22', '196', '87', '1.8');

View File

@ -642,7 +642,7 @@ namespace Meteor.Map.Actors
return new Vector3(positionX, positionY, positionZ);
}
public void SetPos(float x, float y, float z, float rot = 0, uint zoneId = 0)
public void SetPos(float x, float y, float z, float rot = 0, bool instant = false)
{
oldPositionX = positionX;
oldPositionY = positionY;
@ -655,7 +655,13 @@ namespace Meteor.Map.Actors
rotation = rot;
// todo: handle zone?
CurrentArea.BroadcastPacketAroundActor(this, MoveActorToPositionPacket.BuildPacket(Id, x, y, z, rot, moveState));
if (instant)
{
CurrentArea.BroadcastPacketAroundPoint(oldPositionX, oldPositionY, CreateSpawnTeleportPacket(0));
CurrentArea.BroadcastPacketAroundPoint(positionX, positionY, CreateSpawnTeleportPacket(0));
}
else
CurrentArea.BroadcastPacketAroundActor(this, MoveActorToPositionPacket.BuildPacket(Id, x, y, z, rot, moveState));
}
public void LookAt(Actor actor)

View File

@ -488,6 +488,26 @@ namespace Meteor.Map.Actors
}
}
public void BroadcastPacketAroundPoint(float x, float y, SubPacket packet)
{
if (isIsolated)
return;
List<Actor> aroundActor = GetActorsAroundPoint(x, y, 50);
foreach (Actor a in aroundActor)
{
if (a is Player)
{
if (isIsolated)
continue;
SubPacket clonedPacket = new SubPacket(packet, a.Id);
Player p = (Player)a;
p.QueuePacket(clonedPacket);
}
}
}
public void SpawnActor(SpawnLocation location)
{
lock (mActorList)
@ -497,16 +517,8 @@ namespace Meteor.Map.Actors
if (actorClass == null)
return;
uint zoneId;
if (this is PrivateArea)
zoneId = ((PrivateArea)this).GetParentZone().Id;
else
zoneId = Id;
Npc npc = new Npc(mActorList.Count + 1, actorClass, location.uniqueId, this, location.x, location.y, location.z, location.rot, location.state, location.animId, null);
npc.LoadEventConditions(actorClass.eventConditions);
AddActorToZone(npc);
@ -522,12 +534,6 @@ namespace Meteor.Map.Actors
if (actorClass == null)
return null;
uint zoneId;
if (this is PrivateArea)
zoneId = ((PrivateArea)this).GetParentZone().Id;
else
zoneId = Id;
Npc npc;
if (isMob)
npc = new BattleNpc(mActorList.Count + 1, actorClass, uniqueId, this, x, y, z, rot, state, animId, null);
@ -554,13 +560,6 @@ namespace Meteor.Map.Actors
if (actorClass == null)
return null;
uint zoneId;
if (this is PrivateArea)
zoneId = ((PrivateArea)this).GetParentZone().Id;
else
zoneId = Id;
Npc npc = new Npc(mActorList.Count + 1, actorClass, uniqueId, this, x, y, z, 0, regionId, layoutId);
npc.LoadEventConditions(actorClass.eventConditions);

View File

@ -582,7 +582,7 @@ namespace Meteor.Map.Actors
QueuePacket(SetWeatherPacket.BuildPacket(Id, SetWeatherPacket.WEATHER_CLEAR, 1));
}
public void SendZoneInPackets(WorldManager world, ushort spawnType, bool changeMap)
public void SendZoneInPackets(WorldManager world, ushort spawnType)
{
QueuePacket(SetActorIsZoningPacket.BuildPacket(Id, false));
QueuePacket(SetDalamudPacket.BuildPacket(Id, 0));
@ -979,6 +979,16 @@ namespace Meteor.Map.Actors
//CurrentArea.BroadcastPacketAroundActor(this, worldMasterMessage);
}
public void ChangeIntoNpc(Npc npc)
{
uint[] npcAppearIds = new uint[appearanceIds.Length];
for (int i = 0; i < appearanceIds.Length; i++)
npcAppearIds[i] = npc.appearanceIds[i];
SetActorAppearancePacket setappearance = new SetActorAppearancePacket(npc.modelId, npcAppearIds);
BroadcastPacket(setappearance.BuildPacket(Id), true);
}
public void GraphicChange(uint slot, uint graphicId)
{
appearanceIds[slot] = graphicId;

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Meteor.Map.Actors.Debug
{
class DebugWork
{
public bool enableWidget;
public bool printProcessing;
public float printProcessingLog;
public bool printDisp;
public bool printDispFront;
public int serverTimeOffset;
}
}

View File

@ -873,7 +873,7 @@ namespace Meteor.Map
if (oldArea is PrivateAreaContent)
((PrivateAreaContent)oldArea).CheckDestroy();
}
}
//Send packets
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.Id));
@ -916,6 +916,29 @@ namespace Meteor.Map
}
}
// Warp the player to a private area within the zone.
public void WarpToPrivateArea(Player player, String name, int type)
{
WarpToPrivateArea(player, name, type, player.positionX, player.positionY, player.positionZ, player.rotation);
}
// Warp the player to a private area within the zone to a specific location.
public void WarpToPrivateArea(Player player, String name, int type, float x, float y, float z, float rotation)
{
DoZoneChange(player, player.CurrentArea.ZoneId, name, type, 15, x, y, z, rotation);
}
public void WarpToPublicArea(Player player)
{
WarpToPublicArea(player, player.positionX, player.positionY, player.positionZ, player.rotation);
}
public void WarpToPublicArea(Player player, float x, float y, float z, float rotation)
{
if (player.CurrentArea.IsPrivate())
DoZoneChange(player, player.CurrentArea.ZoneId, null, 0, 15, x, y, z, rotation);
}
//Moves actor to new zone, and sends packets to spawn at the given coords.
public void DoZoneChangeContent(Player player, PrivateAreaContent contentArea, float spawnX, float spawnY, float spawnZ, float spawnRotation, ushort spawnType = SetActorPositionPacket.SPAWNTYPE_WARP_DUTY)
{