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
85334b53
Commit
85334b53
authored
11 years ago
by
St3eT
Browse files
Options
Downloads
Patches
Plain Diff
BETA: Fixed `NullPointerException` and little updated '''!DelusionTeleport''' AI.
* Reviewed by: Nos, !UnAfraid, Adry_85
parent
5b90d2b1
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
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/DelusionTeleport/DelusionTeleport.java
+16
-13
16 additions, 13 deletions
...s/ai/npc/Teleports/DelusionTeleport/DelusionTeleport.java
with
16 additions
and
13 deletions
L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/DelusionTeleport/DelusionTeleport.java
+
16
−
13
View file @
85334b53
...
...
@@ -27,7 +27,6 @@ import com.l2jserver.gameserver.instancemanager.TownManager;
import
com.l2jserver.gameserver.model.Location
;
import
com.l2jserver.gameserver.model.actor.L2Npc
;
import
com.l2jserver.gameserver.model.actor.instance.L2PcInstance
;
import
com.l2jserver.gameserver.model.quest.QuestState
;
import
com.l2jserver.gameserver.model.zone.type.L2TownZone
;
/**
...
...
@@ -37,18 +36,24 @@ import com.l2jserver.gameserver.model.zone.type.L2TownZone;
public
final
class
DelusionTeleport
extends
AbstractNpcAI
{
// NPCs
// @formatter:off
private
static
final
int
[]
NPCS
=
{
32484
,
32658
,
32659
,
32660
,
32661
,
32662
,
32663
32484
,
// Pathfinder Worker
32658
,
// Guardian of Eastern Seal
32659
,
// Guardian of Western Seal
32660
,
// Guardian of Southern Seal
32661
,
// Guardian of Northern Seal
32662
,
// Guardian of Great Seal
32663
,
// Guardian of Tower of Seal
};
// @formatter:on
// Misc
// Location
private
static
final
Location
[]
HALL_LOCATIONS
=
{
new
Location
(-
114597
,
-
152501
,
-
6750
),
new
Location
(-
114589
,
-
154162
,
-
6750
)
};
// Player Variables
private
static
final
String
DELUSION_RETURN
=
"DELUSION_RETURN"
;
private
static
final
Map
<
Integer
,
Location
>
RETURN_LOCATIONS
=
new
HashMap
<>();
...
...
@@ -73,22 +78,20 @@ public final class DelusionTeleport extends AbstractNpcAI
@Override
public
String
onTalk
(
L2Npc
npc
,
L2PcInstance
player
)
{
final
QuestState
st
=
player
.
getQuestState
(
getName
());
if
(
npc
.
getId
()
==
NPCS
[
0
])
if
(
npc
.
getId
()
==
NPCS
[
0
])
// Pathfinder Worker
{
final
L2TownZone
town
=
TownManager
.
getTown
(
npc
.
getX
(),
npc
.
getY
(),
npc
.
getZ
());
final
int
townId
=
((
town
==
null
)
?
0
:
town
.
getTownId
());
st
.
set
(
"return_loc"
,
Integer
.
toString
(
townId
)
)
;
player
.
getVariables
().
set
(
DELUSION_RETURN
,
townId
);
player
.
teleToLocation
(
HALL_LOCATIONS
[
getRandom
(
HALL_LOCATIONS
.
length
)],
false
);
}
else
{
player
.
teleToLocation
(
RETURN_LOCATIONS
.
get
(
st
.
getInt
(
"return_loc"
)),
true
);
st
.
exitQuest
(
true
);
final
int
townId
=
player
.
getVariables
().
getInt
(
DELUSION_RETURN
,
0
);
player
.
teleToLocation
(
RETURN_LOCATIONS
.
get
(
townId
),
true
);
player
.
getVariables
().
remove
(
DELUSION_RETURN
);
}
return
""
;
return
super
.
onTalk
(
npc
,
player
);
}
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