Quest Seductive Whispers (663).

Contributed by Mathael.
This commit is contained in:
MobiusDev 2016-07-24 08:39:23 +00:00
parent f345ce31cd
commit 03d81243f4
28 changed files with 727 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<html><body>Wilbert:<br>
Hey, you, traveler! Come over here, my friend.<br>
You look a little bored. Not sure how what to do with yourself?<br>
How about we play a little game that's pretty popular in these parts? I think you'll enjoy it.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-02.htm">"What's the game?"</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Wilbert:<br>
From times to time, we enjoy a duel game called <font color="LEVEL">The Battle of Sun and Moon</font>. It's pretty popular in these parts, in case you haven't heard of it. I've found it a great way to pass the time when you're between jobs. Just say the word and I'll teach you everything you need to know. What do you say?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-03.htm">"I'd like to play."</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Wilbert:<br>
All right! If that's what you want, I'll let you join in.<br>
You can't be ready for the game already, can you? You're not thinking of joining in without bringing anything to the table, are you? You have to get one item if you want to enjoy a game with us. It's not so hard to find, but we need to have <font color="LEVEL">Spirit Beads</font> to make weapons. I'll give you the details another time, but for now, go to <font color="LEVEL">the Ancient Battleground and the Field of Massacre</font> and get some <font color="LEVEL">Spirit Beads</font> from the undead and the demons.<br>
Didn't I explain it well enough?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-04.htm">"What is a Spirit Bead?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-05.html">"How do you play the game called War Between the Sun and the Moon?"</Button>
</body></html>

View File

@ -0,0 +1,10 @@
<html><body>Wilbert:<br>
When a being's thought or spirit energy comes together into the shape of a bead, we call that a Spirit Bead. Artisans like me need them to make good weapons. That's why we gamble with them -- as they're worth a lot to us. In this area, they say that you can easily get Spirit Beads if uou fo to the <font color="LEVEL">Ancient Battleground and the Field of Massacre</font>.<br>
At <font color="LEVEL">the Ancient Battleground</font>, you can obtain <font color="LEVEL">Spirit Beads</font> from the undead known as <font color="LEVEL">Knights of the Past, Ghostly Warriors, Starving Corpses, Dark Guards, Death Agents and Nihil Invaders</font> and from the demons known as <font color="LEVEL">Bloody Loards, Bloody Priests, Bloody Knights and Bloody Ghosts</font>.<br>
At the <font color="LEVEL">Field of Massacre</font>, you can obtain <font color="LEVEL">Spirit Beads</font> from the undead known as <font color="LEVEL">Doom Scouts, Doom Servants, Doom Guards, Doom Archers, Doom Troopers, Doom Warriors, Doom Knights, Archers of Destruction, Spiteful Soul Leaders, Spiteful Soul Wizards and Spiteful Soul Fighters</font>.<br>
I think that's enough information for you to get started. Is there anything else you'd like to know?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-05.html">"How do you play the game called War Between the Sun and the Moon?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-14.html">"What do you get when you win the game?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-06.html">"I want to practice." (Need 1 Spirit Bead.)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-15.html">"Let's play!" (Need 50 Spirit Beads.)</Button>
</body></html>

View File

@ -0,0 +1,12 @@
<html><body>Wilbert:<br>
Actually, we once played this game using the images on the Spirit Beads themselves, but it became easier to just use cards marked with images of Suns or Moons. Listen up! There are 10 types of cards, each marked with 1 to 5 <font color="LEVEL">pictures of the Sun or Moon</font>. here's how to play.<br>
First, xards are deatl to each person in order. The last card drawn is placed face up.<br>
Check how many pictures your cards have on them.<br>
If there is more than one more card with 5 pictures on it, the person who got the card last wins.<br>
Simple, eh ?<br>
Anything else you'd like to know?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-04.htm">"What is a Spirit Bead?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-14.html">"What do you get when you win the game?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-06.html">"I want to practice." (Need 1 Spirit Bead.)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-15.html">"Let's play!" (Need 50 Spirit Beads.)</Button></body>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Wilbert:<br>
Let's start then! First, give me 1 Spirit Bead. Now pick any card you want from this box. You know the rules, right?<br>
When you're ready, go ahead and draw a card.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-22.html">Draw a card</Button>
</body></html>

View File

