mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-24 03:20:30 +02:00
Speed is now stored in the actor. Redid actor speed packet to use float. Added GameMessagePacket which can use all 20 msg packets. Added functions for lua side to call in player obj.
This commit is contained in:
parent
fe69f069ea
commit
cfb29b912f
7 changed files with 445 additions and 21 deletions
|
@ -29,6 +29,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public float positionX, positionY, positionZ, rotation;
|
||||
public float oldPositionX, oldPositionY, oldPositionZ, oldRotation;
|
||||
public ushort moveState, oldMoveState;
|
||||
public float[] moveSpeeds = new float[5];
|
||||
|
||||
public uint zoneId;
|
||||
public Zone zone = null;
|
||||
|
@ -52,6 +53,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
this.actorName = actorName;
|
||||
this.className = className;
|
||||
this.classParams = classParams;
|
||||
|
||||
this.moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP;
|
||||
this.moveSpeeds[1] = SetActorSpeedPacket.DEFAULT_WALK;
|
||||
this.moveSpeeds[2] = SetActorSpeedPacket.DEFAULT_RUN;
|
||||
this.moveSpeeds[3] = SetActorSpeedPacket.DEFAULT_RUN;
|
||||
}
|
||||
|
||||
public SubPacket createAddActorPacket(uint playerActorId, byte val)
|
||||
|
@ -220,6 +226,30 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return classParams;
|
||||
}
|
||||
|
||||
public void changeState(ushort newState)
|
||||
{
|
||||
currentMainState = newState;
|
||||
SubPacket changeStatePacket = SetActorStatePacket.buildPacket(actorId, actorId, newState, currentSubState);
|
||||
zone.broadcastPacketAroundActor(this, changeStatePacket);
|
||||
}
|
||||
|
||||
public void changeSpeed(int type, float value)
|
||||
{
|
||||
moveSpeeds[type] = value;
|
||||
SubPacket changeSpeedPacket = SetActorSpeedPacket.buildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]);
|
||||
zone.broadcastPacketAroundActor(this, changeSpeedPacket);
|
||||
}
|
||||
|
||||
public void changeSpeed(float speedStop, float speedWalk, float speedRun)
|
||||
{
|
||||
moveSpeeds[0] = speedStop;
|
||||
moveSpeeds[1] = speedWalk;
|
||||
moveSpeeds[2] = speedRun;
|
||||
moveSpeeds[3] = speedRun;
|
||||
SubPacket changeSpeedPacket = SetActorSpeedPacket.buildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]);
|
||||
zone.broadcastPacketAroundActor(this, changeSpeedPacket);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,5 +289,22 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
|
||||
public void broadcastPacketAroundActor(Actor actor, SubPacket packet)
|
||||
{
|
||||
if (zone != null)
|
||||
{
|
||||
List<Actor> aroundActor = getActorsAroundActor(actor, 50);
|
||||
foreach (Actor a in aroundActor)
|
||||
{
|
||||
if (a is Player)
|
||||
{
|
||||
SubPacket clonedPacket = new SubPacket(packet, actor.actorId);
|
||||
Player p = (Player)a;
|
||||
p.queuePacket(clonedPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -598,7 +598,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
{
|
||||
playerSession.queuePacket(packet, true, false);
|
||||
}
|
||||
|
||||
|
||||
public void sendMessage(uint logType, string sender, string message)
|
||||
{
|
||||
queuePacket(SendMessagePacket.buildPacket(actorId, actorId, logType, sender, message));
|
||||
|
@ -614,6 +614,32 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
queuePacket(QuitPacket.buildPacket(actorId));
|
||||
}
|
||||
|
||||
public void changeMusic(ushort musicId)
|
||||
{
|
||||
queuePacket(SetMusicPacket.buildPacket(actorId, musicId, 1));
|
||||
}
|
||||
|
||||
public void sendChocoboAppearance()
|
||||
{
|
||||
queuePacket(SetCurrentMountChocoboPacket.buildPacket(actorId, chocoboAppearance));
|
||||
}
|
||||
|
||||
public void sendGoobbueAppearance()
|
||||
{
|
||||
queuePacket(SetCurrentMountGoobbuePacket.buildPacket(actorId, 1));
|
||||
}
|
||||
|
||||
public void sendWorldMessage(ushort worldMasterId, params object[] msgParams)
|
||||
{
|
||||
//queuePacket(WorldMasterPacket.buildPacket());
|
||||
}
|
||||
|
||||
public void broadcastWorldMessage(ushort worldMasterId, params object[] msgParams)
|
||||
{
|
||||
//SubPacket worldMasterMessage =
|
||||
//zone.broadcastPacketAroundActor(this, worldMasterMessage);
|
||||
}
|
||||
|
||||
public void runEventFunction(string functionName, params object[] parameters)
|
||||
{
|
||||
List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue