1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-24 13:47:46 +00:00

Fixed bug with old "findActor" code since private areas were added. Add scripts for npcs in echo during limsa opening.

This commit is contained in:
Filip Maj 2017-03-08 09:12:14 -05:00
parent eb324062da
commit 0c3f6cc9c4
13 changed files with 149 additions and 27 deletions

View file

@ -581,7 +581,7 @@ namespace FFXIVClassic_Map_Server
newArea.AddActorToZone(player); newArea.AddActorToZone(player);
//Update player actor's properties //Update player actor's properties
player.zoneId = newArea.actorId; player.zoneId = newArea is PrivateArea ? ((PrivateArea)newArea).GetParentZone().actorId : newArea.actorId;
player.privateArea = newArea is PrivateArea ? ((PrivateArea)newArea).GetPrivateAreaName() : null; player.privateArea = newArea is PrivateArea ? ((PrivateArea)newArea).GetPrivateAreaName() : null;
player.privateAreaType = newArea is PrivateArea ? ((PrivateArea)newArea).GetPrivateAreaType() : 0; player.privateAreaType = newArea is PrivateArea ? ((PrivateArea)newArea).GetPrivateAreaType() : 0;
@ -649,16 +649,20 @@ namespace FFXIVClassic_Map_Server
public void DoZoneIn(Player player, bool isLogin, ushort spawnType) public void DoZoneIn(Player player, bool isLogin, ushort spawnType)
{ {
//Add player to new zone and update //Add player to new zone and update
Zone zone = GetZone(player.zoneId); Area playerArea;
if (player.privateArea != null)
playerArea = GetPrivateArea(player.zoneId, player.privateArea, player.privateAreaType);
else
playerArea = GetZone(player.zoneId);
//This server does not contain that zoneId //This server does not contain that zoneId
if (zone == null) if (playerArea == null)
return; return;
//Set the current zone and add player //Set the current zone and add player
player.zone = zone; player.zone = playerArea;
zone.AddActorToZone(player); playerArea.AddActorToZone(player);
//Send packets //Send packets
if (!isLogin) if (!isLogin)
@ -833,13 +837,18 @@ namespace FFXIVClassic_Map_Server
public Player GetPCInWorld(string name) public Player GetPCInWorld(string name)
{ {
foreach (Zone zone in zoneList.Values) if (Server.GetServer().GetSession(name) != null)
{ return Server.GetServer().GetSession(name).GetActor();
Player p = zone.FindPCInZone(name); else
if (p != null) return null;
return p; }
}
return null; public Player GetPCInWorld(uint charId)
{
if (Server.GetServer().GetSession(charId) != null)
return Server.GetServer().GetSession(charId).GetActor();
else
return null;
} }
public Actor GetActorInWorld(uint charId) public Actor GetActorInWorld(uint charId)
@ -864,17 +873,6 @@ namespace FFXIVClassic_Map_Server
return null; return null;
} }
public Player GetPCInWorld(uint charId)
{
foreach (Zone zone in zoneList.Values)
{
Player p = zone.FindPCInZone(charId);
if (p != null)
return p;
}
return null;
}
public Zone GetZone(uint zoneId) public Zone GetZone(uint zoneId)
{ {
if (!zoneList.ContainsKey(zoneId)) if (!zoneList.ContainsKey(zoneId))

View file

@ -627,6 +627,13 @@ namespace FFXIVClassic_Map_Server.Actors
} }
} }
public void ChangeAnimation(uint animId)
{
Actor a = zone.FindActorInZone(currentTarget);
if (a is Npc)
((Npc)a).animationId = animId;
}
public void SetDCFlag(bool flag) public void SetDCFlag(bool flag)
{ {
if (flag) if (flag)

View file

@ -190,7 +190,8 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>xcopy "$(SolutionDir)data\world_config.ini" "$(SolutionDir)$(ProjectName)\$(OutDir)" /d</PostBuildEvent> <PostBuildEvent>
</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_2");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_5");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_4");
player:EndEvent();
end
end
end

View file

@ -4,7 +4,7 @@ function onSpawn(player, npc)
man0l1Quest = player:GetQuest("Man0l1"); man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then if (man0l1Quest ~= nil) then
npc:SetQuestGraphic(player, 0x2); npc:SetQuestGraphic(player, 0x3);
end end
end end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_7");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_6");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_7");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_3");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,13 @@
require ("global")
function onEventStarted(player, npc, triggerName)
man0l1Quest = player:GetQuest("Man0l1");
if (man0l1Quest ~= nil) then
if (triggerName == "talkDefault") then
callClientFunction(player, "delegateEvent", player, man0l1Quest, "processEvent010_8");
player:EndEvent();
end
end
end

View file

@ -0,0 +1,12 @@
function init(npc)
return false, false, 0, 0;
end
function onEventStarted(player, npc, triggerName)
if (triggerName == "caution") then
worldMaster = GetWorldMaster();
player:SendGameMessage(player, worldMaster, 34109, 0x20);
elseif (triggerName == "exit") then
end
player:EndEvent();
end