@ -0,0 +1,9 @@
<html><body>Wilbert:<br>
The card that you took out is: %player_card%.<br>
%table%
<br>
So that's how you play the game. Pretty simple, eh? If you want to join a real game, let me know.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-06.html">"I want to practice some more."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-15.html">"Let's play!" (Need 50 Spirit Beads.)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-12.html">"Later maybe."</Button>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Wilbert:<br>
You need 50 spirit beads to play. I can plaintly see that you don't have enough; why don't you go get some more and come back?
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Wilbert:<br>
You know that you need a <font color="LEVEL">Spirit Bead</font> to play the game, right? Now, why you don't you go get some so we can get started?<br>
Go to <font color="LEVEL">the Ancient Battleground and the Fields of Massacre</font> and get some <font color="LEVEL">Spirit Bead</font> from the undead and the demons.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-10.html">"I don't want to play this game anymore."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-04.htm">"What is a Spirit Bead?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-05.html">"How do you play the game called War Between the Sun and the Moon?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-11.html">"I quit."</Button>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Wilbert:<br>
Well, it's a shame that you want to stop. if you want to play again, come by any time. I certanly enjoyed it!
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Wilbert:<br>
What's he matter? You started the game, so you should finish it. Are you really going to quit now?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-12.html">"I'll come by next time."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-10.html">"I don't want to play anymore."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Wilbert:<br>
Very well. You look very tired.<br>
Come back when you are rested. I'll be waiting for you here.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Wilbert:<br>
Don't even think about coming over here if you don't have any beads!
</body></html>

View File

@ -0,0 +1,17 @@
<html><body>Wilbert:<br>
If you win the game, the master running it owes you the appropriate amount. The higher the round, the bigger the payout. That's why the game only allows you to win up to 8 rounds in a row. If -- and that's a big if -- you manage to win 8 straight times, the game will end.<br>
Keep in mind that <font color="LEVEL">if you lose any of the rounds, you get nothing</font>. That's fair warning, my friend. Here's how the prize system works:<br>
1 winning round: 40,000 Adena<br1>
2 winning rounds: 80,000 Adena<br1>
3 winning rounds: 110,000 Adena, D-grade Enchant Weapon Scroll<br1>
4 winning rounds: 199,000 Adena, C-grade Enchant Weapon Scroll<br1>
5 winning rounds: 388,000 Adena, 1 recipe for a B-grade Weapon<br1>
6 winning rounds: 675,000 Adena, 1 essential ingredient for a B-grade Weapon<br1>
7 winning rounds: 1,284,000 Adena, 2 B-grade Enchant Weapon Scrolls, 2 B-grade Enchant Armor Scrolls<br1>
8 winning rounds: 2,384,000 Adena, 1 A-grade Enchant Weapon Scroll, 2 A-grade Enchant Armor Scrolls<br>
My advice is to identify what you'd like to win and then to play for that prize. Any questions?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-04.htm">"What is a Spirit Bead?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-05.html">"How do you play the game called War Between the Sun and the Moon?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-07.html">"I want to practice." (Need 1 Spirit Bead.)</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-08.html">"Let's play!" (Need 50 Spirit Beads.)</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Wilbert:<br>
Well then, ready to get started? I see you've already put in the 50 spirit beads you need to play. Excellent!<br>
Whenever you're ready, my friend, draw your card.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-16.html">Draw a card</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Wilbert:<br>
Ah! Thank the gods, it's my turn again. You drew: %player_card%.<br>
The cards on the table are:<br>
%table%
<br>
Can I draw my card now?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-17.html">Tell him to draw a card.</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Wilbert:<br>
Oh well... Ah, it's your turn again. I drew: %npc_card%<br>
The cards on the table are:<br>
%table%
<br>
Draw a card.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-16.html">Draw card</Button>
</body></html>

View File

