Skip to content

Commit 7db4cfb

Browse files
committed
Fixed Buff Logic
* Added buff handler, so we don't end up with a permanent BM bonuses.
1 parent fadb466 commit 7db4cfb

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Melia.Shared.Game.Const;
7+
using Melia.Zone.Buffs.Base;
8+
using Melia.Zone.World.Actors.Characters;
9+
using Melia.Zone.World.Actors.CombatEntities.Components;
10+
11+
namespace Melia.Zone.Buffs.Handlers.Common
12+
{
13+
/// <summary>
14+
/// Handle for the Riding Companion Buff, which gives certain bonuses.
15+
/// </summary>
16+
public class RidingCompanion : BuffHandler
17+
{
18+
public override void OnStart(Buff buff)
19+
{
20+
var target = (Character)buff.Target;
21+
22+
// Generic values from Velheider, should be companion specific?
23+
target.Properties.Modify(PropertyName.MSPD_BM, 4f);
24+
target.Properties.Modify(PropertyName.DR_BM, 3f);
25+
target.Properties.Modify(PropertyName.DEF_BM, 12f);
26+
}
27+
28+
public override void OnEnd(Buff buff)
29+
{
30+
var target = (Character)buff.Target;
31+
32+
// Generic values from Velheider, should be companion specific?
33+
target.Properties.Modify(PropertyName.MSPD_BM, -4f);
34+
target.Properties.Modify(PropertyName.DR_BM, -3f);
35+
target.Properties.Modify(PropertyName.DEF_BM, -12f);
36+
}
37+
}
38+
}

src/ZoneServer/Network/PacketHandler.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -3022,10 +3022,7 @@ public void CZ_VEHICLE_RIDE(IZoneConnection conn, Packet packet)
30223022
{
30233023
character.StartBuff(BuffId.RidingCompanion, 0, 0, TimeSpan.Zero, companion);
30243024
companion.StartBuff(BuffId.TakingOwner, 0, 0, TimeSpan.Zero, character);
3025-
// This is buff logic
3026-
character.Properties.Modify(PropertyName.MSPD_BM, 4f);
3027-
character.Properties.Modify(PropertyName.DR_BM, 3f);
3028-
character.Properties.Modify(PropertyName.DEF_BM, 12f);
3025+
30293026
Send.ZC_OBJECT_PROPERTY(character, PropertyName.MSPD, PropertyName.MSPD_BM,
30303027
PropertyName.DR, PropertyName.DR_BM, PropertyName.MHP, PropertyName.MHP_RATE_BM,
30313028
PropertyName.DEF, PropertyName.DEF_BM);
@@ -3035,9 +3032,7 @@ public void CZ_VEHICLE_RIDE(IZoneConnection conn, Packet packet)
30353032
{
30363033
character.StopBuff(BuffId.RidingCompanion);
30373034
companion.StopBuff(BuffId.TakingOwner);
3038-
character.Properties.Modify(PropertyName.MSPD_BM, -4f);
3039-
character.Properties.Modify(PropertyName.DR_BM, -3f);
3040-
character.Properties.Modify(PropertyName.DEF_BM, -12f);
3035+
30413036
Send.ZC_OBJECT_PROPERTY(character, PropertyName.MSPD, PropertyName.MSPD_BM,
30423037
PropertyName.DR, PropertyName.DR_BM, PropertyName.MHP, PropertyName.MHP_RATE_BM,
30433038
PropertyName.DEF, PropertyName.DEF_BM);

0 commit comments

Comments
 (0)