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
78550463
Commit
78550463
authored
8 years ago
by
Zoey76
Browse files
Options
Downloads
Patches
Plain Diff
Fixing Quest 234
Reported by: u3games
parent
4f8a99d1
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/Q00234_FatesWhisper/Q00234_FatesWhisper.java
+45
-65
45 additions, 65 deletions
...ripts/quests/Q00234_FatesWhisper/Q00234_FatesWhisper.java
with
45 additions
and
65 deletions
dist/game/data/scripts/quests/Q00234_FatesWhisper/Q00234_FatesWhisper.java
+
45
−
65
View file @
78550463
...
...
@@ -18,9 +18,6 @@
*/
package
quests.Q00234_FatesWhisper
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.l2jserver.gameserver.enums.QuestSound
;
import
com.l2jserver.gameserver.model.actor.L2Npc
;
import
com.l2jserver.gameserver.model.actor.instance.L2PcInstance
;
...
...
@@ -29,7 +26,6 @@ import com.l2jserver.gameserver.model.quest.QuestState;
import
com.l2jserver.gameserver.network.NpcStringId
;
import
com.l2jserver.gameserver.network.clientpackets.Say2
;
import
com.l2jserver.gameserver.network.serverpackets.NpcSay
;
import
com.l2jserver.gameserver.util.Util
;
/**
* Fate's Whisper (234)
...
...
@@ -231,11 +227,15 @@ public final class Q00234_FatesWhisper extends Quest
{
return
"30833-01.html"
;
}
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
!
qs
.
hasQuestItems
(
Q_BLOODY_FABRIC_Q0234
,
Q_WHITE_FABRIC_Q0234
))
final
long
bloodyFabricCount
=
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
);
final
long
whiteFabricCount
=
qs
.
getQuestItemsCount
(
Q_WHITE_FABRIC_Q0234
);
final
long
whiteBloodyFabricCount
=
bloodyFabricCount
+
whiteFabricCount
;
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
whiteBloodyFabricCount
<=
0
))
{
return
"30833-03.html"
;
}
if
(
qs
.
isMemoState
(
8
)
&&
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
!
qs
.
hasQuestItems
(
Q_BLOODY_FABRIC_Q0234
,
Q_WHITE_FABRIC_Q0234
))
if
(
qs
.
isMemoState
(
8
)
&&
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
whiteBloodyFabricCount
<=
0
))
{
qs
.
giveItems
(
Q_MAESTRO_REORINS_MOLD
,
1
);
qs
.
takeItems
(
Q_RED_PIPETTE_KNIFE
,
1
);
...
...
@@ -244,11 +244,11 @@ public final class Q00234_FatesWhisper extends Quest
qs
.
showQuestionMark
(
234
);
return
"30833-04.html"
;
}
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
)
<
30
)
&&
((
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
)
+
qs
.
getQuestItemsCount
(
Q_WHITE_FABRIC_Q0234
))
>=
30
))
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
bloodyFabricCount
<
30
)
&&
(
whiteBloodyFabricCount
>=
30
))
{
return
"30833-03c.html"
;
}
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
)
>=
30
)
&&
((
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
)
+
qs
.
getQuestItemsCount
(
Q_WHITE_FABRIC_Q0234
))
>=
30
))
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
bloodyFabricCount
>=
30
)
&&
(
whiteBloodyFabricCount
>=
30
))
{
qs
.
giveItems
(
Q_MAESTRO_REORINS_MOLD
,
1
);
qs
.
takeItems
(
Q_BLOODY_FABRIC_Q0234
,
-
1
);
...
...
@@ -257,9 +257,9 @@ public final class Q00234_FatesWhisper extends Quest
qs
.
showQuestionMark
(
234
);
return
"30833-03d.html"
;
}
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
(
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
)
+
qs
.
getQuestItemsCount
(
Q_WHITE_FABRIC_Q0234
))
<
30
)
&&
((
qs
.
getQuestItemsCount
(
Q_BLOODY_FABRIC_Q0234
)
+
qs
.
getQuestItemsCount
(
Q_WHITE_FABRIC_Q0234
))
>
0
))
if
(
qs
.
isMemoState
(
8
)
&&
!
qs
.
hasQuestItems
(
Q_RED_PIPETTE_KNIFE
)
&&
(
whiteBloodyFabricCount
<
30
)
&&
(
whiteBloodyFabricCount
>
0
))
{
qs
.
giveItems
(
Q_WHITE_FABRIC_Q0234
,
30
-
qs
.
getQuestItemsCount
(
Q_WHITE_FABRIC_Q0234
)
);
qs
.
giveItems
(
Q_WHITE_FABRIC_Q0234
,
30
-
whiteFabricCount
);
qs
.
takeItems
(
Q_BLOODY_FABRIC_Q0234
,
-
1
);
return
"30833-03e.html"
;
}
...
...
@@ -453,7 +453,7 @@ public final class Q00234_FatesWhisper extends Quest
qs
.
playSound
(
QuestSound
.
ITEMSOUND_QUEST_ITEMGET
);
return
"31028-01.html"
;
}
if
(
(
qs
.
get
MemoState
(
)
!=
2
)
||
qs
.
hasQuestItems
(
Q_INFERNIUM_SCEPTER_1
))
if
(
!
qs
.
is
MemoState
(
2
)
||
qs
.
hasQuestItems
(
Q_INFERNIUM_SCEPTER_1
))
{
return
"31028-02.html"
;
}
...
...
@@ -467,7 +467,7 @@ public final class Q00234_FatesWhisper extends Quest
qs
.
playSound
(
QuestSound
.
ITEMSOUND_QUEST_ITEMGET
);
return
"31029-01.html"
;
}
if
(
(
qs
.
get
MemoState
(
)
!=
2
)
||
qs
.
hasQuestItems
(
Q_INFERNIUM_SCEPTER_2
))
if
(
!
qs
.
is
MemoState
(
2
)
||
qs
.
hasQuestItems
(
Q_INFERNIUM_SCEPTER_2
))
{
return
"31029-02.html"
;
}
...
...
@@ -481,7 +481,7 @@ public final class Q00234_FatesWhisper extends Quest
qs
.
playSound
(
QuestSound
.
ITEMSOUND_QUEST_ITEMGET
);
return
"31030-01.html"
;
}
if
(
(
qs
.
get
MemoState
(
)
!=
2
)
||
qs
.
hasQuestItems
(
Q_INFERNIUM_SCEPTER_3
))
if
(
!
qs
.
is
MemoState
(
2
)
||
qs
.
hasQuestItems
(
Q_INFERNIUM_SCEPTER_3
))
{
return
"31030-02.html"
;
}
...
...
@@ -557,7 +557,7 @@ public final class Q00234_FatesWhisper extends Quest
}
case
3
:
{
if
(
(
qs
.
get
MemoState
(
)
==
4
)
&&
!
qs
.
hasQuestItems
(
Q_INFERNIUM_VARNISH
))
if
(
qs
.
is
MemoState
(
4
)
&&
!
qs
.
hasQuestItems
(
Q_INFERNIUM_VARNISH
))
{
qs
.
giveItems
(
Q_INFERNIUM_VARNISH
,
1
);
return
"30182-04.html"
;
...
...
@@ -574,7 +574,7 @@ public final class Q00234_FatesWhisper extends Quest
{
if
(
qs
.
isMemoState
(
7
))
{
return
"3018
2
-02.html"
;
return
"3018
3
-02.html"
;
}
break
;
}
...
...
@@ -991,66 +991,65 @@ public final class Q00234_FatesWhisper extends Quest
}
}
}
}
return
htmltext
;
}
private
boolean
calculateReward
(
QuestState
qs
,
L2PcInstance
player
,
int
REWARD
)
private
boolean
calculateReward
(
QuestState
qs
,
L2PcInstance
player
,
int
reward
)
{
switch
(
qs
.
getMemoState
())
{
case
11
:
return
getReward
(
qs
,
player
,
SWORD_OF_DAMASCUS
,
SWORD_OF_DAMASCUS_FOCUS
,
SWORD_OF_DAMASCUS_CRT_DAMAGE
,
SWORD_OF_DAMASCUS_HASTE
,
REWARD
);
return
getReward
(
qs
,
player
,
SWORD_OF_DAMASCUS
,
SWORD_OF_DAMASCUS_FOCUS
,
SWORD_OF_DAMASCUS_CRT_DAMAGE
,
SWORD_OF_DAMASCUS_HASTE
,
reward
);
case
12
:
return
getReward
(
qs
,
player
,
HAZARD_BOW
,
HAZARD_BOW_GUIDENCE
,
HAZARD_BOW_QUICKRECOVERY
,
HAZARD_BOW_CHEAPSHOT
,
REWARD
);
return
getReward
(
qs
,
player
,
HAZARD_BOW
,
HAZARD_BOW_GUIDENCE
,
HAZARD_BOW_QUICKRECOVERY
,
HAZARD_BOW_CHEAPSHOT
,
reward
);
case
13
:
return
getReward
(
qs
,
player
,
LANCIA
,
LANCIA_ANGER
,
LANCIA_CRT_STUN
,
LANCIA_LONGBLOW
,
REWARD
);
return
getReward
(
qs
,
player
,
LANCIA
,
LANCIA_ANGER
,
LANCIA_CRT_STUN
,
LANCIA_LONGBLOW
,
reward
);
case
14
:
return
getReward
(
qs
,
player
,
ART_OF_BATTLE_AXE
,
ART_OF_BATTLE_AXE_HEALTH
,
ART_OF_BATTLE_AXE_RSK_FOCUS
,
ART_OF_BATTLE_AXE_HASTE
,
REWARD
);
return
getReward
(
qs
,
player
,
ART_OF_BATTLE_AXE
,
ART_OF_BATTLE_AXE_HEALTH
,
ART_OF_BATTLE_AXE_RSK_FOCUS
,
ART_OF_BATTLE_AXE_HASTE
,
reward
);
case
15
:
return
getReward
(
qs
,
player
,
STAFF_OF_EVIL_SPRIT
,
STAFF_OF_EVIL_SPRIT_MAGICFOCUS
,
STAFF_OF_EVIL_SPRIT_MAGICBLESSTHEBODY
,
STAFF_OF_EVIL_SPRIT_MAGICPOISON
,
REWARD
);
return
getReward
(
qs
,
player
,
STAFF_OF_EVIL_SPRIT
,
STAFF_OF_EVIL_SPRIT_MAGICFOCUS
,
STAFF_OF_EVIL_SPRIT_MAGICBLESSTHEBODY
,
STAFF_OF_EVIL_SPRIT_MAGICPOISON
,
reward
);
case
16
:
return
getReward
(
qs
,
player
,
DEMONS_SWORD
,
DEMONS_SWORD_CRT_BLEED
,
DEMONS_SWORD_CRT_POISON
,
DEMONS_SWORD_MIGHTMOTAL
,
REWARD
);
return
getReward
(
qs
,
player
,
DEMONS_SWORD
,
DEMONS_SWORD_CRT_BLEED
,
DEMONS_SWORD_CRT_POISON
,
DEMONS_SWORD_MIGHTMOTAL
,
reward
);
case
17
:
return
getReward
(
qs
,
player
,
BELLION_CESTUS
,
BELLION_CESTUS_CRT_DRAIN
,
BELLION_CESTUS_CRT_POISON
,
BELLION_CESTUS_RSK_HASTE
,
REWARD
);
return
getReward
(
qs
,
player
,
BELLION_CESTUS
,
BELLION_CESTUS_CRT_DRAIN
,
BELLION_CESTUS_CRT_POISON
,
BELLION_CESTUS_RSK_HASTE
,
reward
);
case
18
:
return
getReward
(
qs
,
player
,
DEADMANS_GLORY
,
DEADMANS_GLORY_ANGER
,
DEADMANS_GLORY_HEALTH
,
DEADMANS_GLORY_HASTE
,
REWARD
);
return
getReward
(
qs
,
player
,
DEADMANS_GLORY
,
DEADMANS_GLORY_ANGER
,
DEADMANS_GLORY_HEALTH
,
DEADMANS_GLORY_HASTE
,
reward
);
case
19
:
return
getReward
(
qs
,
player
,
SAMURAI_LONGSWORD_SAMURAI_LONGSWORD
,
0
,
0
,
0
,
REWARD
);
return
getReward
(
qs
,
player
,
SAMURAI_LONGSWORD_SAMURAI_LONGSWORD
,
0
,
0
,
0
,
reward
);
case
41
:
return
getReward
(
qs
,
player
,
GUARDIANS_SWORD
,
GUARDIANS_SWORD_CRT_DRAIN
,
GUARDIANS_SWORD_HEALTH
,
GUARDIANS_SWORD_CRT_BLEED
,
REWARD
);
return
getReward
(
qs
,
player
,
GUARDIANS_SWORD
,
GUARDIANS_SWORD_CRT_DRAIN
,
GUARDIANS_SWORD_HEALTH
,
GUARDIANS_SWORD_CRT_BLEED
,
reward
);
case
42
:
return
getReward
(
qs
,
player
,
TEARS_OF_WIZARD
,
TEARS_OF_WIZARD_ACUMEN
,
TEARS_OF_WIZARD_MAGICPOWER
,
TEARS_OF_WIZARD_UPDOWN
,
REWARD
);
return
getReward
(
qs
,
player
,
TEARS_OF_WIZARD
,
TEARS_OF_WIZARD_ACUMEN
,
TEARS_OF_WIZARD_MAGICPOWER
,
TEARS_OF_WIZARD_UPDOWN
,
reward
);
case
43
:
return
getReward
(
qs
,
player
,
STAR_BUSTER
,
STAR_BUSTER_HEALTH
,
STAR_BUSTER_HASTE
,
STAR_BUSTER_RSK_FOCUS
,
REWARD
);
return
getReward
(
qs
,
player
,
STAR_BUSTER
,
STAR_BUSTER_HEALTH
,
STAR_BUSTER_HASTE
,
STAR_BUSTER_RSK_FOCUS
,
reward
);
case
44
:
return
getReward
(
qs
,
player
,
BONE_OF_KAIM_VANUL
,
BONE_OF_KAIM_VANUL_MANAUP
,
BONE_OF_KAIM_VANUL_MAGICSILENCE
,
BONE_OF_KAIM_VANUL_UPDOWN
,
REWARD
);
return
getReward
(
qs
,
player
,
BONE_OF_KAIM_VANUL
,
BONE_OF_KAIM_VANUL_MANAUP
,
BONE_OF_KAIM_VANUL_MAGICSILENCE
,
BONE_OF_KAIM_VANUL_UPDOWN
,
reward
);
}
return
false
;
}
private
boolean
getReward
(
QuestState
qs
,
L2PcInstance
player
,
int
ITEM
1
,
int
ITEM
2
,
int
ITEM
3
,
int
ITEM
4
,
int
REWARD
)
private
boolean
getReward
(
QuestState
qs
,
L2PcInstance
player
,
int
item
1
,
int
item
2
,
int
item
3
,
int
item
4
,
int
reward
)
{
if
(
hasAtLeastOneQuestItem
(
player
,
ITEM1
,
ITEM2
,
ITEM3
,
ITEM
4
))
if
(
hasAtLeastOneQuestItem
(
player
,
item1
,
item2
,
item3
,
item
4
))
{
qs
.
giveItems
(
REWARD
,
1
);
qs
.
giveItems
(
reward
,
1
);
qs
.
giveItems
(
Q_STAR_OF_DESTINY
,
1
);
if
(
qs
.
hasQuestItems
(
ITEM
1
))
if
(
qs
.
hasQuestItems
(
item
1
))
{
qs
.
takeItems
(
ITEM
1
,
1
);
qs
.
takeItems
(
item
1
,
1
);
}
else
if
(
qs
.
hasQuestItems
(
ITEM
2
))
else
if
(
qs
.
hasQuestItems
(
item
2
))
{
qs
.
takeItems
(
ITEM
2
,
1
);
qs
.
takeItems
(
item
2
,
1
);
}
else
if
(
qs
.
hasQuestItems
(
ITEM
3
))
else
if
(
qs
.
hasQuestItems
(
item
3
))
{
qs
.
takeItems
(
ITEM
3
,
1
);
qs
.
takeItems
(
item
3
,
1
);
}
else
if
(
qs
.
hasQuestItems
(
ITEM
4
))
else
if
(
qs
.
hasQuestItems
(
item
4
))
{
qs
.
takeItems
(
ITEM
4
,
1
);
qs
.
takeItems
(
item
4
,
1
);
}
qs
.
exitQuest
(
false
,
true
);
player
.
broadcastSocialAction
(
3
);
...
...
@@ -1085,7 +1084,8 @@ public final class Q00234_FatesWhisper extends Quest
return
super
.
onKill
(
npc
,
killer
,
isSummon
);
}
}
final
QuestState
qs
=
getRandomPlayerFromParty
(
killer
,
npc
,
8
);
final
QuestState
qs
=
getRandomPartyMemberState
(
killer
,
-
1
,
2
,
npc
);
if
(
qs
!=
null
)
{
switch
(
npc
.
getId
())
...
...
@@ -1135,29 +1135,9 @@ public final class Q00234_FatesWhisper extends Quest
return
super
.
onAttack
(
npc
,
attacker
,
damage
,
isSummon
);
}
private
QuestState
getRandomPlayerFromParty
(
L2PcInstance
player
,
L2Npc
npc
,
int
memoState
)
@Override
public
boolean
checkPartyMember
(
QuestState
qs
,
L2Npc
npc
)
{
QuestState
qs
=
getQuestState
(
player
,
false
);
final
List
<
QuestState
>
candidates
=
new
ArrayList
<>();
if
((
qs
!=
null
)
&&
qs
.
isStarted
()
&&
(
qs
.
getMemoState
()
==
memoState
)
&&
!
qs
.
hasQuestItems
(
Q_WHITE_FABRIC_Q0234
))
{
candidates
.
add
(
qs
);
candidates
.
add
(
qs
);
}
if
(
player
.
isInParty
())
{
player
.
getParty
().
getMembers
().
stream
().
forEach
(
pm
->
{
QuestState
qss
=
getQuestState
(
pm
,
false
);
if
((
qss
!=
null
)
&&
qss
.
isStarted
()
&&
(
qss
.
getMemoState
()
==
memoState
)
&&
!
qss
.
hasQuestItems
(
Q_WHITE_FABRIC_Q0234
)
&&
Util
.
checkIfInRange
(
1500
,
npc
,
pm
,
true
))
{
candidates
.
add
(
qss
);
}
});
}
return
candidates
.
isEmpty
()
?
null
:
candidates
.
get
(
getRandom
(
candidates
.
size
()));
return
qs
.
hasQuestItems
(
Q_WHITE_FABRIC_Q0234
)
&&
qs
.
isMemoState
(
8
);
}
}
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