@ -0,0 +1,10 @@
<html><body>Wilbert:><br>
Let's see, now... The card you drew is %player_card%.<br>
The cards on the table are:<br>
%table%
<br>
Dragons spore! You've won. If my luck stays this bad, I'm going to have a lot of explaining to do to the missus!<br>
By my reckonin', you have %win_count% consecutive wins. Do you want to quit? Or would you like to keep playing?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-19.html">Challenge him again</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-20.html">Quit the game and collect the prize</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Wilbert:<br>
First just let me warm up a little. Ah... that's better. Let's play! Whenever you're ready, my friend...<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-15.html">"I'm ready"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-12.html">"I want to take a break"</Button>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Wilbert:<br>
My my, you're doing very well, aren't you? I bet you could take everything I have if this keeps up! Well, here are your winnings.<br>
Say, how about we keep playing?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-15.html">Continue the game</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-12.html">Stop the game for a while</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Wilbert:<br>
Let's see here... The card I took out is: %npc_card%.<br>
%table%
<br>
Luck! Looks like I win. It was a good game, though, eh? If you'd like to play again, feel free to challenge me.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-19.html">Challenge him again</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Wilbert:<br>
Whew! Thankfully, it's my turn again. The card you drew is: %player_card%. The cards on table are:<br
%table%
<br>
Can I draw my card now?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-23.html">Tell him to draw a card</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Wilbert:<br>
Ok, now it's your turn. I drew: %npc_card%. The cards on the table are:<br>
%table%
<br>
Can I draw my card now?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-22.html">Draw a card.</Button>
</body></html>

View File

@ -0,0 +1,9 @@
<html><body>Wilbert:<br>
I drew %npc_card%. The cards on the table are:<br>
%table%
<br>
What luck! Looks like I win. Still, it was a pretty exciting practice run, eh? If you want to play again, feel free to challenge me.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-06.html">"I'd like to keep practicing."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-15.html">"I want to play the game now."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00663_SeductiveWhispers 30846-11.html">"I want to quit."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Wilbert:<br>
Hey there! Yeah, you, traveler! When you're a little less gree, come see me for some excitement you won't soon forget.<br>
(You must be level 50 or abve to start this quest.)
</body></html>

View File

