Skip to content

Commit

Permalink
Bug fixes (#329)
Browse files Browse the repository at this point in the history
* Bug fixes

* a stupid format error
  • Loading branch information
Zintixx authored Feb 27, 2025
1 parent d68572b commit 946d544
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions Maple2.Model/Enum/Portal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum PortalType : byte {
DungeonEnter = 9,
InHome = 11,
LeaveDungeon = 13,
ContentsGuide = 15,
}

public enum PortalActionType {
Expand Down
2 changes: 1 addition & 1 deletion Maple2.Server.Game/Manager/ExperienceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public bool LevelUp() {
session.Player.Flag |= PlayerObjectFlag.Level;
session.Field?.Broadcast(LevelUpPacket.LevelUp(session.Player));
session.ConditionUpdate(ConditionType.level_up, codeLong: (int) session.Player.Value.Character.Job.Code(), targetLong: Level);
session.ConditionUpdate(ConditionType.level, codeLong: Level);
session.ConditionUpdate(ConditionType.level, targetLong: Level);

session.Stats.Refresh();

Expand Down
8 changes: 2 additions & 6 deletions Maple2.Server.Game/Manager/Field/FieldManager.State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,8 @@ public FieldPlayer SpawnPlayer(GameSession session, Player player, int portalId
player.Character.ReviveMapId = Metadata.Property.RevivalReturnId;
}

if (Metadata.Property.EnterReturnId != 0 &&
Metadata.Property.Type != MapType.Arcade &&
Metadata.Property.Type != MapType.PocketRealm &&
Metadata.Property.Type != MapType.Dungeon &&
Metadata.Property.Type != MapType.Event &&
Metadata.Property.Type != MapType.Event2) {
if (Metadata.Property.EnterReturnId != 0 && FieldInstance.InstanceType == InstanceType.none) {
// TODO: Probably need to figure out homes and dungeon maps.
player.Character.ReturnMapId = Metadata.Property.EnterReturnId;
}

Expand Down
2 changes: 1 addition & 1 deletion Maple2.Server.Game/Manager/FishingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private Dictionary<Vector3, FishingTile> GetFishingBlocks(FishingRodTable.Entry
continue;
}

if (spot.MinMastery > fish.Mastery || spot.MaxMastery < fish.Mastery) {
if (!fish.IgnoreSpotMastery && (spot.MinMastery > fish.Mastery || spot.MaxMastery < fish.Mastery)) {
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions Maple2.Server.Game/Manager/GuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public bool SetGuild(GuildInfo info, bool addTag = true) {
if (addTag) {
session.Field?.Broadcast(GuildPacket.AddTag(session.PlayerName, Guild.Name));
}

session.ConditionUpdate(ConditionType.guild_join_req);
return true;
}

Expand Down
6 changes: 5 additions & 1 deletion Maple2.Server.Game/Model/Field/Actor/FieldPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ public override void Update(long tickCount) {
}

// Loops through each registered regen stat and applies regen
var statsToRemove = new List<BasicAttribute>();
foreach (BasicAttribute attribute in regenStats.Keys) {
Stat stat = Stats.Values[attribute];
Stat regen = Stats.Values[regenStats[attribute].Item1];
Stat interval = Stats.Values[regenStats[attribute].Item2];

if (stat.Current >= stat.Total) {
// Removes stat from regen stats so it won't be listened for
regenStats.Remove(attribute);
statsToRemove.Add(attribute);
continue;
}

Expand All @@ -130,6 +131,9 @@ public override void Update(long tickCount) {
Session.Send(StatsPacket.Update(this, attribute));
}
}
foreach (BasicAttribute attribute in statsToRemove) {
regenStats.Remove(attribute);
}

Session.GameEvent.Update(tickCount);

Expand Down
7 changes: 5 additions & 2 deletions Maple2.Server.Game/Trigger/TriggerContext.Interface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ public void SetEventUiScript(BannerType type, string script, int duration, strin
}
}

foreach (FieldPlayer player in PlayersInBox(boxIdInts)) {
player.Session.Send(packet);
foreach (int boxId in boxIdInts) {
foreach (FieldPlayer player in PlayersInBox(boxId)) {
player.Session.Send(packet);
}
}

}

public void SetEventUiCountdown(string script, int[] roundCountdown, string[] boxIds) {
Expand Down

0 comments on commit 946d544

Please sign in to comment.