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
d690590e
Commit
d690590e
authored
Apr 29, 2022
by
Melledy
Browse files
Implement AddExtraGroupSuite
parent
72e9a21c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/scripts/ScriptLib.java
View file @
d690590e
...
...
@@ -55,6 +55,10 @@ public class ScriptLib {
.
filter
(
e
->
e
.
getGroupId
()
==
groupId
).
toList
();
for
(
GameEntity
entity
:
list
)
{
if
(!(
entity
instanceof
EntityGadget
))
{
continue
;
}
EntityGadget
gadget
=
(
EntityGadget
)
entity
;
gadget
.
setState
(
gadgetState
);
...
...
@@ -140,9 +144,42 @@ public class ScriptLib {
}
public
int
AddExtraGroupSuite
(
int
groupId
,
int
param2
)
{
SceneGroup
group
=
getSceneScriptManager
().
getGroupById
(
groupId
);
if
(
group
==
null
||
group
.
monsters
==
null
)
{
return
1
;
}
// TODO just spawn all from group for now
List
<
GameEntity
>
toAdd
=
new
ArrayList
<>();
for
(
SceneMonster
monster
:
group
.
monsters
)
{
MonsterData
data
=
GameData
.
getMonsterDataMap
().
get
(
monster
.
monster_id
);
if
(
data
==
null
)
{
continue
;
}
EntityMonster
entity
=
new
EntityMonster
(
getSceneScriptManager
().
getScene
(),
data
,
monster
.
pos
,
monster
.
level
);
entity
.
getRotation
().
set
(
monster
.
rot
);
entity
.
setGroupId
(
group
.
id
);
entity
.
setConfigId
(
monster
.
config_id
);
toAdd
.
add
(
entity
);
}
if
(
toAdd
.
size
()
>
0
)
{
getSceneScriptManager
().
getScene
().
addEntities
(
toAdd
);
for
(
GameEntity
entity
:
toAdd
)
{
this
.
getSceneScriptManager
().
callEvent
(
EventType
.
EVENT_ANY_MONSTER_LIVE
,
new
ScriptArgs
(
entity
.
getConfigId
()));
}
}
return
0
;
}
// param3 (probably time limit for timed dungeons)
public
int
ActiveChallenge
(
int
challengeId
,
int
challengeIndex
,
int
param3
,
int
groupId
,
int
param4
,
int
param5
)
{
SceneGroup
group
=
getSceneScriptManager
().
getGroupById
(
groupId
);
...
...
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