mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-23 10:44:36 +01:00
Implement giving rogue talent points
This commit is contained in:
@@ -243,6 +243,9 @@ public class Inventory extends BasePlayerManager {
|
||||
case 22: // Trailblaze EXP
|
||||
getPlayer().addExp(count);
|
||||
break;
|
||||
case GameConstants.ROGUE_TALENT_POINT_ITEM_ID: // Rogue talent points
|
||||
getPlayer().addTalentPoints(count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +267,9 @@ public class Inventory extends BasePlayerManager {
|
||||
if (param.getId() == GameConstants.MATERIAL_COIN_ID) {
|
||||
// Remove credits
|
||||
getPlayer().addSCoin(-param.getCount() * multiplier);
|
||||
} else if (param.getId() == GameConstants.ROGUE_TALENT_POINT_ITEM_ID) {
|
||||
// Remove credits
|
||||
getPlayer().addTalentPoints(-param.getCount() * multiplier);
|
||||
} else {
|
||||
// Remove param items
|
||||
GameItem item = this.getItemByParam(param);
|
||||
@@ -382,6 +388,8 @@ public class Inventory extends BasePlayerManager {
|
||||
if (!verifyScoin(param.getCount() * multiplier)) {
|
||||
return false;
|
||||
}
|
||||
} else if (param.getId() == GameConstants.ROGUE_TALENT_POINT_ITEM_ID) {
|
||||
return this.getPlayer().getTalentPoints() >= param.getCount() * multiplier;
|
||||
} else {
|
||||
// Check param items
|
||||
GameItem item = this.getItemByParam(param);
|
||||
|
||||
@@ -69,6 +69,7 @@ public class Player {
|
||||
private int scoin; // Credits
|
||||
private int hcoin; // Jade
|
||||
private int mcoin; // Crystals
|
||||
private int talentPoints;
|
||||
|
||||
private transient Battle battle;
|
||||
private transient Scene scene;
|
||||
@@ -299,6 +300,10 @@ public class Player {
|
||||
this.mcoin += amount;
|
||||
this.sendPacket(new PacketPlayerSyncScNotify(this));
|
||||
}
|
||||
|
||||
public void addTalentPoints(int amount) {
|
||||
this.talentPoints += amount;
|
||||
}
|
||||
|
||||
public void addStamina(int amount) {
|
||||
this.stamina = Math.min(this.stamina + amount, GameConstants.MAX_STAMINA);
|
||||
|
||||
@@ -117,14 +117,18 @@ public class RogueManager extends BasePlayerManager {
|
||||
var data = RogueInfoData.newInstance()
|
||||
.setRogueScoreInfo(score)
|
||||
.setRogueSeasonInfo(season);
|
||||
|
||||
|
||||
var proto = RogueInfo.newInstance()
|
||||
.setRogueScoreInfo(score)
|
||||
.setRogueData(data)
|
||||
.setTalentPoints(getPlayer().getTalentPoints())
|
||||
.setSeasonId(seasonId)
|
||||
.setBeginTime(beginTime)
|
||||
.setEndTime(endTime);
|
||||
|
||||
proto.getMutableRogueCurrencyInfo()
|
||||
.setRogueTalentPoints(getPlayer().getTalentPoints());
|
||||
|
||||
// Rogue data
|
||||
RogueInstance curRogue = this.getPlayer().getRogueInstance();
|
||||
if (curRogue != null) {
|
||||
|
||||
Reference in New Issue
Block a user