Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
L2j Server Datapack
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
L2j
L2j Server Datapack
Commits
fd793a35
Commit
fd793a35
authored
7 years ago
by
Adry85
Committed by
Zoey76
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed NPE on Minigame AI.
Patch by: Zephyr Reported by: CostyKiller Tested by: CostyKiller
parent
6199b271
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dist/game/data/scripts/ai/npc/Minigame/Minigame.java
+31
-6
31 additions, 6 deletions
dist/game/data/scripts/ai/npc/Minigame/Minigame.java
with
31 additions
and
6 deletions
dist/game/data/scripts/ai/npc/Minigame/Minigame.java
+
31
−
6
View file @
fd793a35
...
@@ -159,7 +159,7 @@ public final class Minigame extends AbstractNpcAI
...
@@ -159,7 +159,7 @@ public final class Minigame extends AbstractNpcAI
room
.
burnThemAll
();
room
.
burnThemAll
();
startQuestTimer
(
"off"
,
2000
,
npc
,
null
);
startQuestTimer
(
"off"
,
2000
,
npc
,
null
);
final
ConsumerEventListener
listener
=
new
ConsumerEventListener
(
room
.
getParticipant
(),
EventType
.
ON_CREATURE_SKILL_USE
,
(
OnCreatureSkillUse
listenerEvent
)
->
onSkillUse
(
listenerEvent
),
room
);
final
ConsumerEventListener
listener
=
new
ConsumerEventListener
(
room
.
getParticipant
(),
EventType
.
ON_CREATURE_SKILL_USE
,
(
OnCreatureSkillUse
listenerEvent
)
->
onSkillUse
(
listenerEvent
),
room
);
room
.
g
et
Participant
().
add
Listener
(
listener
);
room
.
s
etListener
(
listener
);
room
.
setCurrentPot
(
0
);
room
.
setCurrentPot
(
0
);
}
}
break
;
break
;
...
@@ -185,11 +185,7 @@ public final class Minigame extends AbstractNpcAI
...
@@ -185,11 +185,7 @@ public final class Minigame extends AbstractNpcAI
cancelQuestTimer
(
"expire"
,
npc
,
null
);
cancelQuestTimer
(
"expire"
,
npc
,
null
);
cancelQuestTimer
(
"hurry_up"
,
npc
,
null
);
cancelQuestTimer
(
"hurry_up"
,
npc
,
null
);
cancelQuestTimer
(
"hurry_up2"
,
npc
,
null
);
cancelQuestTimer
(
"hurry_up2"
,
npc
,
null
);
room
.
getManager
().
setTarget
(
null
);
room
.
clean
();
room
.
setParticipant
(
null
);
room
.
setStarted
(
false
);
room
.
setAttemptNumber
(
1
);
room
.
setCurrentPot
(
0
);
break
;
break
;
}
}
case
"afterthat"
:
case
"afterthat"
:
...
@@ -391,6 +387,7 @@ public final class Minigame extends AbstractNpcAI
...
@@ -391,6 +387,7 @@ public final class Minigame extends AbstractNpcAI
private
int
_attemptNumber
;
private
int
_attemptNumber
;
private
int
_currentPot
;
private
int
_currentPot
;
private
final
int
_order
[];
private
final
int
_order
[];
private
ConsumerEventListener
_listener
;
public
MinigameRoom
(
L2Npc
[]
burners
,
L2Npc
manager
)
public
MinigameRoom
(
L2Npc
[]
burners
,
L2Npc
manager
)
{
{
...
@@ -530,6 +527,34 @@ public final class Minigame extends AbstractNpcAI
...
@@ -530,6 +527,34 @@ public final class Minigame extends AbstractNpcAI
{
{
return
_order
;
return
_order
;
}
}
/**
* Set a listener for player inside room
* @param listener
*/
public
void
setListener
(
ConsumerEventListener
listener
)
{
_listener
=
listener
;
_participant
.
addListener
(
listener
);
}
/**
* Clean the room values
*/
public
void
clean
()
{
if
(
_listener
!=
null
)
{
_participant
.
removeListener
(
_listener
);
_listener
=
null
;
}
getManager
().
setTarget
(
null
);
setParticipant
(
null
);
setStarted
(
false
);
setAttemptNumber
(
1
);
setCurrentPot
(
0
);
}
}
}
public
static
void
main
(
String
[]
args
)
public
static
void
main
(
String
[]
args
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment