Implement giving rogue talent points

This commit is contained in:
Melledy
2023-10-27 22:36:39 -07:00
parent 88d4f15fbd
commit 293df4bdae
5 changed files with 675 additions and 55 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) {