Coins of Magic
- ID
- 336
- Название
- Coins of Magic
- start_npcs_json
- [30232]
- npc_ids_json
- [20146,20161,20235,20240,20245,20568,20569,20572,20575,20583,20584,20585,20587,20604,20644,20645,20663,20674,20678,20685,20954,20957,20959,20960,21003,21006,21008,21274,21275,21276,21278,21279,21280,21282,21283,21284,21286,21287,21288,21521,21526,21531,21539,30078,30092,30165,30183,30200,30232,30673,30688,30696,30702,30847]
- constants_json
- {"COIN_DIAGRAM":3811,"KALDIS_COIN":3812,"MEMBERSHIP_1":3813,"MEMBERSHIP_2":3814,"MEMBERSHIP_3":3815,"BLOOD_MEDUSA":3472,"BLOOD_WEREWOLF":3473,"BLOOD_BASILISK":3474,"BLOOD_DREVANUL":3475,"BLOOD_SUCCUBUS":3476,"GOLD_WYVERN":3482,"GOLD_KNIGHT":3483,"GOLD_GIANT":3484,"GOLD_DRAKE":3485,"GOLD_WYRM":3486,"SILVER_UNICORN":3490,"SILVER_FAIRY":3491,"SILVER_DRYAD":3492,"SILVER_GOLEM":3494,"SILVER_UNDINE":3495,"SORINT":30232,"BERNARD":30702,"PAGE":30696,"HAGGER":30183,"STAN":30200,"RALFORD":30165,"FERRIS":30847,"COLLOB":30092,"PANO":30078,"DUNING":30688,"LORAIN":30673,"TIMAK_ORC_ARCHER":20584,"TIMAK_ORC_SOLDIER":20585,"TIMAK_ORC_SHAMAN":20587,"LAKIN":20604,"TORTURED_UNDEAD":20678,"HATAR_HANISHEE":20663,"SHACKLE":20235,"TIMAK_ORC":20583,"HEADLESS_KNIGHT":20146,"ROYAL_CAVE_SERVANT":20240,"MALRUK_SUCCUBUS_TUREN":20245,"FORMOR":20568,"FORMOR_ELDER":20569,"VANOR_SILENOS_SHAMAN":20685,"TARLK_BUGBEAR_HIGH_WARRIOR":20572,"OEL_MAHUM":20161,"OEL_MAHUM_WARRIOR":20575,"HARIT_LIZARDMAN_MATRIARCH":20645,"HARIT_LIZARDMAN_SHAMAN":20644,"GRAVE_LICH":21003,"DOOM_SERVANT":21006,"DOOM_ARCHER":21008,"DOOM_KNIGHT":20674,"KOOKABURRA2":21276,"KOOKABURRA3":21275,"KOOKABURRA4":21274,"ANTELOPE2":21278,"ANTELOPE3":21279,"ANTELOPE4":21280,"BANDERSNATCH2":21282,"BANDERSNATCH3":21284,"BANDERSNATCH4":21283,"BUFFALO2":21287,"BUFFALO3":21288,"BUFFALO4":21286,"CLAWS_OF_SPLENDOR":21521,"WISDOM_OF_SPLENDOR":21526,"PUNISHMENT_OF_SPLENDOR":21531,"WAILING_OF_SPLENDOR":21539,"HUNGERED_CORPSE":20954,"BLOODY_GHOST":20960,"NIHIL_INVADER":20957,"DARK_GUARD":20959}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00336_CoinsOfMagic/Q00336_CoinsOfMagic.java
NPC квеста
| ID | Название | Старт квеста | Уровень |
|---|---|---|---|
| 20146 | Headless Knight | Нет | 50 |
| 20161 | Oel Mahum | Нет | 53 |
| 20235 | Shackle | Нет | 45 |
| 20240 | Royal Cave Servant | Нет | 51 |
| 20245 | Malruk Succubus Turen | Нет | 56 |
| 20568 | Formor | Нет | 45 |
| 20569 | Formor Elder | Нет | 46 |
| 20572 | Tarlk Bugbear High Warrior | Нет | 49 |
| 20575 | Oel Mahum Warrior | Нет | 54 |
| 20583 | Timak Orc | Нет | 40 |
| 20584 | Timak Orc Archer | Нет | 41 |
| 20585 | Timak Orc Soldier | Нет | 42 |
| 20587 | Timak Orc Shaman | Нет | 44 |
| 20604 | Lakin | Нет | 44 |
| 20644 | Harit Lizardman Shaman | Нет | 54 |
| 20645 | Harit Lizardman Matriarch | Нет | 55 |
| 20663 | Hatar Hanishee | Нет | 49 |
| 20674 | Doom Knight | Нет | 65 |
| 20678 | Tortured Undead | Нет | 53 |
| 20685 | Vanor Silenos Shaman | Нет | 49 |
| 20954 | Hungered Corpse | Нет | 60 |
| 20957 | Nihil Invader | Нет | 66 |
| 20959 | Dark Guard | Нет | 70 |
| 20960 | Bloody Ghost | Нет | 64 |
| 21003 | Grave Lich | Нет | 57 |
| 21006 | Doom Servant | Нет | 60 |
| 21008 | Doom Archer | Нет | 62 |
| 21274 | Kookaburra | Нет | 67 |
| 21275 | Kookaburra | Нет | 67 |
| 21276 | Kookaburra | Нет | 67 |
| 21278 | Antelope | Нет | 68 |
| 21279 | Antelope | Нет | 68 |
| 21280 | Antelope | Нет | 68 |
| 21282 | Bandersnatch | Нет | 69 |
| 21283 | Bandersnatch | Нет | 69 |
| 21284 | Bandersnatch | Нет | 69 |
| 21286 | Buffalo | Нет | 70 |
| 21287 | Buffalo | Нет | 70 |
| 21288 | Buffalo | Нет | 70 |
| 21521 | Claws of Splendor | Нет | 60 |
| 21526 | Wisdom of Splendor | Нет | 62 |
| 21531 | Punishment of Splendor | Нет | 64 |
| 21539 | Wailing of Splendor | Нет | 67 |
| 30078 | Pano | Нет | 70 |
| 30092 | Collob | Нет | 70 |
| 30165 | Ralford | Нет | 70 |
| 30183 | Hagger | Нет | 70 |
| 30200 | Stan | Нет | 80 |
| 30232 | Sorint | Да | 70 |
| 30673 | Lorain | Нет | 70 |
| 30688 | Duning | Нет | 70 |
| 30696 | Page | Нет | 70 |
| 30702 | Bernard | Нет | 70 |
| 30847 | Ferris | Нет | 70 |
Условия уровней: выражения из Java
if (st.getPlayer().getLevel() < 40) final int chance = (npc.getLevel() + (grade * 3)) - 20;
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, COIN_DIAGRAM, 1); giveItems(player, COIN_DIAGRAM + grade, 1); giveItems(player, MEMBERSHIP_3, 1); giveItems(player, KALDIS_COIN, 1); giveItems(player, e[1], 1); // giveItems(player, getRandomEntry(BASIC_COINS), 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[30078-01.htm] Grocer Pano: I operate this grocery store and my hobby has reached this point... Wait here a moment... Ah, right. Here it is. OK, and here are the coins that I have... I am collecting Blood Succubus, Blood Basilisk, Silver Dryad, Silver Undine, Gold Giant and Gold Wyrms. Would you like to choose from things that I have? Trade at set ratio.
[30078-54.htm] Grocer Pano: You need to go find a level 2 or level 3 member. I'm sorry, but a level 1 member can only deal with other level 1 members... And if I violate this, I could be kicked out of the guild...
[30092-01.htm] Warehouse Keeper Collob: Please wait a moment. I definitely stored it here somewhere... Ah, right. Here it is. OK, and here are the coins that I have... I want blood succubus, blood basilisk, silver dryad, silver undine, gold giant and gold wyrms. Would you like to choose? Trade at set ratio.
[30092-54.htm] Warehouse Keeper Collob: I'm sorry but I'm a level 1 member... I can't trade with level 2 or level 3 members. It doesn't matter that you are a regular customer at my warehouse... I'm sorry.
[30165-01.htm] Magic Trader Ralford: Isn't the power of magic great? It turned this item into such a beautiful object. Although I'm just a simple trader, I can't help but bow my head to such a masterpiece... By the way what would you like to trade for it? All I have are these coins... and, if you would like to trade with me, you will need Gold Drake, Gold Knight, Silver Golem, Blood Drevanuls, Blood Werewolf and Silver Fairies. Take a look at my items and make a choice. Trade at set ratio.
[30165-54.htm] Magic Trader Ralford: Ah, I'm only a 2nd grade member and therefore cannot trade with you... Go look for Sorceress Page of the Hunters' Village or Researcher Lorain near the Cruma Tower or Warehouse Keeper Hagger located in Oren Castle Town. They will trade with a grade 3 member.
[30183-01.htm] Warehouse Keeper Hagger: To tell you about myself, I can say that I was one of the initial members of the coin collecting club. Other folks made fun of me for gathering various things, but I was simply collecting coins. However... Due to a number of different reasons, I'm still at level 3... OK, OK. Take a look at the coin list that I boast of. If there's something you'd like to exchange, please bring me Silver Unicorn, Gold Wyvern or Blood Medusa coins. Trade at set ratio.
[30200-01.htm] Guard Stan: I had my own reason to apply for the guard position. While I stand here on my guard duty, I have the chance to meet with people from all over the world, and this gives me the opportunity to collect rare coins. Heh heh heh. By the way, what would you like to trade with? These are all the coins I have... Also if you would like to trade with me, you will need Blood Werewolf, Blood Drevanul, Gold knight, Gold Drake, Silver Golem or Silver Fairy. Make your choice from what I have. Trade at set ratio.
[30200-54.htm] Guard Stan: Oh, I'm sorry but... I'm only a 2nd grade member and therefore cannot trade with a 3rd grade member like you... Why don't you go look for Sorceress Page, Researcher Lorain or Warehouse Keeper Hagger. They will trade with a grade 3 member.
[30232-01.htm] Warehouse Keeper Sorint: Lately, I have been feeling weak and depressed. I have found an object I really would like to possess no matter what. But there is this fool who is insisting that it is a family heirloom without knowing its true value. Just because of a stupid man like that I cannot get a hold of this treasure... I feel very frustrated! If I ask someone who is more tactful than myself, perhaps, the person will obtain the item and bring it back to me... (Only a character of level 40 or above can take on this quest.)
[30232-02.htm] Warehouse Keeper Sorint: Vigorous yet cautious manner of walking... like that of a tiger! Sharp eyed like a hawk! You, must be an adventurer of considerable skills! Yes, someone like you must be able to help me. Please take pity on a poor man like me and help me out. I am having a lot of heartache because of this stubborn fellow. If you can obtain a small object and bring it to me, I will pay you a generous sum of reward money. Ask what you need to do to help him.
[30232-03.htm] Warehouse Keeper Sorint: You are a young man that I can count on! My first impressions about you was correct! Now then, I will go ahead and explain the details. You know Bernard, the president of the Hunters Guild in this town? He is showing off a coin that he claims to be a Coin of Luck. Actually the coin is called Kaldis Gold Dragon among us coin collectors. It is a very rare coin! Isn't it a shame that such a rare object is owned by a fool who does not understand its true value! So, I made an offer to Bernard. I would pay him a high price for giving it to me. But he stubbornly refused to hand over the coin to me. I would appreciate it if you could persuade him with some convincing words and bring back the coin to me. Tell him that you will bring back the coin. Tell him that you are not interested in doing such a work.
[30232-04.htm] Warehouse Keeper Sorint Oh my...! Did I judge you wrong? This cannot be... I'm very sure that you will come back to me. I can even bet on this Blood Succubus coin that I treasure very much!
[30232-05.htm] Warehouse Keeper Sorint: Go and meet with the Hunters Guild's president Bernard. Before you go, take this coin diagram. Take a look at the pictures in the book. This coin is the "kaldis gold dragon" I told you about. Bring back to me the coin that looks exactly like this. I will be waiting for you with a gift that will surprise you. So, please do not fail my expectations!
[30232-06.htm] Warehouse Keeper Sorint: So, where is my coin? What? You haven't gotten it yet? If you come back empty-handed, did you think that I would praise you?! What I want is the Kaldis Gold Gragon coin that Bernard has! It's not Blood DreVanul! It's not Silver Unicorn! It is the Gold! Dragon! Of Kaldis! Understand?!!!
[30232-07.htm] Warehouse Keeper Sorint: Ah! You brought it back for me! It's the Kaldis Gold Dragon coin! Oooh hee hee heee.... I'm happy!!! Sooo happy!!! My precious treasure! Please enter my collection box! Ahem...! Hey! Hmm... you are a really capable fellow. I was going to pay you some money to finish our transaction. But I changed my mind. Some one with your skill is sufficiently qualified to become our member! Here! This is the cc membership 3 everybody is wanting to have. What do you think? Aren't you happy? Well, ahem... I'm going to take another look at my new treasure... Ask him what good a cc membership 3 is for you.
[30232-08.htm] Warehouse Keeper Sorint: Why do you look so disappointed? You must not know how precious the membership card is! Do you think anybody can join our coin collection guild? Once you develop a taste for coin collecting, you will realize how valuable a membership card is. After collecting various coins, in order to trade your coins with other members, you are required to have a membership card! But, according to our rules, you cannot trade with a member whose grade is higher than yours. But as long as you continue to be active, I promise to raise your grade. So don't worry! Ah! One more thing. If you bring back your collected coins for each grade, you can exchange them with some great prize items I, Sorint prepared. This is a great opportunity that you shouldn't take for granted! Ask where you can obtain coins. Ask about the members of the coin collection guild.
[30232-09.htm] Warehouse Keeper Sorint: Is there anything I can help you with? Tell him that you would like to raise your membership grade. Ask where you can obtain coins. Ask about the members of the coin collection guild. Tell him that you would like to leave the guild.
[30232-10.htm] Warehouse Keeper Sorint: Do I know you? Oh! It's you. There are so many grade 3 members in our guild even I the president cannot remember everyone. Anyway, is there anything I can help you with? Tell him that you would like to raise your membership grade. Ask where you can obtain coins. Ask about the members of the coin collection guild. Tell him that you would like to leave the guild.
[30232-11.htm] Warehouse Keeper Sorint: It's been a long time since I saw you. So, have you obtained any new coins? Word has been spreading among members that you have been showing some great trade skills lately. Well, anyhow, is there anything I can help you with? Tell him that you would like to raise your membership grade. Ask where you can obtain coins. Ask about the members of the coin collection guild. Tell him that you would like to leave the guild.
[30232-12.htm] Warehouse Keeper Sorint: Hello there! An important person has come back! Since Grade 1 members have the privilege of dealing with many rare coins, many members are desiring to become Grade 1. However, the number of Grade 1 members is limited. To put it simply, I'm saying that Grade 1 membership is not given to just anybody who asks for it. Therefore, you should be extra careful in your words and deeds. Well now, is there anything I can help you with? Tell him that you would like to raise your membership grade. Ask where you can obtain coins. Ask about the members of the coin collection guild. Tell him that you would like to leave the guild.
[30232-13.htm] Warehouse Keeper Sorint: To improve your level you need 1 Gold knight, 1 Gold Drake, 1 Silver Fairy, 1 Silver Golem, 1 Blood Werewolf and 1 Blood Drevanul.
[30232-14.htm] Warehouse Keeper Sorint: To improve your level you need 1 Gold Wyrm, 1 Gold Giant, 1 Silver Dryad, 1 Silver Undine, 1 Blood Basilisk and 1 Blood Succubus.
[30232-15.htm] Warehouse Keeper Sorint: Ah, did I tell you about this? Soon, I plan to offer a special membership category for master coin collectors. Since I'm working on the conditions and benefits of this special membership, you can look forward to it. All grade 1 members will be given the first opportunity to become members of this special grade.
[30232-16.htm] Warehouse Keeper Sorint: I would like to express my respect for your indomitable will and tenacious spirit. On behalf of our coin collectors guild, I am presenting you with a cc membership 2. Congratulations!
[30232-17.htm] Warehouse Keeper Sorint: Ah...! Ah...!!! You really managed to collect all of the precious coins. I fill like crying... sniffle sniffle...! Ah, sorry. I'm making a fool of myself... Only a very few members successfully achieve grade 1 member status. Therefore, this is a great occasion for our coin collectors guild to celebrate. Congratulations!
[30232-18.htm] Warehouse Keeper Sorint: Leave? Do you really want to leave our coin collectors guild? The privilege of trading coins, and the benefits of exchanging coins for prize items... Are you really going to give all that up? Leave the coin collectors guild. Return
[30232-18a.htm] Warehouse Keeper Sorint: You must have just started to taste the fun of collecting coins and are already leaving... It's really regrettable. However, if this is really your intention, I cannot stop you.
[30232-22.htm] Warehouse Keeper Sorint: If you want to find rare coins, you should trade with other members. But you cannot start to trade until you have something to trade with, right? So, first, do your leg work to collect some coins. The hunters guild members are experts in finding hard to find items. So you can seek their help. You are already acquainted with the hunters guild president Bernard right? Return
[30232-23.htm] Warehouse Keeper Sorint: Ah, why don't I tell you who our current members are? First, there is Sorceress Page of the mystics guild in the Hunters' Village, Researcher Lorain who is located at the entrance of Cruma Tower, Warehouse Keeper Hagger of Oren Castle Town, Guard Stan of Oren Castle Town, Blacksmith Duning of the Hunters' Village, Trader Ralford at the basement of the Ivory Tower, Head Blacksmith Ferris of Aden Castle Town, Warehouse Keeper Collob who is located in front of the accessory store in Giran Castle Town and Grocer Pano in the square of Floran Village... Wow, now I realize that our members are spread out all over the place. But we still have a long way to go. My dream is that the coins we are collecting will become a secondary currency! Then everybody on the continent will become members of our club! Ha ha ha!! Won't that be great? Return
[30232-24.htm] Warehouse Keeper Sorint: You don't have any coin that meets our criteria of trading. I am sorry but I cannot trade with you.
[30232-24a.htm] Warehouse Keeper Sorint: Excellent choice! You made a very nice trade! Ah ah... my coins... they are so beautiful. Go ahead and enter my collection box!
[30673-01.htm] Researcher Lorain: I have been collecting coins like this for a while but I'm not sure whether it was the right thing to get into. I heard that quite a few people and their families became destitute after getting sucked into this collecting business. However, the more you look at coins the more you get absorbed by them... People say that whenever I exchange coins, it seems like my personality changes. Anyway, what did you say you wanted to trade with? These are all the coins I have... I mainly trade with the Gold Wyvern, Silver Unicorn and Blood Medusa. I also have: Trade at set ratio.
[30688-01.htm] Blacksmith Duning: I make various tools and artistic items while doing my blacksmith work but I haven't seen anything as beautiful as this coin. This seems to have the power of magic in addition to the human touch. But what do you want to exchange? You've nothing but this coin. And to exchange it with me, you'll still need gold drakes, gold knights, blood drevanuls, blood werewolves, silver golems and silver fairies. OK, choose one of these: Trade at set ratio.
[30688-54.htm] Blacksmith Duning: I'm a level 2 member... I can't trade with level 3 members. Go find Sorceress Page of Hunters Village, Investigator Lorain near Cruma Tower or Warehouse Keeper Hagger of Oren Castle Town.
[30696-01.htm] Sorcerer Page: Ah, you haven't been a member for long, I see. I'm sorry that you went to the trouble of coming this far...? Anyway, coin collection is really great. It's not difficult... And you can trade in a place like this... And if you do it for a long time you can get unexpected income, no? After all, that's what these coins are for. Take a look. If you want to trade, bring me a lot of Blood Medusas, Golden Wyverns and Silver Unicorns. Trade at set ratio.
[30702-01.htm] Bernard, Hunter Union President: Old man, you are incredibly stubborn... However, I inherited this valuable item from my ancestors and no matter what you say I cannot give it to you. Do you know the history behind this coin? This coin or the coins collected by Sorint are not just ordinary coins. Ask about the coin's history.
[30702-02.htm] Bernard, Hunter Union President: This coin is an object that a long time ago, mystics instilled magic into it so that the coin would shine in each mystic's unique color. These coins were crafted by the highest skilled dwarven artisans at the time. High level magic power was bestowed upon these coins to turn them into great works of art. According to legend, mystics used these coins as their own marks. A person who helped a mystic would be given a coin as a mark of gratitude and to the one who became an enemy to a mystic, a coin was given as the mark of a curse. Actually I heard that one of my ancestors did a favor for a mystic and received this coin. Later on, there was a time when mystics were misunderstood by people as demons and many of them were killed. The coins confiscated at that time were considered objects with the mystics' curses upon them and many of them were thrown out near the places where they were executed. Nowadays, these coins have become mere collectible items of ignorant people such as Sorint. "Where can I find a similar coin?" "What do you mean by collecting pretty coins?"
[30702-02a.htm] Bernard, Hunter Union President: The kaldis coin may be obtained from lizardmen in the Forest of Mirrors. Let me give you some advice. You'd better sever your relationship with people with strange hobbies such as Sorint! I heard that some people got totally wiped out financially after becoming addicted to coin collection!
[30702-03.htm] Bernard, Hunter Union President: One of my ancestors received this coin from someone named Kaldis. I heard that Kaldis was hiding out in the Forest of Mirrors during the time when mystics were being persecuted. However, he ended up being killed by lizardmen who inhabited the forest... If you go to this area and look for them perhaps you may stumble onto coins that are similar to this one. What do you think?
[30702-04.htm] Bernard, Hunter Union President: Do you think I am acquainted with such an ignorant person? Birds of a feather flock together. Anyway, one of my ancestors received this coin from someone named Kaldis. I heard that Kaldis was hiding out in the Forest of Mirrors during the time when mystics were being persecuted. However, he ended up being killed by lizardmen who inhabited the forest... If you go to this area and look for them perhaps you may stumble onto coins that are similar to this one. What do you think?
[30702-05.htm] Bernard, Hunter Union President: Oh, it's you again. Are you still wandering around looking for those weird looking coins? "Where will I be able to find the weird looking coins?"
[30702-06.htm] Bernard, Hunter Union President: To be honest with you... after you came to visit me, I was intrigued by what you said and did some research. By getting help from my union members, I found out the areas where the coins are discovered often. Let me see... What I have found out so far is that... Lakin and Vanor Silenos in the southern part of Aden, and Timak Orcs of northern Oren are in possession of these coins. Also, Bandits' Stronghold in Oren, the Cemetery of Kings in Aden and Dragon Valley are the places where the coins are often discovered.
[30847-01.htm] Head Blacksmith Ferris: I also became a level 1 member recently and so please do a good job on this. But what do you want to exchange? These are all the coins I have... And to exchange with me, you'll need blood succubus, blood basilisk, silver dryad, silver undine, gold giant and gold wyrms. OK, choose one of my coins? Trade at set ratio.
[30847-54.htm] Head Blacksmith Ferris: I'm a level 1 member... Therefore, I can only trade with other level 1 members... Don't be upset about it. You'll need to go find a member that can trade with you.
Исходник условий и наград (Java)
/*
* Copyright (c) 2013 L2jMobius
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package quests.Q00336_CoinsOfMagic;
import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.mechanics.script.Quest;
import org.l2jmobius.gameserver.mechanics.script.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
/**
* Adapted from FirstTeam Interlude
*/
public class Q00336_CoinsOfMagic extends Quest
{
private static final int COIN_DIAGRAM = 3811;
private static final int KALDIS_COIN = 3812;
private static final int MEMBERSHIP_1 = 3813;
private static final int MEMBERSHIP_2 = 3814;
private static final int MEMBERSHIP_3 = 3815;
private static final int BLOOD_MEDUSA = 3472;
private static final int BLOOD_WEREWOLF = 3473;
private static final int BLOOD_BASILISK = 3474;
private static final int BLOOD_DREVANUL = 3475;
private static final int BLOOD_SUCCUBUS = 3476;
private static final int GOLD_WYVERN = 3482;
private static final int GOLD_KNIGHT = 3483;
private static final int GOLD_GIANT = 3484;
private static final int GOLD_DRAKE = 3485;
private static final int GOLD_WYRM = 3486;
private static final int SILVER_UNICORN = 3490;
private static final int SILVER_FAIRY = 3491;
private static final int SILVER_DRYAD = 3492;
private static final int SILVER_GOLEM = 3494;
private static final int SILVER_UNDINE = 3495;
// private static final int[] BASIC_COINS =
// {
// BLOOD_MEDUSA,
// GOLD_WYVERN,
// SILVER_UNICORN
// };
private static final int SORINT = 30232;
private static final int BERNARD = 30702;
private static final int PAGE = 30696;
private static final int HAGGER = 30183;
private static final int STAN = 30200;
private static final int RALFORD = 30165;
private static final int FERRIS = 30847;
private static final int COLLOB = 30092;
private static final int PANO = 30078;
private static final int DUNING = 30688;
private static final int LORAIN = 30673;
private static final int TIMAK_ORC_ARCHER = 20584;
private static final int TIMAK_ORC_SOLDIER = 20585;
private static final int TIMAK_ORC_SHAMAN = 20587;
private static final int LAKIN = 20604;
private static final int TORTURED_UNDEAD = 20678;
private static final int HATAR_HANISHEE = 20663;
private static final int SHACKLE = 20235;
private static final int TIMAK_ORC = 20583;
private static final int HEADLESS_KNIGHT = 20146;
private static final int ROYAL_CAVE_SERVANT = 20240;
private static final int MALRUK_SUCCUBUS_TUREN = 20245;
private static final int FORMOR = 20568;
private static final int FORMOR_ELDER = 20569;
private static final int VANOR_SILENOS_SHAMAN = 20685;
private static final int TARLK_BUGBEAR_HIGH_WARRIOR = 20572;
private static final int OEL_MAHUM = 20161;
private static final int OEL_MAHUM_WARRIOR = 20575;
private static final int HARIT_LIZARDMAN_MATRIARCH = 20645;
private static final int HARIT_LIZARDMAN_SHAMAN = 20644;
private static final int GRAVE_LICH = 21003;
private static final int DOOM_SERVANT = 21006;
private static final int DOOM_ARCHER = 21008;
private static final int DOOM_KNIGHT = 20674;
private static final int KOOKABURRA2 = 21276;
private static final int KOOKABURRA3 = 21275;
private static final int KOOKABURRA4 = 21274;
private static final int ANTELOPE2 = 21278;
private static final int ANTELOPE3 = 21279;
private static final int ANTELOPE4 = 21280;
private static final int BANDERSNATCH2 = 21282;
private static final int BANDERSNATCH3 = 21284;
private static final int BANDERSNATCH4 = 21283;
private static final int BUFFALO2 = 21287;
private static final int BUFFALO3 = 21288;
private static final int BUFFALO4 = 21286;
private static final int CLAWS_OF_SPLENDOR = 21521;
private static final int WISDOM_OF_SPLENDOR = 21526;
private static final int PUNISHMENT_OF_SPLENDOR = 21531;
private static final int WAILING_OF_SPLENDOR = 21539;
private static final int HUNGERED_CORPSE = 20954;
private static final int BLOODY_GHOST = 20960;
private static final int NIHIL_INVADER = 20957;
private static final int DARK_GUARD = 20959;
// @formatter:off
private static final int[][] PROMOTE =
{
new int[0],
new int[0], {SILVER_DRYAD, BLOOD_BASILISK, BLOOD_SUCCUBUS, SILVER_UNDINE, GOLD_GIANT, GOLD_WYRM}, {BLOOD_WEREWOLF, GOLD_DRAKE, SILVER_FAIRY, BLOOD_DREVANUL, GOLD_KNIGHT, SILVER_GOLEM}
};
private static final int[][] EXCHANGE_LEVEL =
{
{PAGE, 3}, {LORAIN, 3}, {HAGGER, 3}, {RALFORD, 2}, {STAN, 2}, {DUNING, 2}, {FERRIS, 1}, {COLLOB, 1}, {PANO, 1}
};
private static final int[][] DROPLIST =
{
{TIMAK_ORC_ARCHER, BLOOD_MEDUSA}, {TIMAK_ORC_SOLDIER, BLOOD_MEDUSA}, {TIMAK_ORC_SHAMAN, 3472}, {LAKIN, 3472}, {TORTURED_UNDEAD, 3472}, {HATAR_HANISHEE, 3472}, {TIMAK_ORC, GOLD_WYVERN}, {SHACKLE, GOLD_WYVERN}, {HEADLESS_KNIGHT, GOLD_WYVERN},
{ROYAL_CAVE_SERVANT, GOLD_WYVERN}, {MALRUK_SUCCUBUS_TUREN, GOLD_WYVERN}, {FORMOR, SILVER_UNICORN}, {FORMOR_ELDER, SILVER_UNICORN}, {VANOR_SILENOS_SHAMAN, SILVER_UNICORN}, {TARLK_BUGBEAR_HIGH_WARRIOR, SILVER_UNICORN}, {OEL_MAHUM, SILVER_UNICORN}, {OEL_MAHUM_WARRIOR, SILVER_UNICORN}
};
private static final int[] MONSTERS =
{
GRAVE_LICH, DOOM_SERVANT, DOOM_ARCHER, DOOM_KNIGHT, KOOKABURRA2, KOOKABURRA3, KOOKABURRA4, ANTELOPE2, ANTELOPE3, ANTELOPE4, BANDERSNATCH2, BANDERSNATCH3, BANDERSNATCH4, BUFFALO2, BUFFALO3, BUFFALO4, CLAWS_OF_SPLENDOR, WISDOM_OF_SPLENDOR, PUNISHMENT_OF_SPLENDOR, WAILING_OF_SPLENDOR, HUNGERED_CORPSE, BLOODY_GHOST, NIHIL_INVADER, DARK_GUARD
};
// @formatter:on
public Q00336_CoinsOfMagic()
{
super(336, "Coins of Magic");
addStartNpc(SORINT);
addTalkId(SORINT, BERNARD, PAGE, HAGGER, STAN, RALFORD, FERRIS, COLLOB, PANO, DUNING, LORAIN);
for (int[] mob : DROPLIST)
{
addKillId(mob[0]);
}
addKillId(MONSTERS);
addKillId(HARIT_LIZARDMAN_MATRIARCH);
addKillId(HARIT_LIZARDMAN_SHAMAN);
registerQuestItems(COIN_DIAGRAM, KALDIS_COIN, MEMBERSHIP_1, MEMBERSHIP_2, MEMBERSHIP_3);
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
String htmltext = event;
final QuestState st = getQuestState(player, false);
if (st == null)
{
return htmltext;
}
final int cond = st.getCond();
if ("30702-06.htm".equals(event))
{
if (cond < 7)
{
st.setCond(7);
playSound(player, QuestSound.ITEMSOUND_QUEST_ACCEPT);
}
}
else if ("30232-22.htm".equals(event))
{
if (cond < 6)
{
st.setCond(6);
}
}
else if ("30232-23.htm".equals(event))
{
if (cond < 5)
{
st.setCond(5);
}
}
else if ("30702-02.htm".equals(event))
{
st.setCond(2);
}
else if ("30232-05.htm".equals(event))
{
st.startQuest();
giveItems(player, COIN_DIAGRAM, 1);
}
else if ("30232-04.htm".equals(event) || "30232-18a.htm".equals(event))
{
st.exitQuest(true);
playSound(player, QuestSound.ITEMSOUND_QUEST_GIVEUP);
}
else if ("raise".equals(event))
{
htmltext = promote(st);
}
return htmltext;
}
private String promote(QuestState st)
{
final int grade = st.getInt("grade");
String html;
if (grade == 1)
{
html = "30232-15.htm";
}
else
{
int h = 0;
for (int i : PROMOTE[grade])
{
if (getQuestItemsCount(st.getPlayer(), i) > 0)
{
++h;
}
}
if (h == 6)
{
final Player player = st.getPlayer();
for (int i : PROMOTE[grade])
{
takeItems(player, i, 1);
}
html = "30232-" + (19 - grade) + ".htm";
takeItems(player, KALDIS_COIN + grade, -1);
giveItems(player, COIN_DIAGRAM + grade, 1);
st.set("grade", String.valueOf(grade - 1));
if (grade == 3)
{
st.setCond(9);
}
else if (grade == 2)
{
st.setCond(11);
}
playSound(player, QuestSound.ITEMSOUND_QUEST_FANFARE_MIDDLE);
}
else
{
html = "30232-" + (16 - grade) + ".htm";
if (grade == 3)
{
st.setCond(8);
}
else if (grade == 2)
{
st.setCond(9);
}
}
}
return html;
}
@Override
public String onTalk(Npc npc, Player player)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = getQuestState(player, true);
final int npcId = npc.getId();
final int id = st.getState();
final int grade = st.getInt("grade");
switch (npcId)
{
case SORINT:
{
if (id == State.CREATED)
{
if (st.getPlayer().getLevel() < 40)
{
htmltext = "30232-01.htm";
st.exitQuest(true);
}
else
{
htmltext = "30232-02.htm";
}
}
else if (getQuestItemsCount(player, COIN_DIAGRAM) > 0)
{
if (getQuestItemsCount(player, KALDIS_COIN) > 0)
{
takeItems(player, KALDIS_COIN, -1);
takeItems(player, COIN_DIAGRAM, -1);
giveItems(player, MEMBERSHIP_3, 1);
st.set("grade", "3");
st.setCond(4);
playSound(player, QuestSound.ITEMSOUND_QUEST_FANFARE_MIDDLE);
htmltext = "30232-07.htm";
}
else
{
htmltext = "30232-06.htm";
}
}
else if (grade == 3)
{
htmltext = "30232-12.htm";
}
else if (grade == 2)
{
htmltext = "30232-11.htm";
}
else if (grade == 1)
{
htmltext = "30232-10.htm";
}
break;
}
case BERNARD:
{
if ((getQuestItemsCount(player, COIN_DIAGRAM) > 0) && (grade == 0))
{
htmltext = "30702-01.htm";
}
else if (grade == 3)
{
htmltext = "30702-05.htm";
}
break;
}
default:
{
for (int[] e : EXCHANGE_LEVEL)
{
if ((npcId == e[0]) && (grade <= e[1]))
{
htmltext = npcId + "-01.htm";
}
}
break;
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player player, boolean isPet)
{
final QuestState st = getQuestState(player, false);
if ((st == null) || !st.isStarted())
{
return;
}
final int cond = st.getCond();
final int npcId = npc.getId();
if ((npcId == HARIT_LIZARDMAN_MATRIARCH) || (npcId == HARIT_LIZARDMAN_SHAMAN))
{
if ((cond == 2) && (getRandom(1000) < 63))
{
giveItems(player, KALDIS_COIN, 1);
st.setCond(3);
}
return;
}
final int grade = st.getInt("grade");
final int chance = (npc.getLevel() + (grade * 3)) - 20;
for (int[] e : DROPLIST)
{
if (e[0] == npcId)
{
if (getRandom(100) < chance)
{
giveItems(player, e[1], 1);
}
return;
}
}
// TODO: getBaseHpConsumeRate was 0.
// for (int u : MONSTERS)
// {
// if (u == npcId)
// {
// if (getRandom(100) < (chance * npc.getTemplate().getBaseHpConsumeRate()))
// {
// giveItems(player, getRandomEntry(BASIC_COINS), 1);
// }
// return null;
// }
// }
}
}