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
50c8f43d
Commit
50c8f43d
authored
Jun 15, 2022
by
ImmuState
Committed by
Melledy
Jun 15, 2022
Browse files
Fix giveall and givechar giving broken characters.
parent
5a8a636b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java
View file @
50c8f43d
package
emu.grasscutter.command.commands
;
package
emu.grasscutter.command.commands
;
import
emu.grasscutter.GameConstants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
...
@@ -52,9 +53,26 @@ public final class GiveAllCommand implements CommandHandler {
...
@@ -52,9 +53,26 @@ public final class GiveAllCommand implements CommandHandler {
Avatar
avatar
=
new
Avatar
(
avatarData
);
Avatar
avatar
=
new
Avatar
(
avatarData
);
avatar
.
setLevel
(
90
);
avatar
.
setLevel
(
90
);
avatar
.
setPromoteLevel
(
6
);
avatar
.
setPromoteLevel
(
6
);
// Add constellations.
int
talentBase
=
switch
(
avatar
.
getAvatarId
())
{
case
10000005
->
70
;
case
10000006
->
40
;
default
->
(
avatar
.
getAvatarId
()-
10000000
)*
10
;
};
for
(
int
i
=
1
;
i
<=
6
;++
i
){
for
(
int
i
=
1
;
i
<=
6
;++
i
){
avatar
.
getTalentIdList
().
add
((
avatar
.
getAvatarId
()-
10000000
)*
10
+
i
);
avatar
.
getTalentIdList
().
add
(
talentBase
+
i
);
}
// Handle skill depot for traveller.
if
(
avatar
.
getAvatarId
()
==
GameConstants
.
MAIN_CHARACTER_MALE
)
{
avatar
.
setSkillDepotData
(
GameData
.
getAvatarSkillDepotDataMap
().
get
(
504
));
}
else
if
(
avatar
.
getAvatarId
()
==
GameConstants
.
MAIN_CHARACTER_FEMALE
)
{
avatar
.
setSkillDepotData
(
GameData
.
getAvatarSkillDepotDataMap
().
get
(
704
));
}
}
// This will handle stats and talents
// This will handle stats and talents
avatar
.
recalcStats
();
avatar
.
recalcStats
();
// Don't try to add each avatar to the current team
// Don't try to add each avatar to the current team
...
...
src/main/java/emu/grasscutter/command/commands/GiveCharCommand.java
View file @
50c8f43d
package
emu.grasscutter.command.commands
;
package
emu.grasscutter.command.commands
;
import
emu.grasscutter.GameConstants
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
...
@@ -68,6 +69,14 @@ public final class GiveCharCommand implements CommandHandler {
...
@@ -68,6 +69,14 @@ public final class GiveCharCommand implements CommandHandler {
avatar
.
setLevel
(
level
);
avatar
.
setLevel
(
level
);
avatar
.
setPromoteLevel
(
ascension
);
avatar
.
setPromoteLevel
(
ascension
);
// Handle skill depot for traveller.
if
(
avatar
.
getAvatarId
()
==
GameConstants
.
MAIN_CHARACTER_MALE
)
{
avatar
.
setSkillDepotData
(
GameData
.
getAvatarSkillDepotDataMap
().
get
(
504
));
}
else
if
(
avatar
.
getAvatarId
()
==
GameConstants
.
MAIN_CHARACTER_FEMALE
)
{
avatar
.
setSkillDepotData
(
GameData
.
getAvatarSkillDepotDataMap
().
get
(
704
));
}
// This will handle stats and talents
// This will handle stats and talents
avatar
.
recalcStats
();
avatar
.
recalcStats
();
...
...
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