mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-24 13:47:46 +00:00
Added class-specific exp messages for non-english languages
Fixed status effect loss message not being sent Fixed party bug where people in the same party were considered to be in different parties
This commit is contained in:
parent
0739532c7d
commit
0f7e6f359d
4 changed files with 36 additions and 18 deletions
|
@ -967,6 +967,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
{
|
{
|
||||||
StatusEffect procEffect = Server.GetWorldManager().GetStatusEffect(effectId);
|
StatusEffect procEffect = Server.GetWorldManager().GetStatusEffect(effectId);
|
||||||
procEffect.SetDuration(5);
|
procEffect.SetDuration(5);
|
||||||
|
procEffect.SetSilent(true);
|
||||||
statusEffects.AddStatusEffect(procEffect, this, true, true);
|
statusEffects.AddStatusEffect(procEffect, this, true, true);
|
||||||
}
|
}
|
||||||
//Otherwise we're reseting a proc, remove the status
|
//Otherwise we're reseting a proc, remove the status
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||||
else
|
else
|
||||||
LuaEngine.CallLuaStatusEffectFunction(this.owner, newEffect, "onGain", this.owner, newEffect);
|
LuaEngine.CallLuaStatusEffectFunction(this.owner, newEffect, "onGain", this.owner, newEffect);
|
||||||
effects.Add(newEffect.GetStatusEffectId(), newEffect);
|
effects.Add(newEffect.GetStatusEffectId(), newEffect);
|
||||||
newEffect.SetSilent(silent);
|
//newEffect.SetSilent(silent);
|
||||||
newEffect.SetHidden(hidden);
|
newEffect.SetHidden(hidden);
|
||||||
|
|
||||||
if (!newEffect.GetHidden())
|
if (!newEffect.GetHidden())
|
||||||
|
@ -204,15 +204,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||||
else
|
else
|
||||||
index = Array.IndexOf(owner.charaWork.status, (ushort) 0);
|
index = Array.IndexOf(owner.charaWork.status, (ushort) 0);
|
||||||
|
|
||||||
//owner.charaWork.status[index] = newEffect.GetStatusId();
|
|
||||||
SetStatusAtIndex(index, newEffect.GetStatusId());
|
SetStatusAtIndex(index, newEffect.GetStatusId());
|
||||||
//Stance statuses need their time set to an extremely high number so their icon doesn't flash
|
//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
|
//Adding getduration with them doesn't work because it overflows
|
||||||
uint time = (newEffect.GetFlags() & (uint) StatusEffectFlags.Stance) == 0 ? Utils.UnixTimeStampUTC(newEffect.GetEndTime()) : 0xFFFFFFFF;
|
uint time = (newEffect.GetFlags() & (uint) StatusEffectFlags.Stance) == 0 ? Utils.UnixTimeStampUTC(newEffect.GetEndTime()) : 0xFFFFFFFF;
|
||||||
SetTimeAtIndex(index, time);
|
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();
|
owner.RecalculateStats();
|
||||||
}
|
}
|
||||||
|
@ -233,13 +229,11 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||||
}
|
}
|
||||||
|
|
||||||
//hidden effects not in charawork
|
//hidden effects not in charawork
|
||||||
if(!effect.GetHidden())
|
|
||||||
{
|
|
||||||
var index = Array.IndexOf(owner.charaWork.status, effect.GetStatusId());
|
var index = Array.IndexOf(owner.charaWork.status, effect.GetStatusId());
|
||||||
|
if (!effect.GetHidden() && index != -1)
|
||||||
owner.charaWork.status[index] = 0;
|
{
|
||||||
owner.charaWork.statusShownTime[index] = 0;
|
SetStatusAtIndex(index, 0);
|
||||||
this.owner.zone.BroadcastPacketAroundActor(this.owner, SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, (ushort)0));
|
SetTimeAtIndex(index, 0);
|
||||||
}
|
}
|
||||||
// function onLose(actor, effect)
|
// function onLose(actor, effect)
|
||||||
effects.Remove(effect.GetStatusEffectId());
|
effects.Remove(effect.GetStatusEffectId());
|
||||||
|
@ -382,7 +376,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
||||||
public void SetStatusAtIndex(int index, ushort statusId)
|
public void SetStatusAtIndex(int index, ushort statusId)
|
||||||
{
|
{
|
||||||
owner.charaWork.status[index] = 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));
|
statusSubpackets.Add(SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, statusId));
|
||||||
owner.updateFlags |= ActorUpdateFlags.Status;
|
owner.updateFlags |= ActorUpdateFlags.Status;
|
||||||
|
|
|
@ -50,6 +50,29 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils
|
||||||
{ HitType.Crit, HitEffect.Crit }
|
{ HitType.Crit, HitEffect.Crit }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static Dictionary<byte, ushort> ClassExperienceTextIds = new Dictionary<byte, ushort>()
|
||||||
|
{
|
||||||
|
{ 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
|
//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
|
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);
|
totalBonus += GetChainBonus(expChainNumber);
|
||||||
|
|
||||||
StatusEffect newChain = Server.GetWorldManager().GetStatusEffect((uint)StatusEffectId.EXPChain);
|
StatusEffect newChain = Server.GetWorldManager().GetStatusEffect((uint)StatusEffectId.EXPChain);
|
||||||
|
newChain.SetSilent(true);
|
||||||
newChain.SetDuration(timeLimit);
|
newChain.SetDuration(timeLimit);
|
||||||
newChain.SetTier((byte)(Math.Min(expChainNumber + 1, 255)));
|
newChain.SetTier((byte)(Math.Min(expChainNumber + 1, 255)));
|
||||||
attacker.statusEffects.AddStatusEffect(newChain, attacker, true, true);
|
attacker.statusEffects.AddStatusEffect(newChain, attacker, true, true);
|
||||||
|
|
|
@ -1692,7 +1692,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
//A party member list packet came, set the party
|
//A party member list packet came, set the party
|
||||||
public void SetParty(Party group)
|
public void SetParty(Party group)
|
||||||
{
|
{
|
||||||
if (group is Party)
|
if (group is Party && currentParty != group)
|
||||||
{
|
{
|
||||||
RemoveFromCurrentPartyAndCleanup();
|
RemoveFromCurrentPartyAndCleanup();
|
||||||
currentParty = group;
|
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
|
//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
|
//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<BattleAction> AddExp(int exp, byte classId, byte bonusPercent = 0)
|
public List<BattleAction> AddExp(int exp, byte classId, byte bonusPercent = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
List<BattleAction> actionList = new List<BattleAction>();
|
List<BattleAction> actionList = new List<BattleAction>();
|
||||||
exp += (int) Math.Ceiling((exp * bonusPercent / 100.0f));
|
exp += (int) Math.Ceiling((exp * bonusPercent / 100.0f));
|
||||||
|
|
||||||
//33935: You earn [exp] (+[bonusPercent]%) experience points.
|
//You earn [exp] (+[bonusPercent]%) experience points.
|
||||||
actionList.Add(new BattleAction(actorId, 33935, 0, (ushort)exp, bonusPercent));
|
//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;
|
bool leveled = false;
|
||||||
int diff = MAXEXP[GetLevel() - 1] - charaWork.battleSave.skillPoint[classId - 1];
|
int diff = MAXEXP[GetLevel() - 1] - charaWork.battleSave.skillPoint[classId - 1];
|
||||||
|
|
Loading…
Add table
Reference in a new issue