@ -0,0 +1,543 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package quests.Q00663_SeductiveWhispers;
import java.util.Arrays;
import java.util.stream.Collectors;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* @author Mathael
*/
public class Q00663_SeductiveWhispers extends Quest
{
// NPC
private static final int WILBERT = 30846;
// Item
private static final int SPIRIT_BEAD = 8766;
// Monsters
private static final int[] MOBS =
{
20956,
20955,
20954,
20959,
20958,
20957,
20963,
20962,
20961,
20960,
20976,
20974,
20975,
21006,
20674,
21010,
21009,
21001,
21002
};
// Rewards
private static final int[] RECIPES_B_GRADE =
{
5000,
4966,
4967,
4963,
4968,
5005,
4969,
5007,
4971,
5008,
4970,
5006,
5001,
4972,
4964,
5002,
5003,
4965,
5004
};
private static final int[] PART_B_GRADE =
{
4114,
4107,
4108,
1104,
4109,
4119,
4110,
4121,
4112,
2120,
4111,
4120,
4115,
4113,
4105,
4116,
4117,
4106,
4118
};
// Misc
private static final Card[] cards = new Card[10];
static
{
cards[0] = new Card(Side.MOON, 1);
cards[1] = new Card(Side.SUN, 1);
cards[2] = new Card(Side.MOON, 2);
cards[3] = new Card(Side.SUN, 2);
cards[4] = new Card(Side.MOON, 3);
cards[5] = new Card(Side.SUN, 3);
cards[6] = new Card(Side.MOON, 4);
cards[7] = new Card(Side.SUN, 4);
cards[8] = new Card(Side.MOON, 5);
cards[9] = new Card(Side.SUN, 5);
}
private int winCount = 0;
private Card playerCard = null;
private Card npcCard = null;
public Q00663_SeductiveWhispers()
{
super(663);
addStartNpc(WILBERT);
addTalkId(WILBERT);
addKillId(MOBS);
addCondMinLevel(50, "30846-lvl.html");
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
String htmltext = getNoQuestMsg(talker);
final QuestState qs = getQuestState(talker, true);
if (qs == null)
{
return htmltext;
}
switch (qs.getState())
{
case State.CREATED:
{
htmltext = "30846-01.htm";
break;
}
case State.STARTED:
{
htmltext = "30846-09.html";
break;
}
}
return htmltext;
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return getNoQuestMsg(player);
}
switch (event)
{
case "30846-02.htm":
case "30846-04.htm":
case "30846-05.html":
case "30846-11.html":
case "30846-12.html":
case "30846-14.html":
case "30846-19.html":
{
break;
}
case "30846-03.htm":
{
qs.startQuest();
break;
}
case "30846-10.html":
{
qs.exitQuest(true, true);
break;
}
case "30846-06.html":
{
// practice
if (getQuestItemsCount(player, SPIRIT_BEAD) < 1)
{
event = "30846-13.html";
}
else
{
takeItems(player, SPIRIT_BEAD, 1);
}
break;
}
case "30846-22.html":
{
if (playerCard == null)
{
playerCard = cards[Rnd.get(0, 9)];
}
else
{
playerCard = getRandomCard();
}
event = play(player, true, true);
break;
}
case "30846-23.html":
{
if (npcCard == null)
{
npcCard = playerCard; // to avoid same card when getRandomCard()
npcCard = getRandomCard();
}
else
{
npcCard = getRandomCard();
}
event = play(player, false, true);
break;
}
case "30846-15.html":
{
if (getQuestItemsCount(player, SPIRIT_BEAD) < 50)
{
event = "30846-08.html";
}
else
{
takeItems(player, SPIRIT_BEAD, 50);
}
break;
}
case "30846-16.html":
{
// Player draw a card (Always player start first !!)
if (playerCard == null)
{
playerCard = cards[Rnd.get(0, 9)];
}
else
{
playerCard = getRandomCard();
}
event = play(player, true, false);
break;
}
case "30846-17.html":
{
// npc draw card
if (npcCard == null)
{
npcCard = playerCard; // to avoid same card when getRandomCard()
npcCard = getRandomCard();
}
else
{
npcCard = getRandomCard();
}
event = play(player, false, false);
break;
}
case "30846-20.html":
{
if (winCount > 0)
{
giveRewards(player, winCount);
winCount = 0;
}
reset(false);
break;
}
case "30846-21.html":
{
reset(true);
break;
}
}
return event;
}
public String play(L2PcInstance player, boolean isPlayerTurn, boolean isPractice)
{
boolean isPlayerWin = false;
boolean isNpcWin = false;
String htmltext;
String table = getHtm(player.getHtmlPrefix(), "table.html");
if (isPlayerTurn)
{
if ((playerCard != null) && isWinner(playerCard, npcCard, true))
{
if (isPractice)
{
rewardItems(player, 57, 800);
}
else
{
winCount++;
}
if (winCount == 8)
{
// Cant win more than 8 consecutive game (I don't know html after 8 wins (too hard) -> give reward and show main page)
giveRewards(player, winCount);
reset(true);
return "30846-05.html";
}
isPlayerWin = true;
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-07.html" : "30846-18.html");
htmltext = htmltext.replace("%table%", table);
htmltext = htmltext.replaceAll("%win_count%", "" + winCount);
}
else
{
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-22.html" : "30846-16.html");
htmltext = htmltext.replace("%table%", table);
}
}
else
{
if ((playerCard != null) && (npcCard != null) && isWinner(playerCard, npcCard, false))
{
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-24.html" : "30846-21.html");
htmltext = htmltext.replace("%table%", table);
isNpcWin = true;
}
else
{
htmltext = getHtm(player.getHtmlPrefix(), isPractice ? "30846-23.html" : "30846-17.html");
htmltext = htmltext.replace("%table%", table);
}
}
htmltext = htmltext.replaceAll("%player_name%", player.getName());
htmltext = htmltext.replaceAll("%player_card%", playerCard.toString());
htmltext = npcCard == null ? htmltext.replaceAll("%npc_card%", "No such card") : htmltext.replaceAll("%npc_card%", npcCard.toString());
if (isPlayerWin)
{
reset(false);
}
if (isNpcWin)
{
reset(true);
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getQuestState(killer, false);
if ((qs != null) && qs.isCond(1))
{
switch (Rnd.get(0, 5))
{
case 0:
case 1:
{
break;
}
case 5:
{
giveItems(killer, SPIRIT_BEAD, 2);
break;
}
default:
{
giveItems(killer, SPIRIT_BEAD, 1);
}
}
}
return super.onKill(npc, killer, isSummon);
}
private void reset(boolean resetCounter)
{
playerCard = null;
npcCard = null;
if (resetCounter)
{
winCount = 0;
}
}
private Card getRandomCard()
{
final int index = Rnd.get(0, 7);
return Arrays.stream(cards).filter(card -> (!card.equals(playerCard)) && (!card.equals(npcCard))).collect(Collectors.toList()).get(index);
}
private boolean isWinner(Card playerCard, Card npcCard, boolean playerIsLastDraw)
{
if ((npcCard == null) && playerIsLastDraw && (playerCard.getNumber() == 5))
{
return true;
}
if ((npcCard != null) && (playerCard.getSide().ordinal() == npcCard.getSide().ordinal()))
{
return (playerCard.getNumber() + npcCard.getNumber()) == 5;
}
else if (playerIsLastDraw)
{
return playerCard.getNumber() == 5;
}
else if (npcCard != null)
{
return npcCard.getNumber() == 5;
}
return false;
}
private void giveRewards(L2PcInstance player, int consecutiveWin)
{
switch (consecutiveWin)
{
case 1:
{
rewardItems(player, 57, 40000);
break;
}
case 2:
{
rewardItems(player, 57, 80000);
break;
}
case 3:
{
rewardItems(player, 57, 110000);
rewardItems(player, 955, 1); // Enchant Weapon D
break;
}
case 4:
{
rewardItems(player, 57, 199000);
rewardItems(player, 951, 1); // Enchant Weapon C
break;
}
case 5:
{
rewardItems(player, 57, 388000);
rewardItems(player, getRandomRecipeBGrade(), 1); // Recipe Weapon B grade 60%
break;
}
case 6:
{
rewardItems(player, 57, 675000);
rewardItems(player, getRandomPartBGrade(), 1); // one part for making weapon b grade
break;
}
case 7:
{
rewardItems(player, 57, 1284000);
rewardItems(player, 947, 2); // Enchant Weapon B
rewardItems(player, 948, 2); // Enchant Armor B
break;
}
case 8:
{
rewardItems(player, 57, 2384000);
rewardItems(player, 729, 1); // Enchant Weapon A
rewardItems(player, 730, 2); // Enchant Armor A
break;
}
}
}
private int getRandomRecipeBGrade()
{
return RECIPES_B_GRADE[Rnd.get(0, RECIPES_B_GRADE.length - 1)];
}
private int getRandomPartBGrade()
{
return PART_B_GRADE[Rnd.get(0, PART_B_GRADE.length - 1)];
}
private enum Side
{
SUN("Sun card"),
MOON("Moon card");
private String _name;
Side(String name)
{
_name = name;
}
public String getName()
{
return _name;
}
}
private static final class Card
{
private final int _number;
private final Side _side;
public Card(Side side, int number)
{
_side = side;
_number = number;
}
public Side getSide()
{
return _side;
}
public int getNumber()
{
return _number;
}
@Override
public boolean equals(Object o)
{
return (o instanceof Card) && (((Card) o).getNumber() == _number) && (((Card) o).getSide().ordinal() == _side.ordinal());
}
@Override
public String toString()
{
return getSide() == Side.MOON ? "<font color=\"LEVEL\">" + getSide().getName() + ": " + getNumber() + "</font>" : "<font color=\"FF0000\">" + getSide().getName() + ": " + getNumber() + "</font>";
}
}
}

View File

@ -0,0 +1,10 @@
<table>
<tr align="CENTER">
<td>[Wilbert]</td>
<td>[%player_name%]</td>
</tr>
<tr align="CENTER">
<td>%npc_card%</td>
<td>%player_card%</td>
</tr>
</table>

View File

@ -156,6 +156,7 @@ import quests.Q00648_AnIceMerchantsDream.Q00648_AnIceMerchantsDream;
import quests.Q00650_ABrokenDream.Q00650_ABrokenDream;
import quests.Q00652_AnAgedExAdventurer.Q00652_AnAgedExAdventurer;
import quests.Q00662_AGameOfCards.Q00662_AGameOfCards;
import quests.Q00663_SeductiveWhispers.Q00663_SeductiveWhispers;
import quests.Q00688_DefeatTheElrokianRaiders.Q00688_DefeatTheElrokianRaiders;
import quests.Q00757_TriolsMovement.Q00757_TriolsMovement;
import quests.Q00760_BlockTheExit.Q00760_BlockTheExit;
@ -479,6 +480,7 @@ public class QuestMasterHandler
Q00650_ABrokenDream.class,
Q00652_AnAgedExAdventurer.class,
Q00662_AGameOfCards.class,
Q00663_SeductiveWhispers.class,
Q00688_DefeatTheElrokianRaiders.class,
Q00757_TriolsMovement.class,
Q00760_BlockTheExit.class,