Commit 02a56fce authored by akatatsu27's avatar akatatsu27
Browse files

Major questing improvements

parent 89717f3c
...@@ -30,7 +30,7 @@ public class GameData { ...@@ -30,7 +30,7 @@ public class GameData {
// ExcelConfigs // ExcelConfigs
private static final Int2ObjectMap<PlayerLevelData> playerLevelDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<PlayerLevelData> playerLevelDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<AvatarData> avatarDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<AvatarData> avatarDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<AvatarLevelData> avatarLevelDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<AvatarLevelData> avatarLevelDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<AvatarSkillDepotData> avatarSkillDepotDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<AvatarSkillDepotData> avatarSkillDepotDataMap = new Int2ObjectOpenHashMap<>();
...@@ -40,7 +40,7 @@ public class GameData { ...@@ -40,7 +40,7 @@ public class GameData {
private static final Int2ObjectMap<AvatarPromoteData> avatarPromoteDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<AvatarPromoteData> avatarPromoteDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<AvatarTalentData> avatarTalentDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<AvatarTalentData> avatarTalentDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<ProudSkillData> proudSkillDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<ProudSkillData> proudSkillDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<ItemData> itemDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<ItemData> itemDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<ReliquaryLevelData> reliquaryLevelDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<ReliquaryLevelData> reliquaryLevelDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<ReliquaryAffixData> reliquaryAffixDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<ReliquaryAffixData> reliquaryAffixDataMap = new Int2ObjectOpenHashMap<>();
...@@ -57,11 +57,11 @@ public class GameData { ...@@ -57,11 +57,11 @@ public class GameData {
private static final Int2ObjectMap<GadgetData> gadgetDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<GadgetData> gadgetDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<MonsterCurveData> monsterCurveDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<MonsterCurveData> monsterCurveDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<MonsterDescribeData> monsterDescribeDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<MonsterDescribeData> monsterDescribeDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<AvatarFlycloakData> avatarFlycloakDataMap = new Int2ObjectLinkedOpenHashMap<>(); private static final Int2ObjectMap<AvatarFlycloakData> avatarFlycloakDataMap = new Int2ObjectLinkedOpenHashMap<>();
private static final Int2ObjectMap<AvatarCostumeData> avatarCostumeDataMap = new Int2ObjectLinkedOpenHashMap<>(); private static final Int2ObjectMap<AvatarCostumeData> avatarCostumeDataMap = new Int2ObjectLinkedOpenHashMap<>();
private static final Int2ObjectMap<AvatarCostumeData> avatarCostumeDataItemIdMap = new Int2ObjectLinkedOpenHashMap<>(); private static final Int2ObjectMap<AvatarCostumeData> avatarCostumeDataItemIdMap = new Int2ObjectLinkedOpenHashMap<>();
private static final Int2ObjectMap<SceneData> sceneDataMap = new Int2ObjectLinkedOpenHashMap<>(); private static final Int2ObjectMap<SceneData> sceneDataMap = new Int2ObjectLinkedOpenHashMap<>();
private static final Int2ObjectMap<FetterData> fetterDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<FetterData> fetterDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<CodexQuestData> codexQuestDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<CodexQuestData> codexQuestDataMap = new Int2ObjectOpenHashMap<>();
...@@ -76,7 +76,7 @@ public class GameData { ...@@ -76,7 +76,7 @@ public class GameData {
private static final ArrayList<CodexReliquaryData> codexReliquaryArrayList = new ArrayList<>(); private static final ArrayList<CodexReliquaryData> codexReliquaryArrayList = new ArrayList<>();
private static final Int2ObjectMap<FetterCharacterCardData> fetterCharacterCardDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<FetterCharacterCardData> fetterCharacterCardDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<RewardData> rewardDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<RewardData> rewardDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<WorldAreaData> worldAreaDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<WorldAreaData> worldAreaDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<WorldLevelData> worldLevelDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<WorldLevelData> worldLevelDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<DailyDungeonData> dailyDungeonDataMap = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<DailyDungeonData> dailyDungeonDataMap = new Int2ObjectOpenHashMap<>();
...@@ -108,33 +108,35 @@ public class GameData { ...@@ -108,33 +108,35 @@ public class GameData {
@Getter private static final Int2ObjectMap<MusicGameBasicData> musicGameBasicDataMap = new Int2ObjectOpenHashMap<>(); @Getter private static final Int2ObjectMap<MusicGameBasicData> musicGameBasicDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Int2ObjectMap<PersonalLineData> personalLineDataMap = new Int2ObjectOpenHashMap<>(); @Getter private static final Int2ObjectMap<PersonalLineData> personalLineDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Int2ObjectMap<ChapterData> chapterDataMap = new Int2ObjectOpenHashMap<>(); @Getter private static final Int2ObjectMap<ChapterData> chapterDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Int2ObjectMap<TriggerExcelConfigData> triggerExcelConfigDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Map<String,ScriptSceneData> scriptSceneDataMap = new HashMap<>();
// Cache // Cache
private static Map<Integer, List<Integer>> fetters = new HashMap<>(); private static Map<Integer, List<Integer>> fetters = new HashMap<>();
private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>(); private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>();
private static final IntList scenePointIdList = new IntArrayList(); private static final IntList scenePointIdList = new IntArrayList();
public static Int2ObjectMap<?> getMapByResourceDef(Class<?> resourceDefinition) { public static Int2ObjectMap<?> getMapByResourceDef(Class<?> resourceDefinition) {
Int2ObjectMap<?> map = null; Int2ObjectMap<?> map = null;
try { try {
Field field = GameData.class.getDeclaredField(Utils.lowerCaseFirstChar(resourceDefinition.getSimpleName()) + "Map"); Field field = GameData.class.getDeclaredField(Utils.lowerCaseFirstChar(resourceDefinition.getSimpleName()) + "Map");
field.setAccessible(true); field.setAccessible(true);
map = (Int2ObjectMap<?>) field.get(null); map = (Int2ObjectMap<?>) field.get(null);
field.setAccessible(false); field.setAccessible(false);
} catch (Exception e) { } catch (Exception e) {
Grasscutter.getLogger().error("Error fetching resource map for " + resourceDefinition.getSimpleName(), e); Grasscutter.getLogger().error("Error fetching resource map for " + resourceDefinition.getSimpleName(), e);
} }
return map; return map;
} }
public static Int2ObjectMap<String> getAbilityHashes() { public static Int2ObjectMap<String> getAbilityHashes() {
return abilityHashes; return abilityHashes;
} }
public static Map<String, AbilityEmbryoEntry> getAbilityEmbryoInfo() { public static Map<String, AbilityEmbryoEntry> getAbilityEmbryoInfo() {
return abilityEmbryos; return abilityEmbryos;
} }
...@@ -150,7 +152,7 @@ public class GameData { ...@@ -150,7 +152,7 @@ public class GameData {
public static Map<String, ScenePointEntry> getScenePointEntries() { public static Map<String, ScenePointEntry> getScenePointEntries() {
return scenePointEntries; return scenePointEntries;
} }
// TODO optimize // TODO optimize
public static ScenePointEntry getScenePointEntryById(int sceneId, int pointId) { public static ScenePointEntry getScenePointEntryById(int sceneId, int pointId) {
return getScenePointEntries().get(sceneId + "_" + pointId); return getScenePointEntries().get(sceneId + "_" + pointId);
...@@ -163,15 +165,15 @@ public class GameData { ...@@ -163,15 +165,15 @@ public class GameData {
public static Int2ObjectMap<HomeworldDefaultSaveData> getHomeworldDefaultSaveData() { public static Int2ObjectMap<HomeworldDefaultSaveData> getHomeworldDefaultSaveData() {
return homeworldDefaultSaveData; return homeworldDefaultSaveData;
} }
public static Int2ObjectMap<SceneNpcBornData> getSceneNpcBornData() { public static Int2ObjectMap<SceneNpcBornData> getSceneNpcBornData() {
return npcBornData; return npcBornData;
} }
public static Int2ObjectMap<AvatarData> getAvatarDataMap() { public static Int2ObjectMap<AvatarData> getAvatarDataMap() {
return avatarDataMap; return avatarDataMap;
} }
public static Int2ObjectMap<ItemData> getItemDataMap() { public static Int2ObjectMap<ItemData> getItemDataMap() {
return itemDataMap; return itemDataMap;
} }
...@@ -179,7 +181,7 @@ public class GameData { ...@@ -179,7 +181,7 @@ public class GameData {
public static Int2ObjectMap<AvatarSkillDepotData> getAvatarSkillDepotDataMap() { public static Int2ObjectMap<AvatarSkillDepotData> getAvatarSkillDepotDataMap() {
return avatarSkillDepotDataMap; return avatarSkillDepotDataMap;
} }
public static Int2ObjectMap<AvatarSkillData> getAvatarSkillDataMap() { public static Int2ObjectMap<AvatarSkillData> getAvatarSkillDataMap() {
return avatarSkillDataMap; return avatarSkillDataMap;
} }
...@@ -203,11 +205,11 @@ public class GameData { ...@@ -203,11 +205,11 @@ public class GameData {
public static Int2ObjectMap<WeaponLevelData> getWeaponLevelDataMap() { public static Int2ObjectMap<WeaponLevelData> getWeaponLevelDataMap() {
return weaponLevelDataMap; return weaponLevelDataMap;
} }
public static Int2ObjectMap<ReliquaryAffixData> getReliquaryAffixDataMap() { public static Int2ObjectMap<ReliquaryAffixData> getReliquaryAffixDataMap() {
return reliquaryAffixDataMap; return reliquaryAffixDataMap;
} }
public static Int2ObjectMap<ReliquaryMainPropData> getReliquaryMainPropDataMap() { public static Int2ObjectMap<ReliquaryMainPropData> getReliquaryMainPropDataMap() {
return reliquaryMainPropDataMap; return reliquaryMainPropDataMap;
} }
...@@ -219,7 +221,7 @@ public class GameData { ...@@ -219,7 +221,7 @@ public class GameData {
public static Int2ObjectMap<WeaponCurveData> getWeaponCurveDataMap() { public static Int2ObjectMap<WeaponCurveData> getWeaponCurveDataMap() {
return weaponCurveDataMap; return weaponCurveDataMap;
} }
public static Int2ObjectMap<AvatarCurveData> getAvatarCurveDataMap() { public static Int2ObjectMap<AvatarCurveData> getAvatarCurveDataMap() {
return avatarCurveDataMap; return avatarCurveDataMap;
} }
...@@ -228,11 +230,11 @@ public class GameData { ...@@ -228,11 +230,11 @@ public class GameData {
ReliquaryLevelData levelData = reliquaryLevelDataMap.get((rankLevel << 8) + level); ReliquaryLevelData levelData = reliquaryLevelDataMap.get((rankLevel << 8) + level);
return levelData != null ? levelData.getExp() : 0; return levelData != null ? levelData.getExp() : 0;
} }
public static ReliquaryLevelData getRelicLevelData(int rankLevel, int level) { public static ReliquaryLevelData getRelicLevelData(int rankLevel, int level) {
return reliquaryLevelDataMap.get((rankLevel << 8) + level); return reliquaryLevelDataMap.get((rankLevel << 8) + level);
} }
public static WeaponPromoteData getWeaponPromoteData(int promoteId, int promoteLevel) { public static WeaponPromoteData getWeaponPromoteData(int promoteId, int promoteLevel) {
return weaponPromoteDataMap.get((promoteId << 8) + promoteLevel); return weaponPromoteDataMap.get((promoteId << 8) + promoteLevel);
} }
...@@ -248,7 +250,7 @@ public class GameData { ...@@ -248,7 +250,7 @@ public class GameData {
return 0; return 0;
} }
} }
public static AvatarPromoteData getAvatarPromoteData(int promoteId, int promoteLevel) { public static AvatarPromoteData getAvatarPromoteData(int promoteId, int promoteLevel) {
return avatarPromoteDataMap.get((promoteId << 8) + promoteLevel); return avatarPromoteDataMap.get((promoteId << 8) + promoteLevel);
} }
...@@ -262,7 +264,7 @@ public class GameData { ...@@ -262,7 +264,7 @@ public class GameData {
AvatarFetterLevelData levelData = avatarFetterLevelDataMap.get(level); AvatarFetterLevelData levelData = avatarFetterLevelDataMap.get(level);
return levelData != null ? levelData.getExp() : 0; return levelData != null ? levelData.getExp() : 0;
} }
public static Int2ObjectMap<ProudSkillData> getProudSkillDataMap() { public static Int2ObjectMap<ProudSkillData> getProudSkillDataMap() {
return proudSkillDataMap; return proudSkillDataMap;
} }
...@@ -309,7 +311,7 @@ public class GameData { ...@@ -309,7 +311,7 @@ public class GameData {
public static Int2ObjectMap<AvatarCostumeData> getAvatarCostumeDataMap() { public static Int2ObjectMap<AvatarCostumeData> getAvatarCostumeDataMap() {
return avatarCostumeDataMap; return avatarCostumeDataMap;
} }
public static Int2ObjectMap<AvatarCostumeData> getAvatarCostumeDataItemIdMap() { public static Int2ObjectMap<AvatarCostumeData> getAvatarCostumeDataItemIdMap() {
return avatarCostumeDataItemIdMap; return avatarCostumeDataItemIdMap;
} }
...@@ -350,7 +352,7 @@ public class GameData { ...@@ -350,7 +352,7 @@ public class GameData {
public static Int2ObjectMap<WorldAreaData> getWorldAreaDataMap() { public static Int2ObjectMap<WorldAreaData> getWorldAreaDataMap() {
return worldAreaDataMap; return worldAreaDataMap;
} }
public static Int2ObjectMap<WorldLevelData> getWorldLevelDataMap() { public static Int2ObjectMap<WorldLevelData> getWorldLevelDataMap() {
return worldLevelDataMap; return worldLevelDataMap;
} }
...@@ -358,7 +360,7 @@ public class GameData { ...@@ -358,7 +360,7 @@ public class GameData {
public static Int2ObjectMap<DungeonData> getDungeonDataMap() { public static Int2ObjectMap<DungeonData> getDungeonDataMap() {
return dungeonDataMap; return dungeonDataMap;
} }
public static Int2ObjectMap<DailyDungeonData> getDailyDungeonDataMap() { public static Int2ObjectMap<DailyDungeonData> getDailyDungeonDataMap() {
return dailyDungeonDataMap; return dailyDungeonDataMap;
} }
...@@ -394,11 +396,11 @@ public class GameData { ...@@ -394,11 +396,11 @@ public class GameData {
public static Int2ObjectMap<TowerFloorData> getTowerFloorDataMap(){ public static Int2ObjectMap<TowerFloorData> getTowerFloorDataMap(){
return towerFloorDataMap; return towerFloorDataMap;
} }
public static Int2ObjectMap<TowerLevelData> getTowerLevelDataMap(){ public static Int2ObjectMap<TowerLevelData> getTowerLevelDataMap(){
return towerLevelDataMap; return towerLevelDataMap;
} }
public static Int2ObjectMap<TowerScheduleData> getTowerScheduleDataMap(){ public static Int2ObjectMap<TowerScheduleData> getTowerScheduleDataMap(){
return towerScheduleDataMap; return towerScheduleDataMap;
} }
...@@ -410,19 +412,19 @@ public class GameData { ...@@ -410,19 +412,19 @@ public class GameData {
public static Int2ObjectMap<ForgeData> getForgeDataMap() { public static Int2ObjectMap<ForgeData> getForgeDataMap() {
return forgeDataMap; return forgeDataMap;
} }
public static Int2ObjectMap<HomeWorldLevelData> getHomeWorldLevelDataMap() { public static Int2ObjectMap<HomeWorldLevelData> getHomeWorldLevelDataMap() {
return homeWorldLevelDataMap; return homeWorldLevelDataMap;
} }
public static Int2ObjectMap<FurnitureMakeConfigData> getFurnitureMakeConfigDataMap() { public static Int2ObjectMap<FurnitureMakeConfigData> getFurnitureMakeConfigDataMap() {
return furnitureMakeConfigDataMap; return furnitureMakeConfigDataMap;
} }
public static Int2ObjectMap<GatherData> getGatherDataMap() { public static Int2ObjectMap<GatherData> getGatherDataMap() {
return gatherDataMap; return gatherDataMap;
} }
public static Int2ObjectMap<InvestigationMonsterData> getInvestigationMonsterDataMap() { public static Int2ObjectMap<InvestigationMonsterData> getInvestigationMonsterDataMap() {
return investigationMonsterDataMap; return investigationMonsterDataMap;
} }
......
package emu.grasscutter.data.binout;
import com.google.gson.annotations.SerializedName;
import emu.grasscutter.scripts.data.SceneGroup;
import emu.grasscutter.utils.Position;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class ScriptSceneData {
Map<String,ScriptObject> scriptObjectList;
@Data
public static class ScriptObject {
//private SceneGroup groups;
@SerializedName("dummy_points")
private Map<String, List<Float>> dummyPoints;
}
}
package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
import lombok.Getter;
@ResourceType(name = "TriggerExcelConfigData.json") @Getter
public class TriggerExcelConfigData extends GameResource {
@Getter private int id;
private int sceneId;
private int groupId;
private String triggerName;
}
...@@ -15,6 +15,7 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -15,6 +15,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class EntityRegion extends GameEntity{ public class EntityRegion extends GameEntity{
private final Position position; private final Position position;
private boolean hasNewEntities; private boolean hasNewEntities;
private boolean entityLeave;
private final Set<Integer> entities; // Ids of entities inside this region private final Set<Integer> entities; // Ids of entities inside this region
private final SceneRegion metaRegion; private final SceneRegion metaRegion;
...@@ -45,10 +46,17 @@ public class EntityRegion extends GameEntity{ ...@@ -45,10 +46,17 @@ public class EntityRegion extends GameEntity{
hasNewEntities = false; hasNewEntities = false;
} }
public void removeEntity(int entityId) {
this.getEntities().remove(entityId);
this.entityLeave = true;
}
public void removeEntity(GameEntity entity) { public void removeEntity(GameEntity entity) {
this.getEntities().remove(entity.getId()); this.getEntities().remove(entity.getId());
this.entityLeave = true;
} }
public boolean entityLeave() {return this.entityLeave;}
public void resetEntityLeave() {this.entityLeave = false;}
@Override @Override
public Int2FloatOpenHashMap getFightProperties() { public Int2FloatOpenHashMap getFightProperties() {
return null; return null;
......
...@@ -65,8 +65,8 @@ public class QuestSystem extends BaseGameSystem { ...@@ -65,8 +65,8 @@ public class QuestSystem extends BaseGameSystem {
public boolean triggerCondition(GameQuest quest, QuestCondition condition, String paramStr, int... params) { public boolean triggerCondition(GameQuest quest, QuestCondition condition, String paramStr, int... params) {
QuestBaseHandler handler = condHandlers.get(condition.getType().getValue()); QuestBaseHandler handler = condHandlers.get(condition.getType().getValue());
if (handler == null || quest.getData() == null) { if (handler == null || quest.getQuestData() == null) {
Grasscutter.getLogger().debug("Could not trigger condition {} at {}", condition.getType().getValue(), quest.getData()); Grasscutter.getLogger().debug("Could not trigger condition {} at {}", condition.getType().getValue(), quest.getQuestData());
return false; return false;
} }
...@@ -76,8 +76,8 @@ public class QuestSystem extends BaseGameSystem { ...@@ -76,8 +76,8 @@ public class QuestSystem extends BaseGameSystem {
public boolean triggerContent(GameQuest quest, QuestCondition condition, String paramStr, int... params) { public boolean triggerContent(GameQuest quest, QuestCondition condition, String paramStr, int... params) {
QuestBaseHandler handler = contHandlers.get(condition.getType().getValue()); QuestBaseHandler handler = contHandlers.get(condition.getType().getValue());
if (handler == null || quest.getData() == null) { if (handler == null || quest.getQuestData() == null) {
Grasscutter.getLogger().debug("Could not trigger content {} at {}", condition.getType().getValue(), quest.getData()); Grasscutter.getLogger().debug("Could not trigger content {} at {}", condition.getType().getValue(), quest.getQuestData());
return false; return false;
} }
...@@ -87,8 +87,8 @@ public class QuestSystem extends BaseGameSystem { ...@@ -87,8 +87,8 @@ public class QuestSystem extends BaseGameSystem {
public boolean triggerExec(GameQuest quest, QuestExecParam execParam, String... params) { public boolean triggerExec(GameQuest quest, QuestExecParam execParam, String... params) {
QuestExecHandler handler = execHandlers.get(execParam.getType().getValue()); QuestExecHandler handler = execHandlers.get(execParam.getType().getValue());
if (handler == null || quest.getData() == null) { if (handler == null || quest.getQuestData() == null) {
Grasscutter.getLogger().debug("Could not trigger exec {} at {}", execParam.getType().getValue(), quest.getData()); Grasscutter.getLogger().debug("Could not trigger exec {} at {}", execParam.getType().getValue(), quest.getQuestData());
return false; return false;
} }
......
package emu.grasscutter.game.quest;
import lombok.Data;
import lombok.Getter;
import java.util.List;
@Data
public class RewindData {
AvatarData avatar;
List<Npc> npcs;
@Data
public static class AvatarData {
@Getter private String pos;
}
@Data
private static class Npc {
private String script;
private int room_id;
private int data_index;
private int id;
private String pos;
private int scene_id;
private String alias;
}
}
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.binout.MainQuestData;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameMainQuest;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_COMPLETE_TALK)
public class ConditionCompleteTalk extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
GameMainQuest checkMainQuest = quest.getOwner().getQuestManager().getMainQuestById(condition.getParam()[0]/100);
if (checkMainQuest == null || GameData.getMainQuestDataMap().get(checkMainQuest.getParentQuestId()).getTalks() == null) {
Grasscutter.getLogger().debug("Warning: mainQuest {} hasn't been started yet, or has no talks", condition.getParam()[0]/100);
return false;
}
MainQuestData.TalkData talkData = checkMainQuest.getTalks().get(Integer.valueOf(params[0]));
return talkData != null || checkMainQuest.getChildQuestById(params[0]) != null;
}
}
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_QUEST_GLOBAL_VAR_EQUAL)
public class ConditionQuestGlobalVarEqual extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
Integer questGlobalVarValue = quest.getMainQuest().getQuestManager().getQuestGlobalVarValue(Integer.valueOf(params[0]));
Grasscutter.getLogger().debug("questGlobarVar {} : {}", params[0],questGlobalVarValue);
return questGlobalVarValue.intValue() == params[1];
}
}
\ No newline at end of file
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_QUEST_GLOBAL_VAR_GREATER)
public class ConditionQuestGlobalVarGreater extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
Integer questGlobalVarValue = quest.getMainQuest().getQuestManager().getQuestGlobalVarValue(Integer.valueOf(params[0]));
Grasscutter.getLogger().debug("questGlobarVar {} : {}", params[0],questGlobalVarValue);
return questGlobalVarValue.intValue() > params[1];
}
}
\ No newline at end of file
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_QUEST_GLOBAL_VAR_LESS)
public class ConditionQuestGlobalVarLess extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
Integer questGlobalVarValue = quest.getMainQuest().getQuestManager().getQuestGlobalVarValue(Integer.valueOf(params[0]));
Grasscutter.getLogger().debug("questGlobarVar {} : {}", params[0],questGlobalVarValue);
return questGlobalVarValue.intValue() < params[1];
}
}
\ No newline at end of file
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameMainQuest;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_QUEST_VAR_EQUAL)
public class ConditionQuestVarEqual extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
int questVarValue = quest.getMainQuest().getQuestVars()[params[0]];
Grasscutter.getLogger().debug("questVar {} : {}", params[0],questVarValue);
return questVarValue == params[1];
}
}
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameMainQuest;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_QUEST_VAR_GREATER)
public class ConditionQuestVarGreater extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
int questVarValue = quest.getMainQuest().getQuestVars()[params[0]];
Grasscutter.getLogger().debug("questVar {} : {}", params[0],questVarValue);
return questVarValue > params[1];
}
}
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameMainQuest;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_QUEST_VAR_LESS)
public class ConditionQuestVarLess extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
int questVarValue = quest.getMainQuest().getQuestVars()[params[0]];
Grasscutter.getLogger().debug("questVar {} : {}", params[0],questVarValue);
return questVarValue < params[1];
}
}
package emu.grasscutter.game.quest.conditions;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_COND_STATE_NOT_EQUAL)
public class ConditionStateNotEqual extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
GameQuest checkQuest = quest.getOwner().getQuestManager().getQuestById(condition.getParam()[0]);
if (checkQuest == null) {
/*
Will spam the console
//Grasscutter.getLogger().debug("Warning: quest {} hasn't been started yet!", condition.getParam()[0]);
*/
return false;
}
return checkQuest.getState().getValue() != condition.getParam()[1];
}
}
package emu.grasscutter.game.quest.content;
import emu.grasscutter.data.binout.MainQuestData;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameMainQuest;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_CONTENT_COMPLETE_ANY_TALK)
public class ContentCompleteAnyTalk extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
GameMainQuest checkMainQuest = quest.getOwner().getQuestManager().getMainQuestById(params[0]/100);
if (checkMainQuest == null) {return false;}
MainQuestData.TalkData talkData = checkMainQuest.getTalks().get(Integer.valueOf(paramStr));
return talkData == null || condition.getParamStr().contains(paramStr) || checkMainQuest.getChildQuestById(params[0]) != null;
}
}
\ No newline at end of file
package emu.grasscutter.game.quest.content;
import emu.grasscutter.data.excels.QuestData.QuestCondition;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_CONTENT_LEAVE_SCENE)
public class ContentLeaveScene extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestCondition condition, String paramStr, int... params) {
return quest.getOwner().getScene().getPrevScene() == params[0];
}
}
package emu.grasscutter.game.quest.content;
import emu.grasscutter.data.binout.MainQuestData;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameMainQuest;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_CONTENT_NOT_FINISH_PLOT)
public class ContentNotFinishPlot extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
GameMainQuest checkMainQuest = quest.getOwner().getQuestManager().getMainQuestById(params[0]/100);
if (checkMainQuest == null) {return false;}
MainQuestData.TalkData talkData = checkMainQuest.getTalks().get(Integer.valueOf(params[0]));
return talkData == null;
}
}
package emu.grasscutter.game.quest.content;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_CONTENT_QUEST_STATE_NOT_EQUAL)
public class ContentQuestStateNotEqual extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
GameQuest checkQuest = quest.getOwner().getQuestManager().getQuestById(params[0]);
if (checkQuest != null) {
return checkQuest.getState().getValue() != params[1];
}
return false;
}
}
\ No newline at end of file
package emu.grasscutter.game.quest.content;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_CONTENT_QUEST_VAR_EQUAL)
public class ContentQuestVarEqual extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
int questVarValue = quest.getMainQuest().getQuestVars()[params[0]];
Grasscutter.getLogger().debug("questVar {} : {}", params[0],questVarValue);
return questVarValue == params[1];
}
}
package emu.grasscutter.game.quest.content;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue(QuestTrigger.QUEST_CONTENT_QUEST_VAR_GREATER)
public class ContentQuestVarGreater extends QuestBaseHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestCondition condition, String paramStr, int... params) {
int questVarValue = quest.getMainQuest().getQuestVars()[params[0]];
Grasscutter.getLogger().debug("questVar {} : {}", params[0],questVarValue);
return questVarValue > params[1];
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment