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
cc1988f3
Commit
cc1988f3
authored
7 years ago
by
Adry85
Browse files
Options
Downloads
Patches
Plain Diff
Fixed quest Invention Ambition (269) reward and improved code.
- Reported by: Zoey76
parent
65e847af
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
dist/game/data/scripts/quests/Q00269_InventionAmbition/Q00269_InventionAmbition.java
+53
-56
53 additions, 56 deletions
...ts/Q00269_InventionAmbition/Q00269_InventionAmbition.java
with
53 additions
and
56 deletions
dist/game/data/scripts/quests/Q00269_InventionAmbition/Q00269_InventionAmbition.java
+
53
−
56
View file @
cc1988f3
/*
/*
* Copyright (C) 2004-201
6
L2J DataPack
* Copyright (C) 2004-201
7
L2J DataPack
*
*
* This file is part of L2J DataPack.
* This file is part of L2J DataPack.
*
*
...
@@ -21,12 +21,10 @@ package quests.Q00269_InventionAmbition;
...
@@ -21,12 +21,10 @@ package quests.Q00269_InventionAmbition;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
com.l2jserver.gameserver.enums.audio.Sound
;
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.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.model.quest.State
;
/**
/**
* Invention Ambition (269)
* Invention Ambition (269)
...
@@ -39,17 +37,17 @@ public final class Q00269_InventionAmbition extends Quest
...
@@ -39,17 +37,17 @@ public final class Q00269_InventionAmbition extends Quest
// Items
// Items
private
static
final
int
ENERGY_ORE
=
10866
;
private
static
final
int
ENERGY_ORE
=
10866
;
// Monsters
// Monsters
private
static
final
Map
<
Integer
,
Integer
>
MONSTERS
=
new
HashMap
<>();
private
static
final
Map
<
Integer
,
Double
>
MONSTERS
=
new
HashMap
<>();
static
static
{
{
MONSTERS
.
put
(
21124
,
46
);
// Red Eye Barbed Bat
MONSTERS
.
put
(
21124
,
0.
46
);
// Red Eye Barbed Bat
MONSTERS
.
put
(
21125
,
48
);
// Northern Trimden
MONSTERS
.
put
(
21125
,
0.
48
);
// Northern Trimden
MONSTERS
.
put
(
21126
,
5
0
);
// Kerope Werewolf
MONSTERS
.
put
(
21126
,
0
.5
);
// Kerope Werewolf
MONSTERS
.
put
(
21127
,
64
);
// Northern Goblin
MONSTERS
.
put
(
21127
,
0.
64
);
// Northern Goblin
MONSTERS
.
put
(
21128
,
66
);
// Spine Golem
MONSTERS
.
put
(
21128
,
0.
66
);
// Spine Golem
MONSTERS
.
put
(
21129
,
68
);
// Kerope Werewolf Chief
MONSTERS
.
put
(
21129
,
0.
68
);
// Kerope Werewolf Chief
MONSTERS
.
put
(
21130
,
76
);
// Northern Goblin Leader
MONSTERS
.
put
(
21130
,
0.
76
);
// Northern Goblin Leader
MONSTERS
.
put
(
21131
,
78
);
// Enchanted Spine Golem
MONSTERS
.
put
(
21131
,
0.
78
);
// Enchanted Spine Golem
}
}
// Misc
// Misc
private
static
final
int
MIN_LVL
=
18
;
private
static
final
int
MIN_LVL
=
18
;
...
@@ -67,33 +65,41 @@ public final class Q00269_InventionAmbition extends Quest
...
@@ -67,33 +65,41 @@ public final class Q00269_InventionAmbition extends Quest
public
String
onAdvEvent
(
String
event
,
L2Npc
npc
,
L2PcInstance
player
)
public
String
onAdvEvent
(
String
event
,
L2Npc
npc
,
L2PcInstance
player
)
{
{
final
QuestState
st
=
getQuestState
(
player
,
false
);
final
QuestState
st
=
getQuestState
(
player
,
false
);
if
(
st
==
null
)
{
return
null
;
}
String
htmltext
=
null
;
String
htmltext
=
null
;
if
(
st
!=
null
)
switch
(
event
)
{
{
switch
(
event
)
case
"32486-03.htm"
:
{
{
case
"32486-03.htm"
:
if
(
player
.
getLevel
()
>=
MIN_LVL
)
{
{
htmltext
=
(
player
.
getLevel
()
>=
MIN_LVL
)
?
event
:
null
;
break
;
}
case
"32486-04.htm"
:
{
st
.
startQuest
();
htmltext
=
event
;
htmltext
=
event
;
break
;
}
}
case
"32486-07.html"
:
break
;
{
}
st
.
exitQuest
(
true
,
true
);
case
"32486-04.htm"
:
htmltext
=
event
;
{
break
;
if
(
player
.
getLevel
()
>=
MIN_LVL
)
}
case
"32486-08.html"
:
{
{
st
.
startQuest
();
htmltext
=
event
;
htmltext
=
event
;
break
;
}
}
break
;
}
case
"32486-07.html"
:
{
st
.
exitQuest
(
true
,
true
);
htmltext
=
event
;
break
;
}
case
"32486-08.html"
:
{
htmltext
=
event
;
break
;
}
}
}
}
return
htmltext
;
return
htmltext
;
...
@@ -102,11 +108,10 @@ public final class Q00269_InventionAmbition extends Quest
...
@@ -102,11 +108,10 @@ public final class Q00269_InventionAmbition extends Quest
@Override
@Override
public
String
onKill
(
L2Npc
npc
,
L2PcInstance
killer
,
boolean
isSummon
)
public
String
onKill
(
L2Npc
npc
,
L2PcInstance
killer
,
boolean
isSummon
)
{
{
final
QuestState
st
=
get
Quest
State
(
killer
,
false
);
final
QuestState
st
=
get
RandomPartyMember
State
(
killer
,
-
1
,
3
,
npc
);
if
(
(
st
!=
null
)
&&
(
getRandom
(
100
)
<
MONSTERS
.
get
(
npc
.
getId
())))
if
(
st
!=
null
)
{
{
st
.
giveItems
(
ENERGY_ORE
,
1
);
giveItemRandomly
(
st
.
getPlayer
(),
npc
,
ENERGY_ORE
,
1
,
0
,
MONSTERS
.
get
(
npc
.
getId
()),
true
);
st
.
playSound
(
Sound
.
ITEMSOUND_QUEST_ITEMGET
);
}
}
return
super
.
onKill
(
npc
,
killer
,
isSummon
);
return
super
.
onKill
(
npc
,
killer
,
isSummon
);
}
}
...
@@ -116,30 +121,22 @@ public final class Q00269_InventionAmbition extends Quest
...
@@ -116,30 +121,22 @@ public final class Q00269_InventionAmbition extends Quest
{
{
final
QuestState
st
=
getQuestState
(
player
,
true
);
final
QuestState
st
=
getQuestState
(
player
,
true
);
String
htmltext
=
getNoQuestMsg
(
player
);
String
htmltext
=
getNoQuestMsg
(
player
);
if
(
st
!=
null
)
if
(
st
.
isCreated
())
{
htmltext
=
(
player
.
getLevel
()
>=
MIN_LVL
)
?
"32486-01.htm"
:
"32486-02.html"
;
}
else
if
(
st
.
isStarted
())
{
{
switch
(
st
.
getState
(
))
if
(
st
.
hasQuestItems
(
ENERGY_ORE
))
{
{
case
State
.
CREATED
:
final
long
count
=
getQuestItemsCount
(
player
,
ENERGY_ORE
);
{
giveAdena
(
player
,
(
count
*
50
)
+
(
count
>=
10
?
2044
:
0
),
true
);
htmltext
=
(
player
.
getLevel
()
>=
MIN_LVL
)
?
"32486-01.htm"
:
"32486-02.html"
;
takeItems
(
player
,
ENERGY_ORE
,
-
1
);
break
;
htmltext
=
"32486-06.html"
;
}
}
case
State
.
STARTED
:
else
{
{
if
(
st
.
hasQuestItems
(
ENERGY_ORE
))
htmltext
=
"32486-05.html"
;
{
final
long
count
=
st
.
getQuestItemsCount
(
ENERGY_ORE
);
st
.
giveAdena
((
count
*
50
)
+
(
count
>=
10
?
2044
:
null
),
true
);
st
.
takeItems
(
ENERGY_ORE
,
-
1
);
htmltext
=
"32486-06.html"
;
}
else
{
htmltext
=
"32486-05.html"
;
}
break
;
}
}
}
}
}
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