mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-19 17:19:58 +02:00
Fix hunt permits check
This commit is contained in:
@@ -721,6 +721,12 @@ public class Inventory extends PlayerManager implements GameDatabaseObject {
|
||||
case Title -> {
|
||||
yield this.getTitles().contains(id);
|
||||
}
|
||||
case TraceRequest -> {
|
||||
yield this.getPlayer().getTraceHuntManager().getTraceRequests() >= count;
|
||||
}
|
||||
case HuntPermit -> {
|
||||
yield this.getPlayer().getTraceHuntManager().getHuntPermits() >= count;
|
||||
}
|
||||
default -> {
|
||||
// Not implemented
|
||||
yield false;
|
||||
|
||||
@@ -338,6 +338,13 @@ public class TraceHuntManager extends PlayerManager implements GameDatabaseObjec
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if we have enough cost items
|
||||
var cost = this.getHuntCost();
|
||||
|
||||
if (cost != null && !getPlayer().getInventory().hasItem(cost.getExtraCost1Tid(), cost.getExtraCost1Qty())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set build
|
||||
this.huntPlayerUid = (int) ownerUid;
|
||||
this.huntBossId = bossId;
|
||||
@@ -363,9 +370,6 @@ public class TraceHuntManager extends PlayerManager implements GameDatabaseObjec
|
||||
// Add logs to change info
|
||||
change.setExtraData(logs);
|
||||
|
||||
// Add exp
|
||||
this.addExp(50);
|
||||
|
||||
// Calculate result
|
||||
if (this.huntPlayerUid == this.getPlayerUid()) {
|
||||
// Check if we have enough cost items
|
||||
@@ -396,6 +400,9 @@ public class TraceHuntManager extends PlayerManager implements GameDatabaseObjec
|
||||
return null;
|
||||
}
|
||||
|
||||
// Add exp
|
||||
this.addExp(50);
|
||||
|
||||
// Add medals
|
||||
this.getPlayer().getInventory().addItem(37, this.getRandomMedals(), change);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user