Implement some lua variables for less console spam (#2172)

* Implement some lua variables for less console spam

* Add GetHostQuestState

This fixes some chapter 3 stuff.
This commit is contained in:
Nazrin 2023-05-29 21:57:45 -07:00 committed by GitHub
parent 43a09ace2b
commit 7b3419b1d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -708,6 +708,17 @@ public class ScriptLib {
return quest.getState().getValue();
}
public int GetHostQuestState(int questId){
val player = getSceneScriptManager().getScene().getWorld().getHost();
val quest = player.getQuestManager().getQuestById(questId);
if(quest == null){
return QuestState.QUEST_STATE_NONE.getValue();
}
return quest.getState().getValue();
}
public int ShowReminder(int reminderId){
getSceneScriptManager().getScene().broadcastPacket(new PacketDungeonShowReminderNotify(reminderId));
return 0;
@ -1207,6 +1218,12 @@ public class ScriptLib {
return 0;
}
public int EnterWeatherArea(int var1){
logger.warn("[LUA] Call unimplemented EnterWeatherArea with {}", var1);
//TODO implement
return 0;
}
//TODO check
public boolean CheckIsInMpMode(){
logger.debug("[LUA] Call CheckIsInMpMode");

View File

@ -73,6 +73,7 @@ public class ScriptLoader {
addEnumByOrdinal(ctx, SealBattleType.values(), "SealBattleType");
addEnumByOrdinal(ctx, FatherChallengeProperty.values(), "FatherChallengeProperty");
addEnumByOrdinal(ctx, ChallengeEventMarkType.values(), "ChallengeEventMarkType");
addEnumByOrdinal(ctx, VisionLevelType.values(), "VisionLevelType");
ctx.globals.set(
"EventType",

View File

@ -0,0 +1,7 @@
package emu.grasscutter.scripts.constants;
public enum VisionLevelType {
VISION_LEVEL_NORMAL,
VISION_LEVEL_LITTLE_REMOTE,
VISION_LEVEL_REMOTE
}