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 -> {
|
case Title -> {
|
||||||
yield this.getTitles().contains(id);
|
yield this.getTitles().contains(id);
|
||||||
}
|
}
|
||||||
|
case TraceRequest -> {
|
||||||
|
yield this.getPlayer().getTraceHuntManager().getTraceRequests() >= count;
|
||||||
|
}
|
||||||
|
case HuntPermit -> {
|
||||||
|
yield this.getPlayer().getTraceHuntManager().getHuntPermits() >= count;
|
||||||
|
}
|
||||||
default -> {
|
default -> {
|
||||||
// Not implemented
|
// Not implemented
|
||||||
yield false;
|
yield false;
|
||||||
|
|||||||
@@ -338,6 +338,13 @@ public class TraceHuntManager extends PlayerManager implements GameDatabaseObjec
|
|||||||
return false;
|
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
|
// Set build
|
||||||
this.huntPlayerUid = (int) ownerUid;
|
this.huntPlayerUid = (int) ownerUid;
|
||||||
this.huntBossId = bossId;
|
this.huntBossId = bossId;
|
||||||
@@ -363,9 +370,6 @@ public class TraceHuntManager extends PlayerManager implements GameDatabaseObjec
|
|||||||
// Add logs to change info
|
// Add logs to change info
|
||||||
change.setExtraData(logs);
|
change.setExtraData(logs);
|
||||||
|
|
||||||
// Add exp
|
|
||||||
this.addExp(50);
|
|
||||||
|
|
||||||
// Calculate result
|
// Calculate result
|
||||||
if (this.huntPlayerUid == this.getPlayerUid()) {
|
if (this.huntPlayerUid == this.getPlayerUid()) {
|
||||||
// Check if we have enough cost items
|
// Check if we have enough cost items
|
||||||
@@ -396,6 +400,9 @@ public class TraceHuntManager extends PlayerManager implements GameDatabaseObjec
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add exp
|
||||||
|
this.addExp(50);
|
||||||
|
|
||||||
// Add medals
|
// Add medals
|
||||||
this.getPlayer().getInventory().addItem(37, this.getRandomMedals(), change);
|
this.getPlayer().getInventory().addItem(37, this.getRandomMedals(), change);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user