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.database.GameDatabaseObject;
import emu.nebula.game.inventory.ItemParamMap;
import emu.nebula.game.player.Player;
import emu.nebula.game.player.PlayerChangeInfo;
import emu.nebula.game.quest.QuestCondType;
import emu.nebula.net.NetMsgId;
import emu.nebula.proto.Notify.Skin;
import emu.nebula.proto.Notify.SkinChange;
@@ -117,6 +118,7 @@ public class Character implements GameDatabaseObject {
public void addExp(int amount) {
// Setup
int expRequired = this.getMaxExp();
int oldLevel = this.getLevel();
// Add exp
this.exp += amount;
@@ -134,6 +136,12 @@ public class Character implements GameDatabaseObject {
this.exp = 0;
}
// Check if we leveled up
if (this.level > oldLevel) {
// Trigger quest
this.getPlayer().getQuestManager().triggerQuest(QuestCondType.CharacterUpTotal, this.level - oldLevel);
}
// Save to database
this.save();
}