mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Health updating fix, temp r0 fix
This commit is contained in:
parent
205d3619d6
commit
837c7a9223
@ -500,8 +500,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
npc = new Npc(mActorList.Count + 1, actorClass, uniqueId, this, x, y, z, rot, state, animId, null);
|
npc = new Npc(mActorList.Count + 1, actorClass, uniqueId, this, x, y, z, rot, state, animId, null);
|
||||||
|
|
||||||
npc.LoadEventConditions(actorClass.eventConditions);
|
npc.LoadEventConditions(actorClass.eventConditions);
|
||||||
//npc.SetMaxHP(30000);
|
//npc.SetMaxHP(3000);
|
||||||
//npc.SetHP(30000);
|
//npc.SetHP(3000);
|
||||||
|
|
||||||
AddActorToZone(npc);
|
AddActorToZone(npc);
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
public SharpNav.NavMeshQuery navMeshQuery;
|
public SharpNav.NavMeshQuery navMeshQuery;
|
||||||
|
|
||||||
public Int64 pathCalls;
|
public Int64 pathCalls;
|
||||||
|
public Int64 prevPathCalls = 0;
|
||||||
public Int64 pathCallTime;
|
public Int64 pathCallTime;
|
||||||
|
|
||||||
public Zone(uint id, string zoneName, ushort regionId, string classPath, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool isIsolated, bool isInn, bool canRideChocobo, bool canStealth, bool isInstanceRaid, bool loadNavMesh = false)
|
public Zone(uint id, string zoneName, ushort regionId, string classPath, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool isIsolated, bool isInn, bool canRideChocobo, bool canStealth, bool isInstanceRaid, bool loadNavMesh = false)
|
||||||
@ -196,7 +197,8 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
{
|
{
|
||||||
if (this.pathCalls > 0)
|
if (this.pathCalls > 0)
|
||||||
{
|
{
|
||||||
Program.Log.Debug("Number of pathfinding calls {0} average time {1}ms", pathCalls, (float)(pathCallTime / pathCalls));
|
Program.Log.Debug("Number of pathfinding calls {0} average time {1}ms. {2} this tick", pathCalls, (float)(pathCallTime / pathCalls), pathCalls - prevPathCalls);
|
||||||
|
prevPathCalls = pathCalls;
|
||||||
}
|
}
|
||||||
lastUpdate = tick;
|
lastUpdate = tick;
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if ((updateFlags & ActorUpdateFlags.HpTpMp) != 0)
|
if ((updateFlags & ActorUpdateFlags.HpTpMp) != 0)
|
||||||
{
|
{
|
||||||
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/stateAtQuicklyForAll", this);
|
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/stateAtQuicklyForAll", this);
|
||||||
|
propPacketUtil.AddProperty("charaWork.parameterSave.hp[0]");
|
||||||
|
propPacketUtil.AddProperty("charaWork.parameterSave.hpMax[0]");
|
||||||
propPacketUtil.AddProperty("charaWork.parameterSave.mp");
|
propPacketUtil.AddProperty("charaWork.parameterSave.mp");
|
||||||
propPacketUtil.AddProperty("charaWork.parameterSave.mpMax");
|
propPacketUtil.AddProperty("charaWork.parameterSave.mpMax");
|
||||||
propPacketUtil.AddProperty("charaWork.parameterTemp.tp");
|
propPacketUtil.AddProperty("charaWork.parameterTemp.tp");
|
||||||
|
@ -39,22 +39,24 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
|
|||||||
public override void Update(DateTime tick)
|
public override void Update(DateTime tick)
|
||||||
{
|
{
|
||||||
lastUpdate = tick;
|
lastUpdate = tick;
|
||||||
|
if (!owner.IsDead())
|
||||||
// todo: handle aggro/deaggro and other shit here
|
|
||||||
if (!owner.aiContainer.IsEngaged())
|
|
||||||
{
|
{
|
||||||
TryAggro(tick);
|
// todo: handle aggro/deaggro and other shit here
|
||||||
}
|
if (!owner.aiContainer.IsEngaged())
|
||||||
|
{
|
||||||
|
TryAggro(tick);
|
||||||
|
}
|
||||||
|
|
||||||
if(owner.aiContainer.IsEngaged())
|
if (owner.aiContainer.IsEngaged())
|
||||||
{
|
{
|
||||||
//DoCombatTick(tick);
|
DoCombatTick(tick);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Only move if owner isn't dead and is either too far away from their spawn point or is meant to roam
|
//Only move if owner isn't dead and is either too far away from their spawn point or is meant to roam
|
||||||
if (!owner.IsDead() && (owner.isMovingToSpawn || owner.GetMobMod((uint) MobModifier.Roams) > 0))
|
else if (!owner.IsDead() && (owner.isMovingToSpawn || owner.GetMobMod((uint)MobModifier.Roams) > 0))
|
||||||
{
|
{
|
||||||
DoRoamTick(tick);
|
DoRoamTick(tick);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +105,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
|
|||||||
Engage(owner.hateContainer.GetMostHatedTarget());
|
Engage(owner.hateContainer.GetMostHatedTarget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Engage(Character target)
|
public override bool Engage(Character target)
|
||||||
{
|
{
|
||||||
var canEngage = this.owner.aiContainer.InternalEngage(target);
|
var canEngage = this.owner.aiContainer.InternalEngage(target);
|
||||||
|
@ -129,7 +129,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
|||||||
|
|
||||||
private bool CanAttack()
|
private bool CanAttack()
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
if (!owner.isAutoAttackEnabled)
|
if (!owner.isAutoAttackEnabled)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -15,7 +15,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
|||||||
: base(owner, null)
|
: base(owner, null)
|
||||||
{
|
{
|
||||||
owner.Disengage();
|
owner.Disengage();
|
||||||
//owner.ChangeState(SetActorStatePacket.MAIN_STATE_DEAD2);
|
//owner.ChangeState(SetActorStatePacket.MAIN_STATE_DEAD);
|
||||||
var deathStatePacket = SetActorStatePacket.BuildPacket(owner.actorId, SetActorStatePacket.MAIN_STATE_DEAD, owner.currentSubState);
|
var deathStatePacket = SetActorStatePacket.BuildPacket(owner.actorId, SetActorStatePacket.MAIN_STATE_DEAD, owner.currentSubState);
|
||||||
owner.zone.BroadcastPacketAroundActor(owner, deathStatePacket);
|
owner.zone.BroadcastPacketAroundActor(owner, deathStatePacket);
|
||||||
canInterrupt = false;
|
canInterrupt = false;
|
||||||
|
@ -106,6 +106,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
|||||||
var errors = (BattleAction[])actions.Clone();
|
var errors = (BattleAction[])actions.Clone();
|
||||||
owner.OnWeaponSkill(this, actions, ref errors);
|
owner.OnWeaponSkill(this, actions, ref errors);
|
||||||
owner.DoBattleAction(skill.id, skill.battleAnimation, actions);
|
owner.DoBattleAction(skill.id, skill.battleAnimation, actions);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void TryInterrupt()
|
public override void TryInterrupt()
|
||||||
|
@ -173,9 +173,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if ((updateFlags & ActorUpdateFlags.HpTpMp) != 0)
|
if ((updateFlags & ActorUpdateFlags.HpTpMp) != 0)
|
||||||
{
|
{
|
||||||
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/stateAtQuicklyForAll", this);
|
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/stateAtQuicklyForAll", this);
|
||||||
|
|
||||||
propPacketUtil.AddProperty("charaWork.parameterSave.hp[0]");
|
|
||||||
propPacketUtil.AddProperty("charaWork.parameterSave.hpMax[0]");
|
|
||||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||||
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||||
|
|
||||||
@ -283,7 +280,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
var partyMember = zone.FindActorInArea<Player>(memberId);
|
var partyMember = zone.FindActorInArea<Player>(memberId);
|
||||||
// onDeath(monster, player, killer)
|
// onDeath(monster, player, killer)
|
||||||
lua.LuaEngine.CallLuaBattleFunction(this, "onDeath", this, partyMember, lastAttacker);
|
lua.LuaEngine.CallLuaBattleFunction(this, "onDeath", this, partyMember, lastAttacker);
|
||||||
|
|
||||||
if (partyMember is Player)
|
if (partyMember is Player)
|
||||||
((Player)partyMember).AddExp(1500, (byte)partyMember.GetClass(), 5);
|
((Player)partyMember).AddExp(1500, (byte)partyMember.GetClass(), 5);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,10 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
|
|
||||||
public void QueuePacket(SubPacket subpacket)
|
public void QueuePacket(SubPacket subpacket)
|
||||||
{
|
{
|
||||||
|
//Temporary fix for r0
|
||||||
|
if(SendPacketQueue.Count == 1000)
|
||||||
|
FlushQueuedSendPackets();
|
||||||
|
|
||||||
SendPacketQueue.Add(subpacket);
|
SendPacketQueue.Add(subpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
require("global")
|
|
||||||
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
|
||||||
sender = "regen";
|
|
||||||
|
|
||||||
function onGain(target, effect)
|
|
||||||
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
|
||||||
sender = "regen";
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
function onTick(target, effect)
|
|
||||||
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
|
||||||
sender = "regen";
|
|
||||||
|
|
||||||
-- todo: actual regen effect thing
|
|
||||||
local ability = GetWorldManager().GetBattleCommand(27346);
|
|
||||||
local anim = bit32.bxor(bit32.lshift(ability.animationType, 24), bit32.lshift(tonumber(1), 12) , 101);
|
|
||||||
local addHp = effect.GetMagnitude();
|
|
||||||
|
|
||||||
target.AddHP(addHp);
|
|
||||||
-- target.SendBattleActionX01Packet(anim, 101, 0, 0, addHp);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function onLose(target, effect)
|
|
||||||
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
|
|
||||||
sender = "regen";
|
|
||||||
end;
|
|
3
data/scripts/unique/fst0Town01/Monster/ass.lua
Normal file
3
data/scripts/unique/fst0Town01/Monster/ass.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function onDeath(monster, player, lastAttacker)
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user