mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
added ion's and showmo's enums
- added nullable DateTime param to UnixTimeStampUTC
This commit is contained in:
@@ -98,7 +98,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
public ushort currentJob;
|
||||
|
||||
public Character(uint actorID) : base(actorID)
|
||||
{
|
||||
{
|
||||
//Init timer array to "notimer"
|
||||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
charaWork.statusShownTime[i] = 0xFFFFFFFF;
|
||||
@@ -109,7 +109,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
ResetMoveSpeeds();
|
||||
// todo: base this on equip and shit
|
||||
SetMod((uint)Modifier.AttackRange, 3);
|
||||
SetMod((uint)Modifier.AttackDelay, (Program.Random.Next(30,60) * 100));
|
||||
SetMod((uint)Modifier.AttackDelay, (Program.Random.Next(30, 60) * 100));
|
||||
}
|
||||
|
||||
public SubPacket CreateAppearancePacket()
|
||||
@@ -120,7 +120,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
public SubPacket CreateInitStatusPacket()
|
||||
{
|
||||
return (SetActorStatusAllPacket.BuildPacket(actorId, charaWork.status));
|
||||
return (SetActorStatusAllPacket.BuildPacket(actorId, charaWork.status));
|
||||
}
|
||||
|
||||
public SubPacket CreateSetActorIconPacket()
|
||||
@@ -148,7 +148,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
currentContentGroup = group;
|
||||
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/currentContentGroup", this);
|
||||
propPacketUtil.AddProperty("charaWork.currentContentGroup");
|
||||
propPacketUtil.AddProperty("charaWork.currentContentGroup");
|
||||
zone.BroadcastPacketsAroundActor(this, propPacketUtil.Done());
|
||||
|
||||
}
|
||||
@@ -167,7 +167,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
}
|
||||
|
||||
public void PlayAnimation(uint animId, bool onlySelf = false)
|
||||
{
|
||||
{
|
||||
if (onlySelf)
|
||||
{
|
||||
if (this is Player)
|
||||
@@ -236,7 +236,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
if (updateFlags != ActorUpdateFlags.None)
|
||||
{
|
||||
packets = packets ?? new List<SubPacket>();
|
||||
|
||||
|
||||
if ((updateFlags & ActorUpdateFlags.Appearance) != 0)
|
||||
{
|
||||
packets.Add(new SetActorAppearancePacket(modelId, appearanceIds).BuildPacket(actorId));
|
||||
@@ -322,6 +322,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
aiContainer.Cast(Server.GetWorldManager().GetActorInWorld(targetId == 0 ? currentTarget : targetId) as Character, spellId);
|
||||
}
|
||||
|
||||
public void Ability(uint abilityId, uint targetId = 0)
|
||||
{
|
||||
aiContainer.Ability(Server.GetWorldManager().GetActorInWorld(targetId == 0 ? currentTarget : targetId) as Character, abilityId);
|
||||
}
|
||||
|
||||
public void WeaponSkill(uint skillId)
|
||||
{
|
||||
aiContainer.WeaponSkill(Server.GetWorldManager().GetActorInWorld(currentTarget) as Character, skillId);
|
||||
|
@@ -113,7 +113,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||
|
||||
public bool CanChangeState()
|
||||
{
|
||||
return states.Count == 0 || states.Peek().CanInterrupt();
|
||||
return GetCurrentState() == null || states.Peek().CanInterrupt();
|
||||
}
|
||||
|
||||
public void ChangeTarget(Character target)
|
||||
@@ -217,6 +217,14 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||
InternalDisengage();
|
||||
}
|
||||
|
||||
public void Ability(Character target, uint abilityId)
|
||||
{
|
||||
if (controller != null)
|
||||
controller.Ability(target, abilityId);
|
||||
else
|
||||
InternalAbility(target, abilityId);
|
||||
}
|
||||
|
||||
public void Cast(Character target, uint spellId)
|
||||
{
|
||||
if (controller != null)
|
||||
@@ -293,6 +301,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||
ClearStates();
|
||||
}
|
||||
|
||||
public void InternalAbility(Character target, uint abilityId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void InternalCast(Character target, uint spellId)
|
||||
{
|
||||
ChangeState(new MagicState(owner, target, (ushort)spellId));
|
||||
|
@@ -68,7 +68,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
|
||||
|
||||
public override void Ability(Character target, uint abilityId)
|
||||
{
|
||||
|
||||
owner.aiContainer.InternalAbility(target, abilityId);
|
||||
}
|
||||
|
||||
public override void RangedAttack(Character target)
|
||||
|
@@ -18,9 +18,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
public AttackState(Character owner, Character target) :
|
||||
base(owner, target)
|
||||
{
|
||||
this.canInterrupt = true;
|
||||
this.startTime = DateTime.Now;
|
||||
|
||||
owner.ChangeState(SetActorStatePacket.MAIN_STATE_ACTIVE);
|
||||
owner.aiContainer.ChangeTarget(target);
|
||||
this.startTime = DateTime.Now;
|
||||
attackTime = startTime;
|
||||
owner.aiContainer.pathFind?.Clear();
|
||||
// todo: should handle everything here instead of on next tick..
|
||||
|
@@ -8,6 +8,7 @@ using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.battle;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
{
|
||||
@@ -56,12 +57,21 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
// todo: check within attack range
|
||||
startPos = owner.GetPosAsVector3();
|
||||
owner.LookAt(target);
|
||||
float[] baseCastDuration = { 1.0f, 0.25f };
|
||||
|
||||
foreach (var player in owner.zone.GetActorsAroundActor<Player>(owner, 50))
|
||||
float spellSpeed = spell.castTimeSeconds;
|
||||
List<SubPacket> packets = new List<SubPacket>();
|
||||
|
||||
// command casting duration
|
||||
if (owner.currentSubState == SetActorStatePacket.SUB_STATE_PLAYER)
|
||||
{
|
||||
// todo: this is retarded, prolly doesnt do what i think its gonna do
|
||||
//player.QueuePacket(BattleActionX01Packet.BuildPacket(player.actorId, owner.actorId, target != null ? target.actorId : 0xC0000000, spell.battleAnimation, spell.effectAnimation, 0, spell.id, 0, (byte)spell.castTimeSeconds));
|
||||
// todo: modify spellSpeed based on modifiers and stuff
|
||||
// ((Player)owner).SendStartCastBar(spell.id, Utils.UnixTimeStampUTC(DateTime.Now.AddSeconds(spellSpeed)));
|
||||
|
||||
}
|
||||
// todo: change
|
||||
|
||||
owner.zone.BroadcastPacketsAroundActor(owner, packets);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,5 +170,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
||||
{
|
||||
return (Utils.DistanceSquared(owner.GetPosAsVector3(), startPos) > 4.0f);
|
||||
}
|
||||
|
||||
public override void Cleanup()
|
||||
{
|
||||
// command casting duration
|
||||
var packets = new List<SubPacket>();
|
||||
if (owner.currentSubState == SetActorStatePacket.SUB_STATE_PLAYER)
|
||||
{
|
||||
// ((Player)owner).SendStartCastBar(0, 0);
|
||||
}
|
||||
owner.zone.BroadcastPacketsAroundActor(owner, packets);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user