Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
1de402bd
Commit
1de402bd
authored
Aug 01, 2022
by
KingRainbow44
Browse files
Merge branch 'development' into more-events
parents
b9b4b6f4
f25fb629
Changes
81
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/quest/QuestSystem.java
View file @
1de402bd
...
@@ -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
.
get
Quest
Data
()
==
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
.
get
Quest
Data
());
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
.
get
Quest
Data
()
==
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
.
get
Quest
Data
());
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
.
get
Quest
Data
()
==
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
.
get
Quest
Data
());
return
false
;
return
false
;
}
}
...
...
src/main/java/emu/grasscutter/game/quest/RewindData.java
0 → 100644
View file @
1de402bd
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
;
}
}
src/main/java/emu/grasscutter/game/quest/conditions/ConditionCompleteTalk.java
0 → 100644
View file @
1de402bd
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
;
}
}
src/main/java/emu/grasscutter/game/quest/conditions/ConditionLuaNotify.java
View file @
1de402bd
...
@@ -8,7 +8,7 @@ import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
...
@@ -8,7 +8,7 @@ import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@QuestValue
(
QuestTrigger
.
QUEST_COND_LUA_NOTIFY
)
@QuestValue
(
QuestTrigger
.
QUEST_COND_LUA_NOTIFY
)
public
class
ConditionLuaNotify
extends
QuestBaseHandler
{
public
class
ConditionLuaNotify
extends
QuestBaseHandler
{
//Wrong implementation. Example: 7010226 has no paramStr
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
return
condition
.
getParam
()[
0
]
==
Integer
.
parseInt
(
paramStr
);
return
condition
.
getParam
()[
0
]
==
Integer
.
parseInt
(
paramStr
);
...
...
src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarEqual.java
0 → 100644
View file @
1de402bd
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
src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarGreater.java
0 → 100644
View file @
1de402bd
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
src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarLess.java
0 → 100644
View file @
1de402bd
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
src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarEqual.java
0 → 100644
View file @
1de402bd
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
];
}
}
src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarGreater.java
0 → 100644
View file @
1de402bd
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
];
}
}
src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarLess.java
0 → 100644
View file @
1de402bd
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
];
}
}
src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateEqual.java
View file @
1de402bd
package
emu.grasscutter.game.quest.conditions
;
package
emu.grasscutter.game.quest.conditions
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.game.quest.QuestValue
;
import
emu.grasscutter.game.quest.QuestValue
;
import
emu.grasscutter.data.excels.QuestData.QuestCondition
;
import
emu.grasscutter.data.excels.QuestData.QuestCondition
;
import
emu.grasscutter.game.quest.GameQuest
;
import
emu.grasscutter.game.quest.GameQuest
;
...
@@ -11,13 +12,16 @@ public class ConditionStateEqual extends QuestBaseHandler {
...
@@ -11,13 +12,16 @@ public class ConditionStateEqual extends QuestBaseHandler {
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
GameQuest
checkQuest
=
quest
.
getOwner
().
getQuestManager
().
getQuestById
(
params
[
0
]);
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]);
if
(
checkQuest
!=
null
)
{
*/
return
checkQuest
.
getState
().
getValue
()
==
params
[
1
];
return
false
;
}
}
return
checkQuest
.
getState
().
getValue
()
==
condition
.
getParam
()[
1
];
return
false
;
}
}
}
}
src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateNotEqual.java
0 → 100644
View file @
1de402bd
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
];
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentAddQuestProgress.java
View file @
1de402bd
...
@@ -11,7 +11,12 @@ public class ContentAddQuestProgress extends QuestBaseHandler {
...
@@ -11,7 +11,12 @@ public class ContentAddQuestProgress extends QuestBaseHandler {
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
return
condition
.
getParam
()[
0
]
==
params
[
0
];
/*
//paramStr is a lua group, params[0] may also be a lua group!
questid = xxxxxx lua group = xxxxxxyy
count seems relevant only for lua group
*/
return
condition
.
getParam
()[
0
]
==
params
[
0
];
//missing params[1], paramStr, and count
}
}
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentCompleteAnyTalk.java
0 → 100644
View file @
1de402bd
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
src/main/java/emu/grasscutter/game/quest/content/ContentCompleteTalk.java
View file @
1de402bd
package
emu.grasscutter.game.quest.content
;
package
emu.grasscutter.game.quest.content
;
import
emu.grasscutter.data.binout.MainQuestData
;
import
emu.grasscutter.game.quest.GameMainQuest
;
import
emu.grasscutter.game.quest.GameQuest
;
import
emu.grasscutter.game.quest.QuestValue
;
import
emu.grasscutter.game.quest.QuestValue
;
import
emu.grasscutter.data.excels.QuestData.QuestCondition
;
import
emu.grasscutter.data.excels.QuestData.QuestCondition
;
import
emu.grasscutter.game.quest.GameQuest
;
import
emu.grasscutter.game.quest.enums.QuestTrigger
;
import
emu.grasscutter.game.quest.enums.QuestTrigger
;
import
emu.grasscutter.game.quest.handlers.QuestBaseHandler
;
import
emu.grasscutter.game.quest.handlers.QuestBaseHandler
;
...
@@ -11,7 +13,9 @@ public class ContentCompleteTalk extends QuestBaseHandler {
...
@@ -11,7 +13,9 @@ public class ContentCompleteTalk extends QuestBaseHandler {
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
return
condition
.
getParam
()[
0
]
==
params
[
0
];
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
||
condition
.
getParamStr
().
contains
(
paramStr
)
||
checkMainQuest
.
getChildQuestById
(
params
[
0
])
!=
null
;
}
}
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentEnterDungeon.java
View file @
1de402bd
...
@@ -11,7 +11,7 @@ public class ContentEnterDungeon extends QuestBaseHandler {
...
@@ -11,7 +11,7 @@ public class ContentEnterDungeon extends QuestBaseHandler {
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
return
condition
.
getParam
()[
0
]
==
params
[
0
];
return
condition
.
getParam
()[
0
]
==
params
[
0
];
//missing params[1]
}
}
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java
View file @
1de402bd
package
emu.grasscutter.game.quest.content
;
package
emu.grasscutter.game.quest.content
;
import
emu.grasscutter.data.binout.MainQuestData
;
import
emu.grasscutter.game.quest.GameMainQuest
;
import
emu.grasscutter.game.quest.QuestValue
;
import
emu.grasscutter.game.quest.QuestValue
;
import
emu.grasscutter.data.excels.QuestData.QuestCondition
;
import
emu.grasscutter.data.excels.QuestData.QuestCondition
;
import
emu.grasscutter.game.quest.GameQuest
;
import
emu.grasscutter.game.quest.GameQuest
;
...
@@ -11,7 +13,9 @@ public class ContentFinishPlot extends QuestBaseHandler {
...
@@ -11,7 +13,9 @@ public class ContentFinishPlot extends QuestBaseHandler {
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
return
condition
.
getParam
()[
0
]
==
params
[
0
];
MainQuestData
.
TalkData
talkData
=
quest
.
getMainQuest
().
getTalks
().
get
(
Integer
.
valueOf
(
params
[
0
]));
}
GameQuest
subQuest
=
quest
.
getMainQuest
().
getChildQuestById
(
params
[
0
]);
return
talkData
!=
null
||
subQuest
!=
null
;
}
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentLeaveScene.java
0 → 100644
View file @
1de402bd
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
];
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java
0 → 100644
View file @
1de402bd
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
;
}
}
src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateEqual.java
View file @
1de402bd
...
@@ -11,13 +11,9 @@ public class ContentQuestStateEqual extends QuestBaseHandler {
...
@@ -11,13 +11,9 @@ public class ContentQuestStateEqual extends QuestBaseHandler {
@Override
@Override
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
public
boolean
execute
(
GameQuest
quest
,
QuestCondition
condition
,
String
paramStr
,
int
...
params
)
{
GameQuest
checkQuest
=
quest
.
getOwner
().
getQuestManager
().
getQuestById
(
params
[
0
]);
GameQuest
checkQuest
=
quest
.
getOwner
().
getQuestManager
().
getQuestById
(
condition
.
getParam
()[
0
]);
if
(
checkQuest
==
null
)
{
return
false
;}
if
(
checkQuest
!=
null
)
{
return
checkQuest
.
getState
().
getValue
()
==
params
[
1
];
return
checkQuest
.
getState
().
getValue
()
==
params
[
1
];
}
return
false
;
}
}
}
}
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment