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
65c452cc
Commit
65c452cc
authored
10 years ago
by
Adry_85
Browse files
Options
Downloads
Patches
Plain Diff
BETA: Improvements and fixes for [10472].
Reported by: jurchiks Patch by: jurchiks
parent
b8cdafb5
No related branches found
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/quests/Q00356_DigUpTheSeaOfSpores/Q00356_DigUpTheSeaOfSpores.java
+31
-20
31 additions, 20 deletions
...00356_DigUpTheSeaOfSpores/Q00356_DigUpTheSeaOfSpores.java
with
31 additions
and
20 deletions
L2J_DataPack_BETA/dist/game/data/scripts/quests/Q00356_DigUpTheSeaOfSpores/Q00356_DigUpTheSeaOfSpores.java
+
31
−
20
View file @
65c452cc
...
@@ -23,9 +23,9 @@ import java.util.Map;
...
@@ -23,9 +23,9 @@ import java.util.Map;
import
com.l2jserver.gameserver.model.actor.L2Npc
;
import
com.l2jserver.gameserver.model.actor.L2Npc
;
import
com.l2jserver.gameserver.model.actor.instance.L2PcInstance
;
import
com.l2jserver.gameserver.model.actor.instance.L2PcInstance
;
import
com.l2jserver.gameserver.model.holders.ItemChanceHolder
;
import
com.l2jserver.gameserver.model.quest.Quest
;
import
com.l2jserver.gameserver.model.quest.Quest
;
import
com.l2jserver.gameserver.model.quest.QuestState
;
import
com.l2jserver.gameserver.model.quest.QuestState
;
import
com.l2jserver.gameserver.util.Util
;
import
com.l2jserver.util.Rnd
;
import
com.l2jserver.util.Rnd
;
/**
/**
...
@@ -42,11 +42,13 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
...
@@ -42,11 +42,13 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
// Misc
// Misc
private
static
final
int
MIN_LEVEL
=
43
;
private
static
final
int
MIN_LEVEL
=
43
;
// Monsters
// Monsters
private
static
final
Map
<
Integer
,
ItemChanceHolder
>
MONSTERS
=
new
HashMap
<>();
private
static
final
int
ROTTING_TREE
=
20558
;
private
static
final
int
SPORE_ZOMBIE
=
20562
;
private
static
final
Map
<
Integer
,
Double
>
MONSTER_DROP_CHANCES
=
new
HashMap
<>();
static
static
{
{
MONSTER
S
.
put
(
20558
,
new
ItemChanceHolder
(
HERBIVOROUS_SPOR
E
,
0.73
,
1
)
);
MONSTER
_DROP_CHANCES
.
put
(
ROTTING_TRE
E
,
0.73
);
MONSTER
S
.
put
(
20562
,
new
ItemChanceHolder
(
CARNIVORE_SPOR
E
,
0.94
,
1
)
);
MONSTER
_DROP_CHANCES
.
put
(
SPORE_ZOMBI
E
,
0.94
);
}
}
public
Q00356_DigUpTheSeaOfSpores
()
public
Q00356_DigUpTheSeaOfSpores
()
...
@@ -54,7 +56,7 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
...
@@ -54,7 +56,7 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
super
(
356
,
Q00356_DigUpTheSeaOfSpores
.
class
.
getSimpleName
(),
"Dig Up the Sea of Spores!"
);
super
(
356
,
Q00356_DigUpTheSeaOfSpores
.
class
.
getSimpleName
(),
"Dig Up the Sea of Spores!"
);
addStartNpc
(
GAUEN
);
addStartNpc
(
GAUEN
);
addTalkId
(
GAUEN
);
addTalkId
(
GAUEN
);
addKillId
(
MONSTERS
.
keySet
()
);
addKillId
(
ROTTING_TREE
,
SPORE_ZOMBIE
);
registerQuestItems
(
HERBIVOROUS_SPORE
,
CARNIVORE_SPORE
);
registerQuestItems
(
HERBIVOROUS_SPORE
,
CARNIVORE_SPORE
);
}
}
...
@@ -136,19 +138,25 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
...
@@ -136,19 +138,25 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
@Override
@Override
public
String
onKill
(
L2Npc
npc
,
L2PcInstance
killer
,
boolean
isSummon
)
public
String
onKill
(
L2Npc
npc
,
L2PcInstance
killer
,
boolean
isSummon
)
{
{
final
QuestState
qs
=
getRandomPartyMemberState
(
killer
,
-
1
,
3
,
npc
);
final
QuestState
qs
=
getQuestState
(
killer
,
false
);
if
(
qs
!=
null
)
if
((
qs
==
null
)
||
!
Util
.
checkIfInRange
(
1500
,
npc
,
killer
,
true
))
{
{
final
ItemChanceHolder
item
=
MONSTERS
.
get
(
npc
.
getId
());
return
null
;
if
(
giveItemRandomly
(
qs
.
getPlayer
(),
npc
,
item
.
getId
(),
item
.
getCount
(),
50
,
item
.
getChance
(),
true
)
//
}
&&
(
getQuestItemsCount
(
qs
.
getPlayer
(),
CARNIVORE_SPORE
)
>=
50
)
//
&&
(
getQuestItemsCount
(
qs
.
getPlayer
(),
CARNIVORE_SPORE
)
>=
50
))
final
int
dropItem
=
((
npc
.
getId
()
==
ROTTING_TREE
)
?
HERBIVOROUS_SPORE
:
CARNIVORE_SPORE
);
final
int
otherItem
=
((
dropItem
==
HERBIVOROUS_SPORE
)
?
CARNIVORE_SPORE
:
HERBIVOROUS_SPORE
);
if
(
giveItemRandomly
(
killer
,
npc
,
dropItem
,
1
,
50
,
MONSTER_DROP_CHANCES
.
get
(
npc
.
getId
()),
true
))
{
if
(
getQuestItemsCount
(
killer
,
otherItem
)
>=
50
)
{
{
qs
.
setCond
(
3
,
true
);
qs
.
setCond
(
3
);
}
}
else
else
{
{
qs
.
setCond
(
2
,
true
);
qs
.
setCond
(
2
);
}
}
}
}
return
super
.
onKill
(
npc
,
killer
,
isSummon
);
return
super
.
onKill
(
npc
,
killer
,
isSummon
);
...
@@ -165,21 +173,24 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
...
@@ -165,21 +173,24 @@ public final class Q00356_DigUpTheSeaOfSpores extends Quest
}
}
else
if
(
qs
.
isStarted
())
else
if
(
qs
.
isStarted
())
{
{
if
((
getQuestItemsCount
(
player
,
HERBIVOROUS_SPORE
)
<
50
)
&&
(
getQuestItemsCount
(
player
,
CARNIVORE_SPORE
)
<
50
))
final
boolean
hasAllHerbSpores
=
(
getQuestItemsCount
(
player
,
HERBIVOROUS_SPORE
)
>=
50
);
final
boolean
hasAllCarnSpores
=
(
getQuestItemsCount
(
player
,
CARNIVORE_SPORE
)
>=
50
);
if
(
hasAllHerbSpores
&&
hasAllCarnSpores
)
{
{
htmltext
=
"30717-
07
.html"
;
htmltext
=
"30717-
13
.html"
;
}
}
else
if
(
(
getQuestItemsCount
(
player
,
HERBIVOROUS_SPORE
)
>=
50
)
&&
(
getQuestItemsCount
(
player
,
CARNIVORE_SPORE
)
<
50
)
)
else
if
(
hasAllCarnSpores
)
{
{
htmltext
=
"30717-
08
.html"
;
htmltext
=
"30717-
12
.html"
;
}
}
else
if
(
(
getQuestItemsCount
(
player
,
HERBIVOROUS_SPORE
)
<
50
)
&&
(
getQuestItemsCount
(
player
,
CARNIVORE_SPORE
)
>=
50
)
)
else
if
(
hasAllHerbSpores
)
{
{
htmltext
=
"30717-
12
.html"
;
htmltext
=
"30717-
08
.html"
;
}
}
else
else
{
{
htmltext
=
"30717-
13
.html"
;
htmltext
=
"30717-
07
.html"
;
}
}
}
}
return
htmltext
;
return
htmltext
;
...
...
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