diff --git a/FFXIVClassic Map Server/actors/chara/Character.cs b/FFXIVClassic Map Server/actors/chara/Character.cs index 1c5b7ab9..9595fa1f 100644 --- a/FFXIVClassic Map Server/actors/chara/Character.cs +++ b/FFXIVClassic Map Server/actors/chara/Character.cs @@ -967,6 +967,7 @@ namespace FFXIVClassic_Map_Server.Actors { StatusEffect procEffect = Server.GetWorldManager().GetStatusEffect(effectId); procEffect.SetDuration(5); + procEffect.SetSilent(true); statusEffects.AddStatusEffect(procEffect, this, true, true); } //Otherwise we're reseting a proc, remove the status diff --git a/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs b/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs index a13b83a0..a9d6b915 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs @@ -191,7 +191,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai else LuaEngine.CallLuaStatusEffectFunction(this.owner, newEffect, "onGain", this.owner, newEffect); effects.Add(newEffect.GetStatusEffectId(), newEffect); - newEffect.SetSilent(silent); + //newEffect.SetSilent(silent); newEffect.SetHidden(hidden); if (!newEffect.GetHidden()) @@ -203,16 +203,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai index = Array.IndexOf(owner.charaWork.status, newEffect.GetStatusId()); else index = Array.IndexOf(owner.charaWork.status, (ushort) 0); - - //owner.charaWork.status[index] = newEffect.GetStatusId(); + SetStatusAtIndex(index, newEffect.GetStatusId()); //Stance statuses need their time set to an extremely high number so their icon doesn't flash //Adding getduration with them doesn't work because it overflows uint time = (newEffect.GetFlags() & (uint) StatusEffectFlags.Stance) == 0 ? Utils.UnixTimeStampUTC(newEffect.GetEndTime()) : 0xFFFFFFFF; SetTimeAtIndex(index, time); - //owner.charaWork.statusShownTime[index] = time; - //owner.zone.BroadcastPacketAroundActor(owner, SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, newEffect.GetStatusId())); - //owner.zone.BroadcastPacketsAroundActor(owner, owner.GetActorStatusPackets()); } owner.RecalculateStats(); } @@ -233,13 +229,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai } //hidden effects not in charawork - if(!effect.GetHidden()) + var index = Array.IndexOf(owner.charaWork.status, effect.GetStatusId()); + if (!effect.GetHidden() && index != -1) { - var index = Array.IndexOf(owner.charaWork.status, effect.GetStatusId()); - - owner.charaWork.status[index] = 0; - owner.charaWork.statusShownTime[index] = 0; - this.owner.zone.BroadcastPacketAroundActor(this.owner, SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, (ushort)0)); + SetStatusAtIndex(index, 0); + SetTimeAtIndex(index, 0); } // function onLose(actor, effect) effects.Remove(effect.GetStatusEffectId()); @@ -382,7 +376,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai public void SetStatusAtIndex(int index, ushort statusId) { owner.charaWork.status[index] = statusId; - //owner.zone.BroadcastPacketAroundActor(owner, SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, statusId)); statusSubpackets.Add(SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, statusId)); owner.updateFlags |= ActorUpdateFlags.Status; diff --git a/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs b/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs index 123cc63b..c4b3e259 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs @@ -50,6 +50,29 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils { HitType.Crit, HitEffect.Crit } }; + public static Dictionary ClassExperienceTextIds = new Dictionary() + { + { 2, 33934 }, //Pugilist + { 3, 33935 }, //Gladiator + { 4, 33936 }, //Marauder + { 7, 33937 }, //Archer + { 8, 33938 }, //Lancer + { 10, 33939 }, //Sentinel, this doesn't exist anymore but it's still in the files so may as well put it here just in case + { 22, 33940 }, //Thaumaturge + { 23, 33941 }, //Conjurer + { 29, 33945 }, //Carpenter, for some reason there's a a few different messages between 33941 and 33945 + { 30, 33946 }, //Blacksmith + { 31, 33947 }, //Armorer + { 32, 33948 }, //Goldsmith + { 33, 33949 }, //Leatherworker + { 34, 33950 }, //Weaver + { 35, 33951 }, //Alchemist + { 36, 33952 }, //Culinarian + { 39, 33953 }, //Miner + { 40, 33954 }, //Botanist + { 41, 33955 } //Fisher + }; + //Most of these numbers I'm fairly certain are correct. The repeated numbers at levels 23 and 48 I'm less sure about but they do match some weird spots in the EXP graph public static ushort[] BASEEXP = {150, 150, 150, 150, 150, 150, 150, 150, 150, 150, //Level <= 10 @@ -815,7 +838,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils totalBonus += GetChainBonus(expChainNumber); StatusEffect newChain = Server.GetWorldManager().GetStatusEffect((uint)StatusEffectId.EXPChain); - + newChain.SetSilent(true); newChain.SetDuration(timeLimit); newChain.SetTier((byte)(Math.Min(expChainNumber + 1, 255))); attacker.statusEffects.AddStatusEffect(newChain, attacker, true, true); diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index 5276500a..9696016d 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -1692,7 +1692,7 @@ namespace FFXIVClassic_Map_Server.Actors //A party member list packet came, set the party public void SetParty(Party group) { - if (group is Party) + if (group is Party && currentParty != group) { RemoveFromCurrentPartyAndCleanup(); currentParty = group; @@ -2236,14 +2236,15 @@ namespace FFXIVClassic_Map_Server.Actors //Handles exp being added, does not handle figuring out exp bonus from buffs or skill/link chains or any of that //Returns BattleActions that can be sent to display the EXP gained number and level ups + //exp should be a ushort single the exp graphic overflows after ~65k public List AddExp(int exp, byte classId, byte bonusPercent = 0) { - List actionList = new List(); exp += (int) Math.Ceiling((exp * bonusPercent / 100.0f)); - //33935: You earn [exp] (+[bonusPercent]%) experience points. - actionList.Add(new BattleAction(actorId, 33935, 0, (ushort)exp, bonusPercent)); + //You earn [exp] (+[bonusPercent]%) experience points. + //In non-english languages there are unique messages for each language, hence the use of ClassExperienceTextIds + actionList.Add(new BattleAction(actorId, BattleUtils.ClassExperienceTextIds[classId], 0, (ushort)exp, bonusPercent)); bool leveled = false; int diff = MAXEXP[GetLevel() - 1] - charaWork.battleSave.skillPoint[classId - 1];