mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-24 11:28:22 +02:00
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:
parent
9f077190a3
commit
214d730a58
13 changed files with 208 additions and 124 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
18
Map Server/Actors/Debug/DebugWork.cs
Normal file
18
Map Server/Actors/Debug/DebugWork.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue