Implement daily activity missions

This commit is contained in:
Melledy
2025-11-07 05:29:57 -08:00
parent 67029b7094
commit ad538d59ed
26 changed files with 513 additions and 18 deletions

View File

@@ -17,6 +17,7 @@ import emu.nebula.game.gacha.GachaManager;
import emu.nebula.game.instance.InstanceManager;
import emu.nebula.game.inventory.Inventory;
import emu.nebula.game.mail.Mailbox;
import emu.nebula.game.quest.QuestCondType;
import emu.nebula.game.quest.QuestManager;
import emu.nebula.game.scoreboss.ScoreBossManager;
import emu.nebula.game.story.StoryManager;
@@ -366,8 +367,14 @@ public class Player implements GameDatabaseObject {
return change == null ? new PlayerChangeInfo() : change;
}
// Consume energy
change = modifyEnergy(-amount, change);
// Trigger quest
this.getQuestManager().triggerQuest(QuestCondType.EnergyDeplete, amount);
// Complete
return modifyEnergy(-amount, change);
return change;
}
private PlayerChangeInfo modifyEnergy(int amount, PlayerChangeInfo change) {
@@ -445,6 +452,10 @@ public class Player implements GameDatabaseObject {
this.questManager = this.loadManagerFromDatabase(QuestManager.class);
}
public void onLogin() {
this.getQuestManager().triggerQuest(QuestCondType.LoginTotal, 1);
}
// Next packages
public void addNextPackage(int msgId, ProtoMessage<?> proto) {
@@ -556,6 +567,10 @@ public class Player implements GameDatabaseObject {
quests.addList(quest.toProto());
}
for (int id : this.getQuestManager().getClaimedActiveIds()) {
proto.addDailyActiveIds(id);
}
// Add dictionary tabs
for (var dictionaryData : GameData.getDictionaryTabDataTable()) {
var dictionaryProto = DictionaryTab.newInstance()