From 922fb80f3d2a0354054fcdd418a9156017849bcb Mon Sep 17 00:00:00 2001 From: yogurt Date: Sun, 27 May 2018 14:51:39 -0500 Subject: [PATCH] Bug fixes. Added stoneskin effect to database. Fixed Rampage not working Fixed bug where abilities didn't equip correctly when leveling up Added a temporary fix for returning while dead Added handling for abilities that don't have an actiontype set, like elusive jump --- FFXIVClassic Map Server/Database.cs | 4 ++-- FFXIVClassic Map Server/actors/Actor.cs | 2 +- FFXIVClassic Map Server/actors/chara/Character.cs | 2 +- .../actors/chara/ai/StatusEffectContainer.cs | 4 ++-- .../actors/chara/ai/utils/BattleUtils.cs | 3 +++ FFXIVClassic Map Server/actors/chara/player/Player.cs | 10 ++++++---- .../send/Actor/battle/BattleActionX01Packet.cs | 2 +- data/scripts/commands/TeleportCommand.lua | 9 ++++++++- data/scripts/commands/gm/giveexp.lua | 3 ++- data/scripts/effects/rampage2.lua | 2 +- data/scripts/effects/stoneskin.lua | 11 +---------- sql/server_statuseffects.sql | 3 ++- 12 files changed, 30 insertions(+), 25 deletions(-) diff --git a/FFXIVClassic Map Server/Database.cs b/FFXIVClassic Map Server/Database.cs index 465fc1c1..600fc713 100644 --- a/FFXIVClassic Map Server/Database.cs +++ b/FFXIVClassic Map Server/Database.cs @@ -2317,11 +2317,11 @@ namespace FFXIVClassic_Map_Server Tuple tuple = Tuple.Create(battleCommand.job, battleCommand.level); if (battleCommandIdByLevel.ContainsKey(tuple)) { - battleCommandIdByLevel[tuple].Add(id | 0xA0F00000); + battleCommandIdByLevel[tuple].Add(id); } else { - List list = new List() { id | 0xA0F00000 }; + List list = new List() { id }; battleCommandIdByLevel.Add(tuple, list); } count++; diff --git a/FFXIVClassic Map Server/actors/Actor.cs b/FFXIVClassic Map Server/actors/Actor.cs index c7aff919..ed58f8c3 100644 --- a/FFXIVClassic Map Server/actors/Actor.cs +++ b/FFXIVClassic Map Server/actors/Actor.cs @@ -454,8 +454,8 @@ namespace FFXIVClassic_Map_Server.Actors } updateFlags = ActorUpdateFlags.None; - zone.BroadcastPacketsAroundActor(this, packets); } + zone.BroadcastPacketsAroundActor(this, packets); } public void GenerateActorName(int actorNumber) diff --git a/FFXIVClassic Map Server/actors/chara/Character.cs b/FFXIVClassic Map Server/actors/chara/Character.cs index a3f4e5bf..20b8b35d 100644 --- a/FFXIVClassic Map Server/actors/chara/Character.cs +++ b/FFXIVClassic Map Server/actors/chara/Character.cs @@ -388,8 +388,8 @@ namespace FFXIVClassic_Map_Server.Actors if ((updateFlags & ActorUpdateFlags.StatusTime) != 0) { packets.AddRange(statusEffects.GetStatusTimerPackets()); + statusEffects.ResetPropPacketUtil(); updateFlags &= ~ActorUpdateFlags.StatusTime; - } if ((updateFlags & ActorUpdateFlags.HpTpMp) != 0) diff --git a/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs b/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs index c9f9cbe5..a13b83a0 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/StatusEffectContainer.cs @@ -80,8 +80,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai BattleAction action = new BattleAction(owner.actorId, 30331, (uint)(HitEffect.HitEffectType | HitEffect.Hit), dotTick); utils.BattleUtils.HandleStoneskin(owner, action); // todo: figure out how to make red numbers appear for enemies getting hurt by dots - owner.DelHP(action.amount); - + //owner.DelHP(action.amount); + utils.BattleUtils.DamageTarget(owner, owner, action, null); owner.DoBattleAction(0, 0, action); } diff --git a/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs b/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs index 32b96c38..123cc63b 100644 --- a/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs +++ b/FFXIVClassic Map Server/actors/chara/ai/utils/BattleUtils.cs @@ -383,6 +383,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.utils case (ActionType.Status): FinishActionStatus(caster, target, skill, action, actionContainer); break; + default: + actionContainer.AddAction(action); + break; } } diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index 7e0a08c2..f45ddc4e 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -1888,7 +1888,7 @@ namespace FFXIVClassic_Map_Server.Actors Database.EquipAbility(this, classId, (ushort) (hotbarSlot - charaWork.commandBorder), commandId, recastEnd); //If the class we're equipping for is the current class (need to find out if state_mainSkill is supposed to change when you're a job) //then equip the ability in charawork.commands and save in databse, otherwise just save in database - if (classId == charaWork.parameterSave.state_mainSkill[0]) + if (classId == GetCurrentClassOrJob()) { charaWork.command[hotbarSlot] = trueCommandId; charaWork.commandCategory[hotbarSlot] = 1; @@ -2240,6 +2240,7 @@ namespace FFXIVClassic_Map_Server.Actors //Returns BattleActions that can be sent to display the EXP gained number and level ups public List AddExp(int exp, byte classId, byte bonusPercent = 0) { + List actionList = new List(); exp += (int) Math.Ceiling((exp * bonusPercent / 100.0f)); @@ -2310,7 +2311,8 @@ namespace FFXIVClassic_Map_Server.Actors EquipAbilityInFirstOpenSlot(jobId, commandId, false); //33926: You learn [command]. - actionList?.Add(new BattleAction(actorId, 33926, commandId)); + if(classId == GetCurrentClassOrJob() || jobId == GetCurrentClassOrJob()) + actionList?.Add(new BattleAction(actorId, 33926, commandId)); } } } @@ -2405,8 +2407,8 @@ namespace FFXIVClassic_Map_Server.Actors var mainHandItem = equip.GetItemAtSlot(Equipment.SLOT_MAINHAND); var damageAttribute = 0; var attackDelay = 3000; - var hitCount = 1; - GetAttackDelayMs(); + var hitCount = 1; + if (mainHandItem != null) { var mainHandWeapon = (Server.GetItemGamedata(mainHandItem.itemId) as WeaponItem); diff --git a/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX01Packet.cs b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX01Packet.cs index f5bdde7c..a98020c1 100644 --- a/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX01Packet.cs +++ b/FFXIVClassic Map Server/packets/send/Actor/battle/BattleActionX01Packet.cs @@ -45,7 +45,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle binWriter.Write((Byte)1); //? } } - new SubPacket(OPCODE, sourceActorId, data).DebugPrintSubPacket(); + return new SubPacket(OPCODE, sourceActorId, data); } } diff --git a/data/scripts/commands/TeleportCommand.lua b/data/scripts/commands/TeleportCommand.lua index 8c4bcd55..87a32ac4 100644 --- a/data/scripts/commands/TeleportCommand.lua +++ b/data/scripts/commands/TeleportCommand.lua @@ -91,7 +91,7 @@ function onEventStarted(player, actor, triggerName, isTeleport) local choice, isInn = callClientFunction(player, "delegateCommand", actor, "eventConfirm", true, false, player:GetHomePointInn(), player:GetHomePoint(), false); if (choice == 1) then player:PlayAnimation(0x4000FFB); - player:SendGameMessage(worldMaster, 34104, 0x20); + player:SendGameMessage(worldMaster, 34104, 0x20); if (isInn) then --Return to Inn if (player:GetHomePointInn() == 1) then @@ -108,6 +108,13 @@ function onEventStarted(player, actor, triggerName, isTeleport) randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5); rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]); GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation); + + --bandaid fix for returning while dead, missing things like weakness and the heal number + if (player:GetHP() == 0) then + player:SetHP(player.GetMaxHP()); + player:ChangeState(0); + player:PlayAnimation(0x01000066); + end end end end diff --git a/data/scripts/commands/gm/giveexp.lua b/data/scripts/commands/gm/giveexp.lua index d27366ca..5ac50b62 100644 --- a/data/scripts/commands/gm/giveexp.lua +++ b/data/scripts/commands/gm/giveexp.lua @@ -27,7 +27,8 @@ function onTrigger(player, argc, qty, name, lastName) qty = tonumber(qty) or 1; location = INVENTORY_CURRENCY; - player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 5); + actionList = player:AddExp(qty, player.charaWork.parameterSave.state_mainSkill[0], 0); + player:DoBattleAction(0, 0, actionList); else print(sender.."unable to add experience, ensure player name is valid."); end; diff --git a/data/scripts/effects/rampage2.lua b/data/scripts/effects/rampage2.lua index eb48b564..b79598b8 100644 --- a/data/scripts/effects/rampage2.lua +++ b/data/scripts/effects/rampage2.lua @@ -20,7 +20,7 @@ function onDamageTaken(effect, attacker, defender, action, actionContainer) effect.SetExtra(effect.GetExtra() + 1); attacker.AddMod(modifiersGlobal.Parry, parryPerDT); - attacker.SubtractMod(modifiersGlobal.Delay, delayMsPerDT); + attacker.SubtractMod(modifiersGlobal.AttackDelay, delayMsPerDT); end end diff --git a/data/scripts/effects/stoneskin.lua b/data/scripts/effects/stoneskin.lua index 74712120..c50127a8 100644 --- a/data/scripts/effects/stoneskin.lua +++ b/data/scripts/effects/stoneskin.lua @@ -4,18 +4,9 @@ require("modifiers") require("hiteffect") require("battleutils") - ---todo: calculate actual mitigation value based on Source's enhancing magic. info: http://forum.square-enix.com/ffxiv/threads/40800-Enhancing-Magic ---This should also probably be calculated when the spell is cast so it doesnt overwrite a stronger stoneskin function onGain(owner, effect) - --Going to assume its 1.34 * Enhancing Potency untraited, 1.96 * Enhancing Potency traited. - local potencyModifier = 1.34; - if effect.tier == 2 then - potencyModifier = 1.96; - end - local amount = potencyModifier * effect.source.GetMod(modifiersGlobal.MagicEnhancePotency); - owner.AddMod(modifiersGlobal.Stoneskin, amount); + owner.AddMod(modifiersGlobal.Stoneskin, effect.GetMagnitude()); end --Using extra for how much mitigation stoneskin has diff --git a/sql/server_statuseffects.sql b/sql/server_statuseffects.sql index f706bc7b..ed87a16b 100644 --- a/sql/server_statuseffects.sql +++ b/sql/server_statuseffects.sql @@ -72,6 +72,7 @@ INSERT INTO `server_statuseffects` VALUES (223104,'quelling_strike',1058,2,0); INSERT INTO `server_statuseffects` VALUES (223106,'hawks_eye',50,2,0); INSERT INTO `server_statuseffects` VALUES (223108,'decoy',4130,2,0); INSERT INTO `server_statuseffects` VALUES (223127,'bloodletter',42,2,0); +INSERT INTO `server_statuseffects` VALUES (223133,'stoneskin',16402,1,3000); INSERT INTO `server_statuseffects` VALUES (223173,'covered',42,2,0); INSERT INTO `server_statuseffects` VALUES (223180,'regen',50,2,0); INSERT INTO `server_statuseffects` VALUES (223205,'combo',42,2,0); @@ -124,4 +125,4 @@ commit; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-04-18 14:54:11 +-- Dump completed on 2018-05-27 14:40:45