Skip to content

Commit

Permalink
Implement bazaar related GP course effects
Browse files Browse the repository at this point in the history
  • Loading branch information
alborrajo committed Dec 19, 2024
1 parent dd995b5 commit a82afba
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Arrowgene.Ddon.GameServer/BazaarManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,16 @@ public uint ReceiveProceeds(GameClient client)
foreach (BazaarExhibition exhibition in exhibitionsToReceive)
{
exhibition.Info.State = BazaarExhibitionState.Idle;
exhibition.Info.Expire = now.AddSeconds(Server.Setting.GameLogicSetting.BazaarCooldownTimeSeconds);
ulong totalCooldown;
try
{
totalCooldown = Server.Setting.GameLogicSetting.BazaarCooldownTimeSeconds - Server.GpCourseManager.BazaarReExhibitShorten();
}
catch (OverflowException _)
{
totalCooldown = 0;
}
exhibition.Info.Expire = now.AddSeconds(totalCooldown);
Server.Database.UpdateBazaarExhibiton(exhibition);
}

Expand Down
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Characters/GpCourseManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ internal class CourseBonus
public bool DisablePartyExpAdjustment = false;
public double EnemyBloodOrbMultiplier = 0.0;
public bool InfiniteRevive = false;
public uint BazaarExhibitExtend = 0;
public ulong BazaarReExhibitShorten = 0;
};

private void ApplyCourseEffects(uint courseId)
Expand Down Expand Up @@ -73,6 +75,12 @@ private void ApplyCourseEffects(uint courseId)
case GPCourseId.InfiniteRevive:
_CourseBonus.InfiniteRevive = true;
break;
case GPCourseId.BazaarExhibitExtend:
_CourseBonus.BazaarExhibitExtend += effect.Param0;
break;
case GPCourseId.BazaarReExhibitShorten:
_CourseBonus.BazaarReExhibitShorten += effect.Param0;
break;
}
}
}
Expand Down Expand Up @@ -250,5 +258,21 @@ public bool InfiniteReviveRefresh()
return _CourseBonus.InfiniteRevive;
}
}

public uint BazaarExhibitExtend()
{
lock (_CourseBonus)
{
return _CourseBonus.BazaarExhibitExtend;
}
}

public ulong BazaarReExhibitShorten()
{
lock (_CourseBonus)
{
return _CourseBonus.BazaarReExhibitShorten;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public override S2CBazaarGetExhibitPossibleNumRes Handle(GameClient client, C2SB
{
return new S2CBazaarGetExhibitPossibleNumRes()
{
Num = client.Character.MaxBazaarExhibits,
Add = 0 // TODO: Figure out
Num = client.Character.MaxBazaarExhibits + Server.GpCourseManager.BazaarExhibitExtend(),
Add = Server.GpCourseManager.BazaarExhibitExtend() // Not sure what the purpose of this value is
};
}
}
Expand Down

0 comments on commit a82afba

Please sign in to comment.