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
7df41f61
Commit
7df41f61
authored
Aug 06, 2022
by
KingRainbow44
Browse files
Invoke `AbilityManager#onSkillStart` and `AbilityManager#onSkillEnd`
parent
64204286
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerClientAbilityInitFinishNotify.java
View file @
7df41f61
...
@@ -17,6 +17,10 @@ public class HandlerClientAbilityInitFinishNotify extends PacketHandler {
...
@@ -17,6 +17,10 @@ public class HandlerClientAbilityInitFinishNotify extends PacketHandler {
ClientAbilityInitFinishNotify
notif
=
ClientAbilityInitFinishNotify
.
parseFrom
(
payload
);
ClientAbilityInitFinishNotify
notif
=
ClientAbilityInitFinishNotify
.
parseFrom
(
payload
);
Player
player
=
session
.
getPlayer
();
Player
player
=
session
.
getPlayer
();
// Call skill end in the player's ability manager.
player
.
getAbilityManager
().
onSkillEnd
(
player
);
for
(
AbilityInvokeEntry
entry
:
notif
.
getInvokesList
())
{
for
(
AbilityInvokeEntry
entry
:
notif
.
getInvokesList
())
{
player
.
getAbilityManager
().
onAbilityInvoke
(
entry
);
player
.
getAbilityManager
().
onAbilityInvoke
(
entry
);
player
.
getClientAbilityInitFinishHandler
().
addEntry
(
entry
.
getForwardType
(),
entry
);
player
.
getClientAbilityInitFinishHandler
().
addEntry
(
entry
.
getForwardType
(),
entry
);
...
@@ -26,5 +30,4 @@ public class HandlerClientAbilityInitFinishNotify extends PacketHandler {
...
@@ -26,5 +30,4 @@ public class HandlerClientAbilityInitFinishNotify extends PacketHandler {
session
.
getPlayer
().
getClientAbilityInitFinishHandler
().
update
(
session
.
getPlayer
());
session
.
getPlayer
().
getClientAbilityInitFinishHandler
().
update
(
session
.
getPlayer
());
}
}
}
}
}
}
\ No newline at end of file
src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtDoSkillSuccNotify.java
View file @
7df41f61
...
@@ -12,10 +12,16 @@ public class HandlerEvtDoSkillSuccNotify extends PacketHandler {
...
@@ -12,10 +12,16 @@ public class HandlerEvtDoSkillSuccNotify extends PacketHandler {
@Override
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
EvtDoSkillSuccNotify
notify
=
EvtDoSkillSuccNotify
.
parseFrom
(
payload
);
EvtDoSkillSuccNotify
notify
=
EvtDoSkillSuccNotify
.
parseFrom
(
payload
);
var
player
=
session
.
getPlayer
();
int
skillId
=
notify
.
getSkillId
();
int
skillId
=
notify
.
getSkillId
();
int
casterId
=
notify
.
getCasterId
();
int
casterId
=
notify
.
getCasterId
();
session
.
getPlayer
().
getStaminaManager
().
handleEvtDoSkillSuccNotify
(
session
,
skillId
,
casterId
);
// Call skill perform in the player's ability manager.
session
.
getPlayer
().
getEnergyManager
().
handleEvtDoSkillSuccNotify
(
session
,
skillId
,
casterId
);
player
.
getAbilityManager
().
onSkillStart
(
session
.
getPlayer
(),
skillId
,
casterId
);
// Handle skill notify in other managers.
player
.
getStaminaManager
().
handleEvtDoSkillSuccNotify
(
session
,
skillId
,
casterId
);
player
.
getEnergyManager
().
handleEvtDoSkillSuccNotify
(
session
,
skillId
,
casterId
);
}
}
}
}
\ No newline at end of file
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