Skip to content

Commit b1d810c

Browse files
Fixes for merging the main branch
Fixes for merging the main branch
1 parent 6ff3785 commit b1d810c

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

Maple2.Server.Core/Formulas/BonusAttack.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ public static double Coefficient(int rightHandRarity, int leftHandRarity, JobCod
99
}
1010

1111
double weaponBonusAttackCoefficient = RarityMultiplier(rightHandRarity);
12-
if (leftHandRarity == 0) {
13-
return weaponBonusAttackCoefficient;
12+
if (leftHandRarity > 0) {
13+
weaponBonusAttackCoefficient = 0.5 * (weaponBonusAttackCoefficient + RarityMultiplier(leftHandRarity));
1414
}
1515

16-
weaponBonusAttackCoefficient = 0.5 * (weaponBonusAttackCoefficient + RarityMultiplier(leftHandRarity));
1716
return 4.96 * weaponBonusAttackCoefficient * JobBonusMultiplier(jobCode);
1817
}
1918

Maple2.Server.Game/Manager/StatsManager.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public StatsManager(IActor actor) {
7373
return (1, 1);
7474

7575
double BonusAttackCoefficient(FieldPlayer player) {
76-
int leftHandRarity = player.Session.Item.Equips.Get(EquipSlot.RH)?.Rarity ?? 0;
77-
int rightHandRarity = player.Session.Item.Equips.Get(EquipSlot.LH)?.Rarity ?? 0;
76+
int rightHandRarity = player.Session.Item.Equips.Get(EquipSlot.RH)?.Rarity ?? 0;
77+
int leftHandRarity = player.Session.Item.Equips.Get(EquipSlot.LH)?.Rarity ?? 0;
7878
return BonusAttack.Coefficient(rightHandRarity, leftHandRarity, player.Value.Character.Job.Code());
7979
}
8080
}
@@ -140,6 +140,11 @@ public void Refresh() {
140140
AddBuffs(player);
141141
Values.Total();
142142
StatConversion(player);
143+
// Stat rebuild via AddBase/AddTotal restores Current to Total,
144+
// but a dead player must stay at 0 HP until revived.
145+
if (player.IsDead) {
146+
Values[BasicAttribute.Health].Current = 0;
147+
}
143148
Actor.Field.Broadcast(StatsPacket.Init(player));
144149
Actor.Field.Broadcast(StatsPacket.Update(player), player.Session);
145150

Maple2.Server.Web/Controllers/WebController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private static IResult HandleUnknownMode(UgcType mode) {
286286
#endregion
287287

288288
#region Ranking
289-
public ByteWriter Trophy(string userName) {
289+
private ByteWriter Trophy(string userName) {
290290
string cacheKey = $"Trophy_{userName ?? "all"}";
291291

292292
if (!cache.TryGetValue(cacheKey, out byte[]? cachedData)) {
@@ -312,7 +312,7 @@ public ByteWriter Trophy(string userName) {
312312
return result;
313313
}
314314

315-
public ByteWriter PersonalTrophy(long characterId) {
315+
private ByteWriter PersonalTrophy(long characterId) {
316316
string cacheKey = $"PersonalTrophy_{characterId}";
317317

318318
if (!cache.TryGetValue(cacheKey, out byte[]? cachedData)) {
@@ -328,7 +328,7 @@ public ByteWriter PersonalTrophy(long characterId) {
328328
return result;
329329
}
330330

331-
public ByteWriter GuildTrophy(string userName) {
331+
private ByteWriter GuildTrophy(string userName) {
332332
if (!string.IsNullOrEmpty(userName)) {
333333
string cacheKey = $"GuildTrophy_{userName}";
334334

@@ -359,7 +359,7 @@ public ByteWriter GuildTrophy(string userName) {
359359
return InGameRankPacket.GuildTrophy(GetCachedGuildTrophyRankings());
360360
}
361361

362-
public ByteWriter PersonalGuildTrophy(long characterId) {
362+
private ByteWriter PersonalGuildTrophy(long characterId) {
363363
string cacheKey = $"PersonalGuildTrophy_{characterId}";
364364

365365
if (!cache.TryGetValue(cacheKey, out byte[]? cachedData)) {
@@ -397,7 +397,7 @@ private IList<GuildTrophyRankInfo> GetCachedGuildTrophyRankings() {
397397
}
398398
#endregion
399399

400-
public ByteWriter MenteeList(long accountId, long characterId) {
400+
private ByteWriter MenteeList(long accountId, long characterId) {
401401
using GameStorage.Request db = gameStorage.Context();
402402
IList<long> list = db.GetMentorList(accountId, characterId);
403403

0 commit comments

Comments
 (0)