mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
134 lines
5.3 KiB
C#
134 lines
5.3 KiB
C#
using FFXIVClassic_Lobby_Server;
|
|
using FFXIVClassic_Lobby_Server.common;
|
|
using FFXIVClassic_Lobby_Server.dataobjects;
|
|
using FFXIVClassic_Lobby_Server.packets;
|
|
using FFXIVClassic_Map_Server.dataobjects.database;
|
|
using FFXIVClassic_Map_Server.lua;
|
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
|
using MySql.Data.MySqlClient;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
|
{
|
|
class Player : Character
|
|
{
|
|
|
|
public const int TIMER_TOTORAK = 0;
|
|
public const int TIMER_DZEMAEL = 1;
|
|
public const int TIMER_BOWL_OF_EMBERS_HARD = 2;
|
|
public const int TIMER_BOWL_OF_EMBERS = 3;
|
|
public const int TIMER_THORNMARCH = 4;
|
|
public const int TIMER_AURUMVALE = 5;
|
|
public const int TIMER_CUTTERSCRY = 6;
|
|
public const int TIMER_BATTLE_ALEPORT = 7;
|
|
public const int TIMER_BATTLE_HYRSTMILL = 8;
|
|
public const int TIMER_BATTLE_GOLDENBAZAAR = 9;
|
|
public const int TIMER_HOWLING_EYE_HARD = 10;
|
|
public const int TIMER_HOWLING_EYE = 11;
|
|
public const int TIMER_CASTRUM_TOWER = 12;
|
|
public const int TIMER_BOWL_OF_EMBERS_EXTREME = 13;
|
|
public const int TIMER_RIVENROAD = 14;
|
|
public const int TIMER_RIVENROAD_HARD = 15;
|
|
public const int TIMER_BEHEST = 16;
|
|
public const int TIMER_COMPANYBEHEST = 17;
|
|
public const int TIMER_RETURN = 18;
|
|
public const int TIMER_SKIRMISH = 19;
|
|
|
|
public uint[] timers = new uint[20];
|
|
|
|
public uint currentTitle;
|
|
|
|
public byte gcCurrent;
|
|
public byte gcRankLimsa;
|
|
public byte gcRankGridania;
|
|
public byte gcRankUldah;
|
|
|
|
public bool hasChocobo;
|
|
public bool hasGoobbue;
|
|
public byte chocoboAppearance;
|
|
public string chocoboName;
|
|
|
|
public uint achievementPoints;
|
|
public ushort[] latestAchievements = new ushort[5];
|
|
|
|
public PlayerWork playerWork = new PlayerWork();
|
|
|
|
public Player(uint actorID) : base(actorID)
|
|
{
|
|
actorName = String.Format("_pc{0:00000000}", actorID);
|
|
className = "Player";
|
|
currentSubState = SetActorStatePacket.SUB_STATE_PLAYER;
|
|
|
|
charaWork.property[0] = 1;
|
|
charaWork.property[1] = 1;
|
|
charaWork.property[2] = 1;
|
|
charaWork.property[4] = 1;
|
|
|
|
charaWork.parameterSave.state_mainSkill[0] = 3;
|
|
charaWork.parameterSave.state_mainSkillLevel = 1;
|
|
|
|
Database.loadPlayerCharacter(this);
|
|
}
|
|
|
|
public List<SubPacket> create0x132Packets(uint playerActorId)
|
|
{
|
|
List<SubPacket> packets = new List<SubPacket>();
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0xB, "commandForced"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0xA, "commandDefault"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x6, "commandWeak"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x4, "commandContent"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x6, "commandJudgeMode"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x100, "commandRequest"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x100, "widgetCreate"));
|
|
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x100, "macroRequest"));
|
|
return packets;
|
|
}
|
|
|
|
public override SubPacket createScriptBindPacket(uint playerActorId)
|
|
{
|
|
List<LuaParam> lParams;
|
|
if (isMyPlayer(playerActorId))
|
|
{
|
|
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, true, 0, false, timers, true);
|
|
}
|
|
else
|
|
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, false, false, true);
|
|
|
|
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
|
}
|
|
|
|
public override BasePacket getInitPackets(uint playerActorId)
|
|
{
|
|
List<SubPacket> subpackets = new List<SubPacket>();
|
|
subpackets.Add(createAddActorPacket(playerActorId));
|
|
if (isMyPlayer(playerActorId))
|
|
subpackets.AddRange(create0x132Packets(playerActorId));
|
|
subpackets.Add(createSpeedPacket(playerActorId));
|
|
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
|
subpackets.Add(createAppearancePacket(playerActorId));
|
|
subpackets.Add(createNamePacket(playerActorId));
|
|
subpackets.Add(_0xFPacket.buildPacket(playerActorId, playerActorId));
|
|
subpackets.Add(createStatePacket(playerActorId));
|
|
subpackets.Add(createIdleAnimationPacket(playerActorId));
|
|
subpackets.Add(createInitStatusPacket(playerActorId));
|
|
subpackets.Add(createSetActorIconPacket(playerActorId));
|
|
subpackets.Add(createIsZoneingPacket(playerActorId));
|
|
subpackets.Add(createScriptBindPacket(playerActorId));
|
|
|
|
return BasePacket.createPacket(subpackets, true, false);
|
|
}
|
|
|
|
public bool isMyPlayer(uint otherActorId)
|
|
{
|
|
return actorId == otherActorId;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|