diff --git a/scripts/npc/1002000.js b/scripts/npc/1002000.js index 0a50b8b57a..15e85cf9ff 100644 --- a/scripts/npc/1002000.js +++ b/scripts/npc/1002000.js @@ -2,7 +2,7 @@ var status = 0; var imaps = [104000000, 102000000, 100000000, 101000000, 103000000, 120000000, 105040300]; var maps = [102000000, 100000000, 101000000, 103000000, 120000000]; var cost = [1000, 1000, 800, 1000, 800]; -var townText = [["The town you are at is Lith Harbor! Alright I'll explain to you more about #bLith Harbor#k. It's the place you landed on Victoria Island by riding The Victoria. That's Lith Harbor. A lot of beginners who just got here from Maple Island start their journey here.", "It's a quiet town with the wide body of water on the back of it, thanks to the fact that the harbor is located at the west end of the island. Most of the people here are, or used to be fisherman, so they may look intimidating, but if you strike up a conversation with them, they'll be friendly to you.", "Around town lies a beautiful prairie. Most of the monsters there are small and gentle, perfect for beginners. If you haven't chosen your job yet, this is a good place to boost up your level."],["Alright I'll explain to you more about #bPerion#k. It's a warrior-town located at the northern-most part of Victoria Island, surrounded by rocky mountains. With an unfriendly atmosphere, only the strong survives there.", "Around the highland you'll find a really skinny tree, a wild hog running around the place, and monkeys that live all over the island. There's also a deep valley, and when you go deep into it, you'll find a humongous dragon with the power to match his size. Better go in there very carefully, or don't go at all.", "If you want to be a #bWarrior#k then find #rDances with Balrog#k, the chief of Perion. If you're level 10 or higher, along with a good STR level, he may make you a warrior after all. If not, better keep training yourself until you reach that level."], ["Alright I'll explain to you more about #bEllinia#k. It's a magician-town located at the far east of Victoria Island, and covered in tall, mystic trees. You'll find some fairies there, too. They don't like humans in general so it'll be best for you to be on their good side and stay quiet.", "Near the forest you'll find green slimes, walking mushrooms, monkeys and zombie monkeys all residing there. Walk deeper into the forest and you'll find witches with the flying broomstick navigating the skies. A word of warning: Unless you are really strong, I recommend you don't go near them.", "If you want to be a #bMagician#k, search for #rGrendel the Really Old#k, the head wizard of Ellinia. He may make you a wizard if you're at or above level 8 with a decent amount of INT. If that's not the case, you may have to hunt more and train yourself to get there."], ["Alright I'll explain to you more about #bHenesys#k. It's a bowman-town located at the southernmost part of the island, made on a flatland in the midst of a deep forest and prairies. The weather's just right, and everything is plentiful around that town, perfect for living. Go check it out.", "Around the prairie you'll find weak monsters such as snails, mushrooms, and pigs. According to what I hear, though, in the deepest part of the Pig Park, which is connected to the town somewhere, you'll find a humongous, powerful mushroom called Mushmom every now and then.", "If you want to be a #bBowman#k, you need to go see #rAthena Pierce#k at Henesys. With a level at or above 10 and a decent amount of DEX, she may make you be one afterall. If not, go train yourself, make yourself stronger, then try again."], ["Alright I'll explain to you more about #bKerning City#k. It's a thief-town located at the northwest part of Victoria Island, and there are buildings up there that have just this strange feeling around them. It's mostly covered in black clouds, but if you can go up to a really high place, you'll be able to see a very beautiful sunset there.", "From Kerning City, you can go into several dungeons. You can go to a swamp where alligators and snakes are abound, or hit the subway full of ghosts and bats. At the deepest part of the underground, you'll find Lace, who is just as big and dangerous as a dragon.", "If you want to be a #bThief#k, seek #rDark Lord#k, the heart of darkness of Kerning City. He may well make you a thief if you're at or above level 10 with a good amount of DEX. If not, go hunt and train yourself to reach there."], ["Here's a little information on #b#m120000000##k. It's a submarine that's currently parked in between Ellinia and Henesys in Victoria Island. That submarine serves as home to numerous pirates. You can have just as beautiful a view of the ocean there as you do here in Lith Harbor.", "#m120000000# is parked in between Henesys and Ellinia, so if you step out just a bit, you'll be able to enjoy the view of both towns. All the pirates you'll meet in town are very gregarious and friendly as well.", "If you are serious about becoming a #bPirate#k, then you better meet the captain of #m120000000#, #r#p1090000##k. If you are over Level 10 with 20 DEX, then she may let you become one. If you aren't up to that level, then you'll need to train harder to get there!"], ["Alright I'll explain to you more about #bSleepywood#k. It's a forest town located at the southeast side of Victoria Island. It's pretty much in between Henesys and the ant-tunnel dungeon. There's a hotel there, so you can rest up after a long day at the dungeon ... it's a quiet town in general.", "In front of the hotel there's an old buddhist monk by the name of #rChrishrama#k. Nobody knows a thing about that monk. Apparently he collects materials from the travelers and create something, but I am not too sure about the details. If you have any business going around that area, please check that out for me.", "From Sleepywood, head east and you'll find the ant tunnel connected to the deepest part of the Victoria Island. Lots of nasty, powerful monsters abound so if you walk in thinking it's a walk in the park, you'll be coming out as a corpse. You need to fully prepare yourself for a rough ride before going in.", "And this is what I hear ... apparently, at Sleepywood there's a secret entrance leading you to an unknown place. Apparently, once you move in deep, you'll find a stack of black rocks that actually move around. I want to see that for myself in the near future ..."]]; +var townText = [["The town you are at is Lith Harbor! Alright I'll explain to you more about #bLith Harbor#k. It's the place you landed on Victoria Island by riding The Victoria. That's Lith Harbor. A lot of beginners who just got here from Maple Island start their journey here.", "It's a quiet town with the wide body of water on the back of it, thanks to the fact that the harbor is located at the west end of the island. Most of the people here are, or used to be fisherman, so they may look intimidating, but if you strike up a conversation with them, they'll be friendly to you.", "Around town lies a beautiful prairie. Most of the monsters there are small and gentle, perfect for beginners. If you haven't chosen your job yet, this is a good place to boost up your level."], ["Alright I'll explain to you more about #bPerion#k. It's a warrior-town located at the northern-most part of Victoria Island, surrounded by rocky mountains. With an unfriendly atmosphere, only the strong survives there.", "Around the highland you'll find a really skinny tree, a wild hog running around the place, and monkeys that live all over the island. There's also a deep valley, and when you go deep into it, you'll find a humongous dragon with the power to match his size. Better go in there very carefully, or don't go at all.", "If you want to be a #bWarrior#k then find #rDances with Balrog#k, the chief of Perion. If you're level 10 or higher, along with a good STR level, he may make you a warrior after all. If not, better keep training yourself until you reach that level."], ["Alright I'll explain to you more about #bEllinia#k. It's a magician-town located at the far east of Victoria Island, and covered in tall, mystic trees. You'll find some fairies there, too. They don't like humans in general so it'll be best for you to be on their good side and stay quiet.", "Near the forest you'll find green slimes, walking mushrooms, monkeys and zombie monkeys all residing there. Walk deeper into the forest and you'll find witches with the flying broomstick navigating the skies. A word of warning: Unless you are really strong, I recommend you don't go near them.", "If you want to be a #bMagician#k, search for #rGrendel the Really Old#k, the head wizard of Ellinia. He may make you a wizard if you're at or above level 8 with a decent amount of INT. If that's not the case, you may have to hunt more and train yourself to get there."], ["Alright I'll explain to you more about #bHenesys#k. It's a bowman-town located at the southernmost part of the island, made on a flatland in the midst of a deep forest and prairies. The weather's just right, and everything is plentiful around that town, perfect for living. Go check it out.", "Around the prairie you'll find weak monsters such as snails, mushrooms, and pigs. According to what I hear, though, in the deepest part of the Pig Park, which is connected to the town somewhere, you'll find a humongous, powerful mushroom called Mushmom every now and then.", "If you want to be a #bBowman#k, you need to go see #rAthena Pierce#k at Henesys. With a level at or above 10 and a decent amount of DEX, she may make you be one afterall. If not, go train yourself, make yourself stronger, then try again."], ["Alright I'll explain to you more about #bKerning City#k. It's a thief-town located at the northwest part of Victoria Island, and there are buildings up there that have just this strange feeling around them. It's mostly covered in black clouds, but if you can go up to a really high place, you'll be able to see a very beautiful sunset there.", "From Kerning City, you can go into several dungeons. You can go to a swamp where alligators and snakes are abound, or hit the subway full of ghosts and bats. At the deepest part of the underground, you'll find Lace, who is just as big and dangerous as a dragon.", "If you want to be a #bThief#k, seek #rDark Lord#k, the heart of darkness of Kerning City. He may well make you a thief if you're at or above level 10 with a good amount of DEX. If not, go hunt and train yourself to reach there."], ["Here's a little information on #b#m120000000##k. It's a submarine that's currently parked in between Ellinia and Henesys in Victoria Island. That submarine serves as home to numerous pirates. You can have just as beautiful a view of the ocean there as you do here in Lith Harbor.", "#m120000000# is parked in between Henesys and Ellinia, so if you step out just a bit, you'll be able to enjoy the view of both towns. All the pirates you'll meet in town are very gregarious and friendly as well.", "If you are serious about becoming a #bPirate#k, then you better meet the captain of #m120000000#, #r#p1090000##k. If you are over Level 10 with 20 DEX, then she may let you become one. If you aren't up to that level, then you'll need to train harder to get there!"], ["Alright I'll explain to you more about #bSleepywood#k. It's a forest town located at the southeast side of Victoria Island. It's pretty much in between Henesys and the ant-tunnel dungeon. There's a hotel there, so you can rest up after a long day at the dungeon ... it's a quiet town in general.", "In front of the hotel there's an old buddhist monk by the name of #rChrishrama#k. Nobody knows a thing about that monk. Apparently he collects materials from the travelers and create something, but I am not too sure about the details. If you have any business going around that area, please check that out for me.", "From Sleepywood, head east and you'll find the ant tunnel connected to the deepest part of the Victoria Island. Lots of nasty, powerful monsters abound so if you walk in thinking it's a walk in the park, you'll be coming out as a corpse. You need to fully prepare yourself for a rough ride before going in.", "And this is what I hear ... apparently, at Sleepywood there's a secret entrance leading you to an unknown place. Apparently, once you move in deep, you'll find a stack of black rocks that actually move around. I want to see that for myself in the near future ..."]]; var selectedMap = -1; var town = false; @@ -12,51 +12,56 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if((mode == 0 && !town) || mode == -1){ - if(type == 1 && mode != -1) + if (mode != 1) { + if ((mode == 0 && !town) || mode == -1) { + if (type == 1 && mode != -1) { cm.sendNext("There's a lot to see in this town, too. Let me know if you want to go somewhere else."); + } cm.dispose(); return; - }else { + } else { status -= 2; - - if(status < 1) { + + if (status < 1) { cm.dispose(); return; } } - + } - if (status == 1) + if (status == 1) { cm.sendSimple("It's understandable that you may be confused about this place if this is your first time around. If you got any questions about this place, fire away.\r\n#L0##bWhat kind of towns are here in Victoria Island?#l\r\n#L1#Please take me somewhere else.#k#l"); - else if (status == 2){ - if (selection == 0){ + } else if (status == 2) { + if (selection == 0) { town = true; var text = "There are 7 big towns here in Victoria Island. Which of those do you want to know more of?#b"; - for(var i = 0; i < imaps.length; i++) + for (var i = 0; i < imaps.length; i++) { text += "\r\n#L" + i + "##m" + imaps[i] + "##l"; + } cm.sendSimple(text); - }else if (selection == 1) { + } else if (selection == 1) { var selStr = cm.getJobId() == 0 ? "There's a special 90% discount for all beginners. Alright, where would you want to go?#b" : "Oh you aren't a beginner, huh? Then I'm afraid I may have to charge you full price. Where would you like to go?#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cost[i] / (cm.getJobId() == 0 ? 10 : 1)) + " mesos)#l"; + } cm.sendSimple(selStr); } - } else if (town){ - if (selectedMap == -1) + } else if (town) { + if (selectedMap == -1) { selectedMap = selection; - if(status == 3) - cm.sendNext(townText[selectedMap][status-3]); - else - townText[selectedMap][status-3] == undefined ? cm.dispose() : cm.sendNextPrev(townText[selectedMap][status-3]); - }else if(status == 3){ + } + if (status == 3) { + cm.sendNext(townText[selectedMap][status - 3]); + } else { + townText[selectedMap][status - 3] == undefined ? cm.dispose() : cm.sendNextPrev(townText[selectedMap][status - 3]); + } + } else if (status == 3) { selectedMap = selection; cm.sendYesNo("I guess you don't need to be here. Do you really want to move to #b#m" + maps[selection] + "##k? Well it'll cost you #b" + (cost[selection] / (cm.getJobId() == 0 ? 10 : 1)) + " mesos#k. What do you think?"); - }else if (status == 4) { - if (cm.getMeso() < (cost[selectedMap] / (cm.getJobId() == 0 ? 10 : 1))) + } else if (status == 4) { + if (cm.getMeso() < (cost[selectedMap] / (cm.getJobId() == 0 ? 10 : 1))) { cm.sendNext("You don't have enough mesos. With your abilities, you should have more than that!"); - else { + } else { cm.gainMeso(-(cost[selectedMap] / (cm.getJobId() == 0 ? 10 : 1))); cm.warp(maps[selectedMap]); } diff --git a/scripts/npc/1002002.js b/scripts/npc/1002002.js index 2fba5a9035..56da2e857e 100644 --- a/scripts/npc/1002002.js +++ b/scripts/npc/1002002.js @@ -32,33 +32,39 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1) - if((mode == 0 && type == 1) || mode == -1 || (mode == 0 && status == 1)){ - if(type == 1) + if (mode != 1) { + if ((mode == 0 && type == 1) || mode == -1 || (mode == 0 && status == 1)) { + if (type == 1) { cm.sendNext("You must have some business to take care of here. You must be tired from all that traveling and hunting. Go take some rest, and if you feel like changing your mind, then come talk to me."); + } cm.dispose(); return; - } else + } else { status -= 2; - if (selection == 0) + } + } + if (selection == 0) { status++; - if(status == 1){ - if(selection == 1) + } + if (status == 1) { + if (selection == 1) { cm.sendYesNo("So you have a #bVIP Ticket to Florina Beach#k? You can always head over to Florina Beach with that. Alright then, but just be aware that you may be running into some monsters there too. Okay, would you like to head over to Florina Beach right now?"); - else if (selection == 2) + } else if (selection == 2) { cm.sendNext("You must be curious about a #bVIP Ticket to Florina Beach#k. Haha, that's very understandable. A VIP Ticket to Florina Beach is an item where as long as you have in possession, you may make your way to Florina Beach for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during my precious summer break."); - } else if (status == 2){ - if(type != 1 && selection != 0) { + } + } else if (status == 2) { + if (type != 1 && selection != 0) { cm.sendNextPrev("I came back without it, and it just feels awful not having it. Hopefully someone picked it up and put it somewhere safe. Anyway, this is my story and who knows, you may be able to pick it up and put it to good use. If you have any questions, feel free to ask."); - cm.dispose(); - } else{ - if (cm.getMeso() < 1500 && selection == 0) + cm.dispose(); + } else { + if (cm.getMeso() < 1500 && selection == 0) { cm.sendNext("I think you're lacking mesos. There are many ways to gather up some money, you know, like... selling your armor... defeating monsters... doing quests... you know what I'm talking about."); - else if(!cm.haveItem(4031134) && selection != 0){ + } else if (!cm.haveItem(4031134) && selection != 0) { cm.sendNext("Hmmm, so where exactly is your #bVIP Ticket to Florina\r\nBeach#k? Are you sure you have one? Please double-check."); - }else{ - if(selection == 0) + } else { + if (selection == 0) { cm.gainMeso(-1500); + } cm.getPlayer().saveLocation("FLORINA"); cm.warp(110000000, "st00"); } diff --git a/scripts/npc/1002003.js b/scripts/npc/1002003.js index 926a5fa3f8..57f96290e1 100644 --- a/scripts/npc/1002003.js +++ b/scripts/npc/1002003.js @@ -25,45 +25,46 @@ Description: Extends Buddy List */ var status = 0; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (status == 0 && mode == 0) { - cm.sendNext("I see... you don't have as many friends as I thought you would. Hahaha, just kidding! Anyway if you feel like changing your mind, please feel free to come back and we'll talk business. If you make a lot of friends, then you know ... hehe ..."); - cm.dispose(); - return; - } else if (status >= 1 && mode == 0) { - cm.sendNext("I see... I don't think you don't have as many friends as I thought you would. If not, you just don't have 240,000 mesos with you right this minute? Anyway, if you ever change your mind, come back and we'll talk business. That is, of course, once you have get some financial relief. .. hehe ..."); - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendYesNo("I hope I can make as much as yesterday... well, hello! Don't you want to extend your buddy list? You look like someone who'd have a whole lot of friends... well, what do you think? With some money I can make it happen for you. Remember, though, it only applies to one character at a time, so it won't affect any of your other characters on your account. Do you want to extend your buddy list?"); - } else if (status == 1) { - cm.sendYesNo("Alright, good call! It's not that expensive actually. #b240,000 mesos and I'll add 5 more slots to your buddy list#k. And no, I won't be selling them individually. Once you buy it, it's going to be permanently on your buddy list. So if you're one of those that needs more space there, then you might as well do it. What do you think? Will you spend 240,000 mesos for it?"); - } else if (status == 2) { - var capacity = cm.getPlayer().getBuddylist().getCapacity(); - if (capacity >= 50 || cm.getMeso() < 240000){ - cm.sendNext("Hey... are you sure you have #b240,000 mesos#k? If so, then check and see if you have extended your buddy list to the max. Even if you pay up, the most you can have on your buddy list is #b50#k."); + if (mode == -1) { + cm.dispose(); + } else { + if (status == 0 && mode == 0) { + cm.sendNext("I see... you don't have as many friends as I thought you would. Hahaha, just kidding! Anyway if you feel like changing your mind, please feel free to come back and we'll talk business. If you make a lot of friends, then you know ... hehe ..."); cm.dispose(); - } else { - var newcapacity = capacity + 5; - cm.gainMeso(-240000); - cm.getPlayer().setBuddyCapacity(newcapacity) - cm.sendOk("Alright! Your buddy list will have 5 extra slots by now. Check and see for it yourself. And if you still need more room on your buddy list, you know who to find. Of course, it isn't going to be for free ... well, so long ..."); - cm.dispose(); - } - } - } + return; + } else if (status >= 1 && mode == 0) { + cm.sendNext("I see... I don't think you don't have as many friends as I thought you would. If not, you just don't have 240,000 mesos with you right this minute? Anyway, if you ever change your mind, come back and we'll talk business. That is, of course, once you have get some financial relief. .. hehe ..."); + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendYesNo("I hope I can make as much as yesterday... well, hello! Don't you want to extend your buddy list? You look like someone who'd have a whole lot of friends... well, what do you think? With some money I can make it happen for you. Remember, though, it only applies to one character at a time, so it won't affect any of your other characters on your account. Do you want to extend your buddy list?"); + } else if (status == 1) { + cm.sendYesNo("Alright, good call! It's not that expensive actually. #b240,000 mesos and I'll add 5 more slots to your buddy list#k. And no, I won't be selling them individually. Once you buy it, it's going to be permanently on your buddy list. So if you're one of those that needs more space there, then you might as well do it. What do you think? Will you spend 240,000 mesos for it?"); + } else if (status == 2) { + var capacity = cm.getPlayer().getBuddylist().getCapacity(); + if (capacity >= 50 || cm.getMeso() < 240000) { + cm.sendNext("Hey... are you sure you have #b240,000 mesos#k? If so, then check and see if you have extended your buddy list to the max. Even if you pay up, the most you can have on your buddy list is #b50#k."); + cm.dispose(); + } else { + var newcapacity = capacity + 5; + cm.gainMeso(-240000); + cm.getPlayer().setBuddyCapacity(newcapacity) + cm.sendOk("Alright! Your buddy list will have 5 extra slots by now. Check and see for it yourself. And if you still need more room on your buddy list, you know who to find. Of course, it isn't going to be for free ... well, so long ..."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/1002004.js b/scripts/npc/1002004.js index 7c71b507cf..ebf9311c3b 100644 --- a/scripts/npc/1002004.js +++ b/scripts/npc/1002004.js @@ -20,14 +20,14 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - VIP Cab - Victoria Road : Lith Harbor (104000000) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + VIP Cab - Victoria Road : Lith Harbor (104000000) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var cost = 10000; @@ -38,21 +38,21 @@ function start() { function action(mode, type, selection) { status++; - if (mode == -1){ + if (mode == -1) { cm.dispose(); return; } else if (mode == 0) { cm.sendOk("This town also has a lot to offer. Find us if and when you feel the need to go to the Ant Tunnel Park."); - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 1) { cm.sendYesNo(cm.getJobId() == 0 ? "We have a special 90% discount for beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where the 24 Hr Mobile Store is. Would you like to go there for #b1,000 mesos#k?" : "The regular fee applies for all non-beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where 24 Hr Mobile Store is. Would you like to go there for #b10,000 mesos#k?"); cost /= ((cm.getJobId() == 0) ? 10 : 1); } else if (status == 2) { - if (cm.getMeso() < cost) + if (cm.getMeso() < cost) { cm.sendNext("It looks like you don't have enough mesos. Sorry but you won't be able to use this without it.") - else { + } else { cm.gainMeso(-cost); cm.warp(105070001); } diff --git a/scripts/npc/1002007.js b/scripts/npc/1002007.js index 73d17d4f89..beda2bfdd0 100644 --- a/scripts/npc/1002007.js +++ b/scripts/npc/1002007.js @@ -5,11 +5,11 @@ var selectedMap = -1; var mesos; function start() { - if (cm.hasItem(4032313,1)) { - cm.sendNext("I see that you have a coupon to go to Henesys. One moment, I'll bring you there right over!"); - } else { - cm.sendNext("Hello, I drive the Regular Cab. If you want to go from town to town safely and fast, then ride our cab. We'll glady take you to your destination with an affordable price."); - } + if (cm.hasItem(4032313, 1)) { + cm.sendNext("I see that you have a coupon to go to Henesys. One moment, I'll bring you there right over!"); + } else { + cm.sendNext("Hello, I drive the Regular Cab. If you want to go from town to town safely and fast, then ride our cab. We'll glady take you to your destination with an affordable price."); + } } function action(mode, type, selection) { @@ -24,41 +24,44 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { - if (cm.hasItem(4032313,1)) { + if (cm.hasItem(4032313, 1)) { cm.gainItem(4032313, -1); cm.warp(maps[0], 0); cm.dispose(); return; } - + var selStr = ""; - if (cm.getJobId() == 0) + if (cm.getJobId() == 0) { selStr += "We have a special 90% discount for beginners."; + } selStr += "Choose your destination, for fees will change from place to place.#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 2) { - cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); + cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); selectedMap = selection; } else if (status == 3) { if (cm.getJobId() == 0) { - mesos = cost[selectedMap] / 10; + mesos = cost[selectedMap] / 10; } else { - mesos = cost[selectedMap]; + mesos = cost[selectedMap]; } - + if (cm.getMeso() < mesos) { cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab."); cm.dispose(); return; } - + cm.gainMeso(-mesos); cm.warp(maps[selectedMap], 0); cm.dispose(); diff --git a/scripts/npc/1002100.js b/scripts/npc/1002100.js index 4a1d79114e..a99a71402a 100644 --- a/scripts/npc/1002100.js +++ b/scripts/npc/1002100.js @@ -22,51 +22,55 @@ // Jane the Alchemist var status = -1; var amount = -1; -var items = [[2000002,310],[2022003,1060],[2022000,1600],[2001000,3120]]; +var items = [[2000002, 310], [2022003, 1060], [2022000, 1600], [2001000, 3120]]; var item; function start() { - if (cm.isQuestCompleted(2013)) + if (cm.isQuestCompleted(2013)) { cm.sendNext("It's you ... thanks to you I was able to get a lot done. Nowadays I've been making a bunch of items. If you need anything let me know."); - else { - if (cm.isQuestCompleted(2010)) + } else { + if (cm.isQuestCompleted(2010)) { cm.sendNext("You don't seem strong enough to be able to purchase my potion ..."); - else + } else { cm.sendOk("My dream is to travel everywhere, much like you. My father, however, does not allow me to do it, because he thinks it's very dangerous. He may say yes, though, if I show him some sort of a proof that I'm not the weak girl that he thinks I am ..."); + } cm.dispose(); } } function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0 && type == 1) + if (mode != 1) { + if (mode == 0 && type == 1) { cm.sendNext("I still have quite a few of the materials you got me before. The items are all there so take your time choosing."); + } cm.dispose(); return; } - if (status == 0){ + if (status == 0) { var selStr = "Which item would you like to buy?#b"; - for (var i = 0; i < items.length; i++) + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##i" + items[i][0] + "# (Price : " + items[i][1] + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 1) { item = items[selection]; - var recHpMp = ["300 HP.","1000 HP.","800 MP","1000 HP and MP."]; + var recHpMp = ["300 HP.", "1000 HP.", "800 MP", "1000 HP and MP."]; cm.sendGetNumber("You want #b#t" + item[0] + "##k? #t" + item[0] + "# allows you to recover " + recHpMp[selection] + " How many would you like to buy?", 1, 1, 100); } else if (status == 2) { cm.sendYesNo("Will you purchase #r" + selection + "#k #b#t" + item[0] + "#(s)#k? #t" + item[0] + "# costs " + item[1] + " mesos for one, so the total comes out to be #r" + (item[1] * selection) + "#k mesos."); amount = selection; } else if (status == 3) { - if (cm.getMeso() < item[1] * amount) + if (cm.getMeso() < item[1] * amount) { cm.sendNext("Are you lacking mesos by any chance? Please check and see if you have an empty slot available at your etc. inventory, and if you have at least #r" + (item[1] * selectedItem) + "#k mesos with you."); - else { + } else { if (cm.canHold(item[0])) { cm.gainMeso(-item[1] * amount); cm.gainItem(item[0], amount); cm.sendNext("Thank you for coming. Stuff here can always be made so if you need something, please come again."); - } else + } else { cm.sendNext("Please check and see if you have an empty slot available at your etc. inventory."); + } } cm.dispose(); } diff --git a/scripts/npc/1012000.js b/scripts/npc/1012000.js index 9cd96cd7c9..08a21bddeb 100644 --- a/scripts/npc/1012000.js +++ b/scripts/npc/1012000.js @@ -20,34 +20,37 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { var selStr = ""; - if (cm.getJobId() == 0) + if (cm.getJobId() == 0) { selStr += "We have a special 90% discount for beginners."; + } selStr += "Choose your destination, for fees will change from place to place.#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 2) { - cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); + cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); selectedMap = selection; } else if (status == 3) { if (cm.getJobId() == 0) { - mesos = cost[selectedMap] / 10; + mesos = cost[selectedMap] / 10; } else { - mesos = cost[selectedMap]; + mesos = cost[selectedMap]; } - + if (cm.getMeso() < mesos) { cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab."); cm.dispose(); return; } - + cm.gainMeso(-mesos); cm.warp(maps[selectedMap], 0); cm.dispose(); diff --git a/scripts/npc/1012002.js b/scripts/npc/1012002.js index 90eb1193f3..22d2f235ae 100644 --- a/scripts/npc/1012002.js +++ b/scripts/npc/1012002.js @@ -44,151 +44,172 @@ var equip; function start() { cm.getPlayer().setCS(true); var selStr = "Hello. I am Vicious, retired Sniper. However, I used to be the top student of Athena Pierce. Though I no longer hunt, I can make some archer items that will be useful for you...#b" - var options = ["Create a bow","Create a crossbow","Make a glove","Upgrade a glove","Create materials","Create Arrows"]; - for (var i = 0; i < options.length; i++) + var options = ["Create a bow", "Create a crossbow", "Make a glove", "Upgrade a glove", "Create materials", "Create Arrows"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } cm.sendSimple(selStr); } function action(mode, type, selection) { status++; - if (mode != 1){ + if (mode != 1) { cm.dispose(); return; } if (status == 0) { if (selection == 0) { //bow refine var selStr = "I may have been a Sniper, but bows and crossbows aren't too much different. Anyway, which would you like to make?#b"; - items = [1452002,1452003,1452001,1452000,1452005,1452006,1452007]; - for (var i = 0; i < items.length; i++) + items = [1452002, 1452003, 1452001, 1452000, 1452005, 1452006, 1452007]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##k - Bowman Lv. " + (10 + (i * 5)) + "#l#b"; - }else if (selection == 1) { //xbow refine + } + } else if (selection == 1) { //xbow refine var selStr = "I was a Sniper. Crossbows are my specialty. Which would you like me to make for you?#b"; - items = [1462001,1462002,1462003,1462000,1462004,1462005,1462006,1462007]; - for (var i = 0; i < items.length; i++) + items = [1462001, 1462002, 1462003, 1462000, 1462004, 1462005, 1462006, 1462007]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##k - Bowman Lv. " + (10 + (i * 5)) + "#l#b"; - }else if (selection == 2) { //glove refine + } + } else if (selection == 2) { //glove refine var selStr = "Okay, so which glove do you want me to make?#b"; - items = [1082012,1082013,1082016,1082048,1082068,1082071,1082084,1082089]; - for (var i = 0; i < items.length; i++) - selStr += "\r\n#L" + i + "##t" + items[i] + "##k - Bowman Lv. " + (15 + (i * 5) > 40 ? ((i-1) * 10) : 15 + (i * 5)) + "#l#b"; - }else if (selection == 3) { //glove upgrade + items = [1082012, 1082013, 1082016, 1082048, 1082068, 1082071, 1082084, 1082089]; + for (var i = 0; i < items.length; i++) { + selStr += "\r\n#L" + i + "##t" + items[i] + "##k - Bowman Lv. " + (15 + (i * 5) > 40 ? ((i - 1) * 10) : 15 + (i * 5)) + "#l#b"; + } + } else if (selection == 3) { //glove upgrade var selStr = "Upgrade a glove? That shouldn't be too difficult. Which did you have in mind?#b"; - items = [1082015,1082014,1082017,1082018,1082049,1082050,1082069,1082070,1082072,1082073,1082085,1082083,1082090,1082091]; - for (var i = 0, x = 0; i < items.length; i++, x += (i+1) % 2 == 0 ? 1 : 0) - selStr += "\r\n#L" + i + "##t" + items[i] + "##k" + "##k - Bowman Lv. " + (20 + (x * 5) > 40 ? ((x-1) * 10) : 20 + (x * 5)) + "#l#b"; - }else if (selection == 4) { //material refine + items = [1082015, 1082014, 1082017, 1082018, 1082049, 1082050, 1082069, 1082070, 1082072, 1082073, 1082085, 1082083, 1082090, 1082091]; + for (var i = 0, x = 0; i < items.length; i++, x += (i + 1) % 2 == 0 ? 1 : 0) { + selStr += "\r\n#L" + i + "##t" + items[i] + "##k" + "##k - Bowman Lv. " + (20 + (x * 5) > 40 ? ((x - 1) * 10) : 20 + (x * 5)) + "#l#b"; + } + } else if (selection == 4) { //material refine var selStr = "Materials? I know of a few materials that I can make for you...#b"; - var materials = ["Make Processed Wood with Tree Branch","Make Processed Wood with Firewood","Make Screws (packs of 15)"]; - for (var i = 0; i < materials.length; i++) + var materials = ["Make Processed Wood with Tree Branch", "Make Processed Wood with Firewood", "Make Screws (packs of 15)"]; + for (var i = 0; i < materials.length; i++) { selStr += "\r\n#L" + i + "# " + materials[i] + "#l"; - }else if (selection == 5) { //arrow refine + } + } else if (selection == 5) { //arrow refine var selStr = "Arrows? Not a problem at all.#b"; - items = [2060000,2061000,2060001,2061001,2060002,2061002]; - for (var i = 0; i < items.length; i++) + items = [2060000, 2061000, 2060001, 2061001, 2060002, 2061002]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##l"; + } } selectedType = selection; cm.sendSimple(selStr); - if (selection != 4) + if (selection != 4) { status++; - }else if (status == 1) { + } + } else if (status == 1) { selectedItem = selection; - items = [4003001,4003001,4003000]; - var matSet = [4000003,4000018, [4011000,4011001]]; - var matQtySet = [10,5,[1,1]]; + items = [4003001, 4003001, 4003000]; + var matSet = [4000003, 4000018, [4011000, 4011001]]; + var matQtySet = [10, 5, [1, 1]]; item = items[selection]; mats = matSet[selection]; matQty = matQtySet[selection]; cost = 0; - cm.sendGetNumber("So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?",1,1,100) - }else if (status == 2) { - if (selectedType != 4) + cm.sendGetNumber("So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?", 1, 1, 100) + } else if (status == 2) { + if (selectedType != 4) { selectedItem = selection; - else - qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); // thanks br1337 for showing such a simple exploit with quantity on NPC crafters + } else { + qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } // thanks br1337 for showing such a simple exploit with quantity on NPC crafters if (selectedType == 0) { //bow refine - var matSet = [[4003001,4000000],[4011001,4003000],[4003001,4000016],[4011001,4021006,4003000],[4011001,4011006,4021003,4021006,4003000],[4011004,4021000,4021004,4003000],[4021008,4011001,4011006,4003000,4000014]]; - var matQtySet = [[5,30],[1,3],[30,50],[2,2,8],[5,5,3,3,30],[7,6,3,35],[1,10,3,40,50]]; - var costSet = [800,2000,3000,5000,30000,40000,80000]; - }else if (selectedType == 1) { //xbow refine - var matSet = [[4003001,4003000],[4011001,4003001,4003000],[4011001,4003001,4003000],[4011001,4021006,4021002,4003000],[4011001,4011005,4021006,4003001,4003000],[4021008,4011001,4011006,4021006,4003000],[4021008,4011004,4003001,4003000],[4021008,4011006,4021006,4003001,4003000]]; - var matQtySet = [[7,2],[1,20,5],[1,50,8],[2,1,1,10],[5,5,3,50,15],[1,8,4,2,30],[2,6,30,30],[2,5,3,40,40]]; - var costSet = [1000,2000,3000,10000,30000,50000,80000,200000]; - }else if (selectedType == 2) { //glove refine - var matSet = [[4000021,4000009],[4000021,4000009,4011001],[4000021,4000009,4011006],[4000021,4011006,4021001],[4011000,4011001,4000021,4003000],[4011001,4021000,4021002,4000021,4003000],[4011004,4011006,4021002,4000030,4003000],[4011006,4011007,4021006,4000030,4003000]]; - var matQtySet = [[15,20],[20,20,2],[40,50,2],[50,2,1],[1,3,60,15],[3,1,3,80,25],[3,1,2,40,35],[2,1,8,50,50]]; - var costSet = [5000,10000,15000,20000,30000,40000,50000,70000]; - }else if (selectedType == 3) { //glove upgrade - var matSet = [[1082013,4021003],[1082013,4021000],[1082016,4021000],[1082016,4021008],[1082048,4021003],[1082048,4021008],[1082068,4011002],[1082068,4011006],[1082071,4011006],[1082071,4021008],[1082084,4011000,4021000],[1082084,4011006,4021008],[1082089,4021000,4021007],[1082089,4021007,4021008]]; - var matQtySet = [[1,2],[1,1],[1,3],[1,1],[1,3],[1,1],[1,4],[1,2],[1,4],[1,2],[1,1,5],[1,2,2],[1,5,1],[1,2,2]]; - var costSet = [7000,7000,10000,12000,15000,20000,22000,25000,30000,40000,55000,60000,70000,80000]; - }else if (selectedType == 5) { //arrow refine - var matSet = [[4003001,4003004],[4003001,4003004],[4011000,4003001,4003004],[4011000,4003001,4003004],[4011001,4003001,4003005],[4011001,4003001,4003005]]; - var matQtySet = [[1,1],[1,1],[1,3,10],[1,3,10],[1,5,15],[1,5,15]]; - var costSet = [0,0,0,0,0,0] + var matSet = [[4003001, 4000000], [4011001, 4003000], [4003001, 4000016], [4011001, 4021006, 4003000], [4011001, 4011006, 4021003, 4021006, 4003000], [4011004, 4021000, 4021004, 4003000], [4021008, 4011001, 4011006, 4003000, 4000014]]; + var matQtySet = [[5, 30], [1, 3], [30, 50], [2, 2, 8], [5, 5, 3, 3, 30], [7, 6, 3, 35], [1, 10, 3, 40, 50]]; + var costSet = [800, 2000, 3000, 5000, 30000, 40000, 80000]; + } else if (selectedType == 1) { //xbow refine + var matSet = [[4003001, 4003000], [4011001, 4003001, 4003000], [4011001, 4003001, 4003000], [4011001, 4021006, 4021002, 4003000], [4011001, 4011005, 4021006, 4003001, 4003000], [4021008, 4011001, 4011006, 4021006, 4003000], [4021008, 4011004, 4003001, 4003000], [4021008, 4011006, 4021006, 4003001, 4003000]]; + var matQtySet = [[7, 2], [1, 20, 5], [1, 50, 8], [2, 1, 1, 10], [5, 5, 3, 50, 15], [1, 8, 4, 2, 30], [2, 6, 30, 30], [2, 5, 3, 40, 40]]; + var costSet = [1000, 2000, 3000, 10000, 30000, 50000, 80000, 200000]; + } else if (selectedType == 2) { //glove refine + var matSet = [[4000021, 4000009], [4000021, 4000009, 4011001], [4000021, 4000009, 4011006], [4000021, 4011006, 4021001], [4011000, 4011001, 4000021, 4003000], [4011001, 4021000, 4021002, 4000021, 4003000], [4011004, 4011006, 4021002, 4000030, 4003000], [4011006, 4011007, 4021006, 4000030, 4003000]]; + var matQtySet = [[15, 20], [20, 20, 2], [40, 50, 2], [50, 2, 1], [1, 3, 60, 15], [3, 1, 3, 80, 25], [3, 1, 2, 40, 35], [2, 1, 8, 50, 50]]; + var costSet = [5000, 10000, 15000, 20000, 30000, 40000, 50000, 70000]; + } else if (selectedType == 3) { //glove upgrade + var matSet = [[1082013, 4021003], [1082013, 4021000], [1082016, 4021000], [1082016, 4021008], [1082048, 4021003], [1082048, 4021008], [1082068, 4011002], [1082068, 4011006], [1082071, 4011006], [1082071, 4021008], [1082084, 4011000, 4021000], [1082084, 4011006, 4021008], [1082089, 4021000, 4021007], [1082089, 4021007, 4021008]]; + var matQtySet = [[1, 2], [1, 1], [1, 3], [1, 1], [1, 3], [1, 1], [1, 4], [1, 2], [1, 4], [1, 2], [1, 1, 5], [1, 2, 2], [1, 5, 1], [1, 2, 2]]; + var costSet = [7000, 7000, 10000, 12000, 15000, 20000, 22000, 25000, 30000, 40000, 55000, 60000, 70000, 80000]; + } else if (selectedType == 5) { //arrow refine + var matSet = [[4003001, 4003004], [4003001, 4003004], [4011000, 4003001, 4003004], [4011000, 4003001, 4003004], [4011001, 4003001, 4003005], [4011001, 4003001, 4003005]]; + var matQtySet = [[1, 1], [1, 1], [1, 3, 10], [1, 3, 10], [1, 5, 15], [1, 5, 15]]; + var costSet = [0, 0, 0, 0, 0, 0] } - if(selectedType != 4){ + if (selectedType != 4) { item = items[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; + } prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array) - for(var i = 0; i < mats.length; i++) + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { prompt += "\r\n#i" + mats[i] + "# " + (matQty[i] * qty) + " #t" + mats[i] + "#"; - else + } + } else { prompt += "\r\n#i" + mats + "# " + (matQty * qty) + " #t" + mats + "#"; - if (cost > 0) + } + if (cost > 0) { prompt += "\r\n#i4031138# " + (cost * qty) + " meso"; + } cm.sendYesNo(prompt); - }else if (status == 3) { + } else if (status == 3) { var complete = true; - + if (cm.getMeso() < (cost * qty)) { cm.sendOk("Sorry, but this is how I make my living. No meso, no item."); cm.dispose(); return; - } - else{ + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - }else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; - } - if (!complete) + } + } + if (!complete) { cm.sendOk("Surely you, of all people, would understand the value of having quality items? I can't do that without the items I require."); - else { + } else { var recvItem = item, recvQty; - + if (item >= 2060000 && item <= 2060002) //bow arrows + { recvQty = 1000 - (item - 2060000) * 100; - else if (item >= 2061000 && item <= 2061002) //xbow arrows + } else if (item >= 2061000 && item <= 2061002) //xbow arrows + { recvQty = 1000 - (item - 2061000) * 100; - else if (item == 4003000)//screws + } else if (item == 4003000)//screws + { recvQty = 15 * qty; - else + } else { recvQty = qty; - + } + if (cm.canHold(recvItem, recvQty)) { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++) + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -(matQty[i] * qty)); - }else + } + } else { cm.gainItem(mats, -(matQty * qty)); + } cm.gainMeso(-(cost * qty)); - + cm.gainItem(recvItem, recvQty); cm.sendOk("A perfect item, as usual. Come and see me if you need anything else."); - }else { + } else { cm.sendOk("Please make sure you have room in your inventory, and talk to me again."); } } diff --git a/scripts/npc/1012005.js b/scripts/npc/1012005.js index e71f466e7f..1e1d2a184a 100644 --- a/scripts/npc/1012005.js +++ b/scripts/npc/1012005.js @@ -33,7 +33,7 @@ function start() { } function action(mode, type, selection) { - + if (mode == -1) { cm.dispose(); } else { @@ -41,17 +41,17 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - - if(status == -1) { - cm.sendNext("Hmm... are you raising one of my kids by any chance? I perfected a spell that uses Water of Life to blow life into a doll. People call it the #bPet#k. If you have one with you, feel free to ask me questions."); } - else if (status == 0) + + if (status == -1) { + cm.sendNext("Hmm... are you raising one of my kids by any chance? I perfected a spell that uses Water of Life to blow life into a doll. People call it the #bPet#k. If you have one with you, feel free to ask me questions."); + } else if (status == 0) { cm.sendSimple("What do you want to know more of?#b\r\n#L0#Tell me more about Pets.#l\r\n#L1#How do I raise Pets?#l\r\n#L2#Do Pets die too?#l\r\n#L3#What are the commands for Brown and Black Kitty?#l\r\n#L4#What are the commands for Brown Puppy?#l\r\n#L5#What are the commands for Pink and White Bunny?#l\r\n#L6#What are the commands for Mini Kargo?#l\r\n#L7#What are the commands for Rudolph and Dasher?#l\r\n#L8#What are the commands for Black Pig?#l\r\n#L9#What are the commands for Panda?#l\r\n#L10#What are the commands for Husky?#l\r\n#L11#What are the commands for Dino Boy and Dino Girl?#l\r\n#L12#What are the commands for Monkey?#l\r\n#L13#What are the commands for Turkey?#l\r\n#L14#What are the commands for White Tiger?#l\r\n#L15#What are the commands for Penguin?#l\r\n#L16#What are the commands for Golden Pig?#l\r\n#L17#What are the commands for Robot?#l\r\n#L18#What are the commands for Mini Yeti?#l\r\n#L19#What are the commands for Jr. Balrog?#l\r\n#L20#What are the commands for Baby Dragon?#l\r\n#L21#What are the commands for Green/Red/Blue Dragon?#l\r\n#L22#What are the commands for Black Dragon?#l\r\n#L23#What are the commands for Jr. Reaper?#l\r\n#L24#What are the commands for Porcupine?#l\r\n#L25#What are the commands for Snowman?#l\r\n#L26#What are the commands for Skunk?#l\r\n#L27#Please teach me about transferring pet ability points.#l"); - else if (status == 1) { + } else if (status == 1) { sel = selection; if (selection == 0) { status = 3; @@ -62,93 +62,97 @@ function action(mode, type, selection) { } else if (selection == 2) { status = 11; cm.sendNext("Dying... well, they aren't technically ALIVE per se, so I don't know if dying is the right term to use. They are dolls with my magical power and the power of Water of Life to become a live object. Of course while it's alive, it's just like a live animal..."); - } else if (selection == 3) + } else if (selection == 3) { cm.sendNext("These are the commands for #rBrown Kitty and Black Kitty#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1~30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#btalk, say, chat#k (Level 10 ~ 30)\r\n#bcutie#k (Level 10 ~ 30)\r\n#bup, stand, rise#k (Level 20 ~ 30)"); - else if (selection == 4) + } else if (selection == 4) { cm.sendNext("These are the commands for #rBrown Puppy#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, baddog, dummy#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1~30)\r\n#bpee#k (Level 1 ~ 30)\r\n#btalk, say, chat#k (Level 10 ~ 30)\r\n#bdown#k (Level 10 ~ 30)\r\n#bup, stand, rise#k (Level 20 ~ 30)"); - else if (selection == 5) + } else if (selection == 5) { cm.sendNext("These are the commands for #rPink Bunny and White Bunny#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bup, stand, rise#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1~30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#btalk, say, chat#k (Level 10 ~ 30)\r\n#bhug#k (Level 10 ~ 30)\r\n#bsleep, sleepy, gotobed#k (Level 20 ~ 30)"); - else if (selection == 6) + } else if (selection == 6) { cm.sendNext("These are the commands for #rMini Kargo#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bup, stand, rise#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1~30)\r\n#bpee#k (Level 1 ~ 30)\r\n#btalk, say, chat#k (Level 10 ~ 30)\r\n#bthelook, charisma#k (Level 10 ~ 30)\r\n#bdown#k (Level 10 ~ 30)\r\n#bgoodboy, goodgirl#k (Level 20 ~ 30)"); - else if (selection == 7) + } else if (selection == 7) { cm.sendNext("These are the commands for #rRudolph and Dasher#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bup, stand#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#bmerryxmas, merrychristmas#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1~30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#btalk, say, chat#k (Level 11 ~ 30)\r\n#blonely, alone#k (Level 11 ~ 30)\r\n#bcutie#k (Level 11 ~ 30)\r\n#bmush, go#k (Level 21 ~ 30)"); - else if (selection == 8) + } else if (selection == 8) { cm.sendNext("These are the commands for #rBlack Pig#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1~30)\r\n#bhand#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bsmile#k (Level 10 ~ 30)\r\n#bthelook, charisma#k (Level 20 ~ 30)"); - else if (selection == 9) + } else if (selection == 9) { cm.sendNext("These are the commands for #rPanda#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bchill, relax#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bup, stand, rise#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bletsplay#k (Level 10 ~ 30)\r\n#bmeh, bleh#k (Level 10 ~ 30)\r\n#bsleep#k (Level 20 ~ 30)"); - else if (selection == 10) + } else if (selection == 10) { cm.sendNext("These are the commands for #rHusky#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, baddog, dummy#k (Level 1 ~ 30)\r\n#bhand#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bdown#k (Level 10 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bup, stand, rise#k (Level 20 ~ 30)"); - else if (selection == 11) + } else if (selection == 11) { cm.sendNext("These are the commands for #rDino Boy and Dino Girl#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#bsmile, laugh#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bcutie#k (Level 10 ~ 30)\r\n#bsleep, nap, sleepy#k (Level 20 ~ 30)"); - else if (selection == 12) + } else if (selection == 12) { cm.sendNext("These are the commands for #rMonkey#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#brest#k (Level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (Level 1 ~ 30)\r\n#bpee#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bup, stand#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bplay#k (Level 10 ~ 30)\r\n#bmelong#k (Level 10 ~ 30)\r\n#bsleep, gotobed, sleepy#k (Level 20 ~ 30)"); - else if (selection == 13) + } else if (selection == 13) { cm.sendNext("These are the commands for #rTurkey#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bno, rudeboy, mischief#k (Level 1 ~ 30)\r\n#bstupid#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bup, stand#k (Level 1 ~ 30)\r\n#btalk, chat, gobble#k (Level 10 ~ 30)\r\n#byes, goodboy#k (Level 10 ~ 30)\r\n#bsleepy, birdnap, doze#k (Level 20 ~ 30)\r\n#bbirdeye, thanksgiving, fly, friedbird, imhungry#k (Level 30)"); - else if (selection == 14) + } else if (selection == 14) { cm.sendNext("These are the commands for #rWhite Tiger#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#brest, chill#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bactsad, sadlook#k (Level 10 ~ 30)\r\n#bwait#k (Level 20 ~ 30)"); - else if (selection == 15) + } else if (selection == 15) { cm.sendNext("These are the commands for #rPenguin#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#bup, stand, rise#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 10 ~ 30)\r\n#bhug, hugme#k (Level 10 ~ 30)\r\n#bwing, hand#k (Level 10 ~ 30)\r\n#bsleep#k (Level 20 ~ 30)\r\n#bkiss, smooch, muah#k (Level 20 ~ 30)\r\n#bfly#k (Level 20 ~ 30)\r\n#bcute, adorable#k (Level 20 ~ 30)"); - else if (selection == 16) + } else if (selection == 16) { cm.sendNext("These are the commands for #rGolden Pig#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 11 ~ 30)\r\n#bloveme, hugme#k (Level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (Level 21 ~ 30)\r\n#bignore / impressed / outofhere#k (Level 21 ~ 30)\r\n#broll, showmethemoney#k (Level 21 ~ 30)"); - else if (selection == 17) + } else if (selection == 17) { cm.sendNext("These are the commands for #rRobot#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bup, stand, rise#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#battack, charge#k (Level 1 ~ 30)\r\n#biloveyou#k (Level 1 ~ 30)\r\n#bgood, thelook, charisma#k (Level 11 ~ 30)\r\n#bspeack, talk, chat, say#k (Level 11 ~ 30)\r\n#bdisguise, change, transform#k (Level 11 ~ 30)"); - else if (selection == 18) + } else if (selection == 18) { cm.sendNext("These are the commands for #rMini Yeti#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#bdance, boogie, shakeit#k (Level 1 ~ 30)\r\n#bcute, cutie, pretty, adorable#k (Level 1 ~ 30)\r\n#biloveyou, likeyou, mylove#k (Level 1 ~ 30)\r\n#btalk, chat, say#k (Level 11 ~ 30)\r\n#bsleep, nap, sleepy, gotobed#k (Level 11 ~ 30)"); - else if (selection == 19) + } else if (selection == 19) { cm.sendNext("These are the commands for #rJr. Balrog#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bliedown#k (Level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (Level 1 ~ 30)\r\n#biloveyou|mylove|likeyou#k (Level 1 ~ 30)\r\n#bcute|cutie|pretty|adorable#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#bsmirk|crooked|laugh#k (Level 1 ~ 30)\r\n#bmelong#k (Level 11 ~ 30)\r\n#bgood|thelook|charisma#k (Level 11 ~ 30)\r\n#bspeak|talk|chat|say#k (Level 11 ~ 30)\r\n#bsleep|nap|sleepy#k (Level 11 ~ 30)\r\n#bgas#k (Level 21 ~ 30)"); - else if (selection == 20) + } else if (selection == 20) { cm.sendNext("These are the commands for #rBaby Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (Level 1 ~ 30)\r\n#biloveyou|loveyou#k (Level 1 ~ 30)\r\n#bpoop#k (Level 1 ~ 30)\r\n#bstupid|ihateyou|dummy#k (Level 1 ~ 30)\r\n#bcutie#k (Level 11 ~ 30)\r\n#btalk|chat|say#k (Level 11 ~ 30)\r\n#bsleep|sleepy|gotobed#k (Level 11 ~ 30)"); - else if (selection == 21) + } else if (selection == 21) { cm.sendNext("These are the commands for #rGreen/Red/Blue Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 15 ~ 30)\r\n#bno|bad|badgirl|badboy#k (Level 15 ~ 30)\r\n#biloveyou|loveyou#k (Level 15 ~ 30)\r\n#bpoop#k (Level 15 ~ 30)\r\n#bstupid|ihateyou|dummy#k (Level 15 ~ 30)\r\n#btalk|chat|say#k (Level 15 ~ 30)\r\n#bsleep|sleepy|gotobed#k (Level 15 ~ 30)\r\n#bchange#k (Level 21 ~ 30)"); - else if (selection == 22) + } else if (selection == 22) { cm.sendNext("These are the commands for #rBlack Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 15 ~ 30)\r\n#bno|bad|badgirl|badboy#k (Level 15 ~ 30)\r\n#biloveyou|loveyou#k (Level 15 ~ 30)\r\n#bpoop#k (Level 15 ~ 30)\r\n#bstupid|ihateyou|dummy#k (Level 15 ~ 30)\r\n#btalk|chat|say#k (Level 15 ~ 30)\r\n#bsleep|sleepy|gotobed#k (Level 15 ~ 30)\r\n#bcutie, change#k (Level 21 ~ 30)"); - else if (selection == 23) + } else if (selection == 23) { cm.sendNext("These are the commands for #rJr. Reaper#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (Level 1 ~ 30)\r\n#bplaydead, poop#k (Level 1 ~ 30)\r\n#btalk|chat|say#k (Level 1 ~ 30)\r\n#biloveyou, hug#k (Level 1 ~ 30)\r\n#bsmellmyfeet, rockout, boo#k (Level 1 ~ 30)\r\n#btrickortreat#k (Level 1 ~ 30)\r\n#bmonstermash#k (Level 1 ~ 30)"); - else if (selection == 24) + } else if (selection == 24) { cm.sendNext("These are the commands for #rPorcupine#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (Level 1 ~ 30)\r\n#biloveyou|hug|goodboy#k (Level 1 ~ 30)\r\n#btalk|chat|say#k (Level 1 ~ 30)\r\n#bcushion|sleep|knit|poop#k (Level 1 ~ 30)\r\n#bcomb|beach#k (Level 10 ~ 30)\r\n#btreeninja#k (Level 20 ~ 30)\r\n#bdart#k (Level 20 ~ 30)"); - else if (selection == 25) + } else if (selection == 25) { cm.sendNext("These are the commands for #rSnowman#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (Level 1 ~ 30)\r\n#bloveyou, mylove, ilikeyou#k (Level 1 ~ 30)\r\n#bmerrychristmas#k (Level 1 ~ 30)\r\n#bcutie, adorable, cute, pretty#k (Level 1 ~ 30)\r\n#bcomb, beach/bad, no, badgirl, badboy#k (Level 1 ~ 30)\r\n#btalk, chat, say/sleep, sleepy, gotobed#k (Level 10 ~ 30)\r\n#bchang#k (Level 20 ~ 30)"); - else if (selection == 26) + } else if (selection == 26) { cm.sendNext("These are the commands for #rSkunk#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (Level 1 ~ 30)\r\n#bbad/no/badgirl/badboy#k (Level 1 ~ 30)\r\n#brestandrelax, poop#k (Level 1 ~ 30)\r\n#btalk/chat/say, iloveyou#k (Level 1 ~ 30)\r\n#bsnuggle/hug, sleep, goodboy#k (Level 1 ~ 30)\r\n#bfatty, blind, badbreath#k (Level 10 ~ 30)\r\n#bsuitup, bringthefunk#k (Level 20 ~ 30)"); - else if (selection == 27) { + } else if (selection == 27) { status = 14; cm.sendNext("In order to transfer the pet ability points, closeness and level, Pet AP Reset Scroll is required. If you take this\r\nscroll to Mar the Fairy in Ellinia, she will transfer the level and closeness of the pet to another one. I am especially giving it to you because I can feel your heart for your pet. However, I can't give this out for free. I can give you this book for 250,000 mesos. Oh, I almost forgot! Even if you have this book, it is no use if you do not have a new pet to transfer the Ability points."); } - if(selection > 2 && selection < 27) + if (selection > 2 && selection < 27) { cm.dispose(); + } } else if (status == 2) { - if(sel == 0) + if (sel == 0) { cm.sendNextPrev("But Water of Life only comes out little at the very bottom of the World Tree, so I can't give him too much time in life... I know, it's very unfortunate... but even if it becomes a doll again I can always bring life back into it so be good to it while you're with it."); - else if (sel == 1) + } else if (sel == 1) { cm.sendNextPrev("Talk to the pet, pay attention to it and its intimacy level will go up and eventually his overall level will go up too. As the intimacy level rises, the pet's overall level will rise soon after. As the overall level rises, one day the pet may even talk like a person a little bit, so try hard raising it. Of course it won't be easy doing so..."); - else if (sel == 2) + } else if (sel == 2) { cm.sendNextPrev("After some time... that's correct, they stop moving. They just turn back to being a doll, after the effect of magic dies down and Water of Life dries out. But that doesn't mean it's stopped forever, because once you pour Water of Life over, it's going to be back alive."); - else if (sel == 27) + } else if (sel == 27) { cm.sendYesNo("250,000 mesos will be deducted. Do you really want to buy?"); + } } else if (status == 3) { - if (sel == 0) + if (sel == 0) { cm.sendNextPrev("Oh yeah, they'll react when you give them special commands. You can scold them, love them... it all\r\ndepends on how you take care of them. They are afraid to leave their masters so be nice to them, show them love. They can get sad and lonely fast..."); - else if (sel == 1){ + } else if (sel == 1) { cm.sendNextPrev("It may be a live doll but they also have life so they can feel the hunger too. #bFullness#k shows the level of hunger the pet's in. 100 is the max, and the lower it gets, it means that the pet is getting hungrier. After a while, it won't even follow your command and be on the offensive, so watch out over that."); - return; - }else if (sel == 2) + + } else if (sel == 2) { cm.sendNextPrev("Even if it someday moves again, it's sad to see them stop altogether. Please be nice to them while they are alive and moving. Feed them well, too. Isn't it nice to know that there's something alive that follows and listens to only you?"); - else if (sel == 27){ - if (cm.getMeso() < 250000 || !cm.canHold(4160011)) + } else if (sel == 27) { + if (cm.getMeso() < 250000 || !cm.canHold(4160011)) { cm.sendOk("Please check if your inventory has empty slot or you don't have enough mesos."); - else { + } else { cm.gainMeso(-250000); cm.gainItem(4160011, 1); } cm.dispose(); } - } else if (status == 4){ - if(sel != 1) + } else if (status == 4) { + if (sel != 1) { cm.dispose(); + } cm.sendNextPrev("Oh yes! Pets can't eat the normal human food. Instead my disciple #bDoofus#k sells #bPet Food#k at the Henesys Market so if you need food for your pet, find Henesys. It'll be a good idea to buy the food in advance and feed the pet before it gets really hungry."); - } else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("Oh, and if you don't feed the pet for a long period of time, it goes back home by itself. You can take it out of its home and feed it but it's not really good for the pet's health, so try feeding him on a regular basis so it doesn't go down to that level, alright? I think this will do."); - else + } else { cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1012006.js b/scripts/npc/1012006.js index 57cdd80bdf..049f162fb9 100644 --- a/scripts/npc/1012006.js +++ b/scripts/npc/1012006.js @@ -43,8 +43,9 @@ function action(mode, type, selection) { if (cm.haveItem(4031035)) { cm.sendNext("Get that letter, jump over obstacles with your pet, and take that letter to my brother Trainer Frod. Give him the letter and something good is going to happen to your pet."); cm.dispose(); - } else + } else { cm.sendYesNo("This is the road where you can go take a walk with your pet. You can just walk around with it, or you can train your pet to go through the obstacles here. If you aren't too close with your pet yet, that may present a problem and he will not follow your command as much... So, what do you think? Wanna train your pet?"); + } } else { cm.sendOk("Hey, are you sure you've met #bMar the Fairy#k? Don't lie to me if you've never met her before because it's obvious. That wasn't even a good lie!!"); cm.dispose(); diff --git a/scripts/npc/1012007.js b/scripts/npc/1012007.js index a9e5e4e25a..8702b3d042 100644 --- a/scripts/npc/1012007.js +++ b/scripts/npc/1012007.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Author: Xterminator NPC Name: Trainer Frod Map(s): Victoria Road : Pet-Walking Road (100000202) @@ -26,21 +27,21 @@ */ function start() { - if (cm.haveItem(4031035)) + if (cm.haveItem(4031035)) { cm.sendNext("Eh, that's my brother's letter! Probably scolding me for thinking I'm not working and stuff...Eh? Ahhh...you followed my brother's advice and trained your pet and got up here, huh? Nice!! Since you worked hard to get here, I'll boost your intimacy level with your pet."); - else { + } else { cm.sendOk("My brother told me to take care of the pet obstacle course, but ... since I'm so far away from him, I can't help but wanting to goof around ...hehe, since I don't see him in sight, might as well just chill for a few minutes."); cm.dispose(); } } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { - if (cm.getPlayer().getNoPets() == 0) + } else { + if (cm.getPlayer().getNoPets() == 0) { cm.sendNextPrev("Hmmm ... did you really get here with your pet? These obstacles are for pets. What are you here for without it?? Get outta here!"); - else { + } else { cm.gainItem(4031035, -1); cm.gainCloseness(2, 0); cm.sendNextPrev("What do you think? Don't you think you have gotten much closer with your pet? If you have time, train your pet again on this obstacle course...of course, with my brother's permission."); diff --git a/scripts/npc/1012008.js b/scripts/npc/1012008.js index 7efc7a0d9a..2b70d808e6 100644 --- a/scripts/npc/1012008.js +++ b/scripts/npc/1012008.js @@ -6,7 +6,7 @@ var status; var current; -var omok = [4080000, 4080001, 4080002, 4080003, 4080004, 4080005]; +var omok = [4080000, 4080001, 4080002, 4080003, 4080004, 4080005]; var omok1piece = [4030000, 4030000, 4030000, 4030010, 4030011, 4030011]; var omok2piece = [4030001, 4030010, 4030011, 4030001, 4030010, 4030001]; var omokamount = 99; @@ -15,15 +15,15 @@ var text = "The set also differs based on what kind of pieces you want to use fo function start() { current = 0; status = -1; - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1 && current > 0) { + if (mode == -1 && current > 0) { cm.dispose(); return; } else { - if(mode == 1) { + if (mode == 1) { status++; } else { status--; @@ -32,7 +32,7 @@ function action(mode, type, selection) { if (status == 0) { cm.sendSimple("Hey, you look like you need a breather. You should be enjoying the life, just like I am. Well, if you have a couple of items, I can trade you for an item you can play minigames with. Now... what can I do for you?#b\r\n#L0#Create a minigame item#l\r\n#L1#Explain to me what the minigames are about#l#k"); - + } else if (status == 1) { if (selection == 0) { cm.sendSimple("You want to make the minigame item? Minigames aren't something you can just go ahead and play right off the bat. For each minigame, you'll need a specific set of items. Which minigame it em do you want to make?#b\r\n#L4#Omok Set#l\r\n#L5#A Set of Match Cards#l#k"); @@ -63,7 +63,7 @@ function action(mode, type, selection) { } } - + } else if (status == 3) { if (current == 1) { cm.sendNextPrev("Every game of Omok will cost you #r100 mesos#k. Even if you don't have an #bOmok Set#k, you can enter the room and play. However, if you don't possess 100 mesos, then you won't be allowed to enter in the room at all. The person opening the game room also needs 100 mesos to open the room (or else there's no game). If you run out of mesos during the game, then you're automatically kicked out of the room!"); @@ -71,16 +71,16 @@ function action(mode, type, selection) { cm.sendNextPrev("Every game of Match Cards will cost you #r100 mesos#k. Even if you don't have #bA set of Match Cards#k, you can enter the room and play. However, if you don't possess 100 mesos, then you won't be allowed to enter in the room at all. The person opening the game room also needs 100 mesos to open the room (or else there's no game). If you run out of mesos during the game, then you're automatically kicked out of the room!"); } else if (current == 3) { - for (var i = 0; i < omok.length; i++) - text += "\r\n#L"+i+"##b#t"+omok[i]+"##k#l"; + for (var i = 0; i < omok.length; i++) { + text += "\r\n#L" + i + "##b#t" + omok[i] + "##k#l"; + } cm.sendSimple(text); } } else if (status == 4) { if (current == 1 || current == 2) { cm.sendNextPrev("Enter the room, and when you're ready to play, click on #bReady#k.\r\nOnce the visitor clicks on #bReady#k, the room owner can press #bStart#k to begin the game. If an unwanted visitor walks in, and you don't want to play with that person, the room owner has the right to kick the visitor out of the room. There will be a square box with x written on the right of that person. Click on that for a cold goodbye, okay?"); //Oh yeah, because people WALK in Omok Rooms. - } - else if (current == 3) { + } else if (current == 3) { if (cm.haveItem(omok1piece[selection], 99) && cm.haveItem(omok2piece[selection], 99) && cm.haveItem(4030009, 1)) { cm.gainItem(omok1piece[selection], -omokamount); cm.gainItem(omok2piece[selection], -omokamount); @@ -96,7 +96,7 @@ function action(mode, type, selection) { } else if (status == 5) { if (current == 1) { cm.sendNextPrev("When the first fame starts, #bthe room owner goes first#k. Beward that you'll be given a time limit, and you may lose your turn if you don't make your move on time. Normally, 3 x 3 is not allowed, but if there comes a point that it's absolutely necessary to put your piece there or face ending the game, then you can put it there. 3 x 3 is allowed as the last line of defense! Oh, and it won't count if it's #r6 or 7 straight#k. Only 5!"); - } else if (current == 2) { + } else if (current == 2) { cm.sendNextPrev("Oh, and unlike Omok, when you create the game room for Match Cards, you'll need to set your game on the number of cards you'll use for the game. There are 3 modes avaliable, 3x4, 4x5, and 5x6, which will require 12, 20, and 30 cards respectively. Remember that you won't beable to change it up once the room is open, so if you really wish to change it up, you may have to close the room and open another one."); } @@ -106,7 +106,7 @@ function action(mode, type, selection) { } else if (current == 2) { cm.sendNextPrev("When the first game starts, #bthe room owner goes first.#k Beware that you'll be given a time limit, and you may lose your turn if you don't make your move on time. When you find a matching pair on your turn, you'll get to keep your turn, as long as you keep finding a pair of matching cards. Use your memorizing skills to make a streak."); } - + } else if (status == 7) { if (current == 1) { cm.sendPrev("When the next game starts, the loser will go first. Also, no one is allowed to leave in the middle of a game. If you do, you may need to request either a #bforfeit or tie#k. (Of course, if you request a forfeit, you'll lose the game.) And if you click on 'Leave' in the middle of the game and call to leave after the game, you'll leave the room right after the game is over. This will be a much more useful way to leave."); diff --git a/scripts/npc/1012100.js b/scripts/npc/1012100.js index 6e0bee2384..95a7f8e5d2 100644 --- a/scripts/npc/1012100.js +++ b/scripts/npc/1012100.js @@ -26,7 +26,7 @@ */ status = -1; -actionx = {"1stJob" : false, "2ndjob" : false, "3thJobI" : false, "3thJobC" : false}; +actionx = {"1stJob": false, "2ndjob": false, "3thJobI": false, "3thJobC": false}; job = 310; spawnPnpc = false; @@ -37,12 +37,12 @@ function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { if (cm.getJobId() == 0) { @@ -50,20 +50,21 @@ function start() { cm.sendNext("So you decided to become a #rbowman#k? There are some standards to meet, y'know... #bYour level should be at least 10, with at least " + cm.getFirstJobStatRequirement(jobType) + "#k. Let's see."); // thanks Vcoc for noticing a need to state and check requirements on first job adv starting message } else if (cm.getLevel() >= 30 && cm.getJobId() == 300) { actionx["2ndJob"] = true; - if (cm.haveItem(4031012)) + if (cm.haveItem(4031012)) { cm.sendNext("Haha...I knew you'd breeze through that test. I'll admit, you are a great bowman. I'll make you much stronger than you're right now. before that, however... you;ll need to choose one of two paths given to you. It'll be a difficult decision for you to make, but... if there's any question to ask, please do so."); - else if (cm.haveItem(4031011)){ + } else if (cm.haveItem(4031011)) { cm.sendOk("Go and see the #b#p1072002##k."); cm.dispose(); - } else + } else { cm.sendYesNo("Hmmm... you have grown a lot since I last saw you. I don't see the weakling I saw before, and instead, look much more like a bowman now. Well, what do you think? Don't you want to get even more powerful than that? Pass a simple test and I'll do just that for you. Do you want to do it?"); - } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 3 && !cm.getPlayer().gotPartyQuestItem("JBP"))){ + } + } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 3 && !cm.getPlayer().gotPartyQuestItem("JBP"))) { actionx["3thJobI"] = true; cm.sendNext("There you are. A few days ago, #b#p2020010##k of Ossyria talked to me about you. I see that you are interested in making the leap to the amazing world of the third job advancement for archers. To achieve that goal, I will have to test your strength in order to see whether you are worthy of the advancement. There is an opening in the middle of a deep forest in Victoria Island, where it'll lead you to a secret passage. Once inside, you'll face a clone of myself. Your task is to defeat her and bring #b#t4031059##k back with you."); - } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)){ + } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)) { cm.sendNext("Please, bring me the #b#t4031059##k."); cm.dispose(); - } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")){ + } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")) { actionx["3thJobC"] = true; cm.sendNext("Nice work. You have defeated my clone and brought #b#t4031059##k back safely. You have now proven yourself worthy of the 3rd job advancement from the physical standpoint. Now you should give this necklace to #b#p2020011##k in Ossyria to take on the second part of the test. Good luck. You'll need it."); } else { @@ -81,14 +82,14 @@ function action(mode, type, selection) { } else if (mode == 0 && type != 1) { status -= 2; } - - if (status == -1){ + + if (status == -1) { start(); return; } else { - if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -96,29 +97,30 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); return; } else { - if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)){ - if (mode == 0 && status == 2 && type == 1) + if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)) { + if (mode == 0 && status == 2 && type == 1) { cm.sendOk("You know there is no other choice..."); - if (!(mode == 0 && type != 1)){ + } + if (!(mode == 0 && type != 1)) { cm.dispose(); return; } } } } - - if (actionx["1stJob"]){ + + if (actionx["1stJob"]) { if (status == 0) { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { cm.sendNextPrev("It is an important and final choice. You will not be able to turn back."); @@ -126,9 +128,9 @@ function action(mode, type, selection) { cm.sendOk("Train a bit more until you reach the base requirements and I can show you the way of the #rBowman#k."); cm.dispose(); } - } else if (status == 1){ - if (cm.canHold(1452051) && cm.canHold(2070000)){ - if (cm.getJobId() == 0){ + } else if (status == 1) { + if (cm.canHold(1452051) && cm.canHold(2070000)) { + if (cm.getJobId() == 0) { cm.changeJobById(300); cm.gainItem(1452051, 1); cm.gainItem(2060000, 1000); @@ -139,68 +141,76 @@ function action(mode, type, selection) { cm.sendNext("Make some room in your inventory and talk back to me."); cm.dispose(); } - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You've gotten much stronger now. Plus every single one of your inventories have added slots. A whole row, to be exact. Go see for it yourself. I just gave you a little bit of #bSP#k. When you open up the #bSkill#k menu on the lower left corner of the screen, there are skills you can learn by using SP's. One warning, though: You can't raise it all together all at once. There are also skills you can acquire only after having learned a couple of skills first."); - else if (status == 3) + } else if (status == 3) { cm.sendNextPrev("Now a reminder. Once you have chosen, you cannot change up your mind and try to pick another path. Go now, and live as a proud Bowman."); - else - cm.dispose(); - } else if(actionx["2ndJob"]){ - if (status == 0){ - if (cm.haveItem(4031012)) + } else { + cm.dispose(); + } + } else if (actionx["2ndJob"]) { + if (status == 0) { + if (cm.haveItem(4031012)) { cm.sendSimple("Alright, when you have made your decision, click on [I'll choose my occupation] at the bottom.#b\r\n#L0#Please explain to me what being the Hunter is all about.\r\n#L1#Please explain to me what being the Crossbowman is all about.\r\n#L3#I'll choose my occupation!"); - else { + } else { cm.sendNext("Good decision. You look strong, but I need to see if you really are strong enough to pass the test, it's not a difficult test, so you'll do just fine. Here, take my letter first... make sure you don't lose it!"); - if(!cm.isQuestStarted(100000)) cm.startQuest(100000); - } - } else if (status == 1){ - if (!cm.haveItem(4031012)){ - if (cm.canHold(4031010)){ - if (!cm.haveItem(4031010)) + if (!cm.isQuestStarted(100000)) { + cm.startQuest(100000); + } + } + } else if (status == 1) { + if (!cm.haveItem(4031012)) { + if (cm.canHold(4031010)) { + if (!cm.haveItem(4031010)) { cm.gainItem(4031010, 1); + } cm.sendNextPrev("Please get this letter to #b#p1072002##k who's around #b#m106010000##k near Henesys. She is taking care of the job of an instructor in place of me. Give her the letter and she'll test you in place of me. Best of luck to you."); - cm.dispose(); - } else { + cm.dispose(); + } else { cm.sendNext("Please, make some space in your inventory."); cm.dispose(); } } else { - if (selection < 3){ - if(selection == 0) { //hunter + if (selection < 3) { + if (selection == 0) { //hunter cm.sendNext("Archers that master #rBows#k.\r\n\r\n#bHunters#k have a higher damage/minute output in early levels, with attacks having a faster pace but slightly weaker than Crossbowmans. #bHunters#k get #rArrow Bomb#k, a slightly weaker attack that can cause up to 6 enemies to get stunned."); - } else if(selection == 1) { //crossbowman + } else if (selection == 1) { //crossbowman cm.sendNext("Archers that master #rCrossbows#k.\r\n\r\n#bCrossbowmans'#k attack power grows higher the higher level you are, when compared to Hunters. #bCrossbowmans#k get #rIron Arrow#k, a stronger attack that does not home on enemies but can go through walls."); } - + status -= 2; - } else + } else { cm.sendSimple("Now... have you made up your mind? Please choose the job you'd like to select for your 2nd job advancement. #b\r\n#L0#Hunter\r\n#L1#Crossbowman"); + } } - } else if (status == 2){ + } else if (status == 2) { job += selection * 10; cm.sendYesNo("So you want to make the second job advancement as the " + (job == 310 ? "#bHunter#k" : "#bCrossbowman#k") + "? You know you won't be able to choose a different job for the 2nd job advancement once you make your desicion here, right?"); - } else if (status == 3){ - if (cm.haveItem(4031012)) + } else if (status == 3) { + if (cm.haveItem(4031012)) { cm.gainItem(4031012, -1); - + } + cm.sendNext("Alright, you're the " + (job == 310 ? "#bHunter#k" : "#bCrossbowman#k") + " from here on out. " + (job == 310 ? "#bHunter#k" : "#bCrossbowman#k") + "s are the intelligent bunch with incredible vision, able to pierce the arrow through the heart of the monsters with ease... please train yourself each and everyday. I'll help you become even stronger than you already are."); - if (cm.getJobId() != job) + if (cm.getJobId() != job) { cm.changeJobById(job); - } else if (status == 4) + } + } else if (status == 4) { cm.sendNextPrev("I have just given you a book that gives you the list of skills you can acquire as a " + (job == 310 ? "hunter" : "crossbowman") + ". Also your etc inventory has expanded by adding another row to it. Your max HP and MP have increased, too. Go check and see for it yourself."); - else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("I have also given you a little bit of #bSP#k. Open the #bSkill Menu#k located at the bottomleft corner. you'll be able to boost up the newer acquired 2nd level skills. A word of warning, though. You can't boost them up all at once. Some of the skills are only available after you have learned other skills. Make sure yo remember that."); - else if (status == 6) + } else if (status == 6) { cm.sendNextPrev((job == 310 ? "Hunter" : "Crossbowman") + " need to be strong. But remember that you can't abuse that power and use it on a weakling. Please use your enormous power the right way, because... for you to use that the right way, that is much harden than just getting stronger. Please find me after you have advanced much further. I'll be waiting for you."); - } else if (actionx["3thJobI"]){ - if (status == 0){ - if (cm.getPlayer().gotPartyQuestItem("JB3")){ + } + } else if (actionx["3thJobI"]) { + if (status == 0) { + if (cm.getPlayer().gotPartyQuestItem("JB3")) { cm.getPlayer().removePartyQuestItem("JB3"); cm.getPlayer().setPartyQuestItemObtained("JBP"); } cm.sendNextPrev("Since she is a clone of myself, you can expect a tough battle ahead. He uses a number of special attacking skills unlike any you have ever seen, and it is your task to successfully take him one on one. There is a time limit in the secret passage, so it is crucial that you defeat him within the time limit. I wish you the best of luck, and I hope you bring the #b#t4031059##k with you."); } - } else if (actionx["3thJobC"]){ + } else if (actionx["3thJobC"]) { cm.getPlayer().removePartyQuestItem("JBP"); cm.gainItem(4031059, -1); cm.gainItem(4031057, 1); diff --git a/scripts/npc/1012103.js b/scripts/npc/1012103.js index f3508b0bdb..1b29469292 100644 --- a/scripts/npc/1012103.js +++ b/scripts/npc/1012103.js @@ -48,49 +48,56 @@ function action(mode, type, selection) { cm.dispose(); } else { status++; - if (status == 0) + if (status == 0) { cm.sendSimple("I'm the head of this hair salon. If you have a #b#t5150001##k or a #b#t5151001##k allow me to take care of your hairdo. Please choose the one you want.\r\n#L1#Haircut: #i5150001##t5150001##l\r\n#L2#Dye your hair: #i5151001##t5151001##l"); - else if (status == 1) { + } else if (status == 1) { if (selection == 1) { beauty = 1; hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_v.length; i++) - pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); - if (cm.getPlayer().getGender() == 1) - for(var i = 0; i < fhair_v.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_v.length; i++) { + pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } + if (cm.getPlayer().getGender() == 1) { + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } cm.sendStyle("I can totally change up your hairstyle and make it look so good. Why don't you change it up a bit? If you have #b#t5150001##k I'll change it for you. Choose the one to your liking~.", hairnew); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); + } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t51051001##k I'll change it for you. Choose the one to your liking.", haircolor); } - } else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420002)){ // thanks MedicOP for noticing uncoded functionality for Hair Membership coupons + if (beauty == 1) { + if (cm.haveItem(5420002)) { // thanks MedicOP for noticing uncoded functionality for Hair Membership coupons cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150001)){ + } else if (cm.haveItem(5150001)) { cm.gainItem(5150001, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); + } } - if (beauty == 2){ - if (cm.haveItem(5151001)){ + if (beauty == 2) { + if (cm.haveItem(5151001)) { cm.gainItem(5151001, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); + } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150001, 1); @@ -99,8 +106,9 @@ function action(mode, type, selection) { cm.gainMeso(-haircolorprice); cm.gainItem(5151001, 1); cm.sendOk("Enjoy!"); - } else + } else { cm.sendOk("You don't have enough mesos to buy a coupon!"); + } } } } diff --git a/scripts/npc/1012104.js b/scripts/npc/1012104.js index cb6b7eb67a..c3000cf302 100644 --- a/scripts/npc/1012104.js +++ b/scripts/npc/1012104.js @@ -39,6 +39,7 @@ function pushIfItemExists(array, itemid) { array.push(itemid); } } + function start() { status = -1; action(1, 0, 0); @@ -48,10 +49,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("I'm Brittany the assistant. If you have #b#t5150000##k, #b#t5150010##k or #b#t5151000##k by any chance, then how about letting me change your hairdo?\r\n#L0#Haircut: #i5150000##t5150000##l\r\n#L1#Haircut: #i5150010##t5150010##l\r\n#L2#Dye your hair: #i5151000##t5151000##l"); } else if (status == 1) { @@ -59,62 +61,66 @@ function action(mode, type, selection) { beauty = 3; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_r.length; i++) - pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair()% 10)); + for (var i = 0; i < mhair_r.length; i++) { + pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_r.length; i++) + for (var i = 0; i < fhair_r.length; i++) { pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + } } cm.sendYesNo("If you use the REG coupon your hair will change RANDOMLY with a chance to obtain a new experimental style that even you didn't think was possible. Are you going to use #b#t5150000##k and really change your hairstyle?"); } else if (selection == 1) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_e.length; i++) - pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair()% 10)); + for (var i = 0; i < mhair_e.length; i++) { + pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); + } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_e.length; i++) + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); + } } cm.sendYesNo("If you use the EXP coupon your hair will change RANDOMLY with a chance to obtain a new experimental style that even you didn't think was possible. Are you going to use #b#t5150010##k and really change your hairstyle?"); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); + } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5151000##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150010) == true){ + if (beauty == 1) { + if (cm.haveItem(5150010) == true) { cm.gainItem(5150010, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } - } else if (beauty == 2){ - if (cm.haveItem(5151000) == true){ + } else if (beauty == 2) { + if (cm.haveItem(5151000) == true) { cm.gainItem(5151000, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } - } else if (beauty == 3){ - if (cm.haveItem(5150000) == true){ + } else if (beauty == 3) { + if (cm.haveItem(5150000) == true) { cm.gainItem(5150000, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150010, 1); diff --git a/scripts/npc/1012105.js b/scripts/npc/1012105.js index 0e052b6ddc..a280399ac3 100644 --- a/scripts/npc/1012105.js +++ b/scripts/npc/1012105.js @@ -27,37 +27,36 @@ var skin = Array(0, 1, 2, 3, 4); var price = 1000000; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - cm.dispose(); + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - - if (status == 0) { - cm.sendSimple("Well, hello! Welcome to the Henesys Skin-Care! Would you like to have a firm, tight, healthy looking skin like mine? With a #b#t5153000##k, you can let us take care of the rest and have the kind of skin you've always wanted~!\r\n#L1#Skin Care: #i5153000##t5153000##l"); - } - else if (status == 1) { - if (cm.haveItem(5153000)){ - cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of skin-treatment would you like to do? Choose the style of your liking.", skin); - } else { - cm.sendOk("Um... you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); - cm.dispose(); - return; - } - } - else { - cm.gainItem(5153000, -1); - cm.setSkin(selection); - cm.sendOk("Enjoy your new and improved skin!"); - cm.dispose(); - } + status--; } + + + if (status == 0) { + cm.sendSimple("Well, hello! Welcome to the Henesys Skin-Care! Would you like to have a firm, tight, healthy looking skin like mine? With a #b#t5153000##k, you can let us take care of the rest and have the kind of skin you've always wanted~!\r\n#L1#Skin Care: #i5153000##t5153000##l"); + } else if (status == 1) { + if (cm.haveItem(5153000)) { + cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of skin-treatment would you like to do? Choose the style of your liking.", skin); + } else { + cm.sendOk("Um... you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); + cm.dispose(); + + } + } else { + cm.gainItem(5153000, -1); + cm.setSkin(selection); + cm.sendOk("Enjoy your new and improved skin!"); + cm.dispose(); + } + } } diff --git a/scripts/npc/1012112.js b/scripts/npc/1012112.js index a8be1e38be..607625d326 100644 --- a/scripts/npc/1012112.js +++ b/scripts/npc/1012112.js @@ -41,10 +41,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (cm.getMapId() == 100000200) { if (status == 0) { @@ -73,8 +74,7 @@ function action(mode, type, selection) { if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel."); } - } - else { + } else { cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); } @@ -109,8 +109,7 @@ function action(mode, type, selection) { } else if (status == 1) { if (cm.getEventInstance().giveEventReward(cm.getPlayer())) { cm.warp(100000200); - } - else { + } else { cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly."); } cm.dispose(); diff --git a/scripts/npc/1012113.js b/scripts/npc/1012113.js index d07fdd6504..f66270e908 100644 --- a/scripts/npc/1012113.js +++ b/scripts/npc/1012113.js @@ -25,6 +25,7 @@ * @npc Tommy (HPQ) */ var status = 0; + function start() { status = -1; action(1, 0, 0); @@ -41,18 +42,17 @@ function action(mode, type, selection) { } else if (status == 1) { if (cm.isEventLeader()) { cm.sendYesNo("What do you think about making your way there with your party members and teach those rowdy pigs a lesson?"); - } - else { + } else { cm.sendOk("Interessed? Tell your party leader to talk to me to head there!"); cm.dispose(); - return; + } } else if (status == 2) { cm.getEventInstance().startEventTimer(5 * 60000); cm.getEventInstance().warpEventTeam(910010200); cm.dispose(); - return; + } } else if (cm.getPlayer().getMap().getId() == 910010200) { //Bonus map if (status == 0) { @@ -60,7 +60,7 @@ function action(mode, type, selection) { } else { cm.warp(910010400); cm.dispose(); - return; + } } else if (cm.getPlayer().getMap().getId() == 910010300) { //Exit map if (status == 0) { @@ -68,7 +68,7 @@ function action(mode, type, selection) { } else { cm.warp(100000200); cm.dispose(); - return; + } } } diff --git a/scripts/npc/1012114.js b/scripts/npc/1012114.js index 9318bf1b05..e61b7fc2e9 100644 --- a/scripts/npc/1012114.js +++ b/scripts/npc/1012114.js @@ -9,88 +9,89 @@ var status = 0; var chosen = -1; function clearStage(stage, eim) { - eim.setProperty(stage + "stageclear", "true"); - eim.showClearEffect(true); + eim.setProperty(stage + "stageclear", "true"); + eim.showClearEffect(true); - eim.giveEventPlayersStageReward(stage); + eim.giveEventPlayersStageReward(stage); } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) { - cm.dispose(); - return; - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 0) - status += ((chosen == 2) ? 1 : -1); - else - status++; - - if (status == 0) { - if (cm.isEventLeader()) { - cm.sendSimple("Growl! I am Growlie, always ready to protect this place. What brought you here?\r\n#b#L0# Please tell me what this place is all about.#l\r\n#L1# I have brought #t4001101#.#l\r\n#L2# I would like to leave this place.#l"); - } else { - cm.sendSimple("Growl! I am Growlie, always ready to protect this place. What brought you here?\r\n#b#L0# Please tell me what this place is all about.#l\r\n#L2# I would like to leave this place.#l"); - } - } else if (status == 1) { - if (chosen == -1) - chosen = selection; - if (chosen == 0) { - cm.sendNext("This place can be best described as the prime spot where you can taste the delicious rice cakes made by Moon Bunny every full moon."); - } else if (chosen == 1) { - if (cm.haveItem(4001101, 10)) { - cm.sendNext("Oh... isn't this rice cake made by Moon Bunny? Please hand me the rice cake. Mmmm ... these seems delicious. Please come see me next time for more #b#t4001101##k. Have a safe trip home!"); - } else { - cm.sendOk("I advise you to check and make sure that you have indeed gathered up #b10 #t4001101#s#k."); - cm.dispose(); - } - } else if (chosen == 2) { - cm.sendYesNo("Are you sure you want to leave?"); - } - else { - cm.dispose(); - return; - } - } else if (status == 2) { - if (chosen == 0) { - cm.sendNextPrev("Gather up the primrose seeds from the primrose leaves all over this area, and plant the seeds at the footing near the crescent moon to see the primrose bloom. There are 6 types of primroses, and all of them require different footings. It is imperative that the footing fits the seed of the flower."); - } else if (chosen == 1) { - cm.gainItem(4001101, -10); + if (mode < 0) { + cm.dispose(); - var eim = cm.getEventInstance(); - clearStage(1, eim); - - var map = eim.getMapInstance(cm.getPlayer().getMapId()); - map.killAllMonstersNotFriendly(); - - eim.clearPQ(); - cm.dispose(); - } else { - if (mode == 1) { - cm.warp(910010300); - } else { - cm.sendOk("You better collect some delicious rice cakes for me then, because time is running out, Growl!"); - } - cm.dispose(); - } - } else if (status == 3) { - if (chosen == 0) { - cm.sendNextPrev("When the flowers of primrose blooms, the full moon will rise, and that's when the Moon Bunnies will appear and start pounding the mill. Your task is to fight off the monsters to make sure that Moon Bunny can concentrate on making the best rice cake possible."); - } - } else if (status == 4) { - if (chosen == 0) { - cm.sendNextPrev("I would like for you and your party members to cooperate and get me 10 rice cakes. I strongly advise you to get me the rice cakes within the allotted time."); - } - } else { - cm.dispose(); - } + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 0) { + status += ((chosen == 2) ? 1 : -1); + } else { + status++; + } + + if (status == 0) { + if (cm.isEventLeader()) { + cm.sendSimple("Growl! I am Growlie, always ready to protect this place. What brought you here?\r\n#b#L0# Please tell me what this place is all about.#l\r\n#L1# I have brought #t4001101#.#l\r\n#L2# I would like to leave this place.#l"); + } else { + cm.sendSimple("Growl! I am Growlie, always ready to protect this place. What brought you here?\r\n#b#L0# Please tell me what this place is all about.#l\r\n#L2# I would like to leave this place.#l"); + } + } else if (status == 1) { + if (chosen == -1) { + chosen = selection; + } + if (chosen == 0) { + cm.sendNext("This place can be best described as the prime spot where you can taste the delicious rice cakes made by Moon Bunny every full moon."); + } else if (chosen == 1) { + if (cm.haveItem(4001101, 10)) { + cm.sendNext("Oh... isn't this rice cake made by Moon Bunny? Please hand me the rice cake. Mmmm ... these seems delicious. Please come see me next time for more #b#t4001101##k. Have a safe trip home!"); + } else { + cm.sendOk("I advise you to check and make sure that you have indeed gathered up #b10 #t4001101#s#k."); + cm.dispose(); + } + } else if (chosen == 2) { + cm.sendYesNo("Are you sure you want to leave?"); + } else { + cm.dispose(); + + } + } else if (status == 2) { + if (chosen == 0) { + cm.sendNextPrev("Gather up the primrose seeds from the primrose leaves all over this area, and plant the seeds at the footing near the crescent moon to see the primrose bloom. There are 6 types of primroses, and all of them require different footings. It is imperative that the footing fits the seed of the flower."); + } else if (chosen == 1) { + cm.gainItem(4001101, -10); + + var eim = cm.getEventInstance(); + clearStage(1, eim); + + var map = eim.getMapInstance(cm.getPlayer().getMapId()); + map.killAllMonstersNotFriendly(); + + eim.clearPQ(); + cm.dispose(); + } else { + if (mode == 1) { + cm.warp(910010300); + } else { + cm.sendOk("You better collect some delicious rice cakes for me then, because time is running out, Growl!"); + } + cm.dispose(); + } + } else if (status == 3) { + if (chosen == 0) { + cm.sendNextPrev("When the flowers of primrose blooms, the full moon will rise, and that's when the Moon Bunnies will appear and start pounding the mill. Your task is to fight off the monsters to make sure that Moon Bunny can concentrate on making the best rice cake possible."); + } + } else if (status == 4) { + if (chosen == 0) { + cm.sendNextPrev("I would like for you and your party members to cooperate and get me 10 rice cakes. I strongly advise you to get me the rice cakes within the allotted time."); + } + } else { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1012115.js b/scripts/npc/1012115.js index 820d711761..9a4bed9e3c 100644 --- a/scripts/npc/1012115.js +++ b/scripts/npc/1012115.js @@ -1,6 +1,6 @@ function start() { var status = cm.getQuestStatus(20706); - + if (status == 0) { cm.sendNext("It looks like there's nothing suspicious in the area."); } else if (status == 1) { diff --git a/scripts/npc/1012117.js b/scripts/npc/1012117.js index ae73bdd415..37ad64215a 100644 --- a/scripts/npc/1012117.js +++ b/scripts/npc/1012117.js @@ -42,6 +42,7 @@ function pushIfItemExists(array, itemid) { array.push(itemid); } } + function start() { status = -1; action(1, 0, 0); @@ -51,11 +52,12 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendSimple("Hi, I'm #p1012117#, the most charming and stylish stylist around. If you're looking for the best looking hairdos around, look no further!\r\n\#L0##i5150040##t5150040##l\r\n\#L1##i5150044##t5150044##l"); } else if (status == 1) { @@ -64,32 +66,30 @@ function action(mode, type, selection) { cm.sendYesNo("If you use this REGULAR coupon, your hair may transform into a random new look...do you still want to do it using #b#t5150040##k, I will do it anyways for you. But don't forget, it will be random!"); } else { beauty = 2; - + hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { + for (var i = 0; i < mhair_v.length; i++) { pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } - } - else { - for(var i = 0; i < fhair_v.length; i++) { + } else { + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } - + cm.sendStyle("Using the SPECIAL coupon you can choose the style your hair will become. Pick the style that best provides you delight...", hairnew); } } else if (status == 2) { if (beauty == 1) { - if (cm.haveItem(5150040) == true){ + if (cm.haveItem(5150040) == true) { hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_r.length; i++) { + for (var i = 0; i < mhair_r.length; i++) { pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } - } - else { - for(var i = 0; i < fhair_r.length; i++) { + } else { + for (var i = 0; i < fhair_r.length; i++) { pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } } @@ -101,7 +101,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } else if (beauty == 2) { - if (cm.haveItem(5150044) == true){ + if (cm.haveItem(5150044) == true) { cm.gainItem(5150044, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -109,7 +109,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - + cm.dispose(); } } diff --git a/scripts/npc/1012118.js b/scripts/npc/1012118.js index b6fad8a434..d205ef23fd 100644 --- a/scripts/npc/1012118.js +++ b/scripts/npc/1012118.js @@ -9,41 +9,41 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { - cm.sendOk("This training ground is available only for those under level 20."); - cm.dispose(); - return; + if (cm.getLevel() >= 20) { + cm.sendOk("This training ground is available only for those under level 20."); + cm.dispose(); + } else if (cm.isQuestActive(22515) || cm.isQuestActive(22516) || cm.isQuestActive(22517) || cm.isQuestActive(22518)) { - cm.sendYesNo("Would you like to go in the special Training Center?"); - status = 1; - } else { - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + cm.sendYesNo("Would you like to go in the special Training Center?"); + status = 1; + } else { + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } else if (status == 2) { - cm.warp(910060100,0); - cm.dispose(); + cm.warp(910060100, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/1012119.js b/scripts/npc/1012119.js index 652b65b62e..c1b12ed8f3 100644 --- a/scripts/npc/1012119.js +++ b/scripts/npc/1012119.js @@ -9,42 +9,42 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { - cm.sendOk("This training ground is available only for those under level 20."); - cm.dispose(); - return; + if (cm.getLevel() >= 20) { + cm.sendOk("This training ground is available only for those under level 20."); + cm.dispose(); + } else if (cm.isQuestActive(22515) || cm.isQuestActive(22516) || cm.isQuestActive(22517) || cm.isQuestActive(22518)) { - cm.sendYesNo("Would you like to enter the special Training Center?"); - status = 1; - } else { - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + cm.sendYesNo("Would you like to enter the special Training Center?"); + status = 1; + } else { + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } else if (status == 2) { - cm.warp(910060100,0); - cm.dispose(); + cm.warp(910060100, 0); + cm.dispose(); } } diff --git a/scripts/npc/1013001.js b/scripts/npc/1013001.js index ba4813df37..fbc7c95989 100644 --- a/scripts/npc/1013001.js +++ b/scripts/npc/1013001.js @@ -5,20 +5,20 @@ function start() { } function action(mode, type, selection) { - if (mode == 0 && type == 0) { - status--; - } else if (mode == -1) { - cm.dispose(); - return; - } else { - status++; - } - if (status == 0) { - cm.sendNext("You, who are destined to be a Dragon Master... You have finally arrived.", 1); - } else if (status == 1) { - cm.sendNextPrev("Go and fulfill your duties as the Dragon Master...", 1); - } else if (status == 2) { - cm.warp(900090101, 0); - cm.dispose(); - } + if (mode == 0 && type == 0) { + status--; + } else if (mode == -1) { + cm.dispose(); + return; + } else { + status++; + } + if (status == 0) { + cm.sendNext("You, who are destined to be a Dragon Master... You have finally arrived.", 1); + } else if (status == 1) { + cm.sendNextPrev("Go and fulfill your duties as the Dragon Master...", 1); + } else if (status == 2) { + cm.warp(900090101, 0); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1013002.js b/scripts/npc/1013002.js index 37a3dcb556..0ff6be2b4f 100644 --- a/scripts/npc/1013002.js +++ b/scripts/npc/1013002.js @@ -1,6 +1,6 @@ function start() { - cm.forceCompleteQuest(22011); - cm.playerMessage(5, "You have acquired a Dragon Egg.");//actually getInfoMessage - cm.warp(900090103, 0); - cm.dispose(); + cm.forceCompleteQuest(22011); + cm.playerMessage(5, "You have acquired a Dragon Egg.");//actually getInfoMessage + cm.warp(900090103, 0); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1013104.js b/scripts/npc/1013104.js index 5d7cba0c69..51e810c3fb 100644 --- a/scripts/npc/1013104.js +++ b/scripts/npc/1013104.js @@ -1,13 +1,13 @@ function start() { - if (cm.isQuestStarted(22007)) { - if (!cm.haveItem(4032451)) { - cm.gainItem(4032451, true); - cm.sendNext("#b(You have obtained an Egg. Deliver it to Utah.)"); - } else { - cm.sendNext("#b(You have already obtained an Egg. Take the Egg you have and give it to Utah.)"); - } - } else { - cm.sendNext("#b(You don't need to take an egg now.)#k"); - } - cm.dispose(); + if (cm.isQuestStarted(22007)) { + if (!cm.haveItem(4032451)) { + cm.gainItem(4032451, true); + cm.sendNext("#b(You have obtained an Egg. Deliver it to Utah.)"); + } else { + cm.sendNext("#b(You have already obtained an Egg. Take the Egg you have and give it to Utah.)"); + } + } else { + cm.sendNext("#b(You don't need to take an egg now.)#k"); + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1013200.js b/scripts/npc/1013200.js index 4c8d44b57a..75d14b7e89 100644 --- a/scripts/npc/1013200.js +++ b/scripts/npc/1013200.js @@ -1,10 +1,10 @@ function start() { - if (!cm.isQuestStarted(22015)) { - cm.sendOk("#b(You are too far from the Piglet. Go closer to grab it.)"); - } else { - cm.gainItem(4032449, true); - cm.forceCompleteQuest(22015); - cm.playerMessage(5, "You have rescued the Piglet."); - } - cm.dispose(); + if (!cm.isQuestStarted(22015)) { + cm.sendOk("#b(You are too far from the Piglet. Go closer to grab it.)"); + } else { + cm.gainItem(4032449, true); + cm.forceCompleteQuest(22015); + cm.playerMessage(5, "You have rescued the Piglet."); + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/10200.js b/scripts/npc/10200.js index 19636b3db8..dc747a5ae1 100644 --- a/scripts/npc/10200.js +++ b/scripts/npc/10200.js @@ -27,17 +27,18 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0) - cm.sendNext("If you wish to experience what it's like to be a Bowman, come see me again."); + if (mode != 1) { + if (mode == 0) { + cm.sendNext("If you wish to experience what it's like to be a Bowman, come see me again."); + } cm.dispose(); return; } if (status == 0) { cm.sendYesNo("Would you like to experience what it's like to be a Bowman?"); - } else if (status == 1){ - cm.lockUI(); + } else if (status == 1) { + cm.lockUI(); cm.warp(1020300, 0); cm.dispose(); - } + } } \ No newline at end of file diff --git a/scripts/npc/10201.js b/scripts/npc/10201.js index a24c5461de..6b0655434b 100644 --- a/scripts/npc/10201.js +++ b/scripts/npc/10201.js @@ -27,16 +27,17 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0) - cm.sendNext("If you wish to experience what it's like to be a Magician, come see me again."); + if (mode != 1) { + if (mode == 0) { + cm.sendNext("If you wish to experience what it's like to be a Magician, come see me again."); + } cm.dispose(); return; } if (status == 0) { cm.sendYesNo("Would you like to experience what it's like to be a Magician?"); - } else if (status == 1){ - cm.lockUI(); + } else if (status == 1) { + cm.lockUI(); cm.warp(1020200, 0); cm.dispose(); } diff --git a/scripts/npc/10202.js b/scripts/npc/10202.js index 05a7f9e673..2d0d2bed2b 100644 --- a/scripts/npc/10202.js +++ b/scripts/npc/10202.js @@ -27,17 +27,18 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0) - cm.sendNext("If you wish to experience what it's like to be a Warrior, come see me again."); + if (mode != 1) { + if (mode == 0) { + cm.sendNext("If you wish to experience what it's like to be a Warrior, come see me again."); + } cm.dispose(); return; } if (status == 0) { cm.sendYesNo("Would you like to experience what it's like to be a Warrior?"); - } else if (status == 1){ - cm.lockUI(); + } else if (status == 1) { + cm.lockUI(); cm.warp(1020100, 0); - cm.dispose(); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/10203.js b/scripts/npc/10203.js index cf736b87f1..46be0af290 100644 --- a/scripts/npc/10203.js +++ b/scripts/npc/10203.js @@ -27,16 +27,17 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0) - cm.sendNext("If you wish to experience what it's like to be a Thief, come see me again."); + if (mode != 1) { + if (mode == 0) { + cm.sendNext("If you wish to experience what it's like to be a Thief, come see me again."); + } cm.dispose(); return; } if (status == 0) { cm.sendYesNo("Would you like to experience what it's like to be a Thief?"); - } else if (status == 1){ - cm.lockUI(); + } else if (status == 1) { + cm.lockUI(); cm.warp(1020400, 0); cm.dispose(); } diff --git a/scripts/npc/10204.js b/scripts/npc/10204.js index d96f9ecc87..a8687c2466 100644 --- a/scripts/npc/10204.js +++ b/scripts/npc/10204.js @@ -27,16 +27,17 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0) - cm.sendNext("If you wish to experience what it's like to be a Pirate, come see me again."); + if (mode != 1) { + if (mode == 0) { + cm.sendNext("If you wish to experience what it's like to be a Pirate, come see me again."); + } cm.dispose(); return; } if (status == 0) { cm.sendYesNo("Would you like to experience what it's like to be a Pirate?"); - } else if (status == 1){ - cm.lockUI(); + } else if (status == 1) { + cm.lockUI(); cm.warp(1020500, 0); cm.dispose(); } diff --git a/scripts/npc/1022000.js b/scripts/npc/1022000.js index 00ba0352ee..65bbb7995a 100644 --- a/scripts/npc/1022000.js +++ b/scripts/npc/1022000.js @@ -27,7 +27,7 @@ */ status = -1; -actionx = {"1stJob" : false, "2ndjob" : false, "3thJobI" : false, "3thJobC" : false}; +actionx = {"1stJob": false, "2ndjob": false, "3thJobI": false, "3thJobC": false}; job = 110; spawnPnpc = false; @@ -38,12 +38,12 @@ function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { if (cm.getJobId() == 0) { @@ -51,20 +51,21 @@ function start() { cm.sendNext("Do you want to become a #rwarrior#k? You need to meet some criteria in order to do so.#b You should be at least in level 10, and at least " + cm.getFirstJobStatRequirement(jobType) + "#k. Let's see..."); // thanks Vcoc for noticing a need to state and check requirements on first job adv starting message } else if (cm.getLevel() >= 30 && cm.getJobId() == 100) { actionx["2ndJob"] = true; - if (cm.haveItem(4031012)) + if (cm.haveItem(4031012)) { cm.sendNext("Oh... you came back safe! I knew you'd breeze through. I'll admit, you are a strong, formidable Warrior! Alright, I'll make you an even stronger Warrior than you already are. But before that, you need to choose one of the three paths that you'll be given. It isn't going to be easy, so if you have and questions, feel free to ask."); - else if (cm.haveItem(4031008)){ + } else if (cm.haveItem(4031008)) { cm.sendOk("Go and see the #b#p1072000##k."); cm.dispose(); - } else + } else { cm.sendNext("The progress you have made is astonishing."); + } } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && (cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 1 && !cm.getPlayer().gotPartyQuestItem("JBP")))) { actionx["3thJobI"] = true; cm.sendNext("I was waiting for you. Few days ago, I heard about you from #b#p2020008##k in Ossyria. Well... I'd like to test your strength. There is a secret passage near the ant tunnel. Nobody but you can go into that passage. If you go into the passage, you will meat my the other self. Beat him and bring #b#t4031059##k to me."); - } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)){ + } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)) { cm.sendNext("Please, bring me the #b#t4031059##k."); cm.dispose(); - } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")){ + } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")) { actionx["3thJobC"] = true; cm.sendNext("Wow... You beat my the other self and brought #b#t4031059##k to me. Good! this surely proves your strength. In terms of strength, you are ready to advance to 3th job. As I promised, I will give #b#t4031057##k to you. Give this necklace to #b#p2020008##k in Ossyria and you will be able to take second test of 3rd job advancement. Good Luck~"); } else { @@ -82,14 +83,14 @@ function action(mode, type, selection) { } else if (mode == 0 && type != 1) { status -= 2; } - - if (status == -1){ + + if (status == -1) { start(); return; } else { - if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -97,29 +98,30 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); return; } else { - if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJob"] && status == 1)){ - if (mode == 0 && status == 2 && type == 1) + if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJob"] && status == 1)) { + if (mode == 0 && status == 2 && type == 1) { cm.sendOk("Make up your mind and visit me again."); - if (!(mode == 0 && type != 1)){ + } + if (!(mode == 0 && type != 1)) { cm.dispose(); return; } } } } - - if (actionx["1stJob"]){ + + if (actionx["1stJob"]) { if (status == 0) { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { cm.sendNextPrev("It is an important and final choice. You will not be able to turn back."); @@ -127,9 +129,9 @@ function action(mode, type, selection) { cm.sendOk("Train a bit more until you reach the base requirements and I can show you the way of the #rWarrior#k."); cm.dispose(); } - } else if (status == 1){ - if (cm.canHold(1302077)){ - if (cm.getJobId() == 0){ + } else if (status == 1) { + if (cm.canHold(1302077)) { + if (cm.getJobId() == 0) { cm.changeJobById(100); cm.gainItem(1302077, 1); cm.resetStats(); @@ -139,76 +141,88 @@ function action(mode, type, selection) { cm.sendNext("Make some room in your inventory and talk back to me."); cm.dispose(); } - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You've gotten much stronger now. Plus every single one of your inventories have added slots. A whole row, to be exact. Go see for it yourself. I just gave you a little bit of #bSP#k. When you open up the #bSkill#k menu on the lower left corner of the screen, there are skills you can learn by using SP's. One warning, though: You can't raise it all together all at once. There are also skills you can acquire only after having learned a couple of skills first."); - else if (status == 3) + } else if (status == 3) { cm.sendNextPrev("Now a reminder. Once you have chosen, you cannot change up your mind and try to pick another path. Go now, and live as a proud Warrior."); - else + } else { cm.dispose(); - } else if(actionx["2ndJob"]){ - if (status == 0){ - if (cm.haveItem(4031012)) + } + } else if (actionx["2ndJob"]) { + if (status == 0) { + if (cm.haveItem(4031012)) { cm.sendSimple("Alright, when you have made your decision, click on [I'll choose my occupation] at the bottom.#b\r\n#L0#Please explain to me what being the Fighter is all about.\r\n#L1#Please explain to me what being the Page is all about.\r\n#L2#Please explain to me what being the Spearman is all about.\r\n#L3#I'll choose my occupation!"); - else { + } else { cm.sendNext("Good decision. You look strong, but I need to see if you really are strong enough to pass the test, it's not a difficult test, so you'll do just fine. Here, take my letter first... make sure you don't lose it!"); - if(!cm.isQuestStarted(100003)) cm.startQuest(100003); - } - } else if (status == 1){ - if (!cm.haveItem(4031012)){ - if (cm.canHold(4031008)){ - if(!cm.haveItem(4031008)) + if (!cm.isQuestStarted(100003)) { + cm.startQuest(100003); + } + } + } else if (status == 1) { + if (!cm.haveItem(4031012)) { + if (cm.canHold(4031008)) { + if (!cm.haveItem(4031008)) { cm.gainItem(4031008, 1); + } cm.sendNextPrev("Please get this letter to #b#p1072000##k who's around #b#m102020300##k near Perion. He is taking care of the job of an instructor in place of me. Give him the letter and he'll test you in place of me. Best of luck to you."); } else { cm.sendNext("Please, make some space in your inventory."); cm.dispose(); } - }else{ - if (selection < 3){ - if(selection == 0) { //fighter + } else { + if (selection < 3) { + if (selection == 0) { //fighter cm.sendNext("Warriors that master #rSwords or Axes#k.\r\n\r\n#rFighters#k get #bRage#k, which boosts your party's weapon attack by 10. During 2nd job this is strongly appreciated, as it is free (except for -10 wep def, which is not going to impact the damage you take much at all), takes no Use slots and increases each party member's damage (except Mages) by several hundreds. The other classes can give themselves a weapon attack boost as well, but need items to do so. #rFighters#k also get #bPower Guard#k, reducing touch damage by 40% and deals it back to the monster. This is the main reason why #rFighters#k are considered soloers is because this reduces pot costs immensely."); - } else if(selection == 1) { //page + } else if (selection == 1) { //page cm.sendNext("Warriors that master #rSwords or Maces/Blunt weapons#k.\r\n\r\n#rPages#k get #bThreaten#k, a skill that lowers the enemies' weapon defense and weapon attack by 20; this is mostly used to lower damage dealt to you. Pages also get #bPower Guard#k, reducing touch damage by 40% and deals it back to the monster. This is one of the main reason why #bPages/WKs#k are considered soloers, that's because this reduces pot costs immensely. Of course, constant KB and #bIce Charge#k helps also to the soloing factor."); } else { //spearman cm.sendNext("Warriors that master #rSpears or Polearms#k.\r\n\r\n#rSpearmen#k get #bHyper Body#k, which boosts your max HP/MP and that of your party by 60% when maxed. This skill is particularly useful for helping partied Thieves, Archers, and Mages to survive more hits from enemies and/or PQ bosses. They also get #bIron Will#k which gives +20 wep def and +20 mag def for 300 sec. It is basically a nerfed Bless with 100 seconds more duration but gives no accuracy or avoidability bonus. Even with this skill maxed, it isn't even close to being in the same league as Power Guard and is why Spearmen/Dark Knights are not considered a soloing class."); } - + status -= 2; - } else + } else { cm.sendSimple("Now... have you made up your mind? Please choose the job you'd like to select for your 2nd job advancement. #b\r\n#L0#Fighter\r\n#L1#Page\r\n#L2#Spearman"); + } } - } else if (status == 2){ - if (cm.haveItem(4031008)){ + } else if (status == 2) { + if (cm.haveItem(4031008)) { cm.dispose(); return; } job += selection * 10; cm.sendYesNo("So you want to make the second job advancement as the " + (job == 110 ? "#bFighter#k" : job == 120 ? "#bPage#k" : "#bSpearman#k") + "? You know you won't be able to choose a different job for the 2nd job advancement once you make your desicion here, right? Are you sure about this?"); - } else if (status == 3){ - if (cm.haveItem(4031012)) + } else if (status == 3) { + if (cm.haveItem(4031012)) { cm.gainItem(4031012, -1); - cm.completeQuest(100005); - - if(job == 110) cm.sendNext("Alright, you have now become the #bFighter#k. A fighter strives to become the strongest of the strong, and never stops fighting. Don't ever lose that will to fight, and push forward 24/7. I'll help you become even stronger than you already are."); - else if(job == 120) cm.sendNext("Alright, you have now become a #bPage#k! Pages have high intelligence and bravery, which I hope you'll employ throughout your journey to the right path. I'll help you become much stronger than you already are."); - else cm.sendNext("Alright, you have now become the #bSpearman#k. The Spearman use the power of darkness to take out the enemies, always in shadows... Please believe in yourself and your awesome power as you go in your journey. I'll help you become much stronger than you are right now."); - if (cm.getJobId() != job) + } + cm.completeQuest(100005); + + if (job == 110) { + cm.sendNext("Alright, you have now become the #bFighter#k. A fighter strives to become the strongest of the strong, and never stops fighting. Don't ever lose that will to fight, and push forward 24/7. I'll help you become even stronger than you already are."); + } else if (job == 120) { + cm.sendNext("Alright, you have now become a #bPage#k! Pages have high intelligence and bravery, which I hope you'll employ throughout your journey to the right path. I'll help you become much stronger than you already are."); + } else { + cm.sendNext("Alright, you have now become the #bSpearman#k. The Spearman use the power of darkness to take out the enemies, always in shadows... Please believe in yourself and your awesome power as you go in your journey. I'll help you become much stronger than you are right now."); + } + if (cm.getJobId() != job) { cm.changeJobById(job); - } else if (status == 4) + } + } else if (status == 4) { cm.sendNextPrev("I have just given you a book that gives you the list of skills you can acquire as a " + (job == 110 ? "fighter" : job == 120 ? "page" : "spearman") + ". Also your etc inventory has expanded by adding another row to it. Your max HP and MP have increased, too. Go check and see for it yourself."); - else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("I have also given you a little bit of #bSP#k. Open the #bSkill Menu#k located at the bottomleft corner. you'll be able to boost up the newer acquired 2nd level skills. A word of warning, though. You can't boost them up all at once. Some of the skills are only available after you have learned other skills. Make sure yo remember that."); - else if (status == 6) + } else if (status == 6) { cm.sendNextPrev((job == 110 ? "Fighter" : job == 120 ? "Page" : "Spearman") + " need to be strong. But remember that you can't abuse that power and use it on a weakling. Please use your enormous power the right way, because... for you to use that the right way, that is much harden than just getting stronger. Please find me after you have advanced much further. I'll be waiting for you."); - } else if (actionx["3thJobI"]){ - if (status == 0){ - if (cm.getPlayer().gotPartyQuestItem("JB3")){ + } + } else if (actionx["3thJobI"]) { + if (status == 0) { + if (cm.getPlayer().gotPartyQuestItem("JB3")) { cm.getPlayer().removePartyQuestItem("JB3"); cm.getPlayer().setPartyQuestItemObtained("JBP"); } cm.sendNextPrev("My the other self is quite strong. He uses many special skills and you should fight with him 1 on 1. However, people cannot stay long in the secret passage, so it is important to beat him ASAP. Well... Good luck I will look forward to you bringing #b#t4031059##k to me."); } - } else if (actionx["3thJobC"]){ + } else if (actionx["3thJobC"]) { cm.getPlayer().removePartyQuestItem("JBP"); cm.gainItem(4031059, -1); cm.gainItem(4031057, 1); diff --git a/scripts/npc/1022001.js b/scripts/npc/1022001.js index e7c5b53f3d..34ab757faa 100644 --- a/scripts/npc/1022001.js +++ b/scripts/npc/1022001.js @@ -20,34 +20,37 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { var selStr = ""; - if (cm.getJobId() == 0) + if (cm.getJobId() == 0) { selStr += "We have a special 90% discount for beginners."; + } selStr += "Choose your destination, for fees will change from place to place.#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 2) { - cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); + cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); selectedMap = selection; } else if (status == 3) { if (cm.getJobId() == 0) { - mesos = cost[selectedMap] / 10; + mesos = cost[selectedMap] / 10; } else { - mesos = cost[selectedMap]; + mesos = cost[selectedMap]; } - + if (cm.getMeso() < mesos) { cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab."); cm.dispose(); return; } - + cm.gainMeso(-mesos); cm.warp(maps[selectedMap], 0); cm.dispose(); diff --git a/scripts/npc/1022003.js b/scripts/npc/1022003.js index 9e0f6a07d3..325bfe4e56 100644 --- a/scripts/npc/1022003.js +++ b/scripts/npc/1022003.js @@ -45,172 +45,167 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Hm? Who might you be? Oh, you've heard about my forging skills? In that case, I'd be glad to process some of your ores... for a fee.#b" - var options = new Array("Refine a mineral ore","Refine a jewel ore","Upgrade a helmet","Upgrade a shield"); - for (var i = 0; i < options.length; i++){ + var options = ["Refine a mineral ore", "Refine a jewel ore", "Upgrade a helmet", "Upgrade a shield"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //mineral refine + if (selectedType == 0) { //mineral refine var selStr = "So, what kind of mineral ore would you like to refine?#b"; - var minerals = new Array ("Bronze","Steel","Mithril","Adamantium","Silver","Orihalcon","Gold"); - for (var i = 0; i < minerals.length; i++){ + var minerals = ["Bronze", "Steel", "Mithril", "Adamantium", "Silver", "Orihalcon", "Gold"]; + for (var i = 0; i < minerals.length; i++) { selStr += "\r\n#L" + i + "# " + minerals[i] + "#l"; } cm.sendSimple(selStr); equip = false; - } - else if (selectedType == 1){ //jewel refine + } else if (selectedType == 1) { //jewel refine var selStr = "So, what kind of jewel ore would you like to refine?#b"; - var jewels = new Array ("Garnet","Amethyst","Aquamarine","Emerald","Opal","Sapphire","Topaz","Diamond","Black Crystal"); - for (var i = 0; i < jewels.length; i++){ + var jewels = ["Garnet", "Amethyst", "Aquamarine", "Emerald", "Opal", "Sapphire", "Topaz", "Diamond", "Black Crystal"]; + for (var i = 0; i < jewels.length; i++) { selStr += "\r\n#L" + i + "# " + jewels[i] + "#l"; } cm.sendSimple(selStr); equip = false; - } - else if (selectedType == 2){ //helmet refine + } else if (selectedType == 2) { //helmet refine var selStr = "Ah, you wish to upgrade a helmet? Then tell me, which one?#b"; - var helmets = new Array ("Blue Metal Gear#k - Common Lv. 15#b","Yellow Metal Gear#k - Common Lv. 15#b","Metal Koif#k - Warrior Lv. 10#b","Mithril Koif#k - Warrior Lv. 10#b","Steel Helmet#k - Warrior Lv. 12#b","Mithril Helmet#k - Warrior Lv. 12#b","Steel Full Helm#k - Warrior Lv. 15#b", - "Mithril Full Helm#k - Warrior Lv. 15#b","Iron Viking Helm#k - Warrior Lv. 20#b","Mithril Viking Helm#k - Warrior Lv. 20#b","Steel Football Helmet#k - Warrior Lv. 20#b","Mithrill Football Helmet#k - Warrior Lv. 20#b","Mithril Sharp Helm#k - Warrior Lv. 22#b","Gold Sharp Helm#k - Warrior Lv. 22#b", - "Orihalcon Burgernet Helm#k - Warrior Lv. 25#b","Gold Burgernet Helm#k - Warrior Lv. 25#b","Great Red Helmet#k - Warrior Lv. 35#b","Great Blue Helmet#k - Warrior Lv. 35#b","Mithril Nordic Helm#k - Warrior Lv. 40#b","Gold Nordic Helm#k - Warrior Lv. 40#b","Mithril Crusader Helm#k - Warrior Lv. 50#b", - "Silver Crusader Helm#k - Warrior Lv. 50#b","Old Steel Nordic Helm#k - Warrior Lv. 55#b","Old Mithril Nordic Helm#k - Warrior Lv. 55#b"); - for (var i = 0; i < helmets.length; i++){ + var helmets = ["Blue Metal Gear#k - Common Lv. 15#b", "Yellow Metal Gear#k - Common Lv. 15#b", "Metal Koif#k - Warrior Lv. 10#b", "Mithril Koif#k - Warrior Lv. 10#b", "Steel Helmet#k - Warrior Lv. 12#b", "Mithril Helmet#k - Warrior Lv. 12#b", "Steel Full Helm#k - Warrior Lv. 15#b", + "Mithril Full Helm#k - Warrior Lv. 15#b", "Iron Viking Helm#k - Warrior Lv. 20#b", "Mithril Viking Helm#k - Warrior Lv. 20#b", "Steel Football Helmet#k - Warrior Lv. 20#b", "Mithrill Football Helmet#k - Warrior Lv. 20#b", "Mithril Sharp Helm#k - Warrior Lv. 22#b", "Gold Sharp Helm#k - Warrior Lv. 22#b", + "Orihalcon Burgernet Helm#k - Warrior Lv. 25#b", "Gold Burgernet Helm#k - Warrior Lv. 25#b", "Great Red Helmet#k - Warrior Lv. 35#b", "Great Blue Helmet#k - Warrior Lv. 35#b", "Mithril Nordic Helm#k - Warrior Lv. 40#b", "Gold Nordic Helm#k - Warrior Lv. 40#b", "Mithril Crusader Helm#k - Warrior Lv. 50#b", + "Silver Crusader Helm#k - Warrior Lv. 50#b", "Old Steel Nordic Helm#k - Warrior Lv. 55#b", "Old Mithril Nordic Helm#k - Warrior Lv. 55#b"]; + for (var i = 0; i < helmets.length; i++) { selStr += "\r\n#L" + i + "# " + helmets[i] + "#l"; } cm.sendSimple(selStr); equip = true; - } - else if (selectedType == 3){ //shield refine + } else if (selectedType == 3) { //shield refine var selStr = "Ah, you wish to upgrade a shield? Then tell me, which one?#b"; - var shields = new Array ("Adamantium Tower Shield#k - Warrior Lv. 40#b","Mithril Tower Shield#k - Warrior Lv. 40#b","Silver Legend Shield#k - Warrior Lv. 60#b","Adamantium Legend Shield#k - Warrior Lv. 60#b"); - for (var i = 0; i < shields.length; i++){ + var shields = ["Adamantium Tower Shield#k - Warrior Lv. 40#b", "Mithril Tower Shield#k - Warrior Lv. 40#b", "Silver Legend Shield#k - Warrior Lv. 60#b", "Adamantium Legend Shield#k - Warrior Lv. 60#b"]; + for (var i = 0; i < shields.length; i++) { selStr += "\r\n#L" + i + "# " + shields[i] + "#l"; } cm.sendSimple(selStr); equip = true; } - if (equip) + if (equip) { status++; - } - else if (status == 2 && mode == 1) { + } + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //mineral refine - var itemSet = new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006); - var matSet = new Array(4010000,4010001,4010002,4010003,4010004,4010005,4010006); - var matQtySet = new Array(10,10,10,10,10,10,10); - var costSet = new Array(300,300,300,500,500,500,800); + if (selectedType == 0) { //mineral refine + var itemSet = [4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006]; + var matSet = [4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10]; + var costSet = [300, 300, 300, 500, 500, 500, 800]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //jewel refine + var itemSet = [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]; + var matSet = [4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10, 10, 10]; + var costSet = [500, 500, 500, 500, 500, 500, 500, 1000, 3000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //jewel refine - var itemSet = new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008); - var matSet = new Array(4020000,4020001,4020002,4020003,4020004,4020005,4020006,4020007,4020008); - var matQtySet = new Array(10,10,10,10,10,10,10,10,10); - var costSet = new Array (500,500,500,500,500,500,500,1000,3000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - - cm.sendGetNumber(prompt,1,1,100) - } - else if (status == 3 && mode == 1) { - if (equip) - { + + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3 && mode == 1) { + if (equip) { selectedItem = selection; qty = 1; - } - else + } else { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } - if (selectedType == 2){ //helmet refine - var itemSet = new Array(1002042,1002041,1002002,1002044,1002003,1002040,1002007,1002052,1002011,1002058,1002009,1002056,1002087,1002088,1002050,1002049,1002047,1002048,1002099,1002098,1002085,1002028,1002022,1002101); - var matSet = new Array(new Array(1002001,4011002),new Array(1002001,4021006),new Array(1002043,4011001),new Array(1002043,4011002),new Array(1002039,4011001),new Array(1002039,4011002),new Array(1002051,4011001),new Array(1002051,4011002),new Array(1002059,4011001),new Array(1002059,4011002), - new Array(1002055,4011001),new Array(1002055,4011002),new Array(1002027,4011002),new Array(1002027,4011006),new Array(1002005,4011005),new Array(1002005,4011006),new Array(1002004,4021000),new Array(1002004,4021005),new Array(1002021,4011002),new Array(1002021,4011006),new Array(1002086,4011002), - new Array(1002086,4011004),new Array(1002100,4011007,4011001),new Array(1002100,4011007,4011002)); - var matQtySet = new Array(new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,2),new Array(1,2),new Array(1,3),new Array(1,3),new Array(1,3),new Array(1,3),new Array(1,4),new Array(1,4),new Array(1,5),new Array(1,5),new Array(1,3),new Array(1,3), - new Array(1,5),new Array(1,6),new Array(1,5),new Array(1,4),new Array(1,1,7),new Array(1,1,7)); - var costSet = new Array(500,300,500,800,500,800,1000,1500,1500,2000,1500,2000,2000,4000,4000,5000,8000,10000,12000,15000,20000,25000,30000,30000); + if (selectedType == 2) { //helmet refine + var itemSet = [1002042, 1002041, 1002002, 1002044, 1002003, 1002040, 1002007, 1002052, 1002011, 1002058, 1002009, 1002056, 1002087, 1002088, 1002050, 1002049, 1002047, 1002048, 1002099, 1002098, 1002085, 1002028, 1002022, 1002101]; + var matSet = [[1002001, 4011002], [1002001, 4021006], [1002043, 4011001], [1002043, 4011002], [1002039, 4011001], [1002039, 4011002], [1002051, 4011001], [1002051, 4011002], [1002059, 4011001], [1002059, 4011002], + [1002055, 4011001], [1002055, 4011002], [1002027, 4011002], [1002027, 4011006], [1002005, 4011005], [1002005, 4011006], [1002004, 4021000], [1002004, 4021005], [1002021, 4011002], [1002021, 4011006], [1002086, 4011002], + [1002086, 4011004], [1002100, 4011007, 4011001], [1002100, 4011007, 4011002]]; + var matQtySet = [[1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 2], [1, 2], [1, 3], [1, 3], [1, 3], [1, 3], [1, 4], [1, 4], [1, 5], [1, 5], [1, 3], [1, 3], + [1, 5], [1, 6], [1, 5], [1, 4], [1, 1, 7], [1, 1, 7]]; + var costSet = [500, 300, 500, 800, 500, 800, 1000, 1500, 1500, 2000, 1500, 2000, 2000, 4000, 4000, 5000, 8000, 10000, 12000, 15000, 20000, 25000, 30000, 30000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //shield refine - var itemSet = new Array (1092014,1092013,1092010,1092011); - var matSet = new Array(new Array (1092012,4011003),new Array (1092012,4011002),new Array (1092009,4011007,4011004),new Array (1092009,4011007,4011003)); - var matQtySet = new Array (new Array (1,10),new Array (1,10),new Array (1,1,15),new Array (1,1,15)); - var costSet = new Array (100000,100000,120000,120000); + } else if (selectedType == 3) { //shield refine + var itemSet = [1092014, 1092013, 1092010, 1092011]; + var matSet = [[1092012, 4011003], [1092012, 4011002], [1092009, 4011007, 4011004], [1092009, 4011007, 4011003]]; + var matQtySet = [[1, 10], [1, 10], [1, 1, 15], [1, 1, 15]]; + var costSet = [100000, 100000, 120000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array) - for(var i = 0; i < mats.length; i++) - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; } - if (cost > 0) + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; + } + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; + } cm.sendYesNo(prompt); - } - else if (status == 4 && mode == 1) { + } else if (status == 4 && mode == 1) { var complete = true; - - if(!cm.canHold(item, qty)) { + + if (!cm.canHold(item, qty)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost * qty) - { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("I'm afraid you cannot afford my services."); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; - } - if (!complete) + } + } + if (!complete) { cm.sendOk("I'm afraid you're missing something for the item you want. See you another time, yes?"); - else { - if (mats instanceof Array) - for (var i = 0; i < mats.length; i++) + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); - else + } + } else { cm.gainItem(mats, -matQty * qty); + } cm.gainMeso(-cost * qty); - cm.gainItem(item,qty); + cm.gainItem(item, qty); cm.sendOk("There, finished. What do you think, a piece of art, isn't it? Well, if you need anything else, you nkow where to find me."); } cm.dispose(); diff --git a/scripts/npc/1022004.js b/scripts/npc/1022004.js index 04f0f6e46d..9aa04e65ef 100644 --- a/scripts/npc/1022004.js +++ b/scripts/npc/1022004.js @@ -44,170 +44,166 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Um... Hi, I'm Mr. Thunder's apprentice. He's getting up there in age, so he handles most of the heavy-duty work while I handle some of the lighter jobs. What can I do for you?#b" - var options = new Array("Make a glove","Upgrade a glove","Create materials"); - for (var i = 0; i < options.length; i++){ + var options = ["Make a glove", "Upgrade a glove", "Create materials"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //glove refine + if (selectedType == 0) { //glove refine var selStr = "Okay, so which glove do you want me to make?#b"; - var items = new Array ("Juno#k - Warrior Lv. 10#b","Steel Fingerless Gloves#k - Warrior Lv. 15#b","Venon#k - Warrior Lv. 20#b","White Fingerless Gloves#k - Warrior Lv. 25#b", - "Bronze Missel#k - Warrior Lv. 30#b","Steel Briggon#k - Warrior Lv. 35#b","Iron Knuckle#k - Warrior Lv. 40#b","Steel Brist#k - Warrior Lv. 50#b","Bronze Clench#k - Warrior Lv. 60#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Juno#k - Warrior Lv. 10#b", "Steel Fingerless Gloves#k - Warrior Lv. 15#b", "Venon#k - Warrior Lv. 20#b", "White Fingerless Gloves#k - Warrior Lv. 25#b", + "Bronze Missel#k - Warrior Lv. 30#b", "Steel Briggon#k - Warrior Lv. 35#b", "Iron Knuckle#k - Warrior Lv. 40#b", "Steel Brist#k - Warrior Lv. 50#b", "Bronze Clench#k - Warrior Lv. 60#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); equip = true; - } - else if (selectedType == 1){ //glove upgrade + } else if (selectedType == 1) { //glove upgrade var selStr = "Upgrade a glove? That shouldn't be too difficult. Which did you have in mind?#b"; - var crystals = new Array ("Steel Missel#k - Warrior Lv. 30#b","Orihalcon Missel#k - Warrior Lv. 30#b","Yellow Briggon#k - Warrior Lv. 35#b","Dark Briggon#k - Warrior Lv. 35#b", - "Adamantium Knuckle#k - Warrior Lv. 40#b","Dark Knuckle#k - Warrior Lv. 40#b","Mithril Brist#k - Warrior Lv. 50#b","Gold Brist#k - Warrior Lv. 50#b", - "Sapphire Clench#k - Warrior Lv. 60#b","Dark Clench#k - Warrior Lv. 60#b"); - for (var i = 0; i < crystals.length; i++){ + var crystals = ["Steel Missel#k - Warrior Lv. 30#b", "Orihalcon Missel#k - Warrior Lv. 30#b", "Yellow Briggon#k - Warrior Lv. 35#b", "Dark Briggon#k - Warrior Lv. 35#b", + "Adamantium Knuckle#k - Warrior Lv. 40#b", "Dark Knuckle#k - Warrior Lv. 40#b", "Mithril Brist#k - Warrior Lv. 50#b", "Gold Brist#k - Warrior Lv. 50#b", + "Sapphire Clench#k - Warrior Lv. 60#b", "Dark Clench#k - Warrior Lv. 60#b"]; + for (var i = 0; i < crystals.length; i++) { selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; } cm.sendSimple(selStr); equip = true; - } - else if (selectedType == 2){ //material refine + } else if (selectedType == 2) { //material refine var selStr = "Materials? I know of a few materials that I can make for you...#b"; - var materials = new Array ("Make Processed Wood with Tree Branch","Make Processed Wood with Firewood","Make Screws (packs of 15)"); - for (var i = 0; i < materials.length; i++){ + var materials = ["Make Processed Wood with Tree Branch", "Make Processed Wood with Firewood", "Make Screws (packs of 15)"]; + for (var i = 0; i < materials.length; i++) { selStr += "\r\n#L" + i + "# " + materials[i] + "#l"; } cm.sendSimple(selStr); equip = false; } - if (equip) + if (equip) { status++; - } - else if (status == 2 && mode == 1) { + } + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 2){ //material refine - var itemSet = new Array (4003001,4003001,4003000); - var matSet = new Array(4000003,4000018,new Array (4011000,4011001)); - var matQtySet = new Array (10,5,new Array (1,1)); - var costSet = new Array (0,0,0); + if (selectedType == 2) { //material refine + var itemSet = [4003001, 4003001, 4003000]; + var matSet = [4000003, 4000018, [4011000, 4011001]]; + var matQtySet = [10, 5, [1, 1]]; + var costSet = [0, 0, 0]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - + var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - - cm.sendGetNumber(prompt,1,1,100) - } - else if (status == 3 && mode == 1) { - if (equip) - { + + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3 && mode == 1) { + if (equip) { selectedItem = selection; qty = 1; - } - else + } else { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } - if (selectedType == 0){ //glove refine - var itemSet = new Array(1082003,1082000,1082004,1082001,1082007,1082008,1082023,1082009,1082059); - var matSet = new Array(new Array(4000021,4011001),4011001,new Array(4000021,4011000),4011001,new Array(4011000,4011001,4003000),new Array(4000021,4011001,4003000),new Array(4000021,4011001,4003000), - new Array(4011001,4021007,4000030,4003000),new Array(4011007,4011000,4011006,4000030,4003000)); - var matQtySet = new Array(new Array(15,1),2,new Array(40,2),2,new Array(3,2,15),new Array(30,4,15),new Array(50,5,40),new Array(3,2,30,45),new Array(1,8,2,50,50)); - var costSet = new Array(1000,2000,5000,10000,20000,30000,40000,50000,70000); + if (selectedType == 0) { //glove refine + var itemSet = [1082003, 1082000, 1082004, 1082001, 1082007, 1082008, 1082023, 1082009, 1082059]; + var matSet = [[4000021, 4011001], 4011001, [4000021, 4011000], 4011001, [4011000, 4011001, 4003000], [4000021, 4011001, 4003000], [4000021, 4011001, 4003000], + [4011001, 4021007, 4000030, 4003000], [4011007, 4011000, 4011006, 4000030, 4003000]]; + var matQtySet = [[15, 1], 2, [40, 2], 2, [3, 2, 15], [30, 4, 15], [50, 5, 40], [3, 2, 30, 45], [1, 8, 2, 50, 50]]; + var costSet = [1000, 2000, 5000, 10000, 20000, 30000, 40000, 50000, 70000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //glove upgrade + var itemSet = [1082005, 1082006, 1082035, 1082036, 1082024, 1082025, 1082010, 1082011, 1082060, 1082061]; + var matSet = [[1082007, 4011001], [1082007, 4011005], [1082008, 4021006], [1082008, 4021008], [1082023, 4011003], [1082023, 4021008], + [1082009, 4011002], [1082009, 4011006], [1082059, 4011002, 4021005], [1082059, 4021007, 4021008]]; + var matQtySet = [[1, 1], [1, 2], [1, 3], [1, 1], [1, 4], [1, 2], [1, 5], [1, 4], [1, 3, 5], [1, 2, 2]]; + var costSet = [20000, 25000, 30000, 40000, 45000, 50000, 55000, 60000, 70000, 80000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //glove upgrade - var itemSet = new Array(1082005,1082006,1082035,1082036,1082024,1082025,1082010,1082011,1082060,1082061); - var matSet = new Array(new Array(1082007,4011001),new Array(1082007,4011005),new Array(1082008,4021006),new Array(1082008,4021008),new Array(1082023,4011003),new Array(1082023,4021008), - new Array(1082009,4011002),new Array(1082009,4011006),new Array(1082059,4011002,4021005),new Array(1082059,4021007,4021008)); - var matQtySet = new Array (new Array(1,1),new Array(1,2),new Array(1,3),new Array(1,1),new Array(1,4),new Array(1,2),new Array(1,5),new Array(1,4),new Array(1,3,5),new Array(1,2,2)); - var costSet = new Array (20000,25000,30000,40000,45000,50000,55000,60000,70000,80000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - + } + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 4 && mode == 1) { + } else if (status == 4 && mode == 1) { var complete = true; var recvItem = item, recvQty; - + if (item == 4003000)//screws + { recvQty = 15 * qty; - else + } else { recvQty = qty; - - if(!cm.canHold(recvItem, recvQty)) { + } + + if (!cm.canHold(recvItem, recvQty)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost * qty) - { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("I may still be an apprentice, but I do need to earn a living."); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; + } } - - if (!complete) + + if (!complete) { cm.sendOk("I'm still an apprentice, I don't know if I can substitute other items in yet... Can you please bring what the recipe calls for?"); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } - } - else + } else { cm.gainItem(mats, -matQty * qty); - - if (cost > 0) + } + + if (cost > 0) { cm.gainMeso(-cost * qty); - + } + cm.gainItem(recvItem, recvQty); cm.sendOk("Did that come out right? Come by me again if you have anything for me to practice on."); } diff --git a/scripts/npc/1022101.js b/scripts/npc/1022101.js index 543d0cd9a3..8fe474838a 100644 --- a/scripts/npc/1022101.js +++ b/scripts/npc/1022101.js @@ -17,38 +17,39 @@ Jan Christian Meyer You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -*/ - -/** -Rooney - Happyville Warp NPC -**/ +*/ + +/** + Rooney - Happyville Warp NPC + **/ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendYesNo("Santa told me to go to here, only he didn't told me when... I hope I'm here on the right time! Oh! By the way, I'm Rooney, I can take you to #bHappyVille#k. Are you ready to go?"); - } else { - cm.getPlayer().saveLocation("HAPPYVILLE"); - cm.warp(209000000, 0); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("Santa told me to go to here, only he didn't told me when... I hope I'm here on the right time! Oh! By the way, I'm Rooney, I can take you to #bHappyVille#k. Are you ready to go?"); + } else { + cm.getPlayer().saveLocation("HAPPYVILLE"); + cm.warp(209000000, 0); + cm.dispose(); + } + } } diff --git a/scripts/npc/1022101_old.js b/scripts/npc/1022101_old.js index aeb35fb4de..98d0034156 100644 --- a/scripts/npc/1022101_old.js +++ b/scripts/npc/1022101_old.js @@ -26,9 +26,9 @@ var itemToUse = 4001126; -var chairs = new Array(3010000, 3010001, 3010002, 3010003, 3010004, 3010005, 3010006, 3010007, 3010008, 3010009, 3010010, 3010011, 3010012, 3010013, 3010015, 3010016, 3010017, 3010018, 3010019, 3010022, 3010023, 3010024, 3010025, 3010026, 3010028, 3010040, 3010041, 3010043, 3010045, 3010046, 3010047,3010057,3010058,3010060,3010061,3010062,3010063, 3010064,3010065,3010066,3010067,3010069,3010071,3010072,3010073,3010080,3010081,3010082,3010083, 3010084,3010085,3010097,3010098,3010099,3010101,3010106,3010116,3011000,3012005,3012010,3012011); -var scrolls = new Array(2040603,2044503,2041024,2041025,2044703,2044603,2043303,2040807,2040806,2040006,2040007,2043103,2043203,2043003,2040506,2044403,2040903,2040709,2040710,2040711,2044303,2043803,2040403,2044103,2044203,2044003,2043703); -var weapons = new Array(1302020, 1302030, 1302033, 1302058, 1302064, 1302080, 1312032, 1322054, 1332025, 1332055, 1332056, 1372034, 1382009, 1382012, 1382039, 1402039, 1412011, 1412027, 1422014, 1422029, 1432012, 1432040, 1432046, 1442024, 1442030, 1442051, 1452016, 1452022, 1452045, 1462014, 1462019, 1462040, 1472030, 1472032, 1472055, 1482020, 1482021, 1482022, 1492020, 1492021, 1492022, 1092030, 1092045, 1092046, 1092047); +var chairs = [3010000, 3010001, 3010002, 3010003, 3010004, 3010005, 3010006, 3010007, 3010008, 3010009, 3010010, 3010011, 3010012, 3010013, 3010015, 3010016, 3010017, 3010018, 3010019, 3010022, 3010023, 3010024, 3010025, 3010026, 3010028, 3010040, 3010041, 3010043, 3010045, 3010046, 3010047, 3010057, 3010058, 3010060, 3010061, 3010062, 3010063, 3010064, 3010065, 3010066, 3010067, 3010069, 3010071, 3010072, 3010073, 3010080, 3010081, 3010082, 3010083, 3010084, 3010085, 3010097, 3010098, 3010099, 3010101, 3010106, 3010116, 3011000, 3012005, 3012010, 3012011]; +var scrolls = [2040603, 2044503, 2041024, 2041025, 2044703, 2044603, 2043303, 2040807, 2040806, 2040006, 2040007, 2043103, 2043203, 2043003, 2040506, 2044403, 2040903, 2040709, 2040710, 2040711, 2044303, 2043803, 2040403, 2044103, 2044203, 2044003, 2043703]; +var weapons = [1302020, 1302030, 1302033, 1302058, 1302064, 1302080, 1312032, 1322054, 1332025, 1332055, 1332056, 1372034, 1382009, 1382012, 1382039, 1402039, 1412011, 1412027, 1422014, 1422029, 1432012, 1432040, 1432046, 1442024, 1442030, 1442051, 1452016, 1452022, 1452045, 1462014, 1462019, 1462040, 1472030, 1472032, 1472055, 1482020, 1482021, 1482022, 1492020, 1492021, 1492022, 1092030, 1092045, 1092046, 1092047]; var nxAmount = 3000; var chairAmount = 2; @@ -41,176 +41,182 @@ var buff2ID = 2022179; var status; var vp; var choice; - + function start() { - //vp = cm.getClient().getVotePoints(); - //if(vp == null) - vp = 0; - + //vp = cm.getClient().getVotePoints(); + //if(vp == null) + vp = 0; + status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - if(cm.getPlayer().getLevel() < 20) { - cm.sendOk("Hello, I am the Vote Point exchanger for #rMapleSolaxia#k!\r\n\r\nI am sorry, but I can only exchange Vote Points for players #blevel 20 or over#k."); - cm.dispose(); - return; - } - var outStr = "Hello, I am the Vote Point exchanger for #rMapleSolaxia#k!\r\n"; - outStr += "You currently have #r#c" + itemToUse + "##k #t" + itemToUse + "# and #r" + vp + "#k Vote Points.#b\r\n\r\n"; - outStr += "#L0#I would like to exchange my vote points for Maple Leaves#l\r\n"; - outStr += "#L1#I would like to exchange 1 #t" + itemToUse + "# for "+ nxAmount + " NX Cash#l\r\n"; - outStr += "#L2#I would like to exchange 1 #t" + itemToUse + "# for " + chairAmount + " Random Chair" + (chairAmount > 1 ? "s" : "") + "#l\r\n"; - outStr += "#L3#I would like to exchange 1 #t" + itemToUse + "# for " + weaponAmount + " Maple Weapons#l\r\n"; - outStr += "#L4#I would like to exchange 1 #t" + itemToUse + "# for " + buffAmount + " #t" + buff1ID + "#s and " + buffAmount + " #t" + buff2ID + "#s#l\r\n"; - outStr += "#L5#I would like to exchange 1 #t" + itemToUse + "# for a " + hiredMerchantLength + " Day Hired Merchant#l\r\n"; - cm.sendSimple(outStr); - } else if(status == 1) { - choice = selection; - - if(selection > 0) { - if(!cm.haveItem(itemToUse) && vp == 0) { - cm.sendOk("I'm sorry, but you don't have any #t" +itemToUse + " or Vote Points."); - cm.dispose(); - return; - } - } - - if(selection == 0) { - // Exchange VP for leaves - if(vp <= 0) { - cm.sendOk("I'm sorry, but you don't have any Vote Points to exchange!"); - cm.dispose(); - return; - } - cm.sendYesNo("Would you like to exchange " + vp + " Vote Point" + (vp > 0 ? "s" : "") + " for " + vp + " #t" + itemToUse + "# " + (vp > 0 ? "s" : "") + "?"); - } else if(selection == 1) { - // Exchange 1 Leaf for Cash - cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + nxAmount + " NX Cash?"); - } else if(selection == 2) { - // Exchange 1 Leaf for Chair - cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + chairAmount + " Random Chair" + (chairAmount > 1 ? "s" : "") + "?"); - } else if(selection == 3) { - // Exchange 1 Leaf for Maple Weapons - cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + weaponAmount + " Random Maple Weapons?"); - } else if(selection == 4) { - // Exchange 1 Leaf for Apples/Cheese - cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + buffAmount + " #t" + buff1ID + "# and #t" + buff2ID + "#?"); - } else if(selection == 5) { - // Echange 1 Leaf for Merchant - cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for a " + hiredMerchantLength + " Day Hired Merchant?"); - } else { - cm.dispose(); - } - } else if(status == 2) { - var useVP = false; - if(!cm.hasItem(itemToUse) && vp > 0) - useVP = true; + if (cm.getPlayer().getLevel() < 20) { + cm.sendOk("Hello, I am the Vote Point exchanger for #rMapleSolaxia#k!\r\n\r\nI am sorry, but I can only exchange Vote Points for players #blevel 20 or over#k."); + cm.dispose(); + return; + } + var outStr = "Hello, I am the Vote Point exchanger for #rMapleSolaxia#k!\r\n"; + outStr += "You currently have #r#c" + itemToUse + "##k #t" + itemToUse + "# and #r" + vp + "#k Vote Points.#b\r\n\r\n"; + outStr += "#L0#I would like to exchange my vote points for Maple Leaves#l\r\n"; + outStr += "#L1#I would like to exchange 1 #t" + itemToUse + "# for " + nxAmount + " NX Cash#l\r\n"; + outStr += "#L2#I would like to exchange 1 #t" + itemToUse + "# for " + chairAmount + " Random Chair" + (chairAmount > 1 ? "s" : "") + "#l\r\n"; + outStr += "#L3#I would like to exchange 1 #t" + itemToUse + "# for " + weaponAmount + " Maple Weapons#l\r\n"; + outStr += "#L4#I would like to exchange 1 #t" + itemToUse + "# for " + buffAmount + " #t" + buff1ID + "#s and " + buffAmount + " #t" + buff2ID + "#s#l\r\n"; + outStr += "#L5#I would like to exchange 1 #t" + itemToUse + "# for a " + hiredMerchantLength + " Day Hired Merchant#l\r\n"; + cm.sendSimple(outStr); + } else if (status == 1) { + choice = selection; - const InventoryType = Java.type('client.inventory.InventoryType'); - if(choice == 0) { - // VP Exchange - if(!cm.canHold(itemToUse)) { - cm.sendOk("It looks like you don't have enough space in your #rETC#k inventory to hold the #t" + itemToUse + "#" + (vp > 0 ? "s" : "") + "."); - cm.dispose(); - return; - } - - cm.getClient().useVotePoints(vp); - cm.gainItem(itemToUse, vp); - cm.dispose(); - } else if(choice == 1) { - // Leaf for Cash - if(useVP) - cm.getClient().useVotePoints(1); - else - cm.gainItem(itemToUse, -1); - - cm.getPlayer().getCashShop().gainCash(1, nxAmount); - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getPlayer().sendPacket(PacketCreator.earnTitleMessage("You have earned " + nxAmount + " NX")); - cm.logLeaf(nxAmount + " NX"); - cm.dispose(); - } else if(choice == 2) { - if(!cm.getPlayer().getInventory(InventoryType.SETUP).isFull(chairAmount)) { - - var chairStr = ""; - for(var i = 0; i < chairAmount; i++) { - var chair = chairs[Math.floor(Math.random() * chairs.length)]; - cm.gainItem(chair, 1, true); - chairStr += chair + " "; - } - - if(useVP) - cm.getClient().useVotePoints(1); - else - cm.gainItem(itemToUse, -1); - - cm.logLeaf("Chair ID: " + chairStr); - cm.dispose(); - } else { - cm.sendOk("Please make sure you have enough space to hold the items!"); - } - } else if(choice == 3) { - if(!cm.getPlayer().getInventory(InventoryType.EQUIP).isFull(weaponAmount)) { - - var weaponStr = ""; - for(var i = 0; i < weaponAmount; i++) { - var weapon = weapons[Math.floor(Math.random() * weapons.length)]; - cm.gainItem(weapon, 1, true, true); - weaponStr += weapon + " "; - } - - if(useVP) - cm.getClient().useVotePoints(1); - else - cm.gainItem(itemToUse, -1); - - cm.logLeaf("Maple Weapon IDs: " + weaponStr); - cm.dispose(); - } else { - cm.sendOk("Please make sure you have enough space to hold the items!"); - } - } else if(choice == 4) { - if(!cm.getPlayer().getInventory(InventoryType.USE).isFull(2)) { - cm.gainItem(buff1ID, buffAmount, true); - cm.gainItem(buff2ID, buffAmount, true); - cm.gainItem(itemToUse, -1); - cm.logLeaf(buffAmount + " cheeses and apples"); - cm.dispose(); - } else { - cm.sendOk("Please make sure you have enough space to hold the items!"); - } - } else if(choice == 5) { - if(!cm.haveItem(5030000, 1)) { - if(!cm.getPlayer().getInventory(InventoryType.CASH).isFull(1)){ - cm.gainItem(5030000, 1, false, true, 1000 * 60 * 60 * 24 * hiredMerchantLength); - - if(useVP) - cm.getClient().useVotePoints(1); - else - cm.gainItem(itemToUse, -1); - - cm.logLeaf(hiredMerchantLength + " day hired merchant"); - cm.dispose(); - } else { - cm.sendOk("Please make sure you have enough space to hold these items!"); - } - } else { - cm.sendOk("I can't give you a merchant if you already have one!"); - } - } - } else { - cm.dispose(); - } + if (selection > 0) { + if (!cm.haveItem(itemToUse) && vp == 0) { + cm.sendOk("I'm sorry, but you don't have any #t" + itemToUse + " or Vote Points."); + cm.dispose(); + return; + } + } + + if (selection == 0) { + // Exchange VP for leaves + if (vp <= 0) { + cm.sendOk("I'm sorry, but you don't have any Vote Points to exchange!"); + cm.dispose(); + return; + } + cm.sendYesNo("Would you like to exchange " + vp + " Vote Point" + (vp > 0 ? "s" : "") + " for " + vp + " #t" + itemToUse + "# " + (vp > 0 ? "s" : "") + "?"); + } else if (selection == 1) { + // Exchange 1 Leaf for Cash + cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + nxAmount + " NX Cash?"); + } else if (selection == 2) { + // Exchange 1 Leaf for Chair + cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + chairAmount + " Random Chair" + (chairAmount > 1 ? "s" : "") + "?"); + } else if (selection == 3) { + // Exchange 1 Leaf for Maple Weapons + cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + weaponAmount + " Random Maple Weapons?"); + } else if (selection == 4) { + // Exchange 1 Leaf for Apples/Cheese + cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for " + buffAmount + " #t" + buff1ID + "# and #t" + buff2ID + "#?"); + } else if (selection == 5) { + // Echange 1 Leaf for Merchant + cm.sendYesNo("Would you like to exchange 1 #t" + itemToUse + "# for a " + hiredMerchantLength + " Day Hired Merchant?"); + } else { + cm.dispose(); + } + } else if (status == 2) { + var useVP = false; + if (!cm.hasItem(itemToUse) && vp > 0) { + useVP = true; + } + + const InventoryType = Java.type('client.inventory.InventoryType'); + if (choice == 0) { + // VP Exchange + if (!cm.canHold(itemToUse)) { + cm.sendOk("It looks like you don't have enough space in your #rETC#k inventory to hold the #t" + itemToUse + "#" + (vp > 0 ? "s" : "") + "."); + cm.dispose(); + return; + } + + cm.getClient().useVotePoints(vp); + cm.gainItem(itemToUse, vp); + cm.dispose(); + } else if (choice == 1) { + // Leaf for Cash + if (useVP) { + cm.getClient().useVotePoints(1); + } else { + cm.gainItem(itemToUse, -1); + } + + cm.getPlayer().getCashShop().gainCash(1, nxAmount); + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getPlayer().sendPacket(PacketCreator.earnTitleMessage("You have earned " + nxAmount + " NX")); + cm.logLeaf(nxAmount + " NX"); + cm.dispose(); + } else if (choice == 2) { + if (!cm.getPlayer().getInventory(InventoryType.SETUP).isFull(chairAmount)) { + + var chairStr = ""; + for (var i = 0; i < chairAmount; i++) { + var chair = chairs[Math.floor(Math.random() * chairs.length)]; + cm.gainItem(chair, 1, true); + chairStr += chair + " "; + } + + if (useVP) { + cm.getClient().useVotePoints(1); + } else { + cm.gainItem(itemToUse, -1); + } + + cm.logLeaf("Chair ID: " + chairStr); + cm.dispose(); + } else { + cm.sendOk("Please make sure you have enough space to hold the items!"); + } + } else if (choice == 3) { + if (!cm.getPlayer().getInventory(InventoryType.EQUIP).isFull(weaponAmount)) { + + var weaponStr = ""; + for (var i = 0; i < weaponAmount; i++) { + var weapon = weapons[Math.floor(Math.random() * weapons.length)]; + cm.gainItem(weapon, 1, true, true); + weaponStr += weapon + " "; + } + + if (useVP) { + cm.getClient().useVotePoints(1); + } else { + cm.gainItem(itemToUse, -1); + } + + cm.logLeaf("Maple Weapon IDs: " + weaponStr); + cm.dispose(); + } else { + cm.sendOk("Please make sure you have enough space to hold the items!"); + } + } else if (choice == 4) { + if (!cm.getPlayer().getInventory(InventoryType.USE).isFull(2)) { + cm.gainItem(buff1ID, buffAmount, true); + cm.gainItem(buff2ID, buffAmount, true); + cm.gainItem(itemToUse, -1); + cm.logLeaf(buffAmount + " cheeses and apples"); + cm.dispose(); + } else { + cm.sendOk("Please make sure you have enough space to hold the items!"); + } + } else if (choice == 5) { + if (!cm.haveItem(5030000, 1)) { + if (!cm.getPlayer().getInventory(InventoryType.CASH).isFull(1)) { + cm.gainItem(5030000, 1, false, true, 1000 * 60 * 60 * 24 * hiredMerchantLength); + + if (useVP) { + cm.getClient().useVotePoints(1); + } else { + cm.gainItem(itemToUse, -1); + } + + cm.logLeaf(hiredMerchantLength + " day hired merchant"); + cm.dispose(); + } else { + cm.sendOk("Please make sure you have enough space to hold these items!"); + } + } else { + cm.sendOk("I can't give you a merchant if you already have one!"); + } + } + } else { + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1022104.js b/scripts/npc/1022104.js index 7b6a0c1ad4..8ba11d362b 100644 --- a/scripts/npc/1022104.js +++ b/scripts/npc/1022104.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1022105.js b/scripts/npc/1022105.js index 7b6a0c1ad4..8ba11d362b 100644 --- a/scripts/npc/1022105.js +++ b/scripts/npc/1022105.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1032000.js b/scripts/npc/1032000.js index 3a1c038675..e496e3b5b7 100644 --- a/scripts/npc/1032000.js +++ b/scripts/npc/1032000.js @@ -21,26 +21,29 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { var selStr = ""; - if (cm.getJobId() == 0) + if (cm.getJobId() == 0) { selStr += "We have a special 90% discount for beginners."; + } selStr += "Choose your destination, for fees will change from place to place.#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 2) { if (maps[selection] == 100000000 && cm.getMapId() == 101000000 && cm.haveItem(4032288)) { cm.sendYesNo("Hmm, I see you have been recommended by Neinheart to come to Victoria Island to improve your knightly skills. Well, just this time the ride will be free of charges. Will you take the ride?"); hasCoupon = true; } else { - cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); + cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); } - + selectedMap = selection; } else if (status == 3) { if (!hasCoupon) { @@ -60,7 +63,7 @@ function action(mode, type, selection) { } else { cm.gainItem(4032288, -1); } - + cm.warp(maps[selectedMap], 0); cm.dispose(); } diff --git a/scripts/npc/1032001.js b/scripts/npc/1032001.js index 761e5884e1..2dd03db309 100644 --- a/scripts/npc/1032001.js +++ b/scripts/npc/1032001.js @@ -27,7 +27,7 @@ */ status = -1; -actionx = {"1stJob" : false, "2ndjob" : false, "3thJobI" : false, "3thJobC" : false}; +actionx = {"1stJob": false, "2ndjob": false, "3thJobI": false, "3thJobC": false}; job = 210; spawnPnpc = false; @@ -38,12 +38,12 @@ function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { if (cm.getJobId() == 0) { @@ -51,20 +51,21 @@ function start() { cm.sendNext("Want to be a #rmagician#k? There are some standards to meet. because we can't just accept EVERYONE in... #bYour level should be at least 8#k, with getting " + cm.getFirstJobStatRequirement(jobType) + " as your top priority. Let's see."); // thanks Vcoc for noticing a need to state and check requirements on first job adv starting message } else if (cm.getLevel() >= 30 && cm.getJobId() == 200) { actionx["2ndJob"] = true; - if (cm.haveItem(4031012)) + if (cm.haveItem(4031012)) { cm.sendNext("I see you have done well. I will allow you to take the next step on your long road."); - else if (cm.haveItem(4031009)){ + } else if (cm.haveItem(4031009)) { cm.sendOk("Go and see the #b#p1072001##k."); cm.dispose(); - } else + } else { cm.sendNext("The progress you have made is astonishing."); - } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 2 && !cm.getPlayer().gotPartyQuestItem("JBP"))){ + } + } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 2 && !cm.getPlayer().gotPartyQuestItem("JBP"))) { actionx["3thJobI"] = true; cm.sendNext("There you are. A few days ago, #b#p2020009##k of Ossyria talked to me about you. I see that you are interested in making the leap to the enlightened of the third job advancement for magicians. To archieve that goal, I will have to test your strength in order to see whether you are worthy of the advancement. There is an opening in the middle of a deep forest of evil in Victoria Island, where it'll lead you to a secret passage. Once inside, you'll face a clone of myself. Your task is to defeat him and bring #b#t4031059##k back with you."); - } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)){ + } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)) { cm.sendNext("Please, bring me the #b#t4031059##k from my clone. You can find him inside a hole in space which is deep in a forest of evil."); cm.dispose(); - } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")){ + } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")) { actionx["3thJobC"] = true; cm.sendNext("Nice work. You have defeated my clone and brought #b#t4031059##k back safely. You have now proven yourself worthy of the 3rd job advancement from the physical standpoint. Now you should give this necklace to #b#p2020011##k in Ossyria to take on the second part of the test. Good luck. You'll need it."); } else { @@ -82,14 +83,14 @@ function action(mode, type, selection) { } else if (mode == 0 && type == 0) { status -= 2; } - - if (status == -1){ + + if (status == -1) { start(); return; } else { - if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -97,29 +98,30 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); return; } else { - if (mode != 1 || status == 7 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)){ - if (mode == 0 && status == 2 && type == 1) + if (mode != 1 || status == 7 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)) { + if (mode == 0 && status == 2 && type == 1) { cm.sendOk("You know there is no other choice..."); - if (!(mode == 0 && type == 0)){ + } + if (!(mode == 0 && type == 0)) { cm.dispose(); return; } } } } - - if (actionx["1stJob"]){ + + if (actionx["1stJob"]) { if (status == 0) { if (cm.getLevel() >= 8 && cm.canGetFirstJob(jobType)) { cm.sendYesNo("Oh...! You look like someone that can definitely be a part of us... all you need is a little sinister mind, and... yeah... so, what do you think? Wanna be the Magician?"); @@ -127,9 +129,9 @@ function action(mode, type, selection) { cm.sendOk("Train a bit more until you reach the base requirements and I can show you the way of the #rMagician#k."); cm.dispose(); } - } else if (status == 1){ - if (cm.canHold(1372043)){ - if (cm.getJobId() == 0){ + } else if (status == 1) { + if (cm.canHold(1372043)) { + if (cm.getJobId() == 0) { cm.changeJobById(200); cm.gainItem(1372043, 1); cm.resetStats(); @@ -139,78 +141,86 @@ function action(mode, type, selection) { cm.sendNext("Make some room in your inventory and talk back to me."); cm.dispose(); } - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You've gotten much stronger now. Plus every single one of your inventories have added slots. A whole row, to be exact. Go see for it yourself. I just gave you a little bit of #bSP#k. When you open up the #bSkill#k menu on the lower left corner of the screen, there are skills you can learn by using SP's. One warning, though: You can't raise it all together all at once. There are also skills you can acquire only after having learned a couple of skills first."); - else if (status == 3) + } else if (status == 3) { cm.sendNextPrev("But remember, skills aren't everything. Your stats should support your skills as a Magician, also. Magicians use INT as their main stat, and LUK as their secondary stat. If raising stats is difficult, just use #bAuto-Assign#k"); - else if (status == 4) + } else if (status == 4) { cm.sendNextPrev("Now, one more word of warning to you. If you fail in battle from this point on, you will lose a portion of your total EXP. Be extra mindful of this, since you have less HP than most."); - else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("This is all I can teach you. Good luck on your journey, young Magician."); - else + } else { cm.dispose(); - } else if(actionx["2ndJob"]){ - if (status == 0){ - if (cm.haveItem(4031012)) + } + } else if (actionx["2ndJob"]) { + if (status == 0) { + if (cm.haveItem(4031012)) { cm.sendSimple("Alright, when you have made your decision, click on [I'll choose my occupation] at the bottom.#b\r\n#L0#Please explain to me what being the Wizard (Fire / Poison) is all about.\r\n#L1#Please explain to me what being the Wizard (Ice / Lighting) is all about.\r\n#L2#Please explain to me what being the Cleric is all about.\r\n#L3#I'll choose my occupation!"); - else { + } else { cm.sendNext("Good decision. You look strong, but I need to see if you really are strong enough to pass the test, it's not a difficult test, so you'll do just fine. Here, take my letter first... make sure you don't lose it!"); - if(!cm.isQuestStarted(100006)) cm.startQuest(100006); - } - } else if (status == 1){ - if (!cm.haveItem(4031012)){ - if (cm.canHold(4031009)){ - if(!cm.haveItem(4031009)) + if (!cm.isQuestStarted(100006)) { + cm.startQuest(100006); + } + } + } else if (status == 1) { + if (!cm.haveItem(4031012)) { + if (cm.canHold(4031009)) { + if (!cm.haveItem(4031009)) { cm.gainItem(4031009, 1); + } cm.sendNextPrev("Please get this letter to #b#p1072001##k who's around #b#m101020000##k near Ellinia. He is taking care of the job of an instructor in place of me. Give him the letter and he'll test you in place of me. Best of luck to you."); } else { cm.sendNext("Please, make some space in your inventory."); cm.dispose(); } - }else{ - if (selection < 3){ - if(selection == 0) { + } else { + if (selection < 3) { + if (selection == 0) { cm.sendNext("Magicians that master #rFire/Poison-based magic#k.\r\n\r\n#bWizards#k are a active class that deal magical, elemental damage. These abilities grants them a significant advantage against enemies weak to their element. With their skills #rMeditation#k and #rSlow#k, #bWizards#k can increase their magic attack and reduce the opponent's mobility. #bFire/Poison Wizards#k contains a powerful flame arrow attack and poison attack."); //f/p mage - } else if(selection == 1) { + } else if (selection == 1) { cm.sendNext("Magicians that master #rIce/Lightning-based magic#k.\r\n\r\n#bWizards#k are a active class that deal magical, elemental damage. These abilities grants them a significant advantage against enemies weak to their element. With their skills #rMeditation#k and #rSlow#k, #bWizards#k can increase their magic attack and reduce the opponent's mobility. #bIce/Lightning Wizards#k have a freezing ice attack and a striking lightning attack."); //i/l mage } else { cm.sendNext("Magicians that master #rHoly magic#k.\r\n\r\n#bClerics#k are a powerful supportive class, bound to be accepted into any Party. That's because the have the power to #rHeal#k themselves and others in their party. Using #rBless#k, #bClerics#k can buff the attributes and reduce the amount of damage taken. This class is on worth going for if you find it hard to survive. #bClerics#k are especially effective against undead monsters."); //cleric } - + status -= 2; - } else + } else { cm.sendSimple("Now... have you made up your mind? Please choose the job you'd like to select for your 2nd job advancement. #b\r\n#L0#Wizard (Fire / Poison)\r\n#L1#Wizard (Ice / Lighting)\r\n#L2#Cleric"); + } } - } else if (status == 2){ - if (cm.haveItem(4031009)){ + } else if (status == 2) { + if (cm.haveItem(4031009)) { cm.dispose(); return; } job += selection * 10; cm.sendYesNo("So you want to make the second job advancement as the " + (job == 210 ? "#bWizard (Fire / Poison)#k" : job == 220 ? "#bWizard (Ice / Lighting)#k" : "#bCleric#k") + "? You know you won't be able to choose a different job for the 2nd job advancement once you make your desicion here, right?"); - } else if (status == 3){ - if (cm.haveItem(4031012)) + } else if (status == 3) { + if (cm.haveItem(4031012)) { cm.gainItem(4031012, -1); + } cm.completeQuest(100008); cm.sendNext("Alright, you're the " + (job == 210 ? "#bWizard (Fire / Poison)#k" : job == 220 ? "#bWizard (Ice / Lighting)#k" : "#bCleric#k") + " from here on out. Mages and wizards are the intelligent bunch with incredible magical prowess, able to pierce the mind and the psychological structure of the monsters with ease... please train yourself each and everyday. I'll help you become even stronger than you already are."); - if (cm.getJobId() != job) + if (cm.getJobId() != job) { cm.changeJobById(job); - } else if (status == 4) + } + } else if (status == 4) { cm.sendNextPrev("I have just given you a book that gives you the list of skills you can acquire as a " + (job == 210 ? "#bWizard (Fire / Poison)#k" : job == 220 ? "#bWizard (Ice / Lighting)#k" : "#bCleric#k") + ". Also your etc inventory has expanded by adding another row to it. Your max HP and MP have increased, too. Go check and see for it yourself."); - else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("I have also given you a little bit of #bSP#k. Open the #bSkill Menu#k located at the bottomleft corner. you'll be able to boost up the newer acquired 2nd level skills. A word of warning, though. You can't boost them up all at once. Some of the skills are only available after you have learned other skills. Make sure you remember that."); - else if (status == 6) + } else if (status == 6) { cm.sendNextPrev((job == 210 ? "Wizard (Fire / Poison)" : job == 220 ? "Wizard (Ice / Lighting)" : "Cleric") + " need to be strong. But remember that you can't abuse that power and use it on a weakling. Please use your enormous power the right way, because... for you to use that the right way, that is much harden than just getting stronger. Please find me after you have advanced much further. I'll be waiting for you."); - } else if (actionx["3thJobI"]){ - if (status == 0){ - if (cm.getPlayer().gotPartyQuestItem("JB3")){ + } + } else if (actionx["3thJobI"]) { + if (status == 0) { + if (cm.getPlayer().gotPartyQuestItem("JB3")) { cm.getPlayer().removePartyQuestItem("JB3"); cm.getPlayer().removePartyQuestItem("JB3"); cm.getPlayer().setPartyQuestItemObtained("JBP"); } cm.sendNextPrev("Since he is a clone of myself, you can expect a tough battle ahead. He uses a number of special attacking skills unlike any you have ever seen, and it is your task to successfully take him one on one. There is a time limit in the secret passage, so it is crucial that you defeat him within the time limit. I wish you the best of luck, and I hope you bring the #b#t4031059##k with you."); } - } else if (actionx["3thJobC"]){ + } else if (actionx["3thJobC"]) { cm.getPlayer().removePartyQuestItem("JBP"); cm.gainItem(4031059, -1); cm.gainItem(4031057, 1); diff --git a/scripts/npc/1032002.js b/scripts/npc/1032002.js index 942de6f639..321f1c4427 100644 --- a/scripts/npc/1032002.js +++ b/scripts/npc/1032002.js @@ -45,182 +45,171 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Welcome to my eco-safe refining operation! What would you like today?#b" - var options = new Array("Make a glove","Upgrade a glove","Upgrade a hat","Make a wand","Make a staff"); - for (var i = 0; i < options.length; i++){ + var options = ["Make a glove", "Upgrade a glove", "Upgrade a hat", "Make a wand", "Make a staff"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //glove refine + if (selectedType == 0) { //glove refine var selStr = "So, what kind of glove would you like me to make?#b"; - var items = new Array ("Lemona#k - Magician Lv. 15#b","Blue Morrican#k - Magician Lv. 20#b","Ocean Mesana#k - Magician Lv. 25#b","Red Lutia#k - Magician Lv. 30#b","Red Noel#k - Magician Lv. 35#b","Red Arten#k - Magician Lv. 40#b", - "Red Pennance#k - Magician Lv. 50#b","Steel Manute#k - Magician Lv. 60#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Lemona#k - Magician Lv. 15#b", "Blue Morrican#k - Magician Lv. 20#b", "Ocean Mesana#k - Magician Lv. 25#b", "Red Lutia#k - Magician Lv. 30#b", "Red Noel#k - Magician Lv. 35#b", "Red Arten#k - Magician Lv. 40#b", + "Red Pennance#k - Magician Lv. 50#b", "Steel Manute#k - Magician Lv. 60#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 1){ //glove upgrade + } else if (selectedType == 1) { //glove upgrade var selStr = "So, what kind of glove are you looking to upgrade to?#b"; - var items = new Array ("Green Morrican#k - Magician Lv. 20#b","Purple Morrican#k - Magician Lv. 20#b","Blood Mesana#k - Magician Lv. 25#b","Dark Mesana#k - Magician Lv. 25#b","Blue Lutia#k - Magician Lv. 30#b","Black Lutia#k - Magician Lv. 30#b", - "Blue Noel#k - Magician Lv. 35#b","Dark Noel#k - Magician Lv. 35#b","Blue Arten#k - Magician Lv. 40#b","Dark Arten#k - Magician Lv. 40#b","Blue Pennance#k - Magician Lv. 50#b","Dark Pennance#k - Magician Lv. 50#b", - "Gold Manute#k - Magician Lv. 60#b","Dark Manute#k - Magician Lv. 60#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Green Morrican#k - Magician Lv. 20#b", "Purple Morrican#k - Magician Lv. 20#b", "Blood Mesana#k - Magician Lv. 25#b", "Dark Mesana#k - Magician Lv. 25#b", "Blue Lutia#k - Magician Lv. 30#b", "Black Lutia#k - Magician Lv. 30#b", + "Blue Noel#k - Magician Lv. 35#b", "Dark Noel#k - Magician Lv. 35#b", "Blue Arten#k - Magician Lv. 40#b", "Dark Arten#k - Magician Lv. 40#b", "Blue Pennance#k - Magician Lv. 50#b", "Dark Pennance#k - Magician Lv. 50#b", + "Gold Manute#k - Magician Lv. 60#b", "Dark Manute#k - Magician Lv. 60#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 2){ //hat upgrade + } else if (selectedType == 2) { //hat upgrade var selStr = "A hat? Which one were you thinking of?#b"; - var items = new Array ("Steel Pride#k - Magician Lv. 30#b","Golden Pride#k - Magician Lv. 30#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Steel Pride#k - Magician Lv. 30#b", "Golden Pride#k - Magician Lv. 30#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 3){ //wand refine + } else if (selectedType == 3) { //wand refine var selStr = "A wand, huh? Prefer the smaller weapon that fits in your pocket? Which type are you seeking?#b"; - var items = new Array ("Wooden Wand#k - Common Lv. 8#b","Hardwood Wand#k - Common Lv. 13#b","Metal Wand#k - Common Lv. 18#b","Ice Wand#k - Magician Lv. 23#b","Mithril Wand#k - Magician Lv. 28#b", - "Wizard Wand#k - Magician Lv. 33#b","Fairy Wand#k - Magician Lv. 38#b","Cromi#k - Magician Lv. 48#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Wooden Wand#k - Common Lv. 8#b", "Hardwood Wand#k - Common Lv. 13#b", "Metal Wand#k - Common Lv. 18#b", "Ice Wand#k - Magician Lv. 23#b", "Mithril Wand#k - Magician Lv. 28#b", + "Wizard Wand#k - Magician Lv. 33#b", "Fairy Wand#k - Magician Lv. 38#b", "Cromi#k - Magician Lv. 48#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 4){ //staff refine + } else if (selectedType == 4) { //staff refine var selStr = "Ah, a staff, a great symbol of one's power! Which are you looking to make?#b"; - var items = new Array ("Wooden Staff#k - Magician Lv. 10#b","Sapphire Staff#k - Magician Lv. 15#b","Emerald Staff#k - Magician Lv. 15#b","Old Wooden Staff#k - Magician Lv. 20#b","Wizard Staff#k - Magician Lv. 25#b", - "Arc Staff#k - Magician Lv. 45#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Wooden Staff#k - Magician Lv. 10#b", "Sapphire Staff#k - Magician Lv. 15#b", "Emerald Staff#k - Magician Lv. 15#b", "Old Wooden Staff#k - Magician Lv. 20#b", "Wizard Staff#k - Magician Lv. 25#b", + "Arc Staff#k - Magician Lv. 45#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); } - } - else if (status == 2 && mode == 1) { + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //glove refine - var itemSet = new Array(1082019,1082020,1082026,1082051,1082054,1082062,1082081,1082086); - var matSet = new Array(4000021,new Array(4000021,4011001),new Array(4000021,4011006),new Array(4000021,4021006,4021000),new Array(4000021,4011006,4011001,4021000), - new Array(4000021,4021000,4021006,4003000),new Array(4021000,4011006,4000030,4003000),new Array(4011007,4011001,4021007,4000030,4003000)); - var matQtySet = new Array(15,new Array(30,1),new Array(50,2),new Array(60,1,2),new Array(70,1,3,2),new Array(80,3,3,30),new Array(3,2,35,40),new Array(1,8,1,50,50)); - var costSet = new Array(7000,15000,20000,25000,30000,40000,50000,70000); + if (selectedType == 0) { //glove refine + var itemSet = [1082019, 1082020, 1082026, 1082051, 1082054, 1082062, 1082081, 1082086]; + var matSet = [4000021, [4000021, 4011001], [4000021, 4011006], [4000021, 4021006, 4021000], [4000021, 4011006, 4011001, 4021000], + [4000021, 4021000, 4021006, 4003000], [4021000, 4011006, 4000030, 4003000], [4011007, 4011001, 4021007, 4000030, 4003000]]; + var matQtySet = [15, [30, 1], [50, 2], [60, 1, 2], [70, 1, 3, 2], [80, 3, 3, 30], [3, 2, 35, 40], [1, 8, 1, 50, 50]]; + var costSet = [7000, 15000, 20000, 25000, 30000, 40000, 50000, 70000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //glove upgrade + var itemSet = [1082021, 1082022, 1082027, 1082028, 1082052, 1082053, 1082055, 1082056, 1082063, 1082064, 1082082, 1082080, 1082087, 1082088]; + var matSet = [[1082020, 4011001], [1082020, 4021001], [1082026, 4021000], [1082026, 4021008], [1082051, 4021005], + [1082051, 4021008], [1082054, 4021005], [1082054, 4021008], [1082062, 4021002], [1082062, 4021008], + [1082081, 4021002], [1082081, 4021008], [1082086, 4011004, 4011006], [1082086, 4021008, 4011006]]; + var matQtySet = [[1, 1], [1, 2], [1, 3], [1, 1], [1, 3], [1, 1], [1, 3], [1, 1], [1, 4], + [1, 2], [1, 5], [1, 3], [1, 3, 5], [1, 2, 3]]; + var costSet = [20000, 25000, 30000, 40000, 35000, 40000, 40000, 45000, 45000, 50000, 55000, 60000, 70000, 80000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //hat upgrade + var itemSet = [1002065, 1002013]; + var matSet = [[1002064, 4011001], [1002064, 4011006]]; + var matQtySet = [[1, 3], [1, 3]]; + var costSet = [40000, 50000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 3) { //wand refine + var itemSet = [1372005, 1372006, 1372002, 1372004, 1372003, 1372001, 1372000, 1372007]; + var matSet = [4003001, [4003001, 4000001], [4011001, 4000009, 4003000], [4011002, 4003002, 4003000], [4011002, 4021002, 4003000], + [4021006, 4011002, 4011001, 4003000], [4021006, 4021005, 4021007, 4003003, 4003000], [4011006, 4021003, 4021007, 4021002, 4003002, 4003000]]; + var matQtySet = [5, [10, 50], [1, 30, 5], [2, 1, 10], [3, 1, 10], [5, 3, 1, 15], [5, 5, 1, 1, 20], [4, 3, 2, 1, 1, 30]]; + var costSet = [1000, 3000, 5000, 12000, 30000, 60000, 120000, 200000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 4) { //staff refine + var itemSet = [1382000, 1382003, 1382005, 1382004, 1382002, 1382001]; + var matSet = [4003001, [4021005, 4011001, 4003000], [4021003, 4011001, 4003000], [4003001, 4011001, 4003000], + [4021006, 4021001, 4011001, 4003000], [4011001, 4021006, 4021001, 4021005, 4003000, 4000010, 4003003]]; + var matQtySet = [5, [1, 1, 5], [1, 1, 5], [50, 1, 10], [2, 1, 1, 15], [8, 5, 5, 5, 30, 50, 1]]; + var costSet = [2000, 2000, 2000, 5000, 12000, 180000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //glove upgrade - var itemSet = new Array(1082021,1082022,1082027,1082028,1082052,1082053,1082055,1082056,1082063,1082064,1082082,1082080,1082087,1082088); - var matSet = new Array(new Array(1082020,4011001),new Array(1082020,4021001),new Array(1082026,4021000),new Array(1082026,4021008),new Array(1082051,4021005), - new Array(1082051,4021008),new Array(1082054,4021005),new Array(1082054,4021008),new Array(1082062,4021002),new Array(1082062,4021008), - new Array(1082081,4021002),new Array(1082081,4021008),new Array(1082086,4011004,4011006),new Array(1082086,4021008,4011006)); - var matQtySet = new Array(new Array(1,1),new Array(1,2),new Array(1,3),new Array(1,1),new Array(1,3),new Array(1,1),new Array(1,3),new Array(1,1),new Array(1,4), - new Array(1,2),new Array(1,5),new Array(1,3),new Array(1,3,5),new Array(1,2,3)); - var costSet = new Array (20000,25000,30000,40000,35000,40000,40000,45000,45000,50000,55000,60000,70000,80000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //hat upgrade - var itemSet = new Array(1002065,1002013); - var matSet = new Array(new Array(1002064,4011001),new Array(1002064,4011006)); - var matQtySet = new Array(new Array(1,3),new Array(1,3)); - var costSet = new Array(40000,50000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //wand refine - var itemSet = new Array (1372005,1372006,1372002,1372004,1372003,1372001,1372000,1372007); - var matSet = new Array(4003001,new Array(4003001,4000001),new Array(4011001,4000009,4003000),new Array(4011002,4003002,4003000),new Array(4011002,4021002,4003000), - new Array(4021006,4011002,4011001,4003000),new Array(4021006,4021005,4021007,4003003,4003000),new Array(4011006,4021003,4021007,4021002,4003002,4003000)); - var matQtySet = new Array (5,new Array(10,50),new Array(1,30,5),new Array(2,1,10),new Array(3,1,10),new Array(5,3,1,15),new Array(5,5,1,1,20),new Array(4,3,2,1,1,30)); - var costSet = new Array (1000,3000,5000,12000,30000,60000,120000,200000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 4){ //staff refine - var itemSet = new Array (1382000,1382003,1382005,1382004,1382002,1382001); - var matSet = new Array(4003001,new Array(4021005,4011001,4003000),new Array(4021003,4011001,4003000),new Array(4003001,4011001,4003000), - new Array(4021006,4021001,4011001,4003000),new Array(4011001,4021006,4021001,4021005,4003000,4000010,4003003)); - var matQtySet = new Array (5,new Array(1,1,5),new Array(1,1,5),new Array(50,1,10),new Array(2,1,1,15),new Array(8,5,5,5,30,50,1)); - var costSet = new Array (2000,2000,2000,5000,12000,180000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 3 && mode == 1) { + } else if (status == 3 && mode == 1) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) - { + } else if (cm.getMeso() < cost) { cm.sendOk("Sorry, but all of us need money to live. Come back when you can pay my fees, yes?") cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; + } } - - if (!complete) + + if (!complete) { cm.sendOk("Uhm... I don't keep extra material on me. Sorry. "); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i]); } - } - else + } else { cm.gainItem(mats, -matQty); - - if (cost > 0) + } + + if (cost > 0) { cm.gainMeso(-cost); - + } + cm.gainItem(item, 1); cm.sendOk("It's a success! Oh, I've never felt so alive! Please come back again!"); } diff --git a/scripts/npc/1032003.js b/scripts/npc/1032003.js index 9ded974c18..831a44f411 100644 --- a/scripts/npc/1032003.js +++ b/scripts/npc/1032003.js @@ -21,15 +21,15 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Shane - Ellinia (101000000) --- By --------------------------------------------------------------------------------------------- - Unknown --- Version Info ----------------------------------------------------------------------------------- - 1.1 - Statement fix [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Shane - Ellinia (101000000) + -- By --------------------------------------------------------------------------------------------- + Unknown + -- Version Info ----------------------------------------------------------------------------------- + 1.1 - Statement fix [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var check = 0; @@ -39,9 +39,9 @@ function start() { cm.sendOk("You must be a higher level to enter the Forest of Patience."); cm.dispose(); check = 1; - } - else + } else { cm.sendYesNo("Hi, i'm Shane. I can let you into the Forest of Patience for a small fee. Would you like to enter for #b5000#k mesos?"); + } } function action(mode, type, selection) { @@ -53,25 +53,26 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (check != 1) { if (cm.getPlayer().getMeso() < 5000) { cm.sendOk("Sorry but it doesn't like you have enough mesos!") cm.dispose(); - } - else { - if (cm.isQuestStarted(2050)) + } else { + if (cm.isQuestStarted(2050)) { cm.warp(101000100, 0); - else if (cm.isQuestStarted(2051)) + } else if (cm.isQuestStarted(2051)) { cm.warp(101000102, 0); - else if (cm.getLevel() >= 25 && cm.getLevel() < 50) + } else if (cm.getLevel() >= 25 && cm.getLevel() < 50) { cm.warp(101000100, 0); - else if (cm.getLevel() >= 50) + } else if (cm.getLevel() >= 50) { cm.warp(101000102, 0); + } cm.gainMeso(-5000); cm.dispose(); } diff --git a/scripts/npc/1032004.js b/scripts/npc/1032004.js index f8eb757c7e..3cea1dbe0c 100644 --- a/scripts/npc/1032004.js +++ b/scripts/npc/1032004.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Shane 1032004 * @Author Moogra */ @@ -28,7 +29,8 @@ function start() { } function action(mode, type, selection) { - if (mode > 0) - cm.warp(101000000,0); + if (mode > 0) { + cm.warp(101000000, 0); + } cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1032005.js b/scripts/npc/1032005.js index 21d68f7bc6..522b2f11d0 100644 --- a/scripts/npc/1032005.js +++ b/scripts/npc/1032005.js @@ -20,14 +20,14 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - VIP Cab - Victoria Road : Ellinia (101000000) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + VIP Cab - Victoria Road : Ellinia (101000000) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var cost = 10000; @@ -38,21 +38,21 @@ function start() { function action(mode, type, selection) { status++; - if (mode == -1){ + if (mode == -1) { cm.dispose(); return; } else if (mode == 0) { cm.sendOk("This town also has a lot to offer. Find us if and when you feel the need to go to the Ant Tunnel Park."); - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 1) { cm.sendYesNo(cm.getJobId() == 0 ? "We have a special 90% discount for beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where the 24 Hr Mobile Store is. Would you like to go there for #b1,000 mesos#k?" : "The regular fee applies for all non-beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where 24 Hr Mobile Store is. Would you like to go there for #b10,000 mesos#k?"); cost /= ((cm.getJobId() == 0) ? 10 : 1); } else if (status == 2) { - if (cm.getMeso() < cost) + if (cm.getMeso() < cost) { cm.sendNext("It looks like you don't have enough mesos. Sorry but you won't be able to use this without it.") - else { + } else { cm.gainMeso(-cost); cm.warp(105070001); } diff --git a/scripts/npc/1032007.js b/scripts/npc/1032007.js index 4535065c40..6243b25c17 100644 --- a/scripts/npc/1032007.js +++ b/scripts/npc/1032007.js @@ -2,26 +2,26 @@ var status = 0; var cost = 5000; function start() { - cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 15 minutes, beginning on the hour, and it'll cost you #b"+cost+" mesos#k. Are you sure you want to purchase #b#t4031045##k?"); + cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 15 minutes, beginning on the hour, and it'll cost you #b" + cost + " mesos#k. Are you sure you want to purchase #b#t4031045##k?"); } function action(mode, type, selection) { - if(mode == -1) + if (mode == -1) { cm.dispose(); - else { - if(mode == 0) { + } else { + if (mode == 0) { cm.sendNext("You must have some business to take care of here, right?"); cm.dispose(); return; } status++; - if(status == 1) { + if (status == 1) { if (cm.getMeso() >= cost && cm.canHold(4031045)) { - cm.gainItem(4031045,1); + cm.gainItem(4031045, 1); cm.gainMeso(-cost); cm.dispose(); } else { - cm.sendOk("Are you sure you have #b"+cost+" mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); + cm.sendOk("Are you sure you have #b" + cost + " mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); cm.dispose(); } } diff --git a/scripts/npc/1032008.js b/scripts/npc/1032008.js index ae1a498d80..3aeb7fc119 100644 --- a/scripts/npc/1032008.js +++ b/scripts/npc/1032008.js @@ -1,30 +1,30 @@ function start() { - if(cm.haveItem(4031045)){ + if (cm.haveItem(4031045)) { var em = cm.getEventManager("Boats"); - if (em.getProperty("entry") == "true") + if (em.getProperty("entry") == "true") { cm.sendYesNo("Do you want to go to Orbis?"); - else{ + } else { cm.sendOk("The boat to Orbis is already travelling, please be patient for the next one."); cm.dispose(); } - }else{ + } else { cm.sendOk("Make sure you got a Orbis ticket to travel in this boat. Check your inventory."); cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); - cm.dispose(); - return; + cm.sendOk("Okay, talk to me if you change your mind!"); + cm.dispose(); + return; } var em = cm.getEventManager("Boats"); if (em.getProperty("entry") == "true") { cm.warp(101000301); cm.gainItem(4031045, -1); cm.dispose(); - } - else{ + } else { cm.sendOk("The boat to Orbis is ready to take off, please be patient for the next one."); cm.dispose(); } diff --git a/scripts/npc/1032009.js b/scripts/npc/1032009.js index 0835260695..d808bd1637 100644 --- a/scripts/npc/1032009.js +++ b/scripts/npc/1032009.js @@ -20,8 +20,8 @@ along with this program. If not, see . */ /** -Purin (On Boat ) 1032009 -**/ + Purin (On Boat ) 1032009 + **/ var status = 0; @@ -38,7 +38,7 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); + cm.sendNext("Alright, see you next time. Take care."); status++; } else if (status == 2) { cm.warp(101000300, 0);// back to orbis diff --git a/scripts/npc/1032100.js b/scripts/npc/1032100.js index f1c52360c5..e0073571fb 100644 --- a/scripts/npc/1032100.js +++ b/scripts/npc/1032100.js @@ -20,14 +20,14 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Arwen the Fairy - Victoria Road : Ellinia (101000000) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Arwen the Fairy - Victoria Road : Ellinia (101000000) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var item; @@ -50,10 +50,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { if (cm.getLevel() >= 40) { cm.sendNext("Yeah... I am the master alchemist of the fairies. But the fairies are not supposed to be in contact with a human being for a long period of time... A strong person like you will be fine, though. If you get me the materials, I'll make you a special item."); @@ -79,8 +80,8 @@ function action(mode, type, selection) { if (selected == 0) { if (cm.haveItem(4011000) && cm.haveItem(4011001) && cm.haveItem(4011002) && cm.haveItem(4011003) && cm.haveItem(4011004) && cm.haveItem(4011005) && cm.haveItem(4011006) && cm.getMeso() >= 10000) { cm.gainMeso(-10000); - for(var i = 4011000; i<4011007; i++) { - cm.gainItem(i,-1); + for (var i = 4011000; i < 4011007; i++) { + cm.gainItem(i, -1); } cm.gainItem(4011007, 1); cm.sendNext("Ok here, take " + item + ". It's well-made, probably because I'm using good materials. If you need my help down the road, feel free to come back."); @@ -90,8 +91,8 @@ function action(mode, type, selection) { } else if (selected == 1) { if (cm.haveItem(4021000) && cm.haveItem(4021001) && cm.haveItem(4021002) && cm.haveItem(4021003) && cm.haveItem(4021004) && cm.haveItem(4021005) && cm.haveItem(4021006) && cm.haveItem(4021007) && cm.haveItem(4021008) && cm.getMeso() >= 15000) { cm.gainMeso(-15000); - for(var j = 4021000; j<4021009; j++) { - cm.gainItem(j,-1); + for (var j = 4021000; j < 4021009; j++) { + cm.gainItem(j, -1); } cm.gainItem(4021009, 1); cm.sendNext("Ok here, take " + item + ". It's well-made, probably because I'm using good materials. If you need my help down the road, feel free to come back."); @@ -101,8 +102,8 @@ function action(mode, type, selection) { } else if (selected == 2) { if (cm.haveItem(4001006) && cm.haveItem(4011007) && cm.haveItem(4021008) && cm.getMeso() >= 30000) { cm.gainMeso(-30000); - for(var k = 4001006; k<4021009; k+=10001) { - cm.gainItem(k,-1); + for (var k = 4001006; k < 4021009; k += 10001) { + cm.gainItem(k, -1); } cm.gainItem(4031042, 1); cm.sendNext("Ok here, take " + item + ". It's well-made, probably because I'm using good materials. If you need my help down the road, feel free to come back."); diff --git a/scripts/npc/1032102.js b/scripts/npc/1032102.js index 5a9a464b7c..36525104dc 100644 --- a/scripts/npc/1032102.js +++ b/scripts/npc/1032102.js @@ -12,116 +12,117 @@ var status; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.sendOk("Alright, see you next time."); - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendYesNo("I am Mar the Fairy. If you have a dragon at level 15 or higher and a rock of evolution, I can evolve your dragon. If you are lucky, you may even get a black one! Would you like me to do so?"); - } else if (status == 1) { - if (cm.haveItem(5000028, 1)) { - cm.gainItem(5000028, -1); - cm.gainItem(5000029, 1); - cm.sendOk("I don't know how you got that egg, but it has hatched, apparently!"); - cm.dispose(); - } else if (cm.getPlayer().getPet(0) == null) { - cm.sendOk("Make sure your pet is equipped on slot 1."); - cm.dispose(); - } else if (cm.getPlayer().getPet(0).getItemId() < 5000029 || cm.getPlayer().getPet(0).getItemId() > 5000033 || !cm.haveItem(5380000,1)) { - cm.sendOk("You do not meet the requirements. You need #i5380000##t5380000#, as well as either one of #d#i5000029##t5000029##k, #g#i5000030##t5000030##k, #r#i5000031##t5000031##k, #b#i5000032##t5000032##k, or #e#i5000033##t5000033##n equipped on slot 1. Please come back when you do."); - cm.dispose(); - } else if (cm.getPlayer().getPet(0).getLevel() < 15) { - cm.sendOk("Your pet must be level 15 or above to evolve."); - cm.dispose(); - } else if (cm.haveItem(5000029,2) || cm.haveItem(5000030,2) || cm.haveItem(5000031,2) || cm.haveItem(5000032,2) || cm.haveItem(5000033,2)) { - cm.sendSimple("You have a dragon which isn't out, and as well as a dragon which is out. I can remove one for you. Remember that the data for the dragon I am removing will be lost.\r\n#r#L0#Remove my CASH first slot.#l#k\r\n#b#L1#Remove the first dragon in my inventory.#l#k\r\n#g#L2#No thanks.#l#k"); - } else { - var i; - - for(i = 0; i < 3; i++) { - if(cm.getPlayer().getPet(i) != null && cm.getPlayer().getPet(i).getItemId() == 5000029) { - pet = cm.getPlayer().getPet(i); - break; - } - } - if(i == 3) { - cm.sendOk("You either don't have a pet dragon ready to evolve or you lack #b#t5380000##k."); - cm.dispose(); - return; - } - - var id = cm.getPlayer().getPet(i).getItemId(); - //var name = cm.getPlayer().getPet(i).getName(); - //var level = cm.getPlayer().getPet(i).getLevel(); - //var closeness = cm.getPlayer().getPet(i).getCloseness(); - //var fullness = cm.getPlayer().getPet(i).getFullness(); - //ItemInformationProvider ii = ItemInformationProvider.getInstance(); - if (id < 5000029 || id > 5000033) { - cm.sendOk("Something wrong, try again."); - cm.dispose(); - } - var rand = 1 + Math.floor(Math.random() * 10); - var after = 0; - if (rand >= 1 && rand <= 3) { - after = 5000030; - } else if (rand >= 4 && rand <= 6) { - after = 5000031; - } else if (rand >= 7 && rand <= 9) { - after = 5000032; - } else if (rand == 10) { - after = 5000033; - } else { - cm.sendOk("Something wrong. Try again."); - cm.dispose(); - } - - /*if (name.equals(ItemInformationProvider.getInstance().getName(id))) { - name = ItemInformationProvider.getInstance().getName(after); - }*/ - - cm.gainItem(5380000, -1); - cm.evolvePet(i, after); - - cm.sendOk("Your dragon has now evolved!! It used to be a #i" + id + "# #t" + id + "#, and now it's a #i" + after + "# #t" + after + "#!"); - cm.dispose(); - } - } else if (status == 2) { - if (selection == 0) { - const InventoryManipulator = Java.type('client.inventory.manipulator.InventoryManipulator'); - const InventoryType = Java.type('client.inventory.InventoryType'); - InventoryManipulator.removeFromSlot(cm.getClient(), InventoryType.CASH, 1, 1, true); - cm.sendOk("Your cash first slot is removed."); - } else if (selection == 1) { - if (cm.haveItem(5000029, 2)) { - cm.gainItem(5000029, -1); - } else if (cm.haveItem(5000030, 2)) { - cm.gainItem(5000030, -1); - } else if (cm.haveItem(5000031, 2)) { - cm.gainItem(5000031, -1); - } else if (cm.haveItem(5000032, 2)) { - cm.gainItem(5000032, -1); - } else if (cm.haveItem(5000033, 2)) { - cm.gainItem(5000033, -1); - } - cm.sendOk("The first dragon in your inventory is removed."); - } else if (selection == 2) { - cm.sendOk("Okay, come back next time."); - } - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.sendOk("Alright, see you next time."); + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("I am Mar the Fairy. If you have a dragon at level 15 or higher and a rock of evolution, I can evolve your dragon. If you are lucky, you may even get a black one! Would you like me to do so?"); + } else if (status == 1) { + if (cm.haveItem(5000028, 1)) { + cm.gainItem(5000028, -1); + cm.gainItem(5000029, 1); + cm.sendOk("I don't know how you got that egg, but it has hatched, apparently!"); + cm.dispose(); + } else if (cm.getPlayer().getPet(0) == null) { + cm.sendOk("Make sure your pet is equipped on slot 1."); + cm.dispose(); + } else if (cm.getPlayer().getPet(0).getItemId() < 5000029 || cm.getPlayer().getPet(0).getItemId() > 5000033 || !cm.haveItem(5380000, 1)) { + cm.sendOk("You do not meet the requirements. You need #i5380000##t5380000#, as well as either one of #d#i5000029##t5000029##k, #g#i5000030##t5000030##k, #r#i5000031##t5000031##k, #b#i5000032##t5000032##k, or #e#i5000033##t5000033##n equipped on slot 1. Please come back when you do."); + cm.dispose(); + } else if (cm.getPlayer().getPet(0).getLevel() < 15) { + cm.sendOk("Your pet must be level 15 or above to evolve."); + cm.dispose(); + } else if (cm.haveItem(5000029, 2) || cm.haveItem(5000030, 2) || cm.haveItem(5000031, 2) || cm.haveItem(5000032, 2) || cm.haveItem(5000033, 2)) { + cm.sendSimple("You have a dragon which isn't out, and as well as a dragon which is out. I can remove one for you. Remember that the data for the dragon I am removing will be lost.\r\n#r#L0#Remove my CASH first slot.#l#k\r\n#b#L1#Remove the first dragon in my inventory.#l#k\r\n#g#L2#No thanks.#l#k"); + } else { + var i; + + for (i = 0; i < 3; i++) { + if (cm.getPlayer().getPet(i) != null && cm.getPlayer().getPet(i).getItemId() == 5000029) { + pet = cm.getPlayer().getPet(i); + break; + } + } + if (i == 3) { + cm.sendOk("You either don't have a pet dragon ready to evolve or you lack #b#t5380000##k."); + cm.dispose(); + return; + } + + var id = cm.getPlayer().getPet(i).getItemId(); + //var name = cm.getPlayer().getPet(i).getName(); + //var level = cm.getPlayer().getPet(i).getLevel(); + //var closeness = cm.getPlayer().getPet(i).getCloseness(); + //var fullness = cm.getPlayer().getPet(i).getFullness(); + //ItemInformationProvider ii = ItemInformationProvider.getInstance(); + if (id < 5000029 || id > 5000033) { + cm.sendOk("Something wrong, try again."); + cm.dispose(); + } + var rand = 1 + Math.floor(Math.random() * 10); + var after = 0; + if (rand >= 1 && rand <= 3) { + after = 5000030; + } else if (rand >= 4 && rand <= 6) { + after = 5000031; + } else if (rand >= 7 && rand <= 9) { + after = 5000032; + } else if (rand == 10) { + after = 5000033; + } else { + cm.sendOk("Something wrong. Try again."); + cm.dispose(); + } + + /*if (name.equals(ItemInformationProvider.getInstance().getName(id))) { + name = ItemInformationProvider.getInstance().getName(after); +}*/ + + cm.gainItem(5380000, -1); + cm.evolvePet(i, after); + + cm.sendOk("Your dragon has now evolved!! It used to be a #i" + id + "# #t" + id + "#, and now it's a #i" + after + "# #t" + after + "#!"); + cm.dispose(); + } + } else if (status == 2) { + if (selection == 0) { + const InventoryManipulator = Java.type('client.inventory.manipulator.InventoryManipulator'); + const InventoryType = Java.type('client.inventory.InventoryType'); + InventoryManipulator.removeFromSlot(cm.getClient(), InventoryType.CASH, 1, 1, true); + cm.sendOk("Your cash first slot is removed."); + } else if (selection == 1) { + if (cm.haveItem(5000029, 2)) { + cm.gainItem(5000029, -1); + } else if (cm.haveItem(5000030, 2)) { + cm.gainItem(5000030, -1); + } else if (cm.haveItem(5000031, 2)) { + cm.gainItem(5000031, -1); + } else if (cm.haveItem(5000032, 2)) { + cm.gainItem(5000032, -1); + } else if (cm.haveItem(5000033, 2)) { + cm.gainItem(5000033, -1); + } + cm.sendOk("The first dragon in your inventory is removed."); + } else if (selection == 2) { + cm.sendOk("Okay, come back next time."); + } + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1032109.js b/scripts/npc/1032109.js index 2bee5dd172..0e028aa65b 100644 --- a/scripts/npc/1032109.js +++ b/scripts/npc/1032109.js @@ -7,47 +7,49 @@ var status; var mobId = 2220100; //Blue Mushroom -function start(){ - if (!cm.isQuestStarted(20718)) { // thanks Stray, Ari - cm.dispose(); - return; - } +function start() { + if (!cm.isQuestStarted(20718)) { // thanks Stray, Ari + cm.dispose(); + return; + } - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(status == 0){ - cm.sendOk("A mysterious black figure appeared and summoned a lot of angry monsters!"); - } - else if(status == 1){ - var player = cm.getPlayer(); - var map = player.getMap(); + if (status == 0) { + cm.sendOk("A mysterious black figure appeared and summoned a lot of angry monsters!"); + } else if (status == 1) { + var player = cm.getPlayer(); + var map = player.getMap(); - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - for(var i = 0; i < 10; i++) - map.spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), new Point(117, 183)); - for(var i = 0; i < 10; i++) - map.spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), new Point(4, 183)); - for(var i = 0; i < 10; i++) - map.spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), new Point(-109, 183)); + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + for (var i = 0; i < 10; i++) { + map.spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), new Point(117, 183)); + } + for (var i = 0; i < 10; i++) { + map.spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), new Point(4, 183)); + } + for (var i = 0; i < 10; i++) { + map.spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), new Point(-109, 183)); + } - cm.completeQuest(20718, 1103003); - cm.gainExp(4000 * cm.getPlayer().getExpRate()); + cm.completeQuest(20718, 1103003); + cm.gainExp(4000 * cm.getPlayer().getExpRate()); - cm.dispose(); - return; - } + cm.dispose(); + + } } \ No newline at end of file diff --git a/scripts/npc/1032110.js b/scripts/npc/1032110.js index 57043c7f4f..d529af71b6 100644 --- a/scripts/npc/1032110.js +++ b/scripts/npc/1032110.js @@ -6,27 +6,26 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(status == 0){ - cm.sendOk("Nothing remarkable here."); - } - else if(status == 1){ - cm.dispose(); - return; - } + if (status == 0) { + cm.sendOk("Nothing remarkable here."); + } else if (status == 1) { + cm.dispose(); + + } } \ No newline at end of file diff --git a/scripts/npc/1032111.js b/scripts/npc/1032111.js index f7c419bfba..f98727a620 100644 --- a/scripts/npc/1032111.js +++ b/scripts/npc/1032111.js @@ -6,40 +6,39 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(status == 0){ - if(cm.isQuestStarted(20716)){ - if(!cm.hasItem(4032142)){ - if(cm.canHold(4032142)){ - cm.gainItem(4032142, 1); - cm.sendOk("You bottled up some of the clear tree sap. #i4032142#"); - } - else - cm.sendOk("Make sure you have a free spot in your ETC inventory."); - } - else - cm.sendOk("A never ending flow of sap is coming from this small tree stump."); - } - else - cm.sendOk("A never ending flow of sap is coming from this small tree stump."); - } - else if(status == 1){ - cm.dispose(); - return; - } + if (status == 0) { + if (cm.isQuestStarted(20716)) { + if (!cm.hasItem(4032142)) { + if (cm.canHold(4032142)) { + cm.gainItem(4032142, 1); + cm.sendOk("You bottled up some of the clear tree sap. #i4032142#"); + } else { + cm.sendOk("Make sure you have a free spot in your ETC inventory."); + } + } else { + cm.sendOk("A never ending flow of sap is coming from this small tree stump."); + } + } else { + cm.sendOk("A never ending flow of sap is coming from this small tree stump."); + } + } else if (status == 1) { + cm.dispose(); + + } } \ No newline at end of file diff --git a/scripts/npc/1032113.js b/scripts/npc/1032113.js index 383ed474ac..77c3b48712 100644 --- a/scripts/npc/1032113.js +++ b/scripts/npc/1032113.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1032114.js b/scripts/npc/1032114.js index 383ed474ac..77c3b48712 100644 --- a/scripts/npc/1032114.js +++ b/scripts/npc/1032114.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1040000.js b/scripts/npc/1040000.js index 8c01f43c33..81003f7a34 100644 --- a/scripts/npc/1040000.js +++ b/scripts/npc/1040000.js @@ -19,38 +19,39 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(28177) && !cm.haveItem(4032479)) { - if(cm.canHold(4032479)) { - cm.gainItem(4032479, 1); - cm.sendOk("Huh, are you looking for me? Chief Stan sent you here, right? But hey, I am not the suspect you seek. If I have some proof? Here, take this and return it to #b#p1012003##k."); - } else { - cm.sendOk("Hey, make a slot available before talking to me."); - } - } else { - cm.sendOk("Zzzzzz..."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(28177) && !cm.haveItem(4032479)) { + if (cm.canHold(4032479)) { + cm.gainItem(4032479, 1); + cm.sendOk("Huh, are you looking for me? Chief Stan sent you here, right? But hey, I am not the suspect you seek. If I have some proof? Here, take this and return it to #b#p1012003##k."); + } else { + cm.sendOk("Hey, make a slot available before talking to me."); + } + } else { + cm.sendOk("Zzzzzz..."); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/1043000.js b/scripts/npc/1043000.js index 93105eab1f..ddbaf678cf 100644 --- a/scripts/npc/1043000.js +++ b/scripts/npc/1043000.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Sabi JQ herb pile #1 */ function start() { @@ -27,13 +28,15 @@ function start() { var totalodds = 0; var choice = 0; for (var i = 0; i < chances.length; i++) { - var itemGender = (Math.floor(prizes[i]/1000)%10); - if ((cm.getPlayer().getGender() != itemGender) && (itemGender != 2)) + var itemGender = (Math.floor(prizes[i] / 1000) % 10); + if ((cm.getPlayer().getGender() != itemGender) && (itemGender != 2)) { chances[i] = 0; + } } - for (var i = 0; i < chances.length; i++) + for (var i = 0; i < chances.length; i++) { totalodds += chances[i]; - var randomPick = Math.floor(Math.random()*totalodds)+1; + } + var randomPick = Math.floor(Math.random() * totalodds) + 1; for (var i = 0; i < chances.length; i++) { randomPick -= chances[i]; if (randomPick <= 0) { @@ -41,9 +44,10 @@ function start() { randomPick = totalodds + 100; } } - if (cm.isQuestStarted(2050)) - cm.gainItem(4031020,1); - cm.gainItem(prizes[choice],1); + if (cm.isQuestStarted(2050)) { + cm.gainItem(4031020, 1); + } + cm.gainItem(prizes[choice], 1); cm.warp(101000000, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1043001.js b/scripts/npc/1043001.js index c56162a8d5..451cdfb16a 100644 --- a/scripts/npc/1043001.js +++ b/scripts/npc/1043001.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Sabi JQ herb pile #1 */ @@ -28,13 +29,15 @@ function start() { var totalodds = 0; var choice = 0; for (var i = 0; i < chances.length; i++) { - var itemGender = (Math.floor(prizes[i]/1000)%10); - if ((cm.getPlayer().getGender() != itemGender) && (itemGender != 2)) + var itemGender = (Math.floor(prizes[i] / 1000) % 10); + if ((cm.getPlayer().getGender() != itemGender) && (itemGender != 2)) { chances[i] = 0; + } } - for (var i = 0; i < chances.length; i++) + for (var i = 0; i < chances.length; i++) { totalodds += chances[i]; - var randomPick = Math.floor(Math.random()*totalodds)+1; + } + var randomPick = Math.floor(Math.random() * totalodds) + 1; for (var i = 0; i < chances.length; i++) { randomPick -= chances[i]; if (randomPick <= 0) { @@ -42,9 +45,10 @@ function start() { randomPick = totalodds + 100; } } - if (cm.isQuestStarted(2051)) - cm.gainItem(4031032,1); - cm.gainItem(prizes[choice],1); + if (cm.isQuestStarted(2051)) { + cm.gainItem(4031032, 1); + } + cm.gainItem(prizes[choice], 1); cm.warp(101000000, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1052001.js b/scripts/npc/1052001.js index f70af17f2c..5d99c65e92 100644 --- a/scripts/npc/1052001.js +++ b/scripts/npc/1052001.js @@ -26,7 +26,7 @@ */ status = -1; -actionx = {"1stJob" : false, "2ndjob" : false, "3thJobI" : false, "3thJobC" : false}; +actionx = {"1stJob": false, "2ndjob": false, "3thJobI": false, "3thJobC": false}; job = 410; spawnPnpc = false; @@ -37,12 +37,12 @@ function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { if (cm.getJobId() == 0) { @@ -50,20 +50,21 @@ function start() { cm.sendNext("Want to be a #rthief#k? There are some standards to meet. because we can't just accept EVERYONE in... #bYour level should be at least 10, with at least your " + cm.getFirstJobStatRequirement(jobType) + "#k. Let's see."); // thanks Vcoc for noticing a need to state and check requirements on first job adv starting message } else if (cm.getLevel() >= 30 && cm.getJobId() == 400) { actionx["2ndJob"] = true; - if (cm.haveItem(4031012)) + if (cm.haveItem(4031012)) { cm.sendNext("I see you have done well. I will allow you to take the next step on your long road."); - else if (cm.haveItem(4031011)){ + } else if (cm.haveItem(4031011)) { cm.sendOk("Go and see the #b#p1072003##k."); cm.dispose(); - } else + } else { cm.sendNext("The progress you have made is astonishing."); - } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 4 && !cm.getPlayer().gotPartyQuestItem("JBP"))){ + } + } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 4 && !cm.getPlayer().gotPartyQuestItem("JBP"))) { actionx["3thJobI"] = true; cm.sendNext("There you are. A few days ago, #b#p2020011##k of Ossyria talked to me about you. I see that you are interested in making the leap to the dark world of the third job advancement for thieves. To archieve that goal, I will have to test your strength in orden to see whether you are worthy of the advancement. There is an opening in the middle of a deep swamp in Victoria Island, where it'll lead you to a secret passage. Once inside, you'll face a clone of myself. Your task is to defeat him and bring #b#t4031059##k back with you."); - } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)){ + } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)) { cm.sendNext("Please, bring me the #b#t4031059##k."); cm.dispose(); - } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")){ + } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")) { actionx["3thJobC"] = true; cm.sendNext("Nice work. You have defeated my clone and brought #b#t4031059##k back safely. You have now proven yourself worthy of the 3rd job advancement from the physical standpoint. Now you should give this necklace to #b#p2020011##k in Ossyria to take on the second part of the test. Good luck. You'll need it."); } else if (cm.isQuestStarted(6141)) { @@ -82,15 +83,15 @@ function action(mode, type, selection) { return; } else if (mode == 0 && type != 1) { status -= 2; - } - - if (status == -1){ + } + + if (status == -1) { start(); return; } else { - if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -98,39 +99,40 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); return; } else { - if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)){ - if (mode == 0 && status == 2 && type == 1) + if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)) { + if (mode == 0 && status == 2 && type == 1) { cm.sendOk("You know there is no other choice..."); - if (!(mode == 0 && type != 1)){ + } + if (!(mode == 0 && type != 1)) { cm.dispose(); return; } } } } - - if (actionx["1stJob"]){ + + if (actionx["1stJob"]) { if (status == 0) { - if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) + if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { cm.sendYesNo("Oh...! You look like someone that can definitely be a part of us... all you need is a little sinister mind, and... yeah... so, what do you think? Wanna be the Rogue?"); - else { + } else { cm.sendOk("Train a bit more until you reach the base requirements and I can show you the way of the #rThief#k."); cm.dispose(); } - } else if (status == 1){ - if (cm.canHold(2070000) && cm.canHoldAll([1472061, 1332063])){ - if (cm.getJobId() == 0){ + } else if (status == 1) { + if (cm.canHold(2070000) && cm.canHoldAll([1472061, 1332063])) { + if (cm.getJobId() == 0) { cm.changeJobById(400); cm.gainItem(2070015, 500); cm.gainItem(1472061, 1); @@ -142,74 +144,85 @@ function action(mode, type, selection) { cm.sendNext("Make some room in your inventory and talk back to me."); cm.dispose(); } - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You've gotten much stronger now. Plus every single one of your inventories have added slots. A whole row, to be exact. Go see for it yourself. I just gave you a little bit of #bSP#k. When you open up the #bSkill#k menu on the lower left corner of the screen, there are skills you can learn by using SP's. One warning, though: You can't raise it all together all at once. There are also skills you can acquire only after having learned a couple of skills first."); - else if (status == 3) + } else if (status == 3) { cm.sendNextPrev("Now a reminder. Once you have chosen, you cannot change up your mind and try to pick another path. Go now, and live as a proud Thief."); - else + } else { cm.dispose(); - } else if(actionx["2ndJob"]){ - if (status == 0){ - if (cm.haveItem(4031012)) + } + } else if (actionx["2ndJob"]) { + if (status == 0) { + if (cm.haveItem(4031012)) { cm.sendSimple("Alright, when you have made your decision, click on [I'll choose my occupation] at the bottom.#b\r\n#L0#Please explain to me what being the Assassin is all about.\r\n#L1#Please explain to me what being the Bandit is all about.\r\n#L3#I'll choose my occupation!"); - else { + } else { cm.sendNext("Good decision. You look strong, but I need to see if you really are strong enough to pass the test, it's not a difficult test, so you'll do just fine. Here, take my letter first... make sure you don't lose it!"); - if(!cm.isQuestStarted(100009)) cm.startQuest(100009); - } - } else if (status == 1){ - if (!cm.haveItem(4031012)){ - if (cm.canHold(4031011)){ - if(!cm.haveItem(4031011)) + if (!cm.isQuestStarted(100009)) { + cm.startQuest(100009); + } + } + } else if (status == 1) { + if (!cm.haveItem(4031012)) { + if (cm.canHold(4031011)) { + if (!cm.haveItem(4031011)) { cm.gainItem(4031011, 1); + } cm.sendNextPrev("Please get this letter to #b#p1072003##k who's around #b#m102040000##k near Kerning City. He is taking care of the job of an instructor in place of me. Give him the letter and he'll test you in place of me. Best of luck to you."); } else { cm.sendNext("Please, make some space in your inventory."); cm.dispose(); } - }else{ - if (selection < 3){ - if(selection == 0) { //assassin + } else { + if (selection < 3) { + if (selection == 0) { //assassin cm.sendNext("Thieves that master #rClaws#k.\r\n\r\n#bAssassins#k are far ranged attackers. They are quite Meso efficient and have good damage potential, but cost more than Bandits."); - } else if(selection == 1) { //bandit + } else if (selection == 1) { //bandit cm.sendNext("Thieves that master #rDaggers#k.\r\n\r\n#bBandits#k are quick melee attackers and are quite powerful among the 2nd jobs. They aren't as Meso efficient as Assassins and do not have the benefit of ranged attack but make up for it in much greater raw power."); } - + status -= 2; - } else + } else { cm.sendSimple("Now... have you made up your mind? Please choose the job you'd like to select for your 2nd job advancement. #b\r\n#L0#Assassin\r\n#L1#Bandit"); + } } - } else if (status == 2){ - if (cm.haveItem(4031011)){ + } else if (status == 2) { + if (cm.haveItem(4031011)) { cm.dispose(); return; } job += selection * 10; cm.sendYesNo("So you want to make the second job advancement as the " + (job == 410 ? "#bAssassin#k" : "#bBandit#k") + "? You know you won't be able to choose a different job for the 2nd job advancement once you make your desicion here, right?"); - } else if (status == 3){ - if (cm.haveItem(4031012)) + } else if (status == 3) { + if (cm.haveItem(4031012)) { cm.gainItem(4031012, -1); - cm.completeQuest(100011); - - if(job == 410) cm.sendNext("Alright, from here on out you are the #bAssassin#k. Assassins have quick hands and quicker feets to dominate the enemies. Please keep training. I'll make you even more powerful than you are right now!"); - else cm.sendNext("Alright, you're the #bBandit from here on out. Bandits revel in shadows and darkness, waiting until the right time comes for them to stick a dagger through the enemy's hearth, suddenly and swiftly... please keep training. I'll make you even more powerful than you are right now."); - - if (cm.getJobId() != job) + } + cm.completeQuest(100011); + + if (job == 410) { + cm.sendNext("Alright, from here on out you are the #bAssassin#k. Assassins have quick hands and quicker feets to dominate the enemies. Please keep training. I'll make you even more powerful than you are right now!"); + } else { + cm.sendNext("Alright, you're the #bBandit from here on out. Bandits revel in shadows and darkness, waiting until the right time comes for them to stick a dagger through the enemy's hearth, suddenly and swiftly... please keep training. I'll make you even more powerful than you are right now."); + } + + if (cm.getJobId() != job) { cm.changeJobById(job); - } else if (status == 4) + } + } else if (status == 4) { cm.sendNextPrev("I have just given you a book that gives you the list of skills you can acquire as a " + (job == 410 ? "assassin" : "bandit") + ". Also your etc inventory has expanded by adding another row to it. Your max HP and MP have increased, too. Go check and see for it yourself."); - else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("I have also given you a little bit of #bSP#k. Open the #bSkill Menu#k located at the bottomleft corner. you'll be able to boost up the newer acquired 2nd level skills. A word of warning, though. You can't boost them up all at once. Some of the skills are only available after you have learned other skills. Make sure yo remember that."); - else if (status == 6) + } else if (status == 6) { cm.sendNextPrev((job == 410 ? "Assassin" : "Bandit") + " need to be strong. But remember that you can't abuse that power and use it on a weakling. Please use your enormous power the right way, because... for you to use that the right way, that is much harden than just getting stronger. Please find me after you have advanced much further. I'll be waiting for you."); - } else if (actionx["3thJobI"]){ - if (status == 0){ - if (cm.getPlayer().gotPartyQuestItem("JB3")){ + } + } else if (actionx["3thJobI"]) { + if (status == 0) { + if (cm.getPlayer().gotPartyQuestItem("JB3")) { cm.getPlayer().removePartyQuestItem("JB3"); cm.getPlayer().setPartyQuestItemObtained("JBP"); } cm.sendNextPrev("Since he is a clone of myself, you can expect a tough battle ahead. He uses a number of special attacking skills unlike any you have ever seen, and it is your task to successfully take him one on one. There is a time limit in the secret passage, so it is crucial that you defeat him within the time limit. I wish you the best of luck, and I hope you bring the #b#t4031059##k with you."); } - } else if (actionx["3thJobC"]){ + } else if (actionx["3thJobC"]) { cm.getPlayer().removePartyQuestItem("JBP"); cm.gainItem(4031059, -1); cm.gainItem(4031057, 1); diff --git a/scripts/npc/1052002.js b/scripts/npc/1052002.js index 93b7361b79..f283ef798e 100644 --- a/scripts/npc/1052002.js +++ b/scripts/npc/1052002.js @@ -51,202 +51,197 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Pst... If you have the right goods, I can turn it into something niice...#b" - var options = new Array("Create a glove","Upgrade a glove","Create a claw","Upgrade a claw","Create materials"); - for (var i = 0; i < options.length; i++) + var options = ["Create a glove", "Upgrade a glove", "Create a claw", "Upgrade a claw", "Create materials"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //glove refine + if (selectedType == 0) { //glove refine var selStr = "So, what kind of glove would you like me to make?#b"; - var gloves = new Array ("Work Gloves#k - Common Lv. 10#b","Brown Duo#k - Thief Lv. 15#b","Blue Duo#k - Thief Lv. 15#b","Black Duo#k - Thief Lv. 15#b","Bronze Mischief#k - Thief Lv. 20#b","Bronze Wolfskin#k - Thief Lv. 25#b","Steel Sylvia#k - Thief Lv. 30#b", - "Steel Arbion#k - Thief Lv. 35#b","Red Cleave#k - Thief Lv. 40#b","Blue Moon Glove#k - Thief Lv. 50#b","Bronze Pow#k - Thief Lv. 60#b"); - for (var i = 0; i < gloves.length; i++) + var gloves = ["Work Gloves#k - Common Lv. 10#b", "Brown Duo#k - Thief Lv. 15#b", "Blue Duo#k - Thief Lv. 15#b", "Black Duo#k - Thief Lv. 15#b", "Bronze Mischief#k - Thief Lv. 20#b", "Bronze Wolfskin#k - Thief Lv. 25#b", "Steel Sylvia#k - Thief Lv. 30#b", + "Steel Arbion#k - Thief Lv. 35#b", "Red Cleave#k - Thief Lv. 40#b", "Blue Moon Glove#k - Thief Lv. 50#b", "Bronze Pow#k - Thief Lv. 60#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; + } equip = true; cm.sendSimple(selStr); - } - else if (selectedType == 1){ //glove upgrade + } else if (selectedType == 1) { //glove upgrade var selStr = "An upgraded glove? Sure thing, but note that upgrades won't carry over to the new item... #b"; - var gloves = new Array ("Mithril Mischief#k - Thief Lv. 20#b","Dark Mischief#k - Thief Lv. 20#b","Mithril Wolfskin#k - Thief Lv. 25#b", - "Dark Wolfskin#k - Thief Lv. 25#b","Silver Sylvia#k - Thief Lv. 30#b","Gold Sylvia#k - Thief Lv. 30#b","Orihalcon Arbion#k - Thief Lv. 35#b","Gold Arbion#k - Thief Lv. 35#b","Gold Cleave#k - Thief Lv. 40#b", - "Dark Cleave#k - Thief Lv. 40#b","Red Moon Glove#k - Thief Lv. 50#b","Brown Moon Glove#k - Thief Lv. 50#b","Silver Pow#k - Thief Lv. 60#b","Gold Pow#k - Thief Lv. 60#b"); - for (var i = 0; i < gloves.length; i++) + var gloves = ["Mithril Mischief#k - Thief Lv. 20#b", "Dark Mischief#k - Thief Lv. 20#b", "Mithril Wolfskin#k - Thief Lv. 25#b", + "Dark Wolfskin#k - Thief Lv. 25#b", "Silver Sylvia#k - Thief Lv. 30#b", "Gold Sylvia#k - Thief Lv. 30#b", "Orihalcon Arbion#k - Thief Lv. 35#b", "Gold Arbion#k - Thief Lv. 35#b", "Gold Cleave#k - Thief Lv. 40#b", + "Dark Cleave#k - Thief Lv. 40#b", "Red Moon Glove#k - Thief Lv. 50#b", "Brown Moon Glove#k - Thief Lv. 50#b", "Silver Pow#k - Thief Lv. 60#b", "Gold Pow#k - Thief Lv. 60#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; + } equip = true; cm.sendSimple(selStr); - } - else if (selectedType == 2){ //claw refine + } else if (selectedType == 2) { //claw refine var selStr = "So, what kind of claw would you like me to make?#b"; - var claws = new Array ("Steel Titans#k - Thief Lv. 15#b","Bronze Igor#k - Thief Lv. 20#b","Meba#k - Thief Lv. 25#b","Steel Guards#k - Thief Lv. 30#b","Bronze Guardian#k - Thief Lv. 35#b","Steel Avarice#k - Thief Lv. 40#b","Steel Slain#k - Thief Lv. 50#b"); - for (var i = 0; i < claws.length; i++){ + var claws = ["Steel Titans#k - Thief Lv. 15#b", "Bronze Igor#k - Thief Lv. 20#b", "Meba#k - Thief Lv. 25#b", "Steel Guards#k - Thief Lv. 30#b", "Bronze Guardian#k - Thief Lv. 35#b", "Steel Avarice#k - Thief Lv. 40#b", "Steel Slain#k - Thief Lv. 50#b"]; + for (var i = 0; i < claws.length; i++) { selStr += "\r\n#L" + i + "# " + claws[i] + "#l"; } equip = true; cm.sendSimple(selStr); - } - else if (selectedType == 3){ //claw upgrade + } else if (selectedType == 3) { //claw upgrade var selStr = "An upgraded claw? Sure thing, but note that upgrades won't carry over to the new item...#b"; - var claws = new Array ("Mithril Titans#k - Thief Lv. 15#b","Gold Titans#k - Thief Lv. 15#b","Steel Igor#k - Thief Lv. 20#b","Adamantium Igor#k - Thief Lv. 20#b","Mithril Guards#k - Thief Lv. 30#b","Adamantium Guards#k - Thief Lv. 30#b", - "Silver Guardian#k - Thief Lv. 35#b","Dark Guardian#k - Thief Lv. 35#b","Blood Avarice#k - Thief Lv. 40#b","Adamantium Avarice#k - Thief Lv. 40#b","Dark Avarice#k - Thief Lv. 40#b","Blood Slain#k - Thief Lv. 50#b","Sapphire Slain#k - Thief Lv. 50#b"); - for (var i = 0; i < claws.length; i++){ + var claws = ["Mithril Titans#k - Thief Lv. 15#b", "Gold Titans#k - Thief Lv. 15#b", "Steel Igor#k - Thief Lv. 20#b", "Adamantium Igor#k - Thief Lv. 20#b", "Mithril Guards#k - Thief Lv. 30#b", "Adamantium Guards#k - Thief Lv. 30#b", + "Silver Guardian#k - Thief Lv. 35#b", "Dark Guardian#k - Thief Lv. 35#b", "Blood Avarice#k - Thief Lv. 40#b", "Adamantium Avarice#k - Thief Lv. 40#b", "Dark Avarice#k - Thief Lv. 40#b", "Blood Slain#k - Thief Lv. 50#b", "Sapphire Slain#k - Thief Lv. 50#b"]; + for (var i = 0; i < claws.length; i++) { selStr += "\r\n#L" + i + "# " + claws[i] + "#l"; } equip = true; cm.sendSimple(selStr); - } - else if (selectedType == 4){ //material refine + } else if (selectedType == 4) { //material refine var selStr = "Materials? I know of a few materials that I can make for you...#b"; - var materials = new Array ("Make Processed Wood with Tree Branch","Make Processed Wood with Firewood","Make Screws (packs of 15)"); - for (var i = 0; i < materials.length; i++){ + var materials = ["Make Processed Wood with Tree Branch", "Make Processed Wood with Firewood", "Make Screws (packs of 15)"]; + for (var i = 0; i < materials.length; i++) { selStr += "\r\n#L" + i + "# " + materials[i] + "#l"; } equip = false; cm.sendSimple(selStr); } - if (equip) + if (equip) { status++; - } - else if (status == 2 && mode == 1) { + } + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 4){ //material refine - var itemSet = new Array (4003001,4003001,4003000); - var matSet = new Array(4000003,4000018,new Array (4011000,4011001)); - var matQtySet = new Array (10,5,new Array (1,1)); - var costSet = new Array (0,0,0); + if (selectedType == 4) { //material refine + var itemSet = [4003001, 4003001, 4003000]; + var matSet = [4000003, 4000018, [4011000, 4011001]]; + var matQtySet = [10, 5, [1, 1]]; + var costSet = [0, 0, 0]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - + var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - - cm.sendGetNumber(prompt,1,1,100) - } - else if (status == 3 && mode == 1) { - if (equip) - { + + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3 && mode == 1) { + if (equip) { selectedItem = selection; qty = 1; - } - else + } else { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } - if (selectedType == 0){ //glove refine - var itemSet = new Array(1082002,1082029,1082030,1082031,1082032,1082037,1082042,1082046,1082075,1082065,1082092); - var matSet = new Array(4000021,new Array(4000021,4000018),new Array(4000021,4000015),new Array(4000021,4000020),new Array(4011000,4000021),new Array(4011000,4011001,4000021),new Array(4011001,4000021,4003000),new Array(4011001,4011000,4000021,4003000),new Array(4021000,4000014,4000021,4003000),new Array(4021005,4021008,4000030,4003000),new Array(4011007,4011000,4021007,4000030,4003000)); - var matQtySet = new Array(15,new Array(30,20),new Array(30,20),new Array(30,20),new Array(2,40),new Array(2,1,10),new Array(2,50,10),new Array(3,1,60,15),new Array(3,200,80,30),new Array(3,1,40,30),new Array(1,8,1,50,50)); - var costSet = new Array(1000,7000,7000,7000,10000,15000,25000,30000,40000,50000,70000); + if (selectedType == 0) { //glove refine + var itemSet = [1082002, 1082029, 1082030, 1082031, 1082032, 1082037, 1082042, 1082046, 1082075, 1082065, 1082092]; + var matSet = [4000021, [4000021, 4000018], [4000021, 4000015], [4000021, 4000020], [4011000, 4000021], [4011000, 4011001, 4000021], [4011001, 4000021, 4003000], [4011001, 4011000, 4000021, 4003000], [4021000, 4000014, 4000021, 4003000], [4021005, 4021008, 4000030, 4003000], [4011007, 4011000, 4021007, 4000030, 4003000]]; + var matQtySet = [15, [30, 20], [30, 20], [30, 20], [2, 40], [2, 1, 10], [2, 50, 10], [3, 1, 60, 15], [3, 200, 80, 30], [3, 1, 40, 30], [1, 8, 1, 50, 50]]; + var costSet = [1000, 7000, 7000, 7000, 10000, 15000, 25000, 30000, 40000, 50000, 70000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //glove upgrade + var itemSet = [1082033, 1082034, 1082038, 1082039, 1082043, 1082044, 1082047, 1082045, 1082076, 1082074, 1082067, 1082066, 1082093, 1082094]; + var matSet = [[1082032, 4011002], [1082032, 4021004], [1082037, 4011002], [1082037, 4021004], [1082042, 4011004], [1082042, 4011006], [1082046, 4011005], [1082046, 4011006], [1082075, 4011006], [1082075, 4021008], [1082065, 4021000], [1082065, 4011006, 4021008], [1082092, 4011001, 4000014], [1082092, 4011006, 4000027]]; + var matQtySet = [[1, 1], [1, 1], [1, 2], [1, 2], [1, 2], [1, 1], [1, 3], [1, 2], [1, 4], [1, 2], [1, 5], [1, 2, 1], [1, 7, 200], [1, 7, 150]]; + var costSet = [5000, 7000, 10000, 12000, 15000, 20000, 22000, 25000, 40000, 50000, 55000, 60000, 70000, 80000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //claw refine + var itemSet = [1472001, 1472004, 1472007, 1472008, 1472011, 1472014, 1472018]; + var matSet = [[4011001, 4000021, 4003000], [4011000, 4011001, 4000021, 4003000], [1472000, 4011001, 4000021, 4003001], [4011000, 4011001, 4000021, 4003000], [4011000, 4011001, 4000021, 4003000], [4011000, 4011001, 4000021, 4003000], [4011000, 4011001, 4000030, 4003000]]; + var matQtySet = [[1, 20, 5], [2, 1, 30, 10], [1, 3, 20, 30], [3, 2, 50, 20], [4, 2, 80, 25], [3, 2, 100, 30], [4, 2, 40, 35]]; + var costSet = [2000, 3000, 5000, 15000, 30000, 40000, 50000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 3) { //claw upgrade + var itemSet = [1472002, 1472003, 1472005, 1472006, 1472009, 1472010, 1472012, 1472013, 1472015, 1472016, 1472017, 1472019, 1472020]; + var matSet = [[1472001, 4011002], [1472001, 4011006], [1472004, 4011001], [1472004, 4011003], [1472008, 4011002], [1472008, 4011003], [1472011, 4011004], [1472011, 4021008], [1472014, 4021000], [1472014, 4011003], [1472014, 4021008], [1472018, 4021000], [1472018, 4021005]]; + var matQtySet = [[1, 1], [1, 1], [1, 2], [1, 2], [1, 3], [1, 3], [1, 4], [1, 1], [1, 5], [1, 5], [1, 2], [1, 6], [1, 6]]; + var costSet = [1000, 2000, 3000, 5000, 10000, 15000, 20000, 25000, 30000, 30000, 35000, 40000, 40000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //glove upgrade - var itemSet = new Array(1082033,1082034,1082038,1082039,1082043,1082044,1082047,1082045,1082076,1082074,1082067,1082066,1082093,1082094); - var matSet = new Array(new Array(1082032,4011002),new Array(1082032,4021004),new Array(1082037,4011002),new Array(1082037,4021004),new Array(1082042,4011004),new Array(1082042,4011006),new Array(1082046,4011005),new Array(1082046,4011006),new Array(1082075,4011006),new Array(1082075,4021008),new Array(1082065,4021000),new Array(1082065,4011006,4021008),new Array(1082092,4011001,4000014),new Array(1082092,4011006,4000027)); - var matQtySet = new Array(new Array(1,1),new Array(1,1),new Array(1,2),new Array(1,2),new Array(1,2),new Array(1,1),new Array(1,3),new Array(1,2),new Array(1,4),new Array(1,2),new Array(1,5),new Array(1,2,1),new Array(1,7,200),new Array(1,7,150)); - var costSet = new Array (5000,7000,10000,12000,15000,20000,22000,25000,40000,50000,55000,60000,70000,80000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //claw refine - var itemSet = new Array(1472001,1472004,1472007,1472008,1472011,1472014,1472018); - var matSet = new Array(new Array(4011001,4000021,4003000),new Array(4011000,4011001,4000021,4003000),new Array(1472000,4011001,4000021,4003001),new Array(4011000,4011001,4000021,4003000),new Array(4011000,4011001,4000021,4003000),new Array(4011000,4011001,4000021,4003000),new Array(4011000,4011001,4000030,4003000)); - var matQtySet = new Array(new Array(1,20,5),new Array(2,1,30,10),new Array(1,3,20,30),new Array(3,2,50,20),new Array(4,2,80,25),new Array(3,2,100,30),new Array(4,2,40,35)); - var costSet = new Array(2000,3000,5000,15000,30000,40000,50000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //claw upgrade - var itemSet = new Array (1472002,1472003,1472005,1472006,1472009,1472010,1472012,1472013,1472015,1472016,1472017,1472019,1472020); - var matSet = new Array(new Array(1472001,4011002),new Array(1472001,4011006),new Array(1472004,4011001),new Array(1472004,4011003),new Array(1472008,4011002),new Array(1472008,4011003),new Array(1472011,4011004),new Array(1472011,4021008),new Array(1472014,4021000),new Array(1472014,4011003),new Array(1472014,4021008),new Array(1472018,4021000),new Array(1472018,4021005)); - var matQtySet = new Array (new Array(1,1),new Array(1,1),new Array(1,2),new Array(1,2),new Array(1,3),new Array(1,3),new Array(1,4),new Array(1,1),new Array(1,5),new Array(1,5),new Array(1,2),new Array(1,6),new Array(1,6)); - var costSet = new Array (1000,2000,3000,5000,10000,15000,20000,25000,30000,30000,35000,40000,40000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - + } + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 4 && mode == 1) { + } else if (status == 4 && mode == 1) { var complete = true; var recvItem = item, recvQty; - + if (item == 4003000)//screws + { recvQty = 15 * qty; - else + } else { recvQty = qty; - - if(!cm.canHold(recvItem, recvQty)) { + } + + if (!cm.canHold(recvItem, recvQty)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost * qty) - { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("I'm afraid you cannot afford my services."); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; + } } - - if (!complete) + + if (!complete) { cm.sendOk("What are you trying to pull? I can't make anything unless you bring me what I ask for."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } - } - else + } else { cm.gainItem(mats, -matQty * qty); - if (cost > 0) + } + if (cost > 0) { cm.gainMeso(-cost * qty); - + } + cm.gainItem(recvItem, recvQty); cm.sendOk("All done. If you need anything else... Well, I'm not going anywhere."); } diff --git a/scripts/npc/1052003.js b/scripts/npc/1052003.js index 3e50eae394..afc946c5d6 100644 --- a/scripts/npc/1052003.js +++ b/scripts/npc/1052003.js @@ -33,84 +33,79 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { var selStr = "Yes, I do own this forge. If you're willing to pay, I can offer you some of my services.#b" - var options = new Array("Refine a mineral ore","Refine a jewel ore","I have Iron Hog's Metal Hoof...","Upgrade a claw"); - for (var i = 0; i < options.length; i++){ + var options = ["Refine a mineral ore", "Refine a jewel ore", "I have Iron Hog's Metal Hoof...", "Upgrade a claw"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); - } - else if (status == 1) { + } else if (status == 1) { selectedType = selection; - if (selectedType == 0){ //mineral refine + if (selectedType == 0) { //mineral refine var selStr = "So, what kind of mineral ore would you like to refine?#b"; - var minerals = new Array ("Bronze","Steel","Mithril","Adamantium","Silver","Orihalcon","Gold"); - for (var i = 0; i < minerals.length; i++){ + var minerals = ["Bronze", "Steel", "Mithril", "Adamantium", "Silver", "Orihalcon", "Gold"]; + for (var i = 0; i < minerals.length; i++) { selStr += "\r\n#L" + i + "# " + minerals[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 1){ //jewel refine + } else if (selectedType == 1) { //jewel refine var selStr = "So, what kind of jewel ore would you like to refine?#b"; - var jewels = new Array ("Garnet","Amethyst","Aquamarine","Emerald","Opal","Sapphire","Topaz","Diamond","Black Crystal"); - for (var i = 0; i < jewels.length; i++){ + var jewels = ["Garnet", "Amethyst", "Aquamarine", "Emerald", "Opal", "Sapphire", "Topaz", "Diamond", "Black Crystal"]; + for (var i = 0; i < jewels.length; i++) { selStr += "\r\n#L" + i + "# " + jewels[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 2){ //foot refine + } else if (selectedType == 2) { //foot refine var selStr = "You know about that? Not many people realize the potential in the Iron Hog's Metal Hoof... I can make this into something special, if you want me to."; equip = false; cm.sendYesNo(selStr); - } - else if (selectedType == 3){ //claw refine + } else if (selectedType == 3) { //claw refine var selStr = "Ah, you wish to upgrade a claw? Then tell me, which one?#b"; - var claws = new Array ("Blood Gigantic#k - Thief Lv. 60#b","Sapphire Gigantic#k - Thief Lv. 60#b","Dark Gigantic#k - Thief Lv. 60#b"); - for (var i = 0; i < claws.length; i++){ + var claws = ["Blood Gigantic#k - Thief Lv. 60#b", "Sapphire Gigantic#k - Thief Lv. 60#b", "Dark Gigantic#k - Thief Lv. 60#b"]; + for (var i = 0; i < claws.length; i++) { selStr += "\r\n#L" + i + "# " + claws[i] + "#l"; } equip = true; cm.sendSimple(selStr); } - if (equip) + if (equip) { status++; - } - else if (status == 2 && mode == 1) { + } + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //mineral refine - var itemSet = new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006); - var matSet = new Array(4010000,4010001,4010002,4010003,4010004,4010005,4010006); - var matQtySet = new Array(10,10,10,10,10,10,10); - var costSet = new Array(300,300,300,500,500,500,800); + if (selectedType == 0) { //mineral refine + var itemSet = [4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006]; + var matSet = [4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10]; + var costSet = [300, 300, 300, 500, 500, 500, 800]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 1){ //jewel refine - var itemSet = new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008); - var matSet = new Array(4020000,4020001,4020002,4020003,4020004,4020005,4020006,4020007,4020008); - var matQtySet = new Array(10,10,10,10,10,10,10,10,10); - var costSet = new Array (500,500,500,500,500,500,500,1000,3000); + } else if (selectedType == 1) { //jewel refine + var itemSet = [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]; + var matSet = [4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10, 10, 10]; + var costSet = [500, 500, 500, 500, 500, 500, 500, 1000, 3000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //special refine - var itemSet = new Array(4011001,1); - var matSet = new Array(4000039,1); - var matQtySet = new Array (100,1); - var costSet = new Array (1000,1) + } else if (selectedType == 2) { //special refine + var itemSet = [4011001, 1]; + var matSet = [4000039, 1]; + var matQtySet = [100, 1]; + var costSet = [1000, 1] item = itemSet[0]; mats = matSet[0]; matQty = matQtySet[0]; @@ -119,47 +114,46 @@ function action(mode, type, selection) { var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - cm.sendGetNumber(prompt,1,1,100) - } - - else if (status == 3) { - if (equip) - { + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3) { + if (equip) { selectedItem = selection; qty = 1; - } - else + } else { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } last_use = false; - if (selectedType == 3){ //claw refine - var itemSet = new Array (1472023,1472024,1472025); - var matSet = new Array(new Array (1472022,4011007,4021000,2012000),new Array (1472022,4011007,4021005,2012002),new Array (1472022,4011007,4021008,4000046)); - var matQtySet = new Array (new Array (1,1,8,10),new Array (1,1,8,10),new Array (1,1,3,5)); - var costSet = new Array (80000,80000,100000) + if (selectedType == 3) { //claw refine + var itemSet = [1472023, 1472024, 1472025]; + var matSet = [[1472022, 4011007, 4021000, 2012000], [1472022, 4011007, 4021005, 2012002], [1472022, 4011007, 4021008, 4000046]]; + var matQtySet = [[1, 1, 8, 10], [1, 1, 8, 10], [1, 1, 3, 5]]; + var costSet = [80000, 80000, 100000] item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - if (selectedItem != 2) + if (selectedItem != 2) { last_use = true; + } } var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; + } prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array){ + if (mats instanceof Array) { for (var i = 0; i < mats.length; i++) { - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } } else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } if (cost > 0) { @@ -169,30 +163,31 @@ function action(mode, type, selection) { } else if (status == 4) { var complete = true; - if(!cm.canHold(item, qty)) { + if (!cm.canHold(item, qty)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost * qty) { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("Cash only, no credit."); cm.dispose(); return; } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; + } } - if (!complete) + if (!complete) { cm.sendOk("I cannot accept substitutes. If you don't have what I need, then I won't be able to help you."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } } else { diff --git a/scripts/npc/1052004.js b/scripts/npc/1052004.js index 3f6c61e911..e0b4252dfd 100644 --- a/scripts/npc/1052004.js +++ b/scripts/npc/1052004.js @@ -36,6 +36,7 @@ function pushIfItemExists(array, itemid) { array.push(itemid); } } + function start() { status = -1; action(1, 0, 0); @@ -43,36 +44,40 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well, hello! Welcome to the Henesys Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152001##k, you can let us take care of the rest and have the face you've always wanted~!\r\n#L2#Plastic Surgery: #i5152001##t5152001##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) - pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100)); + for (var i = 0; i < mface_v.length; i++) { + pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) - pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100)); + for (var i = 0; i < fface_v.length; i++) { + pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } } cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152001##k, you can get the face of your liking. Take your time in choosing the face of your preference.", facenew); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5152001) == true){ + if (cm.haveItem(5152001) == true) { cm.gainItem(5152001, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); - } else + } else { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); + } } } } diff --git a/scripts/npc/1052005.js b/scripts/npc/1052005.js index 3192dde566..92a07080b6 100644 --- a/scripts/npc/1052005.js +++ b/scripts/npc/1052005.js @@ -36,6 +36,7 @@ function pushIfItemExists(array, itemid) { array.push(itemid); } } + function start() { status = -1; action(1, 0, 0); @@ -45,24 +46,25 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hi, I pretty much shouldn't be doing this, but with a #b#t5152000##k, I will do it anyways for you. But don't forget, it will be random!\r\n#L2#Plastic Surgery: #i5152000##t5152000##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_r.length; i++) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_r.length; i++) { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -70,10 +72,9 @@ function action(mode, type, selection) { } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152000##k?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5152000) == true){ + if (cm.haveItem(5152000) == true) { cm.gainItem(5152000, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); diff --git a/scripts/npc/1052006.js b/scripts/npc/1052006.js index 4b39ae6702..b6f3707931 100644 --- a/scripts/npc/1052006.js +++ b/scripts/npc/1052006.js @@ -4,39 +4,43 @@ var cost = 1000; function start() { cm.sendNext("Hi, I'm the ticket salesman."); - if (cm.isQuestStarted(2055) || cm.isQuestCompleted(2055)) + if (cm.isQuestStarted(2055) || cm.isQuestCompleted(2055)) { zones++; - if (cm.isQuestStarted(2056) || cm.isQuestCompleted(2056)) + } + if (cm.isQuestStarted(2056) || cm.isQuestCompleted(2056)) { zones++; - if (cm.isQuestStarted(2057) || cm.isQuestCompleted(2057)) + } + if (cm.isQuestStarted(2057) || cm.isQuestCompleted(2057)) { zones++; + } } function action(mode, type, selection) { status++; - if (mode != 1){ + if (mode != 1) { cm.dispose(); return; } if (status == 0) { - if (zones == 0) + if (zones == 0) { cm.dispose(); - else { + } else { var selStr = "Which ticket would you like?#b"; - for (var i = 0; i < zones; i++) - selStr += "\r\n#L" + i + "#Construction site B" + (i+1) + " (" + cost + " mesos)#l"; + for (var i = 0; i < zones; i++) { + selStr += "\r\n#L" + i + "#Construction site B" + (i + 1) + " (" + cost + " mesos)#l"; + } cm.sendSimple(selStr); } } else if (status == 1) { - if (cm.getMeso() < cost) + if (cm.getMeso() < cost) { cm.sendOk("You do not have enough mesos."); - else { + } else { cm.gainMeso(-cost); - if(selection < 0 || selection > zones) { - cm.getClient().disconnect(false, false); - return; - } - cm.gainItem(4031036 + selection,1); + if (selection < 0 || selection > zones) { + cm.getClient().disconnect(false, false); + return; + } + cm.gainItem(4031036 + selection, 1); } cm.dispose(); } diff --git a/scripts/npc/1052007.js b/scripts/npc/1052007.js index 27a0f1a4d6..a3bdc19425 100644 --- a/scripts/npc/1052007.js +++ b/scripts/npc/1052007.js @@ -1,5 +1,3 @@ - - var status = 0; var ticketSelection = -1; var text = "Here's the ticket reader."; @@ -8,62 +6,62 @@ var NLC = false; var em; function start() { - cm.sendSimple("Pick your destination.\n\r\n#L0##bKerning Square Shopping Center#l\n\n\r\n#L1#Enter Contruction Site#l\r\n#L2#New Leaf City#l"); + cm.sendSimple("Pick your destination.\n\r\n#L0##bKerning Square Shopping Center#l\n\n\r\n#L1#Enter Contruction Site#l\r\n#L2#New Leaf City#l"); } function action(mode, type, selection) { em = cm.getEventManager("Subway"); - + if (mode == -1) { - cm.dispose(); - return; + cm.dispose(); + return; } else if (mode == 0) { - cm.dispose(); - return; + cm.dispose(); + return; } else { - status++; + status++; } if (status == 1) { if (selection == 0) { - var em = cm.getEventManager("KerningTrain"); - if (!em.startInstance(cm.getPlayer())) { - cm.sendOk("The passenger wagon is already full. Try again a bit later."); - } - - cm.dispose(); - return; + var em = cm.getEventManager("KerningTrain"); + if (!em.startInstance(cm.getPlayer())) { + cm.sendOk("The passenger wagon is already full. Try again a bit later."); + } + + cm.dispose(); + } else if (selection == 1) { if (cm.haveItem(4031036) || cm.haveItem(4031037) || cm.haveItem(4031038)) { text += " You will be brought in immediately. Which ticket you would like to use?#b"; for (var i = 0; i < 3; i++) { - if (cm.haveItem(4031036 + i)) { - text += "\r\n#b#L" + (i + 1) + "##t" + (4031036 + i) +"#"; - } - } - cm.sendSimple(text); + if (cm.haveItem(4031036 + i)) { + text += "\r\n#b#L" + (i + 1) + "##t" + (4031036 + i) + "#"; + } + } + cm.sendSimple(text); hasTicket = true; - } else { - cm.sendOk("It seems as though you don't have a ticket!"); - cm.dispose(); - return; + } else { + cm.sendOk("It seems as though you don't have a ticket!"); + cm.dispose(); + } } else if (selection == 2) { - if (!cm.haveItem(4031711) && cm.getPlayer().getMapId() == 103000100) { - cm.sendOk("It seems you don't have a ticket! You can buy one from Bell."); - cm.dispose(); - return; - } + if (!cm.haveItem(4031711) && cm.getPlayer().getMapId() == 103000100) { + cm.sendOk("It seems you don't have a ticket! You can buy one from Bell."); + cm.dispose(); + return; + } if (em.getProperty("entry") == "true") { cm.sendYesNo("It looks like there's plenty of room for this ride. Please have your ticket ready so I can let you in. The ride will be long, but you'll get to your destination just fine. What do you think? Do you want to get on this ride?"); } else { cm.sendNext("We will begin boarding 1 minute before the takeoff. Please be patient and wait for a few minutes. Be aware that the subway will take off right on time, and we stop receiving tickets 1 minute before that, so please make sure to be here on time."); cm.dispose(); - return; + } } } else if (status == 2) { - if (hasTicket) { - ticketSelection = selection; + if (hasTicket) { + ticketSelection = selection; if (ticketSelection > -1) { cm.gainItem(4031035 + ticketSelection, -1); cm.warp(103000897 + (ticketSelection * 3), "st00"); // thanks IxianMace for noticing a few scripts having misplaced warp SP's @@ -71,19 +69,18 @@ function action(mode, type, selection) { cm.dispose(); return; } - } - - if (cm.haveItem(4031711)) { - if(em.getProperty("entry") == "false") { + } + + if (cm.haveItem(4031711)) { + if (em.getProperty("entry") == "false") { cm.sendNext("We will begin boarding 1 minute before the takeoff. Please be patient and wait for a few minutes. Be aware that the subway will take off right on time, and we stop receiving tickets 1 minute before that, so please make sure to be here on time."); - } - else { + } else { cm.gainItem(4031711, -1); cm.warp(600010004); } - + cm.dispose(); - return; + } } } \ No newline at end of file diff --git a/scripts/npc/1052008.js b/scripts/npc/1052008.js index 095fd671cf..1e0def16ae 100644 --- a/scripts/npc/1052008.js +++ b/scripts/npc/1052008.js @@ -19,15 +19,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Shumi JQ Chest #1 */ function start() { - prizes = [4020000,4020001,4020002,4020003,4020004]; - if (cm.isQuestStarted(2055)) - cm.gainItem(4031039,1); - else - cm.gainItem(4020000 + ((Math.random()*5)|0), 1); + prizes = [4020000, 4020001, 4020002, 4020003, 4020004]; + if (cm.isQuestStarted(2055)) { + cm.gainItem(4031039, 1); + } else { + cm.gainItem(4020000 + ((Math.random() * 5) | 0), 1); + } cm.warp(103000100, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1052009.js b/scripts/npc/1052009.js index f1de2aab88..0df1ef7dda 100644 --- a/scripts/npc/1052009.js +++ b/scripts/npc/1052009.js @@ -19,15 +19,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Shumi JQ Chest #2 */ function start() { - prizes = [4020005,4020006,4020007,4020008,4010000]; - if (cm.isQuestStarted(2056)) - cm.gainItem(4031040,1); - else - cm.gainItem(prizes[parseInt(Math.random() * prizes.length)],1); + prizes = [4020005, 4020006, 4020007, 4020008, 4010000]; + if (cm.isQuestStarted(2056)) { + cm.gainItem(4031040, 1); + } else { + cm.gainItem(prizes[parseInt(Math.random() * prizes.length)], 1); + } cm.warp(103000100, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1052010.js b/scripts/npc/1052010.js index 7f75e4c2ad..aa451bc980 100644 --- a/scripts/npc/1052010.js +++ b/scripts/npc/1052010.js @@ -19,15 +19,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Shumi JQ Chest #3 */ function start() { - prizes = [4010001,4010002,4010003,4010004,4010005,4010006,4010007]; - if (cm.isQuestStarted(2057)) - cm.gainItem(4031041,1); - else - cm.gainItem(prizes[parseInt(Math.random() * prizes.length)],1); + prizes = [4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007]; + if (cm.isQuestStarted(2057)) { + cm.gainItem(4031041, 1); + } else { + cm.gainItem(prizes[parseInt(Math.random() * prizes.length)], 1); + } cm.warp(103000100, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1052011.js b/scripts/npc/1052011.js index 93dc53bef7..ef863e0a95 100644 --- a/scripts/npc/1052011.js +++ b/scripts/npc/1052011.js @@ -42,14 +42,13 @@ function action(mode, type, selection) { } else if (mode == 0) { cm.sendOk("Alright, see you next time."); cm.dispose(); - } - else { + } else { status++; - if (status == 1) + if (status == 1) { cm.sendNextPrev("Are you going to give up and leave this place?") - else if (status == 2) + } else if (status == 2) { cm.sendYesNo("You'll have to start from scratch the next time you come in..."); - else if (status == 3){ + } else if (status == 3) { cm.warp(103000100, 0); cm.dispose(); } diff --git a/scripts/npc/1052012.js b/scripts/npc/1052012.js index bb683cac66..c94e2b4a18 100644 --- a/scripts/npc/1052012.js +++ b/scripts/npc/1052012.js @@ -27,36 +27,37 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendYesNo("So, are you going to use the Internet Cafe? There is a fee to use the spaces there, that is #b5,000 mesos#k. Are you going to enter the Cafe?"); - } else if(status == 1) { - if(cm.getMeso() < 5000) { - cm.sendOk("Oh, you don't have the money, right? Sorry, I can't let you in."); - } else { - cm.gainMeso(-5000); - cm.warp(193000000, "out00"); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("So, are you going to use the Internet Cafe? There is a fee to use the spaces there, that is #b5,000 mesos#k. Are you going to enter the Cafe?"); + } else if (status == 1) { + if (cm.getMeso() < 5000) { + cm.sendOk("Oh, you don't have the money, right? Sorry, I can't let you in."); + } else { + cm.gainMeso(-5000); + cm.warp(193000000, "out00"); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1052013.js b/scripts/npc/1052013.js index 9bb2a58908..4289447b8b 100644 --- a/scripts/npc/1052013.js +++ b/scripts/npc/1052013.js @@ -26,113 +26,113 @@ var status; var pqArea; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(cm.getMapId() != 193000000) { - var eim = cm.getEventInstance(); - - if(status == 0) { - if(!eim.isEventCleared()) { - var couponsNeeded = eim.getIntProperty("couponsNeeded"); - - if(cm.isEventLeader()) { - if(cm.haveItem(4001007, couponsNeeded)) { - cm.sendNext("Your team collected all the needed coupons, good work!"); - cm.gainItem(4001007, couponsNeeded); - eim.clearPQ(); - - cm.dispose(); - return; - } else { - cm.sendYesNo("Your team must collect #r" + couponsNeeded + "#k coupons to complete this instance. Talk to me when you have the right amount in hands... Or you want to #bquit now#k? Note that if you quit now #ryour team will be forced to quit#k as well."); - } - } else { - cm.sendYesNo("Your team must collect #r" + couponsNeeded + "#k coupons to complete this instance. Let your leader talk to me with the right amount in hands... Or you want to #bquit now#k? Note that if you quit now your team #rmay become undermanned#k to further continue this instance."); - } - } else { - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendOk("Please make a room on your ETC inventory to receive the prize."); - cm.dispose(); - } else { - cm.warp(193000000); - cm.dispose(); - } - } - } else if(status == 1) { - cm.warp(193000000); - cm.dispose(); - } - } else { - var levels = ["#m190000000#", "#m191000000#", "#m192000000#", "#m195000000#", "#m196000000#", "#m197000000#"]; - if (status == 0) { - var sendStr = "Premium Road is a place of multiple areas with monsters of most various types gathered together, an ideal place for grinding EXP and erasers for the #p1052014#. Select the area you are willing to face:\r\n\r\n#b"; - for(var i = 0; i < 6; i++) { - sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; - } - - cm.sendSimple(sendStr); - } else if (status == 1) { - pqArea = selection + 1; - - em = cm.getEventManager("CafePQ_" + pqArea); - if(em == null) { - cm.sendOk("The CafePQ_" + pqArea + "has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - status = 1; - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThe #p1052014# operates differently than the common ones. They do not use mesos or gachapon tickets, rather #rERASERS#k, that can be obtained by completing the missions held on the Premium Road. To go there, you must find partners and attend to a Party Quest. When teamed up and ready, have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 2) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nOn the maps ahead, you will face many common-leveled mobs to face on. Grind all the required coupons from them and give it to me. All members will then receive a eraser, corresponding with the level faced. Insert on the machine #bmany of the same eraser or multiple different ones#k to have a better chance on greater prizes."); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (cm.getMapId() != 193000000) { + var eim = cm.getEventInstance(); + + if (status == 0) { + if (!eim.isEventCleared()) { + var couponsNeeded = eim.getIntProperty("couponsNeeded"); + + if (cm.isEventLeader()) { + if (cm.haveItem(4001007, couponsNeeded)) { + cm.sendNext("Your team collected all the needed coupons, good work!"); + cm.gainItem(4001007, couponsNeeded); + eim.clearPQ(); + + cm.dispose(); + + } else { + cm.sendYesNo("Your team must collect #r" + couponsNeeded + "#k coupons to complete this instance. Talk to me when you have the right amount in hands... Or you want to #bquit now#k? Note that if you quit now #ryour team will be forced to quit#k as well."); + } + } else { + cm.sendYesNo("Your team must collect #r" + couponsNeeded + "#k coupons to complete this instance. Let your leader talk to me with the right amount in hands... Or you want to #bquit now#k? Note that if you quit now your team #rmay become undermanned#k to further continue this instance."); + } + } else { + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendOk("Please make a room on your ETC inventory to receive the prize."); + cm.dispose(); + } else { + cm.warp(193000000); + cm.dispose(); + } + } + } else if (status == 1) { + cm.warp(193000000); + cm.dispose(); + } + } else { + var levels = ["#m190000000#", "#m191000000#", "#m192000000#", "#m195000000#", "#m196000000#", "#m197000000#"]; + if (status == 0) { + var sendStr = "Premium Road is a place of multiple areas with monsters of most various types gathered together, an ideal place for grinding EXP and erasers for the #p1052014#. Select the area you are willing to face:\r\n\r\n#b"; + for (var i = 0; i < 6; i++) { + sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; + } + + cm.sendSimple(sendStr); + } else if (status == 1) { + pqArea = selection + 1; + + em = cm.getEventManager("CafePQ_" + pqArea); + if (em == null) { + cm.sendOk("The CafePQ_" + pqArea + "has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + status = 1; + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThe #p1052014# operates differently than the common ones. They do not use mesos or gachapon tickets, rather #rERASERS#k, that can be obtained by completing the missions held on the Premium Road. To go there, you must find partners and attend to a Party Quest. When teamed up and ready, have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 2) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nOn the maps ahead, you will face many common-leveled mobs to face on. Grind all the required coupons from them and give it to me. All members will then receive a eraser, corresponding with the level faced. Insert on the machine #bmany of the same eraser or multiple different ones#k to have a better chance on greater prizes."); + cm.dispose(); + } + } + } + } } diff --git a/scripts/npc/1052014.js b/scripts/npc/1052014.js index 57b40e6290..002dfc44fa 100644 --- a/scripts/npc/1052014.js +++ b/scripts/npc/1052014.js @@ -23,7 +23,7 @@ * @npc: Vending Machine * @map: 193000000 - Premium Road - Kerning City Internet Cafe * @func: Cafe PQ Rewarder -*/ + */ var status; @@ -58,100 +58,116 @@ var curItemSel; var advance = true; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1 && advance) - status++; - else - status--; - - advance = true; - - if(status == 0) { - hasCoin = cm.haveItem(coinId); - cm.sendNext("This is the vending machine of the Internet Cafe. Place your erasers or #t" + coinId + "# earned throughout the quests to redeem a prize. You can place #bany amount of erasers#k, however take note that placing #rdifferent erasers#k and #rbigger shots of any of them#k will improve the reward possibilities!"); - } else if(status == 1) { - var sendStr; - currentTier = getRewardTier(); - - if(currentTier >= 0) sendStr = "With the items you have currently placed, you can retrieve a #r" + levels[currentTier] + "#k prize. Place erasers:"; - else sendStr = "You have placed no erasers yet. Place erasers:"; - - var listStr = ""; - for(var i = 0; i < tickets.length; i++) { - listStr += "#b#L" + i + "##t" + (4001009 + i) + "##k"; - if(tickets[i] > 0) listStr += " - " + tickets[i] + " erasers"; - listStr += "#l\r\n"; - } - if(hasCoin) { - listStr += "#b#L" + tickets.length + "##t" + coinId + "##k"; - if(coins > 0) listStr += " - " + coins + " feathers"; - listStr += "#l\r\n"; - } - - cm.sendSimple(sendStr + "\r\n\r\n" + listStr + "#r#L" + getRewardIndex(hasCoin) + "#Retrieve a prize!#l#k\r\n"); - - } else if(status == 2) { - if(selection == getRewardIndex(hasCoin)) { - if(currentTier < 0) { - cm.sendPrev("You have set no erasers. Insert at least one to claim a prize."); - advance = false; - } else { - givePrize(); - cm.dispose(); - } - } else { - var tickSel; - if(selection < tickets.length) tickSel = 4001009 + selection; - else tickSel = coinId; - - curItemQty = cm.getItemQuantity(tickSel); - curItemSel = selection; - - if(curItemQty > 0) { - cm.sendGetText("How many of #b#t" + tickSel + "##k do you want to insert on the machine? (#r" + curItemQty + "#k available)#k"); - } else { - cm.sendPrev("You have got #rnone#k of #b#t" + tickSel + "##k to insert on the machine. Click '#rBack#k' to return to the main interface."); - advance = false; - } - } - } else if(status == 3) { - var text = cm.getText(); - - try { - var placedQty = parseInt(text); - if(isNaN(placedQty) || placedQty < 0) throw true; - - if(placedQty > curItemQty) { - cm.sendPrev("You cannot insert the given amount of erasers (#r" + curItemQty + "#k available). Click '#rBack#k' to return to the main interface."); - advance = false; - } else { - if(curItemSel < tickets.length) tickets[curItemSel] = placedQty; - else coins = placedQty; - - cm.sendPrev("Operation succeeded. Click '#rBack#k' to return to the main interface."); - advance = false; - } - } catch(err) { - cm.sendPrev("You must enter a positive number of erasers to insert. Click '#rBack#k' to return to the main interface."); - advance = false; - } - - status = 2; - } else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1 && advance) { + status++; + } else { + status--; + } + + advance = true; + + if (status == 0) { + hasCoin = cm.haveItem(coinId); + cm.sendNext("This is the vending machine of the Internet Cafe. Place your erasers or #t" + coinId + "# earned throughout the quests to redeem a prize. You can place #bany amount of erasers#k, however take note that placing #rdifferent erasers#k and #rbigger shots of any of them#k will improve the reward possibilities!"); + } else if (status == 1) { + var sendStr; + currentTier = getRewardTier(); + + if (currentTier >= 0) { + sendStr = "With the items you have currently placed, you can retrieve a #r" + levels[currentTier] + "#k prize. Place erasers:"; + } else { + sendStr = "You have placed no erasers yet. Place erasers:"; + } + + var listStr = ""; + for (var i = 0; i < tickets.length; i++) { + listStr += "#b#L" + i + "##t" + (4001009 + i) + "##k"; + if (tickets[i] > 0) { + listStr += " - " + tickets[i] + " erasers"; + } + listStr += "#l\r\n"; + } + if (hasCoin) { + listStr += "#b#L" + tickets.length + "##t" + coinId + "##k"; + if (coins > 0) { + listStr += " - " + coins + " feathers"; + } + listStr += "#l\r\n"; + } + + cm.sendSimple(sendStr + "\r\n\r\n" + listStr + "#r#L" + getRewardIndex(hasCoin) + "#Retrieve a prize!#l#k\r\n"); + + } else if (status == 2) { + if (selection == getRewardIndex(hasCoin)) { + if (currentTier < 0) { + cm.sendPrev("You have set no erasers. Insert at least one to claim a prize."); + advance = false; + } else { + givePrize(); + cm.dispose(); + } + } else { + var tickSel; + if (selection < tickets.length) { + tickSel = 4001009 + selection; + } else { + tickSel = coinId; + } + + curItemQty = cm.getItemQuantity(tickSel); + curItemSel = selection; + + if (curItemQty > 0) { + cm.sendGetText("How many of #b#t" + tickSel + "##k do you want to insert on the machine? (#r" + curItemQty + "#k available)#k"); + } else { + cm.sendPrev("You have got #rnone#k of #b#t" + tickSel + "##k to insert on the machine. Click '#rBack#k' to return to the main interface."); + advance = false; + } + } + } else if (status == 3) { + var text = cm.getText(); + + try { + var placedQty = parseInt(text); + if (isNaN(placedQty) || placedQty < 0) { + throw true; + } + + if (placedQty > curItemQty) { + cm.sendPrev("You cannot insert the given amount of erasers (#r" + curItemQty + "#k available). Click '#rBack#k' to return to the main interface."); + advance = false; + } else { + if (curItemSel < tickets.length) { + tickets[curItemSel] = placedQty; + } else { + coins = placedQty; + } + + cm.sendPrev("Operation succeeded. Click '#rBack#k' to return to the main interface."); + advance = false; + } + } catch (err) { + cm.sendPrev("You must enter a positive number of erasers to insert. Click '#rBack#k' to return to the main interface."); + advance = false; + } + + status = 2; + } else { + cm.dispose(); + } + } } function getRewardIndex(hasCoin) { @@ -160,77 +176,87 @@ function getRewardIndex(hasCoin) { function getRewardTier() { var points = getPoints(); - - if(points <= 6) { - if(points <= 0) return -1; - else return 0; + + if (points <= 6) { + if (points <= 0) { + return -1; + } else { + return 0; + } } - if(points >= 46) return 5; - + if (points >= 46) { + return 5; + } + return Math.floor((points - 6) / 8); } function getPoints() { var points = 0; - - for(var i = 0; i < tickets.length; i++) { - if(tickets[i] <= 0) continue; - + + for (var i = 0; i < tickets.length; i++) { + if (tickets[i] <= 0) { + continue; + } + points += (6 + ((tickets[i] - 1) * getTicketMultiplier(i))); //6 from uniques + rest from each ticket difficulty } points += Math.ceil(0.46 * coins); // 100 coins for a LV6 tier item. - + return points; } function getTicketMultiplier(ticket) { - if(ticket == 1 || ticket == 3) return 3; - else return 1; + if (ticket == 1 || ticket == 3) { + return 3; + } else { + return 1; + } } function givePrize() { - var lvTarget, lvQty; - - if(currentTier == 0) { - lvTarget = itemSet_lv1; - lvQty = itemQty_lv1; - } else if(currentTier == 1) { - lvTarget = itemSet_lv2; - lvQty = itemQty_lv2; - } else if(currentTier == 2) { - lvTarget = itemSet_lv3; - lvQty = itemQty_lv3; - } else if(currentTier == 3) { - lvTarget = itemSet_lv4; - lvQty = itemQty_lv4; - } else if(currentTier == 4) { - lvTarget = itemSet_lv5; - lvQty = itemQty_lv5; - } else { - lvTarget = itemSet_lv6; - lvQty = itemQty_lv6; - } - - if(!hasRewardSlot(lvTarget, lvQty)) { - cm.sendOk("Check for an available space on your inventory before retrieving a prize."); - } else { - var rnd = Math.floor(Math.random() * lvTarget.length); - - for(var i = 0; i < tickets.length; i++) { - cm.gainItem(4001009 + i, -1 * tickets[i]); - } - cm.gainItem(coinId, -1 * coins); - - cm.gainItem(lvTarget[rnd], lvQty[rnd]); + var lvTarget, lvQty; + + if (currentTier == 0) { + lvTarget = itemSet_lv1; + lvQty = itemQty_lv1; + } else if (currentTier == 1) { + lvTarget = itemSet_lv2; + lvQty = itemQty_lv2; + } else if (currentTier == 2) { + lvTarget = itemSet_lv3; + lvQty = itemQty_lv3; + } else if (currentTier == 3) { + lvTarget = itemSet_lv4; + lvQty = itemQty_lv4; + } else if (currentTier == 4) { + lvTarget = itemSet_lv5; + lvQty = itemQty_lv5; + } else { + lvTarget = itemSet_lv6; + lvQty = itemQty_lv6; + } + + if (!hasRewardSlot(lvTarget, lvQty)) { + cm.sendOk("Check for an available space on your inventory before retrieving a prize."); + } else { + var rnd = Math.floor(Math.random() * lvTarget.length); + + for (var i = 0; i < tickets.length; i++) { + cm.gainItem(4001009 + i, -1 * tickets[i]); } + cm.gainItem(coinId, -1 * coins); + + cm.gainItem(lvTarget[rnd], lvQty[rnd]); + } } function hasRewardSlot(lvTarget, lvQty) { - for(var i = 0; i < lvTarget.length; i++) { - if(!cm.canHold(lvTarget[i], lvQty[i])) { - return false; - } + for (var i = 0; i < lvTarget.length; i++) { + if (!cm.canHold(lvTarget[i], lvQty[i])) { + return false; } + } - return true; + return true; } \ No newline at end of file diff --git a/scripts/npc/1052015.js b/scripts/npc/1052015.js index b8f5f412f8..ec0132418a 100644 --- a/scripts/npc/1052015.js +++ b/scripts/npc/1052015.js @@ -23,7 +23,7 @@ * @npc: Billy * @map: 193000000 - Premium Road - Kerning City Internet Cafe * @func: Cafe PQ Reward Announcer -*/ + */ var status; @@ -48,63 +48,66 @@ var itemQty_lv1 = [1, 1, 1, 1, 1, 20, 20, 20, 20, 20, 25, 25, 25, 50, 50, 12, 1, var levels = ["Tier 1", "Tier 2", "Tier 3", "Tier 4", "Tier 5", "Tier 6"]; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - var sendStr = "The #bInternet Cafe Party Quest#k rewards players with ticket-like #bfigure erasers#k, that can be used on the vending machine to retrieve prizes. By further increasing the stakes, one can get better prizes, separated by #rtiers#k.\r\n\r\nThe possible rewards for each tier are depicted here:\r\n\r\n#b"; - for(var i = 0; i < 6; i++) { - sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; - } - - cm.sendSimple(sendStr); - } else if(status == 1) { - var lvTarget, lvQty; - - if(selection == 0) { - lvTarget = itemSet_lv1; - lvQty = itemQty_lv1; - } else if(selection == 1) { - lvTarget = itemSet_lv2; - lvQty = itemQty_lv2; - } else if(selection == 2) { - lvTarget = itemSet_lv3; - lvQty = itemQty_lv3; - } else if(selection == 3) { - lvTarget = itemSet_lv4; - lvQty = itemQty_lv4; - } else if(selection == 4) { - lvTarget = itemSet_lv5; - lvQty = itemQty_lv5; - } else { - lvTarget = itemSet_lv6; - lvQty = itemQty_lv6; - } - - var sendStr = "The following items are being awarded at #b" + levels[selection] + "#k:\r\n\r\n"; - for(var i = 0; i < lvTarget.length; i++) { - sendStr += " #L" + i + "# #i" + lvTarget[i] + "# #t" + lvTarget[i] + "#"; - if(lvQty[i] > 1) sendStr += " (" + lvQty[i] + ")"; - sendStr += "#l\r\n"; - } - - cm.sendPrev(sendStr); - } else if(status == 2) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var sendStr = "The #bInternet Cafe Party Quest#k rewards players with ticket-like #bfigure erasers#k, that can be used on the vending machine to retrieve prizes. By further increasing the stakes, one can get better prizes, separated by #rtiers#k.\r\n\r\nThe possible rewards for each tier are depicted here:\r\n\r\n#b"; + for (var i = 0; i < 6; i++) { + sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; + } + + cm.sendSimple(sendStr); + } else if (status == 1) { + var lvTarget, lvQty; + + if (selection == 0) { + lvTarget = itemSet_lv1; + lvQty = itemQty_lv1; + } else if (selection == 1) { + lvTarget = itemSet_lv2; + lvQty = itemQty_lv2; + } else if (selection == 2) { + lvTarget = itemSet_lv3; + lvQty = itemQty_lv3; + } else if (selection == 3) { + lvTarget = itemSet_lv4; + lvQty = itemQty_lv4; + } else if (selection == 4) { + lvTarget = itemSet_lv5; + lvQty = itemQty_lv5; + } else { + lvTarget = itemSet_lv6; + lvQty = itemQty_lv6; + } + + var sendStr = "The following items are being awarded at #b" + levels[selection] + "#k:\r\n\r\n"; + for (var i = 0; i < lvTarget.length; i++) { + sendStr += " #L" + i + "# #i" + lvTarget[i] + "# #t" + lvTarget[i] + "#"; + if (lvQty[i] > 1) { + sendStr += " (" + lvQty[i] + ")"; + } + sendStr += "#l\r\n"; + } + + cm.sendPrev(sendStr); + } else if (status == 2) { + cm.dispose(); + } + } } diff --git a/scripts/npc/1052016.js b/scripts/npc/1052016.js index 7e757d92b5..72aa839631 100644 --- a/scripts/npc/1052016.js +++ b/scripts/npc/1052016.js @@ -20,34 +20,37 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { var selStr = ""; - if (cm.getJobId() == 0) + if (cm.getJobId() == 0) { selStr += "We have a special 90% discount for beginners."; + } selStr += "Choose your destination, for fees will change from place to place.#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 2) { - cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); + cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); selectedMap = selection; } else if (status == 3) { if (cm.getJobId() == 0) { - mesos = cost[selectedMap] / 10; + mesos = cost[selectedMap] / 10; } else { - mesos = cost[selectedMap]; + mesos = cost[selectedMap]; } - + if (cm.getMeso() < mesos) { cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab."); cm.dispose(); return; } - + cm.gainMeso(-mesos); cm.warp(maps[selectedMap], 0); cm.dispose(); diff --git a/scripts/npc/1052100.js b/scripts/npc/1052100.js index 127be5cc40..ee34c561ac 100644 --- a/scripts/npc/1052100.js +++ b/scripts/npc/1052100.js @@ -37,6 +37,7 @@ function pushIfItemExists(array, itemid) { array.push(itemid); } } + function start() { status = -1; action(1, 0, 0); @@ -44,12 +45,14 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hello! I'm Don Giovanni, head of the beauty salon! If you have either #b#t5150003##k or #b#t5151003##k, why don't you let me take care of the rest? Decide what you want to do with your hair...\r\n#L1#Haircut: #i5150003##t5150003##l\r\n#L2#Dye your hair: #i5151003##t5151003##l"); } else if (status == 1) { @@ -57,46 +60,49 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) + for (var i = 0; i < mhair_v.length; i++) { pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } } cm.sendStyle("I can totally change up your hairstyle and make it look so good. Why don't you change it up a bit? If you have #b#t5150003##k I'll change it for you. Choose the one to your liking~.", hairnew); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t5151003##k I'll change it for you. Choose the one to your liking.", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420003)){ + if (beauty == 1) { + if (cm.haveItem(5420003)) { cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150003)){ + } else if (cm.haveItem(5150003)) { cm.gainItem(5150003, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); + } } - if (beauty == 2){ - if (cm.haveItem(5151003)){ + if (beauty == 2) { + if (cm.haveItem(5151003)) { cm.gainItem(5151003, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); + } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150003, 1); @@ -105,8 +111,9 @@ function action(mode, type, selection) { cm.gainMeso(-haircolorprice); cm.gainItem(5151003, 1); cm.sendOk("Enjoy!"); - } else + } else { cm.sendOk("You don't have enough mesos to buy a coupon!"); + } } } } diff --git a/scripts/npc/1052101.js b/scripts/npc/1052101.js index 2f57bbb2d8..fe1b8ae40d 100644 --- a/scripts/npc/1052101.js +++ b/scripts/npc/1052101.js @@ -39,6 +39,7 @@ function pushIfItemExists(array, itemid) { array.push(itemid); } } + function start() { status = -1; action(1, 0, 0); @@ -48,10 +49,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("I'm Andre, Don's assistant. Everyone calls me Andre, though. If you have a #b#t5150002##k, #b#t5150011##k or a #b#t5151002##k, please let me change your hairdo!\r\n#L0#Haircut: #i5150002##t5150002##l\r\n#L1#Haircut: #i5150011##t5150011##l\r\n#L2#Dye your hair: #i5151002##t5151002##l"); } else if (status == 1) { @@ -59,13 +61,13 @@ function action(mode, type, selection) { beauty = 3; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_r.length; i++) { + for (var i = 0; i < mhair_r.length; i++) { pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_r.length; i++) { + for (var i = 0; i < fhair_r.length; i++) { pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -75,13 +77,13 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_e.length; i++) { + for (var i = 0; i < mhair_e.length; i++) { pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_e.length; i++) { + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -91,17 +93,16 @@ function action(mode, type, selection) { beauty = 2; haircolor = Array(); var current = parseInt(cm.getPlayer().getHair() - /10)*10; - for(var i = 0; i < 8; i++) { + / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5151002##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150011) == true){ + if (beauty == 1) { + if (cm.haveItem(5150011) == true) { cm.gainItem(5150011, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -109,8 +110,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151002) == true){ + if (beauty == 2) { + if (cm.haveItem(5151002) == true) { cm.gainItem(5151002, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -118,8 +119,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 3){ - if (cm.haveItem(5150002) == true){ + if (beauty == 3) { + if (cm.haveItem(5150002) == true) { cm.gainItem(5150002, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -127,7 +128,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150011, 1); diff --git a/scripts/npc/1052107.js b/scripts/npc/1052107.js index a84188d257..f7ea9439ac 100644 --- a/scripts/npc/1052107.js +++ b/scripts/npc/1052107.js @@ -25,28 +25,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("A small focus of light lighting in the immersive darkness."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("A small focus of light lighting in the immersive darkness."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1052109.js b/scripts/npc/1052109.js index 826517af31..0ed60b4dba 100644 --- a/scripts/npc/1052109.js +++ b/scripts/npc/1052109.js @@ -24,28 +24,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Just a trash can sitting there."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Just a trash can sitting there."); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1052110.js b/scripts/npc/1052110.js index 0bba942db2..85f2201efe 100644 --- a/scripts/npc/1052110.js +++ b/scripts/npc/1052110.js @@ -4,7 +4,7 @@ */ var status; - + function start() { status = -1; action(1, 0, 0); @@ -18,12 +18,13 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else - status--; - - if(status == 0) { + } else { + status--; + } + + if (status == 0) { cm.sendOk("Just a trash can sitting there."); cm.dispose(); } diff --git a/scripts/npc/1052111.js b/scripts/npc/1052111.js index 2d318bf28d..30816f8d8a 100644 --- a/scripts/npc/1052111.js +++ b/scripts/npc/1052111.js @@ -5,43 +5,42 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1){ - cm.dispose(); - return; - } - else{ - if(mode == 0 && status == 0){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); - if(status == 0) { - if(cm.isQuestStarted(20710)) { - if(!cm.hasItem(4032136)) { - if(cm.canHold(4032136)) { - cm.gainItem(4032136, 1); - cm.sendNext("You have found a #b#t4032136##k in the trash can! #i4032136#"); - } else { - cm.sendOk("#i4032136# Not enough space in your ETC inventory."); - } - } else { - cm.sendOk("Just a trash can sitting there."); - } - } else { - cm.sendOk("Just a trash can sitting there."); - } - } else if(status == 1){ - cm.dispose(); - } - } + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } + + if (status == 0) { + if (cm.isQuestStarted(20710)) { + if (!cm.hasItem(4032136)) { + if (cm.canHold(4032136)) { + cm.gainItem(4032136, 1); + cm.sendNext("You have found a #b#t4032136##k in the trash can! #i4032136#"); + } else { + cm.sendOk("#i4032136# Not enough space in your ETC inventory."); + } + } else { + cm.sendOk("Just a trash can sitting there."); + } + } else { + cm.sendOk("Just a trash can sitting there."); + } + } else if (status == 1) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1052112.js b/scripts/npc/1052112.js index 58909d5be0..71f03a6754 100644 --- a/scripts/npc/1052112.js +++ b/scripts/npc/1052112.js @@ -4,7 +4,7 @@ */ var status; - + function start() { status = -1; action(1, 0, 0); @@ -18,12 +18,13 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else - status--; - - if(status == 0) { + } else { + status--; + } + + if (status == 0) { cm.sendOk("Just a trash can sitting there."); cm.dispose(); } diff --git a/scripts/npc/1052113.js b/scripts/npc/1052113.js index 4ebe7e3544..9b33deb5da 100644 --- a/scripts/npc/1052113.js +++ b/scripts/npc/1052113.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { - cm.sendOk("This training ground is available only for those under level 20."); - cm.dispose(); - return; + if (cm.getLevel() >= 20) { + cm.sendOk("This training ground is available only for those under level 20."); + cm.dispose(); + return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1052114.js b/scripts/npc/1052114.js index 6062c957b3..9b33deb5da 100644 --- a/scripts/npc/1052114.js +++ b/scripts/npc/1052114.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1052115.js b/scripts/npc/1052115.js index 43644d2d90..6750df6535 100644 --- a/scripts/npc/1052115.js +++ b/scripts/npc/1052115.js @@ -1,5 +1,6 @@ var status = 0; var section = 0; + //questid 29931, infoquest 7662 function start() { @@ -8,71 +9,71 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - status--; + status--; } if (status == 1) { - if (cm.getMapId() == 910320001) { - cm.warp(910320000, 0); - cm.dispose(); - } else if (cm.getMapId() == 910330001) { - var itemid = 4001321; - if (!cm.canHold(itemid)) { - cm.sendOk("Please make room for 1 ETC slot."); - } else { - cm.gainItem(itemid,1); - cm.warp(910320000, 0); - } - cm.dispose(); - } else if (cm.getMapId() >= 910320100 && cm.getMapId() <= 910320304) { - cm.sendYesNo("Would you like to exit this place?"); - status = 99; - } else { - cm.sendSimple("My name is Mr.Lim.\r\n#b#e#L1#Enter the Dusty Platform.#l#n\r\n#L2#Head towards Train 999.#l\r\n#L3#Receive a medal of .#l#k"); - } + if (cm.getMapId() == 910320001) { + cm.warp(910320000, 0); + cm.dispose(); + } else if (cm.getMapId() == 910330001) { + var itemid = 4001321; + if (!cm.canHold(itemid)) { + cm.sendOk("Please make room for 1 ETC slot."); + } else { + cm.gainItem(itemid, 1); + cm.warp(910320000, 0); + } + cm.dispose(); + } else if (cm.getMapId() >= 910320100 && cm.getMapId() <= 910320304) { + cm.sendYesNo("Would you like to exit this place?"); + status = 99; + } else { + cm.sendSimple("My name is Mr.Lim.\r\n#b#e#L1#Enter the Dusty Platform.#l#n\r\n#L2#Head towards Train 999.#l\r\n#L3#Receive a medal of .#l#k"); + } } else if (status == 2) { - section = selection; - if (selection == 1) { - if (cm.getPlayer().getLevel() < 25 || cm.getPlayer().getLevel() > 30 || !cm.isLeader()) { - cm.sendOk("You must be in the Level Range 25-30 and be the party leader."); - } else { - if (!cm.start_PyramidSubway(-1)) { - cm.sendOk("The Dusty Platform is currently full at the moment."); - } - } - //todo - } else if (selection == 2) { - if (cm.haveItem(4001321)) { - if (cm.bonus_PyramidSubway(-1)) { - cm.gainItem(4001321, -1); - } else { - cm.sendOk("The Train 999 is currently full at the moment"); - } - } else { - cm.sendOk("You do not have the Boarding Pass."); - } - } else if (selection == 3) { - var record = cm.getQuestRecord(7662); - var data = record.getCustomData(); - if (data == null) { - record.setCustomData("0"); - data = record.getCustomData(); - } - var mons = parseInt(data); - if (mons < 10000) { - cm.sendOk("Please defeat at least 10,000 monsters in the Station and look for me again. Kills : " + mons); - } else if (cm.canHold(1142141) && !cm.haveItem(1142141)){ - cm.gainItem(1142141,1); - cm.startQuest(29931); - cm.completeQuest(29931); - } else { - cm.sendOk("Please make room."); - } - } - cm.dispose(); - } else if (status == 100) { - cm.warp(910320000,0); - cm.dispose(); - } + section = selection; + if (selection == 1) { + if (cm.getPlayer().getLevel() < 25 || cm.getPlayer().getLevel() > 30 || !cm.isLeader()) { + cm.sendOk("You must be in the Level Range 25-30 and be the party leader."); + } else { + if (!cm.start_PyramidSubway(-1)) { + cm.sendOk("The Dusty Platform is currently full at the moment."); + } + } + //todo + } else if (selection == 2) { + if (cm.haveItem(4001321)) { + if (cm.bonus_PyramidSubway(-1)) { + cm.gainItem(4001321, -1); + } else { + cm.sendOk("The Train 999 is currently full at the moment"); + } + } else { + cm.sendOk("You do not have the Boarding Pass."); + } + } else if (selection == 3) { + var record = cm.getQuestRecord(7662); + var data = record.getCustomData(); + if (data == null) { + record.setCustomData("0"); + data = record.getCustomData(); + } + var mons = parseInt(data); + if (mons < 10000) { + cm.sendOk("Please defeat at least 10,000 monsters in the Station and look for me again. Kills : " + mons); + } else if (cm.canHold(1142141) && !cm.haveItem(1142141)) { + cm.gainItem(1142141, 1); + cm.startQuest(29931); + cm.completeQuest(29931); + } else { + cm.sendOk("Please make room."); + } + } + cm.dispose(); + } else if (status == 100) { + cm.warp(910320000, 0); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1052125.js b/scripts/npc/1052125.js index 05f5a8d634..12ce9f5b46 100644 --- a/scripts/npc/1052125.js +++ b/scripts/npc/1052125.js @@ -45,28 +45,28 @@ function action(mode, type, selection) { } } if (status == 0) { - if (selection == 0) { - if (cm.isQuestStarted(2286) || cm.isQuestStarted(2287) || cm.isQuestStarted(2288)) { - var em = cm.getEventManager("RockSpirit"); - if (!em.startInstance(cm.getPlayer())) { - cm.sendOk("Uh... It looks like the rooms ahead are a bit crowded right now. Please wait around here for a bit, ok?"); - } - cm.dispose(); - return; - } else { - cm.sendOk("I did not hear anything from Blake that you are assisting him."); - } - } else { - if (cm.isQuestCompleted(2290)) { - if(cm.getPlayer().getLevel() > 50) { - cm.sendOk("The VIP area is available only for players #rlevel 50 or below#k."); - } else { - cm.sendOk("The VIP area only gets available after handing over #r#t4032521#s#k from the #b'Admission to the VIP Zone'#k quest."); - } - } else { - cm.sendOk("#rVIP#k? Yeah that is funny #rMr. VIP#k, now get lost before I call security."); + if (selection == 0) { + if (cm.isQuestStarted(2286) || cm.isQuestStarted(2287) || cm.isQuestStarted(2288)) { + var em = cm.getEventManager("RockSpirit"); + if (!em.startInstance(cm.getPlayer())) { + cm.sendOk("Uh... It looks like the rooms ahead are a bit crowded right now. Please wait around here for a bit, ok?"); } - } - cm.dispose(); + cm.dispose(); + return; + } else { + cm.sendOk("I did not hear anything from Blake that you are assisting him."); + } + } else { + if (cm.isQuestCompleted(2290)) { + if (cm.getPlayer().getLevel() > 50) { + cm.sendOk("The VIP area is available only for players #rlevel 50 or below#k."); + } else { + cm.sendOk("The VIP area only gets available after handing over #r#t4032521#s#k from the #b'Admission to the VIP Zone'#k quest."); + } + } else { + cm.sendOk("#rVIP#k? Yeah that is funny #rMr. VIP#k, now get lost before I call security."); + } + } + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/1061000.js b/scripts/npc/1061000.js index d8be4a8f0f..2888966658 100644 --- a/scripts/npc/1061000.js +++ b/scripts/npc/1061000.js @@ -41,159 +41,163 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Hello, I live here, but don't underestimate me. How about I help you by making you a new pair of shoes?#b" - var options = new Array("Create a Warrior shoe","Create a Bowman shoe","Create a Magician shoe","Create a Thief shoe"); - for (var i = 0; i < options.length; i++){ + var options = ["Create a Warrior shoe", "Create a Bowman shoe", "Create a Magician shoe", "Create a Thief shoe"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; var selStr; var shoes; - if (selectedType == 0){ //warrior shoe + if (selectedType == 0) { //warrior shoe selStr = "Warrior shoes? Sure thing, which kind?#b"; - shoes = new Array ("Silver War Boots#k - Warrior Lv. 25#b","Gold War Boots#k - Warrior Lv. 25#b","Dark War Boots#k - Warrior Lv. 25#b", - "Emerald Battle Grieve#k - Warrior Lv. 30#b","Mithril Battle Grieve#k - Warrior Lv. 30#b","Silver Battle Grieve#k - Warrior Lv. 30#b","Blood Battle Grieve#k - Warrior Lv. 30#b", - "Steel Trigger#k - Warrior Lv. 35#b","Mithril Trigger#k - Warrior Lv. 35#b","Dark Trigger#k - Warrior Lv. 35#b", - "Brown Jangoon Boots#k - Warrior Lv. 40#b","Maroon Jangoon Boots#k - Warrior Lv. 40#b","Blue Jangoon Boots#k - Warrior Lv. 40#b", - "Emerald Hildon Boots#k - Warrior Lv. 50#b","Mithril Hildon Boots#k - Warrior Lv. 50#b","Orihalcon Hildon Boots#k - Warrior Lv. 50#b","Gold Hildon Boots#k - Warrior Lv. 50#b", - "Sapphire Camel Boots#k - Warrior Lv. 60#b","Orihalcon Camel Boots#k - Warrior Lv. 60#b","Blood Camel Boots#k - Warrior Lv. 60#b");; - } - else if (selectedType == 1){ //bowman shoe + shoes = ["Silver War Boots#k - Warrior Lv. 25#b", "Gold War Boots#k - Warrior Lv. 25#b", "Dark War Boots#k - Warrior Lv. 25#b", + "Emerald Battle Grieve#k - Warrior Lv. 30#b", "Mithril Battle Grieve#k - Warrior Lv. 30#b", "Silver Battle Grieve#k - Warrior Lv. 30#b", "Blood Battle Grieve#k - Warrior Lv. 30#b", + "Steel Trigger#k - Warrior Lv. 35#b", "Mithril Trigger#k - Warrior Lv. 35#b", "Dark Trigger#k - Warrior Lv. 35#b", + "Brown Jangoon Boots#k - Warrior Lv. 40#b", "Maroon Jangoon Boots#k - Warrior Lv. 40#b", "Blue Jangoon Boots#k - Warrior Lv. 40#b", + "Emerald Hildon Boots#k - Warrior Lv. 50#b", "Mithril Hildon Boots#k - Warrior Lv. 50#b", "Orihalcon Hildon Boots#k - Warrior Lv. 50#b", "Gold Hildon Boots#k - Warrior Lv. 50#b", + "Sapphire Camel Boots#k - Warrior Lv. 60#b", "Orihalcon Camel Boots#k - Warrior Lv. 60#b", "Blood Camel Boots#k - Warrior Lv. 60#b"]; + + } else if (selectedType == 1) { //bowman shoe selStr = "Bowman shoes? Sure thing, which kind?#b"; - shoes = new Array ("Brown Jack Boots#k - Bowman Lv. 25#b","Green Jack Boots#k - Bowman Lv. 25#b","Red Jack Boots#k - Bowman Lv. 25#b", - "Red Hunter Boots#k - Bowman Lv. 30#b","Blue Hunter Boots#k - Bowman Lv. 30#b","Green Hunter Boots#k - Bowman Lv. 30#b","Black Hunter Boots#k - Bowman Lv. 30#b","Brown Hunter Boots#k - Bowman Lv. 30#b", - "Blue Silky Boots#k - Bowman Lv. 35#b","Green Silky Boots#k - Bowman Lv. 35#b","Red Silky Boots#k - Bowman Lv. 35#b", - "Red Pierre Shoes#k - Bowman Lv. 40#b","Yellow Pierre Shoes#k - Bowman Lv. 40#b","Brown Pierre Shoes#k - Bowman Lv. 40#b","Blue Pierre Shoes#k - Bowman Lv. 40#b", - "Brown Steel-Tipped Boots#k - Bowman Lv. 50#b","Green Steel-Tipped Boots#k - Bowman Lv. 50#b","Blue Steel-Tipped Boots#k - Bowman Lv. 50#b","Purple Steel-Tipped Boots#k - Bowman Lv. 50#b", - "Red Gore Boots#k - Bowman Lv. 60#b","Blue Gore Boots#k - Bowman Lv. 60#b","Green Gore Boots#k - Bowman Lv. 60#b"); - }else if (selectedType == 2){ //magician shoe + shoes = ["Brown Jack Boots#k - Bowman Lv. 25#b", "Green Jack Boots#k - Bowman Lv. 25#b", "Red Jack Boots#k - Bowman Lv. 25#b", + "Red Hunter Boots#k - Bowman Lv. 30#b", "Blue Hunter Boots#k - Bowman Lv. 30#b", "Green Hunter Boots#k - Bowman Lv. 30#b", "Black Hunter Boots#k - Bowman Lv. 30#b", "Brown Hunter Boots#k - Bowman Lv. 30#b", + "Blue Silky Boots#k - Bowman Lv. 35#b", "Green Silky Boots#k - Bowman Lv. 35#b", "Red Silky Boots#k - Bowman Lv. 35#b", + "Red Pierre Shoes#k - Bowman Lv. 40#b", "Yellow Pierre Shoes#k - Bowman Lv. 40#b", "Brown Pierre Shoes#k - Bowman Lv. 40#b", "Blue Pierre Shoes#k - Bowman Lv. 40#b", + "Brown Steel-Tipped Boots#k - Bowman Lv. 50#b", "Green Steel-Tipped Boots#k - Bowman Lv. 50#b", "Blue Steel-Tipped Boots#k - Bowman Lv. 50#b", "Purple Steel-Tipped Boots#k - Bowman Lv. 50#b", + "Red Gore Boots#k - Bowman Lv. 60#b", "Blue Gore Boots#k - Bowman Lv. 60#b", "Green Gore Boots#k - Bowman Lv. 60#b"]; + } else if (selectedType == 2) { //magician shoe selStr = "Magician shoes? Sure thing, which kind?#b"; - shoes = new Array ("Blue Jewelery Shoes#k - Magician Lv. 20#b","Purple Jewelery Shoes#k - Magician Lv. 20#b","Red Jewelery Shoes#k - Magician Lv. 20#b", - "Silver Windshoes#k - Magician Lv. 25#b","Yellow Windshoes#k - Magician Lv. 25#b","Black Windshoes#k - Magician Lv. 25#b", - "Red Magicshoes#k - Magician Lv. 30#b","Blue Magicshoes#k - Magician Lv. 30#b","White Magicshoes#k - Magician Lv. 30#b","Black Magicshoes#k - Magician Lv. 30#b", - "Purple Salt Shoes#k - Magician Lv. 35#b","Red Salt Shoes#k - Magician Lv. 35#b","Black Salt Shoes#k - Magician Lv. 35#b", - "Red Moon Shoes#k - Magician Lv. 40#b","Blue Moon Shoes#k - Magician Lv. 40#b","Gold Moon Shoes#k - Magician Lv. 40#b","Dark Moon Shoes#k - Magician Lv. 40#b", - "Pink Goldwind Shoes#k - Magician Lv. 50#b","Blue Goldwind Shoes#k - Magician Lv. 50#b","Purple Goldwind Shoes#k - Magician Lv. 50#b","Green Goldwind Shoes#k - Magician Lv. 50#b", - "Pink Goldrunners#k - Magician Lv. 60#b","Green Goldrunners#k - Magician Lv. 60#b","Orange Goldrunners#k - Magician Lv. 60#b","Blue Goldrunners#k - Magician Lv. 60#b"); - }else if (selectedType == 3){ //thief shoe + shoes = ["Blue Jewelery Shoes#k - Magician Lv. 20#b", "Purple Jewelery Shoes#k - Magician Lv. 20#b", "Red Jewelery Shoes#k - Magician Lv. 20#b", + "Silver Windshoes#k - Magician Lv. 25#b", "Yellow Windshoes#k - Magician Lv. 25#b", "Black Windshoes#k - Magician Lv. 25#b", + "Red Magicshoes#k - Magician Lv. 30#b", "Blue Magicshoes#k - Magician Lv. 30#b", "White Magicshoes#k - Magician Lv. 30#b", "Black Magicshoes#k - Magician Lv. 30#b", + "Purple Salt Shoes#k - Magician Lv. 35#b", "Red Salt Shoes#k - Magician Lv. 35#b", "Black Salt Shoes#k - Magician Lv. 35#b", + "Red Moon Shoes#k - Magician Lv. 40#b", "Blue Moon Shoes#k - Magician Lv. 40#b", "Gold Moon Shoes#k - Magician Lv. 40#b", "Dark Moon Shoes#k - Magician Lv. 40#b", + "Pink Goldwind Shoes#k - Magician Lv. 50#b", "Blue Goldwind Shoes#k - Magician Lv. 50#b", "Purple Goldwind Shoes#k - Magician Lv. 50#b", "Green Goldwind Shoes#k - Magician Lv. 50#b", + "Pink Goldrunners#k - Magician Lv. 60#b", "Green Goldrunners#k - Magician Lv. 60#b", "Orange Goldrunners#k - Magician Lv. 60#b", "Blue Goldrunners#k - Magician Lv. 60#b"]; + } else if (selectedType == 3) { //thief shoe selStr = "Thief shoes? Sure thing, which kind?#b"; - shoes = new Array ("Blue Lappy Shoes#k - Thief Lv. 25#b","Red Lappy Shoes#k - Thief Lv. 25#b","Green Lappy Shoes#k - Thief Lv. 25#b","Black Lappy Shoes#k - Thief Lv. 25#b", - "Bronze Chain Boots#k - Thief Lv. 30#b","Iron Chain Boots#k - Thief Lv. 30#b","Silver Chain Boots#k - Thief Lv. 30#b","Gold Chain Boots#k - Thief Lv. 30#b", - "Red White-Line Boots#k - Thief Lv. 35#b","Green White-Line Boots#k - Thief Lv. 35#b","Blue White-Line Boots#k - Thief Lv. 35#b", - "Black Red-Lined Shoes#k - Thief Lv. 40#b","Black Green-Lined Shoes#k - Thief Lv. 40#b","Black Yellow-Lined Shoes#k - Thief Lv. 40#b","Black Blue-Lined Shoes#k - Thief Lv. 40#b", - "Blue Goni Shoes#k - Thief Lv. 50#b","Red Goni Shoes#k - Thief Lv. 50#b","Green Goni Shoes#k - Thief Lv. 50#b","Purple Goni Shoes#k - Thief Lv. 50#b", - "Blood Moss Boots#k - Thief Lv. 60#b","Gold Moss Boots#k - Thief Lv. 60#b","Dark Moss Boots#k - Thief Lv. 60#b"); - }for (var i = 0; i < shoes.length; i++) - selStr += "\r\n#L" + i + "# " + shoes[i] + "#l"; - cm.sendSimple(selStr); - }else if (status == 2 && mode == 1) { - selectedItem = selection; - if (selectedType == 0){ //warrior shoe - var itemSet = new Array(1072051,1072053,1072052,1072003,1072039,1072040,1072041,1072002,1072112,1072113,1072000,1072126,1072127,1072132,1072133,1072134,1072135,1072147,1072148,1072149); - var matSet = new Array(new Array(4011004,4011001,4000021,4003000),new Array(4011006,4011001,4000021,4003000),new Array(4021008,4011001,4000021,4003000),new Array(4021003,4011001,4000021,4003000),new Array(4011002,4011001,4000021,4003000), - new Array(4011004,4011001,4000021,4003000),new Array(4021000,4011001,4000021,4003000),new Array(4011001,4021004,4000021,4000030,4003000),new Array(4011002,4021004,4000021,4000030,4003000),new Array(4021008,4021004,4000021,4000030,4003000), - new Array(4011003,4000021,4000030,4003000,4000033),new Array(4011005,4021007,4000030,4003000,4000042),new Array(4011002,4021007,4000030,4003000,4000041),new Array(4021008,4011001,4021003,4000030,4003000), - new Array(4021008,4011001,4011002,4000030,4003000),new Array(4021008,4011001,4011005,4000030,4003000),new Array(4021008,4011001,4011006,4000030,4003000),new Array(4021008,4011007,4021005,4000030,4003000), - new Array(4021008,4011007,4011005,4000030,4003000),new Array(4021008,4011007,4021000,4000030,4003000)); - var matQtySet = new Array(new Array(2,1,15,10),new Array(2,1,15,10),new Array(1,2,20,10),new Array(4,2,45,15),new Array(4,2,45,15),new Array(4,2,45,15),new Array(4,2,45,15),new Array(3,1,30,20,25),new Array(3,1,30,20,25),new Array(2,1,30,20,25), - new Array(4,100,40,30,100),new Array(4,1,40,30,250),new Array(4,1,40,30,120),new Array(1,3,6,65,45),new Array(1,3,6,65,45),new Array(1,3,6,65,45),new Array(1,3,6,65,45),new Array(1,1,8,80,55),new Array(1,1,8,80,55),new Array(1,1,8,80,55)); - var costSet = new Array(10000,10000,12000,20000,20000,20000,20000,22000,22000,25000,38000,38000,38000,50000,50000,50000,50000,60000,60000,60000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - }else if (selectedType == 1){ //bowman shoe - var itemSet = new Array(1072027,1072034,1072069,1072079,1072080,1072081,1072082,1072083,1072101,1072102,1072103,1072118,1072119,1072120,1072121,1072122,1072123,1072124,1072125,1072144,1072145,1072146); - var matSet = new Array(new Array(4000021,4011000,4003000),new Array(4000021,4021003,4003000),new Array(4000021,4021000,4003000),new Array(4000021,4021000,4003000),new Array(4000021,4021005,4003000),new Array(4000021,4021003,4003000), - new Array(4000021,4021004,4003000),new Array(4000021,4021006,4003000),new Array(4021002,4021006,4000030,4000021,4003000),new Array(4021003,4021006,4000030,4000021,4003000),new Array(4021000,4021006,4000030,4000021,4003000), - new Array(4021000,4003000,4000030,4000024),new Array(4021006,4003000,4000030,4000027),new Array(4011003,4003000,4000030,4000044),new Array(4021002,4003000,4000030,4000009),new Array(4011001,4021006,4021008,4000030,4003000,4000033), - new Array(4011001,4021006,4021008,4000030,4003000,4000032),new Array(4011001,4021006,4021008,4000030,4003000,4000041),new Array(4011001,4021006,4021008,4000030,4003000,4000042),new Array(4011006,4021000,4021007,4000030,4003000), - new Array(4011006,4021005,4021007,4000030,4003000),new Array(4011006,4021003,4021007,4000030,4003000)); - var matQtySet = new Array(new Array(35,3,10),new Array(35,1,10),new Array(35,1,10),new Array(50,2,15),new Array(50,2,15),new Array(50,2,15),new Array(50,2,15),new Array(50,2,15), - new Array(3,1,15,30,20),new Array(3,1,15,30,20),new Array(3,1,15,30,20),new Array(4,30,45,20),new Array(4,30,45,20),new Array(5,30,45,40),new Array(5,30,45,120), - new Array(3,3,1,60,35,80),new Array(3,3,1,60,35,150),new Array(3,3,1,60,35,100),new Array(3,3,1,60,35,250),new Array(5,8,1,75,50),new Array(5,8,1,75,50),new Array(5,8,1,75,50)); - var costSet = new Array(9000,9000,9000,19000,19000,19000,19000,19000,19000,20000,20000,20000,32000,32000,40000,40000,50000,50000,50000,50000,60000,60000,60000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - }else if (selectedType == 2){ //magician shoe - var itemSet = new Array(1072019,1072020,1072021,1072072,1072073,1072074,1072075,1072076,1072077,1072078,1072089,1072090,1072091,1072114,1072115,1072116,1072117,1072140,1072141,1072142,1072143,1072136,1072137,1072138,1072139); - var matSet = new Array(new Array(4021005,4000021,4003000),new Array(4021001,4000021,4003000),new Array(4021000,4000021,4003000),new Array(4011004,4000021,4003000),new Array(4021006,4000021,4003000),new Array(4021004,4000021,4003000), - new Array(4021000,4000021,4003000),new Array(4021002,4000021,4003000),new Array(4011004,4000021,4003000),new Array(4021008,4000021,4003000),new Array(4021001,4021006,4000021,4000030,4003000),new Array(4021000,4021006,4000021,4000030,4003000), - new Array(4021008,4021006,4000021,4000030,4003000),new Array(4021000,4000030,4000043,4003000),new Array(4021005,4000030,4000037,4003000),new Array(4011006,4021007,4000030,4000027,4003000),new Array(4021008,4021007,4000030,4000014,4003000), - new Array(4021009,4011006,4021000,4000030,4003000),new Array(4021009,4011006,4021005,4000030,4003000),new Array(4021009,4011006,4021001,4000030,4003000),new Array(4021009,4011006,4021003,4000030,4003000), - new Array(4021009,4011006,4011005,4000030,4003000),new Array(4021009,4011006,4021003,4000030,4003000),new Array(4021009,4011006,4011003,4000030,4003000),new Array(4021009,4011006,4021002,4000030,4003000)); - var matQtySet = new Array(new Array(1,30,5),new Array(1,30,5),new Array(1,30,5),new Array(1,35,10),new Array(1,35,10),new Array(1,35,10),new Array(2,50,15),new Array(2,50,15),new Array(2,50,15), - new Array(1,50,15),new Array(3,1,30,15,20),new Array(3,1,30,15,20),new Array(2,1,40,25,20),new Array(4,40,35,25),new Array(4,40,70,25),new Array(2,1,40,20,25),new Array(2,1,40,30,30), - new Array(1,3,3,60,40),new Array(1,3,3,60,40),new Array(1,3,3,60,40),new Array(1,3,3,60,40),new Array(1,4,5,70,50),new Array(1,4,5,70,50),new Array(1,4,5,70,50),new Array(1,4,5,70,50)); - var costSet = new Array(3000,3000,3000,8000,8000,8000,18000,18000,18000,18000,20000,20000,22000,30000,30000,35000,40000,50000,50000,50000,50000,60000,60000,60000,60000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - }else if (selectedType == 3){ //thief shoe - var itemSet = new Array(1072084,1072085,1072086,1072087,1072032,1072033,1072035,1072036,1072104,1072105,1072106,1072107,1072108,1072109,1072110,1072128,1072130,1072129,1072131,1072150,1072151,1072152); - var matSet = new Array(new Array(4021005,4000021,4003000),new Array(4021000,4000021,4003000),new Array(4021003,4000021,4003000),new Array(4021004,4000021,4003000),new Array(4011000,4000021,4003000),new Array(4011001,4000021,4003000),new Array(4011004,4000021,4003000),new Array(4011006,4000021,4003000),new Array(4021000,4021004,4000021,4000030,4003000),new Array(4021003,4021004,4000021,4000030,4003000),new Array(4021002,4021004,4000021,4000030,4003000),new Array(4021000,4000030,4000033,4003000),new Array(4021003,4000030,4000032,4003000),new Array(4021006,4000030,4000040,4003000),new Array(4021005,4000030,4000037,4003000),new Array(4011007,4021005,4000030,4000037,4003000),new Array(4011007,4021000,4000030,4000043,4003000),new Array(4011007,4021003,4000030,4000045,4003000),new Array(4011007,4021001,4000030,4000036,4003000),new Array(4021008,4011007,4021005,4000030,4003000),new Array(4021008,4011007,4011005,4000030,4003000),new Array(4021008,4011007,4021000,4000030,4003000)); - var matQtySet = new Array(new Array(1,35,10),new Array(1,35,10),new Array(1,35,10),new Array(1,35,10),new Array(3,50,15),new Array(3,50,15),new Array(2,50,15),new Array(2,50,15),new Array(3,1,30,15,20),new Array(3,1,30,15,20),new Array(3,1,30,15,20), - new Array(5,45,50,30),new Array(4,45,30,30),new Array(4,45,3,30),new Array(4,45,70,30),new Array(2,3,50,200,35),new Array(2,3,50,150,35),new Array(2,3,50,80,35),new Array(2,3,50,80,35),new Array(1,1,8,75,50),new Array(1,1,5,75,50),new Array(1,1,1,75,50)); - var costSet = new Array(9000,9000,9000,9000,19000,19000,19000,21000,20000,20000,20000,40000,32000,35000,35000,50000,50000,50000,50000,60000,60000,60000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - }var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++) - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + shoes = ["Blue Lappy Shoes#k - Thief Lv. 25#b", "Red Lappy Shoes#k - Thief Lv. 25#b", "Green Lappy Shoes#k - Thief Lv. 25#b", "Black Lappy Shoes#k - Thief Lv. 25#b", + "Bronze Chain Boots#k - Thief Lv. 30#b", "Iron Chain Boots#k - Thief Lv. 30#b", "Silver Chain Boots#k - Thief Lv. 30#b", "Gold Chain Boots#k - Thief Lv. 30#b", + "Red White-Line Boots#k - Thief Lv. 35#b", "Green White-Line Boots#k - Thief Lv. 35#b", "Blue White-Line Boots#k - Thief Lv. 35#b", + "Black Red-Lined Shoes#k - Thief Lv. 40#b", "Black Green-Lined Shoes#k - Thief Lv. 40#b", "Black Yellow-Lined Shoes#k - Thief Lv. 40#b", "Black Blue-Lined Shoes#k - Thief Lv. 40#b", + "Blue Goni Shoes#k - Thief Lv. 50#b", "Red Goni Shoes#k - Thief Lv. 50#b", "Green Goni Shoes#k - Thief Lv. 50#b", "Purple Goni Shoes#k - Thief Lv. 50#b", + "Blood Moss Boots#k - Thief Lv. 60#b", "Gold Moss Boots#k - Thief Lv. 60#b", "Dark Moss Boots#k - Thief Lv. 60#b"]; } - else - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; - if (cost > 0) + for (var i = 0; i < shoes.length; i++) { + selStr += "\r\n#L" + i + "# " + shoes[i] + "#l"; + } + cm.sendSimple(selStr); + } else if (status == 2 && mode == 1) { + selectedItem = selection; + if (selectedType == 0) { //warrior shoe + var itemSet = [1072051, 1072053, 1072052, 1072003, 1072039, 1072040, 1072041, 1072002, 1072112, 1072113, 1072000, 1072126, 1072127, 1072132, 1072133, 1072134, 1072135, 1072147, 1072148, 1072149]; + var matSet = [[4011004, 4011001, 4000021, 4003000], [4011006, 4011001, 4000021, 4003000], [4021008, 4011001, 4000021, 4003000], [4021003, 4011001, 4000021, 4003000], [4011002, 4011001, 4000021, 4003000], + [4011004, 4011001, 4000021, 4003000], [4021000, 4011001, 4000021, 4003000], [4011001, 4021004, 4000021, 4000030, 4003000], [4011002, 4021004, 4000021, 4000030, 4003000], [4021008, 4021004, 4000021, 4000030, 4003000], + [4011003, 4000021, 4000030, 4003000, 4000033], [4011005, 4021007, 4000030, 4003000, 4000042], [4011002, 4021007, 4000030, 4003000, 4000041], [4021008, 4011001, 4021003, 4000030, 4003000], + [4021008, 4011001, 4011002, 4000030, 4003000], [4021008, 4011001, 4011005, 4000030, 4003000], [4021008, 4011001, 4011006, 4000030, 4003000], [4021008, 4011007, 4021005, 4000030, 4003000], + [4021008, 4011007, 4011005, 4000030, 4003000], [4021008, 4011007, 4021000, 4000030, 4003000]]; + var matQtySet = [[2, 1, 15, 10], [2, 1, 15, 10], [1, 2, 20, 10], [4, 2, 45, 15], [4, 2, 45, 15], [4, 2, 45, 15], [4, 2, 45, 15], [3, 1, 30, 20, 25], [3, 1, 30, 20, 25], [2, 1, 30, 20, 25], + [4, 100, 40, 30, 100], [4, 1, 40, 30, 250], [4, 1, 40, 30, 120], [1, 3, 6, 65, 45], [1, 3, 6, 65, 45], [1, 3, 6, 65, 45], [1, 3, 6, 65, 45], [1, 1, 8, 80, 55], [1, 1, 8, 80, 55], [1, 1, 8, 80, 55]]; + var costSet = [10000, 10000, 12000, 20000, 20000, 20000, 20000, 22000, 22000, 25000, 38000, 38000, 38000, 50000, 50000, 50000, 50000, 60000, 60000, 60000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //bowman shoe + var itemSet = [1072027, 1072034, 1072069, 1072079, 1072080, 1072081, 1072082, 1072083, 1072101, 1072102, 1072103, 1072118, 1072119, 1072120, 1072121, 1072122, 1072123, 1072124, 1072125, 1072144, 1072145, 1072146]; + var matSet = [[4000021, 4011000, 4003000], [4000021, 4021003, 4003000], [4000021, 4021000, 4003000], [4000021, 4021000, 4003000], [4000021, 4021005, 4003000], [4000021, 4021003, 4003000], + [4000021, 4021004, 4003000], [4000021, 4021006, 4003000], [4021002, 4021006, 4000030, 4000021, 4003000], [4021003, 4021006, 4000030, 4000021, 4003000], [4021000, 4021006, 4000030, 4000021, 4003000], + [4021000, 4003000, 4000030, 4000024], [4021006, 4003000, 4000030, 4000027], [4011003, 4003000, 4000030, 4000044], [4021002, 4003000, 4000030, 4000009], [4011001, 4021006, 4021008, 4000030, 4003000, 4000033], + [4011001, 4021006, 4021008, 4000030, 4003000, 4000032], [4011001, 4021006, 4021008, 4000030, 4003000, 4000041], [4011001, 4021006, 4021008, 4000030, 4003000, 4000042], [4011006, 4021000, 4021007, 4000030, 4003000], + [4011006, 4021005, 4021007, 4000030, 4003000], [4011006, 4021003, 4021007, 4000030, 4003000]]; + var matQtySet = [[35, 3, 10], [35, 1, 10], [35, 1, 10], [50, 2, 15], [50, 2, 15], [50, 2, 15], [50, 2, 15], [50, 2, 15], + [3, 1, 15, 30, 20], [3, 1, 15, 30, 20], [3, 1, 15, 30, 20], [4, 30, 45, 20], [4, 30, 45, 20], [5, 30, 45, 40], [5, 30, 45, 120], + [3, 3, 1, 60, 35, 80], [3, 3, 1, 60, 35, 150], [3, 3, 1, 60, 35, 100], [3, 3, 1, 60, 35, 250], [5, 8, 1, 75, 50], [5, 8, 1, 75, 50], [5, 8, 1, 75, 50]]; + var costSet = [9000, 9000, 9000, 19000, 19000, 19000, 19000, 19000, 19000, 20000, 20000, 20000, 32000, 32000, 40000, 40000, 50000, 50000, 50000, 50000, 60000, 60000, 60000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //magician shoe + var itemSet = [1072019, 1072020, 1072021, 1072072, 1072073, 1072074, 1072075, 1072076, 1072077, 1072078, 1072089, 1072090, 1072091, 1072114, 1072115, 1072116, 1072117, 1072140, 1072141, 1072142, 1072143, 1072136, 1072137, 1072138, 1072139]; + var matSet = [[4021005, 4000021, 4003000], [4021001, 4000021, 4003000], [4021000, 4000021, 4003000], [4011004, 4000021, 4003000], [4021006, 4000021, 4003000], [4021004, 4000021, 4003000], + [4021000, 4000021, 4003000], [4021002, 4000021, 4003000], [4011004, 4000021, 4003000], [4021008, 4000021, 4003000], [4021001, 4021006, 4000021, 4000030, 4003000], [4021000, 4021006, 4000021, 4000030, 4003000], + [4021008, 4021006, 4000021, 4000030, 4003000], [4021000, 4000030, 4000043, 4003000], [4021005, 4000030, 4000037, 4003000], [4011006, 4021007, 4000030, 4000027, 4003000], [4021008, 4021007, 4000030, 4000014, 4003000], + [4021009, 4011006, 4021000, 4000030, 4003000], [4021009, 4011006, 4021005, 4000030, 4003000], [4021009, 4011006, 4021001, 4000030, 4003000], [4021009, 4011006, 4021003, 4000030, 4003000], + [4021009, 4011006, 4011005, 4000030, 4003000], [4021009, 4011006, 4021003, 4000030, 4003000], [4021009, 4011006, 4011003, 4000030, 4003000], [4021009, 4011006, 4021002, 4000030, 4003000]]; + var matQtySet = [[1, 30, 5], [1, 30, 5], [1, 30, 5], [1, 35, 10], [1, 35, 10], [1, 35, 10], [2, 50, 15], [2, 50, 15], [2, 50, 15], + [1, 50, 15], [3, 1, 30, 15, 20], [3, 1, 30, 15, 20], [2, 1, 40, 25, 20], [4, 40, 35, 25], [4, 40, 70, 25], [2, 1, 40, 20, 25], [2, 1, 40, 30, 30], + [1, 3, 3, 60, 40], [1, 3, 3, 60, 40], [1, 3, 3, 60, 40], [1, 3, 3, 60, 40], [1, 4, 5, 70, 50], [1, 4, 5, 70, 50], [1, 4, 5, 70, 50], [1, 4, 5, 70, 50]]; + var costSet = [3000, 3000, 3000, 8000, 8000, 8000, 18000, 18000, 18000, 18000, 20000, 20000, 22000, 30000, 30000, 35000, 40000, 50000, 50000, 50000, 50000, 60000, 60000, 60000, 60000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 3) { //thief shoe + var itemSet = [1072084, 1072085, 1072086, 1072087, 1072032, 1072033, 1072035, 1072036, 1072104, 1072105, 1072106, 1072107, 1072108, 1072109, 1072110, 1072128, 1072130, 1072129, 1072131, 1072150, 1072151, 1072152]; + var matSet = [[4021005, 4000021, 4003000], [4021000, 4000021, 4003000], [4021003, 4000021, 4003000], [4021004, 4000021, 4003000], [4011000, 4000021, 4003000], [4011001, 4000021, 4003000], [4011004, 4000021, 4003000], [4011006, 4000021, 4003000], [4021000, 4021004, 4000021, 4000030, 4003000], [4021003, 4021004, 4000021, 4000030, 4003000], [4021002, 4021004, 4000021, 4000030, 4003000], [4021000, 4000030, 4000033, 4003000], [4021003, 4000030, 4000032, 4003000], [4021006, 4000030, 4000040, 4003000], [4021005, 4000030, 4000037, 4003000], [4011007, 4021005, 4000030, 4000037, 4003000], [4011007, 4021000, 4000030, 4000043, 4003000], [4011007, 4021003, 4000030, 4000045, 4003000], [4011007, 4021001, 4000030, 4000036, 4003000], [4021008, 4011007, 4021005, 4000030, 4003000], [4021008, 4011007, 4011005, 4000030, 4003000], [4021008, 4011007, 4021000, 4000030, 4003000]]; + var matQtySet = [[1, 35, 10], [1, 35, 10], [1, 35, 10], [1, 35, 10], [3, 50, 15], [3, 50, 15], [2, 50, 15], [2, 50, 15], [3, 1, 30, 15, 20], [3, 1, 30, 15, 20], [3, 1, 30, 15, 20], + [5, 45, 50, 30], [4, 45, 30, 30], [4, 45, 3, 30], [4, 45, 70, 30], [2, 3, 50, 200, 35], [2, 3, 50, 150, 35], [2, 3, 50, 80, 35], [2, 3, 50, 80, 35], [1, 1, 8, 75, 50], [1, 1, 5, 75, 50], [1, 1, 1, 75, 50]]; + var costSet = [9000, 9000, 9000, 9000, 19000, 19000, 19000, 21000, 20000, 20000, 20000, 40000, 32000, 35000, 35000, 50000, 50000, 50000, 50000, 60000, 60000, 60000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } + var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; + } + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; + } cm.sendYesNo(prompt); - } - else if (status == 3 && mode == 1) { + } else if (status == 3 && mode == 1) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) { + } else if (cm.getMeso() < cost) { cm.sendOk("Sorry, I can only accept meso."); cm.dispose(); return; - } - - else { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; - } - if (!complete) - cm.sendOk("Sorry, but I have to have those items to get this exactly right. Perhaps next time."); - else { - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++) - cm.gainItem(mats[i], -matQty[i]); } - else + } + if (!complete) { + cm.sendOk("Sorry, but I have to have those items to get this exactly right. Perhaps next time."); + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + cm.gainItem(mats[i], -matQty[i]); + } + } else { cm.gainItem(mats, -matQty); + } cm.gainMeso(-cost); cm.gainItem(item, 1); cm.sendOk("There, the shoes are ready. Be careful not to trip!"); diff --git a/scripts/npc/1061006.js b/scripts/npc/1061006.js index f6a447bd6f..acb45ed868 100644 --- a/scripts/npc/1061006.js +++ b/scripts/npc/1061006.js @@ -27,40 +27,43 @@ var selectedMap = -1; function start() { cm.sendNext("You feel a mysterious force surrounding this statue."); - if (cm.isQuestStarted(2054) || cm.isQuestCompleted(2054)) + if (cm.isQuestStarted(2054) || cm.isQuestCompleted(2054)) { zones = 3; - else if (cm.isQuestStarted(2053) || cm.isQuestCompleted(2053)) + } else if (cm.isQuestStarted(2053) || cm.isQuestCompleted(2053)) { zones = 2; - else if (cm.isQuestStarted(2052) || cm.isQuestCompleted(2052)) + } else if (cm.isQuestStarted(2052) || cm.isQuestCompleted(2052)) { zones = 1; - else + } else { zones = 0; + } } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (status >= 2 && mode == 0) { cm.sendOk("Alright, see you next time."); cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { - if (zones == 0) + if (zones == 0) { cm.dispose(); - else { + } else { var selStr = "Its power allows you to will yourself deep inside the forest.#b"; - for (var i = 0; i < zones; i++) + for (var i = 0; i < zones; i++) { selStr += "\r\n#L" + i + "#" + names[i] + "#l"; + } cm.sendSimple(selStr); } } else if (status == 2) { - cm.warp(maps[selection],0); + cm.warp(maps[selection], 0); cm.dispose(); } } diff --git a/scripts/npc/1061007.js b/scripts/npc/1061007.js index 80fba6e531..3f6577f624 100644 --- a/scripts/npc/1061007.js +++ b/scripts/npc/1061007.js @@ -24,7 +24,8 @@ function start() { } function action(mode, type, selection) { - if(mode == 1) - cm.warp(105040300,0); + if (mode == 1) { + cm.warp(105040300, 0); + } cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1061009.js b/scripts/npc/1061009.js index 3062c8eb24..173c9dddf1 100644 --- a/scripts/npc/1061009.js +++ b/scripts/npc/1061009.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* @Author Ronan @@ -27,46 +28,53 @@ */ function jobString(niche) { - if(niche == 1) return "warrior"; - else if(niche == 2) return "magician"; - else if(niche == 3) return "bowman"; - else if(niche == 4) return "thief"; - else if(niche == 5) return "pirate"; - + if (niche == 1) { + return "warrior"; + } else if (niche == 2) { + return "magician"; + } else if (niche == 3) { + return "bowman"; + } else if (niche == 4) { + return "thief"; + } else if (niche == 5) { + return "pirate"; + } + return "beginner"; } function canEnterDimensionMap(mapid, jobid) { - if (mapid == 105070001 && (jobid >= 110 && jobid <= 130)) + if (mapid == 105070001 && (jobid >= 110 && jobid <= 130)) { return true; - else if (mapid == 105040305 && (jobid >= 310 && jobid <= 320)) + } else if (mapid == 105040305 && (jobid >= 310 && jobid <= 320)) { return true; - else if (mapid == 100040106 && (jobid >= 210 && jobid <= 230)) + } else if (mapid == 100040106 && (jobid >= 210 && jobid <= 230)) { return true; - else if (mapid == 107000402 && (jobid >= 410 && jobid <= 420)) + } else if (mapid == 107000402 && (jobid >= 410 && jobid <= 420)) { return true; - else if (mapid == 105070200 && (jobid >= 510 && jobid <= 520)) + } else if (mapid == 105070200 && (jobid >= 510 && jobid <= 520)) { return true; - + } + return false; } function start() { if (canEnterDimensionMap(cm.getMapId(), cm.getJob().getId()) && cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)) { var js = jobString(cm.getPlayer().getJob().getJobNiche()); - + var em = cm.getEventManager("3rdJob_" + js); - if (em == null) + if (em == null) { cm.sendOk("Sorry, but 3rd job advancement (" + js + ") is closed."); - else { + } else { if (!em.startInstance(cm.getPlayer())) { cm.sendOk("Someone else is already challenging the clone. Please wait until the area is cleared."); } - + cm.dispose(); return; } } - + cm.dispose(); } diff --git a/scripts/npc/1061010.js b/scripts/npc/1061010.js index 7835599d79..fcbe53cd85 100644 --- a/scripts/npc/1061010.js +++ b/scripts/npc/1061010.js @@ -8,28 +8,39 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) - cm.dispose();//ExitChat - else if (mode == 0) - cm.dispose();//No - else{ //Regular Talk - if (mode == 1) + if (mode == -1) { + cm.dispose(); + }//ExitChat + else if (mode == 0) { + cm.dispose(); + }//No + else { //Regular Talk + if (mode == 1) { status++; - else + } else { status--; - - if(status == 0){ - cm.sendYesNo("Would you like to leave?"); - }else if(status == 1){ - var mapid = cm.getMapId(), exitid = mapid; - if(mapid == 108010101) exitid = 105040305; - else if(mapid == 108010201) exitid = 100040106; - else if(mapid == 108010301) exitid = 105070001; - else if(mapid == 108010401) exitid = 107000402; - else if(mapid == 108010501) exitid = 105070200; + } - if (mapid != exitid) cm.getPlayer().changeMap(exitid); - cm.dispose(); + if (status == 0) { + cm.sendYesNo("Would you like to leave?"); + } else if (status == 1) { + var mapid = cm.getMapId(), exitid = mapid; + if (mapid == 108010101) { + exitid = 105040305; + } else if (mapid == 108010201) { + exitid = 100040106; + } else if (mapid == 108010301) { + exitid = 105070001; + } else if (mapid == 108010401) { + exitid = 107000402; + } else if (mapid == 108010501) { + exitid = 105070200; + } + + if (mapid != exitid) { + cm.getPlayer().changeMap(exitid); + } + cm.dispose(); } } } \ No newline at end of file diff --git a/scripts/npc/1061012.js b/scripts/npc/1061012.js index ab052815a3..6e5f15cf3b 100644 --- a/scripts/npc/1061012.js +++ b/scripts/npc/1061012.js @@ -6,36 +6,36 @@ function start() { if (cm.getQuestStatus(6107) == 1 || cm.getQuestStatus(6108) == 1) { - var ret = checkJob(); - if (ret == -1) { - cm.sendOk("Please form a party and talk to me again."); - } else if (ret == 0) { - cm.sendOk("Please make sure that your party is a size of 2."); - } else if (ret == 1) { - cm.sendOk("One of your party member's job is not eligible for entering the other world."); - } else if (ret == 2) { - cm.sendOk("One of your party member's level is not eligible for entering the other world."); - } else { - var em = cm.getEventManager("s4aWorld"); - if (em == null) { - cm.sendOk("You're not allowed to enter with unknown reason. Try again." ); - } else if (em.getProperty("started").equals("true")) { - cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world." ); - } else { + var ret = checkJob(); + if (ret == -1) { + cm.sendOk("Please form a party and talk to me again."); + } else if (ret == 0) { + cm.sendOk("Please make sure that your party is a size of 2."); + } else if (ret == 1) { + cm.sendOk("One of your party member's job is not eligible for entering the other world."); + } else if (ret == 2) { + cm.sendOk("One of your party member's level is not eligible for entering the other world."); + } else { + var em = cm.getEventManager("s4aWorld"); + if (em == null) { + cm.sendOk("You're not allowed to enter with unknown reason. Try again."); + } else if (em.getProperty("started").equals("true")) { + cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world."); + } else { var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { cm.sendOk("A party in your name is already registered in this instance."); } } else { cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); } - } - } + } + } } else { cm.sendOk("You're not allowed to enter the other world with unknown reason."); } - + cm.dispose(); } @@ -46,7 +46,7 @@ function checkJob() { var party = cm.getParty(); if (party == null) { - return -1; + return -1; } // if (party.getMembers().size() != 2) { // return 0; @@ -54,15 +54,15 @@ function checkJob() { var it = party.getMembers().iterator(); while (it.hasNext()) { - var cPlayer = it.next(); + var cPlayer = it.next(); - if (cPlayer.getJobId() == 312 || cPlayer.getJobId() == 322 || cPlayer.getJobId() == 900) { - if (cPlayer.getLevel() < 120) { - return 2; - } - } else { - return 1; - } + if (cPlayer.getJobId() == 312 || cPlayer.getJobId() == 322 || cPlayer.getJobId() == 900) { + if (cPlayer.getLevel() < 120) { + return 2; + } + } else { + return 1; + } } return 3; } \ No newline at end of file diff --git a/scripts/npc/1061014.js b/scripts/npc/1061014.js index 20be342e85..bc78e031a1 100644 --- a/scripts/npc/1061014.js +++ b/scripts/npc/1061014.js @@ -80,12 +80,12 @@ function action(mode, type, selection) { } else if (expedition.isInProgress()) { //Only if the expedition is in progress if (expedition.contains(player)) { //If you're registered, warp you in var eim = em.getInstance(expedName + player.getClient().getChannel()); - if(eim.getIntProperty("canJoin") == 1) { + if (eim.getIntProperty("canJoin") == 1) { eim.registerPlayer(player); } else { cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls."); } - + cm.dispose(); } else { //If you're not in by now, tough luck cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); @@ -95,12 +95,12 @@ function action(mode, type, selection) { } else if (status == 1) { if (selection == 1) { expedition = cm.getExpedition(exped); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(exped); if (res == 0) { cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -109,18 +109,18 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + "."); cm.dispose(); - return; + } else { cm.sendSimple("Hi there. I am #b#nMu Young#n#k, the temple Keeper. This temple is currently under siege by the Balrog troops. We currently do not know who gave the orders. " + - "For a few weeks now, the #e#b Order of the Altair#n#k has been sending mercenaries, but they were eliminated every time." + - " So, traveler, would you like to try your luck at defeating this unspeakable horror?\r\n #L1#What is the #eOrder of the Altair?"); - + "For a few weeks now, the #e#b Order of the Altair#n#k has been sending mercenaries, but they were eliminated every time." + + " So, traveler, would you like to try your luck at defeating this unspeakable horror?\r\n #L1#What is the #eOrder of the Altair?"); + status = 10; } } else if (status == 2) { @@ -152,7 +152,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - + cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { @@ -161,7 +161,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -172,14 +172,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/1061016.js b/scripts/npc/1061016.js index 394c27fb86..fb449c8cb0 100644 --- a/scripts/npc/1061016.js +++ b/scripts/npc/1061016.js @@ -2,33 +2,33 @@ var status = -1; var itemids = Array(2040728, 2040729, 2040730, 2040731, 2040732, 2040733, 2040734, 2040735, 2040736, 2040737, 2040738, 2040739); function start() { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode != 1) { - cm.dispose(); - return; - } - status++; - if (status == 0) { - cm.sendSimple("Hello, #h0#. I can exchange your Balrog Leathers.\r\n\r\n#r#L1#Redeem items#l#k"); - } else if (status == 1) { - var selStr = "Well, okay. These are what you can redeem...\r\n\r\n#b"; - for (var i = 0; i < itemids.length; i++) { - selStr += "#L" + i + "##i" + itemids[i] + "##z" + itemids[i] + "##l\r\n"; - } - cm.sendSimple(selStr); - } else if (status == 2) { - if (!cm.canHold(itemids[selection], 1)) { - cm.sendOk("Please make room"); - } else if (!cm.haveItemWithId(4001261)) { - cm.sendOk("You don't have enough leathers."); - } else { - cm.gainItem(4001261, -1); - cm.gainItem(itemids[selection], 1); - cm.sendOk("Thank you for your redemption"); - } - cm.dispose(); - } + if (mode != 1) { + cm.dispose(); + return; + } + status++; + if (status == 0) { + cm.sendSimple("Hello, #h0#. I can exchange your Balrog Leathers.\r\n\r\n#r#L1#Redeem items#l#k"); + } else if (status == 1) { + var selStr = "Well, okay. These are what you can redeem...\r\n\r\n#b"; + for (var i = 0; i < itemids.length; i++) { + selStr += "#L" + i + "##i" + itemids[i] + "##z" + itemids[i] + "##l\r\n"; + } + cm.sendSimple(selStr); + } else if (status == 2) { + if (!cm.canHold(itemids[selection], 1)) { + cm.sendOk("Please make room"); + } else if (!cm.haveItemWithId(4001261)) { + cm.sendOk("You don't have enough leathers."); + } else { + cm.gainItem(4001261, -1); + cm.gainItem(itemids[selection], 1); + cm.sendOk("Thank you for your redemption"); + } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1061018.js b/scripts/npc/1061018.js index a603b7044b..af4a44a601 100644 --- a/scripts/npc/1061018.js +++ b/scripts/npc/1061018.js @@ -1,39 +1,40 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0){ - if(cm.getEventInstance().isEventCleared()) { - cm.sendOk("Wow! You defeated the balrog."); - } else if(cm.getPlayer().getMap().getCharacters().size() > 1) { - cm.sendYesNo("Are you really going to leave this battle and leave your fellow travelers to die?"); - } else { - cm.sendYesNo("If you're a coward, you will leave."); - } - } else if(status == 1){ - if(cm.getEventInstance().isEventCleared()) { - cm.warp(cm.getMapId() == 105100300 ? 105100301 : 105100401, 0); - } else { - cm.warp(105100100); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getEventInstance().isEventCleared()) { + cm.sendOk("Wow! You defeated the balrog."); + } else if (cm.getPlayer().getMap().getCharacters().size() > 1) { + cm.sendYesNo("Are you really going to leave this battle and leave your fellow travelers to die?"); + } else { + cm.sendYesNo("If you're a coward, you will leave."); + } + } else if (status == 1) { + if (cm.getEventInstance().isEventCleared()) { + cm.warp(cm.getMapId() == 105100300 ? 105100301 : 105100401, 0); + } else { + cm.warp(105100100); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/1061100.js b/scripts/npc/1061100.js index fe97b0f069..076ef93cfd 100644 --- a/scripts/npc/1061100.js +++ b/scripts/npc/1061100.js @@ -20,17 +20,17 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Hotel Receptionist - Sleepywood Hotel(105040400) --- By --------------------------------------------------------------------------------------------- - Unknown --- Version Info ----------------------------------------------------------------------------------- - 1.3 - More Cleanup by Moogra - 12/17/09 - 1.2 - Cleanup and Statement fix by Moogra - 1.1 - Statement fix [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Hotel Receptionist - Sleepywood Hotel(105040400) + -- By --------------------------------------------------------------------------------------------- + Unknown + -- Version Info ----------------------------------------------------------------------------------- + 1.3 - More Cleanup by Moogra - 12/17/09 + 1.2 - Cleanup and Statement fix by Moogra + 1.1 - Statement fix [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var regcost = 499; @@ -42,9 +42,9 @@ function start() { } function action(mode, type, selection) { - if (mode == -1 || (mode == 0 && status == 1)) + if (mode == -1 || (mode == 0 && status == 1)) { cm.dispose(); - else { + } else { if (mode == 0 && status == 2) { cm.sendNext("We offer other kinds of services, too, so please think carefully and then make your decision."); cm.dispose(); @@ -55,25 +55,27 @@ function action(mode, type, selection) { cm.sendSimple("We offer two kinds of rooms for our service. Please choose the one of your liking.\r\n#b#L0#Regular sauna (" + regcost + " mesos per use)#l\r\n#L1#VIP sauna (" + vipcost + " mesos per use)#l"); iwantreg = 1; } else if (status == 2) { - if (selection == 0) + if (selection == 0) { cm.sendYesNo("You have chosen the regular sauna. Your HP and MP will recover fast and you can even purchase some items there. Are you sure you want to go in?"); - else if (selection == 1) { + } else if (selection == 1) { cm.sendYesNo("You've chosen the VIP sauna. Your HP and MP will recover even faster than that of the regular sauna and you can even find a special item in there. Are you sure you want to go in?"); - iwantreg = 0; + iwantreg = 0; } } else if (status == 3) { if (iwantreg == 1) { if (cm.getMeso() >= regcost) { cm.warp(105040401); cm.gainMeso(-regcost); - } else + } else { cm.sendNext("I'm sorry. It looks like you don't have enough mesos. It will cost you at least " + regcost + "mesos to stay at our hotel."); + } } else { if (cm.getMeso() >= vipcost) { cm.warp(105040402); cm.gainMeso(-vipcost); - } else + } else { cm.sendNext("I'm sorry. It looks like you don't have enough mesos. It will cost you at least " + vipcost + "mesos to stay at our hotel."); + } } cm.dispose(); } diff --git a/scripts/npc/1063000.js b/scripts/npc/1063000.js index f33c77595b..31a2272742 100644 --- a/scripts/npc/1063000.js +++ b/scripts/npc/1063000.js @@ -25,26 +25,26 @@ var repeatablePrizes = [[4010000, 3], [4010001, 3], [4010002, 3], [4010003, 3], [4010004, 3], [4010005, 3]]; function start() { - if (cm.isQuestStarted(2052) && !cm.haveItem(4031025,10)) { - if(!cm.canHold(4031025,10)) { + if (cm.isQuestStarted(2052) && !cm.haveItem(4031025, 10)) { + if (!cm.canHold(4031025, 10)) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; } - - cm.gainItem(4031025,10); + + cm.gainItem(4031025, 10); } else { const InventoryType = Java.type('client.inventory.InventoryType'); - if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { + if (cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; } - + var itemPrize = repeatablePrizes[Math.floor((Math.random() * repeatablePrizes.length))]; cm.gainItem(itemPrize[0], itemPrize[1]); } - + cm.warp(105040300, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1063001.js b/scripts/npc/1063001.js index a73df68fe2..64d2cb849d 100644 --- a/scripts/npc/1063001.js +++ b/scripts/npc/1063001.js @@ -25,26 +25,26 @@ var repeatablePrizes = [[4020000, 4], [4020002, 4], [4020006, 4]]; function start() { - if (cm.isQuestStarted(2053) && !cm.haveItem(4031026,20)) { - if(!cm.canHold(4031026,20)) { + if (cm.isQuestStarted(2053) && !cm.haveItem(4031026, 20)) { + if (!cm.canHold(4031026, 20)) { cm.sendNext("Check for a available slot on your ETC inventory.") cm.dispose(); return; } - - cm.gainItem(4031026,20); + + cm.gainItem(4031026, 20); } else { const InventoryType = Java.type('client.inventory.InventoryType'); - if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { + if (cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; } - + var itemPrize = repeatablePrizes[Math.floor((Math.random() * repeatablePrizes.length))]; cm.gainItem(itemPrize[0], itemPrize[1]); } - + cm.warp(105040300, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1063002.js b/scripts/npc/1063002.js index 858f9e6faa..122d51d4ec 100644 --- a/scripts/npc/1063002.js +++ b/scripts/npc/1063002.js @@ -25,26 +25,26 @@ var repeatablePrizes = [[4010006, 4], [4010007, 4], [4020007, 4]]; function start() { - if (cm.isQuestStarted(2054) && !cm.haveItem(4031028,30)) { - if(!cm.canHold(4031028,30)) { + if (cm.isQuestStarted(2054) && !cm.haveItem(4031028, 30)) { + if (!cm.canHold(4031028, 30)) { cm.sendNext("Check for a available slot on your ETC inventory.") cm.dispose(); return; } - - cm.gainItem(4031028,30); + + cm.gainItem(4031028, 30); } else { const InventoryType = Java.type('client.inventory.InventoryType'); - if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { + if (cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { cm.sendNext("Check for a available slot on your ETC inventory."); cm.dispose(); return; } - + var itemPrize = repeatablePrizes[Math.floor((Math.random() * repeatablePrizes.length))]; cm.gainItem(itemPrize[0], itemPrize[1]); } - + cm.warp(105040300, 0); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1063012.js b/scripts/npc/1063012.js index c5d98a2b9f..087824f2cf 100644 --- a/scripts/npc/1063012.js +++ b/scripts/npc/1063012.js @@ -24,41 +24,43 @@ var status = -1; /* Custom Quest 100300 */ -function activateShamanRock(slot,progress) { +function activateShamanRock(slot, progress) { var ch = progress[slot]; - if(ch == '0') { + if (ch == '0') { var nextProgress = progress.substr(0, slot) + '1' + progress.substr(slot + 1); - + cm.setQuestProgress(2236, nextProgress); cm.gainItem(4032263, -1); cm.sendOk("The seal took it's place, repelling the evil in the area."); return 1; } - + return 0; } function start() { - if(cm.isQuestStarted(2236) && cm.haveItem(4032263, 1)) { + if (cm.isQuestStarted(2236) && cm.haveItem(4032263, 1)) { var progress = cm.getQuestProgress(2236); var map = cm.getMapId(); - - if(map == 105050200) activateShamanRock(0,progress); - else if(map == 105060000) activateShamanRock(1,progress); - else if(map == 105070000) activateShamanRock(2,progress); - - else if(map == 105090000) { // workaround... TWO SAME NPC ID ON SAME MAP + + if (map == 105050200) { + activateShamanRock(0, progress); + } else if (map == 105060000) { + activateShamanRock(1, progress); + } else if (map == 105070000) { + activateShamanRock(2, progress); + } else if (map == 105090000) { // workaround... TWO SAME NPC ID ON SAME MAP var npcOid = cm.getQuestProgressInt(100300, 1); if (npcOid == 0) { - activateShamanRock(3,progress); + activateShamanRock(3, progress); cm.setQuestProgress(100300, 1, cm.getNpcObjectId()); } else if (cm.getNpcObjectId() != npcOid) { - activateShamanRock(4,progress); + activateShamanRock(4, progress); } + } else if (map == 105090100) { + activateShamanRock(5, progress); } - - else if(map == 105090100) activateShamanRock(5,progress); } - + cm.dispose(); } diff --git a/scripts/npc/1063013.js b/scripts/npc/1063013.js index c5d98a2b9f..087824f2cf 100644 --- a/scripts/npc/1063013.js +++ b/scripts/npc/1063013.js @@ -24,41 +24,43 @@ var status = -1; /* Custom Quest 100300 */ -function activateShamanRock(slot,progress) { +function activateShamanRock(slot, progress) { var ch = progress[slot]; - if(ch == '0') { + if (ch == '0') { var nextProgress = progress.substr(0, slot) + '1' + progress.substr(slot + 1); - + cm.setQuestProgress(2236, nextProgress); cm.gainItem(4032263, -1); cm.sendOk("The seal took it's place, repelling the evil in the area."); return 1; } - + return 0; } function start() { - if(cm.isQuestStarted(2236) && cm.haveItem(4032263, 1)) { + if (cm.isQuestStarted(2236) && cm.haveItem(4032263, 1)) { var progress = cm.getQuestProgress(2236); var map = cm.getMapId(); - - if(map == 105050200) activateShamanRock(0,progress); - else if(map == 105060000) activateShamanRock(1,progress); - else if(map == 105070000) activateShamanRock(2,progress); - - else if(map == 105090000) { // workaround... TWO SAME NPC ID ON SAME MAP + + if (map == 105050200) { + activateShamanRock(0, progress); + } else if (map == 105060000) { + activateShamanRock(1, progress); + } else if (map == 105070000) { + activateShamanRock(2, progress); + } else if (map == 105090000) { // workaround... TWO SAME NPC ID ON SAME MAP var npcOid = cm.getQuestProgressInt(100300, 1); if (npcOid == 0) { - activateShamanRock(3,progress); + activateShamanRock(3, progress); cm.setQuestProgress(100300, 1, cm.getNpcObjectId()); } else if (cm.getNpcObjectId() != npcOid) { - activateShamanRock(4,progress); + activateShamanRock(4, progress); } + } else if (map == 105090100) { + activateShamanRock(5, progress); } - - else if(map == 105090100) activateShamanRock(5,progress); } - + cm.dispose(); } diff --git a/scripts/npc/1063016.js b/scripts/npc/1063016.js index 778cb8eca6..f1d86c64f6 100644 --- a/scripts/npc/1063016.js +++ b/scripts/npc/1063016.js @@ -4,30 +4,31 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendYesNo("Will you exit this trial?"); - } else { - cm.warp(105040201, 2); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("Will you exit this trial?"); + } else { + cm.warp(105040201, 2); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1063017.js b/scripts/npc/1063017.js index 080e4a17b5..4a25ce165e 100644 --- a/scripts/npc/1063017.js +++ b/scripts/npc/1063017.js @@ -4,38 +4,39 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendYesNo("Ahead awaits the Master himself. Are you ready to face him?"); - } else { - if(cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) { - cm.sendOk("Someone is already challenging the Master. Try again later."); - } else { - const MapleLifeFactoroy = Java.type('server.life.MapleLifeFactoroy'); - const Point = Java.type('java.awt.Point'); - cm.getWarpMap(910510202).spawnMonsterOnGroundBelow(LifeFactory.getMonster(9300346), new Point(95, 200)); - cm.warp(910510202, 0); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("Ahead awaits the Master himself. Are you ready to face him?"); + } else { + if (cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) { + cm.sendOk("Someone is already challenging the Master. Try again later."); + } else { + const MapleLifeFactoroy = Java.type('server.life.MapleLifeFactoroy'); + const Point = Java.type('java.awt.Point'); + cm.getWarpMap(910510202).spawnMonsterOnGroundBelow(LifeFactory.getMonster(9300346), new Point(95, 200)); + cm.warp(910510202, 0); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1072000.js b/scripts/npc/1072000.js index 54966d6615..54bf78f41e 100644 --- a/scripts/npc/1072000.js +++ b/scripts/npc/1072000.js @@ -25,56 +25,55 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.isQuestCompleted(100004)) { - cm.sendOk("You're truly a hero!"); - cm.dispose(); - } else if(cm.isQuestCompleted(100003)) { - cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); - status = 4; - } else if (cm.isQuestStarted(100003)) { - cm.sendNext("Hmmm...it is definitely the letter from #bDances with Balrog#k...so you came all the way here to take the test and make the 2nd job advancement as the warrior. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated."); - } else { - cm.sendOk("I can show you the way once your ready for it."); - cm.dispose(); - } - } - else if (status == 1) - cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item."); - else if (status == 2) - cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test."); - else if (status == 3) - cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease..so you better really buckle up and get ready...well, do you want to go for it now?"); - else if (status == 4) { - cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); - cm.completeQuest(100003); - cm.startQuest(100004); - cm.gainItem(4031008, -1); - } - else if (status == 5) { - cm.warp(108000300, 0); - cm.dispose(); - } else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestCompleted(100004)) { + cm.sendOk("You're truly a hero!"); + cm.dispose(); + } else if (cm.isQuestCompleted(100003)) { + cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); + status = 4; + } else if (cm.isQuestStarted(100003)) { + cm.sendNext("Hmmm...it is definitely the letter from #bDances with Balrog#k...so you came all the way here to take the test and make the 2nd job advancement as the warrior. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated."); + } else { + cm.sendOk("I can show you the way once your ready for it."); + cm.dispose(); + } + } else if (status == 1) { + cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item."); + } else if (status == 2) { + cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test."); + } else if (status == 3) { + cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease..so you better really buckle up and get ready...well, do you want to go for it now?"); + } else if (status == 4) { + cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); + cm.completeQuest(100003); + cm.startQuest(100004); + cm.gainItem(4031008, -1); + } else if (status == 5) { + cm.warp(108000300, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } } diff --git a/scripts/npc/1072001.js b/scripts/npc/1072001.js index 71c638904e..9601b26d7a 100644 --- a/scripts/npc/1072001.js +++ b/scripts/npc/1072001.js @@ -25,55 +25,55 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.isQuestCompleted(100007)) { - cm.sendOk("You're truly a hero!"); - cm.dispose(); - } else if(cm.isQuestCompleted(100006)) { - cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); - status = 4; - } else if (cm.isQuestStarted(100006)) { - cm.sendNext("Hmmm...it is definitely the letter from #bGrendell the Really Old#k...so you came all the way here to take the test and make the 2nd job advancement as a magician. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated."); - } else { - cm.sendOk("I can show you the way once your ready for it."); - cm.dispose(); - } - } - else if(status == 1) - cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item."); - else if (status == 2) - cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test."); - else if (status == 3) - cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease.. So you better really buckle up and get ready...well, do you want to go for it now?"); - else if (status == 4) { - cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); - cm.completeQuest(100006); - cm.startQuest(100007); - cm.gainItem(4031009, -1); - } - else if (status == 5) { - cm.warp(108000200, 0); - cm.dispose(); - } - else cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestCompleted(100007)) { + cm.sendOk("You're truly a hero!"); + cm.dispose(); + } else if (cm.isQuestCompleted(100006)) { + cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); + status = 4; + } else if (cm.isQuestStarted(100006)) { + cm.sendNext("Hmmm...it is definitely the letter from #bGrendell the Really Old#k...so you came all the way here to take the test and make the 2nd job advancement as a magician. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated."); + } else { + cm.sendOk("I can show you the way once your ready for it."); + cm.dispose(); + } + } else if (status == 1) { + cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item."); + } else if (status == 2) { + cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test."); + } else if (status == 3) { + cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease.. So you better really buckle up and get ready...well, do you want to go for it now?"); + } else if (status == 4) { + cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); + cm.completeQuest(100006); + cm.startQuest(100007); + cm.gainItem(4031009, -1); + } else if (status == 5) { + cm.warp(108000200, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } } diff --git a/scripts/npc/1072002.js b/scripts/npc/1072002.js index 3f2ed5c98e..d919c8eb3a 100644 --- a/scripts/npc/1072002.js +++ b/scripts/npc/1072002.js @@ -25,55 +25,53 @@ Warning Street : The Road to the Dungeon (106010000) */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if (cm.isQuestCompleted(100001)) { - cm.sendOk("You're truly a hero!"); - cm.dispose(); - } else if(cm.isQuestCompleted(100000)) { - cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); - status = 3; - } else if (cm.isQuestStarted(100000)) { - cm.sendNext("Oh, isn't this a letter from #bAthena#k?"); - } else { - cm.sendOk("I can show you the way once your ready for it."); - cm.dispose(); - } - } - - else if (status == 1) - cm.sendNextPrev("So you want to prove your skills? Very well..."); - else if (status == 2) - cm.sendAcceptDecline("I will give you a chance if you're ready."); - else if (status == 3) { - cm.completeQuest(100000); - cm.startQuest(100001); - cm.gainItem(4031010, -1); - cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck.") - } else if (status == 4) { - cm.warp(108000100, 0); - cm.dispose(); - } - else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestCompleted(100001)) { + cm.sendOk("You're truly a hero!"); + cm.dispose(); + } else if (cm.isQuestCompleted(100000)) { + cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); + status = 3; + } else if (cm.isQuestStarted(100000)) { + cm.sendNext("Oh, isn't this a letter from #bAthena#k?"); + } else { + cm.sendOk("I can show you the way once your ready for it."); + cm.dispose(); + } + } else if (status == 1) { + cm.sendNextPrev("So you want to prove your skills? Very well..."); + } else if (status == 2) { + cm.sendAcceptDecline("I will give you a chance if you're ready."); + } else if (status == 3) { + cm.completeQuest(100000); + cm.startQuest(100001); + cm.gainItem(4031010, -1); + cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck.") + } else if (status == 4) { + cm.warp(108000100, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1072003.js b/scripts/npc/1072003.js index a23fcbf7b0..b3e1f04c4f 100644 --- a/scripts/npc/1072003.js +++ b/scripts/npc/1072003.js @@ -25,55 +25,53 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.isQuestCompleted(100010)) { - cm.sendOk("You're truly a hero!"); - cm.dispose(); - } else if(cm.isQuestCompleted(100009)) { - cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); - status = 3; - } else if (cm.isQuestStarted(100009)) { - cm.sendNext("Oh, isn't this a letter from the #bDark Lord#k?"); - } else { - cm.sendOk("I can show you the way once your ready for it."); - cm.dispose(); - } - } - - else if(status == 1) - cm.sendNextPrev("So you want to prove your skills? Very well..."); - else if (status == 2) - cm.sendAcceptDecline("I will give you a chance if you're ready."); - else if (status == 3) { - cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck."); - cm.completeQuest(100009); - cm.startQuest(100010); - cm.gainItem(4031011, -1); - } else if (status == 4) { - cm.warp(108000400, 0); - cm.dispose(); - } - else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestCompleted(100010)) { + cm.sendOk("You're truly a hero!"); + cm.dispose(); + } else if (cm.isQuestCompleted(100009)) { + cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you."); + status = 3; + } else if (cm.isQuestStarted(100009)) { + cm.sendNext("Oh, isn't this a letter from the #bDark Lord#k?"); + } else { + cm.sendOk("I can show you the way once your ready for it."); + cm.dispose(); + } + } else if (status == 1) { + cm.sendNextPrev("So you want to prove your skills? Very well..."); + } else if (status == 2) { + cm.sendAcceptDecline("I will give you a chance if you're ready."); + } else if (status == 3) { + cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck."); + cm.completeQuest(100009); + cm.startQuest(100010); + cm.gainItem(4031011, -1); + } else if (status == 4) { + cm.warp(108000400, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } } diff --git a/scripts/npc/1072004.js b/scripts/npc/1072004.js index b5971abba9..5a12fa1f6c 100644 --- a/scripts/npc/1072004.js +++ b/scripts/npc/1072004.js @@ -21,43 +21,44 @@ var status; var completed; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.haveItem(4031013,30)) { - completed = true; - cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult... just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Perion."); - } else { - completed = false; - cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); - } - } else if(status == 1) { - if(completed) { - cm.removeAll(4031013); - cm.completeQuest(100004); - cm.startQuest(100005); - cm.gainItem(4031012); - } - - cm.warp(102020300, 2); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4031013, 30)) { + completed = true; + cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult... just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Perion."); + } else { + completed = false; + cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); + } + } else if (status == 1) { + if (completed) { + cm.removeAll(4031013); + cm.completeQuest(100004); + cm.startQuest(100005); + cm.gainItem(4031012); + } + + cm.warp(102020300, 2); + cm.dispose(); + } + } } diff --git a/scripts/npc/1072005.js b/scripts/npc/1072005.js index c645a0bf37..1157b5fd84 100644 --- a/scripts/npc/1072005.js +++ b/scripts/npc/1072005.js @@ -21,43 +21,44 @@ var status; var completed; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.haveItem(4031013,30)) { - completed = true; - cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult.. just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Ellinia."); - } else { - completed = false; - cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); - } - } else if(status == 1) { - if(completed) { - cm.removeAll(4031013); - cm.completeQuest(100007); - cm.startQuest(100008); - cm.gainItem(4031012); - } - - cm.warp(101020000, 1); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4031013, 30)) { + completed = true; + cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult.. just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Ellinia."); + } else { + completed = false; + cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); + } + } else if (status == 1) { + if (completed) { + cm.removeAll(4031013); + cm.completeQuest(100007); + cm.startQuest(100008); + cm.gainItem(4031012); + } + + cm.warp(101020000, 1); + cm.dispose(); + } + } } diff --git a/scripts/npc/1072006.js b/scripts/npc/1072006.js index 74a4c5e524..a92c2d4457 100644 --- a/scripts/npc/1072006.js +++ b/scripts/npc/1072006.js @@ -20,56 +20,57 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Bowman Job Instructor - Ant Tunnel For Bowman (108000100) --- By --------------------------------------------------------------------------------------------- - Unknown --- Version Info ----------------------------------------------------------------------------------- - 1.2 - Cleanup by Moogra - 1.1 - Statement fix [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Bowman Job Instructor - Ant Tunnel For Bowman (108000100) + -- By --------------------------------------------------------------------------------------------- + Unknown + -- Version Info ----------------------------------------------------------------------------------- + 1.2 - Cleanup by Moogra + 1.1 - Statement fix [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + **/ var status; var completed; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.haveItem(4031013,30)) { - completed = true; - cm.sendOk("You're a true hero! Take this and Athena will acknowledge you."); - } else { - completed = false; - cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); - } - } else if(status == 1) { - if(completed) { - cm.removeAll(4031013); - cm.completeQuest(100001); - cm.startQuest(100002); - cm.gainItem(4031012); - } - - cm.warp(106010000, 9); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4031013, 30)) { + completed = true; + cm.sendOk("You're a true hero! Take this and Athena will acknowledge you."); + } else { + completed = false; + cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); + } + } else if (status == 1) { + if (completed) { + cm.removeAll(4031013); + cm.completeQuest(100001); + cm.startQuest(100002); + cm.gainItem(4031012); + } + + cm.warp(106010000, 9); + cm.dispose(); + } + } } diff --git a/scripts/npc/1072007.js b/scripts/npc/1072007.js index c894121c4b..91fcd300ae 100644 --- a/scripts/npc/1072007.js +++ b/scripts/npc/1072007.js @@ -20,55 +20,56 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Thief Job Instructor - Thief's Construction Site (108000400) --- By --------------------------------------------------------------------------------------------- - Unknown --- Version Info ----------------------------------------------------------------------------------- - 1.1 - Statement fix [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -*/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Thief Job Instructor - Thief's Construction Site (108000400) + -- By --------------------------------------------------------------------------------------------- + Unknown + -- Version Info ----------------------------------------------------------------------------------- + 1.1 - Statement fix [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + */ var status; var completed; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.haveItem(4031013,30)) { - completed = true; - cm.sendOk("You're a true hero! Take this and the Dark Lord will acknowledge you."); - } else { - completed = false; - cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); - } - } else if(status == 1) { - if(completed) { - cm.removeAll(4031013); - cm.completeQuest(100010); - cm.startQuest(100011); - cm.gainItem(4031012); - } - - cm.warp(102040000, 9); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4031013, 30)) { + completed = true; + cm.sendOk("You're a true hero! Take this and the Dark Lord will acknowledge you."); + } else { + completed = false; + cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l"); + } + } else if (status == 1) { + if (completed) { + cm.removeAll(4031013); + cm.completeQuest(100010); + cm.startQuest(100011); + cm.gainItem(4031012); + } + + cm.warp(102040000, 9); + cm.dispose(); + } + } } diff --git a/scripts/npc/1072008.js b/scripts/npc/1072008.js index 03a5973b8a..d74f17a54f 100644 --- a/scripts/npc/1072008.js +++ b/scripts/npc/1072008.js @@ -1,11 +1,11 @@ /** - Author: xQuasar - NPC: Kyrin - Pirate Job Advancer - Inside Test Room -**/ + Author: xQuasar + NPC: Kyrin - Pirate Job Advancer + Inside Test Room + **/ var status; - + function start() { status = -1; action(1, 0, 0); @@ -19,21 +19,22 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { if (cm.getMapId() == 108000502) { - if (!(cm.haveItem(4031856,15))) { + if (!(cm.haveItem(4031856, 15))) { cm.sendSimple("You haven't brought me all the crystals yet. I'm looking forward for your progress, mate! \r\n#b#L1#I would like to leave#l"); } else { status++; cm.sendNext("Wow, you have brought me 15 #b#t4031856##k! Congratulations. Let me warp you out now."); } } else if (cm.getMapId() == 108000501) { - if (!(cm.haveItem(4031857,15))) { + if (!(cm.haveItem(4031857, 15))) { cm.sendSimple("You haven't brought me all the crystals yet. I'm looking forward for your progress, mate! \r\n#b#L1#I would like to leave#l"); } else { status++; @@ -46,10 +47,10 @@ function action(mode, type, selection) { } else if (status == 1) { // thanks Lame for noticing players getting stuck in area in certain scenarios cm.removeAll(4031856); cm.removeAll(4031857); - cm.warp(120000101,0); + cm.warp(120000101, 0); cm.dispose(); } else if (status == 2) { - cm.warp(120000101,0); + cm.warp(120000101, 0); cm.dispose(); } } diff --git a/scripts/npc/1081001.js b/scripts/npc/1081001.js index 24cd18b410..a5c6e2fa13 100644 --- a/scripts/npc/1081001.js +++ b/scripts/npc/1081001.js @@ -20,40 +20,41 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Pison - Florina Beach(110000000) --- By --------------------------------------------------------------------------------------------- - Information & Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.3 - Fixed saved location [Ronan] - 1.2 - Fixed and cleanup [Shootsource] - 1.1 - Add null map check [Xterminator] - 1.0 - First Version ---------------------------------------------------------------------------------------------------- + -- Odin JavaScript -------------------------------------------------------------------------------- + Pison - Florina Beach(110000000) + -- By --------------------------------------------------------------------------------------------- + Information & Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.3 - Fixed saved location [Ronan] + 1.2 - Fixed and cleanup [Shootsource] + 1.1 - Add null map check [Xterminator] + 1.0 - First Version + --------------------------------------------------------------------------------------------------- **/ var status = 0; var returnmap; function start() { returnmap = cm.getPlayer().peekSavedLocation("FLORINA"); - if (returnmap == -1) + if (returnmap == -1) { returnmap = 104000000; - cm.sendNext("So you want to leave #b#m110000000##k? If you want, I can take you back to #b#m"+returnmap+"##k."); + } + cm.sendNext("So you want to leave #b#m110000000##k? If you want, I can take you back to #b#m" + returnmap + "##k."); } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); - return; + } else if (mode == 0) { - cm.sendNext("You must have some business to take care of here. It's not a bad idea to take some rest at #m"+returnmap+"# Look at me; I love it here so much that I wound up living here. Hahaha anyway, talk to me when you feel like going back."); + cm.sendNext("You must have some business to take care of here. It's not a bad idea to take some rest at #m" + returnmap + "# Look at me; I love it here so much that I wound up living here. Hahaha anyway, talk to me when you feel like going back."); cm.dispose(); - return; + } else if (mode == 1) { status++; - if (status == 1) - cm.sendYesNo("Are you sure you want to return to #b#m"+returnmap+"##k? Alright, we'll have to get going fast. Do you want to head back to #m"+returnmap+"# now?") - else { + if (status == 1) { + cm.sendYesNo("Are you sure you want to return to #b#m" + returnmap + "##k? Alright, we'll have to get going fast. Do you want to head back to #m" + returnmap + "# now?") + } else { cm.getPlayer().getSavedLocation("FLORINA"); cm.warp(returnmap); cm.dispose(); diff --git a/scripts/npc/1090000.js b/scripts/npc/1090000.js index 1bf421f35d..6c8a5aa30e 100644 --- a/scripts/npc/1090000.js +++ b/scripts/npc/1090000.js @@ -26,7 +26,7 @@ */ status = -1; -actionx = {"1stJob" : false, "2ndjob" : false, "2ndjobT" : false, "3thJobI" : false, "3thJobC" : false}; +actionx = {"1stJob": false, "2ndjob": false, "2ndjobT": false, "3thJobI": false, "3thJobC": false}; job = 510; spawnPnpc = false; @@ -34,6 +34,7 @@ spawnPnpcFee = 7000000; jobType = 5; var advQuest = 0; + function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (cm.isQuestStarted(6330)) { @@ -47,7 +48,7 @@ function start() { advQuest = 3; cm.teachSkill(5121003, 0, 10, -1); cm.forceCompleteQuest(6330); - + cm.sendNext("Congratulations. You have managed to pass my test. I'll teach you a new skill called \"Super Transformation\".\r\n\r\n #s5121003# #b#q5121003##k"); } } else if (cm.isQuestStarted(6370)) { @@ -61,17 +62,17 @@ function start() { advQuest = 4; cm.teachSkill(5221006, 0, 10, -1); cm.forceCompleteQuest(6370); - + cm.sendNext("Congratulations. You have managed to pass my test. I'll teach you a new skill called \"Battleship\".\r\n\r\n #s5221006# #b#q5221006##k"); } } else if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { if (cm.getJobId() == 0) { @@ -79,17 +80,18 @@ function start() { cm.sendNext("Want to be a #rpirate#k? There are some standards to meet. because we can't just accept EVERYONE in... #bYour level should be at least 10, with " + cm.getFirstJobStatRequirement(jobType) + " minimum#k. Let's see."); // thanks Vcoc for noticing a need to state and check requirements on first job adv starting message } else if (cm.getLevel() >= 30 && cm.getJobId() == 500) { actionx["2ndJob"] = true; - if (cm.isQuestCompleted(2191) || cm.isQuestCompleted(2192)) + if (cm.isQuestCompleted(2191) || cm.isQuestCompleted(2192)) { cm.sendNext("I see you have done well. I will allow you to take the next step on your long road."); - else + } else { cm.sendNext("The progress you have made is astonishing."); - } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 5 && !cm.getPlayer().gotPartyQuestItem("JBP"))){ + } + } else if (actionx["3thJobI"] || (cm.getPlayer().gotPartyQuestItem("JB3") && cm.getLevel() >= 70 && cm.getJobId() % 10 == 0 && parseInt(cm.getJobId() / 100) == 5 && !cm.getPlayer().gotPartyQuestItem("JBP"))) { actionx["3thJobI"] = true; cm.sendNext("There you are. A few days ago, #b#p2020013##k of Ossyria talked to me about you. I see that you are interested in making the leap to the world of the third job advancement for pirates. To archieve that goal, I will have to test your strength in order to see whether you are worthy of the advancement. There is an opening in the middle of a cave on Victoria Island, where it'll lead you to a secret passage. Once inside, you'll face a clone of myself. Your task is to defeat him and bring #b#t4031059##k back with you."); - } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)){ + } else if (cm.getPlayer().gotPartyQuestItem("JBP") && !cm.haveItem(4031059)) { cm.sendNext("Please, bring me the #b#t4031059##k."); cm.dispose(); - } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")){ + } else if (cm.haveItem(4031059) && cm.getPlayer().gotPartyQuestItem("JBP")) { actionx["3thJobC"] = true; cm.sendNext("Nice work. You have defeated my clone and brought #b#t4031059##k back safely. You have now proven yourself worthy of the 3rd job advancement from the physical standpoint. Now you should give this necklace to #b#p2020013##k in Ossyria to take on the second part of the test. Good luck. You'll need it."); } else { @@ -107,15 +109,15 @@ function action(mode, type, selection) { } else if (mode == 0 && type != 1) { status -= 2; } - - if (status == -1){ + + if (status == -1) { start(); return; } else { if (advQuest > 0) { if (advQuest < 3) { var em = cm.getEventManager(advQuest == 1 ? "4jship" : "4jsuper"); - if(!em.startInstance(cm.getPlayer())) { + if (!em.startInstance(cm.getPlayer())) { cm.sendOk("Someone is already challenging the test. Please try again later."); } } else if (advQuest < 5) { @@ -133,11 +135,11 @@ function action(mode, type, selection) { cm.warp(120000101); } - + cm.dispose(); - } else if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + } else if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -145,29 +147,30 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); return; } else { - if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)){ - if (mode == 0 && status == 2 && type == 1) + if (mode != 1 || status == 7 && type != 1 || (actionx["1stJob"] && status == 4) || (cm.haveItem(4031008) && status == 2) || (actionx["3thJobI"] && status == 1)) { + if (mode == 0 && status == 2 && type == 1) { cm.sendOk("You know there is no other choice..."); - if (!(mode == 0 && type != 1)){ + } + if (!(mode == 0 && type != 1)) { cm.dispose(); return; } } } } - - if (actionx["1stJob"]){ + + if (actionx["1stJob"]) { if (status == 0) { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { cm.sendYesNo("Oh...! You look like someone that can definitely be a part of us... all you need is a little slang, and... yeah... so, what do you think? Wanna be the Pirate?"); @@ -175,9 +178,9 @@ function action(mode, type, selection) { cm.sendOk("Train a bit more until you reach the base requirements and I can show you the way of the #rPirate#k."); cm.dispose(); } - } else if (status == 1){ - if (cm.canHold(2070000) && cm.canHoldAll([1482000, 1492000])){ - if (cm.getJobId() == 0){ + } else if (status == 1) { + if (cm.canHold(2070000) && cm.canHoldAll([1482000, 1492000])) { + if (cm.getJobId() == 0) { cm.changeJobById(500); cm.gainItem(1492000, 1); cm.gainItem(1482000, 1); @@ -189,84 +192,95 @@ function action(mode, type, selection) { cm.sendNext("Make some room in your inventory and talk back to me."); cm.dispose(); } - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You've gotten much stronger now. Plus every single one of your inventories have added slots. A whole row, to be exact. Go see for it yourself. I just gave you a little bit of #bSP#k. When you open up the #bSkill#k menu on the lower left corner of the screen, there are skills you can learn by using SP's. One warning, though: You can't raise it all together all at once. There are also skills you can acquire only after having learned a couple of skills first."); - else if (status == 3) + } else if (status == 3) { cm.sendNextPrev("Now a reminder. Once you have chosen, you cannot change up your mind and try to pick another path. Go now, and live as a proud Pirate."); - else + } else { cm.dispose(); - } else if(actionx["2ndJob"]){ - if (status == 0){ - if (cm.isQuestCompleted(2191) || cm.isQuestCompleted(2192)) + } + } else if (actionx["2ndJob"]) { + if (status == 0) { + if (cm.isQuestCompleted(2191) || cm.isQuestCompleted(2192)) { cm.sendSimple("Alright, when you have made your decision, click on [I'll choose my occupation] at the bottom.#b\r\n#L0#Please explain to me what being the Brawler is all about.\r\n#L1#Please explain to me what being the Gunslinger is all about.\r\n#L3#I'll choose my occupation!"); - else + } else { cm.sendNext("Good decision. You look strong, but I need to see if you really are strong enough to pass the test, it's not a difficult test, so you'll do just fine."); - } else if (status == 1){ - if (!cm.isQuestCompleted(2191) && !cm.isQuestCompleted(2192)){ + } + } else if (status == 1) { + if (!cm.isQuestCompleted(2191) && !cm.isQuestCompleted(2192)) { // Pirate works differently from the other jobs. It warps you directly in. actionx["2ndJobT"] = true; cm.sendYesNo("Would you like to take the test now?"); } else { if (selection < 3) { - if(selection == 0) { //brawler + if (selection == 0) { //brawler cm.sendNext("Pirates that master #rKnuckles#k.\r\n\r\n#bBrawlers#k are melee, close-ranged fist fighters who deal lots of damage and have high HP. Armed with #rCorkscrew Blow#k, one can deal massive damage to multiple targets at once. #rOak Barrel#k permits one to scout or disguise themselves in middle of difficult fights, enabling a possible escaping route in front of danger."); - } else if(selection == 1) { //gunslinger + } else if (selection == 1) { //gunslinger cm.sendNext("Pirates that master #rGuns#k.\r\n\r\n#bGunslingers#k are faster and ranged attackers. With the #rWings#k skill, Gunslingers can hover in the air, allowing for a longer, more sustained jump than a regular jump. #rBlank Shot#k allows to deal Stun status to multiple targets nearby."); } - + status -= 2; - } else + } else { cm.sendNextPrev("You have a long road ahead of you still, but being a pirate will help you get there. Just keep that in mind and you will do fine."); + } } - } else if (status == 2){ + } else if (status == 2) { if (actionx["2ndJobT"]) { var map = 0; - if(cm.isQuestStarted(2191)) - map = 108000502; - else - map = 108000501; - if(cm.getPlayerCount(map) > 0) { - cm.sendOk("All the training maps are currently in use. Please try again later."); - cm.dispose(); - } else { - cm.warp(map, 0); - cm.dispose(); - return; + if (cm.isQuestStarted(2191)) { + map = 108000502; + } else { + map = 108000501; + } + if (cm.getPlayerCount(map) > 0) { + cm.sendOk("All the training maps are currently in use. Please try again later."); + cm.dispose(); + } else { + cm.warp(map, 0); + cm.dispose(); + } } else { - if(cm.isQuestCompleted(2191) && cm.isQuestCompleted(2192)) - job = (Math.random() < 0.5) ? 510 : 520; - else if(cm.isQuestCompleted(2191)) - job = 510; - else if(cm.isQuestCompleted(2192)) - job = 520; - + if (cm.isQuestCompleted(2191) && cm.isQuestCompleted(2192)) { + job = (Math.random() < 0.5) ? 510 : 520; + } else if (cm.isQuestCompleted(2191)) { + job = 510; + } else if (cm.isQuestCompleted(2192)) { + job = 520; + } + cm.sendYesNo("So you want to make the second job advancement as the " + (job == 510 ? "#bBrawler#k" : "#bGunslinger#k") + "? You know you won't be able to choose a different job for the 2nd job advancement once you make your decision here, right?"); } - } else if (status == 3){ - if (cm.haveItem(4031012)) + } else if (status == 3) { + if (cm.haveItem(4031012)) { cm.gainItem(4031012, -1); - - if(job == 510) cm.sendNext("From here on out, you are a #bBrawler#k. Brawlers rule the world with the power of their bare fists...which means they need to train their body more than others. If you have any trouble training, I'll be more than happy to help."); - else cm.sendNext("From here on out, you are a #bGunslinger#k. Gunslingers are notable for their long-range attacks with sniper-like accuracy and of course, using Guns as their primary weapon. You should continue training to truly master your skills. If you are having trouble training, I'll be here to help."); - - if (cm.getJobId() != job) + } + + if (job == 510) { + cm.sendNext("From here on out, you are a #bBrawler#k. Brawlers rule the world with the power of their bare fists...which means they need to train their body more than others. If you have any trouble training, I'll be more than happy to help."); + } else { + cm.sendNext("From here on out, you are a #bGunslinger#k. Gunslingers are notable for their long-range attacks with sniper-like accuracy and of course, using Guns as their primary weapon. You should continue training to truly master your skills. If you are having trouble training, I'll be here to help."); + } + + if (cm.getJobId() != job) { cm.changeJobById(job); - } else if (status == 4) + } + } else if (status == 4) { cm.sendNextPrev("I have just given you a book that gives you the list of skills you can acquire as a " + (job == 510 ? "brawler" : "gunslinger") + ". Also your etc inventory has expanded by adding another row to it. Your max HP and MP have increased, too. Go check and see for it yourself."); - else if (status == 5) + } else if (status == 5) { cm.sendNextPrev("I have also given you a little bit of #bSP#k. Open the #bSkill Menu#k located at the bottom left corner. you'll be able to boost up the newer acquired 2nd level skills. A word of warning, though. You can't boost them up all at once. Some of the skills are only available after you have learned other skills. Make sure yo remember that."); - else if (status == 6) + } else if (status == 6) { cm.sendNextPrev((job == 510 ? "Brawlers" : "Gunslingers") + " need to be strong. But remember that you can't abuse that power and use it on a weakling. Please use your enormous power the right way, because... for you to use that the right way, that is much harden than just getting stronger. Please find me after you have advanced much further. I'll be waiting for you."); - } else if (actionx["3thJobI"]){ - if (status == 0){ - if (cm.getPlayer().gotPartyQuestItem("JB3")){ + } + } else if (actionx["3thJobI"]) { + if (status == 0) { + if (cm.getPlayer().gotPartyQuestItem("JB3")) { cm.getPlayer().removePartyQuestItem("JB3"); cm.getPlayer().setPartyQuestItemObtained("JBP"); } cm.sendNextPrev("Since he is a clone of myself, you can expect a tough battle ahead. He uses a number of special attacking skills unlike any you have ever seen, and it is your task to successfully take him one on one. There is a time limit in the secret passage, so it is crucial that you defeat him within the time limit. I wish you the best of luck, and I hope you bring the #b#t4031059##k with you."); } - } else if (actionx["3thJobC"]){ + } else if (actionx["3thJobC"]) { cm.getPlayer().removePartyQuestItem("JBP"); cm.gainItem(4031059, -1); cm.gainItem(4031057, 1); diff --git a/scripts/npc/1091003.js b/scripts/npc/1091003.js index 6d18bc1430..03835d2e98 100644 --- a/scripts/npc/1091003.js +++ b/scripts/npc/1091003.js @@ -4,198 +4,193 @@ */ /** - Author: xQuasar -*/ + Author: xQuasar + */ function start() { - cm.getPlayer().setCS(true); - status = -1; - action(1, 0, 0); + cm.getPlayer().setCS(true); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == 1) - status++; - else - cm.dispose(); - if (status == 0 && mode == 1) { - var selStr = "What? You want to make your own weapons and gloves? Seriously... it's tough to do it by yourself if you don't have experience... I'll help you out. I've been a pirate for 20 years, and for 20 years I have made various items for the crew here. It's easy for me."; - var options = new Array("Make a Knuckler","Make a Gun","Make a pair of gloves"); - for (var i = 0; i < options.length; i++){ - selStr += "\r\n#b#L" + i + "# " + options[i] + "#l#k"; - } - - cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { - selectedType = selection; - if (selectedType == 0){ //Making a Knuckler - var selStr = "As long as you bring in the materials required, I'll make you a fine Knuckler. Which Knuckler would you like to make?"; - var knucklers = new Array("Leather Arms (Level limit: 15, Pirate)", "Double Tail Knuckler (Level limit: 20, Pirate)", "Norman Grip (Level limit: 25, Pirate)", "Prime Hands (Level limit: 30, Pirate)", "Silver Maiden (Level limit: 35, Pirate)", "Neozard (Level limit: 40, Pirate)", "Fury Claw (Level limit: 50, Pirate)"); - for (var i = 0; i < knucklers.length; i++){ - selStr += "\r\n#b#L" + i + "# " + knucklers[i] + "#l#k"; - } - equip = true; - cm.sendSimple(selStr); - } - else if (selectedType == 1){ //Making a Gun - var selStr = "As long as you bring in the materials required, I'll make you a fine Gun. Which Gun would you like to make?"; - var guns = new Array("Dellinger Special (Level limit: 15, Pirate)", "The Negotiator (Level limit: 20, Pirate)", "Golden Hook (Level limit: 25, Pirate)", "Cold Mind (Level limit: 30, Pirate)", "Shooting Star (Level limit: 35, Pirate)", "Lunar Shooter (Level limit: 40, Pirate)", "Mr. Rasfelt (Level limit: 50, Pirate)"); - for (var i = 0; i < guns.length; i++){ - selStr += "\r\n#b#L" + i + "# " + guns[i] + "#l#k"; - } - equip = true; - cm.sendSimple(selStr); - } - else if (selectedType == 2){ //Making a pair of pirate gloves - var selStr = "As long as you bring in the materials required, I'll make you a fine glove. Which glove would you like to make?"; - var gloves = new Array ("Green Lagger Halfglove","Brown Leather Armour Glove","Hard Leather Glove","Yellow Tartis","Brown Jewelled","Brown Barbee","Brown Royce","Black Schult"); - for (var i = 0; i < gloves.length; i++){ - selStr += "\r\n#b#L" + i + "# " + gloves[i] + "#l#k"; - } - equip = true; - cm.sendSimple(selStr); - } - if (equip) - status++; - } - else if (status == 3 && mode == 1) { - if (equip) - { - selectedItem = selection; - qty = 1; - } - else - qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + if (mode == 1) { + status++; + } else { + cm.dispose(); + } + if (status == 0 && mode == 1) { + var selStr = "What? You want to make your own weapons and gloves? Seriously... it's tough to do it by yourself if you don't have experience... I'll help you out. I've been a pirate for 20 years, and for 20 years I have made various items for the crew here. It's easy for me."; + var options = ["Make a Knuckler", "Make a Gun", "Make a pair of gloves"]; + for (var i = 0; i < options.length; i++) { + selStr += "\r\n#b#L" + i + "# " + options[i] + "#l#k"; + } - if (selectedType == 0){ //Making a Knuckler - var itemSet = new Array(1482001, 1482002, 1482003, 1482004, 1482005, 1482006, 1482007); - var matSet = new Array(4000021, new Array(4011001,4011000,4000021,4003000), new Array(4011000,4011001,4003000), new Array(4011000,4011001,4000021,4003000), new Array(4011000,4011001,4000021,4003000), new Array(4011000,4011001,4021000,4000021,4003000), new Array(4000039,4011000,4011001,4000030,4000021,4003000)); - var matQtySet = new Array(20, new Array(1,1,10,5), new Array(2,1,10), new Array(1,1,30,10), new Array(2,2,30,20), new Array(1,1,2,50,20), new Array(150,1,2,20,20,20)); - var costSet = new Array(1000,2000,5000,15000,30000,50000,100000); - var levelLimitSet = new Array(15,20,25,30,35,40,50); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - levelLimit = levelLimitSet[selectedItem]; - } - else if (selectedType == 1){ //Making a Gun - var itemSet = new Array(1492001, 1492002, 1492003, 1492004, 1492005, 1492006, 1492007); - var matSet = new Array(new Array(4011000,4003000,4003001), new Array(4011000,4003000,4003001,4000021), new Array(4011000,4003000), new Array(4011001,4000021,4003000), new Array(4011006,4011001,4000021,4003000), new Array(4011004,4011001,4000021,4003000), new Array(4011006,4011004,4011001,4000030,4003000)); - var matQtySet = new Array(new Array(1,5,1), new Array(1,10,5,10), new Array(2,10), new Array(2,10,10), new Array(10,2,5,10), new Array(1,2,10,20), new Array(1,2,4,30,30)); - var costSet = new Array (1000,2000,5000,15000,30000,50000,100000); - var levelLimitSet = new Array(15,20,25,30,35,40,50); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - levelLimit = levelLimitSet[selectedItem]; - } - else if (selectedType == 2){ //Making a pair of pirate gloves - var itemSet = new Array(1082180, 1082183, 1082186, 1082189, 1082192, 1082195, 1082198, 1082201); - var matSet = new Array(new Array(4000021,4021003),4000021,new Array(4011000,4000021),new Array(4021006,4000021,4003000),new Array(4011000,4000021,4003000),new Array(4000021,4011000,4011001,4003000),new Array(4011000,4000021,4000030,4003000),new Array(4011007,4021008,4021007,4000030,4003000)); - var matQtySet = new Array(new Array(15,1),35,new Array(2,20),new Array(2,50,10),new Array(3,60,15),new Array(80,3,3,25),new Array(3,20,40,30),new Array(1,1,1,50,50)); - var costSet = new Array(1000,8000,15000,25000,30000,40000,50000,70000); - var levelLimitSet = new Array(15,20,25,30,35,40,50,60); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - levelLimit = levelLimitSet[selectedItem]; - } - - prompt = "Making one #t" + item + "# requires the items listed below. The level limit for this item is " + levelLimit + ", so check and make sure you really need this item before getting it. What do you think? Do you really want one?\r\n"; - - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; - } - } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - - if (cost > 0) - prompt += "\r\n#i4031138# " + cost * qty + " meso"; - - cm.sendYesNo(prompt); - } - else if (status == 4 && mode == 1) { - var pass = true; + cm.sendSimple(selStr); + } else if (status == 1 && mode == 1) { + selectedType = selection; + if (selectedType == 0) { //Making a Knuckler + var selStr = "As long as you bring in the materials required, I'll make you a fine Knuckler. Which Knuckler would you like to make?"; + var knucklers = ["Leather Arms (Level limit: 15, Pirate)", "Double Tail Knuckler (Level limit: 20, Pirate)", "Norman Grip (Level limit: 25, Pirate)", "Prime Hands (Level limit: 30, Pirate)", "Silver Maiden (Level limit: 35, Pirate)", "Neozard (Level limit: 40, Pirate)", "Fury Claw (Level limit: 50, Pirate)"]; + for (var i = 0; i < knucklers.length; i++) { + selStr += "\r\n#b#L" + i + "# " + knucklers[i] + "#l#k"; + } + equip = true; + cm.sendSimple(selStr); + } else if (selectedType == 1) { //Making a Gun + var selStr = "As long as you bring in the materials required, I'll make you a fine Gun. Which Gun would you like to make?"; + var guns = ["Dellinger Special (Level limit: 15, Pirate)", "The Negotiator (Level limit: 20, Pirate)", "Golden Hook (Level limit: 25, Pirate)", "Cold Mind (Level limit: 30, Pirate)", "Shooting Star (Level limit: 35, Pirate)", "Lunar Shooter (Level limit: 40, Pirate)", "Mr. Rasfelt (Level limit: 50, Pirate)"]; + for (var i = 0; i < guns.length; i++) { + selStr += "\r\n#b#L" + i + "# " + guns[i] + "#l#k"; + } + equip = true; + cm.sendSimple(selStr); + } else if (selectedType == 2) { //Making a pair of pirate gloves + var selStr = "As long as you bring in the materials required, I'll make you a fine glove. Which glove would you like to make?"; + var gloves = ["Green Lagger Halfglove", "Brown Leather Armour Glove", "Hard Leather Glove", "Yellow Tartis", "Brown Jewelled", "Brown Barbee", "Brown Royce", "Black Schult"]; + for (var i = 0; i < gloves.length; i++) { + selStr += "\r\n#b#L" + i + "# " + gloves[i] + "#l#k"; + } + equip = true; + cm.sendSimple(selStr); + } + if (equip) { + status++; + } + } else if (status == 3 && mode == 1) { + if (equip) { + selectedItem = selection; + qty = 1; + } else { + qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } - if(!cm.canHold(item)) { - cm.sendOk("Check your inventory for a free slot first."); - cm.dispose(); - return; + if (selectedType == 0) { //Making a Knuckler + var itemSet = [1482001, 1482002, 1482003, 1482004, 1482005, 1482006, 1482007]; + var matSet = [4000021, [4011001, 4011000, 4000021, 4003000], [4011000, 4011001, 4003000], [4011000, 4011001, 4000021, 4003000], [4011000, 4011001, 4000021, 4003000], [4011000, 4011001, 4021000, 4000021, 4003000], [4000039, 4011000, 4011001, 4000030, 4000021, 4003000]]; + var matQtySet = [20, [1, 1, 10, 5], [2, 1, 10], [1, 1, 30, 10], [2, 2, 30, 20], [1, 1, 2, 50, 20], [150, 1, 2, 20, 20, 20]]; + var costSet = [1000, 2000, 5000, 15000, 30000, 50000, 100000]; + var levelLimitSet = [15, 20, 25, 30, 35, 40, 50]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + levelLimit = levelLimitSet[selectedItem]; + } else if (selectedType == 1) { //Making a Gun + var itemSet = [1492001, 1492002, 1492003, 1492004, 1492005, 1492006, 1492007]; + var matSet = [[4011000, 4003000, 4003001], [4011000, 4003000, 4003001, 4000021], [4011000, 4003000], [4011001, 4000021, 4003000], [4011006, 4011001, 4000021, 4003000], [4011004, 4011001, 4000021, 4003000], [4011006, 4011004, 4011001, 4000030, 4003000]]; + var matQtySet = [[1, 5, 1], [1, 10, 5, 10], [2, 10], [2, 10, 10], [10, 2, 5, 10], [1, 2, 10, 20], [1, 2, 4, 30, 30]]; + var costSet = [1000, 2000, 5000, 15000, 30000, 50000, 100000]; + var levelLimitSet = [15, 20, 25, 30, 35, 40, 50]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + levelLimit = levelLimitSet[selectedItem]; + } else if (selectedType == 2) { //Making a pair of pirate gloves + var itemSet = [1082180, 1082183, 1082186, 1082189, 1082192, 1082195, 1082198, 1082201]; + var matSet = [[4000021, 4021003], 4000021, [4011000, 4000021], [4021006, 4000021, 4003000], [4011000, 4000021, 4003000], [4000021, 4011000, 4011001, 4003000], [4011000, 4000021, 4000030, 4003000], [4011007, 4021008, 4021007, 4000030, 4003000]]; + var matQtySet = [[15, 1], 35, [2, 20], [2, 50, 10], [3, 60, 15], [80, 3, 3, 25], [3, 20, 40, 30], [1, 1, 1, 50, 50]]; + var costSet = [1000, 8000, 15000, 25000, 30000, 40000, 50000, 70000]; + var levelLimitSet = [15, 20, 25, 30, 35, 40, 50, 60]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + levelLimit = levelLimitSet[selectedItem]; + } + + prompt = "Making one #t" + item + "# requires the items listed below. The level limit for this item is " + levelLimit + ", so check and make sure you really need this item before getting it. What do you think? Do you really want one?\r\n"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; + } + + if (cost > 0) { + prompt += "\r\n#i4031138# " + cost * qty + " meso"; + } + + cm.sendYesNo(prompt); + } else if (status == 4 && mode == 1) { + var pass = true; + + if (!cm.canHold(item)) { + cm.sendOk("Check your inventory for a free slot first."); + cm.dispose(); + return; + } else if (cm.getMeso() < cost * qty) { + cm.sendNext("Check and make sure you have all the necessary items to make this. Also, make sure your Equips inventory has room. I can't give you the item if your inventory is full, you know."); + cm.dispose(); + return; + } else { + if (mats instanceof Array) { + for (var i = 0; pass && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { + pass = false; + } } - else if (cm.getMeso() < cost * qty) - { - cm.sendNext("Check and make sure you have all the necessary items to make this. Also, make sure your Equips inventory has room. I can't give you the item if your inventory is full, you know."); - cm.dispose(); - return; - } - else - { - if (mats instanceof Array) { - for(var i = 0; pass && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) - pass = false; - } - else if (!cm.haveItem(mats, matQty * qty)) - pass = false; - /*if (mats instanceof Array) { - for(var i = 0; pass && i < mats.length; i++) - { - if (matQty[i] * qty == 1) { - if (!cm.haveItem(mats[i])) - { - pass = false; - } - } - else { - var count = 0; - var iter = cm.getChar().getInventory(InventoryType.ETC).listById(mats[i]).iterator(); - while (iter.hasNext()) { - count += iter.next().getQuantity(); - } - if (count < matQty[i] * qty) - pass = false; - } - } - } - else { - var count = 0; - var iter = cm.getChar().getInventory(InventoryType.ETC).listById(mats).iterator(); - while (iter.hasNext()) { - count += iter.next().getQuantity(); - } - if (count < matQty * qty) - pass = false; - } - */ - } - - if (pass == false) - cm.sendNext("Check and make sure you have all the necessary items to make this. Also, make sure your Equips inventory has room. I can't give you the item if your inventory is full, you know."); - else { - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ - cm.gainItem(mats[i], -matQty[i] * qty); - } - } - else - cm.gainItem(mats, -matQty * qty); - - if (cost > 0) - cm.gainMeso(-cost * qty); - - if (item == 4003000)//screws - cm.gainItem(4003000, 15 * qty); - else - cm.gainItem(item, qty); - cm.sendOk("All done. If you need anything else... Well, I'm not going anywhere."); - } - cm.dispose(); - } + } else if (!cm.haveItem(mats, matQty * qty)) { + pass = false; + } + /*if (mats instanceof Array) { + for(var i = 0; pass && i < mats.length; i++) + { + if (matQty[i] * qty == 1) { + if (!cm.haveItem(mats[i])) + { + pass = false; + } + } + else { + var count = 0; + var iter = cm.getChar().getInventory(InventoryType.ETC).listById(mats[i]).iterator(); + while (iter.hasNext()) { + count += iter.next().getQuantity(); + } + if (count < matQty[i] * qty) + pass = false; + } + } + } + else { + var count = 0; + var iter = cm.getChar().getInventory(InventoryType.ETC).listById(mats).iterator(); + while (iter.hasNext()) { + count += iter.next().getQuantity(); + } + if (count < matQty * qty) + pass = false; + } + */ + } + + if (pass == false) { + cm.sendNext("Check and make sure you have all the necessary items to make this. Also, make sure your Equips inventory has room. I can't give you the item if your inventory is full, you know."); + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + cm.gainItem(mats[i], -matQty[i] * qty); + } + } else { + cm.gainItem(mats, -matQty * qty); + } + + if (cost > 0) { + cm.gainMeso(-cost * qty); + } + + if (item == 4003000)//screws + { + cm.gainItem(4003000, 15 * qty); + } else { + cm.gainItem(item, qty); + } + cm.sendOk("All done. If you need anything else... Well, I'm not going anywhere."); + } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1092000.js b/scripts/npc/1092000.js index b5766388f3..0cdeec8ccb 100644 --- a/scripts/npc/1092000.js +++ b/scripts/npc/1092000.js @@ -24,34 +24,33 @@ var status; function start() { - status = -1; + status = -1; action(1, 0, 0); } -function action(mode, type, selection){ - if (mode == -1 || !cm.isQuestStarted(2180)){ - cm.dispose(); - return; - } - else{ - if (mode == 1) status++; - else status --; +function action(mode, type, selection) { + if (mode == -1 || !cm.isQuestStarted(2180)) { + cm.dispose(); - if (status == 0){ - cm.sendNext("Okay, I'll now send you to the stable where my cows are. Watch out for the calves that drink all the milk. You don't want your effort to go to waste."); - } - else if (status == 1){ - cm.sendNextPrev("It won't be easy to tell at a glance between a calf and a cow. Those calves may only be a month or two old, but they have already grown to the size of their mother. They even look alike...even I get confused at times! Good luck!"); - } - else if (status == 2){ - if (cm.canHold(4031847)){ - cm.gainItem(4031847, 1); - cm.warp(912000100, 0); - } - else{ - cm.sendOk("I can't give you the empty bottle because your inventory is full. Please make some room in your Etc window."); - } - cm.dispose(); - } - } + } else { + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendNext("Okay, I'll now send you to the stable where my cows are. Watch out for the calves that drink all the milk. You don't want your effort to go to waste."); + } else if (status == 1) { + cm.sendNextPrev("It won't be easy to tell at a glance between a calf and a cow. Those calves may only be a month or two old, but they have already grown to the size of their mother. They even look alike...even I get confused at times! Good luck!"); + } else if (status == 2) { + if (cm.canHold(4031847)) { + cm.gainItem(4031847, 1); + cm.warp(912000100, 0); + } else { + cm.sendOk("I can't give you the empty bottle because your inventory is full. Please make some room in your Etc window."); + } + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1092007.js b/scripts/npc/1092007.js index b23d49df23..682903338d 100644 --- a/scripts/npc/1092007.js +++ b/scripts/npc/1092007.js @@ -7,42 +7,39 @@ Function: When on the quest, he warps player to Black Magician's Disciple var status; function start() { - + status = -1; action(1, 0, 0); } -function action(mode, type, selection){ - if (mode == -1){ +function action(mode, type, selection) { + if (mode == -1) { cm.dispose(); - } - else{ - if (mode == 0 && type > 0){ + } else { + if (mode == 0 && type > 0) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if (status == 0){ - if (cm.getQuestStatus(2175) == 1){ - if (cm.getPlayer().canHold(2030019)){ + if (status == 0) { + if (cm.getQuestStatus(2175) == 1) { + if (cm.getPlayer().canHold(2030019)) { cm.sendOk("Please take this #b#t2030019##k, it will make your life a lot easier. #i2030019#"); - } - else{ + } else { cm.sendOk("No free inventory spot available. Please make room in your USE inventory first."); cm.dispose(); } - } - else{ + } else { cm.sendOk("The Black Magician and his followers. Kyrin and the Crew of Nautilus. \n They'll be chasing one another until one of them doesn't exist, that's for sure."); cm.dispose(); } - } - else if (status == 1){ + } else if (status == 1) { cm.gainItem(2030019, 1); cm.warp(100000006, 0); cm.dispose(); diff --git a/scripts/npc/1092008.js b/scripts/npc/1092008.js index d23a355f2b..e1774bc01e 100644 --- a/scripts/npc/1092008.js +++ b/scripts/npc/1092008.js @@ -19,35 +19,36 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if (!cm.isQuestStarted(6410)) { - cm.sendOk("Hey, do you have any business with me?"); - cm.dispose(); - } else { - cm.sendYesNo("Let's go save #r#p2095000##k?"); - } - } else if (status == 1) { - cm.warp(925010000, 0); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!cm.isQuestStarted(6410)) { + cm.sendOk("Hey, do you have any business with me?"); + cm.dispose(); + } else { + cm.sendYesNo("Let's go save #r#p2095000##k?"); + } + } else if (status == 1) { + cm.warp(925010000, 0); + cm.dispose(); + } + } } diff --git a/scripts/npc/1092010.js b/scripts/npc/1092010.js index 9773ef4a13..acf0aa2ed2 100644 --- a/scripts/npc/1092010.js +++ b/scripts/npc/1092010.js @@ -32,33 +32,34 @@ No specific function, useless text. */ function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(!cm.haveItem(4220153)) { - cm.sendOk("(Scratch scratch...)"); - cm.dispose(); - } else { - cm.sendYesNo("Hey, nice #bTreasure Map#k you have there? #rCan I keep it#k for the Nautilus crew, if you don't need it any longer?"); - } - } else if(status == 1) { - cm.gainItem(4220153, -1); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!cm.haveItem(4220153)) { + cm.sendOk("(Scratch scratch...)"); + cm.dispose(); + } else { + cm.sendYesNo("Hey, nice #bTreasure Map#k you have there? #rCan I keep it#k for the Nautilus crew, if you don't need it any longer?"); + } + } else if (status == 1) { + cm.gainItem(4220153, -1); + cm.dispose(); + } + } } diff --git a/scripts/npc/1092014.js b/scripts/npc/1092014.js index d4fbf2dd3b..74193ed623 100644 --- a/scripts/npc/1092014.js +++ b/scripts/npc/1092014.js @@ -19,34 +19,37 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { var selStr = ""; - if (cm.getJobId() == 0) + if (cm.getJobId() == 0) { selStr += "We have a special 90% discount for beginners."; + } selStr += "Choose your destination, for fees will change from place to place.#b"; - for (var i = 0; i < maps.length; i++) + for (var i = 0; i < maps.length; i++) { selStr += "\r\n#L" + i + "##m" + maps[i] + "# (" + (cm.getJobId() == 0 ? cost[i] / 10 : cost[i]) + " mesos)#l"; + } cm.sendSimple(selStr); } else if (status == 2) { - cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); + cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b" + (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k."); selectedMap = selection; } else if (status == 3) { if (cm.getJobId() == 0) { - mesos = cost[selectedMap] / 10; + mesos = cost[selectedMap] / 10; } else { - mesos = cost[selectedMap]; + mesos = cost[selectedMap]; } - + if (cm.getMeso() < mesos) { cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab."); cm.dispose(); return; } - + cm.gainMeso(-mesos); cm.warp(maps[selectedMap], 0); cm.dispose(); diff --git a/scripts/npc/1092015.js b/scripts/npc/1092015.js index d7192da1c6..a8c7ac58ef 100644 --- a/scripts/npc/1092015.js +++ b/scripts/npc/1092015.js @@ -20,28 +20,29 @@ /* Water Filter */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("I'm bored! Someone come play with me!"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("I'm bored! Someone come play with me!"); + cm.dispose(); + } + } } diff --git a/scripts/npc/1092016.js b/scripts/npc/1092016.js index c033e12b40..da6dc771b3 100644 --- a/scripts/npc/1092016.js +++ b/scripts/npc/1092016.js @@ -18,17 +18,19 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -*/ +*/ + /* Author : XxOsirisxX (BubblesDev) NPC Name: Shiny Stone */ function start() { - if(cm.isQuestStarted(2166)) { + if (cm.isQuestStarted(2166)) { cm.sendNext("It's a beautiful, shiny rock. I can feel the mysterious power surrounding it."); cm.completeQuest(2166); - } else + } else { cm.sendNext("I touched the shiny rock with my hand, and I felt a mysterious power flowing into my body."); + } cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1092018.js b/scripts/npc/1092018.js index 27ce827069..09a5e65402 100644 --- a/scripts/npc/1092018.js +++ b/scripts/npc/1092018.js @@ -19,38 +19,39 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - var qs = cm.getQuestStatus(2162); - - if((qs == 0 || qs == 1) && !cm.haveItem(4031839, 1)) { - if(cm.canHold(4031839, 1)) { - cm.gainItem(4031839, 1); - cm.sendNext("(You retrieved a Crumpled Paper standing out of the trash can. It's content seems important.)", 2); - } else { - cm.sendNext("(You see a Crumpled Paper standing out of the trash can. It's content seems important, but you can't retrieve it since your inventory is full.)", 2); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var qs = cm.getQuestStatus(2162); + + if ((qs == 0 || qs == 1) && !cm.haveItem(4031839, 1)) { + if (cm.canHold(4031839, 1)) { + cm.gainItem(4031839, 1); + cm.sendNext("(You retrieved a Crumpled Paper standing out of the trash can. It's content seems important.)", 2); + } else { + cm.sendNext("(You see a Crumpled Paper standing out of the trash can. It's content seems important, but you can't retrieve it since your inventory is full.)", 2); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/1092019.js b/scripts/npc/1092019.js index 96e333cc35..795a76e18f 100644 --- a/scripts/npc/1092019.js +++ b/scripts/npc/1092019.js @@ -40,79 +40,80 @@ var seagullProgress; var seagullIdx = -1; var seagullQuestion = ["One day, I went to the ocean and caught 62 Octopi for dinner. But then some kid came by and gave me 10 Octopi as a gift! How many Octopi do I have then, in total?"]; var seagullAnswer = ["72"]; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { // missing script for skill test found thanks to Jade™ - if (!cm.isQuestStarted(6400)) { - cm.sendOk("Who are you talking to me? If you're just bored, go bother somebody else."); - cm.dispose(); - } else { - seagullProgress = cm.getQuestProgressInt(6400, 1); - - if (seagullProgress == 0) { - seagullIdx = Math.floor(Math.random() * seagullQuestion.length); - - // string visibility thanks to ProXAIMeRx & Glvelturall - cm.sendNext("Ok then! I'll give you the first question now! You better be ready because this one's a hard one. Even the seagulls here think this one's pretty tough. It's a pretty difficult problem."); - } else if (seagullProgress == 1) { - cm.sendNext("Now~ Let's go onto the next question. This one is really difficult. I am going to have Bart help me on this one. You know Bart, right?"); - } else { - cm.sendNext("Ohhhh! Now that was impressive! I considered my test quite difficult, and for you to pass that... you are indeed an integral member of the Pirate family, and a friend of seagulls. We are now bonded by the mutual friendship that will last a lifetime! And, most of all, friends are there to help you out when you are in dire straits. If you are in a state of emergency, call us seagulls."); - } - } - } else if (status == 1) { - if (seagullProgress == 0) { - cm.sendGetText(seagullQuestion[seagullIdx]); - } else if (seagullProgress == 1) { - cm.sendNextPrev("I'm going to send you to an empty room in The Nautilus. You will see 9 Barts there. Hahaha~ Are they twins? No, no, certainly not. I've used a bit of magic for this test of will."); - } else { - cm.sendNextPrev("Notify us using the skill Air Strike, and we will be there to help you out, because that's what friends are for.\r\n\r\n #s5221003# #b#q5221003##k"); - } - } else if (status == 2) { - if (seagullIdx > -1) { - var answer = cm.getText(); - if (answer == seagullAnswer[seagullIdx]) { - cm.sendNext("What! I can't believe how incredibly smart you are! Incredible! In the seagull world, that kind of intellingence would give you a Ph.D. and then some. You're really amazing... I can't believe it... I simply can't believe it!"); - cm.setQuestProgress(6400, 1, 1); - cm.dispose(); - } else { - cm.sendOk("Hmm, that's not quite how I recall it. Try again!"); - cm.dispose(); - } - } else if (seagullProgress != 2) { - cm.sendNextPrev("Anyway, only one of 9 Barts is the real Bart. You know that Pirates are known for the strength of their friendships and camaraderie with their fellow pirates. If you're a true pirate, you should be able to find your own mate with ease. Alright then, I'll send you to the room where Bart is."); - } else { - //cm.gainExp(1000000); - //cm.teachSkill(5221003, 0, 10, -1); - //cm.forceCompleteQuest(6400); - - cm.sendNextPrev("You have met all my challenges, and passed! Good job!"); - cm.dispose(); - } - } else if (status == 3) { - var em = cm.getEventManager("4jaerial"); - if(!em.startInstance(cm.getPlayer())) { - cm.sendOk("Another player is already challenging the test in this channel. Please try another channel, or wait for the current player to finish."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { // missing script for skill test found thanks to Jade™ + if (!cm.isQuestStarted(6400)) { + cm.sendOk("Who are you talking to me? If you're just bored, go bother somebody else."); + cm.dispose(); + } else { + seagullProgress = cm.getQuestProgressInt(6400, 1); + + if (seagullProgress == 0) { + seagullIdx = Math.floor(Math.random() * seagullQuestion.length); + + // string visibility thanks to ProXAIMeRx & Glvelturall + cm.sendNext("Ok then! I'll give you the first question now! You better be ready because this one's a hard one. Even the seagulls here think this one's pretty tough. It's a pretty difficult problem."); + } else if (seagullProgress == 1) { + cm.sendNext("Now~ Let's go onto the next question. This one is really difficult. I am going to have Bart help me on this one. You know Bart, right?"); + } else { + cm.sendNext("Ohhhh! Now that was impressive! I considered my test quite difficult, and for you to pass that... you are indeed an integral member of the Pirate family, and a friend of seagulls. We are now bonded by the mutual friendship that will last a lifetime! And, most of all, friends are there to help you out when you are in dire straits. If you are in a state of emergency, call us seagulls."); + } + } + } else if (status == 1) { + if (seagullProgress == 0) { + cm.sendGetText(seagullQuestion[seagullIdx]); + } else if (seagullProgress == 1) { + cm.sendNextPrev("I'm going to send you to an empty room in The Nautilus. You will see 9 Barts there. Hahaha~ Are they twins? No, no, certainly not. I've used a bit of magic for this test of will."); + } else { + cm.sendNextPrev("Notify us using the skill Air Strike, and we will be there to help you out, because that's what friends are for.\r\n\r\n #s5221003# #b#q5221003##k"); + } + } else if (status == 2) { + if (seagullIdx > -1) { + var answer = cm.getText(); + if (answer == seagullAnswer[seagullIdx]) { + cm.sendNext("What! I can't believe how incredibly smart you are! Incredible! In the seagull world, that kind of intellingence would give you a Ph.D. and then some. You're really amazing... I can't believe it... I simply can't believe it!"); + cm.setQuestProgress(6400, 1, 1); + cm.dispose(); + } else { + cm.sendOk("Hmm, that's not quite how I recall it. Try again!"); + cm.dispose(); + } + } else if (seagullProgress != 2) { + cm.sendNextPrev("Anyway, only one of 9 Barts is the real Bart. You know that Pirates are known for the strength of their friendships and camaraderie with their fellow pirates. If you're a true pirate, you should be able to find your own mate with ease. Alright then, I'll send you to the room where Bart is."); + } else { + //cm.gainExp(1000000); + //cm.teachSkill(5221003, 0, 10, -1); + //cm.forceCompleteQuest(6400); + + cm.sendNextPrev("You have met all my challenges, and passed! Good job!"); + cm.dispose(); + } + } else if (status == 3) { + var em = cm.getEventManager("4jaerial"); + if (!em.startInstance(cm.getPlayer())) { + cm.sendOk("Another player is already challenging the test in this channel. Please try another channel, or wait for the current player to finish."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1092090.js b/scripts/npc/1092090.js index 6b1cde8950..b4f566b135 100644 --- a/scripts/npc/1092090.js +++ b/scripts/npc/1092090.js @@ -21,29 +21,29 @@ */ function start() { - if(cm.getQuestProgressInt(2180, 1) == 1) { + if (cm.getQuestProgressInt(2180, 1) == 1) { cm.sendNext("You have taken milk from this cow recently, check another cow."); cm.dispose(); return; } - + if (cm.canHold(4031848) && cm.haveItem(4031847)) { cm.sendNext("Now filling up the bottle with milk. The bottle is now 1/3 full of milk."); cm.gainItem(4031847, -1); cm.gainItem(4031848, 1); - + cm.setQuestProgress(2180, 1, 1); } else if (cm.canHold(4031849, 1) && cm.haveItem(4031848)) { cm.sendNext("Now filling up the bottle with milk. The bottle is now 2/3 full of milk."); cm.gainItem(4031848, -1); cm.gainItem(4031849, 1); - + cm.setQuestProgress(2180, 1, 1); } else if (cm.canHold(4031850) && cm.haveItem(4031849)) { cm.sendNext("Now filling up the bottle with milk. The bottle is now completely full of milk."); cm.gainItem(4031849, -1); cm.gainItem(4031850, 1); - + cm.setQuestProgress(2180, 1, 1); } else { cm.sendNext("Your inventory is full, and there's no room for a milk bottle."); diff --git a/scripts/npc/1092091.js b/scripts/npc/1092091.js index ec40aff0a8..9a4863b225 100644 --- a/scripts/npc/1092091.js +++ b/scripts/npc/1092091.js @@ -21,29 +21,29 @@ */ function start() { - if(cm.getQuestProgressInt(2180, 1) == 2) { + if (cm.getQuestProgressInt(2180, 1) == 2) { cm.sendNext("You have taken milk from this cow recently, check another cow."); cm.dispose(); return; } - - if (cm.canHold(4031848) && cm.haveItem(4031847)){ + + if (cm.canHold(4031848) && cm.haveItem(4031847)) { cm.sendNext("Now filling up the bottle with milk. The bottle is now 1/3 full of milk."); cm.gainItem(4031847, -1); cm.gainItem(4031848, 1); - + cm.setQuestProgress(2180, 1, 2); - } else if(cm.canHold(4031849) && cm.haveItem(4031848)){ + } else if (cm.canHold(4031849) && cm.haveItem(4031848)) { cm.sendNext("Now filling up the bottle with milk. The bottle is now 2/3 full of milk."); cm.gainItem(4031848, -1); cm.gainItem(4031849, 1); - + cm.setQuestProgress(2180, 1, 2); - } else if(cm.canHold(4031850) && cm.haveItem(4031849)){ + } else if (cm.canHold(4031850) && cm.haveItem(4031849)) { cm.sendNext("Now filling up the bottle with milk. The bottle is now completely full of milk."); cm.gainItem(4031849, -1); cm.gainItem(4031850, 1); - + cm.setQuestProgress(2180, 1, 2); } else { cm.sendNext("Your inventory is full, and there's no room for a milk bottle."); diff --git a/scripts/npc/1092094.js b/scripts/npc/1092094.js index ed89201800..820f43bebd 100644 --- a/scripts/npc/1092094.js +++ b/scripts/npc/1092094.js @@ -22,31 +22,34 @@ status = -1; function start() { - if(cm.haveItem(4031847)) + if (cm.haveItem(4031847)) { cm.sendNext("The hungry calf is drinking all the milk! The bottle remains empty..."); - else if(cm.haveItem(4031848) || cm.haveItem(4031849) || cm.haveItem(4031850)){ + } else if (cm.haveItem(4031848) || cm.haveItem(4031849) || cm.haveItem(4031850)) { cm.sendNext("The hungry calf is drinking all the milk! The bottle is now empty."); - if(cm.haveItem(4031848)) - cm.gainItem(4031848,-1); - else if(cm.haveItem(4031849)) + if (cm.haveItem(4031848)) { + cm.gainItem(4031848, -1); + } else if (cm.haveItem(4031849)) { cm.gainItem(4031849, -1); - else + } else { cm.gainItem(4031850, -1); + } cm.gainItem(4031847, 1); cm.dispose(); } } -function action(mode, type, selection){ - if(mode == -1) +function action(mode, type, selection) { + if (mode == -1) { cm.dispose(); - else if(mode == 0){ + } else if (mode == 0) { status--; start(); - }else + } else { status++; - if(status == 0) + } + if (status == 0) { cm.sendPrev("The hungry calf isn't interested in the empty bottle."); - else if(status == 1) + } else if (status == 1) { cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1092095.js b/scripts/npc/1092095.js index f6e83bfc2b..08db107dee 100644 --- a/scripts/npc/1092095.js +++ b/scripts/npc/1092095.js @@ -23,31 +23,34 @@ status = -1; function start() { - if (cm.haveItem(4031847)) + if (cm.haveItem(4031847)) { cm.sendNext("The hungry calf is drinking all the milk! The bottle remains empty..."); - else if (cm.haveItem(4031848) || cm.haveItem(4031849) || cm.haveItem(4031850)) { + } else if (cm.haveItem(4031848) || cm.haveItem(4031849) || cm.haveItem(4031850)) { cm.sendNext("The hungry calf is drinking all the milk! The bottle is now empty."); - if (cm.haveItem(4031848)) - cm.gainItem(4031848,-1); - else if (cm.haveItem(4031849)) + if (cm.haveItem(4031848)) { + cm.gainItem(4031848, -1); + } else if (cm.haveItem(4031849)) { cm.gainItem(4031849, -1); - else + } else { cm.gainItem(4031850, -1); + } cm.gainItem(4031847, 1); cm.dispose(); } } -function action(mode, type, selection){ - if (mode == -1) +function action(mode, type, selection) { + if (mode == -1) { cm.dispose(); - else if (mode == 0) { + } else if (mode == 0) { status--; start(); - } else + } else { status++; - if (status == 0) + } + if (status == 0) { cm.sendPrev("The hungry calf isn't interested in the empty bottle."); - else if (status == 1) + } else if (status == 1) { cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1094002.js b/scripts/npc/1094002.js index e924dc8ca5..609357451a 100644 --- a/scripts/npc/1094002.js +++ b/scripts/npc/1094002.js @@ -25,25 +25,30 @@ var rolled = 0; -function start(mode, type, selection){ - if(!cm.isQuestStarted(2186)) { +function start(mode, type, selection) { + if (!cm.isQuestStarted(2186)) { cm.sendOk("Just a pile of boxes, nothing special..."); cm.dispose(); return; } - + cm.sendNext("Do you want to obtain a glasses?"); } function action(mode, type, selection) { - if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { + if (!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { rolled = Math.floor(Math.random() * 3); - - if(rolled == 0) cm.gainItem(4031853, 1); - else if(rolled == 1) cm.gainItem(4031854, 1); - else cm.gainItem(4031855, 1); + + if (rolled == 0) { + cm.gainItem(4031853, 1); + } else if (rolled == 1) { + cm.gainItem(4031854, 1); + } else { + cm.gainItem(4031855, 1); + } + } else { + cm.sendOk("You #balready have#k the glasses that was here!"); } - else cm.sendOk("You #balready have#k the glasses that was here!"); - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1094003.js b/scripts/npc/1094003.js index e924dc8ca5..609357451a 100644 --- a/scripts/npc/1094003.js +++ b/scripts/npc/1094003.js @@ -25,25 +25,30 @@ var rolled = 0; -function start(mode, type, selection){ - if(!cm.isQuestStarted(2186)) { +function start(mode, type, selection) { + if (!cm.isQuestStarted(2186)) { cm.sendOk("Just a pile of boxes, nothing special..."); cm.dispose(); return; } - + cm.sendNext("Do you want to obtain a glasses?"); } function action(mode, type, selection) { - if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { + if (!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { rolled = Math.floor(Math.random() * 3); - - if(rolled == 0) cm.gainItem(4031853, 1); - else if(rolled == 1) cm.gainItem(4031854, 1); - else cm.gainItem(4031855, 1); + + if (rolled == 0) { + cm.gainItem(4031853, 1); + } else if (rolled == 1) { + cm.gainItem(4031854, 1); + } else { + cm.gainItem(4031855, 1); + } + } else { + cm.sendOk("You #balready have#k the glasses that was here!"); } - else cm.sendOk("You #balready have#k the glasses that was here!"); - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1094004.js b/scripts/npc/1094004.js index e924dc8ca5..609357451a 100644 --- a/scripts/npc/1094004.js +++ b/scripts/npc/1094004.js @@ -25,25 +25,30 @@ var rolled = 0; -function start(mode, type, selection){ - if(!cm.isQuestStarted(2186)) { +function start(mode, type, selection) { + if (!cm.isQuestStarted(2186)) { cm.sendOk("Just a pile of boxes, nothing special..."); cm.dispose(); return; } - + cm.sendNext("Do you want to obtain a glasses?"); } function action(mode, type, selection) { - if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { + if (!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { rolled = Math.floor(Math.random() * 3); - - if(rolled == 0) cm.gainItem(4031853, 1); - else if(rolled == 1) cm.gainItem(4031854, 1); - else cm.gainItem(4031855, 1); + + if (rolled == 0) { + cm.gainItem(4031853, 1); + } else if (rolled == 1) { + cm.gainItem(4031854, 1); + } else { + cm.gainItem(4031855, 1); + } + } else { + cm.sendOk("You #balready have#k the glasses that was here!"); } - else cm.sendOk("You #balready have#k the glasses that was here!"); - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1094005.js b/scripts/npc/1094005.js index e924dc8ca5..609357451a 100644 --- a/scripts/npc/1094005.js +++ b/scripts/npc/1094005.js @@ -25,25 +25,30 @@ var rolled = 0; -function start(mode, type, selection){ - if(!cm.isQuestStarted(2186)) { +function start(mode, type, selection) { + if (!cm.isQuestStarted(2186)) { cm.sendOk("Just a pile of boxes, nothing special..."); cm.dispose(); return; } - + cm.sendNext("Do you want to obtain a glasses?"); } function action(mode, type, selection) { - if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { + if (!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { rolled = Math.floor(Math.random() * 3); - - if(rolled == 0) cm.gainItem(4031853, 1); - else if(rolled == 1) cm.gainItem(4031854, 1); - else cm.gainItem(4031855, 1); + + if (rolled == 0) { + cm.gainItem(4031853, 1); + } else if (rolled == 1) { + cm.gainItem(4031854, 1); + } else { + cm.gainItem(4031855, 1); + } + } else { + cm.sendOk("You #balready have#k the glasses that was here!"); } - else cm.sendOk("You #balready have#k the glasses that was here!"); - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1094006.js b/scripts/npc/1094006.js index e924dc8ca5..609357451a 100644 --- a/scripts/npc/1094006.js +++ b/scripts/npc/1094006.js @@ -25,25 +25,30 @@ var rolled = 0; -function start(mode, type, selection){ - if(!cm.isQuestStarted(2186)) { +function start(mode, type, selection) { + if (!cm.isQuestStarted(2186)) { cm.sendOk("Just a pile of boxes, nothing special..."); cm.dispose(); return; } - + cm.sendNext("Do you want to obtain a glasses?"); } function action(mode, type, selection) { - if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { + if (!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) { rolled = Math.floor(Math.random() * 3); - - if(rolled == 0) cm.gainItem(4031853, 1); - else if(rolled == 1) cm.gainItem(4031854, 1); - else cm.gainItem(4031855, 1); + + if (rolled == 0) { + cm.gainItem(4031853, 1); + } else if (rolled == 1) { + cm.gainItem(4031854, 1); + } else { + cm.gainItem(4031855, 1); + } + } else { + cm.sendOk("You #balready have#k the glasses that was here!"); } - else cm.sendOk("You #balready have#k the glasses that was here!"); - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1095000.js b/scripts/npc/1095000.js index f458b27de8..a356cf135a 100644 --- a/scripts/npc/1095000.js +++ b/scripts/npc/1095000.js @@ -19,30 +19,31 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendYesNo("#b#p2095000##k must be some way up this cliff, according to our latest reports... Or are you saying you want to #rleave here#k?"); - } else if (status == 1) { - cm.warp(120000104); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("#b#p2095000##k must be some way up this cliff, according to our latest reports... Or are you saying you want to #rleave here#k?"); + } else if (status == 1) { + cm.warp(120000104); + cm.dispose(); + } + } } diff --git a/scripts/npc/1095001.js b/scripts/npc/1095001.js index 98b861088f..85d3bd0654 100644 --- a/scripts/npc/1095001.js +++ b/scripts/npc/1095001.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1095002.js b/scripts/npc/1095002.js index 98b861088f..85d3bd0654 100644 --- a/scripts/npc/1095002.js +++ b/scripts/npc/1095002.js @@ -9,35 +9,35 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status <= 1) { - cm.dispose(); - return; - } - status--; + if (status <= 1) { + cm.dispose(); + return; + } + status--; } if (status == 0) { - if(cm.getLevel() >= 20) { + if (cm.getLevel() >= 20) { cm.sendOk("This training ground is available only for those under level 20."); cm.dispose(); return; } - - var selStr = "Would you like to go into the Training Center?"; - for (var i = 0; i < num; i++) { - selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; - } - cm.sendSimple(selStr); + + var selStr = "Would you like to go into the Training Center?"; + for (var i = 0; i < num; i++) { + selStr += "\r\n#b#L" + i + "#Training Center " + i + " (" + cm.getPlayerCount(map + i) + "/" + maxp + ")#l#k"; + } + cm.sendSimple(selStr); } else if (status == 1) { - if (selection < 0 || selection >= num) { - cm.dispose(); - } else if (cm.getPlayerCount(map + selection) >= maxp) { - cm.sendNext("This training center is full."); - status = -1; - } else { - cm.warp(map + selection, 0); - cm.dispose(); - } + if (selection < 0 || selection >= num) { + cm.dispose(); + } else if (cm.getPlayerCount(map + selection) >= maxp) { + cm.sendNext("This training center is full."); + status = -1; + } else { + cm.warp(map + selection, 0); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1096001.js b/scripts/npc/1096001.js index e33f3d3484..fbf8ed7724 100644 --- a/scripts/npc/1096001.js +++ b/scripts/npc/1096001.js @@ -1,4 +1,4 @@ function start() { - cm.sendOk("Will I ever finish cleaning? This ship is just too big..."); - cm.dispose(); + cm.sendOk("Will I ever finish cleaning? This ship is just too big..."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1096003.js b/scripts/npc/1096003.js index 6e4cdb4b00..0b11cdc692 100644 --- a/scripts/npc/1096003.js +++ b/scripts/npc/1096003.js @@ -1,25 +1,25 @@ var status = -1; function start() { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == 0 && type == 0) { - status--; - } else if (mode == -1) { - cm.dispose(); - return; - } else { - status++; - } - if (status == 0) { - cm.sendDirectionInfo(4, 1096003);//else you will crash sending sendNext - cm.sendDirectionInfo(3, 4); - cm.sendNext("Ook! Ook!"); - cm.showIntro("Effect/Direction4.img/cannonshooter/face00"); - } else if (status == 1) { - cm.unlockUI(); - cm.dispose(); - } + if (mode == 0 && type == 0) { + status--; + } else if (mode == -1) { + cm.dispose(); + return; + } else { + status++; + } + if (status == 0) { + cm.sendDirectionInfo(4, 1096003);//else you will crash sending sendNext + cm.sendDirectionInfo(3, 4); + cm.sendNext("Ook! Ook!"); + cm.showIntro("Effect/Direction4.img/cannonshooter/face00"); + } else if (status == 1) { + cm.unlockUI(); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1096005.js b/scripts/npc/1096005.js index 117a444e68..a5477b91f7 100644 --- a/scripts/npc/1096005.js +++ b/scripts/npc/1096005.js @@ -1,37 +1,37 @@ var status = -1; function start() { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == 0 && type == 0) { - status--; - } else if (mode == -1) { - cm.dispose(); - return; - } else { - status++; - } - if (status == 0) { - cm.sendDirectionInfo(4, 1096005);//else you will crash sending sendNext - cm.sendNext("All right! Let's go!"); - } else if (status == 1) { - cm.removeNPC(579711); - cm.updateInfo("fire", "0"); - cm.playSound("cannonshooter/fire"); - cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/flying/0", 7000, 0, 0, -1, -1); - cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/flying1/0", 7000, 0, 0, -1, -1); - cm.sendDirectionInfo(1, 800); - } else if (status == 2) { - cm.warp(912060300, 0); - } else if (status == 3) { - cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/1", 9000, 0, 0, 0, -1); - cm.sendDirectionInfo(1, 1500); - } else if (status == 4) { - cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/2", 9000, 0, 0, 0, -1); - cm.showIntro("Effect/Direction4.img/cannonshooter/face04"); - cm.showIntro("Effect/Direction4.img/cannonshooter/out01"); - cm.dispose(); - } + if (mode == 0 && type == 0) { + status--; + } else if (mode == -1) { + cm.dispose(); + return; + } else { + status++; + } + if (status == 0) { + cm.sendDirectionInfo(4, 1096005);//else you will crash sending sendNext + cm.sendNext("All right! Let's go!"); + } else if (status == 1) { + cm.removeNPC(579711); + cm.updateInfo("fire", "0"); + cm.playSound("cannonshooter/fire"); + cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/flying/0", 7000, 0, 0, -1, -1); + cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/flying1/0", 7000, 0, 0, -1, -1); + cm.sendDirectionInfo(1, 800); + } else if (status == 2) { + cm.warp(912060300, 0); + } else if (status == 3) { + cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/1", 9000, 0, 0, 0, -1); + cm.sendDirectionInfo(1, 1500); + } else if (status == 4) { + cm.sendDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/2", 9000, 0, 0, 0, -1); + cm.showIntro("Effect/Direction4.img/cannonshooter/face04"); + cm.showIntro("Effect/Direction4.img/cannonshooter/out01"); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/1096010.js b/scripts/npc/1096010.js index cbdcda9ddc..a08f50143d 100644 --- a/scripts/npc/1096010.js +++ b/scripts/npc/1096010.js @@ -1,13 +1,13 @@ function start() { - if (cm.isQuestStarted(2566)) { - if (!cm.haveItem(4032985)) { - if (cm.canHold(4032985)) { - cm.gainItem(4032985, true); - cm.earnTitle("You found the Ignition Device. Bring it to Cutter."); - } - } else { - cm.earnTitle("You already have the Ignition Device."); - } - } - cm.dispose(); + if (cm.isQuestStarted(2566)) { + if (!cm.haveItem(4032985)) { + if (cm.canHold(4032985)) { + cm.gainItem(4032985, true); + cm.earnTitle("You found the Ignition Device. Bring it to Cutter."); + } + } else { + cm.earnTitle("You already have the Ignition Device."); + } + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1100000.js b/scripts/npc/1100000.js index 646e923589..e94dd0f4f4 100644 --- a/scripts/npc/1100000.js +++ b/scripts/npc/1100000.js @@ -1,4 +1,4 @@ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 1100000); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 1100000); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1100003.js b/scripts/npc/1100003.js index 9f82919619..18619e59af 100644 --- a/scripts/npc/1100003.js +++ b/scripts/npc/1100003.js @@ -1,50 +1,50 @@ /** ----------------------------------------------------------------------------------- - Skyferry Between Victoria Island, Ereve and Orbis. + ---------------------------------------------------------------------------------- + Skyferry Between Victoria Island, Ereve and Orbis. - 1100003 Kiriru (To Victoria Island From Ereve) + 1100003 Kiriru (To Victoria Island From Ereve) - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ var menu = new Array("Victoria Island"); var method; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1) { - cm.dispose(); - return; - } else { - if(mode == 0 && status == 0) { - cm.dispose(); - return; - } else if(mode == 0) { - cm.sendNext("If you're not interested, then oh well..."); - cm.dispose(); - return; - } - status++; - if (status == 0) { - var display = ""; - for(var i=0; i < menu.length; i++) { - display += "\r\n#L"+i+"##b Victoria Island (1000 mesos)#k"; - } - cm.sendSimple("Eh, Hello...again. Do you want to leave Ereve and go somewhere else? If so, you've come to the right place. I operate a ferry that goes from #bEreve#k to #bVictoria Island#k, I can take you to #bVictoria Island#k if you want... You'll have to pay a fee of #b1000#k Mesos.\r\n"+display); - } else if(status == 1) { - if(cm.getMeso() < 1000) { - cm.sendNext("Hmm... Are you sure you have #b1000#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); - cm.dispose(); - } else { - cm.gainMeso(-1000); - cm.warp(200090031); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + cm.sendNext("If you're not interested, then oh well..."); + cm.dispose(); + return; + } + status++; + if (status == 0) { + var display = ""; + for (var i = 0; i < menu.length; i++) { + display += "\r\n#L" + i + "##b Victoria Island (1000 mesos)#k"; + } + cm.sendSimple("Eh, Hello...again. Do you want to leave Ereve and go somewhere else? If so, you've come to the right place. I operate a ferry that goes from #bEreve#k to #bVictoria Island#k, I can take you to #bVictoria Island#k if you want... You'll have to pay a fee of #b1000#k Mesos.\r\n" + display); + } else if (status == 1) { + if (cm.getMeso() < 1000) { + cm.sendNext("Hmm... Are you sure you have #b1000#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); + cm.dispose(); + } else { + cm.gainMeso(-1000); + cm.warp(200090031); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/1100004.js b/scripts/npc/1100004.js index 7a7ef2c9c0..648cc91aeb 100644 --- a/scripts/npc/1100004.js +++ b/scripts/npc/1100004.js @@ -1,12 +1,12 @@ /** ----------------------------------------------------------------------------------- - Skyferry Between Victoria Island, Ereve and Orbis. + ---------------------------------------------------------------------------------- + Skyferry Between Victoria Island, Ereve and Orbis. - 1100004 Kiru (To Orbis) + 1100004 Kiru (To Orbis) - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ var menu = new Array("Orbis"); var method; @@ -18,7 +18,7 @@ function start() { function action(mode, type, selection) { if (mode == -1) { cm.dispose(); - return; + } else { if (mode == 0 && status == 0) { cm.dispose(); diff --git a/scripts/npc/1100005.js b/scripts/npc/1100005.js index be67a4de2e..da68f84ed6 100644 --- a/scripts/npc/1100005.js +++ b/scripts/npc/1100005.js @@ -1,14 +1,14 @@ /** ----------------------------------------------------------------------------------- - Skyferry Between Victoria Island, Ereve and Orbis. + ---------------------------------------------------------------------------------- + Skyferry Between Victoria Island, Ereve and Orbis. - 1100005 Kiriru (On boat between Ereve and Victoria Island) + 1100005 Kiriru (On boat between Ereve and Victoria Island) - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ function start() { - cm.sendOk("The weather is so nice. At this rate, we should arrive in no time...."); - cm.dispose(); + cm.sendOk("The weather is so nice. At this rate, we should arrive in no time...."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1100006.js b/scripts/npc/1100006.js index 83b8483296..71b6c113ce 100644 --- a/scripts/npc/1100006.js +++ b/scripts/npc/1100006.js @@ -1,12 +1,12 @@ /** ----------------------------------------------------------------------------------- - Skyferry Between Victoria Island, Ereve and Orbis. + ---------------------------------------------------------------------------------- + Skyferry Between Victoria Island, Ereve and Orbis. - 1100006 Kiru (On boat between Ereve and Orbis) + 1100006 Kiru (On boat between Ereve and Orbis) - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ function start() { cm.sendOk("Ah, such lovely winds. This should be a perfect voyage as long as no stupid customer falls off for attempting some weird skill. Of course, I'm talking about you. Please refrain from using your skills."); diff --git a/scripts/npc/1100007.js b/scripts/npc/1100007.js index b46180efd9..c6c09033e1 100644 --- a/scripts/npc/1100007.js +++ b/scripts/npc/1100007.js @@ -1,51 +1,51 @@ /** ----------------------------------------------------------------------------------- - Skyferry Between Victoria Island, Ereve and Orbis. + ---------------------------------------------------------------------------------- + Skyferry Between Victoria Island, Ereve and Orbis. - 1100007 Kiriru (Victoria Island Station to Ereve) + 1100007 Kiriru (Victoria Island Station to Ereve) - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ var menu = new Array("Ereve"); var method; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1) { - cm.dispose(); - return; - } else { - if(mode == 0 && status == 0) { - cm.dispose(); - return; - } else if(mode == 0) { - cm.sendNext("If you're not interested, then oh well..."); - cm.dispose(); - return; - } - status++; - if (status == 0) { - var display = ""; - for(var i=0; i < menu.length; i++) { - display += "\r\n#L"+i+"##b Ereve (1000 mesos)#k"; - } - cm.sendSimple("Eh... So... Um... Are you trying to leave Victoria to go to a different region? You can take this boat to #bEreve#k. There, you will see bright sunlight shinning on the leaves and feel a gentle breeze on your skin. It's where Shinsoo and Empress Cygnus are. Would you like to go to Ereve? It will take about #b2 Minutes#k, and it will cost you #b1000#k mesos.\r\n"+display); - - } else if(status == 1) { - if(cm.getMeso() < 1000) { - cm.sendNext("Hmm... Are you sure you have #b1000#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); - cm.dispose(); - } else { - cm.gainMeso(-1000); - cm.warp(200090030); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + cm.sendNext("If you're not interested, then oh well..."); + cm.dispose(); + return; + } + status++; + if (status == 0) { + var display = ""; + for (var i = 0; i < menu.length; i++) { + display += "\r\n#L" + i + "##b Ereve (1000 mesos)#k"; + } + cm.sendSimple("Eh... So... Um... Are you trying to leave Victoria to go to a different region? You can take this boat to #bEreve#k. There, you will see bright sunlight shinning on the leaves and feel a gentle breeze on your skin. It's where Shinsoo and Empress Cygnus are. Would you like to go to Ereve? It will take about #b2 Minutes#k, and it will cost you #b1000#k mesos.\r\n" + display); + + } else if (status == 1) { + if (cm.getMeso() < 1000) { + cm.sendNext("Hmm... Are you sure you have #b1000#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); + cm.dispose(); + } else { + cm.gainMeso(-1000); + cm.warp(200090030); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/1100008.js b/scripts/npc/1100008.js index e9aa694db3..14fcd34d56 100644 --- a/scripts/npc/1100008.js +++ b/scripts/npc/1100008.js @@ -1,51 +1,51 @@ /** ----------------------------------------------------------------------------------- - Skyferry Between Victoria Island, Ereve and Orbis. + ---------------------------------------------------------------------------------- + Skyferry Between Victoria Island, Ereve and Orbis. - 1100008 Kiru (Orbis Station) + 1100008 Kiru (Orbis Station) - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ var menu = new Array("Ereve"); var method; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1) { - cm.dispose(); - return; - } else { - if(mode == 0 && status == 0) { - cm.dispose(); - return; - } else if(mode == 0) { - cm.sendNext("OK. If you ever change your mind, please let me know."); - cm.dispose(); - return; - } - status++; - if (status == 0) { - var display = ""; - for(var i=0; i < menu.length; i++) { - display += "\r\n#L"+i+"##b Ereve (1000 mesos)#k"; - } - cm.sendSimple("This ship will head towards #bEreve#k, an island where you'll find crimson leaves soaking up the sun, the gentle breeze that glides past the stream, and the Empress of Maple Cygnus. If you're interested in joining the Cygnus Knights, Then you should definitly pay a visit here. Are you interested in visiting Ereve?, The Trip will cost you #b1000#k Mesos\r\n"+display); + if (mode == -1) { + cm.dispose(); - } else if(status == 1) { - if(cm.getMeso() < 1000) { - cm.sendNext("Hmm... Are you sure you have #b1000#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); - cm.dispose(); - } else { - cm.gainMeso(-1000); - cm.warp(200090020); - cm.dispose(); - } - } + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + cm.sendNext("OK. If you ever change your mind, please let me know."); + cm.dispose(); + return; } + status++; + if (status == 0) { + var display = ""; + for (var i = 0; i < menu.length; i++) { + display += "\r\n#L" + i + "##b Ereve (1000 mesos)#k"; + } + cm.sendSimple("This ship will head towards #bEreve#k, an island where you'll find crimson leaves soaking up the sun, the gentle breeze that glides past the stream, and the Empress of Maple Cygnus. If you're interested in joining the Cygnus Knights, Then you should definitly pay a visit here. Are you interested in visiting Ereve?, The Trip will cost you #b1000#k Mesos\r\n" + display); + + } else if (status == 1) { + if (cm.getMeso() < 1000) { + cm.sendNext("Hmm... Are you sure you have #b1000#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); + cm.dispose(); + } else { + cm.gainMeso(-1000); + cm.warp(200090020); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/1101001.js b/scripts/npc/1101001.js index c9947c92f5..a17a8d8502 100644 --- a/scripts/npc/1101001.js +++ b/scripts/npc/1101001.js @@ -1,7 +1,7 @@ - /* - NPC Name: Divine Bird - Map(s): Erev - Description: 3rd job KoC Buff +/* + NPC Name: Divine Bird + Map(s): Erev + Description: 3rd job KoC Buff */ function start() { @@ -12,6 +12,6 @@ function start() { } else { cm.sendOk("Don't stop training. Every ounce of your energy is required to protect the world of Maple...."); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1101008.js b/scripts/npc/1101008.js index bb59149a5e..d858bb338e 100644 --- a/scripts/npc/1101008.js +++ b/scripts/npc/1101008.js @@ -1,71 +1,72 @@ function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (status == 0 && mode == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if(status == 0){ - cm.sendSimple("Wait! You'll figure the stuff out by the time you reach Lv. 10 anyway, but if you absolutely want to prepare beforehand, you may view the following information.\r\n\r\n Tell me, what would you like to know?\r\n#b#L0#About you#l\r\n#L1#Mini Map#l\r\n#L2#Quest Window#l\r\n#L3#Inventory#l\r\n#L4#Regular Attack Hunting#l\r\n#L5#How to Pick Up Items#l\r\n#L6#How to Equip Items#l\r\n#L7#Skill Window#l\r\n#L8#How to Use Quick Slots#l\r\n#L9#How to Break Boxes#l\r\n#L10#How to Sit in a Chair#l\r\n#L11#World Map#l\r\n#L12#Quest Notifications#l\r\n#L13#Enhancing Stats#l\r\n#L14#Who are the Cygnus Knights?#l"); - } else if(status == 1){ - if(selection == 0){ - cm.sendNext("I serve under Shinsoo, the guardian of Empress Cygnus. My master, Shinsoo, has ordered me to guide everyone who comes to Maple World to join Cygnus Knights. I will be assisting and following you around until you become a Knight or reach Lv. 11. Please let me know if you have any questions."); - } else if(selection == 1){ - cm.guideHint(1); - cm.dispose(); - } else if(selection == 2){ - cm.guideHint(2); - cm.dispose(); - } else if(selection == 3){ - cm.guideHint(3); - cm.dispose(); - } else if(selection == 4){ - cm.guideHint(4); - cm.dispose(); - } else if(selection == 5){ - cm.guideHint(5); - cm.dispose(); - } else if(selection == 6){ - cm.guideHint(6); - cm.dispose(); - } else if(selection == 7){ - cm.guideHint(7); - cm.dispose(); - } else if(selection == 8){ - cm.guideHint(8); - cm.dispose(); - } else if(selection == 9){ - cm.guideHint(9); - cm.dispose(); - } else if(selection == 10){ - cm.guideHint(10); - cm.dispose(); - } else if(selection == 11){ - cm.guideHint(11); - cm.dispose(); - } else if(selection == 12){ - cm.guideHint(12); - cm.dispose(); - } else if(selection == 13){ - cm.guideHint(13); - cm.dispose(); - } else if(selection == 14){ - cm.sendOk("The Black Mage is trying to revive and conquer our peaceful Maple World. As a response to this threat, Empress Cygnus has formed a knighthood, now known as Cygnus Knights. You can become a Knight when you reach Lv. 10."); - cm.dispose(); - } - }else if(status == 2){ - cm.sendNextPrev("There is no need for you to check this info now. These are basics that you'll pick up as you play. You can always ask me questions that come up after you've reached Lv. 10, so just relax."); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (status == 0 && mode == 0) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendSimple("Wait! You'll figure the stuff out by the time you reach Lv. 10 anyway, but if you absolutely want to prepare beforehand, you may view the following information.\r\n\r\n Tell me, what would you like to know?\r\n#b#L0#About you#l\r\n#L1#Mini Map#l\r\n#L2#Quest Window#l\r\n#L3#Inventory#l\r\n#L4#Regular Attack Hunting#l\r\n#L5#How to Pick Up Items#l\r\n#L6#How to Equip Items#l\r\n#L7#Skill Window#l\r\n#L8#How to Use Quick Slots#l\r\n#L9#How to Break Boxes#l\r\n#L10#How to Sit in a Chair#l\r\n#L11#World Map#l\r\n#L12#Quest Notifications#l\r\n#L13#Enhancing Stats#l\r\n#L14#Who are the Cygnus Knights?#l"); + } else if (status == 1) { + if (selection == 0) { + cm.sendNext("I serve under Shinsoo, the guardian of Empress Cygnus. My master, Shinsoo, has ordered me to guide everyone who comes to Maple World to join Cygnus Knights. I will be assisting and following you around until you become a Knight or reach Lv. 11. Please let me know if you have any questions."); + } else if (selection == 1) { + cm.guideHint(1); + cm.dispose(); + } else if (selection == 2) { + cm.guideHint(2); + cm.dispose(); + } else if (selection == 3) { + cm.guideHint(3); + cm.dispose(); + } else if (selection == 4) { + cm.guideHint(4); + cm.dispose(); + } else if (selection == 5) { + cm.guideHint(5); + cm.dispose(); + } else if (selection == 6) { + cm.guideHint(6); + cm.dispose(); + } else if (selection == 7) { + cm.guideHint(7); + cm.dispose(); + } else if (selection == 8) { + cm.guideHint(8); + cm.dispose(); + } else if (selection == 9) { + cm.guideHint(9); + cm.dispose(); + } else if (selection == 10) { + cm.guideHint(10); + cm.dispose(); + } else if (selection == 11) { + cm.guideHint(11); + cm.dispose(); + } else if (selection == 12) { + cm.guideHint(12); + cm.dispose(); + } else if (selection == 13) { + cm.guideHint(13); + cm.dispose(); + } else if (selection == 14) { + cm.sendOk("The Black Mage is trying to revive and conquer our peaceful Maple World. As a response to this threat, Empress Cygnus has formed a knighthood, now known as Cygnus Knights. You can become a Knight when you reach Lv. 10."); + cm.dispose(); + } + } else if (status == 2) { + cm.sendNextPrev("There is no need for you to check this info now. These are basics that you'll pick up as you play. You can always ask me questions that come up after you've reached Lv. 10, so just relax."); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1102001.js b/scripts/npc/1102001.js index 9d90155da5..1bfe85759e 100644 --- a/scripts/npc/1102001.js +++ b/scripts/npc/1102001.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* NPC Base Map Name (Map ID) Extra NPC info. @@ -30,20 +31,21 @@ function start() { } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - cm.sendYesNo("Would you like to exit the drill hall?"); - } else if(status == 1) { - cm.warp(130020000, 0); - cm.dispose(); - } else { - cm.dispose(); - } + cm.sendYesNo("Would you like to exit the drill hall?"); + } else if (status == 1) { + cm.warp(130020000, 0); + cm.dispose(); + } else { + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1102002.js b/scripts/npc/1102002.js index d901e7674a..2240311847 100644 --- a/scripts/npc/1102002.js +++ b/scripts/npc/1102002.js @@ -20,14 +20,14 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Kiridu - Cygnus --- By --------------------------------------------------------------------------------------------- - Ronan --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Ronan ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Kiridu - Cygnus + -- By --------------------------------------------------------------------------------------------- + Ronan + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Ronan + --------------------------------------------------------------------------------------------------- + **/ function start() { cm.sendOk("Yo. I am #p1102002#, in charge of mount raising and training for the Cygnus Knights' of Ereve!"); diff --git a/scripts/npc/1102003.js b/scripts/npc/1102003.js index 6877c2c906..5316dd73a8 100644 --- a/scripts/npc/1102003.js +++ b/scripts/npc/1102003.js @@ -36,12 +36,12 @@ function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (jobType >= minJobType && jobType <= maxJobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { cm.sendOk("Welcome to the Knights Chamber."); @@ -51,15 +51,16 @@ function start() { function action(mode, type, selection) { status++; - if (mode == 0 && type != 1) + if (mode == 0 && type != 1) { status -= 2; - if (status == -1){ + } + if (status == -1) { start(); - return; + } else { - if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -67,16 +68,16 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); - return; + } else { // do nothing } diff --git a/scripts/npc/1103000.js b/scripts/npc/1103000.js index 88c0e59e7d..7d89c6ba12 100644 --- a/scripts/npc/1103000.js +++ b/scripts/npc/1103000.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("I am Advanced Knight #b#p1103000##k. Thanks to your bravery I and all of Ereve have been rescued from the grasps of Eleanor. By the kindness of our Empress, well battled!"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("I am Advanced Knight #b#p1103000##k. Thanks to your bravery I and all of Ereve have been rescued from the grasps of Eleanor. By the kindness of our Empress, well battled!"); + cm.dispose(); + } + } } diff --git a/scripts/npc/1103005.js b/scripts/npc/1103005.js index 980e989ba8..42e4d43daf 100644 --- a/scripts/npc/1103005.js +++ b/scripts/npc/1103005.js @@ -31,14 +31,14 @@ function start() { cm.sendAcceptDecline("Becoming a Knight of Cygnus requires talent, faith, courage, and will power... and it looks like you are more than qualified to become a Knight of Cygnus. What do you think? If you wish to become one right this minute, I'll take you straight to Erev. Would you like to head over to Erev right now?"); } - + function action(coded, by, Moogra) { - if (coded > 0) + if (coded > 0) { cm.warp(130000000); - else { + } else { try { cm.warp(cm.getPlayer().getSavedLocation("CYGNUSINTRO")); - } catch(err) { + } catch (err) { cm.warp(100000000); } } diff --git a/scripts/npc/1104000.js b/scripts/npc/1104000.js index 35e8580d21..0011a68621 100644 --- a/scripts/npc/1104000.js +++ b/scripts/npc/1104000.js @@ -1,28 +1,27 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(status == 0){ - cm.sendNext("What the... you don't belong here!"); - } - else if(status == 1){ - var puppet = cm.getEventManager("Puppeteer"); - puppet.setProperty("player", cm.getPlayer().getName()); - puppet.startInstance(cm.getPlayer()); - cm.dispose(); - return; - } + if (status == 0) { + cm.sendNext("What the... you don't belong here!"); + } else if (status == 1) { + var puppet = cm.getEventManager("Puppeteer"); + puppet.setProperty("player", cm.getPlayer().getName()); + puppet.startInstance(cm.getPlayer()); + cm.dispose(); + + } } \ No newline at end of file diff --git a/scripts/npc/1104002.js b/scripts/npc/1104002.js index 8ec461eb7d..e0dca96db3 100644 --- a/scripts/npc/1104002.js +++ b/scripts/npc/1104002.js @@ -19,45 +19,46 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - var mapobj = cm.getMap(); - - if (mode == 0 && type > 0) { - cm.getPlayer().dropMessage(5, "Eleanor: Oh, lost the Empress and still challenging us? Now you've done it! Prepare yourself!!!"); + if (mode == -1) { + cm.dispose(); + } else { + var mapobj = cm.getMap(); - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - mapobj.spawnMonsterOnGroundBelow(LifeFactory.getMonster(9001010), new Point(850, 0)); - mapobj.destroyNPC(1104002); - - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(!cm.isQuestStarted(20407)) { - cm.sendOk("... Knight, you still #bseem unsure to face this fight#k, don't you? There's no grace in challenging someone when they are still not mentally ready for the battle. Talk your peace to that big clumsy bird of yours, maybe it'll put some guts on you."); - cm.dispose(); - return; - } - - cm.sendAcceptDecline("Hahahahaha! This place's Empress is already under my domain, that's surely a great advance on the #bBlack Wings#k' overthrow towards Maple World... And you, there? Still wants to face us? Or, better yet, since you seem strong enough to be quite a supplementary reinforcement at our service, #rwill you meet our expectations and fancy joining us#k since there's nothing more you can do?"); - } else if (status == 1) { - cm.sendOk("Heh, cowards have no place on the #rBlack Mage's#k army. Begone!"); - cm.dispose(); - } + if (mode == 0 && type > 0) { + cm.getPlayer().dropMessage(5, "Eleanor: Oh, lost the Empress and still challenging us? Now you've done it! Prepare yourself!!!"); + + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + mapobj.spawnMonsterOnGroundBelow(LifeFactory.getMonster(9001010), new Point(850, 0)); + mapobj.destroyNPC(1104002); + + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!cm.isQuestStarted(20407)) { + cm.sendOk("... Knight, you still #bseem unsure to face this fight#k, don't you? There's no grace in challenging someone when they are still not mentally ready for the battle. Talk your peace to that big clumsy bird of yours, maybe it'll put some guts on you."); + cm.dispose(); + return; + } + + cm.sendAcceptDecline("Hahahahaha! This place's Empress is already under my domain, that's surely a great advance on the #bBlack Wings#k' overthrow towards Maple World... And you, there? Still wants to face us? Or, better yet, since you seem strong enough to be quite a supplementary reinforcement at our service, #rwill you meet our expectations and fancy joining us#k since there's nothing more you can do?"); + } else if (status == 1) { + cm.sendOk("Heh, cowards have no place on the #rBlack Mage's#k army. Begone!"); + cm.dispose(); + } + } } diff --git a/scripts/npc/1104100.js b/scripts/npc/1104100.js index 01483a6148..5ae4dd14e0 100644 --- a/scripts/npc/1104100.js +++ b/scripts/npc/1104100.js @@ -21,50 +21,52 @@ var npcid = 1104100; var baseJob = 11; var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(Math.floor(cm.getJobId() / 100) != baseJob) { - cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); - cm.dispose(); - return; - } - - cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); - } else if(status == 1) { - var mapobj = cm.getMap(); - var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); - - spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); - mapobj.destroyNPC(npcid); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (Math.floor(cm.getJobId() / 100) != baseJob) { + cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); + cm.dispose(); + return; + } + + cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); + } else if (status == 1) { + var mapobj = cm.getMap(); + var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); + + spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); + mapobj.destroyNPC(npcid); + cm.dispose(); + } + } } function spawnMob(x, y, id, map) { - if(map.getMonsterById(id) != null) - return; + if (map.getMonsterById(id) != null) { + return; + } - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - var mob = LifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + var mob = LifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104101.js b/scripts/npc/1104101.js index ee9ee252df..4d998dee11 100644 --- a/scripts/npc/1104101.js +++ b/scripts/npc/1104101.js @@ -21,50 +21,52 @@ var npcid = 1104101; var baseJob = 12; var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(Math.floor(cm.getJobId() / 100) != baseJob) { - cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); - cm.dispose(); - return; - } - - cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); - } else if(status == 1) { - var mapobj = cm.getMap(); - var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); - - spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); - mapobj.destroyNPC(npcid); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (Math.floor(cm.getJobId() / 100) != baseJob) { + cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); + cm.dispose(); + return; + } + + cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); + } else if (status == 1) { + var mapobj = cm.getMap(); + var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); + + spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); + mapobj.destroyNPC(npcid); + cm.dispose(); + } + } } function spawnMob(x, y, id, map) { - if(map.getMonsterById(id) != null) - return; + if (map.getMonsterById(id) != null) { + return; + } - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - var mob = LifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + var mob = LifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104102.js b/scripts/npc/1104102.js index 81f249e484..e7fe742834 100644 --- a/scripts/npc/1104102.js +++ b/scripts/npc/1104102.js @@ -21,50 +21,52 @@ var npcid = 1104102; var baseJob = 13; var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(Math.floor(cm.getJobId() / 100) != baseJob) { - cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); - cm.dispose(); - return; - } - - cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); - } else if(status == 1) { - var mapobj = cm.getMap(); - var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); - - spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); - mapobj.destroyNPC(npcid); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (Math.floor(cm.getJobId() / 100) != baseJob) { + cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); + cm.dispose(); + return; + } + + cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); + } else if (status == 1) { + var mapobj = cm.getMap(); + var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); + + spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); + mapobj.destroyNPC(npcid); + cm.dispose(); + } + } } function spawnMob(x, y, id, map) { - if(map.getMonsterById(id) != null) - return; + if (map.getMonsterById(id) != null) { + return; + } - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - var mob = LifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + var mob = LifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104103.js b/scripts/npc/1104103.js index 5cfb08437f..aa41702cf5 100644 --- a/scripts/npc/1104103.js +++ b/scripts/npc/1104103.js @@ -21,50 +21,52 @@ var npcid = 1104103; var baseJob = 14; var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(Math.floor(cm.getJobId() / 100) != baseJob) { - cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); - cm.dispose(); - return; - } - - cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); - } else if(status == 1) { - var mapobj = cm.getMap(); - var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); - - spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); - mapobj.destroyNPC(npcid); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (Math.floor(cm.getJobId() / 100) != baseJob) { + cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); + cm.dispose(); + return; + } + + cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); + } else if (status == 1) { + var mapobj = cm.getMap(); + var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); + + spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); + mapobj.destroyNPC(npcid); + cm.dispose(); + } + } } function spawnMob(x, y, id, map) { - if(map.getMonsterById(id) != null) - return; + if (map.getMonsterById(id) != null) { + return; + } - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - var mob = LifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + var mob = LifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104104.js b/scripts/npc/1104104.js index 129ab86998..5eaf9b5dbc 100644 --- a/scripts/npc/1104104.js +++ b/scripts/npc/1104104.js @@ -21,50 +21,52 @@ var npcid = 1104104; var baseJob = 15; var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(Math.floor(cm.getJobId() / 100) != baseJob) { - cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); - cm.dispose(); - return; - } - - cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); - } else if(status == 1) { - var mapobj = cm.getMap(); - var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); - - spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); - mapobj.destroyNPC(npcid); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (Math.floor(cm.getJobId() / 100) != baseJob) { + cm.sendOk("Hello there, #h0#. Are you helping us finding the intruder? He is not in this area, I've already searched here."); + cm.dispose(); + return; + } + + cm.sendOk("Darn, you found me! Then, there's only one way out! Let's fight, like #rBlack Wings#k should!"); + } else if (status == 1) { + var mapobj = cm.getMap(); + var npcpos = mapobj.getMapObject(cm.getNpcObjectId()).getPosition(); + + spawnMob(npcpos.x, npcpos.y, 9001009, mapobj); + mapobj.destroyNPC(npcid); + cm.dispose(); + } + } } function spawnMob(x, y, id, map) { - if(map.getMonsterById(id) != null) - return; + if (map.getMonsterById(id) != null) { + return; + } - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - var mob = LifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + var mob = LifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/1104200.js b/scripts/npc/1104200.js index 4f9ca3b2f3..5fc4e9bcea 100644 --- a/scripts/npc/1104200.js +++ b/scripts/npc/1104200.js @@ -19,37 +19,38 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendNext("#b#p1104002##k... The black witch... Trapped me here... There's no time now, she's already on her way to #rattack Ereve#k!"); - } else if (status == 1) { - cm.sendYesNo("Fellow Knight, you must reach to #rEreve#k right now, #rthe Empress is in danger#k!! Even in this condition, I can still Magic Warp you there. When you're ready talk to me. #bAre you ready to face Eleanor?#k"); - } else if (status == 2) { - if(cm.getWarpMap(913030000).countPlayers() == 0) { - cm.warp(913030000, 0); - } else { - cm.sendOk("There's someone already challenging her. Please wait awhile."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendNext("#b#p1104002##k... The black witch... Trapped me here... There's no time now, she's already on her way to #rattack Ereve#k!"); + } else if (status == 1) { + cm.sendYesNo("Fellow Knight, you must reach to #rEreve#k right now, #rthe Empress is in danger#k!! Even in this condition, I can still Magic Warp you there. When you're ready talk to me. #bAre you ready to face Eleanor?#k"); + } else if (status == 2) { + if (cm.getWarpMap(913030000).countPlayers() == 0) { + cm.warp(913030000, 0); + } else { + cm.sendOk("There's someone already challenging her. Please wait awhile."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1104201.js b/scripts/npc/1104201.js index ee2f89b0ca..47c0801548 100644 --- a/scripts/npc/1104201.js +++ b/scripts/npc/1104201.js @@ -19,34 +19,35 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (!(cm.isQuestCompleted(20407) || cm.isQuestStarted(20407) && cm.getQuestProgressInt(20407, 9001010) != 0) && cm.getMap().countMonster(9001010) == 0 && cm.getMap().getNPCById(1104002) == null) { - cm.sendOk("... Hnngh... #b#h0##k, is that you...? #r#p1104002##k... She's already here... #b#h0##k, I'm truly sorry I can't help you right now in this state, just when a bigger threat appeared I could do nothing for my people.... Please I beg you, please defeat her, #b#h0##k!! ...."); - cm.spawnNpc(1104002, new java.awt.Point(850, 0), cm.getMap()); - } else { - cm.sendOk("..."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!(cm.isQuestCompleted(20407) || cm.isQuestStarted(20407) && cm.getQuestProgressInt(20407, 9001010) != 0) && cm.getMap().countMonster(9001010) == 0 && cm.getMap().getNPCById(1104002) == null) { + cm.sendOk("... Hnngh... #b#h0##k, is that you...? #r#p1104002##k... She's already here... #b#h0##k, I'm truly sorry I can't help you right now in this state, just when a bigger threat appeared I could do nothing for my people.... Please I beg you, please defeat her, #b#h0##k!! ...."); + cm.spawnNpc(1104002, new java.awt.Point(850, 0), cm.getMap()); + } else { + cm.sendOk("..."); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/1104202.js b/scripts/npc/1104202.js index 1171ff2387..a404e89d4b 100644 --- a/scripts/npc/1104202.js +++ b/scripts/npc/1104202.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1104203.js b/scripts/npc/1104203.js index 1171ff2387..a404e89d4b 100644 --- a/scripts/npc/1104203.js +++ b/scripts/npc/1104203.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1104204.js b/scripts/npc/1104204.js index 1171ff2387..a404e89d4b 100644 --- a/scripts/npc/1104204.js +++ b/scripts/npc/1104204.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1104205.js b/scripts/npc/1104205.js index 1171ff2387..a404e89d4b 100644 --- a/scripts/npc/1104205.js +++ b/scripts/npc/1104205.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1104206.js b/scripts/npc/1104206.js index 1171ff2387..a404e89d4b 100644 --- a/scripts/npc/1104206.js +++ b/scripts/npc/1104206.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1104207.js b/scripts/npc/1104207.js index 1171ff2387..a404e89d4b 100644 --- a/scripts/npc/1104207.js +++ b/scripts/npc/1104207.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/1200000.js b/scripts/npc/1200000.js index 5d3c5aead7..140182be7b 100644 --- a/scripts/npc/1200000.js +++ b/scripts/npc/1200000.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* =========================================================== @author Resonance NPC Name: Pusla diff --git a/scripts/npc/1200003.js b/scripts/npc/1200003.js index 5c283fbcd6..0199ae81b9 100644 --- a/scripts/npc/1200003.js +++ b/scripts/npc/1200003.js @@ -1,52 +1,52 @@ /** ----------------------------------------------------------------------------------- - Whale Between Lith harbor and Rien. + ---------------------------------------------------------------------------------- + Whale Between Lith harbor and Rien. - 1200003 Puro + 1200003 Puro - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ var menu = new Array("Lith Harboor"); var method; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1) { - cm.dispose(); - return; - } else { - if(mode == 0 && status == 0) { - cm.dispose(); - return; - } else if(mode == 0) { - cm.sendNext("OK. If you ever change your mind, please let me know."); - cm.dispose(); - return; - } - status++; - if (status == 0) { - var display = ""; - for(var i=0; i < menu.length; i++) { - display += "\r\n#L"+i+"##b Lith Harbor (800 mesos)#k"; - } - cm.sendSimple("Are you trying to leave Rien? Board this ship and I'll take you from #bRien#k to #bLith Harbor#k and back. for a #bfee of 800#k Mesos. Would you like to head over to Lith Harbor now? It'll take about a minute to get there.\r\n"+display); - - } else if(status == 1) { - if(cm.getMeso() < 800) { - cm.sendNext("Hmm... Are you sure you have #b800#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); - cm.dispose(); - } else { - cm.gainMeso(-800); - cm.warp(200090070); - cm.dispose(); - } - - } + if (mode == -1) { + cm.dispose(); + + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + cm.sendNext("OK. If you ever change your mind, please let me know."); + cm.dispose(); + return; } + status++; + if (status == 0) { + var display = ""; + for (var i = 0; i < menu.length; i++) { + display += "\r\n#L" + i + "##b Lith Harbor (800 mesos)#k"; + } + cm.sendSimple("Are you trying to leave Rien? Board this ship and I'll take you from #bRien#k to #bLith Harbor#k and back. for a #bfee of 800#k Mesos. Would you like to head over to Lith Harbor now? It'll take about a minute to get there.\r\n" + display); + + } else if (status == 1) { + if (cm.getMeso() < 800) { + cm.sendNext("Hmm... Are you sure you have #b800#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); + cm.dispose(); + } else { + cm.gainMeso(-800); + cm.warp(200090070); + cm.dispose(); + } + + } + } } \ No newline at end of file diff --git a/scripts/npc/1200004.js b/scripts/npc/1200004.js index 3a07a5354f..a035bf8b9a 100644 --- a/scripts/npc/1200004.js +++ b/scripts/npc/1200004.js @@ -1,51 +1,51 @@ /** ----------------------------------------------------------------------------------- - Whale Between Lith harbor and Rien. + ---------------------------------------------------------------------------------- + Whale Between Lith harbor and Rien. - 1200004 Puro + 1200004 Puro - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ var menu = new Array("Rien"); var method; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1) { - cm.dispose(); - return; - } else { - if(mode == 0 && status == 0) { - cm.dispose(); - return; - } else if(mode == 0) { - cm.sendNext("OK. If you ever change your mind, please let me know."); - cm.dispose(); - return; - } - status++; - if (status == 0) { - var display = ""; - for(var i=0; i < menu.length; i++) { - display += "\r\n#L"+i+"##b Rien (800 mesos)#k"; - } - cm.sendSimple("Are you thinking about leaving Victoria Island and heading to our town? If you board this ship, I can take you from #bLith Harbor#k to #bRien#k and back. But you must pay a #bfee of 800#k Mesos. Would you like to go to Rien? It'll take about a minute to get there.\r\n"+display); - - } else if(status == 1) { - if(cm.getMeso() < 800) { - cm.sendNext("Hmm... Are you sure you have #b800#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); - cm.dispose(); - } else { - cm.gainMeso(-800); - cm.warp(200090060); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + cm.sendNext("OK. If you ever change your mind, please let me know."); + cm.dispose(); + return; } + status++; + if (status == 0) { + var display = ""; + for (var i = 0; i < menu.length; i++) { + display += "\r\n#L" + i + "##b Rien (800 mesos)#k"; + } + cm.sendSimple("Are you thinking about leaving Victoria Island and heading to our town? If you board this ship, I can take you from #bLith Harbor#k to #bRien#k and back. But you must pay a #bfee of 800#k Mesos. Would you like to go to Rien? It'll take about a minute to get there.\r\n" + display); + + } else if (status == 1) { + if (cm.getMeso() < 800) { + cm.sendNext("Hmm... Are you sure you have #b800#k Mesos? Check your Inventory and make sure you have enough. You must pay the fee or I can't let you get on..."); + cm.dispose(); + } else { + cm.gainMeso(-800); + cm.warp(200090060); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/1200005.js b/scripts/npc/1200005.js index 14d9630047..f305163b71 100644 --- a/scripts/npc/1200005.js +++ b/scripts/npc/1200005.js @@ -1,14 +1,14 @@ /** ----------------------------------------------------------------------------------- - Whale Between Lith harbor and Rien. + ---------------------------------------------------------------------------------- + Whale Between Lith harbor and Rien. - 1200005 Puro + 1200005 Puro - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ function start() { - cm.sendOk("Ahhhh, this is so boring... The whale is controlling the ship so i'm left with nothing to do but look up and stare at the clouds."); - cm.dispose() + cm.sendOk("Ahhhh, this is so boring... The whale is controlling the ship so i'm left with nothing to do but look up and stare at the clouds."); + cm.dispose() } \ No newline at end of file diff --git a/scripts/npc/1200006.js b/scripts/npc/1200006.js index 179d9c7f60..8de37e85e5 100644 --- a/scripts/npc/1200006.js +++ b/scripts/npc/1200006.js @@ -1,12 +1,12 @@ /** ----------------------------------------------------------------------------------- - Whale Between Lith harbor and Rien. + ---------------------------------------------------------------------------------- + Whale Between Lith harbor and Rien. - 1200006 Puro + 1200006 Puro - Credits to: MapleSanta ----------------------------------------------------------------------------------- -**/ + Credits to: MapleSanta + ---------------------------------------------------------------------------------- + **/ function start() { cm.sendOk("The current is serene, wich means we may arive in lith harbor earlier than expected."); diff --git a/scripts/npc/1202000.js b/scripts/npc/1202000.js index b655abd1e1..b23c2f8266 100644 --- a/scripts/npc/1202000.js +++ b/scripts/npc/1202000.js @@ -23,92 +23,93 @@ var status = -1; function start() { - action(1, 0, 0); + action(1, 0, 0); } -function action(mode, type, selection) { - if (mode == -1) { +function action(mode, type, selection) { + if (mode == -1) { cm.dispose(); - } else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - if(cm.getPlayer().getMapId() == 140090000) { - if (!cm.containsAreaInfo(21019, "helper=clear")) { - if (status == 0) { - cm.sendNext("You've finally awoken...!", 8); - } else if (status == 1) { - cm.sendNextPrev("And you are...?", 2); - } else if (status == 2) { - cm.sendNextPrev("The hero who fought against the Black Mage... I've been waiting for you to wake up!", 8); - } else if (status == 3) { - cm.sendNextPrev("Who... Who are you? And what are you talking about?", 2); - } else if (status == 4) { - cm.sendNextPrev("And who am I...? I can't remember anything... Ouch, my head hurts!", 2); - } else if (status == 5) { - cm.showIntro("Effect/Direction1.img/aranTutorial/face"); - cm.showIntro("Effect/Direction1.img/aranTutorial/ClickLilin"); - cm.updateAreaInfo(21019, "helper=clear"); - cm.dispose(); - } - } else { - if (status == 0) { - cm.sendNextPrev("Are you alright?", 8); - } else if (status == 1) { - cm.sendNextPrev("I can't remember anything. Where am I? And who are you...?", 2); - } else if (status == 2) { - cm.sendNextPrev("Stay calm. There is no need to panic. You can't remember anything because the curse of the Black Mage erased your memory. I'll tell you everything you need to know...step by step.", 8); - } else if (status == 3) { - cm.sendNextPrev("You're a hero who fought the Black Mage and saved Maple World hundreds of years ago. But at the very last moment, the curse of the Black Mage put you to sleep for a long, long time. That's when you lost all of your memories.", 8); - } else if (status == 4) { - cm.sendNextPrev("This island is called Rien, and it's where the Black Mage trapped you. Despite its name, this island is always covered in ice and snow because of the Black Mage's curse. You were found deep inside the Ice Cave.", 8); - } else if (status == 5) { - cm.sendNextPrev("My name is Lilin and I belong to the clan of Rien. The Rien Clan has been waiting for a hero to return for a long time now, and we finally found you. You've finally returned!", 8); - } else if (status == 6) { - cm.sendNextPrev("I've said too much. It's okay if you don't really understand everything I just told you. You'll get it eventually. For now, #byou should head to town#k. I'll stay by your side and help you until you get there.", 8); - } else if (status == 7) { - cm.spawnGuide(); - cm.warp(140090100, 0); - cm.dispose(); - } - } - } else { - if (status == 0) - cm.sendSimple("Is there anything you're still curious about? If so, I'll try to explain it better. #b#l\r\n#L0#Who am I? #l #l\r\n#L1#Where am I? #l #l\r\n#L2#Who are you?#l#l\r\n#L3#Tell me what I have to do.#l #l\r\n#L4#Tell me about my Inventory.#l #l\r\n#L5#How do I advance my skills?#l #l\r\n#L6#I want to know how to equip items.#l #l\r\n#L7#How do I use quick slots? #l #l\r\n#L8#How can I open breakable containers?#l #l\r\n#L9#I want to sit in a chair but I forgot how.#l#k"); - else if (status == 1) { - if (selection == 0) { - cm.sendNext("You are one of the heroes that saved Maple World from the Black Mage hundreds of years ago. You've lost your memory due to the curse of the Black Mage."); - cm.dispose(); - } else if (selection == 1) { - cm.sendNext("This island is called Rien, and this is where the Black Mage's curse put you to sleep. It's a small island covered in ice and snow, and the majority of the residents are Penguins."); - cm.dispose(); - } else if(selection == 2) { - cm.sendNext("I'm Lilin, a clan member of Rien, and I've been waiting for your return as the prophecy foretold. I'll be your guide for now."); - cm.dispose(); - } else if(selection == 3) { - cm.sendNext("Let's not waste any more time and just get to town. I'll give you the details when we get there."); - cm.dispose(); - } else if(selection == 4) { - cm.guideHint(14); - cm.dispose(); - } else if(selection == 5) { - cm.guideHint(15); - cm.dispose(); - } else if(selection == 6) { - cm.guideHint(16); - cm.dispose(); - } else if(selection == 7) { - cm.guideHint(17); - cm.dispose(); - } else if(selection == 8) { - cm.guideHint(18); - cm.dispose(); - } else if(selection == 9) { - cm.guideHint(19); - cm.dispose(); - } - } - } -} + } + if (cm.getPlayer().getMapId() == 140090000) { + if (!cm.containsAreaInfo(21019, "helper=clear")) { + if (status == 0) { + cm.sendNext("You've finally awoken...!", 8); + } else if (status == 1) { + cm.sendNextPrev("And you are...?", 2); + } else if (status == 2) { + cm.sendNextPrev("The hero who fought against the Black Mage... I've been waiting for you to wake up!", 8); + } else if (status == 3) { + cm.sendNextPrev("Who... Who are you? And what are you talking about?", 2); + } else if (status == 4) { + cm.sendNextPrev("And who am I...? I can't remember anything... Ouch, my head hurts!", 2); + } else if (status == 5) { + cm.showIntro("Effect/Direction1.img/aranTutorial/face"); + cm.showIntro("Effect/Direction1.img/aranTutorial/ClickLilin"); + cm.updateAreaInfo(21019, "helper=clear"); + cm.dispose(); + } + } else { + if (status == 0) { + cm.sendNextPrev("Are you alright?", 8); + } else if (status == 1) { + cm.sendNextPrev("I can't remember anything. Where am I? And who are you...?", 2); + } else if (status == 2) { + cm.sendNextPrev("Stay calm. There is no need to panic. You can't remember anything because the curse of the Black Mage erased your memory. I'll tell you everything you need to know...step by step.", 8); + } else if (status == 3) { + cm.sendNextPrev("You're a hero who fought the Black Mage and saved Maple World hundreds of years ago. But at the very last moment, the curse of the Black Mage put you to sleep for a long, long time. That's when you lost all of your memories.", 8); + } else if (status == 4) { + cm.sendNextPrev("This island is called Rien, and it's where the Black Mage trapped you. Despite its name, this island is always covered in ice and snow because of the Black Mage's curse. You were found deep inside the Ice Cave.", 8); + } else if (status == 5) { + cm.sendNextPrev("My name is Lilin and I belong to the clan of Rien. The Rien Clan has been waiting for a hero to return for a long time now, and we finally found you. You've finally returned!", 8); + } else if (status == 6) { + cm.sendNextPrev("I've said too much. It's okay if you don't really understand everything I just told you. You'll get it eventually. For now, #byou should head to town#k. I'll stay by your side and help you until you get there.", 8); + } else if (status == 7) { + cm.spawnGuide(); + cm.warp(140090100, 0); + cm.dispose(); + } + } + } else { + if (status == 0) { + cm.sendSimple("Is there anything you're still curious about? If so, I'll try to explain it better. #b#l\r\n#L0#Who am I? #l #l\r\n#L1#Where am I? #l #l\r\n#L2#Who are you?#l#l\r\n#L3#Tell me what I have to do.#l #l\r\n#L4#Tell me about my Inventory.#l #l\r\n#L5#How do I advance my skills?#l #l\r\n#L6#I want to know how to equip items.#l #l\r\n#L7#How do I use quick slots? #l #l\r\n#L8#How can I open breakable containers?#l #l\r\n#L9#I want to sit in a chair but I forgot how.#l#k"); + } else if (status == 1) { + if (selection == 0) { + cm.sendNext("You are one of the heroes that saved Maple World from the Black Mage hundreds of years ago. You've lost your memory due to the curse of the Black Mage."); + cm.dispose(); + } else if (selection == 1) { + cm.sendNext("This island is called Rien, and this is where the Black Mage's curse put you to sleep. It's a small island covered in ice and snow, and the majority of the residents are Penguins."); + cm.dispose(); + } else if (selection == 2) { + cm.sendNext("I'm Lilin, a clan member of Rien, and I've been waiting for your return as the prophecy foretold. I'll be your guide for now."); + cm.dispose(); + } else if (selection == 3) { + cm.sendNext("Let's not waste any more time and just get to town. I'll give you the details when we get there."); + cm.dispose(); + } else if (selection == 4) { + cm.guideHint(14); + cm.dispose(); + } else if (selection == 5) { + cm.guideHint(15); + cm.dispose(); + } else if (selection == 6) { + cm.guideHint(16); + cm.dispose(); + } else if (selection == 7) { + cm.guideHint(17); + cm.dispose(); + } else if (selection == 8) { + cm.guideHint(18); + cm.dispose(); + } else if (selection == 9) { + cm.guideHint(19); + cm.dispose(); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/1202009.js b/scripts/npc/1202009.js index 45f13cf2fe..5efa63f428 100644 --- a/scripts/npc/1202009.js +++ b/scripts/npc/1202009.js @@ -6,11 +6,11 @@ function start() { } function action(mode, type, selection) { - if(cm.haveItemWithId(1902016, true)) { + if (cm.haveItemWithId(1902016, true)) { cm.warp(140010210, 0); } else { cm.sendOk("What is it? If you you're here to waste my time, get lost!"); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/1202010.js b/scripts/npc/1202010.js index 7aa4b62473..9b8365bc53 100644 --- a/scripts/npc/1202010.js +++ b/scripts/npc/1202010.js @@ -8,12 +8,12 @@ function start() { const GameConstants = Java.type('constants.game.GameConstants'); if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(GameConstants.getHallOfFameMapid(cm.getJob()))) { spawnPnpc = true; - + var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?"; - if(spawnPnpcFee > 0) { + if (spawnPnpcFee > 0) { sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k"; } - + cm.sendYesNo(sendStr); } else { cm.sendOk("Behold, the distinguished brave heroes of Rien! Those stout hearts are who have been protecting our people since long ago, our valiant comrades."); @@ -23,15 +23,16 @@ function start() { function action(mode, type, selection) { status++; - if (mode == 0 && type != 1) + if (mode == 0 && type != 1) { status -= 2; - if (status == -1){ + } + if (status == -1) { start(); - return; + } else { - if(spawnPnpc) { - if(mode > 0) { - if(cm.getMeso() < spawnPnpcFee) { + if (spawnPnpc) { + if (mode > 0) { + if (cm.getMeso() < spawnPnpcFee) { cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame."); cm.dispose(); return; @@ -39,16 +40,16 @@ function action(mode, type, selection) { const PlayerNPC = Java.type('server.life.PlayerNPC'); const GameConstants = Java.type('constants.game.GameConstants'); - if(PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { + if (PlayerNPC.spawnPlayerNPC(GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) { cm.sendOk("There you go! Hope you will like it."); cm.gainMeso(-spawnPnpcFee); } else { cm.sendOk("Sorry, the Hall of Fame is currently full..."); } } - + cm.dispose(); - return; + } else { // do nothing } diff --git a/scripts/npc/1204001.js b/scripts/npc/1204001.js index 7bf372d445..08876ee359 100644 --- a/scripts/npc/1204001.js +++ b/scripts/npc/1204001.js @@ -10,20 +10,20 @@ function start() { } function action(mode, type, selection) { - if(mode == -1 || mode == 0 && type > 0) { + if (mode == -1 || mode == 0 && type > 0) { cm.dispose(); return; } - + if (mode == 1) { - status++; + status++; } else { - status--; + status--; } if (status == 0) { - cm.sendNext("I'm Francis, the Puppeteer of the Black Wings. How dare you disturb my puppets... It really upsets me, but I'll let it slide this time. If I catch you doing it again though, I swear in the name of the Black Mage, I will make you pay for it.", 9); + cm.sendNext("I'm Francis, the Puppeteer of the Black Wings. How dare you disturb my puppets... It really upsets me, but I'll let it slide this time. If I catch you doing it again though, I swear in the name of the Black Mage, I will make you pay for it.", 9); } else if (status == 1) { - cm.sendNextPrev("#b(The Black Wings? Huh? Who are they? And how is all this related to the Black Mage? Hm, maybe you should report this info to Tru.)#k", 3); + cm.sendNextPrev("#b(The Black Wings? Huh? Who are they? And how is all this related to the Black Mage? Hm, maybe you should report this info to Tru.)#k", 3); } else if (status == 2) { cm.completeQuest(21719); cm.warp(105040200, 10);//104000004 diff --git a/scripts/npc/1209000.js b/scripts/npc/1209000.js index 1856337261..5a38e70881 100644 --- a/scripts/npc/1209000.js +++ b/scripts/npc/1209000.js @@ -26,28 +26,28 @@ function start() { } function action(mode, type, selection) { - if (mode == 0 && type == 0) { - status--; - } else if (mode == -1) { - cm.dispose(); - return; - } else { - status++; - } + if (mode == 0 && type == 0) { + status--; + } else if (mode == -1) { + cm.dispose(); + return; + } else { + status++; + } if (mode == 1) { status++; } else { status--; - } - if (status == 0) { - cm.sendNext("Aran, you're awake! How are you feeling? Hm? You want to know what's been going on?"); - } else if (status == 1) { - cm.sendNext("We're almost done preparing for the escape. You don't have to worry. Everyone I could possibly find has boarded the ark, and Shinsoo has agreed to guide the way. We'll head to Victoria Island as soon as we finish the remaining preparations."); - } else if (status == 2) { - cm.sendNext("The other heroes? They've left to fight the Black Mage. They're buying us time to escape. What? You want to fight with them? No! You can't! You're hurt. You must leave with us!"); - } else if (status == 3) { - //cm.setQuestProgress(21002, 1); - cm.showIntro("Effect/Direction1.img/aranTutorial/Trio"); - cm.dispose(); - } + } + if (status == 0) { + cm.sendNext("Aran, you're awake! How are you feeling? Hm? You want to know what's been going on?"); + } else if (status == 1) { + cm.sendNext("We're almost done preparing for the escape. You don't have to worry. Everyone I could possibly find has boarded the ark, and Shinsoo has agreed to guide the way. We'll head to Victoria Island as soon as we finish the remaining preparations."); + } else if (status == 2) { + cm.sendNext("The other heroes? They've left to fight the Black Mage. They're buying us time to escape. What? You want to fight with them? No! You can't! You're hurt. You must leave with us!"); + } else if (status == 3) { + //cm.setQuestProgress(21002, 1); + cm.showIntro("Effect/Direction1.img/aranTutorial/Trio"); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/12101.js b/scripts/npc/12101.js index 0e2dfe2bbf..5adf92ca02 100644 --- a/scripts/npc/12101.js +++ b/scripts/npc/12101.js @@ -32,20 +32,22 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0 && status == 2){ + if (mode != 1) { + if (mode == 0 && status == 2) { status -= 2; start(); - }else if(mode == 0) - status-= 2; - else + } else if (mode == 0) { + status -= 2; + } else { cm.dispose(); - }else{ - if (status == 1) + } + } else { + if (status == 1) { cm.sendNextPrev("If you want to get stronger, then go to #bSouthperry#k where there's a harbor. Ride on the gigantic ship and head to the place called #bVictoria Island#k. It's incomparable in size compared to this tiny island."); - else if (status == 2) + } else if (status == 2) { cm.sendPrev("At the Victoria Island, you can choose your job. Is it called #bPerion#k...? I heard there's a bare, desolate town where warriors live. A highland...what kind of a place would that be?"); - else if (status == 3) + } else if (status == 3) { cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/1300001.js b/scripts/npc/1300001.js index 9a81a3eb4b..566c29a570 100644 --- a/scripts/npc/1300001.js +++ b/scripts/npc/1300001.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Let the ceremony begins, we cannot let the masses waiting! Hem~hem~heeh~~"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Let the ceremony begins, we cannot let the masses waiting! Hem~hem~heeh~~"); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1300006.js b/scripts/npc/1300006.js index 2e6a5b0ea0..3041454be2 100644 --- a/scripts/npc/1300006.js +++ b/scripts/npc/1300006.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Hey guys, what's going on? I'm already getting married at this age? But I'm only a child!!! How comes?"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Hey guys, what's going on? I'm already getting married at this age? But I'm only a child!!! How comes?"); + cm.dispose(); + } + } } diff --git a/scripts/npc/1300012.js b/scripts/npc/1300012.js index 500b1fe35d..7bb96e9166 100644 --- a/scripts/npc/1300012.js +++ b/scripts/npc/1300012.js @@ -19,27 +19,28 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/1300013.js b/scripts/npc/1300013.js index 56a7be723b..19a7398cff 100644 --- a/scripts/npc/1300013.js +++ b/scripts/npc/1300013.js @@ -5,80 +5,75 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1){ - cm.dispose(); - return; - } - else if(mode == 0 && status == 0){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + return; + } else if (mode == 0 && status == 0) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(cm.getMapId() == 106021402) { - if (!(cm.isQuestCompleted(2331))) { - cm.dispose(); - return; - } - - if(status == 0){ - cm.sendSimple("#L0#Enter to fight #bKing Pepe#k and #bYeti Brothers#k.#l\r\n#L1#Enter to fight #bPrime Minister#k.#l"); - } - else if(status == 1){ - if(selection == 0){ - var pepe = cm.getEventManager("KingPepeAndYetis"); - pepe.setProperty("player", cm.getPlayer().getName()); - pepe.startInstance(cm.getPlayer()); - cm.dispose(); - return; - } - - else if(selection == 1){ - var em = cm.getEventManager("MK_PrimeMinister2"); - - var party = cm.getPlayer().getParty(); - if (party != null) { - if (!em.startInstance(party, cm.getMap(), 1)) { - cm.sendOk("Another party is already challenging the boss in this channel."); - } - } else { - if (!em.startInstance(cm.getPlayer())) { - cm.sendOk("Another party is already challenging the boss in this channel."); - } - } - - cm.dispose(); - return; - } - } - } else { - var questProgress = cm.getQuestProgressInt(2330, 3300005) + cm.getQuestProgressInt(2330, 3300006) + cm.getQuestProgressInt(2330, 3300007); //3 Yetis - if (!(cm.isQuestStarted(2330) && questProgress < 3)) { // thanks Vcoc for finding an exploit with boss entry through NPC - cm.dispose(); - return; - } - - if(status == 0){ - cm.sendSimple("#L1#Enter to fight #bKing Pepe#k and #bYeti Brothers#k.#l"); - } - else if(status == 1){ - if(selection == 1){ - var pepe = cm.getEventManager("KingPepeAndYetis"); - pepe.setProperty("player", cm.getPlayer().getName()); - pepe.startInstance(cm.getPlayer()); - cm.dispose(); - return; - } - } + if (cm.getMapId() == 106021402) { + if (!(cm.isQuestCompleted(2331))) { + cm.dispose(); + return; } + + if (status == 0) { + cm.sendSimple("#L0#Enter to fight #bKing Pepe#k and #bYeti Brothers#k.#l\r\n#L1#Enter to fight #bPrime Minister#k.#l"); + } else if (status == 1) { + if (selection == 0) { + var pepe = cm.getEventManager("KingPepeAndYetis"); + pepe.setProperty("player", cm.getPlayer().getName()); + pepe.startInstance(cm.getPlayer()); + cm.dispose(); + + } else if (selection == 1) { + var em = cm.getEventManager("MK_PrimeMinister2"); + + var party = cm.getPlayer().getParty(); + if (party != null) { + if (!em.startInstance(party, cm.getMap(), 1)) { + cm.sendOk("Another party is already challenging the boss in this channel."); + } + } else { + if (!em.startInstance(cm.getPlayer())) { + cm.sendOk("Another party is already challenging the boss in this channel."); + } + } + + cm.dispose(); + + } + } + } else { + var questProgress = cm.getQuestProgressInt(2330, 3300005) + cm.getQuestProgressInt(2330, 3300006) + cm.getQuestProgressInt(2330, 3300007); //3 Yetis + if (!(cm.isQuestStarted(2330) && questProgress < 3)) { // thanks Vcoc for finding an exploit with boss entry through NPC + cm.dispose(); + return; + } + + if (status == 0) { + cm.sendSimple("#L1#Enter to fight #bKing Pepe#k and #bYeti Brothers#k.#l"); + } else if (status == 1) { + if (selection == 1) { + var pepe = cm.getEventManager("KingPepeAndYetis"); + pepe.setProperty("player", cm.getPlayer().getName()); + pepe.startInstance(cm.getPlayer()); + cm.dispose(); + + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2001000.js b/scripts/npc/2001000.js index 0ec6035b7d..3353ff14d8 100644 --- a/scripts/npc/2001000.js +++ b/scripts/npc/2001000.js @@ -10,23 +10,23 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status > 0) { - status--; - } else { - cm.dispose(); - return; - } + if (status > 0) { + status--; + } else { + cm.dispose(); + return; + } } if (status == 0) { - cm.sendNext("Do you see a bunch of snowmen standing around there? Go talk to one of them, and it'll take you to the famous Christmas tree here that is just humongous. The tree can be decorated using various kinds of ornaments. What do you think? Sounds fun, right?"); + cm.sendNext("Do you see a bunch of snowmen standing around there? Go talk to one of them, and it'll take you to the famous Christmas tree here that is just humongous. The tree can be decorated using various kinds of ornaments. What do you think? Sounds fun, right?"); } else if (status == 1) { - cm.sendNextPrev("Only 6 can be at the place where the tree is at once, and you can't #btrade or open store#k there. The ornaments that you drop can only be picked back up by yourself, so don't worry about losing your ornaments here."); + cm.sendNextPrev("Only 6 can be at the place where the tree is at once, and you can't #btrade or open store#k there. The ornaments that you drop can only be picked back up by yourself, so don't worry about losing your ornaments here."); } else if (status == 2) { - cm.sendNextPrev("Of course, the items that are dropped in there will never disappear. Once you get out of there through the snowman that's inside, all the items you've dropped at that map will come back to you, so you won't have to pick all those items up before leaving the place. Isn't that sweet?"); + cm.sendNextPrev("Of course, the items that are dropped in there will never disappear. Once you get out of there through the snowman that's inside, all the items you've dropped at that map will come back to you, so you won't have to pick all those items up before leaving the place. Isn't that sweet?"); } else if (status == 3) { - cm.sendPrev("Well then, go see #p2002001#, buy some Christmas ornaments there, and then decorate the tree with those~ Oh yeah! The biggest, the most beautiful ornament cannot be bought from him. It's probably ... taken by a monster ... huh huh .."); - cm.dispose(); + cm.sendPrev("Well then, go see #p2002001#, buy some Christmas ornaments there, and then decorate the tree with those~ Oh yeah! The biggest, the most beautiful ornament cannot be bought from him. It's probably ... taken by a monster ... huh huh .."); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2001001.js b/scripts/npc/2001001.js index a44f856527..18162f187d 100644 --- a/scripts/npc/2001001.js +++ b/scripts/npc/2001001.js @@ -26,21 +26,23 @@ var status = -1; -function start() { +function start() { action(1, 0, 0); -} -function action(mode, type, selection) { - if (mode < 0) +} + +function action(mode, type, selection) { + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendYesNo("We have a beautiful christmas tree.\r\nDo you want to see/decorate it?"); - } else if(status == 1) { + } else if (status == 1) { cm.warp(209000001); cm.dispose(); } diff --git a/scripts/npc/2001002.js b/scripts/npc/2001002.js index 64b901dc2d..02ba3161f2 100644 --- a/scripts/npc/2001002.js +++ b/scripts/npc/2001002.js @@ -26,21 +26,23 @@ var status = -1; -function start() { +function start() { action(1, 0, 0); -} -function action(mode, type, selection) { - if (mode < 0) +} + +function action(mode, type, selection) { + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendYesNo("We have a beautiful christmas tree.\r\nDo you want to see/decorate it?"); - } else if(status == 1) { + } else if (status == 1) { cm.warp(209000002); cm.dispose(); } diff --git a/scripts/npc/2001003.js b/scripts/npc/2001003.js index d8d40f6cd7..432ba81f62 100644 --- a/scripts/npc/2001003.js +++ b/scripts/npc/2001003.js @@ -26,21 +26,23 @@ var status = -1; -function start() { +function start() { action(1, 0, 0); -} -function action(mode, type, selection) { - if (mode < 0) +} + +function action(mode, type, selection) { + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendYesNo("We have a beautiful christmas tree.\r\nDo you want to see/decorate it?"); - } else if(status == 1) { + } else if (status == 1) { cm.warp(209000003); cm.dispose(); } diff --git a/scripts/npc/2001004.js b/scripts/npc/2001004.js index 5e9cf90f78..5dccd053db 100644 --- a/scripts/npc/2001004.js +++ b/scripts/npc/2001004.js @@ -26,21 +26,23 @@ var status = -1; -function start() { - action(1,0,0); -} +function start() { + action(1, 0, 0); +} + function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendYesNo("So, are you ready to head out of here?"); - } else if(status == 1) { + } else if (status == 1) { cm.warp(209000000, 3); cm.dispose(); } diff --git a/scripts/npc/2002000.js b/scripts/npc/2002000.js index cd3cd3913e..07de7f4915 100644 --- a/scripts/npc/2002000.js +++ b/scripts/npc/2002000.js @@ -21,23 +21,24 @@ */ /** -Rupi- Happyville Warp NPC -**/ + Rupi- Happyville Warp NPC + **/ function start() { cm.sendYesNo("Do you want to get out of Happyville?"); } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { var map = cm.getPlayer().getSavedLocation("HAPPYVILLE"); - if (map == -1) + if (map == -1) { map = 101000000; - + } + cm.warp(map, 0); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2003.js b/scripts/npc/2003.js index 2a9e9de1fa..e857a2d3bd 100644 --- a/scripts/npc/2003.js +++ b/scripts/npc/2003.js @@ -36,71 +36,75 @@ function start() { function action(mode, type, selection) { status++; if (mode != 1) { - if(mode == 0 && type != 4) + if (mode == 0 && type != 4) { status -= 2; - else{ + } else { cm.dispose(); return; } } if (status == 0) { - if(sel == -1) + if (sel == -1) { sel = selection; - if (sel == 0) + } + if (sel == 0) { cm.sendNext("Alright this is how you move. Use #bleft, right arrow#k to move around the flatland and slanted roads, and press #bAlt#k to jump. A select number of shoes improve your speed and jumping abilities."); - else if (sel == 1) + } else if (sel == 1) { cm.sendNext("Here's how to take down a monster. Every monster possesses an HP of its own and you'll take them down by attacking with either a weapon or through spells. Of course the stronger they are, the harder it is to take them down."); - else if (sel == 2) + } else if (sel == 2) { cm.sendNext("This is how you gather up an item. Once you take down a monster, an item will be dropped to the ground. When that happens, stand in front of the item and press #bZ#k or #b0 on the NumPad#k to acquire the item."); - else if (sel == 3) + } else if (sel == 3) { cm.sendNext("Curious to find out what happens when you die? You'll become a ghost when your HP reaches 0. There will be a tombstone in that place and you won't be able to move, although you still will be able to chat."); - else if (sel == 4) + } else if (sel == 4) { cm.sendNext("When do you get to choose your job? Hahaha, take it easy, my friend. Each job has a requirement set for you to meet. Normally a level between 8 and 10 will do, so work hard."); - else if (sel == 5) + } else if (sel == 5) { cm.sendNext("Want to know about this island? It's called Maple Island and it floats in the air. It's been floating in the sky for a while so the nasty monsters aren't really around. It's a very peaceful island, perfect for beginners!"); - else if (sel == 6) + } else if (sel == 6) { cm.sendNext("You want to become a #bWarrior#k? Hmmm, then I suggest you head over to Victoria Island. Head over to a warrior-town called #rPerion#k and see #bDances with Balrog#k. He'll teach you all about becoming a true warrior. Ohh, and one VERY important thing: You'll need to be at least level 10 in order to become a warrior!!"); - else if (sel == 7) + } else if (sel == 7) { cm.sendNext("You want to become a #bBowman#k? You'll need to go to Victoria Island to make the job advancement. Head over to a bowman-town called #rHenesys#k and talk to the beautiful #bAthena Pierce#k and learn the in's and out's of being a bowman. Ohh, and one VERY important thing: You'll need to be at least level 10 in order to become a bowman!!"); - else if (sel == 8) + } else if (sel == 8) { cm.sendNext("You want to become a #bMagician#k? For you to do that, you'll have to head over to Victoria Island. Head over to a magician-town called #rEllinia#k, and at the very top lies the Magic Library. Inside, you'll meet the head of all wizards, #bGrendel the Really Old#k, who'll teach you everything about becoming a wizard."); - else if (sel == 9) + } else if (sel == 9) { cm.sendNext("You want to become a #bThief#k? In order to become one, you'll have to head over to Victoria Island. Head over to a thief-town called #rKerning City#k, and on the shadier side of town, you'll see a thief's hideaway. There, you'll meet #bDark Lord#k who'll teach you everything about being a thief. Ohh, and one VERY important thing: You'll need to be at least level 10 in order to become a thief!!"); - else if (sel == 10) + } else if (sel == 10) { cm.sendNext("You want to know how to raise your character's ability stats? First press #bS#k to check out the ability window. Every time you level up, you'll be awarded 5 ability points aka AP's. Assign those AP's to the ability of your choice. It's that simple."); - else if (sel == 11) + } else if (sel == 11) { cm.sendNext("You want to know how to check out the items you've picked up, huh? When you defeat a monster, it'll drop an item on the ground, and you may press #bZ#k to pick up the item. That item will then be stored in your item inventory, and you can take a look at it by simply pressing #bI#k."); - else if (sel == 12) + } else if (sel == 12) { cm.sendNext("You want to know how to wear the items, right? Press #bI#k to check out your item inventory. Place your mouse cursor on top of an item and double-click on it to put it on your character. If you find yourself unable to wear the item, chances are your character does not meet the level & stat requirements. You can also put on the item by opening the equipment inventory (#bE#k) and dragging the item into it. To take off an item, double-click on the item at the equipment inventory."); - else if (sel == 13) + } else if (sel == 13) { cm.sendNext("You want to check on the equipped items, right? Press #bE#k to open the equipment inventory, where you'll see exactly what you are wearing right at the moment. To take off an item, double-click on the item. The item will then be sent to the item inventory."); - else if (sel == 14) + } else if (sel == 14) { cm.sendNext("The special 'abilities' you get after acquiring a job are called skills. You'll acquire skills that are specifically for that job. You're not at that stage yet, so you don't have any skills yet, but just remember that to check on your skills, press #bK#k to open the skill book. It'll help you down the road."); - else if (sel == 15) + } else if (sel == 15) { cm.sendNext("How do you get to Victoria Island? On the east of this island there's a harbor called Southperry. There, you'll find a ship that flies in the air. In front of the ship stands the captain. Ask him about it."); - else if (sel == 16) + } else if (sel == 16) { cm.sendNext("It's the currency used in MapleStory. You may purchase items through mesos. To earn them, you may either defeat the monsters, sell items at the store, or complete quests..."); + } } else if (status == 1) { - if (sel == 0) + if (sel == 0) { cm.sendNextPrev("In order to attack the monsters, you'll need to be equipped with a weapon. When equipped, press #bCtrl#k to use the weapon. With the right timing, you'll be able to easily take down the monsters."); - else if (sel == 1) + } else if (sel == 1) { cm.sendNextPrev("Once you make the job advancement, you'll acquire different kinds of skills, and you can assign them to HotKeys for easier access. If it's an attacking skill, you don't need to press Ctrl to attack, just press the button assigned as a HotKey."); - else if (sel == 2) + } else if (sel == 2) { cm.sendNextPrev("Remember, though, that if your item inventory is full, you won't be able to acquire more. So if you have an item you don't need, sell it so you can make something out of it. The inventory may expand once you make the job advancement."); - else if (sel == 3) + } else if (sel == 3) { cm.sendNextPrev("There isn't much to lose when you die if you are just a beginner. Once you have a job, however, it's a different story. You'll lose a portion of your EXP when you die, so make sure you avoid danger and death at all cost."); - else if (sel == 4) + } else if (sel == 4) { cm.sendNextPrev("Level isn't the only thing that determines the advancement, though. You also need to boost up the levels of a particular ability based on the occupation. For example, to be a warrior, your STR has to be over 35, and so forth, you know what I'm saying? Make sure you boost up the abilities that has direct implications to your job."); - else if (sel == 5) + } else if (sel == 5) { cm.sendNextPrev("But, if you want to be a powerful player, better not think about staying here for too long. You won't be able to get a job anyway. Underneath this island lies an enormous island called Victoria Island. That place is so much bigger than here, it's not even funny."); - else if (sel == 8) + } else if (sel == 8) { cm.sendNextPrev("Oh by the way, unlike other jobs, to become a magician you only need to be at level 8. What comes with making the job advancement early also comes with the fact that it takes a lot to become a true powerful mage. Think long and carefully before choosing your path."); - else if (sel == 10) + } else if (sel == 10) { cm.sendNextPrev("Place your mouse cursor on top of all abilities for a brief explanation. For example, STR for warriors, DEX for bowman, INT for magician, and LUK for thief. That itself isn't everything you need to know, so you'll need to think long and hard on how to emphasize your character's strengths through assigning the points."); - else if (sel == 15) + } else if (sel == 15) { cm.sendNextPrev("Oh yeah! One last piece of information before I go. If you are not sure where you are, always press #bW#k. The world map will pop up with the locator showing where you stand. You won't have to worry about getting lost with that."); - else + } else { start(); - }else + } + } else { start(); + } } \ No newline at end of file diff --git a/scripts/npc/2007.js b/scripts/npc/2007.js index 4a5159e710..b55449834b 100644 --- a/scripts/npc/2007.js +++ b/scripts/npc/2007.js @@ -5,22 +5,23 @@ function start() { function action(mode, type, selection) { if (mode == -1) { - cm.sendNext("Enjoy your trip."); + cm.sendNext("Enjoy your trip."); cm.dispose(); } else { if (status == 0 && mode == 0) { - cm.sendNext("Enjoy your trip."); - cm.dispose(); + cm.sendNext("Enjoy your trip."); + cm.dispose(); } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - if (status == 0) - cm.sendYesNo("Would you like to skip the tutorials and head straight to Lith Harbor?"); - else if (status == 1) { - cm.warp(104000000, 0); - cm.dispose(); + } + if (status == 0) { + cm.sendYesNo("Would you like to skip the tutorials and head straight to Lith Harbor?"); + } else if (status == 1) { + cm.warp(104000000, 0); + cm.dispose(); } } } \ No newline at end of file diff --git a/scripts/npc/2010000.js b/scripts/npc/2010000.js index d5abf51152..6947572190 100644 --- a/scripts/npc/2010000.js +++ b/scripts/npc/2010000.js @@ -1,170 +1,170 @@ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Master Sergeant Fox - Orbis(200000000) --- By --------------------------------------------------------------------------------------------- - Sean360 --- Version Info ----------------------------------------------------------------------------------- - 1.2 - Clean-up - 1.1 - Official Text [Information] - 1.0 - First Version by Sean360 ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Master Sergeant Fox - Orbis(200000000) + -- By --------------------------------------------------------------------------------------------- + Sean360 + -- Version Info ----------------------------------------------------------------------------------- + 1.2 - Clean-up + 1.1 - Official Text [Information] + 1.0 - First Version by Sean360 + --------------------------------------------------------------------------------------------------- + **/ var status = 0; -var eQuestChoices = new Array (4000073,4000059,4000060,4000061,4000058, - 4000062,4000048,4000049,4000055,4000056, - 4000051,4000052,4000050,4000057,4000053, - 4000054,4000076,4000078,4000081,4000070, - 4000071,4000072,4000069,4000079,4000080); +var eQuestChoices = [4000073, 4000059, 4000060, 4000061, 4000058, + 4000062, 4000048, 4000049, 4000055, 4000056, + 4000051, 4000052, 4000050, 4000057, 4000053, + 4000054, 4000076, 4000078, 4000081, 4000070, + 4000071, 4000072, 4000069, 4000079, 4000080]; -var eQuestPrizes = new Array(); +var eQuestPrizes = []; -eQuestPrizes[0] = new Array ([2000001,20], // Orange Potions - [2010004,10], // Lemons - [2000003,15], // Blue Potions - [4003001,15], // Processed Wood - [2020001,15], // Fried Chickens - [2030000,15]); // Nearest Town Scroll -eQuestPrizes[1] = new Array ([2000003,20], // Blue Potions - [2000001,30], // Orange Potions - [2010001,40], // Meats - [4003001,20], // Processed Wood - [2040002,1]); // 10% Helm Def -eQuestPrizes[2] = new Array ([2000002,25], // White Potions - [2000006,10], // Mana Elixir - [2022000,5], // Pure Water - [4000030,15], // Dragon Skins - [2040902,1]); // 10% Shield Def -eQuestPrizes[3] = new Array ([2000002,30], // White Potions - [2000006,15], // Mana Elixir - [2020000,20], // Salad - [4003000,5], // Screws - [2041016,1]); // 10% Cape Int -eQuestPrizes[4] = new Array ([2000002,15], // White Potions - [2010004,15], // Lemons - [2000003,25], // Blue Potions - [4003001,30], // Processed Wood - [2040302,1]); // 10% Earring Int -eQuestPrizes[5] = new Array ([2000002,30], // White Potions - [2000006,15], // Mana Elixir - [2020000,20], // Salad - [4003000,5], // Screws - [2040402,1]); // 10% Top Def -eQuestPrizes[6] = new Array ([2000002,30], // White Potions - [2020000,20], // Salad - [2000006,15], // Mana Elixir - [4003000,5], // Screws - [2040402,1]); // 10% Top Def -eQuestPrizes[7] = new Array ([2000006,25], // Mana Elixir - [2020000,20], // Salad - [4020000,7], // Garnet Ore - [4020001,7], // Amethyst Ore - [4020002,3], // Aquamarine Ore - [4020007,2], // Diamond Ore - [2040708,1]); // 10% Shoe Speed -eQuestPrizes[8] = new Array ([2020005,30], // Hotdogs - [2020006,15], // Hotdog Supremes - [2022001,30], // Red Bean Soup - [4003003,1], // Fairy Wing - [2040505,1]); // 10% O/All Def -eQuestPrizes[9] = new Array ([2000006,25], // Mana Elixir - [4020005,7], // Sapphire Ore - [4020003,7], // Emerald Ore - [4020004,7], // Opal Ore - [4020008,2], // Black Crystal Ore - [2040802,1]); // 10% Glove Dex -eQuestPrizes[10] = new Array ([2002004,15], // Warrior Potion - [2002005,15], // Sniper Potion - [2002003,15], // Wizard Potion - [4001005,1], // Ancient Scroll - [2040502,1]); // 10% O/All Dex -eQuestPrizes[11] = new Array ([2000006,20], // Mana Elixir - [4010004,7], // Silver Ore - [4010003,7], // Adamantium Ore - [4010005,7], // Orihalcon Ore - [4003002,1], // Piece of Ice - [2040602,1]); // 10% Bottom Def -eQuestPrizes[12] = new Array ([2000006,20], // Mana Elixir - [4010002,7], // Mithril Ore - [4010001,7], // Steel Ore - [4010000,7], // Bronze Ore - [4010006,2], // Gold Ore - [4003000,5], // Screwa - [2040702,1]); // 10% Shoe Dex -eQuestPrizes[13] = new Array ([2000006,20], // Mana Elixir - [4010004,7], // Silver Ore - [4010005,7], // Orihalcon Ore - [4010006,3], // Gold Ore - [4020007,2], // Diamond Ore - [4020008,2], // Black Crystal Ore - [2040705,1]); // 10% Shoe Jump -eQuestPrizes[14] = new Array ([2000006,30], // Mana Elixir - [4020006,7], // Topaz Ore - [4020008,2], // Black Crystal Ore - [4020007,2], // Diamond Ore - [2070010,1], // Icicle Stars - [2040805,1]); // 10% Glove Attack -eQuestPrizes[15] = new Array ([2000006,30], // Mana Elixir - [4020006,7], // Topaz Ore +eQuestPrizes[0] = [[2000001, 20], // Orange Potions + [2010004, 10], // Lemons + [2000003, 15], // Blue Potions + [4003001, 15], // Processed Wood + [2020001, 15], // Fried Chickens + [2030000, 15]]; // Nearest Town Scroll +eQuestPrizes[1] = [[2000003, 20], // Blue Potions + [2000001, 30], // Orange Potions + [2010001, 40], // Meats + [4003001, 20], // Processed Wood + [2040002, 1]]; // 10% Helm Def +eQuestPrizes[2] = [[2000002, 25], // White Potions + [2000006, 10], // Mana Elixir + [2022000, 5], // Pure Water + [4000030, 15], // Dragon Skins + [2040902, 1]]; // 10% Shield Def +eQuestPrizes[3] = [[2000002, 30], // White Potions + [2000006, 15], // Mana Elixir + [2020000, 20], // Salad + [4003000, 5], // Screws + [2041016, 1]]; // 10% Cape Int +eQuestPrizes[4] = [[2000002, 15], // White Potions + [2010004, 15], // Lemons + [2000003, 25], // Blue Potions + [4003001, 30], // Processed Wood + [2040302, 1]]; // 10% Earring Int +eQuestPrizes[5] = [[2000002, 30], // White Potions + [2000006, 15], // Mana Elixir + [2020000, 20], // Salad + [4003000, 5], // Screws + [2040402, 1]]; // 10% Top Def +eQuestPrizes[6] = [[2000002, 30], // White Potions + [2020000, 20], // Salad + [2000006, 15], // Mana Elixir + [4003000, 5], // Screws + [2040402, 1]]; // 10% Top Def +eQuestPrizes[7] = [[2000006, 25], // Mana Elixir + [2020000, 20], // Salad + [4020000, 7], // Garnet Ore + [4020001, 7], // Amethyst Ore + [4020002, 3], // Aquamarine Ore + [4020007, 2], // Diamond Ore + [2040708, 1]]; // 10% Shoe Speed +eQuestPrizes[8] = [[2020005, 30], // Hotdogs + [2020006, 15], // Hotdog Supremes + [2022001, 30], // Red Bean Soup + [4003003, 1], // Fairy Wing + [2040505, 1]]; // 10% O/All Def +eQuestPrizes[9] = [[2000006, 25], // Mana Elixir + [4020005, 7], // Sapphire Ore + [4020003, 7], // Emerald Ore + [4020004, 7], // Opal Ore + [4020008, 2], // Black Crystal Ore + [2040802, 1]]; // 10% Glove Dex +eQuestPrizes[10] = [[2002004, 15], // Warrior Potion + [2002005, 15], // Sniper Potion + [2002003, 15], // Wizard Potion + [4001005, 1], // Ancient Scroll + [2040502, 1]]; // 10% O/All Dex +eQuestPrizes[11] = [[2000006, 20], // Mana Elixir + [4010004, 7], // Silver Ore + [4010003, 7], // Adamantium Ore + [4010005, 7], // Orihalcon Ore + [4003002, 1], // Piece of Ice + [2040602, 1]]; // 10% Bottom Def +eQuestPrizes[12] = [[2000006, 20], // Mana Elixir + [4010002, 7], // Mithril Ore + [4010001, 7], // Steel Ore + [4010000, 7], // Bronze Ore + [4010006, 2], // Gold Ore + [4003000, 5], // Screwa + [2040702, 1]]; // 10% Shoe Dex +eQuestPrizes[13] = [[2000006, 20], // Mana Elixir + [4010004, 7], // Silver Ore + [4010005, 7], // Orihalcon Ore + [4010006, 3], // Gold Ore + [4020007, 2], // Diamond Ore + [4020008, 2], // Black Crystal Ore + [2040705, 1]]; // 10% Shoe Jump +eQuestPrizes[14] = [[2000006, 30], // Mana Elixir + [4020006, 7], // Topaz Ore + [4020008, 2], // Black Crystal Ore + [4020007, 2], // Diamond Ore + [2070010, 1], // Icicle Stars + [2040805, 1]]; // 10% Glove Attack +eQuestPrizes[15] = [[2000006, 30], // Mana Elixir + [4020006, 7], // Topaz Ore [4020008.2], // Black Crystal Ore - [4020007,2], // Diamond Ore - [2041020,1]); // 10% Cape Dex -eQuestPrizes[16] = new Array ([2000001,30], // Orange Potions - [2000003,20], // Blue Potions - [4003001,20], // Processed Wood - [2010001,40], // Meats - [2040002,1]); // 10% Helm Def -eQuestPrizes[17] = new Array ([2000002,15], // White Potions - [2000003,25], // Blue Potions - [2010004,15], // Lemons - [2050004,15], // Divine Elixir - [4003001,30], // Processed Wood - [2040302,1]); // 10% Earring Int -eQuestPrizes[18] = new Array ([2000006,25], // Mana Elixir - [2020006,25], // Hotdog Supreme - [4010004,8], // Silver Ore - [4010005,8], // Orihalcon Ore - [4010006,3], // Gold Ore - [4020007,2], // Diamond Ore - [4020008,2], // Black Crystal Ore - [2040705,1]); // 10% Shoe Jump -eQuestPrizes[19] = new Array ([2000002,30], // White Potions - [2020000,20], // Salad - [2000006,15], // Mana Elixir - [4003000,5], // Screws - [2041005,1]); // 10% Cape Wep Def -eQuestPrizes[20] = new Array ([2000002,30], // White Potions - [2020000,20], // Salad - [2000006,15], // Mana Elixir - [4003000,5], // Screws - [2041005,1]); // 10% Cape Wep Def -eQuestPrizes[21] = new Array ([2000002,30], // White Potions - [2020000,20], // Salad - [2000006,15], // Mana Elixir - [4003000,5], // Screws - [2041005,1]); // 10% Cape Wep Def -eQuestPrizes[22] = new Array ([2000006,20], // Mana Elixir - [2020005,30], // Hotdogs - [2020006,15], // Hotdog Supremes - [2050004,20], // Divine Elixirs - [4003003,1], // Fairy Wing - [2041002,1]); // 10% Cape Mag Def -eQuestPrizes[23] = new Array ([2000006,25], // Mana Elixir - [2050004,50], // Divine Elixir - [2022001,35], // Red Bean Soup - [4020000,8], // Garnet Ore - [4020001,8], // Amethyst Ore - [4020002,8], // Aquamarine Ore - [4020007,2], // Diamond Ore - [2041023,1]); // 10% Cape LUK -eQuestPrizes[24] = new Array ([2000006,35], // Mana Elixir - [4020006,9], // Topaz Ore - [4010008,4], // Black Crystal Ore - [4020007,4], // Diamond Ore - [2041008,1]); // 10% Cape HP -var requiredItem = 0; + [4020007, 2], // Diamond Ore + [2041020, 1]]; // 10% Cape Dex +eQuestPrizes[16] = [[2000001, 30], // Orange Potions + [2000003, 20], // Blue Potions + [4003001, 20], // Processed Wood + [2010001, 40], // Meats + [2040002, 1]]; // 10% Helm Def +eQuestPrizes[17] = [[2000002, 15], // White Potions + [2000003, 25], // Blue Potions + [2010004, 15], // Lemons + [2050004, 15], // Divine Elixir + [4003001, 30], // Processed Wood + [2040302, 1]]; // 10% Earring Int +eQuestPrizes[18] = [[2000006, 25], // Mana Elixir + [2020006, 25], // Hotdog Supreme + [4010004, 8], // Silver Ore + [4010005, 8], // Orihalcon Ore + [4010006, 3], // Gold Ore + [4020007, 2], // Diamond Ore + [4020008, 2], // Black Crystal Ore + [2040705, 1]]; // 10% Shoe Jump +eQuestPrizes[19] = [[2000002, 30], // White Potions + [2020000, 20], // Salad + [2000006, 15], // Mana Elixir + [4003000, 5], // Screws + [2041005, 1]]; // 10% Cape Wep Def +eQuestPrizes[20] = [[2000002, 30], // White Potions + [2020000, 20], // Salad + [2000006, 15], // Mana Elixir + [4003000, 5], // Screws + [2041005, 1]]; // 10% Cape Wep Def +eQuestPrizes[21] = [[2000002, 30], // White Potions + [2020000, 20], // Salad + [2000006, 15], // Mana Elixir + [4003000, 5], // Screws + [2041005, 1]]; // 10% Cape Wep Def +eQuestPrizes[22] = [[2000006, 20], // Mana Elixir + [2020005, 30], // Hotdogs + [2020006, 15], // Hotdog Supremes + [2050004, 20], // Divine Elixirs + [4003003, 1], // Fairy Wing + [2041002, 1]]; // 10% Cape Mag Def +eQuestPrizes[23] = [[2000006, 25], // Mana Elixir + [2050004, 50], // Divine Elixir + [2022001, 35], // Red Bean Soup + [4020000, 8], // Garnet Ore + [4020001, 8], // Amethyst Ore + [4020002, 8], // Aquamarine Ore + [4020007, 2], // Diamond Ore + [2041023, 1]]; // 10% Cape LUK +eQuestPrizes[24] = [[2000006, 35], // Mana Elixir + [4020006, 9], // Topaz Ore + [4010008, 4], // Black Crystal Ore + [4020007, 4], // Diamond Ore + [2041008, 1]]; // 10% Cape HP +var requiredItem = 0; var lastSelection = 0; -var prizeItem = 0; +var prizeItem = 0; var prizeQuantity = 0; var itemSet; @@ -175,46 +175,46 @@ function start() { function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Hmmm...it shouldn't be a bad deal for you. Come see me at the right time and you may get a much better item to be offered. Anyway, let me know when you have a change of heart."); - cm.dispose(); - return; + cm.sendOk("Hmmm...it shouldn't be a bad deal for you. Come see me at the right time and you may get a much better item to be offered. Anyway, let me know when you have a change of heart."); + cm.dispose(); + return; } - + status++; if (status == 0) { // first interaction with NPC - cm.sendNext("Hey, got a little bit of time? Well, my job is to collect items here and sell them elsewhere, but these days the monsters have become much more hostile so it's been difficult to getting good items ... What do you think? Do you want to do some business with me?"); + cm.sendNext("Hey, got a little bit of time? Well, my job is to collect items here and sell them elsewhere, but these days the monsters have become much more hostile so it's been difficult to getting good items ... What do you think? Do you want to do some business with me?"); } else if (status == 1) { - cm.sendYesNo("The deal is simple. You get me something I need, I get you something you need. The problem is, I deal with a whole bunch of people, so the items I have to offer may change every time you see me. What do you think? Still want to do it?"); + cm.sendYesNo("The deal is simple. You get me something I need, I get you something you need. The problem is, I deal with a whole bunch of people, so the items I have to offer may change every time you see me. What do you think? Still want to do it?"); } else if (status == 2) { - var eQuestChoice = makeChoices(eQuestChoices); - cm.sendSimple(eQuestChoice); - } else if (status == 3){ - lastSelection = selection; - requiredItem = eQuestChoices[selection]; - cm.sendYesNo("Let's see, you want to trade your #b100 #t" + requiredItem + "##k with my stuff right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?"); - }else if (status == 4){ - itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length)); - reward = eQuestPrizes[lastSelection]; - prizeItem = reward[itemSet][0]; - prizeQuantity = reward[itemSet][1]; - if(!cm.haveItem(requiredItem,100)){ - cm.sendOk("Hmmm... are you sure you have #b100 #t" + requiredItem + "##k? If so, then please check and see if your item inventory is full or not."); - } else if(!cm.canHold(prizeItem)){ - cm.sendOk("Your use and etc. inventory seems to be full. You need the free spaces to trade with me! Make room, and then find me."); - } else { - cm.gainItem(requiredItem,-100); - cm.gainExp(500 * cm.getPlayer().getExpRate()); - cm.gainItem(prizeItem, prizeQuantity); - cm.sendOk("For your #b100 #t"+requiredItem+"##k, here's my #b"+prizeQuantity+" #t"+prizeItem+"##k. What do you think? Do you like the items I gave you in return? I plan on being here for a while, so if you gather up more items, I'm always open for a trade ..."); - } - cm.dispose(); + var eQuestChoice = makeChoices(eQuestChoices); + cm.sendSimple(eQuestChoice); + } else if (status == 3) { + lastSelection = selection; + requiredItem = eQuestChoices[selection]; + cm.sendYesNo("Let's see, you want to trade your #b100 #t" + requiredItem + "##k with my stuff right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?"); + } else if (status == 4) { + itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length)); + reward = eQuestPrizes[lastSelection]; + prizeItem = reward[itemSet][0]; + prizeQuantity = reward[itemSet][1]; + if (!cm.haveItem(requiredItem, 100)) { + cm.sendOk("Hmmm... are you sure you have #b100 #t" + requiredItem + "##k? If so, then please check and see if your item inventory is full or not."); + } else if (!cm.canHold(prizeItem)) { + cm.sendOk("Your use and etc. inventory seems to be full. You need the free spaces to trade with me! Make room, and then find me."); + } else { + cm.gainItem(requiredItem, -100); + cm.gainExp(500 * cm.getPlayer().getExpRate()); + cm.gainItem(prizeItem, prizeQuantity); + cm.sendOk("For your #b100 #t" + requiredItem + "##k, here's my #b" + prizeQuantity + " #t" + prizeItem + "##k. What do you think? Do you like the items I gave you in return? I plan on being here for a while, so if you gather up more items, I'm always open for a trade ..."); + } + cm.dispose(); } } -function makeChoices(a){ - var result = "Ok! First you need to choose the item that you'll trade with. The better the item, the more likely the chance that I'll give you something much nicer in return.\r\n"; - for (var x = 0; x< a.length; x++){ - result += " #L" + x + "##v" + a[x] + "# #t" + a[x] + "##l\r\n"; +function makeChoices(a) { + var result = "Ok! First you need to choose the item that you'll trade with. The better the item, the more likely the chance that I'll give you something much nicer in return.\r\n"; + for (var x = 0; x < a.length; x++) { + result += " #L" + x + "##v" + a[x] + "# #t" + a[x] + "##l\r\n"; } return result; } \ No newline at end of file diff --git a/scripts/npc/2010001.js b/scripts/npc/2010001.js index d1d53104db..cdeb685db0 100644 --- a/scripts/npc/2010001.js +++ b/scripts/npc/2010001.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hello I'm Mino. If you have either a #b#t5150005##k or a #b#t5151005##k, then please let me take care of your hair. Choose what you want to do with it.\r\n#L1#Haircut: #i5150005##t5150005##l\r\n#L2#Dye your hair: #i5151005##t5151005##l"); } else if (status == 1) { @@ -58,13 +59,13 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { + for (var i = 0; i < mhair_v.length; i++) { pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) { + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -73,20 +74,19 @@ function action(mode, type, selection) { } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t5151005##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420004)){ + if (beauty == 1) { + if (cm.haveItem(5420004)) { cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150005) == true){ + } else if (cm.haveItem(5150005) == true) { cm.gainItem(5150005, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -94,8 +94,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151005) == true){ + if (beauty == 2) { + if (cm.haveItem(5151005) == true) { cm.gainItem(5151005, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -103,7 +103,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150005, 1); diff --git a/scripts/npc/2010002.js b/scripts/npc/2010002.js index f785255bed..e765f6ab2a 100644 --- a/scripts/npc/2010002.js +++ b/scripts/npc/2010002.js @@ -46,24 +46,25 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well well well, welcome to the Orbis Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152005##k, you can let us take care of the rest and have the face you've always wanted~!\r\n#L2#Plastic Surgery: #i5152005##t5152005##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) { + for (var i = 0; i < mface_v.length; i++) { pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) { + for (var i = 0; i < fface_v.length; i++) { pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -71,10 +72,9 @@ function action(mode, type, selection) { } cm.sendStyle("I can totally transform your face into something new... how about giving us a try? For #b#t5152005##k, you can get the face of your liking...take your time in choosing the face of your preference.", facenew); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5152005) == true){ + if (cm.haveItem(5152005) == true) { cm.gainItem(5152005, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); diff --git a/scripts/npc/2010003.js b/scripts/npc/2010003.js index 1c8c356be4..8d7d9dbfc3 100644 --- a/scripts/npc/2010003.js +++ b/scripts/npc/2010003.js @@ -42,154 +42,144 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Hello there. I'm Orbis' number one glove maker. Would you like me to make you something?#b" - var options = new Array("Create or upgrade a Warrior glove","Create or upgrade a Bowman glove","Create or upgrade a Magician glove","Create or upgrade a Thief glove"); - for (var i = 0; i < options.length; i++){ + var options = ["Create or upgrade a Warrior glove", "Create or upgrade a Bowman glove", "Create or upgrade a Magician glove", "Create or upgrade a Thief glove"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //warrior glove + if (selectedType == 0) { //warrior glove var selStr = "Warrior glove? Okay, then which one?#b"; - var gloves = new Array ("Bronze Husk#k - Warrior Lv. 70#b","Mithril Husk#k - Warrior Lv. 70#b","Dark Husk#k - Warrior Lv. 70#b", - "Sapphire Emperor#k - Warrior Lv. 80#b","Emerald Emperor#k - Warrior Lv. 80#b","Blood Emperor#k - Warrior Lv. 80#b","Dark Emperor#k - Warrior Lv. 80#b"); - for (var i = 0; i < gloves.length; i++){ + var gloves = ["Bronze Husk#k - Warrior Lv. 70#b", "Mithril Husk#k - Warrior Lv. 70#b", "Dark Husk#k - Warrior Lv. 70#b", + "Sapphire Emperor#k - Warrior Lv. 80#b", "Emerald Emperor#k - Warrior Lv. 80#b", "Blood Emperor#k - Warrior Lv. 80#b", "Dark Emperor#k - Warrior Lv. 80#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 1){ //bowman glove + } else if (selectedType == 1) { //bowman glove var selStr = "Bowman glove? Okay, then which one?#b"; - var gloves = new Array ("Blue Eyes#k - Bowman Lv. 70#b","Gold Eyes#k - Bowman Lv. 70#b","Dark Eyes#k - Bowman Lv. 70#b", - "Red Cordon#k - Bowman Lv. 80#b","Blue Cordon#k - Bowman Lv. 80#b","Green Cordon#k - Bowman Lv. 80#b","Dark Cordon#k - Bowman Lv. 80#b"); - for (var i = 0; i < gloves.length; i++){ + var gloves = ["Blue Eyes#k - Bowman Lv. 70#b", "Gold Eyes#k - Bowman Lv. 70#b", "Dark Eyes#k - Bowman Lv. 70#b", + "Red Cordon#k - Bowman Lv. 80#b", "Blue Cordon#k - Bowman Lv. 80#b", "Green Cordon#k - Bowman Lv. 80#b", "Dark Cordon#k - Bowman Lv. 80#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 2){ //mage glove + } else if (selectedType == 2) { //mage glove var selStr = "Magician glove? Okay, then which one?#b"; - var gloves = new Array ("Brown Lorin#k - Magician Lv. 70#b","Blue Lorin#k - Magician Lv. 70#b","Dark Lorin#k - Magician Lv. 70#b", - "Green Clarity#k - Magician Lv. 80#b","Blue Clarity#k - Magician Lv. 80#b","Dark Clarity#k - Magician Lv. 80#b"); - for (var i = 0; i < gloves.length; i++){ + var gloves = ["Brown Lorin#k - Magician Lv. 70#b", "Blue Lorin#k - Magician Lv. 70#b", "Dark Lorin#k - Magician Lv. 70#b", + "Green Clarity#k - Magician Lv. 80#b", "Blue Clarity#k - Magician Lv. 80#b", "Dark Clarity#k - Magician Lv. 80#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 3){ //thief glove + } else if (selectedType == 3) { //thief glove var selStr = "Thief glove? Okay, then which one?#b"; - var gloves = new Array ("Bronze Rover#k - Thief Lv. 70#b","Silver Rover#k - Thief Lv. 70#b","Gold Rover#k - Thief Lv. 70#b", - "Green Larceny#k - Thief Lv. 80#b","Purple Larceny#k - Thief Lv. 80#b","Dark Larceny#k - Thief Lv. 80#b"); - for (var i = 0; i < gloves.length; i++){ + var gloves = ["Bronze Rover#k - Thief Lv. 70#b", "Silver Rover#k - Thief Lv. 70#b", "Gold Rover#k - Thief Lv. 70#b", + "Green Larceny#k - Thief Lv. 80#b", "Purple Larceny#k - Thief Lv. 80#b", "Dark Larceny#k - Thief Lv. 80#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; } cm.sendSimple(selStr); } - } - else if (status == 2 && mode == 1) { + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //warrior glove - var itemSet = new Array(1082103,1082104,1082105,1082114,1082115,1082116,1082117,1082118); - var matSet = new Array(new Array(4005000,4011000,4011006,4000030,4003000),new Array(1082103,4011002,4021006),new Array(1082103,4021006,4021008),new Array(4005000,4005002,4021005,4000030,4003000),new Array(1082114,4005000,4005002,4021003),new Array(1082114,4005002,4021000),new Array(1082114,4005000,4005002,4021008)); - var matQtySet = new Array(new Array(2,8,3,70,55),new Array(1,6,4),new Array(1,8,3),new Array(2,1,8,90,60),new Array(1,1,1,7),new Array(1,3,8),new Array(1,2,1,4)); - var costSet = new Array(90000,90000,100000,100000,110000,110000,120000); + if (selectedType == 0) { //warrior glove + var itemSet = [1082103, 1082104, 1082105, 1082114, 1082115, 1082116, 1082117, 1082118]; + var matSet = [[4005000, 4011000, 4011006, 4000030, 4003000], [1082103, 4011002, 4021006], [1082103, 4021006, 4021008], [4005000, 4005002, 4021005, 4000030, 4003000], [1082114, 4005000, 4005002, 4021003], [1082114, 4005002, 4021000], [1082114, 4005000, 4005002, 4021008]]; + var matQtySet = [[2, 8, 3, 70, 55], [1, 6, 4], [1, 8, 3], [2, 1, 8, 90, 60], [1, 1, 1, 7], [1, 3, 8], [1, 2, 1, 4]]; + var costSet = [90000, 90000, 100000, 100000, 110000, 110000, 120000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //bowman glove + var itemSet = [1082106, 1082107, 1082108, 1082109, 1082110, 1082111, 1082112]; + var matSet = [[4005002, 4021005, 4011004, 4000030, 4003000], [1082106, 4021006, 4011006], [1082106, 4021007, 4021008], [4005002, 4005000, 4021000, 4000030, 4003000], [1082109, 4005002, 4005000, 4021005], [1082109, 4005002, 4005000, 4021003], [1082109, 4005002, 4005000, 4021008]]; + var matQtySet = [[2, 8, 3, 70, 55], [1, 5, 3], [1, 2, 3], [2, 1, 8, 90, 60], [1, 1, 1, 7], [1, 1, 1, 7], [1, 2, 1, 4]]; + var costSet = [90000, 90000, 100000, 100000, 110000, 110000, 120000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //mage glove + var itemSet = [1082098, 1082099, 1082100, 1082121, 1082122, 1082123]; + var matSet = [[4005001, 4011000, 4011004, 4000030, 4003000], [1082098, 4021002, 4021007], [1082098, 4021008, 4011006], [4005001, 4005003, 4021003, 4000030, 4003000], [1082121, 4005001, 4005003, 4021005], [1082121, 4005001, 4005003, 4021008]]; + var matQtySet = [[2, 6, 6, 70, 55], [1, 6, 2], [1, 3, 3], [2, 1, 8, 90, 60], [1, 1, 1, 7], [1, 2, 1, 4]]; + var costSet = [90000, 90000, 100000, 100000, 110000, 120000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 3) { //thief glove + var itemSet = [1082095, 1082096, 1082097, 1082118, 1082119, 1082120]; + var matSet = [[4005003, 4011000, 4011003, 4000030, 4003000], [1082095, 4011004, 4021007], [1082095, 4021007, 4011006], [4005003, 4005002, 4011002, 4000030, 4003000], [1082118, 4005003, 4005002, 4021001], [1082118, 4005003, 4005002, 4021000]]; + var matQtySet = [[2, 6, 6, 70, 55], [1, 6, 2], [1, 3, 3], [2, 1, 8, 90, 60], [1, 1, 1, 7], [1, 2, 1, 8]]; + var costSet = [90000, 90000, 100000, 100000, 110000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //bowman glove - var itemSet = new Array(1082106,1082107,1082108,1082109,1082110,1082111,1082112); - var matSet = new Array(new Array(4005002,4021005,4011004,4000030,4003000),new Array(1082106,4021006,4011006),new Array(1082106,4021007,4021008),new Array(4005002,4005000,4021000,4000030,4003000),new Array(1082109,4005002,4005000,4021005),new Array(1082109,4005002,4005000,4021003),new Array(1082109,4005002,4005000,4021008)); - var matQtySet = new Array(new Array(2,8,3,70,55),new Array(1,5,3),new Array(1,2,3),new Array(2,1,8,90,60),new Array(1,1,1,7),new Array(1,1,1,7),new Array(1,2,1,4)); - var costSet = new Array(90000,90000,100000,100000,110000,110000,120000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //mage glove - var itemSet = new Array(1082098,1082099,1082100,1082121,1082122,1082123); - var matSet = new Array(new Array(4005001,4011000,4011004,4000030,4003000),new Array(1082098,4021002,4021007),new Array(1082098,4021008,4011006),new Array(4005001,4005003,4021003,4000030,4003000),new Array(1082121,4005001,4005003,4021005),new Array(1082121,4005001,4005003,4021008)); - var matQtySet = new Array(new Array(2,6,6,70,55),new Array(1,6,2),new Array(1,3,3),new Array(2,1,8,90,60),new Array(1,1,1,7),new Array(1,2,1,4)); - var costSet = new Array(90000,90000,100000,100000,110000,120000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //thief glove - var itemSet = new Array (1082095,1082096,1082097,1082118,1082119,1082120); - var matSet = new Array(new Array(4005003,4011000,4011003,4000030,4003000),new Array(1082095,4011004,4021007),new Array(1082095,4021007,4011006),new Array(4005003,4005002,4011002,4000030,4003000),new Array(1082118,4005003,4005002,4021001),new Array(1082118,4005003,4005002,4021000)); - var matQtySet = new Array(new Array(2,6,6,70,55),new Array(1,6,2),new Array(1,3,3),new Array(2,1,8,90,60),new Array(1,1,1,7),new Array(1,2,1,8)); - var costSet = new Array(90000,90000,100000,100000,110000,120000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 3 && mode == 1) { + } else if (status == 3 && mode == 1) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) - { + } else if (cm.getMeso() < cost) { cm.sendOk("I'm afraid you cannot afford my services."); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; + } } - - if (!complete) + + if (!complete) { cm.sendOk("I'm afraid that substitute items are unacceptable, if you want your gloves made properly."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i]); } - } - else + } else { cm.gainItem(mats, -matQty); - + } + cm.gainMeso(-cost); cm.gainItem(item, 1); cm.sendOk("Done. If you need anything else, just ask again."); diff --git a/scripts/npc/2010005.js b/scripts/npc/2010005.js index a292177c9e..86095ac9ca 100644 --- a/scripts/npc/2010005.js +++ b/scripts/npc/2010005.js @@ -20,14 +20,14 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Shuri the Tour Guide - Orbis (200000000) --- By --------------------------------------------------------------------------------------------- - Information & Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Shuri the Tour Guide - Orbis (200000000) + -- By --------------------------------------------------------------------------------------------- + Information & Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version + --------------------------------------------------------------------------------------------------- + **/ var pay = 2000; var ticket = 4031134; @@ -37,7 +37,7 @@ var check; var status = 0; function start() { - cm.sendSimple("Have you heard of the beach with a spectacular view of the ocean called #b#m110000000##k, located a little far from #m"+cm.getPlayer().getMapId()+"#? I can take you there right now for either #b"+pay+" mesos#k, or if you have #b#t"+ticket+"##k with you, in which case you'll be in for free.\r\n\r\n#L0##bI'll pay "+pay+" mesos.#k#l\r\n#L1##bI have #t"+ticket+"##k#l\r\n#L2##bWhat is #t"+ticket+"#?#k#l"); + cm.sendSimple("Have you heard of the beach with a spectacular view of the ocean called #b#m110000000##k, located a little far from #m" + cm.getPlayer().getMapId() + "#? I can take you there right now for either #b" + pay + " mesos#k, or if you have #b#t" + ticket + "##k with you, in which case you'll be in for free.\r\n\r\n#L0##bI'll pay " + pay + " mesos.#k#l\r\n#L1##bI have #t" + ticket + "##k#l\r\n#L2##bWhat is #t" + ticket + "#?#k#l"); } function action(mode, type, selection) { @@ -49,20 +49,22 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection == 0 || selection == 1) { check = selection; - if (selection == 0) - msg = "You want to pay #b"+pay+" mesos#k and leave for #m110000000#?"; - else if (selection == 1) - msg = "So you have #b#t"+ticket+"##k? You can always head over to #m110000000# with that."; - cm.sendYesNo(msg+" Okay!! Please beware that you may be running into some monsters around there though, so make sure not to get caught off-guard. Okay, would you like to head over to #m110000000# right now?"); + if (selection == 0) { + msg = "You want to pay #b" + pay + " mesos#k and leave for #m110000000#?"; + } else if (selection == 1) { + msg = "So you have #b#t" + ticket + "##k? You can always head over to #m110000000# with that."; + } + cm.sendYesNo(msg + " Okay!! Please beware that you may be running into some monsters around there though, so make sure not to get caught off-guard. Okay, would you like to head over to #m110000000# right now?"); } else if (selection == 2) { - cm.sendNext("You must be curious about #b#t"+ticket+"##k. Yeah, I can see that. #t"+ticket+"# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); + cm.sendNext("You must be curious about #b#t" + ticket + "##k. Yeah, I can see that. #t" + ticket + "# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); status = 3; } } else if (status == 2) { @@ -76,22 +78,24 @@ function action(mode, type, selection) { } } else if (check == 1) { if (!cm.haveItem(ticket)) { - cm.sendOk("Hmmm, so where exactly is #b#t"+ticket+"##k?? Are you sure you have them? Please double-check."); + cm.sendOk("Hmmm, so where exactly is #b#t" + ticket + "##k?? Are you sure you have them? Please double-check."); cm.dispose(); - } else + } else { access = true; + } } if (access) { cm.getPlayer().saveLocation("FLORINA"); cm.warp(110000000, "st00"); cm.dispose(); } - } else if (status == 3) - cm.sendNext("You must be curious about #b#t"+ticket+"##k. Yeah, I can see that. #t"+ticket+"# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); - else if (status == 4) + } else if (status == 3) { + cm.sendNext("You must be curious about #b#t" + ticket + "##k. Yeah, I can see that. #t" + ticket + "# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); + } else if (status == 4) { cm.sendPrev("I came back without it, and it just feels awful not having it. Hopefully someone picked it up and put it somewhere safe. Anyway this is my story and who knows, you may be able to pick it up and put it to good use. If you have any questions, feel free to ask"); - else if (status == 5) + } else if (status == 5) { cm.dispose(); - + } + } } \ No newline at end of file diff --git a/scripts/npc/2010007.js b/scripts/npc/2010007.js index bf00dc8234..a574875f4e 100644 --- a/scripts/npc/2010007.js +++ b/scripts/npc/2010007.js @@ -35,31 +35,34 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { sel = selection; if (selection == 0) { if (cm.getPlayer().getGuildId() > 0) { cm.sendOk("You may not create a new Guild while you are in one."); cm.dispose(); - } else + } else { cm.sendYesNo("Creating a Guild costs #b 1500000 mesos#k, are you sure you want to continue?"); + } } else if (selection == 1) { if (cm.getPlayer().getGuildId() < 1 || cm.getPlayer().getGuildRank() != 1) { cm.sendOk("You can only disband a Guild if you are the leader of that Guild."); cm.dispose(); - } else + } else { cm.sendYesNo("Are you sure you want to disband your Guild? You will not be able to recover it afterward and all your GP will be gone."); + } } else if (selection == 2) { if (cm.getPlayer().getGuildId() < 1 || cm.getPlayer().getGuildRank() != 1) { cm.sendOk("You can only increase your Guild's capacity if you are the leader."); cm.dispose(); } else { var Guild = Java.type("net.server.guild.Guild"); // thanks Conrad for noticing an issue due to call on a static method here - cm.sendYesNo("Increasing your Guild capacity by #b5#k costs #b " + Guild.getIncreaseGuildCost(cm.getPlayer().getGuild().getCapacity()) +" mesos#k, are you sure you want to continue?"); + cm.sendYesNo("Increasing your Guild capacity by #b5#k costs #b " + Guild.getIncreaseGuildCost(cm.getPlayer().getGuild().getCapacity()) + " mesos#k, are you sure you want to continue?"); } } } else if (status == 2) { diff --git a/scripts/npc/2010008.js b/scripts/npc/2010008.js index 720acd84c7..172108ca6c 100644 --- a/scripts/npc/2010008.js +++ b/scripts/npc/2010008.js @@ -29,23 +29,24 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; if (status == 1) { sel = selection; if (sel == 0) { - if (cm.getPlayer().getGuildRank() == 1) + if (cm.getPlayer().getGuildRank() == 1) { cm.sendYesNo("Creating or changing Guild Emblem costs #b 5000000 mesos#k, are you sure you want to continue?"); - else + } else { cm.sendOk("You must be the Guild Leader to change the Emblem. Please tell your leader to speak with me."); + } } - } - else if (status == 2 && sel == 0) { + } else if (status == 2 && sel == 0) { cm.getPlayer().genericGuildMessage(17); cm.dispose(); - } else + } else { cm.dispose(); + } } } diff --git a/scripts/npc/2010009.js b/scripts/npc/2010009.js index 1675483490..0cf9111cd7 100644 --- a/scripts/npc/2010009.js +++ b/scripts/npc/2010009.js @@ -29,26 +29,25 @@ var allianceLimit = 5; function start() { status = -1; - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else { + } else { cm.dispose(); return; } if (status == 0) { - if(cm.getPlayer().getGuildId() < 1 || cm.getPlayer().getGuildRank() != 1) { + if (cm.getPlayer().getGuildId() < 1 || cm.getPlayer().getGuildRank() != 1) { cm.sendNext("Hello there! I'm #bLenario#k. Just guild masters can attempt to form guild unions."); cm.dispose(); return; } - + cm.sendSimple("Hello there! I'm #bLenario#k.\r\n#b#L0#Can you please tell me what Guild Union is all about?#l\r\n#L1#How do I make a Guild Union?#l\r\n#L2#I want to make a Guild Union.#l\r\n#L3#I want to add more guilds for the Guild Union.#l\r\n#L4#I want to break up the Guild Union.#l"); - } - else if (status == 1) { + } else if (status == 1) { choice = selection; if (selection == 0) { cm.sendNext("Guild Union is just as it says, a union of a number of guilds to form a super group. I am in charge of managing these Guild Unions."); @@ -56,68 +55,68 @@ function action(mode, type, selection) { } else if (selection == 1) { cm.sendNext("To make a Guild Union, two and only #btwo Guild Masters need to be in a party#k and #bboth must be present on this room#k on the same channel. The leader of this party will be assigned as the Guild Union Master.\r\n\r\nInitially, #bonly two guilds#k can make part of the new Union, but over the time you can #rexpand#k the Union capacity by talking to me when the time comes and investing in an estipulated fee."); cm.dispose(); - } else if(selection == 2) { - if(!cm.isLeader()) { + } else if (selection == 2) { + if (!cm.isLeader()) { cm.sendNext("If you want to form a guild union, please tell your party leader to talk to me. He/She will be assigned as the Leader of the Guild Union."); cm.dispose(); return; } - if(cm.getPlayer().getGuild().getAllianceId() > 0) { + if (cm.getPlayer().getGuild().getAllianceId() > 0) { cm.sendOk("You can not create a Guild Union while your guild is already registered in another."); cm.dispose(); return; } - + cm.sendYesNo("Oh, are you interested in forming a Guild Union? The current fee for this operation is #b" + allianceCost + " mesos#k."); } else if (selection == 3) { - if(cm.getPlayer().getMGC() == null) { + if (cm.getPlayer().getMGC() == null) { cm.sendOk("You can not expand a Guild Union if you don't own one."); cm.dispose(); return; } - + var rank = cm.getPlayer().getMGC().getAllianceRank(); - if (rank == 1) + if (rank == 1) { cm.sendYesNo("Do you want to increase your Alliance by #rone guild#k slot? The fee for this procedure is #b" + increaseCost + " mesos#k."); - else { + } else { cm.sendNext("Only the Guild Union Master can expand the number of guilds in the Union."); cm.dispose(); } - } else if(selection == 4) { - if(cm.getPlayer().getMGC() == null) { + } else if (selection == 4) { + if (cm.getPlayer().getMGC() == null) { cm.sendOk("You can not disband a Guild Union if you don't own one."); cm.dispose(); return; } - + var rank = cm.getPlayer().getMGC().getAllianceRank(); - if (rank == 1) + if (rank == 1) { cm.sendYesNo("Are you sure you want to disband your Guild Union?"); - else { + } else { cm.sendNext("Only the Guild Union Master may disband the Guild Union."); cm.dispose(); } } - } else if(status == 2) { + } else if (status == 2) { if (choice == 2) { - if(cm.getMeso() < allianceCost) { + if (cm.getMeso() < allianceCost) { cm.sendOk("You don't have enough mesos for this request."); cm.dispose(); return; } cm.sendGetText("Now please enter the name of your new Guild Union. (max. 12 letters)"); } else if (choice == 3) { - if(cm.getAllianceCapacity() == allianceLimit) { + if (cm.getAllianceCapacity() == allianceLimit) { cm.sendOk("Your alliance already reached the maximum capacity for guilds."); cm.dispose(); return; } - if(cm.getMeso() < increaseCost) { + if (cm.getMeso() < increaseCost) { cm.sendOk("You don't have enough mesos for this request."); cm.dispose(); return; } - + cm.upgradeAlliance(); cm.gainMeso(-increaseCost); cm.sendOk("Your alliance can now accept one more guild."); @@ -134,16 +133,16 @@ function action(mode, type, selection) { } } else if (status == 3) { guildName = cm.getText(); - cm.sendYesNo("Will '"+ guildName + "' be the name of your Guild Union?"); + cm.sendYesNo("Will '" + guildName + "' be the name of your Guild Union?"); } else if (status == 4) { if (!cm.canBeUsedAllianceName(guildName)) { cm.sendNext("This name is unavailable, please choose another one."); //Not real text status = 1; choice = 2; } else { - if (cm.createAlliance(guildName) == null) + if (cm.createAlliance(guildName) == null) { cm.sendOk("Please check if you and the other one guild leader in your party are both here on this room right now, and make sure both guilds are currently unregistered on unions. No other guild leaders should be present with you 2 on this process."); - else { + } else { cm.gainMeso(-allianceCost); cm.sendOk("You have successfully formed a Guild Union."); } diff --git a/scripts/npc/2012000.js b/scripts/npc/2012000.js index c480f21cb6..3f39055460 100644 --- a/scripts/npc/2012000.js +++ b/scripts/npc/2012000.js @@ -1,31 +1,32 @@ -var ticket = new Array(4031047, 4031074, 4031331, 4031576); -var cost = new Array(5000, 6000, 30000, 6000); -var mapNames = new Array("Ellinia of Victoria Island", "Ludibrium", "Leafre", "Ariant"); -var mapName2 = new Array("Ellinia of Victoria Island", "Ludibrium", "Leafre of Minar Forest", "Nihal Desert"); +var ticket = [4031047, 4031074, 4031331, 4031576]; +var cost = [5000, 6000, 30000, 6000]; +var mapNames = ["Ellinia of Victoria Island", "Ludibrium", "Leafre", "Ariant"]; +var mapName2 = ["Ellinia of Victoria Island", "Ludibrium", "Leafre of Minar Forest", "Nihal Desert"]; var select; var status = 0; function start() { var where = "Hello, I'm in charge of selling tickets for the ship ride for every destination. Which ticket would you like to purchase?"; - for (var i = 0; i < ticket.length; i++) + for (var i = 0; i < ticket.length; i++) { where += "\r\n#L" + i + "##b" + mapNames[i] + "#k#l"; + } cm.sendSimple(where); } function action(mode, type, selection) { - if(mode < 1) { + if (mode < 1) { cm.dispose(); } else { status++; if (status == 1) { select = selection; - cm.sendYesNo("The ride to " + mapName2[select] + " takes off every " + (select == 0 ? 15 : 10) + " minutes, beginning on the hour, and it'll cost you #b"+cost[select]+" mesos#k. Are you sure you want to purchase #b#t"+ticket[select]+"##k?"); - } else if(status == 2) { - if (cm.getMeso() < cost[select] || !cm.canHold(ticket[select])) - cm.sendOk("Are you sure you have #b"+cost[select]+" mesos#k? If so, then I urge you to check you etc. inventory, and see if it's full or not."); - else { + cm.sendYesNo("The ride to " + mapName2[select] + " takes off every " + (select == 0 ? 15 : 10) + " minutes, beginning on the hour, and it'll cost you #b" + cost[select] + " mesos#k. Are you sure you want to purchase #b#t" + ticket[select] + "##k?"); + } else if (status == 2) { + if (cm.getMeso() < cost[select] || !cm.canHold(ticket[select])) { + cm.sendOk("Are you sure you have #b" + cost[select] + " mesos#k? If so, then I urge you to check you etc. inventory, and see if it's full or not."); + } else { cm.gainMeso(-cost[select]); - cm.gainItem(ticket[select],1); + cm.gainItem(ticket[select], 1); } cm.dispose(); } diff --git a/scripts/npc/2012001.js b/scripts/npc/2012001.js index eddd22db7e..9f857fd3d9 100644 --- a/scripts/npc/2012001.js +++ b/scripts/npc/2012001.js @@ -1,31 +1,31 @@ function start() { - if(cm.haveItem(4031047)){ + if (cm.haveItem(4031047)) { var em = cm.getEventManager("Boats"); - if (em.getProperty("entry") == "true") + if (em.getProperty("entry") == "true") { cm.sendYesNo("Do you want to go to Ellinia?"); - else{ + } else { cm.sendOk("The boat to Ellinia is already travelling, please be patient for the next one."); cm.dispose(); } - }else{ + } else { cm.sendOk("Make sure you got a Ellinia ticket to travel in this boat. Check your inventory."); cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); - cm.dispose(); - return; + cm.sendOk("Okay, talk to me if you change your mind!"); + cm.dispose(); + return; } - + var em = cm.getEventManager("Boats"); if (em.getProperty("entry") == "true") { cm.warp(200000112); cm.gainItem(4031047, -1); cm.dispose(); - } - else{ + } else { cm.sendOk("The boat to Ellinia is ready to take off, please be patient for the next one."); cm.dispose(); } diff --git a/scripts/npc/2012002.js b/scripts/npc/2012002.js index 3d21152254..d83d564073 100644 --- a/scripts/npc/2012002.js +++ b/scripts/npc/2012002.js @@ -33,19 +33,19 @@ function start() { } function action(mode, type, selection) { -if (mode == 0 && status == 1) { - cm.sendOk("Good choice"); - cm.dispose(); -} - if (mode > 0) - status++; - else + if (mode == 0 && status == 1) { + cm.sendOk("Good choice"); cm.dispose(); - - if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); } - else if (status == 2) { + if (mode > 0) { + status++; + } else { + cm.dispose(); + } + + if (status == 1) { + cm.sendNext("Alright, see you next time. Take care."); + } else if (status == 2) { cm.warp(200000111, 0);// back to Orbis jetty cm.dispose(); } diff --git a/scripts/npc/2012006.js b/scripts/npc/2012006.js index e2ea9c0ebc..99372d9173 100644 --- a/scripts/npc/2012006.js +++ b/scripts/npc/2012006.js @@ -1,15 +1,15 @@ var status = -1; var sel; -var destinations = new Array("Ellinia", "Ludibrium", "Leafre", "Mu Lung", "Ariant", "Ereve"); -var boatType = new Array("the ship", "the train", "the bird", "Hak", "Genie", "the ship"); +var destinations = ["Ellinia", "Ludibrium", "Leafre", "Mu Lung", "Ariant", "Ereve"]; +var boatType = ["the ship", "the train", "the bird", "Hak", "Genie", "the ship"]; function start() { - var message = "Orbis Station has lots of platforms available to choose from. You need to choose the one that'll take you to the destination of your choice. Which platform will you take?\r\n"; - for(var i = 0; i < destinations.length; i++){ - message += "\r\n#L" + i + "##bThe platform to " + boatType[i] + " that heads to " + destinations[i] + ".#l"; - } - cm.sendSimple(message); + var message = "Orbis Station has lots of platforms available to choose from. You need to choose the one that'll take you to the destination of your choice. Which platform will you take?\r\n"; + for (var i = 0; i < destinations.length; i++) { + message += "\r\n#L" + i + "##bThe platform to " + boatType[i] + " that heads to " + destinations[i] + ".#l"; + } + cm.sendSimple(message); } function action(mode, type, selection) { @@ -18,10 +18,10 @@ function action(mode, type, selection) { return; } status++; - if (status == 0){ + if (status == 0) { sel = selection; cm.sendNext("Ok #h #, I will send you to the platform for #b#m" + (200000110 + (sel * 10)) + "##k."); - }else if (status == 1) { + } else if (status == 1) { cm.warp(200000110 + (sel * 10), "west00"); cm.dispose(); } diff --git a/scripts/npc/2012007.js b/scripts/npc/2012007.js index b73c2fdcb9..308ab67d3d 100644 --- a/scripts/npc/2012007.js +++ b/scripts/npc/2012007.js @@ -47,81 +47,94 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; if (status == 1) { if (selection == 0) { beauty = 4; hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_d.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_d.length; i++) { pushIfItemExists(hairnew, mhair_d[i] + parseInt(cm.getPlayer().getHair() % 10)); - else - for (var i = 0; i < fhair_d.length; i++) + } + } else { + for (var i = 0; i < fhair_d.length; i++) { pushIfItemExists(hairnew, fhair_d[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } cm.sendYesNo("If you use the DRT coupon your hair will change RANDOMLY with a chance to obtain the basic styles that I came up with. Are you going to use #b#t5154000##k and really change your hairstyle?"); } else if (selection == 1) { beauty = 3; hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_r.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_r.length; i++) { pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); - else - for (var i = 0; i < fhair_r.length; i++) + } + } else { + for (var i = 0; i < fhair_r.length; i++) { pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } cm.sendYesNo("If you use the REG coupon your hair will change RANDOMLY. Are you going to use #b#t5150004##k and really change your hairstyle?"); } else if (selection == 2) { beauty = 1; hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_e.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_e.length; i++) { pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); - else - for (var i = 0; i < fhair_e.length; i++) + } + } else { + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } cm.sendYesNo("If you use the EXP coupon your hair will change RANDOMLY with a chance to obtain a new experimental style that I came up with. Are you going to use #b#t5150013##k and really change your hairstyle?"); } else if (selection == 3) { beauty = 2; haircolor = Array(); var current = (cm.getPlayer().getHair() / 10) | 0; - for (var i = 0; i < 8; i++) + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); + } cm.sendYesNo("If you use a regular coupon your hair color will change RANDOMLY. Do you still want to use #b#t5151004##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150013)){ + if (beauty == 1) { + if (cm.haveItem(5150013)) { cm.gainItem(5150013, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); - } else if (beauty == 2){ - if (cm.haveItem(5151004)){ + } + } else if (beauty == 2) { + if (cm.haveItem(5151004)) { cm.gainItem(5151004, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); - } else if (beauty == 3){ - if (cm.haveItem(5150004)){ + } + } else if (beauty == 3) { + if (cm.haveItem(5150004)) { cm.gainItem(5150004, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); - } else if (beauty == 4){ - if (cm.haveItem(5154000)){ + } + } else if (beauty == 4) { + if (cm.haveItem(5154000)) { cm.gainItem(5154000, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); - } else if (beauty == 0){ + } + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150013, 1); @@ -130,8 +143,9 @@ function action(mode, type, selection) { cm.gainMeso(-haircolorprice); cm.gainItem(5151004, 1); cm.sendOk("Enjoy!"); - } else + } else { cm.sendOk("You don't have enough mesos to buy a coupon!"); + } } } } diff --git a/scripts/npc/2012008.js b/scripts/npc/2012008.js index bf7cdcb96c..83dca3a17a 100644 --- a/scripts/npc/2012008.js +++ b/scripts/npc/2012008.js @@ -34,22 +34,24 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - if (status == 1) { - if (selection == 2) - cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); } - else if (status == 2){ + if (status == 1) { + if (selection == 2) { + cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); + } + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5153001)){ + if (cm.haveItem(5153001)) { cm.gainItem(5153001, -1); cm.setSkin(selection + 1); cm.sendOk("Enjoy your new and improved skin!"); - } else + } else { cm.sendOk("Um...you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); + } } } } diff --git a/scripts/npc/2012009.js b/scripts/npc/2012009.js index e45f7c289b..537026ba18 100644 --- a/scripts/npc/2012009.js +++ b/scripts/npc/2012009.js @@ -49,24 +49,26 @@ function action(mode, type, selection) { if (status == 1) { if (selection == 2) { facenew = Array(); - if (cm.getPlayer().getGender() == 0) - for (var i = 0; i < mface_r.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); - else - for (var i = 0; i < fface_r.length; i++) + } + } else { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152004##k?"); } - } - else if (status == 2){ - if (cm.haveItem(5152004)){ + } else if (status == 2) { + if (cm.haveItem(5152004)) { cm.gainItem(5152004, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); } else { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } - + cm.dispose(); } } diff --git a/scripts/npc/2012012.js b/scripts/npc/2012012.js index 7753307534..c2e4247b95 100644 --- a/scripts/npc/2012012.js +++ b/scripts/npc/2012012.js @@ -20,28 +20,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Can you help me find the Ancient Book? I lost it somewhere in El Nath..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Can you help me find the Ancient Book? I lost it somewhere in El Nath..."); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2012013.js b/scripts/npc/2012013.js index 9a6707c25f..6113d3b172 100644 --- a/scripts/npc/2012013.js +++ b/scripts/npc/2012013.js @@ -1,5 +1,5 @@ function start() { - if(cm.haveItem(4031074)){ + if (cm.haveItem(4031074)) { var em = cm.getEventManager("Trains"); if (em.getProperty("entry") == "true") { cm.sendYesNo("Do you want to go to Ludibrium?"); @@ -12,19 +12,19 @@ function start() { cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); + cm.sendOk("Okay, talk to me if you change your mind!"); cm.dispose(); - return; - } + return; + } var em = cm.getEventManager("Trains"); if (em.getProperty("entry") == "true") { cm.warp(200000122); cm.gainItem(4031074, -1); cm.dispose(); - } - else{ + } else { cm.sendOk("The train to Ludibrium is ready to take off, please be patient for the next one."); cm.dispose(); } diff --git a/scripts/npc/2012014.js b/scripts/npc/2012014.js index ac7689a247..818e3b9171 100644 --- a/scripts/npc/2012014.js +++ b/scripts/npc/2012014.js @@ -20,21 +20,21 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Orbis Magic Spot - Orbis Tower <1st Floor>(200082100) --- By --------------------------------------------------------------------------------------------- - Unknown --- Version Info ----------------------------------------------------------------------------------- - 1.2 - Now Official method (action(x,0,0) is weak) by Moogra - 1.1 - Official Text and Method [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Orbis Magic Spot - Orbis Tower <1st Floor>(200082100) + -- By --------------------------------------------------------------------------------------------- + Unknown + -- Version Info ----------------------------------------------------------------------------------- + 1.2 - Now Official method (action(x,0,0) is weak) by Moogra + 1.1 - Official Text and Method [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + **/ function start() { - if (cm.haveItem(4001019)) + if (cm.haveItem(4001019)) { cm.sendYesNo("You can use #b#t4001019##k to activate #b#p2012014##k. Will you teleport to where #b#p2012015##k is?"); - else { + } else { cm.sendOk("There's a #b#p2012014##k that'll enable you to teleport to where #b#p2012015##k is, but you can't activate it without the scroll."); cm.dispose(); } diff --git a/scripts/npc/2012015.js b/scripts/npc/2012015.js index aed5a87eec..631b604c7f 100644 --- a/scripts/npc/2012015.js +++ b/scripts/npc/2012015.js @@ -20,21 +20,21 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - El Nath Magic Spot - Orbis Tower <20th Floor>(200080200) --- By --------------------------------------------------------------------------------------------- - Unknown --- Version Info ----------------------------------------------------------------------------------- - 1.2 - Now official version (action(1,0,0) is stupid) by Moogra - 1.1 - Official Text and Method [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + El Nath Magic Spot - Orbis Tower <20th Floor>(200080200) + -- By --------------------------------------------------------------------------------------------- + Unknown + -- Version Info ----------------------------------------------------------------------------------- + 1.2 - Now official version (action(1,0,0) is stupid) by Moogra + 1.1 - Official Text and Method [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + **/ function start() { - if (cm.haveItem(4001019)) + if (cm.haveItem(4001019)) { cm.sendYesNo("You can use #b#t4001019##k to activate #b#p2012014##k. Will you teleport to where #b#p2012015##k is?"); - else { + } else { cm.sendOk("There's a #b#p2012015##k that'll enable you to teleport to where #b#p2012014##k is, but you can't activate it without the scroll."); cm.dispose(); } diff --git a/scripts/npc/2012021.js b/scripts/npc/2012021.js index 0544ebbe20..e9c10304ae 100644 --- a/scripts/npc/2012021.js +++ b/scripts/npc/2012021.js @@ -1,5 +1,5 @@ function start() { - if(cm.haveItem(4031331)){ + if (cm.haveItem(4031331)) { var em = cm.getEventManager("Cabin"); if (em.getProperty("entry") == "true") { cm.sendYesNo("Do you wish to board the flight?"); @@ -12,11 +12,12 @@ function start() { cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); + cm.sendOk("Okay, talk to me if you change your mind!"); cm.dispose(); - return; + return; } var em = cm.getEventManager("Cabin"); diff --git a/scripts/npc/2012022.js b/scripts/npc/2012022.js index 777e65c494..5196f31292 100644 --- a/scripts/npc/2012022.js +++ b/scripts/npc/2012022.js @@ -34,7 +34,7 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); + cm.sendNext("Alright, see you next time. Take care."); status++; } else if (status == 2) { cm.warp(200000131, 0);//Back to Orbis diff --git a/scripts/npc/2012023.js b/scripts/npc/2012023.js index 6ebaa66e10..a0f51c12fc 100644 --- a/scripts/npc/2012023.js +++ b/scripts/npc/2012023.js @@ -22,35 +22,36 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.haveItem(4031476)) { - cm.gainItem(4031476, -1); - - if(cm.canHold(4031456, 1)) { - cm.gainItem(4031456, 1); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4031476)) { + cm.gainItem(4031476, -1); + + if (cm.canHold(4031456, 1)) { + cm.gainItem(4031456, 1); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012024.js b/scripts/npc/2012024.js index d7436a9988..05fcf4c19e 100644 --- a/scripts/npc/2012024.js +++ b/scripts/npc/2012024.js @@ -35,7 +35,7 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); + cm.sendNext("Alright, see you next time. Take care."); status++; } else if (status == 2) { cm.warp(200000151, 0); diff --git a/scripts/npc/2012025.js b/scripts/npc/2012025.js index 0c93ad6b8f..c132762593 100644 --- a/scripts/npc/2012025.js +++ b/scripts/npc/2012025.js @@ -1,5 +1,5 @@ function start() { - if(cm.haveItem(4031576)){ + if (cm.haveItem(4031576)) { var em = cm.getEventManager("Genie"); if (em.getProperty("entry") == "true") { cm.sendYesNo("This will not be a short flight, so you need to take care of some things, I suggest you do that first before getting on board. Do you still wish to board the genie?"); @@ -12,13 +12,14 @@ function start() { cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); + cm.sendOk("Okay, talk to me if you change your mind!"); cm.dispose(); - return; + return; } - + var em = cm.getEventManager("Genie"); if (em.getProperty("entry") == "true") { cm.warp(200000152); @@ -26,6 +27,6 @@ function action(mode, type, selection) { } else { cm.sendOk("This genie is getting ready for takeoff. I'm sorry, but you'll have to get on the next ride. The ride schedule is available through the guide at the ticketing booth."); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2012027.js b/scripts/npc/2012027.js index cba57b8d63..09527141f6 100644 --- a/scripts/npc/2012027.js +++ b/scripts/npc/2012027.js @@ -25,74 +25,75 @@ var status; var harpNote = 'C'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); // infoEx without infoNumber, must use one progress only, critical hit! - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); // infoEx without infoNumber, must use one progress only, critical hit! + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012028.js b/scripts/npc/2012028.js index bfe547c32b..e9b01f8e82 100644 --- a/scripts/npc/2012028.js +++ b/scripts/npc/2012028.js @@ -25,74 +25,75 @@ var status; var harpNote = 'D'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012029.js b/scripts/npc/2012029.js index 4d769c2932..5afb01960a 100644 --- a/scripts/npc/2012029.js +++ b/scripts/npc/2012029.js @@ -25,74 +25,75 @@ var status; var harpNote = 'E'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012030.js b/scripts/npc/2012030.js index af7282a361..99c8b9a65e 100644 --- a/scripts/npc/2012030.js +++ b/scripts/npc/2012030.js @@ -25,74 +25,75 @@ var status; var harpNote = 'F'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012031.js b/scripts/npc/2012031.js index 4087b3f6f4..32d1014c9f 100644 --- a/scripts/npc/2012031.js +++ b/scripts/npc/2012031.js @@ -25,74 +25,75 @@ var status; var harpNote = 'G'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012032.js b/scripts/npc/2012032.js index edbc02f44d..1e11a7cce4 100644 --- a/scripts/npc/2012032.js +++ b/scripts/npc/2012032.js @@ -25,74 +25,75 @@ var status; var harpNote = 'A'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2012033.js b/scripts/npc/2012033.js index 0f38111ea3..95466013cf 100644 --- a/scripts/npc/2012033.js +++ b/scripts/npc/2012033.js @@ -25,74 +25,75 @@ var status; var harpNote = 'B'; var harpSounds = ["do", "re", "mi", "pa", "sol", "la", "si"]; // musical order detected thanks to Arufonsu var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|"; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); - - if(cm.isQuestStarted(3114)) { - var idx = -1 * cm.getQuestProgressInt(3114); - - if(idx > -1) { - var nextNote = harpSong[idx]; - - if(harpNote != nextNote) { - cm.setQuestProgress(3114, 0); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); - - cm.message("You've missed the note... Start over again."); - } else { - nextNote = harpSong[idx + 1]; - - if(nextNote == '|') { - idx++; - - if(idx == 45) { // finished lullaby - cm.message("Twinkle, twinkle, little star, how I wonder what you are."); - cm.setQuestProgress(3114, 42); - - cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); - cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); - - cm.dispose(); - return; - } else { - if(idx == 14) { - cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); - } else if(idx == 22) { - cm.message("Up above the world so high,"); - } else if(idx == 30) { - cm.message("like a diamond in the sky."); - } - } - } - - cm.setQuestProgress(3114, -1 * (idx + 1)); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getMap().broadcastMessage(PacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027])); + + if (cm.isQuestStarted(3114)) { + var idx = -1 * cm.getQuestProgressInt(3114); + + if (idx > -1) { + var nextNote = harpSong[idx]; + + if (harpNote != nextNote) { + cm.setQuestProgress(3114, 0); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/wrong_kor")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Failed")); + + cm.message("You've missed the note... Start over again."); + } else { + nextNote = harpSong[idx + 1]; + + if (nextNote == '|') { + idx++; + + if (idx == 45) { // finished lullaby + cm.message("Twinkle, twinkle, little star, how I wonder what you are."); + cm.setQuestProgress(3114, 42); + + cm.getPlayer().sendPacket(PacketCreator.showEffect("quest/party/clear")); + cm.getPlayer().sendPacket(PacketCreator.playSound("Party1/Clear")); + + cm.dispose(); + return; + } else { + if (idx == 14) { + cm.message("Twinkle, twinkle, little star, how I wonder what you are!"); + } else if (idx == 22) { + cm.message("Up above the world so high,"); + } else if (idx == 30) { + cm.message("like a diamond in the sky."); + } + } + } + + cm.setQuestProgress(3114, -1 * (idx + 1)); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2013000.js b/scripts/npc/2013000.js index 4ff0c6b40c..3d2b111099 100644 --- a/scripts/npc/2013000.js +++ b/scripts/npc/2013000.js @@ -23,93 +23,92 @@ * @npc: Wonky * @map: 200080101 - Orbis - The Unknown Tower * @func: Orbis PQ -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(cm.getMapId() == 200080101) { - if (status == 0) { - em = cm.getEventManager("OrbisPQ"); - if(em == null) { - cm.sendOk("The Orbis PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bTower of Goddess#k? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details.\r\n#L3#I would like to reclaim a prize."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else if (selection == 2) { - cm.sendOk("#e#b#k#n\r\nOur goddess has been missing since some time ago, rumor has it She has been seen last time inside the Tower of Goddess. Furthermore, our sanctuary has been seized by the overwhelming forces of the pixies, those beings that are recently wandering at the outskirts of Orbis. Their leader, Papa Pixie, currently holds the throne and may know Her whereabouts, so we urge to find a composition of brave heroes to charge into and claim back our sanctuary and rescue Her. If your team is able to be a composite of every job niche available (Warrior, Magician, Bowman, Thief and Pirate), you guys will receive my blessings to aid you in battle. Will you aid us?\r\n"); - cm.dispose(); - } - else { - cm.sendSimple("So, what prize do you want to obtain?\r\n#b#L0#Give me Goddess Wristband.\r\n"); - } - } else if (status == 2) { - if (selection == 0) { - if (!cm.haveItem(1082232) && cm.haveItem(4001158, 10)) { - cm.gainItem(1082232, 1); - cm.gainItem(4001158, -10); - cm.dispose(); - } else { - cm.sendOk("You either have Goddess Wristband already or you do not have 10 #t4001158#."); - cm.dispose(); - } - } - } - } else { - if(status == 0) { - cm.sendYesNo("Are you going to drop out from this rescue mission?"); - } else if(status == 1) { - cm.warp(920011200); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (cm.getMapId() == 200080101) { + if (status == 0) { + em = cm.getEventManager("OrbisPQ"); + if (em == null) { + cm.sendOk("The Orbis PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bTower of Goddess#k? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details.\r\n#L3#I would like to reclaim a prize."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else if (selection == 2) { + cm.sendOk("#e#b#k#n\r\nOur goddess has been missing since some time ago, rumor has it She has been seen last time inside the Tower of Goddess. Furthermore, our sanctuary has been seized by the overwhelming forces of the pixies, those beings that are recently wandering at the outskirts of Orbis. Their leader, Papa Pixie, currently holds the throne and may know Her whereabouts, so we urge to find a composition of brave heroes to charge into and claim back our sanctuary and rescue Her. If your team is able to be a composite of every job niche available (Warrior, Magician, Bowman, Thief and Pirate), you guys will receive my blessings to aid you in battle. Will you aid us?\r\n"); + cm.dispose(); + } else { + cm.sendSimple("So, what prize do you want to obtain?\r\n#b#L0#Give me Goddess Wristband.\r\n"); + } + } else if (status == 2) { + if (selection == 0) { + if (!cm.haveItem(1082232) && cm.haveItem(4001158, 10)) { + cm.gainItem(1082232, 1); + cm.gainItem(4001158, -10); + cm.dispose(); + } else { + cm.sendOk("You either have Goddess Wristband already or you do not have 10 #t4001158#."); + cm.dispose(); + } + } + } + } else { + if (status == 0) { + cm.sendYesNo("Are you going to drop out from this rescue mission?"); + } else if (status == 1) { + cm.warp(920011200); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2013001.js b/scripts/npc/2013001.js index 699dd060bb..897d2db8b9 100644 --- a/scripts/npc/2013001.js +++ b/scripts/npc/2013001.js @@ -3,16 +3,18 @@ * @npc: Chamberlain Eak * @map: Orbis - Tower of Goddess * @func: Orbis PQ -*/ + */ var status = 0; var em = null; function isStatueComplete() { - for(var i = 1; i <= 6; i++) { - if(cm.getMap().getReactorByName("scar" + i).getState() < 1) return false; + for (var i = 1; i <= 6; i++) { + if (cm.getMap().getReactorByName("scar" + i).getState() < 1) { + return false; + } } - + return true; } @@ -34,18 +36,19 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + if (cm.getPlayer().getMapId() == 920011200) { //exit cm.warp(200080101); cm.dispose(); return; } if (!cm.isEventLeader()) { - if(cm.getPlayer().getMapId() == 920010000) { + if (cm.getPlayer().getMapId() == 920010000) { cm.warp(920010000, 2); cm.dispose(); return; @@ -58,9 +61,9 @@ function action(mode, type, selection) { var eim = cm.getEventInstance(); - switch(cm.getPlayer().getMapId()) { + switch (cm.getPlayer().getMapId()) { case 920010000: - if(eim.getIntProperty("statusStg0") != 1) { + if (eim.getIntProperty("statusStg0") != 1) { eim.warpEventTeamToMapSpawnPoint(920010000, 2); eim.giveEventPlayersExp(3500); clearStage(0, eim); @@ -75,30 +78,30 @@ function action(mode, type, selection) { if (isStatueComplete()) { if (eim.getIntProperty("statusStg7") == -1) { eim.warpEventTeam(920010800); - } else if(eim.getIntProperty("statusStg8") == -1) { + } else if (eim.getIntProperty("statusStg8") == -1) { cm.sendOk("Oh! You brought the #t4001055#! Please, drop it at the base of the statue to bring Minerva back!"); } else { cm.sendOk("Thank you for saving Minerva! Please, talk to her..."); } } else { cm.sendOk("Please, save Minerva! Gather the six pieces of her statue and then talk to me to retrieve the final piece!"); - } + } break; case 920010200: //walkway - if (!cm.haveItem(4001050,30)) { + if (!cm.haveItem(4001050, 30)) { cm.sendOk("Gather the 30 Statue Pieces from the monsters in this stage, and please bring them to me so I can put them together!"); } else { cm.sendOk("You got them all! Here, the 1st statue piece."); cm.removeAll(4001050); - cm.gainItem(4001044,1); //first piece + cm.gainItem(4001044, 1); //first piece eim.giveEventPlayersExp(3500); clearStage(1, eim); } break; case 920010300: //storage - if(eim.getIntProperty("statusStg2") != 1) { - if(cm.getMap().countMonsters() == 0 && cm.getMap().countItems() == 0) { - if(cm.canHold(4001045)) { + if (eim.getIntProperty("statusStg2") != 1) { + if (cm.getMap().countMonsters() == 0 && cm.getMap().countItems() == 0) { + if (cm.canHold(4001045)) { cm.sendOk("Oh, I've found the 2nd Piece of Statue. Here, take it."); cm.gainItem(4001045, 1); eim.giveEventPlayersExp(3500); @@ -113,7 +116,7 @@ function action(mode, type, selection) { } else { cm.sendOk("Well done. Go find the other statue pieces."); } - + break; case 920010400: //lobby if (eim.getIntProperty("statusStg3") == -1) { @@ -124,7 +127,7 @@ function action(mode, type, selection) { eim.giveEventPlayersExp(3500); clearStage(3, eim); eim.setProperty("statusStg3", "2"); - + } else { cm.sendOk("Thank you so much!"); } @@ -132,14 +135,14 @@ function action(mode, type, selection) { case 920010500: //sealed if (eim.getIntProperty("statusStg4") == -1) { var total = 3; - for(var i = 0; i < 2; i++) { + for (var i = 0; i < 2; i++) { var rnd = Math.round(Math.random() * total); total -= rnd; - + eim.setProperty("stage4_" + i, rnd); } eim.setProperty("stage4_2", "" + total); - + eim.setProperty("statusStg4", "0"); } if (eim.getIntProperty("statusStg4") == 0) { @@ -179,13 +182,13 @@ function action(mode, type, selection) { cm.dispose(); break; case 920010600: //lounge - if(eim.getIntProperty("statusStg5") == -1) { - if (!cm.haveItem(4001052,40)) { + if (eim.getIntProperty("statusStg5") == -1) { + if (!cm.haveItem(4001052, 40)) { cm.sendOk("Gather the 40 Statue Pieces from the monsters in this stage, and please bring them to me so I can put them together!"); } else { cm.sendOk("You got them all! Here, the 5th statue piece."); cm.removeAll(4001052); - cm.gainItem(4001048,1); //fifth piece + cm.gainItem(4001048, 1); //fifth piece eim.giveEventPlayersExp(3500); clearStage(5, eim); eim.setIntProperty("statusStg5", 1); @@ -197,36 +200,42 @@ function action(mode, type, selection) { case 920010700: //on the way up if (eim.getIntProperty("statusStg6") == -1) { var rnd1 = Math.floor(Math.random() * 5); - + var rnd2 = Math.floor(Math.random() * 5); - while(rnd2 == rnd1) { + while (rnd2 == rnd1) { rnd2 = Math.floor(Math.random() * 5); } - - if(rnd1 > rnd2) { + + if (rnd1 > rnd2) { rnd1 = rnd1 ^ rnd2; rnd2 = rnd1 ^ rnd2; rnd1 = rnd1 ^ rnd2; } - + var comb = ""; - for(var i = 0; i < rnd1; i++) comb += "0"; + for (var i = 0; i < rnd1; i++) { + comb += "0"; + } comb += "1"; - for(var i = rnd1 + 1; i < rnd2; i++) comb += "0"; + for (var i = rnd1 + 1; i < rnd2; i++) { + comb += "0"; + } comb += "1"; - for(var i = rnd2 + 1; i < 5; i++) comb += "0"; - + for (var i = rnd2 + 1; i < 5; i++) { + comb += "0"; + } + eim.setProperty("stage6_c", "" + comb); - + eim.setProperty("statusStg6", "0"); } - + var comb = eim.getProperty("stage6_c"); - + if (eim.getIntProperty("statusStg6") == 0) { var react = ""; var total = 0; - for(var i = 1; i <= 5; i++) { + for (var i = 1; i <= 5; i++) { if (cm.getMap().getReactorByName("" + i).getState() > 0) { react += "1"; total += 1; @@ -234,7 +243,7 @@ function action(mode, type, selection) { react += "0"; } } - + if (total != 2) { cm.sendOk("There needs to be exactly 2 levers at the top of the map pushed on."); } else { @@ -243,7 +252,9 @@ function action(mode, type, selection) { for (var i = 0; i < 5; i++) { if (react.charCodeAt(i) == comb.charCodeAt(i)) { num_correct++; - if(react.charAt(i) == '1') psh_correct++; + if (react.charAt(i) == '1') { + psh_correct++; + } } } if (num_correct == 5) { @@ -265,17 +276,17 @@ function action(mode, type, selection) { } break; case 920010800: - cm.sendNext("Please, find a way to defeat Papa Pixie! Once you've found the Dark Nependeath by placing seeds, you've found Papa Pixie! Defeat it, and get the Root of Life to save Minerva!!!"); + cm.sendNext("Please, find a way to defeat Papa Pixie! Once you've found the Dark Nependeath by placing seeds, you've found Papa Pixie! Defeat it, and get the Root of Life to save Minerva!!!"); break; case 920010900: - if(eim.getProperty("statusStg8") == "1") { + if (eim.getProperty("statusStg8") == "1") { cm.sendNext("This is the jail of the tower. You may find some goodies here, just be sure to clear the puzzles ahead as fast as possible."); } else { cm.sendNext("Down there you will not find any statue pieces. Go up the ladder to return to the center tower and search elsewhere. You can come back here to get the goodies that lies down there once you have saved Minerva."); } break; case 920011000: - if(cm.getMap().countMonsters() > 0) { + if (cm.getMap().countMonsters() > 0) { cm.sendNext("This is the hidden room of the tower. After eliminating all monsters on this room, talk to me to gain access to the treasure room, leaving the center tower access behind."); } else { cm.warp(920011100, "st00"); diff --git a/scripts/npc/2013002.js b/scripts/npc/2013002.js index db0157f727..97a97709ce 100644 --- a/scripts/npc/2013002.js +++ b/scripts/npc/2013002.js @@ -31,35 +31,34 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { - status++; + } else { + status++; if (cm.getPlayer().getMapId() == 920010100) { //Center tower - if (status == 0) + if (status == 0) { cm.sendYesNo("I have lifted the spell that was blocking the access to the tower's jail storages. You may find some goodies down there... Alternatively, you may want to be leaving now. Are you ready to exit?"); - else if (status == 1) { + } else if (status == 1) { cm.warp(920011300, 0); cm.dispose(); } - + } else if (cm.getPlayer().getMapId() == 920011100) { - if (status == 0) + if (status == 0) { cm.sendYesNo("So, are you ready to exit?"); - else if (status == 1) { + } else if (status == 1) { cm.warp(920011300, 0); cm.dispose(); } - + } else if (cm.getPlayer().getMapId() == 920011300) { - if (status == 0) + if (status == 0) { cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end... As a token of gratitude, please accept this memento for your bravery."); - else if (status == 1) { - if(cm.getEventInstance().giveEventReward(cm.getPlayer())) { + } else if (status == 1) { + if (cm.getEventInstance().giveEventReward(cm.getPlayer())) { cm.warp(200080101, 0); cm.dispose(); - } - else { + } else { cm.sendOk("Please make room on your inventory first."); cm.dispose(); } diff --git a/scripts/npc/2020000.js b/scripts/npc/2020000.js index 2b93cea427..4cf23b0178 100644 --- a/scripts/npc/2020000.js +++ b/scripts/npc/2020000.js @@ -47,230 +47,219 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Hm? Who might you be? Oh, you've heard about my forging skills? In that case, I'd be glad to process some of your ores... for a fee.#b" - var options = new Array("Refine a mineral ore","Refine a jewel ore","Refine a rare jewel","Refine a crystal ore","Create materials","Create Arrows"); - for (var i = 0; i < options.length; i++){ + var options = ["Refine a mineral ore", "Refine a jewel ore", "Refine a rare jewel", "Refine a crystal ore", "Create materials", "Create Arrows"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //mineral refine + if (selectedType == 0) { //mineral refine var selStr = "So, what kind of mineral ore would you like to refine?#b"; - var minerals = new Array ("Bronze","Steel","Mithril","Adamantium","Silver","Orihalcon","Gold"); - for (var i = 0; i < minerals.length; i++){ + var minerals = ["Bronze", "Steel", "Mithril", "Adamantium", "Silver", "Orihalcon", "Gold"]; + for (var i = 0; i < minerals.length; i++) { selStr += "\r\n#L" + i + "# " + minerals[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 1){ //jewel refine + } else if (selectedType == 1) { //jewel refine var selStr = "So, what kind of jewel ore would you like to refine?#b"; - var jewels = new Array ("Garnet","Amethyst","Aquamarine","Emerald","Opal","Sapphire","Topaz","Diamond","Black Crystal"); - for (var i = 0; i < jewels.length; i++){ + var jewels = ["Garnet", "Amethyst", "Aquamarine", "Emerald", "Opal", "Sapphire", "Topaz", "Diamond", "Black Crystal"]; + for (var i = 0; i < jewels.length; i++) { selStr += "\r\n#L" + i + "# " + jewels[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 2){ //rock refine + } else if (selectedType == 2) { //rock refine var selStr = "A rare jewel? Which one were you thinking of?#b"; - var items = new Array ("Moon Rock","Star Rock"); - for (var i = 0; i < items.length; i++){ + var items = ["Moon Rock", "Star Rock"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 3){ //crystal refine + } else if (selectedType == 3) { //crystal refine var selStr = "Crystal ore? It's hard to find those around here...#b"; - var crystals = new Array ("Power Crystal","Wisdom Crystal","DEX Crystal","LUK Crystal","Dark Crystal"); - for (var i = 0; i < crystals.length; i++){ + var crystals = ["Power Crystal", "Wisdom Crystal", "DEX Crystal", "LUK Crystal", "Dark Crystal"]; + for (var i = 0; i < crystals.length; i++) { selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 4){ //material refine + } else if (selectedType == 4) { //material refine var selStr = "Materials? I know of a few materials that I can make for you...#b"; - var materials = new Array ("Make Processed Wood with Tree Branch","Make Processed Wood with Firewood","Make Screws (packs of 15)"); - for (var i = 0; i < materials.length; i++){ + var materials = ["Make Processed Wood with Tree Branch", "Make Processed Wood with Firewood", "Make Screws (packs of 15)"]; + for (var i = 0; i < materials.length; i++) { selStr += "\r\n#L" + i + "# " + materials[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 5){ //arrow refine + } else if (selectedType == 5) { //arrow refine var selStr = "Arrows? Not a problem at all.#b"; - var arrows = new Array ("Arrow for Bow","Arrow for Crossbow","Bronze Arrow for Bow","Bronze Arrow for Crossbow","Steel Arrow for Bow","Steel Arrow for Crossbow"); - for (var i = 0; i < arrows.length; i++){ + var arrows = ["Arrow for Bow", "Arrow for Crossbow", "Bronze Arrow for Bow", "Bronze Arrow for Crossbow", "Steel Arrow for Bow", "Steel Arrow for Crossbow"]; + for (var i = 0; i < arrows.length; i++) { selStr += "\r\n#L" + i + "# " + arrows[i] + "#l"; } equip = true; cm.sendSimple(selStr); } - if (equip) + if (equip) { status++; - } - else if (status == 2 && mode == 1) { + } + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //mineral refine - var itemSet = new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006); - var matSet = new Array(4010000,4010001,4010002,4010003,4010004,4010005,4010006); - var matQtySet = new Array(10,10,10,10,10,10,10); - var costSet = new Array(300,300,300,500,500,500,800); + if (selectedType == 0) { //mineral refine + var itemSet = [4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006]; + var matSet = [4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10]; + var costSet = [300, 300, 300, 500, 500, 500, 800]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //jewel refine + var itemSet = [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]; + var matSet = [4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10, 10, 10]; + var costSet = [500, 500, 500, 500, 500, 500, 500, 1000, 3000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //rock refine + var itemSet = [4011007, 4021009]; + var matSet = [[4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006], [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]]; + var matQtySet = [[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1]]; + var costSet = [10000, 15000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 3) { //crystal refine + var itemSet = [4005000, 4005001, 4005002, 4005003, 4005004]; + var matSet = [4004000, 4004001, 4004002, 4004003, 4004004]; + var matQtySet = [10, 10, 10, 10, 10]; + var costSet = [5000, 5000, 5000, 5000, 1000000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 4) { //material refine + var itemSet = [4003001, 4003001, 4003000]; + var matSet = [4000003, 4000018, [4011000, 4011001]]; + var matQtySet = [10, 5, [1, 1]]; + var costSet = [0, 0, 0]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //jewel refine - var itemSet = new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008); - var matSet = new Array(4020000,4020001,4020002,4020003,4020004,4020005,4020006,4020007,4020008); - var matQtySet = new Array(10,10,10,10,10,10,10,10,10); - var costSet = new Array (500,500,500,500,500,500,500,1000,3000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //rock refine - var itemSet = new Array(4011007,4021009); - var matSet = new Array(new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006), new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008)); - var matQtySet = new Array(new Array(1,1,1,1,1,1,1),new Array(1,1,1,1,1,1,1,1,1)); - var costSet = new Array(10000,15000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //crystal refine - var itemSet = new Array (4005000,4005001,4005002,4005003,4005004); - var matSet = new Array(4004000,4004001,4004002,4004003,4004004); - var matQtySet = new Array (10,10,10,10,10); - var costSet = new Array (5000,5000,5000,5000,1000000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 4){ //material refine - var itemSet = new Array (4003001,4003001,4003000); - var matSet = new Array(4000003,4000018,new Array (4011000,4011001)); - var matQtySet = new Array (10,5,new Array (1,1)); - var costSet = new Array (0,0,0); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - - cm.sendGetNumber(prompt,1,1,100) - } - else if (status == 3 && mode == 1) { + + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3 && mode == 1) { if (equip) { selectedItem = selection; qty = 1; - } - else + } else { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); - - if (selectedType == 5){ //arrow refine - var itemSet = new Array(2060000,2061000,2060001,2061001,2060002,2061002); - var matSet = new Array(new Array (4003001,4003004),new Array (4003001,4003004),new Array (4011000,4003001,4003004),new Array (4011000,4003001,4003004), - new Array (4011001,4003001,4003005),new Array (4011001,4003001,4003005)); - var matQtySet = new Array (new Array (1,1),new Array (1,1),new Array (1,3,10),new Array (1,3,10),new Array (1,5,15),new Array (1,5,15)); - var costSet = new Array (0,0,0,0,0,0); + } + + if (selectedType == 5) { //arrow refine + var itemSet = [2060000, 2061000, 2060001, 2061001, 2060002, 2061002]; + var matSet = [[4003001, 4003004], [4003001, 4003004], [4011000, 4003001, 4003004], [4011000, 4003001, 4003004], + [4011001, 4003001, 4003005], [4011001, 4003001, 4003005]]; + var matQtySet = [[1, 1], [1, 1], [1, 3, 10], [1, 3, 10], [1, 5, 15], [1, 5, 15]]; + var costSet = [0, 0, 0, 0, 0, 0]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - + var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - - prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; - } - } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - - if (cost > 0) - prompt += "\r\n#i4031138# " + cost * qty + " meso"; - - cm.sendYesNo(prompt); - } - else if (status == 4 && mode == 1) { - var recvItem = item, recvQty; - - if (item >= 2060000 && item <= 2060002) {//bow arrows - recvQty = 1000 - (item - 2060000) * 100; - } - else if (item >= 2061000 && item <= 2061002) {//xbow arrows - recvQty = 1000 - (item - 2061000) * 100; - } - else if (item == 4003000) {//screws - recvQty = 15 * qty; - } - else { - recvQty = qty; } - if(!cm.canHold(recvItem, recvQty)) { + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; + } + + if (cost > 0) { + prompt += "\r\n#i4031138# " + cost * qty + " meso"; + } + + cm.sendYesNo(prompt); + } else if (status == 4 && mode == 1) { + var recvItem = item, recvQty; + + if (item >= 2060000 && item <= 2060002) {//bow arrows + recvQty = 1000 - (item - 2060000) * 100; + } else if (item >= 2061000 && item <= 2061002) {//xbow arrows + recvQty = 1000 - (item - 2061000) * 100; + } else if (item == 4003000) {//screws + recvQty = 15 * qty; + } else { + recvQty = qty; + } + + if (!cm.canHold(recvItem, recvQty)) { cm.sendOk("I'm afraid you don't have a slot available for the item in your inventory."); } else if (cm.getMeso() < cost * qty) { cm.sendOk("I'm afraid you cannot afford my services."); } else { var complete = true; - + if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) { - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - } - else { - if (!cm.haveItem(mats, matQty * qty)) - complete = false; - } - - if (!complete) - cm.sendOk("I can't refine anything for you without the proper items."); - else { - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ - cm.gainItem(mats[i], -matQty[i] * qty); } } - else - cm.gainItem(mats, -matQty * qty); + } else { + if (!cm.haveItem(mats, matQty * qty)) { + complete = false; + } + } - if (cost > 0) + if (!complete) { + cm.sendOk("I can't refine anything for you without the proper items."); + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + cm.gainItem(mats[i], -matQty[i] * qty); + } + } else { + cm.gainItem(mats, -matQty * qty); + } + + if (cost > 0) { cm.gainMeso(-cost * qty); + } cm.gainItem(recvItem, recvQty); cm.sendOk("All done. If you need anything else, just ask."); } } - + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2020002.js b/scripts/npc/2020002.js index 37ecd3ece9..d75dcb020f 100644 --- a/scripts/npc/2020002.js +++ b/scripts/npc/2020002.js @@ -42,149 +42,146 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Hello there. El Nath winters are incredibly cold, you're going to need a warm pair of shoes to survive.#b" - var options = new Array("Create Warrior shoes","Create Bowman shoes","Create Magician shoes","Create Thief shoes"); - for (var i = 0; i < options.length; i++){ + var options = ["Create Warrior shoes", "Create Bowman shoes", "Create Magician shoes", "Create Thief shoes"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; var selStr; var shoes; - if (selectedType == 0){ //warrior shoes + if (selectedType == 0) { //warrior shoes selStr = "Warrior shoes? Okay, then which set?#b"; - var shoes = new Array ("Sapphire Camel Boots#k - Warrior Lv. 60#b","Orihalcon Camel Boots#k - Warrior Lv. 60#b","Blood Camel Boots#k - Warrior Lv. 60#b", - "Blue Carzen Boots#k - Warrior Lv. 70#b","Purple Carzen Boots#k - Warrior Lv. 70#b","Dark Carzen Boots#k - Warrior Lv. 70#b", - "Red Rivers Boots#k - Warrior Lv. 80#b","Blue Rivers Boots#k - Warrior Lv. 80#b","Dark Rivers Boots#k - Warrior Lv. 80#b"); - } - else if (selectedType == 1){ //bowman shoes + var shoes = ["Sapphire Camel Boots#k - Warrior Lv. 60#b", "Orihalcon Camel Boots#k - Warrior Lv. 60#b", "Blood Camel Boots#k - Warrior Lv. 60#b", + "Blue Carzen Boots#k - Warrior Lv. 70#b", "Purple Carzen Boots#k - Warrior Lv. 70#b", "Dark Carzen Boots#k - Warrior Lv. 70#b", + "Red Rivers Boots#k - Warrior Lv. 80#b", "Blue Rivers Boots#k - Warrior Lv. 80#b", "Dark Rivers Boots#k - Warrior Lv. 80#b"]; + } else if (selectedType == 1) { //bowman shoes selStr = "Bowman shoes? Okay, then which set?#b"; - var shoes = new Array ("Red Gore Boots#k - Bowman Lv. 60#b","Blue Gore Boots#k - Bowman Lv. 60#b","Green Gore Boots#k - Bowman Lv. 60#b", - "Blue Elf Boots#k - Bowman Lv. 70#b","Beige Elf Boots#k - Bowman Lv. 70#b","Green Elf Boots#k - Bowman Lv. 70#b","Dark Elf Boots#k - Bowman Lv. 70#b", - "Blue Wing Boots#k - Bowman Lv. 80#b","Red Wing Boots#k - Bowman Lv. 80#b","Green Wing Boots#k - Bowman Lv. 80#b","Dark Wing Boots#k - Bowman Lv. 80#b"); - } - else if (selectedType == 2){ //mage shoes + var shoes = ["Red Gore Boots#k - Bowman Lv. 60#b", "Blue Gore Boots#k - Bowman Lv. 60#b", "Green Gore Boots#k - Bowman Lv. 60#b", + "Blue Elf Boots#k - Bowman Lv. 70#b", "Beige Elf Boots#k - Bowman Lv. 70#b", "Green Elf Boots#k - Bowman Lv. 70#b", "Dark Elf Boots#k - Bowman Lv. 70#b", + "Blue Wing Boots#k - Bowman Lv. 80#b", "Red Wing Boots#k - Bowman Lv. 80#b", "Green Wing Boots#k - Bowman Lv. 80#b", "Dark Wing Boots#k - Bowman Lv. 80#b"]; + } else if (selectedType == 2) { //mage shoes selStr = "Magician shoes? Okay, then which set?#b"; - var shoes = new Array ("Pink Goldrunners#k - Magician Lv. 60#b","Green Goldrunners#k - Magician Lv. 60#b","Orange Goldrunners#k - Magician Lv. 60#b","Blue Goldrunners#k - Magician Lv. 60#b", - "Blue Lapiz Sandals#k - Magician Lv. 70#b","Red Lapiz Sandals#k - Magician Lv. 70#b","Brown Lapiz Sandals#k - Magician Lv. 70#b","Gold Lapiz Sandals#k - Magician Lv. 70#b", - "Green Enigma Shoes#k - Magician Lv. 80#b","Purple Enigma Shoes#k - Magician Lv. 80#b","Dark Enigma Shoes#k - Magician Lv. 80#b"); - } - else if (selectedType == 3){ //thief shoes + var shoes = ["Pink Goldrunners#k - Magician Lv. 60#b", "Green Goldrunners#k - Magician Lv. 60#b", "Orange Goldrunners#k - Magician Lv. 60#b", "Blue Goldrunners#k - Magician Lv. 60#b", + "Blue Lapiz Sandals#k - Magician Lv. 70#b", "Red Lapiz Sandals#k - Magician Lv. 70#b", "Brown Lapiz Sandals#k - Magician Lv. 70#b", "Gold Lapiz Sandals#k - Magician Lv. 70#b", + "Green Enigma Shoes#k - Magician Lv. 80#b", "Purple Enigma Shoes#k - Magician Lv. 80#b", "Dark Enigma Shoes#k - Magician Lv. 80#b"]; + } else if (selectedType == 3) { //thief shoes selStr = "Thief shoes? Okay, then which set?#b"; - var shoes = new Array ("Blood Moss Boots#k - Thief Lv. 60#b","Gold Moss Boots#k - Thief Lv. 60#b","Dark Moss Boots#k - Thief Lv. 60#b", - "Purple Mystique Shoes#k - Thief Lv. 70#b","Blue Mystique Shoes#k - Thief Lv. 70#b","Red Mystique Shoes#k - Thief Lv. 70#b", - "Green Pirate Boots#k - Thief Lv. 80#b","Red Pirate Boots#k - Thief Lv. 80#b","Dark Pirate Boots#k - Thief Lv. 80#b"); + var shoes = ["Blood Moss Boots#k - Thief Lv. 60#b", "Gold Moss Boots#k - Thief Lv. 60#b", "Dark Moss Boots#k - Thief Lv. 60#b", + "Purple Mystique Shoes#k - Thief Lv. 70#b", "Blue Mystique Shoes#k - Thief Lv. 70#b", "Red Mystique Shoes#k - Thief Lv. 70#b", + "Green Pirate Boots#k - Thief Lv. 80#b", "Red Pirate Boots#k - Thief Lv. 80#b", "Dark Pirate Boots#k - Thief Lv. 80#b"]; } - for (var i = 0; i < shoes.length; i++){ + for (var i = 0; i < shoes.length; i++) { selStr += "\r\n#L" + i + "# " + shoes[i] + "#l"; } cm.sendSimple(selStr); - } - else if (status == 2 && mode == 1) { + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //warrior shoes - var itemSet = new Array(1072147,1072148,1072149,1072154,1072155,1072156,1072210,1072211,1072212); - var matSet = new Array(new Array(4021008,4011007,4021005,4000030,4003000),new Array(4021008,4011007,4011005,4000030,4003000),new Array(4021008,4011007,4021000,4000030,4003000), - new Array(4005000,4005002,4011002,4000048,4003000),new Array(4005000,4005002,4011005,4000048,4003000),new Array(4005000,4005002,4021008,4000048,4003000), - new Array(4005000,4005002,4021000,4000030,4003000),new Array(4005000,4005002,4021002,4000030,4003000),new Array(4005000,4005002,4021008,4000030,4003000)); - var matQtySet = new Array(new Array(1,1,8,80,55),new Array(1,1,8,80,55),new Array(1,1,8,80,55),new Array(1,3,5,100,55),new Array(2,2,5,100,55),new Array(3,1,1,100,55), - new Array(2,3,7,90,65),new Array(3,2,7,90,65),new Array(4,1,2,90,65)); - var costSet = new Array(60000,60000,60000,70000,70000,70000,80000,80000,80000); + if (selectedType == 0) { //warrior shoes + var itemSet = [1072147, 1072148, 1072149, 1072154, 1072155, 1072156, 1072210, 1072211, 1072212]; + var matSet = [[4021008, 4011007, 4021005, 4000030, 4003000], [4021008, 4011007, 4011005, 4000030, 4003000], [4021008, 4011007, 4021000, 4000030, 4003000], + [4005000, 4005002, 4011002, 4000048, 4003000], [4005000, 4005002, 4011005, 4000048, 4003000], [4005000, 4005002, 4021008, 4000048, 4003000], + [4005000, 4005002, 4021000, 4000030, 4003000], [4005000, 4005002, 4021002, 4000030, 4003000], [4005000, 4005002, 4021008, 4000030, 4003000]]; + var matQtySet = [[1, 1, 8, 80, 55], [1, 1, 8, 80, 55], [1, 1, 8, 80, 55], [1, 3, 5, 100, 55], [2, 2, 5, 100, 55], [3, 1, 1, 100, 55], + [2, 3, 7, 90, 65], [3, 2, 7, 90, 65], [4, 1, 2, 90, 65]]; + var costSet = [60000, 60000, 60000, 70000, 70000, 70000, 80000, 80000, 80000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 1){ //bowman shoes - var itemSet = new Array(1072144,1072145,1072146,1072164,1072165,1072166,1072167,1072182,1072183,1072184,1072185); - var matSet = new Array(new Array(4011006,4021000,4021007,4000030,4003000),new Array(4011006,4021005,4021007,4000030,4003000),new Array(4011006,4021003,4021007,4000030,4003000), - new Array(4005002,4005000,4021005,4000055,4003000),new Array(4005002,4005000,4021004,4000055,4003000),new Array(4005002,4005000,4021003,4000055,4003000),new Array(4005002,4005000,4021008,4000055,4003000), - new Array(4005002,4005000,4021002,4000030,4003000),new Array(4005002,4005000,4021000,4000030,4003000),new Array(4005002,4005000,4021003,4000030,4003000),new Array(4005002,4021008,4000030,4003000)); - var matQtySet = new Array(new Array(5,8,1,75,50),new Array(5,8,1,75,50),new Array(5,8,1,75,50),new Array(1,3,5,100,55),new Array(2,2,5,100,55),new Array(2,2,5,100,55),new Array(3,1,1,100,55), - new Array(2,3,7,90,60),new Array(3,2,7,90,60),new Array(4,1,7,90,60),new Array(5,2,90,60)); - var costSet = new Array(60000,60000,60000,70000,70000,70000,70000,80000,80000,80000,80000); + } else if (selectedType == 1) { //bowman shoes + var itemSet = [1072144, 1072145, 1072146, 1072164, 1072165, 1072166, 1072167, 1072182, 1072183, 1072184, 1072185]; + var matSet = [[4011006, 4021000, 4021007, 4000030, 4003000], [4011006, 4021005, 4021007, 4000030, 4003000], [4011006, 4021003, 4021007, 4000030, 4003000], + [4005002, 4005000, 4021005, 4000055, 4003000], [4005002, 4005000, 4021004, 4000055, 4003000], [4005002, 4005000, 4021003, 4000055, 4003000], [4005002, 4005000, 4021008, 4000055, 4003000], + [4005002, 4005000, 4021002, 4000030, 4003000], [4005002, 4005000, 4021000, 4000030, 4003000], [4005002, 4005000, 4021003, 4000030, 4003000], [4005002, 4021008, 4000030, 4003000]]; + var matQtySet = [[5, 8, 1, 75, 50], [5, 8, 1, 75, 50], [5, 8, 1, 75, 50], [1, 3, 5, 100, 55], [2, 2, 5, 100, 55], [2, 2, 5, 100, 55], [3, 1, 1, 100, 55], + [2, 3, 7, 90, 60], [3, 2, 7, 90, 60], [4, 1, 7, 90, 60], [5, 2, 90, 60]]; + var costSet = [60000, 60000, 60000, 70000, 70000, 70000, 70000, 80000, 80000, 80000, 80000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //mage shoes - var itemSet = new Array(1072136,1072137,1072138,1072139,1072157,1072158,1072159,1072160,1072177,1072178,1072179); - var matSet = new Array(new Array(4021009,4011006,4011005,4000030,4003000),new Array(4021009,4011006,4021003,4000030,4003000),new Array(4021009,4011006,4011003,4000030,4003000),new Array(4021009,4011006,4021002,4000030,4003000), - new Array(4005001,4005003,4021002,4000051,4003000),new Array(4005001,4005003,4021000,4000051,4003000),new Array(4005001,4005003,4011003,4000051,4003000),new Array(4005001,4005003,4011006,4000051,4003000), - new Array(4005001,4005003,4021003,4000030,4003000),new Array(4005001,4005003,4021001,4000030,4003000),new Array(4005001,4005003,4021008,4000030,4003000)); - var matQtySet = new Array(new Array(1,4,5,70,50),new Array(1,4,5,70,50),new Array(1,4,5,70,50),new Array(1,4,5,70,50), - new Array(1,3,5,100,55),new Array(2,2,5,100,55),new Array(2,2,5,100,55),new Array(3,1,3,100,55), - new Array(2,3,7,85,60),new Array(3,2,7,85,60),new Array(4,1,2,85,60)); - var costSet = new Array(60000,60000,60000,60000,70000,70000,70000,70000,80000,80000,80000); + } else if (selectedType == 2) { //mage shoes + var itemSet = [1072136, 1072137, 1072138, 1072139, 1072157, 1072158, 1072159, 1072160, 1072177, 1072178, 1072179]; + var matSet = [[4021009, 4011006, 4011005, 4000030, 4003000], [4021009, 4011006, 4021003, 4000030, 4003000], [4021009, 4011006, 4011003, 4000030, 4003000], [4021009, 4011006, 4021002, 4000030, 4003000], + [4005001, 4005003, 4021002, 4000051, 4003000], [4005001, 4005003, 4021000, 4000051, 4003000], [4005001, 4005003, 4011003, 4000051, 4003000], [4005001, 4005003, 4011006, 4000051, 4003000], + [4005001, 4005003, 4021003, 4000030, 4003000], [4005001, 4005003, 4021001, 4000030, 4003000], [4005001, 4005003, 4021008, 4000030, 4003000]]; + var matQtySet = [[1, 4, 5, 70, 50], [1, 4, 5, 70, 50], [1, 4, 5, 70, 50], [1, 4, 5, 70, 50], + [1, 3, 5, 100, 55], [2, 2, 5, 100, 55], [2, 2, 5, 100, 55], [3, 1, 3, 100, 55], + [2, 3, 7, 85, 60], [3, 2, 7, 85, 60], [4, 1, 2, 85, 60]]; + var costSet = [60000, 60000, 60000, 60000, 70000, 70000, 70000, 70000, 80000, 80000, 80000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //thief shoes - var itemSet = new Array (1072150,1072151,1072152,1072161,1072162,1072163,1072172,1072173,1072174); - var matSet = new Array(new Array(4021007,4011007,4021000,4000030,4003000),new Array(4021007,4011007,4011006,4000030,4003000),new Array(4021007,4011007,4021008,4000030,4003000), - new Array(4005003,4005000,4021001,4000051,4003000),new Array(4005003,4005002,4021005,4000051,4003000),new Array(4005002,4005003,4021000,4000051,4003000), - new Array(4005000,4005003,4021003,4000030,4003000),new Array(4005002,4005003,4021000,4000030,4003000),new Array(4005003,4005002,4021008,4000030,4003000)); - var matQtySet = new Array(new Array(1,1,8,75,50),new Array(1,1,5,75,50),new Array(1,1,1,75,50), - new Array(1,3,5,100,55),new Array(1,3,5,100,55),new Array(1,3,5,100,55), - new Array(3,2,7,90,60),new Array(3,2,7,90,60),new Array(3,2,7,90,60)); - var costSet = new Array(60000,60000,60000,70000,70000,70000,80000,80000,80000); + } else if (selectedType == 3) { //thief shoes + var itemSet = [1072150, 1072151, 1072152, 1072161, 1072162, 1072163, 1072172, 1072173, 1072174]; + var matSet = [[4021007, 4011007, 4021000, 4000030, 4003000], [4021007, 4011007, 4011006, 4000030, 4003000], [4021007, 4011007, 4021008, 4000030, 4003000], + [4005003, 4005000, 4021001, 4000051, 4003000], [4005003, 4005002, 4021005, 4000051, 4003000], [4005002, 4005003, 4021000, 4000051, 4003000], + [4005000, 4005003, 4021003, 4000030, 4003000], [4005002, 4005003, 4021000, 4000030, 4003000], [4005003, 4005002, 4021008, 4000030, 4003000]]; + var matQtySet = [[1, 1, 8, 75, 50], [1, 1, 5, 75, 50], [1, 1, 1, 75, 50], + [1, 3, 5, 100, 55], [1, 3, 5, 100, 55], [1, 3, 5, 100, 55], + [3, 2, 7, 90, 60], [3, 2, 7, 90, 60], [3, 2, 7, 90, 60]]; + var costSet = [60000, 60000, 60000, 70000, 70000, 70000, 80000, 80000, 80000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array) - for(var i = 0; i < mats.length; i++) - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; - else - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; - if (cost > 0) + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; + } + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; + } cm.sendYesNo(prompt); - } - else if (status == 3 && mode == 1) { + } else if (status == 3 && mode == 1) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) { + } else if (cm.getMeso() < cost) { cm.sendOk("I'm afraid you cannot afford my services."); cm.dispose(); return; - } - else { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; + } } - if (!complete) + if (!complete) { cm.sendOk("I only make quality goods, which I cannot do without the proper materials."); - else { - if (mats instanceof Array) - for (var i = 0; i < mats.length; i++) + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty [i]); - else - cm.gainItem(mats, -matQty ); + } + } else { + cm.gainItem(mats, -matQty); + } cm.gainMeso(-cost); cm.gainItem(item, 1); cm.sendOk("All done. Stay warm!"); diff --git a/scripts/npc/2020005.js b/scripts/npc/2020005.js index 7a5ba4440c..db01d896b1 100644 --- a/scripts/npc/2020005.js +++ b/scripts/npc/2020005.js @@ -20,24 +20,24 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Alcaster - El Nath Market (211000100) --- By --------------------------------------------------------------------------------------------- - Unknown & Information & xQuasar --- Version Info ----------------------------------------------------------------------------------- - 1.3 - Fixed up completely [xQuasar] - 1.2 - Add a missing text part [Information] - 1.1 - Recoded to official [Information] - 1.0 - First Version by Unknown ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Alcaster - El Nath Market (211000100) + -- By --------------------------------------------------------------------------------------------- + Unknown & Information & xQuasar + -- Version Info ----------------------------------------------------------------------------------- + 1.3 - Fixed up completely [xQuasar] + 1.2 - Add a missing text part [Information] + 1.1 - Recoded to official [Information] + 1.0 - First Version by Unknown + --------------------------------------------------------------------------------------------------- + **/ var selected; var amount; var totalcost; -var item = new Array(2050003,2050004,4006000,4006001); -var cost = new Array(300,400,5000,5000); -var msg = new Array("that cures the state of being sealed and cursed","that cures all",", possessing magical power, that is used for high-quality skills",", possessing the power of summoning that is used for high-quality skills"); +var item = [2050003, 2050004, 4006000, 4006001]; +var cost = [300, 400, 5000, 5000]; +var msg = ["that cures the state of being sealed and cursed", "that cures all", ", possessing magical power, that is used for high-quality skills", ", possessing the power of summoning that is used for high-quality skills"]; var status; function start() { @@ -51,7 +51,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - if(mode == 0 && status == 2) { + if (mode == 0 && status == 2) { cm.sendNext("I see. Understand that I have many different items here. Take a look around. I'm only selling these items to you, so I won't be ripping you off in any way shape or form."); cm.dispose(); return; @@ -60,30 +60,28 @@ function action(mode, type, selection) { cm.dispose(); return; } - + status++; if (status == 0) { var selStr = ""; - for (var i = 0; i < item.length; i++){ - selStr += "\r\n#L" + i + "# #b#t" + item[i] + "# (Price: "+cost[i]+" mesos)#k#l"; + for (var i = 0; i < item.length; i++) { + selStr += "\r\n#L" + i + "# #b#t" + item[i] + "# (Price: " + cost[i] + " mesos)#k#l"; } - cm.sendSimple("Thanks to you #b#t4031056##k is safely sealed. Of course, also as a result, I used up about half of the power I have accumulated over the last 800 years or so...but now I can die in peace. Oh, by the way... are you looking for rare items by any chance? As a sign of appreciation for your hard work, I'll sell some items I have to you, and ONLY you. Pick out the one you want!"+selStr); - } - else if (status == 1) { + cm.sendSimple("Thanks to you #b#t4031056##k is safely sealed. Of course, also as a result, I used up about half of the power I have accumulated over the last 800 years or so...but now I can die in peace. Oh, by the way... are you looking for rare items by any chance? As a sign of appreciation for your hard work, I'll sell some items I have to you, and ONLY you. Pick out the one you want!" + selStr); + } else if (status == 1) { selected = selection; - cm.sendGetNumber("Is #b#t"+item[selected]+"##k really the item that you need? It's the item "+msg[selected]+". It may not be the easiest item to acquire, but I'll give you a good deal on it. It'll cost you #b"+cost[selected]+" mesos#k per item. How many would you like to purchase?", 0, 1, 100); - } - else if (status == 2) { + cm.sendGetNumber("Is #b#t" + item[selected] + "##k really the item that you need? It's the item " + msg[selected] + ". It may not be the easiest item to acquire, but I'll give you a good deal on it. It'll cost you #b" + cost[selected] + " mesos#k per item. How many would you like to purchase?", 0, 1, 100); + } else if (status == 2) { amount = selection; totalcost = cost[selected] * amount; if (amount == 0) { cm.sendOk("If you're not going to buy anything, then I've got nothing to sell neither."); cm.dispose(); } - cm.sendYesNo("Are you sure you want to buy #r"+amount+" #t"+item[selected]+"(s)##k? It'll cost you "+cost[selected]+" mesos per #t"+item[selected]+"#, which will cost you #r"+totalcost+" mesos#k in total."); - } else if(status == 3) { - if(cm.getMeso() < totalcost || !cm.canHold(item[selected])) { - cm.sendNext("Are you sure you have enough mesos? Please check and see if your etc. or use inventory is full, or if you have at least #r"+totalcost+"#k mesos."); + cm.sendYesNo("Are you sure you want to buy #r" + amount + " #t" + item[selected] + "(s)##k? It'll cost you " + cost[selected] + " mesos per #t" + item[selected] + "#, which will cost you #r" + totalcost + " mesos#k in total."); + } else if (status == 3) { + if (cm.getMeso() < totalcost || !cm.canHold(item[selected])) { + cm.sendNext("Are you sure you have enough mesos? Please check and see if your etc. or use inventory is full, or if you have at least #r" + totalcost + "#k mesos."); cm.dispose(); } cm.sendNext("Thank you. If you ever find yourself needing items down the road, make sure to drop by here. I may have gotten old over the years, but I can still make magic items with ease."); diff --git a/scripts/npc/2020008.js b/scripts/npc/2020008.js index 58e8e81a94..5e4b8b5454 100644 --- a/scripts/npc/2020008.js +++ b/scripts/npc/2020008.js @@ -23,129 +23,143 @@ status = -1; var job; var sel; -actionx = {"Mental" : false, "Physical" : false}; +actionx = {"Mental": false, "Physical": false}; function start() { - if(cm.isQuestStarted(6192)) { - if(cm.getParty() == null) { + if (cm.isQuestStarted(6192)) { + if (cm.getParty() == null) { cm.sendOk("Form a party to start this instance."); cm.dispose(); return; } - + var em = cm.getEventManager("ElnathPQ"); - if(em == null) { + if (em == null) { cm.sendOk("The El Nath PQ has encountered an error."); cm.dispose(); return; } - + var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { cm.sendOk("Another party is already challenging this instance. Please try another channel, or wait for the current party to finish."); } - } - else { + } else { cm.sendOk("You cannot start this instance yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); } - + cm.dispose(); return; } - + var jobBase = parseInt(cm.getJobId() / 100); var jobStyle = 1; - if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)){ - if(cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { + if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)) { + if (cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { status++; action(1, 0, 1); return; } - + cm.sendNext("Hi there."); cm.dispose(); return; } - if (cm.haveItem(4031058)) + if (cm.haveItem(4031058)) { actionx["Mental"] = true; - else if (cm.haveItem(4031057)) + } else if (cm.haveItem(4031057)) { actionx["Physical"] = true; + } cm.sendSimple("Can I help you?#b" + (cm.getJobId() % 10 == 0 ? "\r\n#L0#I want to make the 3th job advancement." : "") + "\r\n#L1#Please allow me to do the Zakum Dungeon Quest."); } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; if (mode == 0 && type == 0) { status -= 2; - } else if(mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3){ - if (mode == 0 && type == 1) + } else if (mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3) { + if (mode == 0 && type == 1) { cm.sendNext("Make up your mind."); + } cm.dispose(); return; } - if (actionx["Mental"]){ - if (status == 0) + if (actionx["Mental"]) { + if (status == 0) { cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we takeon the next step."); - else if (status == 1) + } else if (status == 1) { cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful warrior through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); - else if (status == 2) { - if (cm.getPlayer().getRemainingSp() > 0) + } else if (status == 2) { + if (cm.getPlayer().getRemainingSp() > 0) { if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { cm.sendNext("Please, use all your SP before continuing."); cm.dispose(); return; } + } if (cm.getJobId() % 10 == 0) { cm.gainItem(4031058, -1); cm.changeJobById(cm.getJobId() + 1); cm.getPlayer().removePartyQuestItem("JBQ"); } - if(Math.floor(cm.getJobId() / 10) == 11) cm.sendNext("You have just become the #bCrusader#k. A number of new attacking skills such as #bShout#k and #bCombo Attack#k are devastating, while #bArmor Crash#k will put a dent on the monsters' defensive abilities. It'll be best to concentrate on acquiring skills with the weapon you mastered during the days as a Fighter."); - else if(Math.floor(cm.getJobId() / 10) == 12) cm.sendNext("You have just become the #bWhite Knight#k. You'll be introduced to a new skill book featuring various new attacking skills as well as element-based attacks. It's recommended that the type of weapon complementary to the Page, whether it be a sword or a blunt weapon, should be continued as the White Knight. There's a skill called #bCharge#k, which adds an element of ice, fire and lightning to the weapon, making White Knight the only warrior that can perform element-based attacks. Charge up your weapon with an element that weakens the monster, and then apply massive damage with the #bCharged Blow#k. This will definitely make you a devastating force around here."); - else cm.sendNext("You're #bDragon Knight#k from here on out. You'll be introduced to a range of new attacking skills for spears and pole arms, and whatever weapon was chosen as the Spearman should be continued as the Dragon Knigth. Skills such as #bCrusher#k (maximum damage to one monster) and #bDragon Fury#k (damage to multiple monsters) are recommended as main attacking skills of choice, while a skill called #bDragon Roar#k will damage everything on screen with devasting force. The downside is the fact that the skill uses up over half of the available HP."); + if (Math.floor(cm.getJobId() / 10) == 11) { + cm.sendNext("You have just become the #bCrusader#k. A number of new attacking skills such as #bShout#k and #bCombo Attack#k are devastating, while #bArmor Crash#k will put a dent on the monsters' defensive abilities. It'll be best to concentrate on acquiring skills with the weapon you mastered during the days as a Fighter."); + } else if (Math.floor(cm.getJobId() / 10) == 12) { + cm.sendNext("You have just become the #bWhite Knight#k. You'll be introduced to a new skill book featuring various new attacking skills as well as element-based attacks. It's recommended that the type of weapon complementary to the Page, whether it be a sword or a blunt weapon, should be continued as the White Knight. There's a skill called #bCharge#k, which adds an element of ice, fire and lightning to the weapon, making White Knight the only warrior that can perform element-based attacks. Charge up your weapon with an element that weakens the monster, and then apply massive damage with the #bCharged Blow#k. This will definitely make you a devastating force around here."); + } else { + cm.sendNext("You're #bDragon Knight#k from here on out. You'll be introduced to a range of new attacking skills for spears and pole arms, and whatever weapon was chosen as the Spearman should be continued as the Dragon Knigth. Skills such as #bCrusher#k (maximum damage to one monster) and #bDragon Fury#k (damage to multiple monsters) are recommended as main attacking skills of choice, while a skill called #bDragon Roar#k will damage everything on screen with devasting force. The downside is the fact that the skill uses up over half of the available HP."); + } } else if (status == 3) { cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); } - }else if (actionx["Physical"]){ - if (status == 0) + } else if (actionx["Physical"]) { + if (status == 0) { cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); - else if (status == 1){ - if (cm.haveItem(4031057)){ + } else if (status == 1) { + if (cm.haveItem(4031057)) { cm.gainItem(4031057, -1); cm.getPlayer().setPartyQuestItemObtained("JBQ"); } cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); - } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0){ + } + } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0) { cm.sendNext("Go, talk with #b#p1022000##k and bring me #b#t4031057##k."); cm.dispose(); - } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0){ + } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0) { cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); cm.dispose(); } else { - if (sel == undefined) + if (sel == undefined) { sel = selection; - if (sel == 0){ - if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0){ - if (status == 0) + } + if (sel == 0) { + if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0) { + if (status == 0) { cm.sendYesNo("Welcome. I'm #b#p2020008##k, the chief of all warriors, in charge of bringing out the best in each and every warrior that needs my guidance. You seem like the kind of warrior that wants to make the leap forward, the one ready to take on the challenges of the 3th job advancement. But I've seen countless warriors eager to make the jump just like you, only to see them fail. What about you? Are you ready to be tested and make the 3th job advancement?"); - else if (status == 1){ + } else if (status == 1) { cm.getPlayer().setPartyQuestItemObtained("JB3"); cm.sendNext("Good. You will be tested on two important aspects of the warrior: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1022000##k from Perion? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1022000#."); - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1022000##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); + } } } else { - if (cm.getPlayer().getLevel() >= 50){ - cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); - if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); + if (cm.getPlayer().getLevel() >= 50) { + cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); + if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { + cm.startQuest(100200); + } const YamlConfig = Java.type('config.YamlConfig'); - if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); - }else + if (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) { + cm.completeQuest(100201); + } + } else { cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); + } cm.dispose(); } } diff --git a/scripts/npc/2020009.js b/scripts/npc/2020009.js index ba0310fbcd..08af26e064 100644 --- a/scripts/npc/2020009.js +++ b/scripts/npc/2020009.js @@ -23,102 +23,117 @@ status = -1; var job; var sel; -actionx = {"Mental" : false, "Physical" : false}; +actionx = {"Mental": false, "Physical": false}; function start() { var jobBase = parseInt(cm.getJobId() / 100); var jobStyle = 2; - if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)){ - if(cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { + if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)) { + if (cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { status++; action(1, 0, 1); return; } - + cm.sendNext("Hi there."); cm.dispose(); return; } - if (cm.haveItem(4031058)) - actionx["Mental"] = true; - else if (cm.haveItem(4031057)) - actionx["Physical"] = true; + if (cm.haveItem(4031058)) { + actionx["Mental"] = true; + } else if (cm.haveItem(4031057)) { + actionx["Physical"] = true; + } cm.sendSimple("Anything you want from me?#b" + (cm.getJobId() % 10 == 0 ? "\r\n#L0#I want to make the 3th job advancement." : "") + "\r\n#L1#Please allow me to do the Zakum Dungeon Quest."); } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; - if (mode == 0 && type == 0) { - status -= 2; - } else if(mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3){ - if (mode == 0 && type == 1) - cm.sendNext("Make up your mind."); - cm.dispose(); - return; - } - if (actionx["Mental"]){ - if (status == 0) - cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we takeon the next step."); - else if (status == 1) - cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful adventurer through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); - else if (status == 2) { - if (cm.getPlayer().getRemainingSp() > 0) - if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { - cm.sendNext("Please, use all your SP before continuing."); - cm.dispose(); - return; - } - if (cm.getJobId() % 10 == 0) { - cm.gainItem(4031058, -1); - cm.changeJobById(cm.getJobId() + 1); - cm.getPlayer().removePartyQuestItem("JBQ"); - } - - if(Math.floor(cm.getJobId() / 10) == 21) cm.sendNext("You're the #bMage of Fire and Poison#k from here on out. The new skill book features new and improved fire and poison based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP."); - else if(Math.floor(cm.getJobId() / 10) == 22) cm.sendNext("You're the #bMage of Ice and Lightning#k from here on out. The new skill book features new and improved ice and lightning based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP."); - else cm.sendNext("You're #bPriest#k from here on out. The new skill book features new and improved holy spells such as #bShining Ray#k and #bSummon Dragon#k, and skills such as #bMystic Door#k (creates a door for the exit to the nearest town) and #bHoly Symbol#k (improves the EXP gained) can be vital to the party play. Off-beat spells such as #bDoom#k (turn monsters into snails) separates Priests from other jobs as the most different of all."); - } else if (status == 3) { - cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); - } - }else if (actionx["Physical"]){ - if (status == 0) - cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); - else if (status == 1){ - if (cm.haveItem(4031057)){ - cm.gainItem(4031057, -1); - cm.getPlayer().setPartyQuestItemObtained("JBQ"); - } - cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); - } else if (status == 2) - cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); - } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0){ - cm.sendNext("Go, talk with #b#p1032001##k and bring me #b#t4031057##k."); - cm.dispose(); - } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0){ - cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); - cm.dispose(); - } else { - if (sel == undefined) - sel = selection; - if (sel == 0){ - if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0){ - if (status == 0) - cm.sendYesNo("Welcome. I'm #b#p2020009##k, the chief of all magicians, ready to share my street knowledge and hard knock life to those willing to listen. You seem ready to make the leap forward, the one ready to take on the challenges of the 3rd job advancement. Too many magicians have come and gone, unable to meet the standards of achieving the 3rd job advancement. What about you? Are you ready to be tested and make the 3th job advancement?"); - else if (status == 1){ - cm.getPlayer().setPartyQuestItemObtained("JB3"); - cm.sendNext("Good. You will be tested on two important aspects of a magician: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1032001##k from Ellinia? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1032001#."); - } else if (status == 2) - cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1032001##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); - } - } else { - if (cm.getPlayer().getLevel() >= 50){ - cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); - if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - const YamlConfig = Java.type('config.YamlConfig'); - if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); - }else - cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); - cm.dispose(); + if (mode == 0 && type == 0) { + status -= 2; + } else if (mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3) { + if (mode == 0 && type == 1) { + cm.sendNext("Make up your mind."); + } + cm.dispose(); + return; + } + if (actionx["Mental"]) { + if (status == 0) { + cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we takeon the next step."); + } else if (status == 1) { + cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful adventurer through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); + } else if (status == 2) { + if (cm.getPlayer().getRemainingSp() > 0) { + if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { + cm.sendNext("Please, use all your SP before continuing."); + cm.dispose(); + return; + } } - } + if (cm.getJobId() % 10 == 0) { + cm.gainItem(4031058, -1); + cm.changeJobById(cm.getJobId() + 1); + cm.getPlayer().removePartyQuestItem("JBQ"); + } + + if (Math.floor(cm.getJobId() / 10) == 21) { + cm.sendNext("You're the #bMage of Fire and Poison#k from here on out. The new skill book features new and improved fire and poison based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP."); + } else if (Math.floor(cm.getJobId() / 10) == 22) { + cm.sendNext("You're the #bMage of Ice and Lightning#k from here on out. The new skill book features new and improved ice and lightning based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP."); + } else { + cm.sendNext("You're #bPriest#k from here on out. The new skill book features new and improved holy spells such as #bShining Ray#k and #bSummon Dragon#k, and skills such as #bMystic Door#k (creates a door for the exit to the nearest town) and #bHoly Symbol#k (improves the EXP gained) can be vital to the party play. Off-beat spells such as #bDoom#k (turn monsters into snails) separates Priests from other jobs as the most different of all."); + } + } else if (status == 3) { + cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); + } + } else if (actionx["Physical"]) { + if (status == 0) { + cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); + } else if (status == 1) { + if (cm.haveItem(4031057)) { + cm.gainItem(4031057, -1); + cm.getPlayer().setPartyQuestItemObtained("JBQ"); + } + cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); + } else if (status == 2) { + cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); + } + } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0) { + cm.sendNext("Go, talk with #b#p1032001##k and bring me #b#t4031057##k."); + cm.dispose(); + } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0) { + cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); + cm.dispose(); + } else { + if (sel == undefined) { + sel = selection; + } + if (sel == 0) { + if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0) { + if (status == 0) { + cm.sendYesNo("Welcome. I'm #b#p2020009##k, the chief of all magicians, ready to share my street knowledge and hard knock life to those willing to listen. You seem ready to make the leap forward, the one ready to take on the challenges of the 3rd job advancement. Too many magicians have come and gone, unable to meet the standards of achieving the 3rd job advancement. What about you? Are you ready to be tested and make the 3th job advancement?"); + } else if (status == 1) { + cm.getPlayer().setPartyQuestItemObtained("JB3"); + cm.sendNext("Good. You will be tested on two important aspects of a magician: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1032001##k from Ellinia? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1032001#."); + } else if (status == 2) { + cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1032001##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); + } + } + } else { + if (cm.getPlayer().getLevel() >= 50) { + cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); + if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { + cm.startQuest(100200); + } + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) { + cm.completeQuest(100201); + } + } else { + cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); + } + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2020010.js b/scripts/npc/2020010.js index fbfa3def39..30386696ee 100644 --- a/scripts/npc/2020010.js +++ b/scripts/npc/2020010.js @@ -25,101 +25,115 @@ status = -1; var job; var sel; -actionx = {"Mental" : false, "Physical" : false}; +actionx = {"Mental": false, "Physical": false}; function start() { var jobBase = parseInt(cm.getJobId() / 100); var jobStyle = 3; - if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)){ - if(cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { + if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)) { + if (cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { status++; action(1, 0, 1); return; } - + cm.sendNext("Hi there."); cm.dispose(); return; } - if (cm.haveItem(4031058)) - actionx["Mental"] = true; - else if (cm.haveItem(4031057)) - actionx["Physical"] = true; + if (cm.haveItem(4031058)) { + actionx["Mental"] = true; + } else if (cm.haveItem(4031057)) { + actionx["Physical"] = true; + } cm.sendSimple("Anything you want from me?#b" + (cm.getJobId() % 10 == 0 ? "\r\n#L0#I want to make the 3th job advancement." : "") + "\r\n#L1#Please allow me to do the Zakum Dungeon Quest."); } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; - if (mode == 0 && type == 0) { - status -= 2; - } else if(mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3){ - if (mode == 0 && type == 1) - cm.sendNext("Make up your mind."); - cm.dispose(); - return; - } - if (actionx["Mental"]){ - if (status == 0) - cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we takeon the next step."); - else if (status == 1) - cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful adventurer through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); - else if (status == 2) { - if (cm.getPlayer().getRemainingSp() > 0) - if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { - cm.sendNext("Please, use all your SP before continuing."); - cm.dispose(); - return; - } - if (cm.getJobId() % 10 == 0) { - cm.gainItem(4031058, -1); - cm.changeJobById(cm.getJobId() + 1); - cm.getPlayer().removePartyQuestItem("JBQ"); - } - - if(Math.floor(cm.getJobId() / 10) == 31) cm.sendNext("You have officially become the #bRanger#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Rangers to fire arrows from close-range. #bInferno#k allows Rangers to temporarily perform fire-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bSilver Hawk#k (summons a Silver Hawk that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire."); - else cm.sendNext("You have officially become the #bSniper#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Snipers to fire arrows from close-range. #bBlizzard#k allows Snipers to temporarily perform ice-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bGolden Eagle#k (summons a Golden Eagle that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire."); - } else if (status == 3) { - cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); - } - }else if (actionx["Physical"]){ - if (status == 0) - cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); - else if (status == 1){ - if (cm.haveItem(4031057)){ - cm.gainItem(4031057, -1); - cm.getPlayer().setPartyQuestItemObtained("JBQ"); - } - cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); - } else if (status == 2) - cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); - } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0){ - cm.sendNext("Go, talk with #b#p1012100##k and bring me #b#t4031057##k."); - cm.dispose(); - } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0){ - cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); - cm.dispose(); - } else { - if (sel == undefined) - sel = selection; - if (sel == 0){ - if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0) { - if (status == 0) - cm.sendYesNo("Welcome. I'm #b#p2020010##k, the chief of all archers, ready to share my bow knowledge and hard knock life to those willing to listen. You seem ready to make the leap forward, the one ready to take on the challenges of the 3rd job advancement. Too many archers have come and gone, unable to meet the standards of achieving the 3rd job advancement. What about you? Are you ready to be tested and make the 3th job advancement?"); - else if (status == 1){ - cm.getPlayer().setPartyQuestItemObtained("JB3"); - cm.sendNext("Good. You will be tested on two important aspects of the archer: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1012100##k from Henesys? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1012100#."); - } else if (status == 2) - cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1012100##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); - } - } else { - if (cm.getPlayer().getLevel() >= 50){ - cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); - if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); - const YamlConfig = Java.type('config.YamlConfig'); - if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); - }else - cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); - cm.dispose(); + if (mode == 0 && type == 0) { + status -= 2; + } else if (mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3) { + if (mode == 0 && type == 1) { + cm.sendNext("Make up your mind."); + } + cm.dispose(); + return; + } + if (actionx["Mental"]) { + if (status == 0) { + cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we takeon the next step."); + } else if (status == 1) { + cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful adventurer through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); + } else if (status == 2) { + if (cm.getPlayer().getRemainingSp() > 0) { + if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { + cm.sendNext("Please, use all your SP before continuing."); + cm.dispose(); + return; + } } - } + if (cm.getJobId() % 10 == 0) { + cm.gainItem(4031058, -1); + cm.changeJobById(cm.getJobId() + 1); + cm.getPlayer().removePartyQuestItem("JBQ"); + } + + if (Math.floor(cm.getJobId() / 10) == 31) { + cm.sendNext("You have officially become the #bRanger#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Rangers to fire arrows from close-range. #bInferno#k allows Rangers to temporarily perform fire-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bSilver Hawk#k (summons a Silver Hawk that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire."); + } else { + cm.sendNext("You have officially become the #bSniper#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Snipers to fire arrows from close-range. #bBlizzard#k allows Snipers to temporarily perform ice-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bGolden Eagle#k (summons a Golden Eagle that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire."); + } + } else if (status == 3) { + cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); + } + } else if (actionx["Physical"]) { + if (status == 0) { + cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); + } else if (status == 1) { + if (cm.haveItem(4031057)) { + cm.gainItem(4031057, -1); + cm.getPlayer().setPartyQuestItemObtained("JBQ"); + } + cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); + } else if (status == 2) { + cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); + } + } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0) { + cm.sendNext("Go, talk with #b#p1012100##k and bring me #b#t4031057##k."); + cm.dispose(); + } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0) { + cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); + cm.dispose(); + } else { + if (sel == undefined) { + sel = selection; + } + if (sel == 0) { + if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0) { + if (status == 0) { + cm.sendYesNo("Welcome. I'm #b#p2020010##k, the chief of all archers, ready to share my bow knowledge and hard knock life to those willing to listen. You seem ready to make the leap forward, the one ready to take on the challenges of the 3rd job advancement. Too many archers have come and gone, unable to meet the standards of achieving the 3rd job advancement. What about you? Are you ready to be tested and make the 3th job advancement?"); + } else if (status == 1) { + cm.getPlayer().setPartyQuestItemObtained("JB3"); + cm.sendNext("Good. You will be tested on two important aspects of the archer: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1012100##k from Henesys? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1012100#."); + } else if (status == 2) { + cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1012100##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); + } + } + } else { + if (cm.getPlayer().getLevel() >= 50) { + cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); + if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { + cm.startQuest(100200); + } + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) { + cm.completeQuest(100201); + } + } else { + cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); + } + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2020011.js b/scripts/npc/2020011.js index 558ca4ab64..8891e3be13 100644 --- a/scripts/npc/2020011.js +++ b/scripts/npc/2020011.js @@ -23,101 +23,115 @@ status = -1; var job; var sel; -actionx = {"Mental" : false, "Physical" : false}; +actionx = {"Mental": false, "Physical": false}; function start() { var jobBase = parseInt(cm.getJobId() / 100); var jobStyle = 4; - if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)){ - if(cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { + if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)) { + if (cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { status++; action(1, 0, 1); return; } - + cm.sendNext("Hi there."); cm.dispose(); return; } - if (cm.haveItem(4031058)) + if (cm.haveItem(4031058)) { actionx["Mental"] = true; - else if (cm.haveItem(4031057)) + } else if (cm.haveItem(4031057)) { actionx["Physical"] = true; + } cm.sendSimple("Anything you want from me?#b" + (cm.getJobId() % 10 == 0 ? "\r\n#L0#I want to make the 3th job advancement." : "") + "\r\n#L1#Please allow me to do the Zakum Dungeon Quest."); } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; if (mode == 0 && type == 0) { status -= 2; - } else if(mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3){ - if (mode == 0 && type == 1) + } else if (mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3) { + if (mode == 0 && type == 1) { cm.sendNext("Make up your mind."); + } cm.dispose(); return; } - if (actionx["Mental"]){ - if (status == 0) + if (actionx["Mental"]) { + if (status == 0) { cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we takeon the next step."); - else if (status == 1) + } else if (status == 1) { cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful adventurer through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); - else if (status == 2) { - if (cm.getPlayer().getRemainingSp() > 0) + } else if (status == 2) { + if (cm.getPlayer().getRemainingSp() > 0) { if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { cm.sendNext("Please, use all your SP before continuing."); cm.dispose(); return; } + } if (cm.getJobId() % 10 == 0) { cm.gainItem(4031058, -1); cm.changeJobById(cm.getJobId() + 1); cm.getPlayer().removePartyQuestItem("JBQ"); } - if(Math.floor(cm.getJobId() / 10) == 41) cm.sendNext("You have officially been anointed as a #bHermit#k from here on out. The skill book introduces a slew of new attacking skills for Hermits using shadows as a way of duplication and replacement, including such skills as #bShadow Meso#k (replacing MP with mesos and attack monsters with the damage based on the amount of mesos thrown) and #bCopy cat#k (creating a shadow that mimics every move, enabling a Hermit to attack a monster as if two Hermits are there). Use those skills to take on the monsters that may have been difficult to conquer before."); - else cm.sendNext("You have officially been anointed as a #bChief Bandit#k from here on out. One of the new additions to the skill book is a skill called #bBand of Thieves#k, in which you can summon fellow Bandits to attack multiple monsters at once. Chief Bandits can also utilize mesos in numerous ways, from attacking monsters (#bMeso Explosion#k, which explodes the mesos on the ground), to defending yourself (#bMeso Guard#k, which decreases the weapon damage)."); - + if (Math.floor(cm.getJobId() / 10) == 41) { + cm.sendNext("You have officially been anointed as a #bHermit#k from here on out. The skill book introduces a slew of new attacking skills for Hermits using shadows as a way of duplication and replacement, including such skills as #bShadow Meso#k (replacing MP with mesos and attack monsters with the damage based on the amount of mesos thrown) and #bCopy cat#k (creating a shadow that mimics every move, enabling a Hermit to attack a monster as if two Hermits are there). Use those skills to take on the monsters that may have been difficult to conquer before."); + } else { + cm.sendNext("You have officially been anointed as a #bChief Bandit#k from here on out. One of the new additions to the skill book is a skill called #bBand of Thieves#k, in which you can summon fellow Bandits to attack multiple monsters at once. Chief Bandits can also utilize mesos in numerous ways, from attacking monsters (#bMeso Explosion#k, which explodes the mesos on the ground), to defending yourself (#bMeso Guard#k, which decreases the weapon damage)."); + } + } else if (status == 3) { cm.sendNextPrev("I've also given you some SP and AP; this should get you started. You have now become a powerful, powerful thief, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); } - }else if (actionx["Physical"]){ - if (status == 0) + } else if (actionx["Physical"]) { + if (status == 0) { cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); - else if (status == 1){ - if (cm.haveItem(4031057)){ + } else if (status == 1) { + if (cm.haveItem(4031057)) { cm.gainItem(4031057, -1); cm.getPlayer().setPartyQuestItemObtained("JBQ"); } cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); - } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0){ + } + } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0) { cm.sendNext("Go, talk with #b#p1052001##k and bring me #b#t4031057##k."); cm.dispose(); - } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0){ + } else if (cm.getPlayer().gotPartyQuestItem("JBQ") && selection == 0) { cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); cm.dispose(); } else { - if (sel == undefined) + if (sel == undefined) { sel = selection; - if (sel == 0){ - if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0){ - if (status == 0) + } + if (sel == 0) { + if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0) { + if (status == 0) { cm.sendYesNo("Welcome. I'm #b#p2020011##k, the chief of all thieves, ready to share my street knowledge and hard knock life to those willing to listen. You seem ready to make the leap forward, the one ready to take on the challenges of the 3rd job advancement. Too many thieves have come and gone, unable to meet the standards of achieving the 3rd job advancement. What about you? Are you ready to be tested and make the 3th job advancement?"); - else if (status == 1){ + } else if (status == 1) { cm.getPlayer().setPartyQuestItemObtained("JB3"); cm.sendNext("Good. You will be tested on two important aspects of the thief: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1052001##k from Kerning City? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1052001#."); - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1052001##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); + } } } else { - if (cm.getPlayer().getLevel() >= 50){ - cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); - if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); + if (cm.getPlayer().getLevel() >= 50) { + cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); + if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { + cm.startQuest(100200); + } const YamlConfig = Java.type('config.YamlConfig'); - if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); - }else + if (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) { + cm.completeQuest(100201); + } + } else { cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); + } cm.dispose(); } } diff --git a/scripts/npc/2020013.js b/scripts/npc/2020013.js index 209e650f49..fc18a21e72 100644 --- a/scripts/npc/2020013.js +++ b/scripts/npc/2020013.js @@ -23,73 +23,80 @@ status = -1; var job; var sel; -actionx = {"Mental" : false, "Physical" : false}; +actionx = {"Mental": false, "Physical": false}; function start() { var jobBase = parseInt(cm.getJobId() / 100); var jobStyle = 5; - if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)){ - if(cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { + if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle && cm.getJobId() % 10 == 0)) { + if (cm.getPlayer().getLevel() >= 50 && jobBase % 10 == jobStyle) { status++; action(1, 0, 1); return; } - + cm.sendNext("Hi there."); cm.dispose(); return; } - if (cm.haveItem(4031058)) + if (cm.haveItem(4031058)) { actionx["Mental"] = true; - else if (cm.haveItem(4031057)) + } else if (cm.haveItem(4031057)) { actionx["Physical"] = true; + } cm.sendSimple("Can I help you?#b" + (cm.getJobId() % 10 == 0 ? "\r\n#L0#I want to make the 3th job advancement." : "") + "\r\n#L1#Please allow me to do the Zakum Dungeon Quest."); } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; if (mode == 0 && type == 0) { status -= 2; - } else if(mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3){ - if (mode == 0 && type == 1) + } else if (mode != 1 || (status > 2 && !actionx["Mental"]) || status > 3) { + if (mode == 0 && type == 1) { cm.sendNext("Make up your mind."); + } cm.dispose(); return; } - if (actionx["Mental"]){ - if (status == 0) + if (actionx["Mental"]) { + if (status == 0) { cm.sendNext("Great job completing the mental part of the test. You have wisely answered all the questions correctly. I must say, I am quite impressed with the level of wisdom you have displayed there. Please hand me the necklace first, before we take on the next step."); - else if (status == 1) + } else if (status == 1) { cm.sendYesNo("Okay! Now, you'll be transformed into a much more powerful pirate through me. Before doing that, though, please make sure your SP has been thoroughly used, You'll need to use up at least all of SP's gained until level 70 to make the 3rd job advancement. Oh, and since you have already chosen your path of the occupation by the 2nd job adv., you won't have to choose again for the 3rd job adv. Do you want to do it right now?"); - else if (status == 2) { - if (cm.getPlayer().getRemainingSp() > 0) + } else if (status == 2) { + if (cm.getPlayer().getRemainingSp() > 0) { if (cm.getPlayer().getRemainingSp() > (cm.getLevel() - 70) * 3) { cm.sendNext("Please, use all your SP before continuing."); cm.dispose(); return; } + } if (cm.getJobId() % 10 == 0) { cm.gainItem(4031058, -1); cm.changeJobById(cm.getJobId() + 1); cm.getPlayer().removePartyQuestItem("JBQ"); } - - if(Math.floor(cm.getJobId() / 10) == 51) cm.sendNext("Great! You are now a #bMarauder#k. As a Marauder, you will learn some of the most sophisticated skills related to melee-based attacks. #bEnergy Charge#k is a skill that allows you to store your power and the damage you receive into a special form of energy. Once this ball of energy is charged, you may use #bEnergy Blast#k to apply maximum damage against your enemies, and also use #bEnergy Drain#k to steal your enemy's HP to recover your own. #bTransformation#k will allow you to transform into a superhuman being with devastating melee attacks, and while transformed, you can use #bShockwave#k to cause a mini-earthquake and inflict massive damage to your enemies."); - else cm.sendNext("Great! You have now become an #bOutlaw#k. As an Outlaw, you will become a true pistolero, a master of every known Gun attack, as well as a few other skills to help you vanquish evil. #bBurst Fire#k is a more powerful version of Double Shot, shooting more bullets and causing more damage at the same time. You also now have the ability to summon a loyal #bOctopus#k and the swooping #bGaviota#k as your trusty allies, while attacking your enemies using #bBullseye#k. You can also use element-based attacks using #bFlamethrower#k and #bIce Splitter#k."); + + if (Math.floor(cm.getJobId() / 10) == 51) { + cm.sendNext("Great! You are now a #bMarauder#k. As a Marauder, you will learn some of the most sophisticated skills related to melee-based attacks. #bEnergy Charge#k is a skill that allows you to store your power and the damage you receive into a special form of energy. Once this ball of energy is charged, you may use #bEnergy Blast#k to apply maximum damage against your enemies, and also use #bEnergy Drain#k to steal your enemy's HP to recover your own. #bTransformation#k will allow you to transform into a superhuman being with devastating melee attacks, and while transformed, you can use #bShockwave#k to cause a mini-earthquake and inflict massive damage to your enemies."); + } else { + cm.sendNext("Great! You have now become an #bOutlaw#k. As an Outlaw, you will become a true pistolero, a master of every known Gun attack, as well as a few other skills to help you vanquish evil. #bBurst Fire#k is a more powerful version of Double Shot, shooting more bullets and causing more damage at the same time. You also now have the ability to summon a loyal #bOctopus#k and the swooping #bGaviota#k as your trusty allies, while attacking your enemies using #bBullseye#k. You can also use element-based attacks using #bFlamethrower#k and #bIce Splitter#k."); + } } else if (status == 3) { cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful pirate, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting."); } - }else if (actionx["Physical"]){ - if (status == 0) + } else if (actionx["Physical"]) { + if (status == 0) { cm.sendNext("Great job completing the physical part of the test. I knew you could do it. Now that you have passed the first half of the test, here's the second half. Please give me the necklace first."); - else if (status == 1){ - if (cm.haveItem(4031057)){ + } else if (status == 1) { + if (cm.haveItem(4031057)) { cm.gainItem(4031057, -1); cm.getPlayer().setPartyQuestItemObtained("JBQ"); } cm.sendNextPrev("Here's the 2nd half of the test. This test will determine whether you are smart enough to take the next step towards greatness. There is a dark, snow-covered area called the Holy Ground at the snowfield in Ossyria, where even the monsters can't reach. On the center of the area lies a huge stone called the Holy Stone. You'll need to offer a special item as the sacrifice, then the Holy Stone will test your wisdom right there on the spot."); - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("You'll need to answer each and every question given to you with honesty and conviction. If you correctly answer all the questions, then the Holy Stone will formally accept you and hand you #b#t4031058##k. Bring back the necklace, and I will help you to the next step forward. Good luck."); + } } else if (cm.getPlayer().gotPartyQuestItem("JB3") && selection == 0) { cm.sendNext("Go, talk with #b#p1090000##k and bring me #b#t4031057##k."); cm.dispose(); @@ -97,26 +104,33 @@ function action(mode, type, selection){ cm.sendNext("Go, talk with #b#p2030006##k and bring me #b#t4031058##k."); cm.dispose(); } else { - if (sel == undefined) + if (sel == undefined) { sel = selection; - if (sel == 0){ - if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0){ - if (status == 0) + } + if (sel == 0) { + if (cm.getPlayer().getLevel() >= 70 && cm.getJobId() % 10 == 0) { + if (status == 0) { cm.sendYesNo("Welcome. I'm #b#p2020013##k, the chief of all pirates, in charge of bringing out the best in each and every pirate that needs my guidance. You seem like the kind of pirate that wants to make the leap forward, the one ready to take on the challenges of the 3th job advancement. But I've seen countless pirates eager to make the jump just like you, only to see them fail. What about you? Are you ready to be tested and make the 3th job advancement?"); - else if (status == 1){ + } else if (status == 1) { cm.getPlayer().setPartyQuestItemObtained("JB3"); cm.sendNext("Good. You will be tested on two important aspects of the pirate: strength and wisdom. I'll now explain to you the physical half of the test. Remember #b#p1090000##k from Nautilus Harbor? Go see him, and he'll give you the details on the first half of the test. Please complete the mission, and get #b#t4031057##k from #p1090000#."); - } else if (status == 2) + } else if (status == 2) { cm.sendNextPrev("The mental half of the test can only start after you pass the physical part of the test. #b#t4031057##k will be the proof that you have indeed passed the test. I'll let #b#p1022000##k in advance that you're making your way there, so get ready. It won't be easy, but I have the utmost faith in you. Good luck."); + } } } else { - if (cm.getPlayer().getLevel() >= 50){ - cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); - if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) cm.startQuest(100200); + if (cm.getPlayer().getLevel() >= 50) { + cm.sendOk("The Chief's Residence Council grants you #bconcession#k to make part of the #rcounteroffensive team against Zakum#k. Good luck on your journey ahead."); + if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { + cm.startQuest(100200); + } const YamlConfig = Java.type('config.YamlConfig'); - if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201); - }else + if (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) { + cm.completeQuest(100201); + } + } else { cm.sendOk("You're way too weak to make part of the #rcounteroffensive team against Zakum#k. Reach at least #blevel 50#k, then talk to me."); + } cm.dispose(); } } diff --git a/scripts/npc/2022004.js b/scripts/npc/2022004.js index 56ad023df8..62c87ec53b 100644 --- a/scripts/npc/2022004.js +++ b/scripts/npc/2022004.js @@ -6,7 +6,7 @@ function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { - cm.warp(211000000,"in01"); + cm.warp(211000000, "in01"); cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2023000.js b/scripts/npc/2023000.js index d0107542bf..49912bab1b 100644 --- a/scripts/npc/2023000.js +++ b/scripts/npc/2023000.js @@ -19,12 +19,12 @@ along with this program. If not, see . */ -var toMap = new Array(211040200, 220050300, 220000000, 240030000); -var inMap = new Array(211000000, 220000000, 221000000, 240000000); -var cost = new Array(10000, 25000, 25000, 65000); +var toMap = [211040200, 220050300, 220000000, 240030000]; +var inMap = [211000000, 220000000, 221000000, 240000000]; +var cost = [10000, 25000, 25000, 65000]; var location; var status; - + function start() { status = -1; action(1, 0, 0); @@ -39,23 +39,23 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - for (var i = 0; i < toMap.length; i ++) { + if (status == 0) { + for (var i = 0; i < toMap.length; i++) { if (inMap[i] == cm.getPlayer().getMap().getId()) { location = i; break; } } - cm.sendNext("Hello there! This taxi will take you to dangerous places in Ossyria faster than an arrow! We go from #m" + inMap[location] + "# to #b#m"+toMap[location]+"##k on this Ossyria Continent! It'll cost you #b"+ cost[location] +" meso#k. I know it's a bit expensive, but it's well worth passing all the dangerous areas!"); - } - else if (status == 1) - cm.sendYesNo("Would you like to pay #b"+ cost[location] +" mesos#k to travel to the #b#m"+toMap[location]+"##k?"); - else if (status == 2) { + cm.sendNext("Hello there! This taxi will take you to dangerous places in Ossyria faster than an arrow! We go from #m" + inMap[location] + "# to #b#m" + toMap[location] + "##k on this Ossyria Continent! It'll cost you #b" + cost[location] + " meso#k. I know it's a bit expensive, but it's well worth passing all the dangerous areas!"); + } else if (status == 1) { + cm.sendYesNo("Would you like to pay #b" + cost[location] + " mesos#k to travel to the #b#m" + toMap[location] + "##k?"); + } else if (status == 2) { if (cm.getMeso() < cost[location]) { cm.sendNext("You don't seem to have enough mesos. I am terribly sorry, but I cannot help you unless you pay up. Bring in the mesos by hunting more and come back when you have enough."); } else { diff --git a/scripts/npc/2030000.js b/scripts/npc/2030000.js index fc7dd3e484..87ef19d536 100644 --- a/scripts/npc/2030000.js +++ b/scripts/npc/2030000.js @@ -20,48 +20,51 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Jeff - El Nath : El Nath : Ice Valley II (211040200) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Jeff - El Nath : El Nath : Ice Valley II (211040200) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status = 0; function start() { - if(cm.haveItem(4031450, 1)) { + if (cm.haveItem(4031450, 1)) { cm.warp(921100100, 1); cm.dispose(); return; } - + cm.sendNext("Hey, you look like you want to go farther and deeper past this place. Over there, though, you'll find yourself surrounded by aggressive, dangerous monsters, so even if you feel that you're ready to go, please be careful. Long ago, a few brave men from our town went in wanting to eliminate anyone threatening the town, but never came back out..."); } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (status == 1 && mode == 0 && cm.getLevel() > 49) { cm.sendNext("Even if your level's high it's hard to actually go in there, but if you ever change your mind, please find me. After all, my job is to protect this place."); cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { - if (cm.getLevel() > 49) + if (cm.getLevel() > 49) { cm.sendYesNo("If you are thinking of going in, I suggest you change your mind. But if you really want to go in... I'm only letting in the ones that are strong enough to stay alive in there. I do not wish to see anyone else die. Let's see... Hmmm...! You look pretty strong. All right, do you want to go in?"); - else + } else { cm.sendPrev("If you are thinking of going in, I suggest you change your mind. But if you really want to go in... I'm only letting in the ones that are strong enough to stay alive in there. I do not wish to see anyone else die. Let's see... Hmmm... You haven't reached Level 50 yet. I can't let you in, then, so forget it."); + } } else if (status == 2) { - if (cm.getLevel() >= 50) + if (cm.getLevel() >= 50) { cm.warp(211040300, 5); + } cm.dispose(); } } diff --git a/scripts/npc/2030006.js b/scripts/npc/2030006.js index 43382598cb..f6be3fabdd 100644 --- a/scripts/npc/2030006.js +++ b/scripts/npc/2030006.js @@ -23,57 +23,57 @@ */ var questionTree = [ - //Questions Related to CHARACTERS - ["In MapleStory, what is the EXP needed to level up from Lv1 to Lv2?", ["20", "15", "4", "12", "16"], 1], - ["In 1st job adv. which of the following is WRONG requirement?", ["Magician - Level 8", "Pirate - 20 DEX or more", "Archer - 25 DEX or more", "Thief - 20 LUK or more", "Swordman - 35 STR or more"], 3], - ["When you hit by monster, which of the following is not fully explained?", ["Sealed - skills become disabled", "Undead - turns undead & halved recovery amounts", "Weaken - slow down moving speed", "Cursed - EXP received are decreased", "Stunned - cannot move"], 2], - ["For the 1st job adv. Which job fully states the job adv. requirement?", ["Pirate - 25 LUK", "Magician - Level 10", "Thief - 25 LUK", "Warrior - 30 STR", "Bowman - 25 DEX"], 4], + //Questions Related to CHARACTERS + ["In MapleStory, what is the EXP needed to level up from Lv1 to Lv2?", ["20", "15", "4", "12", "16"], 1], + ["In 1st job adv. which of the following is WRONG requirement?", ["Magician - Level 8", "Pirate - 20 DEX or more", "Archer - 25 DEX or more", "Thief - 20 LUK or more", "Swordman - 35 STR or more"], 3], + ["When you hit by monster, which of the following is not fully explained?", ["Sealed - skills become disabled", "Undead - turns undead & halved recovery amounts", "Weaken - slow down moving speed", "Cursed - EXP received are decreased", "Stunned - cannot move"], 2], + ["For the 1st job adv. Which job fully states the job adv. requirement?", ["Pirate - 25 LUK", "Magician - Level 10", "Thief - 25 LUK", "Warrior - 30 STR", "Bowman - 25 DEX"], 4], - //Questions Related to ITEMS - ["Which of following monsters got CORRECT item corresponding to the monster?", ["Royal cactus - Needle", "Wild Boar - Boar fang", "Lazy Buffy - Buffy hat", "Chipmunk - Nut", "Stirge - Stirge's wing"], 4], - ["Which of following monsters got WRONG item corresponding to the monster?", ["Greatest Oldies - Greatest oldies", "Nependeath - Nependeath's leaf", "Ghost stump - Seedling", "Sparker - Seal tooth", "Miner Zombie - Zombie's lost tooth"], 1], - //["In GM Event, how many FRUIT CAKE you can get as reward?", ["20", "200", "5", "25", "100"], 2], - ["Which of following potions got CORRECT info.?", ["Warrior Elixir - Attack +5 for 3 minutes", "Pure Water - Recover 700 MP", "Cake - Recover 150 HP & MP", "Salad - Recover 300 MP", "Pizza - Recover 400 HP"], 4], - ["Which of following potions got WRONG info.?", ["Mana Elixir - Recover 300 MP", "Tonic - Cures state of weakness", "Apple - Recover 30 HP", "Sunrise Dew - Recover 3000 MP", "Ramen - Recover 1000 HP"], 3], + //Questions Related to ITEMS + ["Which of following monsters got CORRECT item corresponding to the monster?", ["Royal cactus - Needle", "Wild Boar - Boar fang", "Lazy Buffy - Buffy hat", "Chipmunk - Nut", "Stirge - Stirge's wing"], 4], + ["Which of following monsters got WRONG item corresponding to the monster?", ["Greatest Oldies - Greatest oldies", "Nependeath - Nependeath's leaf", "Ghost stump - Seedling", "Sparker - Seal tooth", "Miner Zombie - Zombie's lost tooth"], 1], + //["In GM Event, how many FRUIT CAKE you can get as reward?", ["20", "200", "5", "25", "100"], 2], + ["Which of following potions got CORRECT info.?", ["Warrior Elixir - Attack +5 for 3 minutes", "Pure Water - Recover 700 MP", "Cake - Recover 150 HP & MP", "Salad - Recover 300 MP", "Pizza - Recover 400 HP"], 4], + ["Which of following potions got WRONG info.?", ["Mana Elixir - Recover 300 MP", "Tonic - Cures state of weakness", "Apple - Recover 30 HP", "Sunrise Dew - Recover 3000 MP", "Ramen - Recover 1000 HP"], 3], - //Questions Related to MONSTERS - ["Green Mushroom, Tree Stump, Bubbling, Axe Stump, Octopus, which is highest level of all?", ["Tree Stump", "Bubbling", "Axe Stump", "Octopus", "Green Mushroom"], 2], - ["Which monster will be seen during the ship trip to Orbis/Ellinia?", ["Werewolf", "Slime", "Crimson Balrog", "Zakum", "Star Pixie"], 2], - ["Maple Island doesn't have which following monsters?", ["Shroom", "Blue Snail", "Slime", "Red Snail", "Pig"], 4], // to get conformant with website answers, thanks to Vcoc - ["Which monster is not at Victoria Island and Sleepywood?", ["Evil Eye", "Sentinel", "Jr. Balrog", "Ghost Stump", "Snail"], 1], - ["El Nath doesn't have which following monsters?", ["Dark Yeti", "Dark Ligator", "Yeti & Pepe", "Bain", "Coolie Zombie"], 1], - ["Which of following monsters can fly?", ["Malady", "Ligator", "Cold Eye", "Meerkat", "Alishar"], 0], - ["Which of these monsters will you NOT be facing in Ossyria?", ["Lunar Pixie", "Lioner", "Cellion", "Croco", "Hector"], 3], - ["Which monster has not appeared in Maple Island?", ["Snail", "Shroom", "Evil Eye", "Orange Mushroom", "Blue Snail"], 2], + //Questions Related to MONSTERS + ["Green Mushroom, Tree Stump, Bubbling, Axe Stump, Octopus, which is highest level of all?", ["Tree Stump", "Bubbling", "Axe Stump", "Octopus", "Green Mushroom"], 2], + ["Which monster will be seen during the ship trip to Orbis/Ellinia?", ["Werewolf", "Slime", "Crimson Balrog", "Zakum", "Star Pixie"], 2], + ["Maple Island doesn't have which following monsters?", ["Shroom", "Blue Snail", "Slime", "Red Snail", "Pig"], 4], // to get conformant with website answers, thanks to Vcoc + ["Which monster is not at Victoria Island and Sleepywood?", ["Evil Eye", "Sentinel", "Jr. Balrog", "Ghost Stump", "Snail"], 1], + ["El Nath doesn't have which following monsters?", ["Dark Yeti", "Dark Ligator", "Yeti & Pepe", "Bain", "Coolie Zombie"], 1], + ["Which of following monsters can fly?", ["Malady", "Ligator", "Cold Eye", "Meerkat", "Alishar"], 0], + ["Which of these monsters will you NOT be facing in Ossyria?", ["Lunar Pixie", "Lioner", "Cellion", "Croco", "Hector"], 3], + ["Which monster has not appeared in Maple Island?", ["Snail", "Shroom", "Evil Eye", "Orange Mushroom", "Blue Snail"], 2], - //Questions Related to QUESTS - ["Which material doesn't need for awaken Hero's Gladius?", ["Flaming Feather", "Old Gladius", "Piece of Ice", "Ancient Scroll", "Fairy Wing"], 4], - ["Which of following quests can be repeated?", ["Mystery of Niora Hospital", "Rightful Donation Culture", "The Ghost Whereabout", "Arwen and the Glass Shoe", "Maya and the Weird Medicine"], 3], - ["Which of following are not 2nd job adv.?", ["Mage", "Cleric", "Assassin", "Gunslinger", "Fighter"], 0], - ["Which of following is the highest level quest?", ["Cupid's Courier", "Lost in the Ocean", "Alcaster and the Dark Crystal", "Eliminating the Drumming Bunny", "War of Pang Pang"], 2], + //Questions Related to QUESTS + ["Which material doesn't need for awaken Hero's Gladius?", ["Flaming Feather", "Old Gladius", "Piece of Ice", "Ancient Scroll", "Fairy Wing"], 4], + ["Which of following quests can be repeated?", ["Mystery of Niora Hospital", "Rightful Donation Culture", "The Ghost Whereabout", "Arwen and the Glass Shoe", "Maya and the Weird Medicine"], 3], + ["Which of following are not 2nd job adv.?", ["Mage", "Cleric", "Assassin", "Gunslinger", "Fighter"], 0], + ["Which of following is the highest level quest?", ["Cupid's Courier", "Lost in the Ocean", "Alcaster and the Dark Crystal", "Eliminating the Drumming Bunny", "War of Pang Pang"], 2], + + //Questions Related to TOWN/NPC + ["Which town is not at Victoria Island?", ["Florina Beach or Nautilus", "Amherst or Southperry", "Kerning City & Square", "Perion or Ellinia", "Sleepywood"], 1], + ["Which is the first NPC you meet in Maple Island?", ["Sera", "Heena", "Lucas", "Roger", "Shanks"], 1], + ["Which NPC cannot be seen in El Nath?", ["Vogen", "Sophia", "Pedro", "Master Sergeant Fox", "Rumi"], 1], + ["Which NPC cannot be seen in El Nath snowfield?", ["Hidden Rock", "Glibber", "Jeff", "Holy Stone", "Elma the Housekeeper"], 4], + ["Which NPC cannot be seen in Perion?", ["Ayan", "Sophia", "Mr. Smith", "Francois", "Manji"], 3], + ["Which NPC cannot be seen in Henesys?", ["Teo", "Vicious", "Mia", "Doofus", "Casey"], 0], + ["Which NPC cannot be seen in Ellinia?", ["Mr. Park", "Mar the Fairy", "Roel", "Ria", "Shane"], 2], + ["Which NPC cannot be seen in Kerning City?", ["Dr. Faymus", "Mong from Kong", "Ervine", "Luke", "Nella"], 3], + ["Which NPC is not related to pets?", ["Doofus", "Vicious", "Patricia", "Weaver", "Cloy"], 1], + ["In Kerning City, who is the father of Alex, the runaway kid?", ["Chief Stan", "JM From tha Streetz", "Dr. Faymus", "Vicious", "Luke"], 0], + ["Which NPC is not belong to Alpha Platoon's Network of Communication?", ["Staff Sergeant Charlie", "Sergeant Bravo", "Corporal Easy", "Master Sergeant Fox", "Peter"], 4], + ["What do you receive in return from giving 30 Dark Marbles to the 2nd job advancement NPC?", ["Old Ring", "Memory Powder", "Fairy Dust", "Proof of Hero", "Scroll of Secrets"], 3], + ["Which item you give Maya at Henesys in order to cure her sickness?", ["Apple", "Power Elixir", "Weird Medicine", "Chrysanthemum", "Orange Juice"], 2], + ["Which of following NPC is not related to item synthesis/refine?", ["Neve", "Serryl", "Shane", "Francois", "JM From tha Streetz"], 2], + ["Which NPC cannot be seen in Maple Island?", ["Bari", "Teo", "Pio", "Sid", "Maria"], 1], + ["Who do you see in the monitor in the navigation room with Kyrin?", ["Lucas", "Dr. Kim", "Chief Stan", "Scadur", "Professor Foxwit"], 1], + ["You know Athena Pierce in Henesys? What color are her eyes?", ["Blue", "Green", "Brown", "Red", "Black"], 1], + ["How many feathers are there on Dances with Barlog's Hat?", ["7", "8", "3", "13", "16"], 3], + ["What's the color of the marble Grendel the Really Old from Ellinia carries with him?", ["White", "Orange", "Blue", "Purple", "Green"], 2] +]; - //Questions Related to TOWN/NPC - ["Which town is not at Victoria Island?", ["Florina Beach or Nautilus", "Amherst or Southperry", "Kerning City & Square", "Perion or Ellinia", "Sleepywood"], 1], - ["Which is the first NPC you meet in Maple Island?", ["Sera", "Heena", "Lucas", "Roger", "Shanks"], 1], - ["Which NPC cannot be seen in El Nath?", ["Vogen", "Sophia", "Pedro", "Master Sergeant Fox", "Rumi"], 1], - ["Which NPC cannot be seen in El Nath snowfield?", ["Hidden Rock", "Glibber", "Jeff", "Holy Stone", "Elma the Housekeeper"], 4], - ["Which NPC cannot be seen in Perion?", ["Ayan", "Sophia", "Mr. Smith", "Francois", "Manji"], 3], - ["Which NPC cannot be seen in Henesys?", ["Teo", "Vicious", "Mia", "Doofus", "Casey"], 0], - ["Which NPC cannot be seen in Ellinia?", ["Mr. Park", "Mar the Fairy", "Roel", "Ria", "Shane"], 2], - ["Which NPC cannot be seen in Kerning City?", ["Dr. Faymus", "Mong from Kong", "Ervine", "Luke", "Nella"], 3], - ["Which NPC is not related to pets?", ["Doofus", "Vicious", "Patricia", "Weaver", "Cloy"], 1], - ["In Kerning City, who is the father of Alex, the runaway kid?", ["Chief Stan", "JM From tha Streetz", "Dr. Faymus", "Vicious", "Luke"], 0], - ["Which NPC is not belong to Alpha Platoon's Network of Communication?", ["Staff Sergeant Charlie", "Sergeant Bravo", "Corporal Easy", "Master Sergeant Fox", "Peter"], 4], - ["What do you receive in return from giving 30 Dark Marbles to the 2nd job advancement NPC?", ["Old Ring", "Memory Powder", "Fairy Dust", "Proof of Hero", "Scroll of Secrets"], 3], - ["Which item you give Maya at Henesys in order to cure her sickness?", ["Apple", "Power Elixir", "Weird Medicine", "Chrysanthemum", "Orange Juice"], 2], - ["Which of following NPC is not related to item synthesis/refine?", ["Neve", "Serryl", "Shane", "Francois", "JM From tha Streetz"], 2], - ["Which NPC cannot be seen in Maple Island?", ["Bari", "Teo", "Pio", "Sid", "Maria"], 1], - ["Who do you see in the monitor in the navigation room with Kyrin?", ["Lucas", "Dr. Kim", "Chief Stan", "Scadur", "Professor Foxwit"], 1], - ["You know Athena Pierce in Henesys? What color are her eyes?", ["Blue", "Green", "Brown", "Red", "Black"], 1], - ["How many feathers are there on Dances with Barlog's Hat?", ["7", "8", "3", "13", "16"], 3], - ["What's the color of the marble Grendel the Really Old from Ellinia carries with him?", ["White", "Orange", "Blue", "Purple", "Green"], 2] - ]; - var status; var question; @@ -95,15 +95,16 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(cm.getPlayer().gotPartyQuestItem("JBQ") && !cm.haveItem(4031058, 1)) { - if(cm.haveItem(4005004, 1)) { - if(!cm.canHold(4031058)) { + if (status == 0) { + if (cm.getPlayer().gotPartyQuestItem("JBQ") && !cm.haveItem(4031058, 1)) { + if (cm.haveItem(4005004, 1)) { + if (!cm.canHold(4031058)) { cm.sendNext("Have a free ETC slot available before accepting this trial."); cm.dispose(); } else { @@ -116,42 +117,42 @@ function action(mode, type, selection) { } else { cm.dispose(); } - } else if(status == 1) { + } else if (status == 1) { cm.gainItem(4005004, -1); instantiateQuestionPool(); - + question = fetchNextQuestion(); var questionHead = generateQuestionHeading(); var questionEntry = questionTree[question][0]; - + var questionData = generateSelectionMenu(questionTree[question][1], questionTree[question][2]); var questionOptions = questionData[0]; questionAnswer = questionData[1]; - + cm.sendSimple(questionHead + questionEntry + "\r\n\r\n#b" + questionOptions + "#k"); - } else if(status >= 2 && status <= 5) { - if(!evaluateAnswer(selection)) { + } else if (status >= 2 && status <= 5) { + if (!evaluateAnswer(selection)) { cm.sendNext("You have failed the question."); cm.dispose(); return; } - + question = fetchNextQuestion(); var questionHead = generateQuestionHeading(); var questionEntry = questionTree[question][0]; - + var questionData = generateSelectionMenu(questionTree[question][1], questionTree[question][2]); var questionOptions = questionData[0]; questionAnswer = questionData[1]; - + cm.sendSimple(questionHead + questionEntry + "\r\n\r\n#b" + questionOptions + "#k"); - } else if(status == 6) { - if(!evaluateAnswer(selection)) { + } else if (status == 6) { + if (!evaluateAnswer(selection)) { cm.sendNext("You have failed the question."); cm.dispose(); return; } - + cm.sendOk("Alright. All your answers have been proven as the truth. Your wisdom has been proven.\r\nTake this necklace and go back."); cm.gainItem(4031058, 1); cm.dispose(); @@ -181,11 +182,11 @@ function shuffleArray(array) { function instantiateQuestionPool() { questionPool = []; - - for(var i = 0; i < questionTree.length; i++) { + + for (var i = 0; i < questionTree.length; i++) { questionPool.push(i); } - + shuffleArray(questionPool); questionPoolCursor = 0; } @@ -193,7 +194,7 @@ function instantiateQuestionPool() { function fetchNextQuestion() { var next = questionPool[questionPoolCursor]; questionPoolCursor++; - + return next; } @@ -218,9 +219,9 @@ function shuffle(array) { function generateSelectionMenu(array, answer) { var answerStr = array[answer], answerPos = -1; - + shuffle(array); - + var menu = ""; for (var i = 0; i < array.length; i++) { menu += "#L" + i + "#" + array[i] + "#l\r\n"; diff --git a/scripts/npc/2030006_old.js b/scripts/npc/2030006_old.js index fb496c3847..a1bbae69db 100644 --- a/scripts/npc/2030006_old.js +++ b/scripts/npc/2030006_old.js @@ -26,16 +26,18 @@ ans = [4, 1, 3, 1, 3]; rand = parseInt(Math.random() * quest.length); function start() { - if (cm.getPlayer().gotPartyQuestItem("JBQ") && !cm.haveItem(4031058)) + if (cm.getPlayer().gotPartyQuestItem("JBQ") && !cm.haveItem(4031058)) { if (cm.haveItem(4005004)) { - if(!cm.canHold(4031058)) { + if (!cm.canHold(4031058)) { cm.sendNext("Have a free ETC slot available before accepting this trial."); } else { cm.sendNext("Alright... I'll be testing out your wisdom here. Answer all the questions correctly, and you will pass the test BUT, if you even lie to me once, then you'll have to start over again ok, here we go."); return; } - } else + } else { cm.sendNext("Bring me a #b#t4005004##k to proceed with the questions."); + } + } cm.dispose(); } @@ -45,16 +47,19 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (status == 0) + if (status == 0) { cm.gainItem(4005004, -1); - if (status > 0) + } + if (status > 0) { if (selection != ans[rand]) { cm.sendNext("You have failed the question."); cm.dispose(); return; } - while (quest[rand].equals("") && status <= 4) + } + while (quest[rand].equals("") && status <= 4) { rand = parseInt(Math.random() * quest.length); + } if (status <= 4) { cm.sendSimple("Here's the " + (status + 1) + (status == 0 ? "st" : status == 1 ? "nd" : status == 2 ? "rd" : "th") + " question. " + quest[rand]); quest[rand] = ""; diff --git a/scripts/npc/2030008.js b/scripts/npc/2030008.js index 9a5429bf7a..4fc6b1e8ad 100644 --- a/scripts/npc/2030008.js +++ b/scripts/npc/2030008.js @@ -40,78 +40,80 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (mode == 0) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - - if(cm.haveItem(4001109, 1)) { + } + + if (cm.haveItem(4001109, 1)) { cm.warp(921100000, "out00"); cm.dispose(); return; } - - if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { // thanks Vcoc for finding out a need of reapproval from the masters for Zakum expeditions + + if (!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { // thanks Vcoc for finding out a need of reapproval from the masters for Zakum expeditions if (cm.getPlayer().getLevel() >= 50) { // thanks Z1peR for noticing not-so-clear unmet requirements message here. cm.sendOk("Beware, for the power of olde has not been forgotten... If you seek to defeat #rZakum#k someday, earn the #bChief's Residence Council#k approval foremost and then #bface the trials#k, only then you will become eligible to fight."); } else { cm.sendOk("Beware, for the power of olde has not been forgotten..."); } - + cm.dispose(); return; } - + em = cm.getEventManager("ZakumPQ"); - if(em == null) { + if (em == null) { cm.sendOk("The Zakum PQ has encountered an error."); cm.dispose(); return; } - + if (status == 0) { cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nBeware, for the power of olde has not been forgotten... #b\r\n#L0#Enter the Unknown Dead Mine (Stage 1)#l\r\n#L1#Face the Breath of Lava (Stage 2)#l\r\n#L2#Forging the Eyes of Fire (Stage 3)#l"); - } - else if (status == 1) { + } else if (status == 1) { if (selection == 0) { if (cm.getParty() == null) { cm.sendOk("You can participate in the party quest only if you are in a party."); cm.dispose(); - } else if(!cm.isLeader()) { + } else if (!cm.isLeader()) { cm.sendOk("Your party leader must talk to me to start this party quest."); cm.dispose(); } else { var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); } - } - else { + } else { cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); } cm.dispose(); } - } else if(selection == 1) { - if (cm.haveItem(4031061) && !cm.haveItem(4031062)) + } else if (selection == 1) { + if (cm.haveItem(4031061) && !cm.haveItem(4031062)) { cm.sendYesNo("Would you like to attempt the #bBreath of Lava#k? If you fail, there is a very real chance you will die."); - else { - if (cm.haveItem(4031062)) cm.sendNext("You've already got the #bBreath of Lava#k, you don't need to do this stage."); - else cm.sendNext("Please complete the earlier trials first."); - + } else { + if (cm.haveItem(4031062)) { + cm.sendNext("You've already got the #bBreath of Lava#k, you don't need to do this stage."); + } else { + cm.sendNext("Please complete the earlier trials first."); + } + cm.dispose(); } } else { - if(cm.haveItem(4031061) && cm.haveItem(4031062)) { - if(!cm.haveItem(4000082, 30)) { + if (cm.haveItem(4031061) && cm.haveItem(4031062)) { + if (!cm.haveItem(4000082, 30)) { cm.sendOk("You have completed the trials, however there's still the need of #b30 #t4000082##k to forge 5 #t4001017#."); } else { cm.completeQuest(100201); @@ -122,15 +124,14 @@ function action(mode, type, selection) { cm.gainItem(4001017, 5); cm.sendNext("You #rhave completed the trials#k, from now on having my approval to challenge Zakum."); } - + cm.dispose(); } else { cm.sendOk("You lack some of the required items to forge the #b#t4001017##k."); cm.dispose(); } } - } - else if (status == 2) { + } else if (status == 2) { cm.warp(280020000, 0); cm.dispose(); } diff --git a/scripts/npc/2030010.js b/scripts/npc/2030010.js index d4e3f97860..fe4fb82b7f 100644 --- a/scripts/npc/2030010.js +++ b/scripts/npc/2030010.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Amon * * @Author Stereo @@ -28,20 +29,23 @@ * Zakum Quest NPC * Helps players leave the map */ - + function start() { - if(cm.getMapId() == 280030000) { - if(!cm.getEventInstance().isEventCleared()) cm.sendYesNo("If you leave now, you'll have to start over. Are you sure you want to leave?"); - else cm.sendYesNo("You guys finally overthrew Zakum, what a superb feat! Congratulations! Are you sure you want to leave now?"); + if (cm.getMapId() == 280030000) { + if (!cm.getEventInstance().isEventCleared()) { + cm.sendYesNo("If you leave now, you'll have to start over. Are you sure you want to leave?"); + } else { + cm.sendYesNo("You guys finally overthrew Zakum, what a superb feat! Congratulations! Are you sure you want to leave now?"); + } } else { cm.sendYesNo("If you leave now, you'll have to start over. Are you sure you want to leave?"); } } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { cm.warp(211042300); cm.dispose(); } diff --git a/scripts/npc/2030013.js b/scripts/npc/2030013.js index 4770881445..01b7c1e5f4 100644 --- a/scripts/npc/2030013.js +++ b/scripts/npc/2030013.js @@ -82,12 +82,12 @@ function action(mode, type, selection) { } else if (expedition.isInProgress()) { //Only if the expedition is in progress if (expedition.contains(player)) { //If you're registered, warp you in var eim = em.getInstance(expedName + player.getClient().getChannel()); - if(eim.getIntProperty("canJoin") == 1) { + if (eim.getIntProperty("canJoin") == 1) { eim.registerPlayer(player); } else { cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls."); } - + cm.dispose(); } else { //If you're not in by now, tough luck cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); @@ -101,14 +101,14 @@ function action(mode, type, selection) { cm.dispose(); return; } - + expedition = cm.getExpedition(exped); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(exped); if (res == 0) { cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -117,13 +117,13 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + "."); cm.dispose(); - return; + } } else if (status == 2) { if (selection == 1) { @@ -148,14 +148,14 @@ function action(mode, type, selection) { status = 6; } else if (selection == 2) { var min = exped.getMinSize(); - + var size = expedition.getMemberList().size(); if (size < min) { cm.sendOk("You need at least " + min + " players registered in your expedition."); cm.dispose(); return; } - + cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { @@ -164,7 +164,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -175,14 +175,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/2030013_old.js b/scripts/npc/2030013_old.js index a7ea949fa0..04396e83e7 100644 --- a/scripts/npc/2030013_old.js +++ b/scripts/npc/2030013_old.js @@ -26,18 +26,18 @@ * * Start of Zakum Bossfight */ - + var status; var minLevel = 50; var state; var maxPlayers = 30; - - + + function start() { status = -1; action(1, 0, 0); } - + function action(mode, type, selection) { if (mode == -1) { cm.dispose(); @@ -46,10 +46,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { if ((cm.getPlayer().getLevel() < minLevel)) { cm.warp(211042300); @@ -58,26 +59,24 @@ function action(mode, type, selection) { return; } cm.sendSimple("The battle to defeat Zakum begins here. What would you like to do? #b\r\n#L0#Start a new Zakum Battle#l\r\n#L1#Join your group's Zakum Battle#l"); - } - else if (status == 1) { + } else if (status == 1) { state = selection; - if (selection == 0) + if (selection == 0) { cm.sendGetText("In order to start the Zakum Battle, you need to choose a name for your instance. This is the password that lets your members join, so tell it to everybody who wants to participate in the battle."); - - else if (selection == 1) + } else if (selection == 1) { cm.sendGetText("In order to join a Zakum Battle, you need to enter the password. If you don't know what it is, please ask the person leading the battle."); - - } - else if (status == 2) { + } + + } else if (status == 2) { var em = cm.getEventManager("ZakumBattle"); var passwd = cm.getText(); - if (em == null) + if (em == null) { cm.sendOk("This trial is currently under construction."); - else { + } else { if (state == 0) { // Leader - if (getEimForString(em,passwd) != null) + if (getEimForString(em, passwd) != null) { cm.sendOk("You may not use that password."); - else { // start Zakum Battle + } else { // start Zakum Battle //var em = cm.getEventManager("Zakum" + passwd); if (!em.startInstance(cm.getPlayer())) { cm.sendOk("A party is already registered in this instance."); @@ -88,18 +87,19 @@ function action(mode, type, selection) { } } if (state == 1) { // Member - var eim = getEimForString(em,passwd); - if (eim == null) + var eim = getEimForString(em, passwd); + if (eim == null) { cm.sendOk("There is currently no battle registered under that name."); - else { + } else { if (eim.getProperty("canEnter").toLowerCase() == "true") { - if (eim.getPlayers().size() < maxPlayers) + if (eim.getPlayers().size() < maxPlayers) { eim.registerPlayer(cm.getPlayer()); - else + } else { cm.sendOk("I'm sorry, but that battle is currently full. Please wait to join another one."); - } - else + } + } else { cm.sendOk("I'm sorry, but that battle is currently in progress. Please return later."); + } } } } @@ -107,6 +107,7 @@ function action(mode, type, selection) { } } } + function getEimForString(em, name) { var stringId = "Zakum" + name; return em.getInstance(stringId); diff --git a/scripts/npc/2030014.js b/scripts/npc/2030014.js index 42045d9764..f88e41258f 100644 --- a/scripts/npc/2030014.js +++ b/scripts/npc/2030014.js @@ -22,33 +22,34 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.haveItem(4031450, 1)) { - if(cm.canHold(2280011, 1)) { - cm.gainItem(2280011, 1); - cm.gainItem(4031450, -1); - } - } - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4031450, 1)) { + if (cm.canHold(2280011, 1)) { + cm.gainItem(2280011, 1); + cm.gainItem(4031450, -1); + } + } + cm.dispose(); + } + } } diff --git a/scripts/npc/2032001.js b/scripts/npc/2032001.js index 9327427cf5..fd85118544 100644 --- a/scripts/npc/2032001.js +++ b/scripts/npc/2032001.js @@ -29,9 +29,9 @@ Refining NPC: var status = 0; function start() { - if (cm.isQuestCompleted(3034)) + if (cm.isQuestCompleted(3034)) { cm.sendYesNo("You've been so much of a help to me... If you have any Dark Crystal Ore, I can refine it for you for only #b500000 meso#k each."); - else { + } else { cm.sendOk("Go away, I'm trying to meditate."); cm.dispose(); } @@ -43,25 +43,25 @@ function action(mode, type, selection) { return; } status++; - if (status == 1) + if (status == 1) { cm.sendGetNumber("Okay, so how many do you want me to make?", 1, 1, 100); - else if (status == 2) { + } else if (status == 2) { var complete = true; - - if (cm.getMeso() < 500000 * selection){ + + if (cm.getMeso() < 500000 * selection) { cm.sendOk("I'm sorry, but I am NOT doing this for free."); cm.dispose(); return; } else if (!cm.haveItem(4004004, 10 * selection)) { complete = false; - } else if(!cm.canHold(4005004, selection)) { + } else if (!cm.canHold(4005004, selection)) { cm.sendOk("Are you having trouble with no empty slots on your inventory? Sort that out first!"); cm.dispose(); return; } - if (!complete) + if (!complete) { cm.sendOk("I need that ore to refine the Crystal. No exceptions.."); - else { + } else { cm.gainItem(4004004, -10 * selection); cm.gainMeso(-500000 * selection); cm.gainItem(4005004, selection); diff --git a/scripts/npc/2032002.js b/scripts/npc/2032002.js index 53aba7e94d..93b34c4556 100644 --- a/scripts/npc/2032002.js +++ b/scripts/npc/2032002.js @@ -36,37 +36,36 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (mode == 0) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + var eim = cm.getPlayer().getEventInstance(); - + if (status == 0) { - if(!eim.isEventCleared()) { + if (!eim.isEventCleared()) { cm.sendSimple("...#b\r\n#L0#What am I supposed to do here?#l\r\n#L1#I brought items!#l\r\n#L2#I want to get out!#l"); } else { cm.sendNext("You completed this ordeal, now receive your prize."); } - } - else if (status == 1) { - if(!eim.isEventCleared()) { + } else if (status == 1) { + if (!eim.isEventCleared()) { selectedType = selection; if (selection == 0) { cm.sendNext("To reveal the power of Zakum, you'll have to recreate its core. Hidden somewhere in this dungeon is a #b\"Fire Ore\"#k which is one of the necessary materials for that core. Find it, and bring it to me.\r\n\r\nOh, and could you do me a favour? There's also a number of #bPaper Documents#k lying under rocks around here. If you can get 30 of them, I can reward you for your efforts."); cm.dispose(); - return; - } - else if (selection == 1) { - if(!cm.isEventLeader()) { + + } else if (selection == 1) { + if (!cm.isEventLeader()) { cm.sendNext("Please let your leader bring the materials to me to complete this ordeal."); cm.dispose(); return; @@ -75,8 +74,7 @@ function action(mode, type, selection) { if (!cm.haveItem(4001018)) { //fire ore cm.sendNext("Please bring the #bFire Ore#k with you."); cm.dispose(); - } - else { + } else { gotAllDocs = cm.haveItem(4001015, 30); if (!gotAllDocs) { //documents cm.sendYesNo("So, you brought the fire ore with you? In that case, I can give to you and to each member of your party a piece of it, that should be more than enough to make the core of Zakum. Make sure your whole party has room in their inventory before proceeding."); @@ -84,12 +82,13 @@ function action(mode, type, selection) { cm.sendYesNo("So, you brought the fire ore and the documents with you? In that case, I can give to you and to each member of your party a piece of it, that should be more than enough to make the core of Zakum. As well, since you #rbrought the documents#k with you, I can also provide you a special item which will #bbring you to the mine's entrance at any time#k. Make sure your whole party has room in their inventory before proceeding."); } } - } else if (selection == 2) + } else if (selection == 2) { cm.sendYesNo("Are you sure you want to exit? If you're the party leader, your party will also be removed from the mines."); + } } else { - if(eim.getProperty("gotDocuments") == 1) { - if(eim.gridCheck(cm.getPlayer()) == -1) { - if(cm.canHoldAll([2030007, 4031061], [5, 1])) { + if (eim.getProperty("gotDocuments") == 1) { + if (eim.gridCheck(cm.getPlayer()) == -1) { + if (cm.canHoldAll([2030007, 4031061], [5, 1])) { cm.gainItem(2030007, 5); cm.gainItem(4031061, 1); @@ -101,8 +100,8 @@ function action(mode, type, selection) { cm.sendOk("You have already received your share. You can now exit the mines through the portal over there."); } } else { - if(eim.gridCheck(cm.getPlayer()) == -1) { - if(cm.canHold(4031061, 1)) { + if (eim.gridCheck(cm.getPlayer()) == -1) { + if (cm.canHold(4031061, 1)) { cm.gainItem(4031061, 1); eim.gridInsert(cm.getPlayer(), 1); @@ -113,28 +112,26 @@ function action(mode, type, selection) { cm.sendOk("You have already received your share. You can now exit the mines through the portal over there."); } } - + cm.dispose(); } - - } - else if (status == 2) { + + } else if (status == 2) { if (selectedType == 1) { cm.gainItem(4001018, -1); - - if(gotAllDocs) { + + if (gotAllDocs) { cm.gainItem(4001015, -30); - + eim.setProperty("gotDocuments", 1); eim.giveEventPlayersExp(20000); } else { eim.giveEventPlayersExp(12000); } - + eim.clearPQ(); cm.dispose(); - } - else if (selectedType == 2) { + } else if (selectedType == 2) { cm.warp(211042300); cm.dispose(); } diff --git a/scripts/npc/2032003.js b/scripts/npc/2032003.js index 4be04e8533..05b3239bfb 100644 --- a/scripts/npc/2032003.js +++ b/scripts/npc/2032003.js @@ -24,34 +24,34 @@ * Adobis's Mission I : Breath of Lava (280020001) * Zakum Quest NPC */ - + var status = -1; - + function start() { action(1, 0, 0); } - + function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; - + if (status == 0) { cm.sendNext("Congratulations on getting this far! Well, I suppose I'd better give you the #bBreath of Fire#k. You've certainly earned it!"); } else if (status == 1) { - if(!cm.canHold(4031062)) { + if (!cm.canHold(4031062)) { cm.sendOk("Try freeing a slot to receive the #b#t4031062##k."); cm.dispose(); return; } - + cm.sendNext("Well, time for you to head off."); } else if (status == 2) { - cm.gainItem(4031062,1); + cm.gainItem(4031062, 1); cm.gainExp(10000 * cm.getPlayer().getExpRate()); cm.warp(211042300); - + cm.dispose(); } } diff --git a/scripts/npc/2040000.js b/scripts/npc/2040000.js index 9d7f868d22..3f394e7a30 100644 --- a/scripts/npc/2040000.js +++ b/scripts/npc/2040000.js @@ -2,26 +2,28 @@ var cost = 6000; var status = 0; function start() { - cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 10 minutes, beginning on the hour, and it'll cost you #b"+cost+" mesos#k. Are you sure you want to purchase #b#t4031045##k?"); + cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 10 minutes, beginning on the hour, and it'll cost you #b" + cost + " mesos#k. Are you sure you want to purchase #b#t4031045##k?"); } function action(mode, type, selection) { - if(mode == -1) + if (mode == -1) { cm.dispose(); - else { - if(mode == 1) + } else { + if (mode == 1) { status++; - if(mode == 0) { + } + if (mode == 0) { cm.sendNext("You must have some business to take care of here, right?"); cm.dispose(); return; } - if(status == 1) { - if(cm.getMeso() >= cost && cm.canHold(4031045)) { - cm.gainItem(4031045,1); + if (status == 1) { + if (cm.getMeso() >= cost && cm.canHold(4031045)) { + cm.gainItem(4031045, 1); cm.gainMeso(-cost); - } else - cm.sendOk("Are you sure you have #b"+cost+" mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); + } else { + cm.sendOk("Are you sure you have #b" + cost + " mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); + } cm.dispose(); } } diff --git a/scripts/npc/2040002.js b/scripts/npc/2040002.js index 4e81a20573..bab5006e7e 100644 --- a/scripts/npc/2040002.js +++ b/scripts/npc/2040002.js @@ -36,31 +36,29 @@ function start() { if (em.getProperty("noEntry") == "false") { cm.sendNext("The pendulum is hidden inside a dollhouse that looks different than the others."); - } - else { + } else { cm.sendOk("Someone else is already searching the area. Please wait until the area is cleared."); cm.dispose(); } - } - else { + } else { cm.sendOk("We are not allowed to let the general public wander past this point."); cm.dispose(); } } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; - if (status == 1) + if (status == 1) { cm.sendYesNo("Are you ready to enter the dollhouse map?"); - else if (status == 2) { + } else if (status == 2) { var em = cm.getEventManager("DollHouse"); if (!em.startInstance(cm.getPlayer())) { cm.sendOk("Hmm... The DollHouse is being challenged already, it seems. Try again later."); } - + cm.dispose(); } } diff --git a/scripts/npc/2040003.js b/scripts/npc/2040003.js index 86b188626d..d2022e19f6 100644 --- a/scripts/npc/2040003.js +++ b/scripts/npc/2040003.js @@ -1,50 +1,50 @@ var status = 0; var entry; -function start() { - if(cm.getPlayer().getMapId() == 922000000) { - entry = 0; - cm.sendYesNo("Do you wish to quit this stage?"); - status++; - } - else if(cm.isQuestStarted(3239)) { - entry = 1; - cm.sendYesNo("Do you want to enter #bToy Factory#k?"); - status++; - } - else { - cm.sendOk("Access to #bToy Factory#k is restricted to the public."); - } +function start() { + if (cm.getPlayer().getMapId() == 922000000) { + entry = 0; + cm.sendYesNo("Do you wish to quit this stage?"); + status++; + } else if (cm.isQuestStarted(3239)) { + entry = 1; + cm.sendYesNo("Do you want to enter #bToy Factory#k?"); + status++; + } else { + cm.sendOk("Access to #bToy Factory#k is restricted to the public."); + } } function action(mode, type, selection) { - if(status == 1) { - if(entry == 0) { - if(mode <= 0) { - cm.sendOk("Ok. Call me if you urge to exit, then."); - cm.dispose(); - return; - } - - cm.warp(922000009, 0); - if(!(cm.isQuestStarted(3239) && cm.haveItem(4031092, 10))) cm.removeAll(4031092); - cm.dispose(); - } + if (status == 1) { + if (entry == 0) { + if (mode <= 0) { + cm.sendOk("Ok. Call me if you urge to exit, then."); + cm.dispose(); + return; + } - else { - if(mode <= 0) { - cm.dispose(); - return; - } - - if(cm.getWarpMap(922000000).countPlayers() == 0) { - cm.warp(922000000, 0); - if(!(cm.isQuestStarted(3239) && cm.haveItem(4031092, 10))) cm.removeAll(4031092); - } else { - cm.sendOk("Someone else is already attempting the parts. Wait for them to finish before you enter."); - } - - cm.dispose(); - } - } + cm.warp(922000009, 0); + if (!(cm.isQuestStarted(3239) && cm.haveItem(4031092, 10))) { + cm.removeAll(4031092); + } + cm.dispose(); + } else { + if (mode <= 0) { + cm.dispose(); + return; + } + + if (cm.getWarpMap(922000000).countPlayers() == 0) { + cm.warp(922000000, 0); + if (!(cm.isQuestStarted(3239) && cm.haveItem(4031092, 10))) { + cm.removeAll(4031092); + } + } else { + cm.sendOk("Someone else is already attempting the parts. Wait for them to finish before you enter."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2040014.js b/scripts/npc/2040014.js index 444cecfbac..10238e95c8 100644 --- a/scripts/npc/2040014.js +++ b/scripts/npc/2040014.js @@ -38,83 +38,92 @@ var matQty; var cost; var qty; -var items = [4080100,4080006,4080007,4080008,4080009,4080010,4080011]; -var matSet = [[4030012],[4030009,4030013,4030014],[4030009,4030013,4030016],[4030009,4030014,4030016],[4030009,4030015,4030013],[4030009,4030015,4030014],[4030009,4030015,4030016]]; -var matQtySet = [[99],[1,99,99],[1,99,99],[1,99,99],[1,99,99],[1,99,99],[1,99,99]]; -var costSet = [10000,25000,25000,25000,25000,25000,25000]; +var items = [4080100, 4080006, 4080007, 4080008, 4080009, 4080010, 4080011]; +var matSet = [[4030012], [4030009, 4030013, 4030014], [4030009, 4030013, 4030016], [4030009, 4030014, 4030016], [4030009, 4030015, 4030013], [4030009, 4030015, 4030014], [4030009, 4030015, 4030016]]; +var matQtySet = [[99], [1, 99, 99], [1, 99, 99], [1, 99, 99], [1, 99, 99], [1, 99, 99], [1, 99, 99]]; +var costSet = [10000, 25000, 25000, 25000, 25000, 25000, 25000]; function start() { cm.getPlayer().setCS(true); var selStr = "Hey there! My name is #p2040014#, and I am a specialist in mini-games. What kind of mini-game you want me to make? #b" - var options = ["#i4080100# #t4080100#","#i4080006# #t4080006#","#i4080007# #t4080007#","#i4080008# #t4080008#","#i4080009# #t4080009#","#i4080010# #t4080010#","#i4080011# #t4080011#"]; - for (var i = 0; i < options.length; i++) + var options = ["#i4080100# #t4080100#", "#i4080006# #t4080006#", "#i4080007# #t4080007#", "#i4080008# #t4080008#", "#i4080009# #t4080009#", "#i4080010# #t4080010#", "#i4080011# #t4080011#"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } cm.sendSimple(selStr); } function action(mode, type, selection) { status++; - if (mode != 1){ + if (mode != 1) { cm.dispose(); return; } - if (status == 0) { + if (status == 0) { selectedItem = selection; - + item = items[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; qty = 1; - + var prompt = "So we are going for "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#"; - else + } else { prompt += qty + " #t" + item + "#"; + } prompt += ", right? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array) - for(var i = 0; i < mats.length; i++) + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { prompt += "\r\n#i" + mats[i] + "# " + (matQty[i] * qty) + " #t" + mats[i] + "#"; - else + } + } else { prompt += "\r\n#i" + mats + "# " + (matQty * qty) + " #t" + mats + "#"; - if (cost > 0) + } + if (cost > 0) { prompt += "\r\n#i4031138# " + (cost * qty) + " meso"; + } cm.sendYesNo(prompt); - }else if (status == 1) { + } else if (status == 1) { var complete = true; - + if (cm.getMeso() < (cost * qty)) { cm.sendOk("See, I need to specify my wages to support my career, that cannot be bypassed. I will gladly help you once you've got the money."); cm.dispose(); return; - } - else { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - }else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; - } - if (!complete) + } + } + if (!complete) { cm.sendOk("You are lacking some items for the set you want to make. Please provide them so that we can assemble the game set."); - else { - if (cm.canHold(item,qty)) { + } else { + if (cm.canHold(item, qty)) { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++) + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -(matQty[i] * qty)); - }else + } + } else { cm.gainItem(mats, -(matQty * qty)); + } cm.gainMeso(-(cost * qty)); - + cm.gainItem(item, qty); cm.sendOk("There is your game set. Have fun!"); - }else { + } else { cm.sendOk("I can't make a set for you if there's no room in your ETC inventory for it. Please free a space first and then talk to me."); } } - + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2040016.js b/scripts/npc/2040016.js index 3a2a99abf8..df224d38de 100644 --- a/scripts/npc/2040016.js +++ b/scripts/npc/2040016.js @@ -48,238 +48,228 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Hm? Who might you be? Oh, you've heard about my forging skills? In that case, I'd be glad to process some of your ores... for a fee.#b" - var options = new Array("Refine a mineral ore","Refine a jewel ore","Refine a rare jewel","Refine a crystal ore","Create materials","Create Arrows"); - for (var i = 0; i < options.length; i++){ + var options = ["Refine a mineral ore", "Refine a jewel ore", "Refine a rare jewel", "Refine a crystal ore", "Create materials", "Create Arrows"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //mineral refine + if (selectedType == 0) { //mineral refine var selStr = "So, what kind of mineral ore would you like to refine?#b"; - var minerals = new Array ("Bronze","Steel","Mithril","Adamantium","Silver","Orihalcon","Gold"); - for (var i = 0; i < minerals.length; i++){ + var minerals = ["Bronze", "Steel", "Mithril", "Adamantium", "Silver", "Orihalcon", "Gold"]; + for (var i = 0; i < minerals.length; i++) { selStr += "\r\n#L" + i + "# " + minerals[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 1){ //jewel refine + } else if (selectedType == 1) { //jewel refine var selStr = "So, what kind of jewel ore would you like to refine?#b"; - var jewels = new Array ("Garnet","Amethyst","Aquamarine","Emerald","Opal","Sapphire","Topaz","Diamond","Black Crystal"); - for (var i = 0; i < jewels.length; i++){ + var jewels = ["Garnet", "Amethyst", "Aquamarine", "Emerald", "Opal", "Sapphire", "Topaz", "Diamond", "Black Crystal"]; + for (var i = 0; i < jewels.length; i++) { selStr += "\r\n#L" + i + "# " + jewels[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 2){ //rock refine + } else if (selectedType == 2) { //rock refine var selStr = "A rare jewel? Which one were you thinking of?#b"; - var items = new Array ("Moon Rock","Star Rock"); - for (var i = 0; i < items.length; i++){ + var items = ["Moon Rock", "Star Rock"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 3){ //crystal refine + } else if (selectedType == 3) { //crystal refine var selStr = "Crystal ore? I love refining those!#b"; - var crystals = new Array ("Power Crystal","Wisdom Crystal","DEX Crystal","LUK Crystal"); - for (var i = 0; i < crystals.length; i++){ + var crystals = ["Power Crystal", "Wisdom Crystal", "DEX Crystal", "LUK Crystal"]; + for (var i = 0; i < crystals.length; i++) { selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 4){ //material refine + } else if (selectedType == 4) { //material refine var selStr = "Materials? I know of a few materials that I can make for you...#b"; - var materials = new Array ("Make Processed Wood with Tree Branch","Make Processed Wood with Firewood","Make Screws (packs of 15)"); - for (var i = 0; i < materials.length; i++){ + var materials = ["Make Processed Wood with Tree Branch", "Make Processed Wood with Firewood", "Make Screws (packs of 15)"]; + for (var i = 0; i < materials.length; i++) { selStr += "\r\n#L" + i + "# " + materials[i] + "#l"; } equip = false; cm.sendSimple(selStr); - } - else if (selectedType == 5){ //arrow refine + } else if (selectedType == 5) { //arrow refine var selStr = "Arrows? Not a problem at all.#b"; - var arrows = new Array ("Arrow for Bow","Arrow for Crossbow","Bronze Arrow for Bow","Bronze Arrow for Crossbow","Steel Arrow for Bow","Steel Arrow for Crossbow"); - for (var i = 0; i < arrows.length; i++){ + var arrows = ["Arrow for Bow", "Arrow for Crossbow", "Bronze Arrow for Bow", "Bronze Arrow for Crossbow", "Steel Arrow for Bow", "Steel Arrow for Crossbow"]; + for (var i = 0; i < arrows.length; i++) { selStr += "\r\n#L" + i + "# " + arrows[i] + "#l"; } equip = true; cm.sendSimple(selStr); } - if (equip) + if (equip) { status++; - } - else if (status == 2 && mode == 1) { + } + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 0){ //mineral refine - var itemSet = new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006); - var matSet = new Array(4010000,4010001,4010002,4010003,4010004,4010005,4010006); - var matQtySet = new Array(10,10,10,10,10,10,10); - var costSet = new Array(270,270,270,450,450,450,720); + if (selectedType == 0) { //mineral refine + var itemSet = [4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006]; + var matSet = [4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10]; + var costSet = [270, 270, 270, 450, 450, 450, 720]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //jewel refine + var itemSet = [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]; + var matSet = [4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10, 10, 10]; + var costSet = [450, 450, 450, 450, 450, 450, 450, 900, 2700]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //rock refine + var itemSet = [4011007, 4021009]; + var matSet = [[4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006], [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]]; + var matQtySet = [[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1]]; + var costSet = [9000, 13500]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 3) { //crystal refine + var itemSet = [4005000, 4005001, 4005002, 4005003]; + var matSet = [4004000, 4004001, 4004002, 4004003]; + var matQtySet = [10, 10, 10, 10]; + var costSet = [4500, 4500, 4500, 4500]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 4) { //material refine + var itemSet = [4003001, 4003001, 4003000]; + var matSet = [4000003, 4000018, [4011000, 4011001]]; + var matQtySet = [10, 5, [1, 1]]; + var costSet = [0, 0, 0]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ //jewel refine - var itemSet = new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008); - var matSet = new Array(4020000,4020001,4020002,4020003,4020004,4020005,4020006,4020007,4020008); - var matQtySet = new Array(10,10,10,10,10,10,10,10,10); - var costSet = new Array (450,450,450,450,450,450,450,900,2700); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //rock refine - var itemSet = new Array(4011007,4021009); - var matSet = new Array(new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006), new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008)); - var matQtySet = new Array(new Array(1,1,1,1,1,1,1),new Array(1,1,1,1,1,1,1,1,1)); - var costSet = new Array(9000,13500); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //crystal refine - var itemSet = new Array (4005000,4005001,4005002,4005003); - var matSet = new Array(4004000,4004001,4004002,4004003); - var matQtySet = new Array (10,10,10,10); - var costSet = new Array (4500,4500,4500,4500); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 4){ //material refine - var itemSet = new Array (4003001,4003001,4003000); - var matSet = new Array(4000003,4000018,new Array (4011000,4011001)); - var matQtySet = new Array (10,5,new Array (1,1)); - var costSet = new Array (0,0,0); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - - cm.sendGetNumber(prompt,1,1,100) - } - else if (status == 3 && mode == 1) { - if (equip) - { + + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3 && mode == 1) { + if (equip) { selectedItem = selection; qty = 1; - } - else + } else { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } // thanks kvmba for noticing arrow selection crashing players - if (selectedType == 5){ //arrow refine - var itemSet = new Array(2060000,2061000,2060001,2061001,2060002,2061002); - var matSet = new Array(new Array (4003001,4003004),new Array (4003001,4003004),new Array (4011000,4003001,4003004),new Array (4011000,4003001,4003004), - new Array (4011001,4003001,4003005),new Array (4011001,4003001,4003005)); - var matQtySet = new Array (new Array (1,1),new Array (1,1),new Array (1,3,10),new Array (1,3,10),new Array (1,5,15),new Array (1,5,15)); - var costSet = new Array (0,0,0,0,0,0); + if (selectedType == 5) { //arrow refine + var itemSet = [2060000, 2061000, 2060001, 2061001, 2060002, 2061002]; + var matSet = [[4003001, 4003004], [4003001, 4003004], [4011000, 4003001, 4003004], [4011000, 4003001, 4003004], + [4011001, 4003001, 4003005], [4011001, 4003001, 4003005]]; + var matQtySet = [[1, 1], [1, 1], [1, 3, 10], [1, 3, 10], [1, 5, 15], [1, 5, 15]]; + var costSet = [0, 0, 0, 0, 0, 0]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - + var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - + } + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 4 && mode == 1) { + } else if (status == 4 && mode == 1) { var complete = true; var recvItem = item, recvQty; - + if (item >= 2060000 && item <= 2060002) //bow arrows + { recvQty = 1000 - (item - 2060000) * 100; - else if (item >= 2061000 && item <= 2061002) //xbow arrows + } else if (item >= 2061000 && item <= 2061002) //xbow arrows + { recvQty = 1000 - (item - 2061000) * 100; - else if (item == 4003000)//screws + } else if (item == 4003000)//screws + { recvQty = 15 * qty; - else + } else { recvQty = qty; - - if(!cm.canHold(recvItem, recvQty)) { + } + + if (!cm.canHold(recvItem, recvQty)) { cm.sendOk("I'm afraid you have no slots available for this transaction."); - } - else if (cm.getMeso() < cost * qty) - { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("I'm afraid you cannot afford my services."); - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - { - if (matQty[i] * qty == 1) { - if (!cm.haveItem(mats[i] * qty)) - { + for (var i = 0; complete && i < mats.length; i++) { + if (matQty[i] * qty == 1) { + if (!cm.haveItem(mats[i] * qty)) { + complete = false; + } + } else { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; } } - else { - if (!cm.haveItem(mats[i],matQty[i] * qty)) complete=false; - } + } + } else { + if (!cm.haveItem(mats, matQty * qty)) { + complete = false; } } - else { - if (!cm.haveItem(mats, matQty * qty)) complete=false; - } - - if (!complete) + + if (!complete) { cm.sendOk("Hold it, I can't finish that without all of the proper materials. Bring them first, then we'll talk."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } - } - else + } else { cm.gainItem(mats, -matQty * qty); + } - if (cost > 0) + if (cost > 0) { cm.gainMeso(-cost * qty); + } cm.gainItem(recvItem, recvQty); cm.sendOk("All done. If you need anything else, you know where to find me."); } } - + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2040019.js b/scripts/npc/2040019.js index 22c93c090e..8f1e06a5d4 100644 --- a/scripts/npc/2040019.js +++ b/scripts/npc/2040019.js @@ -46,24 +46,25 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well, I'm bored, so I'll help out the doctor. For a #b#t5152006##k, I will change the way you look. But don't forget, it will be random!\r\n#L2#Plastic Surgery: #i5152006##t5152006##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_r.length; i++) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_r.length; i++) { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -71,10 +72,9 @@ function action(mode, type, selection) { } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152006##k?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5152006) == true){ + if (cm.haveItem(5152006) == true) { cm.gainItem(5152006, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); diff --git a/scripts/npc/2040020.js b/scripts/npc/2040020.js index 7a9d92d255..0a8fae40d6 100644 --- a/scripts/npc/2040020.js +++ b/scripts/npc/2040020.js @@ -42,219 +42,222 @@ function start() { cm.getPlayer().setCS(true); var selStr = "Hello, and welcome to the Ludibrium Glove Store. How can I help you today?#b" - var options = new Array("What's a stimulator?","Create a Warrior glove","Create a Bowman glove","Create a Magician glove","Create a Thief glove", - "Create a Warrior glove with a Stimulator","Create a Bowman glove with a Stimulator","Create a Magician glove with a Stimulator","Create a Thief glove with a Stimulator"); - for (var i = 0; i < options.length; i++){ + var options = ["What's a stimulator?", "Create a Warrior glove", "Create a Bowman glove", "Create a Magician glove", "Create a Thief glove", + "Create a Warrior glove with a Stimulator", "Create a Bowman glove with a Stimulator", "Create a Magician glove with a Stimulator", "Create a Thief glove with a Stimulator"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); } function action(mode, type, selection) { - if (mode > 0) + if (mode > 0) { status++; - else { + } else { cm.dispose(); return; } if (status == 1) { selectedType = selection; - if (selectedType > 4) + if (selectedType > 4) { stimulator = true; - else + } else { stimulator = false; + } if (selectedType == 0) { //What's a stim? cm.sendNext("A stimulator is a special potion that I can add into the process of creating certain items. It gives it stats as though it had dropped from a monster. However, it is possible to have no change, and it is also possible for the item to be below average. There's also a 10% chance of not getting any item when using a stimulator, so please choose wisely.") cm.dispose(); - } else if (selectedType == 1){ //warrior glove + } else if (selectedType == 1) { //warrior glove var selStr = "Warrior glove? Sure thing, which kind?#b"; - var items = new Array ("Bronze Missel#k - Warrior Lv. 30#b","Steel Briggon#k - Warrior Lv. 35#b","Iron Knuckle#k - Warrior Lv. 40#b","Steel Brist#k - Warrior Lv. 50#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Bronze Missel#k - Warrior Lv. 30#b", "Steel Briggon#k - Warrior Lv. 35#b", "Iron Knuckle#k - Warrior Lv. 40#b", "Steel Brist#k - Warrior Lv. 50#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 2){ //bowman glove + } else if (selectedType == 2) { //bowman glove var selStr = "Bowman glove? Sure thing, which kind?#b"; - var items = new Array ("Brown Marker#k - Bowman Lv. 30#b","Bronze Scaler#k - Bowman Lv. 35#b","Aqua Brace#k - Bowman Lv. 40#b","Blue Willow#k - Bowman Lv. 50#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Brown Marker#k - Bowman Lv. 30#b", "Bronze Scaler#k - Bowman Lv. 35#b", "Aqua Brace#k - Bowman Lv. 40#b", "Blue Willow#k - Bowman Lv. 50#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 3){ //magician glove + } else if (selectedType == 3) { //magician glove var selStr = "Magician glove? Sure thing, which kind?#b"; - var items = new Array ("Red Lutia#k - Magician Lv. 30#b","Red Noel#k - Magician Lv. 35#b","Red Arten#k - Magician Lv. 40#b","Red Pennance#k - Magician Lv. 50#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Red Lutia#k - Magician Lv. 30#b", "Red Noel#k - Magician Lv. 35#b", "Red Arten#k - Magician Lv. 40#b", "Red Pennance#k - Magician Lv. 50#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 4){ //thief glove + } else if (selectedType == 4) { //thief glove var selStr = "Thief glove? Sure thing, which kind?#b"; - var gloves = new Array ("Steel Sylvia#k - Thief Lv. 30#b","Steel Arbion#k - Thief Lv. 35#b","Red Cleave#k - Thief Lv. 40#b","Blue Moon Glove#k - Thief Lv. 50#b"); - for (var i = 0; i < gloves.length; i++){ + var gloves = ["Steel Sylvia#k - Thief Lv. 30#b", "Steel Arbion#k - Thief Lv. 35#b", "Red Cleave#k - Thief Lv. 40#b", "Blue Moon Glove#k - Thief Lv. 50#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 5){ //warrior glove w/ Stim + } else if (selectedType == 5) { //warrior glove w/ Stim var selStr = "Warrior glove with a stimulator? Sure thing, which kind?#b"; - var crystals = new Array ("Steel Missel#k - Warrior Lv. 30#b","Orihalcon Missel#k - Warrior Lv. 30#b","Yellow Briggon#k - Warrior Lv. 35#b","Dark Briggon#k - Warrior Lv. 35#b", - "Adamantium Knuckle#k - Warrior Lv. 40#b","Dark Knuckle#k - Warrior Lv. 40#b","Mithril Brist#k - Warrior Lv. 50#b","Gold Brist#k - Warrior Lv. 50#b"); - for (var i = 0; i < crystals.length; i++){ + var crystals = ["Steel Missel#k - Warrior Lv. 30#b", "Orihalcon Missel#k - Warrior Lv. 30#b", "Yellow Briggon#k - Warrior Lv. 35#b", "Dark Briggon#k - Warrior Lv. 35#b", + "Adamantium Knuckle#k - Warrior Lv. 40#b", "Dark Knuckle#k - Warrior Lv. 40#b", "Mithril Brist#k - Warrior Lv. 50#b", "Gold Brist#k - Warrior Lv. 50#b"]; + for (var i = 0; i < crystals.length; i++) { selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 6){ //bowman glove w/ stim + } else if (selectedType == 6) { //bowman glove w/ stim var selStr = "Bowman glove with a stimulator? Sure thing, which kind?#b"; - var crystals = new Array ("Green Marker#k - Bowman Lv. 30#b","Black Marker#k - Bowman Lv. 30#b","Mithril Scaler#k - Bowman Lv. 35#b","Gold Scaler#k - Bowman Lv. 35#b","Gold Brace#k - Bowman Lv. 40#b","Dark Brace#k - Bowman Lv. 40#b","Red Willow#k - Bowman Lv. 50#b","Dark Willow#k - Bowman Lv. 50#b"); - for (var i = 0; i < crystals.length; i++){ + var crystals = ["Green Marker#k - Bowman Lv. 30#b", "Black Marker#k - Bowman Lv. 30#b", "Mithril Scaler#k - Bowman Lv. 35#b", "Gold Scaler#k - Bowman Lv. 35#b", "Gold Brace#k - Bowman Lv. 40#b", "Dark Brace#k - Bowman Lv. 40#b", "Red Willow#k - Bowman Lv. 50#b", "Dark Willow#k - Bowman Lv. 50#b"]; + for (var i = 0; i < crystals.length; i++) { selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 7){ //magician glove w/ stim + } else if (selectedType == 7) { //magician glove w/ stim var selStr = "Magician glove with a stimulator? Sure thing, which kind?#b"; - var items = new Array ("Blue Lutia#k - Magician Lv. 30#b","Black Lutia#k - Magician Lv. 30#b","Blue Noel#k - Magician Lv. 35#b","Dark Noel#k - Magician Lv. 35#b", - "Blue Arten#k - Magician Lv. 40#b","Dark Arten#k - Magician Lv. 40#b","Blue Pennance#k - Magician Lv. 50#b","Dark Pennance#k - Magician Lv. 50#b"); - for (var i = 0; i < items.length; i++){ + var items = ["Blue Lutia#k - Magician Lv. 30#b", "Black Lutia#k - Magician Lv. 30#b", "Blue Noel#k - Magician Lv. 35#b", "Dark Noel#k - Magician Lv. 35#b", + "Blue Arten#k - Magician Lv. 40#b", "Dark Arten#k - Magician Lv. 40#b", "Blue Pennance#k - Magician Lv. 50#b", "Dark Pennance#k - Magician Lv. 50#b"]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "# " + items[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 8){ //thief glove w/ stim + } else if (selectedType == 8) { //thief glove w/ stim var selStr = "Thief glove with a stimulator? Sure thing, which kind?#b"; - var gloves = new Array ("Silver Sylvia#k - Thief Lv. 30#b","Gold Sylvia#k - Thief Lv. 30#b","Orihalcon Arbion#k - Thief Lv. 35#b","Gold Arbion#k - Thief Lv. 35#b","Gold Cleave#k - Thief Lv. 40#b", - "Dark Cleave#k - Thief Lv. 40#b","Red Moon Glove#k - Thief Lv. 50#b","Brown Moon Glove#k - Thief Lv. 50#b"); - for (var i = 0; i < gloves.length; i++){ + var gloves = ["Silver Sylvia#k - Thief Lv. 30#b", "Gold Sylvia#k - Thief Lv. 30#b", "Orihalcon Arbion#k - Thief Lv. 35#b", "Gold Arbion#k - Thief Lv. 35#b", "Gold Cleave#k - Thief Lv. 40#b", + "Dark Cleave#k - Thief Lv. 40#b", "Red Moon Glove#k - Thief Lv. 50#b", "Brown Moon Glove#k - Thief Lv. 50#b"]; + for (var i = 0; i < gloves.length; i++) { selStr += "\r\n#L" + i + "# " + gloves[i] + "#l"; } cm.sendSimple(selStr); } - } - else if (status == 2) { + } else if (status == 2) { selectedItem = selection; - if (selectedType == 1){ //warrior glove - var itemSet = new Array(1082007,1082008,1082023,1082009); - var matSet = new Array(new Array(4011000,4011001,4003000),new Array(4000021,4011001,4003000),new Array(4000021,4011001,4003000),new Array(4011001,4021007,4000030,4003000)); - var matQtySet = new Array(new Array(3,2,15),new Array(30,4,15),new Array(50,5,40),new Array(3,2,30,45)); - var costSet = new Array(18000,27000,36000,45000); + if (selectedType == 1) { //warrior glove + var itemSet = [1082007, 1082008, 1082023, 1082009]; + var matSet = [[4011000, 4011001, 4003000], [4000021, 4011001, 4003000], [4000021, 4011001, 4003000], [4011001, 4021007, 4000030, 4003000]]; + var matQtySet = [[3, 2, 15], [30, 4, 15], [50, 5, 40], [3, 2, 30, 45]]; + var costSet = [18000, 27000, 36000, 45000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 2){ //bowman glove - var itemSet = new Array(1082048,1082068,1082071,1082084); - var matSet = new Array(new Array(4000021,4011006,4021001),new Array(4011000,4011001,4000021,4003000),new Array(4011001,4021000,4021002,4000021,4003000),new Array(4011004,4011006,4021002,4000030,4003000)); - var matQtySet = new Array(new Array(50,2,1),new Array(1,3,60,15),new Array(3,1,3,80,25),new Array(3,1,2,40,35)); - var costSet = new Array(18000,27000,36000,45000); + } else if (selectedType == 2) { //bowman glove + var itemSet = [1082048, 1082068, 1082071, 1082084]; + var matSet = [[4000021, 4011006, 4021001], [4011000, 4011001, 4000021, 4003000], [4011001, 4021000, 4021002, 4000021, 4003000], [4011004, 4011006, 4021002, 4000030, 4003000]]; + var matQtySet = [[50, 2, 1], [1, 3, 60, 15], [3, 1, 3, 80, 25], [3, 1, 2, 40, 35]]; + var costSet = [18000, 27000, 36000, 45000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 3){ //magician glove - var itemSet = new Array(1082051,1082054,1082062,1082081); - var matSet = new Array(new Array(4000021,4021006,4021000),new Array(4000021,4011006,4011001,4021000),new Array(4000021,4021000,4021006,4003000),new Array(4021000,4011006,4000030,4003000)); - var matQtySet = new Array(new Array(60,1,2),new Array(70,1,3,2),new Array(80,3,3,30),new Array(3,2,35,40)); - var costSet = new Array(22500,27000,36000,45000); + } else if (selectedType == 3) { //magician glove + var itemSet = [1082051, 1082054, 1082062, 1082081]; + var matSet = [[4000021, 4021006, 4021000], [4000021, 4011006, 4011001, 4021000], [4000021, 4021000, 4021006, 4003000], [4021000, 4011006, 4000030, 4003000]]; + var matQtySet = [[60, 1, 2], [70, 1, 3, 2], [80, 3, 3, 30], [3, 2, 35, 40]]; + var costSet = [22500, 27000, 36000, 45000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 4){ //thief glove - var itemSet = new Array(1082042,1082046,1082075,1082065); - var matSet = new Array(new Array(4011001,4000021,4003000),new Array(4011001,4011000,4000021,4003000),new Array(4021000,4000101,4000021,4003000),new Array(4021005,4021008,4000030,4003000)); - var matQtySet = new Array(new Array(2,50,10),new Array(3,1,60,15),new Array(3,100,80,30),new Array(3,1,40,30)); - var costSet = new Array(22500,27000,36000,45000); + } else if (selectedType == 4) { //thief glove + var itemSet = [1082042, 1082046, 1082075, 1082065]; + var matSet = [[4011001, 4000021, 4003000], [4011001, 4011000, 4000021, 4003000], [4021000, 4000101, 4000021, 4003000], [4021005, 4021008, 4000030, 4003000]]; + var matQtySet = [[2, 50, 10], [3, 1, 60, 15], [3, 100, 80, 30], [3, 1, 40, 30]]; + var costSet = [22500, 27000, 36000, 45000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 5){ //warrior glove w/stim - var itemSet = new Array(1082005,1082006,1082035,1082036,1082024,1082025,1082010,1082011); - var matSet = new Array(new Array(1082007,4011001),new Array(1082007,4011005),new Array(1082008,4021006),new Array(1082008,4021008),new Array(1082023,4011003),new Array(1082023,4021008), - new Array(1082009,4011002),new Array(1082009,4011006)); - var matQtySet = new Array (new Array(1,1),new Array(1,2),new Array(1,3),new Array(1,1),new Array(1,4),new Array(1,2),new Array(1,5),new Array(1,4)); - var costSet = new Array (18000,22500,27000,36000,40500,45000,49500,54000); + } else if (selectedType == 5) { //warrior glove w/stim + var itemSet = [1082005, 1082006, 1082035, 1082036, 1082024, 1082025, 1082010, 1082011]; + var matSet = [[1082007, 4011001], [1082007, 4011005], [1082008, 4021006], [1082008, 4021008], [1082023, 4011003], [1082023, 4021008], + [1082009, 4011002], [1082009, 4011006]]; + var matQtySet = [[1, 1], [1, 2], [1, 3], [1, 1], [1, 4], [1, 2], [1, 5], [1, 4]]; + var costSet = [18000, 22500, 27000, 36000, 40500, 45000, 49500, 54000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 6){ //bowman glove w/stim - var itemSet = new Array (1082049,1082050,1082069,1082070,1082072,1082073,1082085,1082083); - var matSet = new Array(new Array(1082048,4021003),new Array(1082048,4021008),new Array(1082068,4011002),new Array(1082068,4011006),new Array(1082071,4011006),new Array(1082071,4021008),new Array(1082084,4011000,4021000),new Array(1082084,4011006,4021008)); - var matQtySet = new Array (new Array(1,3),new Array(1,1),new Array(1,4),new Array(1,2),new Array(1,4),new Array(1,2),new Array(1,1,5),new Array(1,2,2)); - var costSet = new Array (13500,18000,19800,22500,27000,36000,49500,54000); + } else if (selectedType == 6) { //bowman glove w/stim + var itemSet = [1082049, 1082050, 1082069, 1082070, 1082072, 1082073, 1082085, 1082083]; + var matSet = [[1082048, 4021003], [1082048, 4021008], [1082068, 4011002], [1082068, 4011006], [1082071, 4011006], [1082071, 4021008], [1082084, 4011000, 4021000], [1082084, 4011006, 4021008]]; + var matQtySet = [[1, 3], [1, 1], [1, 4], [1, 2], [1, 4], [1, 2], [1, 1, 5], [1, 2, 2]]; + var costSet = [13500, 18000, 19800, 22500, 27000, 36000, 49500, 54000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 7){ //magician glove w/ stim - var itemSet = new Array(1082052,1082053,1082055,1082056,1082063,1082064,1082082,1082080); - var matSet = new Array(new Array(1082051,4021005),new Array(1082051,4021008),new Array(1082054,4021005),new Array(1082054,4021008),new Array(1082062,4021002),new Array(1082062,4021008), - new Array(1082081,4021002),new Array(1082081,4021008)); - var matQtySet = new Array(new Array(1,3),new Array(1,1),new Array(1,3),new Array(1,1),new Array(1,4),new Array(1,2),new Array(1,5),new Array(1,3)); - var costSet = new Array (31500,36000,36000,40500,40500,45000,49500,54000); + } else if (selectedType == 7) { //magician glove w/ stim + var itemSet = [1082052, 1082053, 1082055, 1082056, 1082063, 1082064, 1082082, 1082080]; + var matSet = [[1082051, 4021005], [1082051, 4021008], [1082054, 4021005], [1082054, 4021008], [1082062, 4021002], [1082062, 4021008], + [1082081, 4021002], [1082081, 4021008]]; + var matQtySet = [[1, 3], [1, 1], [1, 3], [1, 1], [1, 4], [1, 2], [1, 5], [1, 3]]; + var costSet = [31500, 36000, 36000, 40500, 40500, 45000, 49500, 54000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 8){ //thief glove w/ stim - var itemSet = new Array(1082043,1082044,1082047,1082045,1082076,1082074,1082067,1082066); - var matSet = new Array(new Array(1082042,4011004),new Array(1082042,4011006),new Array(1082046,4011005),new Array(1082046,4011006),new Array(1082075,4011006),new Array(1082075,4021008),new Array(1082065,4021000),new Array(1082065,4011006,4021008)); - var matQtySet = new Array(new Array(1,2),new Array(1,1),new Array(1,3),new Array(1,2),new Array(1,4),new Array(1,2),new Array(1,5),new Array(1,2,1)); - var costSet = new Array (13500,18000,19800,22500,36000,45000,49500,54000); + } else if (selectedType == 8) { //thief glove w/ stim + var itemSet = [1082043, 1082044, 1082047, 1082045, 1082076, 1082074, 1082067, 1082066]; + var matSet = [[1082042, 4011004], [1082042, 4011006], [1082046, 4011005], [1082046, 4011006], [1082075, 4011006], [1082075, 4021008], [1082065, 4021000], [1082065, 4011006, 4021008]]; + var matQtySet = [[1, 2], [1, 1], [1, 3], [1, 2], [1, 4], [1, 2], [1, 5], [1, 2, 1]]; + var costSet = [13500, 18000, 19800, 22500, 36000, 45000, 49500, 54000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if(stimulator) - prompt += "\r\n#i"+stimID+"# 1 #t" + stimID + "#"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + if (stimulator) { + prompt += "\r\n#i" + stimID + "# 1 #t" + stimID + "#"; + } + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } } else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; } - if (cost > 0) + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; + } cm.sendYesNo(prompt); } else if (status == 3) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) { + } else if (cm.getMeso() < cost) { cm.sendOk("Sorry, we only accept meso."); cm.dispose(); return; - } - else { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; + } } - if (stimulator){ //check for stimulator + if (stimulator) { //check for stimulator if (!cm.haveItem(stimID)) { complete = false; } } - if (!complete) + if (!complete) { cm.sendOk("Sorry, but I have to have those items to get this exactly right. Perhaps next time."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i]); } - } else + } else { cm.gainItem(mats, -matQty); + } cm.gainMeso(-cost); - if (stimulator){ //check for stimulator + if (stimulator) { //check for stimulator cm.gainItem(stimID, -1); var deleted = Math.floor(Math.random() * 10); if (deleted != 0) { @@ -263,7 +266,7 @@ function action(mode, type, selection) { } else { cm.sendOk("Eek! I think I accidently added too much stimulator and, well, the whole thing is unusable now... Sorry, but I can't offer a refund."); } - } else { + } else { cm.gainItem(item, 1); cm.sendOk("There, the gloves are ready. Be careful, they're still hot."); } diff --git a/scripts/npc/2040021.js b/scripts/npc/2040021.js index 24ae225110..8527fea205 100644 --- a/scripts/npc/2040021.js +++ b/scripts/npc/2040021.js @@ -40,8 +40,8 @@ var stimID = 4130001; function start() { cm.getPlayer().setCS(true); var selStr = "Hello, and welcome to the Ludibrium Shoe Store. How can I help you today??#b" - var options = new Array("What's a stimulator?","Create Warrior shoes","Create Bowman shoes","Create Magician shoes","Create Thief shoes", "Create Warrior shoes with a Stimulator","Create Bowman shoes with a Stimulator","Create Magician shoes with a Stimulator","Create Thief shoes with a Stimulator"); - for (var i = 0; i < options.length; i++){ + var options = ["What's a stimulator?", "Create Warrior shoes", "Create Bowman shoes", "Create Magician shoes", "Create Thief shoes", "Create Warrior shoes with a Stimulator", "Create Bowman shoes with a Stimulator", "Create Magician shoes with a Stimulator", "Create Thief shoes with a Stimulator"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); @@ -60,83 +60,81 @@ function action(mode, type, selection) { if (selectedType > 4) { stimulator = true; selectedType -= 4; - } - else + } else { stimulator = false; - if (selectedType == 0){ // what is stim + } + if (selectedType == 0) { // what is stim cm.sendNext("A stimulator is a special potion that I can add into the process of creating certain items. It gives it stats as though it had dropped from a monster. However, it is possible to have no change, and it is also possible for the item to be below average. There's also a 10% chance of not getting any item when using a stimulator, so please choose wisely.") cm.dispose(); - } else if (selectedType == 1){ //warrior shoe + } else if (selectedType == 1) { //warrior shoe selStr = "Warrior shoes? Sure thing, which kind?#b"; - shoes = new Array ("Emerald Battle Grieve#k - Warrior Lv. 30#b","Mithril Battle Grieve#k - Warrior Lv. 30#b","Silver Battle Grieve#k - Warrior Lv. 30#b","Blood Battle Grieve#k - Warrior Lv. 30#b", "Steel Trigger#k - Warrior Lv. 35#b","Mithril Trigger#k - Warrior Lv. 35#b","Dark Trigger#k - Warrior Lv. 35#b", "Brown Jangoon Boots#k - Warrior Lv. 40#b","Maroon Jangoon Boots#k - Warrior Lv. 40#b","Blue Jangoon Boots#k - Warrior Lv. 40#b", "Emerald Hildon Boots#k - Warrior Lv. 50#b","Mithril Hildon Boots#k - Warrior Lv. 50#b","Orihalcon Hildon Boots#k - Warrior Lv. 50#b","Gold Hildon Boots#k - Warrior Lv. 50#b");; - } else if (selectedType == 2){ //bowman shoe + shoes = ["Emerald Battle Grieve#k - Warrior Lv. 30#b", "Mithril Battle Grieve#k - Warrior Lv. 30#b", "Silver Battle Grieve#k - Warrior Lv. 30#b", "Blood Battle Grieve#k - Warrior Lv. 30#b", "Steel Trigger#k - Warrior Lv. 35#b", "Mithril Trigger#k - Warrior Lv. 35#b", "Dark Trigger#k - Warrior Lv. 35#b", "Brown Jangoon Boots#k - Warrior Lv. 40#b", "Maroon Jangoon Boots#k - Warrior Lv. 40#b", "Blue Jangoon Boots#k - Warrior Lv. 40#b", "Emerald Hildon Boots#k - Warrior Lv. 50#b", "Mithril Hildon Boots#k - Warrior Lv. 50#b", "Orihalcon Hildon Boots#k - Warrior Lv. 50#b", "Gold Hildon Boots#k - Warrior Lv. 50#b"]; + + } else if (selectedType == 2) { //bowman shoe selStr = "Bowman shoes? Sure thing, which kind?#b"; - shoes = new Array ("Red Hunter Boots#k - Bowman Lv. 30#b","Blue Hunter Boots#k - Bowman Lv. 30#b","Green Hunter Boots#k - Bowman Lv. 30#b","Black Hunter Boots#k - Bowman Lv. 30#b", "Brown Hunter Boots#k - Bowman Lv. 30#b","Blue Silky Boots#k - Bowman Lv. 35#b","Green Silky Boots#k - Bowman Lv. 35#b","Red Silky Boots#k - Bowman Lv. 35#b", "Red Pierre Shoes#k - Bowman Lv. 40#b","Yellow Pierre Shoes#k - Bowman Lv. 40#b","Brown Pierre Shoes#k - Bowman Lv. 40#b","Blue Pierre Shoes#k - Bowman Lv. 40#b", "Brown Steel-Tipped Boots#k - Bowman Lv. 50#b","Green Steel-Tipped Boots#k - Bowman Lv. 50#b","Blue Steel-Tipped Boots#k - Bowman Lv. 50#b","Purple Steel-Tipped Boots#k - Bowman Lv. 50#b"); - } else if (selectedType == 3){ //magician shoe + shoes = ["Red Hunter Boots#k - Bowman Lv. 30#b", "Blue Hunter Boots#k - Bowman Lv. 30#b", "Green Hunter Boots#k - Bowman Lv. 30#b", "Black Hunter Boots#k - Bowman Lv. 30#b", "Brown Hunter Boots#k - Bowman Lv. 30#b", "Blue Silky Boots#k - Bowman Lv. 35#b", "Green Silky Boots#k - Bowman Lv. 35#b", "Red Silky Boots#k - Bowman Lv. 35#b", "Red Pierre Shoes#k - Bowman Lv. 40#b", "Yellow Pierre Shoes#k - Bowman Lv. 40#b", "Brown Pierre Shoes#k - Bowman Lv. 40#b", "Blue Pierre Shoes#k - Bowman Lv. 40#b", "Brown Steel-Tipped Boots#k - Bowman Lv. 50#b", "Green Steel-Tipped Boots#k - Bowman Lv. 50#b", "Blue Steel-Tipped Boots#k - Bowman Lv. 50#b", "Purple Steel-Tipped Boots#k - Bowman Lv. 50#b"]; + } else if (selectedType == 3) { //magician shoe selStr = "Magician shoes? Sure thing, which kind?#b"; - shoes = new Array ("Red Magicshoes#k - Magician Lv. 30#b","Blue Magicshoes#k - Magician Lv. 30#b","White Magicshoes#k - Magician Lv. 30#b","Black Magicshoes#k - Magician Lv. 30#b","Purple Salt Shoes#k - Magician Lv. 35#b","Red Salt Shoes#k - Magician Lv. 35#b","Black Salt Shoes#k - Magician Lv. 35#b","Red Moon Shoes#k - Magician Lv. 40#b","Blue Moon Shoes#k - Magician Lv. 40#b","Gold Moon Shoes#k - Magician Lv. 40#b","Dark Moon Shoes#k - Magician Lv. 40#b", "Pink Goldwind Shoes#k - Magician Lv. 50#b","Blue Goldwind Shoes#k - Magician Lv. 50#b","Purple Goldwind Shoes#k - Magician Lv. 50#b","Green Goldwind Shoes#k - Magician Lv. 50#b"); - } else if (selectedType == 4){ //thief shoe + shoes = ["Red Magicshoes#k - Magician Lv. 30#b", "Blue Magicshoes#k - Magician Lv. 30#b", "White Magicshoes#k - Magician Lv. 30#b", "Black Magicshoes#k - Magician Lv. 30#b", "Purple Salt Shoes#k - Magician Lv. 35#b", "Red Salt Shoes#k - Magician Lv. 35#b", "Black Salt Shoes#k - Magician Lv. 35#b", "Red Moon Shoes#k - Magician Lv. 40#b", "Blue Moon Shoes#k - Magician Lv. 40#b", "Gold Moon Shoes#k - Magician Lv. 40#b", "Dark Moon Shoes#k - Magician Lv. 40#b", "Pink Goldwind Shoes#k - Magician Lv. 50#b", "Blue Goldwind Shoes#k - Magician Lv. 50#b", "Purple Goldwind Shoes#k - Magician Lv. 50#b", "Green Goldwind Shoes#k - Magician Lv. 50#b"]; + } else if (selectedType == 4) { //thief shoe selStr = "Thief shoes? Sure thing, which kind?#b"; - shoes = new Array ("Bronze Chain Boots#k - Thief Lv. 30#b","Iron Chain Boots#k - Thief Lv. 30#b","Silver Chain Boots#k - Thief Lv. 30#b","Gold Chain Boots#k - Thief Lv. 30#b", "Red White-Line Boots#k - Thief Lv. 35#b","Green White-Line Boots#k - Thief Lv. 35#b","Blue White-Line Boots#k - Thief Lv. 35#b", "Black Red-Lined Shoes#k - Thief Lv. 40#b","Black Green-Lined Shoes#k - Thief Lv. 40#b","Black Yellow-Lined Shoes#k - Thief Lv. 40#b","Black Blue-Lined Shoes#k - Thief Lv. 40#b","Blue Goni Shoes#k - Thief Lv. 50#b","Red Goni Shoes#k - Thief Lv. 50#b","Green Goni Shoes#k - Thief Lv. 50#b","Purple Goni Shoes#k - Thief Lv. 50#b"); - } + shoes = ["Bronze Chain Boots#k - Thief Lv. 30#b", "Iron Chain Boots#k - Thief Lv. 30#b", "Silver Chain Boots#k - Thief Lv. 30#b", "Gold Chain Boots#k - Thief Lv. 30#b", "Red White-Line Boots#k - Thief Lv. 35#b", "Green White-Line Boots#k - Thief Lv. 35#b", "Blue White-Line Boots#k - Thief Lv. 35#b", "Black Red-Lined Shoes#k - Thief Lv. 40#b", "Black Green-Lined Shoes#k - Thief Lv. 40#b", "Black Yellow-Lined Shoes#k - Thief Lv. 40#b", "Black Blue-Lined Shoes#k - Thief Lv. 40#b", "Blue Goni Shoes#k - Thief Lv. 50#b", "Red Goni Shoes#k - Thief Lv. 50#b", "Green Goni Shoes#k - Thief Lv. 50#b", "Purple Goni Shoes#k - Thief Lv. 50#b"]; + } if (selectedType != 0) { - for (var i = 0; i < shoes.length; i++) + for (var i = 0; i < shoes.length; i++) { selStr += "\r\n#L" + i + "# " + shoes[i] + "#l"; + } cm.sendSimple(selStr); } - } - else if (status == 2) { + } else if (status == 2) { selectedItem = selection; - if (selectedType == 1){ //warrior shoe - var itemSet = new Array(1072003,1072039,1072040,1072041,1072002,1072112,1072113,1072000,1072126,1072127,1072132,1072133,1072134,1072135); - var matSet = new Array(new Array(4021003,4011001,4000021,4003000),new Array(4011002,4011001,4000021,4003000), - new Array(4011004,4011001,4000021,4003000),new Array(4021000,4011001,4000021,4003000),new Array(4011001,4021004,4000021,4000030,4003000),new Array(4011002,4021004,4000021,4000030,4003000),new Array(4021008,4021004,4000021,4000030,4003000), - new Array(4011003,4000021,4000030,4003000,4000103),new Array(4011005,4021007,4000030,4003000,4000104),new Array(4011002,4021007,4000030,4003000,4000105),new Array(4021008,4011001,4021003,4000030,4003000), - new Array(4021008,4011001,4011002,4000030,4003000),new Array(4021008,4011001,4011005,4000030,4003000),new Array(4021008,4011001,4011006,4000030,4003000)); - var matQtySet = new Array(new Array(4,2,45,15),new Array(4,2,45,15),new Array(4,2,45,15),new Array(4,2,45,15),new Array(3,1,30,20,25),new Array(3,1,30,20,25),new Array(2,1,30,20,25), - new Array(4,100,40,30,100),new Array(4,1,40,30,100),new Array(4,1,40,30,100),new Array(1,3,6,65,45),new Array(1,3,6,65,45),new Array(1,3,6,65,45),new Array(1,3,6,65,45)); - var costSet = new Array(20000,20000,20000,20000,22000,22000,25000,38000,38000,38000,50000,50000,50000,50000); + if (selectedType == 1) { //warrior shoe + var itemSet = [1072003, 1072039, 1072040, 1072041, 1072002, 1072112, 1072113, 1072000, 1072126, 1072127, 1072132, 1072133, 1072134, 1072135]; + var matSet = [[4021003, 4011001, 4000021, 4003000], [4011002, 4011001, 4000021, 4003000], + [4011004, 4011001, 4000021, 4003000], [4021000, 4011001, 4000021, 4003000], [4011001, 4021004, 4000021, 4000030, 4003000], [4011002, 4021004, 4000021, 4000030, 4003000], [4021008, 4021004, 4000021, 4000030, 4003000], + [4011003, 4000021, 4000030, 4003000, 4000103], [4011005, 4021007, 4000030, 4003000, 4000104], [4011002, 4021007, 4000030, 4003000, 4000105], [4021008, 4011001, 4021003, 4000030, 4003000], + [4021008, 4011001, 4011002, 4000030, 4003000], [4021008, 4011001, 4011005, 4000030, 4003000], [4021008, 4011001, 4011006, 4000030, 4003000]]; + var matQtySet = [[4, 2, 45, 15], [4, 2, 45, 15], [4, 2, 45, 15], [4, 2, 45, 15], [3, 1, 30, 20, 25], [3, 1, 30, 20, 25], [2, 1, 30, 20, 25], + [4, 100, 40, 30, 100], [4, 1, 40, 30, 100], [4, 1, 40, 30, 100], [1, 3, 6, 65, 45], [1, 3, 6, 65, 45], [1, 3, 6, 65, 45], [1, 3, 6, 65, 45]]; + var costSet = [20000, 20000, 20000, 20000, 22000, 22000, 25000, 38000, 38000, 38000, 50000, 50000, 50000, 50000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //bowman shoe - var itemSet = new Array(1072079,1072080,1072081,1072082,1072083,1072101,1072102,1072103,1072118,1072119,1072120,1072121,1072122,1072123,1072124,1072125); - var matSet = new Array(new Array(4000021,4021000,4003000),new Array(4000021,4021005,4003000),new Array(4000021,4021003,4003000), - new Array(4000021,4021004,4003000),new Array(4000021,4021006,4003000),new Array(4021002,4021006,4000030,4000021,4003000),new Array(4021003,4021006,4000030,4000021,4003000),new Array(4021000,4021006,4000030,4000021,4003000), - new Array(4021000,4003000,4000030,4000106),new Array(4021006,4003000,4000030,4000107),new Array(4011003,4003000,4000030,4000108),new Array(4021002,4003000,4000030,4000099),new Array(4011001,4021006,4021008,4000030,4003000,4000033), - new Array(4011001,4021006,4021008,4000030,4003000,4000032),new Array(4011001,4021006,4021008,4000030,4003000,4000041),new Array(4011001,4021006,4021008,4000030,4003000,4000042)); - var matQtySet = new Array(new Array(50,2,15),new Array(50,2,15),new Array(50,2,15),new Array(50,2,15),new Array(50,2,15), - new Array(3,1,15,30,20),new Array(3,1,15,30,20),new Array(3,1,15,30,20),new Array(4,30,45,100),new Array(4,30,45,100),new Array(5,30,45,100),new Array(5,30,45,100), - new Array(3,3,1,60,35,80),new Array(3,3,1,60,35,150),new Array(3,3,1,60,35,100),new Array(3,3,1,60,35,250)); - var costSet = new Array(19000,19000,19000,19000,19000,19000,20000,20000,20000,32000,32000,40000,40000,50000,50000,50000,50000); + } else if (selectedType == 2) { //bowman shoe + var itemSet = [1072079, 1072080, 1072081, 1072082, 1072083, 1072101, 1072102, 1072103, 1072118, 1072119, 1072120, 1072121, 1072122, 1072123, 1072124, 1072125]; + var matSet = [[4000021, 4021000, 4003000], [4000021, 4021005, 4003000], [4000021, 4021003, 4003000], + [4000021, 4021004, 4003000], [4000021, 4021006, 4003000], [4021002, 4021006, 4000030, 4000021, 4003000], [4021003, 4021006, 4000030, 4000021, 4003000], [4021000, 4021006, 4000030, 4000021, 4003000], + [4021000, 4003000, 4000030, 4000106], [4021006, 4003000, 4000030, 4000107], [4011003, 4003000, 4000030, 4000108], [4021002, 4003000, 4000030, 4000099], [4011001, 4021006, 4021008, 4000030, 4003000, 4000033], + [4011001, 4021006, 4021008, 4000030, 4003000, 4000032], [4011001, 4021006, 4021008, 4000030, 4003000, 4000041], [4011001, 4021006, 4021008, 4000030, 4003000, 4000042]]; + var matQtySet = [[50, 2, 15], [50, 2, 15], [50, 2, 15], [50, 2, 15], [50, 2, 15], + [3, 1, 15, 30, 20], [3, 1, 15, 30, 20], [3, 1, 15, 30, 20], [4, 30, 45, 100], [4, 30, 45, 100], [5, 30, 45, 100], [5, 30, 45, 100], + [3, 3, 1, 60, 35, 80], [3, 3, 1, 60, 35, 150], [3, 3, 1, 60, 35, 100], [3, 3, 1, 60, 35, 250]]; + var costSet = [19000, 19000, 19000, 19000, 19000, 19000, 20000, 20000, 20000, 32000, 32000, 40000, 40000, 50000, 50000, 50000, 50000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //magician shoe - var itemSet = new Array(1072075,1072076,1072077,1072078,1072089,1072090,1072091,1072114,1072115,1072116,1072117,1072140,1072141,1072142,1072143,1072136,1072137,1072138,1072139); - var matSet = new Array(new Array(4021000,4000021,4003000),new Array(4021002,4000021,4003000),new Array(4011004,4000021,4003000),new Array(4021008,4000021,4003000),new Array(4021001,4021006,4000021,4000030,4003000),new Array(4021000,4021006,4000021,4000030,4003000), - new Array(4021008,4021006,4000021,4000030,4003000),new Array(4021000,4000030,4000110,4003000),new Array(4021005,4000030,4000111,4003000),new Array(4011006,4021007,4000030,4000100,4003000),new Array(4021008,4021007,4000030,4000112,4003000), - new Array(4021009,4011006,4021000,4000030,4003000),new Array(4021009,4011006,4021005,4000030,4003000),new Array(4021009,4011006,4021001,4000030,4003000),new Array(4021009,4011006,4021003,4000030,4003000)); - var matQtySet = new Array(new Array(2,50,15),new Array(2,50,15),new Array(2,50,15),new Array(1,50,15),new Array(3,1,30,15,20),new Array(3,1,30,15,20),new Array(2,1,40,25,20),new Array(4,40,100,25),new Array(4,40,100,25),new Array(2,1,40,100,25),new Array(2,1,40,100,30), - new Array(1,3,3,60,40),new Array(1,3,3,60,40),new Array(1,3,3,60,40),new Array(1,3,3,60,40)); - var costSet = new Array(18000,18000,18000,18000,20000,20000,22000,30000,30000,35000,40000,50000,50000,50000,50000); + } else if (selectedType == 3) { //magician shoe + var itemSet = [1072075, 1072076, 1072077, 1072078, 1072089, 1072090, 1072091, 1072114, 1072115, 1072116, 1072117, 1072140, 1072141, 1072142, 1072143, 1072136, 1072137, 1072138, 1072139]; + var matSet = [[4021000, 4000021, 4003000], [4021002, 4000021, 4003000], [4011004, 4000021, 4003000], [4021008, 4000021, 4003000], [4021001, 4021006, 4000021, 4000030, 4003000], [4021000, 4021006, 4000021, 4000030, 4003000], + [4021008, 4021006, 4000021, 4000030, 4003000], [4021000, 4000030, 4000110, 4003000], [4021005, 4000030, 4000111, 4003000], [4011006, 4021007, 4000030, 4000100, 4003000], [4021008, 4021007, 4000030, 4000112, 4003000], + [4021009, 4011006, 4021000, 4000030, 4003000], [4021009, 4011006, 4021005, 4000030, 4003000], [4021009, 4011006, 4021001, 4000030, 4003000], [4021009, 4011006, 4021003, 4000030, 4003000]]; + var matQtySet = [[2, 50, 15], [2, 50, 15], [2, 50, 15], [1, 50, 15], [3, 1, 30, 15, 20], [3, 1, 30, 15, 20], [2, 1, 40, 25, 20], [4, 40, 100, 25], [4, 40, 100, 25], [2, 1, 40, 100, 25], [2, 1, 40, 100, 30], + [1, 3, 3, 60, 40], [1, 3, 3, 60, 40], [1, 3, 3, 60, 40], [1, 3, 3, 60, 40]]; + var costSet = [18000, 18000, 18000, 18000, 20000, 20000, 22000, 30000, 30000, 35000, 40000, 50000, 50000, 50000, 50000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 4){ //thief shoe - var itemSet = new Array(1072032,1072033,1072035,1072036,1072104,1072105,1072106,1072107,1072108,1072109,1072110,1072128,1072130,1072129,1072131); - var matSet = new Array(new Array(4011000,4000021,4003000),new Array(4011001,4000021,4003000),new Array(4011004,4000021,4003000),new Array(4011006,4000021,4003000),new Array(4021000,4021004,4000021,4000030,4003000),new Array(4021003,4021004,4000021,4000030,4003000), - new Array(4021002,4021004,4000021,4000030,4003000),new Array(4021000,4000030,4000113,4003000),new Array(4021003,4000030,4000095,4003000),new Array(4021006,4000030,4000096,4003000),new Array(4021005,4000030,4000097,4003000),new Array(4011007,4021005,4000030,4000114,4003000), - new Array(4011007,4021000,4000030,4000115,4003000),new Array(4011007,4021003,4000030,4000109,4003000),new Array(4011007,4021001,4000030,4000036,4003000)); - var matQtySet = new Array(new Array(3,50,15),new Array(3,50,15),new Array(2,50,15),new Array(2,50,15),new Array(3,1,30,15,20),new Array(3,1,30,15,20),new Array(3,1,30,15,20), - new Array(5,45,100,30),new Array(4,45,100,30),new Array(4,45,100,30),new Array(4,45,100,30),new Array(2,3,50,100,35),new Array(2,3,50,100,35),new Array(2,3,50,100,35),new Array(2,3,50,80,35)); - var costSet = new Array(19000,19000,19000,21000,20000,20000,20000,40000,32000,35000,35000,50000,50000,50000,50000); + } else if (selectedType == 4) { //thief shoe + var itemSet = [1072032, 1072033, 1072035, 1072036, 1072104, 1072105, 1072106, 1072107, 1072108, 1072109, 1072110, 1072128, 1072130, 1072129, 1072131]; + var matSet = [[4011000, 4000021, 4003000], [4011001, 4000021, 4003000], [4011004, 4000021, 4003000], [4011006, 4000021, 4003000], [4021000, 4021004, 4000021, 4000030, 4003000], [4021003, 4021004, 4000021, 4000030, 4003000], + [4021002, 4021004, 4000021, 4000030, 4003000], [4021000, 4000030, 4000113, 4003000], [4021003, 4000030, 4000095, 4003000], [4021006, 4000030, 4000096, 4003000], [4021005, 4000030, 4000097, 4003000], [4011007, 4021005, 4000030, 4000114, 4003000], + [4011007, 4021000, 4000030, 4000115, 4003000], [4011007, 4021003, 4000030, 4000109, 4003000], [4011007, 4021001, 4000030, 4000036, 4003000]]; + var matQtySet = [[3, 50, 15], [3, 50, 15], [2, 50, 15], [2, 50, 15], [3, 1, 30, 15, 20], [3, 1, 30, 15, 20], [3, 1, 30, 15, 20], + [5, 45, 100, 30], [4, 45, 100, 30], [4, 45, 100, 30], [4, 45, 100, 30], [2, 3, 50, 100, 35], [2, 3, 50, 100, 35], [2, 3, 50, 100, 35], [2, 3, 50, 80, 35]]; + var costSet = [19000, 19000, 19000, 21000, 20000, 20000, 20000, 40000, 32000, 35000, 35000, 50000, 50000, 50000, 50000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; @@ -145,55 +143,59 @@ function action(mode, type, selection) { //Ludi fee is -10%, array not changed unlike 2040016 and 2040020 cost *= 0.9; var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if(stimulator) - prompt += "\r\n#i"+stimID+"# 1 #t" + stimID + "#"; - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++) - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; - } else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; + if (stimulator) { + prompt += "\r\n#i" + stimID + "# 1 #t" + stimID + "#"; } - if (cost > 0) + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; + } + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; + } cm.sendYesNo(prompt); } else if (status == 3) { - var complete = true; - - if(!cm.canHold(item, 1)) { + var complete = true; + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost){ + } else if (cm.getMeso() < cost) { cm.sendOk("Sorry, we only accept meso."); cm.dispose(); return; - } - else { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; - } - if (stimulator){ //check for stimulator + } + } + if (stimulator) { //check for stimulator if (!cm.haveItem(stimID)) { complete = false; } - } - if (!complete) + } + if (!complete) { cm.sendOk("Sorry, but I have to have those items to get this exactly right. Perhaps next time."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i]); } - } else - cm.gainItem(mats, -matQty); + } else { + cm.gainItem(mats, -matQty); + } cm.gainMeso(-cost); - if (stimulator){ //check for stimulator + if (stimulator) { //check for stimulator cm.gainItem(stimID, -1); var deleted = Math.floor(Math.random() * 10); if (deleted != 0) { @@ -202,7 +204,7 @@ function action(mode, type, selection) { } else { cm.sendOk("Eek! I think I accidently added too much stimulator and, well, the whole thing is unusable now... Sorry, but I can't offer a refund."); } - } else { + } else { cm.gainItem(item, 1); cm.sendOk("There, the shoes are ready. Be careful, they're still hot."); } diff --git a/scripts/npc/2040022.js b/scripts/npc/2040022.js index cb869209fb..f33665c8f1 100644 --- a/scripts/npc/2040022.js +++ b/scripts/npc/2040022.js @@ -41,228 +41,208 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); + } if (status == 0 && mode == 1) { var selStr = "Ah, you've found me! I spend most of my time here, working on weapons to make for travellers like yourself. Did you have a request?#b" - var options = new Array("What's a stimulator?","Create a Warrior weapon","Create a Bowman weapon","Create a Magician weapon","Create a Thief weapon", - "Create a Warrior weapon with a Stimulator","Create a Bowman weapon with a Stimulator","Create a Magician weapon with a Stimulator","Create a Thief weapon with a Stimulator"); - for (var i = 0; i < options.length; i++){ + var options = ["What's a stimulator?", "Create a Warrior weapon", "Create a Bowman weapon", "Create a Magician weapon", "Create a Thief weapon", + "Create a Warrior weapon with a Stimulator", "Create a Bowman weapon with a Stimulator", "Create a Magician weapon with a Stimulator", "Create a Thief weapon with a Stimulator"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } - + cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; var selStr; var weapon; - if (selectedType > 4) - { + if (selectedType > 4) { stimulator = true; selectedType -= 4; - } - else + } else { stimulator = false; + } if (selectedType == 0) { //What's a stim? cm.sendNext("A stimulator is a special potion that I can add into the process of creating certain items. It gives it stats as though it had dropped from a monster. However, it is possible to have no change, and it is also possible for the item to be below average. There's also a 10% chance of not getting any item when using a stimulator, so please choose wisely.") cm.dispose(); - } - else if (selectedType == 1){ //warrior weapon + } else if (selectedType == 1) { //warrior weapon selStr = "Very well, then which Warrior weapon shall I work on?#b"; - weapon = new Array ("Gladius#k - Lv. 30 One-Handed Sword#b","Cutlus#k - Lv. 35 One-Handed Sword#b","Traus#k - Lv. 40 One-Handed Sword#b","Jeweled Katar#k - Lv. 50 One-Handed Sword#b","Fireman's Axe#k - Lv. 30 One-Handed Axe#b","Dankke#k - Lv. 35 One-Handed Axe#b","Blue Counter#k - Lv. 40 One-Handed Axe#b","Buck#k - Lv. 50 One-Handed Axe#b", - "War Hammer#k - Lv. 30 One-Handed BW#b","Heavy Hammer#k - Lv. 35 One-Handed BW#b","Jacker#k - Lv. 40 One-Handed BW#b","Knuckle Mace#k - Lv. 50 One-Handed BW#b","Scimitar#k - Lv. 30 Two-Handed Sword#b","Lionheart#k - Lv. 35 Two-Handed Sword#b","Zard#k - Lv. 40 Two-Handed Sword#b","Lion's Fang#k - Lv. 50 Two-Handed Sword#b", - "Blue Axe#k - Lv. 30 Two-Handed Axe#b","Niam#k - Lv. 35 Two-Handed Axe#b","Sabretooth#k - Lv. 40 Two-Handed Axe#b","The Rising#k - Lv. 50 Two-Handed Axe#b","Mithril Maul#k - Lv. 30 Two-Handed BW#b","Sledgehammer#k - Lv. 35 Two-Handed BW#b","Titan#k - Lv. 40 Two-Handed BW#b","Golden Mole#k - Lv. 50 Two-Handed BW#b", - "Forked Spear#k - Lv. 30 Spear#b","Nakimaki#k - Lv. 35 Spear#b","Zeco#k - Lv. 40 Spear#b","Serpent's Tongue#k - Lv. 50 Spear#b","Mithril Polearm#k - Lv. 30 Polearm#b","Axe Polearm#k - Lv. 35 Polearm#b","Crescent Polearm#k - Lv. 40 Polearm#b","The Nine Dragons#k - Lv. 50 Polearm#b"); - } - else if (selectedType == 2){ //bowman weapon + weapon = ["Gladius#k - Lv. 30 One-Handed Sword#b", "Cutlus#k - Lv. 35 One-Handed Sword#b", "Traus#k - Lv. 40 One-Handed Sword#b", "Jeweled Katar#k - Lv. 50 One-Handed Sword#b", "Fireman's Axe#k - Lv. 30 One-Handed Axe#b", "Dankke#k - Lv. 35 One-Handed Axe#b", "Blue Counter#k - Lv. 40 One-Handed Axe#b", "Buck#k - Lv. 50 One-Handed Axe#b", + "War Hammer#k - Lv. 30 One-Handed BW#b", "Heavy Hammer#k - Lv. 35 One-Handed BW#b", "Jacker#k - Lv. 40 One-Handed BW#b", "Knuckle Mace#k - Lv. 50 One-Handed BW#b", "Scimitar#k - Lv. 30 Two-Handed Sword#b", "Lionheart#k - Lv. 35 Two-Handed Sword#b", "Zard#k - Lv. 40 Two-Handed Sword#b", "Lion's Fang#k - Lv. 50 Two-Handed Sword#b", + "Blue Axe#k - Lv. 30 Two-Handed Axe#b", "Niam#k - Lv. 35 Two-Handed Axe#b", "Sabretooth#k - Lv. 40 Two-Handed Axe#b", "The Rising#k - Lv. 50 Two-Handed Axe#b", "Mithril Maul#k - Lv. 30 Two-Handed BW#b", "Sledgehammer#k - Lv. 35 Two-Handed BW#b", "Titan#k - Lv. 40 Two-Handed BW#b", "Golden Mole#k - Lv. 50 Two-Handed BW#b", + "Forked Spear#k - Lv. 30 Spear#b", "Nakimaki#k - Lv. 35 Spear#b", "Zeco#k - Lv. 40 Spear#b", "Serpent's Tongue#k - Lv. 50 Spear#b", "Mithril Polearm#k - Lv. 30 Polearm#b", "Axe Polearm#k - Lv. 35 Polearm#b", "Crescent Polearm#k - Lv. 40 Polearm#b", "The Nine Dragons#k - Lv. 50 Polearm#b"]; + } else if (selectedType == 2) { //bowman weapon selStr = "Very well, then which Bowman weapon shall I work on?#b"; - weapon = new Array ("Ryden#k - Lv. 30 Bow#b","Red Viper#k - Lv. 35 Bow#b","Vaulter 2000#k - Lv. 40 Bow#b","Olympus#k - Lv. 50 Bow#b","Eagle Crow#k - Bowman Lv. 32#b","Heckler#k - Bowman Lv. 38#b","Silver Crow#k - Bowman Lv. 42#b","Rower#k - Bowman Lv. 50#b"); - } - else if (selectedType == 3){ //magician weapon + weapon = ["Ryden#k - Lv. 30 Bow#b", "Red Viper#k - Lv. 35 Bow#b", "Vaulter 2000#k - Lv. 40 Bow#b", "Olympus#k - Lv. 50 Bow#b", "Eagle Crow#k - Bowman Lv. 32#b", "Heckler#k - Bowman Lv. 38#b", "Silver Crow#k - Bowman Lv. 42#b", "Rower#k - Bowman Lv. 50#b"]; + } else if (selectedType == 3) { //magician weapon selStr = "Very well, then which Magician weapon shall I work on?#b"; - weapon = new Array ("Mithril Wand#k - Lv. 28 Wand#b","Wizard Wand#k - Lv. 33 Wand#b","Fairy Wand#k - Lv. 38 Wand#b","Cromi#k - Lv. 48 Wand#b","Wizard Staff#k - Lv. 25 Staff#b","Arc Staff#k - Lv. 45 Staff#b","Thorns#k - Lv. 55 Staff#b"); - } - else if (selectedType == 4){ //thief weapon; claws vary depending if stimulator is being used + weapon = ["Mithril Wand#k - Lv. 28 Wand#b", "Wizard Wand#k - Lv. 33 Wand#b", "Fairy Wand#k - Lv. 38 Wand#b", "Cromi#k - Lv. 48 Wand#b", "Wizard Staff#k - Lv. 25 Staff#b", "Arc Staff#k - Lv. 45 Staff#b", "Thorns#k - Lv. 55 Staff#b"]; + } else if (selectedType == 4) { //thief weapon; claws vary depending if stimulator is being used selStr = "Very well, then which Thief weapon shall I work on?#b"; - if (!stimulator) - weapon = new Array ("Reef Claw#k - Lv. 30 LUK Dagger#b","Cass#k - Lv. 30 STR Dagger#b","Gephart#k - Lv. 35 LUK Dagger#b","Bazlud#k - Lv. 40 STR Dagger#b","Sai#k - Lv. 50 STR Dagger#b","Shinkita#k - Lv. 50 LUK Dagger#b", - "Steel Guards#k - Lv. 30 Claw#b","Bronze Guardian#k - Lv. 35 Claw#b","Steel Avarice#k - Lv. 40 Claw#b","Steel Slain#k - Lv. 50 Claw#b"); - else - weapon = new Array ("Reef Claw#k - Lv. 30 LUK Dagger#b","Cass#k - Lv. 30 STR Dagger#b","Gephart#k - Lv. 35 LUK Dagger#b","Bazlud#k - Lv. 40 STR Dagger#b","Sai#k - Lv. 50 STR Dagger#b","Shinkita#k - Lv. 50 LUK Dagger#b", - "Mithril Guards#k - Lv. 30 Claw#b","Adamantium Guards#k - Lv. 30 Claw#b","Silver Guardian#k - Lv. 35 Claw#b","Dark Guardian#k - Lv. 35 Claw#b","Blood Avarice#k - Lv. 40 Claw#b","Adamantium Avarice#k - Lv. 40 Claw#b", - "Dark Avarice#k - Lv. 40 Claw#b","Blood Slain#k - Lv. 50 Claw#b","Sapphire Slain#k - Lv. 50 Claw#b","Dark Slain#k - Lv. 50 Claw#b"); + if (!stimulator) { + weapon = ["Reef Claw#k - Lv. 30 LUK Dagger#b", "Cass#k - Lv. 30 STR Dagger#b", "Gephart#k - Lv. 35 LUK Dagger#b", "Bazlud#k - Lv. 40 STR Dagger#b", "Sai#k - Lv. 50 STR Dagger#b", "Shinkita#k - Lv. 50 LUK Dagger#b", + "Steel Guards#k - Lv. 30 Claw#b", "Bronze Guardian#k - Lv. 35 Claw#b", "Steel Avarice#k - Lv. 40 Claw#b", "Steel Slain#k - Lv. 50 Claw#b"]; + } else { + weapon = ["Reef Claw#k - Lv. 30 LUK Dagger#b", "Cass#k - Lv. 30 STR Dagger#b", "Gephart#k - Lv. 35 LUK Dagger#b", "Bazlud#k - Lv. 40 STR Dagger#b", "Sai#k - Lv. 50 STR Dagger#b", "Shinkita#k - Lv. 50 LUK Dagger#b", + "Mithril Guards#k - Lv. 30 Claw#b", "Adamantium Guards#k - Lv. 30 Claw#b", "Silver Guardian#k - Lv. 35 Claw#b", "Dark Guardian#k - Lv. 35 Claw#b", "Blood Avarice#k - Lv. 40 Claw#b", "Adamantium Avarice#k - Lv. 40 Claw#b", + "Dark Avarice#k - Lv. 40 Claw#b", "Blood Slain#k - Lv. 50 Claw#b", "Sapphire Slain#k - Lv. 50 Claw#b", "Dark Slain#k - Lv. 50 Claw#b"]; + } } - - if (selectedType != 0) - { - for (var i = 0; i < weapon.length; i++){ + + if (selectedType != 0) { + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; } cm.sendSimple(selStr); } - } - else if (status == 2 && mode == 1) { + } else if (status == 2 && mode == 1) { selectedItem = selection; - if (selectedType == 1){ //warrior weapon - var itemSet = new Array(1302008,1302004,1302009,1302010,1312005,1312006,1312007,1312008,1322014,1322015,1322016,1322017,1402002,1402006,1402007,1402003,1412006,1412004,1412005,1412003,1422001,1422008,1422007,1422005,1432002,1432003,1432005,1432004,1442001,1442003,1442009,1442005); - var matSet = new Array(new Array(4131000,4011001,4011004,4003000),new Array(4131000,4011006,4011001,4021006,4003000),new Array(4131000,4011006,4011001,4021000,4003000),new Array(4131000,4005000,4021008,4011006,4021003,4003000), - new Array(4131001,4011001,4021000,4003000),new Array(4131001,4011001,4021000,4011004,4003000),new Array(4131001,4021005,4011001,4021001,4003000),new Array(4131001,4005000,4021008,4011004,4011001,4003000), - new Array(4131002,4011001,4011000,4003000),new Array(4131002,4011001,4011000,4011003,4003000),new Array(4131002,4011003,4011001,4011004,4003000),new Array(4131002,4005000,4021008,4011006,4011001,4003000), - new Array(4131003,4011001,4021000,4021004,4003000),new Array(4131003,4011006,4011001,4021004,4003000),new Array(4131003,4021003,4011000,4011001,4003000),new Array(4131003,4005000,4021007,4011006,4011001,4003000), - new Array(4131004,4021005,4011001,4003001,4003000),new Array(4131004,4011004,4011000,4021003,4003000),new Array(4131004,4011006,4011004,4011001,4003000),new Array(4131004,4005000,4021007,4011006,4021006,4003000), - new Array(4131005,4011001,4011004,4003000),new Array(4131005,4011001,4011000,4003001,4003000),new Array(4131005,4011001,4011004,4011006,4003000),new Array(4131005,4005000,4021008,4021006,4011006,4003000), - new Array(4131006,4011000,4011004,4003000),new Array(4131006,4011001,4011002,4021000,4003000),new Array(4131006,4011004,4011001,4011000,4003000),new Array(4131006,4005000,4021008,4011000,4021000,4003000), - new Array(4131007,4011000,4011002,4003000),new Array(4131007,4011001,4011002,4003000),new Array(4131007,4011006,4011002,4011001,4003000),new Array(4131007,4005000,4021007,4011001,4011002,4003000)); - var matQtySet = new Array(new Array(1,2,2,30),new Array(1,1,5,3,35),new Array(1,3,5,5,40),new Array(1,1,2,4,10,50), - new Array(1,2,2,30),new Array(1,5,5,3,35),new Array(1,7,5,5,40),new Array(1,1,2,8,10,50), - new Array(1,2,2,30),new Array(1,5,5,3,35),new Array(1,7,5,5,40),new Array(1,1,2,4,10,50), - new Array(1,2,1,2,35),new Array(1,1,5,5,40),new Array(1,7,5,5,45),new Array(1,1,2,4,10,55), - new Array(1,2,2,5,35),new Array(1,5,5,3,40),new Array(1,3,5,5,45),new Array(1,1,2,5,7,55), - new Array(1,2,3,35),new Array(1,5,5,10,40),new Array(1,5,5,3,45),new Array(1,1,2,7,5,55), - new Array(1,2,3,40),new Array(1,5,5,3,45),new Array(1,3,5,5,50),new Array(1,1,2,7,5,60), - new Array(1,2,3,40),new Array(1,5,5,40),new Array(1,3,5,5,50),new Array(1,1,2,7,5,60)); - var costSet = new Array(18000,35000,70000,200000,18000,35000,70000,200000,18000,35000,70000,200000,20000,37000,72000,220000,20000,37000,72000,220000,20000,37000,72000,220000,22000,39000,74000,240000,22000,39000,74000,240000); + if (selectedType == 1) { //warrior weapon + var itemSet = [1302008, 1302004, 1302009, 1302010, 1312005, 1312006, 1312007, 1312008, 1322014, 1322015, 1322016, 1322017, 1402002, 1402006, 1402007, 1402003, 1412006, 1412004, 1412005, 1412003, 1422001, 1422008, 1422007, 1422005, 1432002, 1432003, 1432005, 1432004, 1442001, 1442003, 1442009, 1442005]; + var matSet = [[4131000, 4011001, 4011004, 4003000], [4131000, 4011006, 4011001, 4021006, 4003000], [4131000, 4011006, 4011001, 4021000, 4003000], [4131000, 4005000, 4021008, 4011006, 4021003, 4003000], + [4131001, 4011001, 4021000, 4003000], [4131001, 4011001, 4021000, 4011004, 4003000], [4131001, 4021005, 4011001, 4021001, 4003000], [4131001, 4005000, 4021008, 4011004, 4011001, 4003000], + [4131002, 4011001, 4011000, 4003000], [4131002, 4011001, 4011000, 4011003, 4003000], [4131002, 4011003, 4011001, 4011004, 4003000], [4131002, 4005000, 4021008, 4011006, 4011001, 4003000], + [4131003, 4011001, 4021000, 4021004, 4003000], [4131003, 4011006, 4011001, 4021004, 4003000], [4131003, 4021003, 4011000, 4011001, 4003000], [4131003, 4005000, 4021007, 4011006, 4011001, 4003000], + [4131004, 4021005, 4011001, 4003001, 4003000], [4131004, 4011004, 4011000, 4021003, 4003000], [4131004, 4011006, 4011004, 4011001, 4003000], [4131004, 4005000, 4021007, 4011006, 4021006, 4003000], + [4131005, 4011001, 4011004, 4003000], [4131005, 4011001, 4011000, 4003001, 4003000], [4131005, 4011001, 4011004, 4011006, 4003000], [4131005, 4005000, 4021008, 4021006, 4011006, 4003000], + [4131006, 4011000, 4011004, 4003000], [4131006, 4011001, 4011002, 4021000, 4003000], [4131006, 4011004, 4011001, 4011000, 4003000], [4131006, 4005000, 4021008, 4011000, 4021000, 4003000], + [4131007, 4011000, 4011002, 4003000], [4131007, 4011001, 4011002, 4003000], [4131007, 4011006, 4011002, 4011001, 4003000], [4131007, 4005000, 4021007, 4011001, 4011002, 4003000]]; + var matQtySet = [[1, 2, 2, 30], [1, 1, 5, 3, 35], [1, 3, 5, 5, 40], [1, 1, 2, 4, 10, 50], + [1, 2, 2, 30], [1, 5, 5, 3, 35], [1, 7, 5, 5, 40], [1, 1, 2, 8, 10, 50], + [1, 2, 2, 30], [1, 5, 5, 3, 35], [1, 7, 5, 5, 40], [1, 1, 2, 4, 10, 50], + [1, 2, 1, 2, 35], [1, 1, 5, 5, 40], [1, 7, 5, 5, 45], [1, 1, 2, 4, 10, 55], + [1, 2, 2, 5, 35], [1, 5, 5, 3, 40], [1, 3, 5, 5, 45], [1, 1, 2, 5, 7, 55], + [1, 2, 3, 35], [1, 5, 5, 10, 40], [1, 5, 5, 3, 45], [1, 1, 2, 7, 5, 55], + [1, 2, 3, 40], [1, 5, 5, 3, 45], [1, 3, 5, 5, 50], [1, 1, 2, 7, 5, 60], + [1, 2, 3, 40], [1, 5, 5, 40], [1, 3, 5, 5, 50], [1, 1, 2, 7, 5, 60]]; + var costSet = [18000, 35000, 70000, 200000, 18000, 35000, 70000, 200000, 18000, 35000, 70000, 200000, 20000, 37000, 72000, 220000, 20000, 37000, 72000, 220000, 20000, 37000, 72000, 220000, 22000, 39000, 74000, 240000, 22000, 39000, 74000, 240000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //bowman weapon - var itemSet = new Array(1452005,1452006,1452007,1452008,1462004,1462005,1462006,1462007); - var matSet = new Array(new Array(4131010,4011001,4011006,4021003,4021006,4003000),new Array(4131010,4011004,4021000,4021004,4003000),new Array(4131010,4021008,4011001,4011006,4003000,4000112),new Array(4131010,4005002,4021008,4011001,4021005,4003000), - new Array(4131011,4011001,4011005,4021006,4003001,4003000),new Array(4131011,4021008,4011001,4011006,4021006,4003000),new Array(4131011,4021008,4011004,4003001,4003000),new Array(4131011,4021008,4011006,4021006,4003001,4003000)); - var matQtySet = new Array(new Array(1,5,5,3,3,30),new Array(1,7,6,3,35),new Array(1,1,10,3,40,100),new Array(1,1,2,10,6,50),new Array(1,5,5,3,50,15),new Array(1,1,8,4,2,30),new Array(1,2,6,30,30),new Array(1,2,5,3,40,40)); - var costSet = new Array(15000,20000,40000,100000,15000,25000,41000,100000); + } else if (selectedType == 2) { //bowman weapon + var itemSet = [1452005, 1452006, 1452007, 1452008, 1462004, 1462005, 1462006, 1462007]; + var matSet = [[4131010, 4011001, 4011006, 4021003, 4021006, 4003000], [4131010, 4011004, 4021000, 4021004, 4003000], [4131010, 4021008, 4011001, 4011006, 4003000, 4000112], [4131010, 4005002, 4021008, 4011001, 4021005, 4003000], + [4131011, 4011001, 4011005, 4021006, 4003001, 4003000], [4131011, 4021008, 4011001, 4011006, 4021006, 4003000], [4131011, 4021008, 4011004, 4003001, 4003000], [4131011, 4021008, 4011006, 4021006, 4003001, 4003000]]; + var matQtySet = [[1, 5, 5, 3, 3, 30], [1, 7, 6, 3, 35], [1, 1, 10, 3, 40, 100], [1, 1, 2, 10, 6, 50], [1, 5, 5, 3, 50, 15], [1, 1, 8, 4, 2, 30], [1, 2, 6, 30, 30], [1, 2, 5, 3, 40, 40]]; + var costSet = [15000, 20000, 40000, 100000, 15000, 25000, 41000, 100000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 3){ //magician weapon - var itemSet = new Array(1372003,1372001,1372000,1372007,1382002,1382001,1382006); - var matSet = new Array(new Array(4131008,4011002,4021002,4003000),new Array(4131008,4021006,4011002,4011001,4003000),new Array(4131008,4021006,4021005,4021007,4003003,4003000),new Array(4131008,4011006,4021003,4021007,4021002,4003000), - new Array(4131009,4021006,4021001,4011001,4003000),new Array(4131009,4011001,4021006,4021001,4021005,4003000),new Array(4131009,4005001,4021008,4011006,4011004,4003000)); - var matQtySet = new Array(new Array(1,3,1,10),new Array(1,5,3,1,15),new Array(1,5,5,1,1,20),new Array(1,4,3,2,1,30),new Array(1,2,1,1,15),new Array(1,8,5,5,5,30),new Array(1,2,2,5,10,40)); - var costSet = new Array(15000,30000,60000,100000,10000,80000,200000); + } else if (selectedType == 3) { //magician weapon + var itemSet = [1372003, 1372001, 1372000, 1372007, 1382002, 1382001, 1382006]; + var matSet = [[4131008, 4011002, 4021002, 4003000], [4131008, 4021006, 4011002, 4011001, 4003000], [4131008, 4021006, 4021005, 4021007, 4003003, 4003000], [4131008, 4011006, 4021003, 4021007, 4021002, 4003000], + [4131009, 4021006, 4021001, 4011001, 4003000], [4131009, 4011001, 4021006, 4021001, 4021005, 4003000], [4131009, 4005001, 4021008, 4011006, 4011004, 4003000]]; + var matQtySet = [[1, 3, 1, 10], [1, 5, 3, 1, 15], [1, 5, 5, 1, 1, 20], [1, 4, 3, 2, 1, 30], [1, 2, 1, 1, 15], [1, 8, 5, 5, 5, 30], [1, 2, 2, 5, 10, 40]]; + var costSet = [15000, 30000, 60000, 100000, 10000, 80000, 200000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } - else if (selectedType == 4){ //thief weapon; claws vary depending if stimulator is being used - if (!stimulator){ - var itemSet = new Array(1332012,1332009,1332014,1332011,1332016,1332003,1472008,1472011,1472014,1472018); - var matSet = new Array(new Array(4131012,4011002,4011001,4003000),new Array(4131012,4021005,4011001,4003000),new Array(4131012,4021005,4011001,4011002,4003000),new Array(4131012,4011001,4011006,4021006,4003000),new Array(4131012,4005003,4021008,4011004,4011001,4003000),new Array(4131012,4005003,4021007,4011006,4011001,4003000), - new Array(4131013,4011000,4011001,4000021,4003000),new Array(4131013,4011000,4011001,4000021,4003000),new Array(4131013,4011000,4011001,4000021,4003000),new Array(4131013,4011000,4011001,4000030,4003000)); - var matQtySet = new Array(new Array(1,2,3,30),new Array(1,2,3,30),new Array(1,1,5,3,35),new Array(1,7,3,6,40),new Array(1,1,2,7,10,50),new Array(1,1,2,5,10,50),new Array(1,3,2,50,20),new Array(1,4,2,80,25),new Array(1,3,2,100,30),new Array(1,4,2,40,35)); - var costSet = new Array(20000,20000,33000,73000,230000,230000,15000,30000,40000,50000); - } - else{ - var itemSet = new Array(1332012,1332009,1332014,1332011,1332016,1332003,1472009,1472010,1472012,1472013,1472015,1472016,1472017,1472019,1472020,1472021); - var matSet = new Array(new Array(4131012,4011002,4011001,4003000),new Array(4131012,4021005,4011001,4003000),new Array(4131012,4021005,4011001,4011002,4003000),new Array(4131012,4011001,4011006,4021006,4003000),new Array(4131012,4005003,4021008,4011004,4011001,4003000),new Array(4131012,4005003,4021007,4011006,4011001,4003000), - new Array(4131013,1472008,4011002),new Array(4131013,1472008,4011003),new Array(4131013,1472011,4011004),new Array(4131013,1472011,4021008),new Array(4131013,1472014,4021000),new Array(4131013,1472014,4011003),new Array(4131013,1472014,4021008),new Array(4131013,1472018,4021000),new Array(4131013,1472018,4021005), - new Array(4131013,1472018,4005003,4021008)); - var matQtySet = new Array(new Array(1,2,3,30),new Array(1,2,3,30),new Array(1,1,5,3,35),new Array(1,7,3,6,40),new Array(1,1,2,7,10,50),new Array(1,1,2,5,10,50),new Array(1,1,3),new Array(1,1,3),new Array(1,1,4),new Array(1,1,1),new Array(1,1,5),new Array(1,1,5),new Array(1,1,2),new Array(1,1,6),new Array(1,1,6),new Array(1,1,1,3)); - var costSet = new Array(20000,20000,33000,73000,230000,230000,10000,15000,20000,25000,30000,30000,35000,40000,40000,50000); + } else if (selectedType == 4) { //thief weapon; claws vary depending if stimulator is being used + if (!stimulator) { + var itemSet = [1332012, 1332009, 1332014, 1332011, 1332016, 1332003, 1472008, 1472011, 1472014, 1472018]; + var matSet = [[4131012, 4011002, 4011001, 4003000], [4131012, 4021005, 4011001, 4003000], [4131012, 4021005, 4011001, 4011002, 4003000], [4131012, 4011001, 4011006, 4021006, 4003000], [4131012, 4005003, 4021008, 4011004, 4011001, 4003000], [4131012, 4005003, 4021007, 4011006, 4011001, 4003000], + [4131013, 4011000, 4011001, 4000021, 4003000], [4131013, 4011000, 4011001, 4000021, 4003000], [4131013, 4011000, 4011001, 4000021, 4003000], [4131013, 4011000, 4011001, 4000030, 4003000]]; + var matQtySet = [[1, 2, 3, 30], [1, 2, 3, 30], [1, 1, 5, 3, 35], [1, 7, 3, 6, 40], [1, 1, 2, 7, 10, 50], [1, 1, 2, 5, 10, 50], [1, 3, 2, 50, 20], [1, 4, 2, 80, 25], [1, 3, 2, 100, 30], [1, 4, 2, 40, 35]]; + var costSet = [20000, 20000, 33000, 73000, 230000, 230000, 15000, 30000, 40000, 50000]; + } else { + var itemSet = [1332012, 1332009, 1332014, 1332011, 1332016, 1332003, 1472009, 1472010, 1472012, 1472013, 1472015, 1472016, 1472017, 1472019, 1472020, 1472021]; + var matSet = [[4131012, 4011002, 4011001, 4003000], [4131012, 4021005, 4011001, 4003000], [4131012, 4021005, 4011001, 4011002, 4003000], [4131012, 4011001, 4011006, 4021006, 4003000], [4131012, 4005003, 4021008, 4011004, 4011001, 4003000], [4131012, 4005003, 4021007, 4011006, 4011001, 4003000], + [4131013, 1472008, 4011002], [4131013, 1472008, 4011003], [4131013, 1472011, 4011004], [4131013, 1472011, 4021008], [4131013, 1472014, 4021000], [4131013, 1472014, 4011003], [4131013, 1472014, 4021008], [4131013, 1472018, 4021000], [4131013, 1472018, 4021005], + [4131013, 1472018, 4005003, 4021008]]; + var matQtySet = [[1, 2, 3, 30], [1, 2, 3, 30], [1, 1, 5, 3, 35], [1, 7, 3, 6, 40], [1, 1, 2, 7, 10, 50], [1, 1, 2, 5, 10, 50], [1, 1, 3], [1, 1, 3], [1, 1, 4], [1, 1, 1], [1, 1, 5], [1, 1, 5], [1, 1, 2], [1, 1, 6], [1, 1, 6], [1, 1, 1, 3]]; + var costSet = [20000, 20000, 33000, 73000, 230000, 230000, 10000, 15000, 20000, 25000, 30000, 30000, 35000, 40000, 40000, 50000]; } item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - + var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if(stimulator){ + if (stimulator) { stimID = mats[0] - 998; //stim ID for a weapon = manual ID for weapon - 998 - prompt += "\r\n#i"+stimID+"# 1 #t" + stimID + "#"; + prompt += "\r\n#i" + stimID + "# 1 #t" + stimID + "#"; } - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 3 && mode == 1) { + } else if (status == 3 && mode == 1) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Verify for a slot in your inventory first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) - { + } else if (cm.getMeso() < cost) { cm.sendOk("I'm afraid my fees are non-negotiable."); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - { + for (var i = 0; complete && i < mats.length; i++) { if (matQty[i] * selection == 1) { - if (!cm.haveItem(mats[i])) - { + if (!cm.haveItem(mats[i])) { + complete = false; + } + } else { + if (!cm.haveItem(mats[i], matQty[i] * selection)) { complete = false; } } - else { - if (!cm.haveItem(mats[i],matQty[i] * selection)) complete=false; - } + } + } else { + if (!cm.haveItem(mats, matQty * selection)) { + complete = false; } } - else { - if (!cm.haveItem(mats,matQty * selection)) complete=false; - } } - - if (stimulator){ //check for stimulator - if (!cm.haveItem(stimID)) - { + + if (stimulator) { //check for stimulator + if (!cm.haveItem(stimID)) { complete = false; } } - - if (!complete) + + if (!complete) { cm.sendOk("Sorry, but you're missing a required item. Possibly a manual? Or one of the ores?"); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i]); } - } - else + } else { cm.gainItem(mats, -matQty); - + } + cm.gainMeso(-cost); - if (stimulator){ //check for stimulator + if (stimulator) { //check for stimulator cm.gainItem(stimID, -1); var deleted = Math.floor(Math.random() * 10); - if (deleted != 0) - { + if (deleted != 0) { cm.gainItem(item, 1, true, true); cm.sendOk("Heeere you go! What do you think? Marvellous, isn't it?"); - } - else - { + } else { cm.sendOk("...ACK! My attention wandered, and before I knew it... Uh, sorry, but there's nothing I can do for you now."); } - } - else //just give basic item + } else //just give basic item { cm.gainItem(item, 1); cm.sendOk("Heeere you go! What do you think? Marvellous, isn't it?"); diff --git a/scripts/npc/2040024.js b/scripts/npc/2040024.js index ed42648c56..2a247e86b3 100644 --- a/scripts/npc/2040024.js +++ b/scripts/npc/2040024.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Author: Xterminator, Moogra NPC Name: First Eos Rock Map(s): Ludibrium : Eos Tower 100th Floor (221024400) @@ -26,9 +27,9 @@ */ function start() { - if (cm.haveItem(4001020)) + if (cm.haveItem(4001020)) { cm.sendYesNo("You can use #bEos Rock Scroll#k to activate #bFirst Eos Rock#k. Will you teleport to #bSecond Eos Rock#k at the 71st floor?"); - else { + } else { cm.sendOk("There's a rock that will enable you to teleport to #bSecond Eos Rock#k, but it cannot be activated without the scroll."); cm.dispose(); } diff --git a/scripts/npc/2040025.js b/scripts/npc/2040025.js index e09494a8ab..a3058c17f8 100644 --- a/scripts/npc/2040025.js +++ b/scripts/npc/2040025.js @@ -28,30 +28,31 @@ var status = 0; var map = 221024400; function start() { - if (cm.haveItem(4001020)) + if (cm.haveItem(4001020)) { cm.sendSimple("You can use #bEos Rock Scroll#k to activate #bSecond Eos Rock#k. Which of these rocks would you like to teleport to?#b\r\n#L0#First Eos Rock (100th Floor)#l\r\n#L1#Third Eos Rock (41st Floor)#l"); - else { + } else { cm.sendOk("There's a rock that will enable you to teleport to #bFirst Eos Rock or Third Eos Rock#k, but it cannot be activated without the scroll."); cm.dispose(); } } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (status >= 0 && mode == 0) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { - if (selection == 0) + if (selection == 0) { cm.sendYesNo("You can use #bEos Rock Scroll#k to activate #bSecond Eos Rock#k. Will you teleport to #bFirst Eos Rock#k at the 100th Floor?"); - else { + } else { cm.sendYesNo("You can use #bEos Rock Scroll#k to activate #bSecond Eos Rock#k. Will you teleport to #bThird Eos Rock#k at the 41st Floor?"); map = 221021700; } diff --git a/scripts/npc/2040026.js b/scripts/npc/2040026.js index 8449c45fcc..546acbd111 100644 --- a/scripts/npc/2040026.js +++ b/scripts/npc/2040026.js @@ -37,9 +37,9 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; if (status == 1) { if (selection == 0) { diff --git a/scripts/npc/2040027.js b/scripts/npc/2040027.js index c26a2c2f97..cba25a1a87 100644 --- a/scripts/npc/2040027.js +++ b/scripts/npc/2040027.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Author: Xterminator, Moogra NPC Name: Fourth Eos Rock Map(s): Ludibrium : Eos Tower 1st Floor (221020000) @@ -26,9 +27,9 @@ */ function start() { - if (cm.haveItem(4001020)) + if (cm.haveItem(4001020)) { cm.sendYesNo("You can use #bEos Rock Scroll#k to activate #bFourth Eos Rock#k. Will you head over to #bThird Eos Rock#k at the 41st floor?"); - else { + } else { cm.sendOk("There's a rock that will enable you to teleport to #bThird Eos Rock#k, but it cannot be activated without the scroll."); cm.dispose(); } diff --git a/scripts/npc/2040028.js b/scripts/npc/2040028.js index fe92011bf5..16b2ac6eb6 100644 --- a/scripts/npc/2040028.js +++ b/scripts/npc/2040028.js @@ -39,22 +39,24 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - - if(status == 0) { + } + + if (status == 0) { var greeting = "Thank you for finding the pendulum. Are you ready to return to Eos Tower?"; if (cm.isQuestStarted(3230)) { if (cm.haveItem(4031094)) { cm.completeQuest(3230); cm.gainItem(4031094, -1); - } else + } else { greeting = "You haven't found the pendulum yet. Do you want to go back to Eos Tower?"; + } } cm.sendYesNo(greeting); - } else if(status == 1) { + } else if (status == 1) { cm.warp(221024400, 4); cm.dispose(); } diff --git a/scripts/npc/2040030.js b/scripts/npc/2040030.js index ca362dd3f8..54ff7d4c19 100644 --- a/scripts/npc/2040030.js +++ b/scripts/npc/2040030.js @@ -12,131 +12,131 @@ function start() { function action(mode, type, selection) { if (mode == -1) { - cm.dispose(); + cm.dispose(); } else { - if (status >= 0 && mode == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; + if (status >= 0 && mode == 0) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } - if(status == 0){ - cm.sendSimple("Hello there, I'm #bMar the Fairy#k of Victoria Island's main disciple. Mar the Fairy summoned me here to see if the pets are being taken care of here in Ludibrium. What can I do for you? \r\n#L0##bMy pet has turned back into a doll\r\nPlease help me make it move again!#k#l \r\n#L1##bTell me more about Pets.#k#l \r\n#L2##bHow do I raise Pets?#k#l \r\n#L3##bDo Pets die too?#k#l \r\n#L4##bWhat are the commands for brown and black kitty?#k#l \r\n#L5##bWhat are the commands for brown puppy?#k#l \r\n#L6##bWhat are the commands for pink and white bunny?#k#l \r\n#L7##bWhat are the commands for Mini Cargo?#k#l \r\n#L8##bWhat are the commands for Husky?#k#l \r\n#L9##bWhat are the commands for Black Pig?#k#l \r\n#L10##bWhat are the commands for Panda#k#l \r\n#L11##bWhat are the commands for Dino Boy & Girl?#k#l \r\n#L12##bWhat are the commands for Rudolph?#k#l \r\n#L13##bWhat are the commands for Monkey?#k#l \r\n#L14##bWhat are the commands for Robot?#k#l \r\n#L15##bWhat are the commands for Elephant?#k#l \r\n#L16##bWhat are the commands for Golden Pig?#k#l \r\n#L17##bWhat are the commands for Penguin?#k#l \r\n#L18##bWhat are the commands for Mini Yeti?#k#l \r\n#L19##bWhat are the commands for Jr. Balrog? \r\n#L20##bWhat are the commands for Baby Dragon?#k#l \r\n#L21##bWhat are the commands for Green/Red/Blue Dragon?#k#l \r\n#L22##bWhat are the commands for Black Dragon?#k#l \r\n#L23##bWhat are the commands for Snowman?#k#l \r\n#L24##bWhat are the commands for Sun Wu Kong?#k#l \r\n#L25##bWhat are the commands for Jr. Reaper?#k#l \r\n#L26##bWhat are the commands for Crystal Rudolph?#k#l \r\n#L27##bWhat are the commands for Kino?#k#l \r\n#L28##bWhat are the commands for White Duck?#k#l \r\n#L29##bWhat are the commands for Pink Bean?#k#l \r\n#L30##bWhat are the commands for Porcupine?#k#l"); - } - else if(status == 1){ - if(selection == 0){ - cm.sendNext("I'm Wisp, continuing on with the studies that my Master Mar the Fairy assigned me. There seems to be a lot of pets even her in Ludibrium. I need to get back to my studies, so if you'll excuse me..."); - cm.dispose(); - } else if(selection == 1){ - cm.sendNext("Hmmmm,you must have a lot of questions regarding the pets. Long ago, a person by the name #bCloy#k, sprayed Water of Life on it, and cast spell on it to create a magical animal. I know it sounds unbelievable, but it's a doll that became an actual living thing. They understand and follow people very well."); - } else if(selection == 2){ - cm.sendNext("Depending on the command you give, pets can love it, hate, and display other kinds of reactions to it. If you give the pet a command and it follows you well, your closeness goes up. Double click on the pet and you can check the closeness, level, fullness and etc..."); - } else if(selection == 3){ - cm.sendNext("Dying... well, they aren't technically ALIVE per se, so I don't know if dying is the right term to use. They are dolls with my magical power and the power of Water of Life to become a live object. Of course while it's alive, it's just like a live animal..."); - } else if(selection == 4){ - cm.sendNext("These are the commands for #rBrown Kitty and Black Kitty#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpoop#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 10 ~ 30)\r\n#bcutie#k (level 10 ~ 30)\r\n#bup, stand, rise#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 5){ - cm.sendNext("These are the commands for #rBrown Puppy#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, baddog, dummy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpee#k (level 10 ~ 30)\r\n#btalk, say, chat, bark#k (level 10 ~ 30)\r\n#bdown#k (level 10 ~ 30)\r\n#bup, stand, rise#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 6){ - cm.sendNext("These are the commands for #rPink Bunny and White Bunny#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bup, stand#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpoop#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 10 ~ 30)\r\n#bhug#k (level 10 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 7){ - cm.sendNext("These are the commands for #rMini Cargo#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bup, stand#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpee#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 10 ~ 30)\r\n#bthelook, charisma#k (level 10 ~ 30)\r\n#bgoodboy, good#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 8){ - cm.sendNext("These are the commands for #rHusky#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, baddog, dummy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1 ~ 30)\r\n#bpee#k (level 1 ~ 30)\r\n#btalk, say, chat, bark#k (level 10 ~ 30)\r\n#bdown#k (level 10 ~ 30)\r\n#bup, stand, rise#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 9){ - cm.sendNext("These are the commands for #rBlack Pig#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bhand, up, stand#k (level 1 ~ 30)\r\n#btalk, say, chat, hug#k (level 10 ~ 30)\r\n#bsmile#k (level 10 ~ 30)\r\n#blaugh, smile#k (level 10 ~ 30)\r\n#bcharisma, sleep, sleepy, gotobed#k(level 20~30)"); - cm.dispose(); - } else if(selection == 10){ - cm.sendNext("These are the commands for #rPanda#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1 ~ 30)\r\n#bpee#k(level 1 ~ 30)\r\n#bup, stand, hug#k (level 1 ~ 30)\r\n#btalk, chat#k (level 10 ~ 30)\r\n#bplay#k (level 20 ~ 30)\r\n#bmeh, bleh#k (level 10 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 11){ - cm.sendNext("These are the commands for #rDino Boy and Dino Girl#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no,, stupid, ihateyou, badboy, badgirl#k (evel 1 ~ 30)\r\n#biloveyou, dummy#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#btalk, chat(level 10 ~ 30)\r\n#bsmile, laugh#k (level 1 ~ 30)\r\n#bcutie#k (level 10 ~ 30)\r\n#bsleep, nap, sleepy#k (level 20 ~ 30)"); - cm.dispose(); - } else if(selection == 12){ - cm.sendNext("These are the commands for #rRudolph#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~30) \r\n#bbad, no, badgirl, badboy#k(level 1~30)\r\n#bup, stand#k(level 1 ~ 30) \r\n#bstupid, ihateyou, dummy#k(level 1 ~ 30) \r\n#bmerryxmas, merrychristmas#k(level 11 ~ 30)\r\n#biloveyou#k(level 1 ~ 30)\r\n#bpoop#k(level 1 ~ 30)\r\n#btalk, say, chat#k(level 11 ~ 30)\r\n#blonely, alone, down, rednose#k(level 11~30),\r\n#bcutie#k(level 11 ~ 30)\r\n#bmush, go#k(level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 13) { - cm.sendNext("These are the commands for #rMonkey#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit, rest#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bup, stand#k(level 1 ~ 30)\r\n#biloveyou, pee#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 11 ~ 30)\r\n#bplay, melong#k (level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 14) { - cm.sendNext("These are the commands for #rRobot#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit, stand, rise#k (level 1 ~ 30)\r\n#battack, bad, no, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (level 1 ~ 30)\r\n#biloveyou, good#k (level 1 ~ 30)\r\n#bspeak, disguise#k (level 11 ~ 30)"); - cm.dispose(); - } else if (selection == 15) { - cm.sendNext("These are the commands for #rElephant#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit, rest#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bup, stand, rise#k(level 1 ~ 30)\r\n#biloveyou, pee#k (level 1 ~ 30)\r\n#btalk, say, chat, play#k (level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 16) { - cm.sendNext("These are the commands for #rGolden Pig#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bpoop, iloveyou#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 11 ~ 30)\r\n#bloveme, hugme#k (level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 21 ~ 30)\r\n#bimpressed, outofhere#k (level 21 ~ 30)\r\n#broll, showmethemoney#k (level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 17) { - cm.sendNext("These are the commands for #rPenguin#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bup, stand, rise#k (level 1 ~ 30)\r\n#biloveyou#k (level 1 ~ 30)\r\n#btalk, chat, say#k (level 10 ~ 30)\r\n#bhug, hugme#k (level 10 ~ 30)\r\n#bwing, hand#k (level 10 ~ 30)\r\n#bsleep#k (level 20 ~ 30)\r\n#bkiss, smooch, muah#k (level 20 ~ 30)\r\n#bfly#k (level 20 ~ 30)\r\n#bcute, adorable#k (level 20 ~ 30)"); - cm.dispose(); - } else if (selection == 18) { - cm.sendNext("These are the commands for #rMini Yeti#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bdance, boogie, shakeit#k (level 1 ~ 30)\r\n#bcute, cutie, pretty, adorable#k (level 1 ~ 30)\r\n#biloveyou, likeyou, mylove#k (level 1 ~ 30)\r\n#btalk, chat, say#k (level 10 ~ 30)\r\n#bsleep, nap#k (level 10 ~ 30)"); - cm.dispose(); - } else if (selection == 19) { - cm.sendNext("These are the commands for #rJr. Balrog#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bliedown#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#biloveyou|mylove|likeyou#k (level 1 ~ 30)\r\n#bcute|cutie|pretty|adorable#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bsmirk|crooked|laugh#k (level 1 ~ 30)\r\n#bmelong#k (level 11 ~ 30)\r\n#bgood|thelook|charisma#k (level 11 ~ 30)\r\n#bspeak|talk|chat|say#k (level 11 ~ 30)\r\n#bsleep|nap|sleepy#k (level 11 ~ 30)\r\n#bgas#k (level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 20) { - cm.sendNext("These are the commands for #rBaby Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#biloveyou|loveyou#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bstupid|ihateyou|dummy#k (level 1 ~ 30)\r\n#bcutie#k (level 11 ~ 30)\r\n#btalk|chat|say#k (level 11 ~ 30)\r\n#bsleep|sleepy|gotobed#k (level 11 ~ 30)"); - cm.dispose(); - } else if (selection == 21) { - cm.sendNext("These are the commands for #rGreen/Red/Blue Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 15 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 15 ~ 30)\r\n#biloveyou|loveyou#k (level 15 ~ 30)\r\n#bpoop#k (level 15 ~ 30)\r\n#bstupid|ihateyou|dummy#k (level 15 ~ 30)\r\n#btalk|chat|say#k (level 15 ~ 30)\r\n#bsleep|sleepy|gotobed#k (level 15 ~ 30)\r\n#bchange#k (level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 22) { - cm.sendNext("These are the commands for #rBlack Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 15 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 15 ~ 30)\r\n#biloveyou|loveyou#k (level 15 ~ 30)\r\n#bpoop#k (level 15 ~ 30)\r\n#bstupid|ihateyou|dummy#k (level 15 ~ 30)\r\n#btalk|chat|say#k (level 15 ~ 30)\r\n#bsleep|sleepy|gotobed#k (level 15 ~ 30)\r\n#bcutie, change#k (level 21 ~ 30)"); - cm.dispose(); - } else if (selection == 23) { - cm.sendNext("These are the commands for #rSnowman#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bstupid, ihateyou, dummy#k (level 1 ~ 30)\r\n#bloveyou, mylove, ilikeyou#k (level 1 ~ 30)\r\n#bmerrychristmas#k (level 1 ~ 30)\r\n#bcutie, adorable, cute, pretty#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#btalk, chat, say/sleep, sleepy, gotobed#k (level 10 ~ 30)\r\n#bchang#k (level 20 ~ 30)"); - cm.dispose(); - } else if (selection == 24) { - cm.sendNext("These are the commands for #rSun Wu Kong#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~ 30)\r\n#bno,bad,badgirl,badboy#k(level 1 ~ 30) \r\n#bpoope#k(level 1 ~ 30) \r\n#bcutie,adorable,cute,pretty#k(level 1 ~ 30) \r\n#biloveyou,loveyou,luvyou,ilikeyou,mylove#k(level 1 ~ 30) \r\n#btalk,chat,say/sleep,sleepy,gotobed#k(level 10 ~ 30) \r\n#btransform#k(level 20 ~ 30)"); - cm.dispose(); - } else if (selection == 25) { - cm.sendNext("These are the commands for #rJr. Reaper#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#bplaydead, poop#k (level 1 ~ 30)\r\n#btalk|chat|say#k (level 1 ~ 30)\r\n#biloveyou, hug#k (level 1 ~ 30)\r\n#bsmellmyfeet, rockout, boo#k (level 1 ~ 30)\r\n#btrickortreat#k (level 1 ~ 30)\r\n#bmonstermash#k (level 1 ~ 30)"); - cm.dispose(); - } else if (selection == 26) { - cm.sendNext("These are the commands for #rCrystal Rudolph#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|badgirl|badboy#k (level 1 ~ 30)\r\n#bbleh|joke#k(level 1~30)\r\n#bdisguise|transform#k(level 1 ~ 30) \r\n#bawesome|feelgood|lalala#k(level 1 ~ 30) \r\n#bloveyou|heybabe#k(level 1 ~ 30) \r\n#btalk|say|chat#k(level 10 ~ 30) \r\n#bsleep|sleepy|nap|gotobed#k(level 20 ~ 30)"); - cm.dispose(); - } else if (selection == 27) { - cm.sendNext("These are the commands for #rKino#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad|no|badgirl|badboy#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bsleep|nap|sleepy|gotobed#k(level 1 ~ 30) \r\n#btalk|say|chat#k(level 10 ~ 30) \r\n#biloveyou|mylove|likeyou#k(level 10 ~ 30) \r\n#bmeh|bleh#k(level 10 ~ 30) \r\n#bdisguise|change|transform#k(level 20 ~ 30)"); - cm.dispose(); - } else if (selection == 28) { - cm.sendNext("These are the commands for #rWhite Duck#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~ 30) \r\n#bbad|no|badgirl|badboy#k(level 1 ~ 30) \r\n#bup|stand#k(level 1 ~ 30) \r\n#bpoop#k(level 1 ~ 30) \r\n#btalk|chat|say#k(level 1 ~ 30) \r\n#bhug#k(level 1 ~ 30) \r\n#bloveyou#k(level 1 ~ 30) \r\n#bcutie#k(level 1 ~ 30) \r\n#bsleep#k(level 1 ~ 30) \r\n#bsmarty(level 10 ~ 30) \r\n#bdance#k (level 20 ~ 30) \r\n#bswan#k(level 20 ~ 30)"); - cm.dispose(); - } else if (selection == 29){ - cm.sendNext("These are the commands for #rPink Bean#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~ 30) \r\n#bbad|no|badgirl|badboy|poop#k(level 1 ~ 30) \r\n#blazy|dummy|ihateyoutalk|chat|say|mumbleiloveyou|hugme|loveyou|#k(level 1 ~ 30) \r\n#bshake|music|charmbleh|joke|boo#k(level 20 ~ 30) \r\n#bgotobed|sleep|sleepypoke|stinky|dummy|ihateyou#k(level 20 ~ 30)\r\n#bkongkong#k(level 30)"); - cm.dispose(); - } else if (selection == 30){ - cm.sendNext("These are the commands for #rPorcupine#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#bhugcushion|sleep|knit|poop#k (level 1 ~ 30)\r\n#bcomb|beach#k (level 10 ~ 30)\r\n#btreeninja|dart#k (level 20 ~ 30)"); - cm.dispose(); - } - } else if(status == 2){ - cm.sendNextPrev("But Water of Life only comes out little at the very bottom of the World Tree, so those babies can't be alive forever... I know, it's very unfortunate... but even if it becomes a doll again they can be brought back to life so be good to it while you're with it."); - } else if(status == 3){ - cm.sendNextPrev("Oh yeah, they'll react when you give them special commands. You can scold them, love them.. it all depends on how you take care of them. They are afraid to leave their masters so be nice to them, show them love. They can get sad and lonely fast.."); - cm.dispose(); - } else if(status == 4){ - cm.sendNextPrev("Talk to the pet, pay attention to it and its closeness level will go up and eventually his overall level will go up too. As the closeness rises, the pet's overall level will rise soon after. As the overall level rises, one day the pet may even talk like a person a little bit, so try hard raising it. Of course it won't be easy doing so..."); - } else if(status == 5){ - cm.sendNextPrev("It may be a live doll but they also have life so they can feel the hunger too. #bFullness#k shows the level of hunger the pet's in. 100 is the max, and the lower it gets, it means that the pet is getting hungrier. After a while, it won't even follow your command and be on the offensive, so watch out over that."); - } else if(status == 6){ - cm.sendNextPrev("That's right! Pets can't eat the normal human food. Instead a teddy bear in Ludibrium called #bPatricia#k sells #bPet Food#k so if you need food for your pet, find #bPatricia#k It'll be a good idea to buy the food in advance and feed the pet before it gets really hungry."); - } else if(status == 7){ - cm.sendNextPrev("Oh, and if you don't feed the pet for a long period of time, it goes back home by itself. You can take it out of its home and feed it but it's not really good for the pet's health, so try feeding him on a regular basis so it doesn't go down to that level, alright? I think this will do."); - cm.dispose(); - } else if(status == 8){ - cm.sendNextPrev("After some time... that's correct, they stop moving. They just turn back to being a doll, after the effect of magic dies down and Water of Life dries out. But that doesn't mean it's stopped forever, because once you pour Water of Life over, it's going to be back alive."); - } else if(status == 9){ - cm.sendNextPrev("Even if it someday moves again, it's sad to see them stop altogether. Please be nice to them while they are alive and moving. Feed them well, too. Isn't it nice to know that there's something alive that follows and listens to only you?"); - cm.dispose(); + if (status == 0) { + cm.sendSimple("Hello there, I'm #bMar the Fairy#k of Victoria Island's main disciple. Mar the Fairy summoned me here to see if the pets are being taken care of here in Ludibrium. What can I do for you? \r\n#L0##bMy pet has turned back into a doll\r\nPlease help me make it move again!#k#l \r\n#L1##bTell me more about Pets.#k#l \r\n#L2##bHow do I raise Pets?#k#l \r\n#L3##bDo Pets die too?#k#l \r\n#L4##bWhat are the commands for brown and black kitty?#k#l \r\n#L5##bWhat are the commands for brown puppy?#k#l \r\n#L6##bWhat are the commands for pink and white bunny?#k#l \r\n#L7##bWhat are the commands for Mini Cargo?#k#l \r\n#L8##bWhat are the commands for Husky?#k#l \r\n#L9##bWhat are the commands for Black Pig?#k#l \r\n#L10##bWhat are the commands for Panda#k#l \r\n#L11##bWhat are the commands for Dino Boy & Girl?#k#l \r\n#L12##bWhat are the commands for Rudolph?#k#l \r\n#L13##bWhat are the commands for Monkey?#k#l \r\n#L14##bWhat are the commands for Robot?#k#l \r\n#L15##bWhat are the commands for Elephant?#k#l \r\n#L16##bWhat are the commands for Golden Pig?#k#l \r\n#L17##bWhat are the commands for Penguin?#k#l \r\n#L18##bWhat are the commands for Mini Yeti?#k#l \r\n#L19##bWhat are the commands for Jr. Balrog? \r\n#L20##bWhat are the commands for Baby Dragon?#k#l \r\n#L21##bWhat are the commands for Green/Red/Blue Dragon?#k#l \r\n#L22##bWhat are the commands for Black Dragon?#k#l \r\n#L23##bWhat are the commands for Snowman?#k#l \r\n#L24##bWhat are the commands for Sun Wu Kong?#k#l \r\n#L25##bWhat are the commands for Jr. Reaper?#k#l \r\n#L26##bWhat are the commands for Crystal Rudolph?#k#l \r\n#L27##bWhat are the commands for Kino?#k#l \r\n#L28##bWhat are the commands for White Duck?#k#l \r\n#L29##bWhat are the commands for Pink Bean?#k#l \r\n#L30##bWhat are the commands for Porcupine?#k#l"); + } else if (status == 1) { + if (selection == 0) { + cm.sendNext("I'm Wisp, continuing on with the studies that my Master Mar the Fairy assigned me. There seems to be a lot of pets even her in Ludibrium. I need to get back to my studies, so if you'll excuse me..."); + cm.dispose(); + } else if (selection == 1) { + cm.sendNext("Hmmmm,you must have a lot of questions regarding the pets. Long ago, a person by the name #bCloy#k, sprayed Water of Life on it, and cast spell on it to create a magical animal. I know it sounds unbelievable, but it's a doll that became an actual living thing. They understand and follow people very well."); + } else if (selection == 2) { + cm.sendNext("Depending on the command you give, pets can love it, hate, and display other kinds of reactions to it. If you give the pet a command and it follows you well, your closeness goes up. Double click on the pet and you can check the closeness, level, fullness and etc..."); + } else if (selection == 3) { + cm.sendNext("Dying... well, they aren't technically ALIVE per se, so I don't know if dying is the right term to use. They are dolls with my magical power and the power of Water of Life to become a live object. Of course while it's alive, it's just like a live animal..."); + } else if (selection == 4) { + cm.sendNext("These are the commands for #rBrown Kitty and Black Kitty#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpoop#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 10 ~ 30)\r\n#bcutie#k (level 10 ~ 30)\r\n#bup, stand, rise#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 5) { + cm.sendNext("These are the commands for #rBrown Puppy#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, baddog, dummy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpee#k (level 10 ~ 30)\r\n#btalk, say, chat, bark#k (level 10 ~ 30)\r\n#bdown#k (level 10 ~ 30)\r\n#bup, stand, rise#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 6) { + cm.sendNext("These are the commands for #rPink Bunny and White Bunny#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bup, stand#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpoop#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 10 ~ 30)\r\n#bhug#k (level 10 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 7) { + cm.sendNext("These are the commands for #rMini Cargo#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bup, stand#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpee#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 10 ~ 30)\r\n#bthelook, charisma#k (level 10 ~ 30)\r\n#bgoodboy, good#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 8) { + cm.sendNext("These are the commands for #rHusky#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, baddog, dummy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1 ~ 30)\r\n#bpee#k (level 1 ~ 30)\r\n#btalk, say, chat, bark#k (level 10 ~ 30)\r\n#bdown#k (level 10 ~ 30)\r\n#bup, stand, rise#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 9) { + cm.sendNext("These are the commands for #rBlack Pig#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#biloveyou#k (level 1~30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bhand, up, stand#k (level 1 ~ 30)\r\n#btalk, say, chat, hug#k (level 10 ~ 30)\r\n#bsmile#k (level 10 ~ 30)\r\n#blaugh, smile#k (level 10 ~ 30)\r\n#bcharisma, sleep, sleepy, gotobed#k(level 20~30)"); + cm.dispose(); + } else if (selection == 10) { + cm.sendNext("These are the commands for #rPanda#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#biloveyou#k (level 1 ~ 30)\r\n#bpee#k(level 1 ~ 30)\r\n#bup, stand, hug#k (level 1 ~ 30)\r\n#btalk, chat#k (level 10 ~ 30)\r\n#bplay#k (level 20 ~ 30)\r\n#bmeh, bleh#k (level 10 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 11) { + cm.sendNext("These are the commands for #rDino Boy and Dino Girl#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no,, stupid, ihateyou, badboy, badgirl#k (evel 1 ~ 30)\r\n#biloveyou, dummy#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#btalk, chat(level 10 ~ 30)\r\n#bsmile, laugh#k (level 1 ~ 30)\r\n#bcutie#k (level 10 ~ 30)\r\n#bsleep, nap, sleepy#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 12) { + cm.sendNext("These are the commands for #rRudolph#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~30) \r\n#bbad, no, badgirl, badboy#k(level 1~30)\r\n#bup, stand#k(level 1 ~ 30) \r\n#bstupid, ihateyou, dummy#k(level 1 ~ 30) \r\n#bmerryxmas, merrychristmas#k(level 11 ~ 30)\r\n#biloveyou#k(level 1 ~ 30)\r\n#bpoop#k(level 1 ~ 30)\r\n#btalk, say, chat#k(level 11 ~ 30)\r\n#blonely, alone, down, rednose#k(level 11~30),\r\n#bcutie#k(level 11 ~ 30)\r\n#bmush, go#k(level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 13) { + cm.sendNext("These are the commands for #rMonkey#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit, rest#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bup, stand#k(level 1 ~ 30)\r\n#biloveyou, pee#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 11 ~ 30)\r\n#bplay, melong#k (level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 14) { + cm.sendNext("These are the commands for #rRobot#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit, stand, rise#k (level 1 ~ 30)\r\n#battack, bad, no, badboy#k (level 1 ~ 30)\r\n#bstupid, ihateyou, dummy#k (level 1 ~ 30)\r\n#biloveyou, good#k (level 1 ~ 30)\r\n#bspeak, disguise#k (level 11 ~ 30)"); + cm.dispose(); + } else if (selection == 15) { + cm.sendNext("These are the commands for #rElephant#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit, rest#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bup, stand, rise#k(level 1 ~ 30)\r\n#biloveyou, pee#k (level 1 ~ 30)\r\n#btalk, say, chat, play#k (level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 16) { + cm.sendNext("These are the commands for #rGolden Pig#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bpoop, iloveyou#k (level 1 ~ 30)\r\n#btalk, say, chat#k (level 11 ~ 30)\r\n#bloveme, hugme#k (level 11 ~ 30)\r\n#bsleep, sleepy, gotobed#k (level 21 ~ 30)\r\n#bimpressed, outofhere#k (level 21 ~ 30)\r\n#broll, showmethemoney#k (level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 17) { + cm.sendNext("These are the commands for #rPenguin#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bup, stand, rise#k (level 1 ~ 30)\r\n#biloveyou#k (level 1 ~ 30)\r\n#btalk, chat, say#k (level 10 ~ 30)\r\n#bhug, hugme#k (level 10 ~ 30)\r\n#bwing, hand#k (level 10 ~ 30)\r\n#bsleep#k (level 20 ~ 30)\r\n#bkiss, smooch, muah#k (level 20 ~ 30)\r\n#bfly#k (level 20 ~ 30)\r\n#bcute, adorable#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 18) { + cm.sendNext("These are the commands for #rMini Yeti#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad, no, badboy, badgirl#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bdance, boogie, shakeit#k (level 1 ~ 30)\r\n#bcute, cutie, pretty, adorable#k (level 1 ~ 30)\r\n#biloveyou, likeyou, mylove#k (level 1 ~ 30)\r\n#btalk, chat, say#k (level 10 ~ 30)\r\n#bsleep, nap#k (level 10 ~ 30)"); + cm.dispose(); + } else if (selection == 19) { + cm.sendNext("These are the commands for #rJr. Balrog#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bliedown#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#biloveyou|mylove|likeyou#k (level 1 ~ 30)\r\n#bcute|cutie|pretty|adorable#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bsmirk|crooked|laugh#k (level 1 ~ 30)\r\n#bmelong#k (level 11 ~ 30)\r\n#bgood|thelook|charisma#k (level 11 ~ 30)\r\n#bspeak|talk|chat|say#k (level 11 ~ 30)\r\n#bsleep|nap|sleepy#k (level 11 ~ 30)\r\n#bgas#k (level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 20) { + cm.sendNext("These are the commands for #rBaby Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#biloveyou|loveyou#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bstupid|ihateyou|dummy#k (level 1 ~ 30)\r\n#bcutie#k (level 11 ~ 30)\r\n#btalk|chat|say#k (level 11 ~ 30)\r\n#bsleep|sleepy|gotobed#k (level 11 ~ 30)"); + cm.dispose(); + } else if (selection == 21) { + cm.sendNext("These are the commands for #rGreen/Red/Blue Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 15 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 15 ~ 30)\r\n#biloveyou|loveyou#k (level 15 ~ 30)\r\n#bpoop#k (level 15 ~ 30)\r\n#bstupid|ihateyou|dummy#k (level 15 ~ 30)\r\n#btalk|chat|say#k (level 15 ~ 30)\r\n#bsleep|sleepy|gotobed#k (level 15 ~ 30)\r\n#bchange#k (level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 22) { + cm.sendNext("These are the commands for #rBlack Dragon#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 15 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 15 ~ 30)\r\n#biloveyou|loveyou#k (level 15 ~ 30)\r\n#bpoop#k (level 15 ~ 30)\r\n#bstupid|ihateyou|dummy#k (level 15 ~ 30)\r\n#btalk|chat|say#k (level 15 ~ 30)\r\n#bsleep|sleepy|gotobed#k (level 15 ~ 30)\r\n#bcutie, change#k (level 21 ~ 30)"); + cm.dispose(); + } else if (selection == 23) { + cm.sendNext("These are the commands for #rSnowman#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bstupid, ihateyou, dummy#k (level 1 ~ 30)\r\n#bloveyou, mylove, ilikeyou#k (level 1 ~ 30)\r\n#bmerrychristmas#k (level 1 ~ 30)\r\n#bcutie, adorable, cute, pretty#k (level 1 ~ 30)\r\n#bbad, no, badgirl, badboy#k (level 1 ~ 30)\r\n#btalk, chat, say/sleep, sleepy, gotobed#k (level 10 ~ 30)\r\n#bchang#k (level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 24) { + cm.sendNext("These are the commands for #rSun Wu Kong#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~ 30)\r\n#bno,bad,badgirl,badboy#k(level 1 ~ 30) \r\n#bpoope#k(level 1 ~ 30) \r\n#bcutie,adorable,cute,pretty#k(level 1 ~ 30) \r\n#biloveyou,loveyou,luvyou,ilikeyou,mylove#k(level 1 ~ 30) \r\n#btalk,chat,say/sleep,sleepy,gotobed#k(level 10 ~ 30) \r\n#btransform#k(level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 25) { + cm.sendNext("These are the commands for #rJr. Reaper#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#bplaydead, poop#k (level 1 ~ 30)\r\n#btalk|chat|say#k (level 1 ~ 30)\r\n#biloveyou, hug#k (level 1 ~ 30)\r\n#bsmellmyfeet, rockout, boo#k (level 1 ~ 30)\r\n#btrickortreat#k (level 1 ~ 30)\r\n#bmonstermash#k (level 1 ~ 30)"); + cm.dispose(); + } else if (selection == 26) { + cm.sendNext("These are the commands for #rCrystal Rudolph#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|badgirl|badboy#k (level 1 ~ 30)\r\n#bbleh|joke#k(level 1~30)\r\n#bdisguise|transform#k(level 1 ~ 30) \r\n#bawesome|feelgood|lalala#k(level 1 ~ 30) \r\n#bloveyou|heybabe#k(level 1 ~ 30) \r\n#btalk|say|chat#k(level 10 ~ 30) \r\n#bsleep|sleepy|nap|gotobed#k(level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 27) { + cm.sendNext("These are the commands for #rKino#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bbad|no|badgirl|badboy#k (level 1 ~ 30)\r\n#bpoop#k (level 1 ~ 30)\r\n#bsleep|nap|sleepy|gotobed#k(level 1 ~ 30) \r\n#btalk|say|chat#k(level 10 ~ 30) \r\n#biloveyou|mylove|likeyou#k(level 10 ~ 30) \r\n#bmeh|bleh#k(level 10 ~ 30) \r\n#bdisguise|change|transform#k(level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 28) { + cm.sendNext("These are the commands for #rWhite Duck#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~ 30) \r\n#bbad|no|badgirl|badboy#k(level 1 ~ 30) \r\n#bup|stand#k(level 1 ~ 30) \r\n#bpoop#k(level 1 ~ 30) \r\n#btalk|chat|say#k(level 1 ~ 30) \r\n#bhug#k(level 1 ~ 30) \r\n#bloveyou#k(level 1 ~ 30) \r\n#bcutie#k(level 1 ~ 30) \r\n#bsleep#k(level 1 ~ 30) \r\n#bsmarty(level 10 ~ 30) \r\n#bdance#k (level 20 ~ 30) \r\n#bswan#k(level 20 ~ 30)"); + cm.dispose(); + } else if (selection == 29) { + cm.sendNext("These are the commands for #rPink Bean#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k(level 1 ~ 30) \r\n#bbad|no|badgirl|badboy|poop#k(level 1 ~ 30) \r\n#blazy|dummy|ihateyoutalk|chat|say|mumbleiloveyou|hugme|loveyou|#k(level 1 ~ 30) \r\n#bshake|music|charmbleh|joke|boo#k(level 20 ~ 30) \r\n#bgotobed|sleep|sleepypoke|stinky|dummy|ihateyou#k(level 20 ~ 30)\r\n#bkongkong#k(level 30)"); + cm.dispose(); + } else if (selection == 30) { + cm.sendNext("These are the commands for #rPorcupine#k. The level mentioned next to the command shows the pet level required for it to respond.\r\n#bsit#k (level 1 ~ 30)\r\n#bno|bad|badgirl|badboy#k (level 1 ~ 30)\r\n#bhugcushion|sleep|knit|poop#k (level 1 ~ 30)\r\n#bcomb|beach#k (level 10 ~ 30)\r\n#btreeninja|dart#k (level 20 ~ 30)"); + cm.dispose(); } + } else if (status == 2) { + cm.sendNextPrev("But Water of Life only comes out little at the very bottom of the World Tree, so those babies can't be alive forever... I know, it's very unfortunate... but even if it becomes a doll again they can be brought back to life so be good to it while you're with it."); + } else if (status == 3) { + cm.sendNextPrev("Oh yeah, they'll react when you give them special commands. You can scold them, love them.. it all depends on how you take care of them. They are afraid to leave their masters so be nice to them, show them love. They can get sad and lonely fast.."); + cm.dispose(); + } else if (status == 4) { + cm.sendNextPrev("Talk to the pet, pay attention to it and its closeness level will go up and eventually his overall level will go up too. As the closeness rises, the pet's overall level will rise soon after. As the overall level rises, one day the pet may even talk like a person a little bit, so try hard raising it. Of course it won't be easy doing so..."); + } else if (status == 5) { + cm.sendNextPrev("It may be a live doll but they also have life so they can feel the hunger too. #bFullness#k shows the level of hunger the pet's in. 100 is the max, and the lower it gets, it means that the pet is getting hungrier. After a while, it won't even follow your command and be on the offensive, so watch out over that."); + } else if (status == 6) { + cm.sendNextPrev("That's right! Pets can't eat the normal human food. Instead a teddy bear in Ludibrium called #bPatricia#k sells #bPet Food#k so if you need food for your pet, find #bPatricia#k It'll be a good idea to buy the food in advance and feed the pet before it gets really hungry."); + } else if (status == 7) { + cm.sendNextPrev("Oh, and if you don't feed the pet for a long period of time, it goes back home by itself. You can take it out of its home and feed it but it's not really good for the pet's health, so try feeding him on a regular basis so it doesn't go down to that level, alright? I think this will do."); + cm.dispose(); + } else if (status == 8) { + cm.sendNextPrev("After some time... that's correct, they stop moving. They just turn back to being a doll, after the effect of magic dies down and Water of Life dries out. But that doesn't mean it's stopped forever, because once you pour Water of Life over, it's going to be back alive."); + } else if (status == 9) { + cm.sendNextPrev("Even if it someday moves again, it's sad to see them stop altogether. Please be nice to them while they are alive and moving. Feed them well, too. Isn't it nice to know that there's something alive that follows and listens to only you?"); + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/2040031.js b/scripts/npc/2040031.js index 2dc345a995..c1646ffef0 100644 --- a/scripts/npc/2040031.js +++ b/scripts/npc/2040031.js @@ -24,28 +24,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("A document roll on the ground."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("A document roll on the ground."); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2040032.js b/scripts/npc/2040032.js index 3a039a287c..a62b90ce40 100644 --- a/scripts/npc/2040032.js +++ b/scripts/npc/2040032.js @@ -20,27 +20,27 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Weaver - Ludibrium : Ludibrium Pet Walkway (220000006) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Weaver - Ludibrium : Ludibrium Pet Walkway (220000006) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ function start() { cm.sendYesNo("This is the road where you can go take a walk with your pet. You can walk around with it, or you can train your pet to go through obstacles here. If you aren't too close with your pet yet, that may present a problem and he will not follow your command as much... So, what do you think? Wanna train your pet?"); } function action(mode, type, selection) { - if (mode == -1){ + if (mode == -1) { } else if (mode == 0) { cm.sendNext("Hmmm ... too busy to do it right now? If you feel like doing it, though, come back and find me."); } else if (mode == 1) { - if (cm.haveItem(4031128)) + if (cm.haveItem(4031128)) { cm.sendNext("Get that letter, jump over obstacles with your pet, and take that letter to my brother Trainer Frod. Give him the letter and something good is going to happen to your pet."); - else { + } else { cm.gainItem(4031128, 1); cm.sendOk("Ok, here's the letter. He wouldn't know I sent you if you just went there straight, so go through the obstacles with your pet, go to the very top, and then talk to Trainer Frod to give him the letter. It won't be hard if you pay attention to your pet while going through obstacles. Good luck!"); } diff --git a/scripts/npc/2040033.js b/scripts/npc/2040033.js index 6374f16834..b0ca42641e 100644 --- a/scripts/npc/2040033.js +++ b/scripts/npc/2040033.js @@ -20,15 +20,15 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Neru - Ludibrium : Ludibrium Pet Walkway (220000006) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.1 - Second Version by Moogra - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Neru - Ludibrium : Ludibrium Pet Walkway (220000006) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.1 - Second Version by Moogra + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ function start() { if (cm.haveItem(4031128)) { @@ -41,9 +41,9 @@ function start() { function action(mode, type, selection) { if (mode < 1) { - } else if (cm.getPlayer().getNoPets() == 0) + } else if (cm.getPlayer().getNoPets() == 0) { cm.sendNextPrev("Hmmm ... did you really get here with your pet? These obstacles are for pets. What are you here for without it?? Get outta here!"); - else { + } else { cm.gainItem(4031128, -1); cm.gainCloseness(4); cm.sendNextPrev("What do you think? Don't you think you have gotten much closer with your pet? If you have time, train your pet again on this obstacle course...of course, with my brother's permission."); diff --git a/scripts/npc/2040034.js b/scripts/npc/2040034.js index 5e7f0b5def..509261aadb 100644 --- a/scripts/npc/2040034.js +++ b/scripts/npc/2040034.js @@ -4,70 +4,70 @@ * @npc: Red Sign * @map: 101st Floor Eos Tower (221024500) * @func: Ludi PQ -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("LudiPQ"); - if(em == null) { - cm.sendOk("The Ludibrium PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any higher because of the extremely dangerous creatures above. Would you like to collaborate with party members to complete the quest? If so, please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nA Dimensional Schism has appeared in #b#m220000000#!#k We desperately need brave adventurers who can defeat the intruding monsters. Please, party with some dependable allies to save #m220000000#! You must pass through various stages by defeating monsters and solving quizzes, and ultimately defeat #r#o9300012##k."); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("LudiPQ"); + if (em == null) { + cm.sendOk("The Ludibrium PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any higher because of the extremely dangerous creatures above. Would you like to collaborate with party members to complete the quest? If so, please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nA Dimensional Schism has appeared in #b#m220000000#!#k We desperately need brave adventurers who can defeat the intruding monsters. Please, party with some dependable allies to save #m220000000#! You must pass through various stages by defeating monsters and solving quizzes, and ultimately defeat #r#o9300012##k."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2040035.js b/scripts/npc/2040035.js index 7471ac6f3e..f9b6934325 100644 --- a/scripts/npc/2040035.js +++ b/scripts/npc/2040035.js @@ -19,38 +19,40 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* @author: Ronan * * Arturo Abandoned Tower (922011100) Gives LudiPQ Reward. */ - + function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) - cm.dispose(); - else { - if (mode == 1) - status++; - else - status--; - if (status == 0 && mode == 1) { - cm.sendNext("Congratulations on sealing the dimensional crack! For all of your hard work, I have a gift for you! Here take this prize."); - } else if(status == 1) { - var eim = cm.getEventInstance(); - - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendNext("It seems you don't have a free slot in either your #rEquip#k, #rUse#k or #rEtc#k inventories. Please make some room and try again."); - } else { - cm.warp(221024500); - } - - cm.dispose(); - } + if (mode < 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; } + if (status == 0 && mode == 1) { + cm.sendNext("Congratulations on sealing the dimensional crack! For all of your hard work, I have a gift for you! Here take this prize."); + } else if (status == 1) { + var eim = cm.getEventInstance(); + + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendNext("It seems you don't have a free slot in either your #rEquip#k, #rUse#k or #rEtc#k inventories. Please make some room and try again."); + } else { + cm.warp(221024500); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2040036.js b/scripts/npc/2040036.js index f313499239..166c16d096 100644 --- a/scripts/npc/2040036.js +++ b/scripts/npc/2040036.js @@ -36,7 +36,7 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } @@ -44,50 +44,49 @@ function start() { function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. Collect 25 #t4001022#'s scattered across the map, then talk to me."); - eim.setProperty("statusStg" + stage, 0); - } - else { // check stage completion - if (cm.haveItem(4001022, 25)) { - cm.sendOk("Good job! You have collected all 25 #b#t4001022#'s.#k"); - cm.gainItem(4001022, -25); - - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Sorry you don't have all 25 #b#t4001022#'s.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. Collect 25 #t4001022#'s scattered across the map, then talk to me."); + eim.setProperty("statusStg" + stage, 0); + } else { // check stage completion + if (cm.haveItem(4001022, 25)) { + cm.sendOk("Good job! You have collected all 25 #b#t4001022#'s.#k"); + cm.gainItem(4001022, -25); + + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Sorry you don't have all 25 #b#t4001022#'s.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040037.js b/scripts/npc/2040037.js index b67f4cc446..aee693e004 100644 --- a/scripts/npc/2040037.js +++ b/scripts/npc/2040037.js @@ -36,7 +36,7 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } @@ -44,50 +44,49 @@ function start() { function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. Collect 15 #t4001022#'s scattered across the map, then talk to me."); - eim.setProperty("statusStg" + stage, 0); - } - else { // check stage completion - if (cm.haveItem(4001022, 15)) { - cm.sendOk("Good job! You have collected all 15 #b#t4001022#'s.#k"); - cm.gainItem(4001022, -15); - - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Sorry you don't have all 15 #b#t4001022#'s.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. Collect 15 #t4001022#'s scattered across the map, then talk to me."); + eim.setProperty("statusStg" + stage, 0); + } else { // check stage completion + if (cm.haveItem(4001022, 15)) { + cm.sendOk("Good job! You have collected all 15 #b#t4001022#'s.#k"); + cm.gainItem(4001022, -15); + + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Sorry you don't have all 15 #b#t4001022#'s.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040038.js b/scripts/npc/2040038.js index 6a97ef8a25..9ce88bbbec 100644 --- a/scripts/npc/2040038.js +++ b/scripts/npc/2040038.js @@ -36,7 +36,7 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } @@ -44,50 +44,49 @@ function start() { function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. Collect 32 #t4001022#'s scattered across the map, then talk to me."); - eim.setProperty("statusStg" + stage, 0); - } - else { // check stage completion - if (cm.haveItem(4001022, 32)) { - cm.sendOk("Good job! You have collected all 32 #b#t4001022#'s.#k"); - cm.gainItem(4001022, -32); - - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Sorry you don't have all 32 #b#t4001022#'s.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. Collect 32 #t4001022#'s scattered across the map, then talk to me."); + eim.setProperty("statusStg" + stage, 0); + } else { // check stage completion + if (cm.haveItem(4001022, 32)) { + cm.sendOk("Good job! You have collected all 32 #b#t4001022#'s.#k"); + cm.gainItem(4001022, -32); + + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Sorry you don't have all 32 #b#t4001022#'s.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040039.js b/scripts/npc/2040039.js index c16abba0fc..8d8248ec07 100644 --- a/scripts/npc/2040039.js +++ b/scripts/npc/2040039.js @@ -36,7 +36,7 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } @@ -44,50 +44,49 @@ function start() { function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. On this stage, several creatures are hiding in the shadows of the inner parts of this tower. Some of them cannot be beaten by physical means, so magical attacks are required to do the job, whereas others work the other way around. Get me 6 #t4001022#'s this time."); - eim.setProperty("statusStg" + stage, 0); - } - else { // check stage completion - if (cm.haveItem(4001022, 6)) { - cm.sendOk("Good job! You have collected all 6 #b#t4001022#'s.#k"); - cm.gainItem(4001022, -6); - - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Sorry you don't have all 6 #b#t4001022#'s.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. On this stage, several creatures are hiding in the shadows of the inner parts of this tower. Some of them cannot be beaten by physical means, so magical attacks are required to do the job, whereas others work the other way around. Get me 6 #t4001022#'s this time."); + eim.setProperty("statusStg" + stage, 0); + } else { // check stage completion + if (cm.haveItem(4001022, 6)) { + cm.sendOk("Good job! You have collected all 6 #b#t4001022#'s.#k"); + cm.gainItem(4001022, -6); + + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Sorry you don't have all 6 #b#t4001022#'s.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040040.js b/scripts/npc/2040040.js index 7f8c31c181..8c16a57c09 100644 --- a/scripts/npc/2040040.js +++ b/scripts/npc/2040040.js @@ -36,7 +36,7 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } @@ -44,50 +44,49 @@ function start() { function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. This is the 2nd stage, but everyone has to cooperate. There are 6 portals here. One is guarded by undefeatable monsters, and one is very high. I'd like you and your party to go in each one and break the boxes inside. Bring back the drops -- there should be 24."); - eim.setProperty("statusStg" + stage, 0); - } - else { // check stage completion - if (cm.haveItem(4001022, 24)) { - cm.sendOk("Good job! You have collected all 24 #b#t4001022#'s.#k"); - cm.gainItem(4001022, -24); - - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Sorry you don't have all 24 #b#t4001022#'s.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. This is the 2nd stage, but everyone has to cooperate. There are 6 portals here. One is guarded by undefeatable monsters, and one is very high. I'd like you and your party to go in each one and break the boxes inside. Bring back the drops -- there should be 24."); + eim.setProperty("statusStg" + stage, 0); + } else { // check stage completion + if (cm.haveItem(4001022, 24)) { + cm.sendOk("Good job! You have collected all 24 #b#t4001022#'s.#k"); + cm.gainItem(4001022, -24); + + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Sorry you don't have all 24 #b#t4001022#'s.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040041.js b/scripts/npc/2040041.js index 2a1f833b5e..e2223a10ce 100644 --- a/scripts/npc/2040041.js +++ b/scripts/npc/2040041.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* @ Author : Moogra @ NPC = Aqua Balloon diff --git a/scripts/npc/2040042.js b/scripts/npc/2040042.js index 66a43f7256..b20ccb9dc5 100644 --- a/scripts/npc/2040042.js +++ b/scripts/npc/2040042.js @@ -37,7 +37,7 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } @@ -45,50 +45,49 @@ function start() { function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. You need ranged personnel here. They must kill the three Ratz, which will trigger something. What's next is for you to find out! Get me 3 passes!"); - eim.setProperty("statusStg" + stage, 0); - } - else if(state == 0) { // check stage completion - if (cm.haveItem(4001022, 3)) { - cm.sendOk("Good job! You have collected all 3 #b#t4001022#'s.#k"); - cm.gainItem(4001022, -3); - - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Sorry you don't have all 3 #b#t4001022#'s.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. You need ranged personnel here. They must kill the three Ratz, which will trigger something. What's next is for you to find out! Get me 3 passes!"); + eim.setProperty("statusStg" + stage, 0); + } else if (state == 0) { // check stage completion + if (cm.haveItem(4001022, 3)) { + cm.sendOk("Good job! You have collected all 3 #b#t4001022#'s.#k"); + cm.gainItem(4001022, -3); + + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Sorry you don't have all 3 #b#t4001022#'s.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040043.js b/scripts/npc/2040043.js index 51a346b2bf..6002420887 100644 --- a/scripts/npc/2040043.js +++ b/scripts/npc/2040043.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* @ Author : Twdtwd @ Author : Ronan @@ -32,26 +33,29 @@ */ function generateCombo() { - var countPicked = 0; - var positions = Array(0,0,0,0,0,0,0,0,0); - while(countPicked < 5) { - var picked = Math.floor(Math.random() * positions.length); - if(positions[picked] == 1) // Don't let it pick one its already picked. - continue; - - positions[picked] = 1; - countPicked++; - } - - var returnString = ""; - for(var i = 0; i < positions.length; i++) { - returnString += positions[i]; - if(i != positions.length - 1) - returnString += ","; - } - - return returnString; - + var countPicked = 0; + var positions = Array(0, 0, 0, 0, 0, 0, 0, 0, 0); + while (countPicked < 5) { + var picked = Math.floor(Math.random() * positions.length); + if (positions[picked] == 1) // Don't let it pick one its already picked. + { + continue; + } + + positions[picked] = 1; + countPicked++; + } + + var returnString = ""; + for (var i = 0; i < positions.length; i++) { + returnString += positions[i]; + if (i != positions.length - 1) { + returnString += ","; + } + } + + return returnString; + } var debug = false; @@ -61,99 +65,99 @@ var curMap, stage; function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map } function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. In this stage, line up 5 member of your party above those boxes in order to form the right combination to unlock the next stage. Only one player should stay above a box desired to pertain the combination."); - - var st = (debug) ? 2 : 0; - eim.setProperty("statusStg" + stage, st); - } - else { // check stage completion - if(state == 2) { - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - cm.dispose(); - return; - } - - objset = [0,0,0,0,0,0,0,0,0]; - var playersOnCombo = 0; - var map = cm.getPlayer().getMap(); - var party = cm.getEventInstance().getPlayers(); - for (var i = 0; i < party.size(); i++) { - for (var y = 0; y < map.getAreas().size(); y++) { - if (map.getArea(y).contains(party.get(i).getPosition())) { - playersOnCombo++; - objset[y] = 1; - //cm.mapMessage(5, "Player found on " + (y + 1)); - break; - } - } - } - - if (playersOnCombo == 5 || cm.getPlayer().gmLevel() > 1) { - var comboStr = eim.getProperty("stage" + stage + "combo"); - if(comboStr == null) { - comboStr = generateCombo(); - eim.setProperty("stage" + stage + "combo", comboStr); - } - - var combo = comboStr.split(','); - var correctCombo = true; - for (i = 0; i < objset.length && correctCombo; i++) - if (parseInt(combo[i]) != objset[i]) { - //cm.mapMessage(5, "Combo failed on " + (i + 1)); - correctCombo = false; - } - if (correctCombo || cm.getPlayer().gmLevel() > 1) { - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - cm.dispose(); - } else { - eim.showWrongEffect(); - cm.dispose(); - } - } else { - cm.sendNext("It looks like you haven't found the 5 boxes just yet. Please think of a different combination of boxes. Only 5 are allowed to stand on boxes, and if you move it may not count as an answer, so please keep that in mind. Keep going!"); - cm.dispose(); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. In this stage, line up 5 member of your party above those boxes in order to form the right combination to unlock the next stage. Only one player should stay above a box desired to pertain the combination."); + + var st = (debug) ? 2 : 0; + eim.setProperty("statusStg" + stage, st); + } else { // check stage completion + if (state == 2) { + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + cm.dispose(); + return; + } + + objset = [0, 0, 0, 0, 0, 0, 0, 0, 0]; + var playersOnCombo = 0; + var map = cm.getPlayer().getMap(); + var party = cm.getEventInstance().getPlayers(); + for (var i = 0; i < party.size(); i++) { + for (var y = 0; y < map.getAreas().size(); y++) { + if (map.getArea(y).contains(party.get(i).getPosition())) { + playersOnCombo++; + objset[y] = 1; + //cm.mapMessage(5, "Player found on " + (y + 1)); + break; + } + } + } + + if (playersOnCombo == 5 || cm.getPlayer().gmLevel() > 1) { + var comboStr = eim.getProperty("stage" + stage + "combo"); + if (comboStr == null) { + comboStr = generateCombo(); + eim.setProperty("stage" + stage + "combo", comboStr); + } + + var combo = comboStr.split(','); + var correctCombo = true; + for (i = 0; i < objset.length && correctCombo; i++) { + if (parseInt(combo[i]) != objset[i]) { + //cm.mapMessage(5, "Combo failed on " + (i + 1)); + correctCombo = false; + } + } + if (correctCombo || cm.getPlayer().gmLevel() > 1) { + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + cm.dispose(); + } else { + eim.showWrongEffect(); + cm.dispose(); + } + } else { + cm.sendNext("It looks like you haven't found the 5 boxes just yet. Please think of a different combination of boxes. Only 5 are allowed to stand on boxes, and if you move it may not count as an answer, so please keep that in mind. Keep going!"); + cm.dispose(); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040044.js b/scripts/npc/2040044.js index 20391b00ff..0861f305cc 100644 --- a/scripts/npc/2040044.js +++ b/scripts/npc/2040044.js @@ -37,57 +37,56 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 922010100) / 100) + 1; - + status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("Hurry, goto the next stage, the portal is open!"); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - cm.sendOk("Hi. Welcome to the #bBOSS stage#k. Kill the Ratz on that platform to reveal the Alishar, and defeat him!"); - eim.setProperty("statusStg" + stage, 0); - } - else { // check stage completion - if (cm.haveItem(4001023, 1)) { - cm.gainItem(4001023, -1); - eim.setProperty("statusStg" + stage, 1); - - var list = eim.getClearStageBonus(stage); // will give bonus exp & mesos to everyone in the event - eim.giveEventPlayersExp(list.get(0)); - eim.giveEventPlayersMeso(list.get(1)); - - eim.setProperty(stage + "stageclear", "true"); - eim.showClearEffect(true); - - eim.clearPQ(); - } else { - cm.sendNext("Please defeat Alishar and bring me his #b#t4001023#.#k"); - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("Hurry, goto the next stage, the portal is open!"); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + cm.sendOk("Hi. Welcome to the #bBOSS stage#k. Kill the Ratz on that platform to reveal the Alishar, and defeat him!"); + eim.setProperty("statusStg" + stage, 0); + } else { // check stage completion + if (cm.haveItem(4001023, 1)) { + cm.gainItem(4001023, -1); + eim.setProperty("statusStg" + stage, 1); + + var list = eim.getClearStageBonus(stage); // will give bonus exp & mesos to everyone in the event + eim.giveEventPlayersExp(list.get(0)); + eim.giveEventPlayersMeso(list.get(1)); + + eim.setProperty(stage + "stageclear", "true"); + eim.showClearEffect(true); + + eim.clearPQ(); + } else { + cm.sendNext("Please defeat Alishar and bring me his #b#t4001023#.#k"); + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } diff --git a/scripts/npc/2040045.js b/scripts/npc/2040045.js index 01f546487b..d48725356d 100644 --- a/scripts/npc/2040045.js +++ b/scripts/npc/2040045.js @@ -39,23 +39,23 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose();//ExitChat - }else if (mode == 0){ - cm.sendOk("Wise choice. Who wouldn't want free mesos from the #bBonus Stage#k?"); - cm.dispose();//No + if (mode == -1) { + cm.dispose();//ExitChat + } else if (mode == 0) { + cm.sendOk("Wise choice. Who wouldn't want free mesos from the #bBonus Stage#k?"); + cm.dispose();//No + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendYesNo("Would you like to leave the bonus stage?"); - } - else { - cm.warp(922011100, "st00"); - cm.dispose(); - } + status--; } + + if (status == 0) { + cm.sendYesNo("Would you like to leave the bonus stage?"); + } else { + cm.warp(922011100, "st00"); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2040046.js b/scripts/npc/2040046.js index afed8a51a6..910bfa70f0 100644 --- a/scripts/npc/2040046.js +++ b/scripts/npc/2040046.js @@ -20,55 +20,56 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Robert Holly - Ludibrium: Ludibrium (220000000) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Robert Holly - Ludibrium: Ludibrium (220000000) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status = 0; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (status == 0 && mode == 0) { - cm.sendNext("I see... you don't have as many friends as I thought you would. Hahaha, just kidding! Anyway if you feel like changing your mind, please feel free to come back and we'll talk business. If you make a lot of friends, then you know ... hehe ..."); - cm.dispose(); - return; - } else if (status >= 1 && mode == 0) { - cm.sendNext("I see... I don't think you don't have as many friends as I thought you would. If not, you just don't have 240,000 mesos with you right this minute? Anyway, if you ever change your mind, come back and we'll talk business. That is, of course, once you have get some financial relief. .. hehe ..."); - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendYesNo("I hope I can make as much as yesterday... well, hello! Don't you want to extend your buddy list? You look like someone who'd have a whole lot of friends... well, what do you think? With some money I can make it happen for you. Remember, though, it only applies to one character at a time, so it won't affect any of your other characters on your account. Do you want to extend your buddy list?"); - } else if (status == 1) { - cm.sendYesNo("Alright, good call! It's not that expensive actually. #b240,000 mesos and I'll add 5 more slots to your buddy list#k. And no, I won't be selling them individually. Once you buy it, it's going to be permanently on your buddy list. So if you're one of those that needs more space there, then you might as well do it. What do you think? Will you spend 240,000 mesos for it?"); - } else if (status == 2) { - var capacity = cm.getPlayer().getBuddylist().getCapacity(); - if (capacity >= 50 || cm.getMeso() < 240000){ - cm.sendNext("Hey... are you sure you have #b240,000 mesos#k? If so, then check and see if you have extended your buddy list to the max. Even if you pay up, the most you can have on your buddy list is #b50#k."); + if (mode == -1) { + cm.dispose(); + } else { + if (status == 0 && mode == 0) { + cm.sendNext("I see... you don't have as many friends as I thought you would. Hahaha, just kidding! Anyway if you feel like changing your mind, please feel free to come back and we'll talk business. If you make a lot of friends, then you know ... hehe ..."); cm.dispose(); - } else { - var newcapacity = capacity + 5; - cm.gainMeso(-240000); - cm.getPlayer().setBuddyCapacity(newcapacity) - cm.sendOk("Alright! Your buddy list will have 5 extra slots by now. Check and see for it yourself. And if you still need more room on your buddy list, you know who to find. Of course, it isn't going to be for free ... well, so long ..."); - cm.dispose(); - } - } - } + return; + } else if (status >= 1 && mode == 0) { + cm.sendNext("I see... I don't think you don't have as many friends as I thought you would. If not, you just don't have 240,000 mesos with you right this minute? Anyway, if you ever change your mind, come back and we'll talk business. That is, of course, once you have get some financial relief. .. hehe ..."); + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendYesNo("I hope I can make as much as yesterday... well, hello! Don't you want to extend your buddy list? You look like someone who'd have a whole lot of friends... well, what do you think? With some money I can make it happen for you. Remember, though, it only applies to one character at a time, so it won't affect any of your other characters on your account. Do you want to extend your buddy list?"); + } else if (status == 1) { + cm.sendYesNo("Alright, good call! It's not that expensive actually. #b240,000 mesos and I'll add 5 more slots to your buddy list#k. And no, I won't be selling them individually. Once you buy it, it's going to be permanently on your buddy list. So if you're one of those that needs more space there, then you might as well do it. What do you think? Will you spend 240,000 mesos for it?"); + } else if (status == 2) { + var capacity = cm.getPlayer().getBuddylist().getCapacity(); + if (capacity >= 50 || cm.getMeso() < 240000) { + cm.sendNext("Hey... are you sure you have #b240,000 mesos#k? If so, then check and see if you have extended your buddy list to the max. Even if you pay up, the most you can have on your buddy list is #b50#k."); + cm.dispose(); + } else { + var newcapacity = capacity + 5; + cm.gainMeso(-240000); + cm.getPlayer().setBuddyCapacity(newcapacity) + cm.sendOk("Alright! Your buddy list will have 5 extra slots by now. Check and see for it yourself. And if you still need more room on your buddy list, you know who to find. Of course, it isn't going to be for free ... well, so long ..."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2040047.js b/scripts/npc/2040047.js index 956d702078..7a4d03fec6 100644 --- a/scripts/npc/2040047.js +++ b/scripts/npc/2040047.js @@ -34,13 +34,13 @@ var status; function start() { status = -1; - action(1,0,0); + action(1, 0, 0); } -function action(mode, type, selection){ - if (mode == 1) +function action(mode, type, selection) { + if (mode == 1) { status++; - else { + } else { cm.dispose(); return; } diff --git a/scripts/npc/2040047_old.js b/scripts/npc/2040047_old.js index 4964970b34..6a7e37973c 100644 --- a/scripts/npc/2040047_old.js +++ b/scripts/npc/2040047_old.js @@ -3,58 +3,59 @@ * @npc: Sgt. Anderson * @maps: Ludibrium PQ Maps * @func: Ludi PQ (Warps you out) -*/ + */ var status = -1; function start() { if (cm.getMapId() != 922010000 && cm.getMapId() != 922010800) { - cm.sendYesNo("You'll have to start over from scratch if you want to take a crack at this quest after leaving this stage. Are you sure you want to leave this map?"); + cm.sendYesNo("You'll have to start over from scratch if you want to take a crack at this quest after leaving this stage. Are you sure you want to leave this map?"); } else if (cm.getMapId() == 922010800) { - cm.sendSimple("Do you need some help?#b\r\n#L0#I need Platform Puppet.#l\r\n#L1#I want to get out of here.#l#k"); - } else { - cm.removeAll(4001022); // pass of dimension - cm.removeAll(4001023); - cm.removeAll(4001454); // platform puppet - cm.warp(221024500, 0); - cm.dispose(); + cm.sendSimple("Do you need some help?#b\r\n#L0#I need Platform Puppet.#l\r\n#L1#I want to get out of here.#l#k"); + } else { + cm.removeAll(4001022); // pass of dimension + cm.removeAll(4001023); + cm.removeAll(4001454); // platform puppet + cm.warp(221024500, 0); + cm.dispose(); } } function action(mode, type, selection) { - if (mode == 1) - status++; - else if (mode == 0 && (status == 0 || status == -1)) { - cm.sendNext("I see. Gather up the strength of your party members and try harder!"); - cm.dispose(); - return; - } else - status--; - if (status == 0) { - if (cm.getMapId() == 922010800) { - if (selection == 0) { - cm.sendNext("You have received a Platform Puppet. If you place it on the platform, it will have the same effect as someone standing there.\r\nRemember, though, this is an item that can only be used in here."); - cm.gainItem(4001454, 1); - cm.dispose(); - } else { - cm.sendYesNo("You'll have to start over from scratch if you want to take a crack at this quest after leaving this stage. Are you sure you want to leave this map?"); - } - } else { - var eim = cm.getPlayer().getEventInstance(); - if(eim != null) { - eim.removePlayer(cm.getPlayer()); - } else { - cm.warp(922010000, 0); - } - cm.dispose(); - } - } else if (status == 1) { - var eim = cm.getPlayer().getEventInstance(); - if(eim != null) { - eim.removePlayer(cm.getPlayer()); - } else { - cm.warp(922010000, 0); - } - cm.dispose(); - } + if (mode == 1) { + status++; + } else if (mode == 0 && (status == 0 || status == -1)) { + cm.sendNext("I see. Gather up the strength of your party members and try harder!"); + cm.dispose(); + return; + } else { + status--; + } + if (status == 0) { + if (cm.getMapId() == 922010800) { + if (selection == 0) { + cm.sendNext("You have received a Platform Puppet. If you place it on the platform, it will have the same effect as someone standing there.\r\nRemember, though, this is an item that can only be used in here."); + cm.gainItem(4001454, 1); + cm.dispose(); + } else { + cm.sendYesNo("You'll have to start over from scratch if you want to take a crack at this quest after leaving this stage. Are you sure you want to leave this map?"); + } + } else { + var eim = cm.getPlayer().getEventInstance(); + if (eim != null) { + eim.removePlayer(cm.getPlayer()); + } else { + cm.warp(922010000, 0); + } + cm.dispose(); + } + } else if (status == 1) { + var eim = cm.getPlayer().getEventInstance(); + if (eim != null) { + eim.removePlayer(cm.getPlayer()); + } else { + cm.warp(922010000, 0); + } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2040048.js b/scripts/npc/2040048.js index 48a3bb3804..f4e88388ae 100644 --- a/scripts/npc/2040048.js +++ b/scripts/npc/2040048.js @@ -27,7 +27,7 @@ var access = false; var status = 0; function start() { - cm.sendSimple("Have you heard of the beach with a spectacular view of the ocean called #b#m110000000##k, located a little far from #m"+cm.getPlayer().getMapId()+"#? I can take you there right now for either #b"+pay+" mesos#k, or if you have #b#t"+ticket+"##k with you, in which case you'll be in for free.\r\n\r\n#L0##bI'll pay "+pay+" mesos.#k#l\r\n#L1##bI have #t"+ticket+"##k#l\r\n#L2##bWhat is #t"+ticket+"#?#k#l"); + cm.sendSimple("Have you heard of the beach with a spectacular view of the ocean called #b#m110000000##k, located a little far from #m" + cm.getPlayer().getMapId() + "#? I can take you there right now for either #b" + pay + " mesos#k, or if you have #b#t" + ticket + "##k with you, in which case you'll be in for free.\r\n\r\n#L0##bI'll pay " + pay + " mesos.#k#l\r\n#L1##bI have #t" + ticket + "##k#l\r\n#L2##bWhat is #t" + ticket + "#?#k#l"); } function action(mode, type, selection) { @@ -37,26 +37,28 @@ function action(mode, type, selection) { if (mode == 0 && status == 0) { cm.dispose(); return; - } - if (mode == 0 && status == 1) { + } + if (mode == 0 && status == 1) { cm.sendNext("You must have some buiness to take care of here. You must be tired from all that traveling and hunting. Go take some rest, and if you feel like changing your mind, then come talk to me."); cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection == 0 || selection == 1) { check = selection; - if (selection == 0) - msg = "You want to pay #b"+pay+" mesos#k and leave for #m110000000#?"; - else if (selection == 1) - msg = "So you have #b#t"+ticket+"##k? You can always head over to #m110000000# with that."; - cm.sendYesNo(msg+" Okay!! Please beware that you may be running into some monsters around there though, so make sure not to get caught off-guard. Okat, would you like to head over to #m110000000# right now?"); + if (selection == 0) { + msg = "You want to pay #b" + pay + " mesos#k and leave for #m110000000#?"; + } else if (selection == 1) { + msg = "So you have #b#t" + ticket + "##k? You can always head over to #m110000000# with that."; + } + cm.sendYesNo(msg + " Okay!! Please beware that you may be running into some monsters around there though, so make sure not to get caught off-guard. Okat, would you like to head over to #m110000000# right now?"); } else if (selection == 2) { - cm.sendNext("You must be curious about #b#t"+ticket+"##k. Yeah, I can see that. #t"+ticket+"# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); + cm.sendNext("You must be curious about #b#t" + ticket + "##k. Yeah, I can see that. #t" + ticket + "# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); status = 3; } } else if (status == 2) { @@ -70,21 +72,23 @@ function action(mode, type, selection) { } } else if (check == 1) { if (!cm.haveItem(ticket)) { - cm.sendOk("Hmmm, so where exactly is #b#t"+ticket+"##k?? Are you sure you have them? Please double-check."); + cm.sendOk("Hmmm, so where exactly is #b#t" + ticket + "##k?? Are you sure you have them? Please double-check."); cm.dispose(); - } else + } else { access = true; - } + } + } if (access == true) { cm.getPlayer().saveLocation("FLORINA"); cm.warp(110000000, "st00"); cm.dispose(); } - } else if (status == 3) - cm.sendNext("You must be curious about #b#t"+ticket+"##k. Yeah, I can see that. #t"+ticket+"# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); - else if (status == 4) + } else if (status == 3) { + cm.sendNext("You must be curious about #b#t" + ticket + "##k. Yeah, I can see that. #t" + ticket + "# is an item where as long as you have in possession, you may make your way to #m110000000# for free. It's such a rare item that even we had to buy those, but unfortunately I lost mine a few weeks ago during a long weekend."); + } else if (status == 4) { cm.sendPrev("I came back without it, and it just feels awful not having it. Hopefully someone picked it up and put it somewhere safe. Anyway this is my story and who knows, you may be able to pick it up and put it to good use. If you have any questions, feel free to ask"); - else if (status == 5) + } else if (status == 5) { cm.dispose(); + } } } diff --git a/scripts/npc/2040050.js b/scripts/npc/2040050.js index 4e5faa9a3e..a2aa62cc7f 100644 --- a/scripts/npc/2040050.js +++ b/scripts/npc/2040050.js @@ -20,88 +20,89 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Eurek the Alchemist - Multiple Place --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Information ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Eurek the Alchemist - Multiple Place + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Information + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var menu = ""; var set; var makeitem; var access = true; -var reqitem = new Array(); +var reqitem = []; var cost = 4000; -var makeditem = new Array(4006000,4006001); -var reqset = new Array([[[4000046,20],[4000027,20],[4021001,1]], - [[4000025,20],[4000049,20],[4021006,1]], - [[4000129,15],[4000130,15],[4021002,1]], - [[4000074,15],[4000057,15],[4021005,1]], - [[4000054,7],[4000053,7],[4021003,1]]], - - [[[4000046,20],[4000027,20],[4011001,1]], - [[4000014,20],[4000049,20],[4011003,1]], - [[4000132,15],[4000128,15],[4011005,1]], - [[4000074,15],[4000069,15],[4011002,1]], - [[4000080,7],[4000079,7],[4011004,1]]]); +var makeditem = [4006000, 4006001]; +var reqset = [[[[4000046, 20], [4000027, 20], [4021001, 1]], + [[4000025, 20], [4000049, 20], [4021006, 1]], + [[4000129, 15], [4000130, 15], [4021002, 1]], + [[4000074, 15], [4000057, 15], [4021005, 1]], + [[4000054, 7], [4000053, 7], [4021003, 1]]], + + [[[4000046, 20], [4000027, 20], [4011001, 1]], + [[4000014, 20], [4000049, 20], [4011003, 1]], + [[4000132, 15], [4000128, 15], [4011005, 1]], + [[4000074, 15], [4000069, 15], [4011002, 1]], + [[4000080, 7], [4000079, 7], [4011004, 1]]]]; function start() { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1 || (mode == 0 && (status ==1 || status == 2))) { - cm.dispose(); - return; - } - if(mode == 0) { - cm.sendNext("Not enough materials, huh? No worries. Just come see me once you gather up the necessary items. There are numerous ways to obtain them, whether it be hunting or purchasing it from others, so keep going."); - cm.dispose(); - } - if(mode == 1) { - status++; - } - if(status == 0) { - cm.sendNext("Alright, mix up the frog's tongue with the squirrel's tooth and ... oh yeah! Forgot to put in the sparkling white powder!! Man, that could have been really bad ... Whoa!! How long have you been standing there? I maaaay have been a little carried away with my work ... hehe."); - } else if(status == 1) { - cm.sendSimple("As you can see, I'm just a traveling alchemist. I may be in training, but I can still make a few things that you may need. Do you want to take a look?\r\n\r\n#L0##bMake Magic Rock#k#l\r\n#L1##bMake The Summoning Rock#k#l"); - } else if(status == 2) { - set = selection; - makeitem = makeditem[set]; - for(i=0; i < reqset[set].length; i++) { - menu += "\r\n#L"+i+"##bMake it using #t"+reqset[set][i][0][0]+"# and #t"+reqset[set][i][1][0]+"##k#l"; - } - cm.sendSimple("Haha... #b#t"+makeitem+"##k is a mystical rock that only I can make. Many travelers seems to need this for most powerful skills that require more than just MP and HP. There are 5 ways to make #t"+makeitem+"#. Which way do you want to make it?"+menu); - } else if(status == 3) { - set = reqset[set][selection]; - reqitem[0] = new Array(set[0][0],set[0][1]); - reqitem[1] = new Array(set[1][0],set[1][1]); - reqitem[2] = new Array(set[2][0],set[2][1]); - menu = ""; - for(i=0; i < reqitem.length; i++) { - menu += "\r\n#v"+reqitem[i][0]+"# #b"+reqitem[i][1]+" #t"+reqitem[i][0]+"#s#k"; - } - menu += "\r\n#i4031138# #b"+cost+" mesos#k"; - cm.sendYesNo("To make #b5 #t"+makeitem+"##k, I'll need the following items. Most of them can be obtained through hunting, so it won't be terriblt difficult for you to get them. What do you think? Do you want some?\r\n"+menu); - } else if(status == 4) { - for(i=0; i < reqitem.length; i++) { - if(!cm.haveItem(reqitem[i][0],reqitem[i][1])) - access = false; - } - if(access == false || !cm.canHold(makeitem) || cm.getMeso() < cost) { - cm.sendNext("Please check and see if you have all the items needed, or if your etc. inventory is full or not"); - } else { - cm.sendOk("Here, take the 5 pieces of #b#t"+makeitem+"##k. Even I have to admit, this is a masterpiece. Alright, if you need my help down the road, by all means come back and talk to me!"); - cm.gainItem(reqitem[0][0],-reqitem[0][1]); - cm.gainItem(reqitem[1][0],-reqitem[1][1]); - cm.gainItem(reqitem[2][0],-reqitem[2][1]); - cm.gainMeso(-cost); - cm.gainItem(makeitem,5); - } - cm.dispose(); - } + if (mode == -1 || (mode == 0 && (status == 1 || status == 2))) { + cm.dispose(); + return; + } + if (mode == 0) { + cm.sendNext("Not enough materials, huh? No worries. Just come see me once you gather up the necessary items. There are numerous ways to obtain them, whether it be hunting or purchasing it from others, so keep going."); + cm.dispose(); + } + if (mode == 1) { + status++; + } + if (status == 0) { + cm.sendNext("Alright, mix up the frog's tongue with the squirrel's tooth and ... oh yeah! Forgot to put in the sparkling white powder!! Man, that could have been really bad ... Whoa!! How long have you been standing there? I maaaay have been a little carried away with my work ... hehe."); + } else if (status == 1) { + cm.sendSimple("As you can see, I'm just a traveling alchemist. I may be in training, but I can still make a few things that you may need. Do you want to take a look?\r\n\r\n#L0##bMake Magic Rock#k#l\r\n#L1##bMake The Summoning Rock#k#l"); + } else if (status == 2) { + set = selection; + makeitem = makeditem[set]; + for (i = 0; i < reqset[set].length; i++) { + menu += "\r\n#L" + i + "##bMake it using #t" + reqset[set][i][0][0] + "# and #t" + reqset[set][i][1][0] + "##k#l"; + } + cm.sendSimple("Haha... #b#t" + makeitem + "##k is a mystical rock that only I can make. Many travelers seems to need this for most powerful skills that require more than just MP and HP. There are 5 ways to make #t" + makeitem + "#. Which way do you want to make it?" + menu); + } else if (status == 3) { + set = reqset[set][selection]; + reqitem[0] = [set[0][0], set[0][1]]; + reqitem[1] = [set[1][0], set[1][1]]; + reqitem[2] = [set[2][0], set[2][1]]; + menu = ""; + for (i = 0; i < reqitem.length; i++) { + menu += "\r\n#v" + reqitem[i][0] + "# #b" + reqitem[i][1] + " #t" + reqitem[i][0] + "#s#k"; + } + menu += "\r\n#i4031138# #b" + cost + " mesos#k"; + cm.sendYesNo("To make #b5 #t" + makeitem + "##k, I'll need the following items. Most of them can be obtained through hunting, so it won't be terriblt difficult for you to get them. What do you think? Do you want some?\r\n" + menu); + } else if (status == 4) { + for (i = 0; i < reqitem.length; i++) { + if (!cm.haveItem(reqitem[i][0], reqitem[i][1])) { + access = false; + } + } + if (access == false || !cm.canHold(makeitem) || cm.getMeso() < cost) { + cm.sendNext("Please check and see if you have all the items needed, or if your etc. inventory is full or not"); + } else { + cm.sendOk("Here, take the 5 pieces of #b#t" + makeitem + "##k. Even I have to admit, this is a masterpiece. Alright, if you need my help down the road, by all means come back and talk to me!"); + cm.gainItem(reqitem[0][0], -reqitem[0][1]); + cm.gainItem(reqitem[1][0], -reqitem[1][1]); + cm.gainItem(reqitem[2][0], -reqitem[2][1]); + cm.gainMeso(-cost); + cm.gainItem(makeitem, 5); + } + cm.dispose(); + } } diff --git a/scripts/npc/2040052.js b/scripts/npc/2040052.js index ea4f53dd22..8ad7b8a248 100644 --- a/scripts/npc/2040052.js +++ b/scripts/npc/2040052.js @@ -20,57 +20,59 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Wiz the Librarian - Helios Tower (222020000) --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Information ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Wiz the Librarian - Helios Tower (222020000) + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Information + --------------------------------------------------------------------------------------------------- + **/ var status = 0; -var questid = new Array(3615,3616,3617,3618,3630,3633,3639,3920); -var questitem = new Array(4031235,4031236,4031237,4031238,4031270,4031280,4031298,4031591); +var questid = [3615, 3616, 3617, 3618, 3630, 3633, 3639, 3920]; +var questitem = [4031235, 4031236, 4031237, 4031238, 4031270, 4031280, 4031298, 4031591]; var counter = 0; var books; var i; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - if (status == 0) { - if(counter == 0) { - books = ""; - for(i=0; i < questid.length; i++) { - if(cm.isQuestCompleted(questid[i])) { - counter += 1; - books += "\r\n#v"+questitem[i]+"# #b#t"+questitem[i]+"##k"; - } - } - if(counter == 0) - counter = 99; - } - if(counter == 99) { - cm.sendOk("#b#h ##k has not returned a single storybook yet."); - cm.dispose(); - } else { - cm.sendNext("Let's see.. #b#h ##k have returned a total of #b"+counter+"#k books. The list of returned books is as follows:"+books); - } - } else if (status == 1) { - cm.sendNextPrev("The library is settling down now thanks chiefly to you, #b#h ##k's immense help. If the story gets mixed up once again, then I'll be counting on you to fix it once more."); - } else if (status == 2) { - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + if (counter == 0) { + books = ""; + for (i = 0; i < questid.length; i++) { + if (cm.isQuestCompleted(questid[i])) { + counter += 1; + books += "\r\n#v" + questitem[i] + "# #b#t" + questitem[i] + "##k"; + } + } + if (counter == 0) { + counter = 99; + } + } + if (counter == 99) { + cm.sendOk("#b#h ##k has not returned a single storybook yet."); + cm.dispose(); + } else { + cm.sendNext("Let's see.. #b#h ##k have returned a total of #b" + counter + "#k books. The list of returned books is as follows:" + books); + } + } else if (status == 1) { + cm.sendNextPrev("The library is settling down now thanks chiefly to you, #b#h ##k's immense help. If the story gets mixed up once again, then I'll be counting on you to fix it once more."); + } else if (status == 2) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2041000.js b/scripts/npc/2041000.js index 84b0be8e79..6fe6cc4f3a 100644 --- a/scripts/npc/2041000.js +++ b/scripts/npc/2041000.js @@ -1,31 +1,31 @@ function start() { - if(cm.haveItem(4031045)){ + if (cm.haveItem(4031045)) { var em = cm.getEventManager("Trains"); - if (em.getProperty("entry") == "true") + if (em.getProperty("entry") == "true") { cm.sendYesNo("Do you want to go to Orbis?"); - else{ + } else { cm.sendOk("The train to Orbis is already travelling, please be patient for the next one."); cm.dispose(); } - }else{ + } else { cm.sendOk("Make sure you got a Orbis ticket to travel in this train. Check your inventory."); cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); + cm.sendOk("Okay, talk to me if you change your mind!"); cm.dispose(); - return; - } - + return; + } + var em = cm.getEventManager("Trains"); if (em.getProperty("entry") == "true") { cm.warp(220000111); cm.gainItem(4031045, -1); cm.dispose(); - } - else { + } else { cm.sendOk("The train to Orbis is ready to take off, please be patient for the next one."); cm.dispose(); } diff --git a/scripts/npc/2041001.js b/scripts/npc/2041001.js index b5fe8f7adf..fba9aaf518 100644 --- a/scripts/npc/2041001.js +++ b/scripts/npc/2041001.js @@ -20,8 +20,8 @@ along with this program. If not, see . */ /** -Rosey (On Train) 2041001 -**/ + Rosey (On Train) 2041001 + **/ var status = 0; @@ -38,13 +38,15 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); + cm.sendNext("Alright, see you next time. Take care."); status++; } else if (status == 2) { - if (cm.getPlayer().getMapId() == 200000122) - cm.warp(200000121, 0);// back to orbis - else - cm.warp(220000110,0);// back to Ludi + if (cm.getPlayer().getMapId() == 200000122) { + cm.warp(200000121, 0); + }// back to orbis + else { + cm.warp(220000110, 0); + }// back to Ludi cm.dispose(); } } diff --git a/scripts/npc/2041007.js b/scripts/npc/2041007.js index 05a22869a6..f6dd66f17b 100644 --- a/scripts/npc/2041007.js +++ b/scripts/npc/2041007.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Welcome, welcome, welcome to the Ludibrium Hair Salon! Do you, by any chance, have a #b#t5150007##k or a #b#t5151007##k? If so, how about letting me take care of your hair? Please choose what you want to do with it...\r\n#L1#Haircut: #i5150007##t5150007##l\r\n#L2#Dye your hair: #i5151007##t5151007##l"); } else if (status == 1) { @@ -58,33 +59,32 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { - pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); + for (var i = 0; i < mhair_v.length; i++) { + pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) { - pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); + for (var i = 0; i < fhair_v.length; i++) { + pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } cm.sendStyle("I can completely change the look of your hair. Aren't you ready for a change? With #b#t5150007##k, I'll take care of the rest for you. Choose the style of your liking!", hairnew); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendStyle("I can completely change the color of your hair. Aren't you ready for a change? With #b#t5151007##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420005)){ + if (beauty == 1) { + if (cm.haveItem(5420005)) { cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150007) == true){ + } else if (cm.haveItem(5150007) == true) { cm.gainItem(5150007, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -92,8 +92,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151007) == true){ + if (beauty == 2) { + if (cm.haveItem(5151007) == true) { cm.gainItem(5151007, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -101,7 +101,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150007, 1); diff --git a/scripts/npc/2041008.js b/scripts/npc/2041008.js index 0b478a6abf..c75eecf2af 100644 --- a/scripts/npc/2041008.js +++ b/scripts/npc/2041008.js @@ -20,14 +20,14 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Seppy - Ludibrium : Ludibrium (220000000) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Seppy - Ludibrium : Ludibrium (220000000) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ function start() { cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2041008); diff --git a/scripts/npc/2041009.js b/scripts/npc/2041009.js index 27a6284229..0572a89ab1 100644 --- a/scripts/npc/2041009.js +++ b/scripts/npc/2041009.js @@ -49,10 +49,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hi, I'm the assistant here. Don't worry, I'm plenty good enough for this. If you have #b#t5150006##k, #b#t5150012##k or #b#t5151006##k by any chance, then allow me to take care of the rest, alright?\r\n#L0#Haircut: #i5150006##t5150006##l\r\n#L1#Haircut: #i5150012##t5150012##l\r\n#L2#Dye your hair: #i5151006##t5151006##l"); } else if (status == 1) { @@ -60,12 +61,12 @@ function action(mode, type, selection) { beauty = 3; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_r.length; i++) { - pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + for (var i = 0; i < mhair_r.length; i++) { + pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_r.length; i++) { + for (var i = 0; i < fhair_r.length; i++) { pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } } @@ -74,12 +75,12 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_e.length; i++) { - pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); + for (var i = 0; i < mhair_e.length; i++) { + pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_e.length; i++) { + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } @@ -87,40 +88,39 @@ function action(mode, type, selection) { } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5151006##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150012)){ + if (beauty == 1) { + if (cm.haveItem(5150012)) { cm.gainItem(5150012, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } - } else if (beauty == 2){ - if (cm.haveItem(5151006)){ + } else if (beauty == 2) { + if (cm.haveItem(5151006)) { cm.gainItem(5151006, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } - } else if (beauty == 3){ - if (cm.haveItem(5150006)){ + } else if (beauty == 3) { + if (cm.haveItem(5150006)) { cm.gainItem(5150006, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150012, 1); diff --git a/scripts/npc/2041010.js b/scripts/npc/2041010.js index 3e54e6bd5e..1da9cda48c 100644 --- a/scripts/npc/2041010.js +++ b/scripts/npc/2041010.js @@ -46,24 +46,25 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well, hello! Welcome to the Ludibrium Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152007##k, you can let us take care of the rest and have the face you've always wanted~!\r\n#L2#Plastic Surgery: #i5152007##t5152007##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) { + for (var i = 0; i < mface_v.length; i++) { pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) { + for (var i = 0; i < fface_v.length; i++) { pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -71,10 +72,9 @@ function action(mode, type, selection) { } cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152007##k, you can get the face of your liking. Take your time in choosing the face of your preference.", facenew); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5152007)){ + if (cm.haveItem(5152007)) { cm.gainItem(5152007, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); diff --git a/scripts/npc/2041013.js b/scripts/npc/2041013.js index 16f85921dd..b0e8337d61 100644 --- a/scripts/npc/2041013.js +++ b/scripts/npc/2041013.js @@ -24,34 +24,34 @@ var price = 1000000; var skin = Array(0, 1, 2, 3, 4); function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendSimple("Oh, hello! Welcome to the Ludibrium Skin-Care! Are you interested in getting tanned and looking sexy? How about a beautiful, snow-white skin? If you have #b#t5153002##k, you can let us take care of the rest and have the kind of skin you've always dreamed of!\r\n#L2#Skin Care: #i5153002##t5153002##l"); - } else if (status == 1) { - if (selection == 2) { - cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); - } - } - else if (status == 2){ - cm.dispose(); - if (cm.haveItem(5153002) == true){ - cm.gainItem(5153002, -1); - cm.setSkin(skin[selection]); - cm.sendOk("Enjoy your new and improved skin!"); - } else { - cm.sendOk("Um...you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); - } - } - } + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendSimple("Oh, hello! Welcome to the Ludibrium Skin-Care! Are you interested in getting tanned and looking sexy? How about a beautiful, snow-white skin? If you have #b#t5153002##k, you can let us take care of the rest and have the kind of skin you've always dreamed of!\r\n#L2#Skin Care: #i5153002##t5153002##l"); + } else if (status == 1) { + if (selection == 2) { + cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); + } + } else if (status == 2) { + cm.dispose(); + if (cm.haveItem(5153002) == true) { + cm.gainItem(5153002, -1); + cm.setSkin(skin[selection]); + cm.sendOk("Enjoy your new and improved skin!"); + } else { + cm.sendOk("Um...you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); + } + } + } } diff --git a/scripts/npc/2041023.js b/scripts/npc/2041023.js index 4c664b85ae..67078a962e 100644 --- a/scripts/npc/2041023.js +++ b/scripts/npc/2041023.js @@ -26,76 +26,76 @@ * @npc: Flo * @map: Ludibrium - Path of Time (220050300) * @func: Elemental Thanatos room -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if(!(cm.isQuestCompleted(6316) && (cm.isQuestStarted(6225) || cm.isQuestStarted(6315)))) { - cm.sendOk("You seems to have no reason to meet element-based Thanatos."); - cm.dispose(); - return; - } - - em = cm.getEventManager("ElementalBattle"); - if(em == null) { - cm.sendOk("The Elemental Battle has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou are looking for Elemental Thanatos, right? If you team up with another mage, with the opposite elemental affinity as yours, you guys will be able to overcome them. As a leader, talk to me when you feel ready to go.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\n Team up with another mage with #rdifferent elemental affinity#k before entering the stage. This team aspect is crucial to overcome the elementals inside."); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!(cm.isQuestCompleted(6316) && (cm.isQuestStarted(6225) || cm.isQuestStarted(6315)))) { + cm.sendOk("You seems to have no reason to meet element-based Thanatos."); + cm.dispose(); + return; + } + + em = cm.getEventManager("ElementalBattle"); + if (em == null) { + cm.sendOk("The Elemental Battle has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou are looking for Elemental Thanatos, right? If you team up with another mage, with the opposite elemental affinity as yours, you guys will be able to overcome them. As a leader, talk to me when you feel ready to go.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\n Team up with another mage with #rdifferent elemental affinity#k before entering the stage. This team aspect is crucial to overcome the elementals inside."); + cm.dispose(); + } + } + } } diff --git a/scripts/npc/2041024.js b/scripts/npc/2041024.js index a71412356e..3a6b800c0b 100644 --- a/scripts/npc/2041024.js +++ b/scripts/npc/2041024.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("For those capable of great feats and bearers of an unwavering resolve, the #bfinal destination#k lies ahead past the gate. The Machine Room accepts only #rone party at a time#k, so make sure your party is ready when crossing the gate."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("For those capable of great feats and bearers of an unwavering resolve, the #bfinal destination#k lies ahead past the gate. The Machine Room accepts only #rone party at a time#k, so make sure your party is ready when crossing the gate."); + cm.dispose(); + } + } } diff --git a/scripts/npc/2041025.js b/scripts/npc/2041025.js index 302df98bca..4451701e46 100644 --- a/scripts/npc/2041025.js +++ b/scripts/npc/2041025.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* * @Author: Moogra */ @@ -28,7 +29,8 @@ function start() { } function action(mode, type, selection) { - if (mode > 0) + if (mode > 0) { cm.warp(220080000); + } cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2041026.js b/scripts/npc/2041026.js index 15546c86cb..124f3e9458 100644 --- a/scripts/npc/2041026.js +++ b/scripts/npc/2041026.js @@ -21,36 +21,37 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.haveItem(4220046, 1)) { - // quest completing here when "forfeiting Timer's Egg", as well as reporting missing quests on M. Shrine are thanks to drmdsr & Thora - - cm.gainItem(4220046, -1); - cm.sendOk("You want to hand the #r#t4220046##k to me, right? Alright, I'll take it for you."); - } else { - cm.sendOk("Hello there! I'm #b#p2041026##k, in charge of watching and reporting any paranormal activities in this area."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.haveItem(4220046, 1)) { + // quest completing here when "forfeiting Timer's Egg", as well as reporting missing quests on M. Shrine are thanks to drmdsr & Thora + + cm.gainItem(4220046, -1); + cm.sendOk("You want to hand the #r#t4220046##k to me, right? Alright, I'll take it for you."); + } else { + cm.sendOk("Hello there! I'm #b#p2041026##k, in charge of watching and reporting any paranormal activities in this area."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2042000.js b/scripts/npc/2042000.js index 72217204bd..0cffaa8bb2 100644 --- a/scripts/npc/2042000.js +++ b/scripts/npc/2042000.js @@ -1,11 +1,11 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Ronan (HeavenMS) - 3.0 - Third Version by Jayd - translated CPQ contents to English and added Pirate items - Special thanks to 頼晏 (ryantpayton) for also stepping in to translate CPQ scripts. ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Ronan (HeavenMS) + 3.0 - Third Version by Jayd - translated CPQ contents to English and added Pirate items + Special thanks to 頼晏 (ryantpayton) for also stepping in to translate CPQ scripts. + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var rnk = -1; @@ -39,10 +39,10 @@ function start() { cm.sendOk("The Monster Carnival is currently unavailable."); cm.dispose(); } - + return; } - + action(1, 0, 0); } @@ -54,10 +54,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } const YamlConfig = Java.type('config.YamlConfig'); if (cm.getPlayer().getMapId() == 980000010) { @@ -248,15 +249,15 @@ function action(mode, type, selection) { cm.getChar().saveLocation("MONSTER_CARNIVAL"); cm.warp(980000000, 0); cm.dispose(); - return; + } else if (cm.getLevel() < 30) { cm.sendOk("You must be at least level 30 to participate in the Monster Carnival. Talk to me when you're strong enough."); cm.dispose(); - return; + } else { cm.sendOk("I'm sorry, but only players of level 30 ~ 50 can participate in the Monster Carnival."); cm.dispose(); - return; + } } else if (selection == 1) { status = 60; @@ -267,24 +268,24 @@ function action(mode, type, selection) { cm.getChar().saveLocation("MONSTER_CARNIVAL"); cm.warp(980030000, 0); cm.dispose(); - return; + } else if (selection == 4) { var selStr = "Very well, instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b"; - var options = new Array("Refine mineral ores","Refine jewel ores"); - if(refineCrystals) { + var options = ["Refine mineral ores", "Refine jewel ores"]; + if (refineCrystals) { options.push("Refine crystal ores"); } - if(refineRocks) { + if (refineRocks) { options.push("Refine plates/jewels"); } - for (var i = 0; i < options.length; i++){ + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); - + status = 76; } } else if (status == 2) { @@ -327,8 +328,8 @@ function action(mode, type, selection) { if (selection == 12) { cm.sendSimple("Select the weapon you would like to trade. The weapons I have here are extremely useful. Take a look! \r\n#b#L0# #z1322015# (" + n3 + " coins)#l\r\n#L1# #z1422008# (" + n3 + " coins)#l\r\n#L2# #z1322016# (" + n4 + " coins)#l\r\n#L3# #z1422007# (" + n4 + " coins)#l\r\n#L4# #z1322017# (" + n5 + " coins)#l\r\n#L5# #z1422005# (" + n5 + " coins)#l\r\n#L6# #z1432003# (" + n3 + " coins)#l\r\n#L7# #z1442003# (" + n3 + " coins)#l\r\n#L8# #z1432005# (" + n4 + " coins)#l\r\n#L9# #z1442009# (" + n4 + " coins)#l\r\n#L10# #z1442005# (" + n5 + " coins)#l\r\n#L11# #z1432004# (" + n5 + " coins)#l\r\n#L12# Back to the first page (2/2)#l"); } else { - var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003); - var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5); + var item = [1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003]; + var cost = [n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -343,8 +344,8 @@ function action(mode, type, selection) { status = 10; cm.sendSimple("Please make sure you have #b#t4001129##k for the weapon you want. Select the weapon you would like to trade #t4001129#. The choices I have are really good, and I'm not the one who speaks to the people who say it! \r\n#b#L0# #z1302004# (" + n3 + " coins)#l\r\n#L1# #z1402006# (" + n3 + " coins)#l\r\n#L2# #z1302009# (" + n4 + " coins)#l\r\n#L3# #z1402007# (" + n4 + " coins)#l\r\n#L4# #z1302010# (" + n5 + " coins)#l\r\n#L5# #z1402003# (" + n5 + " coins)#l\r\n#L6# #z1312006# (" + n3 + " coins)#l\r\n#L7# #z1412004# (" + n3 + " coins)#l\r\n#L8# #z1312007# (" + n4 + " coins)#l\r\n#L9# #z1412005# (" + n4 + " coins)#l\r\n#L10# #z1312008# (" + n5 + " coins)#l\r\n#L11# #z1412003# (" + n5 + " coins)#l\r\n#L12# Continue to the next page(1/2)#l"); } else { - var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004); - var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5); + var item = [1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004]; + var cost = [n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -355,8 +356,8 @@ function action(mode, type, selection) { } } } else if (status == 21) { - var item = new Array(1372001, 1382018, 1372012, 1382019, 1382001, 1372007); - var cost = new Array(n3, n3, n4, n4, n5, n5); + var item = [1372001, 1382018, 1372012, 1382019, 1382001, 1372007]; + var cost = [n3, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -366,8 +367,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 31) { - var item = new Array(1452006, 1452007, 1452008, 1462005, 1462006, 1462007); - var cost = new Array(n3, n4, n5, n3, n4, n5); + var item = [1452006, 1452007, 1452008, 1462005, 1462006, 1462007]; + var cost = [n3, n4, n5, n3, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -377,8 +378,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 41) { - var item = new Array(1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003); - var cost = new Array(n3, n4, n5, n3, n4, n4, n5, n5); + var item = [1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003]; + var cost = [n3, n4, n5, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -388,8 +389,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 51) { - var item = new Array(1482005, 1482006, 1482007, 1492005, 1492006, 1492007); - var cost = new Array(n3, n4, n5, n3, n4, n5); + var item = [1482005, 1482006, 1482007, 1492005, 1492006, 1492007]; + var cost = [n3, n4, n5, n3, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -457,7 +458,7 @@ function action(mode, type, selection) { allDone = refineRockItems(); // moon/star rock } - if(allDone) { + if (allDone) { cm.sendOk("Done. Thanks for showing up~."); } else { cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee."); @@ -473,31 +474,31 @@ function getRefineFee(fee) { } function isRefineTarget(refineType, refineItemid) { - if(refineType == 0) { //mineral refine + if (refineType == 0) { //mineral refine return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials); - } else if(refineType == 1) { //jewel refine + } else if (refineType == 1) { //jewel refine return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials); - } else if(refineType == 2) { //crystal refine + } else if (refineType == 2) { //crystal refine return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials); } - + return false; } function getRockRefineTarget(refineItemid) { - if(refineItemid >= 4011000 && refineItemid <= 4011006) { + if (refineItemid >= 4011000 && refineItemid <= 4011006) { return 0; - } else if(refineItemid >= 4021000 && refineItemid <= 4021008) { + } else if (refineItemid >= 4021000 && refineItemid <= 4021008) { return 1; } - + return -1; } function refineItems(refineType) { var allDone = true; - - var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]]; + + var refineFees = [[300, 300, 300, 500, 500, 500, 800, 270], [500, 500, 500, 500, 500, 500, 500, 1000, 3000], [5000, 5000, 5000, 5000, 1000000]]; var itemCount = {}; const InventoryType = Java.type('client.inventory.InventoryType'); @@ -506,35 +507,37 @@ function refineItems(refineType) { var it = iter.next(); var itemid = it.getItemId(); - if(isRefineTarget(refineType, itemid)) { + if (isRefineTarget(refineType, itemid)) { var ic = itemCount[itemid]; - - if(ic != undefined) { + + if (ic != undefined) { itemCount[itemid] += it.getQuantity(); } else { itemCount[itemid] = it.getQuantity(); } } } - - for(var key in itemCount) { + + for (var key in itemCount) { var itemqty = itemCount[key]; var itemid = parseInt(key); - + var refineQty = ((itemqty / 10) | 0); - if(refineQty <= 0) continue; - - while(true) { + if (refineQty <= 0) { + continue; + } + + while (true) { itemqty = refineQty * 10; - + var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty); - if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) { + if (cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) { cm.gainMeso(-fee); cm.gainItem(itemid, -itemqty); cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty); - + break; - } else if(refineQty <= 1) { + } else if (refineQty <= 1) { allDone = false; break; } else { @@ -542,7 +545,7 @@ function refineItems(refineType) { } } } - + return allDone; } @@ -550,7 +553,7 @@ function refineRockItems() { var allDone = true; var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]]; var minRocks = [2147483647, 2147483647]; - + var rockItems = [4011007, 4021009]; var rockFees = [10000, 15000]; @@ -560,43 +563,45 @@ function refineRockItems() { var it = iter.next(); var itemid = it.getItemId(); var rockRefine = getRockRefineTarget(itemid); - if(rockRefine >= 0) { + if (rockRefine >= 0) { var rockItem = ((itemid % 100) | 0); var itemqty = it.getQuantity(); - + minItems[rockRefine][rockItem] += itemqty; } } - - for(var i = 0; i < minRocks.length; i++) { - for(var j = 0; j < minItems[i].length; j++) { - if(minRocks[i] > minItems[i][j]) { + + for (var i = 0; i < minRocks.length; i++) { + for (var j = 0; j < minItems[i].length; j++) { + if (minRocks[i] > minItems[i][j]) { minRocks[i] = minItems[i][j]; } } - if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue; - + if (minRocks[i] <= 0 || minRocks[i] == 2147483647) { + continue; + } + var refineQty = minRocks[i]; - while(true) { + while (true) { var fee = getRefineFee(rockFees[i] * refineQty); - if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) { + if (cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) { cm.gainMeso(-fee); var j; - if(i == 0) { - for(j = 4011000; j < 4011007; j++) { + if (i == 0) { + for (j = 4011000; j < 4011007; j++) { cm.gainItem(j, -refineQty); } cm.gainItem(j, refineQty); } else { - for(j = 4021000; j < 4021009; j++) { + for (j = 4021000; j < 4021009; j++) { cm.gainItem(j, -refineQty); } cm.gainItem(j, refineQty); } - + break; - } else if(refineQty <= 1) { + } else if (refineQty <= 1) { allDone = false; break; } else { @@ -604,6 +609,6 @@ function refineRockItems() { } } } - + return allDone; } diff --git a/scripts/npc/2042001.js b/scripts/npc/2042001.js index 009f62b8fa..b0933ee1e2 100644 --- a/scripts/npc/2042001.js +++ b/scripts/npc/2042001.js @@ -1,10 +1,10 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Ronan (HeavenMS) - 3.0 - Third Version by Jayd - translated CPQ contents to English and added Pirate items ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Ronan (HeavenMS) + 3.0 - Third Version by Jayd - translated CPQ contents to English and added Pirate items + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var rnk = -1; @@ -38,10 +38,10 @@ function start() { cm.sendOk("The Monster Carnival is currently unavailable."); cm.dispose(); } - + return; } - + action(1, 0, 0); } @@ -53,10 +53,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } const YamlConfig = Java.type('config.YamlConfig'); if (cm.getPlayer().getMapId() == 980000010) { @@ -247,15 +248,15 @@ function action(mode, type, selection) { cm.getChar().saveLocation("MONSTER_CARNIVAL"); cm.warp(980000000, 0); cm.dispose(); - return; + } else if (cm.getLevel() < 30) { cm.sendOk("You must be at least level 30 to participate in the Monster Carnival. Talk to me when you're strong enough."); cm.dispose(); - return; + } else { cm.sendOk("I'm sorry, but only players of level 30 ~ 50 can participate in the Monster Carnival."); cm.dispose(); - return; + } } else if (selection == 1) { status = 60; @@ -266,24 +267,24 @@ function action(mode, type, selection) { cm.getChar().saveLocation("MONSTER_CARNIVAL"); cm.warp(980030000, 0); cm.dispose(); - return; + } else if (selection == 4) { var selStr = "Very well, instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b"; - var options = new Array("Refine mineral ores","Refine jewel ores"); - if(refineCrystals) { + var options = ["Refine mineral ores", "Refine jewel ores"]; + if (refineCrystals) { options.push("Refine crystal ores"); } - if(refineRocks) { + if (refineRocks) { options.push("Refine plates/jewels"); } - for (var i = 0; i < options.length; i++){ + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); - + status = 76; } } else if (status == 2) { @@ -326,8 +327,8 @@ function action(mode, type, selection) { if (selection == 12) { cm.sendSimple("Select the weapon you would like to trade. The weapons I have here are extremely useful. Take a look! \r\n#b#L0# #z1322015# (" + n3 + " coins)#l\r\n#L1# #z1422008# (" + n3 + " coins)#l\r\n#L2# #z1322016# (" + n4 + " coins)#l\r\n#L3# #z1422007# (" + n4 + " coins)#l\r\n#L4# #z1322017# (" + n5 + " coins)#l\r\n#L5# #z1422005# (" + n5 + " coins)#l\r\n#L6# #z1432003# (" + n3 + " coins)#l\r\n#L7# #z1442003# (" + n3 + " coins)#l\r\n#L8# #z1432005# (" + n4 + " coins)#l\r\n#L9# #z1442009# (" + n4 + " coins)#l\r\n#L10# #z1442005# (" + n5 + " coins)#l\r\n#L11# #z1432004# (" + n5 + " coins)#l\r\n#L12# Back to the first page (2/2)#l"); } else { - var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003); - var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5); + var item = [1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003]; + var cost = [n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -342,8 +343,8 @@ function action(mode, type, selection) { status = 10; cm.sendSimple("Please make sure you have #b#t4001129##k for the weapon you want. Select the weapon you would like to trade #t4001129#. The choices I have are really good, and I'm not the one who speaks to the people who say it! \r\n#b#L0# #z1302004# (" + n3 + " coins)#l\r\n#L1# #z1402006# (" + n3 + " coins)#l\r\n#L2# #z1302009# (" + n4 + " coins)#l\r\n#L3# #z1402007# (" + n4 + " coins)#l\r\n#L4# #z1302010# (" + n5 + " coins)#l\r\n#L5# #z1402003# (" + n5 + " coins)#l\r\n#L6# #z1312006# (" + n3 + " coins)#l\r\n#L7# #z1412004# (" + n3 + " coins)#l\r\n#L8# #z1312007# (" + n4 + " coins)#l\r\n#L9# #z1412005# (" + n4 + " coins)#l\r\n#L10# #z1312008# (" + n5 + " coins)#l\r\n#L11# #z1412003# (" + n5 + " coins)#l\r\n#L12# Continue to the next page(1/2)#l"); } else { - var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004); - var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5); + var item = [1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004]; + var cost = [n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -354,8 +355,8 @@ function action(mode, type, selection) { } } } else if (status == 21) { - var item = new Array(1372001, 1382018, 1372012, 1382019, 1382001, 1372007); - var cost = new Array(n3, n3, n4, n4, n5, n5); + var item = [1372001, 1382018, 1372012, 1382019, 1382001, 1372007]; + var cost = [n3, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -365,8 +366,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 31) { - var item = new Array(1452006, 1452007, 1452008, 1462005, 1462006, 1462007); - var cost = new Array(n3, n4, n5, n3, n4, n5); + var item = [1452006, 1452007, 1452008, 1462005, 1462006, 1462007]; + var cost = [n3, n4, n5, n3, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -376,8 +377,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 41) { - var item = new Array(1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003); - var cost = new Array(n3, n4, n5, n3, n4, n4, n5, n5); + var item = [1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003]; + var cost = [n3, n4, n5, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -387,8 +388,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 51) { - var item = new Array(1482005, 1482006, 1482007, 1492005, 1492006, 1492007); - var cost = new Array(n3, n4, n5, n3, n4, n5); + var item = [1482005, 1482006, 1482007, 1492005, 1492006, 1492007]; + var cost = [n3, n4, n5, n3, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -456,7 +457,7 @@ function action(mode, type, selection) { allDone = refineRockItems(); // moon/star rock } - if(allDone) { + if (allDone) { cm.sendOk("Done. Thanks for showing up~."); } else { cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee."); @@ -472,31 +473,31 @@ function getRefineFee(fee) { } function isRefineTarget(refineType, refineItemid) { - if(refineType == 0) { //mineral refine + if (refineType == 0) { //mineral refine return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials); - } else if(refineType == 1) { //jewel refine + } else if (refineType == 1) { //jewel refine return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials); - } else if(refineType == 2) { //crystal refine + } else if (refineType == 2) { //crystal refine return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials); } - + return false; } function getRockRefineTarget(refineItemid) { - if(refineItemid >= 4011000 && refineItemid <= 4011006) { + if (refineItemid >= 4011000 && refineItemid <= 4011006) { return 0; - } else if(refineItemid >= 4021000 && refineItemid <= 4021008) { + } else if (refineItemid >= 4021000 && refineItemid <= 4021008) { return 1; } - + return -1; } function refineItems(refineType) { var allDone = true; - - var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]]; + + var refineFees = [[300, 300, 300, 500, 500, 500, 800, 270], [500, 500, 500, 500, 500, 500, 500, 1000, 3000], [5000, 5000, 5000, 5000, 1000000]]; var itemCount = {}; const InventoryType = Java.type('client.inventory.InventoryType'); @@ -505,35 +506,37 @@ function refineItems(refineType) { var it = iter.next(); var itemid = it.getItemId(); - if(isRefineTarget(refineType, itemid)) { + if (isRefineTarget(refineType, itemid)) { var ic = itemCount[itemid]; - - if(ic != undefined) { + + if (ic != undefined) { itemCount[itemid] += it.getQuantity(); } else { itemCount[itemid] = it.getQuantity(); } } } - - for(var key in itemCount) { + + for (var key in itemCount) { var itemqty = itemCount[key]; var itemid = parseInt(key); - + var refineQty = ((itemqty / 10) | 0); - if(refineQty <= 0) continue; - - while(true) { + if (refineQty <= 0) { + continue; + } + + while (true) { itemqty = refineQty * 10; - + var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty); - if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) { + if (cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) { cm.gainMeso(-fee); cm.gainItem(itemid, -itemqty); cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty); - + break; - } else if(refineQty <= 1) { + } else if (refineQty <= 1) { allDone = false; break; } else { @@ -541,7 +544,7 @@ function refineItems(refineType) { } } } - + return allDone; } @@ -549,7 +552,7 @@ function refineRockItems() { var allDone = true; var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]]; var minRocks = [2147483647, 2147483647]; - + var rockItems = [4011007, 4021009]; var rockFees = [10000, 15000]; @@ -559,43 +562,45 @@ function refineRockItems() { var it = iter.next(); var itemid = it.getItemId(); var rockRefine = getRockRefineTarget(itemid); - if(rockRefine >= 0) { + if (rockRefine >= 0) { var rockItem = ((itemid % 100) | 0); var itemqty = it.getQuantity(); - + minItems[rockRefine][rockItem] += itemqty; } } - - for(var i = 0; i < minRocks.length; i++) { - for(var j = 0; j < minItems[i].length; j++) { - if(minRocks[i] > minItems[i][j]) { + + for (var i = 0; i < minRocks.length; i++) { + for (var j = 0; j < minItems[i].length; j++) { + if (minRocks[i] > minItems[i][j]) { minRocks[i] = minItems[i][j]; } } - if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue; - + if (minRocks[i] <= 0 || minRocks[i] == 2147483647) { + continue; + } + var refineQty = minRocks[i]; - while(true) { + while (true) { var fee = getRefineFee(rockFees[i] * refineQty); - if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) { + if (cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) { cm.gainMeso(-fee); var j; - if(i == 0) { - for(j = 4011000; j < 4011007; j++) { + if (i == 0) { + for (j = 4011000; j < 4011007; j++) { cm.gainItem(j, -refineQty); } cm.gainItem(j, refineQty); } else { - for(j = 4021000; j < 4021009; j++) { + for (j = 4021000; j < 4021009; j++) { cm.gainItem(j, -refineQty); } cm.gainItem(j, refineQty); } - + break; - } else if(refineQty <= 1) { + } else if (refineQty <= 1) { allDone = false; break; } else { @@ -603,6 +608,6 @@ function refineRockItems() { } } } - + return allDone; } diff --git a/scripts/npc/2042002.js b/scripts/npc/2042002.js index 54df3fe8fc..18ac7309e8 100644 --- a/scripts/npc/2042002.js +++ b/scripts/npc/2042002.js @@ -1,10 +1,10 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Ronan (HeavenMS) - 3.0 - Third Version by Jayd - translated CPQ contents to English and added Pirate items ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Ronan (HeavenMS) + 3.0 - Third Version by Jayd - translated CPQ contents to English and added Pirate items + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var rnk = -1; @@ -28,7 +28,7 @@ var feeMultiplier = 7.0; function start() { status = -1; - + const YamlConfig = Java.type('config.YamlConfig'); if (!YamlConfig.config.server.USE_CPQ) { if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { @@ -38,10 +38,10 @@ function start() { cm.sendOk("The Monster Carnival is currently unavailable."); cm.dispose(); } - + return; } - + action(1, 0, 0); } @@ -53,11 +53,12 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + if (cm.getPlayer().getMapId() == 980000010) { if (status == 0) { cm.sendNext("I hope you had fun at the Monster Carnival!"); @@ -248,15 +249,15 @@ function action(mode, type, selection) { cm.getChar().saveLocation("MONSTER_CARNIVAL"); cm.warp(980000000, 0); cm.dispose(); - return; + } else if (cm.getLevel() < 30) { cm.sendOk("You must be at least level 30 to participate in the Monster Carnival. Talk to me when you're strong enough."); cm.dispose(); - return; + } else { cm.sendOk("I'm sorry, but only players of level 30 ~ 50 can participate in the Monster Carnival."); cm.dispose(); - return; + } } else if (selection == 1) { status = 60; @@ -267,24 +268,24 @@ function action(mode, type, selection) { cm.getChar().saveLocation("MONSTER_CARNIVAL"); cm.warp(980030000, 0); cm.dispose(); - return; + } else if (selection == 4) { var selStr = "Very well, instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b"; - var options = new Array("Refine mineral ores","Refine jewel ores"); - if(refineCrystals) { + var options = ["Refine mineral ores", "Refine jewel ores"]; + if (refineCrystals) { options.push("Refine crystal ores"); } - if(refineRocks) { + if (refineRocks) { options.push("Refine plates/jewels"); } - for (var i = 0; i < options.length; i++){ + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); - + status = 76; } } else if (status == 2) { @@ -327,8 +328,8 @@ function action(mode, type, selection) { if (selection == 12) { cm.sendSimple("Select the weapon you would like to trade. The weapons I have here are extremely useful. Take a look! \r\n#b#L0# #z1322015# (" + n3 + " coins)#l\r\n#L1# #z1422008# (" + n3 + " coins)#l\r\n#L2# #z1322016# (" + n4 + " coins)#l\r\n#L3# #z1422007# (" + n4 + " coins)#l\r\n#L4# #z1322017# (" + n5 + " coins)#l\r\n#L5# #z1422005# (" + n5 + " coins)#l\r\n#L6# #z1432003# (" + n3 + " coins)#l\r\n#L7# #z1442003# (" + n3 + " coins)#l\r\n#L8# #z1432005# (" + n4 + " coins)#l\r\n#L9# #z1442009# (" + n4 + " coins)#l\r\n#L10# #z1442005# (" + n5 + " coins)#l\r\n#L11# #z1432004# (" + n5 + " coins)#l\r\n#L12# Back to the first page (2/2)#l"); } else { - var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003); - var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5); + var item = [1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003]; + var cost = [n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -343,8 +344,8 @@ function action(mode, type, selection) { status = 10; cm.sendSimple("Please make sure you have #b#t4001129##k for the weapon you want. Select the weapon you would like to trade #t4001129#. The choices I have are really good, and I'm not the one who speaks to the people who say it! \r\n#b#L0# #z1302004# (" + n3 + " coins)#l\r\n#L1# #z1402006# (" + n3 + " coins)#l\r\n#L2# #z1302009# (" + n4 + " coins)#l\r\n#L3# #z1402007# (" + n4 + " coins)#l\r\n#L4# #z1302010# (" + n5 + " coins)#l\r\n#L5# #z1402003# (" + n5 + " coins)#l\r\n#L6# #z1312006# (" + n3 + " coins)#l\r\n#L7# #z1412004# (" + n3 + " coins)#l\r\n#L8# #z1312007# (" + n4 + " coins)#l\r\n#L9# #z1412005# (" + n4 + " coins)#l\r\n#L10# #z1312008# (" + n5 + " coins)#l\r\n#L11# #z1412003# (" + n5 + " coins)#l\r\n#L12# Continue to the next page(1/2)#l"); } else { - var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004); - var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5); + var item = [1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004]; + var cost = [n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -355,8 +356,8 @@ function action(mode, type, selection) { } } } else if (status == 21) { - var item = new Array(1372001, 1382018, 1372012, 1382019, 1382001, 1372007); - var cost = new Array(n3, n3, n4, n4, n5, n5); + var item = [1372001, 1382018, 1372012, 1382019, 1382001, 1372007]; + var cost = [n3, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -366,8 +367,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 31) { - var item = new Array(1452006, 1452007, 1452008, 1462005, 1462006, 1462007); - var cost = new Array(n3, n4, n5, n3, n4, n5); + var item = [1452006, 1452007, 1452008, 1462005, 1462006, 1462007]; + var cost = [n3, n4, n5, n3, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -377,8 +378,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 41) { - var item = new Array(1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003); - var cost = new Array(n3, n4, n5, n3, n4, n4, n5, n5); + var item = [1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003]; + var cost = [n3, n4, n5, n3, n4, n4, n5, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -388,8 +389,8 @@ function action(mode, type, selection) { cm.dispose(); } } else if (status == 51) { - var item = new Array(1482005, 1482006, 1482007, 1492005, 1492006, 1492007); - var cost = new Array(n3, n4, n5, n3, n4, n5); + var item = [1482005, 1482006, 1482007, 1492005, 1492006, 1492007]; + var cost = [n3, n4, n5, n3, n4, n5]; if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) { cm.gainItem(item[selection], 1); cm.gainItem(4001129, -cost[selection]); @@ -457,7 +458,7 @@ function action(mode, type, selection) { allDone = refineRockItems(); // moon/star rock } - if(allDone) { + if (allDone) { cm.sendOk("Done. Thanks for showing up~."); } else { cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee."); @@ -473,31 +474,31 @@ function getRefineFee(fee) { } function isRefineTarget(refineType, refineItemid) { - if(refineType == 0) { //mineral refine + if (refineType == 0) { //mineral refine return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials); - } else if(refineType == 1) { //jewel refine + } else if (refineType == 1) { //jewel refine return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials); - } else if(refineType == 2) { //crystal refine + } else if (refineType == 2) { //crystal refine return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials); } - + return false; } function getRockRefineTarget(refineItemid) { - if(refineItemid >= 4011000 && refineItemid <= 4011006) { + if (refineItemid >= 4011000 && refineItemid <= 4011006) { return 0; - } else if(refineItemid >= 4021000 && refineItemid <= 4021008) { + } else if (refineItemid >= 4021000 && refineItemid <= 4021008) { return 1; } - + return -1; } function refineItems(refineType) { var allDone = true; - - var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]]; + + var refineFees = [[300, 300, 300, 500, 500, 500, 800, 270], [500, 500, 500, 500, 500, 500, 500, 1000, 3000], [5000, 5000, 5000, 5000, 1000000]]; var itemCount = {}; const InventoryType = Java.type('client.inventory.InventoryType'); @@ -506,35 +507,37 @@ function refineItems(refineType) { var it = iter.next(); var itemid = it.getItemId(); - if(isRefineTarget(refineType, itemid)) { + if (isRefineTarget(refineType, itemid)) { var ic = itemCount[itemid]; - - if(ic != undefined) { + + if (ic != undefined) { itemCount[itemid] += it.getQuantity(); } else { itemCount[itemid] = it.getQuantity(); } } } - - for(var key in itemCount) { + + for (var key in itemCount) { var itemqty = itemCount[key]; var itemid = parseInt(key); - + var refineQty = ((itemqty / 10) | 0); - if(refineQty <= 0) continue; - - while(true) { + if (refineQty <= 0) { + continue; + } + + while (true) { itemqty = refineQty * 10; - + var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty); - if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) { + if (cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) { cm.gainMeso(-fee); cm.gainItem(itemid, -itemqty); cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty); - + break; - } else if(refineQty <= 1) { + } else if (refineQty <= 1) { allDone = false; break; } else { @@ -542,7 +545,7 @@ function refineItems(refineType) { } } } - + return allDone; } @@ -550,7 +553,7 @@ function refineRockItems() { var allDone = true; var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]]; var minRocks = [2147483647, 2147483647]; - + var rockItems = [4011007, 4021009]; var rockFees = [10000, 15000]; @@ -560,43 +563,45 @@ function refineRockItems() { var it = iter.next(); var itemid = it.getItemId(); var rockRefine = getRockRefineTarget(itemid); - if(rockRefine >= 0) { + if (rockRefine >= 0) { var rockItem = ((itemid % 100) | 0); var itemqty = it.getQuantity(); - + minItems[rockRefine][rockItem] += itemqty; } } - - for(var i = 0; i < minRocks.length; i++) { - for(var j = 0; j < minItems[i].length; j++) { - if(minRocks[i] > minItems[i][j]) { + + for (var i = 0; i < minRocks.length; i++) { + for (var j = 0; j < minItems[i].length; j++) { + if (minRocks[i] > minItems[i][j]) { minRocks[i] = minItems[i][j]; } } - if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue; - + if (minRocks[i] <= 0 || minRocks[i] == 2147483647) { + continue; + } + var refineQty = minRocks[i]; - while(true) { + while (true) { var fee = getRefineFee(rockFees[i] * refineQty); - if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) { + if (cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) { cm.gainMeso(-fee); var j; - if(i == 0) { - for(j = 4011000; j < 4011007; j++) { + if (i == 0) { + for (j = 4011000; j < 4011007; j++) { cm.gainItem(j, -refineQty); } cm.gainItem(j, refineQty); } else { - for(j = 4021000; j < 4021009; j++) { + for (j = 4021000; j < 4021009; j++) { cm.gainItem(j, -refineQty); } cm.gainItem(j, refineQty); } - + break; - } else if(refineQty <= 1) { + } else if (refineQty <= 1) { allDone = false; break; } else { @@ -604,6 +609,6 @@ function refineRockItems() { } } } - + return allDone; } diff --git a/scripts/npc/2042003.js b/scripts/npc/2042003.js index d9cf1d2b6e..d5e90466e0 100644 --- a/scripts/npc/2042003.js +++ b/scripts/npc/2042003.js @@ -15,10 +15,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.warpParty(980000000); cm.cancelCPQLobby(); diff --git a/scripts/npc/2042004.js b/scripts/npc/2042004.js index d9cf1d2b6e..d5e90466e0 100644 --- a/scripts/npc/2042004.js +++ b/scripts/npc/2042004.js @@ -15,10 +15,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.warpParty(980000000); cm.cancelCPQLobby(); diff --git a/scripts/npc/2042005.js b/scripts/npc/2042005.js index 61ea554dd1..a13b5c90f1 100644 --- a/scripts/npc/2042005.js +++ b/scripts/npc/2042005.js @@ -1,9 +1,9 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Jayd - translated CPQ contents to English ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Jayd - translated CPQ contents to English + --------------------------------------------------------------------------------------------------- + **/ var cpqMinLvl = 51; var cpqMaxLvl = 70; @@ -23,10 +23,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { if (cm.getParty() == null) { status = 10; @@ -43,7 +44,7 @@ function action(mode, type, selection) { for (var i = 0; i < party.size(); i++) { if (party.get(i).getLevel() >= cpqMinLvl && party.get(i).getLevel() <= cpqMaxLvl) { lvlOk++; - + if (party.get(i).getPlayer().getMapId() != leaderMapid) { isOutMap++; } @@ -78,9 +79,9 @@ function action(mode, type, selection) { } else { var party = cm.getParty().getMembers(); const YamlConfig = Java.type('config.YamlConfig'); - if ((selection === 0 || selection === 1 ) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { + if ((selection === 0 || selection === 1) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) { cm.sendOk("You need at least 2 players to participate in the battle!"); - } else if ((selection === 2 ) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { + } else if ((selection === 2) && party.size() < (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) { cm.sendOk("You need at least 3 players to participate in the battle!"); } else { cm.cpqLobby2(selection); diff --git a/scripts/npc/2042007.js b/scripts/npc/2042007.js index e47fbcc0af..1e2ed488f0 100644 --- a/scripts/npc/2042007.js +++ b/scripts/npc/2042007.js @@ -1,9 +1,9 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Jayd - translated CPQ contents to English ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Jayd - translated CPQ contents to English + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var rnk = -1; @@ -22,11 +22,12 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + if (cm.getPlayer().getMapId() == 980030010) { if (status == 0) { cm.sendNext("I hope you had fun at the Monster Carnival!"); diff --git a/scripts/npc/2042008.js b/scripts/npc/2042008.js index 3225fb385e..359245153e 100644 --- a/scripts/npc/2042008.js +++ b/scripts/npc/2042008.js @@ -15,10 +15,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.warpParty(980030000, 4); cm.cancelCPQLobby(); diff --git a/scripts/npc/2042009.js b/scripts/npc/2042009.js index 3225fb385e..359245153e 100644 --- a/scripts/npc/2042009.js +++ b/scripts/npc/2042009.js @@ -15,10 +15,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.warpParty(980030000, 4); cm.cancelCPQLobby(); diff --git a/scripts/npc/2043000.js b/scripts/npc/2043000.js index 08f557db18..6d069fc722 100644 --- a/scripts/npc/2043000.js +++ b/scripts/npc/2043000.js @@ -23,30 +23,31 @@ */ var status; - + function start() { // thanks iPunchEm for NPC visibility - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendNext("You don't belong to this world... Return now."); - } else if(status == 1) { - cm.warp(220080000); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendNext("You don't belong to this world... Return now."); + } else if (status == 1) { + cm.warp(220080000); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2050004.js b/scripts/npc/2050004.js index d266a7bbd1..a1453715f7 100644 --- a/scripts/npc/2050004.js +++ b/scripts/npc/2050004.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2050004); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2050004); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2050014.js b/scripts/npc/2050014.js index 26a43ecf67..75a0932fc6 100644 --- a/scripts/npc/2050014.js +++ b/scripts/npc/2050014.js @@ -22,43 +22,44 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3421)) { - var meteoriteId = cm.getNpc() - 2050014; - - var progress = cm.getQuestProgressInt(3421, 1); - if((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { - if (cm.canHold(4031117, 1)) { - progress |= (1 << meteoriteId); - - cm.gainItem(4031117, 1); - cm.setQuestProgress(3421, 1, progress); - } else { - cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3421)) { + var meteoriteId = cm.getNpc() - 2050014; + + var progress = cm.getQuestProgressInt(3421, 1); + if ((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { + if (cm.canHold(4031117, 1)) { + progress |= (1 << meteoriteId); + + cm.gainItem(4031117, 1); + cm.setQuestProgress(3421, 1, progress); + } else { + cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2050015.js b/scripts/npc/2050015.js index 26a43ecf67..75a0932fc6 100644 --- a/scripts/npc/2050015.js +++ b/scripts/npc/2050015.js @@ -22,43 +22,44 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3421)) { - var meteoriteId = cm.getNpc() - 2050014; - - var progress = cm.getQuestProgressInt(3421, 1); - if((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { - if (cm.canHold(4031117, 1)) { - progress |= (1 << meteoriteId); - - cm.gainItem(4031117, 1); - cm.setQuestProgress(3421, 1, progress); - } else { - cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3421)) { + var meteoriteId = cm.getNpc() - 2050014; + + var progress = cm.getQuestProgressInt(3421, 1); + if ((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { + if (cm.canHold(4031117, 1)) { + progress |= (1 << meteoriteId); + + cm.gainItem(4031117, 1); + cm.setQuestProgress(3421, 1, progress); + } else { + cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2050016.js b/scripts/npc/2050016.js index 26a43ecf67..75a0932fc6 100644 --- a/scripts/npc/2050016.js +++ b/scripts/npc/2050016.js @@ -22,43 +22,44 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3421)) { - var meteoriteId = cm.getNpc() - 2050014; - - var progress = cm.getQuestProgressInt(3421, 1); - if((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { - if (cm.canHold(4031117, 1)) { - progress |= (1 << meteoriteId); - - cm.gainItem(4031117, 1); - cm.setQuestProgress(3421, 1, progress); - } else { - cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3421)) { + var meteoriteId = cm.getNpc() - 2050014; + + var progress = cm.getQuestProgressInt(3421, 1); + if ((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { + if (cm.canHold(4031117, 1)) { + progress |= (1 << meteoriteId); + + cm.gainItem(4031117, 1); + cm.setQuestProgress(3421, 1, progress); + } else { + cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2050017.js b/scripts/npc/2050017.js index 26a43ecf67..75a0932fc6 100644 --- a/scripts/npc/2050017.js +++ b/scripts/npc/2050017.js @@ -22,43 +22,44 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3421)) { - var meteoriteId = cm.getNpc() - 2050014; - - var progress = cm.getQuestProgressInt(3421, 1); - if((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { - if (cm.canHold(4031117, 1)) { - progress |= (1 << meteoriteId); - - cm.gainItem(4031117, 1); - cm.setQuestProgress(3421, 1, progress); - } else { - cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3421)) { + var meteoriteId = cm.getNpc() - 2050014; + + var progress = cm.getQuestProgressInt(3421, 1); + if ((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { + if (cm.canHold(4031117, 1)) { + progress |= (1 << meteoriteId); + + cm.gainItem(4031117, 1); + cm.setQuestProgress(3421, 1, progress); + } else { + cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2050018.js b/scripts/npc/2050018.js index 26a43ecf67..75a0932fc6 100644 --- a/scripts/npc/2050018.js +++ b/scripts/npc/2050018.js @@ -22,43 +22,44 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3421)) { - var meteoriteId = cm.getNpc() - 2050014; - - var progress = cm.getQuestProgressInt(3421, 1); - if((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { - if (cm.canHold(4031117, 1)) { - progress |= (1 << meteoriteId); - - cm.gainItem(4031117, 1); - cm.setQuestProgress(3421, 1, progress); - } else { - cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3421)) { + var meteoriteId = cm.getNpc() - 2050014; + + var progress = cm.getQuestProgressInt(3421, 1); + if ((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { + if (cm.canHold(4031117, 1)) { + progress |= (1 << meteoriteId); + + cm.gainItem(4031117, 1); + cm.setQuestProgress(3421, 1, progress); + } else { + cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2050019.js b/scripts/npc/2050019.js index 26a43ecf67..75a0932fc6 100644 --- a/scripts/npc/2050019.js +++ b/scripts/npc/2050019.js @@ -22,43 +22,44 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3421)) { - var meteoriteId = cm.getNpc() - 2050014; - - var progress = cm.getQuestProgressInt(3421, 1); - if((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { - if (cm.canHold(4031117, 1)) { - progress |= (1 << meteoriteId); - - cm.gainItem(4031117, 1); - cm.setQuestProgress(3421, 1, progress); - } else { - cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3421)) { + var meteoriteId = cm.getNpc() - 2050014; + + var progress = cm.getQuestProgressInt(3421, 1); + if ((progress >> meteoriteId) % 2 == 0 || (progress == 63 && !cm.haveItem(4031117, 6))) { + if (cm.canHold(4031117, 1)) { + progress |= (1 << meteoriteId); + + cm.gainItem(4031117, 1); + cm.setQuestProgress(3421, 1, progress); + } else { + cm.getPlayer().dropMessage(1, "Have a ETC slot available for this item."); + } + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2060005.js b/scripts/npc/2060005.js index e2ee871223..e3658fa08d 100644 --- a/scripts/npc/2060005.js +++ b/scripts/npc/2060005.js @@ -21,24 +21,23 @@ */ /** - @Author Ronan + @Author Ronan - 2060005 - Kenta - Enter 3rd job mount event -**/ + 2060005 - Kenta + Enter 3rd job mount event + **/ function start() { - if(cm.isQuestCompleted(6002)) { + if (cm.isQuestCompleted(6002)) { cm.sendOk("Thanks for saving the pork."); - } - else if(cm.isQuestStarted(6002)) { - if (cm.haveItem(4031507, 5) && cm.haveItem(4031508,5)) { + } else if (cm.isQuestStarted(6002)) { + if (cm.haveItem(4031507, 5) && cm.haveItem(4031508, 5)) { cm.sendOk("Thanks for saving the pork."); } else { var em = cm.getEventManager("3rdJob_mount"); - if (em == null) + if (em == null) { cm.sendOk("Sorry, but 3rd job advancement (mount) is closed."); - else { + } else { if (em.startInstance(cm.getPlayer())) { cm.removeAll(4031507); cm.removeAll(4031508); @@ -47,10 +46,9 @@ function start() { } } } - } - else { + } else { cm.sendOk("Only few adventurers, from a selected public, are eligible to protect the Watch Hog."); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2060008.js b/scripts/npc/2060008.js index 2a1317b8a9..64c9d75f9f 100644 --- a/scripts/npc/2060008.js +++ b/scripts/npc/2060008.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2060008); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2060008); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2060009.js b/scripts/npc/2060009.js index eccfb0a6ae..f2975ee871 100644 --- a/scripts/npc/2060009.js +++ b/scripts/npc/2060009.js @@ -4,49 +4,55 @@ var payment = false; var atHerbTown = false; function start() { - if(cm.getPlayer().getMap().getId() == 251000100) atHerbTown = true; - - if (cm.haveItem(4031242)){ - if(atHerbTown) - menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l"; - else - menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l"; - }else { - if(atHerbTown) - menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l"; - else - menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l"; + if (cm.getPlayer().getMap().getId() == 251000100) { + atHerbTown = true; + } + + if (cm.haveItem(4031242)) { + if (atHerbTown) { + menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l"; + } else { + menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l"; + } + } else { + if (atHerbTown) { + menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l"; + } else { + menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l"; + } payment = true; } - cm.sendSimple ("Ocean are all connected to each other. Place you can't reach by foot can easily reached oversea. How about taking #bDolphin Taxi#k with us today?\r\n"+menu); + cm.sendSimple("Ocean are all connected to each other. Place you can't reach by foot can easily reached oversea. How about taking #bDolphin Taxi#k with us today?\r\n" + menu); } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { if (selection == 0) { - if(payment) { - if(cm.getPlayer().getMeso() < 1000) { + if (payment) { + if (cm.getPlayer().getMeso() < 1000) { cm.sendOk("I don't think you have enough money..."); cm.dispose(); - } else + } else { cm.gainMeso(-1000); - } else - cm.gainItem(4031242,-1); + } + } else { + cm.gainItem(4031242, -1); + } cm.warp(230030200, 2); cm.dispose(); return; } else if (selection == 1) { - if (cm.getPlayer().getMeso() < 10000) { - cm.sendOk("I don't think you have enough money..."); - cm.dispose(); - return; - }else{ - cm.gainMeso(-10000); - cm.warp(atHerbTown ? 230000000 : 251000100); - } - } + if (cm.getPlayer().getMeso() < 10000) { + cm.sendOk("I don't think you have enough money..."); + cm.dispose(); + return; + } else { + cm.gainMeso(-10000); + cm.warp(atHerbTown ? 230000000 : 251000100); + } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2060100.js b/scripts/npc/2060100.js index 8608e7552c..3830f4d71f 100644 --- a/scripts/npc/2060100.js +++ b/scripts/npc/2060100.js @@ -19,9 +19,10 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + //carta -function start(){ - if(cm.isQuestStarted(6301)) { +function start() { + if (cm.isQuestStarted(6301)) { if (cm.haveItem(4000175)) { cm.gainItem(4000175, -1); cm.warp(923000000, 0); @@ -31,6 +32,6 @@ function start(){ } else { cm.sendOk("I'm #bCarta the sea-witch.#k Don't fool around with me, as I'm known for my habit of turning people into worms."); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2070000.js b/scripts/npc/2070000.js index 14c470fd83..1372b8adf8 100644 --- a/scripts/npc/2070000.js +++ b/scripts/npc/2070000.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2070000); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2070000); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2071012.js b/scripts/npc/2071012.js index c5d24d199a..5df780f0a0 100644 --- a/scripts/npc/2071012.js +++ b/scripts/npc/2071012.js @@ -3,45 +3,46 @@ */ var status; - + function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { cm.dispose(); + return; + } + if (mode == 1) { + status++; } else { - if (mode == 0 && type > 0) { + status--; + } + + if (status == 0) { + if (cm.getQuestProgressInt(23647, 1) != 0) { cm.dispose(); return; } - if (mode == 1) - status++; - else - status--; - if(status == 0) { - if(cm.getQuestProgressInt(23647, 1) != 0) { - cm.dispose(); - return; - } - - if(!cm.haveItem(4031793, 1)) { - cm.sendOk("Umm... Hey... Would you help me find a #bsoft and shiny silver fur#k that I lost on the woods? I need it, I need it, I need it sooooo much!"); - cm.dispose(); - return; - } - - cm.sendYesNo("Hey... Umm... Would you help me find a #bsoft and shiny silver fur#k that I lost on the woods? I need it, I need it, I need it sooooo much! ... Oh you found it!!! Will you give it to me?"); - } else if(status == 1) { - cm.sendNext("Teehehee~ That's your reward for taking it from me, serves you well."); - cm.gainItem(4031793, -1); - cm.gainFame(-5); - cm.setQuestProgress(23647, 1, 1); - + if (!cm.haveItem(4031793, 1)) { + cm.sendOk("Umm... Hey... Would you help me find a #bsoft and shiny silver fur#k that I lost on the woods? I need it, I need it, I need it sooooo much!"); cm.dispose(); + return; } + + cm.sendYesNo("Hey... Umm... Would you help me find a #bsoft and shiny silver fur#k that I lost on the woods? I need it, I need it, I need it sooooo much! ... Oh you found it!!! Will you give it to me?"); + } else if (status == 1) { + cm.sendNext("Teehehee~ That's your reward for taking it from me, serves you well."); + cm.gainItem(4031793, -1); + cm.gainFame(-5); + cm.setQuestProgress(23647, 1, 1); + + cm.dispose(); } + } } \ No newline at end of file diff --git a/scripts/npc/2080000.js b/scripts/npc/2080000.js index d063cc6ca2..41503fd0dd 100644 --- a/scripts/npc/2080000.js +++ b/scripts/npc/2080000.js @@ -30,28 +30,30 @@ var cost; var stimID; var cd_item = 4001078; -var cd_mats = new Array(4011001,4011002,4001079); -var cd_matQty = new Array(1,1,1); +var cd_mats = [4011001, 4011002, 4001079]; +var cd_matQty = [1, 1, 1]; var cd_cost = 25000; function start() { cm.getPlayer().setCS(true); var selStr = "A dragon's power is not to be underestimated. If you like, I can add its power to one of your weapons. However, the weapon must be powerful enough to hold its potential...#b" - var options = new Array("What's a stimulator?","Create a Warrior weapon","Create a Bowman weapon","Create a Magician weapon","Create a Thief weapon","Create a Pirate Weapon", - "Create a Warrior weapon with a Stimulator","Create a Bowman weapon with a Stimulator","Create a Magician weapon with a Stimulator","Create a Thief weapon with a Stimulator","Create a Pirate Weapon with a Stimulator"); - - if(cm.isQuestStarted(7301) || cm.isQuestStarted(7303)) options.push("Make #t4001078#"); - - for (var i = 0; i < options.length; i++){ + var options = ["What's a stimulator?", "Create a Warrior weapon", "Create a Bowman weapon", "Create a Magician weapon", "Create a Thief weapon", "Create a Pirate Weapon", + "Create a Warrior weapon with a Stimulator", "Create a Bowman weapon with a Stimulator", "Create a Magician weapon with a Stimulator", "Create a Thief weapon with a Stimulator", "Create a Pirate Weapon with a Stimulator"]; + + if (cm.isQuestStarted(7301) || cm.isQuestStarted(7303)) { + options.push("Make #t4001078#"); + } + + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; } cm.sendSimple(selStr); } function action(mode, type, selection) { - if (mode > 0) + if (mode > 0) { status++; - else { + } else { cm.dispose(); return; } @@ -60,159 +62,161 @@ function action(mode, type, selection) { if (selectedType > 5 && selectedType < 11) { stimulator = true; selectedType -= 5; - } - else + } else { stimulator = false; + } if (selectedType == 0) { //What's a stim? cm.sendNext("A stimulator is a special potion that I can add into the process of creating certain items. It gives it stats as though it had dropped from a monster. However, it is possible to have no change, and it is also possible for the item to be below average. There's also a 10% chance of not getting any item when using a stimulator, so please choose wisely.") cm.dispose(); - } else if (selectedType == 1){ //warrior weapon + } else if (selectedType == 1) { //warrior weapon var selStr = "Very well, then which Warrior weapon shall receive a dragon's power?#b"; - var weapon = new Array ("Dragon Carbella#k - Lv. 110 One-Handed Sword#b","Dragon Axe#k - Lv. 110 One-Handed Axe#b","Dragon Mace#k - Lv. 110 One-Handed BW#b","Dragon Claymore#k - Lv. 110 Two-Handed Sword#b","Dragon Battle Axe#k - Lv. 110 Two-Handed Axe#b","Dragon Flame#k - Lv. 110 Two-Handed BW#b", - "Dragon Faltizan#k - Lv. 110 Spear#b","Dragon Chelbird#k - Lv. 110 Polearm#b"); - for (var i = 0; i < weapon.length; i++){ + var weapon = ["Dragon Carbella#k - Lv. 110 One-Handed Sword#b", "Dragon Axe#k - Lv. 110 One-Handed Axe#b", "Dragon Mace#k - Lv. 110 One-Handed BW#b", "Dragon Claymore#k - Lv. 110 Two-Handed Sword#b", "Dragon Battle Axe#k - Lv. 110 Two-Handed Axe#b", "Dragon Flame#k - Lv. 110 Two-Handed BW#b", + "Dragon Faltizan#k - Lv. 110 Spear#b", "Dragon Chelbird#k - Lv. 110 Polearm#b"]; + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 2){ //bowman weapon + } else if (selectedType == 2) { //bowman weapon var selStr = "Very well, then which Bowman weapon shall receive a dragon's power?#b"; - var weapon = new Array ("Dragon Shiner Bow#k - Lv. 110 Bow#b","Dragon Shiner Cross#k - Lv. 110 Crossbow#b"); - for (var i = 0; i < weapon.length; i++){ + var weapon = ["Dragon Shiner Bow#k - Lv. 110 Bow#b", "Dragon Shiner Cross#k - Lv. 110 Crossbow#b"]; + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 3){ //magician weapon + } else if (selectedType == 3) { //magician weapon var selStr = "Very well, then which Magician weapon shall receive a dragon's power?#b"; - var weapon = new Array ("Dragon Wand#k - Lv. 108 Wand#b","Dragon Staff#k - Lv. 110 Staff#b"); - for (var i = 0; i < weapon.length; i++){ + var weapon = ["Dragon Wand#k - Lv. 108 Wand#b", "Dragon Staff#k - Lv. 110 Staff#b"]; + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 4){ //thief weapon + } else if (selectedType == 4) { //thief weapon var selStr = "Very well, then which Thief weapon shall receive a dragon's power?#b"; - var weapon = new Array ("Dragon Kanzir#k - Lv. 110 STR Dagger#b","Dragon Kreda#k - Lv. 110 LUK Dagger#b","Dragon Green Sleve#k - Lv. 110 Claw#b"); - for (var i = 0; i < weapon.length; i++){ + var weapon = ["Dragon Kanzir#k - Lv. 110 STR Dagger#b", "Dragon Kreda#k - Lv. 110 LUK Dagger#b", "Dragon Green Sleve#k - Lv. 110 Claw#b"]; + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; } cm.sendSimple(selStr); - } else if (selectedType == 5){ //pirate weapon + } else if (selectedType == 5) { //pirate weapon var selStr = "Very well, then which Pirate weapon shall receive a dragon's power?#b"; - var weapon = new Array ("Dragon Slash Claw#k - Lv. 110 Knuckle#b","Dragonfire Revolver#k - Lv. 110 Gun#b"); - for (var i = 0; i < weapon.length; i++){ - selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; + var weapon = ["Dragon Slash Claw#k - Lv. 110 Knuckle#b", "Dragonfire Revolver#k - Lv. 110 Gun#b"]; + for (var i = 0; i < weapon.length; i++) { + selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; } cm.sendSimple(selStr); - } - else if (selectedType == 11){ //cornian's dagger + } else if (selectedType == 11) { //cornian's dagger var selStr = "Oh, are you trying to sneak into these lizards to save Moira? I will support your cause wherever I can. Bring me a couple of resources and I will make you an almost identical piece of #t4001078#."; cm.sendNext(selStr); - } + } } else if (status == 2) { selectedItem = selection; - - if (selectedType == 1){ //warrior weapon - var itemSet = new Array(1302059,1312031,1322052,1402036,1412026,1422028,1432038,1442045); - var matSet = new Array(new Array(1302056,4000244,4000245,4005000),new Array(1312030,4000244,4000245,4005000),new Array(1322045,4000244,4000245,4005000),new Array(1402035,4000244,4000245,4005000), - new Array(1412021,4000244,4000245,4005000),new Array(1422027,4000244,4000245,4005000),new Array(1432030,4000244,4000245,4005000),new Array(1442044,4000244,4000245,4005000)); - var matQtySet = new Array(new Array(1,20,25,8),new Array(1,20,25,8),new Array(1,20,25,8),new Array(1,20,25,8),new Array(1,20,25,8),new Array(1,20,25,8),new Array(1,20,25,8),new Array(1,20,25,8)); - var costSet = new Array(120000,120000,120000,120000,120000,120000,120000,120000); + + if (selectedType == 1) { //warrior weapon + var itemSet = [1302059, 1312031, 1322052, 1402036, 1412026, 1422028, 1432038, 1442045]; + var matSet = [[1302056, 4000244, 4000245, 4005000], [1312030, 4000244, 4000245, 4005000], [1322045, 4000244, 4000245, 4005000], [1402035, 4000244, 4000245, 4005000], + [1412021, 4000244, 4000245, 4005000], [1422027, 4000244, 4000245, 4005000], [1432030, 4000244, 4000245, 4005000], [1442044, 4000244, 4000245, 4005000]]; + var matQtySet = [[1, 20, 25, 8], [1, 20, 25, 8], [1, 20, 25, 8], [1, 20, 25, 8], [1, 20, 25, 8], [1, 20, 25, 8], [1, 20, 25, 8], [1, 20, 25, 8]]; + var costSet = [120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 2){ //bowman weapon - var itemSet = new Array(1452044,1462039); - var matSet = new Array(new Array(1452019,4000244,4000245,4005000,4005002),new Array(1462015,4000244,4000245,4005000,4005002)); - var matQtySet = new Array(new Array(1,20,25,3,5),new Array(1,20,25,5,3)); - var costSet = new Array(120000,120000); + } else if (selectedType == 2) { //bowman weapon + var itemSet = [1452044, 1462039]; + var matSet = [[1452019, 4000244, 4000245, 4005000, 4005002], [1462015, 4000244, 4000245, 4005000, 4005002]]; + var matQtySet = [[1, 20, 25, 3, 5], [1, 20, 25, 5, 3]]; + var costSet = [120000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 3){ //magician weapon - var itemSet = new Array(1372032,1382036); - var matSet = new Array(new Array(1372010,4000244,4000245,4005001,4005003),new Array(1382035,4000244,4000245,4005001,4005003)); - var matQtySet = new Array(new Array(1,20,25,6,2),new Array(1,20,25,6,2)); - var costSet = new Array(120000,120000); + } else if (selectedType == 3) { //magician weapon + var itemSet = [1372032, 1382036]; + var matSet = [[1372010, 4000244, 4000245, 4005001, 4005003], [1382035, 4000244, 4000245, 4005001, 4005003]]; + var matQtySet = [[1, 20, 25, 6, 2], [1, 20, 25, 6, 2]]; + var costSet = [120000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 4){ //thief weapon - var itemSet = new Array(1332049,1332050,1472051); - var matSet = new Array(new Array(1332051,4000244,4000245,4005000,4005002),new Array(1332052,4000244,4000245,4005002,4005003),new Array(1472053,4000244,4000245,4005002,4005003)); - var matQtySet = new Array(new Array(1,20,25,5,3),new Array(1,20,25,3,5),new Array(1,20,25,2,6)); - var costSet = new Array(120000,120000,120000); + } else if (selectedType == 4) { //thief weapon + var itemSet = [1332049, 1332050, 1472051]; + var matSet = [[1332051, 4000244, 4000245, 4005000, 4005002], [1332052, 4000244, 4000245, 4005002, 4005003], [1472053, 4000244, 4000245, 4005002, 4005003]]; + var matQtySet = [[1, 20, 25, 5, 3], [1, 20, 25, 3, 5], [1, 20, 25, 2, 6]]; + var costSet = [120000, 120000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 5){ //pirate weapon - var itemSet = new Array(1482013,1492013); - var matSet = new Array(new Array(1482012,4000244,4000245,4005000,4005002),new Array(1492012,4000244,4000245,4005000,4005002)); - var matQtySet = new Array(new Array(1,20,25,5,3),new Array(1,20,25,3,5)); - var costSet = new Array(120000,120000); + } else if (selectedType == 5) { //pirate weapon + var itemSet = [1482013, 1492013]; + var matSet = [[1482012, 4000244, 4000245, 4005000, 4005002], [1492012, 4000244, 4000245, 4005000, 4005002]]; + var matQtySet = [[1, 20, 25, 5, 3], [1, 20, 25, 3, 5]]; + var costSet = [120000, 120000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - } else if (selectedType == 11){ //cornian's dagger + } else if (selectedType == 11) { //cornian's dagger item = cd_item; mats = cd_mats; matQty = cd_matQty; cost = cd_cost; } - + var prompt = "You want me to make a #t" + item + "#? In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if(stimulator){ + if (stimulator) { stimID = getStimID(item); - prompt += "\r\n#i"+stimID+"# 1 #t" + stimID + "#"; + prompt += "\r\n#i" + stimID + "# 1 #t" + stimID + "#"; } - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } } else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; } - if (cost > 0) + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; + } cm.sendYesNo(prompt); } else if (status == 3) { var complete = true; - - if(!cm.canHold(item, 1)) { + + if (!cm.canHold(item, 1)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost) { + } else if (cm.getMeso() < cost) { cm.sendOk("My fee is for the good of all of Leafre. If you cannot pay it, then begone."); cm.dispose(); return; } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i])) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { complete = false; - } - else if (!cm.haveItem(mats, matQty)) + } + } + } else if (!cm.haveItem(mats, matQty)) { complete = false; + } } - if (stimulator){ //check for stimulator + if (stimulator) { //check for stimulator if (!cm.haveItem(stimID)) { complete = false; } } - if (!complete) + if (!complete) { cm.sendOk("I'm afraid that without the correct items, the dragon's essence would... not make for a very reliable weapon. Please bring the correct items next time."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i]); } - } else + } else { cm.gainItem(mats, -matQty); + } cm.gainMeso(-cost); if (stimulator) { //check for stimulator cm.gainItem(stimID, -1); @@ -223,8 +227,7 @@ function action(mode, type, selection) { } else { cm.sendOk("Unfortunately, the dragon's essence has... conflicted with your weapon. My apologies for your loss."); } - } - else {//just give basic item + } else {//just give basic item cm.gainItem(item, 1); cm.sendOk("The process is complete. Treat your weapon well, lest you bring the wrath of the dragons upon you."); } @@ -233,9 +236,9 @@ function action(mode, type, selection) { } } -function getStimID(equipID){ +function getStimID(equipID) { var cat = Math.floor(equipID / 10000); - switch (cat){ + switch (cat) { case 130: //1h sword return 4130002; case 131: //1h axe diff --git a/scripts/npc/2080005.js b/scripts/npc/2080005.js index 7b8e392557..47c4e13008 100644 --- a/scripts/npc/2080005.js +++ b/scripts/npc/2080005.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2080005); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2080005); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2081000.js b/scripts/npc/2081000.js index 4a1e895741..505123b6ef 100644 --- a/scripts/npc/2081000.js +++ b/scripts/npc/2081000.js @@ -38,26 +38,26 @@ function action(mode, type, selection) { return; } status++; - if(status == 1) { - if(selection == 0) { + if (status == 1) { + if (selection == 0) { cm.sendSimple("You don't seem to be from out town. How can I help you?#L0##bI would like some #t4031346#.#k#l"); } else { cm.sendNext("Under development..."); cm.dispose(); } - } else if(status == 2) { - cm.sendGetNumber("#b#t4031346##k is a precious iteml I cannot give it to you just like that. How about doing me a little favor? Then I'll give it to you. I'll sell the #b#t4031346##k to you for #b30,000 mesos#k each. Are you willing to make the purchase? How many would you like, then?",0,0,99); - } else if(status == 3) { - if(selection == 0) { + } else if (status == 2) { + cm.sendGetNumber("#b#t4031346##k is a precious iteml I cannot give it to you just like that. How about doing me a little favor? Then I'll give it to you. I'll sell the #b#t4031346##k to you for #b30,000 mesos#k each. Are you willing to make the purchase? How many would you like, then?", 0, 0, 99); + } else if (status == 3) { + if (selection == 0) { cm.sendOk("I can't sell you 0."); cm.dispose(); } else { temp = selection; cost = temp * 30000; - cm.sendYesNo("Buying #b"+temp+" #t4031346#(s)#k will cost you #b"+cost+" mesos#k. Are you sure you want to make the purchase?"); + cm.sendYesNo("Buying #b" + temp + " #t4031346#(s)#k will cost you #b" + cost + " mesos#k. Are you sure you want to make the purchase?"); } - } else if(status == 4) { - if(cm.getMeso() < cost || !cm.canHold(4031346)) { + } else if (status == 4) { + if (cm.getMeso() < cost || !cm.canHold(4031346)) { cm.sendOk("Please check and see if you have enough mesos to make the purchase. Also, I suggest you check the etc. inventory and see if you have enough space available to make the purchase."); } else { cm.sendOk("See you again~"); diff --git a/scripts/npc/2081005.js b/scripts/npc/2081005.js index 35cf8035ac..27b56f9fac 100644 --- a/scripts/npc/2081005.js +++ b/scripts/npc/2081005.js @@ -31,21 +31,21 @@ function isTransformed(ch) { } function start() { - if(!(isTransformed(cm.getPlayer()) || cm.haveItem(4001086))) { + if (!(isTransformed(cm.getPlayer()) || cm.haveItem(4001086))) { cm.sendOk("This is the cave of the mighty Horntail, supreme ruler of the Leafre Canyons. Only those #bdeemed worthy#k to meet him can pass here, #boutsiders#k are not welcome. Get lost!"); cm.dispose(); return; } - + cm.sendSimple("Welcome to Cave of Life - Entrance ! Would you like to go inside and fight #rHorntail#k ? If you want to fight him, you may might need some #b#v2000005##k, so you can recover some HP if you have been hit by #rHorntail#k.\r\n#L1#I would like to buy 10 for 100,000 Mesos!#l\r\n\#L2#No thanks, let me in now!#l"); } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else if (selection == 1) { - if(cm.getMeso() >= price) { - if(!cm.canHold(2000005)) { + } else if (selection == 1) { + if (cm.getMeso() >= price) { + if (!cm.canHold(2000005)) { cm.sendOk("Sorry, you don't have a slot on your inventory for the item!"); } else { cm.gainMeso(-price); @@ -57,10 +57,11 @@ function action(mode, type, selection) { } cm.dispose(); } else if (selection == 2) { - if (cm.getLevel() > 99) + if (cm.getLevel() > 99) { cm.warp(240050000, 0); - else + } else { cm.sendOk("I'm sorry. You need to be atleast level 100 or above to enter."); + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2081009.js b/scripts/npc/2081009.js index d49ae9513a..d909329c13 100644 --- a/scripts/npc/2081009.js +++ b/scripts/npc/2081009.js @@ -24,37 +24,32 @@ var status; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { if (mode <= 0) { - cm.dispose(); + cm.dispose(); return; } - + status++; - if(status == 0) { - if(cm.isQuestStarted(6180) && cm.getQuestProgressInt(6180, 9300096) < 200) { + if (status == 0) { + if (cm.isQuestStarted(6180) && cm.getQuestProgressInt(6180, 9300096) < 200) { cm.sendYesNo("Pay attention: during the time you stay inside the training ground make sure you #bhave equipped your #t1092041##k, it is of the utmost importance. Are you ready to proceed to the training area?"); - } - - else { + } else { cm.sendOk("Only assigned personnel can access the training ground."); cm.dispose(); } - } - - else if(status == 1) { + } else if (status == 1) { if (cm.getPlayer().haveItemEquipped(1092041)) { cm.sendNext("Have your shield equipped until the end of the quest, or else you will need to start all over again!"); } else { cm.sendOk("Please equip the #r#t1092041##k before entering the training ground."); cm.dispose(); } - } - else { + } else { cm.warp(924000001, 0); cm.dispose(); } diff --git a/scripts/npc/2081010.js b/scripts/npc/2081010.js index 019a545276..b7305ffe54 100644 --- a/scripts/npc/2081010.js +++ b/scripts/npc/2081010.js @@ -29,22 +29,20 @@ var exitMap = 240010400; function start() { status = -1; - action(1,0,0); + action(1, 0, 0); } -function action(mode, type, selection){ +function action(mode, type, selection) { if (mode <= 0) { - cm.dispose(); + cm.dispose(); return; } - + status++; - if(status == 0) { + if (status == 0) { cm.sendYesNo("Do you want to exit the area? If you quit, you will need to start this task from the scratch."); - } - - else if(status == 1) { - cm.warp(exitMap, "st00"); + } else if (status == 1) { + cm.warp(exitMap, "st00"); cm.dispose(); } } diff --git a/scripts/npc/2081100.js b/scripts/npc/2081100.js index eccfb48ef8..9b23238cc1 100644 --- a/scripts/npc/2081100.js +++ b/scripts/npc/2081100.js @@ -26,86 +26,96 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 1) { - cm.sendOk("Please don't bother me right now, I am trying to concentrate."); - cm.dispose(); - } else if (!cm.isQuestCompleted(6904)) { - cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); - cm.dispose(); - } else if ( cm.getJobId() % 100 % 10 != 2) { - cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); - } else { - cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); - } - } else if(status == 1) { - if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { - if (cm.canHold(2280003, 1)) { - cm.changeJobById(cm.getJobId() + 1); - if(cm.getJobId() == 112) { - cm.teachSkill(1121001, 0, 10, -1); - cm.teachSkill(1120004, 0, 10, -1); - cm.teachSkill(1121008, 0, 10, -1); - } else if(cm.getJobId() == 122) { - cm.teachSkill(1221001, 0, 10, -1); - cm.teachSkill(1220005, 0, 10, -1); - cm.teachSkill(1221009, 0, 10, -1); - } else if(cm.getJobId() == 132) { - cm.teachSkill(1321001, 0, 10, -1); - cm.teachSkill(1320005, 0, 10, -1); - cm.teachSkill(1321007, 0, 10, -1); - } - cm.gainItem(2280003, 1); - } else { - cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); - } - } else if(mode >= 0 && cm.getJobId() % 100 % 10 == 2) { - // TEMP until I can get the quest fixed... - if(cm.getJobId() == 112) { - if(cm.getPlayer().getSkillLevel(1121010) == 0) - cm.teachSkill(1121010 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(1120005) == 0) - cm.teachSkill(1120005 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(1121002) == 0) - cm.teachSkill(1121002 , 0, 10, -1); - } else if(cm.getJobId() == 122) { - if(cm.getPlayer().getSkillLevel(1221002) == 0) - cm.teachSkill(1221002, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(1221003) == 0) - cm.teachSkill(1221003, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(1221004) == 0) - cm.teachSkill(1221004, 0, 10, -1); - } else if(cm.getJobId() == 132) { - if(cm.getPlayer().getSkillLevel(1321002) == 0) - cm.teachSkill(1321002, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(1320008) == 0) - cm.teachSkill(1320008, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(1320009) == 0) - cm.teachSkill(1320009, 0, 10, -1); - } - cm.sendOk("It is done. Leave me now."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 1) { + cm.sendOk("Please don't bother me right now, I am trying to concentrate."); + cm.dispose(); + } else if (!cm.isQuestCompleted(6904)) { + cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); + cm.dispose(); + } else if (cm.getJobId() % 100 % 10 != 2) { + cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); + } else { + cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); + } + } else if (status == 1) { + if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { + if (cm.canHold(2280003, 1)) { + cm.changeJobById(cm.getJobId() + 1); + if (cm.getJobId() == 112) { + cm.teachSkill(1121001, 0, 10, -1); + cm.teachSkill(1120004, 0, 10, -1); + cm.teachSkill(1121008, 0, 10, -1); + } else if (cm.getJobId() == 122) { + cm.teachSkill(1221001, 0, 10, -1); + cm.teachSkill(1220005, 0, 10, -1); + cm.teachSkill(1221009, 0, 10, -1); + } else if (cm.getJobId() == 132) { + cm.teachSkill(1321001, 0, 10, -1); + cm.teachSkill(1320005, 0, 10, -1); + cm.teachSkill(1321007, 0, 10, -1); + } + cm.gainItem(2280003, 1); + } else { + cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); + } + } else if (mode >= 0 && cm.getJobId() % 100 % 10 == 2) { + // TEMP until I can get the quest fixed... + if (cm.getJobId() == 112) { + if (cm.getPlayer().getSkillLevel(1121010) == 0) { + cm.teachSkill(1121010, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(1120005) == 0) { + cm.teachSkill(1120005, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(1121002) == 0) { + cm.teachSkill(1121002, 0, 10, -1); + } + } else if (cm.getJobId() == 122) { + if (cm.getPlayer().getSkillLevel(1221002) == 0) { + cm.teachSkill(1221002, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(1221003) == 0) { + cm.teachSkill(1221003, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(1221004) == 0) { + cm.teachSkill(1221004, 0, 10, -1); + } + } else if (cm.getJobId() == 132) { + if (cm.getPlayer().getSkillLevel(1321002) == 0) { + cm.teachSkill(1321002, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(1320008) == 0) { + cm.teachSkill(1320008, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(1320009) == 0) { + cm.teachSkill(1320009, 0, 10, -1); + } + } + cm.sendOk("It is done. Leave me now."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2081200.js b/scripts/npc/2081200.js index ecb0b3882e..2becc627fa 100644 --- a/scripts/npc/2081200.js +++ b/scripts/npc/2081200.js @@ -26,83 +26,92 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 2) { - cm.sendOk("Please don't bother me right now, I am trying to concentrate."); - cm.dispose(); - } else if (!cm.isQuestCompleted(6914)) { - cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); - cm.dispose(); - } else if ( cm.getJobId() % 100 % 10 != 2) { - cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); - } else { - cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); - //cm.dispose(); - } - } else if(status == 1) { - if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { - if (cm.canHold(2280003, 1)) { - cm.changeJobById(cm.getJobId() + 1); - if(cm.getJobId() == 212) { - cm.teachSkill(2121001, 0, 10, -1); - cm.teachSkill(2121002, 0, 10, -1); - cm.teachSkill(2121006, 0, 10, -1); - } else if(cm.getJobId() == 222) { - cm.teachSkill(2221001, 0, 10, -1); - cm.teachSkill(2221002, 0, 10, -1); - cm.teachSkill(2221006, 0, 10, -1); - } else if(cm.getJobId() == 232) { - cm.teachSkill(2321001, 0, 10, -1); - cm.teachSkill(2321002, 0, 10, -1); - cm.teachSkill(2321005, 0, 10, -1); - } - cm.gainItem(2280003, 1); - } else { - cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); - } - } else if( mode >= 1 && cm.getJobId() % 100 % 10 == 2) { - if(cm.getJobId() == 212) { - if(cm.getPlayer().getSkillLevel(2121007) == 0) - cm.teachSkill(2121007 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(2121005) == 0) - cm.teachSkill(2121005 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(2121005) == 0) - cm.teachSkill(2121005 , 0, 10, -1); - } else if(cm.getJobId() == 222) { - if(cm.getPlayer().getSkillLevel(2221007) == 0) - cm.teachSkill(2221007 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(2221005) == 0) - cm.teachSkill(2221005 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(2221003) == 0) - cm.teachSkill(2221003 , 0, 10, -1); - } else if(cm.getJobId() == 232) { - if (cm.getPlayer().getSkillLevel(2321008) < 1) - cm.teachSkill(2321008, 0, 10,-1); // Genesis - if (cm.getPlayer().getSkillLevel(2321006) < 1) - cm.teachSkill(2321006, 0, 10,-1); // res - } - cm.sendOk("It is done. Leave me now."); - } - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 2) { + cm.sendOk("Please don't bother me right now, I am trying to concentrate."); + cm.dispose(); + } else if (!cm.isQuestCompleted(6914)) { + cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); + cm.dispose(); + } else if (cm.getJobId() % 100 % 10 != 2) { + cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); + } else { + cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); + //cm.dispose(); + } + } else if (status == 1) { + if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { + if (cm.canHold(2280003, 1)) { + cm.changeJobById(cm.getJobId() + 1); + if (cm.getJobId() == 212) { + cm.teachSkill(2121001, 0, 10, -1); + cm.teachSkill(2121002, 0, 10, -1); + cm.teachSkill(2121006, 0, 10, -1); + } else if (cm.getJobId() == 222) { + cm.teachSkill(2221001, 0, 10, -1); + cm.teachSkill(2221002, 0, 10, -1); + cm.teachSkill(2221006, 0, 10, -1); + } else if (cm.getJobId() == 232) { + cm.teachSkill(2321001, 0, 10, -1); + cm.teachSkill(2321002, 0, 10, -1); + cm.teachSkill(2321005, 0, 10, -1); + } + cm.gainItem(2280003, 1); + } else { + cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); + } + } else if (mode >= 1 && cm.getJobId() % 100 % 10 == 2) { + if (cm.getJobId() == 212) { + if (cm.getPlayer().getSkillLevel(2121007) == 0) { + cm.teachSkill(2121007, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(2121005) == 0) { + cm.teachSkill(2121005, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(2121005) == 0) { + cm.teachSkill(2121005, 0, 10, -1); + } + } else if (cm.getJobId() == 222) { + if (cm.getPlayer().getSkillLevel(2221007) == 0) { + cm.teachSkill(2221007, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(2221005) == 0) { + cm.teachSkill(2221005, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(2221003) == 0) { + cm.teachSkill(2221003, 0, 10, -1); + } + } else if (cm.getJobId() == 232) { + if (cm.getPlayer().getSkillLevel(2321008) < 1) { + cm.teachSkill(2321008, 0, 10, -1); + } // Genesis + if (cm.getPlayer().getSkillLevel(2321006) < 1) { + cm.teachSkill(2321006, 0, 10, -1); + } // res + } + cm.sendOk("It is done. Leave me now."); + } + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2081300.js b/scripts/npc/2081300.js index 5d8ef07f42..d088c26ed9 100644 --- a/scripts/npc/2081300.js +++ b/scripts/npc/2081300.js @@ -26,75 +26,82 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 3) { - cm.sendOk("Please don't bother me right now, I am trying to concentrate."); - cm.dispose(); - } else if (!cm.isQuestCompleted(6924)) { - cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); - cm.dispose(); - } else if ( cm.getJobId() % 100 % 10 != 2) { - cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); - } else { - cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); - //cm.dispose(); - } - } else if(status == 1) { - if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { - if (cm.canHold(2280003, 1)) { - cm.changeJobById(cm.getJobId() + 1); - if(cm.getJobId() == 312) { - cm.teachSkill(3121002, 0, 10, -1); - cm.teachSkill(3120005, 0, 10, -1); - cm.teachSkill(3121007, 0, 10, -1); - } else if(cm.getJobId() == 322) { - cm.teachSkill(3221002, 0, 10, -1); - cm.teachSkill(3220004, 0, 10, -1); - cm.teachSkill(3221006, 0, 10, -1); - } - cm.gainItem(2280003, 1); - } else { - cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); - } - } else if(mode >= 0 && cm.getJobId() % 100 % 10 == 2) { - if(cm.getJobId() == 312) { - if(cm.getPlayer().getSkillLevel(3121008) == 0) - cm.teachSkill(3121008 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(3121006) == 0) - cm.teachSkill(3121006 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(3121004) == 0) - cm.teachSkill(3121004 , 0, 10, -1); - } else if(cm.getJobId() == 322) { - if(cm.getPlayer().getSkillLevel(3221007) == 0) - cm.teachSkill(3221007 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(3221005) == 0) - cm.teachSkill(3221005 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(3221001) == 0) - cm.teachSkill(3221001 , 0, 10, -1); - } - cm.sendOk("It is done. Leave me now."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 3) { + cm.sendOk("Please don't bother me right now, I am trying to concentrate."); + cm.dispose(); + } else if (!cm.isQuestCompleted(6924)) { + cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); + cm.dispose(); + } else if (cm.getJobId() % 100 % 10 != 2) { + cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); + } else { + cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); + //cm.dispose(); + } + } else if (status == 1) { + if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { + if (cm.canHold(2280003, 1)) { + cm.changeJobById(cm.getJobId() + 1); + if (cm.getJobId() == 312) { + cm.teachSkill(3121002, 0, 10, -1); + cm.teachSkill(3120005, 0, 10, -1); + cm.teachSkill(3121007, 0, 10, -1); + } else if (cm.getJobId() == 322) { + cm.teachSkill(3221002, 0, 10, -1); + cm.teachSkill(3220004, 0, 10, -1); + cm.teachSkill(3221006, 0, 10, -1); + } + cm.gainItem(2280003, 1); + } else { + cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); + } + } else if (mode >= 0 && cm.getJobId() % 100 % 10 == 2) { + if (cm.getJobId() == 312) { + if (cm.getPlayer().getSkillLevel(3121008) == 0) { + cm.teachSkill(3121008, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(3121006) == 0) { + cm.teachSkill(3121006, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(3121004) == 0) { + cm.teachSkill(3121004, 0, 10, -1); + } + } else if (cm.getJobId() == 322) { + if (cm.getPlayer().getSkillLevel(3221007) == 0) { + cm.teachSkill(3221007, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(3221005) == 0) { + cm.teachSkill(3221005, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(3221001) == 0) { + cm.teachSkill(3221001, 0, 10, -1); + } + } + cm.sendOk("It is done. Leave me now."); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2081400.js b/scripts/npc/2081400.js index c1fd82010e..9b50f646a1 100644 --- a/scripts/npc/2081400.js +++ b/scripts/npc/2081400.js @@ -26,71 +26,76 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 4) { - cm.sendOk("Please don't bother me right now, I am trying to concentrate."); - cm.dispose(); - } else if (!cm.isQuestCompleted(6934)) { - cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); - cm.dispose(); - } else if ( cm.getJobId() % 100 % 10 != 2) { - cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); - } else { - cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); - //cm.dispose(); - } - } else if(status == 1) { - if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { - if (cm.canHold(2280003, 1)) { - cm.changeJobById(cm.getJobId() + 1); - if(cm.getJobId() == 412) { - cm.teachSkill(4120002, 0, 10, -1); - cm.teachSkill(4120005, 0, 10, -1); - cm.teachSkill(4121006, 0, 10, -1); - } else if(cm.getJobId() == 422) { - cm.teachSkill(4220002, 0, 10, -1); - cm.teachSkill(4220005, 0, 10, -1); - cm.teachSkill(4221007, 0, 10, -1); - } - cm.gainItem(2280003, 1); - } else { - cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); - } - } else if(mode >= 1 && cm.getJobId() % 100 % 10 == 2) { - if(cm.getJobId() == 412) { - if(cm.getPlayer().getSkillLevel(4121008) == 0) - cm.teachSkill(4121008 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(4121004) == 0) - cm.teachSkill(4121004 , 0, 10, -1); - } else if(cm.getJobId() == 422) { - if(cm.getPlayer().getSkillLevel(4221004) == 0) - cm.teachSkill(4221004 , 0, 10, -1); - if(cm.getPlayer().getSkillLevel(4221001) == 0) - cm.teachSkill(4221001 , 0, 10, -1); - } - cm.sendOk("It is done. Leave me now."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 4) { + cm.sendOk("Please don't bother me right now, I am trying to concentrate."); + cm.dispose(); + } else if (!cm.isQuestCompleted(6934)) { + cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); + cm.dispose(); + } else if (cm.getJobId() % 100 % 10 != 2) { + cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); + } else { + cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); + //cm.dispose(); + } + } else if (status == 1) { + if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { + if (cm.canHold(2280003, 1)) { + cm.changeJobById(cm.getJobId() + 1); + if (cm.getJobId() == 412) { + cm.teachSkill(4120002, 0, 10, -1); + cm.teachSkill(4120005, 0, 10, -1); + cm.teachSkill(4121006, 0, 10, -1); + } else if (cm.getJobId() == 422) { + cm.teachSkill(4220002, 0, 10, -1); + cm.teachSkill(4220005, 0, 10, -1); + cm.teachSkill(4221007, 0, 10, -1); + } + cm.gainItem(2280003, 1); + } else { + cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); + } + } else if (mode >= 1 && cm.getJobId() % 100 % 10 == 2) { + if (cm.getJobId() == 412) { + if (cm.getPlayer().getSkillLevel(4121008) == 0) { + cm.teachSkill(4121008, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(4121004) == 0) { + cm.teachSkill(4121004, 0, 10, -1); + } + } else if (cm.getJobId() == 422) { + if (cm.getPlayer().getSkillLevel(4221004) == 0) { + cm.teachSkill(4221004, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(4221001) == 0) { + cm.teachSkill(4221001, 0, 10, -1); + } + } + cm.sendOk("It is done. Leave me now."); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2081500.js b/scripts/npc/2081500.js index aa2c83ec92..dc03ff4032 100644 --- a/scripts/npc/2081500.js +++ b/scripts/npc/2081500.js @@ -26,83 +26,93 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 5) { - cm.sendOk("Please don't bother me right now, I am trying to concentrate."); - cm.dispose(); - } else if (!cm.isQuestCompleted(6944)) { - cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); - cm.dispose(); - } else if ( cm.getJobId() % 100 % 10 != 2) { - cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); - } else { - cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); - //cm.dispose(); - } - } else if(status == 1) { - if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { - if (cm.canHold(2280003, 1)) { - cm.changeJobById(cm.getJobId() + 1); - if(cm.getJobId() == 512) { - cm.teachSkill(5121001, 0, 10, -1); - cm.teachSkill(5121002, 0, 10, -1); - cm.teachSkill(5121007, 0, 10, -1); - cm.teachSkill(5121009, 0, 10, -1); - } else if(cm.getJobId() == 522) { - cm.teachSkill(5220001, 0, 10, -1); - cm.teachSkill(5220002, 0, 10, -1); - cm.teachSkill(5221004, 0, 10, -1); - cm.teachSkill(5220011, 0, 10, -1); - } - cm.gainItem(2280003, 1); - } else { - cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); - } - } else if(mode >= 1 && cm.getJobId() % 100 % 10 == 2) { - if(cm.getJobId() == 512) { - if(cm.getPlayer().getSkillLevel(5121003) == 0) - cm.teachSkill(5121003, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5121004) == 0) - cm.teachSkill(5121004, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5121005) == 0) - cm.teachSkill(5121005, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5121010) == 0) - cm.teachSkill(5121010, 0, 10, -1); - } else if(cm.getJobId() == 522) { - if(cm.getPlayer().getSkillLevel(5221006) == 0) - cm.teachSkill(5221006, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5221007) == 0) - cm.teachSkill(5221007, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5221008) == 0) - cm.teachSkill(5221008, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5221009) == 0) - cm.teachSkill(5221009, 0, 10, -1); - if(cm.getPlayer().getSkillLevel(5221003) == 0) - cm.teachSkill(5221003, 0, 10, -1); - } - cm.sendOk("It is done. Leave me now."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 5) { + cm.sendOk("Please don't bother me right now, I am trying to concentrate."); + cm.dispose(); + } else if (!cm.isQuestCompleted(6944)) { + cm.sendOk("You have not yet passed my trials. I can not advance you until you do so."); + cm.dispose(); + } else if (cm.getJobId() % 100 % 10 != 2) { + cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?"); + } else { + cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l"); + //cm.dispose(); + } + } else if (status == 1) { + if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) { + if (cm.canHold(2280003, 1)) { + cm.changeJobById(cm.getJobId() + 1); + if (cm.getJobId() == 512) { + cm.teachSkill(5121001, 0, 10, -1); + cm.teachSkill(5121002, 0, 10, -1); + cm.teachSkill(5121007, 0, 10, -1); + cm.teachSkill(5121009, 0, 10, -1); + } else if (cm.getJobId() == 522) { + cm.teachSkill(5220001, 0, 10, -1); + cm.teachSkill(5220002, 0, 10, -1); + cm.teachSkill(5221004, 0, 10, -1); + cm.teachSkill(5220011, 0, 10, -1); + } + cm.gainItem(2280003, 1); + } else { + cm.sendOk("Please have one slot available on #bUSE#k inventory to receive a skill book."); + } + } else if (mode >= 1 && cm.getJobId() % 100 % 10 == 2) { + if (cm.getJobId() == 512) { + if (cm.getPlayer().getSkillLevel(5121003) == 0) { + cm.teachSkill(5121003, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5121004) == 0) { + cm.teachSkill(5121004, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5121005) == 0) { + cm.teachSkill(5121005, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5121010) == 0) { + cm.teachSkill(5121010, 0, 10, -1); + } + } else if (cm.getJobId() == 522) { + if (cm.getPlayer().getSkillLevel(5221006) == 0) { + cm.teachSkill(5221006, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5221007) == 0) { + cm.teachSkill(5221007, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5221008) == 0) { + cm.teachSkill(5221008, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5221009) == 0) { + cm.teachSkill(5221009, 0, 10, -1); + } + if (cm.getPlayer().getSkillLevel(5221003) == 0) { + cm.teachSkill(5221003, 0, 10, -1); + } + } + cm.sendOk("It is done. Leave me now."); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2082000.js b/scripts/npc/2082000.js index ca1ec50558..c44c5c2c23 100644 --- a/scripts/npc/2082000.js +++ b/scripts/npc/2082000.js @@ -20,40 +20,41 @@ along with this program. If not, see . */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Mue - Leafre Ticketing Booth(240000100) --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.2 - Cleanup by Moogra - 1.1 - Price like GMS [sadiq] - 1.0 - First Version by Information ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Mue - Leafre Ticketing Booth(240000100) + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.2 - Cleanup by Moogra + 1.1 - Price like GMS [sadiq] + 1.0 - First Version by Information + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var cost = 30000; function start() { - cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 10 minutes, beginning on the hour, and it'll cost you #b"+cost+" mesos#k. Are you sure you want to purchase #b#t4031045##k?"); + cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 10 minutes, beginning on the hour, and it'll cost you #b" + cost + " mesos#k. Are you sure you want to purchase #b#t4031045##k?"); } function action(mode, type, selection) { - if(mode == -1) + if (mode == -1) { cm.dispose(); - else { - if(mode == 1) + } else { + if (mode == 1) { status++; - else { + } else { cm.sendNext("You must have some business to take care of here, right?"); cm.dispose(); return; } - if(status == 1) { - if(cm.getMeso() >= cost && cm.canHold(4031045)) { - cm.gainItem(4031045,1); + if (status == 1) { + if (cm.getMeso() >= cost && cm.canHold(4031045)) { + cm.gainItem(4031045, 1); cm.gainMeso(-cost); - } else - cm.sendOk("Are you sure you have #b"+cost+" mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); + } else { + cm.sendOk("Are you sure you have #b" + cost + " mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); + } cm.dispose(); } } diff --git a/scripts/npc/2082001.js b/scripts/npc/2082001.js index 1fa482ab25..c8710c07d1 100644 --- a/scripts/npc/2082001.js +++ b/scripts/npc/2082001.js @@ -1,5 +1,5 @@ function start() { - if(cm.haveItem(4031045)){ + if (cm.haveItem(4031045)) { var em = cm.getEventManager("Cabin"); if (em.getProperty("entry") == "true") { cm.sendYesNo("Do you wish to board the flight?"); @@ -12,11 +12,12 @@ function start() { cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); + cm.sendOk("Okay, talk to me if you change your mind!"); cm.dispose(); - return; + return; } var em = cm.getEventManager("Cabin"); if (em.getProperty("entry") == "true") { diff --git a/scripts/npc/2082002.js b/scripts/npc/2082002.js index ce18d00e9d..3437595ad1 100644 --- a/scripts/npc/2082002.js +++ b/scripts/npc/2082002.js @@ -34,7 +34,7 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); + cm.sendNext("Alright, see you next time. Take care."); status++; } else if (status == 2) { cm.warp(240000110, 0);// back to Leafre diff --git a/scripts/npc/2082003.js b/scripts/npc/2082003.js index 0a88cb81aa..9fa47e7b03 100644 --- a/scripts/npc/2082003.js +++ b/scripts/npc/2082003.js @@ -3,9 +3,9 @@ function start() { } function action(m, t, s) { - if (m > 0){ - cm.useItem(2210016); - cm.warp(200090500, 0); - } - cm.dispose(); + if (m > 0) { + cm.useItem(2210016); + cm.warp(200090500, 0); + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2082004.js b/scripts/npc/2082004.js index b30854f31e..faf7e91773 100644 --- a/scripts/npc/2082004.js +++ b/scripts/npc/2082004.js @@ -22,28 +22,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Hi, I am Andy, the time traveler from a not so distant future. I have come to avert the creation of machines by the greedy people of this time. They went berserk on my time and consumed everything to dust. I must stop it at any cost!"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Hi, I am Andy, the time traveler from a not so distant future. I have come to avert the creation of machines by the greedy people of this time. They went berserk on my time and consumed everything to dust. I must stop it at any cost!"); + cm.dispose(); + } + } } diff --git a/scripts/npc/2082014.js b/scripts/npc/2082014.js index 291e0b3ded..c7726f98e5 100644 --- a/scripts/npc/2082014.js +++ b/scripts/npc/2082014.js @@ -19,36 +19,37 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const YamlConfig = Java.type('config.YamlConfig'); - if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { - cm.openShopNPC(2082014); - } else if (cm.isQuestStarted(3749)) { - cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission."); - } else { - cm.sendDefault(); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + cm.openShopNPC(2082014); + } else if (cm.isQuestStarted(3749)) { + cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission."); + } else { + cm.sendDefault(); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2083000.js b/scripts/npc/2083000.js index 96622940da..6fd013f1b1 100644 --- a/scripts/npc/2083000.js +++ b/scripts/npc/2083000.js @@ -38,16 +38,17 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { const YamlConfig = Java.type('config.YamlConfig'); - if(cm.haveItem(4001086)) { + if (cm.haveItem(4001086)) { cm.sendYesNo("Do you want to access #b#m240050400##k right now?"); - } else if(YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) { - if(canBypassHTPQ()) { + } else if (YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS) { + if (canBypassHTPQ()) { cm.sendYesNo("Do you want to access #b#m240050400##k right now?"); } else { cm.sendOk("Those who don't have the #r#t4001086##k must prove their valor before challenging #bHorntail#k. Come here holding the #r3 certificates#k that proves you're worthy to || the task."); // NPC picture is so long it goes through some section of text, || to fill up that space @@ -57,8 +58,7 @@ function action(mode, type, selection) { cm.sendOk("Those who don't have the #r#t4001086##k must prove their valor before challenging #bHorntail#k."); cm.dispose(); } - } - else { + } else { cm.warp(240050400); cm.dispose(); } diff --git a/scripts/npc/2083001.js b/scripts/npc/2083001.js index a39772aa07..32a9c06d04 100644 --- a/scripts/npc/2083001.js +++ b/scripts/npc/2083001.js @@ -23,7 +23,7 @@ * @npc: Mark of the Squad * @map: Cave of Life - Cave Entrance (240050000) * @func: Horntail PQ -*/ + */ var status = 0; var price = 100000; @@ -31,104 +31,104 @@ var em = null; var hasPass; function isRecruitingMap(mapid) { - return mapid == 240050000; + return mapid == 240050000; } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(isRecruitingMap(cm.getMapId())) { - if (status == 0) { - em = cm.getEventManager("HorntailPQ"); - if(em == null) { - cm.sendOk("The Horntail PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the path to Horntail's lair. If you want to face him, you and your team shall be tested on the trial grounds ahead.#b\r\n#L0#Let us pass to the trial grounds.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("Either I cannot accept some members of your party inside the cave or you team is lacking. Solve this problem then talk to me!"); - } - - cm.dispose(); - } - } else if(selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nAs the gatekeeper of Horntail's lair, I will grant access #bjust to those worthy#k of his presence. Even for those people, the path inside is that of a maze, full of branches and trials. However, those #radept at fighting squad bosses#k have a better chance to stand to our leader, although those #rof our kind#k have a shabby chance as well."); - cm.dispose(); - } - } - } else { - if(!cm.isEventLeader()) { - cm.sendOk("Only your party leader is allowed to interact with the Schedule."); - } else if(cm.getMapId() == 240050100) { - if(cm.haveItem(4001087) && cm.haveItem(4001088) && cm.haveItem(4001089) && cm.haveItem(4001090) && cm.haveItem(4001091)) { - cm.gainItem(4001087, -1); - cm.gainItem(4001088, -1); - cm.gainItem(4001089, -1); - cm.gainItem(4001090, -1); - cm.gainItem(4001091, -1); - - cm.getEventInstance().warpEventTeam(240050200); - } else { - cm.sendOk("You don't have all the keys needed to proceed."); - } - } else if(cm.getMapId() == 240050300) { - if(cm.haveItem(4001092, 1) && cm.haveItem(4001093, 6)) { - cm.gainItem(4001092, -1); - cm.gainItem(4001093, -6); - cm.getEventInstance().clearPQ(); - } else { - cm.sendOk("Check if you have got all 6 Red keys and 1 Blue key with you."); - } - } else if(cm.getMapId() == 240050310) { - if(cm.haveItem(4001092, 1) && cm.haveItem(4001093, 6)) { - cm.gainItem(4001092, -1); - cm.gainItem(4001093, -6); - cm.getEventInstance().clearPQ(); - } else { - cm.sendOk("Check if you have got all 6 Red keys and 1 Blue key with you."); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (isRecruitingMap(cm.getMapId())) { + if (status == 0) { + em = cm.getEventManager("HorntailPQ"); + if (em == null) { + cm.sendOk("The Horntail PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the path to Horntail's lair. If you want to face him, you and your team shall be tested on the trial grounds ahead.#b\r\n#L0#Let us pass to the trial grounds.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("Either I cannot accept some members of your party inside the cave or you team is lacking. Solve this problem then talk to me!"); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nAs the gatekeeper of Horntail's lair, I will grant access #bjust to those worthy#k of his presence. Even for those people, the path inside is that of a maze, full of branches and trials. However, those #radept at fighting squad bosses#k have a better chance to stand to our leader, although those #rof our kind#k have a shabby chance as well."); + cm.dispose(); + } + } + } else { + if (!cm.isEventLeader()) { + cm.sendOk("Only your party leader is allowed to interact with the Schedule."); + } else if (cm.getMapId() == 240050100) { + if (cm.haveItem(4001087) && cm.haveItem(4001088) && cm.haveItem(4001089) && cm.haveItem(4001090) && cm.haveItem(4001091)) { + cm.gainItem(4001087, -1); + cm.gainItem(4001088, -1); + cm.gainItem(4001089, -1); + cm.gainItem(4001090, -1); + cm.gainItem(4001091, -1); + + cm.getEventInstance().warpEventTeam(240050200); + } else { + cm.sendOk("You don't have all the keys needed to proceed."); + } + } else if (cm.getMapId() == 240050300) { + if (cm.haveItem(4001092, 1) && cm.haveItem(4001093, 6)) { + cm.gainItem(4001092, -1); + cm.gainItem(4001093, -6); + cm.getEventInstance().clearPQ(); + } else { + cm.sendOk("Check if you have got all 6 Red keys and 1 Blue key with you."); + } + } else if (cm.getMapId() == 240050310) { + if (cm.haveItem(4001092, 1) && cm.haveItem(4001093, 6)) { + cm.gainItem(4001092, -1); + cm.gainItem(4001093, -6); + cm.getEventInstance().clearPQ(); + } else { + cm.sendOk("Check if you have got all 6 Red keys and 1 Blue key with you."); + } + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2083002.js b/scripts/npc/2083002.js index c7cbd07632..cd5b101116 100644 --- a/scripts/npc/2083002.js +++ b/scripts/npc/2083002.js @@ -30,12 +30,15 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { - if(cm.getMapId() > 240050400) cm.warp(240050600); - else cm.warp(240040700, "out00"); - + } else { + if (cm.getMapId() > 240050400) { + cm.warp(240050600); + } else { + cm.warp(240040700, "out00"); + } + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2083004.js b/scripts/npc/2083004.js index 5c7d0f7ef0..6523026d2d 100644 --- a/scripts/npc/2083004.js +++ b/scripts/npc/2083004.js @@ -80,12 +80,12 @@ function action(mode, type, selection) { } else if (expedition.isInProgress()) { //Only if the expedition is in progress if (expedition.contains(player)) { //If you're registered, warp you in var eim = em.getInstance(expedName + player.getClient().getChannel()); - if(eim.getIntProperty("canJoin") == 1) { + if (eim.getIntProperty("canJoin") == 1) { eim.registerPlayer(player); } else { cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls."); } - + cm.dispose(); } else { //If you're not in by now, tough luck cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); @@ -95,12 +95,12 @@ function action(mode, type, selection) { } else if (status == 1) { if (selection == 1) { expedition = cm.getExpedition(exped); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(exped); if (res == 0) { cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -109,13 +109,13 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + "."); cm.dispose(); - return; + } } else if (status == 2) { if (selection == 1) { @@ -140,14 +140,14 @@ function action(mode, type, selection) { status = 6; } else if (selection == 2) { var min = exped.getMinSize(); - + var size = expedition.getMemberList().size(); if (size < min) { cm.sendOk("You need at least " + min + " players registered in your expedition."); cm.dispose(); return; } - + cm.sendOk("Good luck! All of Leafre is counting on you."); status = 4; } else if (selection == 3) { @@ -156,7 +156,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -167,14 +167,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/2083005.js b/scripts/npc/2083005.js index fa19b5922e..b8bdfcaad0 100644 --- a/scripts/npc/2083005.js +++ b/scripts/npc/2083005.js @@ -20,17 +20,17 @@ along with this program. If not, see . */ /** -Fountain of Life 2083005 -**/ + Fountain of Life 2083005 + **/ function start() { - if(cm.isQuestStarted(6280)) { - if(cm.hasItem(4031454)) { + if (cm.isQuestStarted(6280)) { + if (cm.hasItem(4031454)) { cm.sendOk("(You poured some water from the fountain into the cup.)"); cm.gainItem(4031454, -1); cm.gainItem(4031455, 1); } } - + cm.dispose(); } diff --git a/scripts/npc/2083006.js b/scripts/npc/2083006.js index f53b9c1db4..161a572562 100644 --- a/scripts/npc/2083006.js +++ b/scripts/npc/2083006.js @@ -8,88 +8,89 @@ var array = ["Year 2021 - Average Town Entrance", "Year 2099 - Midnight Harbor E var limit; function start() { - if(!cm.isQuestCompleted(3718)) { - cm.sendOk("The time machine has not been activated yet."); - cm.dispose(); - return; + if (!cm.isQuestCompleted(3718)) { + cm.sendOk("The time machine has not been activated yet."); + cm.dispose(); + return; + } + + for (limit = 0; limit < quests.length; limit++) { + if (!cm.isQuestCompleted(quests[limit])) { + break; } - - for(limit = 0; limit < quests.length; limit++) { - if(!cm.isQuestCompleted(quests[limit])) { - break; - } - } - - if(limit == 0) { - cm.sendOk("Prove your valor against the #bGuardian Nex#k before unlocking next Neo City maps."); - cm.dispose(); - return; - } - - status = -1; - action(1, 0, 0); + } + + if (limit == 0) { + cm.sendOk("Prove your valor against the #bGuardian Nex#k before unlocking next Neo City maps."); + cm.dispose(); + return; + } + + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - var menuSel = generateSelectionMenu(array, limit); - cm.sendSimple(menuSel); - } else if(status == 1) { - var mapid = 0; - - switch (selection) { - case 0: - mapid = 240070100; - break; - case 1: - mapid = 240070200; - break; - case 2: - mapid = 240070300; - break; - case 3: - mapid = 240070400; - break; - case 4: - mapid = 240070500; - break; - case 5: - mapid = 240070600; - break; - /*case 6: - mapid = 683070400; - break;*/ - } - - if (mapid > 0) { - cm.warp(mapid, 1); - } else { - cm.sendOk("Complete your mission first."); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var menuSel = generateSelectionMenu(array, limit); + cm.sendSimple(menuSel); + } else if (status == 1) { + var mapid = 0; + + switch (selection) { + case 0: + mapid = 240070100; + break; + case 1: + mapid = 240070200; + break; + case 2: + mapid = 240070300; + break; + case 3: + mapid = 240070400; + break; + case 4: + mapid = 240070500; + break; + case 5: + mapid = 240070600; + break; + /*case 6: + mapid = 683070400; + break;*/ + } + + if (mapid > 0) { + cm.warp(mapid, 1); + } else { + cm.sendOk("Complete your mission first."); + } + } + } } function generateSelectionMenu(array, limit) { // nice tool for generating a string for the sendSimple functionality - var menu = ""; - - var len = Math.min(limit, array.length); - for (var i = 0; i < len; i++) { - menu += "#L" + i + "#" + array[i] + "#l\r\n"; - } - return menu; + var menu = ""; + + var len = Math.min(limit, array.length); + for (var i = 0; i < len; i++) { + menu += "#L" + i + "#" + array[i] + "#l\r\n"; + } + return menu; } \ No newline at end of file diff --git a/scripts/npc/2090000.js b/scripts/npc/2090000.js index bf5b4633d0..eec40ef162 100644 --- a/scripts/npc/2090000.js +++ b/scripts/npc/2090000.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2090000); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2090000); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2090004.js b/scripts/npc/2090004.js index 4c720bdf03..b3d3d9da23 100644 --- a/scripts/npc/2090004.js +++ b/scripts/npc/2090004.js @@ -21,247 +21,250 @@ var matQtySet; var matQtyMeso; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == 1) - status++; - else { - cm.sendOk("Oh, talk to me when you have decided what you want from me. I am very busy right now."); - cm.dispose(); + if (mode == 1) { + status++; + } else { + cm.sendOk("Oh, talk to me when you have decided what you want from me. I am very busy right now."); + cm.dispose(); + return; + } + + if (status == 0) { + if (cm.isQuestActive(3821) && !cm.haveItem(4031554) && !cm.haveItem(4161030) && cm.isQuestCompleted(3830)) { + //player lost his book, help him complete quest anyways + + if (cm.canHold(4031554)) { + cm.sendOk("Oh, the boy wanted you to bring him a #t4031554#? No problem, I was on his debt anyway. Now, tell him I am repaying the debt, OK?"); + cm.gainItem(4031554, 1); + cm.dispose(); return; - } - - if (status == 0) { - if (cm.isQuestActive(3821) && !cm.haveItem(4031554) && !cm.haveItem(4161030) && cm.isQuestCompleted(3830)) { - //player lost his book, help him complete quest anyways - - if(cm.canHold(4031554)) { - cm.sendOk("Oh, the boy wanted you to bring him a #t4031554#? No problem, I was on his debt anyway. Now, tell him I am repaying the debt, OK?"); - cm.gainItem(4031554, 1); - cm.dispose(); - return; - } - else { - cm.sendOk("Oh, the boy wanted you to bring him a #t4031554#? Make room at your ETC inventory first."); - cm.dispose(); - return; - } - } - var selStr = "I am a man of many talents. Let me know what you'd like to do. #b" - var options = new Array("Make a medicine","Make a scroll","Donate medicine ingredients"); - for (var i = 0; i < options.length; i++){ - selStr += "\r\n#L" + i + "# " + options[i] + "#l"; - } - - cm.sendSimple(selStr); - } else if (status == 1) { - selectedType = selection; - var selStr; - if (selectedType == 0){ //Make a medicine - itemSet = new Array(2022145,2022146,2022147,2022148,2022149,2022150,2050004,4031554); - matSet = new Array(2022116,2022116,new Array(4000281,4000293),new Array(4000276,2002005),new Array(4000288,4000292),4000295,new Array(2022131,2022132),new Array(4000286,4000287,4000293)); - matQtySet = new Array(3,3,new Array(10,10),new Array(20,1),new Array(20,20),10,new Array(1,1),new Array(20,20,20)); - matQtyMeso = new Array(0,0,910,950,1940,600,700,1000); - - if(!cm.haveItem(4161030)) { - cm.sendNext("If you want to make a medicine, you must study the Book on Herbal Medicine first. Nothing is more dangerous than practicing a medicine without proper knowledge."); - cm.dispose(); - return; - } - - selStr = "What kind of medicine are you interested in making?#b"; - - for (var i = 0; i < itemSet.length; i++){ - selStr += "\r\n#L" + i + "# #v" + itemSet[i] + "# #t" + itemSet[i] + "##l"; - } - selStr += "#k"; - } - else if(selectedType == 1){ //Make a scroll - status++; - - selStr = "What kind of scrolls are you interested in making?#b"; - itemSet = new Array("Scroll for One-Handed Sword for ATT", "Scroll for One-Handed Axe for ATT", "Scroll for One-Handed BW for ATT", - "Scroll for Dagger for ATT","Scroll for Wand for Magic Att.","Scroll for Staff for Magic Att.", - "Scroll for Two-handed Sword for ATT.","Scroll for Two-handed Axe for ATT","Scroll for Two-handed BW for ATT", - "Scroll for Spear for ATT","Scroll for Pole Arm for ATT","Scroll for Bow for ATT","Scroll for Crossbow for ATT ", - "Scroll for Claw for ATT","Scroll for Knuckle for ATT","Scroll for Gun for ATT#k"); - - for (var i = 0; i < itemSet.length; i++){ - selStr += "\r\n#L" + i + "# " + itemSet[i] + "#l"; - } - } - else {//Donate medicine ingredients - status++; - - selStr = "So you wish to donate some medicine ingredients? This is great news! Donations will be accepted in the unit of #b100#k. The donator will receive a marble that enables one to make a scroll. Which of these would you like to donate? #b"; - itemSet = new Array(4000276,4000277,4000278,4000279,4000280,4000291,4000292,4000286,4000287,4000293,4000294,4000298,4000284,4000288,4000285,4000282,4000295,4000289,4000296,4000297); - - for (var i = 0; i < itemSet.length; i++){ - selStr += "\r\n#L" + i + "# #v" + itemSet[i] + "# #t" + itemSet[i] + "##l"; - } - } - - cm.sendSimple(selStr); - } - else if (status == 2) { - selectedItem = selection; - cm.sendGetText("How many #b#t" + itemSet[selectedItem] + "##k do you want to make?"); + } else { + cm.sendOk("Oh, the boy wanted you to bring him a #t4031554#? Make room at your ETC inventory first."); + cm.dispose(); + return; + } } - else if (status == 3) { - if(selectedType == 0) { //Medicines - var text = cm.getText(); - makeQty = parseInt(text); - if(isNaN(makeQty)) makeQty = 1; - - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - matMeso = matQtyMeso[selectedItem]; - - var prompt = "You want to make #b" + makeQty + " #t" + item + "##k? In order to make " + makeQty + " #t" + item +"#, you'll need the following items:\r\n"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i]*makeQty + " #t" + mats[i] + "#"; - } - } - else prompt += "\r\n#i"+mats+"# " + matQty*makeQty + " #t" + mats + "#"; - - if (matMeso > 0) - prompt += "\r\n#i4031138# " + matMeso*makeQty + " meso"; - - cm.sendYesNo(prompt); + var selStr = "I am a man of many talents. Let me know what you'd like to do. #b" + var options = ["Make a medicine", "Make a scroll", "Donate medicine ingredients"]; + for (var i = 0; i < options.length; i++) { + selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } + + cm.sendSimple(selStr); + } else if (status == 1) { + selectedType = selection; + var selStr; + if (selectedType == 0) { //Make a medicine + itemSet = [2022145, 2022146, 2022147, 2022148, 2022149, 2022150, 2050004, 4031554]; + matSet = [2022116, 2022116, [4000281, 4000293], [4000276, 2002005], [4000288, 4000292], 4000295, [2022131, 2022132], [4000286, 4000287, 4000293]]; + matQtySet = [3, 3, [10, 10], [20, 1], [20, 20], 10, [1, 1], [20, 20, 20]]; + matQtyMeso = [0, 0, 910, 950, 1940, 600, 700, 1000]; + + if (!cm.haveItem(4161030)) { + cm.sendNext("If you want to make a medicine, you must study the Book on Herbal Medicine first. Nothing is more dangerous than practicing a medicine without proper knowledge."); + cm.dispose(); + return; + } + + selStr = "What kind of medicine are you interested in making?#b"; + + for (var i = 0; i < itemSet.length; i++) { + selStr += "\r\n#L" + i + "# #v" + itemSet[i] + "# #t" + itemSet[i] + "##l"; + } + selStr += "#k"; + } else if (selectedType == 1) { //Make a scroll + status++; + + selStr = "What kind of scrolls are you interested in making?#b"; + itemSet = ["Scroll for One-Handed Sword for ATT", "Scroll for One-Handed Axe for ATT", "Scroll for One-Handed BW for ATT", + "Scroll for Dagger for ATT", "Scroll for Wand for Magic Att.", "Scroll for Staff for Magic Att.", + "Scroll for Two-handed Sword for ATT.", "Scroll for Two-handed Axe for ATT", "Scroll for Two-handed BW for ATT", + "Scroll for Spear for ATT", "Scroll for Pole Arm for ATT", "Scroll for Bow for ATT", "Scroll for Crossbow for ATT ", + "Scroll for Claw for ATT", "Scroll for Knuckle for ATT", "Scroll for Gun for ATT#k"]; + + for (var i = 0; i < itemSet.length; i++) { + selStr += "\r\n#L" + i + "# " + itemSet[i] + "#l"; + } + } else {//Donate medicine ingredients + status++; + + selStr = "So you wish to donate some medicine ingredients? This is great news! Donations will be accepted in the unit of #b100#k. The donator will receive a marble that enables one to make a scroll. Which of these would you like to donate? #b"; + itemSet = [4000276, 4000277, 4000278, 4000279, 4000280, 4000291, 4000292, 4000286, 4000287, 4000293, 4000294, 4000298, 4000284, 4000288, 4000285, 4000282, 4000295, 4000289, 4000296, 4000297]; + + for (var i = 0; i < itemSet.length; i++) { + selStr += "\r\n#L" + i + "# #v" + itemSet[i] + "# #t" + itemSet[i] + "##l"; + } + } + + cm.sendSimple(selStr); + } else if (status == 2) { + selectedItem = selection; + cm.sendGetText("How many #b#t" + itemSet[selectedItem] + "##k do you want to make?"); + } else if (status == 3) { + if (selectedType == 0) { //Medicines + var text = cm.getText(); + makeQty = parseInt(text); + if (isNaN(makeQty)) { + makeQty = 1; + } + + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + matMeso = matQtyMeso[selectedItem]; + + var prompt = "You want to make #b" + makeQty + " #t" + item + "##k? In order to make " + makeQty + " #t" + item + "#, you'll need the following items:\r\n"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * makeQty + " #t" + mats[i] + "#"; } - - else if (selectedType == 1){ //Scrolls - selectedItem = selection; - - itemSet = new Array(2043000,2043100,2043200,2043300,2043700,2043800,2044000,2044100,2044200,2044300,2044400,2044500,2044600,2044700,2044800,2044900); - matSet = new Array(new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001), - new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001), - new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001),new Array(4001124,4010001)); - matQtySet = new Array(new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10), - new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10),new Array(100, 10), - new Array(100, 10)); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - var prompt = "You want to make #b#t" + item + "##k? In order to make #t" + item +"# you'll need the following items:"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; - } - } - else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; - } - - cm.sendYesNo(prompt); - } - else if(selectedType == 2){ - selectedItem = selection; - - itemSet = new Array(4000276,4000277,4000278,4000279,4000280,4000291,4000292,4000286,4000287,4000293,4000294,4000298,4000284,4000288,4000285,4000282,4000295,4000289,4000296,4000297); - rewdSet = new Array(7,7,new Array(7,8),10,11,8,new Array(7,8),new Array(7,9),new Array(7,8),9,10,new Array(10,11),11,new Array(11,12),13,13,14,15,new Array(15,16),17); - - item = itemSet[selectedItem]; - var prompt = "Are you sure you want to donate #b100 #t " + item + "##k?"; - cm.sendYesNo(prompt); - } - } - else if (status == 4) { - if(selectedType == 0) { - var complete = true; - if (mats instanceof Array) { - for(var i = 0; i < mats.length; i++) { - if(!cm.haveItem(mats[i], matQty[i]*makeQty)) complete = false; - } - } - else { - if(!cm.haveItem(mats, matQty*makeQty)) complete = false; - } - - if(cm.getMeso() < matMeso*makeQty) complete = false; + } else { + prompt += "\r\n#i" + mats + "# " + matQty * makeQty + " #t" + mats + "#"; + } - if (!complete || !cm.canHold(item, makeQty)) - cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your use inventory."); - else { - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ - cm.gainItem(mats[i], -matQty[i]*makeQty); - } - } - else { - cm.gainItem(mats, -matQty*makeQty); - } + if (matMeso > 0) { + prompt += "\r\n#i4031138# " + matMeso * makeQty + " meso"; + } - if(matMeso > 0) cm.gainMeso(-matMeso*makeQty); - cm.gainItem(item,makeQty); - } + cm.sendYesNo(prompt); + } else if (selectedType == 1) { //Scrolls + selectedItem = selection; - cm.dispose(); + itemSet = [2043000, 2043100, 2043200, 2043300, 2043700, 2043800, 2044000, 2044100, 2044200, 2044300, 2044400, 2044500, 2044600, 2044700, 2044800, 2044900]; + matSet = [[4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], + [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], + [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001], [4001124, 4010001]]; + matQtySet = [[100, 10], [100, 10], [100, 10], [100, 10], [100, 10], [100, 10], [100, 10], + [100, 10], [100, 10], [100, 10], [100, 10], [100, 10], [100, 10], [100, 10], [100, 10], + [100, 10]]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + var prompt = "You want to make #b#t" + item + "##k? In order to make #t" + item + "# you'll need the following items:"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } - else if(selectedType == 1) { - var complete = true; - if (mats instanceof Array) { - for(var i = 0; i < mats.length; i++) { - if(!cm.haveItem(mats[i], matQty[i])) - complete = false; - } - } - else { - if(!cm.haveItem(mats, matQty)) - complete = false; - } - - if(Math.random() >= 0.9) //A lucky find! Scroll 60% - item += 1; + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; + } - if (!complete || !cm.canHold(item, 1)) - cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your use inventory."); - else { - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ - cm.gainItem(mats[i], -matQty[i]); - } - } - else - cm.gainItem(mats, -matQty); + cm.sendYesNo(prompt); + } else if (selectedType == 2) { + selectedItem = selection; - cm.gainItem(item, 1); - } + itemSet = [4000276, 4000277, 4000278, 4000279, 4000280, 4000291, 4000292, 4000286, 4000287, 4000293, 4000294, 4000298, 4000284, 4000288, 4000285, 4000282, 4000295, 4000289, 4000296, 4000297]; + rewdSet = [7, 7, [7, 8], 10, 11, 8, [7, 8], [7, 9], [7, 8], 9, 10, [10, 11], 11, [11, 12], 13, 13, 14, 15, [15, 16], 17]; - cm.dispose(); - } - else if(selectedType == 2) { - var complete = true; - - if(!cm.haveItem(item, 100)) - complete = false; - - if(!complete) { - cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your etc inventory."); - cm.dispose(); - return; - } - - var reward; - if (rewdSet[selectedItem] instanceof Array) { - var length = rewdSet[selectedItem][1] - rewdSet[selectedItem][0]; - reward = rewdSet[selectedItem][0] + Math.round(Math.random() * length); - } - else reward = rewdSet[selectedItem]; - - if (!cm.canHold(4001124, reward)) - cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your etc inventory."); - else { - cm.gainItem(item, -100); - cm.gainItem(4001124, reward); - } - - cm.dispose(); + item = itemSet[selectedItem]; + var prompt = "Are you sure you want to donate #b100 #t " + item + "##k?"; + cm.sendYesNo(prompt); + } + } else if (status == 4) { + if (selectedType == 0) { + var complete = true; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * makeQty)) { + complete = false; + } } - } + } else { + if (!cm.haveItem(mats, matQty * makeQty)) { + complete = false; + } + } + + if (cm.getMeso() < matMeso * makeQty) { + complete = false; + } + + if (!complete || !cm.canHold(item, makeQty)) { + cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your use inventory."); + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + cm.gainItem(mats[i], -matQty[i] * makeQty); + } + } else { + cm.gainItem(mats, -matQty * makeQty); + } + + if (matMeso > 0) { + cm.gainMeso(-matMeso * makeQty); + } + cm.gainItem(item, makeQty); + } + + cm.dispose(); + } else if (selectedType == 1) { + var complete = true; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i])) { + complete = false; + } + } + } else { + if (!cm.haveItem(mats, matQty)) { + complete = false; + } + } + + if (Math.random() >= 0.9) //A lucky find! Scroll 60% + { + item += 1; + } + + if (!complete || !cm.canHold(item, 1)) { + cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your use inventory."); + } else { + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + cm.gainItem(mats[i], -matQty[i]); + } + } else { + cm.gainItem(mats, -matQty); + } + + cm.gainItem(item, 1); + } + + cm.dispose(); + } else if (selectedType == 2) { + var complete = true; + + if (!cm.haveItem(item, 100)) { + complete = false; + } + + if (!complete) { + cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your etc inventory."); + cm.dispose(); + return; + } + + var reward; + if (rewdSet[selectedItem] instanceof Array) { + var length = rewdSet[selectedItem][1] - rewdSet[selectedItem][0]; + reward = rewdSet[selectedItem][0] + Math.round(Math.random() * length); + } else { + reward = rewdSet[selectedItem]; + } + + if (!cm.canHold(4001124, reward)) { + cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your etc inventory."); + } else { + cm.gainItem(item, -100); + cm.gainItem(4001124, reward); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2090005.js b/scripts/npc/2090005.js index be092366f1..bb3fd91ba6 100644 --- a/scripts/npc/2090005.js +++ b/scripts/npc/2090005.js @@ -1,16 +1,16 @@ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Hak - Cabin (200000141) / Mu Lung Temple(250000100) / Herb Town(251000000) --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.1 - Text and statement fix [Information] - 1.0 - First Version by Information ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Hak - Cabin (200000141) / Mu Lung Temple(250000100) / Herb Town(251000000) + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.1 - Text and statement fix [Information] + 1.0 - First Version by Information + --------------------------------------------------------------------------------------------------- + **/ -var menu = new Array("Mu Lung","Orbis","Herb Town","Mu Lung"); -var cost = new Array(1500,1500,500,1500); +var menu = ["Mu Lung", "Orbis", "Herb Town", "Mu Lung"]; +var cost = [1500, 1500, 500, 1500]; var hak; var slct; var display = ""; @@ -25,47 +25,47 @@ function start() { } function action(mode, type, selection) { - if(mode == -1) { + if (mode == -1) { cm.dispose(); - return; + } else { - if(mode == 0 && status == 0) { + if (mode == 0 && status == 0) { cm.dispose(); return; - } else if(mode == 0) { + } else if (mode == 0) { cm.sendNext("OK. If you ever change your mind, please let me know."); cm.dispose(); return; } status++; if (status == 0) { - for(var i=0; i < menu.length; i++) { - if(cm.getPlayer().getMapId() == 200000141 && i < 1) { - display += "\r\n#L"+i+"##b"+menu[i]+"("+cost[i]+" mesos)#k"; - } else if(cm.getPlayer().getMapId() == 250000100 && i > 0 && i < 3) { - display += "\r\n#L"+i+"##b"+menu[i]+"("+cost[i]+" mesos)#k"; + for (var i = 0; i < menu.length; i++) { + if (cm.getPlayer().getMapId() == 200000141 && i < 1) { + display += "\r\n#L" + i + "##b" + menu[i] + "(" + cost[i] + " mesos)#k"; + } else if (cm.getPlayer().getMapId() == 250000100 && i > 0 && i < 3) { + display += "\r\n#L" + i + "##b" + menu[i] + "(" + cost[i] + " mesos)#k"; } } - if(cm.getPlayer().getMapId() == 200000141 || cm.getPlayer().getMapId() == 251000000) { + if (cm.getPlayer().getMapId() == 200000141 || cm.getPlayer().getMapId() == 251000000) { btwmsg = "#bOrbis#k to #bMu Lung#k"; - } else if(cm.getPlayer().getMapId() == 250000100) { + } else if (cm.getPlayer().getMapId() == 250000100) { btwmsg = "#bMu Lung#k to #bOrbis#k"; } - if(cm.getPlayer().getMapId() == 251000000) { - cm.sendYesNo("Hello there. How's the traveling so far? I've been transporting other travelers like you to #b"+menu[3]+"#k in no time, and... are you interested? It's not as stable as the ship, so you'll have to hold on tight, but i can get there much faster than the ship. I'll take you there as long as you pay #b"+cost[2]+" mesos#k."); + if (cm.getPlayer().getMapId() == 251000000) { + cm.sendYesNo("Hello there. How's the traveling so far? I've been transporting other travelers like you to #b" + menu[3] + "#k in no time, and... are you interested? It's not as stable as the ship, so you'll have to hold on tight, but i can get there much faster than the ship. I'll take you there as long as you pay #b" + cost[2] + " mesos#k."); status++; - } else if(cm.getPlayer().getMapId() == 250000100) { - cm.sendSimple("Hello there. How's the traveling so far? I understand that walking on two legs is much harder to cover ground compared to someone like me that can navigate the skies. I've been transporting other travelers like you to other regions in no time, and... are you interested? If so, then select the town you'd like yo head to.\r\n"+display); + } else if (cm.getPlayer().getMapId() == 250000100) { + cm.sendSimple("Hello there. How's the traveling so far? I understand that walking on two legs is much harder to cover ground compared to someone like me that can navigate the skies. I've been transporting other travelers like you to other regions in no time, and... are you interested? If so, then select the town you'd like yo head to.\r\n" + display); } else { - cm.sendSimple("Hello there. How's the traveling so far? I've been transporting other travelers like you to other regions in no time, and... are you interested? If so, then select the town you'd like to head to.\r\n"+display); + cm.sendSimple("Hello there. How's the traveling so far? I've been transporting other travelers like you to other regions in no time, and... are you interested? If so, then select the town you'd like to head to.\r\n" + display); } - } else if(status == 1) { + } else if (status == 1) { slct = selection; - cm.sendYesNo("Will you move to #b"+menu[selection]+"#k now? If you have #b"+cost[selection]+" mesos#k, I'll take you there right now."); + cm.sendYesNo("Will you move to #b" + menu[selection] + "#k now? If you have #b" + cost[selection] + " mesos#k, I'll take you there right now."); - } else if(status == 2) { - if(slct == 2) { - if(cm.getMeso() < cost[2]) { + } else if (status == 2) { + if (slct == 2) { + if (cm.getMeso() < cost[2]) { cm.sendNext("Are you sure you have enough mesos?"); cm.dispose(); } else { @@ -73,28 +73,26 @@ function action(mode, type, selection) { cm.warp(251000000, 0); cm.dispose(); } - } - - else { - if(cm.getMeso() < cost[slct]) { - cm.sendNext("Are you sure you have enough mesos?"); - cm.dispose(); + } else { + if (cm.getMeso() < cost[slct]) { + cm.sendNext("Are you sure you have enough mesos?"); + cm.dispose(); } else { - if(cm.getPlayer().getMapId() == 251000000) { - cm.gainMeso(-cost[2]); - cm.warp(250000100, 0); - cm.dispose(); - } else { - var em = cm.getEventManager("Hak"); - if (!em.startInstance(cm.getPlayer())) { - cm.sendOk("Uh... We are currently taking requests from too many maplers right now... Please try again in a bit."); - cm.dispose(); - return; - } - - cm.gainMeso(-cost[slct]); + if (cm.getPlayer().getMapId() == 251000000) { + cm.gainMeso(-cost[2]); + cm.warp(250000100, 0); + cm.dispose(); + } else { + var em = cm.getEventManager("Hak"); + if (!em.startInstance(cm.getPlayer())) { + cm.sendOk("Uh... We are currently taking requests from too many maplers right now... Please try again in a bit."); cm.dispose(); + return; } + + cm.gainMeso(-cost[slct]); + cm.dispose(); + } } } } diff --git a/scripts/npc/2090100.js b/scripts/npc/2090100.js index a4e7ad8b81..7b7906083d 100644 --- a/scripts/npc/2090100.js +++ b/scripts/npc/2090100.js @@ -46,22 +46,23 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection == 1) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { + for (var i = 0; i < mhair_v.length; i++) { pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) { + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -71,20 +72,19 @@ function action(mode, type, selection) { beauty = 2; haircolor = Array(); var current = parseInt(cm.getPlayer().getHair() - /10)*10; - for(var i = 0; i < 8; i++) { + / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t5151020##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420006)){ + if (beauty == 1) { + if (cm.haveItem(5420006)) { cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150025)){ + } else if (cm.haveItem(5150025)) { cm.gainItem(5150025, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -92,8 +92,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151020)){ + if (beauty == 2) { + if (cm.haveItem(5151020)) { cm.gainItem(5151020, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -101,7 +101,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150025, 1); diff --git a/scripts/npc/2090101.js b/scripts/npc/2090101.js index be21e4f978..7063e67a65 100644 --- a/scripts/npc/2090101.js +++ b/scripts/npc/2090101.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("I'm a hair assistant in this shop. If you have #b#t5150024##k or #b#t5151019##k by any chance, then how about letting me change your hairdo?\r\n#L1#Haircut: #i5150024##t5150024##l\r\n#L2#Dye your hair: #i5151019##t5151019##l"); } else if (status == 1) { @@ -58,13 +59,13 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_e.length; i++) { + for (var i = 0; i < mhair_e.length; i++) { pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_e.length; i++) { + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -74,17 +75,16 @@ function action(mode, type, selection) { beauty = 2; haircolor = Array(); var current = parseInt(cm.getPlayer().getHair() - /10)*10; - for(var i = 0; i < 8; i++) { + / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5151019##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150024)){ + if (beauty == 1) { + if (cm.haveItem(5150024)) { cm.gainItem(5150024, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -92,8 +92,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151019)){ + if (beauty == 2) { + if (cm.haveItem(5151019)) { cm.gainItem(5151019, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -101,7 +101,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150024, 1); diff --git a/scripts/npc/2090102.js b/scripts/npc/2090102.js index e1980b9840..b3be8b191e 100644 --- a/scripts/npc/2090102.js +++ b/scripts/npc/2090102.js @@ -35,20 +35,20 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well, hello! Welcome to the Mu Lung Skin-Care! Would you like to have a firm, tight, healthy looking skin like mine? With #b#t5153006##k, you can let us take care of the rest and have the kind of skin you've always wanted~!\r\n#L2#Skin Care: #i5153006##t5153006##l"); } else if (status == 1) { if (selection == 2) { cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5153006)){ + if (cm.haveItem(5153006)) { cm.gainItem(5153006, -1); cm.setSkin(skin[selection]); cm.sendOk("Enjoy your new and improved skin!"); diff --git a/scripts/npc/2090103.js b/scripts/npc/2090103.js index ac10c6558b..6182892ba7 100644 --- a/scripts/npc/2090103.js +++ b/scripts/npc/2090103.js @@ -32,7 +32,7 @@ var fface_v = Array(21000, 21003, 21005, 21006, 21008, 21009, 21011, 21012, 2102 function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -54,10 +54,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hey, I'm Pata, and I am a renowned plastic surgeon and cosmetic lens expert here in Mu Lung. I believe your face and eyes are the most important features in your body, and with #b#t5152028##k or #b#t5152041##k, I can prescribe the right kind of facial care and cosmetic lenses for you. Now, what would you like to use?\r\n#L1#Plastic Surgery: #i5152028##t5152028##l\r\n#L2#Cosmetic Lenses: #i5152041##t5152041##l\r\n#L3#One-time Cosmetic Lenses: #i5152100# (any color)#l"); } else if (status == 1) { @@ -65,14 +66,14 @@ function action(mode, type, selection) { beauty = 1; facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) { + for (var i = 0; i < mface_v.length; i++) { pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) { + for (var i = 0; i < fface_v.length; i++) { pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -83,64 +84,63 @@ function action(mode, type, selection) { beauty = 2; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 300, current + 500, current + 600, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 300, current + 500, current + 600, current + 700]); cm.sendStyle("With our new computer program, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Please choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5152028)){ + if (beauty == 1) { + if (cm.haveItem(5152028)) { cm.gainItem(5152028, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); } else { cm.sendOk("I'm sorry, but I don't think you have our plastic surgery coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 2){ - if (cm.haveItem(5152041)){ + } else if (beauty == 2) { + if (cm.haveItem(5152041)) { cm.gainItem(5152041, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 3){ + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); diff --git a/scripts/npc/2090104.js b/scripts/npc/2090104.js index 08826c183a..7cf0b802aa 100644 --- a/scripts/npc/2090104.js +++ b/scripts/npc/2090104.js @@ -38,7 +38,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -54,10 +54,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hey, I'm Noma, and I am assisting Pata in changing faces and applying lenses as my internship studies. With #b#t5152027##k or #b#t5152042##k, I can change the way you look. Now, what would you like to use?\r\n#L1#Plastic Surgery: #i5152027##t5152027##l\r\n#L2#Cosmetic Lenses: #i5152042##t5152042##l"); } else if (status == 1) { @@ -65,14 +66,14 @@ function action(mode, type, selection) { beauty = 1; facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_r.length; i++) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_r.length; i++) { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -83,21 +84,20 @@ function action(mode, type, selection) { beauty = 2; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 300, current + 500, current + 600, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 300, current + 500, current + 600, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152042##k and really make the change to your eyes?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5152027)){ + if (beauty == 1) { + if (cm.haveItem(5152027)) { cm.gainItem(5152027, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); @@ -105,8 +105,8 @@ function action(mode, type, selection) { cm.sendOk("I'm sorry, but I don't think you have our plastic surgery coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } } - if (beauty == 2){ - if (cm.haveItem(5152042)){ + if (beauty == 2) { + if (cm.haveItem(5152042)) { cm.gainItem(5152042, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); diff --git a/scripts/npc/2091005.js b/scripts/npc/2091005.js index 4b1bb7e713..fe15d8afbc 100644 --- a/scripts/npc/2091005.js +++ b/scripts/npc/2091005.js @@ -44,12 +44,12 @@ function start() { const YamlConfig = Java.type('config.YamlConfig'); belt_points = YamlConfig.config.server.USE_FAST_DOJO_UPGRADE ? Array(10, 90, 200, 460, 850) : Array(200, 1800, 4000, 9200, 17000); - - belt_on_inventory = new Array(); + + belt_on_inventory = []; for (var i = 0; i < belts.length; i++) { belt_on_inventory.push(cm.haveItemWithId(belts[i], true)); } - + action(1, 0, 0); } @@ -62,10 +62,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - - if(status == 0) { + } + + if (status == 0) { if (isRestingSpot(cm.getPlayer().getMap().getId())) { var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n"; @@ -83,13 +84,14 @@ function action(mode, type, selection) { } else { cm.sendOk("Hey! Are you mocking my master? Who do you think you are to challenge him? This is a joke! You should at least be level #b25#k."); cm.dispose(); - return; + } } else { if (cm.getPlayer().getMap().getId() == 925020001) { if (mode >= 0) { - if (status == 1) + if (status == 1) { selectedMenu = selection; + } if (selectedMenu == 0) { //I want to challenge him alone. if (!cm.getPlayer().hasEntered("dojang_Msg") && !cm.getPlayer().getFinishedDojoTutorial()) { //kind of hackish... if (status == 1) { @@ -98,49 +100,54 @@ function action(mode, type, selection) { if (mode == 0) { cm.sendNext("Haha! Who are you trying to impress with a heart like that?\r\nGo back home where you belong!"); cm.dispose(); - return; + } else { var avDojo = cm.getClient().getChannelServer().ingressDojo(true, 0); - if(avDojo < 0) { - if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); - else cm.sendOk("Either your party is already using the Dojo or your party's allotted time on the Dojo has not expired yet. Wait for them to finish to enter."); - } - else { + if (avDojo < 0) { + if (avDojo == -1) { + cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); + } else { + cm.sendOk("Either your party is already using the Dojo or your party's allotted time on the Dojo has not expired yet. Wait for them to finish to enter."); + } + } else { cm.getClient().getChannelServer().getMapFactory().getMap(925020010 + avDojo).resetMapObjects(); - + cm.resetDojoEnergy(); cm.warp(925020010 + avDojo, 0); } cm.dispose(); - return; + } } } else if (cm.getPlayer().getDojoStage() > 0) { dojoWarp = cm.getPlayer().getDojoStage(); cm.getPlayer().setDojoStage(0); - + var stageWarp = ((dojoWarp / 6) | 0) * 5; cm.sendYesNo("The last time you took the challenge by yourself, you went up to round #b" + stageWarp + "#k. I can take you there right now. Do you want to go there? (Select #rNo#k to erase this record.)"); } else { var avDojo = cm.getClient().getChannelServer().ingressDojo(false, dojoWarp); - if(avDojo < 0) { - if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); - else cm.sendOk("Either your party is already using the Dojo or your party's allotted time on the Dojo has not expired yet. Wait for them to finish to enter."); - + if (avDojo < 0) { + if (avDojo == -1) { + cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); + } else { + cm.sendOk("Either your party is already using the Dojo or your party's allotted time on the Dojo has not expired yet. Wait for them to finish to enter."); + } + cm.getPlayer().setDojoStage(dojoWarp); } else { var warpDojoMap = 925020000 + (dojoWarp + 1) * 100 + avDojo; cm.getClient().getChannelServer().resetDojoMap(warpDojoMap); - + cm.resetDojoEnergy(); cm.warp(warpDojoMap, 0); } cm.dispose(); - return; + } } else if (selectedMenu == 1) { //I want to challenge him with a party. var party = cm.getPlayer().getParty(); @@ -149,36 +156,39 @@ function action(mode, type, selection) { cm.dispose(); return; } - + if (party.getLeader().getId() != cm.getPlayer().getId()) { cm.sendNext("Where do you think you're going? You're not even the party leader! Go tell your party leader to talk to me."); cm.dispose(); - return; + } - //else if (party.getMembers().size() == 1) { - // cm.sendNext("You're going to take on the challenge as a one-man party?"); + //else if (party.getMembers().size() == 1) { + // cm.sendNext("You're going to take on the challenge as a one-man party?"); //} else if (!isBetween(party, 30)) { cm.sendNext("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r30 levels#k of each other."); cm.dispose(); - return; + } else { var avDojo = cm.getClient().getChannelServer().ingressDojo(true, cm.getParty(), 0); - if(avDojo < 0) { - if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); - else cm.sendOk("Either your party is already using the Dojo or your party's allotted time on the Dojo has not expired yet. Wait for them to finish to enter."); + if (avDojo < 0) { + if (avDojo == -1) { + cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); + } else { + cm.sendOk("Either your party is already using the Dojo or your party's allotted time on the Dojo has not expired yet. Wait for them to finish to enter."); + } } else { cm.getClient().getChannelServer().resetDojoMap(925030100 + avDojo); - + cm.resetPartyDojoEnergy(); cm.warpParty(925030100 + avDojo); } cm.dispose(); - return; + } } else if (selectedMenu == 2) { //I want to receive a belt. @@ -196,35 +206,40 @@ function action(mode, type, selection) { for (var i = 0; i < belts.length; i++) { if (belt_on_inventory[i]) { selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "# (Already on inventory)"; - } else + } else { selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "#"; + } } cm.sendSimple(selStr); } else if (status == 2) { var belt = belts[selection]; var level = belt_level[selection]; var points = belt_points[selection]; - + var oldbelt = (selection > 0) ? belts[selection - 1] : -1; var haveOldbelt = (oldbelt == -1 || cm.haveItemWithId(oldbelt, false)); - + if (selection > 0 && !belt_on_inventory[selection - 1]) { sendBeltRequirements(belt, oldbelt, haveOldbelt, level, points); } else if (cm.getPlayer().getDojoPoints() >= points) { if (selection > 0 && !haveOldbelt) { sendBeltRequirements(belt, oldbelt, haveOldbelt, level, points); } else if (cm.getPlayer().getLevel() > level) { - if(selection > 0) cm.gainItem(oldbelt, -1); + if (selection > 0) { + cm.gainItem(oldbelt, -1); + } cm.gainItem(belt, 1); cm.getPlayer().setDojoPoints(cm.getPlayer().getDojoPoints() - points); cm.sendNext("There is the #i" + belt + "# #b#t" + belt + "##k. You have proven your valor to ascend on the Dojo ranks. Well done!"); - } else + } else { sendBeltRequirements(belt, oldbelt, haveOldbelt, level, points); - } else + } + } else { sendBeltRequirements(belt, oldbelt, haveOldbelt, level, points); + } cm.dispose(); - return; + } } else if (selectedMenu == 3) { //I want to reset my training points. if (status == 1) { @@ -237,7 +252,7 @@ function action(mode, type, selection) { cm.sendNext("There! All your training points have been reset. Think of it as a new beginning and train hard!"); } cm.dispose(); - return; + } } else if (selectedMenu == 4) { //I want to receive a medal. if (status == 1 && cm.getPlayer().getVanquisherStage() <= 0) { @@ -248,9 +263,9 @@ function action(mode, type, selection) { } else { if (cm.getPlayer().getDojoStage() > 37) { cm.sendNext("You have completed all medals challenges."); - } else if (cm.getPlayer().getVanquisherKills() < 100 && cm.getPlayer().getVanquisherStage() > 0) + } else if (cm.getPlayer().getVanquisherKills() < 100 && cm.getPlayer().getVanquisherStage() > 0) { cm.sendNext("You still need #b" + (100 - cm.getPlayer().getVanquisherKills()) + "#k in order to obtain the #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k. Please try a little harder. As a reminder, only the mosnters that have been summoned by our Master in Mu Lung Dojo are considered. Oh, and make sure you're not hunting the monsters and exiting!#r If you don't go to the next level after defeating the monster, it doesn't count as a win#k."); - else if (cm.getPlayer().getVanquisherStage() <= 0) { + } else if (cm.getPlayer().getVanquisherStage() <= 0) { cm.getPlayer().setVanquisherStage(1); } else { cm.sendNext("You have obtained #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k."); @@ -261,69 +276,76 @@ function action(mode, type, selection) { } cm.dispose(); - return; + } else { cm.dispose(); - return; + } } else if (selectedMenu == 5) { //What is a Mu Lung Dojo? cm.sendNext("Our master is the strongest person in Mu Lung. The place he built is called the Mu Lung Dojo, a building that is #r38 stories#k tall! You can train yourself as you go up each level. Of course, it'll be hard for someone at your level to reach the top."); cm.dispose(); - return; + } } else { cm.dispose(); - return; + } } else if (isRestingSpot(cm.getPlayer().getMap().getId())) { - if (selectedMenu == -1) + if (selectedMenu == -1) { selectedMenu = selection; - + } + if (selectedMenu == 0) { var hasParty = (cm.getParty() != null); - + var firstEnter = false; var avDojo = cm.getClient().getChannelServer().lookupPartyDojo(cm.getParty()); - if(avDojo < 0) { - if(hasParty) { - if(!cm.isPartyLeader()) { + if (avDojo < 0) { + if (hasParty) { + if (!cm.isPartyLeader()) { cm.sendOk("You are not the leader! Call your party leader to talk to me if you wish to continue."); cm.dispose(); return; } - - if(!isBetween(cm.getParty(), 35)) { + + if (!isBetween(cm.getParty(), 35)) { cm.sendOk("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r35 levels#k of each other."); cm.dispose(); return; } } - + avDojo = cm.getClient().getChannelServer().ingressDojo(hasParty, cm.getParty(), Math.floor((cm.getPlayer().getMap().getId()) / 100) % 100); firstEnter = true; } - if(avDojo < 0) { - if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); - else cm.sendOk("Your party already registered for the dojo. Wait for the end of the registration time to enter again."); + if (avDojo < 0) { + if (avDojo == -1) { + cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again."); + } else { + cm.sendOk("Your party already registered for the dojo. Wait for the end of the registration time to enter again."); + } } else { var baseStg = hasParty ? 925030000 : 925020000; var nextStg = Math.floor((cm.getPlayer().getMap().getId() + 100) / 100) % 100; var dojoWarpMap = baseStg + (nextStg * 100) + avDojo; - if(firstEnter) { + if (firstEnter) { cm.getClient().getChannelServer().resetDojoMap(dojoWarpMap); } - + //non-leader party members can progress whilst having the record saved if they don't command to enter the next stage cm.getPlayer().setDojoStage(0); - - if(!hasParty || !cm.isLeader()) cm.warp(dojoWarpMap, 0); - else cm.warpParty(dojoWarpMap, 0); + + if (!hasParty || !cm.isLeader()) { + cm.warp(dojoWarpMap, 0); + } else { + cm.warpParty(dojoWarpMap, 0); + } } cm.dispose(); - return; + } else if (selectedMenu == 1) { //I want to leave if (status == 1) { cm.sendYesNo("So, you're giving up? You're really going to leave?"); @@ -332,7 +354,7 @@ function action(mode, type, selection) { cm.warp(925020002, "st00"); } cm.dispose(); - return; + } } else if (selectedMenu == 2) { //I want to record my score up to this point if (status == 1) { @@ -347,7 +369,7 @@ function action(mode, type, selection) { cm.getPlayer().setDojoStage(Math.floor(cm.getMapId() / 100) % 100); } cm.dispose(); - return; + } } } else { @@ -355,10 +377,10 @@ function action(mode, type, selection) { cm.sendNext("Stop changing your mind! Soon, you'll be crying, begging me to go back."); } else if (mode == 1) { var dojoMapId = cm.getPlayer().getMap().getId(); - + cm.warp(925020002, 0); cm.getPlayer().message("Can you make up your mind please?"); - + cm.getClient().getChannelServer().freeDojoSectionIfEmpty(dojoMapId); } cm.dispose(); @@ -369,11 +391,11 @@ function action(mode, type, selection) { function sendBeltRequirements(belt, oldbelt, haveOldbelt, level, points) { var beltReqStr = (oldbelt != -1) ? " you must have the #i" + oldbelt + "# belt in your inventory," : ""; - + var pointsLeftStr = (points - cm.getPlayer().getDojoPoints() > 0) ? " you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points" : ""; var beltLeftStr = (!haveOldbelt) ? " you must have the needed belt unequipped and available in your EQP inventory" : ""; var conjStr = (pointsLeftStr.length > 0 && beltLeftStr.length > 0) ? " and" : ""; - + cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k," + beltReqStr + " you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt," + beltLeftStr + conjStr + pointsLeftStr + "."); } @@ -386,10 +408,11 @@ function isBetween(party, range) { var highest = lowest; for (var x = 0; x < party.getMembers().size(); x++) { var lvl = party.getMembers().get(x).getLevel(); - if (lvl > highest) + if (lvl > highest) { highest = lvl; - else if (lvl < lowest) + } else if (lvl < lowest) { lowest = lvl; + } } return (highest - lowest) <= range; } diff --git a/scripts/npc/2091005_old.js b/scripts/npc/2091005_old.js index ad73703e70..f4d168af84 100644 --- a/scripts/npc/2091005_old.js +++ b/scripts/npc/2091005_old.js @@ -37,12 +37,12 @@ var status = -1; var selectedMenu = -1; function start() { - if(disabled) { - cm.sendOk("My master has requested that the dojo be #rclosed#k at this time so I can't let you in."); - cm.dispose(); - return; - } - + if (disabled) { + cm.sendOk("My master has requested that the dojo be #rclosed#k at this time so I can't let you in."); + cm.dispose(); + return; + } + if (isRestingSpot(cm.getPlayer().getMap().getId())) { var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n"; @@ -68,8 +68,9 @@ function action(mode, type, selection) { cm.dispose(); } else if (cm.getPlayer().getMap().getId() == 925020001) { if (mode >= 0) { - if (status == -1) + if (status == -1) { selectedMenu = selection; + } status++; //there is no prev. if (selectedMenu == 0) { //I want to challenge him alone. if (!cm.getPlayer().hasEntered("dojang_Msg") && !cm.getPlayer().getFinishedDojoTutorial()) { //kind of hackish... @@ -79,7 +80,7 @@ function action(mode, type, selection) { if (mode == 0) { cm.sendNext("Haha! Who are you trying to impress with a heart like that?\r\nGo back home where you belong!"); } else { - if(cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) { + if (cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) { cm.sendOk("Someone is already in Dojo."); cm.dispose(); return; @@ -97,13 +98,13 @@ function action(mode, type, selection) { cm.dispose(); } } else { - for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps - if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) { - cm.sendOk("Someone is already in the Dojo." + i); - cm.dispose(); - return; - } - } + for (var i = 1; i < 39; i++) { //only 32 stages, but 38 maps + if (cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) { + cm.sendOk("Someone is already in the Dojo." + i); + cm.dispose(); + return; + } + } cm.getClient().getChannelServer().getMapFactory().getMap(925020100).resetReactors(); cm.getClient().getChannelServer().getMapFactory().getMap(925020100).killAllMonsters(); cm.warp(925020100, 0); @@ -120,10 +121,11 @@ function action(mode, type, selection) { var highest = lowest; for (var x = 0; x < party.getMembers().size(); x++) { var lvl = party.getMembers().get(x).getLevel(); - if (lvl > highest) + if (lvl > highest) { highest = lvl; - else if (lvl < lowest) + } else if (lvl < lowest) { lowest = lvl; + } } var isBetween30 = highest - lowest < 30; if (party.getLeader().getId() != cm.getPlayer().getId()) { @@ -134,12 +136,12 @@ function action(mode, type, selection) { } else if (!isBetween30) { cm.sendNext("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r30 levels#k of each other."); } else { - for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps - if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) { - cm.sendOk("Someone is already in the Dojo."); - cm.dispose(); - return; - } + for (var i = 1; i < 39; i++) { //only 32 stages, but 38 maps + if (cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) { + cm.sendOk("Someone is already in the Dojo."); + cm.dispose(); + return; + } } cm.getClient().getChannelServer().getMapFactory().getMap(925020100).resetReactors(); cm.getClient().getChannelServer().getMapFactory().getMap(925020100).killAllMonsters(); @@ -157,8 +159,9 @@ function action(mode, type, selection) { for (var i = 0; i < belts.length; i++) { if (cm.haveItemWithId(belts[i], true)) { selStr += "\r\n #i" + belts[i] + "# #t" + belts[i] + "#(Obtain)"; - } else + } else { selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "#l"; + } } cm.sendSimple(selStr); } else if (status == 1) { @@ -166,12 +169,14 @@ function action(mode, type, selection) { var level = belt_level[selection]; var points = belt_points[selection]; if (cm.getPlayer().getDojoPoints() > points) { - if (cm.getPlayer().getLevel() > level) + if (cm.getPlayer().getLevel() > level) { cm.gainItem(belt, 1); - else + } else { cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k, you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points."); - } else + } + } else { cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k, you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points."); + } cm.dispose(); } } else if (selectedMenu == 3) { //I want to reset my training points. @@ -196,9 +201,9 @@ function action(mode, type, selection) { } else { if (cm.getPlayer().getDojoStage() > 37) { cm.sendNext("You have complete all medals challenges."); - } else if (cm.getPlayer().getVanquisherKills() < 100 && cm.getPlayer().getVanquisherStage() > 0) + } else if (cm.getPlayer().getVanquisherKills() < 100 && cm.getPlayer().getVanquisherStage() > 0) { cm.sendNext("You still need #b" + (100 - cm.getPlayer().getVanquisherKills()) + "#k in order to obtain the #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k. Please try a little harder. As a reminder, only the mosnters that have been summoned by our Master in Mu Lung Dojo are considered. Oh, and make sure you're not hunting the monsters and exiting!#r If you don't go to the next level after defeating the monster, it doesn't count as a win#k."); - else if (cm.getPlayer().getVanquisherStage() <= 0) { + } else if (cm.getPlayer().getVanquisherStage() <= 0) { cm.getPlayer().setVanquisherStage(1); } else { cm.sendNext("You have obtained #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k."); @@ -213,11 +218,13 @@ function action(mode, type, selection) { cm.sendNext("Our master is the strongest person in Mu Lung. The place he built is called the Mu Lung Dojo, a building that is 38 stories tall! You can train yourself as you go up each level. Of course, it'll be hard for someone at your level to reach the top."); cm.dispose(); } - } else + } else { cm.dispose(); + } } else if (isRestingSpot(cm.getPlayer().getMap().getId())) { - if (selectedMenu == -1) + if (selectedMenu == -1) { selectedMenu = selection; + } status++; if (selectedMenu == 0) { cm.warp(cm.getPlayer().getMap().getId() + 100, 0); diff --git a/scripts/npc/2091006.js b/scripts/npc/2091006.js index 929dc9ec1f..4667c40d61 100644 --- a/scripts/npc/2091006.js +++ b/scripts/npc/2091006.js @@ -35,17 +35,19 @@ function start() { function action(mode, type, selection) { status++; - if(mode == 0 && type == 0) + if (mode == 0 && type == 0) { status -= 2; + } if (mode >= 0) { if (selection == 1 || readNotice == 1) { if (status == -1) { readNotice = 1; cm.sendNext("#e< Notice : Take the challenge! >#n\r\nMy name is Mu Gong, the owner of the My Lung Dojo. Since long ago, I have been training in Mu Lung to the point where my skills have now reached the pinnacle. Starting today, I will take on any and all applicants for Mu Lung Dojo. The rights to the Mu Lung Dojo will be given only to the strongest person.\r\nIf there is anyone who wishes to learn from me, come take the challenge any time! If there is anyone who wishes to challenge me, you're welcome as well. I will make you fully aware of your own weakness."); - } else if (status == 0) + } else if (status == 0) { cm.sendPrev("PS:You can challenge me on your own. But if you don't have that kind of courage, go ahead and call all your friends."); - else + } else { cm.dispose(); + } } else { if (status == -1 && mode == 1) { cm.sendYesNo("(Once I had placed my hands on the bulletin board, a mysterious energy began to envelop me.)\r\n\r\nWould you like to go to Mu Lung Dojo?"); @@ -59,6 +61,7 @@ function action(mode, type, selection) { cm.dispose(); } } - } else + } else { cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2091009.js b/scripts/npc/2091009.js index c72fb2ca9b..15d4311eda 100644 --- a/scripts/npc/2091009.js +++ b/scripts/npc/2091009.js @@ -1,44 +1,41 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } + if (status == 0) { + cm.sendGetText("The entrance of the Sealed Shrine... #bPassword#k!"); + } else if (status == 1) { + if (cm.getWarpMap(925040100).countPlayers() > 0) { + cm.sendOk("Someone is already attending the Sealed Shrine."); + cm.dispose(); + return; + } + if (cm.getText() == "Actions speak louder than words") { + if (cm.isQuestStarted(21747) && cm.getQuestProgressInt(21747, 9300351) == 0) { + cm.warp(925040100, 0); + } else { + cm.playerMessage(5, "Although you said the right answer, some mysterious forces are blocking the way in."); + } - if(status == 0){ - cm.sendGetText("The entrance of the Sealed Shrine... #bPassword#k!"); - } - else if(status == 1){ - if(cm.getWarpMap(925040100).countPlayers() > 0) { - cm.sendOk("Someone is already attending the Sealed Shrine."); - cm.dispose(); - return; - } - if(cm.getText() == "Actions speak louder than words"){ - if(cm.isQuestStarted(21747) && cm.getQuestProgressInt(21747, 9300351) == 0) - cm.warp(925040100, 0); - else - cm.playerMessage(5, "Although you said the right answer, some mysterious forces are blocking the way in."); - - cm.dispose(); - } - else{ - cm.sendOk("#rWrong!"); - } - } - else if(status == 2){ - cm.dispose(); - } + cm.dispose(); + } else { + cm.sendOk("#rWrong!"); + } + } else if (status == 2) { + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2093003.js b/scripts/npc/2093003.js index 63004f238e..a54e3bcb8e 100644 --- a/scripts/npc/2093003.js +++ b/scripts/npc/2093003.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2093003); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2093003); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2093004.js b/scripts/npc/2093004.js index 3aa4c7f861..f9eab98ff6 100644 --- a/scripts/npc/2093004.js +++ b/scripts/npc/2093004.js @@ -24,26 +24,27 @@ var menu; var cost = 10000; function start() { - cm.sendYesNo("Will you move to #b#m230000000##k now? The price is #b"+cost+" mesos#k."); + cm.sendYesNo("Will you move to #b#m230000000##k now? The price is #b" + cost + " mesos#k."); } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (mode == 0) { cm.sendNext("Hmmm ... too busy to do it right now? If you feel like doing it, though, come back and find me."); cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { - if(cm.getPlayer().getMeso() < cost) + if (cm.getPlayer().getMeso() < cost) { cm.sendOk("I don't think you have enough money..."); - else { + } else { cm.gainMeso(-cost); cm.warp(230000000); } diff --git a/scripts/npc/2094000.js b/scripts/npc/2094000.js index 58976aacf5..ef89bf18a1 100644 --- a/scripts/npc/2094000.js +++ b/scripts/npc/2094000.js @@ -23,70 +23,70 @@ * @npc: Guon * @map: 251010404 - Over the Pirate Ship * @func: Pirate PQ -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("PiratePQ"); - if(em == null) { - cm.sendOk("The Pirate PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHelp! My son has been kidnapped and is bound on the hands of the fearful #rLord Pirate#k. I need your help... Would you please assemble or join a team to save him? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nIn this PQ, your mission is to progressively make your way through the ship, taking on all pirates and baddies in your path. Reaching the #rLord Pirate#k, depending on how many great chests you opened on the stages before, the boss will reveal himself even more powerful, so stay alert. Said chests, if opened, gives many extra rewards to your crew, it's worth a shot! Good luck."); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("PiratePQ"); + if (em == null) { + cm.sendOk("The Pirate PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHelp! My son has been kidnapped and is bound on the hands of the fearful #rLord Pirate#k. I need your help... Would you please assemble or join a team to save him? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nIn this PQ, your mission is to progressively make your way through the ship, taking on all pirates and baddies in your path. Reaching the #rLord Pirate#k, depending on how many great chests you opened on the stages before, the boss will reveal himself even more powerful, so stay alert. Said chests, if opened, gives many extra rewards to your crew, it's worth a shot! Good luck."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2094001.js b/scripts/npc/2094001.js index 358f2332f4..b62ec326dc 100644 --- a/scripts/npc/2094001.js +++ b/scripts/npc/2094001.js @@ -28,93 +28,91 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } + + if (mode == 1) { + status++; } else { - if (mode == 0 && status == 0) { + status--; + } + + if (cm.getMapId() == 925100500) { + if (status == 0) { + if (cm.isEventLeader()) { + cm.sendOk("I have been saved thanks to your efforts! Thank you, guys!"); + } else { + cm.sendOk("I have been saved thanks to your efforts! Thank you, guys! Let your party leader talk to me first before I give you your rewards..."); + cm.dispose(); + } + } else { + cm.getEventInstance().clearPQ(); + cm.dispose(); + } + } else { + if (status == 0) { + cm.sendSimple("Thank you for saving me! How can I help you?\r\n#b#L0#Get me out of here.\r\n#L1#Give me Pirate Hat."); + } else if (status == 1) { + if (selection == 0) { + if (!cm.canHold(4001158, 1)) { + cm.sendOk("Please make room in ETC."); cm.dispose(); return; + } + cm.gainItem(4001158, 1); + cm.warp(251010404, 0); + } else { + if (cm.haveItem(1003267, 1)) { + cm.sendOk("You have the best hat."); + } else if (cm.haveItem(1002573, 1)) { + if (cm.haveItem(4001158, 20)) { + if (cm.canHold(1003267, 1)) { + cm.gainItem(1002573, -1); + cm.gainItem(4001158, -20); + cm.gainItem(1003267, 1); + cm.sendOk("I have given you the hat."); + } else { + cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); + } + } else { + cm.sendOk("You need 20 #t4001158# to get the next hat."); + } + } else if (cm.haveItem(1002572, 1)) { + if (cm.haveItem(4001158, 20)) { + if (cm.canHold(1002573, 1)) { + cm.gainItem(1002572, -1); + cm.gainItem(4001158, -20); + cm.gainItem(1002573, 1); + cm.sendOk("I have given you the hat."); + } else { + cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); + } + } else { + cm.sendOk("You need 20 #t4001158# to get the next hat."); + } + } else { + if (cm.haveItem(4001158, 20)) { + if (cm.canHold(1002572, 1)) { + cm.gainItem(4001158, -20); + cm.gainItem(1002572, 1); + cm.sendOk("I have given you the hat."); + } else { + cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); + } + } else { + cm.sendOk("You need 20 #t4001158# to get the next hat."); + } + } } - if (mode == 1) - status++; - else - status--; - - if(cm.getMapId() == 925100500) { - if (status == 0) { - if(cm.isEventLeader()) { - cm.sendOk("I have been saved thanks to your efforts! Thank you, guys!"); - } - else { - cm.sendOk("I have been saved thanks to your efforts! Thank you, guys! Let your party leader talk to me first before I give you your rewards..."); - cm.dispose(); - } - } - else { - cm.getEventInstance().clearPQ(); - cm.dispose(); - } - } - else { - if (status == 0) { - cm.sendSimple("Thank you for saving me! How can I help you?\r\n#b#L0#Get me out of here.\r\n#L1#Give me Pirate Hat."); - } else if (status == 1) { - if (selection == 0) { - if (!cm.canHold(4001158, 1)) { - cm.sendOk("Please make room in ETC."); - cm.dispose(); - return; - } - cm.gainItem(4001158, 1); - cm.warp(251010404,0); - } else { - if (cm.haveItem(1003267, 1)) { - cm.sendOk("You have the best hat."); - } else if (cm.haveItem(1002573, 1)) { - if (cm.haveItem(4001158, 20)) { - if (cm.canHold(1003267,1)) { - cm.gainItem(1002573, -1); - cm.gainItem(4001158, -20); - cm.gainItem(1003267,1); - cm.sendOk("I have given you the hat."); - } else { - cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); - } - } else { - cm.sendOk("You need 20 #t4001158# to get the next hat."); - } - } else if (cm.haveItem(1002572, 1)) { - if (cm.haveItem(4001158, 20)) { - if (cm.canHold(1002573,1)) { - cm.gainItem(1002572, -1); - cm.gainItem(4001158, -20); - cm.gainItem(1002573,1); - cm.sendOk("I have given you the hat."); - } else { - cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); - } - } else { - cm.sendOk("You need 20 #t4001158# to get the next hat."); - } - } else { - if (cm.haveItem(4001158, 20)) { - if (cm.canHold(1002572,1)) { - cm.gainItem(4001158, -20); - cm.gainItem(1002572,1); - cm.sendOk("I have given you the hat."); - } else { - cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); - } - } else { - cm.sendOk("You need 20 #t4001158# to get the next hat."); - } - } - } - - cm.dispose(); - } - } - + cm.dispose(); + } } + + } } diff --git a/scripts/npc/2094002.js b/scripts/npc/2094002.js index cd71c9f626..1c7bbbe8c8 100644 --- a/scripts/npc/2094002.js +++ b/scripts/npc/2094002.js @@ -2,33 +2,32 @@ var status = -1; var level = 1; function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - status--; + status--; } if (cm.getPlayer().getMapId() == 925100700) { - cm.warp(251010404,0); - cm.dispose(); - return; - } - - if(status == 1) { // leaders cant withdraw - cm.warp(251010404,0); + cm.warp(251010404, 0); + cm.dispose(); return; } - - if (!cm.isEventLeader()) { - cm.sendYesNo("I wish for your leader to talk to me. Alternatively, you may be wanting to quit. Are you going to abandon this campaign?"); + + if (status == 1) { // leaders cant withdraw + cm.warp(251010404, 0); + return; } - else { + + if (!cm.isEventLeader()) { + cm.sendYesNo("I wish for your leader to talk to me. Alternatively, you may be wanting to quit. Are you going to abandon this campaign?"); + } else { var eim = cm.getEventInstance(); if (eim == null) { - cm.warp(251010404,0); + cm.warp(251010404, 0); cm.sendNext("How are you even here without being registered on an instance?"); cm.dispose(); return; @@ -36,7 +35,7 @@ function action(mode, type, selection) { level = eim.getProperty("level"); - switch(cm.getPlayer().getMapId()) { + switch (cm.getPlayer().getMapId()) { case 925100000: cm.sendNext("We are heading into the Pirate Ship now! To get in, we must destroy all the monsters guarding it."); cm.dispose(); @@ -44,27 +43,27 @@ function action(mode, type, selection) { case 925100100: var emp = eim.getProperty("stage2"); if (emp.equals("0")) { - if (cm.haveItem(4001120,20)) { + if (cm.haveItem(4001120, 20)) { cm.sendNext("Excellent! Now hunt me 20 Rising Medals."); - cm.gainItem(4001120,-20); + cm.gainItem(4001120, -20); cm.getMap().killAllMonsters(); eim.setProperty("stage2", "1"); } else { cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals."); } } else if (emp.equals("1")) { - if (cm.haveItem(4001121,20)) { + if (cm.haveItem(4001121, 20)) { cm.sendNext("Excellent! Now hunt me 20 Veteran Medals."); - cm.gainItem(4001121,-20); + cm.gainItem(4001121, -20); cm.getMap().killAllMonsters(); eim.setProperty("stage2", "2"); } else { cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals."); } } else if (emp.equals("2")) { - if (cm.haveItem(4001122,20)) { + if (cm.haveItem(4001122, 20)) { cm.sendNext("Excellent! Now let us go."); - cm.gainItem(4001122,-20); + cm.gainItem(4001122, -20); cm.getMap().killAllMonsters(); eim.setProperty("stage2", "3"); eim.showClearEffect(cm.getMapId()); @@ -124,6 +123,6 @@ function action(mode, type, selection) { break; } } - - + + } \ No newline at end of file diff --git a/scripts/npc/2095000.js b/scripts/npc/2095000.js index bb83a6c357..150fe03a0d 100644 --- a/scripts/npc/2095000.js +++ b/scripts/npc/2095000.js @@ -23,75 +23,75 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if (cm.getMapId() != 925010400) { - em = cm.getEventManager("DelliBattle"); - if(em == null) { - cm.sendOk("The Delli Battle has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nAh, #r#p1095000##k sent you here? Is she worried about me? ... I'm terribly sorry to hear that, but I can't really go back just yet, some monsters are under the Black Mage's influence, and it's up to me to liberate them! ... It seems you're not going to accept that either, huh? Would you like to collaborate with party members to help me? If so, please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else { - cm.sendYesNo("The mission succeeded, thanks for escorting me! I can lead you to #b#m120000104##k, are you ready?"); - } - } else if (status == 1) { - if (cm.getMapId() != 925010400) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\n A ambush is under way! I must stand on the field for around 6 minutes to complete the liberation, please protect me during that time so that my mission is completed."); - cm.dispose(); - } - } else { - cm.warp(120000104); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getMapId() != 925010400) { + em = cm.getEventManager("DelliBattle"); + if (em == null) { + cm.sendOk("The Delli Battle has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nAh, #r#p1095000##k sent you here? Is she worried about me? ... I'm terribly sorry to hear that, but I can't really go back just yet, some monsters are under the Black Mage's influence, and it's up to me to liberate them! ... It seems you're not going to accept that either, huh? Would you like to collaborate with party members to help me? If so, please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else { + cm.sendYesNo("The mission succeeded, thanks for escorting me! I can lead you to #b#m120000104##k, are you ready?"); + } + } else if (status == 1) { + if (cm.getMapId() != 925010400) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\n A ambush is under way! I must stand on the field for around 6 minutes to complete the liberation, please protect me during that time so that my mission is completed."); + cm.dispose(); + } + } else { + cm.warp(120000104); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2096000.js b/scripts/npc/2096000.js index 86f90bbffb..5bbc223b11 100644 --- a/scripts/npc/2096000.js +++ b/scripts/npc/2096000.js @@ -25,28 +25,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Amateurs train on this map. Adepts train on the next. Professionals train on the last, where the boss will be awaiting."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Amateurs train on this map. Adepts train on the next. Professionals train on the last, where the boss will be awaiting."); + cm.dispose(); + } + } } diff --git a/scripts/npc/2100.js b/scripts/npc/2100.js index 1ec7ae27a1..88c4d69cfc 100644 --- a/scripts/npc/2100.js +++ b/scripts/npc/2100.js @@ -28,42 +28,44 @@ var status = -1; function start() { - if (cm.c.getPlayer().getMapId() == 0 || cm.c.getPlayer().getMapId() == 3) + if (cm.c.getPlayer().getMapId() == 0 || cm.c.getPlayer().getMapId() == 3) { cm.sendYesNo("Welcome to the world of MapleStory. The purpose of this training camp is to help beginners. Would you like to enter this training camp? Some people start their journey without taking the training program. But I strongly recommend you take the training program first."); - else + } else { cm.sendNext("This is the image room where your first training program begins. In this room, you will have an advance look into the job of your choice."); + } } function action(mode, type, selection) { status++; if (mode != 1) { - if(mode == 0 && status == 0){ + if (mode == 0 && status == 0) { cm.sendYesNo("Do you really want to start your journey right away?"); return; - }else if(mode == 0 && status == 1 && type == 0){ + } else if (mode == 0 && status == 1 && type == 0) { status -= 2; start(); return; - }else if(mode == 0 && status == 1 && type == 1) + } else if (mode == 0 && status == 1 && type == 1) { cm.sendNext("Please talk to me again when you finally made your decision."); + } cm.dispose(); return; } - if (cm.c.getPlayer().getMapId() == 0 || cm.c.getPlayer().getMapId() == 3){ - if(status == 0){ + if (cm.c.getPlayer().getMapId() == 0 || cm.c.getPlayer().getMapId() == 3) { + if (status == 0) { cm.sendNext("Ok then, I will let you enter the training camp. Please follow your instructor's lead."); - }else if(status == 1 && type == 1){ + } else if (status == 1 && type == 1) { cm.sendNext("It seems like you want to start your journey without taking the training program. Then, I will let you move on to the training ground. Be careful~"); - }else if(status == 1){ + } else if (status == 1) { cm.warp(1, 0); cm.dispose(); - }else{ + } else { cm.warp(40000, 0); cm.dispose(); } - }else - if(status == 0) + } else if (status == 0) { cm.sendPrev("Once you train hard enough, you will be entitled to occupy a job. You can become a Bowman in Henesys, a Magician in Ellinia, a Warrior in Perion, and a Thief in Kerning City..."); - else + } else { cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2100000.js b/scripts/npc/2100000.js index feb6c97526..5ba09f9876 100644 --- a/scripts/npc/2100000.js +++ b/scripts/npc/2100000.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2100000); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 2100000); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2100001.js b/scripts/npc/2100001.js index c1143ca4b3..53bba48110 100644 --- a/scripts/npc/2100001.js +++ b/scripts/npc/2100001.js @@ -15,195 +15,189 @@ var qty; var equip; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode <= 0 && status == 0) { - cm.sendNext("If you aren't in a hurry, then please come back in a bit. As you can see, there's so much work going on right now that I can't possibly give them to you on time."); - cm.dispose(); - return; - } - if (mode <= 0 && status >= 1){ - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; + if (mode <= 0 && status == 0) { + cm.sendNext("If you aren't in a hurry, then please come back in a bit. As you can see, there's so much work going on right now that I can't possibly give them to you on time."); + cm.dispose(); + return; + } + if (mode <= 0 && status >= 1) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } - if(status == 0) - cm.sendYesNo("Are you here to refine the ores of a mineral or a jewel? It doesn't matter how many ores you have, if you don't have them refined by a master like me, then they won't see the light of day. What do you think, do you want to refine them right now?"); - if (status == 1 && mode == 1) { - var selStr = "I like your attitude! Let's just take care of this right now. What kind of ores would you like to refine? #b"; - var options = new Array("Refine mineral ore","Refine jewel ores","Refine crystal ores"); - for (var i = 0; i < options.length; i++){ - selStr += "\r\n#L" + i + "# " + options[i] + "#l"; - } - cm.sendSimple(selStr); - } - else if (status == 2 && mode == 1) { - selectedType = selection; - - if (selectedType == 0){ //mineral refine - var selStr = "Which mineral would you like to refine?#b"; - var minerals = new Array ("Bronze Plate","Steel Plate","Mithril Plate","Adamantium Plate","Silver Plate","Orihalcon Plate","Gold Plate","Lithium"); - for (var i = 0; i < minerals.length; i++){ - selStr += "\r\n#L" + i + "# " + minerals[i] + "#l"; - } - cm.sendSimple(selStr); - equip = false; - } - else if (selectedType == 1){ //jewel refine - var selStr = "Which jewel would you like to refine?#b"; - var jewels = new Array ("Garnet","Amethyst","Aquamarine","Emerald","Opal","Sapphire","Topaz","Diamond","Black Crystal"); - for (var i = 0; i < jewels.length; i++){ - selStr += "\r\n#L" + i + "# " + jewels[i] + "#l"; - } - cm.sendSimple(selStr); - equip = false; - } - else if (selectedType == 2){ //Crystal refine - var selStr = "A crystal? That's a rare item indeed. Don't worry, I can refine it just as well as others. Which crystal would you like to refine? #b"; - var crystals = new Array("Power Crystal","Wisdom Crystal","DEX Crystal","LUK Crystal"); - for (var i = 0; i < crystals.length; i++){ - selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; - } - cm.sendSimple(selStr); - equip = false; - } - } - else if (status == 3 && mode == 1) { - selectedItem = selection; - - if (selectedType == 0){ //mineral refine - var itemSet = new Array(4011000,4011001,4011002,4011003,4011004,4011005,4011006,4011008); - var matSet = new Array(4010000,4010001,4010002,4010003,4010004,4010005,4010006,4010007); - var matQtySet = new Array(10,10,10,10,10,10,10,10); - var costSet = new Array(270,270,270,450,450,450,720,270); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 1){ //jewel refine - var itemSet = new Array(4021000,4021001,4021002,4021003,4021004,4021005,4021006,4021007,4021008); - var matSet = new Array(4020000,4020001,4020002,4020003,4020004,4020005,4020006,4020007,4020008); - var matQtySet = new Array(10,10,10,10,10,10,10,10,10); - var costSet = new Array (450,450,450,450,450,450,450,900,2700); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - else if (selectedType == 2){ //Crystal refine - var itemSet = new Array(4005000,4005001,4005002,4005003); - var matSet = new Array(4004000,4004001,4004002,4004003); - var matQtySet = new Array(10,10,10,10); - var costSet = new Array (4500,4500,4500,4500); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - - var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; - cm.sendGetNumber(prompt,1,1,100) - } - - else if (status == 4 && mode == 1) { - if (equip) - { - selectedItem = selection; - qty = 1; + if (status == 0) { + cm.sendYesNo("Are you here to refine the ores of a mineral or a jewel? It doesn't matter how many ores you have, if you don't have them refined by a master like me, then they won't see the light of day. What do you think, do you want to refine them right now?"); + } + if (status == 1 && mode == 1) { + var selStr = "I like your attitude! Let's just take care of this right now. What kind of ores would you like to refine? #b"; + var options = ["Refine mineral ore", "Refine jewel ores", "Refine crystal ores"]; + for (var i = 0; i < options.length; i++) { + selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } + cm.sendSimple(selStr); + } else if (status == 2 && mode == 1) { + selectedType = selection; + + if (selectedType == 0) { //mineral refine + var selStr = "Which mineral would you like to refine?#b"; + var minerals = ["Bronze Plate", "Steel Plate", "Mithril Plate", "Adamantium Plate", "Silver Plate", "Orihalcon Plate", "Gold Plate", "Lithium"]; + for (var i = 0; i < minerals.length; i++) { + selStr += "\r\n#L" + i + "# " + minerals[i] + "#l"; } - else - qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + cm.sendSimple(selStr); + equip = false; + } else if (selectedType == 1) { //jewel refine + var selStr = "Which jewel would you like to refine?#b"; + var jewels = ["Garnet", "Amethyst", "Aquamarine", "Emerald", "Opal", "Sapphire", "Topaz", "Diamond", "Black Crystal"]; + for (var i = 0; i < jewels.length; i++) { + selStr += "\r\n#L" + i + "# " + jewels[i] + "#l"; + } + cm.sendSimple(selStr); + equip = false; + } else if (selectedType == 2) { //Crystal refine + var selStr = "A crystal? That's a rare item indeed. Don't worry, I can refine it just as well as others. Which crystal would you like to refine? #b"; + var crystals = ["Power Crystal", "Wisdom Crystal", "DEX Crystal", "LUK Crystal"]; + for (var i = 0; i < crystals.length; i++) { + selStr += "\r\n#L" + i + "# " + crystals[i] + "#l"; + } + cm.sendSimple(selStr); + equip = false; + } + } else if (status == 3 && mode == 1) { + selectedItem = selection; - var prompt = "You want me to make "; - if (qty == 1) - prompt += "a #t" + item + "#?"; - else - prompt += qty + " #t" + item + "#?"; + if (selectedType == 0) { //mineral refine + var itemSet = [4011000, 4011001, 4011002, 4011003, 4011004, 4011005, 4011006, 4011008]; + var matSet = [4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10, 10]; + var costSet = [270, 270, 270, 450, 450, 450, 720, 270]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { //jewel refine + var itemSet = [4021000, 4021001, 4021002, 4021003, 4021004, 4021005, 4021006, 4021007, 4021008]; + var matSet = [4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008]; + var matQtySet = [10, 10, 10, 10, 10, 10, 10, 10, 10]; + var costSet = [450, 450, 450, 450, 450, 450, 450, 900, 2700]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 2) { //Crystal refine + var itemSet = [4005000, 4005001, 4005002, 4005003]; + var matSet = [4004000, 4004001, 4004002, 4004003]; + var matQtySet = [10, 10, 10, 10]; + var costSet = [4500, 4500, 4500, 4500]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } - prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; + var prompt = "So, you want me to make some #t" + item + "#s? In that case, how many do you want me to make?"; + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 4 && mode == 1) { + if (equip) { + selectedItem = selection; + qty = 1; + } else { + qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); + } - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + var prompt = "You want me to make "; + if (qty == 1) { + prompt += "a #t" + item + "#?"; + } else { + prompt += qty + " #t" + item + "#?"; + } + + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; + } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; + } + + if (cost > 0) { + prompt += "\r\n#i4031138# " + cost * qty + " meso"; + } + + cm.sendYesNo(prompt); + } else if (status == 5 && mode == 1) { + var complete = true; + var recvItem = item, recvQty; + + if (item >= 2060000 && item <= 2060002) //bow arrows + { + recvQty = 1000 - (item - 2060000) * 100; + } else if (item >= 2061000 && item <= 2061002) //xbow arrows + { + recvQty = 1000 - (item - 2061000) * 100; + } else if (item == 4003000)//screws + { + recvQty = 15 * qty; + } else { + recvQty = qty; + } + + if (!cm.canHold(recvItem, recvQty)) { + cm.sendOk("I'm afraid you are short in inventory slots for this."); + } else if (cm.getMeso() < cost * qty) { + cm.sendOk("I'm afraid you cannot afford my services."); + } else { + if (mats instanceof Array) { + for (var i = 0; complete && i < mats.length; i++) { + if (matQty[i] * qty == 1) { + if (!cm.haveItem(mats[i])) { + complete = false; + } + } else { + + if (cm.haveItem(mats[i], matQty[i] * qty)) { + complete = false; + } + } + } + } else { + if (!cm.haveItem(mats, matQty * qty)) { + complete = false; } } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - if (cost > 0) - prompt += "\r\n#i4031138# " + cost * qty + " meso"; - - cm.sendYesNo(prompt); - } - else if (status == 5 && mode == 1) { - var complete = true; - var recvItem = item, recvQty; - - if (item >= 2060000 && item <= 2060002) //bow arrows - recvQty = 1000 - (item - 2060000) * 100; - else if (item >= 2061000 && item <= 2061002) //xbow arrows - recvQty = 1000 - (item - 2061000) * 100; - else if (item == 4003000)//screws - recvQty = 15 * qty; - else - recvQty = qty; - - if(!cm.canHold(recvItem, recvQty)) { - cm.sendOk("I'm afraid you are short in inventory slots for this."); - } - else if (cm.getMeso() < cost * qty) - { - cm.sendOk("I'm afraid you cannot afford my services."); - } - else - { + if (!complete) { + cm.sendOk("Please check and see if you have all the necessary items with you. If so, then please check your etc. inventory and see if you have an empty space."); + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - { - if (matQty[i] * qty == 1) { - if (!cm.haveItem(mats[i])) - { - complete = false; - } - } - else { - - if (cm.haveItem(mats[i],matQty[i]*qty))complete=false; - } + for (var i = 0; i < mats.length; i++) { + cm.gainItem(mats[i], -matQty[i] * qty); } + } else { + cm.gainItem(mats, -matQty * qty); } - else { - if (!cm.haveItem(mats, matQty * qty))complete=false; - } - - if (!complete) - cm.sendOk("Please check and see if you have all the necessary items with you. If so, then please check your etc. inventory and see if you have an empty space."); - else { - if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ - cm.gainItem(mats[i], -matQty[i] * qty); - } - } - else - cm.gainItem(mats, -matQty * qty); - if (cost > 0) - cm.gainMeso(-cost * qty); - - cm.gainItem(recvItem, recvQty); - cm.sendOk("There, finished. What do you think, a piece of art, isn't it? Well, if you need anything else, you know where to find me."); + if (cost > 0) { + cm.gainMeso(-cost * qty); } + + cm.gainItem(recvItem, recvQty); + cm.sendOk("There, finished. What do you think, a piece of art, isn't it? Well, if you need anything else, you know where to find me."); } - - cm.dispose(); } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/2100005.js b/scripts/npc/2100005.js index 92c189d298..d7372ae9dc 100644 --- a/scripts/npc/2100005.js +++ b/scripts/npc/2100005.js @@ -19,72 +19,72 @@ function pushIfItemExists(array, itemid) { } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - if (type == 7) { - cm.sendNext("I guess you aren't ready to make the change yet. Let me know when you are!"); + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + if (type == 7) { + cm.sendNext("I guess you aren't ready to make the change yet. Let me know when you are!"); + } + + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendSimple("Hey there! I'm Shatti, and I'm Mazra's apprentice. If you have #bAriant hair style coupon(REG)#k or #bAriant hair color coupon(REG)#k with you, how about allowing me to work on your hair? \r\n#L0#Haircut: #i5150026##t5150026##l\r\n#L1#Dye your hair: #i5151021##t5151021##l"); + } else if (status == 1) { + if (selection == 0) { + beauty = 1; + hairnew = Array(); + if (cm.getChar().getGender() == 0) { + for (var i = 0; i < mhair_r.length; i++) { + pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getChar().getHair() + % 10)); + } } - - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendSimple("Hey there! I'm Shatti, and I'm Mazra's apprentice. If you have #bAriant hair style coupon(REG)#k or #bAriant hair color coupon(REG)#k with you, how about allowing me to work on your hair? \r\n#L0#Haircut: #i5150026##t5150026##l\r\n#L1#Dye your hair: #i5151021##t5151021##l"); - } else if (status == 1) { - if (selection == 0) { - beauty = 1; - hairnew = Array(); - if (cm.getChar().getGender() == 0) { - for(var i = 0; i < mhair_r.length; i++) { - pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getChar().getHair() - % 10)); - } - } - if (cm.getChar().getGender() == 1) { - for(var i = 0; i < fhair_r.length; i++) { - pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getChar().getHair() - % 10)); - } - } - cm.sendYesNo("If you use the REG coupon, your hairstyle will be changed to a random new look. You'll also have access to new hairstyles I worked on that's not available for VIP coupons. Would you like to use #bAriant hair style coupon(REG)#k for a fabulous new look?"); - } else if (selection == 1) { - beauty = 2; - haircolor = Array(); - var current = parseInt(cm.getChar().getHair() -/10)*10; - for(var i = 0; i < 8; i++) { - pushIfItemExists(haircolor, current + i); - } - cm.sendYesNo("If you use the regular coupon, your hair color will change to a random new color. Are you sure you want to use #b#t5151021##k and randomly change your hair color?"); - } - } - else if (status == 2){ - cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150026) == true){ - cm.gainItem(5150026, -1); - cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); - cm.sendOk("Enjoy your new and improved hairstyle!"); - } else { - cm.sendNext("I can only change your hairstyle if you bring me the coupon. You didn't forget that, did you?"); - } - } - if (beauty == 2){ - if (cm.haveItem(5151021) == true){ - cm.gainItem(5151021, -1); - cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); - cm.sendOk("Enjoy your new and improved haircolor!"); - } else { - cm.sendNext("I can only change your hairstyle if you bring me the coupon. You didn't forget that, did you?"); - } - } - } - } + if (cm.getChar().getGender() == 1) { + for (var i = 0; i < fhair_r.length; i++) { + pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getChar().getHair() + % 10)); + } + } + cm.sendYesNo("If you use the REG coupon, your hairstyle will be changed to a random new look. You'll also have access to new hairstyles I worked on that's not available for VIP coupons. Would you like to use #bAriant hair style coupon(REG)#k for a fabulous new look?"); + } else if (selection == 1) { + beauty = 2; + haircolor = Array(); + var current = parseInt(cm.getChar().getHair() + / 10) * 10; + for (var i = 0; i < 8; i++) { + pushIfItemExists(haircolor, current + i); + } + cm.sendYesNo("If you use the regular coupon, your hair color will change to a random new color. Are you sure you want to use #b#t5151021##k and randomly change your hair color?"); + } + } else if (status == 2) { + cm.dispose(); + if (beauty == 1) { + if (cm.haveItem(5150026) == true) { + cm.gainItem(5150026, -1); + cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); + cm.sendOk("Enjoy your new and improved hairstyle!"); + } else { + cm.sendNext("I can only change your hairstyle if you bring me the coupon. You didn't forget that, did you?"); + } + } + if (beauty == 2) { + if (cm.haveItem(5151021) == true) { + cm.gainItem(5151021, -1); + cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); + cm.sendOk("Enjoy your new and improved haircolor!"); + } else { + cm.sendNext("I can only change your hairstyle if you bring me the coupon. You didn't forget that, did you?"); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2100006.js b/scripts/npc/2100006.js index d08c7d0430..e330160a31 100644 --- a/scripts/npc/2100006.js +++ b/scripts/npc/2100006.js @@ -19,68 +19,68 @@ function pushIfItemExists(array, itemid) { } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendSimple("Hahaha... it takes a lot of style and flair for someone to pay attention to his or her hairsyle in a desert. Someone like you...If you have #bAriant hair style coupon(VIP)#k or #bAriant hair color coupon(VIP)#k, I'll give your hair a fresh new look. \r\n#L0#Haircut: #i5150027##t5150027##l\r\n#L1#Dye your hair: #i5151022##t5151022##l"); - } else if (status == 1) { - if (selection == 0) { - beauty = 1; - hairnew = Array(); - if (cm.getChar().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { - pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getChar().getHair() - % 10)); - } - } - if (cm.getChar().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) { - pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getChar().getHair() - % 10)); - } - } - cm.sendStyle("Hahaha~all you need is #bAriant hair style coupon(VIP)#k to change up your hairstyle. Choose the new style, and let me do the rest.", hairnew); - } else if (selection == 1) { - beauty = 2; - haircolor = Array(); - var current = parseInt(cm.getChar().getHair() -/10)*10; - for(var i = 0; i < 8; i++) { - pushIfItemExists(haircolor, current + i); - } - cm.sendStyle("Every once in a while, it doesn't hurt to change up your hair color... it's fun. Allow me, the great Mazra, to dye your hair, so you just bring me #bAriant hair color coupon(VIP)#k, and choose your new hair color.", haircolor); - } - } - else if (status == 2){ - cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150027) == true){ - cm.gainItem(5150027, -1); - cm.setHair(hairnew[selection]); - cm.sendOk("Enjoy your new and improved hairstyle!"); - } else { - cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again."); - } - } - if (beauty == 2){ - if (cm.haveItem(5151022) == true){ - cm.gainItem(5151022, -1); - cm.setHair(haircolor[selection]); - cm.sendOk("Enjoy your new and improved haircolor!"); - } else { - cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again."); - } - } - } - } + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendSimple("Hahaha... it takes a lot of style and flair for someone to pay attention to his or her hairsyle in a desert. Someone like you...If you have #bAriant hair style coupon(VIP)#k or #bAriant hair color coupon(VIP)#k, I'll give your hair a fresh new look. \r\n#L0#Haircut: #i5150027##t5150027##l\r\n#L1#Dye your hair: #i5151022##t5151022##l"); + } else if (status == 1) { + if (selection == 0) { + beauty = 1; + hairnew = Array(); + if (cm.getChar().getGender() == 0) { + for (var i = 0; i < mhair_v.length; i++) { + pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getChar().getHair() + % 10)); + } + } + if (cm.getChar().getGender() == 1) { + for (var i = 0; i < fhair_v.length; i++) { + pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getChar().getHair() + % 10)); + } + } + cm.sendStyle("Hahaha~all you need is #bAriant hair style coupon(VIP)#k to change up your hairstyle. Choose the new style, and let me do the rest.", hairnew); + } else if (selection == 1) { + beauty = 2; + haircolor = Array(); + var current = parseInt(cm.getChar().getHair() + / 10) * 10; + for (var i = 0; i < 8; i++) { + pushIfItemExists(haircolor, current + i); + } + cm.sendStyle("Every once in a while, it doesn't hurt to change up your hair color... it's fun. Allow me, the great Mazra, to dye your hair, so you just bring me #bAriant hair color coupon(VIP)#k, and choose your new hair color.", haircolor); + } + } else if (status == 2) { + cm.dispose(); + if (beauty == 1) { + if (cm.haveItem(5150027) == true) { + cm.gainItem(5150027, -1); + cm.setHair(hairnew[selection]); + cm.sendOk("Enjoy your new and improved hairstyle!"); + } else { + cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again."); + } + } + if (beauty == 2) { + if (cm.haveItem(5151022) == true) { + cm.gainItem(5151022, -1); + cm.setHair(haircolor[selection]); + cm.sendOk("Enjoy your new and improved haircolor!"); + } else { + cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again."); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2100007.js b/scripts/npc/2100007.js index e3931f5ec4..0595639ec5 100644 --- a/scripts/npc/2100007.js +++ b/scripts/npc/2100007.js @@ -8,31 +8,32 @@ var status = 0; var skin = Array(0, 1, 2, 3, 4); function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendNext("Hohoh~ welcome welcome. Welcome to Ariant Skin Care. You have stepped into a renowned Skin Care shop that even the Queen herself frequents this place. If you have #bAriant skin care coupon#k with you, we'll take care of the rest. How about letting work on your skin today?"); - } else if (status == 1) { - cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of skin-treatment would you like to do? Choose the style of your liking...", skin); - } else if (status == 2){ - cm.dispose(); - if (cm.haveItem(5153007) == true){ - cm.gainItem(5153007, -1); - cm.setSkin(skin[selection]); - cm.sendOk("Enjoy your new and improved skin!"); - } else { - cm.sendNext("Hmmm... I don't think you have our Skin Care coupon with you. Without it, I can't give you the treatment"); - } - } - } + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendNext("Hohoh~ welcome welcome. Welcome to Ariant Skin Care. You have stepped into a renowned Skin Care shop that even the Queen herself frequents this place. If you have #bAriant skin care coupon#k with you, we'll take care of the rest. How about letting work on your skin today?"); + } else if (status == 1) { + cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of skin-treatment would you like to do? Choose the style of your liking...", skin); + } else if (status == 2) { + cm.dispose(); + if (cm.haveItem(5153007) == true) { + cm.gainItem(5153007, -1); + cm.setSkin(skin[selection]); + cm.sendOk("Enjoy your new and improved skin!"); + } else { + cm.sendNext("Hmmm... I don't think you have our Skin Care coupon with you. Without it, I can't give you the treatment"); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2100008.js b/scripts/npc/2100008.js index d1ae52e721..3f7dc3337e 100644 --- a/scripts/npc/2100008.js +++ b/scripts/npc/2100008.js @@ -21,7 +21,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -29,111 +29,112 @@ function pushIfItemsExists(array, itemidList) { } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendSimple("Ah, welcome to the Ariant Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152030##k or a #b#t5152047##k, I can make your face so much better!\r\n#L1#Plastic Surgery: #i5152030##t5152030##l\r\n#L2#Cosmetic Lens: #i5152047##t5152047##l\r\n#L3#One-time Cosmetic Lenses: #i5152101# (any color)#l"); - } else if (status == 1) { - if (selection == 1) { - beauty = 0; - - facenew = Array(); - if (cm.getChar().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) { - pushIfItemExists(facenew, mface_v[i] + cm.getChar().getFace() - % 1000 - (cm.getChar().getFace() - % 100)); - } - } - if (cm.getChar().getGender() == 1) { - for(var i = 0; i < fface.length; i++) { - pushIfItemExists(facenew, fface[i] + cm.getChar().getFace() - % 1000 - (cm.getChar().getFace() - % 100)); - } - } - cm.sendStyle("Hmmm... Face of beauty glows even under cover and burning desert. Choose the face you want, and I will pull out my outstanding skill for the great make over.", facenew); - } else if (selection == 2) { - beauty = 1; - - if (cm.getPlayer().getGender() == 0) { - var current = cm.getPlayer().getFace() - % 100 + 20000; - } - if (cm.getPlayer().getGender() == 1) { - var current = cm.getPlayer().getFace() - % 100 + 21000; - } - colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 300, current + 600, current + 700]); - cm.sendStyle("With the utmost finesse matching that of the sparkling sands of the desert that gleefully embraces the rooftop of the Palace, we will make your eyes shine even brighter with the new lenses. Select the one you want to use...", colors); - } else if (selection == 3) { - beauty = 3; - if (cm.getPlayer().getGender() == 0) { - var current = cm.getPlayer().getFace() - % 100 + 20000; - } - if (cm.getPlayer().getGender() == 1) { - var current = cm.getPlayer().getFace() - % 100 + 21000; - } + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } - colors = Array(); - for (var i = 0; i < 8; i++) { - if (cm.haveItem(5152100 + i)) { - pushIfItemExists(colors, current + 100 * i); - } - } + if (status == 0) { + cm.sendSimple("Ah, welcome to the Ariant Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152030##k or a #b#t5152047##k, I can make your face so much better!\r\n#L1#Plastic Surgery: #i5152030##t5152030##l\r\n#L2#Cosmetic Lens: #i5152047##t5152047##l\r\n#L3#One-time Cosmetic Lenses: #i5152101# (any color)#l"); + } else if (status == 1) { + if (selection == 1) { + beauty = 0; - if (colors.length == 0) { - cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); - cm.dispose(); - return; - } + facenew = Array(); + if (cm.getChar().getGender() == 0) { + for (var i = 0; i < mface_v.length; i++) { + pushIfItemExists(facenew, mface_v[i] + cm.getChar().getFace() + % 1000 - (cm.getChar().getFace() + % 100)); + } + } + if (cm.getChar().getGender() == 1) { + for (var i = 0; i < fface.length; i++) { + pushIfItemExists(facenew, fface[i] + cm.getChar().getFace() + % 1000 - (cm.getChar().getFace() + % 100)); + } + } + cm.sendStyle("Hmmm... Face of beauty glows even under cover and burning desert. Choose the face you want, and I will pull out my outstanding skill for the great make over.", facenew); + } else if (selection == 2) { + beauty = 1; - cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); - } - } else if (status == 2){ - cm.dispose(); - - if (beauty == 0) { - if (cm.haveItem(5152030) == true){ - cm.gainItem(5152030, -1); - cm.setFace(facenew[selection]); - cm.sendOk("Enjoy your new and improved face!"); - } else { - cm.sendNext("Erm... You don't seem to have the exclusive coupon for this hospital. Without the coupon, I'm afraid I can't do it for you."); - } - } else if (beauty == 1) { - if (cm.haveItem(5152047) == true){ - cm.gainItem(5152047, -1); - cm.setFace(colors[selection]); - cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else { - cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); - } - } else if (beauty == 3){ - var color = (colors[selection] / 100) % 100 | 0; + if (cm.getPlayer().getGender() == 0) { + var current = cm.getPlayer().getFace() + % 100 + 20000; + } + if (cm.getPlayer().getGender() == 1) { + var current = cm.getPlayer().getFace() + % 100 + 21000; + } + colors = Array(); + pushIfItemsExists(colors, [current, current + 100, current + 300, current + 600, current + 700]); + cm.sendStyle("With the utmost finesse matching that of the sparkling sands of the desert that gleefully embraces the rooftop of the Palace, we will make your eyes shine even brighter with the new lenses. Select the one you want to use...", colors); + } else if (selection == 3) { + beauty = 3; + if (cm.getPlayer().getGender() == 0) { + var current = cm.getPlayer().getFace() + % 100 + 20000; + } + if (cm.getPlayer().getGender() == 1) { + var current = cm.getPlayer().getFace() + % 100 + 21000; + } - if (cm.haveItem(5152100 + color)){ - cm.gainItem(5152100 + color, -1); - cm.setFace(colors[selection]); - cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else { - cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); - } - } - } - } + colors = Array(); + for (var i = 0; i < 8; i++) { + if (cm.haveItem(5152100 + i)) { + pushIfItemExists(colors, current + 100 * i); + } + } + + if (colors.length == 0) { + cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); + cm.dispose(); + return; + } + + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); + } + } else if (status == 2) { + cm.dispose(); + + if (beauty == 0) { + if (cm.haveItem(5152030) == true) { + cm.gainItem(5152030, -1); + cm.setFace(facenew[selection]); + cm.sendOk("Enjoy your new and improved face!"); + } else { + cm.sendNext("Erm... You don't seem to have the exclusive coupon for this hospital. Without the coupon, I'm afraid I can't do it for you."); + } + } else if (beauty == 1) { + if (cm.haveItem(5152047) == true) { + cm.gainItem(5152047, -1); + cm.setFace(colors[selection]); + cm.sendOk("Enjoy your new and improved cosmetic lenses!"); + } else { + cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); + } + } else if (beauty == 3) { + var color = (colors[selection] / 100) % 100 | 0; + + if (cm.haveItem(5152100 + color)) { + cm.gainItem(5152100 + color, -1); + cm.setFace(colors[selection]); + cm.sendOk("Enjoy your new and improved cosmetic lenses!"); + } else { + cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2100009.js b/scripts/npc/2100009.js index c269e1616e..0fa23cc0a9 100644 --- a/scripts/npc/2100009.js +++ b/scripts/npc/2100009.js @@ -21,7 +21,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -29,79 +29,80 @@ function pushIfItemsExists(array, itemidList) { } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc - if (type == 7) { - cm.sendNext("I see...take your time, see if you really want it. Let me know when you make up your mind."); - } - - cm.dispose(); - } else { - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendSimple("Hi, I'm the face surgery assistant doctor from around here. With a #b#t5152029##k or a #b#t5152048##k, I can make it kick in just nice, trust me. Ah, don't forget, what comes next after the operation will be random! Then, what are you going for?\r\n#L1#Plastic Surgery: #i5152029##t5152029##l\r\n#L2#Cosmetic Lens: #i5152048##t5152048##l"); - } else if (status == 1) { - if (selection == 1) { - beauty = 0; - - facenew = Array(); - if (cm.getChar().getGender() == 0) { - for(var i = 0; i < mface_r.length; i++) { - pushIfItemExists(facenew, mface_r[i] + cm.getChar().getFace() - % 1000 - (cm.getChar().getFace() - % 100)); - } - } - if (cm.getChar().getGender() == 1) { - for(var i = 0; i < fface_r.length; i++) { - pushIfItemExists(facenew, fface_r[i] + cm.getChar().getFace() - % 1000 - (cm.getChar().getFace() - % 100)); - } - } - cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152029##k?"); - } else if (selection == 2) { - beauty = 1; - if (cm.getPlayer().getGender() == 0) { - var current = cm.getPlayer().getFace() - % 100 + 20000; - } - if (cm.getPlayer().getGender() == 1) { - var current = cm.getPlayer().getFace() - % 100 + 21000; - } - colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 300, current + 600, current + 700]); - cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152048##k and really make the change to your eyes?"); - } - } else if (status == 2){ - cm.dispose(); - - if (beauty == 0) { - if (cm.haveItem(5152029) == true){ - cm.gainItem(5152029, -1); - cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); - cm.sendOk("Enjoy your new and improved face!"); - } else { - cm.sendNext("Um ... it looks like you don't have the coupon specifically for this place...sorry to say this, but without the coupon, there's no plastic surgery for you."); - } - } else if (beauty == 1) { - if (cm.haveItem(5152048)){ - cm.gainItem(5152048, -1); - cm.setFace(colors[Math.floor(Math.random() * colors.length)]); - cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else { - cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); - } - } - } - } + if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc + if (type == 7) { + cm.sendNext("I see...take your time, see if you really want it. Let me know when you make up your mind."); + } + + cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendSimple("Hi, I'm the face surgery assistant doctor from around here. With a #b#t5152029##k or a #b#t5152048##k, I can make it kick in just nice, trust me. Ah, don't forget, what comes next after the operation will be random! Then, what are you going for?\r\n#L1#Plastic Surgery: #i5152029##t5152029##l\r\n#L2#Cosmetic Lens: #i5152048##t5152048##l"); + } else if (status == 1) { + if (selection == 1) { + beauty = 0; + + facenew = Array(); + if (cm.getChar().getGender() == 0) { + for (var i = 0; i < mface_r.length; i++) { + pushIfItemExists(facenew, mface_r[i] + cm.getChar().getFace() + % 1000 - (cm.getChar().getFace() + % 100)); + } + } + if (cm.getChar().getGender() == 1) { + for (var i = 0; i < fface_r.length; i++) { + pushIfItemExists(facenew, fface_r[i] + cm.getChar().getFace() + % 1000 - (cm.getChar().getFace() + % 100)); + } + } + cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152029##k?"); + } else if (selection == 2) { + beauty = 1; + if (cm.getPlayer().getGender() == 0) { + var current = cm.getPlayer().getFace() + % 100 + 20000; + } + if (cm.getPlayer().getGender() == 1) { + var current = cm.getPlayer().getFace() + % 100 + 21000; + } + colors = Array(); + pushIfItemsExists(colors, [current, current + 100, current + 300, current + 600, current + 700]); + cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152048##k and really make the change to your eyes?"); + } + } else if (status == 2) { + cm.dispose(); + + if (beauty == 0) { + if (cm.haveItem(5152029) == true) { + cm.gainItem(5152029, -1); + cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); + cm.sendOk("Enjoy your new and improved face!"); + } else { + cm.sendNext("Um ... it looks like you don't have the coupon specifically for this place...sorry to say this, but without the coupon, there's no plastic surgery for you."); + } + } else if (beauty == 1) { + if (cm.haveItem(5152048)) { + cm.gainItem(5152048, -1); + cm.setFace(colors[Math.floor(Math.random() * colors.length)]); + cm.sendOk("Enjoy your new and improved cosmetic lenses!"); + } else { + cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2101.js b/scripts/npc/2101.js index a5d03dca76..84d548d9ed 100644 --- a/scripts/npc/2101.js +++ b/scripts/npc/2101.js @@ -27,15 +27,16 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0) + if (mode != 1) { + if (mode == 0) { cm.sendOk("Haven't you finished the training program yet? If you want to leave this place, please do not hesitate to tell me."); + } cm.dispose(); return; } - if (status == 0) + if (status == 0) { cm.sendNext("Then, I will send you out from here. Good job."); - else{ + } else { cm.warp(40000, 0); cm.dispose(); } diff --git a/scripts/npc/2101000.js b/scripts/npc/2101000.js index e41e8300d1..6faa237153 100644 --- a/scripts/npc/2101000.js +++ b/scripts/npc/2101000.js @@ -20,6 +20,6 @@ along with this program. If not, see . */ function start() { - cm.sendOk ("Just dancing well is not enough for me. I want to do a marvelous brilliant dance!"); + cm.sendOk("Just dancing well is not enough for me. I want to do a marvelous brilliant dance!"); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2101003.js b/scripts/npc/2101003.js index 52f384ad18..0fb8a2841b 100644 --- a/scripts/npc/2101003.js +++ b/scripts/npc/2101003.js @@ -4,7 +4,7 @@ function start() { - cm.sendNext ("Hey hey, don't try to start trouble with anyone. I want nothing to do with you."); + cm.sendNext("Hey hey, don't try to start trouble with anyone. I want nothing to do with you."); } function action() { diff --git a/scripts/npc/2101004.js b/scripts/npc/2101004.js index 8e4ab9262e..666da0a8b5 100644 --- a/scripts/npc/2101004.js +++ b/scripts/npc/2101004.js @@ -19,12 +19,13 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -/* + +/* Tigun Palace Guard */ function start() { - cm.sendNext("This isn't much of a #bpalace#k but it'll do until we can get an even better palace built! Anyone's allowed to speak to the king and queen, but don't expect niceness from either of them. Well... maybe King Abdullah VIII, if you catch him in his non-lazy and not-paying-attention moods."); + cm.sendNext("This isn't much of a #bpalace#k but it'll do until we can get an even better palace built! Anyone's allowed to speak to the king and queen, but don't expect niceness from either of them. Well... maybe King Abdullah VIII, if you catch him in his non-lazy and not-paying-attention moods."); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2101005.js b/scripts/npc/2101005.js index d0351c57ca..ff6a29c8a6 100644 --- a/scripts/npc/2101005.js +++ b/scripts/npc/2101005.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Byron Excavator/Treasure Hunter diff --git a/scripts/npc/2101008.js b/scripts/npc/2101008.js index e45295ace0..96eb04d38b 100644 --- a/scripts/npc/2101008.js +++ b/scripts/npc/2101008.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Schegerazade Palace Servant diff --git a/scripts/npc/2101010.js b/scripts/npc/2101010.js index 8004ae007f..f3ec0c5d27 100644 --- a/scripts/npc/2101010.js +++ b/scripts/npc/2101010.js @@ -20,7 +20,7 @@ along with this program. If not, see . */ function start() { - cm.warp (670010200, 3); + cm.warp(670010200, 3); cm.changeMusic("Bgm14/Ariant"); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2101011.js b/scripts/npc/2101011.js index a8fbd2d88c..922f9c73f9 100644 --- a/scripts/npc/2101011.js +++ b/scripts/npc/2101011.js @@ -19,12 +19,13 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Jano Right/Male Side */ function start() { - cm.sendNext ("The light and dark always coexist..."); + cm.sendNext("The light and dark always coexist..."); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2101013.js b/scripts/npc/2101013.js index f2cc998982..9928caa242 100644 --- a/scripts/npc/2101013.js +++ b/scripts/npc/2101013.js @@ -3,40 +3,41 @@ Map(s): The Burning Sands: Tents of the Entertainers(260010600) Description: Warps to Victoria Island */ -var towns = new Array(100000000,101000000,102000000,103000000,104000000); +var towns = [100000000, 101000000, 102000000, 103000000, 104000000]; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0) { - cm.sendNext("Aye...are you scared of speed or heights? You can't trust my flying skills? Trust me, I've worked out all the kinks!"); - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if(status == 0){ - cm.sendNext("I don't know how you found out about this, but you came to the right place! For those that wandered around Nihal Desert and are getting homesick, I am offering a flight straight to Victorial Island, non-stop! Don't worry about the flying ship--it's only fallen once or twice! Don't you feel claustrophobic being in a long flight on that small ship?"); - } else if(status == 1){ - cm.sendYesNo("Please remember two things. One, this line is actually for overseas shipping, so #rI cannot gurantee exactly which town you'll land#k. Two, since I am putting you in this special flight, it'll be a bit expensive. The service charge is #e#b10,000 mesos#n#k. There's a flight thats about to take off. Are you interested in this direct flight?"); - } else if(status == 2){ - cm.sendNext("Okay, ready to takeoff~"); - } else if(status == 3){ - if(cm.getMeso() >= 10000){ - cm.gainMeso(-10000); - cm.warp(towns[Math.floor(Math.random() * towns.length)]); - } else{ - cm.sendNextPrev("Hey, are you short on cash? I told you you'll need #b10,000#k mesos to get on this."); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0) { + cm.sendNext("Aye...are you scared of speed or heights? You can't trust my flying skills? Trust me, I've worked out all the kinks!"); + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendNext("I don't know how you found out about this, but you came to the right place! For those that wandered around Nihal Desert and are getting homesick, I am offering a flight straight to Victorial Island, non-stop! Don't worry about the flying ship--it's only fallen once or twice! Don't you feel claustrophobic being in a long flight on that small ship?"); + } else if (status == 1) { + cm.sendYesNo("Please remember two things. One, this line is actually for overseas shipping, so #rI cannot gurantee exactly which town you'll land#k. Two, since I am putting you in this special flight, it'll be a bit expensive. The service charge is #e#b10,000 mesos#n#k. There's a flight thats about to take off. Are you interested in this direct flight?"); + } else if (status == 2) { + cm.sendNext("Okay, ready to takeoff~"); + } else if (status == 3) { + if (cm.getMeso() >= 10000) { + cm.gainMeso(-10000); + cm.warp(towns[Math.floor(Math.random() * towns.length)]); + } else { + cm.sendNextPrev("Hey, are you short on cash? I told you you'll need #b10,000#k mesos to get on this."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2101014.js b/scripts/npc/2101014.js index 59dec9e986..db672437ae 100644 --- a/scripts/npc/2101014.js +++ b/scripts/npc/2101014.js @@ -40,12 +40,12 @@ function action(mode, type, selection) { cm.dispose(); return; } - + if (status == 0) { var expedicao = cm.getExpedition(exped); var expedicao1 = cm.getExpedition(exped1); var expedicao2 = cm.getExpedition(exped2); - + var channelMaps = cm.getClient().getChannelServer().getMapFactory(); var startSnd = "What would you like to do? \r\n\r\n\t#e#r(Choose a Battle Arena)#n#k\r\n#b"; var toSnd = startSnd; @@ -78,7 +78,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - + if (expedicao != null) { enterArena(-1); } else { @@ -94,7 +94,7 @@ function action(mode, type, selection) { status = 0; } else { enterArena(players); - } + } } } } @@ -122,7 +122,7 @@ function fetchArenaType() { map = 0; expedicao = ""; } - + return expedicao; } @@ -130,7 +130,7 @@ function enterArena(arenaPlayers) { expedicao = fetchArenaType(); if (expedicao == "") { cm.dispose(); - return; + } else if (expedicao == null) { if (arenaPlayers != -1) { var res = cm.createExpedition(exped, true, 0, arenaPlayers); @@ -145,7 +145,7 @@ function enterArena(arenaPlayers) { } else { cm.sendOk("An unexpected error has occurred when locating the expedition, please try again later."); } - + cm.dispose(); } else { if (playerAlreadyInLobby(cm.getPlayer())) { @@ -175,6 +175,6 @@ function enterArena(arenaPlayers) { function playerAlreadyInLobby(player) { return cm.getExpedition(ExpeditionType.ARIANT) != null && cm.getExpedition(ExpeditionType.ARIANT).contains(player) || - cm.getExpedition(ExpeditionType.ARIANT1) != null && cm.getExpedition(ExpeditionType.ARIANT1).contains(player) || - cm.getExpedition(ExpeditionType.ARIANT2) != null && cm.getExpedition(ExpeditionType.ARIANT2).contains(player); + cm.getExpedition(ExpeditionType.ARIANT1) != null && cm.getExpedition(ExpeditionType.ARIANT1).contains(player) || + cm.getExpedition(ExpeditionType.ARIANT2) != null && cm.getExpedition(ExpeditionType.ARIANT2).contains(player); } \ No newline at end of file diff --git a/scripts/npc/2101015.js b/scripts/npc/2101015.js index 5ef0793b69..70730a82f5 100644 --- a/scripts/npc/2101015.js +++ b/scripts/npc/2101015.js @@ -8,7 +8,7 @@ function start() { cm.dispose(); return; } - + status = -1; action(1, 0, 0); } @@ -21,10 +21,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { menuStr = generateSelectionMenu(["I would like to check my battle points! / I would like to exchange (1) Palm Tree Beach Chair", "I would like to know more about the points of the Battle Arena."]); cm.sendSimple("Hello, what I can do for you?\r\n\r\n" + menuStr); diff --git a/scripts/npc/2101016.js b/scripts/npc/2101016.js index 324846c156..5b38a35343 100644 --- a/scripts/npc/2101016.js +++ b/scripts/npc/2101016.js @@ -8,7 +8,7 @@ function start() { cm.dispose(); return; } - + status = -1; action(1, 0, 0); } @@ -21,10 +21,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { copns = arena.getAriantScore(cm.getPlayer()); if (copns < 1 && !cm.getPlayer().isGM()) { @@ -39,10 +40,10 @@ function action(mode, type, selection) { arena.clearAriantRewardTier(cm.getPlayer()); arena.clearAriantScore(cm.getPlayer()); cm.removeAll(4031868); - + cm.getPlayer().gainExp(92.7 * cm.getPlayer().getExpRate() * copns, true, true); cm.getPlayer().gainAriantPoints(copns); - cm.sendOk("Alright! Make me more jewels next time! Ahahahahah!"); + cm.sendOk("Alright! Make me more jewels next time! Ahahahahah!"); cm.dispose(); } } diff --git a/scripts/npc/2101017.js b/scripts/npc/2101017.js index 1741dfb41b..5690d6008d 100644 --- a/scripts/npc/2101017.js +++ b/scripts/npc/2101017.js @@ -20,7 +20,7 @@ function start() { } function action(mode, type, selection) { - + if (mode == -1) { cm.dispose(); } else { @@ -42,12 +42,12 @@ function action(mode, type, selection) { exped = ExpeditionType.ARIANT2; expedicao = cm.getExpedition(exped); } - + if (expedicao == null) { cm.dispose(); return; } - + expedMembers = expedicao.getMemberList(); if (status == 0) { if (cm.isLeaderExpedition(exped)) { @@ -89,12 +89,12 @@ function action(mode, type, selection) { cm.dispose(); return; } - + var errorMsg = cm.startAriantBattle(exped, cm.getPlayer().getMapId()); if (errorMsg != "") { cm.sendOk(errorMsg); } - + cm.dispose(); } } else if (selection == 4) { @@ -144,6 +144,6 @@ function action(mode, type, selection) { } else { cm.sendOk("Hi there, have you heard of the Ariant Coliseum Battle Arena, it's a competitive event available to players between level 20 to 30!"); cm.dispose(); - } + } } } diff --git a/scripts/npc/2101018.js b/scripts/npc/2101018.js index 51eca3877d..5ed61bf8bd 100644 --- a/scripts/npc/2101018.js +++ b/scripts/npc/2101018.js @@ -28,36 +28,38 @@ */ status = -1; + function start() { - if((cm.getPlayer().getLevel() < 19 || cm.getPlayer().getLevel() > 30) && !cm.getPlayer().isGM()){ + if ((cm.getPlayer().getLevel() < 19 || cm.getPlayer().getLevel() > 30) && !cm.getPlayer().isGM()) { cm.sendNext("You're not between level 20 and 30. Sorry, you may not participate."); cm.dispose(); return; } - action(1,0,0); + action(1, 0, 0); } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; - if (status == 4){ + if (status == 4) { cm.getPlayer().saveLocation("MIRROR"); cm.warp(980010000, 3); cm.dispose(); } - if(mode != 1){ - if(mode == 0 && type == 0) + if (mode != 1) { + if (mode == 0 && type == 0) { status -= 2; - else{ + } else { cm.dispose(); return; } } - if (status == 0) + if (status == 0) { cm.sendNext("I have prepared a huge festival here at Ariant for the great fighters of MapleStory. It's called #bThe Ariant Coliseum Challenge#k."); - else if (status == 1) + } else if (status == 1) { cm.sendNextPrev("The Ariant Coliseum Challenge is a competition that matches the skills of monster combat against others. In this competition, your object isn't to hunt the monster; rather, you need to #beliminate a set amount of HP from the monster, followed by absorbing it with a jewel#k. #bThe fighter that ends up with the most jewels will win the competition.#k"); - else if (status == 2) + } else if (status == 2) { cm.sendSimple("If you are a strong and brave warrior from #bPerion#k, training under Dances With Balrogs, then are you interested in participating in The Ariant Coliseum Challenge?!\r\n#b#L0# I'd love to participate in this great competition.#l"); - else if (status == 3) + } else if (status == 3) { cm.sendNext("Okay, now I'll send you to the battle arena. I'd like to see you emerge victorious!"); + } } \ No newline at end of file diff --git a/scripts/npc/2102000.js b/scripts/npc/2102000.js index 976cb52f55..28ae9f584f 100644 --- a/scripts/npc/2102000.js +++ b/scripts/npc/2102000.js @@ -21,7 +21,7 @@ */ function start() { - if(cm.haveItem(4031045)){ + if (cm.haveItem(4031045)) { var em = cm.getEventManager("Genie"); if (em.getProperty("entry") == "true") { cm.sendYesNo("This will not be a short flight, so you need to take care of some things, I suggest you do that first before getting on board. Do you still wish to board the genie?"); @@ -34,21 +34,21 @@ function start() { cm.dispose(); } } + function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Okay, talk to me if you change your mind!"); + cm.sendOk("Okay, talk to me if you change your mind!"); cm.dispose(); - return; + return; } - + var em = cm.getEventManager("Genie"); if (em.getProperty("entry") == "true") { cm.warp(260000110); cm.gainItem(4031045, -1); - } - else { + } else { cm.sendOk("This genie is getting ready for takeoff. I'm sorry, but you'll have to get on the next ride. The ride schedule is available through the guide at the ticketing booth."); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2102001.js b/scripts/npc/2102001.js index 4f2ef64c7e..0e18fa735e 100644 --- a/scripts/npc/2102001.js +++ b/scripts/npc/2102001.js @@ -35,7 +35,7 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 1) { - cm.sendNext ("Alright, see you next time. Take care."); + cm.sendNext("Alright, see you next time. Take care."); status++; } else if (status == 2) { cm.warp(260000100, 0); diff --git a/scripts/npc/2102002.js b/scripts/npc/2102002.js index b8e9153eb3..cf92d63eb8 100644 --- a/scripts/npc/2102002.js +++ b/scripts/npc/2102002.js @@ -27,25 +27,25 @@ function start() { } function action(mode, type, selection) { - if(mode == -1) { + if (mode == -1) { cm.dispose(); } else { - if(mode == 1) { + if (mode == 1) { status++; } - if(mode == 0) { + if (mode == 0) { cm.sendNext("You must have some business to take care of here, right?"); cm.dispose(); return; } - if(status == 0) { - cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 10 minutes, beginning on the hour, and it'll cost you #b"+cost+" mesos#k. Are you sure you want to purchase #b#t4031045##k?"); - } else if(status == 1) { - if(cm.getMeso() >= cost && cm.canHold(4031045)) { - cm.gainItem(4031045,1); + if (status == 0) { + cm.sendYesNo("Hello, I'm in charge of selling tickets for the ship ride to Orbis Station of Ossyria. The ride to Orbis takes off every 10 minutes, beginning on the hour, and it'll cost you #b" + cost + " mesos#k. Are you sure you want to purchase #b#t4031045##k?"); + } else if (status == 1) { + if (cm.getMeso() >= cost && cm.canHold(4031045)) { + cm.gainItem(4031045, 1); cm.gainMeso(-cost); } else { - cm.sendOk("Are you sure you have #b"+cost+" mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); + cm.sendOk("Are you sure you have #b" + cost + " mesos#k? If so, then I urge you to check your etc. inventory, and see if it's full or not."); } cm.dispose(); } diff --git a/scripts/npc/2103000.js b/scripts/npc/2103000.js index c69c792dc4..d2f192118a 100644 --- a/scripts/npc/2103000.js +++ b/scripts/npc/2103000.js @@ -17,6 +17,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Oasis near Ariant Castle */ @@ -32,38 +33,39 @@ function start() { } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - if(cm.isQuestStarted(3900) && cm.getQuestProgressInt(3900) != 5) { - cm.sendOk("#b(You drink the water from the oasis and feel refreshed.)", 2); - cm.setQuestProgress(3900, 5); - } else if(cm.isQuestCompleted(3938)) { - if(cm.canHold(2210005)) { - if(!cm.haveItem(2210005) && !isTigunMorphed(cm.getPlayer())) { - cm.gainItem(2210005, 1); - cm.sendOk("You found a lock of hair (probably Tigun's) floating by the water and catched it. Remembering how #bJano#k made it last time, you crafted a new #t2210005#", 2); - } - } else { - cm.sendOk("You don't have a USE slot available.", 2); - } - } else if(cm.isQuestStarted(3934) || (cm.isQuestCompleted(3934) && !cm.isQuestCompleted(3935))) { - if(cm.canHold(2210005)) { - if(!cm.haveItem(2210005) && !isTigunMorphed(cm.getPlayer())) { - cm.gainItem(2210005, 1); - cm.sendOk("You managed to find a strange flask floating on the river. It seems like a transformation bottle mimicking one of the guards of the castle, maybe with it you will be able to roam inside freely.", 2); - } - } else { - cm.sendOk("You found a strange flask floating on the river. But you decided to ignore it since you don't have a USE slot available.", 2); - } + if (cm.isQuestStarted(3900) && cm.getQuestProgressInt(3900) != 5) { + cm.sendOk("#b(You drink the water from the oasis and feel refreshed.)", 2); + cm.setQuestProgress(3900, 5); + } else if (cm.isQuestCompleted(3938)) { + if (cm.canHold(2210005)) { + if (!cm.haveItem(2210005) && !isTigunMorphed(cm.getPlayer())) { + cm.gainItem(2210005, 1); + cm.sendOk("You found a lock of hair (probably Tigun's) floating by the water and catched it. Remembering how #bJano#k made it last time, you crafted a new #t2210005#", 2); + } + } else { + cm.sendOk("You don't have a USE slot available.", 2); } - - cm.dispose(); + } else if (cm.isQuestStarted(3934) || (cm.isQuestCompleted(3934) && !cm.isQuestCompleted(3935))) { + if (cm.canHold(2210005)) { + if (!cm.haveItem(2210005) && !isTigunMorphed(cm.getPlayer())) { + cm.gainItem(2210005, 1); + cm.sendOk("You managed to find a strange flask floating on the river. It seems like a transformation bottle mimicking one of the guards of the castle, maybe with it you will be able to roam inside freely.", 2); + } + } else { + cm.sendOk("You found a strange flask floating on the river. But you decided to ignore it since you don't have a USE slot available.", 2); + } + } + + cm.dispose(); } } } \ No newline at end of file diff --git a/scripts/npc/2103001.js b/scripts/npc/2103001.js index 241adeade8..5c4b05723d 100644 --- a/scripts/npc/2103001.js +++ b/scripts/npc/2103001.js @@ -5,10 +5,10 @@ function start() { } function action(mode, type, selection) { - if(cm.isQuestStarted(3927)) { + if (cm.isQuestStarted(3927)) { cm.sendNext("If I had an iron hammer and a dagger, a bow and an arrow..."); cm.setQuestProgress(3927, 1); } - + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2103002.js b/scripts/npc/2103002.js index 5ef7f0c1e3..f1d4fda8aa 100644 --- a/scripts/npc/2103002.js +++ b/scripts/npc/2103002.js @@ -21,36 +21,37 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3923) && !cm.haveItem(4031578, 1)) { - if(cm.canHold(4031578, 1)) { - cm.sendOk("You have just swiped the ring. Clear the area asap!", 2); - cm.gainItem(4031578, 1); - } else { - cm.sendOk("You don't have a ETC slot available.", 2); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3923) && !cm.haveItem(4031578, 1)) { + if (cm.canHold(4031578, 1)) { + cm.sendOk("You have just swiped the ring. Clear the area asap!", 2); + cm.gainItem(4031578, 1); + } else { + cm.sendOk("You don't have a ETC slot available.", 2); + } + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2103003.js b/scripts/npc/2103003.js index 98960f3301..cfc0d83f6e 100644 --- a/scripts/npc/2103003.js +++ b/scripts/npc/2103003.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3929)) { - var progress = cm.getQuestProgress(3929); - var slot = 0; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031580, -1); - cm.setQuestProgress(3929, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3929)) { + var progress = cm.getQuestProgress(3929); + var slot = 0; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031580, -1); + cm.setQuestProgress(3929, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103004.js b/scripts/npc/2103004.js index 24d3e420f5..eb51041370 100644 --- a/scripts/npc/2103004.js +++ b/scripts/npc/2103004.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3929)) { - var progress = cm.getQuestProgress(3929); - var slot = 2; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031580, -1); - cm.setQuestProgress(3929, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3929)) { + var progress = cm.getQuestProgress(3929); + var slot = 2; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031580, -1); + cm.setQuestProgress(3929, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103005.js b/scripts/npc/2103005.js index 83898e072b..2a365296b7 100644 --- a/scripts/npc/2103005.js +++ b/scripts/npc/2103005.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3929)) { - var progress = cm.getQuestProgress(3929); - var slot = 1; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031580, -1); - cm.setQuestProgress(3929, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3929)) { + var progress = cm.getQuestProgress(3929); + var slot = 1; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031580, -1); + cm.setQuestProgress(3929, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103006.js b/scripts/npc/2103006.js index d6c45109ef..06e4f1c7a7 100644 --- a/scripts/npc/2103006.js +++ b/scripts/npc/2103006.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3929)) { - var progress = cm.getQuestProgress(3929); - var slot = 3; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031580, -1); - cm.setQuestProgress(3929, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3929)) { + var progress = cm.getQuestProgress(3929); + var slot = 3; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031580, -1); + cm.setQuestProgress(3929, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103009.js b/scripts/npc/2103009.js index 33a4eaf1fa..851290b505 100644 --- a/scripts/npc/2103009.js +++ b/scripts/npc/2103009.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3926)) { - var progress = cm.getQuestProgress(3926); - var slot = 0; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031579, -1); - cm.setQuestProgress(3926, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3926)) { + var progress = cm.getQuestProgress(3926); + var slot = 0; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031579, -1); + cm.setQuestProgress(3926, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103010.js b/scripts/npc/2103010.js index f6c8ad13e1..cd95e64965 100644 --- a/scripts/npc/2103010.js +++ b/scripts/npc/2103010.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3926)) { - var progress = cm.getQuestProgress(3926); - var slot = 2; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031579, -1); - cm.setQuestProgress(3926, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3926)) { + var progress = cm.getQuestProgress(3926); + var slot = 2; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031579, -1); + cm.setQuestProgress(3926, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103011.js b/scripts/npc/2103011.js index 617dceae09..0f3b4a5bc9 100644 --- a/scripts/npc/2103011.js +++ b/scripts/npc/2103011.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3926)) { - var progress = cm.getQuestProgress(3926); - var slot = 1; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031579, -1); - cm.setQuestProgress(3926, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3926)) { + var progress = cm.getQuestProgress(3926); + var slot = 1; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031579, -1); + cm.setQuestProgress(3926, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103012.js b/scripts/npc/2103012.js index 63b9f4874b..1265f79253 100644 --- a/scripts/npc/2103012.js +++ b/scripts/npc/2103012.js @@ -22,40 +22,41 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3926)) { - var progress = cm.getQuestProgress(3926); - var slot = 3; - - var ch = progress[slot]; - if(ch == '2') { - var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); - - cm.gainItem(4031579, -1); - cm.setQuestProgress(3926, nextProgress); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3926)) { + var progress = cm.getQuestProgress(3926); + var slot = 3; + + var ch = progress[slot]; + if (ch == '2') { + var nextProgress = progress.substr(0, slot) + '3' + progress.substr(slot + 1); + + cm.gainItem(4031579, -1); + cm.setQuestProgress(3926, nextProgress); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2103013.js b/scripts/npc/2103013.js index 9eddad86c0..1bc47a6dae 100644 --- a/scripts/npc/2103013.js +++ b/scripts/npc/2103013.js @@ -24,8 +24,8 @@ var selected = -1; var party = 0; function start() { - cm.sendOk("The PyramidPQ is currently unavailable."); - cm.dispose(); + cm.sendOk("The PyramidPQ is currently unavailable."); + cm.dispose(); } /*function start() { @@ -43,144 +43,162 @@ function start() { */ function action(mode, type, selection) { - if (mode == 0 && type == 0) { - status--; - } else if (mode < 0 || (type == 4 && mode == 0)) { - cm.dispose(); - return; - } else status++; - - if (cm.getMapId() == 926010000) { - if (status == 0) { - if (selection > -1) selected = selection; - if (selection == 0 || selected == 0) { - cm.sendNext("This is the pyramid of Nett, the god of chaos and revenge. For a long time, it was buried deep in the desert, but Nett has ordered it to rise above ground. If you are unafraid of chaos and possible death, you may challenge Pharaoh Yeti, who lies asleep inside the Pyramid. Whatever the outcome, the choice is yours to make."); - } else if (selection == 1) { - cm.sendSimple("You fools who know no fear of Nett's wrath, it is now time to choose your destiny! \r\n\r\n#b#L0# Enter alone.#l\r\n#L1# Enter with a party of 2 or more.#l"); - } else if (selection == 2) { - cm.openUI(0x16); - cm.showInfoText("Use the Party Search (Hotkey O) window to search for a party to join anytime and anywhere!"); - cm.dispose(); - } else if (selection == 3) { - cm.sendSimple("What gem have you brought?\r\n\r\n#L0##i4001322# #t4001322##l\r\n#L1##i4001323# #t4001323##l\r\n#L2##i4001324# #t4001324##l\r\n#L3##i4001325# #t4001325##l"); - } else if (selection == 4) { - cm.sendNext("Inside Pharaoh Yeti's Tomb, you can acquire a #e#b#t2022613##k#n by proving yourself capable of defeating the #bPharaoh Jr. Yeti#k, the Pharaoh's clone. Inside that box lies a very special treasure. It is the #e#b#t1132012##k#n.\r\n#i1132012:# #t1132012#\r\n\r\n And if you are somehow able to survive Hell Mode, you will receive the #e#b#t1132013##k#n.\r\n\r\n#i1132013:# #t1132013#\r\n\r\n Though, of course, Nett won't allow that to happen."); - } else if (selection == 5) { - var progress = cm.getQuestProgressInt(29932); - if (progress >= 50000) - cm.dispose(); - else - cm.sendNext(""); - - } - } else if (status == 1) { - if (selected == 0) { - cm.sendNextPrev("Once you enter the Pyramid, you will be faced with the wrath of Nett. Since you don't look too sharp, I will offer you some advice and rules to follow. Remember them well.#b\r\n\r\n1. Be careful that your #e#rAct Gauge#b#n does not decrease. The only way to maintain your Gauge level is to battle the monsters without stopping.\r\n2. Those who are unable will pay dearly. Be careful to not cause any #rMiss#b.\r\n3. Be wary of the Pharaoh Jr. Yeti with the #v04032424# mark. Make the mistake of attacking him and you will regret it.\r\n4. Be wise about using the skill that is given to you for Kill accomplishments."); - } else if (selected == 1) { - party = selection; - cm.sendSimple("You who lack fear of death's cruelty, make your decision!\r\n#L0##i3994115##l#L1##i3994116##l#L2##i3994117##l#L3##i3994118##l"); - } else if (selected == 3) { - if (selection == 0) { - if (cm.haveItem(4001322)) { - return; - } - } else if (selection == 1) { - if (cm.haveItem(4001323)) { - return; - } - } else if (selection == 2) { - if (cm.haveItem(4001324)) { - return; - } - } else if (selection == 3) { - if (cm.haveItem(4001325)) { - return; - } - } - cm.sendOk("You'll need a gem to enter Pharaoh Yeti's Tomb. Are you sure you have one?"); - cm.dispose(); - } else if (selected == 5) { - } else { - cm.dispose(); - } - } else if (status == 2) { - if (selected == 0) { - cm.sendNextPrev("Those who are able to withstand Nett's wrath will be honored, but those who fail will face destruction. This is all the advice I can give you. The rest is in your hands."); - } else if (selected == 1) { - var mode = "EASY"; - //Finish this - var pqparty = cm.getPlayer().getParty(); - if (party == 1) { - if (pqparty == null) { - cm.sendOk("Create a fucking party faggot.");//BE NICE - cm.dispose(); - return; - } else { - if (pqparty.getMembers().size() < 2) { - cm.sendOk("Get more members..."); - cm.dispose(); - return; - } else { - var i = 0; - for (var a = 0; a < pq.getMembers().size(); a++) { - var pqchar = pq.getMembers().get(a); - if (i > 1) break; - if (pqchar != null && pqchar.getMapId() == 926010000) i++; - } - if (i < 2) { - cm.sendOk("Make sure that 2 or more party members are in your map."); - cm.dispose(); - return; - } - } - } - } - - if (cm.getPlayer().getLevel() < 40) { - cm.sendOk("You must be Lv. 40+ to enter this PQ."); - cm.dispose(); - return; - } - if (selection < 3 && cm.getPlayer().getLevel() > 60) { - cm.sendOk("Only Hell mode is avaible for players that are over Lv. 60."); - cm.dispose(); - return; - } - if (selection == 1) mode = "NORMAL"; - else if (selection == 2) mode = "HARD"; - else if (selection == 3) mode = "HELL"; - - if (!cm.createPyramid(mode, party == 1)) { - cm.sendOk("All rooms are full for this mode, please try it again later or on another channel ):"); - } - cm.dispose(); - } - } else if (status == 3) { - cm.dispose(); - } - } else if (cm.getMapId() == 926020001) { - if (status == 0) { - if (selection == 0) - cm.dispose();//:( - else if (selection == 1) - cm.sendNext("I will give you Pharaoh Yeti's Gem. You will be able to enter Pharaoh Yeti's Tomb anytime with this Gem. Check to see if you have at least 1 empty slot in your Etc window."); - - } else if (status == 1) { - var itemid = 4001325; - if (cm.getPlayer().getLevel() >= 60) itemid = 4001325; - if (cm.canHold(itemid)) { - cm.gainItem(itemid); - cm.warp(926010000); - } else - cm.showInfoText("You must have at least 1 empty slot in your Etc window to receive the reward."); - - cm.dispose(); - } - } else { - cm.warp(926010000); - cm.getPlayer().setPartyQuest(null); - cm.dispose(); - } + if (mode == 0 && type == 0) { + status--; + } else if (mode < 0 || (type == 4 && mode == 0)) { + cm.dispose(); + return; + } else { + status++; + } + + if (cm.getMapId() == 926010000) { + if (status == 0) { + if (selection > -1) { + selected = selection; + } + if (selection == 0 || selected == 0) { + cm.sendNext("This is the pyramid of Nett, the god of chaos and revenge. For a long time, it was buried deep in the desert, but Nett has ordered it to rise above ground. If you are unafraid of chaos and possible death, you may challenge Pharaoh Yeti, who lies asleep inside the Pyramid. Whatever the outcome, the choice is yours to make."); + } else if (selection == 1) { + cm.sendSimple("You fools who know no fear of Nett's wrath, it is now time to choose your destiny! \r\n\r\n#b#L0# Enter alone.#l\r\n#L1# Enter with a party of 2 or more.#l"); + } else if (selection == 2) { + cm.openUI(0x16); + cm.showInfoText("Use the Party Search (Hotkey O) window to search for a party to join anytime and anywhere!"); + cm.dispose(); + } else if (selection == 3) { + cm.sendSimple("What gem have you brought?\r\n\r\n#L0##i4001322# #t4001322##l\r\n#L1##i4001323# #t4001323##l\r\n#L2##i4001324# #t4001324##l\r\n#L3##i4001325# #t4001325##l"); + } else if (selection == 4) { + cm.sendNext("Inside Pharaoh Yeti's Tomb, you can acquire a #e#b#t2022613##k#n by proving yourself capable of defeating the #bPharaoh Jr. Yeti#k, the Pharaoh's clone. Inside that box lies a very special treasure. It is the #e#b#t1132012##k#n.\r\n#i1132012:# #t1132012#\r\n\r\n And if you are somehow able to survive Hell Mode, you will receive the #e#b#t1132013##k#n.\r\n\r\n#i1132013:# #t1132013#\r\n\r\n Though, of course, Nett won't allow that to happen."); + } else if (selection == 5) { + var progress = cm.getQuestProgressInt(29932); + if (progress >= 50000) { + cm.dispose(); + } else { + cm.sendNext(""); + } + + } + } else if (status == 1) { + if (selected == 0) { + cm.sendNextPrev("Once you enter the Pyramid, you will be faced with the wrath of Nett. Since you don't look too sharp, I will offer you some advice and rules to follow. Remember them well.#b\r\n\r\n1. Be careful that your #e#rAct Gauge#b#n does not decrease. The only way to maintain your Gauge level is to battle the monsters without stopping.\r\n2. Those who are unable will pay dearly. Be careful to not cause any #rMiss#b.\r\n3. Be wary of the Pharaoh Jr. Yeti with the #v04032424# mark. Make the mistake of attacking him and you will regret it.\r\n4. Be wise about using the skill that is given to you for Kill accomplishments."); + } else if (selected == 1) { + party = selection; + cm.sendSimple("You who lack fear of death's cruelty, make your decision!\r\n#L0##i3994115##l#L1##i3994116##l#L2##i3994117##l#L3##i3994118##l"); + } else if (selected == 3) { + if (selection == 0) { + if (cm.haveItem(4001322)) { + return; + } + } else if (selection == 1) { + if (cm.haveItem(4001323)) { + return; + } + } else if (selection == 2) { + if (cm.haveItem(4001324)) { + return; + } + } else if (selection == 3) { + if (cm.haveItem(4001325)) { + return; + } + } + cm.sendOk("You'll need a gem to enter Pharaoh Yeti's Tomb. Are you sure you have one?"); + cm.dispose(); + } else if (selected == 5) { + } else { + cm.dispose(); + } + } else if (status == 2) { + if (selected == 0) { + cm.sendNextPrev("Those who are able to withstand Nett's wrath will be honored, but those who fail will face destruction. This is all the advice I can give you. The rest is in your hands."); + } else if (selected == 1) { + var mode = "EASY"; + //Finish this + var pqparty = cm.getPlayer().getParty(); + if (party == 1) { + if (pqparty == null) { + cm.sendOk("Create a fucking party faggot.");//BE NICE + cm.dispose(); + return; + } else { + if (pqparty.getMembers().size() < 2) { + cm.sendOk("Get more members..."); + cm.dispose(); + return; + } else { + var i = 0; + for (var a = 0; a < pq.getMembers().size(); a++) { + var pqchar = pq.getMembers().get(a); + if (i > 1) { + break; + } + if (pqchar != null && pqchar.getMapId() == 926010000) { + i++; + } + } + if (i < 2) { + cm.sendOk("Make sure that 2 or more party members are in your map."); + cm.dispose(); + return; + } + } + } + } + + if (cm.getPlayer().getLevel() < 40) { + cm.sendOk("You must be Lv. 40+ to enter this PQ."); + cm.dispose(); + return; + } + if (selection < 3 && cm.getPlayer().getLevel() > 60) { + cm.sendOk("Only Hell mode is avaible for players that are over Lv. 60."); + cm.dispose(); + return; + } + if (selection == 1) { + mode = "NORMAL"; + } else if (selection == 2) { + mode = "HARD"; + } else if (selection == 3) { + mode = "HELL"; + } + + if (!cm.createPyramid(mode, party == 1)) { + cm.sendOk("All rooms are full for this mode, please try it again later or on another channel ):"); + } + cm.dispose(); + } + } else if (status == 3) { + cm.dispose(); + } + } else if (cm.getMapId() == 926020001) { + if (status == 0) { + if (selection == 0) { + cm.dispose(); + }//:( + else if (selection == 1) { + cm.sendNext("I will give you Pharaoh Yeti's Gem. You will be able to enter Pharaoh Yeti's Tomb anytime with this Gem. Check to see if you have at least 1 empty slot in your Etc window."); + } + + } else if (status == 1) { + var itemid = 4001325; + if (cm.getPlayer().getLevel() >= 60) { + itemid = 4001325; + } + if (cm.canHold(itemid)) { + cm.gainItem(itemid); + cm.warp(926010000); + } else { + cm.showInfoText("You must have at least 1 empty slot in your Etc window to receive the reward."); + } + + cm.dispose(); + } + } else { + cm.warp(926010000); + cm.getPlayer().setPartyQuest(null); + cm.dispose(); + } }/*Do you want to forfeit the challenge and leave? Your allotted time has passed. Do you want to leave now? diff --git a/scripts/npc/2110002.js b/scripts/npc/2110002.js index 59f5d868ab..3afdf1f684 100644 --- a/scripts/npc/2110002.js +++ b/scripts/npc/2110002.js @@ -27,7 +27,7 @@ * * Kerning City Party Quest NPC */ - + function start() { cm.showEffect("quest/party/clear"); cm.dispose(); diff --git a/scripts/npc/2110005.js b/scripts/npc/2110005.js index 37aecf9d55..973dca048a 100644 --- a/scripts/npc/2110005.js +++ b/scripts/npc/2110005.js @@ -42,12 +42,13 @@ function action(mode, type, selection) { if (cm.getMeso() < 1500) { cm.sendNext("I am sorry, but I think you are short on mesos. I am afraid I can't let you ride this if you do not have enough money to do so. Please come back when you have enough money to use this."); cm.dispose(); - } else { + } else { cm.warp(cm.getPlayer().getMapId() == 260020000 ? 261000000 : 260000000, 0); - cm.gainMeso(-1500); + cm.gainMeso(-1500); cm.dispose(); - } - } else if (mode == 0) + } + } else if (mode == 0) { cm.sendNext("Hmmm... too busy to do it right now? If you feel like doing it, though, come back and find me."); - cm.dispose(); + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2111000.js b/scripts/npc/2111000.js index 3ae1c9dba4..d2e9e106a8 100644 --- a/scripts/npc/2111000.js +++ b/scripts/npc/2111000.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Carson - Magatia (GMS Like) @@ -29,11 +30,11 @@ --------------------------------------------------------------------------------------------------- */ function start() { - if(cm.isQuestStarted(3310) && !cm.haveItem(4031709, 1)) { + if (cm.isQuestStarted(3310) && !cm.haveItem(4031709, 1)) { cm.warp(926120100, "out00"); } else { cm.sendNext("Alchemy....and Alchemist.....both of them are important. But more importantly, it is the Magatia that tolerate everything. The honor of Magatia should be protected by me."); } - + cm.dispose(); } diff --git a/scripts/npc/2111003.js b/scripts/npc/2111003.js index 82901da15b..f09241fbdc 100644 --- a/scripts/npc/2111003.js +++ b/scripts/npc/2111003.js @@ -32,7 +32,7 @@ */ function start() { - if(cm.isQuestStarted(3335) && !cm.haveItem(4031695, 1)) { + if (cm.isQuestStarted(3335) && !cm.haveItem(4031695, 1)) { cm.warp(926120300, "out00"); cm.dispose(); } else { diff --git a/scripts/npc/2111004.js b/scripts/npc/2111004.js index 0ccc1bfd85..07a308a37c 100644 --- a/scripts/npc/2111004.js +++ b/scripts/npc/2111004.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Phyllia - Magatia (GMS Like) diff --git a/scripts/npc/2111005.js b/scripts/npc/2111005.js index b062f0d026..ac2f736589 100644 --- a/scripts/npc/2111005.js +++ b/scripts/npc/2111005.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Keeny - Magatia (GMS Like) diff --git a/scripts/npc/2111006.js b/scripts/npc/2111006.js index 1db79394df..8cefb25b04 100644 --- a/scripts/npc/2111006.js +++ b/scripts/npc/2111006.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Parwen - Magatia (GMS Like) @@ -30,11 +31,11 @@ */ function start() { - if(cm.isQuestStarted(3320) || cm.isQuestCompleted(3320)) { + if (cm.isQuestStarted(3320) || cm.isQuestCompleted(3320)) { cm.warp(926120200, 1); } else { cm.sendOk("uuuuhuk...Why only Ghost are around here?..."); } - + cm.dispose(); } diff --git a/scripts/npc/2111007.js b/scripts/npc/2111007.js index 9a790a5695..a0057502f2 100644 --- a/scripts/npc/2111007.js +++ b/scripts/npc/2111007.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Han the Broker - Magatia (GMS Like) diff --git a/scripts/npc/2111008.js b/scripts/npc/2111008.js index 3cd6955fa5..19a44e329d 100644 --- a/scripts/npc/2111008.js +++ b/scripts/npc/2111008.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Bedin - Magatia (GMS Like) diff --git a/scripts/npc/2111009.js b/scripts/npc/2111009.js index 73dea742c2..3db3bfe365 100644 --- a/scripts/npc/2111009.js +++ b/scripts/npc/2111009.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* -- Odin JavaScript -------------------------------------------------------------------------------- Russellon - Magatia (GMS Like) diff --git a/scripts/npc/2111010.js b/scripts/npc/2111010.js index caec1a1afc..34e37d66a8 100644 --- a/scripts/npc/2111010.js +++ b/scripts/npc/2111010.js @@ -19,35 +19,36 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3309) && !cm.haveItem(4031708, 1)) { - if(cm.canHold(4031708, 1)) { - cm.gainItem(4031708, 1); - } else { - cm.sendOk("Have a ETC slot available to get the Alcadno's secret document."); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3309) && !cm.haveItem(4031708, 1)) { + if (cm.canHold(4031708, 1)) { + cm.gainItem(4031708, 1); + } else { + cm.sendOk("Have a ETC slot available to get the Alcadno's secret document."); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2111011.js b/scripts/npc/2111011.js index 8b8b43f8de..3b00ddc030 100644 --- a/scripts/npc/2111011.js +++ b/scripts/npc/2111011.js @@ -1,25 +1,26 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2111012.js b/scripts/npc/2111012.js index 8b8b43f8de..3b00ddc030 100644 --- a/scripts/npc/2111012.js +++ b/scripts/npc/2111012.js @@ -1,25 +1,26 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2111013.js b/scripts/npc/2111013.js index 6a35da3229..23936ae7f2 100644 --- a/scripts/npc/2111013.js +++ b/scripts/npc/2111013.js @@ -19,41 +19,42 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3311)) { - var progress = cm.getQuestProgressInt(3311); - - if (progress == 4) { - progress = 7; - } else { - progress = 5; - } - - cm.setQuestProgress(3311, progress); - - cm.sendOk("This is a mug picture of Dr. De Lang. It seems he is adorning a locket with the emblem of the Alcadno academy, he is a retainer of the Alcadno society.", 2); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3311)) { + var progress = cm.getQuestProgressInt(3311); + + if (progress == 4) { + progress = 7; + } else { + progress = 5; + } + + cm.setQuestProgress(3311, progress); + + cm.sendOk("This is a mug picture of Dr. De Lang. It seems he is adorning a locket with the emblem of the Alcadno academy, he is a retainer of the Alcadno society.", 2); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2111014.js b/scripts/npc/2111014.js index 5b1e454f4e..31be1b6759 100644 --- a/scripts/npc/2111014.js +++ b/scripts/npc/2111014.js @@ -19,46 +19,48 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3311)) { - var progress = cm.getQuestProgressInt(3311); - - if (progress == 4) { - progress = 7; - } else { - progress = 5; - } - - cm.setQuestProgress(3311, progress); - - cm.sendOk("The diary of Dr. De Lang. A lot of formulas and pompous scientific texts can be found all way through the pages, but it is worth noting that in the last entry (3 weeks ago), it is written that he concluded the researches on an improvement on the blueprints for the Neo Huroids, thus making the last preparations to show it to the 'society'... No words after this...", 2); - } else if(cm.isQuestStarted(3322) && !cm.haveItem(4031697, 1)) { - if(cm.canHold(4031697, 1)) - cm.gainItem(4031697, 1); - else - cm.sendNext("Your inventory is full, make sure a ETC slot is available for the item."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3311)) { + var progress = cm.getQuestProgressInt(3311); + + if (progress == 4) { + progress = 7; + } else { + progress = 5; + } + + cm.setQuestProgress(3311, progress); + + cm.sendOk("The diary of Dr. De Lang. A lot of formulas and pompous scientific texts can be found all way through the pages, but it is worth noting that in the last entry (3 weeks ago), it is written that he concluded the researches on an improvement on the blueprints for the Neo Huroids, thus making the last preparations to show it to the 'society'... No words after this...", 2); + } else if (cm.isQuestStarted(3322) && !cm.haveItem(4031697, 1)) { + if (cm.canHold(4031697, 1)) { + cm.gainItem(4031697, 1); + } else { + cm.sendNext("Your inventory is full, make sure a ETC slot is available for the item."); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2111015.js b/scripts/npc/2111015.js index 812d33690d..4642d78c55 100644 --- a/scripts/npc/2111015.js +++ b/scripts/npc/2111015.js @@ -21,39 +21,40 @@ var status; function isPillUsed(ch) { - const BuffStat = Java.type('client.BuffStat'); - return ch.getBuffSource(BuffStat.HPREC) == 2022198; + const BuffStat = Java.type('client.BuffStat'); + return ch.getBuffSource(BuffStat.HPREC) == 2022198; } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3314) && !cm.haveItem(2022198, 1) && !isPillUsed(cm.getPlayer())) { - if(cm.canHold(2022198, 1)) { - cm.gainItem(2022198, 1); - cm.sendOk("You took the pills that were laying on the desk.", 2); - } else { - cm.sendOk("You don't have a USE slot available to get Russellon's pills.", 2); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3314) && !cm.haveItem(2022198, 1) && !isPillUsed(cm.getPlayer())) { + if (cm.canHold(2022198, 1)) { + cm.gainItem(2022198, 1); + cm.sendOk("You took the pills that were laying on the desk.", 2); + } else { + cm.sendOk("You don't have a USE slot available to get Russellon's pills.", 2); + } + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/2111016.js b/scripts/npc/2111016.js index 8b8b43f8de..3b00ddc030 100644 --- a/scripts/npc/2111016.js +++ b/scripts/npc/2111016.js @@ -1,25 +1,26 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2111017.js b/scripts/npc/2111017.js index 95d07048f4..07e5a0a1ab 100644 --- a/scripts/npc/2111017.js +++ b/scripts/npc/2111017.js @@ -19,58 +19,58 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3339)) { - var progress = cm.getQuestProgressInt(23339, 1); - - if(progress == 3) { - cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); - } else if(progress == 0) { - cm.setQuestProgress(23339, 1, 1); - cm.dispose(); - } else if(progress < 3) { - cm.setQuestProgress(23339, 1, 0); - cm.dispose(); - } else { - cm.warp(261000001, 1); - cm.dispose(); - } - } else { - if(cm.isQuestCompleted(3339)) { - cm.warp(261000001, 1); - } - - cm.dispose(); - } - } else if(status == 1) { - if(cm.getText() == "my love Phyllia") { - cm.setQuestProgress(23339, 1, 4); - cm.warp(261000001, 1); - cm.dispose(); - } - else{ - cm.sendOk("#rWrong!"); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3339)) { + var progress = cm.getQuestProgressInt(23339, 1); + + if (progress == 3) { + cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); + } else if (progress == 0) { + cm.setQuestProgress(23339, 1, 1); + cm.dispose(); + } else if (progress < 3) { + cm.setQuestProgress(23339, 1, 0); + cm.dispose(); + } else { + cm.warp(261000001, 1); + cm.dispose(); + } + } else { + if (cm.isQuestCompleted(3339)) { + cm.warp(261000001, 1); + } + + cm.dispose(); + } + } else if (status == 1) { + if (cm.getText() == "my love Phyllia") { + cm.setQuestProgress(23339, 1, 4); + cm.warp(261000001, 1); + cm.dispose(); + } else { + cm.sendOk("#rWrong!"); + cm.dispose(); + } + } + } } diff --git a/scripts/npc/2111018.js b/scripts/npc/2111018.js index fb0bbd845e..99943a403e 100644 --- a/scripts/npc/2111018.js +++ b/scripts/npc/2111018.js @@ -19,58 +19,58 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3339)) { - var progress = cm.getQuestProgressInt(23339, 1); - - if(progress == 3) { - cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); - } else if(progress == 2) { - cm.setQuestProgress(23339, 1, 3); - cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); - } else if(progress < 3) { - cm.setQuestProgress(23339, 1, 0); - cm.dispose(); - } else { - cm.warp(261000001, 1); - cm.dispose(); - } - } else { - if(cm.isQuestCompleted(3339)) { - cm.warp(261000001, 1); - } - - cm.dispose(); - } - } else if(status == 1) { - if(cm.getText() == "my love Phyllia") { - cm.setQuestProgress(23339, 1, 4); - cm.warp(261000001, 1); - cm.dispose(); - } - else{ - cm.sendOk("#rWrong!"); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3339)) { + var progress = cm.getQuestProgressInt(23339, 1); + + if (progress == 3) { + cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); + } else if (progress == 2) { + cm.setQuestProgress(23339, 1, 3); + cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); + } else if (progress < 3) { + cm.setQuestProgress(23339, 1, 0); + cm.dispose(); + } else { + cm.warp(261000001, 1); + cm.dispose(); + } + } else { + if (cm.isQuestCompleted(3339)) { + cm.warp(261000001, 1); + } + + cm.dispose(); + } + } else if (status == 1) { + if (cm.getText() == "my love Phyllia") { + cm.setQuestProgress(23339, 1, 4); + cm.warp(261000001, 1); + cm.dispose(); + } else { + cm.sendOk("#rWrong!"); + cm.dispose(); + } + } + } } diff --git a/scripts/npc/2111019.js b/scripts/npc/2111019.js index 28674aae7f..d13fad7c02 100644 --- a/scripts/npc/2111019.js +++ b/scripts/npc/2111019.js @@ -19,58 +19,58 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3339)) { - var progress = cm.getQuestProgressInt(23339, 1); - - if(progress == 3) { - cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); - } else if(progress == 1) { - cm.setQuestProgress(23339, 1, 2); - cm.dispose(); - } else if(progress < 3) { - cm.setQuestProgress(23339, 1, 0); - cm.dispose(); - } else { - cm.warp(261000001, 1); - cm.dispose(); - } - } else { - if(cm.isQuestCompleted(3339)) { - cm.warp(261000001, 1); - } - - cm.dispose(); - } - } else if(status == 1) { - if(cm.getText() == "my love Phyllia") { - cm.setQuestProgress(23339, 1, 4); - cm.warp(261000001, 1); - cm.dispose(); - } - else{ - cm.sendOk("#rWrong!"); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3339)) { + var progress = cm.getQuestProgressInt(23339, 1); + + if (progress == 3) { + cm.sendGetText("The pipe reacts as the water starts flowing. A secret compartment with a keypad shows up. #bPassword#k!"); + } else if (progress == 1) { + cm.setQuestProgress(23339, 1, 2); + cm.dispose(); + } else if (progress < 3) { + cm.setQuestProgress(23339, 1, 0); + cm.dispose(); + } else { + cm.warp(261000001, 1); + cm.dispose(); + } + } else { + if (cm.isQuestCompleted(3339)) { + cm.warp(261000001, 1); + } + + cm.dispose(); + } + } else if (status == 1) { + if (cm.getText() == "my love Phyllia") { + cm.setQuestProgress(23339, 1, 4); + cm.warp(261000001, 1); + cm.dispose(); + } else { + cm.sendOk("#rWrong!"); + cm.dispose(); + } + } + } } diff --git a/scripts/npc/2111020.js b/scripts/npc/2111020.js index 9e6dc25e4b..65a5813d73 100644 --- a/scripts/npc/2111020.js +++ b/scripts/npc/2111020.js @@ -19,39 +19,40 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3345)) { - var progress = cm.getQuestProgressInt(3345); - - if(progress == 0) { - cm.setQuestProgress(3345, 1); - cm.dispose(); - } else if(progress < 4) { - cm.setQuestProgress(3345, 0); - cm.dispose(); - } else { - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3345)) { + var progress = cm.getQuestProgressInt(3345); + + if (progress == 0) { + cm.setQuestProgress(3345, 1); + cm.dispose(); + } else if (progress < 4) { + cm.setQuestProgress(3345, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } + } + } } diff --git a/scripts/npc/2111021.js b/scripts/npc/2111021.js index d800d3c52f..8106252b85 100644 --- a/scripts/npc/2111021.js +++ b/scripts/npc/2111021.js @@ -19,39 +19,40 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3345)) { - var progress = cm.getQuestProgressInt(3345); - - if(progress == 1) { - cm.setQuestProgress(3345, 2); - cm.dispose(); - } else if(progress < 4) { - cm.setQuestProgress(3345, 0); - cm.dispose(); - } else { - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3345)) { + var progress = cm.getQuestProgressInt(3345); + + if (progress == 1) { + cm.setQuestProgress(3345, 2); + cm.dispose(); + } else if (progress < 4) { + cm.setQuestProgress(3345, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } + } + } } diff --git a/scripts/npc/2111022.js b/scripts/npc/2111022.js index 17d305d19b..e0033bb41a 100644 --- a/scripts/npc/2111022.js +++ b/scripts/npc/2111022.js @@ -19,39 +19,40 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3345)) { - var progress = cm.getQuestProgressInt(3345); - - if(progress == 2) { - cm.setQuestProgress(3345, 3); - cm.dispose(); - } else if(progress < 4) { - cm.setQuestProgress(3345, 0); - cm.dispose(); - } else { - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3345)) { + var progress = cm.getQuestProgressInt(3345); + + if (progress == 2) { + cm.setQuestProgress(3345, 3); + cm.dispose(); + } else if (progress < 4) { + cm.setQuestProgress(3345, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } + } + } } diff --git a/scripts/npc/2111023.js b/scripts/npc/2111023.js index 9516d06c41..e677a0ccc6 100644 --- a/scripts/npc/2111023.js +++ b/scripts/npc/2111023.js @@ -19,44 +19,45 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestStarted(3345)) { - var progress = cm.getQuestProgressInt(3345); - - if(progress == 3 && cm.haveItem(4031739, 1) && cm.haveItem(4031740, 1) && cm.haveItem(4031741, 1)) { - cm.setQuestProgress(3345, 4); - cm.gainItem(4031739, -1); - cm.gainItem(4031740, -1); - cm.gainItem(4031741, -1); - - cm.sendOk("(As you place the shards a light shines over the circle, repelling whatever omens were brewing inside the artifact.)", 2); - cm.dispose(); - } else if(progress < 4) { - cm.setQuestProgress(3345, 0); - cm.dispose(); - } else { - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestStarted(3345)) { + var progress = cm.getQuestProgressInt(3345); + + if (progress == 3 && cm.haveItem(4031739, 1) && cm.haveItem(4031740, 1) && cm.haveItem(4031741, 1)) { + cm.setQuestProgress(3345, 4); + cm.gainItem(4031739, -1); + cm.gainItem(4031740, -1); + cm.gainItem(4031741, -1); + + cm.sendOk("(As you place the shards a light shines over the circle, repelling whatever omens were brewing inside the artifact.)", 2); + cm.dispose(); + } else if (progress < 4) { + cm.setQuestProgress(3345, 0); + cm.dispose(); + } else { + cm.dispose(); + } + } + } + } } diff --git a/scripts/npc/2111025.js b/scripts/npc/2111025.js index bd91cda971..42ef71d0b5 100644 --- a/scripts/npc/2111025.js +++ b/scripts/npc/2111025.js @@ -19,11 +19,12 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Control Device */ function start() { - cm.sendNext ("This control device seems to be monitoring something..."); + cm.sendNext("This control device seems to be monitoring something..."); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2111026.js b/scripts/npc/2111026.js index a3b8356f8b..2a9297dda3 100644 --- a/scripts/npc/2111026.js +++ b/scripts/npc/2111026.js @@ -19,11 +19,12 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Incomplete Magic Square */ function start() { - cm.sendNext ("This chalkboard has some hard-founded studies annotated on it..."); + cm.sendNext("This chalkboard has some hard-founded studies annotated on it..."); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2112000.js b/scripts/npc/2112000.js index cff92a9965..635c1ba31b 100644 --- a/scripts/npc/2112000.js +++ b/scripts/npc/2112000.js @@ -27,102 +27,105 @@ var status; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function playersTooClose() { - var npcpos = cm.getMap().getMapObject(cm.getNpcObjectId()).getPosition(); - var listchr = cm.getMap().getPlayers(); - - for (var iterator = listchr.iterator(); iterator.hasNext();) { - var chr = iterator.next(); - - var chrpos = chr.getPosition(); - if(Math.sqrt( Math.pow((npcpos.getX() - chrpos.getX()), 2) + Math.pow((npcpos.getY() - chrpos.getY()), 2) ) < 310) return true; + var npcpos = cm.getMap().getMapObject(cm.getNpcObjectId()).getPosition(); + var listchr = cm.getMap().getPlayers(); + + for (var iterator = listchr.iterator(); iterator.hasNext();) { + var chr = iterator.next(); + + var chrpos = chr.getPosition(); + if (Math.sqrt(Math.pow((npcpos.getX() - chrpos.getX()), 2) + Math.pow((npcpos.getY() - chrpos.getY()), 2)) < 310) { + return true; } - - return false; + } + + return false; } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - - if(cm.getMapId() == 926100203) { - if(status == 0) { - var state = eim.getIntProperty("yuleteTalked"); - - if(state == -1) { - cm.sendOk("Heh, it seems you guys have company. Have fun with them, as I politely request my leave."); - - } else if (playersTooClose()) { - cm.sendOk("Oh, hello there. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); - - eim.setIntProperty("yuleteTalked", -1); - } else if (eim.getIntProperty("npcShocked") == 0) { - cm.sendOk("Ho~ Aren't you quite the sneaky one? Well, it matters not. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); - - eim.setIntProperty("yuleteTalked", -1); - } else { - cm.sendOk("... Hah! What, wh-- How did you get here?! I though I had sealed all paths here! No matter, this situation will be resolved soon. Guys: DEPLOY the #rmaster weapon#k!! You! Yes, you. Don't you think this ends here, look back at your companions, they need some help! I'll be retreating for now."); - - eim.setIntProperty("yuleteTalked", 1); - } - } - - cm.dispose(); - } else { - if(status == 0) { - if(eim.isEventCleared()) { - cm.sendOk("Nooooo... I have been beated? But how? Everything I did was for the sake of the development of a greater alchemy! You can't jail me, I did what everybody standing in a place like mine would do! But no, they simply decided to damp up the progress of the science JUST BECAUSE it was deemed dangerous??? Oh, come on!"); - } else { - var state = eim.getIntProperty("yuletePassed"); - - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - if(state == -1) { - cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); - } else if(state == 0) { - cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest alchemy, #rFrankenroid#k."); - eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest alchemy, Frankenroid!"); - - var mapobj = eim.getMapInstance(926100401); - var bossobj = LifeFactory.getMonster(9300139); - - //mapobj.spawnMonsterWithEffect(bossobj, 13, new Packages.java.awt.Point(250, 100)); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); - - eim.setIntProperty("statusStg7", 1); - eim.setIntProperty("yuletePassed", -1); - } else { - cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the #rmighty Frankenroid#k!"); - eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the mighty Frankenroid!!"); - - var mapobj = eim.getMapInstance(926100401); - var bossobj = LifeFactory.getMonster(9300140); - - //mapobj.spawnMonsterWithEffect(bossobj, 14, new Packages.java.awt.Point(250, 100)); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); - - eim.setIntProperty("statusStg7", 2); - eim.setIntProperty("yuletePassed", -1); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + + if (cm.getMapId() == 926100203) { + if (status == 0) { + var state = eim.getIntProperty("yuleteTalked"); + + if (state == -1) { + cm.sendOk("Heh, it seems you guys have company. Have fun with them, as I politely request my leave."); + + } else if (playersTooClose()) { + cm.sendOk("Oh, hello there. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); + + eim.setIntProperty("yuleteTalked", -1); + } else if (eim.getIntProperty("npcShocked") == 0) { + cm.sendOk("Ho~ Aren't you quite the sneaky one? Well, it matters not. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); + + eim.setIntProperty("yuleteTalked", -1); + } else { + cm.sendOk("... Hah! What, wh-- How did you get here?! I though I had sealed all paths here! No matter, this situation will be resolved soon. Guys: DEPLOY the #rmaster weapon#k!! You! Yes, you. Don't you think this ends here, look back at your companions, they need some help! I'll be retreating for now."); + + eim.setIntProperty("yuleteTalked", 1); + } + } + + cm.dispose(); + } else { + if (status == 0) { + if (eim.isEventCleared()) { + cm.sendOk("Nooooo... I have been beated? But how? Everything I did was for the sake of the development of a greater alchemy! You can't jail me, I did what everybody standing in a place like mine would do! But no, they simply decided to damp up the progress of the science JUST BECAUSE it was deemed dangerous??? Oh, come on!"); + } else { + var state = eim.getIntProperty("yuletePassed"); + + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + if (state == -1) { + cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); + } else if (state == 0) { + cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest alchemy, #rFrankenroid#k."); + eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest alchemy, Frankenroid!"); + + var mapobj = eim.getMapInstance(926100401); + var bossobj = LifeFactory.getMonster(9300139); + + //mapobj.spawnMonsterWithEffect(bossobj, 13, new Packages.java.awt.Point(250, 100)); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); + + eim.setIntProperty("statusStg7", 1); + eim.setIntProperty("yuletePassed", -1); + } else { + cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the #rmighty Frankenroid#k!"); + eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the mighty Frankenroid!!"); + + var mapobj = eim.getMapInstance(926100401); + var bossobj = LifeFactory.getMonster(9300140); + + //mapobj.spawnMonsterWithEffect(bossobj, 14, new Packages.java.awt.Point(250, 100)); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); + + eim.setIntProperty("statusStg7", 2); + eim.setIntProperty("yuletePassed", -1); + } + } + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2112001.js b/scripts/npc/2112001.js index 2c3d10e5ba..7cf946ce47 100644 --- a/scripts/npc/2112001.js +++ b/scripts/npc/2112001.js @@ -25,34 +25,37 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendSimple("Defeated... So, that's how Yulete's legacy will reach it's end, oh how woe is this... Hope you guys are happy now, as I will pass my days rotting in a dark cellar. Everything I've done was for the sake of Magatia!! (sob)\r\n #Ll# Hey man, come now, cheer up! There were not many damages that couldn't be resolved here. Magatia created these forbidding laws to protect it's people from the undoings a greater power like this would do if it reaches wrong hands. That's not the end for you, accept rehabilitation from the Societies and everything will work out!#l"); - } else if (status == 1){ - cm.sendNext("... Are you guys forgiving me after all that I've done? Well, I guess I was blinded by the great source of power that could be discovered that way, maybe they're right saying a human can't simply fathom on the usage of those powers without corrupting theirselves along the way... I am profoundly sorry, and to make myself up with everyone I'm willing to help the Societies again wherever I can on the progress of alchemy. Thank you."); - } else { - if(!cm.isQuestCompleted(7770)) cm.completeQuest(7770); - - cm.warp(926100600); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendSimple("Defeated... So, that's how Yulete's legacy will reach it's end, oh how woe is this... Hope you guys are happy now, as I will pass my days rotting in a dark cellar. Everything I've done was for the sake of Magatia!! (sob)\r\n #Ll# Hey man, come now, cheer up! There were not many damages that couldn't be resolved here. Magatia created these forbidding laws to protect it's people from the undoings a greater power like this would do if it reaches wrong hands. That's not the end for you, accept rehabilitation from the Societies and everything will work out!#l"); + } else if (status == 1) { + cm.sendNext("... Are you guys forgiving me after all that I've done? Well, I guess I was blinded by the great source of power that could be discovered that way, maybe they're right saying a human can't simply fathom on the usage of those powers without corrupting theirselves along the way... I am profoundly sorry, and to make myself up with everyone I'm willing to help the Societies again wherever I can on the progress of alchemy. Thank you."); + } else { + if (!cm.isQuestCompleted(7770)) { + cm.completeQuest(7770); + } + + cm.warp(926100600); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2112003.js b/scripts/npc/2112003.js index 6e4c8f0be5..088edc8556 100644 --- a/scripts/npc/2112003.js +++ b/scripts/npc/2112003.js @@ -23,79 +23,79 @@ * @npc: Juliet * @map: Magatia - Alcadno - Hidden Room (261000021) * @func: Magatia PQ (Alcadno) -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(cm.getMapId() != 261000021) { - if(status == 0) { - cm.sendYesNo("We must keep fighting to save Romeo, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); - } else if(status == 1) { - cm.warp(926110700, 0); - cm.dispose(); - } - } else { - if (status == 0) { - em = cm.getEventManager("MagatiaPQ_A"); - if(em == null) { - cm.sendOk("The Magatia PQ (Alcadno) has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nMy beloved Romeo has been kidnapped! Although he is Zenumist's, I can't stand by and just see him suffer just because of this foolish clash. I need you and your colleagues help to save him! Please, help us!! Please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nNot long ago, a scientist named Yulete has been banished from this town because of his researches of combined alchemies of Alcadno's and Zenumist's. Because of the immensurable amount of power coming from this combination, it is forbidden by law to study both. Yet, he ignored this law and got hands in both researches. As a result, he has been exiled.\r\nHe is now retaliating, already took my beloved one and his next target is me, as we are big pictures of Magatia, successors of both societies. But I'm not afraid. We must recover him at all costs!\r\n"); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (cm.getMapId() != 261000021) { + if (status == 0) { + cm.sendYesNo("We must keep fighting to save Romeo, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); + } else if (status == 1) { + cm.warp(926110700, 0); + cm.dispose(); + } + } else { + if (status == 0) { + em = cm.getEventManager("MagatiaPQ_A"); + if (em == null) { + cm.sendOk("The Magatia PQ (Alcadno) has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nMy beloved Romeo has been kidnapped! Although he is Zenumist's, I can't stand by and just see him suffer just because of this foolish clash. I need you and your colleagues help to save him! Please, help us!! Please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nNot long ago, a scientist named Yulete has been banished from this town because of his researches of combined alchemies of Alcadno's and Zenumist's. Because of the immensurable amount of power coming from this combination, it is forbidden by law to study both. Yet, he ignored this law and got hands in both researches. As a result, he has been exiled.\r\nHe is now retaliating, already took my beloved one and his next target is me, as we are big pictures of Magatia, successors of both societies. But I'm not afraid. We must recover him at all costs!\r\n"); + cm.dispose(); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2112004.js b/scripts/npc/2112004.js index b637a6ba64..0bdc9d5661 100644 --- a/scripts/npc/2112004.js +++ b/scripts/npc/2112004.js @@ -23,79 +23,79 @@ * @npc: Romeo * @map: Magatia - Zenumist - Hidden Room (261000011) * @func: Magatia PQ (Zenumist) -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(cm.getMapId() != 261000011) { - if(status == 0) { - cm.sendYesNo("We must keep fighting to save Juliet, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); - } else if(status == 1) { - cm.warp(926100700, 0); - cm.dispose(); - } - } else { - if (status == 0) { - em = cm.getEventManager("MagatiaPQ_Z"); - if(em == null) { - cm.sendOk("The Magatia PQ (Zenumist) has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nMy beloved Juliet has been kidnapped! Although she is Alcadno's, I can't stand by and just see her suffer just because of this foolish clash. I need you and your colleagues help to save her! Please, help us!! Please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nNot long ago, a scientist named Yulete has been banished from this town because of his researches of combined alchemies of Alcadno's and Zenumist's. Because of the immensurable amount of power coming from this combination, it is forbidden by law to study both. Yet, he ignored this law and got hands in both researches. As a result, he has been exiled.\r\nHe is now retaliating, already took my beloved one and his next target is me, as we are big pictures of Magatia, successors of both societies. But I'm not afraid. We must recover her at all costs!\r\n"); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (cm.getMapId() != 261000011) { + if (status == 0) { + cm.sendYesNo("We must keep fighting to save Juliet, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); + } else if (status == 1) { + cm.warp(926100700, 0); + cm.dispose(); + } + } else { + if (status == 0) { + em = cm.getEventManager("MagatiaPQ_Z"); + if (em == null) { + cm.sendOk("The Magatia PQ (Zenumist) has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nMy beloved Juliet has been kidnapped! Although she is Alcadno's, I can't stand by and just see her suffer just because of this foolish clash. I need you and your colleagues help to save her! Please, help us!! Please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nNot long ago, a scientist named Yulete has been banished from this town because of his researches of combined alchemies of Alcadno's and Zenumist's. Because of the immensurable amount of power coming from this combination, it is forbidden by law to study both. Yet, he ignored this law and got hands in both researches. As a result, he has been exiled.\r\nHe is now retaliating, already took my beloved one and his next target is me, as we are big pictures of Magatia, successors of both societies. But I'm not afraid. We must recover her at all costs!\r\n"); + cm.dispose(); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2112005.js b/scripts/npc/2112005.js index 14de113793..4c3b8cc77c 100644 --- a/scripts/npc/2112005.js +++ b/scripts/npc/2112005.js @@ -24,104 +24,107 @@ * @author: Ronan * @npc: Juliet * @func: MagatiaPQ area NPC -*/ + */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - - if(!eim.isEventCleared()) { - if(status == 0) { - if(eim.getIntProperty("npcShocked") == 0 && cm.haveItem(4001130, 1)) { - cm.gainItem(4001130, -1); - eim.setIntProperty("npcShocked", 1); - - cm.sendNext("Oh? You got a letter for me? On times like this, what should it be... Gasp! Something big is going on, guys. Rally yourselves, from now on things will be harder than ever!"); - eim.dropMessage(6, "Juliet seemed very much in shock after reading Romeo's Letter."); - - cm.dispose(); - return; - } else if (eim.getIntProperty("statusStg4") == 1) { - var door = cm.getMap().getReactorByName("jnr3_out3"); - - if(door.getState() == 0) { - cm.sendNext("Let me open the door for you."); - door.hitReactor(cm.getClient()); - } else { - cm.sendNext("Please hurry, Romeo is in trouble."); - } - - cm.dispose(); - return; - } else if (cm.haveItem(4001134, 1) && cm.haveItem(4001135, 1)) { - if (cm.isEventLeader()) { - cm.gainItem(4001134, -1); - cm.gainItem(4001135, -1); - cm.sendNext("Great! You got both Alcadno and Zenumist files at hand. Now we can proceed."); - - eim.showClearEffect(); - eim.giveEventPlayersStageReward(4); - eim.setIntProperty("statusStg4", 1); - - cm.getMap().killAllMonsters(); - cm.getMap().getReactorByName("jnr3_out3").hitReactor(cm.getClient()); - } else { - cm.sendOk("Please let your leader pass the files to me."); - } - - cm.dispose(); - return; - } else { - cm.sendYesNo("We must keep fighting to save Romeo, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); - } - } else { - cm.warp(926110700, 0); - cm.dispose(); - } - } else { - if(status == 0) { - if(eim.getIntProperty("escortFail") == 0) { - cm.sendNext("Finally, Romeo is safe! Thanks to your efforts, we could save him from the clutches of Yulete, who will now be judged for his rebellion against Magatia. From now on, as he will start rehabilitation, we will keep an eye on his endeavours, making sure he will cause no more troubles on the future."); - } - else { - cm.sendNext("Romeo is safe now, although the battle took it's toll on him... Thanks to your efforts, we could save him from the clutches of Yulete, who will now be judged for his rebellion against Magatia. Thank you."); - status = 2; - } - } else if(status == 1) { - cm.sendNext("Now, please receive this gift as an act of acceptation for our gratitude."); - } else if(status == 2) { - if(cm.canHold(4001160)) { - cm.gainItem(4001160, 1); - - if(eim.getIntProperty("normalClear") == 1) cm.warp(926110600, 0); - else cm.warp(926110500, 0); - } else { - cm.sendOk("Make sure you have a space on your ETC inventory."); - } - - cm.dispose(); - } else { - cm.warp(926110600, 0); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + + if (!eim.isEventCleared()) { + if (status == 0) { + if (eim.getIntProperty("npcShocked") == 0 && cm.haveItem(4001130, 1)) { + cm.gainItem(4001130, -1); + eim.setIntProperty("npcShocked", 1); + + cm.sendNext("Oh? You got a letter for me? On times like this, what should it be... Gasp! Something big is going on, guys. Rally yourselves, from now on things will be harder than ever!"); + eim.dropMessage(6, "Juliet seemed very much in shock after reading Romeo's Letter."); + + cm.dispose(); + + } else if (eim.getIntProperty("statusStg4") == 1) { + var door = cm.getMap().getReactorByName("jnr3_out3"); + + if (door.getState() == 0) { + cm.sendNext("Let me open the door for you."); + door.hitReactor(cm.getClient()); + } else { + cm.sendNext("Please hurry, Romeo is in trouble."); + } + + cm.dispose(); + + } else if (cm.haveItem(4001134, 1) && cm.haveItem(4001135, 1)) { + if (cm.isEventLeader()) { + cm.gainItem(4001134, -1); + cm.gainItem(4001135, -1); + cm.sendNext("Great! You got both Alcadno and Zenumist files at hand. Now we can proceed."); + + eim.showClearEffect(); + eim.giveEventPlayersStageReward(4); + eim.setIntProperty("statusStg4", 1); + + cm.getMap().killAllMonsters(); + cm.getMap().getReactorByName("jnr3_out3").hitReactor(cm.getClient()); + } else { + cm.sendOk("Please let your leader pass the files to me."); + } + + cm.dispose(); + + } else { + cm.sendYesNo("We must keep fighting to save Romeo, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); + } + } else { + cm.warp(926110700, 0); + cm.dispose(); + } + } else { + if (status == 0) { + if (eim.getIntProperty("escortFail") == 0) { + cm.sendNext("Finally, Romeo is safe! Thanks to your efforts, we could save him from the clutches of Yulete, who will now be judged for his rebellion against Magatia. From now on, as he will start rehabilitation, we will keep an eye on his endeavours, making sure he will cause no more troubles on the future."); + } else { + cm.sendNext("Romeo is safe now, although the battle took it's toll on him... Thanks to your efforts, we could save him from the clutches of Yulete, who will now be judged for his rebellion against Magatia. Thank you."); + status = 2; + } + } else if (status == 1) { + cm.sendNext("Now, please receive this gift as an act of acceptation for our gratitude."); + } else if (status == 2) { + if (cm.canHold(4001160)) { + cm.gainItem(4001160, 1); + + if (eim.getIntProperty("normalClear") == 1) { + cm.warp(926110600, 0); + } else { + cm.warp(926110500, 0); + } + } else { + cm.sendOk("Make sure you have a space on your ETC inventory."); + } + + cm.dispose(); + } else { + cm.warp(926110600, 0); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2112006.js b/scripts/npc/2112006.js index 2a1ad0c222..fd39795147 100644 --- a/scripts/npc/2112006.js +++ b/scripts/npc/2112006.js @@ -24,104 +24,107 @@ * @author: Ronan * @npc: Romeo * @func: MagatiaPQ area NPC -*/ + */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - - if(!eim.isEventCleared()) { - if(status == 0) { - if(eim.getIntProperty("npcShocked") == 0 && cm.haveItem(4001131, 1)) { - cm.gainItem(4001131, -1); - eim.setIntProperty("npcShocked", 1); - - cm.sendNext("Oh? You got a letter for me? On times like this, what should it be... Gasp! Something big is going on, guys. Rally yourselves, from now on things will be harder than ever!"); - eim.dropMessage(6, "Romeo seemed very much in shock after reading Juliet's Letter."); - - cm.dispose(); - return; - } else if (eim.getIntProperty("statusStg4") == 1) { - var door = cm.getMap().getReactorByName("rnj3_out3"); - - if(door.getState() == 0) { - cm.sendNext("Let me open the door for you."); - door.hitReactor(cm.getClient()); - } else { - cm.sendNext("Please hurry, Juliet is in trouble."); - } - - cm.dispose(); - return; - } else if (cm.haveItem(4001134, 1) && cm.haveItem(4001135, 1)) { - if (cm.isEventLeader()) { - cm.gainItem(4001134, -1); - cm.gainItem(4001135, -1); - cm.sendNext("Great! You got both Alcadno and Zenumist files at hand. Now we can proceed."); - - eim.showClearEffect(); - eim.giveEventPlayersStageReward(4); - eim.setIntProperty("statusStg4", 1); - - cm.getMap().killAllMonsters(); - cm.getMap().getReactorByName("rnj3_out3").hitReactor(cm.getClient()); - } else { - cm.sendOk("Please let your leader pass the files to me."); - } - - cm.dispose(); - return; - } else { - cm.sendYesNo("We must keep fighting to save Juliet, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); - } - } else { - cm.warp(926100700, 0); - cm.dispose(); - } - } else { - if(status == 0) { - if(eim.getIntProperty("escortFail") == 0) { - cm.sendNext("Finally, Juliet is safe! Thanks to your efforts, we could save her from the clutches of Yulete, who will now be judged for his rebellion against Magatia. From now on, as he will start rehabilitation, we will keep an eye on his endeavours, making sure he will cause no more troubles on the future."); - } - else { - cm.sendNext("Juliet is safe now, although the battle took it's toll on her... Thanks to your efforts, we could save her from the clutches of Yulete, who will now be judged for his rebellion against Magatia. Thank you."); - status = 2; - } - } else if(status == 1) { - cm.sendNext("Now, please receive this gift as an act of acceptation for our gratitude."); - } else if(status == 2) { - if(cm.canHold(4001159)) { - cm.gainItem(4001159, 1); - - if(eim.getIntProperty("normalClear") == 1) cm.warp(926100600, 0); - else cm.warp(926100500, 0); - } else { - cm.sendOk("Make sure you have a space on your ETC inventory."); - } - - cm.dispose(); - } else { - cm.warp(926100600, 0); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + + if (!eim.isEventCleared()) { + if (status == 0) { + if (eim.getIntProperty("npcShocked") == 0 && cm.haveItem(4001131, 1)) { + cm.gainItem(4001131, -1); + eim.setIntProperty("npcShocked", 1); + + cm.sendNext("Oh? You got a letter for me? On times like this, what should it be... Gasp! Something big is going on, guys. Rally yourselves, from now on things will be harder than ever!"); + eim.dropMessage(6, "Romeo seemed very much in shock after reading Juliet's Letter."); + + cm.dispose(); + + } else if (eim.getIntProperty("statusStg4") == 1) { + var door = cm.getMap().getReactorByName("rnj3_out3"); + + if (door.getState() == 0) { + cm.sendNext("Let me open the door for you."); + door.hitReactor(cm.getClient()); + } else { + cm.sendNext("Please hurry, Juliet is in trouble."); + } + + cm.dispose(); + + } else if (cm.haveItem(4001134, 1) && cm.haveItem(4001135, 1)) { + if (cm.isEventLeader()) { + cm.gainItem(4001134, -1); + cm.gainItem(4001135, -1); + cm.sendNext("Great! You got both Alcadno and Zenumist files at hand. Now we can proceed."); + + eim.showClearEffect(); + eim.giveEventPlayersStageReward(4); + eim.setIntProperty("statusStg4", 1); + + cm.getMap().killAllMonsters(); + cm.getMap().getReactorByName("rnj3_out3").hitReactor(cm.getClient()); + } else { + cm.sendOk("Please let your leader pass the files to me."); + } + + cm.dispose(); + + } else { + cm.sendYesNo("We must keep fighting to save Juliet, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?"); + } + } else { + cm.warp(926100700, 0); + cm.dispose(); + } + } else { + if (status == 0) { + if (eim.getIntProperty("escortFail") == 0) { + cm.sendNext("Finally, Juliet is safe! Thanks to your efforts, we could save her from the clutches of Yulete, who will now be judged for his rebellion against Magatia. From now on, as he will start rehabilitation, we will keep an eye on his endeavours, making sure he will cause no more troubles on the future."); + } else { + cm.sendNext("Juliet is safe now, although the battle took it's toll on her... Thanks to your efforts, we could save her from the clutches of Yulete, who will now be judged for his rebellion against Magatia. Thank you."); + status = 2; + } + } else if (status == 1) { + cm.sendNext("Now, please receive this gift as an act of acceptation for our gratitude."); + } else if (status == 2) { + if (cm.canHold(4001159)) { + cm.gainItem(4001159, 1); + + if (eim.getIntProperty("normalClear") == 1) { + cm.warp(926100600, 0); + } else { + cm.warp(926100500, 0); + } + } else { + cm.sendOk("Make sure you have a space on your ETC inventory."); + } + + cm.dispose(); + } else { + cm.warp(926100600, 0); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2112007.js b/scripts/npc/2112007.js index f6505f4c1e..c82787acc8 100644 --- a/scripts/npc/2112007.js +++ b/scripts/npc/2112007.js @@ -22,47 +22,47 @@ * @author: Ronan * @npc: Investigation Result * @func: Gives MagatiaPQ stg1 item -*/ + */ function start() { var eim = cm.getEventInstance(); var book = "stg1_b" + (cm.getNpcObjectId() % 26); - + var res = eim.getIntProperty(book); - if(res > -1) { + if (res > -1) { eim.setIntProperty(book, -1); - - if(res == 0) { // mesos + + if (res == 0) { // mesos var mgain = 500 * cm.getPlayer().getMesoRate(); cm.sendNext("Earned " + mgain + " mesos!"); cm.gainMeso(mgain); - } else if(res == 1) { // exp + } else if (res == 1) { // exp var egain = 500 * cm.getPlayer().getExpRate(); cm.sendNext("Earned " + egain + " exp!"); cm.gainExp(egain); - } else if(res == 2) { // letter + } else if (res == 2) { // letter var letter = 4001131; - if(!cm.canHold(letter)) { + if (!cm.canHold(letter)) { cm.sendOk("You got a letter, however it didn't fit on your inventory, so you put it back."); cm.dispose(); return; } - + cm.gainItem(letter, 1); cm.sendNext("You found a letter, strategically placed here as it seems."); - } else if(res == 3) { // pass + } else if (res == 3) { // pass cm.sendNext("You found the trigger to the next stage."); - + var eim = cm.getEventInstance(); eim.showClearEffect(); eim.giveEventPlayersStageReward(1); eim.setIntProperty("statusStg1", 1); - + cm.getMap().getReactorByName("d00").hitReactor(cm.getClient()); } } else { cm.sendNext("There is nothing here."); } - + cm.dispose(); } diff --git a/scripts/npc/2112010.js b/scripts/npc/2112010.js index 7a1e226dd3..6b5d8e12c4 100644 --- a/scripts/npc/2112010.js +++ b/scripts/npc/2112010.js @@ -27,98 +27,101 @@ var status; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function playersTooClose() { - var npcpos = cm.getMap().getMapObject(cm.getNpcObjectId()).getPosition(); - var listchr = cm.getMap().getPlayers(); - - for (var iterator = listchr.iterator(); iterator.hasNext();) { - var chr = iterator.next(); - - var chrpos = chr.getPosition(); - if(Math.sqrt( Math.pow((npcpos.getX() - chrpos.getX()), 2) + Math.pow((npcpos.getY() - chrpos.getY()), 2) ) < 310) return true; + var npcpos = cm.getMap().getMapObject(cm.getNpcObjectId()).getPosition(); + var listchr = cm.getMap().getPlayers(); + + for (var iterator = listchr.iterator(); iterator.hasNext();) { + var chr = iterator.next(); + + var chrpos = chr.getPosition(); + if (Math.sqrt(Math.pow((npcpos.getX() - chrpos.getX()), 2) + Math.pow((npcpos.getY() - chrpos.getY()), 2)) < 310) { + return true; } - - return false; + } + + return false; } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - - if(cm.getMapId() == 926110203) { - if(status == 0) { - var state = eim.getIntProperty("yuleteTalked"); - - if(state == -1) { - cm.sendOk("Heh, it seems you guys have company. Have fun with them, as I politely request my leave."); - - } else if (playersTooClose()) { - cm.sendOk("Oh, hello there. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); - - eim.setIntProperty("yuleteTalked", -1); - } else if (eim.getIntProperty("npcShocked") == 0) { - cm.sendOk("Ho~ Aren't you quite the sneaky one? Well, it matters not. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); - - eim.setIntProperty("yuleteTalked", -1); - } else { - cm.sendOk("... Hah! What, wh-- How did you get here?! I though I had sealed all paths here! No matter, this situation will be resolved soon. Guys: DEPLOY the #rmaster weapon#k!! You! Yes, you. Don't you think this ends here, look back at your companions, they need some help! I'll be retreating for now."); - - eim.setIntProperty("yuleteTalked", 1); - } - } - - cm.dispose(); - } else { - if(status == 0) { - if(eim.isEventCleared()) { - cm.sendOk("Nooooo... I have been beated? But how? Everything I did was for the sake of the development of a greater alchemy! You can't jail me, I did what everybody standing in a place like mine would do! But no, they simply decided to damp up the progress of the science JUST BECAUSE it was deemed dangerous??? Oh, come on!"); - } else { - var state = eim.getIntProperty("yuletePassed"); - - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - if(state == -1) { - cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); - } else if(state == 0) { - cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest alchemy, #rFrankenroid#k."); - eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest alchemy, Frankenroid!"); - - var mapobj = eim.getMapInstance(926110401); - var bossobj = LifeFactory.getMonster(9300151); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); - - eim.setIntProperty("statusStg7", 1); - eim.setIntProperty("yuletePassed", -1); - } else { - cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the #rmighty Frankenroid#k!"); - eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the mighty Frankenroid!!"); - - var mapobj = eim.getMapInstance(926110401); - var bossobj = LifeFactory.getMonster(9300152); - mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); - - eim.setIntProperty("statusStg7", 2); - eim.setIntProperty("yuletePassed", -1); - } - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + + if (cm.getMapId() == 926110203) { + if (status == 0) { + var state = eim.getIntProperty("yuleteTalked"); + + if (state == -1) { + cm.sendOk("Heh, it seems you guys have company. Have fun with them, as I politely request my leave."); + + } else if (playersTooClose()) { + cm.sendOk("Oh, hello there. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); + + eim.setIntProperty("yuleteTalked", -1); + } else if (eim.getIntProperty("npcShocked") == 0) { + cm.sendOk("Ho~ Aren't you quite the sneaky one? Well, it matters not. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now."); + + eim.setIntProperty("yuleteTalked", -1); + } else { + cm.sendOk("... Hah! What, wh-- How did you get here?! I though I had sealed all paths here! No matter, this situation will be resolved soon. Guys: DEPLOY the #rmaster weapon#k!! You! Yes, you. Don't you think this ends here, look back at your companions, they need some help! I'll be retreating for now."); + + eim.setIntProperty("yuleteTalked", 1); + } + } + + cm.dispose(); + } else { + if (status == 0) { + if (eim.isEventCleared()) { + cm.sendOk("Nooooo... I have been beated? But how? Everything I did was for the sake of the development of a greater alchemy! You can't jail me, I did what everybody standing in a place like mine would do! But no, they simply decided to damp up the progress of the science JUST BECAUSE it was deemed dangerous??? Oh, come on!"); + } else { + var state = eim.getIntProperty("yuletePassed"); + + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + if (state == -1) { + cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha..."); + } else if (state == 0) { + cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest alchemy, #rFrankenroid#k."); + eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest alchemy, Frankenroid!"); + + var mapobj = eim.getMapInstance(926110401); + var bossobj = LifeFactory.getMonster(9300151); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); + + eim.setIntProperty("statusStg7", 1); + eim.setIntProperty("yuletePassed", -1); + } else { + cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the #rmighty Frankenroid#k!"); + eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the mighty Frankenroid!!"); + + var mapobj = eim.getMapInstance(926110401); + var bossobj = LifeFactory.getMonster(9300152); + mapobj.spawnMonsterOnGroundBelow(bossobj, new Point(250, 100)); + + eim.setIntProperty("statusStg7", 2); + eim.setIntProperty("yuletePassed", -1); + } + } + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2112011.js b/scripts/npc/2112011.js index e6f2cc19e9..2a30f43c69 100644 --- a/scripts/npc/2112011.js +++ b/scripts/npc/2112011.js @@ -25,34 +25,37 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendSimple("Defeated... So, that's how Yulete's legacy will reach it's end, oh how woe is this... Hope you guys are happy now, as I will pass my days rotting in a dark cellar. Everything I've done was for the sake of Magatia!! (sob)\r\n #Ll# Hey man, come now, cheer up! There were not many damages that couldn't be resolved here. Magatia created these forbidding laws to protect it's people from the undoings a greater power like this would do if it reaches wrong hands. That's not the end for you, accept rehabilitation from the Societies and everything will work out!#l"); - } else if (status == 1){ - cm.sendNext("... Are you guys forgiving me after all that I've done? Well, I guess I was blinded by the great source of power that could be discovered that way, maybe they're right saying a human can't simply fathom on the usage of those powers without corrupting theirselves along the way... I am profoundly sorry, and to make myself up with everyone I'm willing to help the Societies again wherever I can on the progress of alchemy. Thank you."); - } else { - if(!cm.isQuestCompleted(7770)) cm.completeQuest(7770); - - cm.warp(926110600, 0); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendSimple("Defeated... So, that's how Yulete's legacy will reach it's end, oh how woe is this... Hope you guys are happy now, as I will pass my days rotting in a dark cellar. Everything I've done was for the sake of Magatia!! (sob)\r\n #Ll# Hey man, come now, cheer up! There were not many damages that couldn't be resolved here. Magatia created these forbidding laws to protect it's people from the undoings a greater power like this would do if it reaches wrong hands. That's not the end for you, accept rehabilitation from the Societies and everything will work out!#l"); + } else if (status == 1) { + cm.sendNext("... Are you guys forgiving me after all that I've done? Well, I guess I was blinded by the great source of power that could be discovered that way, maybe they're right saying a human can't simply fathom on the usage of those powers without corrupting theirselves along the way... I am profoundly sorry, and to make myself up with everyone I'm willing to help the Societies again wherever I can on the progress of alchemy. Thank you."); + } else { + if (!cm.isQuestCompleted(7770)) { + cm.completeQuest(7770); + } + + cm.warp(926110600, 0); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2112013.js b/scripts/npc/2112013.js index 887f0372f1..cb888f53d1 100644 --- a/scripts/npc/2112013.js +++ b/scripts/npc/2112013.js @@ -24,47 +24,47 @@ * @author: Ronan * @npc: Investigation Result * @func: Gives MagatiaPQ stg1 item -*/ + */ function start() { var eim = cm.getEventInstance(); var book = "stg1_b" + (cm.getNpcObjectId() % 26); - + var res = eim.getIntProperty(book); - if(res > -1) { + if (res > -1) { eim.setIntProperty(book, -1); - - if(res == 0) { // mesos + + if (res == 0) { // mesos var mgain = 500 * cm.getPlayer().getMesoRate(); cm.sendNext("Earned " + mgain + " mesos!"); cm.gainMeso(mgain); - } else if(res == 1) { // exp + } else if (res == 1) { // exp var egain = 500 * cm.getPlayer().getExpRate(); cm.sendNext("Earned " + egain + " exp!"); cm.gainExp(egain); - } else if(res == 2) { // letter + } else if (res == 2) { // letter var letter = 4001130; - if(!cm.canHold(letter)) { + if (!cm.canHold(letter)) { cm.sendOk("You got a letter, however it didn't fit on your inventory, so you put it back."); cm.dispose(); return; } - + cm.gainItem(letter, 1); cm.sendNext("You found a letter, strategically placed here as it seems."); - } else if(res == 3) { // pass + } else if (res == 3) { // pass cm.sendNext("You found the trigger to the next stage."); - + var eim = cm.getEventInstance(); eim.showClearEffect(); eim.giveEventPlayersStageReward(1); eim.setIntProperty("statusStg1", 1); - + cm.getMap().getReactorByName("d00").hitReactor(cm.getClient()); } } else { cm.sendNext("There is nothing here."); } - + cm.dispose(); } diff --git a/scripts/npc/2112016.js b/scripts/npc/2112016.js index 2615ab3ac6..9f82bb5de8 100644 --- a/scripts/npc/2112016.js +++ b/scripts/npc/2112016.js @@ -22,24 +22,24 @@ * @author: Ronan * @npc: Hidden Documents * @func: Yulete lab 2 quest -*/ + */ function start() { - if(cm.isQuestStarted(3367)) { + if (cm.isQuestStarted(3367)) { var c = cm.getQuestProgressInt(3367, 30); - if(c >= 30) { + if (c >= 30) { cm.sendNext("(All files have been organized. Report the found files to Yulete.)", 2); cm.dispose(); return; } - + var book = (cm.getNpcObjectId() % 30); var prog = cm.getQuestProgressInt(3367, book); - if(prog == 0) { + if (prog == 0) { c++; - - if(book < 20) { - if(!cm.canHold(4031797, 1)) { + + if (book < 20) { + if (!cm.canHold(4031797, 1)) { cm.sendNext("(You found a report file, but since your ETC is full you choose to put the file in the place you've found.)"); cm.dispose(); return; @@ -48,13 +48,13 @@ function start() { cm.setQuestProgress(3367, 31, cm.getQuestProgressInt(3367, 31) + 1); } } - + cm.sendNext("(Organized file. #r" + (30 - c) + "#k left.)", 2); - + cm.setQuestProgress(3367, book, 1); cm.setQuestProgress(3367, 30, c); } } - + cm.dispose(); } diff --git a/scripts/npc/2112018.js b/scripts/npc/2112018.js index 749ba9b36a..d189c271c1 100644 --- a/scripts/npc/2112018.js +++ b/scripts/npc/2112018.js @@ -24,44 +24,45 @@ * @author: Ronan * @npc: Romeo & Juliet * @func: MagatiaPQ exit -*/ + */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - - if(status == 0) { - if(eim.getIntProperty("escortFail") == 1) { - cm.sendNext("Thanks to you, we were capable of reunion once again. Yulete will now be forwarded to jail for attempt against the Law of Magatia. Once again, thank you."); - } else { - cm.sendNext("Thanks to you, we were capable of reunion once again. Yulete will now pass through rehabilitation, as his studies are invaluable for the growth of our town, and all his doings were being made because he was blinded by the greed for power, although it was for the sake of Magatia. Once again, thank you."); - } - } else { - if(eim.giveEventReward(cm.getPlayer())) { - cm.warp((eim.getIntProperty("isAlcadno") == 0) ? 261000011 : 261000021); - } else { - cm.sendOk("Please free a slot on one of your inventories before receiving your reward."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + + if (status == 0) { + if (eim.getIntProperty("escortFail") == 1) { + cm.sendNext("Thanks to you, we were capable of reunion once again. Yulete will now be forwarded to jail for attempt against the Law of Magatia. Once again, thank you."); + } else { + cm.sendNext("Thanks to you, we were capable of reunion once again. Yulete will now pass through rehabilitation, as his studies are invaluable for the growth of our town, and all his doings were being made because he was blinded by the greed for power, although it was for the sake of Magatia. Once again, thank you."); + } + } else { + if (eim.giveEventReward(cm.getPlayer())) { + cm.warp((eim.getIntProperty("isAlcadno") == 0) ? 261000011 : 261000021); + } else { + cm.sendOk("Please free a slot on one of your inventories before receiving your reward."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2120003.js b/scripts/npc/2120003.js index b1623bf2fa..745ae40f68 100644 --- a/scripts/npc/2120003.js +++ b/scripts/npc/2120003.js @@ -5,6 +5,6 @@ */ function start() { - cm.sendOk("Hello and welcome, dear guest. The Master has prepared some wonderful games for you to enjoy tonight."); - cm.dispose(); + cm.sendOk("Hello and welcome, dear guest. The Master has prepared some wonderful games for you to enjoy tonight."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2131000.js b/scripts/npc/2131000.js index 5c0180bd25..938ed65aab 100644 --- a/scripts/npc/2131000.js +++ b/scripts/npc/2131000.js @@ -4,7 +4,7 @@ Description: Unknown */ -function start(){ - cm.sendOk("It is been a while since we left Ossyria to avoid the Black Magician. If not for the world tree, I do not know where we would have been. I have been trying to establish myself here, but that is not easy. I wonder how things are like back home."); - cm.dispose(); - } \ No newline at end of file +function start() { + cm.sendOk("It is been a while since we left Ossyria to avoid the Black Magician. If not for the world tree, I do not know where we would have been. I have been trying to establish myself here, but that is not easy. I wonder how things are like back home."); + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/2131001.js b/scripts/npc/2131001.js index 0c5ed72e01..65b972afd9 100644 --- a/scripts/npc/2131001.js +++ b/scripts/npc/2131001.js @@ -7,31 +7,31 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { cm.sendSimple("My name is #p2131001#, I am the strongest magician around these parts.#b\r\n#L0#Hey, take these rubbles. You can perform your magic on them.#l"); } else if (status == 1) { - if (!cm.haveItem(exchangeItem, 100)) { - cm.sendNext("You don't have enough... I need at least 100."); - cm.dispose(); - } else { + if (!cm.haveItem(exchangeItem, 100)) { + cm.sendNext("You don't have enough... I need at least 100."); + cm.dispose(); + } else { // thanks yuxaij for noticing a few methods having parameters not matching the expected Math library function parameter types - cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); - } - } else if (status == 2) { - if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { - if (!cm.canHold(4310000, selection)) { - cm.sendOk("Please make some space in ETC tab."); - } else { - cm.gainItem(4310000, selection); - cm.gainItem(exchangeItem, -(selection * 100)); - cm.sendOk("Thanks!"); - } - } + cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); + } + } else if (status == 2) { + if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { + if (!cm.canHold(4310000, selection)) { + cm.sendOk("Please make some space in ETC tab."); + } else { + cm.gainItem(4310000, selection); + cm.gainItem(exchangeItem, -(selection * 100)); + cm.sendOk("Thanks!"); + } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2131002.js b/scripts/npc/2131002.js index 7c253084cc..dbad6770ea 100644 --- a/scripts/npc/2131002.js +++ b/scripts/npc/2131002.js @@ -4,7 +4,7 @@ Description: Unknown */ -function start(){ - cm.sendOk("My name is #p2131002#... As you can see, I am a fairy. People tell me I do not act fairy-like, but... I like making things out of metal objects. Shhh, don't tell this to anyone, but I also like MMA."); - cm.dispose(); - } \ No newline at end of file +function start() { + cm.sendOk("My name is #p2131002#... As you can see, I am a fairy. People tell me I do not act fairy-like, but... I like making things out of metal objects. Shhh, don't tell this to anyone, but I also like MMA."); + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/2131003.js b/scripts/npc/2131003.js index dd5be16d12..63961a6024 100644 --- a/scripts/npc/2131003.js +++ b/scripts/npc/2131003.js @@ -7,30 +7,30 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { cm.sendSimple("So many injuries, so little medicine...#b\r\n#L0#Hey, take these black spores. You can make better medicine with them.#l"); } else if (status == 1) { - if (!cm.haveItem(exchangeItem, 100)) { - cm.sendNext("You don't have enough... I need at least 100."); - cm.dispose(); - } else { - cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); - } - } else if (status == 2) { - if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { - if (!cm.canHold(4310000, selection)) { - cm.sendOk("Please make some space in ETC tab."); - } else { - cm.gainItem(4310000, selection); - cm.gainItem(exchangeItem, -(selection * 100)); - cm.sendOk("Thanks!"); - } - } + if (!cm.haveItem(exchangeItem, 100)) { + cm.sendNext("You don't have enough... I need at least 100."); + cm.dispose(); + } else { + cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); + } + } else if (status == 2) { + if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { + if (!cm.canHold(4310000, selection)) { + cm.sendOk("Please make some space in ETC tab."); + } else { + cm.gainItem(4310000, selection); + cm.gainItem(exchangeItem, -(selection * 100)); + cm.sendOk("Thanks!"); + } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2131004.js b/scripts/npc/2131004.js index 892ee889ae..d7a9c7dfb1 100644 --- a/scripts/npc/2131004.js +++ b/scripts/npc/2131004.js @@ -1,5 +1,5 @@ function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { diff --git a/scripts/npc/2131005.js b/scripts/npc/2131005.js index e51c35030a..7a2c7bf957 100644 --- a/scripts/npc/2131005.js +++ b/scripts/npc/2131005.js @@ -7,30 +7,30 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { cm.sendSimple("I wish I had something to hold this water in...#b\r\n#L0#Hey, take these snail shells. You can hold your water with these.#l"); } else if (status == 1) { - if (!cm.haveItem(exchangeItem, 100)) { - cm.sendNext("You don't have enough... I need at least 100."); - cm.dispose(); - } else { - cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); - } - } else if (status == 2) { - if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { - if (!cm.canHold(4310000, selection)) { - cm.sendOk("Please make some space in ETC tab."); - } else { - cm.gainItem(4310000, selection); - cm.gainItem(exchangeItem, -(selection * 100)); - cm.sendOk("Thanks!"); - } - } + if (!cm.haveItem(exchangeItem, 100)) { + cm.sendNext("You don't have enough... I need at least 100."); + cm.dispose(); + } else { + cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); + } + } else if (status == 2) { + if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { + if (!cm.canHold(4310000, selection)) { + cm.sendOk("Please make some space in ETC tab."); + } else { + cm.gainItem(4310000, selection); + cm.gainItem(exchangeItem, -(selection * 100)); + cm.sendOk("Thanks!"); + } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2131006.js b/scripts/npc/2131006.js index a19b093243..dcec1c69d8 100644 --- a/scripts/npc/2131006.js +++ b/scripts/npc/2131006.js @@ -7,30 +7,30 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { cm.sendSimple("The monsters are advancing.. I can't fight. I was badly injured by the Primitive Boars...#b\r\n#L0#Hey, take these boar hides. You can recover from them.#l"); } else if (status == 1) { - if (!cm.haveItem(exchangeItem, 100)) { - cm.sendNext("You don't have enough... I need at least 100."); - cm.dispose(); - } else { - cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); - } - } else if (status == 2) { - if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { - if (!cm.canHold(4310000, selection)) { - cm.sendOk("Please make some space in ETC tab."); - } else { - cm.gainItem(4310000, selection); - cm.gainItem(exchangeItem, -(selection * 100)); - cm.sendOk("Thanks!"); - } - } + if (!cm.haveItem(exchangeItem, 100)) { + cm.sendNext("You don't have enough... I need at least 100."); + cm.dispose(); + } else { + cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); + } + } else if (status == 2) { + if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { + if (!cm.canHold(4310000, selection)) { + cm.sendOk("Please make some space in ETC tab."); + } else { + cm.gainItem(4310000, selection); + cm.gainItem(exchangeItem, -(selection * 100)); + cm.sendOk("Thanks!"); + } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2131007.js b/scripts/npc/2131007.js index fffc7fb562..fe0754450d 100644 --- a/scripts/npc/2131007.js +++ b/scripts/npc/2131007.js @@ -7,30 +7,30 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { cm.sendSimple("These monsters are a piece of cake! One hit with my sword and I will kill them... better get a sword first.#b\r\n#L0#Hey, take these tree trunks. You can build a better sword with them.#l"); } else if (status == 1) { - if (!cm.haveItem(exchangeItem, 100)) { - cm.sendNext("You don't have enough... I need at least 100."); - cm.dispose(); - } else { - cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); - } - } else if (status == 2) { - if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { - if (!cm.canHold(4310000, selection)) { - cm.sendOk("Please make some space in ETC tab."); - } else { - cm.gainItem(4310000, selection); - cm.gainItem(exchangeItem, -(selection * 100)); - cm.sendOk("Thanks!"); - } - } + if (!cm.haveItem(exchangeItem, 100)) { + cm.sendNext("You don't have enough... I need at least 100."); + cm.dispose(); + } else { + cm.sendGetNumber("Hey, that's a good idea! I can give you #i4310000#Perfect Pitch for each 100 #i" + exchangeItem + "##t" + exchangeItem + "# you give me. How many do you want? (Current Items: " + cm.itemQuantity(exchangeItem) + ")", Math.min(300, cm.itemQuantity(exchangeItem) / 100), 1, Math.min(300, cm.itemQuantity(exchangeItem) / 100)); + } + } else if (status == 2) { + if (selection >= 1 && selection <= cm.itemQuantity(exchangeItem) / 100) { + if (!cm.canHold(4310000, selection)) { + cm.sendOk("Please make some space in ETC tab."); + } else { + cm.gainItem(4310000, selection); + cm.gainItem(exchangeItem, -(selection * 100)); + cm.sendOk("Thanks!"); + } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2132000.js b/scripts/npc/2132000.js index e85d945797..184fa02b74 100644 --- a/scripts/npc/2132000.js +++ b/scripts/npc/2132000.js @@ -4,7 +4,7 @@ Description: Unknown */ -function start(){ - cm.sendOk("Hmmm! For you to make your way here, far away from the Camp, you must be one strong individual. Let's explore new areas and find a place to establish our own town!!"); - cm.dispose(); +function start() { + cm.sendOk("Hmmm! For you to make your way here, far away from the Camp, you must be one strong individual. Let's explore new areas and find a place to establish our own town!!"); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2132001.js b/scripts/npc/2132001.js index 1fd12b013a..ffd0b37735 100644 --- a/scripts/npc/2132001.js +++ b/scripts/npc/2132001.js @@ -1,5 +1,5 @@ function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { diff --git a/scripts/npc/2132002.js b/scripts/npc/2132002.js index 3983d69bc1..42c86e6b13 100644 --- a/scripts/npc/2132002.js +++ b/scripts/npc/2132002.js @@ -1,5 +1,5 @@ function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { diff --git a/scripts/npc/2132003.js b/scripts/npc/2132003.js index 7390fd0590..5e339421ac 100644 --- a/scripts/npc/2132003.js +++ b/scripts/npc/2132003.js @@ -1,5 +1,5 @@ function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { diff --git a/scripts/npc/2133000.js b/scripts/npc/2133000.js index a91a790498..8e1ec76f53 100644 --- a/scripts/npc/2133000.js +++ b/scripts/npc/2133000.js @@ -23,104 +23,103 @@ * @npc: Ellin * @map: 300030100 - Deep Fairy Forest * @func: Ellin PQ -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("EllinPQ"); - if(em == null) { - cm.sendOk("The Ellin PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bForest of Poison Haze#k? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details.\r\n#L3#I would like to reclaim a prize."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else if (selection == 2) { - cm.sendOk("#e#b#k#n\r\nIn this PQ, your mission is to progressively make your way through the woods, taking on all baddies in your path, solving many puzzles you encounter and rallying yourselves to take the best of teamwork to overcome time limits and powerful creatures. Clearing the final boss, your team have a chance to obtain a marble that, #bwhen dropped by the fountain at the exit map#k, will guarantee the team extra prizes. Good luck."); - cm.dispose(); - } - else { - cm.sendSimple("So, what prize do you want to obtain?\r\n#b#L0#Give me Altaire Earrings.\r\n#L1#Give me Glittering Altaire Earrings.\r\n#L2#Give me Brilliant Altaire Earrings"); - } - } else if (status == 2) { - if (selection == 0) { - if (!cm.haveItem(1032060) && cm.haveItem(4001198, 10)) { - cm.gainItem(1032060,1); - cm.gainItem(4001198, -10); - cm.dispose(); - } else { - cm.sendOk("You either have Altair Earrings already or you do not have 10 Altair Fragments."); - cm.dispose(); - } - } else if (selection == 1){ - if (cm.haveItem(1032060) && !cm.haveItem(1032061) && cm.haveItem(4001198, 10)) { - cm.gainItem(1032060,-1); - cm.gainItem(1032061, 1); - cm.gainItem(4001198, -10); - cm.dispose(); - } else { - cm.sendOk("You either don't have Altair Earrings already or you do not have 10 Altair Fragments."); - cm.dispose(); - } - } else if (selection == 2){ - if (cm.haveItem(1032061) && !cm.haveItem(1032072) && cm.haveItem(4001198, 10)) { - cm.gainItem(1032061,-1); - cm.gainItem(1032072, 1); // thanks yuxaij for noticing unexpected itemid here - cm.gainItem(4001198, -10); - cm.dispose(); - } else { - cm.sendOk("You either don't have Glittering Altair Earrings already or you do not have 10 Altair Fragments."); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("EllinPQ"); + if (em == null) { + cm.sendOk("The Ellin PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bForest of Poison Haze#k? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details.\r\n#L3#I would like to reclaim a prize."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else if (selection == 2) { + cm.sendOk("#e#b#k#n\r\nIn this PQ, your mission is to progressively make your way through the woods, taking on all baddies in your path, solving many puzzles you encounter and rallying yourselves to take the best of teamwork to overcome time limits and powerful creatures. Clearing the final boss, your team have a chance to obtain a marble that, #bwhen dropped by the fountain at the exit map#k, will guarantee the team extra prizes. Good luck."); + cm.dispose(); + } else { + cm.sendSimple("So, what prize do you want to obtain?\r\n#b#L0#Give me Altaire Earrings.\r\n#L1#Give me Glittering Altaire Earrings.\r\n#L2#Give me Brilliant Altaire Earrings"); + } + } else if (status == 2) { + if (selection == 0) { + if (!cm.haveItem(1032060) && cm.haveItem(4001198, 10)) { + cm.gainItem(1032060, 1); + cm.gainItem(4001198, -10); + cm.dispose(); + } else { + cm.sendOk("You either have Altair Earrings already or you do not have 10 Altair Fragments."); + cm.dispose(); + } + } else if (selection == 1) { + if (cm.haveItem(1032060) && !cm.haveItem(1032061) && cm.haveItem(4001198, 10)) { + cm.gainItem(1032060, -1); + cm.gainItem(1032061, 1); + cm.gainItem(4001198, -10); + cm.dispose(); + } else { + cm.sendOk("You either don't have Altair Earrings already or you do not have 10 Altair Fragments."); + cm.dispose(); + } + } else if (selection == 2) { + if (cm.haveItem(1032061) && !cm.haveItem(1032072) && cm.haveItem(4001198, 10)) { + cm.gainItem(1032061, -1); + cm.gainItem(1032072, 1); // thanks yuxaij for noticing unexpected itemid here + cm.gainItem(4001198, -10); + cm.dispose(); + } else { + cm.sendOk("You either don't have Glittering Altair Earrings already or you do not have 10 Altair Fragments."); + cm.dispose(); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/2133001.js b/scripts/npc/2133001.js index d288555334..5117ff58bc 100644 --- a/scripts/npc/2133001.js +++ b/scripts/npc/2133001.js @@ -3,128 +3,129 @@ * @npc: Ellin * @map: Ellin PQ * @func: Ellin PQ Coordinator -*/ + */ var status = 0; var mapid; function start() { - mapid = cm.getPlayer().getMapId(); - - status = -1; - action(1, 0, 0); + mapid = cm.getPlayer().getMapId(); + + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - var ellinStr = ellinMapMessage(mapid); - - if(mapid == 930000000) { - cm.sendNext(ellinStr); - } else if(mapid == 930000300) { - var eim = cm.getEventInstance(); - - if(eim.getIntProperty("statusStg4") == 0) { - eim.showClearEffect(cm.getMap().getId()); - eim.setIntProperty("statusStg4", 1); - } - - cm.sendNext(ellinStr); - } else if(mapid == 930000400) { - if (cm.haveItem(4001169, 20)) { - if(cm.isEventLeader()) { - cm.sendNext("Oh you have brought them! We can now continue, shall we proceed?"); - } else { - cm.sendOk("You have brought them, but you're not the leader! Please let the leader hand me the marbles..."); - cm.dispose(); - return; - } - } else { - if(cm.getEventInstance().gridCheck(cm.getPlayer()) != 1) { - cm.sendNext(ellinStr); - - cm.getEventInstance().gridInsert(cm.getPlayer(), 1); - status = -1; - } else { - var mobs = cm.getMap().countMonsters(); - - if(mobs > 0) { - if (!cm.haveItem(2270004)) { - if(cm.canHold(2270004, 10)) { - cm.gainItem(2270004, 10); - cm.sendOk("Take 10 #t2270004#. First, #rweaken the #o9300174##k and, once it gets low health, use the item I gave you to capture them."); - cm.dispose(); - return; - } else { - cm.sendOk("Please make space on your USE inventory before receiving the purifiers!"); - cm.dispose(); - return; - } - } else { - cm.sendYesNo(ellinStr + "\r\n\r\nIt may be you are #rwilling to quit#k? Please double-think it, maybe your partners are still trying this instance."); - } - } else { - cm.sendYesNo("You guys caught all the #o9300174#. Let the party leader hand all #b20 #t4001169##k to me to proceed." + "\r\n\r\nIt may be you are #rwilling to quit#k? Please double-think it, maybe your partners are still trying this instance."); - } - } - } - } else { - cm.sendYesNo(ellinStr + "\r\n\r\nIt may be you are #rwilling to quit#k? Please double-think it, maybe your partners are still trying this instance."); - } - } else if(status == 1) { - if(mapid == 930000000) { - } else if(mapid == 930000300) { - cm.getEventInstance().warpEventTeam(930000400); - } else if(mapid == 930000400) { - if(cm.haveItem(4001169, 20) && cm.isEventLeader()) { - cm.gainItem(4001169, -20); - cm.getEventInstance().warpEventTeam(930000500); - } else { - cm.warp(930000800, 0); - } - } else { - cm.warp(930000800, 0); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var ellinStr = ellinMapMessage(mapid); + + if (mapid == 930000000) { + cm.sendNext(ellinStr); + } else if (mapid == 930000300) { + var eim = cm.getEventInstance(); + + if (eim.getIntProperty("statusStg4") == 0) { + eim.showClearEffect(cm.getMap().getId()); + eim.setIntProperty("statusStg4", 1); + } + + cm.sendNext(ellinStr); + } else if (mapid == 930000400) { + if (cm.haveItem(4001169, 20)) { + if (cm.isEventLeader()) { + cm.sendNext("Oh you have brought them! We can now continue, shall we proceed?"); + } else { + cm.sendOk("You have brought them, but you're not the leader! Please let the leader hand me the marbles..."); + cm.dispose(); + + } + } else { + if (cm.getEventInstance().gridCheck(cm.getPlayer()) != 1) { + cm.sendNext(ellinStr); + + cm.getEventInstance().gridInsert(cm.getPlayer(), 1); + status = -1; + } else { + var mobs = cm.getMap().countMonsters(); + + if (mobs > 0) { + if (!cm.haveItem(2270004)) { + if (cm.canHold(2270004, 10)) { + cm.gainItem(2270004, 10); + cm.sendOk("Take 10 #t2270004#. First, #rweaken the #o9300174##k and, once it gets low health, use the item I gave you to capture them."); + cm.dispose(); + + } else { + cm.sendOk("Please make space on your USE inventory before receiving the purifiers!"); + cm.dispose(); + + } + } else { + cm.sendYesNo(ellinStr + "\r\n\r\nIt may be you are #rwilling to quit#k? Please double-think it, maybe your partners are still trying this instance."); + } + } else { + cm.sendYesNo("You guys caught all the #o9300174#. Let the party leader hand all #b20 #t4001169##k to me to proceed." + "\r\n\r\nIt may be you are #rwilling to quit#k? Please double-think it, maybe your partners are still trying this instance."); + } + } + } + } else { + cm.sendYesNo(ellinStr + "\r\n\r\nIt may be you are #rwilling to quit#k? Please double-think it, maybe your partners are still trying this instance."); + } + } else if (status == 1) { + if (mapid == 930000000) { + } else if (mapid == 930000300) { + cm.getEventInstance().warpEventTeam(930000400); + } else if (mapid == 930000400) { + if (cm.haveItem(4001169, 20) && cm.isEventLeader()) { + cm.gainItem(4001169, -20); + cm.getEventInstance().warpEventTeam(930000500); + } else { + cm.warp(930000800, 0); + } + } else { + cm.warp(930000800, 0); + } + + cm.dispose(); + } + } } function ellinMapMessage(mapid) { - switch(mapid) { - case 930000000: - return "Welcome to the Forest of Poison Haze. Proceed by entering the portal."; - - case 930000100: - return "The #b#o9300172##k have taken the area. We have to eliminate all these contaminated monsters to proceed further."; - - case 930000200: - return "A great spine has blocked the way ahead. To remove this barrier we must retrieve the poison the #b#o9300173##k carries to deter the overgrown spine. However, the poison in natural state can't be handled, as it is way too concentrated. Use the #bfountain#k over there to dilute it."; - - case 930000300: + switch (mapid) { + case 930000000: + return "Welcome to the Forest of Poison Haze. Proceed by entering the portal."; + + case 930000100: + return "The #b#o9300172##k have taken the area. We have to eliminate all these contaminated monsters to proceed further."; + + case 930000200: + return "A great spine has blocked the way ahead. To remove this barrier we must retrieve the poison the #b#o9300173##k carries to deter the overgrown spine. However, the poison in natural state can't be handled, as it is way too concentrated. Use the #bfountain#k over there to dilute it."; + + case 930000300: return "Oh great, you have reached me. We can now proceed further inside the forest."; - - case 930000400: - return "The #b#o9300175##k took over this area. However they are not ordinary monsters, then regrow pretty fast, #rnormal weapon and magic does no harm to it#k at all. We have to purify all these contaminated monsters, using #b#t2270004##k! Let your group leader get me 20 Monster Marbles from them."; - - case 930000600: - return "The root of all problems of the forest! Place the obtained Magic Stone on the Altar and prepare yourselves!"; - - case 930000700: - return "This is it, you guys did it! Thank you so much for purifying the forest!!"; - + + case 930000400: + return "The #b#o9300175##k took over this area. However they are not ordinary monsters, then regrow pretty fast, #rnormal weapon and magic does no harm to it#k at all. We have to purify all these contaminated monsters, using #b#t2270004##k! Let your group leader get me 20 Monster Marbles from them."; + + case 930000600: + return "The root of all problems of the forest! Place the obtained Magic Stone on the Altar and prepare yourselves!"; + + case 930000700: + return "This is it, you guys did it! Thank you so much for purifying the forest!!"; + } } \ No newline at end of file diff --git a/scripts/npc/2133002.js b/scripts/npc/2133002.js index 59c3d759cc..ce8b458eef 100644 --- a/scripts/npc/2133002.js +++ b/scripts/npc/2133002.js @@ -1,25 +1,25 @@ var status = -1; function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - if (status == 0) { - cm.dispose(); - } - status--; + if (status == 0) { + cm.dispose(); + } + status--; } if (status == 0) { - cm.sendYesNo("Would you like to exit this instance? Your party members may have to abandon it as well, so take that in mind."); + cm.sendYesNo("Would you like to exit this instance? Your party members may have to abandon it as well, so take that in mind."); } else if (status == 1) { - cm.removeAll(4001163); - cm.removeAll(4001169); - cm.removeAll(2270004); - cm.warp(930000800, 0); - cm.dispose(); + cm.removeAll(4001163); + cm.removeAll(4001169); + cm.removeAll(2270004); + cm.warp(930000800, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/2133004.js b/scripts/npc/2133004.js index ef0d283fe3..717f912eea 100644 --- a/scripts/npc/2133004.js +++ b/scripts/npc/2133004.js @@ -1,36 +1,37 @@ var status = -1; function start() { - action(1,0,0); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(!cm.haveItem(4001163) || !cm.isEventLeader()) { - cm.sendYesNo("Let your party leader show me the Purple Stone of Magic from here.\r\n\r\nOr maybe you want to #rleave this forest#k? Leaving now means to abandon your partners here, take that in mind."); - } else { - cm.sendNext("Great, you have the Purple Stone of Magic. I shall show you guys #bthe path leading to the Stone Altar#k. Come this way."); - } - } else if(status == 1) { - if (!cm.haveItem(4001163)) { - cm.warp(930000800, 0); - } else { - cm.getEventInstance().warpEventTeam(930000600); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!cm.haveItem(4001163) || !cm.isEventLeader()) { + cm.sendYesNo("Let your party leader show me the Purple Stone of Magic from here.\r\n\r\nOr maybe you want to #rleave this forest#k? Leaving now means to abandon your partners here, take that in mind."); + } else { + cm.sendNext("Great, you have the Purple Stone of Magic. I shall show you guys #bthe path leading to the Stone Altar#k. Come this way."); + } + } else if (status == 1) { + if (!cm.haveItem(4001163)) { + cm.warp(930000800, 0); + } else { + cm.getEventInstance().warpEventTeam(930000600); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/2141000.js b/scripts/npc/2141000.js index b1e5b9c5e9..e1642512a0 100644 --- a/scripts/npc/2141000.js +++ b/scripts/npc/2141000.js @@ -9,8 +9,8 @@ function start() { function action(mode, type, selection) { if (mode == 1) { - cm.removeNpc(270050100, 2141000); - cm.forceStartReactor(270050100, 2709000); + cm.removeNpc(270050100, 2141000); + cm.forceStartReactor(270050100, 2709000); } cm.dispose(); diff --git a/scripts/npc/2141001.js b/scripts/npc/2141001.js index 4e2785fbdc..3789604f3f 100644 --- a/scripts/npc/2141001.js +++ b/scripts/npc/2141001.js @@ -83,12 +83,12 @@ function action(mode, type, selection) { } else if (expedition.isInProgress()) { //Only if the expedition is in progress if (expedition.contains(player)) { //If you're registered, warp you in var eim = em.getInstance(expedName + player.getClient().getChannel()); - if(eim.getIntProperty("canJoin") == 1) { + if (eim.getIntProperty("canJoin") == 1) { eim.registerPlayer(player); } else { cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls."); } - + cm.dispose(); } else { //If you're not in by now, tough luck cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); @@ -98,12 +98,12 @@ function action(mode, type, selection) { } else if (status == 1) { if (selection == 1) { expedition = cm.getExpedition(exped); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(exped); if (res == 0) { cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -112,13 +112,13 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + "."); cm.dispose(); - return; + } } else if (status == 2) { if (selection == 1) { @@ -143,14 +143,14 @@ function action(mode, type, selection) { status = 6; } else if (selection == 2) { var min = exped.getMinSize(); - + var size = expedition.getMemberList().size(); if (size < min) { cm.sendOk("You need at least " + min + " players registered in your expedition."); cm.dispose(); return; } - + cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { @@ -159,7 +159,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -170,14 +170,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/2141002.js b/scripts/npc/2141002.js index 8506642d0f..84941f1394 100644 --- a/scripts/npc/2141002.js +++ b/scripts/npc/2141002.js @@ -12,40 +12,38 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (mode == 0) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + var eim = cm.getEventInstance(); - if(!eim.isEventCleared()) { + if (!eim.isEventCleared()) { if (status == 0) { cm.sendYesNo("Do you want to get out now?"); - } - else if (status == 1) { + } else if (status == 1) { cm.warp(270050000, 0); cm.dispose(); } - + } else { if (status == 0) { cm.sendYesNo("Pink Bean has been defeated! You guys sure are true heroes of this land! In no time, Temple of Time will shine again as bright as ever, all thanks to your efforts! Hooray to our heroes!! Are you ready to go now?"); - } - else if (status == 1) { - if(eim.giveEventReward(cm.getPlayer(), 1)) { + } else if (status == 1) { + if (eim.giveEventReward(cm.getPlayer(), 1)) { cm.warp(270050000); - } - else { + } else { cm.sendOk("You cannot receive an instance prize without having an empty room in your EQUIP, USE, SET-UP and ETC inventory."); } - + cm.dispose(); } } diff --git a/scripts/npc/22000.js b/scripts/npc/22000.js index c91c68f46f..ba6f5fd301 100644 --- a/scripts/npc/22000.js +++ b/scripts/npc/22000.js @@ -32,31 +32,33 @@ function start() { function action(mode, type, selection) { status++; - if (mode != 1){ - if(mode == 0 && type != 1) + if (mode != 1) { + if (mode == 0 && type != 1) { status -= 2; - else if(type == 1 || (mode == -1 && type != 1)){ - if(mode == 0) + } else if (type == 1 || (mode == -1 && type != 1)) { + if (mode == 0) { cm.sendOk("Hmm... I guess you still have things to do here?"); + } cm.dispose(); return; } } if (status == 1) { - if (cm.haveItem(4031801)) + if (cm.haveItem(4031801)) { cm.sendNext("Okay, now give me 150 mesos... Hey, what's that? Is that the recommendation letter from Lucas, the chief of Amherst? Hey, you should have told me you had this. I, Shanks, recognize greatness when I see one, and since you have been recommended by Lucas, I see that you have a great, great potential as an adventurer. No way would I charge you for this trip!"); - else + } else { cm.sendNext("Bored of this place? Here... Give me #e150 mesos#n first..."); + } } else if (status == 2) { - if (cm.haveItem(4031801)) + if (cm.haveItem(4031801)) { cm.sendNextPrev("Since you have the recommendation letter, I won't charge you for this. Alright, buckle up, because we're going to head to Victoria Island right now, and it might get a bit turbulent!!"); - else - if (cm.getLevel() > 6) { + } else if (cm.getLevel() > 6) { if (cm.getMeso() < 150) { cm.sendOk("What? You're telling me you wanted to go without any money? You're one weirdo..."); cm.dispose(); - } else + } else { cm.sendNext("Awesome! #e150#n mesos accepted! Alright, off to Victoria Island!"); + } } else { cm.sendOk("Let's see... I don't think you are strong enough. You'll have to be at least Level 7 to go to Victoria Island."); cm.dispose(); diff --git a/scripts/npc/9000001.js b/scripts/npc/9000001.js index c0501bf004..0c5286c208 100644 --- a/scripts/npc/9000001.js +++ b/scripts/npc/9000001.js @@ -38,10 +38,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { cm.sendNextPrev("Hmm... What should I do? The event will start, soon... Many people went to participate in the event, so we better be hurry..."); } else if (status == 2) { @@ -53,19 +54,20 @@ function action(mode, type, selection) { } else if (selection == 1) { cm.sendSimple("There are many games for this event. It will help you a lot to know how to play the game before you play it. Choose the one you want to know more of! #b\r\n#L0# Ola Ola#l\r\n#L1# MapleStory Maple Physical Fitness Test#l\r\n#L2# Snow Ball#l\r\n#L3# Coconut Harvest#l\r\n#L4# OX Quiz#l\r\n#L5# Treasure Hunt#l#k"); } else if (selection == 2) { - if (cm.getEvent() != null && cm.getEvent().getLimit() > 0) { - cm.getPlayer().saveLocation("EVENT"); - if (cm.getEvent().getMapId() == 109080000 || cm.getEvent().getMapId() == 109060001) - cm.divideTeams(); - - cm.getEvent().minusLimit(); - cm.warp(cm.getEvent().getMapId(), 0); - cm.dispose(); - } else { - cm.sendNext("Either the event has not been started, you already have the #bScroll of Secrets#k, or you have already participated in this event within the last 24 hours. Please try again later!"); - cm.dispose(); + if (cm.getEvent() != null && cm.getEvent().getLimit() > 0) { + cm.getPlayer().saveLocation("EVENT"); + if (cm.getEvent().getMapId() == 109080000 || cm.getEvent().getMapId() == 109060001) { + cm.divideTeams(); + } + + cm.getEvent().minusLimit(); + cm.warp(cm.getEvent().getMapId(), 0); + cm.dispose(); + } else { + cm.sendNext("Either the event has not been started, you already have the #bScroll of Secrets#k, or you have already participated in this event within the last 24 hours. Please try again later!"); + cm.dispose(); + } } - } } else if (status == 4) { if (selection == 0) { cm.sendNext("#b[Ola Ola]#k is a game where participants climb ladders to reach the top. Climb your way up and move to the next level by choosing the correct portal out of the numerous portals available. \r\n\r\nThe game consists of three levels, and the time limit is #b6 MINUTES#k. During [Ola Ola], you #bwon't be able to jump, teleport, haste, or boost your speed using potions or items#k. There are also trick portals that'll lead you to a strange place, so please be aware of those."); @@ -86,6 +88,6 @@ function action(mode, type, selection) { cm.sendNext("#b[Treasure Hunt]#k is a game in which your goal is to find the #btreasure scrolls#k that are hidden all over the map #rin 10 minutes#k. There will be a number of mysterious treasure chests hidden away, and once you break them apart, many items will surface from the chest. Your job is to pick out the treasure scroll from those items. \r\nTreasure chests can be destroyed using #bregular attacks#k, and once you have the treasure scroll in possession, you can trade it for the Scroll of Secrets through an NPC that's in charge of trading items. The trading NPC can be found on the Treasure Hunt map, but you can also trade your scroll through #bVikin#k of Lith Harbor.\r\n\r\nThis game has its share of hidden portals and hidden teleporting spots. To use them, press the #bup arrow#k at a certain spot, and you'll be teleported to a different place. Try jumping around, for you may also run into hidden stairs or ropes. There will also be a treasure chest that'll take you to a hidden spot, and a hidden chest that can only be found through the hidden portal, so try looking around.\r\n\r\nDuring the game of Treasure Hunt, all attack skills will be #rdisabled#k, so please break the treasure chest with the regular attack."); cm.dispose(); } - } + } } } \ No newline at end of file diff --git a/scripts/npc/9000002.js b/scripts/npc/9000002.js index dcd058162e..5ea8f72a94 100644 --- a/scripts/npc/9000002.js +++ b/scripts/npc/9000002.js @@ -28,14 +28,15 @@ function start() { function action(mode, type, selection) { if (mode == -1) { cm.dispose(); - }else if (mode == 0){ + } else if (mode == 0) { cm.dispose(); - }else{ - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendNext("Bam bam bam bam!! You have won the game from the \r\n#bEVENT#k. Congratulations on making it this far!"); } else if (status == 1) { @@ -43,13 +44,13 @@ function action(mode, type, selection) { } else if (status == 2) { cm.sendNext("The Scroll of Secrets can be deciphered by #rChun Ji#k or \r\n#rGeanie#k at Ludibrium. Bring it with you and something good's bound to happen."); } else if (status == 3) { - if (cm.canHold(4031019)) { - cm.gainItem(4031019); - cm.warp(cm.getPlayer().getSavedLocation("EVENT")); - cm.dispose(); - } else { - cm.sendNext("I think your Etc window is full. Please make room, then talk to me."); - } + if (cm.canHold(4031019)) { + cm.gainItem(4031019); + cm.warp(cm.getPlayer().getSavedLocation("EVENT")); + cm.dispose(); + } else { + cm.sendNext("I think your Etc window is full. Please make room, then talk to me."); + } } else if (status == 4) { cm.dispose(); } diff --git a/scripts/npc/9000004.js b/scripts/npc/9000004.js index 3c520f4c01..b687e09414 100644 --- a/scripts/npc/9000004.js +++ b/scripts/npc/9000004.js @@ -32,14 +32,15 @@ function start() { function action(mode, type, selection) { if (mode == -1) { cm.dispose(); - }else if (mode == 0){ + } else if (mode == 0) { cm.dispose(); - }else{ - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - var eim = cm.getPlayer().getEventInstance(); + } + var eim = cm.getPlayer().getEventInstance(); var nthtext = "last"; if (status == 0) { party = eim.getPlayers(); @@ -48,53 +49,53 @@ function action(mode, type, selection) { if (preamble == null) { cm.sendOk("Hi. Welcome to the " + nthtext + " stage. This is where you fight the #bboss#k. Shall we get started?"); status = 9; - }else{ - if(!isLeader()){ - if(mobcount == null){ + } else { + if (!isLeader()) { + if (mobcount == null) { cm.sendOk("Please tell your #bParty-Leader#k to come talk to me"); cm.dispose(); - }else{ - cm.warp(109020001,0); + } else { + cm.warp(109020001, 0); cm.dispose(); } } - if(mobcount == null){ + if (mobcount == null) { cm.sendYesNo("You're finished?!"); } } - }else if (status == 1){ + } else if (status == 1) { //if (cm.mobCount(600010000)==0) { if (cm.mapMobCount() == 0) { cm.sendOk("Good job! You've killed 'em!"); - }else{ + } else { cm.sendOk("What are you talking about? Kill those creatures!!"); cm.dispose(); } - }else if (status == 2){ + } else if (status == 2) { cm.sendOk("You may continue to the next stage!"); - }else if (status == 3) { + } else if (status == 3) { cm.clear(); - eim.setProperty("leader" + nthtext + "mobcount","done"); + eim.setProperty("leader" + nthtext + "mobcount", "done"); var map = eim.getMapInstance(109020001); var members = eim.getPlayers(); cm.warpMembers(map, members); cm.givePartyExp(2500, eim.getPlayers()); cm.dispose(); - }else if (status == 10){ - eim.setProperty("leader" + nthtext + "preamble","done"); + } else if (status == 10) { + eim.setProperty("leader" + nthtext + "preamble", "done"); // cm.summonMobAtPosition(8220000,25000000,1500000,1,-762,-1307); // cm.summonMobAtPosition(8220001,15000000,750000,1,-788,-851); // cm.summonMobAtPosition(9410015,15000000,750000,1,128,-851); cm.dispose(); - } + } } } - - -function isLeader(){ - if(cm.getParty() == null){ + + +function isLeader() { + if (cm.getParty() == null) { return false; - }else{ + } else { return cm.isLeader(); } } \ No newline at end of file diff --git a/scripts/npc/9000007.js b/scripts/npc/9000007.js index 3772715b71..822bc37565 100644 --- a/scripts/npc/9000007.js +++ b/scripts/npc/9000007.js @@ -20,28 +20,29 @@ /* Chun Ji */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Just a kid... Don't talk to me..."); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Just a kid... Don't talk to me..."); + cm.dispose(); + } + } } diff --git a/scripts/npc/9000009.js b/scripts/npc/9000009.js index ebddd92d08..cd3749f7ca 100644 --- a/scripts/npc/9000009.js +++ b/scripts/npc/9000009.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Author: Xterminator, Moogra NPC Name: Vikin Map(s): Victoria Road: Lith Harbor (104000000) diff --git a/scripts/npc/9000010.js b/scripts/npc/9000010.js index a333fe08b4..b6fb0ac6f4 100644 --- a/scripts/npc/9000010.js +++ b/scripts/npc/9000010.js @@ -29,5 +29,5 @@ function action(mode, type, selection) { cm.dispose(); } cm.warp(cm.getPlayer().getSavedLocation("EVENT")); - cm.dispose(); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9000011.js b/scripts/npc/9000011.js index 67dbb825bd..8f87d2d31e 100644 --- a/scripts/npc/9000011.js +++ b/scripts/npc/9000011.js @@ -12,132 +12,133 @@ var prize10 = Array(1442049, 3010172, 3010171, 3010169, 3010168, 3010161, 243011 var status = 0; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (status >= 0 && mode == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendNext("Hey, I'm #p" + cm.getNpc() + "#k, if you're not busy and all ... then can I hang out with you? I heard there are people gathering up around here for an #revent#k but I don't want to go there by myself ... Well, do you want to go check it out with me?"); - } else if (status == 1) { - cm.sendSimple("Huh? What kind of an event? Well, that's...\r\n#L0##e1.#n#b What kind of an event is it?#k#l\r\n#L1##e2.#n#b Explain the event game to me.#k#l\r\n#L2##e3.#n#b Alright, let's go!#k#l\r\n#L3##e4.#n#bPlease exchance Certificate of straight Win to reward item.#k#l"); - } else if (status == 2) { - if (selection == 0) { - cm.sendNext("All this month, MapleStory Global is celebrating its 3rd anniversary! The GM's will be holding surprise GM Events throughout the event, so stay on your toes and make sure to participate in at least one of the events for great prizes!"); - cm.dispose(); - } else if (selection == 1) { - cm.sendSimple("There are many games for this event. It will help you a lot to know how to play the game before you play it. Choose the one you want to know more of! #b\r\n#L0# Ola Ola#l\r\n#L1# MapleStory Maple Physical Fitness Test#l\r\n#L2# Snow Ball#l\r\n#L3# Coconut Harvest#l\r\n#L4# OX Quiz#l\r\n#L5# Treasure Hunt#l#k"); - } else if (selection == 2) { - var marr = cm.getQuestRecord(100295); - if (marr.getCustomData() == null) { - marr.setCustomData("0"); - } - var dat = parseInt(marr.getCustomData()); - if (dat + 3600000 >= cm.getCurrentTime()) { - cm.sendNext("You've entered the event already in the past hour."); - } else if (!cm.canHold(4031019)) { - cm.sendNext("Save up some space in your inventory."); - } else if (cm.getChannelServer().getEvent() > -1 && !cm.haveItem(4031019)) { - cm.getPlayer().saveLocation("EVENT"); - cm.getPlayer().setChalkboard(null); - marr.setCustomData("" + cm.getCurrentTime()); - cm.warp(cm.getChannelServer().getEvent(), cm.getChannelServer().getEvent() == 109080000 || cm.getChannelServer().getEvent() == 109080010 ? 0 : "join00"); - } else { - cm.sendNext("Either the event has not been started, you already have the #bScroll of Secrets#k, or you have already participated in this event within the last 24 hours. Please try again later!"); - } - cm.dispose(); - } else if (selection == 3) { - var selStr = "Which Certificate of straight Win do you wish to exchange?"; - for (var i = 0; i < quantities.length; i++) { - selStr += "\r\n#b#L" + i + "##t" + (4031332 + i) + "# Exchange(" + quantities[i] + ")#l"; - } - cm.sendSimple(selStr); - status = 9; - } - } else if (status == 3) { - if (selection == 0) { - cm.sendNext("#b[Ola Ola]#k is a game where participants climb ladders to reach the top. Climb your way up and move to the next level by choosing the correct portal out of the numerous portals available. \r\n\r\nThe game consists of three levels, and the time limit is #b6 MINUTES#k. During [Ola Ola], you #bwon't be able to jump, teleport, haste, or boost your speed using potions or items#k. There are also trick portals that'll lead you to a strange place, so please be aware of those."); - cm.dispose(); - } else if (selection == 1) { - cm.sendNext("#b[MapleStory Physical Fitness Test] is a race through an obstacle course#k much like the Forest of Patience. You can win it by overcoming various obstacles and reach the final destination within the time limit. \r\n\r\nThe game consists of four levels, and the time limit is #b15 MINUTES#k. During [MapleStory Physical Fitness Test], you won't be able to use teleport or haste."); - cm.dispose(); - } else if (selection == 2) { - cm.sendNext("#b[Snowball]#k consists of two teams, Maple Team and Story Team, and the two teams duke it out to see #bwhich team rolled the snowball farther and bigger in a limited time#k. If the game cannot be decided within the time period, then the team that rolled the snowball farther wins. \r\n\r\nTo roll up the snow, attack it by pressing #bCtrl#k. All long-ranged attacks and skill-based attacks will not work here, #bonly the close-range attacks will work#k. \r\n\r\nIf a character touches the snowball, he/she'll be sent back to the starting point. Attack the snowman in front of the starting point to prevent the opposing team from rolling the snow forward. This is where a well-planned strategy works, as the team will decide whether to attack the snowball or the snowman."); - cm.dispose(); - } else if (selection == 3) { - cm.sendNext("#b[Coconut Harvest]#k consists of two teams, Maple Team and Story Team, and the two teams duke it out to see #bwhich team gathers up the most coconuts#k. The time limit is #b5 MINUTES#k. If the game ends in a tie, an additional 2 minutes will be awarded to determine the winner. If, for some reason, the score stays tied, then the game will end in a draw. \r\n\r\nAll long-range attacks and skill-based attacks will not work here, #bonly the close-range attacks will work#k. If you don't have a weapon for the close-range attacks, you can purchase them through an NPC within the event map. No matter the level of character, the weapon, or skills, all damages applied will be the same.\r\n\r\nBeware of the obstacles and traps within the map. If the character dies during the game, the character will be eliminated from the game. The player who strikes last before the coconut drops wins. Only the coconuts that hit the ground counts, which means the ones that do not fall off the tree, or the occasional explosion of the coconuts WILL NOT COUNT. There's also a hidden portal at one of the shells at the bottom of the map, so use that wisely!"); - cm.dispose(); - } else if (selection == 4) { - cm.sendNext("#b[OX Quiz]#k is a game of MapleStory smarts through X's and O's. Once you join the game, turn on the minimap by pressing #bM#k to see where the X and O are. A total of #r10 questions#k will be given, and the character that answers them all correctly wins the game. \r\n\r\nOnce the question is given, use the ladder to enter the area where the correct answer may be, be it X or O. If the character does not choose an answer or is hanging on the ladder past the time limit, the character will be eliminated. Please hold your position until [CORRECT] is off the screen before moving on. To prevent cheating of any kind, all types of chatting will be turned off during the OX Quiz."); - cm.dispose(); - } else if (selection == 5) { - cm.sendNext("#b[Treasure Hunt]#k is a game in which your goal is to find the #btreasure scrolls#k that are hidden all over the map #rin 10 minutes#k. There will be a number of mysterious treasure chests hidden away, and once you break them apart, many items will surface from the chest. Your job is to pick out the treasure scroll from those items. \r\nTreasure chests can be destroyed using #bregular attacks#k, and once you have the treasure scroll in possession, you can trade it for the Scroll of Secrets through an NPC that's in charge of trading items. The trading NPC can be found on the Treasure Hunt map, but you can also trade your scroll through #bVikin#k of Lith Harbor.\r\n\r\nThis game has its share of hidden portals and hidden teleporting spots. To use them, press the #bup arrow#k at a certain spot, and you'll be teleported to a different place. Try jumping around, for you may also run into hidden stairs or ropes. There will also be a treasure chest that'll take you to a hidden spot, and a hidden chest that can only be found through the hidden portal, so try looking around.\r\n\r\nDuring the game of Treasure Hunt, all attack skills will be #rdisabled#k, so please break the treasure chest with the regular attack."); - cm.dispose(); - } - } else if (status == 10) { - if (selection < 0 || selection > quantities.length) { - return; - } - var ite = 4031332 + selection; - var quan = quantities[selection]; - var pri; - switch(selection) { - case 0: - pri = prize1; - break; - case 1: - pri = prize2; - break; - case 2: - pri = prize3; - break; - case 3: - pri = prize4; - break; - case 4: - pri = prize5; - break; - case 5: - pri = prize6; - break; - case 6: - pri = prize7; - break; - case 7: - pri = prize8; - break; - case 8: - pri = prize9; - break; - case 9: - pri = prize10; - break; - default: - cm.dispose(); - return; - } - var rand = Math.floor(Math.random() * pri.length); - if (!cm.haveItem(ite, quan)) { - cm.sendOk("You need #b" + quan + " #t" + ite + "##k to exchange it with item."); - } else if (cm.getInventory(1).getNextFreeSlot() <= -1 || cm.getInventory(2).getNextFreeSlot() <= -1 || cm.getInventory(3).getNextFreeSlot() <= -1 || cm.getInventory(4).getNextFreeSlot() <= -1) { - cm.sendOk("You need space for this item."); - } else { - cm.gainItem(pri[rand], 1); - cm.gainItem(ite, -quan); - cm.gainMeso(100000 * selection); //temporary prize lolol - } - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (status >= 0 && mode == 0) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendNext("Hey, I'm #p" + cm.getNpc() + "#k, if you're not busy and all ... then can I hang out with you? I heard there are people gathering up around here for an #revent#k but I don't want to go there by myself ... Well, do you want to go check it out with me?"); + } else if (status == 1) { + cm.sendSimple("Huh? What kind of an event? Well, that's...\r\n#L0##e1.#n#b What kind of an event is it?#k#l\r\n#L1##e2.#n#b Explain the event game to me.#k#l\r\n#L2##e3.#n#b Alright, let's go!#k#l\r\n#L3##e4.#n#bPlease exchance Certificate of straight Win to reward item.#k#l"); + } else if (status == 2) { + if (selection == 0) { + cm.sendNext("All this month, MapleStory Global is celebrating its 3rd anniversary! The GM's will be holding surprise GM Events throughout the event, so stay on your toes and make sure to participate in at least one of the events for great prizes!"); + cm.dispose(); + } else if (selection == 1) { + cm.sendSimple("There are many games for this event. It will help you a lot to know how to play the game before you play it. Choose the one you want to know more of! #b\r\n#L0# Ola Ola#l\r\n#L1# MapleStory Maple Physical Fitness Test#l\r\n#L2# Snow Ball#l\r\n#L3# Coconut Harvest#l\r\n#L4# OX Quiz#l\r\n#L5# Treasure Hunt#l#k"); + } else if (selection == 2) { + var marr = cm.getQuestRecord(100295); + if (marr.getCustomData() == null) { + marr.setCustomData("0"); + } + var dat = parseInt(marr.getCustomData()); + if (dat + 3600000 >= cm.getCurrentTime()) { + cm.sendNext("You've entered the event already in the past hour."); + } else if (!cm.canHold(4031019)) { + cm.sendNext("Save up some space in your inventory."); + } else if (cm.getChannelServer().getEvent() > -1 && !cm.haveItem(4031019)) { + cm.getPlayer().saveLocation("EVENT"); + cm.getPlayer().setChalkboard(null); + marr.setCustomData("" + cm.getCurrentTime()); + cm.warp(cm.getChannelServer().getEvent(), cm.getChannelServer().getEvent() == 109080000 || cm.getChannelServer().getEvent() == 109080010 ? 0 : "join00"); + } else { + cm.sendNext("Either the event has not been started, you already have the #bScroll of Secrets#k, or you have already participated in this event within the last 24 hours. Please try again later!"); + } + cm.dispose(); + } else if (selection == 3) { + var selStr = "Which Certificate of straight Win do you wish to exchange?"; + for (var i = 0; i < quantities.length; i++) { + selStr += "\r\n#b#L" + i + "##t" + (4031332 + i) + "# Exchange(" + quantities[i] + ")#l"; + } + cm.sendSimple(selStr); + status = 9; + } + } else if (status == 3) { + if (selection == 0) { + cm.sendNext("#b[Ola Ola]#k is a game where participants climb ladders to reach the top. Climb your way up and move to the next level by choosing the correct portal out of the numerous portals available. \r\n\r\nThe game consists of three levels, and the time limit is #b6 MINUTES#k. During [Ola Ola], you #bwon't be able to jump, teleport, haste, or boost your speed using potions or items#k. There are also trick portals that'll lead you to a strange place, so please be aware of those."); + cm.dispose(); + } else if (selection == 1) { + cm.sendNext("#b[MapleStory Physical Fitness Test] is a race through an obstacle course#k much like the Forest of Patience. You can win it by overcoming various obstacles and reach the final destination within the time limit. \r\n\r\nThe game consists of four levels, and the time limit is #b15 MINUTES#k. During [MapleStory Physical Fitness Test], you won't be able to use teleport or haste."); + cm.dispose(); + } else if (selection == 2) { + cm.sendNext("#b[Snowball]#k consists of two teams, Maple Team and Story Team, and the two teams duke it out to see #bwhich team rolled the snowball farther and bigger in a limited time#k. If the game cannot be decided within the time period, then the team that rolled the snowball farther wins. \r\n\r\nTo roll up the snow, attack it by pressing #bCtrl#k. All long-ranged attacks and skill-based attacks will not work here, #bonly the close-range attacks will work#k. \r\n\r\nIf a character touches the snowball, he/she'll be sent back to the starting point. Attack the snowman in front of the starting point to prevent the opposing team from rolling the snow forward. This is where a well-planned strategy works, as the team will decide whether to attack the snowball or the snowman."); + cm.dispose(); + } else if (selection == 3) { + cm.sendNext("#b[Coconut Harvest]#k consists of two teams, Maple Team and Story Team, and the two teams duke it out to see #bwhich team gathers up the most coconuts#k. The time limit is #b5 MINUTES#k. If the game ends in a tie, an additional 2 minutes will be awarded to determine the winner. If, for some reason, the score stays tied, then the game will end in a draw. \r\n\r\nAll long-range attacks and skill-based attacks will not work here, #bonly the close-range attacks will work#k. If you don't have a weapon for the close-range attacks, you can purchase them through an NPC within the event map. No matter the level of character, the weapon, or skills, all damages applied will be the same.\r\n\r\nBeware of the obstacles and traps within the map. If the character dies during the game, the character will be eliminated from the game. The player who strikes last before the coconut drops wins. Only the coconuts that hit the ground counts, which means the ones that do not fall off the tree, or the occasional explosion of the coconuts WILL NOT COUNT. There's also a hidden portal at one of the shells at the bottom of the map, so use that wisely!"); + cm.dispose(); + } else if (selection == 4) { + cm.sendNext("#b[OX Quiz]#k is a game of MapleStory smarts through X's and O's. Once you join the game, turn on the minimap by pressing #bM#k to see where the X and O are. A total of #r10 questions#k will be given, and the character that answers them all correctly wins the game. \r\n\r\nOnce the question is given, use the ladder to enter the area where the correct answer may be, be it X or O. If the character does not choose an answer or is hanging on the ladder past the time limit, the character will be eliminated. Please hold your position until [CORRECT] is off the screen before moving on. To prevent cheating of any kind, all types of chatting will be turned off during the OX Quiz."); + cm.dispose(); + } else if (selection == 5) { + cm.sendNext("#b[Treasure Hunt]#k is a game in which your goal is to find the #btreasure scrolls#k that are hidden all over the map #rin 10 minutes#k. There will be a number of mysterious treasure chests hidden away, and once you break them apart, many items will surface from the chest. Your job is to pick out the treasure scroll from those items. \r\nTreasure chests can be destroyed using #bregular attacks#k, and once you have the treasure scroll in possession, you can trade it for the Scroll of Secrets through an NPC that's in charge of trading items. The trading NPC can be found on the Treasure Hunt map, but you can also trade your scroll through #bVikin#k of Lith Harbor.\r\n\r\nThis game has its share of hidden portals and hidden teleporting spots. To use them, press the #bup arrow#k at a certain spot, and you'll be teleported to a different place. Try jumping around, for you may also run into hidden stairs or ropes. There will also be a treasure chest that'll take you to a hidden spot, and a hidden chest that can only be found through the hidden portal, so try looking around.\r\n\r\nDuring the game of Treasure Hunt, all attack skills will be #rdisabled#k, so please break the treasure chest with the regular attack."); + cm.dispose(); + } + } else if (status == 10) { + if (selection < 0 || selection > quantities.length) { + return; + } + var ite = 4031332 + selection; + var quan = quantities[selection]; + var pri; + switch (selection) { + case 0: + pri = prize1; + break; + case 1: + pri = prize2; + break; + case 2: + pri = prize3; + break; + case 3: + pri = prize4; + break; + case 4: + pri = prize5; + break; + case 5: + pri = prize6; + break; + case 6: + pri = prize7; + break; + case 7: + pri = prize8; + break; + case 8: + pri = prize9; + break; + case 9: + pri = prize10; + break; + default: + cm.dispose(); + return; + } + var rand = Math.floor(Math.random() * pri.length); + if (!cm.haveItem(ite, quan)) { + cm.sendOk("You need #b" + quan + " #t" + ite + "##k to exchange it with item."); + } else if (cm.getInventory(1).getNextFreeSlot() <= -1 || cm.getInventory(2).getNextFreeSlot() <= -1 || cm.getInventory(3).getNextFreeSlot() <= -1 || cm.getInventory(4).getNextFreeSlot() <= -1) { + cm.sendOk("You need space for this item."); + } else { + cm.gainItem(pri[rand], 1); + cm.gainItem(ite, -quan); + cm.gainMeso(100000 * selection); //temporary prize lolol + } + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9000012.js b/scripts/npc/9000012.js index af021b98ce..927922f281 100644 --- a/scripts/npc/9000012.js +++ b/scripts/npc/9000012.js @@ -28,40 +28,41 @@ var status = 0; function start() { status = -1; - cm.sendSimple("Man... It is hot!!!~ How can I help you?\r\n#L0##bLeave the event game.#l\r\n#L1#Buy the weapon (Wooden Club 1 meso)"); + cm.sendSimple("Man... It is hot!!!~ How can I help you?\r\n#L0##bLeave the event game.#l\r\n#L1#Buy the weapon (Wooden Club 1 meso)"); } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); - }else if (mode == 0){ + } else if (mode == 0) { cm.dispose(); - }else{ - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; } - if (status == 0) { - if (selection == 0) { - cm.sendYesNo("If you leave now, you can't participate in this event for the next 24 hours. Are you sure you want to leave?"); - } else if (selection == 1) { - if (cm.getMesos < 1 && !cm.canHold(1322005)) { + } + if (status == 0) { + if (selection == 0) { + cm.sendYesNo("If you leave now, you can't participate in this event for the next 24 hours. Are you sure you want to leave?"); + } else if (selection == 1) { + if (cm.getMesos < 1 && !cm.canHold(1322005)) { cm.sendOk("You don't have enough mesos or you don't have any space in your inventory."); cm.dispose(); - } else { + } else { cm.gainItem(1322005); - cm.gainMeso(-1); + cm.gainMeso(-1); cm.dispose(); - } - } - } else if (status == 1) { - if (cm.getEvent() != null) { - cm.getEvent().addLimit(); - } - cm.warp(109050001, 0); - cm.dispose(); - } + } + } + } else if (status == 1) { + if (cm.getEvent() != null) { + cm.getEvent().addLimit(); + } + cm.warp(109050001, 0); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9000017.js b/scripts/npc/9000017.js index c001a09481..50bd254539 100644 --- a/scripts/npc/9000017.js +++ b/scripts/npc/9000017.js @@ -42,9 +42,9 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else { + } else { cm.sendOk("Oh, ok... Talk back to us when you want to make business."); cm.dispose(); return; @@ -57,68 +57,60 @@ function action(mode, type, selection) { cm.dispose(); return; } - + var selStr = "Hey traveler! Come, come closer... We offer a #bhuge opportunity of business#k to you. If you want to know what it is, keep listening..."; cm.sendNext(selStr); - } - else if (status == 1) { - var selStr = "We've got here the knowledge to synthetize the mighty #b#t2049100##k! Of course, making one is not an easy task... But worry not! Just gather some material to me and a fee of #b1,200,000 mesos#k for our services to #bobtain it#k. You still want to do it?"; + } else if (status == 1) { + var selStr = "We've got here the knowledge to synthetize the mighty #b#t2049100##k! Of course, making one is not an easy task... But worry not! Just gather some material to me and a fee of #b1,200,000 mesos#k for our services to #bobtain it#k. You still want to do it?"; cm.sendYesNo(selStr); - } - - else if (status == 2) { + } else if (status == 2) { //selectedItem = selection; selectedItem = 0; - var itemSet = new Array(2049100, 7777777); - var matSet = new Array(new Array(4031203,4001356,4000136,4000082,4001126,4080100,4000021,4003005)); - var matQtySet = new Array(new Array(100,60,40,80,10,8,200,120)); - var costSet = new Array(1200000, 7777777); + var itemSet = [2049100, 7777777]; + var matSet = new Array([4031203, 4001356, 4000136, 4000082, 4001126, 4080100, 4000021, 4003005]); + var matQtySet = new Array([100, 60, 40, 80, 10, 8, 200, 120]); + var costSet = [1200000, 7777777]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - + var prompt = "So, you want us to make some #t" + item + "#? In that case, how many do you want us to make?"; - cm.sendGetNumber(prompt,1,1,100) - } - - else if (status == 3) { + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3) { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); last_use = false; - + var prompt = "You want us to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - + } + prompt += " In that case, we're going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - - if (mats instanceof Array){ + + if (mats instanceof Array) { for (var i = 0; i < mats.length; i++) { - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } } else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } - + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; } cm.sendYesNo(prompt); - } - - else if (status == 4) { + } else if (status == 4) { var complete = true; - + if (cm.getMeso() < cost * qty) { cm.sendOk("Come on! We're not here doing you a favor! We all need money to live properly, so bring the cash so we make deal and start the synthesis."); - } - else if(!cm.canHold(item, qty)) { + } else if (!cm.canHold(item, qty)) { cm.sendOk("You didn't check if you got a slot to spare on your inventory before our business, no?"); - } - else { + } else { if (mats instanceof Array) { for (var i = 0; complete && i < mats.length; i++) { if (matQty[i] * qty == 1) { @@ -130,12 +122,12 @@ function action(mode, type, selection) { } else { complete = cm.haveItem(mats, matQty * qty); } - - if (!complete) + + if (!complete) { cm.sendOk("You kidding, right? We won't be able to start the process without all the ingredients at hands. Go get all of them and then talk to us!"); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } } else { diff --git a/scripts/npc/9000019.js b/scripts/npc/9000019.js index ffc677a148..f554715bd6 100644 --- a/scripts/npc/9000019.js +++ b/scripts/npc/9000019.js @@ -1,34 +1,35 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - const InventoryType = Java.type('client.inventory.InventoryType'); - if(cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { - cm.sendNext("Check for a available slot on your ETC inventory."); - cm.dispose(); - return; - } - - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getClient().sendPacket(PacketCreator.openRPSNPC()); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + const InventoryType = Java.type('client.inventory.InventoryType'); + if (cm.getPlayer().getInventory(InventoryType.ETC).getNumFreeSlot() < 1) { + cm.sendNext("Check for a available slot on your ETC inventory."); + cm.dispose(); + return; + } + + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getClient().sendPacket(PacketCreator.openRPSNPC()); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9000020.js b/scripts/npc/9000020.js index 1a35a90e59..2a40acd0c7 100644 --- a/scripts/npc/9000020.js +++ b/scripts/npc/9000020.js @@ -32,54 +32,54 @@ var travelPlaceCountry = ["Japan", "Malaysia"]; var travelAgent = ["I", "#r#p9201135##k"]; var travelDescription = ["If you desire to feel the essence of Japan, there's nothing like visiting the Shrine, a Japanese cultural melting pot. Mushroom Shrine is a mythical place that serves the incomparable Mushroom God from ancient times.", - "If you desire to feel the heat of the tropics on an upbeat environment, the residents of Malaysia are eager to welcome you. Also, the metropolis itself is the heart of the local economy, that place is known to always offer something to do or to visit around."]; + "If you desire to feel the heat of the tropics on an upbeat environment, the residents of Malaysia are eager to welcome you. Also, the metropolis itself is the heart of the local economy, that place is known to always offer something to do or to visit around."]; var travelDescription2 = ["Check out the female shaman serving the Mushroom God, and I strongly recommend trying Takoyaki, Yakisoba, and other delocious food sold in the streets of Japan. Now, let's head over to #bMushroom Shrine#k, a mythical place if there ever was one.", - "Once there, I strongly suggest you to schedule a visit to Kampung Village. Why? Surely you've come to know about the fantasy theme park Spooky World? No? It's simply put the greatest theme park around there, it's worth a visit! Now, let's head over to the #bTrend Zone of Malaysia#k."]; + "Once there, I strongly suggest you to schedule a visit to Kampung Village. Why? Surely you've come to know about the fantasy theme park Spooky World? No? It's simply put the greatest theme park around there, it's worth a visit! Now, let's head over to the #bTrend Zone of Malaysia#k."]; var travelType; var travelStatus; function start() { travelStatus = getTravelingStatus(cm.getPlayer().getMapId()); - action(1,0,0); + action(1, 0, 0); } function getTravelingStatus(mapid) { - for(var i = 0; i < travelMap.length; i++) { - if(mapid == travelMap[i]) { + for (var i = 0; i < travelMap.length; i++) { + if (mapid == travelMap[i]) { return i; } } - + return -1; } function getTravelType(mapid) { - for(var i = 0; i < travelFrom.length; i++) { - if(mapid == travelFrom[i]) { + for (var i = 0; i < travelFrom.length; i++) { + if (mapid == travelFrom[i]) { return i; } } - + return 0; } function action(mode, type, selection) { status++; - if(mode != 1){ - if(mode == 0 && status == 4) + if (mode != 1) { + if (mode == 0 && status == 4) { status -= 2; - else{ + } else { cm.dispose(); return; } } - + if (travelStatus != -1) { - if (status == 0) + if (status == 0) { cm.sendSimple("How's the traveling? Are you enjoying it?#b\r\n#L0#Yes, I'm done with traveling. Can I go back to #m" + cm.getPlayer().peekSavedLocation("WORLDTOUR") + "#?\r\n#L1#No, I'd like to continue exploring this place."); - else if (status == 1) { + } else if (status == 1) { if (selection == 0) { cm.sendNext("Alright. I'll take you back to where you were before the visit to Japan. If you ever feel like traveling again down the road, please let me know!"); } else if (selection == 1) { @@ -88,8 +88,10 @@ function action(mode, type, selection) { } } else if (status == 2) { var map = cm.getPlayer().getSavedLocation("WORLDTOUR"); - if (map == -1) map = 104000000; - + if (map == -1) { + map = 104000000; + } + cm.warp(map); cm.dispose(); } @@ -102,7 +104,7 @@ function action(mode, type, selection) { } else if (status == 2) { cm.sendNext("Would you like to travel to #b" + travelPlace[travelType] + "#k? " + travelDescription[travelType]); } else if (status == 3) { - if(cm.getMeso() < travelFee[travelType]){ + if (cm.getMeso() < travelFee[travelType]) { cm.sendNext("You don't have enough mesos to take the travel."); cm.dispose(); return; diff --git a/scripts/npc/9000021.js b/scripts/npc/9000021.js index b2dd15c369..e68e385310 100644 --- a/scripts/npc/9000021.js +++ b/scripts/npc/9000021.js @@ -25,35 +25,36 @@ */ var status; - + function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { + } else { if (mode == 0 && type > 0) { cm.dispose(); return; } - - if (mode == 1) + + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { cm.sendNext("Hey, traveler! I am #p9000021#, and my job is to recruit travelers like you, who eagers for new challenges daily. Right now, my team is holding contests that thoroughly tests the mental and physical capabilities of adventurers like you."); - } else if(status == 1) { + } else if (status == 1) { cm.sendNext("These contests involve #bsequential boss fights#k, with some resting spots between some sections. These will require some strategy time and enough supplies at hand, as they are not common fights."); - } else if(status == 2) { + } else if (status == 2) { cm.sendAcceptDecline("If you feel you are powerful enough, you can join others like you at where we are hosting the contests of power. ... So, what is your decision? Will you come to where the contests are being held right now?"); - } else if(status == 3) { + } else if (status == 3) { cm.sendOk("Very well. Remember, there you can assemble a team or take on the fightings on your own, it's up to you. Good luck!"); - } else if(status == 4) { + } else if (status == 4) { cm.getPlayer().saveLocation("BOSSPQ"); cm.warp(970030000, "out00"); cm.dispose(); diff --git a/scripts/npc/9000021_old.js b/scripts/npc/9000021_old.js index 89c70b1442..97e7aa978b 100644 --- a/scripts/npc/9000021_old.js +++ b/scripts/npc/9000021_old.js @@ -7,10 +7,10 @@ var status = -1; var ask = "Oh, I see you've grown stronger! Do you wish to job advance?"; var job; -var koc = new Array(); +var koc = []; function start() { - cm.sendNext("Hey #e#h ##n, I'm the Aran & Cygnus Job Advancer."); + cm.sendNext("Hey #e#h ##n, I'm the Aran & Cygnus Job Advancer."); } function action(m, t, s) { @@ -20,24 +20,26 @@ function action(m, t, s) { return; } if (status == 0) { - if (cm.getJobId() < 1000 ||cm.getJobId() % 10 == 2) { + if (cm.getJobId() < 1000 || cm.getJobId() % 10 == 2) { cm.dispose(); } else if (cm.getJobId() % 10 == 1 && cm.getJobId() < 2000) { cm.dispose(); } else if (cm.getJobId() % 1000 == 0 && cm.getJobId() != 0 && cm.getLevel() >= 10) { if (cm.getJobId() == 1000) { - for (var i = 1; i < 6; i++) - koc.push(cm.getJobId() + 100 * i); + for (var i = 1; i < 6; i++) { + koc.push(cm.getJobId() + 100 * i); + } var list = "What class of Cygnus Knight do you wish to advance to?"; - for (var k = 0; k < koc.length; k++) - list += "\r\n#L" + k + "#" + cm.getJobName(koc[k]) + "#l"; + for (var k = 0; k < koc.length; k++) { + list += "\r\n#L" + k + "#" + cm.getJobName(koc[k]) + "#l"; + } cm.sendSimple(list); } else if (cm.getJobId() == 2000) { job = cm.getJobId() + 100; cm.sendYesNo(ask); + } else { + cm.dispose(); } - else - cm.dispose(); } else if (cm.getJobId() % 1000 != 0) { if (cm.getJobId() % 100 == 0 && cm.getLevel() >= 30) { job = cm.getJobId() + 10; diff --git a/scripts/npc/9000036.js b/scripts/npc/9000036.js index 73c6e933e9..575d9a3210 100644 --- a/scripts/npc/9000036.js +++ b/scripts/npc/9000036.js @@ -45,12 +45,13 @@ function start() { cm.dispose(); return; } - + cm.getPlayer().setCS(true); var selStr = "Hello, I am the #bAccessory NPC Crafter#k! My works are widely recognized to be too fine, up to the point at which all my items mimic not only the appearance but too the attributes of them! Everything I charge is some 'ingredients' to make them and, of course, a fee for my services. On what kind of equipment are you interessed?#b"; - var options = ["Pendants","Face accessories","Eye accessories","Belts & medals","Rings"/*,"#t4032496#"*/]; - for (var i = 0; i < options.length; i++) + var options = ["Pendants", "Face accessories", "Eye accessories", "Belts & medals", "Rings"/*,"#t4032496#"*/]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } cm.sendSimple(selStr); } @@ -63,44 +64,52 @@ function action(mode, type, selection) { if (status == 0) { if (selection == 0) { //pendants var selStr = "Well, I've got these pendants on my repertoire:#b"; - items = [1122018,1122007,1122001,1122003,1122004,1122006,1122002,1122005,1122058]; - for (var i = 0; i < items.length; i++) + items = [1122018, 1122007, 1122001, 1122003, 1122004, 1122006, 1122002, 1122005, 1122058]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##b"; - }else if (selection == 1) { //face accessory + } + } else if (selection == 1) { //face accessory var selStr = "Hmm, face accessories? There you go: #b"; - items = [1012181,1012182,1012183,1012184,1012185,1012186, 1012108, 1012109, 1012110, 1012111]; - for (var i = 0; i < items.length; i++) + items = [1012181, 1012182, 1012183, 1012184, 1012185, 1012186, 1012108, 1012109, 1012110, 1012111]; + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##b"; - }else if (selection == 2) { //eye accessory + } + } else if (selection == 2) { //eye accessory var selStr = "Got hard sight? Okay, so which glasses do you want me to make?#b"; items = [1022073, 1022088, 1022103, 1022089, 1022082]; - for (var i = 0; i < items.length; i++) + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##b"; - }else if (selection == 3) { //belt & medal + } + } else if (selection == 3) { //belt & medal var selStr = "Hmm... For these, things get a little tricky. Since these items are too short and too similar one another, I don't really know what item will emerge when I finish the synthesis. Still wanna try for something?"; items = []; maxEqp = 0; - - for (var x = 1132005; x < 1132017; maxEqp++, x++) + + for (var x = 1132005; x < 1132017; maxEqp++, x++) { items[maxEqp] = x; - - for (var x = 1142000; x < 1142102; maxEqp++, x++) + } + + for (var x = 1142000; x < 1142102; maxEqp++, x++) { items[maxEqp] = x; - - for (var x = 1142107; x < 1142121; maxEqp++, x++) + } + + for (var x = 1142107; x < 1142121; maxEqp++, x++) { items[maxEqp] = x; - - for (var x = 1142122; x < 1142143; maxEqp++, x++) - items[maxEqp] = x; + } + + for (var x = 1142122; x < 1142143; maxEqp++, x++) { + items[maxEqp] = x; + } selStr += "\r\n#L" + i + "##bTry it!#b"; - - }else if (selection == 4) { //ring refine + + } else if (selection == 4) { //ring refine var selStr = "Rings, huh? These are my specialty, go check it yourself!#b"; items = [1112407, 1112408, 1112401, 1112413, 1112414, 1112405, 1112402]; - - for (var i = 0; i < items.length; i++) + + for (var i = 0; i < items.length; i++) { selStr += "\r\n#L" + i + "##t" + items[i] + "##b"; - + } + }/*else if (selection == 5) { //make necklace var selStr = "Need to make #t4032496#?#b"; items = [4032496]; @@ -109,26 +118,28 @@ function action(mode, type, selection) { }*/ selectedType = selection; cm.sendSimple(selStr); - }else if (status == 1) { - if (selectedType != 3) selectedItem = selection; - + } else if (status == 1) { + if (selectedType != 3) { + selectedItem = selection; + } + if (selectedType == 0) { //pendant refine var matSet = [[4003004, 4030012, 4001356, 4000026], [4000026, 4001356, 4000073, 4001006], [4001343, 4011002, 4003004, 4003005], [4001343, 4011006, 4003004, 4003005], [4000091, 4011005, 4003004, 4003005], [4000091, 4011001, 4003004, 4003005], [4000469, 4011000, 4003004, 4003005], [4000469, 4011004, 4003004, 4003005], [1122007, 4003002, 4000413]]; var matQtySet = [[20, 20, 5, 1], [5, 5, 10, 1], [10, 2, 20, 4], [10, 1, 20, 4], [15, 3, 30, 6], [15, 3, 30, 6], [20, 5, 20, 8], [20, 4, 40, 8], [1, 1, 1]]; var costSet = [150000, 500000, 200000, 200000, 300000, 300000, 400000, 400000, 2500000]; - }else if (selectedType == 1) { //face accessory refine - var matSet = [[4006000, 4003004],[4006000, 4003004,4000026],[4006000, 4003004,4000026,4000082,4003002],[4006000, 4003005],[4006000, 4003005,4000026],[4006000, 4003005,4000026,4000082,4003002],[4001006, 4011008],[4001006, 4011008],[4001006, 4011008],[4001006, 4011008]]; - var matQtySet = [[5,5],[5,5,5],[5,5,5,5,1],[5,5],[5,5,5],[5,5,5,5,1],[1,1],[1,1],[1,1],[1,1]]; - var costSet = [100000,200000,300000,125000,250000,375000,500000,500000,500000,500000, 25000, 25000, 25000, 25000]; - }else if (selectedType == 2) { //eye accessory refine + } else if (selectedType == 1) { //face accessory refine + var matSet = [[4006000, 4003004], [4006000, 4003004, 4000026], [4006000, 4003004, 4000026, 4000082, 4003002], [4006000, 4003005], [4006000, 4003005, 4000026], [4006000, 4003005, 4000026, 4000082, 4003002], [4001006, 4011008], [4001006, 4011008], [4001006, 4011008], [4001006, 4011008]]; + var matQtySet = [[5, 5], [5, 5, 5], [5, 5, 5, 5, 1], [5, 5], [5, 5, 5], [5, 5, 5, 5, 1], [1, 1], [1, 1], [1, 1], [1, 1]]; + var costSet = [100000, 200000, 300000, 125000, 250000, 375000, 500000, 500000, 500000, 500000, 25000, 25000, 25000, 25000]; + } else if (selectedType == 2) { //eye accessory refine var matSet = [[4001006, 4003002, 4000082, 4031203], [4001005, 4011008], [4001005, 4011008], [4001005, 4011008, 4000082], [4001006, 4003002, 4003000, 4003001]]; var matQtySet = [[2, 2, 5, 10], [3, 2], [4, 3], [5, 3, 10], [2, 2, 10, 5]]; var costSet = [250000, 250000, 300000, 400000, 200000]; - }else if (selectedType == 3) { //belt & medals refine + } else if (selectedType == 3) { //belt & medals refine var matSet = [[4001006, 4003005, 4003004], [7777, 7777]]; var matQtySet = [[2, 5, 10], [7777, 7777]]; var costSet = [15000, 7777]; - }else if (selectedType == 4) { //ring refine + } else if (selectedType == 4) { //ring refine var matSet = [[4003001, 4001344, 4006000], [4003001, 4001344, 4006000], [4021004, 4011008], [4011008, 4001006], [1112413, 2022039], [1112414, 4000176], [4011007, 4021009]]; var matQtySet = [[2, 2, 2], [2, 2, 2], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1]]; var costSet = [10000, 10000, 10000, 20000, 15000, 15000, 10000]; @@ -137,60 +148,69 @@ function action(mode, type, selection) { var matQtySet = [[1, 1, 1]]; var costSet = [10000]; }*/ - + if (selectedType == 3) { selectedItem = Math.floor(Math.random() * maxEqp); item = items[selectedItem]; mats = matSet[0]; matQty = matQtySet[0]; cost = costSet[0]; - } - else { + } else { item = items[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - + var prompt = "You want me to make "; - if(selectedType != 3) { - if (qty == 1) + if (selectedType != 3) { + if (qty == 1) { prompt += "a #b#t" + item + "##k?"; - else + } else { prompt += "#b" + qty + " #t" + item + "##k?"; + } + } else { + prompt += "a #bbelt#k or a #bmedal#k?"; } - else prompt += "a #bbelt#k or a #bmedal#k?"; - + prompt += " Right! I will need some items to make that item. Make sure you have a #bfree slot#k in your inventory!#b"; - if (mats instanceof Array) - for(var i = 0; i < mats.length; i++) + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { prompt += "\r\n#i" + mats[i] + "# " + (matQty[i] * qty) + " #t" + mats[i] + "#"; - else + } + } else { prompt += "\r\n#i" + mats + "# " + (matQty * qty) + " #t" + mats + "#"; - if (cost > 0) + } + if (cost > 0) { prompt += "\r\n#i4031138# " + (cost * qty) + " meso"; + } cm.sendYesNo(prompt); - }else if (status == 2) { + } else if (status == 2) { if (cm.getMeso() < (cost * qty)) { cm.sendOk("This is the fee I charge to make my items! No credit."); } else { var complete = true; if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; - - if (!complete) + } + + if (!complete) { cm.sendOk("Are you sure you got all the items required? Double check it!"); - else { + } else { if (cm.canHold(item, qty)) { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++) + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -(matQty[i] * qty)); - } else + } + } else { cm.gainItem(mats, -(matQty * qty)); + } cm.gainMeso(-(cost * qty)); cm.gainItem(item, qty); @@ -199,8 +219,8 @@ function action(mode, type, selection) { cm.sendOk("You got no free slot on your inventory."); } } - } - + } + cm.dispose(); } } diff --git a/scripts/npc/9000037.js b/scripts/npc/9000037.js index 45e3fd9921..aca404f87d 100644 --- a/scripts/npc/9000037.js +++ b/scripts/npc/9000037.js @@ -23,7 +23,7 @@ * @npc: Agent Meow * @map: 970030000 - Hidden Street - Exclusive Training Center * @func: Boss Rush PQ -*/ + */ var status = 0; var state; @@ -39,146 +39,151 @@ function isFinalBossDone() { function detectTeamLobby(team) { var midLevel = 0; - - for(var i = 0; i < team.size(); i++) { + + for (var i = 0; i < team.size(); i++) { var player = team.get(i); midLevel += player.getLevel(); } midLevel = Math.floor(midLevel / team.size()); - + var lobby; // teams low level can be allocated at higher leveled lobbys - if(midLevel <= 20) lobby = 0; - else if(midLevel <= 40) lobby = 1; - else if(midLevel <= 60) lobby = 2; - else if(midLevel <= 80) lobby = 3; - else if(midLevel <= 90) lobby = 4; - else if(midLevel <= 100) lobby = 5; - else if(midLevel <= 110) lobby = 6; - else lobby = 7; - + if (midLevel <= 20) { + lobby = 0; + } else if (midLevel <= 40) { + lobby = 1; + } else if (midLevel <= 60) { + lobby = 2; + } else if (midLevel <= 80) { + lobby = 3; + } else if (midLevel <= 90) { + lobby = 4; + } else if (midLevel <= 100) { + lobby = 5; + } else if (midLevel <= 110) { + lobby = 6; + } else { + lobby = 7; + } + return lobby; } function start() { - status = -1; - state = (cm.getMapId() >= 970030001 && cm.getMapId() <= 970042711) ? (!onRestingSpot() ? (isFinalBossDone() ? 3 : 1) : 2) : 0; - action(1, 0, 0); + status = -1; + state = (cm.getMapId() >= 970030001 && cm.getMapId() <= 970042711) ? (!onRestingSpot() ? (isFinalBossDone() ? 3 : 1) : 2) : 0; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if(state == 3) { - if(cm.getEventInstance().getProperty("clear") == null) { - cm.getEventInstance().clearPQ(); - cm.getEventInstance().setProperty("clear", "true"); - } - - if(cm.isEventLeader()) { - cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now I will be handing your reward as you are being transported out..."); - } - else { - cm.sendOk("For #bdefeating all bosses#k in this instance, congratulations! You will now receive a prize that matches your performance here as I warp you out."); - } - } - else if(state == 2) { - if(cm.isEventLeader()) { - if(cm.getPlayer().getEventInstance().isEventTeamTogether()) { - cm.sendYesNo("Is your party ready to proceed to the next stages? Walk through the portal if you think you're done, the time is now.. Now, do you guys REALLY want to proceed?"); - } - else { - cm.sendOk("Please wait for your party to reassemble before proceeding."); - cm.dispose(); - return; - } - } - else { - cm.sendOk("Wait for your party leader to give me the signal to proceed. If you're not feeling too well and want to quit, walk through the portal and you will be transported out, and you will receive a prize for coming this far."); - cm.dispose(); - return; - } - } else if(state == 1) { - cm.sendYesNo("Do you wish to abandon this instance?"); - } - else { - em = cm.getEventManager("BossRushPQ"); - if(em == null) { - cm.sendOk("The Boss Rush PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to collaborate with party members to complete the expedition, or are you brave enough to take it on all by yourself? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } - } else if (status == 1) { - if(state == 3) { - if(!cm.getPlayer().getEventInstance().giveEventReward(cm.getPlayer(), 6)) { - cm.sendOk("Please arrange a slot in all tabs of your inventory beforehand."); - cm.dispose(); - return; - } - - cm.warp(970030000); - cm.dispose(); - } else if(state == 2) { - var restSpot = ((cm.getMapId() - 1) % 5) + 1; - cm.getPlayer().getEventInstance().restartEventTimer(restSpot * 4 * 60000); // adds (restspot number * 4) minutes - cm.getPlayer().getEventInstance().warpEventTeam(970030100 + cm.getEventInstance().getIntProperty("lobby") + (500 * restSpot)); - - cm.dispose(); - } else if(state == 1) { - cm.warp(970030000); - cm.dispose(); - } - else { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - var lobby = detectTeamLobby(eli), i; - for(i = lobby; i < 8; i++) { - if(em.startInstance(i, cm.getParty(), cm.getPlayer().getMap(), 1)) break; - } - - if(i == 8) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nBrave adventurers from all over the places travels here to test their skills and abilities in combat, as they face even more powerful bosses from MapleStory. Join forces with fellow adventurers or face all the burden by yourself and receive all the glory, it is up to you. REWARDS are given accordingly to how far the adventurers reach and extra prizes may are given to a random member of the party, all attributed at the end of an expedition.\r\n\r\nThis instance also supports #bmultiple lobbies for matchmaking several ranges of team levels#k at once: team up with players with lower level if you want better chances to swiftly set up a boss rush for your team."); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (state == 3) { + if (cm.getEventInstance().getProperty("clear") == null) { + cm.getEventInstance().clearPQ(); + cm.getEventInstance().setProperty("clear", "true"); + } + + if (cm.isEventLeader()) { + cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now I will be handing your reward as you are being transported out..."); + } else { + cm.sendOk("For #bdefeating all bosses#k in this instance, congratulations! You will now receive a prize that matches your performance here as I warp you out."); + } + } else if (state == 2) { + if (cm.isEventLeader()) { + if (cm.getPlayer().getEventInstance().isEventTeamTogether()) { + cm.sendYesNo("Is your party ready to proceed to the next stages? Walk through the portal if you think you're done, the time is now.. Now, do you guys REALLY want to proceed?"); + } else { + cm.sendOk("Please wait for your party to reassemble before proceeding."); + cm.dispose(); + + } + } else { + cm.sendOk("Wait for your party leader to give me the signal to proceed. If you're not feeling too well and want to quit, walk through the portal and you will be transported out, and you will receive a prize for coming this far."); + cm.dispose(); + + } + } else if (state == 1) { + cm.sendYesNo("Do you wish to abandon this instance?"); + } else { + em = cm.getEventManager("BossRushPQ"); + if (em == null) { + cm.sendOk("The Boss Rush PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to collaborate with party members to complete the expedition, or are you brave enough to take it on all by yourself? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } + } else if (status == 1) { + if (state == 3) { + if (!cm.getPlayer().getEventInstance().giveEventReward(cm.getPlayer(), 6)) { + cm.sendOk("Please arrange a slot in all tabs of your inventory beforehand."); + cm.dispose(); + return; + } + + cm.warp(970030000); + cm.dispose(); + } else if (state == 2) { + var restSpot = ((cm.getMapId() - 1) % 5) + 1; + cm.getPlayer().getEventInstance().restartEventTimer(restSpot * 4 * 60000); // adds (restspot number * 4) minutes + cm.getPlayer().getEventInstance().warpEventTeam(970030100 + cm.getEventInstance().getIntProperty("lobby") + (500 * restSpot)); + + cm.dispose(); + } else if (state == 1) { + cm.warp(970030000); + cm.dispose(); + } else { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + var lobby = detectTeamLobby(eli), i; + for (i = lobby; i < 8; i++) { + if (em.startInstance(i, cm.getParty(), cm.getPlayer().getMap(), 1)) { + break; + } + } + + if (i == 8) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nBrave adventurers from all over the places travels here to test their skills and abilities in combat, as they face even more powerful bosses from MapleStory. Join forces with fellow adventurers or face all the burden by yourself and receive all the glory, it is up to you. REWARDS are given accordingly to how far the adventurers reach and extra prizes may are given to a random member of the party, all attributed at the end of an expedition.\r\n\r\nThis instance also supports #bmultiple lobbies for matchmaking several ranges of team levels#k at once: team up with players with lower level if you want better chances to swiftly set up a boss rush for your team."); + cm.dispose(); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9000038.js b/scripts/npc/9000038.js index 55119f47d9..2853040a20 100644 --- a/scripts/npc/9000038.js +++ b/scripts/npc/9000038.js @@ -23,7 +23,7 @@ * @npc: Agent Kitty * @map: 970030000 - Hidden Street - Exclusive Training Center * @func: Boss Rush PQ Reward Announcer -*/ + */ var status; @@ -48,63 +48,66 @@ var itemQty_lv1 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 25, 25, 25, 25, var levels = ["#m970030001#", "#m970030002#", "#m970030003#", "#m970030004#", "#m970030005#", "Final stage"]; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - var sendStr = "The #bBoss Rush Party Quest#k rewards players accordingly to how far the team went on the boss huntings. Take note that each player #bcan only claim a reward if they leave through a portal inside a Resting Spot#k. Challenging stronger bosses will require the team to commit to more fightings until the next Resting Spot is reached, or until the final boss is defeated.\r\n\r\nThe possible rewards for those leaving in the selected Resting Spot are depicted here:\r\n\r\n#b"; - for(var i = 0; i < 6; i++) { - sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; - } - - cm.sendSimple(sendStr); - } else if(status == 1) { - var lvTarget, lvQty; - - if(selection == 0) { - lvTarget = itemSet_lv1; - lvQty = itemQty_lv1; - } else if(selection == 1) { - lvTarget = itemSet_lv2; - lvQty = itemQty_lv2; - } else if(selection == 2) { - lvTarget = itemSet_lv3; - lvQty = itemQty_lv3; - } else if(selection == 3) { - lvTarget = itemSet_lv4; - lvQty = itemQty_lv4; - } else if(selection == 4) { - lvTarget = itemSet_lv5; - lvQty = itemQty_lv5; - } else { - lvTarget = itemSet_lv6; - lvQty = itemQty_lv6; - } - - var sendStr = "The following items are being awarded at #b" + levels[selection] + "#k:\r\n\r\n"; - for(var i = 0; i < lvTarget.length; i++) { - sendStr += " #L" + i + "# #i" + lvTarget[i] + "# #t" + lvTarget[i] + "#"; - if(lvQty[i] > 1) sendStr += " (" + lvQty[i] + ")"; - sendStr += "#l\r\n"; - } - - cm.sendPrev(sendStr); - } else if(status == 2) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var sendStr = "The #bBoss Rush Party Quest#k rewards players accordingly to how far the team went on the boss huntings. Take note that each player #bcan only claim a reward if they leave through a portal inside a Resting Spot#k. Challenging stronger bosses will require the team to commit to more fightings until the next Resting Spot is reached, or until the final boss is defeated.\r\n\r\nThe possible rewards for those leaving in the selected Resting Spot are depicted here:\r\n\r\n#b"; + for (var i = 0; i < 6; i++) { + sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; + } + + cm.sendSimple(sendStr); + } else if (status == 1) { + var lvTarget, lvQty; + + if (selection == 0) { + lvTarget = itemSet_lv1; + lvQty = itemQty_lv1; + } else if (selection == 1) { + lvTarget = itemSet_lv2; + lvQty = itemQty_lv2; + } else if (selection == 2) { + lvTarget = itemSet_lv3; + lvQty = itemQty_lv3; + } else if (selection == 3) { + lvTarget = itemSet_lv4; + lvQty = itemQty_lv4; + } else if (selection == 4) { + lvTarget = itemSet_lv5; + lvQty = itemQty_lv5; + } else { + lvTarget = itemSet_lv6; + lvQty = itemQty_lv6; + } + + var sendStr = "The following items are being awarded at #b" + levels[selection] + "#k:\r\n\r\n"; + for (var i = 0; i < lvTarget.length; i++) { + sendStr += " #L" + i + "# #i" + lvTarget[i] + "# #t" + lvTarget[i] + "#"; + if (lvQty[i] > 1) { + sendStr += " (" + lvQty[i] + ")"; + } + sendStr += "#l\r\n"; + } + + cm.sendPrev(sendStr); + } else if (status == 2) { + cm.dispose(); + } + } } diff --git a/scripts/npc/9000040.js b/scripts/npc/9000040.js index 5f5c4bcf5e..7e84360c85 100644 --- a/scripts/npc/9000040.js +++ b/scripts/npc/9000040.js @@ -41,19 +41,20 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { const YamlConfig = Java.type('config.YamlConfig'); if (!YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { cm.sendOk("The medal ranking system is currently unavailable..."); cm.dispose(); return; } - + var levelLimit = !cm.getPlayer().isCygnus() ? 160 : 110; var selStr = "The medal ranking system is currently unavailable... Therefore, I am providing the #bEquipment Merge#k service! "; @@ -70,19 +71,19 @@ function action(mode, type, selection) { selStr += "For the fee of #r" + cm.numberWithCommas(mergeFee) + "#k mesos, merge unnecessary equipments in your inventory into your currently equipped gears to get stat boosts into them, statups based on the attributes of the items used on the merge!"; cm.sendNext(selStr); } - } else if(status == 1) { + } else if (status == 1) { selStr = "#rWARNING#b: Make sure you have your items ready to merge at the slots #rAFTER#b the item you have selected to merge.#k Any items #bunder#k the item selected will be merged thoroughly.\r\n\r\nNote that equipments receiving bonuses from merge are going to become #rUntradeable#k thereon, and equipments that already received the merge bonus #rcannot be used for merge#k.\r\n\r\n"; cm.sendGetText(selStr); - } else if(status == 2) { + } else if (status == 2) { name = cm.getText(); - + if (cm.getPlayer().mergeAllItemsFromName(name)) { cm.gainMeso(-mergeFee); cm.sendOk("Merging complete! Thanks for using the service and enjoy your new equipment stats."); } else { cm.sendOk("There is no #b'" + name + "'#k in your #bEQUIP#k inventory!"); } - + cm.dispose(); } } diff --git a/scripts/npc/9000041.js b/scripts/npc/9000041.js index 6437f55ebd..3b90cf41bc 100644 --- a/scripts/npc/9000041.js +++ b/scripts/npc/9000041.js @@ -24,14 +24,14 @@ * @author Ronan Lana */ -var options = ["EQUIP","USE","SET-UP","ETC"]; +var options = ["EQUIP", "USE", "SET-UP", "ETC"]; var name; var status; var selectedType = 0; function start() { status = -1; - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { @@ -48,24 +48,24 @@ function action(mode, type, selection) { cm.dispose(); return; } - + var selStr = "Hello, I am the #bBazaar NPC#k! Sell to me any item on your inventory you don't need. #rWARNING#b: Make sure you have your items ready to sell at the slots #rAFTER#b the item you have selected to sell.#k Any items #bunder#k the item selected will be sold thoroughly."; - for (var i = 0; i < options.length; i++) + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } cm.sendSimple(selStr); - } - - else if (status == 1) { - selectedType = selection; + } else if (status == 1) { + selectedType = selection; cm.sendGetText("From what item on your #r" + options[selectedType] + "#k inventory do you want to start the transaction?"); - } - - else if (status == 2) { + } else if (status == 2) { name = cm.getText(); - var res = cm.getPlayer().sellAllItemsFromName(selectedType + 1, name); + var res = cm.getPlayer().sellAllItemsFromName(selectedType + 1, name); - if(res > -1) cm.sendOk("Transaction complete! You received #r" + cm.numberWithCommas(res) + " mesos#k from this action."); - else cm.sendOk("There is no #b'" + name + "'#k in your #b" + options[selectedType] + "#k inventory!"); + if (res > -1) { + cm.sendOk("Transaction complete! You received #r" + cm.numberWithCommas(res) + " mesos#k from this action."); + } else { + cm.sendOk("There is no #b'" + name + "'#k in your #b" + options[selectedType] + "#k inventory!"); + } cm.dispose(); } diff --git a/scripts/npc/9000049.js b/scripts/npc/9000049.js index 5fd96ecaba..0c75772ccc 100644 --- a/scripts/npc/9000049.js +++ b/scripts/npc/9000049.js @@ -27,53 +27,60 @@ */ var status; -var stage = 1; - +var stage = 1; + function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - if(cm.getPlayer().isGM()) { - var event = "CLOSED"; - var stage = cm.getClient().getChannelServer().getStoredVar(9000049); - if(stage == 1) event = "EASY"; - if(stage == 2) event = "MEDIUM"; - if(stage == 3) event = "HARD"; - cm.sendSimple("Hello GM.\r\nThe event is currently: #r" + event + "#k\r\nWhat would you like to do?\r\n#b#L0#Enter the event#l\r\n#L1#Close the event#l\r\n#L2#Set the event to EASY#l\r\n#L3#Set the event to MEDIUM#l\r\n#L4#Set the event to HARD#l"); - } else { - var stage = cm.getClient().getChannelServer().getStoredVar(9000049); - if(stage == 0) { - cm.sendOk("It looks like the Tower isn't unlocked yet. Please wait for a GM to unlock it!"); - } else { - cm.warp(980040000 + stage * 1000, 0); - } - cm.dispose(); - } - } else if(status == 1 && cm.getPlayer().isGM()) { - if(selection == 0) { - var stage = cm.getClient().getChannelServer().getStoredVar(9000049); - if(stage == 0) { - cm.sendOk("It looks like the Tower isn't unlocked yet. Please wait for a GM to unlock it!"); - } else { - cm.warp(980040000 + stage * 1000, 0); - } - cm.dispose(); - return; - } - cm.getClient().getChannelServer().setStoredVar(9000049, selection - 1); - cm.dispose(); - } else { - cm.dispose(); - } + if (cm.getPlayer().isGM()) { + var event = "CLOSED"; + var stage = cm.getClient().getChannelServer().getStoredVar(9000049); + if (stage == 1) { + event = "EASY"; + } + if (stage == 2) { + event = "MEDIUM"; + } + if (stage == 3) { + event = "HARD"; + } + cm.sendSimple("Hello GM.\r\nThe event is currently: #r" + event + "#k\r\nWhat would you like to do?\r\n#b#L0#Enter the event#l\r\n#L1#Close the event#l\r\n#L2#Set the event to EASY#l\r\n#L3#Set the event to MEDIUM#l\r\n#L4#Set the event to HARD#l"); + } else { + var stage = cm.getClient().getChannelServer().getStoredVar(9000049); + if (stage == 0) { + cm.sendOk("It looks like the Tower isn't unlocked yet. Please wait for a GM to unlock it!"); + } else { + cm.warp(980040000 + stage * 1000, 0); + } + cm.dispose(); + } + } else if (status == 1 && cm.getPlayer().isGM()) { + if (selection == 0) { + var stage = cm.getClient().getChannelServer().getStoredVar(9000049); + if (stage == 0) { + cm.sendOk("It looks like the Tower isn't unlocked yet. Please wait for a GM to unlock it!"); + } else { + cm.warp(980040000 + stage * 1000, 0); + } + cm.dispose(); + return; + } + cm.getClient().getChannelServer().setStoredVar(9000049, selection - 1); + cm.dispose(); + } else { + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/9001102.js b/scripts/npc/9001102.js index 101c772a71..d94b25b13d 100644 --- a/scripts/npc/9001102.js +++ b/scripts/npc/9001102.js @@ -20,35 +20,36 @@ along with this program. If not, see . */ /** -* @Author : iAkira, Kevintjuh93 -**/ -var status = 0; + * @Author : iAkira, Kevintjuh93 + **/ +var status = 0; var selected = 0; function start() { - if (cm.getPlayer().getMapId() == 100000000) { - cm.sendNext("There! Did you see that? You didn't? A UFO just passed... there!! Look, someone is getting dragged into the UFO... arrrrrrgh, it's Gaga! #rGaga just got kidnapped by a UFO!#k"); - } + if (cm.getPlayer().getMapId() == 100000000) { + cm.sendNext("There! Did you see that? You didn't? A UFO just passed... there!! Look, someone is getting dragged into the UFO... arrrrrrgh, it's Gaga! #rGaga just got kidnapped by a UFO!#k"); + } } -function action(m,t,s) { - if (m > 0) { - status++; - if (cm.getPlayer().getMapId() == 100000000) { // warper completed - if (status == 1) { - if (cm.getPlayer().getLevel() >= 12) - cm.sendYesNo("What do we do now? It's just a rumor yet, but... I've heard that scary things happen to you if you get kidnapped by aliens... may be that's what happenning to Gaga right now! Please, please rescue Gaga! \r\n #bGaga may be a bit indetermined and clueless, but#k he has a really good heart. I can't let something terrible happen to him. Right! Grandpa from the moon might know how to rescue him! I will send you to the moon, so please go meet Grandpa and rescue Gaga!!!"); - else - cm.sendOk("Oh! It seems you don't reach the level requirements to save Gaga. Please come back when you are level 12 or higher."); - - } else if (status == 2) - cm.sendNext("Thank you so much. Please rescue Gaga! Grandpa from the moon will help you."); - else if (status == 3) { - cm.warp(922240200, 0); - cm.dispose(); - } - } - } else if (m < 1) { - cm.dispose(); - } +function action(m, t, s) { + if (m > 0) { + status++; + if (cm.getPlayer().getMapId() == 100000000) { // warper completed + if (status == 1) { + if (cm.getPlayer().getLevel() >= 12) { + cm.sendYesNo("What do we do now? It's just a rumor yet, but... I've heard that scary things happen to you if you get kidnapped by aliens... may be that's what happenning to Gaga right now! Please, please rescue Gaga! \r\n #bGaga may be a bit indetermined and clueless, but#k he has a really good heart. I can't let something terrible happen to him. Right! Grandpa from the moon might know how to rescue him! I will send you to the moon, so please go meet Grandpa and rescue Gaga!!!"); + } else { + cm.sendOk("Oh! It seems you don't reach the level requirements to save Gaga. Please come back when you are level 12 or higher."); + } + + } else if (status == 2) { + cm.sendNext("Thank you so much. Please rescue Gaga! Grandpa from the moon will help you."); + } else if (status == 3) { + cm.warp(922240200, 0); + cm.dispose(); + } + } + } else if (m < 1) { + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9001105.js b/scripts/npc/9001105.js index d648f068ee..fc69c4db24 100644 --- a/scripts/npc/9001105.js +++ b/scripts/npc/9001105.js @@ -1,77 +1,79 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - if (cm.getPlayer().getMapId() == 922240200) { - cm.sendOk("That's a shame, come back when your ready."); - } - - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if (cm.getMapId() == 922240200) { - cm.sendSimple("Did you have something to say...? #b\b\r\n#L0#I want to rescue Gaga.#l\r\n"); //#L1#I want to go to the Space Mine.#l - } else if (cm.getMapId() >= 922240000 && cm.getMapId() <= 922240019) { - cm.sendYesNo("Don't worry if you fail. You'll have 3 chances. Do you still want to give up?"); - } else if (cm.getMapId() >= 922240100 && cm.getMapId() <= 922240119) { - var text = "You went through so much trouble to rescue Gaga, but it looks like we're back to square one. "; - var rgaga = cm.getPlayer().getEvents().get("rescueGaga"); - if (rgaga.getCompleted() > 10) { - text += "Please don't give up until Gaga is rescued. To show you my appreciation for what you've accomplished thus far, I've given you a Spaceship. It's rather worn out, but it should still be operational. Check your #bSkill Window#k."; - rgaga.giveSkill(cm.getPlayer()); - } else - text += "Let's go back now."; + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + if (cm.getPlayer().getMapId() == 922240200) { + cm.sendOk("That's a shame, come back when your ready."); + } - cm.sendNext(text); - } - } else { - if (cm.getPlayer().getMapId() == 922240200) { - if (status == 1) { - if(selection == 0) { - selected = 1; - cm.sendNext("Welcome! I heard what happened from Baby Moon Bunny I'm glad you came since I was Planning on requesting some help. Gaga is a friend of mine who has helped me before and often stops by to say hello. Unfortunately, he was kidnapped by aliens."); - } else { - selected = 2; - cm.sendYesNo("At the Space Mine, you can find special ores called #bKrypto Crystals#k that contains the mysterious power of space. #bKrypto Crystals#l are usually emerald in color, but will turn brown if hit with the Spaceship's #bSpace Beam#k. Remember, in order to thwart this alien conspracy, #b10 Brown Krypto Crystal's and 10 Emerald Krypto Crystal's are needed. But since even #b1 Krypto Crystal#k can be of help, brign me as many as possible. Oh, and one more thing! The Space Mines are protected by the Space Mateons. They are extemely strong due to the power of the #Krypto Crystals#k, so don't try to defeat them. Simply concentrate on quickly collecting the crystals."); - } - } else if (status == 2) { - if(selected == 1) { - cm.sendYesNo("If we just leave Gaga with the aliens, something terrible will happen to him! I'll let you borrow a spaceship that the Moon Bunnies use for traveling so that you can rescue Gaga.#b Although he might appear a bit indecisive, slow, and immature at times#k, he's really a nice young man. Do you want to go rescue him now?"); - } else if(selected == 2) { - cm.sendOk("Not coded yet, f4."); - cm.dispose(); - } - } else if (status == 3) { - var em = cm.getEventManager("RescueGaga"); - if (em == null) { - cm.sendOk("This event is currently unavailable."); - } else if (!em.startInstance(cm.getPlayer())) { - cm.sendOk("There is currently someone in this map, come back later."); - } - - cm.dispose(); - } - } else if (cm.getPlayer().getMapId() >= 922240000 && cm.getPlayer().getMapId() <= 922240019) { - cm.warp(922240200, 0); - cm.dispose(); - } else if (cm.getPlayer().getMapId() >= 922240100 && cm.getPlayer().getMapId() <= 922240119) { - cm.warp(922240200, 0); - cm.dispose(); - } - } + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getMapId() == 922240200) { + cm.sendSimple("Did you have something to say...? #b\b\r\n#L0#I want to rescue Gaga.#l\r\n"); //#L1#I want to go to the Space Mine.#l + } else if (cm.getMapId() >= 922240000 && cm.getMapId() <= 922240019) { + cm.sendYesNo("Don't worry if you fail. You'll have 3 chances. Do you still want to give up?"); + } else if (cm.getMapId() >= 922240100 && cm.getMapId() <= 922240119) { + var text = "You went through so much trouble to rescue Gaga, but it looks like we're back to square one. "; + var rgaga = cm.getPlayer().getEvents().get("rescueGaga"); + if (rgaga.getCompleted() > 10) { + text += "Please don't give up until Gaga is rescued. To show you my appreciation for what you've accomplished thus far, I've given you a Spaceship. It's rather worn out, but it should still be operational. Check your #bSkill Window#k."; + rgaga.giveSkill(cm.getPlayer()); + } else { + text += "Let's go back now."; + } + + cm.sendNext(text); + } + } else { + if (cm.getPlayer().getMapId() == 922240200) { + if (status == 1) { + if (selection == 0) { + selected = 1; + cm.sendNext("Welcome! I heard what happened from Baby Moon Bunny I'm glad you came since I was Planning on requesting some help. Gaga is a friend of mine who has helped me before and often stops by to say hello. Unfortunately, he was kidnapped by aliens."); + } else { + selected = 2; + cm.sendYesNo("At the Space Mine, you can find special ores called #bKrypto Crystals#k that contains the mysterious power of space. #bKrypto Crystals#l are usually emerald in color, but will turn brown if hit with the Spaceship's #bSpace Beam#k. Remember, in order to thwart this alien conspracy, #b10 Brown Krypto Crystal's and 10 Emerald Krypto Crystal's are needed. But since even #b1 Krypto Crystal#k can be of help, brign me as many as possible. Oh, and one more thing! The Space Mines are protected by the Space Mateons. They are extemely strong due to the power of the #Krypto Crystals#k, so don't try to defeat them. Simply concentrate on quickly collecting the crystals."); + } + } else if (status == 2) { + if (selected == 1) { + cm.sendYesNo("If we just leave Gaga with the aliens, something terrible will happen to him! I'll let you borrow a spaceship that the Moon Bunnies use for traveling so that you can rescue Gaga.#b Although he might appear a bit indecisive, slow, and immature at times#k, he's really a nice young man. Do you want to go rescue him now?"); + } else if (selected == 2) { + cm.sendOk("Not coded yet, f4."); + cm.dispose(); + } + } else if (status == 3) { + var em = cm.getEventManager("RescueGaga"); + if (em == null) { + cm.sendOk("This event is currently unavailable."); + } else if (!em.startInstance(cm.getPlayer())) { + cm.sendOk("There is currently someone in this map, come back later."); + } + + cm.dispose(); + } + } else if (cm.getPlayer().getMapId() >= 922240000 && cm.getPlayer().getMapId() <= 922240019) { + cm.warp(922240200, 0); + cm.dispose(); + } else if (cm.getPlayer().getMapId() >= 922240100 && cm.getPlayer().getMapId() <= 922240119) { + cm.warp(922240200, 0); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9010001.js b/scripts/npc/9010001.js index 1524ce2db3..a9cf6ced28 100644 --- a/scripts/npc/9010001.js +++ b/scripts/npc/9010001.js @@ -4,6 +4,6 @@ function start() { } function action(mode, type, selection) { - cm.sendNext("Hi, I'm #p9010001#."); - cm.dispose(); + cm.sendNext("Hi, I'm #p9010001#."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9010002.js b/scripts/npc/9010002.js index d52b10c883..ff1c6954af 100644 --- a/scripts/npc/9010002.js +++ b/scripts/npc/9010002.js @@ -4,6 +4,6 @@ function start() { } function action(mode, type, selection) { - cm.sendNext("Hi, I'm #p9010002#."); - cm.dispose(); + cm.sendNext("Hi, I'm #p9010002#."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9010003.js b/scripts/npc/9010003.js index 1392ab4c85..30734f77ff 100644 --- a/scripts/npc/9010003.js +++ b/scripts/npc/9010003.js @@ -4,6 +4,6 @@ function start() { } function action(mode, type, selection) { - cm.sendNext("Hi, I'm #p9010003#."); - cm.dispose(); + cm.sendNext("Hi, I'm #p9010003#."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9010004.js b/scripts/npc/9010004.js index 92572d934e..29ede2f60c 100644 --- a/scripts/npc/9010004.js +++ b/scripts/npc/9010004.js @@ -4,6 +4,6 @@ function start() { } function action(mode, type, selection) { - cm.sendNext("Hi, I'm #p9010004#."); - cm.dispose(); + cm.sendNext("Hi, I'm #p9010004#."); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9010021.js b/scripts/npc/9010021.js index 8899b84e00..8c6555c461 100644 --- a/scripts/npc/9010021.js +++ b/scripts/npc/9010021.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* 9010021 - Wolf Spirit Ryko @author Ronan @author wejrox diff --git a/scripts/npc/9010022.js b/scripts/npc/9010022.js index f4718a16d4..72a8ea9538 100644 --- a/scripts/npc/9010022.js +++ b/scripts/npc/9010022.js @@ -1,45 +1,45 @@ - -var status; -var sel; +var status; +var sel; -function start() { - status = -1; - action(1, 0, 0); -} +function start() { + status = -1; + action(1, 0, 0); +} -function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if (status == 0) { - if (cm.getLevel() < 20) { - cm.sendDimensionalMirror("#-1# There is no place for you to transport to from here."); - cm.dispose(); - } else { - var selStr = ""; +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + if (cm.getLevel() < 20) { + cm.sendDimensionalMirror("#-1# There is no place for you to transport to from here."); + cm.dispose(); + } else { + var selStr = ""; if (cm.getLevel() >= 20 && cm.getLevel() <= 30) { - selStr += "#0# Ariant Coliseum"; + selStr += "#0# Ariant Coliseum"; } - if (cm.getLevel() >= 25) { - selStr += "#1# Mu Lung Dojo"; - } + if (cm.getLevel() >= 25) { + selStr += "#1# Mu Lung Dojo"; + } if (cm.getLevel() >= 30 && cm.getLevel() <= 50) { // MC 1 & 2 recalled thanks to --- - selStr += "#2# Monster Carnival 1"; - } + selStr += "#2# Monster Carnival 1"; + } if (cm.getLevel() >= 51 && cm.getLevel() <= 70) { - selStr += "#3# Monster Carnival 2"; - } + selStr += "#3# Monster Carnival 2"; + } /* if (cm.getLevel() >= 40) { NOT IMPLEMENTED @@ -50,34 +50,34 @@ function action(mode, type, selection) { selStr += "#6# Construction Site"; } */ - - cm.sendDimensionalMirror(selStr); - } - } else if (status == 1) { - cm.getPlayer().saveLocation("MIRROR"); - switch (selection) { - case 0: - cm.warp(980010000, 3); - break; - case 1: - cm.warp(925020000, 0); - break; - case 2: - cm.getPlayer().saveLocation("MONSTER_CARNIVAL"); - cm.warp(980000000, 3); - break; - case 3: - cm.getPlayer().saveLocation("MONSTER_CARNIVAL"); - cm.warp(980030000, 3); - break; - case 5: - cm.warp(926010000, 4); - break; - case 6: + + cm.sendDimensionalMirror(selStr); + } + } else if (status == 1) { + cm.getPlayer().saveLocation("MIRROR"); + switch (selection) { + case 0: + cm.warp(980010000, 3); + break; + case 1: + cm.warp(925020000, 0); + break; + case 2: + cm.getPlayer().saveLocation("MONSTER_CARNIVAL"); + cm.warp(980000000, 3); + break; + case 3: + cm.getPlayer().saveLocation("MONSTER_CARNIVAL"); + cm.warp(980030000, 3); + break; + case 5: + cm.warp(926010000, 4); + break; + case 6: cm.warp(910320000, 2); - break; - } - cm.dispose(); - } - } + break; + } + cm.dispose(); + } + } } diff --git a/scripts/npc/9010022_old.js b/scripts/npc/9010022_old.js index 8a9e49bdbf..841ef02f0c 100644 --- a/scripts/npc/9010022_old.js +++ b/scripts/npc/9010022_old.js @@ -1,78 +1,78 @@ +var status; +var sel; -var status; -var sel; +function start() { + status = -1; + action(1, 0, 0); +} -function start() { - status = -1; - action(1, 0, 0); -} +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + if (cm.getLevel() < 20) { + cm.sendDimensionalMirror("#-1# There is no place for you to transport to from here."); + cm.dispose(); + } else { + var selStr = ""; + if (cm.getLevel() >= 20 && cm.getLevel() <= 30) { + selStr += "#0# Ariant Coliseum"; + } -function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - if (status == 0) { - if (cm.getLevel() < 20) { - cm.sendDimensionalMirror("#-1# There is no place for you to transport to from here."); - cm.dispose(); - } else { - var selStr = ""; - if (cm.getLevel() >= 20 && cm.getLevel() <= 30) { - selStr += "#0# Ariant Coliseum"; - } + if (cm.getLevel() >= 25) { + selStr += "#1# Mu Lung Dojo"; + } - if (cm.getLevel() >= 25) { - selStr += "#1# Mu Lung Dojo"; - } + if (cm.getLevel() >= 30 && cm.getLevel() <= 50) { + selStr += "#2# Monster Carnival 1"; + } - if (cm.getLevel() >= 30 && cm.getLevel() <= 50) { - selStr += "#2# Monster Carnival 1"; - } + if (cm.getLevel() >= 51 && cm.getLevel() <= 70) { + selStr += "#3# Monster Carnival 2"; + } - if (cm.getLevel() >= 51 && cm.getLevel() <= 70) { - selStr += "#3# Monster Carnival 2"; - } + if (cm.getLevel() >= 40) { + selStr += "#5# Nett's Pyramid"; + } - if (cm.getLevel() >= 40) { - selStr += "#5# Nett's Pyramid"; - } - - if (cm.getLevel() >= 25 && cm.getLevel() <= 30) { - selStr += "#6# Construction Site"; - } - cm.sendDimensionalMirror(selStr); - } - } else if (status == 1) { - cm.getPlayer().saveLocation("MIRROR"); - switch (selection) { - case 0: - cm.warp(980010000, 3); - break; - case 1: - cm.warp(925020000, 0); - break; - case 2: - cm.warp(980000000, 3); - break; - case 3: - cm.warp(980030000, 3); - break; - case 5: - cm.warp(926010000, 4); - break; - case 6: + if (cm.getLevel() >= 25 && cm.getLevel() <= 30) { + selStr += "#6# Construction Site"; + } + cm.sendDimensionalMirror(selStr); + } + } else if (status == 1) { + cm.getPlayer().saveLocation("MIRROR"); + switch (selection) { + case 0: + cm.warp(980010000, 3); + break; + case 1: + cm.warp(925020000, 0); + break; + case 2: + cm.warp(980000000, 3); + break; + case 3: + cm.warp(980030000, 3); + break; + case 5: + cm.warp(926010000, 4); + break; + case 6: cm.warp(910320000, 2); - break; - } - cm.dispose(); - } - } + break; + } + cm.dispose(); + } + } } diff --git a/scripts/npc/9020000.js b/scripts/npc/9020000.js index 74eae3bbae..49c4ed3056 100644 --- a/scripts/npc/9020000.js +++ b/scripts/npc/9020000.js @@ -23,82 +23,80 @@ * @npc: Lakelis * @map: 103000000 - Kerning City * @func: Kerning PQ -*/ + */ var status = 0; var state; var em = null; function start() { - status = -1; - state = (cm.getMapId() >= 103000800 && cm.getMapId() <= 103000805) ? 1 : 0; - action(1, 0, 0); + status = -1; + state = (cm.getMapId() >= 103000800 && cm.getMapId() <= 103000805) ? 1 : 0; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if(state == 1) { - cm.sendYesNo("Do you wish to abandon this area?"); - } - else { - em = cm.getEventManager("KerningPQ"); - if(em == null) { - cm.sendOk("The Kerning PQ has encountered an error."); - cm.dispose(); - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } - } else if (status == 1) { - if(state == 1) { - cm.warp(103000000); - cm.dispose(); - } - else { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nYour party must pass through many obstacles and puzzles while traversing the sub-objectives of this Party Quest. Coordinate with your team in order to further advance and defeat the final boss and collect the dropped item in order to access the rewards and bonus stage."); - cm.dispose(); - } - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (state == 1) { + cm.sendYesNo("Do you wish to abandon this area?"); + } else { + em = cm.getEventManager("KerningPQ"); + if (em == null) { + cm.sendOk("The Kerning PQ has encountered an error."); + cm.dispose(); + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } + } else if (status == 1) { + if (state == 1) { + cm.warp(103000000); + cm.dispose(); + } else { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nYour party must pass through many obstacles and puzzles while traversing the sub-objectives of this Party Quest. Coordinate with your team in order to further advance and defeat the final boss and collect the dropped item in order to access the rewards and bonus stage."); + cm.dispose(); + } + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9020001.js b/scripts/npc/9020001.js index 78ebb34276..32adc9bf46 100644 --- a/scripts/npc/9020001.js +++ b/scripts/npc/9020001.js @@ -25,7 +25,7 @@ * @npc: Cloto * @map: 1st Accompaniment - KPQ * @func: Kerning PQ -*/ + */ var stage1Questions = Array( "Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as warrior.", @@ -38,49 +38,50 @@ var stage1Questions = Array( var stage1Answers = Array(10, 35, 20, 25, 25, 30, 8); const Rectangle = Java.type('java.awt.Rectangle'); -var stage2Rects = Array(new Rectangle(-755,-132,4,218),new Rectangle(-721,-340,4,166),new Rectangle(-586,-326,4,150),new Rectangle(-483,-181,4,222)); -var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,140,45), - new Rectangle(958,-180,140,50),new Rectangle(876,-238,140,45), - new Rectangle(702,-238,140,45)); -var stage4Rects = Array(new Rectangle(910,-236,35,5),new Rectangle(877,-184,35,5), - new Rectangle(946,-184,35,5),new Rectangle(845,-132,35,5), - new Rectangle(910,-132,35,5),new Rectangle(981,-132,35,5)); - -var stage2Combos = Array(Array(0,1,1,1),Array(1,0,1,1),Array(1,1,0,1),Array(1,1,1,0)); -var stage3Combos = Array(Array(0,0,1,1,1),Array(0,1,0,1,1),Array(0,1,1,0,1), - Array(0,1,1,1,0),Array(1,0,0,1,1),Array(1,0,1,0,1), - Array(1,0,1,1,0),Array(1,1,0,0,1),Array(1,1,0,1,0), - Array(1,1,1,0,0)); -var stage4Combos = Array(Array(0,0,0,1,1,1),Array(0,0,1,0,1,1),Array(0,0,1,1,0,1), - Array(0,0,1,1,1,0),Array(0,1,0,0,1,1),Array(0,1,0,1,0,1), - Array(0,1,0,1,1,0),Array(0,1,1,0,0,1),Array(0,1,1,0,1,0), - Array(0,1,1,1,0,0),Array(1,0,0,0,1,1),Array(1,0,0,1,0,1), - Array(1,0,0,1,1,0),Array(1,0,1,0,0,1),Array(1,0,1,0,1,0), - Array(1,0,1,1,0,0),Array(1,1,0,0,0,1),Array(1,1,0,0,1,0), - Array(1,1,0,1,0,0),Array(1,1,1,0,0,0)); +var stage2Rects = Array(new Rectangle(-755, -132, 4, 218), new Rectangle(-721, -340, 4, 166), new Rectangle(-586, -326, 4, 150), new Rectangle(-483, -181, 4, 222)); +var stage3Rects = Array(new Rectangle(608, -180, 140, 50), new Rectangle(791, -117, 140, 45), + new Rectangle(958, -180, 140, 50), new Rectangle(876, -238, 140, 45), + new Rectangle(702, -238, 140, 45)); +var stage4Rects = Array(new Rectangle(910, -236, 35, 5), new Rectangle(877, -184, 35, 5), + new Rectangle(946, -184, 35, 5), new Rectangle(845, -132, 35, 5), + new Rectangle(910, -132, 35, 5), new Rectangle(981, -132, 35, 5)); + +var stage2Combos = Array(Array(0, 1, 1, 1), Array(1, 0, 1, 1), Array(1, 1, 0, 1), Array(1, 1, 1, 0)); +var stage3Combos = Array(Array(0, 0, 1, 1, 1), Array(0, 1, 0, 1, 1), Array(0, 1, 1, 0, 1), + Array(0, 1, 1, 1, 0), Array(1, 0, 0, 1, 1), Array(1, 0, 1, 0, 1), + Array(1, 0, 1, 1, 0), Array(1, 1, 0, 0, 1), Array(1, 1, 0, 1, 0), + Array(1, 1, 1, 0, 0)); +var stage4Combos = Array(Array(0, 0, 0, 1, 1, 1), Array(0, 0, 1, 0, 1, 1), Array(0, 0, 1, 1, 0, 1), + Array(0, 0, 1, 1, 1, 0), Array(0, 1, 0, 0, 1, 1), Array(0, 1, 0, 1, 0, 1), + Array(0, 1, 0, 1, 1, 0), Array(0, 1, 1, 0, 0, 1), Array(0, 1, 1, 0, 1, 0), + Array(0, 1, 1, 1, 0, 0), Array(1, 0, 0, 0, 1, 1), Array(1, 0, 0, 1, 0, 1), + Array(1, 0, 0, 1, 1, 0), Array(1, 0, 1, 0, 0, 1), Array(1, 0, 1, 0, 1, 0), + Array(1, 0, 1, 1, 0, 0), Array(1, 1, 0, 0, 0, 1), Array(1, 1, 0, 0, 1, 0), + Array(1, 1, 0, 1, 0, 0), Array(1, 1, 1, 0, 0, 0)); function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); eim.showClearEffect(true); - + eim.linkToNextStage(stage, "kpq", curMap); //opens the portal to the next map } function rectangleStages(eim, property, areaCombos, areaRects) { var c = eim.getProperty(property); - if(c == null) { + if (c == null) { c = Math.floor(Math.random() * areaCombos.length); eim.setProperty(property, c.toString()); + } else { + c = parseInt(c); } - else c = parseInt(c); - + // get player placement var players = eim.getPlayers(); - var playerPlacement = new Array(0, 0, 0, 0, 0, 0); + var playerPlacement = [0, 0, 0, 0, 0, 0]; - for(var i = 0; i < eim.getPlayerCount(); i++) { - for(var j = 0; j < areaRects.length; j++) { - if(areaRects[j].contains(players.get(i).getPosition())) { + for (var i = 0; i < eim.getPlayerCount(); i++) { + for (var j = 0; j < areaRects.length; j++) { + if (areaRects[j].contains(players.get(i).getPosition())) { playerPlacement[j] += 1; break; } @@ -89,13 +90,13 @@ function rectangleStages(eim, property, areaCombos, areaRects) { var curCombo = areaCombos[c]; var accept = true; - for(var j = 0; j < curCombo.length; j++) { - if(curCombo[j] != playerPlacement[j]) { + for (var j = 0; j < curCombo.length; j++) { + if (curCombo[j] != playerPlacement[j]) { accept = false; break; } } - + return accept; } @@ -103,194 +104,180 @@ var status = -1; var eim; function start() { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { - eim = cm.getEventInstance(); - - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - var curMap = cm.getMapId(); - var stage = curMap - 103000800 + 1; - if(eim.getProperty(stage.toString() + "stageclear") != null) { - if(stage < 5) { - cm.sendNext("Please hurry on to the next stage, the portal opened!"); - cm.dispose(); - } - else { - cm.sendNext("Incredible! You cleared all the stages to get to this point. Here's a small prize for your job well done. Before you accept it, however, please make sure your use and etc. inventories have empty slots available."); - } - } - else if(curMap == 103000800) { // stage 1 - if(cm.isEventLeader()) { - var numpasses = eim.getPlayerCount() - 1; // minus leader + eim = cm.getEventInstance(); - if(cm.hasItem(4001008, numpasses)) { - cm.sendNext("You gathered up " + numpasses + " passes! Congratulations on clearing the stage! I'll make the portal that sends you to the next stage. There's a time limit on getting there, so please hurry. Best of luck to you all!"); - clearStage(stage, eim, curMap); - eim.gridClear(); - cm.gainItem(4001008, -numpasses); - } - else { - cm.sendNext("I'm sorry, but you are short on the number of passes. You need to give me the right number of passes; it should be the number of members of your party minus the leader, in this case the total of " + numpasses + " to clear the stage. Tell your party members to solve the questions, gather up the passes, and give them to you."); - } - } - else { - var data = eim.gridCheck(cm.getPlayer()); - - if(data == 0) { - cm.sendNext("Thanks for bringing me the coupons. Please hand the pass to your party leader to continue."); - } else if(data == -1) { - data = Math.floor(Math.random() * stage1Questions.length) + 1; //data will be counted from 1 - eim.gridInsert(cm.getPlayer(), data); - - var question = stage1Questions[data - 1]; - cm.sendNext(question); - } else { - var answer = stage1Answers[data - 1]; - - if(cm.itemQuantity(4001007) == answer) { - cm.sendNext("That's the right answer! For that you have just received a #bpass#k. Please hand it to the leader of the party."); - cm.gainItem(4001007, -answer); - cm.gainItem(4001008, 1); - eim.gridInsert(cm.getPlayer(), 0); - } - else { - var question = stage1Questions[eim.gridCheck(cm.getPlayer()) - 1]; - cm.sendNext("I'm sorry, but that is not the right answer!\r\n" + question); - } - } - } - - cm.dispose(); - } else if(curMap == 103000801) { // stage 2 - var stgProperty = "stg2Property"; - var stgCombos = stage2Combos; - var stgAreas = stage2Rects; - - var nthtext = "2nd", nthobj = "ropes", nthverb = "hang", nthpos = "hang on the ropes too low"; - var nextStgId = 103000802; - - if(!eim.isEventLeader(cm.getPlayer())) { - cm.sendOk("Follow the instructions given by your party leader to proceed through this stage."); - } - else if(eim.getProperty(stgProperty) == null) { - cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!"); - var c = Math.floor(Math.random() * stgCombos.length); - eim.setProperty(stgProperty, c.toString()); - } - else { - var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas); - - if(accept) { - clearStage(stage, eim, curMap); - cm.sendNext("Please hurry on to the next stage, the portal opened!"); - } - else { - eim.showWrongEffect(); - cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!"); - } - } - - cm.dispose(); - } else if(curMap == 103000802) { - var stgProperty = "stg3Property"; - var stgCombos = stage3Combos; - var stgAreas = stage3Rects; - - var nthtext = "3rd", nthobj = "platforms", nthverb = "stand", nthpos = "stand too close to the edges"; - var nextStgId = 103000803; - - if(!eim.isEventLeader(cm.getPlayer())) { - cm.sendOk("Follow the instructions given by your party leader to proceed through this stage."); - } - else if(eim.getProperty(stgProperty) == null) { - cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!"); - var c = Math.floor(Math.random() * stgCombos.length); - eim.setProperty(stgProperty, c.toString()); - } - else { - var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas); - - if(accept) { - clearStage(stage, eim, curMap); - cm.sendNext("Please hurry on to the next stage, the portal opened!"); - } - else { - eim.showWrongEffect(); - cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!"); - } - } - - cm.dispose(); - } else if(curMap == 103000803) { - var stgProperty = "stg4Property"; - var stgCombos = stage4Combos; - var stgAreas = stage4Rects; - - var nthtext = "4th", nthobj = "barrels", nthverb = "stand", nthpos = "stand too close to the edges"; - var nextStgId = 103000804; - - if(!eim.isEventLeader(cm.getPlayer())) { - cm.sendOk("Follow the instructions given by your party leader to proceed through this stage."); - } - else if(eim.getProperty(stgProperty) == null) { - cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!"); - var c = Math.floor(Math.random() * stgCombos.length); - eim.setProperty(stgProperty, c.toString()); - } - else { - var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas); - - if(accept) { - clearStage(stage, eim, curMap); - cm.sendNext("Please hurry on to the next stage, the portal opened!"); - } - else { - eim.showWrongEffect(); - cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!"); - } - } - - cm.dispose(); - } else if(curMap == 103000804) { - if (eim.isEventLeader(cm.getPlayer())) { - if (cm.haveItem(4001008, 10)) { - cm.sendNext("Here's the portal that leads you to the last, bonus stage. It's a stage that allows you to defeat regular monsters a little easier. You'll be given a set amount of time to hunt as much as possible, but you can always leave the stage in the middle of it through the NPC. Again, congratulations on clearing all the stages. Let your party talk to me to receive their prizes as they are allowed to pass to the bonus stage. Take care..."); - cm.gainItem(4001008, -10); - - clearStage(stage, eim, curMap); - eim.clearPQ(); - } else { - cm.sendNext("Hello. Welcome to the 5th and final stage. Walk around the map and you'll be able to find some Boss monsters. Defeat all of them, gather up #bthe passes#k, and please get them to me. Once you earn your pass, the leader of your party will collect them, and then get them to me once the #bpasses#k are gathered up. The monsters may be familiar to you, but they may be much stronger than you think, so please be careful. Good luck!"); - } - } else { - cm.sendNext("Welcome to the 5th and final stage. Walk around the map and you will be able to find some Boss monsters. Defeat them all, gather up the #bpasses#k, and #bgive them to your leader#k. Once you are done, return to me to collect your reward."); - } - - cm.dispose(); - } - } - else if (status == 1) { - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendNext("Please make room on your inventory first!"); - } else { - cm.warp(103000805, "st00"); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var curMap = cm.getMapId(); + var stage = curMap - 103000800 + 1; + if (eim.getProperty(stage.toString() + "stageclear") != null) { + if (stage < 5) { + cm.sendNext("Please hurry on to the next stage, the portal opened!"); + cm.dispose(); + } else { + cm.sendNext("Incredible! You cleared all the stages to get to this point. Here's a small prize for your job well done. Before you accept it, however, please make sure your use and etc. inventories have empty slots available."); + } + } else if (curMap == 103000800) { // stage 1 + if (cm.isEventLeader()) { + var numpasses = eim.getPlayerCount() - 1; // minus leader + + if (cm.hasItem(4001008, numpasses)) { + cm.sendNext("You gathered up " + numpasses + " passes! Congratulations on clearing the stage! I'll make the portal that sends you to the next stage. There's a time limit on getting there, so please hurry. Best of luck to you all!"); + clearStage(stage, eim, curMap); + eim.gridClear(); + cm.gainItem(4001008, -numpasses); + } else { + cm.sendNext("I'm sorry, but you are short on the number of passes. You need to give me the right number of passes; it should be the number of members of your party minus the leader, in this case the total of " + numpasses + " to clear the stage. Tell your party members to solve the questions, gather up the passes, and give them to you."); + } + } else { + var data = eim.gridCheck(cm.getPlayer()); + + if (data == 0) { + cm.sendNext("Thanks for bringing me the coupons. Please hand the pass to your party leader to continue."); + } else if (data == -1) { + data = Math.floor(Math.random() * stage1Questions.length) + 1; //data will be counted from 1 + eim.gridInsert(cm.getPlayer(), data); + + var question = stage1Questions[data - 1]; + cm.sendNext(question); + } else { + var answer = stage1Answers[data - 1]; + + if (cm.itemQuantity(4001007) == answer) { + cm.sendNext("That's the right answer! For that you have just received a #bpass#k. Please hand it to the leader of the party."); + cm.gainItem(4001007, -answer); + cm.gainItem(4001008, 1); + eim.gridInsert(cm.getPlayer(), 0); + } else { + var question = stage1Questions[eim.gridCheck(cm.getPlayer()) - 1]; + cm.sendNext("I'm sorry, but that is not the right answer!\r\n" + question); + } + } + } + + cm.dispose(); + } else if (curMap == 103000801) { // stage 2 + var stgProperty = "stg2Property"; + var stgCombos = stage2Combos; + var stgAreas = stage2Rects; + + var nthtext = "2nd", nthobj = "ropes", nthverb = "hang", nthpos = "hang on the ropes too low"; + var nextStgId = 103000802; + + if (!eim.isEventLeader(cm.getPlayer())) { + cm.sendOk("Follow the instructions given by your party leader to proceed through this stage."); + } else if (eim.getProperty(stgProperty) == null) { + cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!"); + var c = Math.floor(Math.random() * stgCombos.length); + eim.setProperty(stgProperty, c.toString()); + } else { + var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas); + + if (accept) { + clearStage(stage, eim, curMap); + cm.sendNext("Please hurry on to the next stage, the portal opened!"); + } else { + eim.showWrongEffect(); + cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!"); + } + } + + cm.dispose(); + } else if (curMap == 103000802) { + var stgProperty = "stg3Property"; + var stgCombos = stage3Combos; + var stgAreas = stage3Rects; + + var nthtext = "3rd", nthobj = "platforms", nthverb = "stand", nthpos = "stand too close to the edges"; + var nextStgId = 103000803; + + if (!eim.isEventLeader(cm.getPlayer())) { + cm.sendOk("Follow the instructions given by your party leader to proceed through this stage."); + } else if (eim.getProperty(stgProperty) == null) { + cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!"); + var c = Math.floor(Math.random() * stgCombos.length); + eim.setProperty(stgProperty, c.toString()); + } else { + var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas); + + if (accept) { + clearStage(stage, eim, curMap); + cm.sendNext("Please hurry on to the next stage, the portal opened!"); + } else { + eim.showWrongEffect(); + cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!"); + } + } + + cm.dispose(); + } else if (curMap == 103000803) { + var stgProperty = "stg4Property"; + var stgCombos = stage4Combos; + var stgAreas = stage4Rects; + + var nthtext = "4th", nthobj = "barrels", nthverb = "stand", nthpos = "stand too close to the edges"; + var nextStgId = 103000804; + + if (!eim.isEventLeader(cm.getPlayer())) { + cm.sendOk("Follow the instructions given by your party leader to proceed through this stage."); + } else if (eim.getProperty(stgProperty) == null) { + cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!"); + var c = Math.floor(Math.random() * stgCombos.length); + eim.setProperty(stgProperty, c.toString()); + } else { + var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas); + + if (accept) { + clearStage(stage, eim, curMap); + cm.sendNext("Please hurry on to the next stage, the portal opened!"); + } else { + eim.showWrongEffect(); + cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!"); + } + } + + cm.dispose(); + } else if (curMap == 103000804) { + if (eim.isEventLeader(cm.getPlayer())) { + if (cm.haveItem(4001008, 10)) { + cm.sendNext("Here's the portal that leads you to the last, bonus stage. It's a stage that allows you to defeat regular monsters a little easier. You'll be given a set amount of time to hunt as much as possible, but you can always leave the stage in the middle of it through the NPC. Again, congratulations on clearing all the stages. Let your party talk to me to receive their prizes as they are allowed to pass to the bonus stage. Take care..."); + cm.gainItem(4001008, -10); + + clearStage(stage, eim, curMap); + eim.clearPQ(); + } else { + cm.sendNext("Hello. Welcome to the 5th and final stage. Walk around the map and you'll be able to find some Boss monsters. Defeat all of them, gather up #bthe passes#k, and please get them to me. Once you earn your pass, the leader of your party will collect them, and then get them to me once the #bpasses#k are gathered up. The monsters may be familiar to you, but they may be much stronger than you think, so please be careful. Good luck!"); + } + } else { + cm.sendNext("Welcome to the 5th and final stage. Walk around the map and you will be able to find some Boss monsters. Defeat them all, gather up the #bpasses#k, and #bgive them to your leader#k. Once you are done, return to me to collect your reward."); + } + + cm.dispose(); + } + } else if (status == 1) { + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendNext("Please make room on your inventory first!"); + } else { + cm.warp(103000805, "st00"); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/9020002.js b/scripts/npc/9020002.js index 6b1f2cbd5a..db571b9578 100644 --- a/scripts/npc/9020002.js +++ b/scripts/npc/9020002.js @@ -20,26 +20,26 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Nella - Hidden Street : 1st Accompaniment --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Nella - Hidden Street : 1st Accompaniment + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status; function start() { status = -1; - action(1,0,0); + action(1, 0, 0); } -function action(mode, type, selection){ - if (mode == 1) +function action(mode, type, selection) { + if (mode == 1) { status++; - else { + } else { cm.dispose(); return; } diff --git a/scripts/npc/9030000.js b/scripts/npc/9030000.js index 1393500637..ffb557701b 100644 --- a/scripts/npc/9030000.js +++ b/scripts/npc/9030000.js @@ -28,26 +28,27 @@ var status; function start() { status = -1; action(1, 0, 0); -} +} function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else { + } else { cm.dispose(); return; } - if (status == 0) - if (!cm.hasMerchant() && cm.hasMerchantItems()) { - cm.showFredrick(); - cm.dispose(); - } else { - if (cm.hasMerchant()) { - cm.sendOk("You have a Merchant open."); - cm.dispose(); - } else { - cm.sendOk("You don't have any items or mesos to be retrieved."); - cm.dispose(); - } - } + if (status == 0) { + if (!cm.hasMerchant() && cm.hasMerchantItems()) { + cm.showFredrick(); + cm.dispose(); + } else { + if (cm.hasMerchant()) { + cm.sendOk("You have a Merchant open."); + cm.dispose(); + } else { + cm.sendOk("You don't have any items or mesos to be retrieved."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9040000.js b/scripts/npc/9040000.js index 79db553ec3..d2c5ddbb8d 100644 --- a/scripts/npc/9040000.js +++ b/scripts/npc/9040000.js @@ -23,110 +23,114 @@ * @npc: Shuang * @map: Victoria Road: Excavation Site (101030104) * @func: Start Guild PQ -*/ + */ var status = 0; var sel; var em = null; function findLobby(guild) { - for (var iterator = em.getInstances().iterator(); iterator.hasNext();) { - var lobby = iterator.next(); - - if(lobby.getIntProperty("guild") == guild) { - if(lobby.getIntProperty("canJoin") == 1) return lobby; - else return null; - } + for (var iterator = em.getInstances().iterator(); iterator.hasNext();) { + var lobby = iterator.next(); + + if (lobby.getIntProperty("guild") == guild) { + if (lobby.getIntProperty("canJoin") == 1) { + return lobby; + } else { + return null; + } } - - return null; + } + + return null; } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("GuildQuest"); - if(em == null) { - cm.sendOk("The Guild Quest has encountered an error."); - cm.dispose(); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThe path to Sharenian starts here. What would you like to do? #b\r\n#L0#Register your guild for Guild Quest#l\r\n#L1#Join your guild's Guild Quest#l\r\n#L2#I would like to hear more details.#l"); - } else if (status == 1) { - sel = selection; - if (selection == 0) { - if(!cm.isGuildLeader()) { - cm.sendOk("Your guild master/jr.master must talk to me to register the guild for the guild quest."); - cm.dispose(); - } else { - if(em.isQueueFull()) { - cm.sendOk("The queue on this channel is already full. Please be patient and try again after a while, or try on another channel."); - cm.dispose(); - } else { - var qsize = em.getQueueSize(); - cm.sendYesNo(((qsize > 0) ? "There is currently #r" + qsize + "#k guilds queued on. " : "") + "Do you wish for your guild to join this queue?"); - } - } - } else if (selection == 1) { - if(cm.getPlayer().getGuildId() > 0) { - var eim = findLobby(cm.getPlayer().getGuildId()); - if(eim == null) { - cm.sendOk("Your guild is not currently on strategy time on this channel. Check again if your guild is currently planning a Guild Quest or, if so, the channel they are allotted on."); - } else { - if(cm.isLeader()) { - em.getEligibleParty(cm.getParty()); - eim.registerParty(cm.getPlayer()); - } else { - eim.registerPlayer(cm.getPlayer()); - } - } - } else { - cm.sendOk("You can't participate in the guild quest if you don't pertain on a guild yourself!"); - } - - cm.dispose(); - } else { - var reqStr = ""; - reqStr += "\r\n\r\n Team requirements:\r\n\r\n"; - reqStr += " - 1 team member #rbelow or equal level 30#k.\r\n"; - reqStr += " - 1 team member who is a #rThief with Dark Sight#k skill and #rmaxed Haste#k.\r\n"; - reqStr += " - 1 team member who is a Magician with #rmaxed Teleport#k.\r\n"; - reqStr += " - 1 team member who is a #rlong ranged attacker#k like Bowman, Assassin, or Gunslinger.\r\n"; - reqStr += " - 1 team member with #rgood jumping skills#k like Assassin with maxed Flash Jump or Gunslinger with Wings.\r\n"; - - cm.sendOk("#e#b#k#n\r\n Team up with your guild members in an auspicious attempt to recover the Rubian from the skeleton's grasp, with teamwork overcoming many puzzles and challenges awaiting inside the Sharenian tombs. Great rewards can be obtained upon the instance completion, and Guild Points can be racked up for your Guild." + reqStr); - cm.dispose(); - } - } else if (status == 2) { - if (sel == 0) { - var entry = em.addGuildToQueue(cm.getPlayer().getGuildId(), cm.getPlayer().getId()); - if(entry > 0) { - cm.sendOk("Your guild has been registered successfully. A message will pop on your chat keeping your guild aware about the registration status.\r\n\r\nNow, #rimportant#k: as the leader of this instance, #ryou must already be present on this channel#k the right moment your guild is called for the strategy time. #bThe missubmission of this action will void#k your guild registration as a whole, and the next guild will be called immediately. Must be noted also that if you, leader of this instance, become absent from the end of the strategy time to any point on the duration of the instance, it will render the mission interrupted, and your guild will be moved out instantly, moving again the queue."); - } else if(entry == 0) { - cm.sendOk("The queue on this channel is already full. Please be patient and try again after a while, or try on another channel."); - } else { - cm.sendOk("Your guild is already queued on a channel. Please wait for your guild's turn."); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("GuildQuest"); + if (em == null) { + cm.sendOk("The Guild Quest has encountered an error."); + cm.dispose(); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThe path to Sharenian starts here. What would you like to do? #b\r\n#L0#Register your guild for Guild Quest#l\r\n#L1#Join your guild's Guild Quest#l\r\n#L2#I would like to hear more details.#l"); + } else if (status == 1) { + sel = selection; + if (selection == 0) { + if (!cm.isGuildLeader()) { + cm.sendOk("Your guild master/jr.master must talk to me to register the guild for the guild quest."); + cm.dispose(); + } else { + if (em.isQueueFull()) { + cm.sendOk("The queue on this channel is already full. Please be patient and try again after a while, or try on another channel."); + cm.dispose(); + } else { + var qsize = em.getQueueSize(); + cm.sendYesNo(((qsize > 0) ? "There is currently #r" + qsize + "#k guilds queued on. " : "") + "Do you wish for your guild to join this queue?"); + } + } + } else if (selection == 1) { + if (cm.getPlayer().getGuildId() > 0) { + var eim = findLobby(cm.getPlayer().getGuildId()); + if (eim == null) { + cm.sendOk("Your guild is not currently on strategy time on this channel. Check again if your guild is currently planning a Guild Quest or, if so, the channel they are allotted on."); + } else { + if (cm.isLeader()) { + em.getEligibleParty(cm.getParty()); + eim.registerParty(cm.getPlayer()); + } else { + eim.registerPlayer(cm.getPlayer()); + } + } + } else { + cm.sendOk("You can't participate in the guild quest if you don't pertain on a guild yourself!"); + } + + cm.dispose(); + } else { + var reqStr = ""; + reqStr += "\r\n\r\n Team requirements:\r\n\r\n"; + reqStr += " - 1 team member #rbelow or equal level 30#k.\r\n"; + reqStr += " - 1 team member who is a #rThief with Dark Sight#k skill and #rmaxed Haste#k.\r\n"; + reqStr += " - 1 team member who is a Magician with #rmaxed Teleport#k.\r\n"; + reqStr += " - 1 team member who is a #rlong ranged attacker#k like Bowman, Assassin, or Gunslinger.\r\n"; + reqStr += " - 1 team member with #rgood jumping skills#k like Assassin with maxed Flash Jump or Gunslinger with Wings.\r\n"; + + cm.sendOk("#e#b#k#n\r\n Team up with your guild members in an auspicious attempt to recover the Rubian from the skeleton's grasp, with teamwork overcoming many puzzles and challenges awaiting inside the Sharenian tombs. Great rewards can be obtained upon the instance completion, and Guild Points can be racked up for your Guild." + reqStr); + cm.dispose(); + } + } else if (status == 2) { + if (sel == 0) { + var entry = em.addGuildToQueue(cm.getPlayer().getGuildId(), cm.getPlayer().getId()); + if (entry > 0) { + cm.sendOk("Your guild has been registered successfully. A message will pop on your chat keeping your guild aware about the registration status.\r\n\r\nNow, #rimportant#k: as the leader of this instance, #ryou must already be present on this channel#k the right moment your guild is called for the strategy time. #bThe missubmission of this action will void#k your guild registration as a whole, and the next guild will be called immediately. Must be noted also that if you, leader of this instance, become absent from the end of the strategy time to any point on the duration of the instance, it will render the mission interrupted, and your guild will be moved out instantly, moving again the queue."); + } else if (entry == 0) { + cm.sendOk("The queue on this channel is already full. Please be patient and try again after a while, or try on another channel."); + } else { + cm.sendOk("Your guild is already queued on a channel. Please wait for your guild's turn."); + } + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9040001.js b/scripts/npc/9040001.js index 6ae76a4b3e..356996efb4 100644 --- a/scripts/npc/9040001.js +++ b/scripts/npc/9040001.js @@ -33,13 +33,13 @@ var status; function start() { status = -1; - action(1,0,0); + action(1, 0, 0); } -function action(mode, type, selection){ - if (mode == 1) +function action(mode, type, selection) { + if (mode == 1) { status++; - else { + } else { cm.dispose(); return; } @@ -49,14 +49,14 @@ function action(mode, type, selection){ cm.sendYesNo(outText); } else if (mode == 1) { var eim = cm.getEventInstance(); - - if(eim != null && eim.isEventCleared()) { - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendNext("It seems you don't have a free slot in either your #rEquip#k, #rUse#k or #rEtc#k inventories. Please make some room first."); + + if (eim != null && eim.isEventCleared()) { + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendNext("It seems you don't have a free slot in either your #rEquip#k, #rUse#k or #rEtc#k inventories. Please make some room first."); } else { - cm.warp(101030104); + cm.warp(101030104); } - + cm.dispose(); } else { cm.warp(101030104); diff --git a/scripts/npc/9040002.js b/scripts/npc/9040002.js index 41e29ea7db..abd25af778 100644 --- a/scripts/npc/9040002.js +++ b/scripts/npc/9040002.js @@ -44,10 +44,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (mode == 1 && status == 3) { status = 0; } @@ -59,35 +60,27 @@ function action(mode, type, selection) { prompt = "Do you have any other questions?" + prompt; } cm.sendSimple(prompt); - } - else if (status == 1) { + } else if (status == 1) { selectedOption = selection; if (selectedOption == 0) { cm.sendNext("Sharenian was a literate civilization from the past that had control over every area of the Victoria Island. The Temple of Golem, the Shrine in the deep part of the Dungeon, and other old architectural constructions where no one knows who built it are indeed made during the Sharenian times."); - } - else if (selectedOption == 1) { + } else if (selectedOption == 1) { cm.sendNext("#t4001024# is a legendary jewel that brings eternal youth to the one that possesses it. Ironically, it seems like everyone that had #t4001024# ended up downtrodden, which should explain the downfall of Sharenian."); status = -1; - } - else if (selectedOption == 2) { + } else if (selectedOption == 2) { cm.sendNext("I've sent groups of explorers to Sharenian before, but none of them ever came back, which prompted us to start the Guild Quest. We've been waiting for guilds that are strong enough to take on tough challenges, guilds like yours."); - } - else if (selectedOption == 3) { + } else if (selectedOption == 3) { cm.sendOk("Really? If you have anything else to ask, please feel free to talk to me."); cm.dispose(); - } - else { + } else { cm.dispose(); } - } - else if (status == 2) { //should only be available for options 0 and 2 + } else if (status == 2) { //should only be available for options 0 and 2 if (selectedOption == 0) { cm.sendNextPrev("The last king of Sharenian was a gentleman named Sharen III, and apparently he was a very wise and compassionate king. But one day, the whole kingdom collapsed, and there was no explanation made for it."); - } - else if (selectedOption == 2) { + } else if (selectedOption == 2) { cm.sendNextPrev("The ultimate goal of this Guild Quest is to explore Sharenian and find #t4001024#. This is not a task where power solves everything. Teamwork is more important here."); - } - else { + } else { cm.dispose(); } } diff --git a/scripts/npc/9040003.js b/scripts/npc/9040003.js index 1153623729..8974ecbdb9 100644 --- a/scripts/npc/9040003.js +++ b/scripts/npc/9040003.js @@ -19,7 +19,8 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -/* + +/* * @Author TheRamon * @Author Ronan * @@ -36,6 +37,7 @@ function clearStage(stage, eim) { } var status = 0; + function start() { status = -1; action(1, 0, 0); @@ -45,19 +47,20 @@ function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); - + } + var eim = cm.getPlayer().getEventInstance(); - + if (eim.getProperty("stage4clear") != null && eim.getProperty("stage4clear").equals("true")) { cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now."); cm.dispose(); return; } - + if (status == 0) { if (cm.isEventLeader()) { cm.sendNext("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. This old man will now pave the way for you to finish the quest."); @@ -65,11 +68,9 @@ function action(mode, type, selection) { clearStage(4, eim); cm.getGuild().gainGP(30); cm.getPlayer().getMap().getReactorByName("ghostgate").forceHitReactor(1); - + cm.dispose(); - } - else - { + } else { cm.sendOk("I need the leader of your party to speak with me, nobody else."); cm.dispose(); } diff --git a/scripts/npc/9040004.js b/scripts/npc/9040004.js index 6520d7f0cf..9b2cc9e3e3 100644 --- a/scripts/npc/9040004.js +++ b/scripts/npc/9040004.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Guild Rank Board */ function start() { diff --git a/scripts/npc/9040005.js b/scripts/npc/9040005.js index 7dae431267..f5ffc3c410 100644 --- a/scripts/npc/9040005.js +++ b/scripts/npc/9040005.js @@ -24,8 +24,8 @@ function start() { } function action(mode, type, selection) { - if(mode == 1) { - cm.warp(101030104); - } - cm.dispose(); + if (mode == 1) { + cm.warp(101030104); + } + cm.dispose(); } diff --git a/scripts/npc/9040006.js b/scripts/npc/9040006.js index 40c2584222..5e2c135cff 100644 --- a/scripts/npc/9040006.js +++ b/scripts/npc/9040006.js @@ -7,30 +7,30 @@ */ function clearStage(stage, eim) { - eim.setProperty("stage" + stage + "clear", "true"); - eim.showClearEffect(true); + eim.setProperty("stage" + stage + "clear", "true"); + eim.showClearEffect(true); - eim.giveEventPlayersStageReward(stage); + eim.giveEventPlayersStageReward(stage); } function start() { - if (cm.getPlayer().getMap().getReactorByName("watergate").getState() > 0){ + if (cm.getPlayer().getMap().getReactorByName("watergate").getState() > 0) { cm.sendOk("Excellent work. You may proceed to the next stage."); cm.dispose(); return; } - + var eim = cm.getPlayer().getEventInstance(); if (eim == null) { - cm.warp(990001100); + cm.warp(990001100); } else { - if (cm.isEventLeader()) { + if (cm.isEventLeader()) { var currentCombo = eim.getProperty("stage3combo"); if (currentCombo == null || currentCombo.equals("reset")) { var newCombo = makeCombo(); - eim.setProperty("stage3combo",newCombo); + eim.setProperty("stage3combo", newCombo); //cm.playerMessage("Debug: " + newCombo); - eim.setProperty("stage3attempt","1"); + eim.setProperty("stage3attempt", "1"); cm.sendOk("This fountain guards the secret passage to the throne room. Offer items in the area to the vassals to proceed. The vassals shall tell you whether your offerings are accepted, and if not, which vassals are displeased. You have seven attempts. Good luck."); } else { var attempt = parseInt(eim.getProperty("stage3attempt")); @@ -41,33 +41,36 @@ function start() { cm.getPlayer().getMap().getReactorByName("watergate").forceHitReactor(1); clearStage(3, eim); cm.getGuild().gainGP(25); - + removeGroundItems(); cm.sendOk("Excellent work. You may proceed to the next stage."); } else { if (attempt < 7) { var comboItems = [0, 0, 0, 0]; var guessItems = [0, 0, 0, 0]; - + var correct = 0, incorrect, unknown = 0; - for(var i = 0; i < 4; i++) { + for (var i = 0; i < 4; i++) { var guessIdx = Math.floor(guess / Math.pow(10, i)) % 10; var comboIdx = Math.floor(combo / Math.pow(10, i)) % 10; - - if(guessIdx == comboIdx) correct++; - else { + + if (guessIdx == comboIdx) { + correct++; + } else { (guessItems[guessIdx])++; (comboItems[comboIdx])++; } } - - for(var i = 0; i < 4; i++) { + + for (var i = 0; i < 4; i++) { var diff = guessItems[i] - comboItems[i]; - if(diff > 0) unknown += diff; + if (diff > 0) { + unknown += diff; + } } - + incorrect = 4 - correct - unknown; - + var string = ""; //cm.playerMessage("Results - Correct: " + results[0] + " | Incorrect: " + results[1] + " | Unknown: " + results[2]); if (correct != 0) { @@ -113,10 +116,10 @@ function start() { spawnMob(9300037, 400, 150, cm.getPlayer().getMap()); cm.sendOk(string); - eim.setProperty("stage3attempt",attempt + 1); + eim.setProperty("stage3attempt", attempt + 1); } else { //reset the combo and mass spawn monsters - eim.setProperty("stage3combo","reset"); + eim.setProperty("stage3combo", "reset"); cm.sendOk("You have failed the test. Please compose yourselves and try again later."); for (var i = 0; i < 6; i++) { @@ -125,7 +128,7 @@ function start() { spawnMob(9300037, randX(), 150, cm.getPlayer().getMap()); } } - + eim.showWrongEffect(); } } else { @@ -136,7 +139,7 @@ function start() { cm.sendOk("Please have your leader speak to me."); } } - + cm.dispose(); } @@ -144,43 +147,45 @@ function action(mode, type, selection) {} function makeCombo() { var combo = 0; - + for (var i = 0; i < 4; i++) { - combo += (Math.floor(Math.random() * 4) * Math.pow(10, i)); + combo += (Math.floor(Math.random() * 4) * Math.pow(10, i)); } - + return combo; } function getRawItems() { var mapItems = cm.getPlayer().getMap().getItems(); - var rawItems = new Array(); - + var rawItems = []; + var iter = mapItems.iterator(); while (iter.hasNext()) { - var item = iter.next(); - var id = item.getItem().getItemId(); - if (id < 4001027 || id > 4001030) { - continue; - } else { - rawItems.push(item); - } + var item = iter.next(); + var id = item.getItem().getItemId(); + if (id < 4001027 || id > 4001030) { + + } else { + rawItems.push(item); + } } - + return rawItems; } //check the items on ground and convert into an applicable string; null if items aren't proper function getGroundItems() { - var itemInArea = new Array(-1, -1, -1, -1); - + var itemInArea = [-1, -1, -1, -1]; + var rawItems = getRawItems(); - if (rawItems.length != 4) return null; - - for(var j = 0; j < rawItems.length; j++) { + if (rawItems.length != 4) { + return null; + } + + for (var j = 0; j < rawItems.length; j++) { var item = rawItems[j]; var id = item.getItem().getItemId(); - + //check item location for (var i = 0; i < 4; i++) { if (cm.getPlayer().getMap().getArea(i).contains(item.getPosition())) { @@ -189,18 +194,19 @@ function getGroundItems() { } } } - + //guaranteed four items that are part of the stage 3 item set by this point, check to see if each area has an item - if (itemInArea[0] == -1 || itemInArea[1] == -1 || itemInArea[2] == -1 || itemInArea[3] == -1) - return null; - + if (itemInArea[0] == -1 || itemInArea[1] == -1 || itemInArea[2] == -1 || itemInArea[3] == -1) { + return null; + } + return ((itemInArea[0] * 1000) + (itemInArea[1] * 100) + (itemInArea[2] * 10) + itemInArea[3]); } function removeGroundItems() { var map = cm.getMap(); var rawItems = getRawItems(); - for(var j = 0; j < rawItems.length; j++) { + for (var j = 0; j < rawItems.length; j++) { map.makeDisappearItemFromMap(rawItems[j]); } } @@ -213,6 +219,6 @@ function randX() { function spawnMob(id, x, y, map) { const LifeFactory = Java.type('server.life.LifeFactory'); const Point = Java.type('java.awt.Point'); - var mob = LifeFactory.getMonster(id); - map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); + var mob = LifeFactory.getMonster(id); + map.spawnMonsterOnGroundBelow(mob, new Point(x, y)); } \ No newline at end of file diff --git a/scripts/npc/9040008.js b/scripts/npc/9040008.js index 6520d7f0cf..9b2cc9e3e3 100644 --- a/scripts/npc/9040008.js +++ b/scripts/npc/9040008.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Guild Rank Board */ function start() { diff --git a/scripts/npc/9040009.js b/scripts/npc/9040009.js index 9d5c33b8f5..5448994ec9 100644 --- a/scripts/npc/9040009.js +++ b/scripts/npc/9040009.js @@ -23,15 +23,15 @@ var status; var stage; function clearStage(stage, eim) { - eim.setProperty("stage" + stage + "clear", "true"); - eim.showClearEffect(true); + eim.setProperty("stage" + stage + "clear", "true"); + eim.showClearEffect(true); - eim.giveEventPlayersStageReward(stage); + eim.giveEventPlayersStageReward(stage); } function start() { status = -1; - action (1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { @@ -42,31 +42,32 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - + } + var eim = cm.getPlayer().getEventInstance(); if (eim == null) { cm.warp(990001100); } else { - if(eim.getProperty("stage1clear") == "true") { + if (eim.getProperty("stage1clear") == "true") { cm.sendOk("Excellent work. You may proceed to the next stage."); cm.dispose(); return; } - + if (cm.isEventLeader()) { if (status == 0) { if (eim.getProperty("stage1status") == null || eim.getProperty("stage1status").equals("waiting")) { if (eim.getProperty("stage1phase") == null) { stage = 1; - eim.setProperty("stage1phase",stage); + eim.setProperty("stage1phase", stage); } else { stage = parseInt(eim.getProperty("stage1phase")); } - + if (stage == 1) { cm.sendOk("In this challenge, I shall show a pattern on the statues around me. When I give the word, repeat the pattern to me to proceed."); } else { @@ -74,7 +75,7 @@ function action(mode, type, selection) { } } else if (eim.getProperty("stage1status").equals("active")) { stage = parseInt(eim.getProperty("stage1phase")); - + if (eim.getProperty("stage1combo").equals(eim.getProperty("stage1guess"))) { if (stage == 3) { cm.getPlayer().getMap().getReactorByName("statuegate").forceHitReactor(1); @@ -92,7 +93,7 @@ function action(mode, type, selection) { eim.showWrongEffect(); cm.sendOk("You have failed this test."); cm.mapMessage(5, "You have failed the Gatekeeper Test."); - eim.setProperty("stage1phase","1"); + eim.setProperty("stage1phase", "1"); } eim.setProperty("stage1status", "waiting"); cm.dispose(); @@ -100,17 +101,16 @@ function action(mode, type, selection) { cm.sendOk("The statues are working on the pattern. Please wait."); cm.dispose(); } - } - else if (status == 1) { + } else if (status == 1) { var reactors = getReactors(); var combo = makeCombo(reactors); cm.mapMessage(5, "Please wait while the combination is revealed."); var delay = 5000; for (var i = 0; i < combo.length; i++) { - cm.getPlayer().getMap().getReactorByOid(combo[i]).delayedHitReactor(cm.getClient(), delay + 3500*i); + cm.getPlayer().getMap().getReactorByOid(combo[i]).delayedHitReactor(cm.getClient(), delay + 3500 * i); } eim.setProperty("stage1status", "display"); - eim.setProperty("stage1combo",""); + eim.setProperty("stage1combo", ""); cm.dispose(); } } else { @@ -123,8 +123,8 @@ function action(mode, type, selection) { //method for getting the statue reactors on the map by oid function getReactors() { - var reactors = new Array(); - + var reactors = []; + var iter = cm.getPlayer().getMap().getReactors().iterator(); while (iter.hasNext()) { var mo = iter.next(); @@ -132,12 +132,12 @@ function getReactors() { reactors.push(mo.getObjectId()); } } - + return reactors; } function makeCombo(reactors) { - var combo = new Array(); + var combo = []; while (combo.length < (stage + 3)) { var chosenReactor = reactors[Math.floor(Math.random() * reactors.length)]; var repeat = false; diff --git a/scripts/npc/9040010.js b/scripts/npc/9040010.js index 802ea6f628..35d89e3706 100644 --- a/scripts/npc/9040010.js +++ b/scripts/npc/9040010.js @@ -29,25 +29,25 @@ function start() { if (prev == null) { var start = parseInt(eim.getProperty("entryTimestamp")); var diff = Date.now() - start; - + var points = 1000 - Math.floor(diff / (100 * 60)); - if(points < 100) points = 100; - + if (points < 100) { + points = 100; + } + cm.getGuild().gainGP(points); } - + eim.clearPQ(); - } - else { + } else { cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and return it to me. That is all."); } - } - else { + } else { cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and let your instance leader return it to me. That is all."); } - } - else + } else { cm.warp(990001100); - + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9040012.js b/scripts/npc/9040012.js index 2715a7a599..33852674f9 100644 --- a/scripts/npc/9040012.js +++ b/scripts/npc/9040012.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* @Author Lerk * Armor Statue - Sharenian: Hall of the Knight (990000400) * Guild Quest Stage 2 Info diff --git a/scripts/npc/9060000.js b/scripts/npc/9060000.js index aeb86ff6f5..140c0b3382 100644 --- a/scripts/npc/9060000.js +++ b/scripts/npc/9060000.js @@ -23,8 +23,8 @@ var status = -1; var completed; function start() { - completed = cm.haveItem(4031508, 5) && cm.haveItem(4031507,5); - + completed = cm.haveItem(4031508, 5) && cm.haveItem(4031507, 5); + if (completed) { cm.sendNext("Wow~ You have succeeded in collecting 5 of each #b#t4031508##k and #b#t4031507##k. Okay then, I will send you to Zoo. Please talk to me again when you get there."); } else { @@ -32,14 +32,14 @@ function start() { } } -function action(mode, type, selection){ +function action(mode, type, selection) { status++; if (mode != 1) { cm.dispose(); return; } - - if(status == 0) { + + if (status == 0) { cm.sendOk("Well okay, I will send you back."); } else { if (completed) { @@ -47,7 +47,7 @@ function action(mode, type, selection){ } else { cm.warp(923010100, 0); } - + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9101001.js b/scripts/npc/9101001.js index c28470b404..8f8d8190f6 100644 --- a/scripts/npc/9101001.js +++ b/scripts/npc/9101001.js @@ -35,9 +35,9 @@ function action(mode, type, selection) { cm.dispose(); } else { status++; - if (status == 1) + if (status == 1) { cm.sendNextPrev("But remember, once you get out of here, you will enter a village full with monsters. Well them, good bye!"); - else if (status == 2) { + } else if (status == 2) { cm.warp(40000, 0); cm.gainExp(3); cm.dispose(); diff --git a/scripts/npc/9102100.js b/scripts/npc/9102100.js index 2806ca5a48..7a88c573e6 100644 --- a/scripts/npc/9102100.js +++ b/scripts/npc/9102100.js @@ -1,12 +1,12 @@ /** --- Odin JavaScript -------------------------------------------------------------------------------- - ? - Victoria Road: Pet-Walking Road (100000202) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + ? - Victoria Road: Pet-Walking Road (100000202) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + --------------------------------------------------------------------------------------------------- + **/ var status = 0; @@ -17,29 +17,30 @@ function start() { function action(mode, type, selection) { if (status == 0 && mode == 0) { - cm.sendNext("#b(I didn't touch this hidden item covered in grass)"); - cm.dispose(); - return; + cm.sendNext("#b(I didn't touch this hidden item covered in grass)"); + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } else { + status--; } - if (mode == 1) - status++; - else - status--; if (status == 0) { - if (cm.getQuestStatus(4646) == 1) { - if (cm.haveItem(4031921)) { - cm.sendNext("#b(What's this... eww... a pet's poop was in there!)"); - cm.dispose(); - } else { - cm.sendYesNo("#b(I can see something covered in grass. Should I pull it out?)"); - } - } else { - cm.sendOk("#b(I couldn't find anything.)"); - cm.dispose(); - } + if (cm.getQuestStatus(4646) == 1) { + if (cm.haveItem(4031921)) { + cm.sendNext("#b(What's this... eww... a pet's poop was in there!)"); + cm.dispose(); + } else { + cm.sendYesNo("#b(I can see something covered in grass. Should I pull it out?)"); + } + } else { + cm.sendOk("#b(I couldn't find anything.)"); + cm.dispose(); + } } else if (status == 1) { - cm.sendNext("I found the item that Pet Trainer Bartos hid... this note."); - cm.gainItem(4031921, 1); - cm.dispose(); + cm.sendNext("I found the item that Pet Trainer Bartos hid... this note."); + cm.gainItem(4031921, 1); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9102101.js b/scripts/npc/9102101.js index 00e71c696f..8d8efcddda 100644 --- a/scripts/npc/9102101.js +++ b/scripts/npc/9102101.js @@ -20,15 +20,15 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - ? - Victoria Road: Pet-Walking Road (100000202) --- By --------------------------------------------------------------------------------------------- - Xterminator --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Xterminator - 2.0 - Second Version by Moogra ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + ? - Victoria Road: Pet-Walking Road (100000202) + -- By --------------------------------------------------------------------------------------------- + Xterminator + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Xterminator + 2.0 - Second Version by Moogra + --------------------------------------------------------------------------------------------------- + **/ function start() { cm.sendYesNo("#b(I can see something covered in grass. Should I pull it out?)"); diff --git a/scripts/npc/9103000.js b/scripts/npc/9103000.js index eadcf5837e..09ac6db10a 100644 --- a/scripts/npc/9103000.js +++ b/scripts/npc/9103000.js @@ -39,42 +39,40 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if(cm.isEventLeader()) { - if(!cm.getEventInstance().isEventTeamTogether()) { - cm.sendOk("One or more instance team members is missing, please wait for them to reach here first."); - cm.dispose(); - } - else if(cm.hasItem(4001106, 30)) { - qty = cm.getItemQuantity(4001106); - cm.sendYesNo("Splendid! You have retrieved " + qty + " #t4001106# from this run, now your team will receive the fair amount of EXP from this action. Are you ready to get transported out?"); - } - else { - cm.sendOk("Your party cannot finish this PQ yet, as you have not reached the minimum of 30 #t4001106#'s in hand yet."); - cm.dispose(); - } - } - else { - cm.sendOk("Let your party leader talk to me to end this quest."); - cm.dispose(); - } - } else if(status == 1) { - cm.removeAll(4001106); - cm.getEventInstance().giveEventPlayersExp(50 * qty); - cm.getEventInstance().clearPQ(); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isEventLeader()) { + if (!cm.getEventInstance().isEventTeamTogether()) { + cm.sendOk("One or more instance team members is missing, please wait for them to reach here first."); + cm.dispose(); + } else if (cm.hasItem(4001106, 30)) { + qty = cm.getItemQuantity(4001106); + cm.sendYesNo("Splendid! You have retrieved " + qty + " #t4001106# from this run, now your team will receive the fair amount of EXP from this action. Are you ready to get transported out?"); + } else { + cm.sendOk("Your party cannot finish this PQ yet, as you have not reached the minimum of 30 #t4001106#'s in hand yet."); + cm.dispose(); + } + } else { + cm.sendOk("Let your party leader talk to me to end this quest."); + cm.dispose(); + } + } else if (status == 1) { + cm.removeAll(4001106); + cm.getEventInstance().giveEventPlayersExp(50 * qty); + cm.getEventInstance().clearPQ(); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9103001.js b/scripts/npc/9103001.js index 33a156f98b..13c6da17e6 100644 --- a/scripts/npc/9103001.js +++ b/scripts/npc/9103001.js @@ -38,59 +38,59 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("LudiMazePQ"); - if(em == null) { - cm.sendOk("The Ludibrium Maze PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the entrance to the Ludibrium Maze. Enjoy!\r\n#b#L0#Enter the Lubidrium Maze#l\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#What is the Ludibrium Maze?"); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("Try taking on the Maze Quest with your party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("If you DO decide to tackle it, please have your Party Leader notify me!"); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("Your party needs to consist of at least 3 members in order to tackle this maze."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nThis maze is available to all parties of 3 or more members, and all participants must be between Level 51~70. You will be given 15 minutes to escape the maze. At the center of the room, there will be a Warp Portal set up to transport you to a different room. These portals will transport you to other rooms where you'll (hopefully) find the exit. Pietri will be waiting at the exit, so all you need to do is talk to him, and he'll let you out. Break all the boxes located in the room, and a monster inside the box will drop a coupon. After escaping the maze, you will be awarded with EXP based on the coupons collected. Additionally, if the leader possesses at least 30 coupons, then a special gift will be presented to the party. If you cannot escape the maze within the allotted 15 minutes, you will receive 0 EXP for your time in the maze. If you decide to log off while you're in the maze, you will be automatically kicked out of the maze. Even if the members of the party leave in the middle of the quest, the remaining members will be able to continue on with the quest, except if they run out of the minimum amount of party members in the maze. If you are in critical condition and unable to hunt down the monsters, you may avoid them to save yourself. Your fighting spirit and wits will be tested! Good luck!"); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("LudiMazePQ"); + if (em == null) { + cm.sendOk("The Ludibrium Maze PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the entrance to the Ludibrium Maze. Enjoy!\r\n#b#L0#Enter the Lubidrium Maze#l\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#What is the Ludibrium Maze?"); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("Try taking on the Maze Quest with your party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("If you DO decide to tackle it, please have your Party Leader notify me!"); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("Your party needs to consist of at least 3 members in order to tackle this maze."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nThis maze is available to all parties of 3 or more members, and all participants must be between Level 51~70. You will be given 15 minutes to escape the maze. At the center of the room, there will be a Warp Portal set up to transport you to a different room. These portals will transport you to other rooms where you'll (hopefully) find the exit. Pietri will be waiting at the exit, so all you need to do is talk to him, and he'll let you out. Break all the boxes located in the room, and a monster inside the box will drop a coupon. After escaping the maze, you will be awarded with EXP based on the coupons collected. Additionally, if the leader possesses at least 30 coupons, then a special gift will be presented to the party. If you cannot escape the maze within the allotted 15 minutes, you will receive 0 EXP for your time in the maze. If you decide to log off while you're in the maze, you will be automatically kicked out of the maze. Even if the members of the party leave in the middle of the quest, the remaining members will be able to continue on with the quest, except if they run out of the minimum amount of party members in the maze. If you are in critical condition and unable to hunt down the monsters, you may avoid them to save yourself. Your fighting spirit and wits will be tested! Good luck!"); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9103002.js b/scripts/npc/9103002.js index 49b9751838..c4e6aee177 100644 --- a/scripts/npc/9103002.js +++ b/scripts/npc/9103002.js @@ -30,33 +30,34 @@ var status = 0; function start() { status = -1; - action(1,0,0); + action(1, 0, 0); } -function action(mode, type, selection){ +function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } if (mode == 0) { cm.dispose(); - return; - } else { - if (mode == 1) - status++; - else - status--; - if (status == 0) { - cm.sendYesNo("Your party gave a stellar effort and gathered up at least 30 coupons. For that, I have a present for each and every one of you. After receiving the present, you will be sent back to Ludibrium. Now, would you like to receive the present right now?"); - } else if(status == 1) { - var eim = cm.getEventInstance(); - - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendNext("It seems you don't have a free slot in either your #rEquip#k, #rUse#k or #rEtc#k inventories. Please make some room and try again."); - } else { - cm.warp(809050017); - } - cm.dispose(); + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { + cm.sendYesNo("Your party gave a stellar effort and gathered up at least 30 coupons. For that, I have a present for each and every one of you. After receiving the present, you will be sent back to Ludibrium. Now, would you like to receive the present right now?"); + } else if (status == 1) { + var eim = cm.getEventInstance(); + + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendNext("It seems you don't have a free slot in either your #rEquip#k, #rUse#k or #rEtc#k inventories. Please make some room and try again."); + } else { + cm.warp(809050017); + } + + cm.dispose(); } } } \ No newline at end of file diff --git a/scripts/npc/9103003.js b/scripts/npc/9103003.js index f89a83d54f..c4980ce39e 100644 --- a/scripts/npc/9103003.js +++ b/scripts/npc/9103003.js @@ -25,29 +25,31 @@ */ var status = 0; + function start() { status = -1; action(1, 0, 0); } -function action(mode, type, selection){ - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendNext("Come this way to return to Ludibrium."); - } else { - cm.warp(220000000, 0); - cm.dispose(); - } +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendNext("Come this way to return to Ludibrium."); + } else { + cm.warp(220000000, 0); + cm.dispose(); + } + } } diff --git a/scripts/npc/9105004.js b/scripts/npc/9105004.js index 772198f428..82e5db8c6b 100644 --- a/scripts/npc/9105004.js +++ b/scripts/npc/9105004.js @@ -30,203 +30,203 @@ var state; var status; var gift; var pqType; - + function start() { - pqType = ((cm.getMapId() / 10) % 10) + 1; - state = (cm.getMapId() % 10 > 0) ? 1 : 0; - status = -1; - action(1, 0, 0); + pqType = ((cm.getMapId() / 10) % 10) + 1; + state = (cm.getMapId() % 10 > 0) ? 1 : 0; + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(state > 0) { - insidePqAction(mode, type, selection); - } else { - recruitPqAction(mode, type, selection); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (state > 0) { + insidePqAction(mode, type, selection); + } else { + recruitPqAction(mode, type, selection); + } + } } function recruitPqAction(mode, type, selection) { - if (status == 0) { - em = cm.getEventManager("HolidayPQ_" + pqType); - if(em == null) { - cm.sendOk("The Holiday PQ " + pqType + " has encountered an error."); - cm.dispose(); - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), pqType)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\n\r\nJoin in with your team to build up the Snowman that will protect Happyville from the misdoings of Scrooge. While inside, work out with your team to protect it at any means necessary while collecting Snow Vigor that will help on the build up of the Snowman."); - cm.dispose(); - } + if (status == 0) { + em = cm.getEventManager("HolidayPQ_" + pqType); + if (em == null) { + cm.sendOk("The Holiday PQ " + pqType + " has encountered an error."); + cm.dispose(); + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; } -} -function insidePqAction(mode, type, selection) { - var eim = cm.getEventInstance(); - var difficulty = eim.getIntProperty("level"); - var stg = eim.getIntProperty("statusStg1"); - - var mapobj = eim.getInstanceMap(889100001 + 10 * (difficulty - 1)); - - if(status == 0) { - if(stg == -1) { - cm.sendNext("#b#h0##k... you're finally here. This is the place where the residents of Happyville build the giant snowman. But Scrooge's subordinates are attacking it right now. Now Hurry! Our mission is for you and your party to protect the snowman from Scrooge's men within the time limit. If you eliminate them, then they'll drop an item called Snow Vigor. Gather them up and drop them on the snowman, and you'll literally see it grow. Once it returns to its original size, then your task is complete. Just beware of one thing. Some of the subordinates may drop a fake Snow Vigor. A fake Snow Vigor will actually cause the snowman to melt even faster than usual. Best of luck to you."); - } else if(stg == 0) { - if(cm.getMap().getMonsterById(9400321 + 5 * difficulty) == null) { - cm.sendNext("Please, defeat Scrooge's underlings and make the snowman grow, so that Scrooge has no other way to avoid showing himself up."); - cm.dispose(); - } else { - cm.sendNext("Awesome! Just as I expected, you managed to defeat Scrooge's subordinates. Thank you so much! (Stands silent for a while...) Unfortunately, Scrooge doesn't seem like he's going to stop right here. One of his men have already told him what happened, which means... he'll show up soon. Please keep fighting, and again, best of luck to you."); - } + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), pqType)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } } else { - if(!eim.isEventCleared()) { - cm.sendNext("Please defeat the Scrooge, so our Maplemas keeps safe from harm!"); - cm.dispose(); - } else { - cm.sendNext("Wow!! You defeated Scrooge! Thank you so much! You have managed to make this Maplemas safe and sound! Thanks!!"); - } - } - } else if(status == 1) { - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - - if(stg == -1) { - if(!cm.isEventLeader()) { - cm.sendOk("Please let your party leader talk to me for further details on the mission."); - cm.dispose(); - return; - } - - mapobj.allowSummonState(true); - var snowman = LifeFactory.getMonster(9400317 + (5 * difficulty)); - mapobj.spawnMonsterOnGroundBelow(snowman, new Point(-180, 15)); - eim.setIntProperty("snowmanLevel", 1); - eim.dropMessage(5, "The snowman appeared on the field! Protect it using all means necessary!"); - - eim.setIntProperty("statusStg1", 0); - cm.dispose(); - return; - } else if(stg == 0) { - if(!cm.isEventLeader()) { - cm.sendOk("Please let your party leader talk to me for further details on the mission."); - cm.dispose(); - return; - } - - mapobj.broadcastStringMessage(5, "As the snowman grows to it's prime, the Scrooge appears!"); - eim.getEm().getIv().invokeFunction("snowmanHeal", eim); - - var boss = LifeFactory.getMonster(9400318 + difficulty); - mapobj.spawnMonsterOnGroundBelow(boss, new Point(-180, 15)); - eim.setProperty("spawnedBoss", "true"); - - eim.setIntProperty("statusStg1", 1); - cm.dispose(); - } else { - gift = cm.haveItem(4032092, 1); - if(gift) { - var optStr = generateSelectionMenu(generatePrizeString()); - cm.sendSimple("Oh, you brought a #b#t4032092##k with you? That's nice, hold on a bit... Here's your Maplemas gift. Please select the one you'd like to receive:\r\n\r\n" + optStr); - } else if(eim.gridCheck(cm.getPlayer()) == -1) { - cm.sendNext("Here's your Maplemas gift. Enjoy~"); - } else { - cm.sendOk("Happy Maplemas!!"); - cm.dispose(); - } - } - - } else if(status == 2) { - if(gift) { - var selItems = prizeTree[selection]; - if(cm.canHoldAll(selItems[0], selItems[1])) { - cm.gainItem(4032092, -1); - cm.gainItem(selItems[0][0], selItems[1][0]); - - if(selection == 1) { - var rnd = (Math.random() * 9) | 0; - cm.gainItem(selItems[0][1] + rnd, selItems[1][1]); - } else { - cm.gainItem(selItems[0][1], selItems[1][1]); - } - } else { - cm.sendOk("Please make sure you have room in your EQUIP and USE inventories before proceeding."); - } - } else { - if(eim.giveEventReward(cm.getPlayer(), difficulty)) { - eim.gridInsert(cm.getPlayer(), 1); - } else { - cm.sendOk("Please make sure you have room in your EQUIP, USE and ETC inventories before proceeding."); - } + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); } cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\n\r\nJoin in with your team to build up the Snowman that will protect Happyville from the misdoings of Scrooge. While inside, work out with your team to protect it at any means necessary while collecting Snow Vigor that will help on the build up of the Snowman."); + cm.dispose(); } + } +} + +function insidePqAction(mode, type, selection) { + var eim = cm.getEventInstance(); + var difficulty = eim.getIntProperty("level"); + var stg = eim.getIntProperty("statusStg1"); + + var mapobj = eim.getInstanceMap(889100001 + 10 * (difficulty - 1)); + + if (status == 0) { + if (stg == -1) { + cm.sendNext("#b#h0##k... you're finally here. This is the place where the residents of Happyville build the giant snowman. But Scrooge's subordinates are attacking it right now. Now Hurry! Our mission is for you and your party to protect the snowman from Scrooge's men within the time limit. If you eliminate them, then they'll drop an item called Snow Vigor. Gather them up and drop them on the snowman, and you'll literally see it grow. Once it returns to its original size, then your task is complete. Just beware of one thing. Some of the subordinates may drop a fake Snow Vigor. A fake Snow Vigor will actually cause the snowman to melt even faster than usual. Best of luck to you."); + } else if (stg == 0) { + if (cm.getMap().getMonsterById(9400321 + 5 * difficulty) == null) { + cm.sendNext("Please, defeat Scrooge's underlings and make the snowman grow, so that Scrooge has no other way to avoid showing himself up."); + cm.dispose(); + } else { + cm.sendNext("Awesome! Just as I expected, you managed to defeat Scrooge's subordinates. Thank you so much! (Stands silent for a while...) Unfortunately, Scrooge doesn't seem like he's going to stop right here. One of his men have already told him what happened, which means... he'll show up soon. Please keep fighting, and again, best of luck to you."); + } + } else { + if (!eim.isEventCleared()) { + cm.sendNext("Please defeat the Scrooge, so our Maplemas keeps safe from harm!"); + cm.dispose(); + } else { + cm.sendNext("Wow!! You defeated Scrooge! Thank you so much! You have managed to make this Maplemas safe and sound! Thanks!!"); + } + } + } else if (status == 1) { + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + + if (stg == -1) { + if (!cm.isEventLeader()) { + cm.sendOk("Please let your party leader talk to me for further details on the mission."); + cm.dispose(); + return; + } + + mapobj.allowSummonState(true); + var snowman = LifeFactory.getMonster(9400317 + (5 * difficulty)); + mapobj.spawnMonsterOnGroundBelow(snowman, new Point(-180, 15)); + eim.setIntProperty("snowmanLevel", 1); + eim.dropMessage(5, "The snowman appeared on the field! Protect it using all means necessary!"); + + eim.setIntProperty("statusStg1", 0); + cm.dispose(); + + } else if (stg == 0) { + if (!cm.isEventLeader()) { + cm.sendOk("Please let your party leader talk to me for further details on the mission."); + cm.dispose(); + return; + } + + mapobj.broadcastStringMessage(5, "As the snowman grows to it's prime, the Scrooge appears!"); + eim.getEm().getIv().invokeFunction("snowmanHeal", eim); + + var boss = LifeFactory.getMonster(9400318 + difficulty); + mapobj.spawnMonsterOnGroundBelow(boss, new Point(-180, 15)); + eim.setProperty("spawnedBoss", "true"); + + eim.setIntProperty("statusStg1", 1); + cm.dispose(); + } else { + gift = cm.haveItem(4032092, 1); + if (gift) { + var optStr = generateSelectionMenu(generatePrizeString()); + cm.sendSimple("Oh, you brought a #b#t4032092##k with you? That's nice, hold on a bit... Here's your Maplemas gift. Please select the one you'd like to receive:\r\n\r\n" + optStr); + } else if (eim.gridCheck(cm.getPlayer()) == -1) { + cm.sendNext("Here's your Maplemas gift. Enjoy~"); + } else { + cm.sendOk("Happy Maplemas!!"); + cm.dispose(); + } + } + + } else if (status == 2) { + if (gift) { + var selItems = prizeTree[selection]; + if (cm.canHoldAll(selItems[0], selItems[1])) { + cm.gainItem(4032092, -1); + cm.gainItem(selItems[0][0], selItems[1][0]); + + if (selection == 1) { + var rnd = (Math.random() * 9) | 0; + cm.gainItem(selItems[0][1] + rnd, selItems[1][1]); + } else { + cm.gainItem(selItems[0][1], selItems[1][1]); + } + } else { + cm.sendOk("Please make sure you have room in your EQUIP and USE inventories before proceeding."); + } + } else { + if (eim.giveEventReward(cm.getPlayer(), difficulty)) { + eim.gridInsert(cm.getPlayer(), 1); + } else { + cm.sendOk("Please make sure you have room in your EQUIP, USE and ETC inventories before proceeding."); + } + } + + cm.dispose(); + } } function generatePrizeString() { - var strTree = []; - - for(var i = 0; i < prizeTree.length; i++) { - var items = prizeTree[i][0]; - var qtys = prizeTree[i][1]; + var strTree = []; - var strSel = ""; - for(var j = 0; j < items.length; j++) { - strSel += ("#i" + items[j] + "# #t" + items[j] + "#" + (qtys[j] > 1 ? (" : " + qtys[j]) : "")); - } + for (var i = 0; i < prizeTree.length; i++) { + var items = prizeTree[i][0]; + var qtys = prizeTree[i][1]; - strTree.push(strSel); + var strSel = ""; + for (var j = 0; j < items.length; j++) { + strSel += ("#i" + items[j] + "# #t" + items[j] + "#" + (qtys[j] > 1 ? (" : " + qtys[j]) : "")); } - - return strTree; + + strTree.push(strSel); + } + + return strTree; } function generateSelectionMenu(array) { - var menu = ""; - for (var i = 0; i < array.length; i++) { - menu += "#L" + i + "#" + array[i] + "#l\r\n"; - } - return menu; + var menu = ""; + for (var i = 0; i < array.length; i++) { + menu += "#L" + i + "#" + array[i] + "#l\r\n"; + } + return menu; } \ No newline at end of file diff --git a/scripts/npc/9105005.js b/scripts/npc/9105005.js index 5a9fad2bbf..52fc0e227a 100644 --- a/scripts/npc/9105005.js +++ b/scripts/npc/9105005.js @@ -20,40 +20,41 @@ var status; var area; - + function start() { - area = cm.getMapId() % 10; - status = -1; - action(1, 0, 0); + area = cm.getMapId() % 10; + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(area > 0) { - cm.sendYesNo("Do you wish to leave this place?"); - } else { - cm.sendYesNo("Do you wish to return to #bHappyville#k?"); - } - } else { - if(area > 0) { - cm.warp(cm.getMapId() + 1, 0); - } else { - cm.warp(209000000); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (area > 0) { + cm.sendYesNo("Do you wish to leave this place?"); + } else { + cm.sendYesNo("Do you wish to return to #bHappyville#k?"); + } + } else { + if (area > 0) { + cm.warp(cm.getMapId() + 1, 0); + } else { + cm.warp(209000000); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/9110002.js b/scripts/npc/9110002.js index 55f90f51b6..f6c667f1c4 100644 --- a/scripts/npc/9110002.js +++ b/scripts/npc/9110002.js @@ -21,43 +21,44 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Kino Konoko - Zipangu - Mushroom Shrine(800000000) --- By --------------------------------------------------------------------------------------------- - Ronan --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Ronan ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Kino Konoko - Zipangu - Mushroom Shrine(800000000) + -- By --------------------------------------------------------------------------------------------- + Ronan + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Ronan + --------------------------------------------------------------------------------------------------- + **/ var status; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.isQuestCompleted(8074)) { - cm.openNpc(9110002); - } else { - cm.sendOk("Musssshhhhroooom Shrine~~~"); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.isQuestCompleted(8074)) { + cm.openNpc(9110002); + } else { + cm.sendOk("Musssshhhhroooom Shrine~~~"); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/9120003.js b/scripts/npc/9120003.js index fb08eed273..6fd5ca6d30 100644 --- a/scripts/npc/9120003.js +++ b/scripts/npc/9120003.js @@ -21,16 +21,16 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Hikari - Showa Town(801000000) --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Information - 2.0 - Second Version by Moogra - 2.1 - Code revamped by Moogra ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Hikari - Showa Town(801000000) + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Information + 2.0 - Second Version by Moogra + 2.1 - Code revamped by Moogra + --------------------------------------------------------------------------------------------------- + **/ var price = 300; @@ -40,14 +40,15 @@ function start() { function action(mode, type, selection) { if (mode < 1) { - if (mode == 0) + if (mode == 0) { cm.sendOk("Please come back some other time."); + } cm.dispose(); return; } - if (cm.getMeso < price) + if (cm.getMeso < price) { cm.sendOk("Please check and see if you have " + price + " mesos to enter this place."); - else { + } else { cm.gainMeso(-price); cm.warp(801000100 + 100 * cm.getPlayer().getGender(), "out00"); } diff --git a/scripts/npc/9120010.js b/scripts/npc/9120010.js index 836d4b3524..bbc71569e0 100644 --- a/scripts/npc/9120010.js +++ b/scripts/npc/9120010.js @@ -20,22 +20,22 @@ along with this program. If not, see . */ var status = 0; -var eQuestChoices = new Array (4000064,4000065,4000066,4000075,4000077,4000089,4000090,4000091,4000092,4000093,4000094); -var eQuestPrizes = new Array(); -eQuestPrizes[0] = new Array ([2000000,1],[2000006,1],[2000003,5],[2000002,5],[4020006,2],[4020000,2],[4020004,2],[2000003,10],[2000003,20],[2000002,10],[2000002,20],[2022026,15],[2022024,15],[1002393,1]); // Crow feather -eQuestPrizes[1] = new Array ([2000006,1],[2000002,5],[4020006,2],[2000002,10],[2000003,10],[2000002,20],[2000003,20],[2022024,15],[2022026,15]); // Raccoon firewood -eQuestPrizes[2] = new Array ([2000006,1],[2000002,5],[2000003,5],[4020000,2],[2000003,10],[2000002,10],[2000003,20],[2000002,20],[2022024,15],[1002393,1]); // Cloud foxtail -eQuestPrizes[3] = new Array ([2060003,1000],[4010004,2],[4010006,2],[2022022,5],[2022022,10],[2022022,15],[2022019,5],[2022019,10],[2022019,15],[2001002,15],[2001001,15],[1102040,1],[1102043,1]); // Tringular bandana of the nightghost -eQuestPrizes[4] = new Array ([2000003,1],[2022019,5],[2000006,5],[4010002,2],[4010003,2],[2000006,10],[2000006,15],[2022019,10],[2022019,15],[2060003,1000],[2061003,1000],[1082150,1],[1082149,1]); // Dark cloud foxtail -eQuestPrizes[5] = new Array ([2000006,1],[2000003,5],[2000002,5],[2000003,10],[2000003,20],[2000002,10],[2000002,15],[2060003,1000],[2061003,1000],[2022026,15],[1002395,1]); // Littleman A's badge -eQuestPrizes[6] = new Array ([2022019,5],[2000006,5],[4010003,2],[2022019,10],[2022019,15],[2000006,10],[2000006,15],[2060003,1000],[2061003,1000]); // Littleman B's name plate -eQuestPrizes[7] = new Array ([2000003,1], [2000006,1],[2022019,1],[2000006,5],[4010002,2],[4020001,2],[2022019,10],[2022019,15],[2000006,10],[2000006,15],[2060003,1000],[2061003,1000]); // Littleman C's necklace -eQuestPrizes[8] = new Array ([2022019,5],[2022022,5],[4010006,2],[2022019,10],[2022019,15],[2022022,10],[2022022,15],[2001002,15],[2001001,15],[1102043,1]); // Leader A's shades -eQuestPrizes[9] = new Array ([4010004,5],[2022019,5],[2022022,15],[2022019,15],[2001002,15],[2001001,15],[1102043,1]); // Leader B's charm -eQuestPrizes[10] = new Array([1102207,1],[1442026,1],[1302037,1],[2070007,1],[2340000,1],[2330005,1],[2022060,25],[2022061,20],[2022062,15]); // Boss pomade -var requiredItem = 0; +var eQuestChoices = [4000064, 4000065, 4000066, 4000075, 4000077, 4000089, 4000090, 4000091, 4000092, 4000093, 4000094]; +var eQuestPrizes = []; +eQuestPrizes[0] = [[2000000, 1], [2000006, 1], [2000003, 5], [2000002, 5], [4020006, 2], [4020000, 2], [4020004, 2], [2000003, 10], [2000003, 20], [2000002, 10], [2000002, 20], [2022026, 15], [2022024, 15], [1002393, 1]]; // Crow feather +eQuestPrizes[1] = [[2000006, 1], [2000002, 5], [4020006, 2], [2000002, 10], [2000003, 10], [2000002, 20], [2000003, 20], [2022024, 15], [2022026, 15]]; // Raccoon firewood +eQuestPrizes[2] = [[2000006, 1], [2000002, 5], [2000003, 5], [4020000, 2], [2000003, 10], [2000002, 10], [2000003, 20], [2000002, 20], [2022024, 15], [1002393, 1]]; // Cloud foxtail +eQuestPrizes[3] = [[2060003, 1000], [4010004, 2], [4010006, 2], [2022022, 5], [2022022, 10], [2022022, 15], [2022019, 5], [2022019, 10], [2022019, 15], [2001002, 15], [2001001, 15], [1102040, 1], [1102043, 1]]; // Tringular bandana of the nightghost +eQuestPrizes[4] = [[2000003, 1], [2022019, 5], [2000006, 5], [4010002, 2], [4010003, 2], [2000006, 10], [2000006, 15], [2022019, 10], [2022019, 15], [2060003, 1000], [2061003, 1000], [1082150, 1], [1082149, 1]]; // Dark cloud foxtail +eQuestPrizes[5] = [[2000006, 1], [2000003, 5], [2000002, 5], [2000003, 10], [2000003, 20], [2000002, 10], [2000002, 15], [2060003, 1000], [2061003, 1000], [2022026, 15], [1002395, 1]]; // Littleman A's badge +eQuestPrizes[6] = [[2022019, 5], [2000006, 5], [4010003, 2], [2022019, 10], [2022019, 15], [2000006, 10], [2000006, 15], [2060003, 1000], [2061003, 1000]]; // Littleman B's name plate +eQuestPrizes[7] = [[2000003, 1], [2000006, 1], [2022019, 1], [2000006, 5], [4010002, 2], [4020001, 2], [2022019, 10], [2022019, 15], [2000006, 10], [2000006, 15], [2060003, 1000], [2061003, 1000]]; // Littleman C's necklace +eQuestPrizes[8] = [[2022019, 5], [2022022, 5], [4010006, 2], [2022019, 10], [2022019, 15], [2022022, 10], [2022022, 15], [2001002, 15], [2001001, 15], [1102043, 1]]; // Leader A's shades +eQuestPrizes[9] = [[4010004, 5], [2022019, 5], [2022022, 15], [2022019, 15], [2001002, 15], [2001001, 15], [1102043, 1]]; // Leader B's charm +eQuestPrizes[10] = [[1102207, 1], [1442026, 1], [1302037, 1], [2070007, 1], [2340000, 1], [2330005, 1], [2022060, 25], [2022061, 20], [2022062, 15]]; // Boss pomade +var requiredItem = 0; var lastSelection = 0; -var prizeItem = 0; +var prizeItem = 0; var prizeQuantity = 0; var info; var itemSet; @@ -54,30 +54,32 @@ function action(mode, type, selection) { cm.sendOk("Really? Let me know if you ever change your mind."); cm.dispose(); return; - } if (mode == 0 && status == 1) { + } + if (mode == 0 && status == 1) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; + } if (status == 0) { cm.sendYesNo("If you're looking for someone that can pinpoint the characteristics of various items, you're looking at one right now. I'm currently looking for something. Would you like to hear my story?"); } else if (status == 1) { var eQuestChoice = makeChoices(eQuestChoices); cm.sendSimple(eQuestChoice); - } else if (status == 2){ + } else if (status == 2) { requiredItem = eQuestChoices[selection]; reward = eQuestPrizes[selection]; itemSet = (Math.floor(Math.random() * reward.length)); prizeItem = reward[itemSet][0]; prizeQuantity = reward[itemSet][1]; - if (!cm.canHold(prizeItem)){ + if (!cm.canHold(prizeItem)) { cm.sendNext("I can't give you the reward if your equip, use, or etc. inventory is full. Please go take a look right now."); - } else if (cm.hasItem(requiredItem, 100)){ // check they have >= 100 in Inventory - cm.gainItem(requiredItem,-100); - cm.gainItem(prizeItem,prizeQuantity); - cm.sendOk("Hmmm ... if not for this minor scratch ... sigh. I'm afraid I can only deem this a standard-quality item. Well, here's \r\n#t"+ prizeItem +"# for you."); - } else{ + } else if (cm.hasItem(requiredItem, 100)) { // check they have >= 100 in Inventory + cm.gainItem(requiredItem, -100); + cm.gainItem(prizeItem, prizeQuantity); + cm.sendOk("Hmmm ... if not for this minor scratch ... sigh. I'm afraid I can only deem this a standard-quality item. Well, here's \r\n#t" + prizeItem + "# for you."); + } else { cm.sendOk("Hey, what do you think you're doing? Go lie to someone that DOESN'T know what he's talking about. Not me!"); } cm.dispose(); @@ -85,9 +87,9 @@ function action(mode, type, selection) { } } -function makeChoices(a){ - var result = "The items I'm looking for are 1,2,3 ... phew, too many to\r\nmention. Anyhow, if you gather up 100 of the same items,\r\nthen i may trade it with something similiar. What? You may\r\nnot know this, but i keep my end of the promise, so you\r\nneed not worry. Now, shall we trade?\r\n"; - for (var x = 0; x< a.length; x++){ +function makeChoices(a) { + var result = "The items I'm looking for are 1,2,3 ... phew, too many to\r\nmention. Anyhow, if you gather up 100 of the same items,\r\nthen i may trade it with something similiar. What? You may\r\nnot know this, but i keep my end of the promise, so you\r\nneed not worry. Now, shall we trade?\r\n"; + for (var x = 0; x < a.length; x++) { result += " #L" + x + "##v" + a[x] + "##t" + a[x] + "##l\r\n"; } return result; diff --git a/scripts/npc/9120013.js b/scripts/npc/9120013.js index 5e03eaa915..5395167101 100644 --- a/scripts/npc/9120013.js +++ b/scripts/npc/9120013.js @@ -29,60 +29,55 @@ var questionNum; function start() { status = -1; - questions = new Array("Which of these items does the Flaming Raccoon NOT drop?","Which NPC is responsible for transporting travellers from Kerning City to Zipangu, and back?","Which of the items sold at the Mushroom Shrine increases your attack power?","Which of these items do the Extras NOT drop?","Which of these items DO NOT exist??","What's the name of the vegetable store owner in Showa Town?","Which of these items DO exist?","What is the name of the strongest boss in the Mushroom Shrine?","Which one of these items has a mis-matched class or level description?","Which of these noodles are NOT being sold by Robo at the Mushroom Shrine?","Which of these NPCs do NOT stand in front of Showa Movie Theater?") - answers = new Array(new Array("Raccoon Firewood","Solid Horn","Red Brick"),new Array("Peli","Spinel","Poli"),new Array("Takoyaki","Yakisoba","Tempura"),new Array("Extra A's Badge","Extra B's Corset","Extra C's Necklace"),new Array("Frozen Tuna","Fan","Fly Swatter"),new Array("Sami","Kami","Umi"),new Array("Cloud Fox's Tooth","Ghost's Bouquet","Dark Cloud Fox's Tail"),new Array("Black Crow","Blue Mushmom","Himegami"),new Array("Bamboo Spear - Warrior-only Weapon","Pico-Pico Hammer - One-handed Sword","Mystic Cane - Level 51 equip"),new Array("Kinoko Ramen (Pig Skull)","Kinoko Ramen (Salt)","Mushroom Miso Ramen"),new Array("Skye","Furano","Shinta")); - correctAnswer = new Array(1,1,0,1,2,2,2,0,0,2,2); + questions = ["Which of these items does the Flaming Raccoon NOT drop?", "Which NPC is responsible for transporting travellers from Kerning City to Zipangu, and back?", "Which of the items sold at the Mushroom Shrine increases your attack power?", "Which of these items do the Extras NOT drop?", "Which of these items DO NOT exist??", "What's the name of the vegetable store owner in Showa Town?", "Which of these items DO exist?", "What is the name of the strongest boss in the Mushroom Shrine?", "Which one of these items has a mis-matched class or level description?", "Which of these noodles are NOT being sold by Robo at the Mushroom Shrine?", "Which of these NPCs do NOT stand in front of Showa Movie Theater?"] + answers = [["Raccoon Firewood", "Solid Horn", "Red Brick"], ["Peli", "Spinel", "Poli"], ["Takoyaki", "Yakisoba", "Tempura"], ["Extra A's Badge", "Extra B's Corset", "Extra C's Necklace"], ["Frozen Tuna", "Fan", "Fly Swatter"], ["Sami", "Kami", "Umi"], ["Cloud Fox's Tooth", "Ghost's Bouquet", "Dark Cloud Fox's Tail"], ["Black Crow", "Blue Mushmom", "Himegami"], ["Bamboo Spear - Warrior-only Weapon", "Pico-Pico Hammer - One-handed Sword", "Mystic Cane - Level 51 equip"], ["Kinoko Ramen (Pig Skull)", "Kinoko Ramen (Salt)", "Mushroom Miso Ramen"], ["Skye", "Furano", "Shinta"]]; + correctAnswer = [1, 1, 0, 1, 2, 2, 2, 0, 0, 2, 2]; action(1, 0, 0); } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); - } - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - if (cm.isQuestStarted(8012) && !cm.haveItem(4031064)){ //quest in progress + if (cm.isQuestStarted(8012) && !cm.haveItem(4031064)) { //quest in progress cm.sendYesNo("Did you get them all? Are you going to try to answer all of my questions?"); - } - else { //quest not started or already completed + } else { //quest not started or already completed //cm.sendOk("Meeeoooowww!");//lol what's this? cm.dispose(); } - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { var hasChicken = true; - if (!cm.haveItem(2020001,300)) hasChicken=false; + if (!cm.haveItem(2020001, 300)) { + hasChicken = false; + } if (!hasChicken) { cm.sendOk("What? No! 300! THREE. HUNDRED. No less. Hand over more if you want, but I need at least 300. Not all of us can be as big and as fed as you..."); cm.dispose(); - } - else { + } else { cm.gainItem(2020001, -300) cm.sendNext("Good job! Now hold on a sec... Hey look! I got some food here! Help yourselves. Okay, now it's time for me to ask you some questions. I'm sure you're aware of this, but remember, if you're wrong, it's over. It's all or nothing!"); } - } - else if (status == 7 && mode == 1) { //2-6 are the questions - if (selection != correctAnswer.pop()){ + } else if (status == 7 && mode == 1) { //2-6 are the questions + if (selection != correctAnswer.pop()) { cm.sendNext("Hmmm...all humans make mistakes anyway! If you want to take another crack at it, then bring me 300 Fried Chicken.") cm.dispose(); - } - else { + } else { cm.sendNext("Dang, you answered all the questions right. I may not like humans in general, but I HATE breaking a promise, so, as promised, here's the Orange Marble.") } - } - else if (status == 8 && mode == 1) { //gain marble + } else if (status == 8 && mode == 1) { //gain marble cm.gainItem(4031064, 1); cm.sendOk("Our business is concluded, thank you very much! You can leave now!"); cm.dispose(); - } - else if (status >= 2 && status <= 6 && mode == 1) {//questions + } else if (status >= 2 && status <= 6 && mode == 1) {//questions var cont = true; if (status > 2) { - if (selection != correctAnswer.pop()){ + if (selection != correctAnswer.pop()) { cm.sendNext("Hmmm...all humans make mistakes anyway! If you want to take another crack at it, then bring me 300 Fried Chicken.") cm.dispose(); cont = false; @@ -90,7 +85,7 @@ function action(mode, type, selection) { } if (cont) { questionNum = Math.floor(Math.random() * questions.length); - if (questionNum != (questions.length - 1)){ + if (questionNum != (questions.length - 1)) { var temp; temp = questions[questionNum]; questions[questionNum] = questions[questions.length - 1]; @@ -105,8 +100,9 @@ function action(mode, type, selection) { var question = questions.pop(); var answer = answers.pop(); var prompt = "Question no." + (status - 1) + ": " + question; - for (var i = 0; i < answer.length; i++) + for (var i = 0; i < answer.length; i++) { prompt += "\r\n#b#L" + i + "#" + answer[i] + "#l#k"; + } cm.sendSimple(prompt); } } diff --git a/scripts/npc/9120015.js b/scripts/npc/9120015.js index f5846c1ac1..2729d9de62 100644 --- a/scripts/npc/9120015.js +++ b/scripts/npc/9120015.js @@ -20,18 +20,19 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Konpei - Showa Town(801000000) --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.1 - Fixed by Moogra - 1.0 - First Version by Information ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Konpei - Showa Town(801000000) + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.1 - Fixed by Moogra + 1.0 - First Version by Information + --------------------------------------------------------------------------------------------------- + **/ var status = 0; + function start() { - cm.sendSimple ("What do you want from me?\r #L0##bGather up some information on the hideout.#l\r\n#L1#Take me to the hideout#l\r\n#L2#Nothing#l#k"); + cm.sendSimple("What do you want from me?\r #L0##bGather up some information on the hideout.#l\r\n#L1#Take me to the hideout#l\r\n#L2#Nothing#l#k"); } function action(mode, type, selection) { @@ -43,9 +44,9 @@ function action(mode, type, selection) { if (selection == 0) { cm.sendNext("I can take you to the hideout, but the place is infested with thugs looking for trouble. You'll need to be both incredibly strong and brave to enter the premise. At the hideaway, you'll find the Boss that controls all the other bosses around this area. It's easy to get to the hideout, but the room on the top floor of the place can only be entered ONCE a day. The Boss's Room is not a place to mess around. I suggest you don't stay there for too long; you'll need to swiftly take care of the business once inside. The boss himself is a difficult foe, but you'll run into some incredibly powerful enemies on you way to meeting the boss! It ain't going to be easy."); cm.dispose(); - } else if (selection == 1) + } else if (selection == 1) { cm.sendNext("Oh, the brave one. I've been awaiting your arrival. If these\r\nthugs are left unchecked, there's no telling what going to\r\nhappen in this neighborhood. Before that happens, I hope\r\nyou take care of all them and beat the boss, who resides\r\non the 5th floor. You'll need to be on alert at all times, since\r\nthe boss is too tough for even wisemen to handle.\r\nLooking at your eyes, however, I can see that eye of the\r\ntiger, the eyes that tell me you can do this. Let's go!"); - else { + } else { cm.sendOk("I'm a busy person! Leave me alone if that's all you need!"); cm.dispose(); } diff --git a/scripts/npc/9120100.js b/scripts/npc/9120100.js index 8bc681d7eb..4851cd77b2 100644 --- a/scripts/npc/9120100.js +++ b/scripts/npc/9120100.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Welcome to the Showa hair shop. If you have a #b#t5150009##k, or a #b#t5151009##k, allow me to take care of your hairdo. Please choose the one you want.\r\n#L1#Haircut: #i5150009##t5150009##l\r\n#L2#Dye your hair: #i5151009##t5151009##l"); } else if (status == 1) { @@ -58,30 +59,29 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { - pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); + for (var i = 0; i < mhair_v.length; i++) { + pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) { - pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); + for (var i = 0; i < fhair_v.length; i++) { + pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } cm.sendStyle("I can totally change up your hairstyle and make it look so good. Why don't you change it up a bit? With #b#t5150009##k, I'll take care of the rest for you. Choose the style of your liking!", hairnew); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t5151009##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150009)){ + if (beauty == 1) { + if (cm.haveItem(5150009)) { cm.gainItem(5150009, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -89,8 +89,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151009)){ + if (beauty == 2) { + if (cm.haveItem(5151009)) { cm.gainItem(5151009, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -98,7 +98,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150009, 1); diff --git a/scripts/npc/9120101.js b/scripts/npc/9120101.js index 6693ef7b75..9ebfde3757 100644 --- a/scripts/npc/9120101.js +++ b/scripts/npc/9120101.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hi, I'm the assistant here. Don't worry, I'm plenty good enough for this. If you have #b#t5150008##k or #b#t5151008##k by any chance, then allow me to take care of the rest, alright?\r\n#L1#Haircut: #i5150008##t5150008##l\r\n#L2#Dye your hair: #i5151008##t5151008##l"); } else if (status == 1) { @@ -58,12 +59,12 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_r.length; i++) { - pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + for (var i = 0; i < mhair_r.length; i++) { + pushIfItemExists(hairnew, mhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_r.length; i++) { + for (var i = 0; i < fhair_r.length; i++) { pushIfItemExists(hairnew, fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); } } @@ -71,32 +72,31 @@ function action(mode, type, selection) { } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5151008##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150008)){ + if (beauty == 1) { + if (cm.haveItem(5150008)) { cm.gainItem(5150008, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } - } else if (beauty == 2){ - if (cm.haveItem(5151008)){ + } else if (beauty == 2) { + if (cm.haveItem(5151008)) { cm.gainItem(5151008, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150008, 1); diff --git a/scripts/npc/9120102.js b/scripts/npc/9120102.js index e0fdb4a85e..453ee00f49 100644 --- a/scripts/npc/9120102.js +++ b/scripts/npc/9120102.js @@ -43,7 +43,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -59,10 +59,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well well well, welcome to the Showa Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152009##k or a #b#t5152045##k, you can let us take care of the rest and have the face you've always wanted~!\r\n#L1#Plastic Surgery: #i5152009##t5152009##l\r\n#L2#Cosmetic Lens: #i5152045##t5152045##l\r\n#L3#One-time Cosmetic Lenses: #i5152102# (any color)#l"); } else if (status == 1) { @@ -70,14 +71,14 @@ function action(mode, type, selection) { beauty = 0; facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) { + for (var i = 0; i < mface_v.length; i++) { pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) { + for (var i = 0; i < fface_v.length; i++) { pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); @@ -88,47 +89,46 @@ function action(mode, type, selection) { beauty = 1; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 200, current + 300, current +400, current + 500, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 200, current + 300, current + 400, current + 500, current + 700]); cm.sendStyle("With our new computer program, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Please choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - + if (beauty == 0) { - if (cm.haveItem(5152009) == true){ + if (cm.haveItem(5152009) == true) { cm.gainItem(5152009, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); @@ -136,17 +136,17 @@ function action(mode, type, selection) { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } } else if (beauty == 1) { - if (cm.haveItem(5152045) == true){ + if (cm.haveItem(5152045) == true) { cm.gainItem(5152045, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } - } else if (beauty == 3){ + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); diff --git a/scripts/npc/9120103.js b/scripts/npc/9120103.js index 11ba8384a5..6db8aa08df 100644 --- a/scripts/npc/9120103.js +++ b/scripts/npc/9120103.js @@ -43,7 +43,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -63,31 +63,33 @@ function action(mode, type, selection) { if (selection == 1) { beauty = 0; facenew = Array(); - if (cm.getPlayer().getGender() == 0) - for (var i = 0; i < mface_r.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); - else - for (var i = 0; i < fface_r.length; i++) + } + } else { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152008##k?"); } else if (selection == 2) { beauty = 1; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 200, current + 300, current +400, current + 500, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 200, current + 300, current + 400, current + 500, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152046##k and really make the change to your eyes?"); } - } - else if (status == 2){ + } else if (status == 2) { if (beauty == 0) { - if (cm.haveItem(5152008)){ + if (cm.haveItem(5152008)) { cm.gainItem(5152008, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); @@ -95,7 +97,7 @@ function action(mode, type, selection) { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } } else if (beauty == 1) { - if (cm.haveItem(5152046)){ + if (cm.haveItem(5152046)) { cm.gainItem(5152046, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); @@ -103,7 +105,7 @@ function action(mode, type, selection) { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } } - + cm.dispose(); } } diff --git a/scripts/npc/9120201.js b/scripts/npc/9120201.js index 90d4d67821..6ada64e354 100644 --- a/scripts/npc/9120201.js +++ b/scripts/npc/9120201.js @@ -81,12 +81,12 @@ function action(mode, type, selection) { } else if (expedition.isInProgress()) { //Only if the expedition is in progress if (expedition.contains(player)) { //If you're registered, warp you in var eim = em.getInstance(expedName + player.getClient().getChannel()); - if(eim.getIntProperty("canJoin") == 1) { + if (eim.getIntProperty("canJoin") == 1) { eim.registerPlayer(player); } else { cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls."); } - + cm.dispose(); } else { //If you're not in by now, tough luck cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); @@ -100,14 +100,14 @@ function action(mode, type, selection) { cm.dispose(); return; } - + expedition = cm.getExpedition(exped); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(exped); if (res == 0) { cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -116,13 +116,13 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + "."); cm.dispose(); - return; + } } else if (status == 2) { if (selection == 1) { @@ -147,14 +147,14 @@ function action(mode, type, selection) { status = 6; } else if (selection == 2) { var min = exped.getMinSize(); - + var size = expedition.getMemberList().size(); if (size < min) { cm.sendOk("You need at least " + min + " players registered in your expedition."); cm.dispose(); return; } - + cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { @@ -163,7 +163,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -174,14 +174,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/9120202.js b/scripts/npc/9120202.js index 0135fc7197..45f17371d4 100644 --- a/scripts/npc/9120202.js +++ b/scripts/npc/9120202.js @@ -23,50 +23,51 @@ * * @Author Ronan */ - + var status; - + function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - if(!eim.isEventCleared()) { - if (status == 0) { - cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?"); - } else if (status == 1) { - cm.warp(801040004, 1); - cm.dispose(); - } - } else { - if(status == 0) { - cm.sendNext("You guys did it, great job! Now our city is free from the tyranny of their mobs! As representative of the city, please accept this as a prize for your efforts, as I get you back to town."); - } - - if(status == 1) { - var eim = cm.getEventInstance(); - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendNext("Please make room on your inventory first..."); - } else { - cm.warp(801040101); - } - - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + if (!eim.isEventCleared()) { + if (status == 0) { + cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?"); + } else if (status == 1) { + cm.warp(801040004, 1); + cm.dispose(); + } + } else { + if (status == 0) { + cm.sendNext("You guys did it, great job! Now our city is free from the tyranny of their mobs! As representative of the city, please accept this as a prize for your efforts, as I get you back to town."); + } + + if (status == 1) { + var eim = cm.getEventInstance(); + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendNext("Please make room on your inventory first..."); + } else { + cm.warp(801040101); + } + + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9120203.js b/scripts/npc/9120203.js index 69c77ad353..71de0bc762 100644 --- a/scripts/npc/9120203.js +++ b/scripts/npc/9120203.js @@ -21,40 +21,41 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Konpei - Near the Hideout (Beautiful Sky)(801040101) --- By --------------------------------------------------------------------------------------------- - Ronan --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Ronan ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Konpei - Near the Hideout (Beautiful Sky)(801040101) + -- By --------------------------------------------------------------------------------------------- + Ronan + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Ronan + --------------------------------------------------------------------------------------------------- + **/ var status; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendNext("Ah, The Boss has been defeated. What a happy day this turns out to be! Congratulations, everyone. Follow this way back to town."); - } else if (status == 1) { - cm.warp(801000000); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendNext("Ah, The Boss has been defeated. What a happy day this turns out to be! Congratulations, everyone. Follow this way back to town."); + } else if (status == 1) { + cm.warp(801000000); + cm.dispose(); + } + } } diff --git a/scripts/npc/9200100.js b/scripts/npc/9200100.js index 85bc796f47..9c36972468 100644 --- a/scripts/npc/9200100.js +++ b/scripts/npc/9200100.js @@ -37,7 +37,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -51,88 +51,95 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - - if (status == 0) + } + + if (status == 0) { cm.sendSimple("Hi, there~! I'm Dr. Lenu, in charge of the cosmetic lenses here at the Henesys Plastic Surgery Shop! With #b#t5152010##k or #b#t5152013##k, you can let us take care of the rest and have the kind of beautiful look you've always craved~! Remember, the first thing everyone notices about you is the eyes, and we can help you find the cosmetic lens that most fits you! Now, what would you like to use?\r\n#L1#Cosmetic Lenses: #i5152010##t5152010##l\r\n#L2#Cosmetic Lenses: #i5152013##t5152013##l\r\n#L3#One-time Cosmetic Lenses: #i5152103# (any color)#l"); - else if (status == 1) { + } else if (status == 1) { if (selection == 1) { beauty = 1; - if (cm.getPlayer().getGender() == 0) - var current = cm.getPlayer().getFace()% 100 + 20000; - if (cm.getPlayer().getGender() == 1) - var current = cm.getPlayer().getFace()% 100 + 21000; + if (cm.getPlayer().getGender() == 0) { + var current = cm.getPlayer().getFace() % 100 + 20000; + } + if (cm.getPlayer().getGender() == 1) { + var current = cm.getPlayer().getFace() % 100 + 21000; + } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 200, current +400, current + 600, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 200, current + 400, current + 600, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152010##k and really make the change to your eyes?"); } else if (selection == 2) { beauty = 2; - if (cm.getPlayer().getGender() == 0) - var current = cm.getPlayer().getFace()% 100 + 20000; - if (cm.getPlayer().getGender() == 1) + if (cm.getPlayer().getGender() == 0) { + var current = cm.getPlayer().getFace() % 100 + 20000; + } + if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() % 100 + 21000; + } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 200, current +400, current + 600, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 200, current + 400, current + 600, current + 700]); cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5152010) == true){ + if (beauty == 1) { + if (cm.haveItem(5152010) == true) { cm.gainItem(5152010, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else + } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); - } else if (beauty == 2){ - if (cm.haveItem(5152013) == true){ + } + } else if (beauty == 2) { + if (cm.haveItem(5152013) == true) { cm.gainItem(5152013, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else + } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); - } else if (beauty == 3){ + } + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= regprice) { cm.gainMeso(-regprice); cm.gainItem(5152010, 1); @@ -141,8 +148,9 @@ function action(mode, type, selection) { cm.gainMeso(-vipprice); cm.gainItem(5152013, 1); cm.sendOk("Enjoy!"); - } else + } else { cm.sendOk("You don't have enough mesos to buy a coupon!"); + } } } } diff --git a/scripts/npc/9200101.js b/scripts/npc/9200101.js index 99532c29b4..b46dad66ec 100644 --- a/scripts/npc/9200101.js +++ b/scripts/npc/9200101.js @@ -37,7 +37,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -53,10 +53,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hello, I'm Dr. Rhomes, head of the cosmetic lens department here at the Orbis Plastic Surgery Shop.\r\nMy goal here is to add personality to everyone's eyes through the wonders of cosmetic lenses, and with #b#t5152011##k or #b#t5152014##k, I can do the same for you, too! Now, what would you like to use?\r\n#L1#Cosmetic Lenses: #i5152011##t5152011##l\r\n#L2#Cosmetic Lenses: #i5152014##t5152014##l\r\n#L3#One-time Cosmetic Lenses: #i5152104# (any color)#l"); } else if (status == 1) { @@ -64,84 +65,83 @@ function action(mode, type, selection) { beauty = 1; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current + 100, current + 300, current +400, current + 700]); + pushIfItemsExists(colors, [current + 100, current + 300, current + 400, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152011##k and really make the change to your eyes?"); } else if (selection == 2) { beauty = 2; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current + 100, current + 300, current +400, current + 700]); + pushIfItemsExists(colors, [current + 100, current + 300, current + 400, current + 700]); cm.sendStyle("With our new computer program, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Please choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5152011)){ + if (beauty == 1) { + if (cm.haveItem(5152011)) { cm.gainItem(5152011, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 2){ - if (cm.haveItem(5152014)){ + } else if (beauty == 2) { + if (cm.haveItem(5152014)) { cm.gainItem(5152014, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 3){ + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= regprice) { cm.gainMeso(-regprice); cm.gainItem(5152011, 1); diff --git a/scripts/npc/9200102.js b/scripts/npc/9200102.js index 69386b776f..22466a2baf 100644 --- a/scripts/npc/9200102.js +++ b/scripts/npc/9200102.js @@ -37,7 +37,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -53,10 +53,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Um... hi, I'm Dr. Bosch, and I am a cosmetic lens expert here at the Ludibrium Plastic Surgery Shop. I believe your eyes are the most important feature in your body, and with #b#t5152012##k or #b#t5152015##k, I can prescribe the right kind of cosmetic lenses for you. Now, what would you like to use?\r\n#L1#Cosmetic Lenses: #i5152012##t5152012##l\r\n#L2#Cosmetic Lenses: #i5152015##t5152015##l\r\n#L3#One-time Cosmetic Lenses: #i5152105# (any color)#l"); } else if (status == 1) { @@ -69,7 +70,7 @@ function action(mode, type, selection) { var current = cm.getPlayer().getFace() % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current + 200, current + 300, current +400, current + 500, current + 700]); + pushIfItemsExists(colors, [current + 200, current + 300, current + 400, current + 500, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152012##k and really make the change to your eyes?"); } else if (selection == 2) { beauty = 2; @@ -80,38 +81,37 @@ function action(mode, type, selection) { var current = cm.getPlayer().getFace() % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current + 200, current + 300, current +400, current + 500, current + 700]); + pushIfItemsExists(colors, [current + 200, current + 300, current + 400, current + 500, current + 700]); cm.sendStyle("With our new computer program, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Please choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2){ - if (beauty == 1){ - if (cm.haveItem(5152012) == true){ + } else if (status == 2) { + if (beauty == 1) { + if (cm.haveItem(5152012) == true) { cm.gainItem(5152012, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); @@ -120,8 +120,8 @@ function action(mode, type, selection) { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); cm.dispose(); } - } else if (beauty == 2){ - if (cm.haveItem(5152015) == true){ + } else if (beauty == 2) { + if (cm.haveItem(5152015) == true) { cm.gainItem(5152015, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); @@ -130,17 +130,17 @@ function action(mode, type, selection) { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); cm.dispose(); } - } else if (beauty == 3){ + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= regprice) { cm.gainMeso(-regprice); cm.gainItem(5152012, 1); diff --git a/scripts/npc/9201000.js b/scripts/npc/9201000.js index c684ffdf3d..e3c60a5b41 100644 --- a/scripts/npc/9201000.js +++ b/scripts/npc/9201000.js @@ -33,12 +33,12 @@ var cost; var options; function hasEngagementBox(player) { - for(var i = 2240000; i <= 2240003; i++) { - if(player.haveItem(i)) { + for (var i = 2240000; i <= 2240003; i++) { + if (player.haveItem(i)) { return true; } } - + return false; } @@ -55,18 +55,19 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { options = ["I want to make a ring.", "I want to discard the ring box I have."]; cm.sendSimple("I'm #p9201000#, the #bengagement ring maker#k. How can I help you?\r\n\r\n#b" + generateSelectionMenu(options)); - } else if(status == 1) { - if(selection == 0) { - if(!cm.isQuestCompleted(100400)) { - if(!cm.isQuestStarted(100400)) { + } else if (status == 1) { + if (selection == 0) { + if (!cm.isQuestCompleted(100400)) { + if (!cm.isQuestStarted(100400)) { state = 0; cm.sendNext("So you want to make a engagement ring, huh? Very well, I can provide one after you receive #rblessings#k from your #b#p9201003##k."); } else { @@ -74,45 +75,45 @@ function action(mode, type, selection) { cm.dispose(); } } else { - if(hasEngagementBox(cm.getPlayer())) { + if (hasEngagementBox(cm.getPlayer())) { cm.sendOk("Sorry, you already have an engagement box. I cannot provide you more than one box per time."); cm.dispose(); return; } - if(cm.getPlayer().getGender() != 0) { + if (cm.getPlayer().getGender() != 0) { cm.sendOk("Sorry, but the ring box is currently available only for males."); cm.dispose(); return; } state = 1; - options = ["Moonstone","Star Gem","Golden Heart", "Silver Swan"]; + options = ["Moonstone", "Star Gem", "Golden Heart", "Silver Swan"]; var selStr = "So, what kind of engagement ring you want me to craft?\r\n\r\n#b" + generateSelectionMenu(options); cm.sendSimple(selStr); } } else { - if(hasEngagementBox(cm.getPlayer())) { - for(var i = 2240000; i <= 2240003; i++) { + if (hasEngagementBox(cm.getPlayer())) { + for (var i = 2240000; i <= 2240003; i++) { cm.removeAll(i); } - + cm.sendOk("Your ring box has been discarded."); } else { cm.sendOk("You have no ring box to discard."); } - + cm.dispose(); } - } else if(status == 2) { - if(state == 0) { + } else if (status == 2) { + if (state == 0) { cm.sendOk("Where do they live, you ask? My, it goes way back... you see, I'm a friend of theirs, and I was the one who crafted and personally delivered their engagement ring. They live beyond #rHenesys Hunting Grounds#k, I'm sure you know where it is."); cm.startQuest(100400); cm.dispose(); } else { - var itemSet = new Array(2240000,2240001,2240002,2240003); - var matSet = new Array(new Array(4011007,4021007),new Array(4021009,4021007),new Array(4011006,4021007),new Array(4011004,4021007)); - var matQtySet = new Array(new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1)); - var costSet = new Array (30000,20000,10000,5000); + var itemSet = [2240000, 2240001, 2240002, 2240003]; + var matSet = [[4011007, 4021007], [4021009, 4021007], [4011006, 4021007], [4011004, 4021007]]; + var matQtySet = [[1, 1], [1, 1], [1, 1], [1, 1]]; + var costSet = [30000, 20000, 10000, 5000]; item = itemSet[selection]; mats = matSet[selection]; @@ -122,59 +123,58 @@ function action(mode, type, selection) { var prompt = "Then I'm going to craft you a #b#t" + item + "##k, is that right?"; prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#"; + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] + " #t" + mats[i] + "#"; } - } - else { - prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#"; + } else { + prompt += "\r\n#i" + mats + "# " + matQty + " #t" + mats + "#"; } - if (cost > 0) + if (cost > 0) { prompt += "\r\n#i4031138# " + cost + " meso"; + } cm.sendYesNo(prompt); } - } else if(status == 3) { + } else if (status == 3) { var complete = true; var recvItem = item, recvQty = 1, qty = 1; - if(!cm.canHold(recvItem, recvQty)) { + if (!cm.canHold(recvItem, recvQty)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost * qty) - { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("I'm sorry but there's a fee for my services. Please bring me the right amount of mesos here before trying to forge a ring."); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; + } } - if (!complete) + if (!complete) { cm.sendOk("Hm, it seems you're lacking some ingredients for the engagement ring. Please provide them first, will you?"); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } - } - else + } else { cm.gainItem(mats, -matQty * qty); + } - if (cost > 0) + if (cost > 0) { cm.gainMeso(-cost * qty); + } cm.gainItem(recvItem, recvQty); cm.sendOk("All done, the engagement ring came out just right. I wish you a happy engagement."); diff --git a/scripts/npc/9201001.js b/scripts/npc/9201001.js index d654fed771..88b7ef85cd 100644 --- a/scripts/npc/9201001.js +++ b/scripts/npc/9201001.js @@ -34,25 +34,25 @@ var options; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } function getNanaLocation(player) { var mapid = player.getMap().getId(); - - for(var i = 0; i < mapids.length; i++) { - if(mapid == mapids[i]) { + + for (var i = 0; i < mapids.length; i++) { + if (mapid == mapids[i]) { return i; } } - + return -1; } @@ -62,8 +62,8 @@ var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128]; var questExp = [2000, 5000, 10000, 17000, 22000, 30000]; function processNanaQuest() { - if(cm.haveItem(questItems[nanaLoc], 50)) { - if(cm.canHold(4031367 + nanaLoc, 1)) { + if (cm.haveItem(questItems[nanaLoc], 50)) { + if (cm.canHold(4031367 + nanaLoc, 1)) { cm.gainItem(questItems[nanaLoc], -50); cm.gainItem(4031367 + nanaLoc, 1); @@ -75,7 +75,7 @@ function processNanaQuest() { } else { cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k."); } - + return false; } @@ -92,35 +92,36 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(!cm.isQuestStarted(100400)) { + if (status == 0) { + if (!cm.isQuestStarted(100400)) { cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love."); cm.dispose(); return; } - + nanaLoc = getNanaLocation(cm.getPlayer()); - if(nanaLoc == -1) { + if (nanaLoc == -1) { cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love."); cm.dispose(); return; } - - if(!cm.haveItem(4031367 + nanaLoc, 1)) { - if(cm.isQuestCompleted(100401 + nanaLoc)) { + + if (!cm.haveItem(4031367 + nanaLoc, 1)) { + if (cm.isQuestCompleted(100401 + nanaLoc)) { state = 1; cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k"); - } else if(cm.isQuestStarted(100401 + nanaLoc)) { - if(processNanaQuest()) { + } else if (cm.isQuestStarted(100401 + nanaLoc)) { + if (processNanaQuest()) { cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate()); cm.completeQuest(100401 + nanaLoc); } - + cm.dispose(); } else { state = 0; @@ -130,10 +131,10 @@ function action(mode, type, selection) { cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?"); cm.dispose(); } - } else if(status == 1) { - if(state == 0) { + } else if (status == 1) { + if (state == 0) { cm.startQuest(100401 + nanaLoc); - + cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k."); cm.dispose(); } else { diff --git a/scripts/npc/9201002.js b/scripts/npc/9201002.js index 2825cacd15..b9b60fcd7c 100644 --- a/scripts/npc/9201002.js +++ b/scripts/npc/9201002.js @@ -37,7 +37,7 @@ function isWeddingIndoors(mapid) { function getMarriageInstance(player) { var em = cm.getEventManager(weddingEventName); - for (var iterator = em.getInstances().iterator(); iterator.hasNext(); ) { + for (var iterator = em.getInstances().iterator(); iterator.hasNext();) { var eim = iterator.next(); if (eim.isEventLeader(player)) { return eim; @@ -82,15 +82,19 @@ function isSuitedForWedding(player, equipped) { } function getWeddingPreparationStatus(player, partner) { - if (!player.haveItem(4000313)) + if (!player.haveItem(4000313)) { return -3; - if (!partner.haveItem(4000313)) + } + if (!partner.haveItem(4000313)) { return 3; + } - if (!isSuitedForWedding(player, true)) + if (!isSuitedForWedding(player, true)) { return -4; - if (!isSuitedForWedding(partner, true)) + } + if (!isSuitedForWedding(partner, true)) { return 4; + } var hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { @@ -99,8 +103,9 @@ function getWeddingPreparationStatus(player, partner) { break; } } - if (!hasEngagement) + if (!hasEngagement) { return -1; + } hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { @@ -109,13 +114,16 @@ function getWeddingPreparationStatus(player, partner) { break; } } - if (!hasEngagement) + if (!hasEngagement) { return -2; + } - if (!player.canHold(1112803)) + if (!player.canHold(1112803)) { return 1; - if (!partner.canHold(1112803)) + } + if (!partner.canHold(1112803)) { return 2; + } return 0; } @@ -129,8 +137,9 @@ function giveCoupleBlessings(eim, player, partner) { function start() { weddingIndoors = isWeddingIndoors(cm.getMapId()); - if (weddingIndoors) + if (weddingIndoors) { eim = cm.getEventInstance(); + } status = -1; action(1, 0, 0); @@ -144,10 +153,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (!weddingIndoors) { if (status == 0) { diff --git a/scripts/npc/9201003.js b/scripts/npc/9201003.js index 2f30233c03..92188c648b 100644 --- a/scripts/npc/9201003.js +++ b/scripts/npc/9201003.js @@ -30,13 +30,13 @@ var state = 0; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } @@ -53,10 +53,11 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { if (!cm.isQuestStarted(100400)) { @@ -66,7 +67,7 @@ function action(mode, type, selection) { if (cm.getQuestProgressInt(100400, 1) == 0) { cm.sendNext("Mom, dad, I have a request to do to both of you... I wanna know more about the path you've already been walking since always, the path of loving and caring for someone dear to me.", 2); } else { - if(!hasProofOfLoves(cm.getPlayer())) { + if (!hasProofOfLoves(cm.getPlayer())) { cm.sendOk("Dear, we need to make sure you are really ready to fall in love with whoever you choose to be your partner, please bring here #b4 #t4031367#'s#k."); cm.dispose(); } else { @@ -80,13 +81,13 @@ function action(mode, type, selection) { cm.sendNextPrev("My dear! How thoughtful of you asking our help. Surely we will help you out!"); } else { cm.sendOk("Mom... Dad... Thanks a lot for your tender support!!!", 2); - + cm.completeQuest(100400); cm.gainExp(20000 * cm.getPlayer().getExpRate()); - for(var i = 4031367; i <= 4031372; i++) { + for (var i = 4031367; i <= 4031372; i++) { cm.removeAll(i); } - + cm.dispose(); } } else if (status == 2) { diff --git a/scripts/npc/9201004.js b/scripts/npc/9201004.js index 0a1f05002a..d7e8a980bf 100644 --- a/scripts/npc/9201004.js +++ b/scripts/npc/9201004.js @@ -34,7 +34,7 @@ function getWeddingRingItemId(player) { return rings[i]; } } - + return null; } @@ -44,13 +44,13 @@ function hasEquippedWeddingRing(player) { return true; } } - + return false; } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { @@ -61,72 +61,76 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { var questionStr = ["How can I engage someone?", "How can I marry?", "How can I divorce?"] - - if(!(!cm.getPlayer().isMarried() && getWeddingRingItemId(cm.getPlayer()))) questionStr.push("I want a divorce..."); - else questionStr.push("I wanna remove my old wedding ring..."); - + + if (!(!cm.getPlayer().isMarried() && getWeddingRingItemId(cm.getPlayer()))) { + questionStr.push("I want a divorce..."); + } else { + questionStr.push("I wanna remove my old wedding ring..."); + } + cm.sendSimple("Hello, welcome to #bAmoria#k, a beautiful land where maplers can find love and, if inspired enough, even marry. Do you have any questions about Amoria? Talk it to me.#b\r\n\r\n" + generateSelectionMenu(questionStr)); - } else if(status == 1) { - switch(selection) { + } else if (status == 1) { + switch (selection) { case 0: cm.sendOk("The #bengagement process#k is as straightforward as it can be. Starting from a prequest from the #bring maker, #p9201000##k, gather #b#t4031367#'s#k thoughout the Maple world.\r\n\r\nCompleting it, you will be able to craft an engagement ring. With one in hands, declare yourself to someone you become fond of, and hope that person feels the same way."); cm.dispose(); break; - + case 1: cm.sendOk("For the #bmarriage process#k you must be already engaged. The loving couple must choose a venue they want to hold their marriage. Amoria offers two: the #rCathedral#k and the #rChapel#k.\r\nThen, one of the partners must buy a #bWedding Ticket#k, available through the Cash Shop, and book their ceremony with the Wedding Assistant. Each partner will receive #rguest tickets#k to be distributed to their acquaintances."); cm.dispose(); break; - + case 2: cm.sendOk("Unfortunately the love of long may fizzle someday. Well, I hope that's not the case for any loving couple that once married, is marrying today or is going to do so tomorrow. But, if that ever happens, I myself will be at service to make a safe divorce, by the fee of #r" + divorceFee + "#k mesos."); cm.dispose(); break; - + case 3: ringObj = cm.getPlayer().getMarriageRing(); - if(ringObj == null) { + if (ringObj == null) { var itemid = getWeddingRingItemId(cm.getPlayer()); - - if(itemid != null) { + + if (itemid != null) { cm.sendOk("There you go, I've removed your old wedding ring."); cm.gainItem(itemid, -1); - } else if(hasEquippedWeddingRing(cm.getPlayer())) { + } else if (hasEquippedWeddingRing(cm.getPlayer())) { cm.sendOk("If you want your old wedding ring removed, please unequip it before talking to me."); } else { cm.sendOk("You're not married to require a divorce from it."); } - + cm.dispose(); return; } - + cm.sendYesNo("So, you want to divorce from your partner? Be sure, this process #bcannot be rollbacked#k by any means, it's supposed to be an ultimatum from which your ring will be destroyed as consequence. That said, do you #rreally want to divorce#k?"); break; } - } else if(status == 2) { - if(cm.getMeso() < divorceFee) { + } else if (status == 2) { + if (cm.getMeso() < divorceFee) { cm.sendOk("You don't have the required amount of #r" + divorceFee + " mesos#k for the divorce fee."); cm.dispose(); return; - } else if(ringObj.equipped()) { + } else if (ringObj.equipped()) { cm.sendOk("Please unequip your ring before trying to divorce."); cm.dispose(); return; } - + cm.gainMeso(-divorceFee); const RingActionHandler = Java.type('net.server.channel.handlers.RingActionHandler'); RingActionHandler.breakMarriageRing(cm.getPlayer(), ringObj.getItemId()); cm.gainItem(ringObj.getItemId(), -1); - + cm.sendOk("You have divorced from your partner."); cm.dispose(); } diff --git a/scripts/npc/9201005.js b/scripts/npc/9201005.js index d81ab704fa..6cc532a9dd 100644 --- a/scripts/npc/9201005.js +++ b/scripts/npc/9201005.js @@ -40,27 +40,27 @@ function isWeddingIndoors(mapid) { function hasSuitForWedding(player) { var baseid = (player.getGender() == 0) ? 1050131 : 1051150; - - for(var i = 0; i < 4; i++) { - if(player.haveItemWithId(baseid + i, true)) { + + for (var i = 0; i < 4; i++) { + if (player.haveItemWithId(baseid + i, true)) { return true; } } - + return false; } function getMarriageInstance(weddingId) { var em = cm.getEventManager(weddingEventName); - + for (var iterator = em.getInstances().iterator(); iterator.hasNext();) { var eim = iterator.next(); - - if(eim.getIntProperty("weddingId") == weddingId) { + + if (eim.getIntProperty("weddingId") == weddingId) { return eim; } } - + return null; } @@ -71,18 +71,18 @@ function hasWeddingRing(player) { return true; } } - + return false; } -function start() { +function start() { weddingIndoors = isWeddingIndoors(cm.getMapId()); status = -1; - - action(1, 0, 0); -} -function action(mode, type, selection) { + action(1, 0, 0); +} + +function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { @@ -90,12 +90,13 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - - if(!weddingIndoors) { + } + + if (!weddingIndoors) { var hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { if (cm.haveItem(x, 1)) { @@ -110,56 +111,56 @@ function action(mode, type, selection) { for (x = 0; x < choice.length; x++) { text += "\r\n#L" + x + "##b" + choice[x] + "#l"; } - + if (cm.haveItem(5251100)) { text += "\r\n#L" + x + "##bMake additional invitation cards#l"; } - + cm.sendSimple(text); } else if (status == 1) { - switch(selection) { + switch (selection) { case 0: cm.sendOk("Firstly you need to be #bengaged#k to someone. #p9201000# makes the engagement ring. Once attained the engagement status, purchase a #b#t" + weddingEntryTicketCommon + "##k.\r\nShow me your engagement ring and a wedding ticket, and I will book a reservation for you along with #r15 Wedding Tickets#k. Use them to invite your guests into the wedding. They need 1 each to enter."); cm.dispose(); break; - + case 1: if (hasEngagement) { var wserv = cm.getClient().getWorldServer(); var cserv = cm.getClient().getChannelServer(); var weddingId = wserv.getRelationshipId(cm.getPlayer().getId()); - if(weddingId > 0) { - if(cserv.isWeddingReserved(weddingId)) { // registration check + if (weddingId > 0) { + if (cserv.isWeddingReserved(weddingId)) { // registration check var placeTime = cserv.getWeddingReservationTimeLeft(weddingId); cm.sendOk("Your wedding is set to start at the #r" + placeTime + "#k. Get formally dressed and don't be late!"); } else { var partner = wserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId()); - if(partner == null) { + if (partner == null) { cm.sendOk("Your partner seems to be offline right now... Make sure to get both gathered here when the time comes!"); cm.dispose(); return; } - if(hasWeddingRing(cm.getPlayer()) || hasWeddingRing(partner)) { + if (hasWeddingRing(cm.getPlayer()) || hasWeddingRing(partner)) { cm.sendOk("Either you or your partner already has a marriage ring."); cm.dispose(); return; } - if(!cm.getMap().equals(partner.getMap())) { + if (!cm.getMap().equals(partner.getMap())) { cm.sendOk("Please let your partner come here as well to register the reservation."); cm.dispose(); return; } - if(!cm.canHold(weddingSendTicket, 15) || !partner.canHold(weddingSendTicket, 15)) { + if (!cm.canHold(weddingSendTicket, 15) || !partner.canHold(weddingSendTicket, 15)) { cm.sendOk("Either you or your partner doesn't have a free ETC slot for the Wedding tickets! Please make some room before trying to register a reservation."); cm.dispose(); return; } - - if(!cm.getUnclaimedMarriageGifts().isEmpty() || !partner.getAbstractPlayerInteraction().getUnclaimedMarriageGifts().isEmpty()) { + + if (!cm.getUnclaimedMarriageGifts().isEmpty() || !partner.getAbstractPlayerInteraction().getUnclaimedMarriageGifts().isEmpty()) { cm.sendOk("Eerhm... I'm sorry, something doesn't seem right according to the Amoria's Wedding Gift Registry reserve. Please check in the situation with #b#p9201014##k."); cm.dispose(); return; @@ -168,18 +169,18 @@ function action(mode, type, selection) { var hasCommon = cm.haveItem(weddingEntryTicketCommon); var hasPremium = cm.haveItem(weddingEntryTicketPremium); - if(hasCommon || hasPremium) { + if (hasCommon || hasPremium) { var weddingType = (hasPremium ? true : false); var player = cm.getPlayer(); var resStatus = cserv.pushWeddingReservation(weddingId, cathedralWedding, weddingType, player.getId(), player.getPartnerId()); - if(resStatus > 0) { + if (resStatus > 0) { cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1); const Channel = Java.type('net.server.channel.Channel'); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); - cm.gainItem(weddingSendTicket,15,false,true,expirationTime); - partner.getAbstractPlayerInteraction().gainItem(weddingSendTicket,15,false,true,expirationTime); + cm.gainItem(weddingSendTicket, 15, false, true, expirationTime); + partner.getAbstractPlayerInteraction().gainItem(weddingSendTicket, 15, false, true, expirationTime); var placeTime = cserv.getWeddingReservationTimeLeft(weddingId); @@ -189,11 +190,11 @@ function action(mode, type, selection) { player.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Get dressed and don't be late!"); partner.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Get dressed and don't be late!"); - if(!hasSuitForWedding(player)) { + if (!hasSuitForWedding(player)) { player.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria."); } - if(!hasSuitForWedding(partner)) { + if (!hasSuitForWedding(partner)) { partner.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria."); } } else { @@ -213,16 +214,16 @@ function action(mode, type, selection) { cm.dispose(); } break; - + case 2: if (cm.haveItem(weddingGuestTicket)) { var cserv = cm.getClient().getChannelServer(); wid = cserv.getOngoingWedding(cathedralWedding); - if(wid > 0) { - if(cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) { + if (wid > 0) { + if (cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) { var eim = getMarriageInstance(wid); - if(eim != null) { + if (eim != null) { cm.sendOk("Enjoy the wedding. Don't drop your Gold Maple Leaf or you won't be able to finish the whole wedding."); } else { cm.sendOk("Please wait a moment while the couple get ready to enter the Cathedral."); @@ -241,33 +242,33 @@ function action(mode, type, selection) { cm.dispose(); } break; - + default: var wserv = cm.getClient().getWorldServer(); var cserv = cm.getClient().getChannelServer(); var weddingId = wserv.getRelationshipId(cm.getPlayer().getId()); var resStatus = cserv.getWeddingReservationStatus(weddingId, cathedralWedding); - if(resStatus > 0) { - if(cm.canHold(weddingSendTicket, 3)) { + if (resStatus > 0) { + if (cm.canHold(weddingSendTicket, 3)) { cm.gainItem(5251100, -1); const Channel = Java.type('net.server.channel.Channel'); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); - cm.gainItem(weddingSendTicket,3,false,true,expirationTime); + cm.gainItem(weddingSendTicket, 3, false, true, expirationTime); } else { cm.sendOk("Please have a free ETC slot available to get more invitations."); } } else { cm.sendOk("You're not currently booked on the Cathedral to make additional invitations."); } - + cm.dispose(); } } else if (status == 2) { // registering guest var eim = getMarriageInstance(wid); - if(eim != null) { + if (eim != null) { cm.gainItem(weddingGuestTicket, -1); eim.registerPlayer(cm.getPlayer()); //cm.warp(680000210, 0); } else { @@ -279,16 +280,16 @@ function action(mode, type, selection) { } else { if (status == 0) { var eim = cm.getEventInstance(); - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId")); - if(eim.getIntProperty("weddingStage") == 0) { - if(!isMarrying) { + if (eim.getIntProperty("weddingStage") == 0) { + if (!isMarrying) { cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please hang around with the groom and bride while the other guests are gathering here.\r\n\r\nWhen the timer reach it's end the couple will head to the altar, at that time you will be allowed to root over them from the #bguests area#k."); } else { cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please greet the guests that are already here while the others are coming. When the timer reach it's end the couple will head to the altar."); @@ -299,10 +300,10 @@ function action(mode, type, selection) { cm.sendYesNo("The #bbride and groom#k are already on their way to the altar. Would you like to join them now?"); } } else if (status == 1) { - cm.warp(weddingAltarMapid,"sp"); + cm.warp(weddingAltarMapid, "sp"); cm.dispose(); } } - + } } \ No newline at end of file diff --git a/scripts/npc/9201006.js b/scripts/npc/9201006.js index 93d4b07e5a..6a463a35c9 100644 --- a/scripts/npc/9201006.js +++ b/scripts/npc/9201006.js @@ -20,23 +20,23 @@ along with this program. If not, see . */ /** - Debbie --- By --------------------------------------------------------------------------------------------- - Angel (get31720) --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Angel - 2.0 - Second Version by happydud3 & XotiCraze ---------------------------------------------------------------------------------------------------- -**/ + Debbie + -- By --------------------------------------------------------------------------------------------- + Angel (get31720) + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Angel + 2.0 - Second Version by happydud3 & XotiCraze + --------------------------------------------------------------------------------------------------- + **/ var status; -function start() { - status = -1; - action(1, 0, 0); -} +function start() { + status = -1; + action(1, 0, 0); +} -function action(mode, type, selection) { +function action(mode, type, selection) { if (mode == -1 || mode == 0) { cm.sendOk("Goodbye then."); cm.dispose(); @@ -46,16 +46,16 @@ function action(mode, type, selection) { } else { status--; } - + var eim = cm.getEventInstance(); - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } - + var isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId")); - + switch (status) { case 0: var hasEngagement = false; @@ -65,12 +65,12 @@ function action(mode, type, selection) { break; } } - + if (cm.haveItem(4000313) && isMarrying) { - if(eim.getIntProperty("weddingStage") == 3) { + if (eim.getIntProperty("weddingStage") == 3) { cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty."); cm.dispose(); - } else if(hasEngagement) { + } else if (hasEngagement) { if (!cm.createMarriageWishlist()) { cm.sendOk("You have already sent your wishlist..."); } @@ -79,8 +79,8 @@ function action(mode, type, selection) { cm.sendOk("You do not have the required item to continue through this wedding. Unfortunately, it's over..."); } } else { - if(eim.getIntProperty("weddingStage") == 3) { - if(!isMarrying) { + if (eim.getIntProperty("weddingStage") == 3) { + if (!isMarrying) { cm.sendYesNo("The couple #rhas just married#k, and soon #bthey will start the afterparty#k. You should wait here for them. Are you really ready to #rquit this wedding#k and return to #bAmoria#k?"); } else { cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty."); @@ -91,9 +91,9 @@ function action(mode, type, selection) { } } break; - + case 1: - cm.warp(680000000,0); + cm.warp(680000000, 0); cm.dispose(); break; } diff --git a/scripts/npc/9201007.js b/scripts/npc/9201007.js index 63517179a1..bb5a8d9b08 100644 --- a/scripts/npc/9201007.js +++ b/scripts/npc/9201007.js @@ -20,15 +20,15 @@ along with this program. If not, see . */ /** - Assistant Nancy --- By --------------------------------------------------------------------------------------------- - Angel (get31720) --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Angel - 2.0 - Second Version by happydud3 & XotiCraze - 3.0 - Third Version by RonanLana (HeavenMS) ---------------------------------------------------------------------------------------------------- -**/ + Assistant Nancy + -- By --------------------------------------------------------------------------------------------- + Angel (get31720) + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Angel + 2.0 - Second Version by happydud3 & XotiCraze + 3.0 - Third Version by RonanLana (HeavenMS) + --------------------------------------------------------------------------------------------------- + **/ var status; var eim; @@ -37,31 +37,31 @@ var hasRing; function start() { eim = cm.getEventInstance(); - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } - - if(cm.getMapId() == 680000200) { - if(eim.getIntProperty("weddingStage") == 0) { + + if (cm.getMapId() == 680000200) { + if (eim.getIntProperty("weddingStage") == 0) { cm.sendNext("The guests are gathering here right now. Please wait awhile, the ceremony will start soon enough."); } else { cm.warp(680000210, "sp"); cm.sendNext("Pick your seat over here and good show!"); } - + cm.dispose(); } else { - if(cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) { + if (cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) { cm.sendNext("Sorry, only the marrying couple should be talking to me right now."); cm.dispose(); return; } hasEngage = false; - for(var i = 4031357; i <= 4031364; i++) { - if(cm.haveItem(i)) { + for (var i = 4031357; i <= 4031364; i++) { + if (cm.haveItem(i)) { hasEngage = true; break; } @@ -82,7 +82,7 @@ function start() { function action(mode, type, selection) { if (mode == -1 || mode == 0) { - cm.sendOk("Goodbye then."); + cm.sendOk("Goodbye then."); cm.dispose(); return; } else if (mode == 1) { @@ -90,10 +90,10 @@ function action(mode, type, selection) { } else { status--; } - + if (status == 0) { var hasGoldenLeaf = cm.haveItem(4000313); - + if (hasGoldenLeaf && hasEngage) { cm.sendOk("You can't leave yet! You need to click High Priest John and get married before I can let you leave."); cm.dispose(); @@ -112,32 +112,36 @@ function action(mode, type, selection) { var cmPartner; try { cmPartner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId()).getAbstractPlayerInteraction(); - } catch(err) { + } catch (err) { cmPartner = null; } - - switch(selection) { + + switch (selection) { case 0: - if(eim.getIntProperty("isPremium") == 1) { + if (eim.getIntProperty("isPremium") == 1) { eim.warpEventTeam(680000300); cm.sendOk("Enjoy! Cherish your Photos Forever!"); - if (cmPartner != null) cmPartner.npcTalk(cm.getNpc(), "Enjoy! Cherish your Photos Forever!"); + if (cmPartner != null) { + cmPartner.npcTalk(cm.getNpc(), "Enjoy! Cherish your Photos Forever!"); + } } else { // skip the party-time (premium only) eim.warpEventTeam(680000500); cm.sendOk("Congratulations for the newly-wed! I will escort you to the exit."); - if (cmPartner != null) cmPartner.npcTalk(cm.getNpc(), "Congratulations for the newly-wed! I will escort you to the exit."); + if (cmPartner != null) { + cmPartner.npcTalk(cm.getNpc(), "Congratulations for the newly-wed! I will escort you to the exit."); + } } - + cm.dispose(); break; - + case 1: cm.sendOk("The Bride and Groom must receive the blessings of High Priest John to be wed. When you are ready you can click me to go to the Afterparty."); cm.dispose(); break; - + default: - cm.warp(680000000,0); + cm.warp(680000000, 0); cm.dispose(); break; } diff --git a/scripts/npc/9201008.js b/scripts/npc/9201008.js index 348d1ac555..9647736705 100644 --- a/scripts/npc/9201008.js +++ b/scripts/npc/9201008.js @@ -40,27 +40,27 @@ function isWeddingIndoors(mapid) { function hasSuitForWedding(player) { var baseid = (player.getGender() == 0) ? 1050131 : 1051150; - - for(var i = 0; i < 4; i++) { - if(player.haveItemWithId(baseid + i, true)) { + + for (var i = 0; i < 4; i++) { + if (player.haveItemWithId(baseid + i, true)) { return true; } } - + return false; } function getMarriageInstance(weddingId) { var em = cm.getEventManager(weddingEventName); - + for (var iterator = em.getInstances().iterator(); iterator.hasNext();) { var eim = iterator.next(); - - if(eim.getIntProperty("weddingId") == weddingId) { + + if (eim.getIntProperty("weddingId") == weddingId) { return eim; } } - + return null; } @@ -71,18 +71,18 @@ function hasWeddingRing(player) { return true; } } - + return false; } -function start() { +function start() { weddingIndoors = isWeddingIndoors(cm.getMapId()); status = -1; - - action(1, 0, 0); -} -function action(mode, type, selection) { + action(1, 0, 0); +} + +function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { @@ -90,12 +90,13 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; - - if(!weddingIndoors) { + } + + if (!weddingIndoors) { var hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { if (cm.haveItem(x, 1)) { @@ -110,56 +111,56 @@ function action(mode, type, selection) { for (x = 0; x < choice.length; x++) { text += "\r\n#L" + x + "##b" + choice[x] + "#l"; } - + if (cm.haveItem(5251100)) { text += "\r\n#L" + x + "##bMake additional invitation cards#l"; } - + cm.sendSimple(text); } else if (status == 1) { - switch(selection) { + switch (selection) { case 0: cm.sendOk("Firstly you need to be #bengaged#k to someone. #p9201000# makes the engagement ring. Once attained the engagement status, purchase a #b#t" + weddingEntryTicketCommon + "##k.\r\nShow me your engagement ring and a wedding ticket, and I will book a reservation for you along with #r15 Wedding Tickets#k. Use them to invite your guests into the wedding. They need 1 each to enter."); cm.dispose(); break; - + case 1: if (hasEngagement) { var wserv = cm.getClient().getWorldServer(); var cserv = cm.getClient().getChannelServer(); var weddingId = wserv.getRelationshipId(cm.getPlayer().getId()); - if(weddingId > 0) { - if(cserv.isWeddingReserved(weddingId)) { // registration check + if (weddingId > 0) { + if (cserv.isWeddingReserved(weddingId)) { // registration check var placeTime = cserv.getWeddingReservationTimeLeft(weddingId); cm.sendOk("Your wedding is set to start at the #r" + placeTime + "#k. Get a cool attire and don't be late!"); } else { var partner = wserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId()); - if(partner == null) { + if (partner == null) { cm.sendOk("Your partner seems to be offline right now... Make sure to get both gathered here when the time comes!"); cm.dispose(); return; } - - if(hasWeddingRing(cm.getPlayer()) || hasWeddingRing(partner)) { + + if (hasWeddingRing(cm.getPlayer()) || hasWeddingRing(partner)) { cm.sendOk("Either you or your partner already has a marriage ring."); cm.dispose(); return; } - if(!cm.getMap().equals(partner.getMap())) { + if (!cm.getMap().equals(partner.getMap())) { cm.sendOk("Please let your partner come here as well to register the reservation."); cm.dispose(); return; } - if(!cm.canHold(weddingSendTicket, 15) || !partner.canHold(weddingSendTicket, 15)) { + if (!cm.canHold(weddingSendTicket, 15) || !partner.canHold(weddingSendTicket, 15)) { cm.sendOk("Either you or your partner doesn't have a free ETC slot for the Wedding tickets! Please make some room before trying to register a reservation."); cm.dispose(); return; } - - if(!cm.getUnclaimedMarriageGifts().isEmpty() || !partner.getAbstractPlayerInteraction().getUnclaimedMarriageGifts().isEmpty()) { + + if (!cm.getUnclaimedMarriageGifts().isEmpty() || !partner.getAbstractPlayerInteraction().getUnclaimedMarriageGifts().isEmpty()) { cm.sendOk("Eerhm... I'm sorry, something doesn't seem right according to the Amoria's Wedding Gift Registry reserve. Please check in the situation with #b#p9201014##k."); cm.dispose(); return; @@ -168,17 +169,17 @@ function action(mode, type, selection) { var hasCommon = cm.haveItem(weddingEntryTicketCommon); var hasPremium = cm.haveItem(weddingEntryTicketPremium); - if(hasCommon || hasPremium) { + if (hasCommon || hasPremium) { var weddingType = (hasPremium ? true : false); var player = cm.getPlayer(); var resStatus = cserv.pushWeddingReservation(weddingId, cathedralWedding, weddingType, player.getId(), player.getPartnerId()); - if(resStatus > 0) { + if (resStatus > 0) { cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); - cm.gainItem(weddingSendTicket,15,false,true,expirationTime); - partner.getAbstractPlayerInteraction().gainItem(weddingSendTicket,15,false,true,expirationTime); + cm.gainItem(weddingSendTicket, 15, false, true, expirationTime); + partner.getAbstractPlayerInteraction().gainItem(weddingSendTicket, 15, false, true, expirationTime); var placeTime = cserv.getWeddingReservationTimeLeft(weddingId); @@ -188,11 +189,11 @@ function action(mode, type, selection) { player.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Get dressed and don't be late!"); partner.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Get dressed and don't be late!"); - if(!hasSuitForWedding(player)) { + if (!hasSuitForWedding(player)) { player.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria."); } - if(!hasSuitForWedding(partner)) { + if (!hasSuitForWedding(partner)) { partner.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria."); } } else { @@ -212,16 +213,16 @@ function action(mode, type, selection) { cm.dispose(); } break; - + case 2: if (cm.haveItem(weddingGuestTicket)) { var cserv = cm.getClient().getChannelServer(); wid = cserv.getOngoingWedding(cathedralWedding); - if(wid > 0) { - if(cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) { + if (wid > 0) { + if (cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) { var eim = getMarriageInstance(wid); - if(eim != null) { + if (eim != null) { cm.sendOk("Enjoy the wedding. Don't drop your Gold Maple Leaf or you won't be able to finish the whole wedding."); } else { cm.sendOk("Please wait a moment while the couple get ready to enter the Chapel."); @@ -240,33 +241,33 @@ function action(mode, type, selection) { cm.dispose(); } break; - + default: var wserv = cm.getClient().getWorldServer(); var cserv = cm.getClient().getChannelServer(); var weddingId = wserv.getRelationshipId(cm.getPlayer().getId()); var resStatus = cserv.getWeddingReservationStatus(weddingId, cathedralWedding); - if(resStatus > 0) { - if(cm.canHold(weddingSendTicket, 3)) { + if (resStatus > 0) { + if (cm.canHold(weddingSendTicket, 3)) { cm.gainItem(5251100, -1); const Channel = Java.type('net.server.channel.Channel'); var expirationTime = Channel.getRelativeWeddingTicketExpireTime(resStatus); - cm.gainItem(weddingSendTicket,3,false,true,expirationTime); + cm.gainItem(weddingSendTicket, 3, false, true, expirationTime); } else { cm.sendOk("Please have a free ETC slot available to get more invitations."); } } else { cm.sendOk("You're not currently booked on the Chapel to make additional invitations."); } - + cm.dispose(); } } else if (status == 2) { // registering guest var eim = getMarriageInstance(wid); - if(eim != null) { + if (eim != null) { cm.gainItem(weddingGuestTicket, -1); eim.registerPlayer(cm.getPlayer()); //cm.warp(680000210, 0); } else { @@ -278,16 +279,16 @@ function action(mode, type, selection) { } else { if (status == 0) { var eim = cm.getEventInstance(); - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId")); - if(eim.getIntProperty("weddingStage") == 0) { - if(!isMarrying) { + if (eim.getIntProperty("weddingStage") == 0) { + if (!isMarrying) { cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please hang around with the groom and bride while the other guests are gathering here.\r\n\r\nWhen the timer reach it's end the couple will head to the altar, at that time you will be allowed to root over them from the #bguests area#k."); } else { cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please greet the guests that are already here while the others are coming. When the timer reach it's end the couple will head to the altar."); @@ -298,7 +299,7 @@ function action(mode, type, selection) { cm.sendYesNo("The #bbride and groom#k are already on their way to the altar. Would you like to join them now?"); } } else if (status == 1) { - cm.warp(weddingAltarMapid,"sp"); + cm.warp(weddingAltarMapid, "sp"); cm.dispose(); } } diff --git a/scripts/npc/9201009.js b/scripts/npc/9201009.js index 1f46fff691..07f8ceff66 100644 --- a/scripts/npc/9201009.js +++ b/scripts/npc/9201009.js @@ -20,15 +20,15 @@ along with this program. If not, see . */ /** - Assistant Nancy --- By --------------------------------------------------------------------------------------------- - Angel (get31720) --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Angel - 2.0 - Second Version by happydud3 & XotiCraze - 3.0 - Third Version by RonanLana (HeavenMS) ---------------------------------------------------------------------------------------------------- -**/ + Assistant Nancy + -- By --------------------------------------------------------------------------------------------- + Angel (get31720) + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Angel + 2.0 - Second Version by happydud3 & XotiCraze + 3.0 - Third Version by RonanLana (HeavenMS) + --------------------------------------------------------------------------------------------------- + **/ var status; var eim; @@ -37,31 +37,31 @@ var hasRing; function start() { eim = cm.getEventInstance(); - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } - - if(cm.getMapId() == 680000200) { - if(eim.getIntProperty("weddingStage") == 0) { + + if (cm.getMapId() == 680000200) { + if (eim.getIntProperty("weddingStage") == 0) { cm.sendNext("The guests are gathering here right now. Please wait awhile, the ceremony will start soon enough."); } else { cm.warp(680000210, "sp"); cm.sendNext("Pick your seat over here and good show!"); } - + cm.dispose(); } else { - if(cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) { + if (cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) { cm.sendNext("Sorry, only the marrying couple should be talking to me right now."); cm.dispose(); return; } hasEngage = false; - for(var i = 4031357; i <= 4031364; i++) { - if(cm.haveItem(i)) { + for (var i = 4031357; i <= 4031364; i++) { + if (cm.haveItem(i)) { hasEngage = true; break; } @@ -82,7 +82,7 @@ function start() { function action(mode, type, selection) { if (mode == -1 || mode == 0) { - cm.sendOk("Goodbye then."); + cm.sendOk("Goodbye then."); cm.dispose(); return; } else if (mode == 1) { @@ -90,10 +90,10 @@ function action(mode, type, selection) { } else { status--; } - + if (status == 0) { var hasGoldenLeaf = cm.haveItem(4000313); - + if (hasGoldenLeaf && hasEngage) { cm.sendOk("You can't leave yet! You need to click Pelvis Bebop and get his word before I can let you leave."); cm.dispose(); @@ -112,32 +112,36 @@ function action(mode, type, selection) { var cmPartner; try { cmPartner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId()).getAbstractPlayerInteraction(); - } catch(err) { + } catch (err) { cmPartner = null; } - - switch(selection) { + + switch (selection) { case 0: - if(eim.getIntProperty("isPremium") == 1) { + if (eim.getIntProperty("isPremium") == 1) { eim.warpEventTeam(680000300); cm.sendOk("Enjoy! Cherish your Photos Forever!"); - if (cmPartner != null) cmPartner.npcTalk(cm.getNpc(), "Enjoy! Cherish your Photos Forever!"); + if (cmPartner != null) { + cmPartner.npcTalk(cm.getNpc(), "Enjoy! Cherish your Photos Forever!"); + } } else { // skip the party-time (premium only) eim.warpEventTeam(680000500); cm.sendOk("Congratulations for the newly-wed! I will escort you to the exit."); - if (cmPartner != null) cmPartner.npcTalk(cm.getNpc(), "Congratulations for the newly-wed! I will escort you to the exit."); + if (cmPartner != null) { + cmPartner.npcTalk(cm.getNpc(), "Congratulations for the newly-wed! I will escort you to the exit."); + } } - + cm.dispose(); break; - + case 1: cm.sendOk("The superstars must receive the word of Pelvis Bebop to be united. When you are ready you can click me to go to the Afterparty."); cm.dispose(); break; - + default: - cm.warp(680000000,0); + cm.warp(680000000, 0); cm.dispose(); break; } diff --git a/scripts/npc/9201010.js b/scripts/npc/9201010.js index f2041d2d3c..c696dde887 100644 --- a/scripts/npc/9201010.js +++ b/scripts/npc/9201010.js @@ -20,24 +20,24 @@ along with this program. If not, see . */ /** - Assistant Travis --- By --------------------------------------------------------------------------------------------- - Angel (get31720) --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Angel - 2.0 - Second Version by happydud3 & XotiCraze - 3.0 - Third Version by RonanLana (HeavenMS) ---------------------------------------------------------------------------------------------------- -**/ + Assistant Travis + -- By --------------------------------------------------------------------------------------------- + Angel (get31720) + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Angel + 2.0 - Second Version by happydud3 & XotiCraze + 3.0 - Third Version by RonanLana (HeavenMS) + --------------------------------------------------------------------------------------------------- + **/ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } -function action(mode, type, selection) { +function action(mode, type, selection) { if (mode == -1 || mode == 0) { cm.dispose(); return; @@ -46,19 +46,19 @@ function action(mode, type, selection) { } else { status--; } - + var eim = cm.getEventInstance(); - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } - + var isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId")); - + switch (status) { case 0: - if(cm.getMapId() == 680000300) { + if (cm.getMapId() == 680000300) { cm.sendYesNo("Are you sure you want to #rquit the stage#k and head back to #bAmoria#k? You will be #rskipping the bonus stages#k that way."); } else { var hasEngagement = false; @@ -70,10 +70,10 @@ function action(mode, type, selection) { } if (cm.haveItem(4000313) && isMarrying) { - if(eim.getIntProperty("weddingStage") == 3) { + if (eim.getIntProperty("weddingStage") == 3) { cm.sendOk("You guys totally rocked the stage!!! Go go, talk to #b#p9201007##k to start the afterparty."); cm.dispose(); - } else if(hasEngagement) { + } else if (hasEngagement) { if (!cm.createMarriageWishlist()) { cm.sendOk("You have already sent your wishlist..."); } @@ -82,8 +82,8 @@ function action(mode, type, selection) { cm.sendOk("Oh, hey, where are the credentials for the this so-lauded party? Oh man, we can't continue at this rate now... Sorry, the party is over."); } } else { - if(eim.getIntProperty("weddingStage") == 3) { - if(!isMarrying) { + if (eim.getIntProperty("weddingStage") == 3) { + if (!isMarrying) { cm.sendYesNo("You guys didn't miss them right? Our superstars #rworked so good together#k, and soon #bthey will start the afterparty#k. Are you really going to #rdrop out of the show#k and return to #bAmoria#k?"); } else { cm.sendOk("You guys totally rocked the stage!!! Go go, talk to #b#p9201007##k to start the afterparty."); @@ -94,12 +94,12 @@ function action(mode, type, selection) { } } } - - + + break; - + case 1: - cm.warp(680000000,0); + cm.warp(680000000, 0); cm.dispose(); break; } diff --git a/scripts/npc/9201011.js b/scripts/npc/9201011.js index f41d49c2a5..71d059dbee 100644 --- a/scripts/npc/9201011.js +++ b/scripts/npc/9201011.js @@ -36,7 +36,7 @@ function detectPlayerItemid(player) { return x; } } - + return -1; } @@ -46,31 +46,39 @@ function getRingId(boxItemId) { function isSuitedForWedding(player, equipped) { var baseid = (player.getGender() == 0) ? 1050131 : 1051150; - - if(equipped) { - for(var i = 0; i < 4; i++) { - if(player.haveItemEquipped(baseid + i)) { + + if (equipped) { + for (var i = 0; i < 4; i++) { + if (player.haveItemEquipped(baseid + i)) { return true; } } } else { - for(var i = 0; i < 4; i++) { - if(player.haveItemWithId(baseid + i, true)) { + for (var i = 0; i < 4; i++) { + if (player.haveItemWithId(baseid + i, true)) { return true; } } } - + return false; } function getWeddingPreparationStatus(player, partner) { - if(!player.haveItem(4000313)) return -3; - if(!partner.haveItem(4000313)) return 3; - - if(!isSuitedForWedding(player, true)) return -4; - if(!isSuitedForWedding(partner, true)) return 4; - + if (!player.haveItem(4000313)) { + return -3; + } + if (!partner.haveItem(4000313)) { + return 3; + } + + if (!isSuitedForWedding(player, true)) { + return -4; + } + if (!isSuitedForWedding(partner, true)) { + return 4; + } + var hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { if (player.haveItem(x)) { @@ -78,7 +86,9 @@ function getWeddingPreparationStatus(player, partner) { break; } } - if(!hasEngagement) return -1; + if (!hasEngagement) { + return -1; + } hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { @@ -87,22 +97,28 @@ function getWeddingPreparationStatus(player, partner) { break; } } - if(!hasEngagement) return -2; + if (!hasEngagement) { + return -2; + } - if(!player.canHold(1112803)) return 1; - if(!partner.canHold(1112803)) return 2; + if (!player.canHold(1112803)) { + return 1; + } + if (!partner.canHold(1112803)) { + return 2; + } return 0; } function giveCoupleBlessings(eim, player, partner) { var blessCount = eim.gridSize(); - + player.gainExp(blessCount * weddingBlessingExp); partner.gainExp(blessCount * weddingBlessingExp); } -function start() { +function start() { eim = cm.getEventInstance(); status = -1; @@ -117,26 +133,27 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { - if(eim == null) { - cm.warp(680000000,0); + if (eim == null) { + cm.warp(680000000, 0); cm.dispose(); return; } var playerId = cm.getPlayer().getId(); - if(playerId == eim.getIntProperty("groomId") || playerId == eim.getIntProperty("brideId")) { + if (playerId == eim.getIntProperty("groomId") || playerId == eim.getIntProperty("brideId")) { var wstg = eim.getIntProperty("weddingStage"); - if(wstg == 2) { + if (wstg == 2) { cm.sendYesNo("Awhoooooooooosh~, the guests have proclaimed their love to y'all. The time has come baby~, #rshould I make you Husband and Wife#k?"); state = 1; - } else if(wstg == 1) { + } else if (wstg == 1) { cm.sendOk("W-whoah wait a bit alright? Your guests are currently giving their love to y'all. Let's shake this place up, baby~~."); cm.dispose(); } else { @@ -145,12 +162,12 @@ function action(mode, type, selection) { } } else { var wstg = eim.getIntProperty("weddingStage"); - if(wstg == 1) { - if(eim.gridCheck(cm.getPlayer()) != -1) { + if (wstg == 1) { + if (eim.gridCheck(cm.getPlayer()) != -1) { cm.sendOk("Everyone let's shake this place up! Let's rock 'n' roll!!"); cm.dispose(); } else { - if(eim.getIntProperty("guestBlessings") == 1) { + if (eim.getIntProperty("guestBlessings") == 1) { cm.sendYesNo("Will you manifest your love to the superstars here present?"); state = 0; } else { @@ -158,7 +175,7 @@ function action(mode, type, selection) { cm.dispose(); } } - } else if(wstg == 3) { + } else if (wstg == 3) { cm.sendOk("Whooooooo-hoo! The couple's love now are like one super big shiny heart right now! And it shall go on ever after this festival. Please #rget ready for the afterparty#k, baby~. Follow the married couple's lead!"); cm.dispose(); } else { @@ -167,11 +184,11 @@ function action(mode, type, selection) { } } } else if (status == 1) { - if(state == 0) { // give player blessings + if (state == 0) { // give player blessings eim.gridInsert(cm.getPlayer(), 1); const PacketCreator = Java.type('tools.PacketCreator'); - if(YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) { + if (YamlConfig.config.server.WEDDING_BLESSER_SHOWFX) { var target = cm.getPlayer(); target.sendPacket(PacketCreator.showSpecialEffect(9)); target.getMap().broadcastMessage(target, PacketCreator.showForeignEffect(target.getId(), 9), false); @@ -179,7 +196,7 @@ function action(mode, type, selection) { var target = eim.getPlayerById(eim.getIntProperty("groomId")); target.sendPacket(PacketCreator.showSpecialEffect(9)); target.getMap().broadcastMessage(target, PacketCreator.showForeignEffect(target.getId(), 9), false); - + target = eim.getPlayerById(eim.getIntProperty("brideId")); target.sendPacket(PacketCreator.showSpecialEffect(9)); target.getMap().broadcastMessage(target, PacketCreator.showForeignEffect(target.getId(), 9), false); @@ -190,9 +207,9 @@ function action(mode, type, selection) { } else { // couple wants to complete the wedding var wstg = eim.getIntProperty("weddingStage"); - if(wstg == 2) { + if (wstg == 2) { var pid = cm.getPlayer().getPartnerId(); - if(pid <= 0) { + if (pid <= 0) { cm.sendOk("Huh~.... Wait wait, did you just break that thing you had right now?? Oh my, what happened?"); cm.dispose(); return; @@ -200,14 +217,14 @@ function action(mode, type, selection) { var player = cm.getPlayer(); var partner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId()); - if(partner != null) { + if (partner != null) { state = getWeddingPreparationStatus(player, partner); - switch(state) { + switch (state) { case 0: var pid = eim.getIntProperty("confirmedVows"); - if(pid != -1) { - if(pid == player.getId()) { + if (pid != -1) { + if (pid == player.getId()) { cm.sendOk("You have already confirmed your vows. All that is left is for your partner to confirm now."); } else { eim.setIntProperty("weddingStage", 3); @@ -239,7 +256,7 @@ function action(mode, type, selection) { eim.setIntProperty("confirmedVows", player.getId()); cm.getMap().dropMessage(6, "Wedding Assistant: " + player.getName() + " has confirmed vows! Alright, one step away to make it official. Tighten your seatbelts!"); } - + break; case -1: diff --git a/scripts/npc/9201012.js b/scripts/npc/9201012.js index 1692015df9..f56923a097 100644 --- a/scripts/npc/9201012.js +++ b/scripts/npc/9201012.js @@ -30,38 +30,38 @@ var cathedralWedding = false; function isSuitedForWedding(player, equipped) { var baseid = (player.getGender() == 0) ? 1050131 : 1051150; - - if(equipped) { - for(var i = 0; i < 4; i++) { - if(player.haveItemEquipped(baseid + i)) { + + if (equipped) { + for (var i = 0; i < 4; i++) { + if (player.haveItemEquipped(baseid + i)) { return true; } } } else { - for(var i = 0; i < 4; i++) { - if(player.haveItemWithId(baseid + i, true)) { + for (var i = 0; i < 4; i++) { + if (player.haveItemWithId(baseid + i, true)) { return true; } } } - + return false; } function getMarriageInstance(player) { var em = cm.getEventManager(weddingEventName); - + for (var iterator = em.getInstances().iterator(); iterator.hasNext();) { var eim = iterator.next(); - if(eim.isEventLeader(player)) { + if (eim.isEventLeader(player)) { return eim; } } - + return null; } -function start() { +function start() { status = -1; action(1, 0, 0); } @@ -74,12 +74,13 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { var hasEngagement = false; for (var x = 4031357; x <= 4031364; x++) { if (cm.haveItem(x, 1)) { @@ -88,7 +89,7 @@ function action(mode, type, selection) { } } - if(hasEngagement) { + if (hasEngagement) { var text = "Hi there. How about skyrocket the day with your fiancee baby~?"; var choice = new Array("We're ready to get married."); for (x = 0; x < choice.length; x++) { @@ -99,27 +100,27 @@ function action(mode, type, selection) { cm.sendOk("Hi there, folks. Even thought of having a wedding held on Amoria? When the talk is about wedding, everyone firstly thinks about Amoria, there is no miss to it. Our chapel here is renowned around the Maple world for offering the best wedding services for maplers!"); cm.dispose(); } - } else if(status == 1) { + } else if (status == 1) { var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId()); var cserv = cm.getClient().getChannelServer(); - if(cserv.isWeddingReserved(wid)) { - if(wid == cserv.getOngoingWedding(cathedralWedding)) { + if (cserv.isWeddingReserved(wid)) { + if (wid == cserv.getOngoingWedding(cathedralWedding)) { var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId()); - if(!(partner == null || !cm.getMap().equals(partner.getMap()))) { - if(!cm.canHold(4000313)) { + if (!(partner == null || !cm.getMap().equals(partner.getMap()))) { + if (!cm.canHold(4000313)) { cm.sendOk("Please have a free ETC slot available to get the #b#t4000313##k."); cm.dispose(); return; - } else if(!partner.canHold(4000313)) { + } else if (!partner.canHold(4000313)) { cm.sendOk("Please let your partner know they must have a free ETC slot available to get the #b#t4000313##k."); cm.dispose(); return; - } else if(!isSuitedForWedding(cm.getPlayer(), false)) { + } else if (!isSuitedForWedding(cm.getPlayer(), false)) { cm.sendOk("Please purchase fashionable #rwedding clothes#k for the wedding, quickly! It's time to shine, baby~!"); cm.dispose(); return; - } else if(!isSuitedForWedding(partner, false)) { + } else if (!isSuitedForWedding(partner, false)) { cm.sendOk("Your partner must know they must have fashionable #rwedding clothes#k for the wedding. It's time to shine, baby~!"); cm.dispose(); return; @@ -140,19 +141,19 @@ function action(mode, type, selection) { cm.sendOk("Aawww, I'm sorry but there are no reservations made for you at this channel for the time being."); cm.dispose(); } - } else if(status == 2) { + } else if (status == 2) { var cserv = cm.getClient().getChannelServer(); var wtype = cserv.getOngoingWeddingType(cathedralWedding); - + var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId()); - if(!(partner == null || !cm.getMap().equals(partner.getMap()))) { - if(cserv.acceptOngoingWedding(cathedralWedding)) { + if (!(partner == null || !cm.getMap().equals(partner.getMap()))) { + if (cserv.acceptOngoingWedding(cathedralWedding)) { var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId()); - if(wid > 0) { + if (wid > 0) { var em = cm.getEventManager(weddingEventName); - if(em.startInstance(cm.getPlayer())) { + if (em.startInstance(cm.getPlayer())) { eim = getMarriageInstance(cm.getPlayer()); - if(eim != null) { + if (eim != null) { eim.setIntProperty("weddingId", wid); eim.setIntProperty("groomId", cm.getPlayer().getId()); eim.setIntProperty("brideId", cm.getPlayer().getPartnerId()); @@ -179,6 +180,6 @@ function action(mode, type, selection) { cm.sendOk("Aww, it seems your partner is elsewhere... Both must be here for the wedding, else it's going to be sooooo lame."); cm.dispose(); } - } + } } } \ No newline at end of file diff --git a/scripts/npc/9201013.js b/scripts/npc/9201013.js index 8751f1d6aa..0f6fc7ee49 100644 --- a/scripts/npc/9201013.js +++ b/scripts/npc/9201013.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Victoria @author Ronan */ diff --git a/scripts/npc/9201014.js b/scripts/npc/9201014.js index 879884b108..ff051f8102 100644 --- a/scripts/npc/9201014.js +++ b/scripts/npc/9201014.js @@ -20,16 +20,16 @@ along with this program. If not, see . */ /** - Pila Present --- By --------------------------------------------------------------------------------------------- - get31720 (RaGEZONE) --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Angel - 2.0 - Second Version by happydud3 & XotiCraze - 3.0 - Third Version by RonanLana (HeavenMS) - 4.0 - Fourth Version by Drago (MapleStorySA) ---------------------------------------------------------------------------------------------------- -**/ + Pila Present + -- By --------------------------------------------------------------------------------------------- + get31720 (RaGEZONE) + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Angel + 2.0 - Second Version by happydud3 & XotiCraze + 3.0 - Third Version by RonanLana (HeavenMS) + 4.0 - Fourth Version by Drago (MapleStorySA) + --------------------------------------------------------------------------------------------------- + **/ var status = -1; var marriageRoom; @@ -42,7 +42,7 @@ function start() { marriageGifts = cm.getUnclaimedMarriageGifts(); marriageAction = (!marriageGifts.isEmpty() ? 2 : ((cm.haveItem(4031423) || cm.haveItem(4031424)) ? 1 : 0)); } - + status = -1; action(1, 0, 0); } @@ -59,7 +59,7 @@ function action(mode, type, selection) { var talk = "Hi there, welcome to the wedding's Gift Registry. From which spouse's wishlist would you like to take a look?"; var options = ["Groom", "Bride"]; - cm.sendSimple(talk + "\r\n\r\n#b" + generateSelectionMenu(options) + "#k"); + cm.sendSimple(talk + "\r\n\r\n#b" + generateSelectionMenu(options) + "#k"); } else { cm.sendMarriageWishlist(selection == 0); cm.dispose(); @@ -76,7 +76,7 @@ function action(mode, type, selection) { } else if (marriageAction == 1) { // onyx prizes if (status == 0) { var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!#b"; - var choice1 = new Array("I have an Onyx Chest for Bride and Groom", "I have an Onyx Chest"); + var choice1 = ["I have an Onyx Chest for Bride and Groom", "I have an Onyx Chest"]; for (var i = 0; i < choice1.length; i++) { msg += "\r\n#L" + i + "#" + choice1[i] + "#l"; } @@ -85,11 +85,11 @@ function action(mode, type, selection) { if (selection == 0) { if (cm.haveItem(4031424)) { if (cm.getPlayer().isMarried()) { // thanks MedicOP for solving an issue here - if(cm.getInventory(2).getNextFreeSlot() >= 0) { + if (cm.getInventory(2).getNextFreeSlot() >= 0) { var rand = Math.floor(Math.random() * bgPrizes.length); cm.gainItem(bgPrizes[rand][0], bgPrizes[rand][1]); - cm.gainItem(4031424,-1); + cm.gainItem(4031424, -1); cm.dispose(); } else { cm.sendOk("You don't have a free USE slot right now."); @@ -105,11 +105,11 @@ function action(mode, type, selection) { } } else if (selection == 1) { if (cm.haveItem(4031423)) { - if(cm.getInventory(2).getNextFreeSlot() >= 0) { + if (cm.getInventory(2).getNextFreeSlot() >= 0) { var rand = Math.floor(Math.random() * cmPrizes.length); cm.gainItem(cmPrizes[rand][0], cmPrizes[rand][1]); - cm.gainItem(4031423,-1); + cm.gainItem(4031423, -1); cm.dispose(); } else { cm.sendOk("You don't have a free USE slot right now."); @@ -124,14 +124,14 @@ function action(mode, type, selection) { } else { cm.sendOk("Hi there, welcome to Amoria's Wedding Gift Registry reserve. We redistribute and tender gifts for both wedding spouses and lucky ceremonial attenders."); cm.dispose(); - } + } } } function generateSelectionMenu(array) { - var menu = ""; - for (var i = 0; i < array.length; i++) { - menu += "#L" + i + "#" + array[i] + "#l\r\n"; - } - return menu; + var menu = ""; + for (var i = 0; i < array.length; i++) { + menu += "#L" + i + "#" + array[i] + "#l\r\n"; + } + return menu; } \ No newline at end of file diff --git a/scripts/npc/9201015.js b/scripts/npc/9201015.js index 4786e909e3..cb560f7a70 100644 --- a/scripts/npc/9201015.js +++ b/scripts/npc/9201015.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Welcome to the Amoria hair shop. If you have a #b#t5150020##k, or a #b#t5151017##k, allow me to take care of your hairdo. Please choose the one you want.\r\n#L1#Haircut: #i5150020##t5150020##l\r\n#L2#Dye your hair: #i5151017##t5151017##l"); } else if (status == 1) { @@ -58,13 +59,13 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_v.length; i++) { + for (var i = 0; i < mhair_v.length; i++) { pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_v.length; i++) { + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -74,20 +75,19 @@ function action(mode, type, selection) { beauty = 2; haircolor = Array(); var current = parseInt(cm.getPlayer().getHair() - /10)*10; - for(var i = 0; i < 8; i++) { + / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t5151017##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420000)){ + if (beauty == 1) { + if (cm.haveItem(5420000)) { cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150020) == true){ + } else if (cm.haveItem(5150020) == true) { cm.gainItem(5150020, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -95,8 +95,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151017) == true){ + if (beauty == 2) { + if (cm.haveItem(5151017) == true) { cm.gainItem(5151017, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -104,7 +104,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150020, 1); diff --git a/scripts/npc/9201016.js b/scripts/npc/9201016.js index 5c8a526cc6..786e49f221 100644 --- a/scripts/npc/9201016.js +++ b/scripts/npc/9201016.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("I'm Salon Seamus. If you have #b#t5150019##k or #b#t5151016##k by any chance, then how about letting me change your hairdo?\r\n#L1#Haircut: #i5150019##t5150019##l\r\n#L2#Dye your hair: #i5151016##t5151016##l"); } else if (status == 1) { @@ -58,13 +59,13 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_e.length; i++) { + for (var i = 0; i < mhair_e.length; i++) { pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_e.length; i++) { + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } @@ -74,17 +75,16 @@ function action(mode, type, selection) { beauty = 2; haircolor = Array(); var current = parseInt(cm.getPlayer().getHair() - /10)*10; - for(var i = 0; i < 8; i++) { + / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5150016##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150019) == true){ + if (beauty == 1) { + if (cm.haveItem(5150019) == true) { cm.gainItem(5150019, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -92,8 +92,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151016) == true){ + if (beauty == 2) { + if (cm.haveItem(5151016) == true) { cm.gainItem(5151016, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -101,7 +101,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150019, 1); diff --git a/scripts/npc/9201017.js b/scripts/npc/9201017.js index d3aa73dfaf..42a7b387bf 100644 --- a/scripts/npc/9201017.js +++ b/scripts/npc/9201017.js @@ -37,7 +37,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -53,10 +53,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hi, there~! I'm Dr.Roberts, in charge of the cosmetic lenses here at the Amoria Plastic Surgery Shop! With #b#t5152025##k or #b#t5152026##k, you can let us take care of the rest and have the kind of beautiful look you've always craved~! Remember, the first thing everyone notices about you is the eyes, and we can help you find the cosmetic lens that most fits you! Now, what would you like to use?\r\n#L1#Cosmetic Lenses: #i5152025##t5152025##l\r\n#L2#Cosmetic Lenses: #i5152026##t5152026##l\r\n#L3#One-time Cosmetic Lenses: #i5152106# (any color)#l"); } else if (status == 1) { @@ -69,7 +70,7 @@ function action(mode, type, selection) { var current = cm.getPlayer().getFace() % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 300, current +400, current + 500, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 300, current + 400, current + 500, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152025##k and really make the change to your eyes?"); } else if (selection == 2) { beauty = 2; @@ -80,38 +81,37 @@ function action(mode, type, selection) { var current = cm.getPlayer().getFace() % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current , current + 100, current + 300, current +400, current + 500, current + 700]); + pushIfItemsExists(colors, [current, current + 100, current + 300, current + 400, current + 500, current + 700]); cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2){ - if (beauty == 1){ - if (cm.haveItem(5152025)){ + } else if (status == 2) { + if (beauty == 1) { + if (cm.haveItem(5152025)) { cm.gainItem(5152025, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); @@ -119,8 +119,8 @@ function action(mode, type, selection) { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); cm.dispose(); } - } else if (beauty == 2){ - if (cm.haveItem(5152026)){ + } else if (beauty == 2) { + if (cm.haveItem(5152026)) { cm.gainItem(5152026, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); @@ -128,17 +128,17 @@ function action(mode, type, selection) { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); cm.dispose(); } - } else if (beauty == 3){ + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 0){ + } else if (beauty == 0) { if (selection == 0 && cm.getMeso() >= regprice) { cm.gainMeso(-regprice); cm.gainItem(5152025, 1); diff --git a/scripts/npc/9201018.js b/scripts/npc/9201018.js index e9e0157c35..ad3a3783b0 100644 --- a/scripts/npc/9201018.js +++ b/scripts/npc/9201018.js @@ -46,30 +46,30 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Well, hello! Welcome to Amoria Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152022##k, you can let us take care of the rest and have the face you've always wanted~!\r\n#L2#Plastic Surgery: #i5152022##t5152022##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) { + for (var i = 0; i < mface_v.length; i++) { pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) { + for (var i = 0; i < fface_v.length; i++) { pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152022##k, you can get the face of your liking. Take your time in choosing the face of your preference.", facenew); } - } - else if (status == 2){ - if (cm.haveItem(5152022) == true){ + } else if (status == 2) { + if (cm.haveItem(5152022) == true) { cm.gainItem(5152022, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); diff --git a/scripts/npc/9201019.js b/scripts/npc/9201019.js index 1a2a8bc6d7..2098377d08 100644 --- a/scripts/npc/9201019.js +++ b/scripts/npc/9201019.js @@ -46,30 +46,30 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hi, I pretty much shouldn't be doing this, but with a #b#t5152021##k, I will do it anyways for you. But don't forget, it will be random!\r\n#L2#Plastic Surgery: #i5152021##t5152021##l"); } else if (status == 1) { if (selection == 2) { facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_r.length; i++) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_r.length; i++) { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152021##k?"); } - } - else if (status == 2){ - if (cm.haveItem(5152021) == true){ + } else if (status == 2) { + if (cm.haveItem(5152021) == true) { cm.gainItem(5152021, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); diff --git a/scripts/npc/9201021.js b/scripts/npc/9201021.js index 49790a5384..003db384ad 100644 --- a/scripts/npc/9201021.js +++ b/scripts/npc/9201021.js @@ -19,48 +19,52 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -var status = 0; +var status = 0; function start() { - if(cm.getMapId() != 680000401) cm.sendSimple("Hello, where would you like to go?\r\n#b" + ((cm.getMapId() != 680000400) ? "#L0#Untamed Hearts Hunting Ground#l\r\n" : "") + ((cm.getMapId() == 680000400) ? "#L1#I have 7 keys. Bring me to smash boxes#l\r\n" : "") + "#L2#Please warp me out.#l#k"); - else cm.sendSimple("Hello, do you want to go back now? Returning here again will cost you #rother 7 keys#k.\r\n#b#L2#Please warp me back to the training grounds.#l#k"); -} + if (cm.getMapId() != 680000401) { + cm.sendSimple("Hello, where would you like to go?\r\n#b" + ((cm.getMapId() != 680000400) ? "#L0#Untamed Hearts Hunting Ground#l\r\n" : "") + ((cm.getMapId() == 680000400) ? "#L1#I have 7 keys. Bring me to smash boxes#l\r\n" : "") + "#L2#Please warp me out.#l#k"); + } else { + cm.sendSimple("Hello, do you want to go back now? Returning here again will cost you #rother 7 keys#k.\r\n#b#L2#Please warp me back to the training grounds.#l#k"); + } +} -function action(mode, type, selection) { +function action(mode, type, selection) { if (mode < 1) { cm.sendOk("Goodbye then."); cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection < 1) { - if(!cm.haveItem(4000313, 1)) { + if (!cm.haveItem(4000313, 1)) { cm.sendOk("It seems like you lost your #b#t4000313##k. I'm sorry, but I can't let you proceed to the hunting grounds without that."); cm.dispose(); return; } - + cm.warp(680000400, 0); } else if (selection < 2) { - if (cm.haveItem(4031217,7)) { + if (cm.haveItem(4031217, 7)) { cm.gainItem(4031217, -7); cm.warp(680000401, 0); } else { cm.sendOk("It seems like you don't have 7 Keys. Kill the cakes and candles in the Untamed Heart Hunting Ground to get keys."); } } else if (selection > 1) { - if(cm.getMapId() != 680000401) { + if (cm.getMapId() != 680000401) { cm.warp(680000500, 0); cm.sendOk("Goodbye. I hope you enjoyed the wedding!"); } else { cm.warp(680000400, 0); } } - + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201022.js b/scripts/npc/9201022.js index 45435d7803..d358f1ec53 100644 --- a/scripts/npc/9201022.js +++ b/scripts/npc/9201022.js @@ -28,27 +28,30 @@ status = -1; function start() { - if (cm.getPlayer().getMapId() == 100000000) + if (cm.getPlayer().getMapId() == 100000000) { cm.sendYesNo("I can take you to the Amoria Village. Are you ready to go?"); - else + } else { cm.sendYesNo("I can take you back to Henesys. Are you ready to go?"); + } } function action(mode, type, selection) { status++; if (mode != 1) { - if (mode == 0) + if (mode == 0) { cm.sendOk("Ok, feel free to hang around until you're ready to go!"); + } cm.dispose(); return; } - if (status == 0) + if (status == 0) { cm.sendNext("I hope you had a great time! See you around!"); - else if (status == 1) { - if (cm.getPlayer().getMapId() == 100000000) + } else if (status == 1) { + if (cm.getPlayer().getMapId() == 100000000) { cm.warp(680000000, 0); - else + } else { cm.warp(100000000, 5); + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201023.js b/scripts/npc/9201023.js index 8e6326a9a2..daba83d985 100644 --- a/scripts/npc/9201023.js +++ b/scripts/npc/9201023.js @@ -34,25 +34,25 @@ var options; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } function getNanaLocation(player) { var mapid = player.getMap().getId(); - - for(var i = 0; i < mapids.length; i++) { - if(mapid == mapids[i]) { + + for (var i = 0; i < mapids.length; i++) { + if (mapid == mapids[i]) { return i; } } - + return -1; } @@ -62,8 +62,8 @@ var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128]; var questExp = [2000, 5000, 10000, 17000, 22000, 30000]; function processNanaQuest() { - if(cm.haveItem(questItems[nanaLoc], 50)) { - if(cm.canHold(4031367 + nanaLoc, 1)) { + if (cm.haveItem(questItems[nanaLoc], 50)) { + if (cm.canHold(4031367 + nanaLoc, 1)) { cm.gainItem(questItems[nanaLoc], -50); cm.gainItem(4031367 + nanaLoc, 1); @@ -75,7 +75,7 @@ function processNanaQuest() { } else { cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k."); } - + return false; } @@ -92,35 +92,36 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(!cm.isQuestStarted(100400)) { + if (status == 0) { + if (!cm.isQuestStarted(100400)) { cm.sendOk("Hello #b#h0##k, I'm #p9201023# the fairy of Love."); // thanks Periwinks (LuckyStory) for noticing Nana's introducing themselves as Nana (H) cm.dispose(); return; } - + nanaLoc = getNanaLocation(cm.getPlayer()); - if(nanaLoc == -1) { + if (nanaLoc == -1) { cm.sendOk("Hello #b#h0##k, I'm #p9201023# the fairy of Love."); cm.dispose(); return; } - - if(!cm.haveItem(4031367 + nanaLoc, 1)) { - if(cm.isQuestCompleted(100401 + nanaLoc)) { + + if (!cm.haveItem(4031367 + nanaLoc, 1)) { + if (cm.isQuestCompleted(100401 + nanaLoc)) { state = 1; cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k"); - } else if(cm.isQuestStarted(100401 + nanaLoc)) { - if(processNanaQuest()) { + } else if (cm.isQuestStarted(100401 + nanaLoc)) { + if (processNanaQuest()) { cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate()); cm.completeQuest(100401 + nanaLoc); } - + cm.dispose(); } else { state = 0; @@ -130,10 +131,10 @@ function action(mode, type, selection) { cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?"); cm.dispose(); } - } else if(status == 1) { - if(state == 0) { + } else if (status == 1) { + if (state == 0) { cm.startQuest(100401 + nanaLoc); - + cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k."); cm.dispose(); } else { diff --git a/scripts/npc/9201024.js b/scripts/npc/9201024.js index 271cf7a75b..9e05332c58 100644 --- a/scripts/npc/9201024.js +++ b/scripts/npc/9201024.js @@ -34,25 +34,25 @@ var options; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } function getNanaLocation(player) { var mapid = player.getMap().getId(); - - for(var i = 0; i < mapids.length; i++) { - if(mapid == mapids[i]) { + + for (var i = 0; i < mapids.length; i++) { + if (mapid == mapids[i]) { return i; } } - + return -1; } @@ -62,8 +62,8 @@ var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128]; var questExp = [2000, 5000, 10000, 17000, 22000, 30000]; function processNanaQuest() { - if(cm.haveItem(questItems[nanaLoc], 50)) { - if(cm.canHold(4031367 + nanaLoc, 1)) { + if (cm.haveItem(questItems[nanaLoc], 50)) { + if (cm.canHold(4031367 + nanaLoc, 1)) { cm.gainItem(questItems[nanaLoc], -50); cm.gainItem(4031367 + nanaLoc, 1); @@ -75,7 +75,7 @@ function processNanaQuest() { } else { cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k."); } - + return false; } @@ -92,35 +92,36 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(!cm.isQuestStarted(100400)) { + if (status == 0) { + if (!cm.isQuestStarted(100400)) { cm.sendOk("Hello #b#h0##k, I'm #p9201024# the fairy of Love."); cm.dispose(); return; } - + nanaLoc = getNanaLocation(cm.getPlayer()); - if(nanaLoc == -1) { + if (nanaLoc == -1) { cm.sendOk("Hello #b#h0##k, I'm #p9201024# the fairy of Love."); cm.dispose(); return; } - - if(!cm.haveItem(4031367 + nanaLoc, 1)) { - if(cm.isQuestCompleted(100401 + nanaLoc)) { + + if (!cm.haveItem(4031367 + nanaLoc, 1)) { + if (cm.isQuestCompleted(100401 + nanaLoc)) { state = 1; cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k"); - } else if(cm.isQuestStarted(100401 + nanaLoc)) { - if(processNanaQuest()) { + } else if (cm.isQuestStarted(100401 + nanaLoc)) { + if (processNanaQuest()) { cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate()); cm.completeQuest(100401 + nanaLoc); } - + cm.dispose(); } else { state = 0; @@ -130,10 +131,10 @@ function action(mode, type, selection) { cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?"); cm.dispose(); } - } else if(status == 1) { - if(state == 0) { + } else if (status == 1) { + if (state == 0) { cm.startQuest(100401 + nanaLoc); - + cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k."); cm.dispose(); } else { diff --git a/scripts/npc/9201025.js b/scripts/npc/9201025.js index d284706f18..8b8d31713e 100644 --- a/scripts/npc/9201025.js +++ b/scripts/npc/9201025.js @@ -34,25 +34,25 @@ var options; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } function getNanaLocation(player) { var mapid = player.getMap().getId(); - - for(var i = 0; i < mapids.length; i++) { - if(mapid == mapids[i]) { + + for (var i = 0; i < mapids.length; i++) { + if (mapid == mapids[i]) { return i; } } - + return -1; } @@ -62,8 +62,8 @@ var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128]; var questExp = [2000, 5000, 10000, 17000, 22000, 30000]; function processNanaQuest() { - if(cm.haveItem(questItems[nanaLoc], 50)) { - if(cm.canHold(4031367 + nanaLoc, 1)) { + if (cm.haveItem(questItems[nanaLoc], 50)) { + if (cm.canHold(4031367 + nanaLoc, 1)) { cm.gainItem(questItems[nanaLoc], -50); cm.gainItem(4031367 + nanaLoc, 1); @@ -75,7 +75,7 @@ function processNanaQuest() { } else { cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k."); } - + return false; } @@ -92,35 +92,36 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(!cm.isQuestStarted(100400)) { + if (status == 0) { + if (!cm.isQuestStarted(100400)) { cm.sendOk("Hello #b#h0##k, I'm #p9201025# the fairy of Love."); cm.dispose(); return; } - + nanaLoc = getNanaLocation(cm.getPlayer()); - if(nanaLoc == -1) { + if (nanaLoc == -1) { cm.sendOk("Hello #b#h0##k, I'm #p9201025# the fairy of Love."); cm.dispose(); return; } - - if(!cm.haveItem(4031367 + nanaLoc, 1)) { - if(cm.isQuestCompleted(100401 + nanaLoc)) { + + if (!cm.haveItem(4031367 + nanaLoc, 1)) { + if (cm.isQuestCompleted(100401 + nanaLoc)) { state = 1; cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k"); - } else if(cm.isQuestStarted(100401 + nanaLoc)) { - if(processNanaQuest()) { + } else if (cm.isQuestStarted(100401 + nanaLoc)) { + if (processNanaQuest()) { cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate()); cm.completeQuest(100401 + nanaLoc); } - + cm.dispose(); } else { state = 0; @@ -130,10 +131,10 @@ function action(mode, type, selection) { cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?"); cm.dispose(); } - } else if(status == 1) { - if(state == 0) { + } else if (status == 1) { + if (state == 0) { cm.startQuest(100401 + nanaLoc); - + cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k."); cm.dispose(); } else { diff --git a/scripts/npc/9201026.js b/scripts/npc/9201026.js index 48d97f52a3..0fe1ee5aec 100644 --- a/scripts/npc/9201026.js +++ b/scripts/npc/9201026.js @@ -34,25 +34,25 @@ var options; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } function getNanaLocation(player) { var mapid = player.getMap().getId(); - - for(var i = 0; i < mapids.length; i++) { - if(mapid == mapids[i]) { + + for (var i = 0; i < mapids.length; i++) { + if (mapid == mapids[i]) { return i; } } - + return -1; } @@ -62,8 +62,8 @@ var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128]; var questExp = [2000, 5000, 10000, 17000, 22000, 30000]; function processNanaQuest() { - if(cm.haveItem(questItems[nanaLoc], 50)) { - if(cm.canHold(4031367 + nanaLoc, 1)) { + if (cm.haveItem(questItems[nanaLoc], 50)) { + if (cm.canHold(4031367 + nanaLoc, 1)) { cm.gainItem(questItems[nanaLoc], -50); cm.gainItem(4031367 + nanaLoc, 1); @@ -75,7 +75,7 @@ function processNanaQuest() { } else { cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k."); } - + return false; } @@ -92,35 +92,36 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(!cm.isQuestStarted(100400)) { + if (status == 0) { + if (!cm.isQuestStarted(100400)) { cm.sendOk("Hello #b#h0##k, I'm #p9201026# the fairy of Love."); cm.dispose(); return; } - + nanaLoc = getNanaLocation(cm.getPlayer()); - if(nanaLoc == -1) { + if (nanaLoc == -1) { cm.sendOk("Hello #b#h0##k, I'm #p9201026# the fairy of Love."); cm.dispose(); return; } - - if(!cm.haveItem(4031367 + nanaLoc, 1)) { - if(cm.isQuestCompleted(100401 + nanaLoc)) { + + if (!cm.haveItem(4031367 + nanaLoc, 1)) { + if (cm.isQuestCompleted(100401 + nanaLoc)) { state = 1; cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k"); - } else if(cm.isQuestStarted(100401 + nanaLoc)) { - if(processNanaQuest()) { + } else if (cm.isQuestStarted(100401 + nanaLoc)) { + if (processNanaQuest()) { cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate()); cm.completeQuest(100401 + nanaLoc); } - + cm.dispose(); } else { state = 0; @@ -130,10 +131,10 @@ function action(mode, type, selection) { cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?"); cm.dispose(); } - } else if(status == 1) { - if(state == 0) { + } else if (status == 1) { + if (state == 0) { cm.startQuest(100401 + nanaLoc); - + cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k."); cm.dispose(); } else { diff --git a/scripts/npc/9201027.js b/scripts/npc/9201027.js index e02f52039e..97ebf72da8 100644 --- a/scripts/npc/9201027.js +++ b/scripts/npc/9201027.js @@ -34,25 +34,25 @@ var options; function hasProofOfLoves(player) { var count = 0; - - for(var i = 4031367; i <= 4031372; i++) { - if(player.haveItem(i)) { + + for (var i = 4031367; i <= 4031372; i++) { + if (player.haveItem(i)) { count++; } } - + return count >= 4; } function getNanaLocation(player) { var mapid = player.getMap().getId(); - - for(var i = 0; i < mapids.length; i++) { - if(mapid == mapids[i]) { + + for (var i = 0; i < mapids.length; i++) { + if (mapid == mapids[i]) { return i; } } - + return -1; } @@ -62,8 +62,8 @@ var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128]; var questExp = [2000, 5000, 10000, 17000, 22000, 30000]; function processNanaQuest() { - if(cm.haveItem(questItems[nanaLoc], 50)) { - if(cm.canHold(4031367 + nanaLoc, 1)) { + if (cm.haveItem(questItems[nanaLoc], 50)) { + if (cm.canHold(4031367 + nanaLoc, 1)) { cm.gainItem(questItems[nanaLoc], -50); cm.gainItem(4031367 + nanaLoc, 1); @@ -75,7 +75,7 @@ function processNanaQuest() { } else { cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k."); } - + return false; } @@ -92,35 +92,36 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - if(!cm.isQuestStarted(100400)) { + if (status == 0) { + if (!cm.isQuestStarted(100400)) { cm.sendOk("Hello #b#h0##k, I'm #p9201027# the fairy of Love."); cm.dispose(); return; } - + nanaLoc = getNanaLocation(cm.getPlayer()); - if(nanaLoc == -1) { + if (nanaLoc == -1) { cm.sendOk("Hello #b#h0##k, I'm #p9201027# the fairy of Love."); cm.dispose(); return; } - - if(!cm.haveItem(4031367 + nanaLoc, 1)) { - if(cm.isQuestCompleted(100401 + nanaLoc)) { + + if (!cm.haveItem(4031367 + nanaLoc, 1)) { + if (cm.isQuestCompleted(100401 + nanaLoc)) { state = 1; cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k"); - } else if(cm.isQuestStarted(100401 + nanaLoc)) { - if(processNanaQuest()) { + } else if (cm.isQuestStarted(100401 + nanaLoc)) { + if (processNanaQuest()) { cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate()); cm.completeQuest(100401 + nanaLoc); } - + cm.dispose(); } else { state = 0; @@ -130,10 +131,10 @@ function action(mode, type, selection) { cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?"); cm.dispose(); } - } else if(status == 1) { - if(state == 0) { + } else if (status == 1) { + if (state == 0) { cm.startQuest(100401 + nanaLoc); - + cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k."); cm.dispose(); } else { diff --git a/scripts/npc/9201033.js b/scripts/npc/9201033.js index 6bc3f304be..35f038de04 100644 --- a/scripts/npc/9201033.js +++ b/scripts/npc/9201033.js @@ -31,7 +31,7 @@ var status; var smap = 681000000; var hv = 209000000; var tst, b2h; - + function start() { status = -1; action(1, 0, 0); @@ -42,8 +42,8 @@ function action(mode, type, selection) { cm.dispose(); } else { if (status == 0 && mode == 0) { - cm.sendNext("Let me know if you've changed your mind!"); - cm.dispose(); + cm.sendNext("Let me know if you've changed your mind!"); + cm.dispose(); } if (mode == 1) { @@ -53,14 +53,14 @@ function action(mode, type, selection) { } if (status == 0) { - if (cm.getMapId() == hv) { + if (cm.getMapId() == hv) { tst = 1; //to shalom temple - cm.sendYesNo("The Shalom Temple is unlike any other place in Happyville, would you like to head to #bShalom Temple#k?"); //not GMS lol - } else if (cm.getMapId() == smap) { + cm.sendYesNo("The Shalom Temple is unlike any other place in Happyville, would you like to head to #bShalom Temple#k?"); //not GMS lol + } else if (cm.getMapId() == smap) { b2h = 1; //back to happyville - cm.sendYesNo("Would you like to head back to Happyville?"); - } - } else if (status == 1) { + cm.sendYesNo("Would you like to head back to Happyville?"); + } + } else if (status == 1) { if (tst == 1) { cm.warp(smap, 0); cm.dispose(); diff --git a/scripts/npc/9201039.js b/scripts/npc/9201039.js index 19f7387a10..e64f85d3c7 100644 --- a/scripts/npc/9201039.js +++ b/scripts/npc/9201039.js @@ -41,8 +41,9 @@ function start() { if (cm.isQuestCompleted(8860) && !cm.haveItem(4031528)) { cm.sendNext("I've already done your hair once as a trade-for-services, sport. You'll have to snag an EXP Hair coupon from the Cash Shop if you want to change it again!"); cm.dispose(); - } else + } else { cm.sendYesNo("Ready for an awesome hairdo? I think you are! Just say the word, and we'll get started!"); + } } function action(mode, type, selection) { @@ -50,18 +51,21 @@ function action(mode, type, selection) { if (type == 7) { cm.sendNext("Ok, I'll give you a minute."); } - + cm.dispose(); } status++; if (status == 1) { hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_q.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_q.length; i++) { pushIfItemExists(hairnew, mhair_q[i]); - else - for(var j = 0; j < fhair_q.length; j++) + } + } else { + for (var j = 0; j < fhair_q.length; j++) { pushIfItemExists(hairnew, fhair_q[j]); + } + } cm.sendNext("Here we go!"); } else { if (cm.haveItem(4031528)) { diff --git a/scripts/npc/9201042.js b/scripts/npc/9201042.js index d884e0b67b..eb367d0707 100644 --- a/scripts/npc/9201042.js +++ b/scripts/npc/9201042.js @@ -41,69 +41,70 @@ var advance = true; var status; function getTierTicket(level) { - if(level < 50) { - return 4031543; - } else if(level < 120) { - return 4031544; - } else { - return 4031545; - } + if (level < 50) { + return 4031543; + } else if (level < 120) { + return 4031544; + } else { + return 4031545; + } } function start() { - slctTicket = getTierTicket(cm.getPlayer().getLevel()); - amntTicket = cm.getItemQuantity(slctTicket); - - status = -1; - action(1, 0, 0); + slctTicket = getTierTicket(cm.getPlayer().getLevel()); + amntTicket = cm.getItemQuantity(slctTicket); + + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1 && advance) - status++; - else - status--; - - advance = true; - - if(status == 0) { - cm.sendNext("Hi there, how is it going? Since you're passing by Amoria, have you heard about the instance my brother Amos is hosting? It is the #bAmorian Challenge#k, an instance for everyone above level 40.\r\n\r\nThere, you may find the #i4031543# #i4031544# #i4031545# #bWish Tickets#k that can be brought here to redeem prizes."); - } else if(status == 1) { - var listStr = ""; - for(var i = 0; i < wishPrizes.length; i++) { - listStr += "#b#L" + i + "#" + wishPrizesQty[i] + " #z" + wishPrizes[i] + "##k"; - listStr += " - " + wishPrizesCst[i] + " wish tickets"; - listStr += "#l\r\n"; - } - - cm.sendSimple("You currently have #b" + amntTicket + " #i" + slctTicket + "# #t" + slctTicket + "##k.\r\n\r\nPurchase a prize:\r\n\r\n" + listStr); - } else if(status == 2) { - sel = selection; - - if(amntTicket < wishPrizesCst[selection]) { - cm.sendPrev("You will need #b" + wishPrizesCst[selection] + " #t" + slctTicket + "##k to purchase that! If you want this, come back another time when you have all the tickets at hand."); - advance = false; - } else { - cm.sendYesNo("You have selected #b" + wishPrizesQty[selection] + " #z" + wishPrizes[selection] + "##k, that will require #b" + wishPrizesCst[selection] + " #t" + slctTicket + "##k. Will you purchase it?"); - } - } else { - if(cm.canHold(wishPrizes[sel], wishPrizesQty[sel])) { - cm.gainItem(wishPrizes[sel], wishPrizesQty[sel]); - cm.gainItem(slctTicket, -wishPrizesCst[sel]); - - cm.sendOk("There you go, have a good day!"); - } else { - cm.sendOk("Please have a slot available on your inventory before claiming the item."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1 && advance) { + status++; + } else { + status--; + } + + advance = true; + + if (status == 0) { + cm.sendNext("Hi there, how is it going? Since you're passing by Amoria, have you heard about the instance my brother Amos is hosting? It is the #bAmorian Challenge#k, an instance for everyone above level 40.\r\n\r\nThere, you may find the #i4031543# #i4031544# #i4031545# #bWish Tickets#k that can be brought here to redeem prizes."); + } else if (status == 1) { + var listStr = ""; + for (var i = 0; i < wishPrizes.length; i++) { + listStr += "#b#L" + i + "#" + wishPrizesQty[i] + " #z" + wishPrizes[i] + "##k"; + listStr += " - " + wishPrizesCst[i] + " wish tickets"; + listStr += "#l\r\n"; + } + + cm.sendSimple("You currently have #b" + amntTicket + " #i" + slctTicket + "# #t" + slctTicket + "##k.\r\n\r\nPurchase a prize:\r\n\r\n" + listStr); + } else if (status == 2) { + sel = selection; + + if (amntTicket < wishPrizesCst[selection]) { + cm.sendPrev("You will need #b" + wishPrizesCst[selection] + " #t" + slctTicket + "##k to purchase that! If you want this, come back another time when you have all the tickets at hand."); + advance = false; + } else { + cm.sendYesNo("You have selected #b" + wishPrizesQty[selection] + " #z" + wishPrizes[selection] + "##k, that will require #b" + wishPrizesCst[selection] + " #t" + slctTicket + "##k. Will you purchase it?"); + } + } else { + if (cm.canHold(wishPrizes[sel], wishPrizesQty[sel])) { + cm.gainItem(wishPrizes[sel], wishPrizesQty[sel]); + cm.gainItem(slctTicket, -wishPrizesCst[sel]); + + cm.sendOk("There you go, have a good day!"); + } else { + cm.sendOk("Please have a slot available on your inventory before claiming the item."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9201043.js b/scripts/npc/9201043.js index a1de5f9201..49e9fd8618 100644 --- a/scripts/npc/9201043.js +++ b/scripts/npc/9201043.js @@ -32,18 +32,19 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (status >= 0 && mode == 0) { cm.sendOk("Ok come back when you're ready."); cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1 && selection == 0) { if (cm.haveItem(4031592, 1)) { cm.sendYesNo("So you would like to enter the #bEntrance#k?"); @@ -56,8 +57,7 @@ function action(mode, type, selection) { if (cm.haveItem(4031592)) { cm.sendOk("You already have an Entrance Ticket!"); cm.dispose(); - } - else if (cm.haveItem(4031593, 10)) { + } else if (cm.haveItem(4031593, 10)) { cm.sendYesNo("So you would like a Ticket?"); MySelection = selection; } else { diff --git a/scripts/npc/9201044.js b/scripts/npc/9201044.js index b39df0da47..e413a02687 100644 --- a/scripts/npc/9201044.js +++ b/scripts/npc/9201044.js @@ -43,8 +43,8 @@ function spawnMobs(maxSpawn) { spawnPosX = [619, 299, 47, -140, -471]; spawnPosY = [-840, -840, -840, -840, -840]; - for(var i = 0; i < 5; i++) { - for(var j = 0; j < 2; j++) { + for (var i = 0; i < 5; i++) { + for (var j = 0; j < 2; j++) { var mobObj1 = LifeFactory.getMonster(9400515); var mobObj2 = LifeFactory.getMonster(9400516); var mobObj3 = LifeFactory.getMonster(9400517); @@ -58,7 +58,7 @@ function spawnMobs(maxSpawn) { spawnPosX = [2303, 1832, 1656, 1379, 1171]; spawnPosY = [240, 150, 300, 150, 240]; - for(var i = 0; i < maxSpawn; i++) { + for (var i = 0; i < maxSpawn; i++) { var rndMob = 9400519 + Math.floor(Math.random() * 4); var rndPos = Math.floor(Math.random() * 5); @@ -69,45 +69,47 @@ function spawnMobs(maxSpawn) { } function generateCombo1() { - var positions = Array(0,0,0,0,0,0,0,0,0); - var rndPicked = Math.floor(Math.random() * Math.pow(3, 5)); - - while(rndPicked > 0) { - (positions[rndPicked % 3])++; - - rndPicked = Math.floor(rndPicked / 3); + var positions = Array(0, 0, 0, 0, 0, 0, 0, 0, 0); + var rndPicked = Math.floor(Math.random() * Math.pow(3, 5)); + + while (rndPicked > 0) { + (positions[rndPicked % 3])++; + + rndPicked = Math.floor(rndPicked / 3); + } + + var returnString = ""; + for (var i = 0; i < positions.length; i++) { + returnString += positions[i]; + if (i != positions.length - 1) { + returnString += ","; } - - var returnString = ""; - for(var i = 0; i < positions.length; i++) { - returnString += positions[i]; - if(i != positions.length - 1) - returnString += ","; - } - - return returnString; + } + + return returnString; } function generateCombo2() { - var toPick = 5, rndPicked; - var positions = Array(0,0,0,0,0,0,0,0,0); - while(toPick > 0) { - rndPicked = Math.floor(Math.random() * 9); - - if(positions[rndPicked] == 0) { - positions[rndPicked] = 1; - toPick--; - } - } - - var returnString = ""; - for(var i = 0; i < positions.length; i++) { - returnString += positions[i]; - if(i != positions.length - 1) - returnString += ","; - } - - return returnString; + var toPick = 5, rndPicked; + var positions = Array(0, 0, 0, 0, 0, 0, 0, 0, 0); + while (toPick > 0) { + rndPicked = Math.floor(Math.random() * 9); + + if (positions[rndPicked] == 0) { + positions[rndPicked] = 1; + toPick--; + } + } + + var returnString = ""; + for (var i = 0; i < positions.length; i++) { + returnString += positions[i]; + if (i != positions.length - 1) { + returnString += ","; + } + } + + return returnString; } var status = 0; @@ -115,16 +117,15 @@ var curMap, stage; function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); - if(stage > 1) { + if (stage > 1) { eim.showClearEffect(true); eim.linkToNextStage(stage, "apq", curMap); //opens the portal to the next map - } - else { + } else { cm.getMap().getPortal("go01").setPortalState(false); - + var val = Math.floor(Math.random() * 3); eim.showClearEffect(670010200, "gate" + val, 2); - + cm.getMap().getPortal("go0" + val).setPortalState(true); eim.linkPortalToScript(stage, "go0" + val, "apq0" + val, curMap); } @@ -133,159 +134,170 @@ function clearStage(stage, eim, curMap) { function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 670010200) / 100) + 1; - + status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - - if(eim.getProperty(stage.toString() + "stageclear") != null) { - cm.sendNext("The portal is already open, advance for the trials that awaits you there."); - } - else { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - if(stage == 1) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, talk to #p9201047#, he will pass to you further details of the mission. After shattering the Magik Mirror down there, return the shard to #p9201047# and come here to gain access to the next stage."); - else if(stage == 2) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, let 5 of your party members climb up the platforms in such a way to try for a combination to unlock the portal to the next level. When you feel ready, talk to me and I'll let you know the situation. However, be prepared, as in the case the portal does not get unlocked after a few tries, monsters will spawn."); - else if(stage == 3) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, let 5 of your party members climb up the platforms, one on each, in such a way to try for a combination to unlock the portal to the next level. When you feel ready, talk to me and I'll let you know the situation. Take hint: upon failing, count the number of slimes appearing on the scene, that will tell how many of you had their position right."); - - var st = (autopass) ? 2 : 0; - eim.setProperty("statusStg" + stage, st); - } - else { // check stage completion - if(state == 2) { - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - cm.dispose(); - return; - } - - var map = cm.getPlayer().getMap(); - if(stage == 1) { - if(eim.getIntProperty("statusStg" + stage) == 1) { - clearStage(stage, eim, curMap); - } else { - cm.sendOk("Talk with #p9201047# for more info on this stage."); - } - } else if(stage == 2 || stage == 3) { - if(map.countMonsters() == 0) { - objset = [0,0,0,0,0,0,0,0,0]; - var playersOnCombo = 0; - var party = cm.getEventInstance().getPlayers(); - for (var i = 0; i < party.size(); i++) { - for (var y = 0; y < map.getAreas().size(); y++) { - if (map.getArea(y).contains(party.get(i).getPosition())) { - playersOnCombo++; - objset[y] += 1; - break; - } - } - } - - if (playersOnCombo == 5/* || cm.getPlayer().gmLevel() > 1*/ || debug) { - var comboStr = eim.getProperty("stage" + stage + "combo"); - if (comboStr == null || comboStr == "") { - if (stage == 2) { - comboStr = generateCombo1(); - } else { - comboStr = generateCombo2(); - } - - eim.setProperty("stage" + stage + "combo", comboStr); - if(debug) print("generated " + comboStr + " for stg" + stage + "\n"); - } - - var combo = comboStr.split(','); - var correctCombo = true; - var guessedRight = objset.length; - var playersRight = 0; - - if(!debug) { - for (i = 0; i < objset.length; i++) { - if (parseInt(combo[i]) != objset[i]) { - correctCombo = false; - guessedRight--; - } else { - if(objset[i] > 0) playersRight++; - } - } - } else { - for (i = 0; i < objset.length; i++) { - var ci = cm.getPlayer().countItem(4000000 + i); - - if (ci != parseInt(combo[i])) { - correctCombo = false; - guessedRight--; - } else { - if(ci > 0) playersRight++; - } - } - } - - - if (correctCombo/* || cm.getPlayer().gmLevel() > 1*/) { - eim.setProperty("statusStg" + stage, 1); - clearStage(stage, eim, curMap); - cm.dispose(); - } else { - var miss = eim.getIntProperty("missCount") + 1; - var maxMiss = (stage == 2) ? 7 : 1; - - if (miss < maxMiss) { //already implies stage 2 - eim.setIntProperty("missCount", miss); - - if(guessedRight == 6) { //6 unused slots on this stage - cm.sendNext("All ropes weigh differently. Think your next course of action, then try again."); - cm.mapMessage(5, "Amos: Hmm... All ropes weigh differently."); - } - else { - cm.sendNext("One rope weigh the same. Think your next course of action, then try again."); - cm.mapMessage(5, "Amos: Hmm... One rope weigh the same."); - } - } else { - spawnMobs(playersRight); - eim.setIntProperty("missCount", 0); - if(stage == 2) { - eim.setProperty("stage2combo", ""); - - cm.sendNext("You have failed to discover the right combination, now it shall be reset. Start over again!"); - cm.mapMessage(5, "Amos: You have failed to discover the right combination, now it shall be reset. Start over again!"); - } - } - - eim.showWrongEffect(); - cm.dispose(); - } - } else { - if(stage == 2) cm.sendNext("It looks like you guys haven't found the ways of this trial yet. Think on an arrangement of 5 members on the platforms. Remember, exactly 5 are allowed to stand on the platforms, and if you move it may not count as an answer, so please keep that in mind. Keep going!"); - else cm.sendNext("It looks like you guys haven't found the ways of this trial yet. Think on an arrangement of party members on different platforms. Remember, exactly 5 are allowed to stand on the platforms, and if you move it may not count as an answer, so please keep that in mind. Keep going!"); - - cm.dispose(); - } - } else { - cm.sendNext("Defeat all mobs before trying for a combination."); - } - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + + if (eim.getProperty(stage.toString() + "stageclear") != null) { + cm.sendNext("The portal is already open, advance for the trials that awaits you there."); + } else { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + if (stage == 1) { + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, talk to #p9201047#, he will pass to you further details of the mission. After shattering the Magik Mirror down there, return the shard to #p9201047# and come here to gain access to the next stage."); + } else if (stage == 2) { + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, let 5 of your party members climb up the platforms in such a way to try for a combination to unlock the portal to the next level. When you feel ready, talk to me and I'll let you know the situation. However, be prepared, as in the case the portal does not get unlocked after a few tries, monsters will spawn."); + } else if (stage == 3) { + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, let 5 of your party members climb up the platforms, one on each, in such a way to try for a combination to unlock the portal to the next level. When you feel ready, talk to me and I'll let you know the situation. Take hint: upon failing, count the number of slimes appearing on the scene, that will tell how many of you had their position right."); + } + + var st = (autopass) ? 2 : 0; + eim.setProperty("statusStg" + stage, st); + } else { // check stage completion + if (state == 2) { + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + cm.dispose(); + return; + } + + var map = cm.getPlayer().getMap(); + if (stage == 1) { + if (eim.getIntProperty("statusStg" + stage) == 1) { + clearStage(stage, eim, curMap); + } else { + cm.sendOk("Talk with #p9201047# for more info on this stage."); + } + } else if (stage == 2 || stage == 3) { + if (map.countMonsters() == 0) { + objset = [0, 0, 0, 0, 0, 0, 0, 0, 0]; + var playersOnCombo = 0; + var party = cm.getEventInstance().getPlayers(); + for (var i = 0; i < party.size(); i++) { + for (var y = 0; y < map.getAreas().size(); y++) { + if (map.getArea(y).contains(party.get(i).getPosition())) { + playersOnCombo++; + objset[y] += 1; + break; + } + } + } + + if (playersOnCombo == 5/* || cm.getPlayer().gmLevel() > 1*/ || debug) { + var comboStr = eim.getProperty("stage" + stage + "combo"); + if (comboStr == null || comboStr == "") { + if (stage == 2) { + comboStr = generateCombo1(); + } else { + comboStr = generateCombo2(); + } + + eim.setProperty("stage" + stage + "combo", comboStr); + if (debug) { + print("generated " + comboStr + " for stg" + stage + "\n"); + } + } + + var combo = comboStr.split(','); + var correctCombo = true; + var guessedRight = objset.length; + var playersRight = 0; + + if (!debug) { + for (i = 0; i < objset.length; i++) { + if (parseInt(combo[i]) != objset[i]) { + correctCombo = false; + guessedRight--; + } else { + if (objset[i] > 0) { + playersRight++; + } + } + } + } else { + for (i = 0; i < objset.length; i++) { + var ci = cm.getPlayer().countItem(4000000 + i); + + if (ci != parseInt(combo[i])) { + correctCombo = false; + guessedRight--; + } else { + if (ci > 0) { + playersRight++; + } + } + } + } + + + if (correctCombo/* || cm.getPlayer().gmLevel() > 1*/) { + eim.setProperty("statusStg" + stage, 1); + clearStage(stage, eim, curMap); + cm.dispose(); + } else { + var miss = eim.getIntProperty("missCount") + 1; + var maxMiss = (stage == 2) ? 7 : 1; + + if (miss < maxMiss) { //already implies stage 2 + eim.setIntProperty("missCount", miss); + + if (guessedRight == 6) { //6 unused slots on this stage + cm.sendNext("All ropes weigh differently. Think your next course of action, then try again."); + cm.mapMessage(5, "Amos: Hmm... All ropes weigh differently."); + } else { + cm.sendNext("One rope weigh the same. Think your next course of action, then try again."); + cm.mapMessage(5, "Amos: Hmm... One rope weigh the same."); + } + } else { + spawnMobs(playersRight); + eim.setIntProperty("missCount", 0); + if (stage == 2) { + eim.setProperty("stage2combo", ""); + + cm.sendNext("You have failed to discover the right combination, now it shall be reset. Start over again!"); + cm.mapMessage(5, "Amos: You have failed to discover the right combination, now it shall be reset. Start over again!"); + } + } + + eim.showWrongEffect(); + cm.dispose(); + } + } else { + if (stage == 2) { + cm.sendNext("It looks like you guys haven't found the ways of this trial yet. Think on an arrangement of 5 members on the platforms. Remember, exactly 5 are allowed to stand on the platforms, and if you move it may not count as an answer, so please keep that in mind. Keep going!"); + } else { + cm.sendNext("It looks like you guys haven't found the ways of this trial yet. Think on an arrangement of party members on different platforms. Remember, exactly 5 are allowed to stand on the platforms, and if you move it may not count as an answer, so please keep that in mind. Keep going!"); + } + + cm.dispose(); + } + } else { + cm.sendNext("Defeat all mobs before trying for a combination."); + } + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201045.js b/scripts/npc/9201045.js index 849bb7da99..98111f98ef 100644 --- a/scripts/npc/9201045.js +++ b/scripts/npc/9201045.js @@ -35,20 +35,20 @@ var curMap, stage; function isAllGatesOpen() { var map = cm.getPlayer().getMap(); - - for(var i = 0; i < 7; i++) { + + for (var i = 0; i < 7; i++) { var gate = map.getReactorByName("gate0" + i); - if(gate.getState() != 4) { + if (gate.getState() != 4) { return false; } } - + return true; } function clearStage(stage, eim, curMap) { eim.setProperty(stage + "stageclear", "true"); - + eim.showClearEffect(true); eim.linkToNextStage(stage, "apq", curMap); //opens the portal to the next map } @@ -56,142 +56,146 @@ function clearStage(stage, eim, curMap) { function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 670010200) / 100) + 1; - + status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - if(eim.getProperty(stage.toString() + "stageclear") != null) { - if(stage < 5) cm.sendNext("The portal is already open, advance for the trials that awaits you there."); - else if(stage == 5) eim.warpEventTeamToMapSpawnPoint(670010700, 0); - else { - if(cm.isEventLeader()) { - if(eim.getIntProperty("marriedGroup") == 0) { - eim.restartEventTimer(1 * 60 * 1000); - eim.warpEventTeam(670010800); - } else { - eim.setIntProperty("marriedGroup", 0); - - eim.restartEventTimer(2 * 60 * 1000); - eim.warpEventTeamToMapSpawnPoint(670010750, 1); - } - } else { - cm.sendNext("Wait for the leader's command to start the bonus phase."); - } - } - } - else { - if(stage != 6) { - if (eim.isEventLeader(cm.getPlayer())) { - var state = eim.getIntProperty("statusStg" + stage); - - if(state == -1) { // preamble - if(stage == 4) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, collect me #b50 #t4031597##k from the mobs around here."); - else if(stage == 5) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. That was quite the run to reach here, eh? Well, that was your task this stage here, anyway: survival! Firstly, have anyone alive gathered here before challenging the boss."); - - var st = (debug) ? 2 : 0; - eim.setProperty("statusStg" + stage, st); - } - else { // check stage completion - if(stage == 4) { - if(cm.haveItem(4031597, 50)) { - cm.gainItem(4031597, -50); - - var tl = eim.getTimeLeft(); - if(tl >= 5 * 60 * 1000) { - eim.setProperty("timeLeft", tl.toString()); - eim.restartEventTimer(4 * 60 * 1000); - } - - cm.sendNext("Well done! Let me open the gate for you now."); - cm.mapMessage(5, "Amos: The time runs short now. Your objective is to open the gates and gather together on the other side of the next map. Good luck!"); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("Hey, didn't you pay heed? I demand #r50 #t4031597##k for the success of this trial."); - } - - } else if(stage == 5) { - var pass = true; - - if(eim.isEventTeamTogether()) { - var party = cm.getEventInstance().getPlayers(); - var area = cm.getMap().getArea(2); - - for (var i = 0; i < party.size(); i++) { - var chr = party.get(i); - - if (chr.isAlive() && !area.contains(chr.getPosition())) { - pass = false; - break; - } - } - } else { - pass = false; - } - - if(pass) { - if(isAllGatesOpen()) { - var tl = eim.getProperty("timeLeft"); - if(tl != null) { - var tr = eim.getTimeLeft(); - - var tl = parseFloat(tl); - eim.restartEventTimer(tl - (4 * 60 * 1000 - tr)); - } - - cm.sendNext("Okay, your team is already gathered. Talk to me when you guys feel ready to fight the #rGeist Balrog#k."); - - cm.mapMessage(5, "Amos: Now only the boss fight remains! Once inside, talk to me only if you want to join the boss fight, you will be transported to action immediately."); - clearStage(stage, eim, curMap); - } else { - cm.sendNext("You guys reached here by teleporting, eh? I can tell it. This is a shame, all gates needs to be open to fulfill this stage. If you still have the time, backtrack your steps and take down those gates."); - } - } else { - cm.sendNext("Your team has not gathered nearby yet. Give them some time to reach here."); - } - } - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } else { - var area = cm.getMap().getArea(0); - if (area.contains(cm.getPlayer().getPosition())) { - if(cm.getPlayer().isAlive()) { - cm.warp(670010700, "st01"); - } else { - cm.sendNext("Oy stand back... You are already dead."); - } - } else { - if(cm.isEventLeader()) { - if(cm.haveItem(4031594, 1)) { - cm.gainItem(4031594, -1); - cm.sendNext("Congratulations! Your party defeated the Geist Balrog, thus #bcompleting the Amorian Challenge#k! Talk to me again to start the bonus stage."); - - clearStage(stage, eim, curMap); - eim.clearPQ(); - } else { - cm.sendNext("How is it? Are you going to retrieve me the #b#t4031594##k? That's your last trial, hold on!") - } - } else { - cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); - } - } - } - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + if (eim.getProperty(stage.toString() + "stageclear") != null) { + if (stage < 5) { + cm.sendNext("The portal is already open, advance for the trials that awaits you there."); + } else if (stage == 5) { + eim.warpEventTeamToMapSpawnPoint(670010700, 0); + } else { + if (cm.isEventLeader()) { + if (eim.getIntProperty("marriedGroup") == 0) { + eim.restartEventTimer(1 * 60 * 1000); + eim.warpEventTeam(670010800); + } else { + eim.setIntProperty("marriedGroup", 0); + + eim.restartEventTimer(2 * 60 * 1000); + eim.warpEventTeamToMapSpawnPoint(670010750, 1); + } + } else { + cm.sendNext("Wait for the leader's command to start the bonus phase."); + } + } + } else { + if (stage != 6) { + if (eim.isEventLeader(cm.getPlayer())) { + var state = eim.getIntProperty("statusStg" + stage); + + if (state == -1) { // preamble + if (stage == 4) { + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, collect me #b50 #t4031597##k from the mobs around here."); + } else if (stage == 5) { + cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. That was quite the run to reach here, eh? Well, that was your task this stage here, anyway: survival! Firstly, have anyone alive gathered here before challenging the boss."); + } + + var st = (debug) ? 2 : 0; + eim.setProperty("statusStg" + stage, st); + } else { // check stage completion + if (stage == 4) { + if (cm.haveItem(4031597, 50)) { + cm.gainItem(4031597, -50); + + var tl = eim.getTimeLeft(); + if (tl >= 5 * 60 * 1000) { + eim.setProperty("timeLeft", tl.toString()); + eim.restartEventTimer(4 * 60 * 1000); + } + + cm.sendNext("Well done! Let me open the gate for you now."); + cm.mapMessage(5, "Amos: The time runs short now. Your objective is to open the gates and gather together on the other side of the next map. Good luck!"); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("Hey, didn't you pay heed? I demand #r50 #t4031597##k for the success of this trial."); + } + + } else if (stage == 5) { + var pass = true; + + if (eim.isEventTeamTogether()) { + var party = cm.getEventInstance().getPlayers(); + var area = cm.getMap().getArea(2); + + for (var i = 0; i < party.size(); i++) { + var chr = party.get(i); + + if (chr.isAlive() && !area.contains(chr.getPosition())) { + pass = false; + break; + } + } + } else { + pass = false; + } + + if (pass) { + if (isAllGatesOpen()) { + var tl = eim.getProperty("timeLeft"); + if (tl != null) { + var tr = eim.getTimeLeft(); + + var tl = parseFloat(tl); + eim.restartEventTimer(tl - (4 * 60 * 1000 - tr)); + } + + cm.sendNext("Okay, your team is already gathered. Talk to me when you guys feel ready to fight the #rGeist Balrog#k."); + + cm.mapMessage(5, "Amos: Now only the boss fight remains! Once inside, talk to me only if you want to join the boss fight, you will be transported to action immediately."); + clearStage(stage, eim, curMap); + } else { + cm.sendNext("You guys reached here by teleporting, eh? I can tell it. This is a shame, all gates needs to be open to fulfill this stage. If you still have the time, backtrack your steps and take down those gates."); + } + } else { + cm.sendNext("Your team has not gathered nearby yet. Give them some time to reach here."); + } + } + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } else { + var area = cm.getMap().getArea(0); + if (area.contains(cm.getPlayer().getPosition())) { + if (cm.getPlayer().isAlive()) { + cm.warp(670010700, "st01"); + } else { + cm.sendNext("Oy stand back... You are already dead."); + } + } else { + if (cm.isEventLeader()) { + if (cm.haveItem(4031594, 1)) { + cm.gainItem(4031594, -1); + cm.sendNext("Congratulations! Your party defeated the Geist Balrog, thus #bcompleting the Amorian Challenge#k! Talk to me again to start the bonus stage."); + + clearStage(stage, eim, curMap); + eim.clearPQ(); + } else { + cm.sendNext("How is it? Are you going to retrieve me the #b#t4031594##k? That's your last trial, hold on!") + } + } else { + cm.sendNext("Please tell your #bParty-Leader#k to come talk to me."); + } + } + } + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201046.js b/scripts/npc/9201046.js index 5c6cbe2a9d..54a90e9db2 100644 --- a/scripts/npc/9201046.js +++ b/scripts/npc/9201046.js @@ -36,49 +36,50 @@ var curMap, stage; function start() { curMap = cm.getMapId(); stage = Math.floor((curMap - 670010200) / 100) + 1; - + status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else if (mode == 0){ - cm.dispose(); + if (mode == -1) { + cm.dispose(); + } else if (mode == 0) { + cm.dispose(); + } else { + if (mode == 1) { + status++; } else { - if (mode == 1) - status++; - else - status--; - - var eim = cm.getPlayer().getEventInstance(); - if(curMap == 670010750) { - if(cm.haveItem(4031597, 35)) { - if(cm.canHold(1102101) && eim.getIntProperty("marriedGroup") == 0) { - eim.setIntProperty("marriedGroup", 1); - - var baseId = (cm.getPlayer().getGender() == 0) ? 1102101 : 1102104; - var rnd = Math.floor(Math.random() * 3); - cm.gainItem(baseId + rnd); - - cm.sendNext("Bravo! You are the first to claim the prize for fetching 35 #t4031597#. Take this cape as merit for your feat."); - cm.gainItem(4031597, -35); - cm.gainExp(4000 * cm.getPlayer().getExpRate()); - } else if(eim.getIntProperty("marriedGroup") == 0) { - cm.sendNext("Check if you have a slot available before talking about receiving prizes!"); - } else { - cm.sendNext("35 #t4031597#. Nicely done, too bad someone took the prize first. Hurry up to get the last moments of the bonus stage!"); - cm.gainItem(4031597, -35); - cm.gainExp(4000 * cm.getPlayer().getExpRate()); - } - } else { - cm.sendNext("To claim a prize here, get to me 35 #t4031597# from the mobs spawned from the boxes. Only the #rfirst player can claim the big prize#k, although others can still claim an EXP boost from this feat. Alternatively, one can choose to #bskip this bonus stage#k and go for the usual one by passing #bthrough the portals#k."); - } - } else { - cm.sendNext("Hurry up to get the last moments of the bonus stage!"); - } - - cm.dispose(); + status--; } + + var eim = cm.getPlayer().getEventInstance(); + if (curMap == 670010750) { + if (cm.haveItem(4031597, 35)) { + if (cm.canHold(1102101) && eim.getIntProperty("marriedGroup") == 0) { + eim.setIntProperty("marriedGroup", 1); + + var baseId = (cm.getPlayer().getGender() == 0) ? 1102101 : 1102104; + var rnd = Math.floor(Math.random() * 3); + cm.gainItem(baseId + rnd); + + cm.sendNext("Bravo! You are the first to claim the prize for fetching 35 #t4031597#. Take this cape as merit for your feat."); + cm.gainItem(4031597, -35); + cm.gainExp(4000 * cm.getPlayer().getExpRate()); + } else if (eim.getIntProperty("marriedGroup") == 0) { + cm.sendNext("Check if you have a slot available before talking about receiving prizes!"); + } else { + cm.sendNext("35 #t4031597#. Nicely done, too bad someone took the prize first. Hurry up to get the last moments of the bonus stage!"); + cm.gainItem(4031597, -35); + cm.gainExp(4000 * cm.getPlayer().getExpRate()); + } + } else { + cm.sendNext("To claim a prize here, get to me 35 #t4031597# from the mobs spawned from the boxes. Only the #rfirst player can claim the big prize#k, although others can still claim an EXP boost from this feat. Alternatively, one can choose to #bskip this bonus stage#k and go for the usual one by passing #bthrough the portals#k."); + } + } else { + cm.sendNext("Hurry up to get the last moments of the bonus stage!"); + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201047.js b/scripts/npc/9201047.js index cb780bbcb1..b3fe644773 100644 --- a/scripts/npc/9201047.js +++ b/scripts/npc/9201047.js @@ -25,66 +25,70 @@ var status; var curMap, stage; - + function start() { - curMap = cm.getMapId(); - stage = Math.floor((curMap - 670010200) / 100) + 1; - - status = -1; - action(1, 0, 0); + curMap = cm.getMapId(); + stage = Math.floor((curMap - 670010200) / 100) + 1; + + status = -1; + action(1, 0, 0); } -function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(cm.getMapId() != 670010200) { - cm.sendYesNo("So, are you going to leave this place?"); - } else { - if(cm.isEventLeader()) { - var eim = cm.getEventInstance(); - var st = eim.getIntProperty("statusStg" + stage); - - if(cm.haveItem(4031595, 1)) { - cm.gainItem(4031595, -1); - eim.setIntProperty("statusStg" + stage, 1); - - cm.sendOk("You retrieved the #t4031595#, splendid! You may report to Amos about your success on this task."); - } else if(st < 1 && cm.getMap().countMonsters() == 0) { - eim.setIntProperty("statusStg" + stage, 1); - - var mapObj = cm.getMap(); - mapObj.toggleDrops(); - - const LifeFactory = Java.type('server.life.LifeFactory'); - const Point = Java.type('java.awt.Point'); - var mobObj = LifeFactory.getMonster(9400518); - mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(-245, 810)); - - cm.sendOk("The fierry appeared! Defeat it to get the #b#t4031596##k!"); - } else { - if(st < 1) cm.sendOk("Your task is to recover a shard of the Magik Mirror. To do so, you will need a #b#t4031596##k, that drops on a fierry that appears when all other mobs are killed. To access the rooms the mobs are, pick the portal corresponding to your gender and kill all mobs there. Ladies take the left side, gentlemen the right side."); - else cm.sendOk("Your task is to recover a shard of the Magik Mirror. Defeat the fierry to get the #b#t4031596##k."); - } - } else { - cm.sendOk("Your task is to recover a shard of the Magik Mirror. To do so, you will need a #b#t4031596##k, that drops on a fierry that appears when all other mobs are killed. To access the rooms the mobs are, pick the portal corresponding to your gender and kill all mobs there. Ladies take the left side, gentlemen the right side. #bYour leader#k must bring the #b#t4031595##k to have my pass."); - } - - cm.dispose(); - } - } else if(status == 1) { - cm.warp(670010000, "st00"); - cm.dispose(); - } +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (cm.getMapId() != 670010200) { + cm.sendYesNo("So, are you going to leave this place?"); + } else { + if (cm.isEventLeader()) { + var eim = cm.getEventInstance(); + var st = eim.getIntProperty("statusStg" + stage); + + if (cm.haveItem(4031595, 1)) { + cm.gainItem(4031595, -1); + eim.setIntProperty("statusStg" + stage, 1); + + cm.sendOk("You retrieved the #t4031595#, splendid! You may report to Amos about your success on this task."); + } else if (st < 1 && cm.getMap().countMonsters() == 0) { + eim.setIntProperty("statusStg" + stage, 1); + + var mapObj = cm.getMap(); + mapObj.toggleDrops(); + + const LifeFactory = Java.type('server.life.LifeFactory'); + const Point = Java.type('java.awt.Point'); + var mobObj = LifeFactory.getMonster(9400518); + mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(-245, 810)); + + cm.sendOk("The fierry appeared! Defeat it to get the #b#t4031596##k!"); + } else { + if (st < 1) { + cm.sendOk("Your task is to recover a shard of the Magik Mirror. To do so, you will need a #b#t4031596##k, that drops on a fierry that appears when all other mobs are killed. To access the rooms the mobs are, pick the portal corresponding to your gender and kill all mobs there. Ladies take the left side, gentlemen the right side."); + } else { + cm.sendOk("Your task is to recover a shard of the Magik Mirror. Defeat the fierry to get the #b#t4031596##k."); + } + } + } else { + cm.sendOk("Your task is to recover a shard of the Magik Mirror. To do so, you will need a #b#t4031596##k, that drops on a fierry that appears when all other mobs are killed. To access the rooms the mobs are, pick the portal corresponding to your gender and kill all mobs there. Ladies take the left side, gentlemen the right side. #bYour leader#k must bring the #b#t4031595##k to have my pass."); + } + + cm.dispose(); + } + } else if (status == 1) { + cm.warp(670010000, "st00"); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9201048.js b/scripts/npc/9201048.js index 7e2538525c..8c1335cabe 100644 --- a/scripts/npc/9201048.js +++ b/scripts/npc/9201048.js @@ -23,70 +23,70 @@ * @npc: Amos * @map: Entrance of Amorian Challenge (670010100) * @func: Amoria PQ -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("AmoriaPQ"); - if(em == null) { - cm.sendOk("The Amoria PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nIf you're brave enough to attempt the Amorian Challenge, join with others like you and let your #bparty leader#k talk to me. If a party filled with whole married couples register to the challenge, better prizes awaits there.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nI am Amos, hoster of the well-round famed Amorian Challenge. The instance consist of many team puzzles, where cooperation is the fundamental key for progress. Team up with other players to attempt for the bonus stage, where many goodies can be obtained at the end of the instance. If an all-couple party is formed, they can get even better prizes on the extra bonus stage."); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("AmoriaPQ"); + if (em == null) { + cm.sendOk("The Amoria PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nIf you're brave enough to attempt the Amorian Challenge, join with others like you and let your #bparty leader#k talk to me. If a party filled with whole married couples register to the challenge, better prizes awaits there.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nI am Amos, hoster of the well-round famed Amorian Challenge. The instance consist of many team puzzles, where cooperation is the fundamental key for progress. Team up with other players to attempt for the bonus stage, where many goodies can be obtained at the end of the instance. If an all-couple party is formed, they can get even better prizes on the extra bonus stage."); + cm.dispose(); + } + } + } } diff --git a/scripts/npc/9201049.js b/scripts/npc/9201049.js index 2066d213af..e25f4b83ce 100644 --- a/scripts/npc/9201049.js +++ b/scripts/npc/9201049.js @@ -23,33 +23,34 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); + if (mode == -1) { + cm.dispose(); } else { if (mode == 0 && type > 0) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { - cm.sendOk("Hey there, did you enjoy the wedding? I will head you back to #bAmoria#k now."); - } else if(status == 1) { + if (status == 0) { + cm.sendOk("Hey there, did you enjoy the wedding? I will head you back to #bAmoria#k now."); + } else if (status == 1) { var eim = cm.getEventInstance(); - if(eim != null) { + if (eim != null) { var boxId = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId")) ? 4031424 : 4031423; - - if(cm.canHold(boxId, 1)) { + + if (cm.canHold(boxId, 1)) { cm.gainItem(boxId, 1); cm.warp(680000000); cm.sendOk("You just received an Onyx Chest. Search for #b#p9201014##k, she is at the top of Amoria, she knows how to open these."); @@ -61,7 +62,7 @@ function action(mode, type, selection) { } else { cm.warp(680000000); } - + cm.dispose(); } } diff --git a/scripts/npc/9201050.js b/scripts/npc/9201050.js index 946012cf4b..5ac3dc3d1d 100644 --- a/scripts/npc/9201050.js +++ b/scripts/npc/9201050.js @@ -32,18 +32,19 @@ function start() { } function action(mode, type, selection) { - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { + } else { if (mode == 0 && type > 0) { cm.dispose(); return; } - - if (mode == 1) + + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { if (cm.isQuestCompleted(4911)) { cm.sendNext("Good job! You've solved all of my questions about NLC. Enjoy your trip!"); @@ -53,12 +54,13 @@ function action(mode, type, selection) { cm.dispose(); } else { var selStr = "What up! Name's Icebyrd Slimm, mayor of New Leaf City! Happy to see you accepted my invite. So, what can I do for you?#b" - var info = new Array("What is this place?","Who is Professor Foxwit?","What's a Foxwit Door?","Where are the MesoGears?","What is the Krakian Jungle?","What's a Gear Portal?","What do the street signs mean?","What's the deal with Jack Masque?","Lita Lawless looks like a tough cookie, what's her story?","When will new boroughs open up in the city?","I want to take the quiz!"); - for (var i = 0; i < info.length; i++) + var info = ["What is this place?", "Who is Professor Foxwit?", "What's a Foxwit Door?", "Where are the MesoGears?", "What is the Krakian Jungle?", "What's a Gear Portal?", "What do the street signs mean?", "What's the deal with Jack Masque?", "Lita Lawless looks like a tough cookie, what's her story?", "When will new boroughs open up in the city?", "I want to take the quiz!"]; + for (var i = 0; i < info.length; i++) { selStr += "\r\n#L" + i + "# " + info[i] + "#l"; + } cm.sendSimple(selStr); } - } else if(status == 1) { + } else if (status == 1) { switch (selection) { case 0: cm.sendNext("I've always dreamed of building a city. Not just any city, but one where everyone was welcome. I used to live in Kerning City, so I decided to see if I could create a city. As I went along in finding the means to do so, I encountered many people, some of whom I've come to regard as friends. Like Professor Foxwit-he's our resident genius; saved him from a group of man-eating plants. Jack Masque is an old hunting buddy from Amoria-almost too smooth of a talker for his own good. Lita and I are old friends from Kerning City-she's saved me a few times with that weapon of hers; so I figured she was a perfect choice for Town Sheriff. It took a bit of persuasion, but she came to believe her destiny lies here. About our resident explorer, Barricade came searching for something; he agreed to bring whatever he found to the museum. I'd heard stories about him and his brother when I was still in Kerning City. And Elpam...well, let's just say he's not from around here. At all. We've spoken before, and he seems to mean well, so I've allowed him to stay. I just realized that I've rambled quite a bit! What else would you like to know?"); @@ -107,7 +109,7 @@ function action(mode, type, selection) { } else { cm.sendNext("Eager, are we? How about you explore a bit more before I let you take the quiz?"); } - + cm.dispose(); break; } diff --git a/scripts/npc/9201051.js b/scripts/npc/9201051.js index ed61392726..f9f43cefb4 100644 --- a/scripts/npc/9201051.js +++ b/scripts/npc/9201051.js @@ -2,7 +2,7 @@ *9201051 - John Barricade *@author Ronan */ - + function start() { cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); cm.dispose(); diff --git a/scripts/npc/9201052.js b/scripts/npc/9201052.js index eab40d0b37..6c80d81cce 100644 --- a/scripts/npc/9201052.js +++ b/scripts/npc/9201052.js @@ -2,7 +2,7 @@ *9201052 - Professor Foxwit *@author Ronan */ - + function start() { cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); cm.dispose(); diff --git a/scripts/npc/9201054.js b/scripts/npc/9201054.js index af431473f4..1114323dd7 100644 --- a/scripts/npc/9201054.js +++ b/scripts/npc/9201054.js @@ -2,7 +2,7 @@ *9201054 - Lita Lawless *@author Ronan */ - + function start() { cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); cm.dispose(); diff --git a/scripts/npc/9201056.js b/scripts/npc/9201056.js index 2a8686d764..f82179375d 100644 --- a/scripts/npc/9201056.js +++ b/scripts/npc/9201056.js @@ -29,37 +29,38 @@ function start() { function action(mode, type, selection) { if (mode != 1) { - if (mode == 0) + if (mode == 0) { cm.sendOk("Alright, see you next time."); + } cm.dispose(); - } - else { + } else { status++; if (cm.getPlayer().getMapId() == 682000000) { if (status == 0) { - if (selection == 0) + if (selection == 0) { cm.sendYesNo("Would you like to return back to #bcivilization#k? The fee is " + fee + " mesos."); + } } else if (status == 1) { - if(cm.getMeso() >= fee) { + if (cm.getMeso() >= fee) { cm.gainMeso(-fee); cm.warp(600000000); } else { cm.sendOk("Hey, what are you trying to pull on? You don't have enough meso to pay the fee."); } - + cm.dispose(); } } else { if (status == 0) { cm.sendYesNo("Would you like to go to the #bHaunted Mansion#k? The fee is " + fee + " mesos."); } else if (status == 1) { - if(cm.getMeso() >= fee) { + if (cm.getMeso() >= fee) { cm.gainMeso(-fee); cm.warp(682000000, 0); } else { cm.sendOk("Hey, what are you trying to pull on? You don't have enough meso to pay the fee."); } - + cm.dispose(); } } diff --git a/scripts/npc/9201057.js b/scripts/npc/9201057.js index 71f718c056..4b1cdc6586 100644 --- a/scripts/npc/9201057.js +++ b/scripts/npc/9201057.js @@ -1,28 +1,29 @@ function start() { - if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001) + if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001) { cm.sendYesNo("The ride to " + (cm.c.getPlayer().getMapId() == 103000100 ? "New Leaf City of Masteria" : "Kerning City of Victoria Island") + " takes off every minute, beginning on the hour, and it'll cost you #b5000 mesos#k. Are you sure you want to purchase #b#t" + (4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000)) + "##k?"); - else if (cm.c.getPlayer().getMapId() == 600010002 || cm.c.getPlayer().getMapId() == 600010004) + } else if (cm.c.getPlayer().getMapId() == 600010002 || cm.c.getPlayer().getMapId() == 600010004) { cm.sendYesNo("Do you want to leave before the train start? There will be no refund."); + } } function action(mode, type, selection) { - if(mode != 1){ + if (mode != 1) { cm.dispose(); return; } - if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001){ - var item = 4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000); + if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001) { + var item = 4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000); - if(!cm.canHold(item)) { + if (!cm.canHold(item)) { cm.sendNext("You don't have a etc. slot available."); - } - else if(cm.getMeso() >= 5000){ + } else if (cm.getMeso() >= 5000) { cm.gainMeso(-5000); cm.gainItem(item, 1); cm.sendNext("There you go."); - }else + } else { cm.sendNext("You don't have enough mesos."); - }else{ + } + } else { cm.warp(cm.c.getPlayer().getMapId() == 600010002 ? 600010001 : 103000100); } cm.dispose(); diff --git a/scripts/npc/9201061.js b/scripts/npc/9201061.js index bbdb900422..8f40c17aa9 100644 --- a/scripts/npc/9201061.js +++ b/scripts/npc/9201061.js @@ -29,7 +29,7 @@ var colors = Array(); function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -45,10 +45,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hi, there~! I'm Bomack. If you have a #b#t5152035##k, I can prescribe the right kind of cosmetic lenses for you. Now, what would you like to do?\r\n#L2#Cosmetic Lens: #i5152035##t5152035##l"); } else if (status == 1) { @@ -60,13 +61,12 @@ function action(mode, type, selection) { var current = cm.getPlayer().getFace() % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current + 100, current + 200, current + 300, current +400, current + 500, current + 600, current + 700]); + pushIfItemsExists(colors, [current + 100, current + 200, current + 300, current + 400, current + 500, current + 600, current + 700]); cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use #b#t5152035##k and really make the change to your eyes?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (cm.haveItem(5152035) == true){ + if (cm.haveItem(5152035) == true) { cm.gainItem(5152035, -1); cm.setFace(colors[Math.floor(Math.random() * colors.length)]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); diff --git a/scripts/npc/9201062.js b/scripts/npc/9201062.js index 1438423ac7..436eb4120c 100644 --- a/scripts/npc/9201062.js +++ b/scripts/npc/9201062.js @@ -36,7 +36,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -52,10 +52,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Hey, there~! I'm J.J.! I'm in charge of the cosmetic lenses here at NLC Shop! If you have a #b#t5152036##k, I can get you the best cosmetic lenses you have ever had! Now, what would you like to do?\r\n#L2#Cosmetic Lenses: #i5152036##t5152036##l\r\n#L3#One-time Cosmetic Lenses: #i5152107# (any color)#l"); } else if (status == 1) { @@ -67,48 +68,48 @@ function action(mode, type, selection) { var current = cm.getPlayer().getFace() % 100 + 21000; } colors = Array(); - pushIfItemsExists(colors, [current + 100, current + 200, current + 300, current +400, current + 500, current + 600, current + 700]); + pushIfItemsExists(colors, [current + 100, current + 200, current + 300, current + 400, current + 500, current + 600, current + 700]); cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } else if (status == 2){ + } else if (status == 2) { cm.dispose(); if (beauty == 0) { - if (cm.haveItem(5152036) == true){ + if (cm.haveItem(5152036) == true) { cm.gainItem(5152036, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); } - } else if (beauty == 3){ + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); diff --git a/scripts/npc/9201063.js b/scripts/npc/9201063.js index f1b88d9f22..151c308dc0 100644 --- a/scripts/npc/9201063.js +++ b/scripts/npc/9201063.js @@ -47,10 +47,11 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("I'm Ari the assistant. If you have #b#t5150030##k or #b#t5151025##k by any chance, then how about letting me change your hairdo?\r\n#L1#Haircut: #i5150030##t5150030##l\r\n#L2#Dye your hair: #i5151025##t5151025##l"); } else if (status == 1) { @@ -58,12 +59,12 @@ function action(mode, type, selection) { beauty = 1; hairnew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mhair_e.length; i++) { + for (var i = 0; i < mhair_e.length; i++) { pushIfItemExists(hairnew, mhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fhair_e.length; i++) { + for (var i = 0; i < fhair_e.length; i++) { pushIfItemExists(hairnew, fhair_e[i] + parseInt(cm.getPlayer().getHair() % 10)); } } @@ -71,17 +72,16 @@ function action(mode, type, selection) { } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) { + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); } cm.sendYesNo("If you use a regular coupon your hair will change RANDOMLY. Do you still want to use #b#t5151025##k and change it up?"); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5150030)){ + if (beauty == 1) { + if (cm.haveItem(5150030)) { cm.gainItem(5150030, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); @@ -89,8 +89,8 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); } } - if (beauty == 2){ - if (cm.haveItem(5151025)){ + if (beauty == 2) { + if (cm.haveItem(5151025)) { cm.gainItem(5151025, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); @@ -98,7 +98,7 @@ function action(mode, type, selection) { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150030, 1); diff --git a/scripts/npc/9201064.js b/scripts/npc/9201064.js index 540e599fac..6b26f3292f 100644 --- a/scripts/npc/9201064.js +++ b/scripts/npc/9201064.js @@ -44,54 +44,62 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection == 1) { beauty = 1; hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_v.length; i++) - pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); - if (cm.getPlayer().getGender() == 1) - for(var i = 0; i < fhair_v.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_v.length; i++) { + pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } + if (cm.getPlayer().getGender() == 1) { + for (var i = 0; i < fhair_v.length; i++) { pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } cm.sendStyle("I can totally change up your hairstyle and make it look so good. Why don't you change it up a bit? With #b#t5150031##k, I'll take care of the rest for you. Choose the style of your liking!", hairnew); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); + } cm.sendStyle("I can totally change your haircolor and make it look so good. Why don't you change it up a bit? With #b#t5151026##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } - } - else if (status == 2){ + } else if (status == 2) { cm.dispose(); - if (beauty == 1){ - if (cm.haveItem(5420001)){ + if (beauty == 1) { + if (cm.haveItem(5420001)) { cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else if (cm.haveItem(5150031)){ + } else if (cm.haveItem(5150031)) { cm.gainItem(5150031, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); + } } - if (beauty == 2){ - if (cm.haveItem(5151026) == true){ + if (beauty == 2) { + if (cm.haveItem(5151026) == true) { cm.gainItem(5151026, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); + } } - if (beauty == 0){ + if (beauty == 0) { if (selection == 0 && cm.getMeso() >= hairprice) { cm.gainMeso(-hairprice); cm.gainItem(5150031, 1); @@ -100,8 +108,9 @@ function action(mode, type, selection) { cm.gainMeso(-haircolorprice); cm.gainItem(5151026, 1); cm.sendOk("Enjoy!"); - } else + } else { cm.sendOk("You don't have enough mesos to buy a coupon!"); + } } } } diff --git a/scripts/npc/9201065.js b/scripts/npc/9201065.js index 32049e4b76..c7d23f1c2f 100644 --- a/scripts/npc/9201065.js +++ b/scripts/npc/9201065.js @@ -32,25 +32,27 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - if (status == 1) { - if (selection == 2) - cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); } - else if (status == 2){ - if (cm.haveItem(5153009)){ + if (status == 1) { + if (selection == 2) { + cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); + } + } else if (status == 2) { + if (cm.haveItem(5153009)) { cm.gainItem(5153009, -1); cm.setSkin(skin[selection]); cm.sendOk("Enjoy your new and improved skin!"); } else { cm.sendOk("Um...you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); } - + cm.dispose(); } } diff --git a/scripts/npc/9201068.js b/scripts/npc/9201068.js index c5b0098cdb..4a9a186ccd 100644 --- a/scripts/npc/9201068.js +++ b/scripts/npc/9201068.js @@ -6,49 +6,50 @@ var em; function start() { em = cm.getEventManager("Subway"); var text = "Here's the ticket reader."; - var hasTicket = false; - if (cm.haveItem(4031713) && cm.getPlayer().getMapId() == 600010001){ + var hasTicket = false; + if (cm.haveItem(4031713) && cm.getPlayer().getMapId() == 600010001) { text += "\r\n#b#L0##t4031713#"; - hasTicket = true; - } - if(!hasTicket){ - cm.sendOk("It seems you don't have a ticket! You can buy one from Bell."); - cm.dispose(); - }else + hasTicket = true; + } + if (!hasTicket) { + cm.sendOk("It seems you don't have a ticket! You can buy one from Bell."); + cm.dispose(); + } else { cm.sendSimple(text); + } } function action(mode, type, selection) { status++; if (mode != 1) { - if(mode == 0) + if (mode == 0) { cm.sendNext("You must have some business to take care of here, right?"); + } cm.dispose(); return; } if (status == 0) { - if(selection == 0){ - if (em.getProperty("entry") == "true") + if (selection == 0) { + if (em.getProperty("entry") == "true") { cm.sendYesNo("It looks like there's plenty of room for this ride. Please have your ticket ready so I can let you in. The ride will be long, but you'll get to your destination just fine. What do you think? Do you wants to get on this ride?"); - else{ + } else { cm.sendNext("We will begin boarding 1 minute before the takeoff. Please be patient and wait for a few minutes. Be aware that the subway will take off right on time, and we stop receiving tickets 1 minute before that, so please make sure to be here on time."); cm.dispose(); } } oldSelection = selection; - }else if(status == 1){ + } else if (status == 1) { if (oldSelection == 0 && cm.haveItem(4031713)) { - if(em.getProperty("entry") == "true") { + if (em.getProperty("entry") == "true") { cm.gainItem(4031713, -1); cm.warp(600010002); - } - else { + } else { cm.sendNext("We will begin boarding 1 minute before the takeoff. Please be patient and wait for a few minutes. Be aware that the subway will take off right on time, and we stop receiving tickets 1 minute before that, so please make sure to be here on time."); } } else { cm.sendNext("Sorry, you need a ticket to enter!"); - } - + } + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201069.js b/scripts/npc/9201069.js index c39fd66091..aa63286f2e 100644 --- a/scripts/npc/9201069.js +++ b/scripts/npc/9201069.js @@ -43,33 +43,38 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection == 2) { facenew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mface_v.length; i++) - pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace()% 100)); - if (cm.getPlayer().getGender() == 1) - for(var i = 0; i < fface_v.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mface_v.length; i++) { + pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } + if (cm.getPlayer().getGender() == 1) { + for (var i = 0; i < fface_v.length; i++) { pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152034##k, you can get the face of your liking. Take your time in choosing the face of your preference.", facenew); } - } - else if (status == 2){ - if (cm.haveItem(5152034)){ + } else if (status == 2) { + if (cm.haveItem(5152034)) { cm.gainItem(5152034, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); } else { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } - + cm.dispose(); } } diff --git a/scripts/npc/9201070.js b/scripts/npc/9201070.js index a5c5393389..f52b412edd 100644 --- a/scripts/npc/9201070.js +++ b/scripts/npc/9201070.js @@ -45,30 +45,35 @@ function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 1) { if (selection == 2) { facenew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mface_r.length; i++) + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mface_r.length; i++) { pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); - if (cm.getPlayer().getGender() == 1) - for(var i = 0; i < fface_r.length; i++) + } + } + if (cm.getPlayer().getGender() == 1) { + for (var i = 0; i < fface_r.length; i++) { pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152033##k?"); } - } else if (status == 2){ - if (cm.haveItem(5152033)){ + } else if (status == 2) { + if (cm.haveItem(5152033)) { cm.gainItem(5152033, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); } else { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); } - + cm.dispose(); } } diff --git a/scripts/npc/9201071.js b/scripts/npc/9201071.js index 6fe990590f..fb631c527d 100644 --- a/scripts/npc/9201071.js +++ b/scripts/npc/9201071.js @@ -2,7 +2,7 @@ *9201071 - Sunstone Grave *@author Ronan */ - + function start() { cm.sendOk("(This tombstone keeps emmiting ever oddier light waves the more I stare to it...)"); cm.dispose(); diff --git a/scripts/npc/9201072.js b/scripts/npc/9201072.js index 79f7b6e744..08b32d4742 100644 --- a/scripts/npc/9201072.js +++ b/scripts/npc/9201072.js @@ -2,7 +2,7 @@ *9201072 - Moonstone Grave *@author Ronan */ - + function start() { cm.sendOk("(This tombstone keeps emmiting ever oddier light waves the more I stare to it...)"); cm.dispose(); diff --git a/scripts/npc/9201073.js b/scripts/npc/9201073.js index 1808f66c9e..9255650e91 100644 --- a/scripts/npc/9201073.js +++ b/scripts/npc/9201073.js @@ -2,7 +2,7 @@ *9201073 - Tombstone *@author Ronan */ - + function start() { cm.sendOk("(This enigmatic tombstone keeps emmiting strange forces... Better look another way.)"); cm.dispose(); diff --git a/scripts/npc/9201082.js b/scripts/npc/9201082.js index 93be490cd5..b7fc6e23f5 100644 --- a/scripts/npc/9201082.js +++ b/scripts/npc/9201082.js @@ -1,26 +1,27 @@ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("Have you ever come to know about the card game based on MapleStory, the MapleStory iTCG?"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("Have you ever come to know about the card game based on MapleStory, the MapleStory iTCG?"); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9201083.js b/scripts/npc/9201083.js index 37137e463b..369f407e36 100644 --- a/scripts/npc/9201083.js +++ b/scripts/npc/9201083.js @@ -2,7 +2,7 @@ *9201083 - The Glimmer Man *@author Ronan */ - + function start() { cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); cm.dispose(); diff --git a/scripts/npc/9201084.js b/scripts/npc/9201084.js index 500b1fe35d..7bb96e9166 100644 --- a/scripts/npc/9201084.js +++ b/scripts/npc/9201084.js @@ -19,27 +19,28 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9201093.js b/scripts/npc/9201093.js index a62d2c258b..450777dd65 100644 --- a/scripts/npc/9201093.js +++ b/scripts/npc/9201093.js @@ -2,7 +2,7 @@ *9201093 - Little Suzy *@author Ronan */ - + function start() { cm.sendOk("Have you heard the fantasic Jack Masque appeared around the city these days? That is sooooo nice!"); cm.dispose(); diff --git a/scripts/npc/9201094.js b/scripts/npc/9201094.js index 10c00bb9be..acb1fbabcd 100644 --- a/scripts/npc/9201094.js +++ b/scripts/npc/9201094.js @@ -2,7 +2,7 @@ *9201094 - Corine *@author Ronan */ - + function start() { cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); cm.dispose(); diff --git a/scripts/npc/9201095.js b/scripts/npc/9201095.js index 9673da0c9d..a034c084b7 100644 --- a/scripts/npc/9201095.js +++ b/scripts/npc/9201095.js @@ -43,133 +43,132 @@ function start() { cm.dispose(); return; } - + cm.getPlayer().setCS(true); status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else + } else { cm.dispose(); - + } + if (status == 0 && mode == 1) { var selStr = "Hey, partner! If you have the right goods, I can turn it into something very nice...#b" - var options = new Array("Weapon Forging","Weapon Upgrading"); - for (var i = 0; i < options.length; i++) + var options = ["Weapon Forging", "Weapon Upgrading"]; + for (var i = 0; i < options.length; i++) { selStr += "\r\n#L" + i + "# " + options[i] + "#l"; + } cm.sendSimple(selStr); - } - else if (status == 1 && mode == 1) { + } else if (status == 1 && mode == 1) { selectedType = selection; - if (selectedType == 0){ //weapon forge + if (selectedType == 0) { //weapon forge var selStr = "So, what kind of weapon would you like me to forge?#b"; - var weapon = new Array ("#t2070018#","#t1382060#","#t1442068#","#t1452060#"); - for (var i = 0; i < weapon.length; i++) + var weapon = ["#t2070018#", "#t1382060#", "#t1442068#", "#t1452060#"]; + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; - + } + cm.sendSimple(selStr); - } - else if (selectedType == 1){ //weapon upgrade + } else if (selectedType == 1) { //weapon upgrade var selStr = "An upgraded weapon? Of course, but note that upgrades won't carry over to the new item... #b"; - var weapon = new Array ("#t1472074#","#t1472073#","#t1472075#","#t1332079#","#t1332078#","#t1332080#","#t1462054#","#t1462053#","#t1462055#","#t1402050#","#t1402049#","#t1402051#"); - for (var i = 0; i < weapon.length; i++) + var weapon = ["#t1472074#", "#t1472073#", "#t1472075#", "#t1332079#", "#t1332078#", "#t1332080#", "#t1462054#", "#t1462053#", "#t1462055#", "#t1402050#", "#t1402049#", "#t1402051#"]; + for (var i = 0; i < weapon.length; i++) { selStr += "\r\n#L" + i + "# " + weapon[i] + "#l"; - + } + cm.sendSimple(selStr); } - - } - else if (status == 2 && mode == 1) { + + } else if (status == 2 && mode == 1) { qty = 1; selectedItem = selection; - if (selectedType == 0){ // weapon forge - var itemSet = new Array(2070018,1382060,1442068,1452060); - var matSet = new Array(new Array(4032015, 4032016, 4032017, 4021008, 4032005), new Array(4032016,4032017,4032004,4032005,4032012,4005001), new Array(4032015,4032017,4032004,4032005,4032012,4005000), new Array(4032015,4032016,4032004,4032005,4032012,4005002)); - var matQtySet = new Array(new Array(1,1,1,100,30), new Array(1,1,400,10,30,4), new Array(1,1,500,40,20,4), new Array(1,1,300,75,10,4)); - var costSet = new Array(70000,70000,70000,70000); + if (selectedType == 0) { // weapon forge + var itemSet = [2070018, 1382060, 1442068, 1452060]; + var matSet = [[4032015, 4032016, 4032017, 4021008, 4032005], [4032016, 4032017, 4032004, 4032005, 4032012, 4005001], [4032015, 4032017, 4032004, 4032005, 4032012, 4005000], [4032015, 4032016, 4032004, 4032005, 4032012, 4005002]]; + var matQtySet = [[1, 1, 1, 100, 30], [1, 1, 400, 10, 30, 4], [1, 1, 500, 40, 20, 4], [1, 1, 300, 75, 10, 4]]; + var costSet = [70000, 70000, 70000, 70000]; + item = itemSet[selectedItem]; + mats = matSet[selectedItem]; + matQty = matQtySet[selectedItem]; + cost = costSet[selectedItem]; + } else if (selectedType == 1) { // weapon upgrade + var itemSet = [1472074, 1472073, 1472075, 1332079, 1332078, 1332080, 1462054, 1462053, 1462055, 1402050, 1402049, 1402051]; + var matSet = [[4032017, 4005001, 4021008], [4032015, 4005002, 4021008], [4032016, 4005000, 4021008], [4032017, 4005001, 4021008], [4032015, 4005002, 4021008], [4032016, 4005000, 4021008], [4032017, 4005001, 4021008], [4032015, 4005002, 4021008], [4032016, 4005000, 4021008], [4032017, 4005001, 4021008], [4032015, 4005002, 4021008], [4032016, 4005000, 4021008]]; + var matQtySet = [[1, 10, 20], [1, 10, 30], [1, 5, 20], [1, 10, 20], [1, 10, 30], [1, 5, 20], [1, 10, 20], [1, 10, 30], [1, 5, 20], [1, 10, 20], [1, 10, 30], [1, 5, 20]]; + var costSet = [75000, 50000, 50000, 75000, 50000, 50000, 75000, 50000, 50000, 75000, 50000, 50000]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; } - else if (selectedType == 1){ // weapon upgrade - var itemSet = new Array(1472074,1472073,1472075,1332079,1332078,1332080,1462054,1462053,1462055,1402050,1402049,1402051); - var matSet = new Array(new Array(4032017,4005001,4021008), new Array(4032015,4005002,4021008), new Array(4032016,4005000,4021008),new Array(4032017,4005001,4021008), new Array(4032015,4005002,4021008), new Array(4032016,4005000,4021008), new Array(4032017,4005001,4021008), new Array(4032015,4005002,4021008), new Array(4032016,4005000,4021008), new Array(4032017,4005001,4021008), new Array(4032015,4005002,4021008), new Array(4032016,4005000,4021008)); - var matQtySet = new Array(new Array(1,10,20),new Array(1,10,30),new Array(1,5,20),new Array(1,10,20),new Array(1,10,30),new Array(1,5,20),new Array(1,10,20),new Array(1,10,30),new Array(1,5,20),new Array(1,10,20),new Array(1,10,30),new Array(1,5,20)); - var costSet = new Array (75000,50000,50000,75000,50000,50000,75000,50000,50000,75000,50000,50000); - item = itemSet[selectedItem]; - mats = matSet[selectedItem]; - matQty = matQtySet[selectedItem]; - cost = costSet[selectedItem]; - } - + var prompt = "You want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - + } + prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b"; - - if (mats instanceof Array){ - for(var i = 0; i < mats.length; i++){ - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + + if (mats instanceof Array) { + for (var i = 0; i < mats.length; i++) { + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } + } else { + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } - else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; - } - - if (cost > 0) + + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; - + } + cm.sendYesNo(prompt); - } - else if (status == 3 && mode == 1) { + } else if (status == 3 && mode == 1) { var complete = true; var recvItem = item, recvQty; - + recvQty = qty; - - if(!cm.canHold(recvItem, recvQty)) { + + if (!cm.canHold(recvItem, recvQty)) { cm.sendOk("Check your inventory for a free slot first."); cm.dispose(); return; - } - else if (cm.getMeso() < cost * qty) - { + } else if (cm.getMeso() < cost * qty) { cm.sendOk("I am afraid you don't have enough to pay me, partner. Please check this out first, ok?"); cm.dispose(); return; - } - else - { + } else { if (mats instanceof Array) { - for(var i = 0; complete && i < mats.length; i++) - if (!cm.haveItem(mats[i], matQty[i] * qty)) + for (var i = 0; complete && i < mats.length; i++) { + if (!cm.haveItem(mats[i], matQty[i] * qty)) { complete = false; - } - else if (!cm.haveItem(mats, matQty * qty)) + } + } + } else if (!cm.haveItem(mats, matQty * qty)) { complete = false; + } } - - if (!complete) + + if (!complete) { cm.sendOk("Hey, I need those items to craft properly, you know?"); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } - } - else + } else { cm.gainItem(mats, -matQty * qty); - if (cost > 0) + } + if (cost > 0) { cm.gainMeso(-cost * qty); - + } + cm.gainItem(recvItem, recvQty); cm.sendOk("All done. If you need anything else... Well, I'm not going anywhere."); } diff --git a/scripts/npc/9201096.js b/scripts/npc/9201096.js index 62d14296ab..75892a8aec 100644 --- a/scripts/npc/9201096.js +++ b/scripts/npc/9201096.js @@ -39,9 +39,9 @@ function start() { } function action(mode, type, selection) { - if (mode == 1) + if (mode == 1) { status++; - else { + } else { cm.sendOk("Very well, see you around."); cm.dispose(); return; @@ -50,65 +50,57 @@ function action(mode, type, selection) { if (status == 0) { var selStr = "Hey, are you aware about the expeditions running right now at the Crimsonwood Keep? So, there is a great opportunity for one to improve themselves, one can rack up experience and loot pretty fast there."; cm.sendNext(selStr); - } - else if (status == 1) { - var selStr = "Said so, methinks making use of some strong utility potions can potentially create some differential on the front, and by this I mean to start crafting #b#t2022284##k's to help on the efforts. So, getting right down to business, I'm currently pursuing #rplenty#k of those items: #r#t4032010##k, #r#t4032011##k, #r#t4032012##k, and some funds to support the cause. Would you want to get some of these boosters?"; + } else if (status == 1) { + var selStr = "Said so, methinks making use of some strong utility potions can potentially create some differential on the front, and by this I mean to start crafting #b#t2022284##k's to help on the efforts. So, getting right down to business, I'm currently pursuing #rplenty#k of those items: #r#t4032010##k, #r#t4032011##k, #r#t4032012##k, and some funds to support the cause. Would you want to get some of these boosters?"; cm.sendYesNo(selStr); - } - - else if (status == 2) { + } else if (status == 2) { //selectedItem = selection; selectedItem = 0; - var itemSet = new Array(2022284, 7777777); - var matSet = new Array(new Array(4032010, 4032011, 4032012)); - var matQtySet = new Array(new Array(60, 60, 45)); - var costSet = new Array(75000, 7777777); + var itemSet = [2022284, 7777777]; + var matSet = new Array([4032010, 4032011, 4032012]); + var matQtySet = new Array([60, 60, 45]); + var costSet = [75000, 7777777]; item = itemSet[selectedItem]; mats = matSet[selectedItem]; matQty = matQtySet[selectedItem]; cost = costSet[selectedItem]; - + var prompt = "Ok, I'll be crafting some #t" + item + "#. In that case, how many of those do you want me to make?"; - cm.sendGetNumber(prompt,1,1,100) - } - - else if (status == 3) { + cm.sendGetNumber(prompt, 1, 1, 100) + } else if (status == 3) { qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1); last_use = false; - + var prompt = "So, you want me to make "; - if (qty == 1) + if (qty == 1) { prompt += "a #t" + item + "#?"; - else + } else { prompt += qty + " #t" + item + "#?"; - + } + prompt += " In that case, I'm going to need specific items from you in order to make it. And make sure you have room in your inventory!#b"; - - if (mats instanceof Array){ + + if (mats instanceof Array) { for (var i = 0; i < mats.length; i++) { - prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#"; + prompt += "\r\n#i" + mats[i] + "# " + matQty[i] * qty + " #t" + mats[i] + "#"; } } else { - prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#"; + prompt += "\r\n#i" + mats + "# " + matQty * qty + " #t" + mats + "#"; } - + if (cost > 0) { prompt += "\r\n#i4031138# " + cost * qty + " meso"; } cm.sendYesNo(prompt); - } - - else if (status == 4) { + } else if (status == 4) { var complete = true; - + if (cm.getMeso() < cost * qty) { cm.sendOk("Well, I DID say I would be needing some funds to craft it, wasn't it?"); - } - else if(!cm.canHold(item, qty)) { + } else if (!cm.canHold(item, qty)) { cm.sendOk("You didn't check if you got a slot to spare on your inventory before crafting, right?"); - } - else { + } else { if (mats instanceof Array) { for (var i = 0; complete && i < mats.length; i++) { if (matQty[i] * qty == 1) { @@ -120,12 +112,12 @@ function action(mode, type, selection) { } else { complete = cm.haveItem(mats, matQty * qty); } - - if (!complete) + + if (!complete) { cm.sendOk("There are not enough resources on your inventory. Please check it again."); - else { + } else { if (mats instanceof Array) { - for (var i = 0; i < mats.length; i++){ + for (var i = 0; i < mats.length; i++) { cm.gainItem(mats[i], -matQty[i] * qty); } } else { diff --git a/scripts/npc/9201097.js b/scripts/npc/9201097.js index 0f3929af13..ced0b0c226 100644 --- a/scripts/npc/9201097.js +++ b/scripts/npc/9201097.js @@ -1,70 +1,70 @@ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Joko - Phantom Forest: Dead Man's Gorge(610010004) --- By --------------------------------------------------------------------------------------------- - Ronan Lana --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Ronan Lana ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Joko - Phantom Forest: Dead Man's Gorge(610010004) + -- By --------------------------------------------------------------------------------------------- + Ronan Lana + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Ronan Lana + --------------------------------------------------------------------------------------------------- + **/ var status = 0; -var eQuestChoices = new Array (4032007, 4032006, 4032009, 4032008, 4032007, 4032006, 4032009, 4032008); +var eQuestChoices = [4032007, 4032006, 4032009, 4032008, 4032007, 4032006, 4032009, 4032008]; -var eQuestPrizes = new Array(); +var eQuestPrizes = []; -eQuestPrizes[0] = new Array ([1002801,1], // Raven Ninja Bandana - [1462052,1], // Raven's Eye - [1462006,1], // Silver Crow - [1462009,1], // Gross Jaeger - [1452012,1], // Marine Arund - [1472031,1], // Black Mamba - [2044701,1], // Claw for ATT 60% - [2044501,1], // Bow for ATT 60% - [3010041,1], // Skull Throne - [0, 750000]); // Mesos - -eQuestPrizes[1] = new Array ([1332077,1], // Raven's Beak - [1322062,1], // Crushed Skull - [1302068,1], // Onyx Blade - [4032016,1], // Tao of Sight - [2043001,1], // One Handed Sword for Att 60% - [2043201,1], // One Handed BW for Att 60% - [2044401,1], // Polearm for Att 60% - [2044301,1], // Spear for Att 60% - [3010041,1], // Skull Throne - [0,1250000]); // Mesos - -eQuestPrizes[2] = new Array ([1472072,1], //Raven's Claw - [1332077,1], // Raven's Beak - [1402048,1], // Raven's Wing - [1302068,1], // Onyx Blade - [4032017,1], // Tao of Harmony - [4032015,1], // Tao of Shadows - [2043023,1], // One-Handed Sword for Att 100%[2] - [2043101,1], // One-Handed Axe for Att 60% - [2043301,1], // Dagger for Att 60% - [3010040,1], // The Stirge Seat - [0,2500000]); // Mesos - -eQuestPrizes[3] = new Array ([1002801,1], //Raven Ninja Bandana - [1382008,1], // Kage - [1382006,1], // Thorns - [4032016,1], // Tao of Sight - [4032015,1], // Tao of Shadows - [2043701,1], // Wand for Magic Att 60% - [2043801,1], // Staff for Magic Att 60% - [3010040,1], // The Stirge Seat - [0,1750000]); // Mesos +eQuestPrizes[0] = [[1002801, 1], // Raven Ninja Bandana + [1462052, 1], // Raven's Eye + [1462006, 1], // Silver Crow + [1462009, 1], // Gross Jaeger + [1452012, 1], // Marine Arund + [1472031, 1], // Black Mamba + [2044701, 1], // Claw for ATT 60% + [2044501, 1], // Bow for ATT 60% + [3010041, 1], // Skull Throne + [0, 750000]]; // Mesos -eQuestPrizes[4] = new Array ([0,3500000]); // Mesos -eQuestPrizes[5] = new Array ([0,3500000]); // Mesos -eQuestPrizes[6] = new Array ([0,3500000]); // Mesos -eQuestPrizes[7] = new Array ([0,3500000]); // Mesos +eQuestPrizes[1] = [[1332077, 1], // Raven's Beak + [1322062, 1], // Crushed Skull + [1302068, 1], // Onyx Blade + [4032016, 1], // Tao of Sight + [2043001, 1], // One Handed Sword for Att 60% + [2043201, 1], // One Handed BW for Att 60% + [2044401, 1], // Polearm for Att 60% + [2044301, 1], // Spear for Att 60% + [3010041, 1], // Skull Throne + [0, 1250000]]; // Mesos -var requiredItem = 0; +eQuestPrizes[2] = [[1472072, 1], //Raven's Claw + [1332077, 1], // Raven's Beak + [1402048, 1], // Raven's Wing + [1302068, 1], // Onyx Blade + [4032017, 1], // Tao of Harmony + [4032015, 1], // Tao of Shadows + [2043023, 1], // One-Handed Sword for Att 100%[2] + [2043101, 1], // One-Handed Axe for Att 60% + [2043301, 1], // Dagger for Att 60% + [3010040, 1], // The Stirge Seat + [0, 2500000]]; // Mesos + +eQuestPrizes[3] = [[1002801, 1], //Raven Ninja Bandana + [1382008, 1], // Kage + [1382006, 1], // Thorns + [4032016, 1], // Tao of Sight + [4032015, 1], // Tao of Shadows + [2043701, 1], // Wand for Magic Att 60% + [2043801, 1], // Staff for Magic Att 60% + [3010040, 1], // The Stirge Seat + [0, 1750000]]; // Mesos + +eQuestPrizes[4] = new Array([0, 3500000]); // Mesos +eQuestPrizes[5] = new Array([0, 3500000]); // Mesos +eQuestPrizes[6] = new Array([0, 3500000]); // Mesos +eQuestPrizes[7] = new Array([0, 3500000]); // Mesos + +var requiredItem = 0; var lastSelection = 0; -var prizeItem = 0; +var prizeItem = 0; var prizeQuantity = 0; var itemSet; var qnt; @@ -76,61 +76,64 @@ function start() { function action(mode, type, selection) { if (mode <= 0) { - cm.sendOk("Hmmm...it shouldn't be a bad deal for you. Come see me at the right time and you may get a much better item to be offered. Anyway, let me know if you have a change of mind."); - cm.dispose(); - return; + cm.sendOk("Hmmm...it shouldn't be a bad deal for you. Come see me at the right time and you may get a much better item to be offered. Anyway, let me know if you have a change of mind."); + cm.dispose(); + return; } - + status++; if (status == 0) { // first interaction with NPC - if(cm.getQuestStatus(8225) != 2) { + if (cm.getQuestStatus(8225) != 2) { cm.sendNext("Hey, I'm not a bandit, ok?"); cm.dispose(); return; } - - cm.sendNext("Hey, got a little bit of time? Well, my job is to collect items here and sell them elsewhere, but these days the monsters have become much more hostile so it have been difficult to get good items... What do you think? Do you want to do some business with me?"); + + cm.sendNext("Hey, got a little bit of time? Well, my job is to collect items here and sell them elsewhere, but these days the monsters have become much more hostile so it have been difficult to get good items... What do you think? Do you want to do some business with me?"); } else if (status == 1) { - cm.sendYesNo("The deal is simple. You get me something I need, I get you something you need. The problem is, I deal with a whole bunch of people, so the items I have to offer may change every time you see me. What do you think? Still want to do it?"); + cm.sendYesNo("The deal is simple. You get me something I need, I get you something you need. The problem is, I deal with a whole bunch of people, so the items I have to offer may change every time you see me. What do you think? Still want to do it?"); } else if (status == 2) { - var eQuestChoice = makeChoices(eQuestChoices); - cm.sendSimple(eQuestChoice); - } else if (status == 3){ - lastSelection = selection; - requiredItem = eQuestChoices[selection]; - - if(selection < 4) qnt = 50; - else qnt = 25; - - cm.sendYesNo("Let's see, you want to trade your #b" + qnt + " #t" + requiredItem + "##k with my stuff, right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?"); - }else if (status == 4){ - itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length)); - reward = eQuestPrizes[lastSelection]; - prizeItem = reward[itemSet][0]; - prizeQuantity = reward[itemSet][1]; - if(!cm.haveItem(requiredItem,qnt)){ - cm.sendOk("Hmmm... are you sure you have #b" + qnt + " #t" + requiredItem + "##k? If so, then please check and see if your item inventory is full or not."); - } else if(prizeItem == 0) { - cm.gainItem(requiredItem,-qnt); + var eQuestChoice = makeChoices(eQuestChoices); + cm.sendSimple(eQuestChoice); + } else if (status == 3) { + lastSelection = selection; + requiredItem = eQuestChoices[selection]; + + if (selection < 4) { + qnt = 50; + } else { + qnt = 25; + } + + cm.sendYesNo("Let's see, you want to trade your #b" + qnt + " #t" + requiredItem + "##k with my stuff, right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?"); + } else if (status == 4) { + itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length)); + reward = eQuestPrizes[lastSelection]; + prizeItem = reward[itemSet][0]; + prizeQuantity = reward[itemSet][1]; + if (!cm.haveItem(requiredItem, qnt)) { + cm.sendOk("Hmmm... are you sure you have #b" + qnt + " #t" + requiredItem + "##k? If so, then please check and see if your item inventory is full or not."); + } else if (prizeItem == 0) { + cm.gainItem(requiredItem, -qnt); cm.gainMeso(prizeQuantity); - cm.sendOk("For your #b" + qnt + " #t"+requiredItem+"##k, here's #b" + prizeQuantity + " mesos#k. What do you think? Did you like the items I gave you in return? I plan on being here for awhile, so if you gather up more items, I'm always open for a trade..."); - } else if(!cm.canHold(prizeItem)){ - cm.sendOk("Your use and etc. inventory seems to be full. You need the free spaces to trade with me! Make room, and then find me."); - } else { - cm.gainItem(requiredItem,-qnt); - cm.gainItem(prizeItem, prizeQuantity); - cm.sendOk("For your #b" + qnt + " #t"+requiredItem+"##k, here's my #b"+prizeQuantity+" #t"+prizeItem+"##k. What do you think? Did you like the items I gave you in return? I plan on being here for awhile, so if you gather up more items, I'm always open for a trade..."); - } - cm.dispose(); + cm.sendOk("For your #b" + qnt + " #t" + requiredItem + "##k, here's #b" + prizeQuantity + " mesos#k. What do you think? Did you like the items I gave you in return? I plan on being here for awhile, so if you gather up more items, I'm always open for a trade..."); + } else if (!cm.canHold(prizeItem)) { + cm.sendOk("Your use and etc. inventory seems to be full. You need the free spaces to trade with me! Make room, and then find me."); + } else { + cm.gainItem(requiredItem, -qnt); + cm.gainItem(prizeItem, prizeQuantity); + cm.sendOk("For your #b" + qnt + " #t" + requiredItem + "##k, here's my #b" + prizeQuantity + " #t" + prizeItem + "##k. What do you think? Did you like the items I gave you in return? I plan on being here for awhile, so if you gather up more items, I'm always open for a trade..."); + } + cm.dispose(); } } -function makeChoices(a){ - var result = "Ok! First you need to choose the item that you'll trade with. The better the item, the more likely the chance that I'll give you something much nicer in return.\r\n"; +function makeChoices(a) { + var result = "Ok! First you need to choose the item that you'll trade with. The better the item, the more likely the chance that I'll give you something much nicer in return.\r\n"; var qnty = [50, 25]; - - for (var x = 0; x< a.length; x++){ - result += " #L" + x + "##v" + a[x] + "# #b#t" + a[x] + "# #kx " + qnty[Math.floor(x/4)] + "#l\r\n"; + + for (var x = 0; x < a.length; x++) { + result += " #L" + x + "##v" + a[x] + "# #b#t" + a[x] + "# #kx " + qnty[Math.floor(x / 4)] + "#l\r\n"; } return result; } \ No newline at end of file diff --git a/scripts/npc/9201098.js b/scripts/npc/9201098.js index 10dc2caa63..99f3f82189 100644 --- a/scripts/npc/9201098.js +++ b/scripts/npc/9201098.js @@ -2,13 +2,15 @@ *9201098 - Lukan *@author Ronan */ - + function start() { - if(cm.getQuestStatus(8223) == 2) { - if(cm.haveItem(3992041)) cm.sendOk("We, defenders of Yore, are currenly meeting at the Inner Sactum inside the Keep, about to start an offensive against the Twisted Masters and their army. Join us there anytime."); - else { - if(!cm.canHold(3992041)) cm.sendOk("Please make a slot on your SETUP ready for the key I have to give to you. It is fundamental to enter the Inner Sanctum, inside the Keep."); - else { + if (cm.getQuestStatus(8223) == 2) { + if (cm.haveItem(3992041)) { + cm.sendOk("We, defenders of Yore, are currenly meeting at the Inner Sactum inside the Keep, about to start an offensive against the Twisted Masters and their army. Join us there anytime."); + } else { + if (!cm.canHold(3992041)) { + cm.sendOk("Please make a slot on your SETUP ready for the key I have to give to you. It is fundamental to enter the Inner Sanctum, inside the Keep."); + } else { cm.sendOk("So you did lost your key, right? Very well, I will craft you another one, but please don't lose it again. It is fundamental to enter the Inner Sanctum, inside the Keep."); cm.gainItem(3992041, 1); } @@ -16,6 +18,6 @@ function start() { } else { cm.sendOk("O, brave adventurer. The Stormcasters house, from which I belong, guards the surrounding area of Yore, this landscape, from the forces of the Twisted Masters' guard that daily threathens the citizens. Please help us on the defense of Yore."); } - + cm.dispose(); } diff --git a/scripts/npc/9201099.js b/scripts/npc/9201099.js index fda4cd9f8c..c22922ed9f 100644 --- a/scripts/npc/9201099.js +++ b/scripts/npc/9201099.js @@ -2,13 +2,13 @@ *9201098 - Mo *@author Ronan */ - + function start() { - if(cm.getQuestStatus(8224) == 2) { + if (cm.getQuestStatus(8224) == 2) { cm.openShopNPC(9201099); } else { cm.sendOk("Hm, at who do you think you are looking at?"); } - + cm.dispose(); } diff --git a/scripts/npc/9201100.js b/scripts/npc/9201100.js index 38356190c8..22269e9ff1 100644 --- a/scripts/npc/9201100.js +++ b/scripts/npc/9201100.js @@ -2,13 +2,13 @@ *9201100 - Taggrin *@author Ronan */ - + function start() { - if(cm.getQuestStatus(8224) == 2) { + if (cm.getQuestStatus(8224) == 2) { cm.sendOk("Well met, fellow clan member. If you need anything we can be of help, try talking to one of our members."); } else { cm.sendOk("Hello there, stranger. We are the renowned Raven Claw clan of mercenaries, and I'm their leader."); } - + cm.dispose(); } diff --git a/scripts/npc/9201101.js b/scripts/npc/9201101.js index 4232739755..d792fc5bd2 100644 --- a/scripts/npc/9201101.js +++ b/scripts/npc/9201101.js @@ -2,7 +2,7 @@ *9201101 - T-1337 *@author Ronan */ - + function start() { const YamlConfig = Java.type('config.YamlConfig'); if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { diff --git a/scripts/npc/9201102.js b/scripts/npc/9201102.js index f4386edd1c..cff9d6cb7f 100644 --- a/scripts/npc/9201102.js +++ b/scripts/npc/9201102.js @@ -2,7 +2,7 @@ *9201102 - Stirgeman *@author Ronan */ - + function start() { cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city."); cm.dispose(); diff --git a/scripts/npc/9201103.js b/scripts/npc/9201103.js index 90ef86e324..06ab6b1de2 100644 --- a/scripts/npc/9201103.js +++ b/scripts/npc/9201103.js @@ -2,9 +2,12 @@ *9201103 - Sage *@author Ronan */ - + function start() { - if(cm.getLevel() >= 100) cm.sendOk("Expeditions are frequently being held inside the Crimsonwood Keep by adventurers like you, where many people from many parties cooperate together, solving puzzles therein and taking down strong enemies, being able to get many prizes in the process. To find more info about this, go ahead inside the keep at the top-right room there."); - else cm.sendOk("Inside the Keep, expeditions can be formed to attempt the Crimsonwood Keep PQ, which requires maplers from level 100 or more. It seems you are not suitable for attempting it yet, train some more if you want to attempt it."); + if (cm.getLevel() >= 100) { + cm.sendOk("Expeditions are frequently being held inside the Crimsonwood Keep by adventurers like you, where many people from many parties cooperate together, solving puzzles therein and taking down strong enemies, being able to get many prizes in the process. To find more info about this, go ahead inside the keep at the top-right room there."); + } else { + cm.sendOk("Inside the Keep, expeditions can be formed to attempt the Crimsonwood Keep PQ, which requires maplers from level 100 or more. It seems you are not suitable for attempting it yet, train some more if you want to attempt it."); + } cm.dispose(); } diff --git a/scripts/npc/9201104.js b/scripts/npc/9201104.js index e63d17a6e2..c5929e1236 100644 --- a/scripts/npc/9201104.js +++ b/scripts/npc/9201104.js @@ -2,11 +2,16 @@ *9201104 - Sage *@author Ronan */ - + function start() { - if(cm.getMapId() == 610020000) cm.sendOk("O, brave adventurer. Just by reaching this spot, you are truly distinct among the masses, congratulations. However, #rpay heed#k: on the path ahead, which leads to the mighty fortress of #bCrimsonwood Keep#k, #rdeadly Menhirs#k are deployed as traps for those unaware of the dangers ahead. #rOne hit from it is enough to take you down#k, so beware. If you aim to reach the Keep, follow the trail ahead carefully."); - else if(cm.getMapId() == 610020003) cm.sendOk("You seem worthy now to receive a hint for what lies ahead. Once inside the main room of the Keep, make sure you remember the layout of the statue you see there. That's it."); - else if(cm.getMapId() == 610020004) cm.sendOk("You seem worthy now to receive a hint for what lies ahead. Devices known as Sigils are activated by detection when some skills of certain jobs are activated nearby, make sure your team is made whole for when the time comes. That's it."); - else cm.sendOk("So far your progress is splendid, good job. However, to make it to the Keep, you must face and accomplish this ordeal, carry on."); + if (cm.getMapId() == 610020000) { + cm.sendOk("O, brave adventurer. Just by reaching this spot, you are truly distinct among the masses, congratulations. However, #rpay heed#k: on the path ahead, which leads to the mighty fortress of #bCrimsonwood Keep#k, #rdeadly Menhirs#k are deployed as traps for those unaware of the dangers ahead. #rOne hit from it is enough to take you down#k, so beware. If you aim to reach the Keep, follow the trail ahead carefully."); + } else if (cm.getMapId() == 610020003) { + cm.sendOk("You seem worthy now to receive a hint for what lies ahead. Once inside the main room of the Keep, make sure you remember the layout of the statue you see there. That's it."); + } else if (cm.getMapId() == 610020004) { + cm.sendOk("You seem worthy now to receive a hint for what lies ahead. Devices known as Sigils are activated by detection when some skills of certain jobs are activated nearby, make sure your team is made whole for when the time comes. That's it."); + } else { + cm.sendOk("So far your progress is splendid, good job. However, to make it to the Keep, you must face and accomplish this ordeal, carry on."); + } cm.dispose(); } diff --git a/scripts/npc/9201105.js b/scripts/npc/9201105.js index ce9a4172ef..636eb1075d 100644 --- a/scripts/npc/9201105.js +++ b/scripts/npc/9201105.js @@ -2,9 +2,12 @@ *9201105 - Sage *@author Ronan */ - + function start() { - if(cm.getMapId() == 610020005) cm.sendOk("The Crimsonwood Keep lies right ahead, a great feat has been made by you this day, salute to thee. Pass through these woods to enter the gates of the Keep."); - else cm.sendOk("So far your progress is splendid, good job. However, to make it to the Keep, you must face and accomplish this ordeal, carry on."); + if (cm.getMapId() == 610020005) { + cm.sendOk("The Crimsonwood Keep lies right ahead, a great feat has been made by you this day, salute to thee. Pass through these woods to enter the gates of the Keep."); + } else { + cm.sendOk("So far your progress is splendid, good job. However, to make it to the Keep, you must face and accomplish this ordeal, carry on."); + } cm.dispose(); } diff --git a/scripts/npc/9201106.js b/scripts/npc/9201106.js index cc8c6b2df4..b5e18ea424 100644 --- a/scripts/npc/9201106.js +++ b/scripts/npc/9201106.js @@ -19,28 +19,29 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - cm.sendOk("I came from far-away places looking for people powerful enough to join my expedition against the evil that lays waste on this land. Are you, by any chance, one of those people?"); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendOk("I came from far-away places looking for people powerful enough to join my expedition against the evil that lays waste on this land. Are you, by any chance, one of those people?"); + cm.dispose(); + } + } } diff --git a/scripts/npc/9201107.js b/scripts/npc/9201107.js index 2621f0350a..5d2b9b3790 100644 --- a/scripts/npc/9201107.js +++ b/scripts/npc/9201107.js @@ -2,34 +2,34 @@ */ function start() { - if (cm.getPlayer().getMapId() == 610030500) { - cm.sendOk("Unbelievable strength and power, anyone can be achieve. But what makes a warrior special is their iron will. No matter the odds, a true warrior pushes through until victory is assured. Thus, the Warrior Chamber is a brutal road where the room itself is against you, as well as the ultra-strong monsters within. Use your skills to shake off the effects and defeat the monsters within to reach the Warrior Statue and claim the Master Sword. Good luck!"); - cm.dispose(); - } else if (cm.getPlayer().getMap().getId() == 610030000) { - cm.sendOk("A legendary family of heroes, the de Vrisiens are the original founders of the Stormcasters. The family is unique, as each son or daughter inherits the full fighting techniques of their ancestors. This ability has proven to be immensely useful; as it allows for nearly unlimited strategy, improvisation and tactics to defeat all enemies. A true family for the generations."); - cm.dispose(); - } else if (cm.getPlayer().getMapId() == 610030510) { - if (cm.getPlayer().getMap().countMonsters() == 0) { - var eim = cm.getEventInstance(); - var stgStatus = eim.getIntProperty("glpq5_room"); - var jobNiche = cm.getPlayer().getJob().getJobNiche(); - - if ((stgStatus >> jobNiche) % 2 == 0) { - if(cm.canHold(4001259, 1)) { - cm.gainItem(4001259, 1); - cm.sendOk("Good job."); - - stgStatus += (1 << jobNiche); - eim.setIntProperty("glpq5_room", stgStatus); - } else { - cm.sendOk("Make room on your ETC inventory first."); - } - } else { - cm.sendOk("The weapon inside this room has already been retrieved."); - } + if (cm.getPlayer().getMapId() == 610030500) { + cm.sendOk("Unbelievable strength and power, anyone can be achieve. But what makes a warrior special is their iron will. No matter the odds, a true warrior pushes through until victory is assured. Thus, the Warrior Chamber is a brutal road where the room itself is against you, as well as the ultra-strong monsters within. Use your skills to shake off the effects and defeat the monsters within to reach the Warrior Statue and claim the Master Sword. Good luck!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("A legendary family of heroes, the de Vrisiens are the original founders of the Stormcasters. The family is unique, as each son or daughter inherits the full fighting techniques of their ancestors. This ability has proven to be immensely useful; as it allows for nearly unlimited strategy, improvisation and tactics to defeat all enemies. A true family for the generations."); + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030510) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if (cm.canHold(4001259, 1)) { + cm.gainItem(4001259, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); } else { - cm.sendOk("Eliminate all Crimson Guardians."); + cm.sendOk("Make room on your ETC inventory first."); } - cm.dispose(); + } else { + cm.sendOk("The weapon inside this room has already been retrieved."); + } + } else { + cm.sendOk("Eliminate all Crimson Guardians."); } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201108.js b/scripts/npc/9201108.js index 9342485685..59500c0842 100644 --- a/scripts/npc/9201108.js +++ b/scripts/npc/9201108.js @@ -2,34 +2,34 @@ */ function start() { - if (cm.getPlayer().getMapId() == 610030500) { - cm.sendOk("A legendary creature known as the Master Guardian awaits you. It was a Crimson Guardian that Ridley once experimented on, which resulted in its becoming highly resistant to magic attacks, spears, maces, everything--except arrows fired with exceptional power. Bowmen and women! As undisputed masters of the Bow and Arrow, you must use your most powerful attacks--everything from Strafe to Hurricane to Piercing Arrow to destroy this powerful creature and reach the Bowman Statue to claim The Ancestral Bow! Good luck!"); - cm.dispose(); - } else if (cm.getPlayer().getMap().getId() == 610030000) { - cm.sendOk("One of the only known Holy Archers, Lockewood is one of the Keep's most famous heroes. Of particular note is his custom white and gold battle barb, said to be blessed by a powerfull goddess. His aim was tremendously accurate over long distanes. Feared and respected for his 'Genesis Arrow' and 'Doom Phoenix', he once struck down six Typhons from the Valley of Heroes."); - cm.dispose(); - } else if (cm.getPlayer().getMapId() == 610030540) { - if (cm.getPlayer().getMap().countMonsters() == 0) { - var eim = cm.getEventInstance(); - var stgStatus = eim.getIntProperty("glpq5_room"); - var jobNiche = cm.getPlayer().getJob().getJobNiche(); - - if ((stgStatus >> jobNiche) % 2 == 0) { - if(cm.canHold(4001258, 1)) { - cm.gainItem(4001258, 1); - cm.sendOk("Good job."); - - stgStatus += (1 << jobNiche); - eim.setIntProperty("glpq5_room", stgStatus); - } else { - cm.sendOk("Make room on your ETC inventory first."); - } - } else { - cm.sendOk("The weapon inside this room has already been retrieved."); - } + if (cm.getPlayer().getMapId() == 610030500) { + cm.sendOk("A legendary creature known as the Master Guardian awaits you. It was a Crimson Guardian that Ridley once experimented on, which resulted in its becoming highly resistant to magic attacks, spears, maces, everything--except arrows fired with exceptional power. Bowmen and women! As undisputed masters of the Bow and Arrow, you must use your most powerful attacks--everything from Strafe to Hurricane to Piercing Arrow to destroy this powerful creature and reach the Bowman Statue to claim The Ancestral Bow! Good luck!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("One of the only known Holy Archers, Lockewood is one of the Keep's most famous heroes. Of particular note is his custom white and gold battle barb, said to be blessed by a powerfull goddess. His aim was tremendously accurate over long distanes. Feared and respected for his 'Genesis Arrow' and 'Doom Phoenix', he once struck down six Typhons from the Valley of Heroes."); + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030540) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if (cm.canHold(4001258, 1)) { + cm.gainItem(4001258, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); } else { - cm.sendOk("Eliminate all Master Guardians."); + cm.sendOk("Make room on your ETC inventory first."); } - cm.dispose(); + } else { + cm.sendOk("The weapon inside this room has already been retrieved."); + } + } else { + cm.sendOk("Eliminate all Master Guardians."); } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201109.js b/scripts/npc/9201109.js index 21b02cf26b..f5e0077a6f 100644 --- a/scripts/npc/9201109.js +++ b/scripts/npc/9201109.js @@ -2,36 +2,36 @@ */ function start() { - if (cm.getPlayer().getMapId() == 610030500) { - cm.sendOk("As a powerful Elite Mage, Ridly knew the value of intelligence, the hallmark quality of a wizard. Thus, the Mage Chamber is a twisting maze of devious conception--the Teleport skill is the only skill you can use inside to get around, and Magic Claw is the only skill that will break the statues. You must also kill numerous monsters within. After you solve the maze and defeat all the foes within it, deduce which Mage Statue hides the Staff of First Magic and break it open to claim it! Good luck!"); - cm.dispose(); - } else if (cm.getPlayer().getMap().getId() == 610030000) { - cm.sendOk("A name forever remembered, Rafael was an exceptionally skilled sorcerer, and the foremost master of mental magic powers, telekinesis and telepathy. In addition to that, he was one of the 'Elite Mages' who mastered all the elements. He was last seen looking for the 'Temple of the Elementals' to turn the tide against the invading Krakian Army..."); - cm.dispose(); - } else if (cm.getPlayer().getMapId() == 610030521) { - if (cm.getPlayer().getMap().countMonsters() == 0) { - var eim = cm.getEventInstance(); - var stgStatus = eim.getIntProperty("glpq5_room"); - var jobNiche = cm.getPlayer().getJob().getJobNiche(); - - if ((stgStatus >> jobNiche) % 2 == 0) { - if(cm.canHold(4001257, 1)) { - cm.gainItem(4001257, 1); - cm.sendOk("Good job."); - - stgStatus += (1 << jobNiche); - eim.setIntProperty("glpq5_room", stgStatus); - } else { - cm.sendOk("Make room on your ETC inventory first."); - } - } else { - cm.sendOk("The weapon inside this room has already been retrieved."); - } + if (cm.getPlayer().getMapId() == 610030500) { + cm.sendOk("As a powerful Elite Mage, Ridly knew the value of intelligence, the hallmark quality of a wizard. Thus, the Mage Chamber is a twisting maze of devious conception--the Teleport skill is the only skill you can use inside to get around, and Magic Claw is the only skill that will break the statues. You must also kill numerous monsters within. After you solve the maze and defeat all the foes within it, deduce which Mage Statue hides the Staff of First Magic and break it open to claim it! Good luck!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("A name forever remembered, Rafael was an exceptionally skilled sorcerer, and the foremost master of mental magic powers, telekinesis and telepathy. In addition to that, he was one of the 'Elite Mages' who mastered all the elements. He was last seen looking for the 'Temple of the Elementals' to turn the tide against the invading Krakian Army..."); + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030521) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if (cm.canHold(4001257, 1)) { + cm.gainItem(4001257, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); } else { - cm.sendOk("Eliminate all monsters."); + cm.sendOk("Make room on your ETC inventory first."); } - cm.dispose(); - } /* else if (cm.getPlayer().getMapId() == 610030522) { + } else { + cm.sendOk("The weapon inside this room has already been retrieved."); + } + } else { + cm.sendOk("Eliminate all monsters."); + } + cm.dispose(); + } /* else if (cm.getPlayer().getMapId() == 610030522) { if (cm.getPlayer().getMap().countMonsters() == 0) { cm.warp(610030522,0); } else { diff --git a/scripts/npc/9201110.js b/scripts/npc/9201110.js index 53ff9734af..ba9f948563 100644 --- a/scripts/npc/9201110.js +++ b/scripts/npc/9201110.js @@ -2,36 +2,36 @@ */ function start() { - switch(cm.getPlayer().getMapId()) { - case 610030500: - cm.sendOk("As every Thief knows, the best attack is the one you never see coming. So, to best illustrate this, you'll be in a chamber with platforms and ledges that you can only get to with Haste, as well as All-Seeing Eyes that your dagger or claw must close--permanently. After all the All-Seeing Eyes have been eliminated, get ti the Thief Statue and lay claim to the Primal Claw! Good luck!"); - break; - case 610030000: - cm.sendOk("Once known as the 'Prince of Shadows', Grandmaster Ryo possessed supreme speed and power with short-ranged daggers and longer chain-like Claw. A part-time member of the Bosshunters, he was reowned for unparalleled ability to blend into the very night itself. His legend grew during a battle with Crimson Balrog, where he moved so swiftly that Balrog's attacks only caught air. Ryo also performed occasional 'retrievals' for those less fortunate than himself."); - break; - case 610030530: - if (cm.isAllReactorState(6108004, 1)) { - var eim = cm.getEventInstance(); - var stgStatus = eim.getIntProperty("glpq5_room"); - var jobNiche = cm.getPlayer().getJob().getJobNiche(); + switch (cm.getPlayer().getMapId()) { + case 610030500: + cm.sendOk("As every Thief knows, the best attack is the one you never see coming. So, to best illustrate this, you'll be in a chamber with platforms and ledges that you can only get to with Haste, as well as All-Seeing Eyes that your dagger or claw must close--permanently. After all the All-Seeing Eyes have been eliminated, get ti the Thief Statue and lay claim to the Primal Claw! Good luck!"); + break; + case 610030000: + cm.sendOk("Once known as the 'Prince of Shadows', Grandmaster Ryo possessed supreme speed and power with short-ranged daggers and longer chain-like Claw. A part-time member of the Bosshunters, he was reowned for unparalleled ability to blend into the very night itself. His legend grew during a battle with Crimson Balrog, where he moved so swiftly that Balrog's attacks only caught air. Ryo also performed occasional 'retrievals' for those less fortunate than himself."); + break; + case 610030530: + if (cm.isAllReactorState(6108004, 1)) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); - if ((stgStatus >> jobNiche) % 2 == 0) { - if(cm.canHold(4001256, 1)) { - cm.gainItem(4001256, 1); - cm.sendOk("Good job."); + if ((stgStatus >> jobNiche) % 2 == 0) { + if (cm.canHold(4001256, 1)) { + cm.gainItem(4001256, 1); + cm.sendOk("Good job."); - stgStatus += (1 << jobNiche); - eim.setIntProperty("glpq5_room", stgStatus); - } else { - cm.sendOk("Make room on your ETC inventory first."); - } - } else { - cm.sendOk("The weapon inside this room has already been retrieved."); - } - } else { - cm.sendOk("Go now, destroy all of the watchful eyes with your mobility skills, fellow Thief. Report back to me when you are done."); - } - break; - } - cm.dispose(); + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); + } else { + cm.sendOk("Make room on your ETC inventory first."); + } + } else { + cm.sendOk("The weapon inside this room has already been retrieved."); + } + } else { + cm.sendOk("Go now, destroy all of the watchful eyes with your mobility skills, fellow Thief. Report back to me when you are done."); + } + break; + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9201111.js b/scripts/npc/9201111.js index 6fc3834fc7..c0c69e980e 100644 --- a/scripts/npc/9201111.js +++ b/scripts/npc/9201111.js @@ -2,11 +2,11 @@ */ function start() { - if (cm.getPlayer().getMap().getId() == 610030500) { - cm.sendOk("You're about to get wet and do what a Pirate does best--dig for booty! Be careful--that water beneath is known as Heavy Water, and it's so dense that I doubt you could swim through it! You'll have to make your way around....The relic you seek is known as the Forbidden Gun, which is an ancient weapon of the finest Pirate to grace the shores of Masteria--Steel Fist Jack! It's been buried in one of the many treasure chests you'll find below the sea. It won't be easy...Pirates were known for burying things in the most unlikely places, so dig deep and keep your guard up. There are sharks and much worse in those waters!"); - cm.dispose(); - } else if (cm.getPlayer().getMap().getId() == 610030000) { - cm.sendOk("Long ago, a strange warrior washed upon the shores of Masteria. This being claimed to be a member of a mysterious band of warriors that used claw-like weapons and projectile-based artillery to defeat foes. Known as 'Steel Fist Jack', his cunning and trickery in battle was devilishly effective. He eventually built a boat and left the Keep in search of his former crew and captain."); - cm.dispose(); - } + if (cm.getPlayer().getMap().getId() == 610030500) { + cm.sendOk("You're about to get wet and do what a Pirate does best--dig for booty! Be careful--that water beneath is known as Heavy Water, and it's so dense that I doubt you could swim through it! You'll have to make your way around....The relic you seek is known as the Forbidden Gun, which is an ancient weapon of the finest Pirate to grace the shores of Masteria--Steel Fist Jack! It's been buried in one of the many treasure chests you'll find below the sea. It won't be easy...Pirates were known for burying things in the most unlikely places, so dig deep and keep your guard up. There are sharks and much worse in those waters!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("Long ago, a strange warrior washed upon the shores of Masteria. This being claimed to be a member of a mysterious band of warriors that used claw-like weapons and projectile-based artillery to defeat foes. Known as 'Steel Fist Jack', his cunning and trickery in battle was devilishly effective. He eventually built a boat and left the Keep in search of his former crew and captain."); + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201112.js b/scripts/npc/9201112.js index 14e92d30bd..4b351a19b9 100644 --- a/scripts/npc/9201112.js +++ b/scripts/npc/9201112.js @@ -12,7 +12,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - + if (mode == 1) { status++; } else { @@ -24,7 +24,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - switch(cm.getPlayer().getMapId()) { + switch (cm.getPlayer().getMapId()) { case 610030100: if (status == 0) { cm.sendNext("Agh, you have made it in. Let me tell you real quick: they've caught us already. Master Guardians are about to come here in about a minute. We'd better hurry."); @@ -36,45 +36,45 @@ function action(mode, type, selection) { } break; case 610030200: - if (status == 0) { + if (status == 0) { cm.sendNext("That was a success! Now, for this path, I do believe we need one of every Adventurer class to get past."); - } else if (status == 1) { + } else if (status == 1) { cm.sendNext("They need to use their skills on each of these things called Sigils. Once all five have been done, we can get past."); cm.dispose(); - } - break; + } + break; case 610030300: - if (status == 0) { + if (status == 0) { cm.sendNext("Now what we have here are more Sigils. At least five Adventurers have to climb to the very top and go through the portal. Stay aware though: not every wall or ground on this map is what it seems to be, so tread lightly!"); - } else if (status == 1) { + } else if (status == 1) { cm.sendNext("Oh, and beware of these death traps: Menhirs. They really pack a punch. Good luck."); cm.dispose(); - } - break; + } + break; case 610030400: - if (status == 0) { + if (status == 0) { cm.sendNext("Now what we have here are more Sigils. However, some of them don't work. Here all jobs must fill their roles, as at least one of these Sigils are activated by their job skills, however there can be more than one per job, so be sure to test them all."); - } else if (status == 1) { + } else if (status == 1) { cm.sendNext("These Stirges will get in your way, but they're merely a distraction. To get rid of them, get five adventurers to stand on the middle-left platform simultaneously. To pass, try every one of these Sigils until they work."); cm.dispose(); - } - break; + } + break; case 610030500: - if (status == 0) { + if (status == 0) { cm.sendNext("Surprised you made it this far! What you see here is the statue of Crimsonwood Keep, but without any of it's weapons."); - } else if (status == 1) { + } else if (status == 1) { cm.sendNext("There are five rooms, marked by a statue near each of them, around the statue."); - } else if (status == 2) { + } else if (status == 2) { cm.sendNext("I suspect that each of these rooms have one of the statue's five weapons."); - } else if (status == 3) { + } else if (status == 3) { cm.sendNext("Bring back the weapons and restore them to the Relic of Mastery!"); cm.dispose(); - } - break; + } + break; case 610030700: - cm.sendNext("That was some good work out there! This leads the way to the Twisted Masters' Armory."); - cm.dispose(); - break; + cm.sendNext("That was some good work out there! This leads the way to the Twisted Masters' Armory."); + cm.dispose(); + break; } } } \ No newline at end of file diff --git a/scripts/npc/9201113.js b/scripts/npc/9201113.js index 3164a0babf..7f2c26e944 100644 --- a/scripts/npc/9201113.js +++ b/scripts/npc/9201113.js @@ -86,12 +86,12 @@ function action(mode, type, selection) { } else if (status == 1) { if (selection == 1) { expedition = cm.getExpedition(cwkpq); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(cwkpq); if (res == 0) { cm.sendOk("The #rCrimsonwood Keep Party Quest Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -100,13 +100,13 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to attempting Crimsonwood Keep Party Quest."); cm.dispose(); - return; + } } else if (status == 2) { if (selection == 1) { @@ -137,7 +137,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - + cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to CWKPQ Altar#k."); status = 4; } else if (selection == 3) { @@ -146,7 +146,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -157,14 +157,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to complete the Crimsonwood Keep Party Quest, lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/9201114.js b/scripts/npc/9201114.js index 7173ec59c7..28591a87aa 100644 --- a/scripts/npc/9201114.js +++ b/scripts/npc/9201114.js @@ -19,14 +19,18 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Door that warps you inside the CWKPQ start map. * * @Author Ronan */ - + function start() { - if(cm.haveItem(3992041, 1)) cm.warp(610030020, "out00"); - else cm.playerMessage(5, "The giant gate of iron will not budge no matter what, however there is a visible key-shaped socket."); - + if (cm.haveItem(3992041, 1)) { + cm.warp(610030020, "out00"); + } else { + cm.playerMessage(5, "The giant gate of iron will not budge no matter what, however there is a visible key-shaped socket."); + } + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9201115.js b/scripts/npc/9201115.js index a8c036ad81..59bb624293 100644 --- a/scripts/npc/9201115.js +++ b/scripts/npc/9201115.js @@ -5,96 +5,96 @@ function start() { } function action(mode, type, selection) { - var eim = cm.getEventInstance(); - if (eim != null && eim.getIntProperty("glpq6") == 3) { - cm.sendOk("... Well played. You overtook the Twisted Masters. Pass through that gate to receive your prizes."); - cm.dispose(); - return; - } - - if (!cm.isEventLeader()) { - cm.sendNext("I wish for your leader to talk to me."); - cm.dispose(); - return; - } - - if (mode == 1) { - status++; - } else { - status--; - } + var eim = cm.getEventInstance(); + if (eim != null && eim.getIntProperty("glpq6") == 3) { + cm.sendOk("... Well played. You overtook the Twisted Masters. Pass through that gate to receive your prizes."); + cm.dispose(); + return; + } - if (eim != null) { - if (eim.getIntProperty("glpq6") == 0) { - if (status == 0) { - cm.sendNext("Welcome to the Twisted Masters' Keep. I will be your host for this evening..."); - } else if (status == 1) { - cm.sendNext("Tonight, we have a feast of a squad of Maplers.. ahaha..."); - } else if (status == 2) { - cm.sendNext("Let our specially trained Master Guardians escort you!"); - cm.mapMessage(6, "Engarde! Master Guardians approach!"); - for (var i = 0; i < 10; i++) { - var mob = eim.getMonster(9400594); - cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276)); - } - for (var i = 0; i < 20; i++) { - var mob = eim.getMonster(9400582); - cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276)); - } - eim.setIntProperty("glpq6", 1); - cm.dispose(); - } - } else if (eim.getIntProperty("glpq6") == 1) { - if (cm.getMap().countMonsters() == 0) { - if (status == 0) { - cm.sendOk("Eh. What is this? You've defeated them?"); - } else if (status == 1) { - cm.sendNext("Well, no matter! The Twisted Masters will be glad to welcome you."); - cm.mapMessage(6, "Twisted Masters approach!"); + if (!cm.isEventLeader()) { + cm.sendNext("I wish for your leader to talk to me."); + cm.dispose(); + return; + } - //Margana - var mob = eim.getMonster(9400590); - cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-22, 1)); + if (mode == 1) { + status++; + } else { + status--; + } - //Red Nirg - var mob2 = eim.getMonster(9400591); - cm.getMap().spawnMonsterOnGroundBelow(mob2, new java.awt.Point(-22, 276)); - - //Hsalf - var mob4 = eim.getMonster(9400593); - cm.getMap().spawnMonsterOnGroundBelow(mob4, new java.awt.Point(496, 276)); - - //Rellik - var mob3 = eim.getMonster(9400592); - cm.getMap().spawnMonsterOnGroundBelow(mob3, new java.awt.Point(-496, 276)); - - eim.setIntProperty("glpq6", 2); - cm.dispose(); - } - } else { - cm.sendOk("Pay no attention to me. The Master Guardians will escort you!"); - cm.dispose(); - } - } else if (eim.getIntProperty("glpq6") == 2) { - if (cm.getMap().countMonsters() == 0) { - cm.sendOk("WHAT? Ugh... this can't be happening."); - cm.mapMessage(5, "The portal to the next stage has opened!"); - eim.setIntProperty("glpq6", 3); - - eim.showClearEffect(true); - eim.giveEventPlayersStageReward(6); - - eim.clearPQ(); - cm.dispose(); - } else { - cm.sendOk("Pay no attention to me. The Twisted Masters will escort you!"); - cm.dispose(); - } - } else { - cm.sendOk("... Well played. You overtook the Twisted Masters. Pass through that gate to receive your prizes."); - cm.dispose(); + if (eim != null) { + if (eim.getIntProperty("glpq6") == 0) { + if (status == 0) { + cm.sendNext("Welcome to the Twisted Masters' Keep. I will be your host for this evening..."); + } else if (status == 1) { + cm.sendNext("Tonight, we have a feast of a squad of Maplers.. ahaha..."); + } else if (status == 2) { + cm.sendNext("Let our specially trained Master Guardians escort you!"); + cm.mapMessage(6, "Engarde! Master Guardians approach!"); + for (var i = 0; i < 10; i++) { + var mob = eim.getMonster(9400594); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276)); } - } else { + for (var i = 0; i < 20; i++) { + var mob = eim.getMonster(9400582); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276)); + } + eim.setIntProperty("glpq6", 1); cm.dispose(); + } + } else if (eim.getIntProperty("glpq6") == 1) { + if (cm.getMap().countMonsters() == 0) { + if (status == 0) { + cm.sendOk("Eh. What is this? You've defeated them?"); + } else if (status == 1) { + cm.sendNext("Well, no matter! The Twisted Masters will be glad to welcome you."); + cm.mapMessage(6, "Twisted Masters approach!"); + + //Margana + var mob = eim.getMonster(9400590); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-22, 1)); + + //Red Nirg + var mob2 = eim.getMonster(9400591); + cm.getMap().spawnMonsterOnGroundBelow(mob2, new java.awt.Point(-22, 276)); + + //Hsalf + var mob4 = eim.getMonster(9400593); + cm.getMap().spawnMonsterOnGroundBelow(mob4, new java.awt.Point(496, 276)); + + //Rellik + var mob3 = eim.getMonster(9400592); + cm.getMap().spawnMonsterOnGroundBelow(mob3, new java.awt.Point(-496, 276)); + + eim.setIntProperty("glpq6", 2); + cm.dispose(); + } + } else { + cm.sendOk("Pay no attention to me. The Master Guardians will escort you!"); + cm.dispose(); + } + } else if (eim.getIntProperty("glpq6") == 2) { + if (cm.getMap().countMonsters() == 0) { + cm.sendOk("WHAT? Ugh... this can't be happening."); + cm.mapMessage(5, "The portal to the next stage has opened!"); + eim.setIntProperty("glpq6", 3); + + eim.showClearEffect(true); + eim.giveEventPlayersStageReward(6); + + eim.clearPQ(); + cm.dispose(); + } else { + cm.sendOk("Pay no attention to me. The Twisted Masters will escort you!"); + cm.dispose(); + } + } else { + cm.sendOk("... Well played. You overtook the Twisted Masters. Pass through that gate to receive your prizes."); + cm.dispose(); } + } else { + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9201123.js b/scripts/npc/9201123.js index 66c91073c3..b6320f6d3a 100644 --- a/scripts/npc/9201123.js +++ b/scripts/npc/9201123.js @@ -30,7 +30,7 @@ var status; var map = 102000003; var job = "Warrior"; var jobType = 1; -var no = "Come back to me if you decided to be a #b"+job+"#k."; +var no = "Come back to me if you decided to be a #b" + job + "#k."; function start() { status = -1; @@ -47,17 +47,18 @@ function action(mode, type, selection) { cm.dispose(); } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { if (cm.getJob() == "BEGINNER") { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { - cm.sendYesNo("Hey #h #, I can send you to #b#m"+map+"##k if you want to be a #b"+job+"#k. Do you want to go now?"); + cm.sendYesNo("Hey #h #, I can send you to #b#m" + map + "##k if you want to be a #b" + job + "#k. Do you want to go now?"); } else { - cm.sendOk("If you want to be a #b"+job+"#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); + cm.sendOk("If you want to be a #b" + job + "#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); cm.dispose(); } } else { diff --git a/scripts/npc/9201124.js b/scripts/npc/9201124.js index 8ae109da76..718c2ce155 100644 --- a/scripts/npc/9201124.js +++ b/scripts/npc/9201124.js @@ -30,7 +30,7 @@ var status; var map = 100000201; var job = "Bowman"; var jobType = 3; -var no = "Come back to me if you decided to be a #b"+job+"#k."; +var no = "Come back to me if you decided to be a #b" + job + "#k."; function start() { status = -1; @@ -47,17 +47,18 @@ function action(mode, type, selection) { cm.dispose(); } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { if (cm.getJob() == "BEGINNER") { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { - cm.sendYesNo("Hey #h #, I can send you to #b#m"+map+"##k if you want to be a #b"+job+"#k. Do you want to go now?"); + cm.sendYesNo("Hey #h #, I can send you to #b#m" + map + "##k if you want to be a #b" + job + "#k. Do you want to go now?"); } else { - cm.sendOk("If you want to be a #b"+job+"#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); + cm.sendOk("If you want to be a #b" + job + "#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); cm.dispose(); } } else { diff --git a/scripts/npc/9201125.js b/scripts/npc/9201125.js index cb05b35630..c6b69c7a5e 100644 --- a/scripts/npc/9201125.js +++ b/scripts/npc/9201125.js @@ -30,7 +30,7 @@ var status; var map = 101000003; var job = "Magician"; var jobType = 2; -var no = "Come back to me if you decided to be a #b"+job+"#k."; +var no = "Come back to me if you decided to be a #b" + job + "#k."; function start() { status = -1; @@ -47,17 +47,18 @@ function action(mode, type, selection) { cm.dispose(); } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { if (cm.getJob() == "BEGINNER") { if (cm.getLevel() >= 8 && cm.canGetFirstJob(jobType)) { - cm.sendYesNo("Hey #h #, I can send you to #b#m"+map+"##k if you want to be a #b"+job+"#k. Do you want to go now?"); + cm.sendYesNo("Hey #h #, I can send you to #b#m" + map + "##k if you want to be a #b" + job + "#k. Do you want to go now?"); } else { - cm.sendOk("If you want to be a #b"+job+"#k, train yourself further until you reach #blevel 8, " + cm.getFirstJobStatRequirement(jobType) + "#k."); + cm.sendOk("If you want to be a #b" + job + "#k, train yourself further until you reach #blevel 8, " + cm.getFirstJobStatRequirement(jobType) + "#k."); cm.dispose(); } } else { diff --git a/scripts/npc/9201126.js b/scripts/npc/9201126.js index af34c2e37f..9ddf1f1f9c 100644 --- a/scripts/npc/9201126.js +++ b/scripts/npc/9201126.js @@ -30,7 +30,7 @@ var status; var map = 103000003; var job = "Thief"; var jobType = 4; -var no = "Come back to me if you decided to be a #b"+job+"#k."; +var no = "Come back to me if you decided to be a #b" + job + "#k."; function start() { status = -1; @@ -47,17 +47,18 @@ function action(mode, type, selection) { cm.dispose(); } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { if (cm.getJob() == "BEGINNER") { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { - cm.sendYesNo("Hey #h #, I can send you to #b#m"+map+"##k if you want to be a #b"+job+"#k. Do you want to go now?"); + cm.sendYesNo("Hey #h #, I can send you to #b#m" + map + "##k if you want to be a #b" + job + "#k. Do you want to go now?"); } else { - cm.sendOk("If you want to be a #b"+job+"#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); + cm.sendOk("If you want to be a #b" + job + "#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); cm.dispose(); } } else { diff --git a/scripts/npc/9201127.js b/scripts/npc/9201127.js index 70641a08a4..6d5e10b283 100644 --- a/scripts/npc/9201127.js +++ b/scripts/npc/9201127.js @@ -30,7 +30,7 @@ var status; var map = 120000101; var job = "Pirate"; var jobType = 5; -var no = "Come back to me if you decided to be a #b"+job+"#k."; +var no = "Come back to me if you decided to be a #b" + job + "#k."; function start() { status = -1; @@ -47,17 +47,18 @@ function action(mode, type, selection) { cm.dispose(); } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { if (cm.getJob() == "BEGINNER") { if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType)) { - cm.sendYesNo("Hey #h #, I can send you to #b#m"+map+"##k if you want to be a #b"+job+"#k. Do you want to go now?"); + cm.sendYesNo("Hey #h #, I can send you to #b#m" + map + "##k if you want to be a #b" + job + "#k. Do you want to go now?"); } else { - cm.sendOk("If you want to be a #b"+job+"#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); + cm.sendOk("If you want to be a #b" + job + "#k, train yourself further until you reach #blevel 10, " + cm.getFirstJobStatRequirement(jobType) + "#k."); cm.dispose(); } } else { diff --git a/scripts/npc/9201128.js b/scripts/npc/9201128.js index 6fea1725b9..0ec3a5a179 100644 --- a/scripts/npc/9201128.js +++ b/scripts/npc/9201128.js @@ -4,15 +4,15 @@ var questItem = 4032491; var status = -1; function start(mode, type, selection) { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { if (cm.isQuestStarted(quest)) { @@ -27,10 +27,14 @@ function action(mode, type, selection) { cm.dispose(); } } else { - if(cm.haveItem(4001341, 1)) cm.gainItem(4001341, -1); - if(cm.haveItem(4032478, 1)) cm.gainItem(4032478, -1); - - cm.warp(map, 0); - cm.dispose(); + if (cm.haveItem(4001341, 1)) { + cm.gainItem(4001341, -1); + } + if (cm.haveItem(4032478, 1)) { + cm.gainItem(4032478, -1); + } + + cm.warp(map, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201129.js b/scripts/npc/9201129.js index 44362c3756..d3c75ae9de 100644 --- a/scripts/npc/9201129.js +++ b/scripts/npc/9201129.js @@ -4,15 +4,15 @@ var questItem = 4032495; var status = -1; function start(mode, type, selection) { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { if (cm.isQuestStarted(quest)) { @@ -27,7 +27,7 @@ function action(mode, type, selection) { cm.dispose(); } } else { - cm.warp(map, 0); - cm.dispose(); + cm.warp(map, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201130.js b/scripts/npc/9201130.js index 795bcde1d5..b8f8b6515b 100644 --- a/scripts/npc/9201130.js +++ b/scripts/npc/9201130.js @@ -4,15 +4,15 @@ var questItem = 4032493; var status = -1; function start(mode, type, selection) { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { if (cm.isQuestStarted(quest)) { @@ -27,10 +27,14 @@ function action(mode, type, selection) { cm.dispose(); } } else { - if(cm.haveItem(4032485, 1)) cm.gainItem(4032485, -1); - if(cm.haveItem(4001355, 1)) cm.gainItem(4001355, -1); - - cm.warp(map, 0); - cm.dispose(); + if (cm.haveItem(4032485, 1)) { + cm.gainItem(4032485, -1); + } + if (cm.haveItem(4001355, 1)) { + cm.gainItem(4001355, -1); + } + + cm.warp(map, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201131.js b/scripts/npc/9201131.js index ab545d7784..25148617ff 100644 --- a/scripts/npc/9201131.js +++ b/scripts/npc/9201131.js @@ -4,15 +4,15 @@ var questItem = 4032492; var status = -1; function start(mode, type, selection) { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { if (cm.isQuestStarted(quest)) { @@ -27,11 +27,17 @@ function action(mode, type, selection) { cm.dispose(); } } else { - if(cm.haveItem(4032481, 1)) cm.gainItem(4032481, -1); - if(cm.haveItem(4032482, 1)) cm.gainItem(4032482, -1); - if(cm.haveItem(4032483, 1)) cm.gainItem(4032483, -1); - - cm.warp(map, 0); - cm.dispose(); + if (cm.haveItem(4032481, 1)) { + cm.gainItem(4032481, -1); + } + if (cm.haveItem(4032482, 1)) { + cm.gainItem(4032482, -1); + } + if (cm.haveItem(4032483, 1)) { + cm.gainItem(4032483, -1); + } + + cm.warp(map, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201132.js b/scripts/npc/9201132.js index a790f832f6..070c2d3730 100644 --- a/scripts/npc/9201132.js +++ b/scripts/npc/9201132.js @@ -4,15 +4,15 @@ var questItem = 4032494; var status = -1; function start(mode, type, selection) { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { if (cm.isQuestStarted(quest)) { @@ -27,14 +27,26 @@ function action(mode, type, selection) { cm.dispose(); } } else { - if(cm.haveItem(4001362, 1)) cm.gainItem(4001362, -cm.getItemQuantity(4001362)); - if(cm.haveItem(4001363, 1)) cm.gainItem(4001363, -cm.getItemQuantity(4001363)); - if(cm.haveItem(4032486, 1)) cm.gainItem(4032486, -1); - if(cm.haveItem(4032488, 1)) cm.gainItem(4032488, -1); - if(cm.haveItem(4032489, 1)) cm.gainItem(4032489, -1); - if(cm.haveItem(4220153, 1)) cm.gainItem(4220153, -1); - - cm.warp(map, 0); - cm.dispose(); + if (cm.haveItem(4001362, 1)) { + cm.gainItem(4001362, -cm.getItemQuantity(4001362)); + } + if (cm.haveItem(4001363, 1)) { + cm.gainItem(4001363, -cm.getItemQuantity(4001363)); + } + if (cm.haveItem(4032486, 1)) { + cm.gainItem(4032486, -1); + } + if (cm.haveItem(4032488, 1)) { + cm.gainItem(4032488, -1); + } + if (cm.haveItem(4032489, 1)) { + cm.gainItem(4032489, -1); + } + if (cm.haveItem(4220153, 1)) { + cm.gainItem(4220153, -1); + } + + cm.warp(map, 0); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201133.js b/scripts/npc/9201133.js index 8f6f9c8e6e..842b9f00c3 100644 --- a/scripts/npc/9201133.js +++ b/scripts/npc/9201133.js @@ -4,21 +4,21 @@ var status = -1; var inHuntingGround; function start(mode, type, selection) { - inHuntingGround = (cm.getMapId() >= 677000010 && cm.getMapId() <= 677000012); - action(1, 0, 0); + inHuntingGround = (cm.getMapId() >= 677000010 && cm.getMapId() <= 677000012); + action(1, 0, 0); } function action(mode, type, selection) { if (mode == 1) { - status++; + status++; } else { - cm.dispose(); - return; + cm.dispose(); + return; } if (status == 0) { - if(!inHuntingGround) { + if (!inHuntingGround) { if (cm.isQuestStarted(quest)) { - if(!cm.getPlayer().haveItemEquipped(1003036)) { + if (!cm.getPlayer().haveItemEquipped(1003036)) { cm.sendOk("The path ahead has a weird stench... Equip the #rgas mask#k before entering."); cm.dispose(); return; @@ -30,7 +30,7 @@ function action(mode, type, selection) { cm.dispose(); } } else { - if(cm.getMapId() == 677000011) { + if (cm.getMapId() == 677000011) { map = 677000012; cm.sendYesNo("Would you like to move to #b#m" + map + "##k?"); } else { @@ -40,6 +40,6 @@ function action(mode, type, selection) { } } else { cm.warp(map, 0); - cm.dispose(); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9201134.js b/scripts/npc/9201134.js index d1ff985863..8abd11ab96 100644 --- a/scripts/npc/9201134.js +++ b/scripts/npc/9201134.js @@ -23,47 +23,48 @@ * * @Author Ronan */ - + var status; - + function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - var eim = cm.getEventInstance(); - if(!eim.isEventCleared()) { - if (status == 0) { - cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?"); - } else if (status == 1) { - cm.warp(551030100, 2); - cm.dispose(); - } - } else { - if (status == 0) { - cm.sendNext("You guys defeated both Scarlion and Targa! Wonderful! Take this memento as a prize for your bravery."); - } else if (status == 1) { - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendNext("Please make room on your inventory first!"); - } else { - cm.warp(551030100, 2); - } - - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + var eim = cm.getEventInstance(); + if (!eim.isEventCleared()) { + if (status == 0) { + cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?"); + } else if (status == 1) { + cm.warp(551030100, 2); + cm.dispose(); + } + } else { + if (status == 0) { + cm.sendNext("You guys defeated both Scarlion and Targa! Wonderful! Take this memento as a prize for your bravery."); + } else if (status == 1) { + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendNext("Please make room on your inventory first!"); + } else { + cm.warp(551030100, 2); + } + + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9201135.js b/scripts/npc/9201135.js index 6b0643b3a2..10e346ef0d 100644 --- a/scripts/npc/9201135.js +++ b/scripts/npc/9201135.js @@ -19,10 +19,10 @@ along with this program. If not, see . */ -var inMap = new Array(540000000, 550000000, 551000000); -var toMap = new Array(550000000, new Array(551000000, 541000000), 550000000); -var cost = new Array(42000, new Array(10000, 0), 10000); -var toMapSp = new Array(0, new Array(2, 4), 4); +var inMap = [540000000, 550000000, 551000000]; +var toMap = [550000000, [551000000, 541000000], 550000000]; +var cost = [42000, [10000, 0], 10000]; +var toMapSp = [0, [2, 4], 4]; var location; var text; @@ -36,39 +36,41 @@ var startedTravel = false; var status = 0; function start() { - if (cm.getPlayer().getMap().getId() != 540000000) { - text = "Hey I'm #p9201135#, your tour guide here in #rMalaysia#k. Where would you like to travel?\n\n"; - } else { - text = "Hey I'm #p9201135#, a tour guide on #rMalaysia#k. Since you're not registered in our special travel package with our partner #bMaple Travel Agency#k, the ride will be significantly more expensive. So, would you like to ride now?\n\n"; - startedTravel = true; - } - - for (var i = 0; i < toMap.length; i ++) { - if (inMap[i] == cm.getPlayer().getMap().getId()) { - if(inMap[i] == 550000000) { - toMap[1][1] = cm.getPlayer().peekSavedLocation("WORLDTOUR"); - if(toMap[1][1] == -1) toMap[1][1] = 541000000; - } - - location = i; - break; + if (cm.getPlayer().getMap().getId() != 540000000) { + text = "Hey I'm #p9201135#, your tour guide here in #rMalaysia#k. Where would you like to travel?\n\n"; + } else { + text = "Hey I'm #p9201135#, a tour guide on #rMalaysia#k. Since you're not registered in our special travel package with our partner #bMaple Travel Agency#k, the ride will be significantly more expensive. So, would you like to ride now?\n\n"; + startedTravel = true; + } + + for (var i = 0; i < toMap.length; i++) { + if (inMap[i] == cm.getPlayer().getMap().getId()) { + if (inMap[i] == 550000000) { + toMap[1][1] = cm.getPlayer().peekSavedLocation("WORLDTOUR"); + if (toMap[1][1] == -1) { + toMap[1][1] = 541000000; } + } + + location = i; + break; } + } - if(toMap[location] instanceof Array) { - var maps = toMap[location]; - var costs = cost[location]; + if (toMap[location] instanceof Array) { + var maps = toMap[location]; + var costs = cost[location]; - for(var i = 0; i < maps.length; i++) { - text +="\t\r\n#b#L" + i + "##m" + maps[i] + "# " + (costs[i] > 0 ? "(" + costs[i] + "mesos)" : "") + "#l"; - } - } else { - text +="\t\r\n#b#L0##m" + toMap[location] + "# " + (cost[location] > 0 ? "(" + cost[location] + "mesos)" : "") + "#l"; + for (var i = 0; i < maps.length; i++) { + text += "\t\r\n#b#L" + i + "##m" + maps[i] + "# " + (costs[i] > 0 ? "(" + costs[i] + "mesos)" : "") + "#l"; } + } else { + text += "\t\r\n#b#L0##m" + toMap[location] + "# " + (cost[location] > 0 ? "(" + cost[location] + "mesos)" : "") + "#l"; + } - text += "#k"; - - cm.sendSimple(text); + text += "#k"; + + cm.sendSimple(text); } function action(mode, type, selection) { @@ -76,7 +78,7 @@ function action(mode, type, selection) { cm.dispose(); return; } else if (mode == 0) { - cm.sendNext("You know where to come if you need a ride!"); + cm.sendNext("You know where to come if you need a ride!"); cm.dispose(); return; } else { @@ -87,8 +89,8 @@ function action(mode, type, selection) { cm.dispose(); return; } - - if(toMap[location] instanceof Array) { + + if (toMap[location] instanceof Array) { var maps = toMap[location]; var costs = cost[location]; var sps = toMapSp[location]; @@ -101,8 +103,8 @@ function action(mode, type, selection) { travelMap = toMap[location]; travelSp = toMapSp[location]; } - - if(travelCost > 0) { + + if (travelCost > 0) { cm.sendYesNo("Would you like to travel to #b#m" + travelMap + "##k? To head over to #b#m" + travelMap + "##k, it'll cost you #r" + cm.numberWithCommas(travelCost) + " mesos#k. Would you like to go right now?"); } else { cm.sendNext("Had a great time in #rMalaysia#k? I hope so, have a safe travel back!"); @@ -111,15 +113,18 @@ function action(mode, type, selection) { if (cm.getMeso() < travelCost) { cm.sendNext("You do not seem to have enough mesos."); } else { - if(travelCost > 0) { + if (travelCost > 0) { cm.gainMeso(-travelCost); - if(startedTravel) cm.getPlayer().saveLocation("WORLDTOUR"); - } - else { + if (startedTravel) { + cm.getPlayer().saveLocation("WORLDTOUR"); + } + } else { travelMap = cm.getPlayer().getSavedLocation("WORLDTOUR"); - if(travelMap == -1) travelMap = toMap[1][1]; + if (travelMap == -1) { + travelMap = toMap[1][1]; + } } - + cm.warp(travelMap, travelSp); } cm.dispose(); diff --git a/scripts/npc/9201143.js b/scripts/npc/9201143.js index b02b59cf8a..8247f68ed4 100644 --- a/scripts/npc/9201143.js +++ b/scripts/npc/9201143.js @@ -6,6 +6,6 @@ */ function start() { - cm.sendNext("At your service, my friend."); - cm.dispose(); + cm.sendNext("At your service, my friend."); + cm.dispose(); } diff --git a/scripts/npc/9209000.js b/scripts/npc/9209000.js index 8d222a5790..fb38285ff3 100644 --- a/scripts/npc/9209000.js +++ b/scripts/npc/9209000.js @@ -22,7 +22,7 @@ * @npc: Abdula * @map: Multiple towns on Maplestory * @func: Job Skill / Mastery Book Drop Announcer -*/ + */ var status; var selected = 0; @@ -42,55 +42,58 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { var greeting = "Hello, I'm #p9209000#, the Skill & Mastery Book announcer! "; - - if(cm.getPlayer().isCygnus()) { + + if (cm.getPlayer().isCygnus()) { cm.sendOk(greeting + "There are no skill or mastery books available for Cygnus Knights."); cm.dispose(); return; } - + var jobrank = cm.getJob().getId() % 10; - if(jobrank < 2) { + if (jobrank < 2) { cm.sendOk(greeting + "Keep training yourself until you reach the #r4th job#k of your class. New opportunities for improvement will arrive when you reach that feat!"); cm.dispose(); return; } - + skillbook = cm.getAvailableSkillBooks(); masterybook = cm.getAvailableMasteryBooks(); - if(skillbook.length == 0 && masterybook.length == 0) { + if (skillbook.length == 0 && masterybook.length == 0) { cm.sendOk(greeting + "There are no books available to further improve your job skills for now. Either you #bmaxed out everything#k or #byou didn't reach the minimum requisites to use some skill books#k yet."); cm.dispose(); - } else if(skillbook.length > 0 && masterybook.length > 0) { + } else if (skillbook.length > 0 && masterybook.length > 0) { var sendStr = greeting + "New opportunities for skill improvement have been located for you to improve your skills! Pick a type to take a look onto.\r\n\r\n#b"; sendStr += "#L1# Skill Book#l\r\n"; sendStr += "#L2# Mastery Book#l\r\n"; cm.sendSimple(sendStr); - } else if(skillbook.length > 0) { + } else if (skillbook.length > 0) { selected = 1; cm.sendNext(greeting + "New opportunities for skill improvement have been located for you to improve your skills! Only skill learns available for now."); } else { selected = 2; cm.sendNext(greeting + "New opportunities for skill improvement have been located for you to improve your skills! Only skill upgrades available."); } - - } else if(status == 1) { + + } else if (status == 1) { var sendStr = "The following books are currently available:\r\n\r\n"; - if(selected == 0) selected = selection; - + if (selected == 0) { + selected = selection; + } + if (selected == 1) { table = skillbook; - for(var i = 0; i < table.length; i++) { + for (var i = 0; i < table.length; i++) { if (table[i] > 0) { var itemid = table[i]; sendStr += " #L" + i + "# #i" + itemid + "# #t" + itemid + "##l\r\n"; @@ -101,27 +104,27 @@ function action(mode, type, selection) { } } else { table = masterybook; - for(var i = 0; i < table.length; i++) { + for (var i = 0; i < table.length; i++) { var itemid = table[i]; sendStr += " #L" + i + "# #i" + itemid + "# #t" + itemid + "##l\r\n"; } } - + cm.sendSimple(sendStr); - } else if(status == 2) { + } else if (status == 2) { selected = selection; var sendStr; if (table[selected] > 0) { var mobList = cm.getNamesWhoDropsItem(table[selected]); - - if(mobList.length == 0) { + + if (mobList.length == 0) { sendStr = "No mobs drop '#b#t" + table[selected] + "##k'.\r\n\r\n"; } else { sendStr = "The following mobs drop '#b#t" + table[selected] + "##k':\r\n\r\n"; - for(var i = 0; i < mobList.length; i++) { + for (var i = 0; i < mobList.length; i++) { sendStr += " #L" + i + "# " + mobList[i] + "#l\r\n"; } @@ -130,7 +133,7 @@ function action(mode, type, selection) { } else { sendStr = "\r\n\r\n"; } - + sendStr += cm.getSkillBookInfo(table[selected]); cm.sendNext(sendStr); diff --git a/scripts/npc/9209000_old.js b/scripts/npc/9209000_old.js index d20c84c109..14f31542e3 100644 --- a/scripts/npc/9209000_old.js +++ b/scripts/npc/9209000_old.js @@ -30,59 +30,66 @@ function start() { function action(mode, type, selection) { status++; - if(mode != 1){ - if(mode == 0 && status == 0){ + if (mode != 1) { + if (mode == 0 && status == 0) { cm.dispose(); return; - }else if(mode == 0 && sel == 0 && status == 2){ + } else if (mode == 0 && sel == 0 && status == 2) { cm.sendNext("You don't want to sell it right now? You can sell it later, but remember the Special Items are only valuable for a week."); cm.dispose(); return; - }else if(mode == 0 && sel == 2) + } else if (mode == 0 && sel == 2) { status -= 2; + } } - if(status == 0){ - if(sel == undefined) + if (status == 0) { + if (sel == undefined) { sel = selection; - if (selection == 0){ + } + if (selection == 0) { var text = "Let's see what you brought...#b"; - for(var i = 0; i < 5; i++) + for (var i = 0; i < 5; i++) { text += "\r\n#L" + i + "##t" + (3994090 + i) + "#"; + } cm.sendSimple(text); - }else if (selection == 1){ + } else if (selection == 1) { var text = ""; - for(var i = 0; i < 5; i++) + for (var i = 0; i < 5; i++) { text += "The current market price for #t" + (i + 3994090) + "# is #rNOT DONE#k mesos\r\n"; + } cm.sendNext(text); cm.dispose(); - }else + } else { cm.sendNext("I buy the products at the Maple 7th Day Market and sell them in other towns. I trade memorabilia, spices, taxidermy shark, and more... but no Lazy Daisy's eggs."); - }else if(status == 1){ - if(sel == 0){ - if(cm.haveItem(3994090 + selection)){ + } + } else if (status == 1) { + if (sel == 0) { + if (cm.haveItem(3994090 + selection)) { pickup = 3994090 + selection; cm.sendYesNo("The current price is 180 mesos. Would you like to sell it now?"); //Make a price changer by hour. - }else{ + } else { cm.sendNext("You don't have anything. Stop wasting my time... I'm a busy person."); cm.dispose(); } - }else + } else { cm.sendNextPrev("Maple 7th Day Market Sundays are my days off. If you need to see me, you're going to have to come Monday to Friday..."); - }else if(status == 2){ - if(sel == 0) + } + } else if (status == 2) { + if (sel == 0) { cm.sendGetNumber("How many would you like to sell?", 0, 0, 200); - else{ + } else { cm.sendPrev("Oh, and the prices are subject to change. I can't get the short end of the stick, I have to stay in business! Check back with me frequently, my prices change by the hour!"); } - }else if(status == 3){ - if(sel == 0) - if(selection != 1) + } else if (status == 3) { + if (sel == 0) { + if (selection != 1) { cm.sendNext("Something's not right. Check again."); - else{ + } else { cm.sendNext("The transaction has been completed. See you next time."); cm.gainMeso(180); cm.gainItem(pickup, -1); } + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9209001.js b/scripts/npc/9209001.js index b501028217..0c487ca133 100644 --- a/scripts/npc/9209001.js +++ b/scripts/npc/9209001.js @@ -27,7 +27,7 @@ function start() { cm.sendOk("Hello, the Maple 7th Day Market is currently unavailable."); cm.dispose(); return; - + cm.sendSimple("Hello, the Maple 7th Day Market opens today.#b\r\n#L0#Move to Maple 7th Day Market map\r\n#L1#Listen for an explanation about the Maple 7th Day Market"); } @@ -38,55 +38,62 @@ function action(mode, type, selection) { status = 0; } if (mode != 1) { - if (mode == 0 && type == 0) + if (mode == 0 && type == 0) { status -= 2; - else { + } else { cm.dispose(); return; } } if (status == 0) { - if (sel == undefined) + if (sel == undefined) { sel = selection; + } if (selection == 0) { cm.sendNext("Okay, we will send you to the Maple 7th Day Market map."); - } else + } else { cm.sendSimple("What would you like to know about the Maple 7th Day Market?#b\r\n#L0#Where does the Maple 7th Day Market take place?\r\n#L1#What can you do at the Maple 7th Day Market?\r\n#L2#I do not have any questions."); - } else if(status == 1) { + } + } else if (status == 1) { if (sel == 0) { - cm.getPlayer().saveLocation("EVENT"); + cm.getPlayer().saveLocation("EVENT"); cm.warp(680100000 + parseInt(Math.random() * 3)); cm.dispose(); } else if (selection == 0) { cm.sendNext("The Maple 7th Day Market opens only on Sundays. You can enter if you find me in any town, Henesys, New Leaf City, Leafre, Kerning City, Ludibrium, I'm just about everywhere!"); status -= 2; - } else if (selection == 1) + } else if (selection == 1) { cm.sendSimple("You can find rare goods that are hard to find elsewhere at the Maple 7th Day Market.#b\r\n#L0#Purchase Special Items\r\n#L1#Help the Poultry Farm Owner"); - else { + } else { cm.sendNext("I guess you don't have any question. Please keep us in your thoughts, and ask if you are curious about anything."); cm.dispose(); } } else if (status == 2) { - if (sel2 == undefined) + if (sel2 == undefined) { sel2 = selection; - if (sel2 == 0) + } + if (sel2 == 0) { cm.sendNext("You can find many items at the Maple 7th Day Market. The prices are subject to change, so you'd better get them when they're cheap!"); - else + } else { cm.sendNext("Aside from the merchants, you can also find the lazy daughter of the poultry farm owner at the Maple 7th Day Market. Help Mimi and hatch her egg until it grows to be a chicken!"); + } } else if (status == 3) { - if (sel2 == 0) + if (sel2 == 0) { cm.sendNextPrev("The purchases made here can be sold back to the merchant intermediary, Abdula. He won't accept anything more than a week old, so make sure you re-sell by Saturday!"); - else + } else { cm.sendNextPrev("Since she can't just trust anyone with the egg, she'll ask for deposit money. Pay her the deposit and take good care of the egg."); + } } else if (status == 4) { - if (sel2 == 0) + if (sel2 == 0) { cm.sendNextPrev("Abdula adjusts his reselling rates as well, so it would be wise to sell when you can make the most profit. The prices tend to fluctuate hourly, so remember to check often."); - else + } else { cm.sendNextPrev("If you manage to successfully grow the egg into a chicken and take it back to Mimi, Mimi will reward you. She may be lazy but she's not ungrateful."); + } } else if (status == 5) { - if (sel2 == 0) + if (sel2 == 0) { cm.sendNextPrev("Test your business wit by buying good at low prices in the Maple 7th Day Market and selling it to the merchant intermediary when its value goes up!"); - else + } else { cm.sendNextPrev("You can click on the egg to check on its growth. You have to be diligent with the egg since the EXP you gain and the egg will grow together."); + } } } \ No newline at end of file diff --git a/scripts/npc/9209100.js b/scripts/npc/9209100.js index 63ec0c5eb0..c1b462cac5 100644 --- a/scripts/npc/9209100.js +++ b/scripts/npc/9209100.js @@ -2,35 +2,39 @@ var status; function playerNearby(chrpos, portalpos) { try { - return Math.sqrt( Math.pow((portalpos.getX() - chrpos.getX()), 2) + Math.pow((portalpos.getY() - chrpos.getY()), 2) ) < 77; - } catch(err) { + return Math.sqrt(Math.pow((portalpos.getX() - chrpos.getX()), 2) + Math.pow((portalpos.getY() - chrpos.getY()), 2)) < 77; + } catch (err) { return false; } } function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - if (playerNearby(cm.getPlayer().getPosition(), cm.getMap().getPortal("chimney01").getPosition())) cm.sendOk("Hey, hey~~ Please don't go sneaking into someone else's house without permission, you don't want to get a naughty remark on Santa's list this year, do you?"); - else cm.sendOk("Hohoho~~ have you a Great Year full of health, realization and happiness!"); - } else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (playerNearby(cm.getPlayer().getPosition(), cm.getMap().getPortal("chimney01").getPosition())) { + cm.sendOk("Hey, hey~~ Please don't go sneaking into someone else's house without permission, you don't want to get a naughty remark on Santa's list this year, do you?"); + } else { + cm.sendOk("Hohoho~~ have you a Great Year full of health, realization and happiness!"); + } + } else { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9220004.js b/scripts/npc/9220004.js index e64f5c5e06..6e6bae03c5 100644 --- a/scripts/npc/9220004.js +++ b/scripts/npc/9220004.js @@ -1,48 +1,51 @@ -/** -Happy - Happy ville -@author Ronan -**/ +/** + Happy - Happy ville + @author Ronan + **/ var status = -1; -function start() { - action(1, 0, 0); -} -function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (status == 0 && mode == 0) { - cm.sendOk("Talk to me again when you want to."); - cm.dispose(); - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendSimple("#b#k\r\nA raid is nothing but many people joining up in an attempt to defeat extremely powerful creatures. Here is no different. Everyone can take part in defeating the spawned creature. What will you do?\r\n#b\r\n#L0#Spawn Kid Snowman.\r\n#L1#Spawn Lost Rudolph.\r\n#L2#Nothing, just chilling.#k"); - } else if(status == 1) { - if(selection == 0) { - if(cm.getMap().getMonsters().size() > 1) { //reactor as a monster? wtf - cm.sendOk("Eliminate all mobs in the area to call Kid Snowman."); - cm.dispose(); - return; - } - - cm.getMap().spawnMonsterOnGroundBelow(9500317, 1700, 80); - } else if(selection == 1) { - if(cm.getMap().getMonsters().size() > 6) { //reactor as a monster? wtf - cm.sendOk("The place is too crowded right now. Eliminate some mobs before trying again."); - cm.dispose(); - return; - } - - cm.getMap().spawnMonsterOnGroundBelow(9500320, 1700, 80); - } else { - cm.sendOk("Fine then."); - } - - cm.dispose(); - } + +function start() { + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (status == 0 && mode == 0) { + cm.sendOk("Talk to me again when you want to."); + cm.dispose(); } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendSimple("#b#k\r\nA raid is nothing but many people joining up in an attempt to defeat extremely powerful creatures. Here is no different. Everyone can take part in defeating the spawned creature. What will you do?\r\n#b\r\n#L0#Spawn Kid Snowman.\r\n#L1#Spawn Lost Rudolph.\r\n#L2#Nothing, just chilling.#k"); + } else if (status == 1) { + if (selection == 0) { + if (cm.getMap().getMonsters().size() > 1) { //reactor as a monster? wtf + cm.sendOk("Eliminate all mobs in the area to call Kid Snowman."); + cm.dispose(); + return; + } + + cm.getMap().spawnMonsterOnGroundBelow(9500317, 1700, 80); + } else if (selection == 1) { + if (cm.getMap().getMonsters().size() > 6) { //reactor as a monster? wtf + cm.sendOk("The place is too crowded right now. Eliminate some mobs before trying again."); + cm.dispose(); + return; + } + + cm.getMap().spawnMonsterOnGroundBelow(9500320, 1700, 80); + } else { + cm.sendOk("Fine then."); + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9220005.js b/scripts/npc/9220005.js index 261d5f85cb..9ce87218e3 100644 --- a/scripts/npc/9220005.js +++ b/scripts/npc/9220005.js @@ -1,50 +1,48 @@ -/** -Roodolph - Happy ville -@author fantier123 -**/ +/** + Roodolph - Happy ville + @author fantier123 + **/ var status; -function start() { - status = 0; - action(1, 0, 0); -} -function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0) { - cm.sendOk("Talk to me again when you want to."); - cm.dispose(); - } - if (mode == 1) - status++; - else - status--; - - if (status == 1) { - if (cm.getChar().getMapId() == 209000000) { - cm.sendYesNo("Do you wish to head to where the #bSnow Sprinkler#k is?"); - status = 9; - } else if (cm.getChar().getMapId() == 209080000) { - cm.sendYesNo("Do you wish to return to Happyville?"); - status = 19; - } - else { - cm.sendOk("You alright?"); - cm.dispose(); - } - } - else if (status == 10) { - cm.warp(209080000, 0); - cm.dispose(); - } - else if (status == 20) { - cm.warp(209000000, 0); - cm.dispose(); - } - - else { - cm.sendOk("You alrighty?"); - cm.dispose(); - } + +function start() { + status = 0; + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0) { + cm.sendOk("Talk to me again when you want to."); + cm.dispose(); } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 1) { + if (cm.getChar().getMapId() == 209000000) { + cm.sendYesNo("Do you wish to head to where the #bSnow Sprinkler#k is?"); + status = 9; + } else if (cm.getChar().getMapId() == 209080000) { + cm.sendYesNo("Do you wish to return to Happyville?"); + status = 19; + } else { + cm.sendOk("You alright?"); + cm.dispose(); + } + } else if (status == 10) { + cm.warp(209080000, 0); + cm.dispose(); + } else if (status == 20) { + cm.warp(209000000, 0); + cm.dispose(); + } else { + cm.sendOk("You alrighty?"); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9220005_old.js b/scripts/npc/9220005_old.js index b67e6cc19d..f5a695609d 100644 --- a/scripts/npc/9220005_old.js +++ b/scripts/npc/9220005_old.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Roudolph Happyville Warp NPC @author Moogra */ @@ -28,7 +29,8 @@ function start() { } function action(mode, type, selection) { - if (mode > 0) + if (mode > 0) { cm.warp(209080000, 0); + } cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9220018.js b/scripts/npc/9220018.js index fb71ce3731..2bbfe5a6ac 100644 --- a/scripts/npc/9220018.js +++ b/scripts/npc/9220018.js @@ -22,70 +22,70 @@ * @author: Ronan * @npc: Charles * @func: Treasure PQ -*/ + */ var status = 0; var em = null; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - em = cm.getEventManager("TreasurePQ"); - if(em == null) { - cm.sendOk("The Treasure PQ has encountered an error."); - cm.dispose(); - return; - } else if(cm.isUsingOldPqNpcStyle()) { - action(1, 0, 0); - return; - } - - cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any further because of the extremely dangerous creatures lying ahead. Would you like to collaborate with party members to complete the quest? If so, please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); - } else if (status == 1) { - if (selection == 0) { - if (cm.getParty() == null) { - cm.sendOk("You can participate in the party quest only if you are in a party."); - cm.dispose(); - } else if(!cm.isLeader()) { - cm.sendOk("Your party leader must talk to me to start this party quest."); - cm.dispose(); - } else { - var eli = em.getEligibleParty(cm.getParty()); - if(eli.size() > 0) { - if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { - cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); - } - } - else { - cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); - } - - cm.dispose(); - } - } else if (selection == 1) { - var psState = cm.getPlayer().toggleRecvPartySearchInvite(); - cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); - cm.dispose(); - } else { - cm.sendOk("#e#b#k#n\r\nMV appeared once more, disrupting the welfare of the people of New Leaf City. Join forces with other maplers to fend off this sudden attack. After defeating MV and his minions, fetch your prizes at MV's treasure room."); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + em = cm.getEventManager("TreasurePQ"); + if (em == null) { + cm.sendOk("The Treasure PQ has encountered an error."); + cm.dispose(); + return; + } else if (cm.isUsingOldPqNpcStyle()) { + action(1, 0, 0); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any further because of the extremely dangerous creatures lying ahead. Would you like to collaborate with party members to complete the quest? If so, please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I would like to " + (cm.getPlayer().isRecvPartySearchInviteEnabled() ? "disable" : "enable") + " Party Search.\r\n#L2#I would like to hear more details."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if (!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if (eli.size() > 0) { + if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + var psState = cm.getPlayer().toggleRecvPartySearchInvite(); + cm.sendOk("Your Party Search status is now: #b" + (psState ? "enabled" : "disabled") + "#k. Talk to me whenever you want to change it back."); + cm.dispose(); + } else { + cm.sendOk("#e#b#k#n\r\nMV appeared once more, disrupting the welfare of the people of New Leaf City. Join forces with other maplers to fend off this sudden attack. After defeating MV and his minions, fetch your prizes at MV's treasure room."); + cm.dispose(); + } + } + } } \ No newline at end of file diff --git a/scripts/npc/9220019.js b/scripts/npc/9220019.js index 08fc4e5278..50adc97fb3 100644 --- a/scripts/npc/9220019.js +++ b/scripts/npc/9220019.js @@ -19,41 +19,42 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - var mapid = cm.getMapId(); - if(mapid == 674030100) { - cm.sendNext("Hi, I'm #p9220019#."); - cm.dispose(); - return; - } else if(mapid == 674030300) { - cm.sendNext("Hi there, #h0#. This is the MV's treasure room. Use the time you have here to do whatever you want, there are a lot of things to uncover here, actually. Or else you can use the portal here to #rgo back#k to the entrance."); - cm.dispose(); - return; - } - - cm.sendYesNo("Are you sure you want to return? By returning now you are leaving your partners behind, do you really want to do it?"); - } else if(status == 1) { - cm.warp(674030100); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var mapid = cm.getMapId(); + if (mapid == 674030100) { + cm.sendNext("Hi, I'm #p9220019#."); + cm.dispose(); + return; + } else if (mapid == 674030300) { + cm.sendNext("Hi there, #h0#. This is the MV's treasure room. Use the time you have here to do whatever you want, there are a lot of things to uncover here, actually. Or else you can use the portal here to #rgo back#k to the entrance."); + cm.dispose(); + return; + } + + cm.sendYesNo("Are you sure you want to return? By returning now you are leaving your partners behind, do you really want to do it?"); + } else if (status == 1) { + cm.warp(674030100); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9220020.js b/scripts/npc/9220020.js index 4c0a9a131b..20a80c8096 100644 --- a/scripts/npc/9220020.js +++ b/scripts/npc/9220020.js @@ -19,50 +19,51 @@ */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - if(!cm.isEventLeader()) { - cm.sendNext("Please let your party leader talk to me for further instructions to proceed to the next stage."); - cm.dispose(); - return; - } - - var eim = cm.getEventInstance(); - if(eim.getIntProperty("statusStg1") == 1) { - cm.sendNext("Go through this tunnel for the boss battle."); - } else { - if(cm.haveItem(4032118, 15)) { - cm.gainItem(4032118, -15); - - eim.setIntProperty("statusStg1", 1); - eim.showClearEffect(); - eim.giveEventPlayersStageReward(1); - - cm.sendNext("You got the letters, great! Now, you can proceed to the room MV is through this tunnel. Be prepared!"); - } else { - cm.sendNext("Please hand me #r15 secret letters#k."); - } - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + if (!cm.isEventLeader()) { + cm.sendNext("Please let your party leader talk to me for further instructions to proceed to the next stage."); + cm.dispose(); + return; + } + + var eim = cm.getEventInstance(); + if (eim.getIntProperty("statusStg1") == 1) { + cm.sendNext("Go through this tunnel for the boss battle."); + } else { + if (cm.haveItem(4032118, 15)) { + cm.gainItem(4032118, -15); + + eim.setIntProperty("statusStg1", 1); + eim.showClearEffect(); + eim.giveEventPlayersStageReward(1); + + cm.sendNext("You got the letters, great! Now, you can proceed to the room MV is through this tunnel. Be prepared!"); + } else { + cm.sendNext("Please hand me #r15 secret letters#k."); + } + } + + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9250045.js b/scripts/npc/9250045.js index 4a3e59167b..30d6f5bdc7 100644 --- a/scripts/npc/9250045.js +++ b/scripts/npc/9250045.js @@ -1,9 +1,9 @@ //Perion Maple TV function start() { - action(1, 0, 0); + action(1, 0, 0); } function action(mode, type, selection) { - cm.dispose(); //What the fuck + cm.dispose(); //What the fuck } \ No newline at end of file diff --git a/scripts/npc/9270017.js b/scripts/npc/9270017.js index 64127f0633..e37ec9ac34 100644 --- a/scripts/npc/9270017.js +++ b/scripts/npc/9270017.js @@ -20,15 +20,15 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Xinga - Pilot --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Information - 2.0 - Second Version by Jayd ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Xinga - Pilot + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Information + 2.0 - Second Version by Jayd + --------------------------------------------------------------------------------------------------- + **/ var status = 0; @@ -38,16 +38,17 @@ function start() { function action(mode, type, selection) { if (mode != 1) { - if (mode == 0) + if (mode == 0) { cm.sendOk("Please hold on for a sec, and plane will be taking off. Thanks for your patience."); + } cm.dispose(); return; } status++; if (status == 1) { cm.sendNext("The ticket is not refundable, hope to see you again!"); - } else if(status == 2){ - cm.warp(103000000); - cm.dispose(); + } else if (status == 2) { + cm.warp(103000000); + cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9270018.js b/scripts/npc/9270018.js index d21c82daeb..fc0a3b73a4 100644 --- a/scripts/npc/9270018.js +++ b/scripts/npc/9270018.js @@ -20,69 +20,69 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Kerny - Pilot --- By --------------------------------------------------------------------------------------------- - Information --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Information - 2.0 - Second Version by Jayd ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Kerny - Pilot + -- By --------------------------------------------------------------------------------------------- + Information + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Information + 2.0 - Second Version by Jayd + --------------------------------------------------------------------------------------------------- + **/ var k2s; var airport; var s2k; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if(mode == -1) { - cm.dispose(); - return; - } - if(mode == 1) { - status++; - } - if(mode == 0) { - if (cm.getMapId() == 540010101) { - cm.sendOk("Please hold on for a sec, and we're reaching Singapore! Thanks for your patience."); - cm.dispose(); - return; - } else { - cm.sendOk("Please hold on for a sec, and we're reaching Kerning City! Thanks for your patience."); - cm.dispose(); - return; - } - } - if(status == 0) { - if (cm.getMapId() == 540010001) { - cm.sendYesNo("The plane is taking off soon, are you sure you want to leave now? The ticket is not refundable."); - airport = 1; - } else if (cm.getMapId() == 540010002) { - cm.sendOk("We're reaching Kerning City in a minute, please sit down and wait."); - cm.dispose(); - s2k = 1; - } else if (cm.getMapId() == 540010101) { - cm.sendOk("We're reaching Singapore in a minute, please sit down and wait."); - cm.dispose(); - k2s = 1; - } - } else if(status == 1) { - if (k2s == 1) { - cm.warp(103000000); - cm.sendOk("Hope to see you again soon!"); - cm.dispose(); - } else if (airport == 1) { - cm.warp(540010000); - cm.sendOk("Hope to see you again soon!"); - cm.dispose(); - } else if (s2k == 1) { - cm.warp(540010000); - cm.sendOk("Hope to see you again soon!"); - cm.dispose(); - } - } + if (mode == -1) { + cm.dispose(); + return; + } + if (mode == 1) { + status++; + } + if (mode == 0) { + if (cm.getMapId() == 540010101) { + cm.sendOk("Please hold on for a sec, and we're reaching Singapore! Thanks for your patience."); + cm.dispose(); + return; + } else { + cm.sendOk("Please hold on for a sec, and we're reaching Kerning City! Thanks for your patience."); + cm.dispose(); + return; + } + } + if (status == 0) { + if (cm.getMapId() == 540010001) { + cm.sendYesNo("The plane is taking off soon, are you sure you want to leave now? The ticket is not refundable."); + airport = 1; + } else if (cm.getMapId() == 540010002) { + cm.sendOk("We're reaching Kerning City in a minute, please sit down and wait."); + cm.dispose(); + s2k = 1; + } else if (cm.getMapId() == 540010101) { + cm.sendOk("We're reaching Singapore in a minute, please sit down and wait."); + cm.dispose(); + k2s = 1; + } + } else if (status == 1) { + if (k2s == 1) { + cm.warp(103000000); + cm.sendOk("Hope to see you again soon!"); + cm.dispose(); + } else if (airport == 1) { + cm.warp(540010000); + cm.sendOk("Hope to see you again soon!"); + cm.dispose(); + } else if (s2k == 1) { + cm.warp(540010000); + cm.sendOk("Hope to see you again soon!"); + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/9270023.js b/scripts/npc/9270023.js index 1ee68efdd0..2afa7bd765 100644 --- a/scripts/npc/9270023.js +++ b/scripts/npc/9270023.js @@ -44,33 +44,39 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 1) { if (!cm.haveItem(5152037)) { cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you..."); cm.dispose(); return; } - + facenew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mface_r.length; i++) - pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100)); - if (cm.getPlayer().getGender() == 1) - for(var i = 0; i < fface_r.length; i++) - pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100)); + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mface_r.length; i++) { + pushIfItemExists(facenew, mface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } + if (cm.getPlayer().getGender() == 1) { + for (var i = 0; i < fface_r.length; i++) { + pushIfItemExists(facenew, fface_r[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } + } cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152037##k?"); - } else if (status == 2){ - cm.gainItem(5152037 , -1); + } else if (status == 2) { + cm.gainItem(5152037, -1); cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]); cm.sendOk("Enjoy your new and improved face!"); - + cm.dispose(); } } diff --git a/scripts/npc/9270024.js b/scripts/npc/9270024.js index 60e3401dfe..0a923627e1 100644 --- a/scripts/npc/9270024.js +++ b/scripts/npc/9270024.js @@ -43,13 +43,15 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { cm.sendSimple("Let's see...I can totally transform your face into something new. Don't you want to try it? For #b#t5152038##k, you can get the face of your liking. Take your time in choosing the face of your preference...\r\n\#L2#Let me get my dream face! (Uses #i5152038# #t5152038#)#l"); } else if (status == 1) { @@ -58,24 +60,24 @@ function action(mode, type, selection) { cm.dispose(); return; } - + facenew = Array(); if (cm.getPlayer().getGender() == 0) { - for(var i = 0; i < mface_v.length; i++) - pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100)); + for (var i = 0; i < mface_v.length; i++) { + pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); + } } if (cm.getPlayer().getGender() == 1) { - for(var i = 0; i < fface_v.length; i++) { - pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100)); + for (var i = 0; i < fface_v.length; i++) { + pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100)); } } cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152038##k, you can get the face of your liking. Take your time in choosing the face of your preference...", facenew); - } - else if (status == 2){ + } else if (status == 2) { cm.gainItem(5152038, -1); cm.setFace(facenew[selection]); cm.sendOk("Enjoy your new and improved face!"); - + cm.dispose(); } } diff --git a/scripts/npc/9270025.js b/scripts/npc/9270025.js index fe61dfe657..b6893180ae 100644 --- a/scripts/npc/9270025.js +++ b/scripts/npc/9270025.js @@ -33,29 +33,29 @@ function start() { function action(mode, type, selection) { if (mode < 1) // disposing issue with stylishs found thanks to Vcoc + { cm.dispose(); - else { - if (mode == 1) - status++; - else - status--; - + } else { + if (mode == 1) { + status++; + } else { + status--; + } + if (status == 0) { cm.sendSimple("Well, hello! Welcome to the Lian Hua Hua Skin-Care! Would you like to have a firm, tight, healthy looking skin like mine? With #b#tCBD Skin Coupon##k, you can let us take care of the rest and have the kind of skin you've always wanted!\r\n\#L1#Sounds Good! (uses #i5153010# #t5153010#)#l"); - } - else if (status == 1) { + } else if (status == 1) { if (!cm.haveItem(5153010)) { cm.sendOk("It looks like you don't have the coupon you need to receive the treatment. I'm sorry but it looks like we cannot do it for you."); cm.dispose(); return; } cm.sendStyle("With our specialized service, you can see the way you'll look after the treatment in advance. What kind of a skin-treatment would you like to do? Go ahead and choose the style of your liking...", skin); - } - else { + } else { cm.gainItem(5153010, -1); cm.setSkin(selection); cm.sendOk("Enjoy your new and improved skin!"); - + cm.dispose(); } } diff --git a/scripts/npc/9270026.js b/scripts/npc/9270026.js index 9dbc3a6629..04adaba6e5 100644 --- a/scripts/npc/9270026.js +++ b/scripts/npc/9270026.js @@ -36,7 +36,7 @@ function pushIfItemExists(array, itemid) { function pushIfItemsExists(array, itemidList) { for (var i = 0; i < itemidList.length; i++) { var itemid = itemidList[i]; - + if ((itemid = cm.getCosmeticItem(itemid)) != -1 && !cm.isCosmeticEquipped(itemid)) { array.push(itemid); } @@ -48,66 +48,67 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; if (status == 1) { if (selection == 1) { beauty = 1; - var current = cm.getPlayer().getFace()% 100 + 20000 + cm.getPlayer().getGender() * 1000; + var current = cm.getPlayer().getFace() % 100 + 20000 + cm.getPlayer().getGender() * 1000; cm.sendYesNo("If you use the regular coupon, you'll be awarded a random pair of cosmetic lenses. Are you going to use a #b#t5152039##k and really make the change to your eyes?"); } else if (selection == 2) { beauty = 2; - var current = cm.getPlayer().getFace()% 100 + 20000 + cm.getPlayer().getGender() * 1000; - pushIfItemsExists(colors, [current + 200, current + 300, current +400, current + 700]); + var current = cm.getPlayer().getFace() % 100 + 20000 + cm.getPlayer().getGender() * 1000; + pushIfItemsExists(colors, [current + 200, current + 300, current + 400, current + 700]); cm.sendStyle("With our specialized machine, you can see yourself after the treatment in advance. What kind of lens would you like to wear? Choose the style of your liking.", colors); } else if (selection == 3) { beauty = 3; if (cm.getPlayer().getGender() == 0) { var current = cm.getPlayer().getFace() - % 100 + 20000; + % 100 + 20000; } if (cm.getPlayer().getGender() == 1) { var current = cm.getPlayer().getFace() - % 100 + 21000; + % 100 + 21000; } - + colors = Array(); for (var i = 0; i < 8; i++) { if (cm.haveItem(5152100 + i)) { pushIfItemExists(colors, current + 100 * i); } } - + if (colors.length == 0) { cm.sendOk("You don't have any One-Time Cosmetic Lens to use."); cm.dispose(); return; } - + cm.sendStyle("What kind of lens would you like to wear? Please choose the style of your liking.", colors); } - } - else if (status == 2) { - if (beauty == 1){ - if (cm.haveItem(5152039)){ + } else if (status == 2) { + if (beauty == 1) { + if (cm.haveItem(5152039)) { cm.gainItem(5152039, -1); cm.setFace(Math.floor(Math.random() * 8) * 100 + current); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else + } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); - } else if (beauty == 2){ - if (cm.haveItem(5152040)){ + } + } else if (beauty == 2) { + if (cm.haveItem(5152040)) { cm.gainItem(5152040, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); - } else + } else { cm.sendOk("I'm sorry, but I don't think you have our cosmetic lens coupon with you right now. Without the coupon, I'm afraid I can't do it for you.."); - } else if (beauty == 3){ + } + } else if (beauty == 3) { var color = (colors[selection] / 100) % 100 | 0; - - if (cm.haveItem(5152100 + color)){ + + if (cm.haveItem(5152100 + color)) { cm.gainItem(5152100 + color, -1); cm.setFace(colors[selection]); cm.sendOk("Enjoy your new and improved cosmetic lenses!"); diff --git a/scripts/npc/9270031.js b/scripts/npc/9270031.js index 8901c233e4..891b1d319b 100644 --- a/scripts/npc/9270031.js +++ b/scripts/npc/9270031.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Dave & Iris () diff --git a/scripts/npc/9270033.js b/scripts/npc/9270033.js index 186a9d1c41..e472f17cdc 100644 --- a/scripts/npc/9270033.js +++ b/scripts/npc/9270033.js @@ -27,41 +27,42 @@ var eim; var status = 0; function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && status == 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - eim = cm.getEventInstance(); - if(status == 0) { - if(!eim.isEventCleared()) { - cm.sendYesNo("Are you ready to leave this place?"); - } else { - cm.sendYesNo("You have defeated Capt. Latanica, well done! Are you ready to leave this place?"); - } - } else if(status == 1) { - if(eim.isEventCleared()) { - if(!eim.giveEventReward(cm.getPlayer())) { - cm.sendOk("Please make a room on your inventory to receive the loot."); - cm.dispose(); - return; - } - } - - cm.warp(541010110, 0); - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + eim = cm.getEventInstance(); + if (status == 0) { + if (!eim.isEventCleared()) { + cm.sendYesNo("Are you ready to leave this place?"); + } else { + cm.sendYesNo("You have defeated Capt. Latanica, well done! Are you ready to leave this place?"); + } + } else if (status == 1) { + if (eim.isEventCleared()) { + if (!eim.giveEventReward(cm.getPlayer())) { + cm.sendOk("Please make a room on your inventory to receive the loot."); + cm.dispose(); + return; + } + } + + cm.warp(541010110, 0); + cm.dispose(); + } + } } diff --git a/scripts/npc/9270036.js b/scripts/npc/9270036.js index dd5b5b8a05..b10867da82 100644 --- a/scripts/npc/9270036.js +++ b/scripts/npc/9270036.js @@ -42,43 +42,49 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; if (selection == 1) { beauty = 1; hairnew = Array(); - if (cm.getPlayer().getGender() == 0) - for(var i = 0; i < mhair_v.length; i++) - pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); - else - for(var i = 0; i < fhair_v.length; i++) - pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair()% 10)); + if (cm.getPlayer().getGender() == 0) { + for (var i = 0; i < mhair_v.length; i++) { + pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } else { + for (var i = 0; i < fhair_v.length; i++) { + pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getPlayer().getHair() % 10)); + } + } cm.sendStyle("I can completely change the look of your hair. Aren't you ready for a change? With #b#t5150033##k, I'll take care of the rest for you. Choose the style of your liking!", hairnew); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); + } cm.sendStyle("I can completely change the look of your hair. Aren't you ready for a change? With #b#t5151028##k, I'll take care of the rest. Choose the color of your liking!", haircolor); } else if (status == 2) { - if (beauty == 1){ - if (cm.haveItem(5150033)){ + if (beauty == 1) { + if (cm.haveItem(5150033)) { cm.gainItem(5150033, -1); cm.setHair(hairnew[selection]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry."); + } } - if (beauty == 2){ - if (cm.haveItem(5151028)){ + if (beauty == 2) { + if (cm.haveItem(5151028)) { cm.gainItem(5151028, -1); cm.setHair(haircolor[selection]); cm.sendOk("Enjoy your new and improved haircolor!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry."); + } } cm.dispose(); } diff --git a/scripts/npc/9270037.js b/scripts/npc/9270037.js index 7ab584bfba..cec8b72c35 100644 --- a/scripts/npc/9270037.js +++ b/scripts/npc/9270037.js @@ -43,39 +43,43 @@ function start() { } function action(mode, type, selection) { - if (mode < 1) + if (mode < 1) { cm.dispose(); - else { + } else { status++; if (selection == 1) { beauty = 1; hairnew = Array(); - for (var id = 0; id < cm.getPlayer().getGender() == 0 ? mhair_r.length : fhair_r.length; id++) - pushIfItemExists(hairnew, cm.getPlayer().getGender == 0 ? mhair_r[i] : fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + for (var id = 0; id < cm.getPlayer().getGender() == 0 ? mhair_r.length : fhair_r.length; id++) { + pushIfItemExists(hairnew, cm.getPlayer().getGender == 0 ? mhair_r[i] : fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10)); + } cm.sendYesNo("If you use the REG coupon your hair will change RANDOMLY with a chance to obtain a new experimental style that I came up with. Are you going to use #b#t5150032##k and really change your hairstyle?"); } else if (selection == 2) { beauty = 2; haircolor = Array(); - var current = parseInt(cm.getPlayer().getHair()/10)*10; - for(var i = 0; i < 8; i++) + var current = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var i = 0; i < 8; i++) { pushIfItemExists(haircolor, current + i); + } cm.sendYesNo("If you use the REG coupon your hair will change RANDOMLY. Do you still want to use #b#t5151027##k and change it up?"); } else if (status == 2) { - if (beauty == 1){ - if (cm.haveItem(5150032)){ + if (beauty == 1) { + if (cm.haveItem(5150032)) { cm.gainItem(5150032, -1); cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]); cm.sendOk("Enjoy your new and improved hairstyle!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry..."); + } } - if (beauty == 2){ - if (cm.haveItem(5151027)){ + if (beauty == 2) { + if (cm.haveItem(5151027)) { cm.gainItem(5151027, -1); cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]); cm.sendOk("Enjoy your new and improved haircolor!"); - } else + } else { cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry..."); + } } cm.dispose(); } diff --git a/scripts/npc/9270038.js b/scripts/npc/9270038.js index dd521701f5..9d9ca83e3f 100644 --- a/scripts/npc/9270038.js +++ b/scripts/npc/9270038.js @@ -20,15 +20,15 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Shalon - Ticketing Usher --- By --------------------------------------------------------------------------------------------- - Whoever written this script --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Whoever written this script - 2.0 - Second Version by Jayd ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Shalon - Ticketing Usher + -- By --------------------------------------------------------------------------------------------- + Whoever written this script + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Whoever written this script + 2.0 - Second Version by Jayd + --------------------------------------------------------------------------------------------------- + **/ status = -1; oldSelection = -1; @@ -38,49 +38,48 @@ function start() { } function action(mode, type, selection) { - status++; - if (mode <= 0){ - oldSelection = -1; - cm.dispose(); - } - - if(status == 0){ - if(selection == 0){ - cm.sendYesNo("The ticket will cost you 5,000 mesos. Will you purchase the ticket?"); - }else if(selection == 1){ - cm.sendYesNo("Would you like to go in now? You will lose your ticket once you go in! Thank you for choosing Wizet Airline."); - } - oldSelection = selection; - }else if(status == 1){ - if(oldSelection == 0){ - if (cm.getPlayer().getMeso() > 4999 && !cm.getPlayer().haveItem(4031732)) { - if(cm.getPlayer().canHold(4031732, 1)) { - cm.gainMeso(-5000); - cm.gainItem(4031732); - cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!"); - cm.dispose(); - } - else { - cm.sendOk("You don't have a free slot on your ETC inventory for the ticket, please make a room beforehand."); - cm.dispose(); - } - } else { - cm.sendOk("You do not have enough mesos or you've already purchased a ticket."); - cm.dispose(); - } - }else if(oldSelection == 1){ - if(cm.itemQuantity(4031732) > 0){ - var em = cm.getEventManager("AirPlane"); - if(em.getProperty("entry") == "true"){ - cm.warp(540010001); - cm.gainItem(4031732, -1); - }else{ - cm.sendOk("Sorry the plane has taken off, please wait a few minutes."); - } - }else{ - cm.sendOk("You need a #b#t4031732##k to get on the plane!"); - } - } - cm.dispose(); - } + status++; + if (mode <= 0) { + oldSelection = -1; + cm.dispose(); + } + + if (status == 0) { + if (selection == 0) { + cm.sendYesNo("The ticket will cost you 5,000 mesos. Will you purchase the ticket?"); + } else if (selection == 1) { + cm.sendYesNo("Would you like to go in now? You will lose your ticket once you go in! Thank you for choosing Wizet Airline."); + } + oldSelection = selection; + } else if (status == 1) { + if (oldSelection == 0) { + if (cm.getPlayer().getMeso() > 4999 && !cm.getPlayer().haveItem(4031732)) { + if (cm.getPlayer().canHold(4031732, 1)) { + cm.gainMeso(-5000); + cm.gainItem(4031732); + cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!"); + cm.dispose(); + } else { + cm.sendOk("You don't have a free slot on your ETC inventory for the ticket, please make a room beforehand."); + cm.dispose(); + } + } else { + cm.sendOk("You do not have enough mesos or you've already purchased a ticket."); + cm.dispose(); + } + } else if (oldSelection == 1) { + if (cm.itemQuantity(4031732) > 0) { + var em = cm.getEventManager("AirPlane"); + if (em.getProperty("entry") == "true") { + cm.warp(540010001); + cm.gainItem(4031732, -1); + } else { + cm.sendOk("Sorry the plane has taken off, please wait a few minutes."); + } + } else { + cm.sendOk("You need a #b#t4031732##k to get on the plane!"); + } + } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9270041.js b/scripts/npc/9270041.js index 2960b65e51..babb4b5544 100644 --- a/scripts/npc/9270041.js +++ b/scripts/npc/9270041.js @@ -20,15 +20,15 @@ */ /** --- Odin JavaScript -------------------------------------------------------------------------------- - Irene - Ticketing Usher --- By --------------------------------------------------------------------------------------------- - Whoever written this script --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Whoever written this script - 2.0 - Second Version by Jayd ---------------------------------------------------------------------------------------------------- -**/ + -- Odin JavaScript -------------------------------------------------------------------------------- + Irene - Ticketing Usher + -- By --------------------------------------------------------------------------------------------- + Whoever written this script + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Whoever written this script + 2.0 - Second Version by Jayd + --------------------------------------------------------------------------------------------------- + **/ status = -1; oldSelection = -1; @@ -38,49 +38,48 @@ function start() { } function action(mode, type, selection) { - status++; - if (mode <= 0){ - oldSelection = -1; - cm.dispose(); - } - - if(status == 0){ - if(selection == 0){ - cm.sendYesNo("The ticket will cost you 5,000 mesos. Will you purchase the ticket?"); - }else if(selection == 1){ - cm.sendYesNo("Would you like to go in now? You will lose your ticket once you go in! Thank you for choosing Wizet Airline."); - } - oldSelection = selection; - }else if(status == 1){ - if(oldSelection == 0){ - if (cm.getPlayer().getMeso() > 4999 && !cm.getPlayer().haveItem(4031731)) { - if(cm.canHold(4031731, 1)) { - cm.gainMeso(-5000); - cm.gainItem(4031731); - cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!"); - cm.dispose(); - } - else { - cm.sendOk("You don't have a free slot on your ETC inventory for the ticket, please make a room beforehand."); - cm.dispose(); - } - } else { - cm.sendOk("You do not have enough mesos or you've already purchased a ticket."); - cm.dispose(); - } - }else if(oldSelection == 1){ - if(cm.itemQuantity(4031731) > 0){ - var em = cm.getEventManager("AirPlane"); - if(em.getProperty("entry") == "true"){ - cm.warp(540010100); - cm.gainItem(4031731, -1); - }else{ - cm.sendOk("Sorry the plane has taken off, please wait a few minutes."); - } - }else{ - cm.sendOk("You need a #b#t4031731##k to get on the plane!"); - } - } - cm.dispose(); - } + status++; + if (mode <= 0) { + oldSelection = -1; + cm.dispose(); + } + + if (status == 0) { + if (selection == 0) { + cm.sendYesNo("The ticket will cost you 5,000 mesos. Will you purchase the ticket?"); + } else if (selection == 1) { + cm.sendYesNo("Would you like to go in now? You will lose your ticket once you go in! Thank you for choosing Wizet Airline."); + } + oldSelection = selection; + } else if (status == 1) { + if (oldSelection == 0) { + if (cm.getPlayer().getMeso() > 4999 && !cm.getPlayer().haveItem(4031731)) { + if (cm.canHold(4031731, 1)) { + cm.gainMeso(-5000); + cm.gainItem(4031731); + cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!"); + cm.dispose(); + } else { + cm.sendOk("You don't have a free slot on your ETC inventory for the ticket, please make a room beforehand."); + cm.dispose(); + } + } else { + cm.sendOk("You do not have enough mesos or you've already purchased a ticket."); + cm.dispose(); + } + } else if (oldSelection == 1) { + if (cm.itemQuantity(4031731) > 0) { + var em = cm.getEventManager("AirPlane"); + if (em.getProperty("entry") == "true") { + cm.warp(540010100); + cm.gainItem(4031731, -1); + } else { + cm.sendOk("Sorry the plane has taken off, please wait a few minutes."); + } + } else { + cm.sendOk("You need a #b#t4031731##k to get on the plane!"); + } + } + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/9270043.js b/scripts/npc/9270043.js index 0975bcb503..5cd2a560c2 100644 --- a/scripts/npc/9270043.js +++ b/scripts/npc/9270043.js @@ -21,7 +21,7 @@ */ //Gachapon -var ids = [2000004,2020012,2000005,2030007,2022027,2040001,2041002, 2040805, 2040702, 2043802, 2040402, 2043702, 1302022, 1322021, 1322026, 1302026, 1442017, 1082147, 1102043, 1442016, 1402012, 1302027, 1322027, 1322025, 1312012, 1062000, 1332020, 1302028, 1372002, 1002033, 1092022, 1302021, 1102041, 1102042, 1322024, 1082148, 1002012, 1322012, 1322022, 1002020, 1302013, 1082146, 1442014, 1002096, 1302017, 1442012, 1322010, 1442011, 1442018, 1092011, 1092014, 1302003, 1432001, 1312011, 1002088, 1041020, 1322015, 1442004, 1422008, 1302056, 1432000, 1382001, 1041053, 1060014, 1050053, 1051032, 1050073, 1061036, 1002253, 1002034, 1051025, 1050067, 1051052, 1002072, 1002144, 1051054, 1050069, 1372007, 1050056, 1050074, 1002254, 1002274, 1002218, 1051055, 1382010, 1002246, 1050039, 1382007, 1372000, 1002013, 1050072, 1002036, 1002243, 1372008, 1382008, 1382011, 1092021, 1051034, 1050047, 1040019, 1041031, 1051033, 1002153, 1002252, 1051024, 1002153, 1050068, 1382003, 1382006, 1050055, 1051031, 1050025, 1002155, 1002245, 1452004, 1452023, 1060057, 1040071, 1002137, 1462009, 1452017, 1040025, 1041027, 1452005, 1452007, 1061057, 1472006, 1472019, 1060084, 1472028, 1002179, 1082074, 1332015, 1432001, 1060071, 1472007, 1472002, 1051009, 1061037, 1332016, 1332034, 1472020, 1102084, 1102086, 1102042, 1032026, 1082149]; +var ids = [2000004, 2020012, 2000005, 2030007, 2022027, 2040001, 2041002, 2040805, 2040702, 2043802, 2040402, 2043702, 1302022, 1322021, 1322026, 1302026, 1442017, 1082147, 1102043, 1442016, 1402012, 1302027, 1322027, 1322025, 1312012, 1062000, 1332020, 1302028, 1372002, 1002033, 1092022, 1302021, 1102041, 1102042, 1322024, 1082148, 1002012, 1322012, 1322022, 1002020, 1302013, 1082146, 1442014, 1002096, 1302017, 1442012, 1322010, 1442011, 1442018, 1092011, 1092014, 1302003, 1432001, 1312011, 1002088, 1041020, 1322015, 1442004, 1422008, 1302056, 1432000, 1382001, 1041053, 1060014, 1050053, 1051032, 1050073, 1061036, 1002253, 1002034, 1051025, 1050067, 1051052, 1002072, 1002144, 1051054, 1050069, 1372007, 1050056, 1050074, 1002254, 1002274, 1002218, 1051055, 1382010, 1002246, 1050039, 1382007, 1372000, 1002013, 1050072, 1002036, 1002243, 1372008, 1382008, 1382011, 1092021, 1051034, 1050047, 1040019, 1041031, 1051033, 1002153, 1002252, 1051024, 1002153, 1050068, 1382003, 1382006, 1050055, 1051031, 1050025, 1002155, 1002245, 1452004, 1452023, 1060057, 1040071, 1002137, 1462009, 1452017, 1040025, 1041027, 1452005, 1452007, 1061057, 1472006, 1472019, 1060084, 1472028, 1002179, 1082074, 1332015, 1432001, 1060071, 1472007, 1472002, 1051009, 1061037, 1332016, 1332034, 1472020, 1102084, 1102086, 1102042, 1032026, 1082149]; var status = 0; function start() { @@ -29,14 +29,14 @@ function start() { cm.gainItem(5451000, -1); cm.doGachapon(); cm.dispose(); - } else if (cm.haveItem(5220000)) + } else if (cm.haveItem(5220000)) { cm.sendYesNo("You may use Gachapon. Would you like to use your Gachapon ticket?"); - else { + } else { cm.sendSimple("Welcome to the " + cm.getPlayer().getMap().getMapName() + " Gachapon. How may I help you?\r\n\r\n#L0#What is Gachapon?#l\r\n#L1#Where can you buy Gachapon tickets?#l"); } } -function action(mode, type, selection){ +function action(mode, type, selection) { if (mode == 1 && cm.haveItem(5220000)) { cm.doGachapon(); cm.dispose(); diff --git a/scripts/npc/9270047.js b/scripts/npc/9270047.js index d70ec6468a..f54e4d7521 100644 --- a/scripts/npc/9270047.js +++ b/scripts/npc/9270047.js @@ -82,12 +82,12 @@ function action(mode, type, selection) { } else if (expedition.isInProgress()) { //Only if the expedition is in progress if (expedition.contains(player)) { //If you're registered, warp you in var eim = em.getInstance(expedName + player.getClient().getChannel()); - if(eim.getIntProperty("canJoin") == 1) { + if (eim.getIntProperty("canJoin") == 1) { eim.registerPlayer(player); } else { cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls."); } - + cm.dispose(); } else { //If you're not in by now, tough luck cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); @@ -101,14 +101,14 @@ function action(mode, type, selection) { cm.dispose(); return; } - + expedition = cm.getExpedition(exped); - if(expedition != null) { + if (expedition != null) { cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!"); cm.dispose(); return; } - + var res = cm.createExpedition(exped); if (res == 0) { cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!"); @@ -117,13 +117,13 @@ function action(mode, type, selection) { } else { cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later."); } - + cm.dispose(); - return; + } else if (selection == 2) { cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + "."); cm.dispose(); - return; + } } else if (status == 2) { if (selection == 1) { @@ -154,7 +154,7 @@ function action(mode, type, selection) { cm.dispose(); return; } - + cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k."); status = 4; } else if (selection == 3) { @@ -163,7 +163,7 @@ function action(mode, type, selection) { cm.endExpedition(expedition); cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away."); cm.dispose(); - return; + } } else if (status == 4) { if (em == null) { @@ -174,14 +174,14 @@ function action(mode, type, selection) { em.setProperty("leader", player.getName()); em.setProperty("channel", player.getClient().getChannel()); - if(!em.startInstance(expedition)) { + if (!em.startInstance(expedition)) { cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls."); cm.dispose(); return; } - + cm.dispose(); - return; + } else if (status == 6) { if (selection > 0) { var banned = expedMembers.get(selection - 1); diff --git a/scripts/npc/9270054.js b/scripts/npc/9270054.js index 4d637d6100..6ef532baae 100644 --- a/scripts/npc/9270054.js +++ b/scripts/npc/9270054.js @@ -1,4 +1,4 @@ function start() { - cm.getPlayer().getStorage().sendStorage(cm.getClient(), 9270054); - cm.dispose(); + cm.getPlayer().getStorage().sendStorage(cm.getClient(), 9270054); + cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9310058.js b/scripts/npc/9310058.js index 5423859efd..8ac2c4e70b 100644 --- a/scripts/npc/9310058.js +++ b/scripts/npc/9310058.js @@ -1,8 +1,8 @@ -/** - Santa - Happyville -**/ +/** + Santa - Happyville + **/ function start() { - cm.sendOk("Welcome to #bHappyville#k, young traveler. Do you have any wishes?"); - cm.dispose(); + cm.sendOk("Welcome to #bHappyville#k, young traveler. Do you have any wishes?"); + cm.dispose(); } diff --git a/scripts/npc/9900000.js b/scripts/npc/9900000.js index 6407ca43f5..017ee3e08d 100644 --- a/scripts/npc/9900000.js +++ b/scripts/npc/9900000.js @@ -31,7 +31,7 @@ var status = 0; var beauty = 0; var haircolor = Array(); var skin = [0, 1, 2, 3, 4, 5, 9, 10]; -var fhair= [31000, 31010, 31020, 31030, 31040, 31050, 31060, 31070, 31080, 31090, 31100, 31110, 31120, 31130, 31140, 31150, 31160, 31170, 31180, 31190, 31200, 31210, 31220, 31230, 31240, 31250, 31260, 31270, 31280, 31290, 31300, 31310, 31320, 31330, 31340, 31350, 31400, 31410, 31420, 31440, 31450, 31460, 31470, 31480, 31490, 31510, 31520, 31530, 31540, 31550, 31560, 31570, 31580, 31590, 31600, 31610, 31620, 31630, 31640, 31650, 31670, 31660, 31680, 31690, 31700, 31710, 31720, 31730, 31740, 31750, 31760, 31770, 31780, 31790, 31800, 31810, 31820, 31830, 31840, 31850, 31860, 31870, 31880, 31890, 31910, 31920, 31930, 31940, 31950, 34010, 34020, 34030, 34050, 34110]; +var fhair = [31000, 31010, 31020, 31030, 31040, 31050, 31060, 31070, 31080, 31090, 31100, 31110, 31120, 31130, 31140, 31150, 31160, 31170, 31180, 31190, 31200, 31210, 31220, 31230, 31240, 31250, 31260, 31270, 31280, 31290, 31300, 31310, 31320, 31330, 31340, 31350, 31400, 31410, 31420, 31440, 31450, 31460, 31470, 31480, 31490, 31510, 31520, 31530, 31540, 31550, 31560, 31570, 31580, 31590, 31600, 31610, 31620, 31630, 31640, 31650, 31670, 31660, 31680, 31690, 31700, 31710, 31720, 31730, 31740, 31750, 31760, 31770, 31780, 31790, 31800, 31810, 31820, 31830, 31840, 31850, 31860, 31870, 31880, 31890, 31910, 31920, 31930, 31940, 31950, 34010, 34020, 34030, 34050, 34110]; var hair = [30000, 30010, 30020, 30030, 30040, 30050, 30060, 30070, 30080, 30090, 30110, 30120, 30130, 30140, 30150, 30160, 30170, 30180, 30190, 30200, 30210, 30220, 30230, 30240, 30250, 30260, 30270, 30280, 30290, 30300, 30310, 30320, 30330, 30340, 30350, 30360, 30370, 30400, 30410, 30420, 30440, 30450, 30460, 30470, 30480, 30490, 30510, 30520, 30530, 30540, 30550, 30560, 30570, 30580, 30590, 30600, 30610, 30620, 30630, 30640, 30650, 30660, 30670, 30680, 30690, 30700, 30710, 30720, 30730, 30740, 30750, 30760, 30770, 30780, 30790, 30800, 30810, 30820, 30830, 30840, 30860, 30870, 30880, 30890, 30900, 30910, 30920, 30930, 30940, 30950, 30990, 33000, 33040, 33100]; var hairnew = Array(); var face = [20000, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009, 20010, 20011, 20012, 20013, 20014, 20015, 20016, 20017, 20018, 20019, 20020, 20021, 20022, 20023, 20024, 20025, 20026, 20027, 20028, 20029, 20031, 20032]; @@ -47,75 +47,83 @@ function pushIfItemExists(array, itemid) { } function start() { - if(cm.getPlayer().gmLevel() < 1) { + if (cm.getPlayer().gmLevel() < 1) { cm.sendOk("Hey wassup?"); cm.dispose(); return; } - - if(cm.getPlayer().isMale()){ - cm.sendSimple("Hey there, you can change your look for " + price + " mesos. What would you like to change?\r\n#L0#Skin#l\r\n#L1#Male Hair#l\r\n#L2#Hair Color#l\r\n#L3#Male Regular Eyes#l\r\n#L4#Eye Color#l"); - }else{ - cm.sendSimple("Hey there, you can change your look for " + price + " mesos. What would you like to change?\r\n#L0#Skin#l\r\n#L5#Female Hair#l\r\n#L2#Hair Color#l\r\n#L6#Female Eyes#l\r\n#L4#Eye Color#l"); - } + + if (cm.getPlayer().isMale()) { + cm.sendSimple("Hey there, you can change your look for " + price + " mesos. What would you like to change?\r\n#L0#Skin#l\r\n#L1#Male Hair#l\r\n#L2#Hair Color#l\r\n#L3#Male Regular Eyes#l\r\n#L4#Eye Color#l"); + } else { + cm.sendSimple("Hey there, you can change your look for " + price + " mesos. What would you like to change?\r\n#L0#Skin#l\r\n#L5#Female Hair#l\r\n#L2#Hair Color#l\r\n#L6#Female Eyes#l\r\n#L4#Eye Color#l"); + } } function action(mode, type, selection) { status++; - if (mode != 1 || cm.getPlayer().gmLevel() < 1){ + if (mode != 1 || cm.getPlayer().gmLevel() < 1) { cm.dispose(); return; } if (status == 1) { beauty = selection + 1; - if(cm.getMeso() > price){ - if (selection == 0) - cm.sendStyle("Pick one?", skin); - else if (selection == 1 || selection == 5) { - for each(var i in selection == 1 ? hair : fhair) - pushIfItemExists(hairnew, i); - cm.sendStyle("Pick one?", hairnew); - } else if (selection == 2) { - var baseHair = parseInt(cm.getPlayer().getHair() / 10) * 10; - for(var k = 0; k < 8; k++) - pushIfItemExists(haircolor, baseHair + k); - cm.sendStyle("Pick one?", haircolor); - } else if (selection == 3 || selection == 6) { - for each(var j in selection == 3 ? face : fface) - pushIfItemExists(facenew, j); - cm.sendStyle("Pick one?", facenew); - } else if (selection == 4) { - var baseFace = parseInt(cm.getPlayer().getFace() / 1000) * 1000 + parseInt(cm.getPlayer().getFace() % 100); - for(var i = 0; i < 9; i++) - pushIfItemExists(colors, baseFace + (i*100)); - cm.sendStyle("Pick one?", colors); - } - } else { - cm.sendNext("You don't have enough mesos. Sorry to say this, but without " + price + " mesos, you won't be able to change your look!"); + if (cm.getMeso() > price) { + if (selection == 0) { + cm.sendStyle("Pick one?", skin); + } else if (selection == 1 || selection == 5) { + for each(var i + in + selection == 1 ? hair : fhair + ) + pushIfItemExists(hairnew, i); + cm.sendStyle("Pick one?", hairnew); + } else if (selection == 2) { + var baseHair = parseInt(cm.getPlayer().getHair() / 10) * 10; + for (var k = 0; k < 8; k++) { + pushIfItemExists(haircolor, baseHair + k); + } + cm.sendStyle("Pick one?", haircolor); + } else if (selection == 3 || selection == 6) { + for each(var j + in + selection == 3 ? face : fface + ) + pushIfItemExists(facenew, j); + cm.sendStyle("Pick one?", facenew); + } else if (selection == 4) { + var baseFace = parseInt(cm.getPlayer().getFace() / 1000) * 1000 + parseInt(cm.getPlayer().getFace() % 100); + for (var i = 0; i < 9; i++) { + pushIfItemExists(colors, baseFace + (i * 100)); + } + cm.sendStyle("Pick one?", colors); + } + } else { + cm.sendNext("You don't have enough mesos. Sorry to say this, but without " + price + " mesos, you won't be able to change your look!"); cm.dispose(); - } - - } else if (status == 2){ - if (beauty == 1){ + } + + } else if (status == 2) { + if (beauty == 1) { cm.setSkin(skin[selection]); - cm.gainMeso(-price); - } - if (beauty == 2 || beauty == 6){ + cm.gainMeso(-price); + } + if (beauty == 2 || beauty == 6) { cm.setHair(hairnew[selection]); - cm.gainMeso(-price); - } - if (beauty == 3){ + cm.gainMeso(-price); + } + if (beauty == 3) { cm.setHair(haircolor[selection]); - cm.gainMeso(-price); - } - if (beauty == 4 || beauty == 7){ + cm.gainMeso(-price); + } + if (beauty == 4 || beauty == 7) { cm.setFace(facenew[selection]); - cm.gainMeso(-price); - } - if (beauty == 5){ + cm.gainMeso(-price); + } + if (beauty == 5) { cm.setFace(colors[selection]); - cm.gainMeso(-price); - } + cm.gainMeso(-price); + } cm.dispose(); } } \ No newline at end of file diff --git a/scripts/npc/9900001.js b/scripts/npc/9900001.js index c5d17ce633..d42565daef 100644 --- a/scripts/npc/9900001.js +++ b/scripts/npc/9900001.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* * @Name KIN * @Author: Signalize @@ -26,12 +27,16 @@ * @Purpose: Levels people up. */ function start() { - if(cm.getPlayer().gmLevel() > 1) cm.sendYesNo("Do you want to level up?"); - else cm.sendOk("Hey wassup?"); + if (cm.getPlayer().gmLevel() > 1) { + cm.sendYesNo("Do you want to level up?"); + } else { + cm.sendOk("Hey wassup?"); + } } function action(i, am, pro) { - if (i > 0 && cm.getPlayer().gmLevel() > 1) + if (i > 0 && cm.getPlayer().gmLevel() > 1) { cm.getPlayer().levelUp(true); + } cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/9977777.js b/scripts/npc/9977777.js index bcabefea5b..ce1087771b 100644 --- a/scripts/npc/9977777.js +++ b/scripts/npc/9977777.js @@ -33,339 +33,340 @@ var feature_cursor; var tabs = ["PQs", "Skills", "Quests", "Player Social Network", "Cash & Items", "Monsters, Maps & Reactors", "PQ potentials", "Player potentials", "Server potentials", "Commands", "Custom NPCs", "Localhost edits", "Project"]; function addFeature(feature) { - feature_cursor.push(feature); + feature_cursor.push(feature); } function writeFeatureTab_PQs() { - addFeature("HPQ/KPQ/LPQ/LMPQ/OPQ/APQ/EllinPQ/PiratePQ."); - addFeature("RnJPQ/HorntailPQ/TreasurePQ/ElnathPQ/HolidayPQ."); - addFeature("CWKPQ as Expedition-based instance."); - addFeature("Scarga/Horntail/Showa/Balrog/Zakum/Pinkbean."); - addFeature("Expeditions with entry-limit system available."); - addFeature("GuildPQ & queue with multi-lobby system available."); - addFeature("Brand-new PQs: BossRushPQ, CafePQ."); - addFeature("Mu Lung Dojo."); - addFeature("Monster Carnival 1 & 2 - thanks Dragohe4rt & Jayd!"); - addFeature("AriantPQ - thanks Dragohe4rt & Jayd!"); - addFeature("Capt. Latanica with party fighting the boss."); - addFeature("Filled up missing obligatory event script methods."); - addFeature("Secured uniquety of active lobby-name instances."); + addFeature("HPQ/KPQ/LPQ/LMPQ/OPQ/APQ/EllinPQ/PiratePQ."); + addFeature("RnJPQ/HorntailPQ/TreasurePQ/ElnathPQ/HolidayPQ."); + addFeature("CWKPQ as Expedition-based instance."); + addFeature("Scarga/Horntail/Showa/Balrog/Zakum/Pinkbean."); + addFeature("Expeditions with entry-limit system available."); + addFeature("GuildPQ & queue with multi-lobby system available."); + addFeature("Brand-new PQs: BossRushPQ, CafePQ."); + addFeature("Mu Lung Dojo."); + addFeature("Monster Carnival 1 & 2 - thanks Dragohe4rt & Jayd!"); + addFeature("AriantPQ - thanks Dragohe4rt & Jayd!"); + addFeature("Capt. Latanica with party fighting the boss."); + addFeature("Filled up missing obligatory event script methods."); + addFeature("Secured uniquety of active lobby-name instances."); } function writeFeatureTab_Skills() { - addFeature("Reviewed many skills, such as Steal and M. Door."); - addFeature("Heal GMS-like: fixed HP gain & Heal skill packet."); - addFeature("Improved battleship: HP visible and map-persistent."); - addFeature("Maker skill features developed - pckts thanks Arnah."); - addFeature("Chair Mastery - map chair boosts HP/MP rec."); - addFeature("Mu Lung Dojo skills functional."); - addFeature("M. Magnet on bosses no longer crash."); - addFeature("M. Magnet on fixed no longer crash - thanks shavit!"); - addFeature("HP/MP consumption from skills triggers pet autopot."); - addFeature("Elemental weapon imbue visibility for other players."); + addFeature("Reviewed many skills, such as Steal and M. Door."); + addFeature("Heal GMS-like: fixed HP gain & Heal skill packet."); + addFeature("Improved battleship: HP visible and map-persistent."); + addFeature("Maker skill features developed - pckts thanks Arnah."); + addFeature("Chair Mastery - map chair boosts HP/MP rec."); + addFeature("Mu Lung Dojo skills functional."); + addFeature("M. Magnet on bosses no longer crash."); + addFeature("M. Magnet on fixed no longer crash - thanks shavit!"); + addFeature("HP/MP consumption from skills triggers pet autopot."); + addFeature("Elemental weapon imbue visibility for other players."); } function writeFeatureTab_Quests() { - addFeature("Doll house quest functional."); - addFeature("Q. items required to start quests shows up properly."); - addFeature("Quests are now rewarding items properly."); - addFeature("Items from starting quest reacquireable on NPC talk."); - addFeature("Selection of rewards works properly."); - addFeature("Loads of quests have been patched."); - addFeature("Aran questline has been reviewed."); - addFeature("Reviewed several 4th job skill questlines."); - addFeature("Rewarding system now looks up for item stacking."); - addFeature("3rd job quiz with all 40-question pool available."); - addFeature("Item raising functional."); - addFeature("Cleared issue with player movement during NPC talk."); - addFeature("Reviewed usage of quest progress data as requisite."); + addFeature("Doll house quest functional."); + addFeature("Q. items required to start quests shows up properly."); + addFeature("Quests are now rewarding items properly."); + addFeature("Items from starting quest reacquireable on NPC talk."); + addFeature("Selection of rewards works properly."); + addFeature("Loads of quests have been patched."); + addFeature("Aran questline has been reviewed."); + addFeature("Reviewed several 4th job skill questlines."); + addFeature("Rewarding system now looks up for item stacking."); + addFeature("3rd job quiz with all 40-question pool available."); + addFeature("Item raising functional."); + addFeature("Cleared issue with player movement during NPC talk."); + addFeature("Reviewed usage of quest progress data as requisite."); } function writeFeatureTab_PlayerSocialNetwork() { - addFeature("Party Search fully functional."); - addFeature("Guild and Alliance system fully functional."); - addFeature("Guild contract system held in Guild Headquarters."); - addFeature("Party for novices-only."); - addFeature("P. members' HPBar accounts HP gain on equips."); - addFeature("Thoroughly reviewed P. Shops and H. Merchants."); - addFeature("Transactions on Merchs instantly announced to owner."); - addFeature("Proper meso space check on player transactions."); - addFeature("Game minirooms with functional pw system."); - addFeature("Proper item pickup cooldown on non-owned items."); - addFeature("Improved ranking system, with daily movement."); - addFeature("Protected and improved face expression system."); - addFeature("Automated support for Player NPCs and Hall of Fame."); - addFeature("Engagement & Wedding system with ring effects."); - addFeature("Wedding Wishlists - thanks Dragohe4rt!"); - addFeature("Equipments displays to everyone it's level & EXP info."); - addFeature("Further improved the existent minigame mechanics."); - addFeature("Trade complete using handshake synchronization."); - addFeature("GMS-like trade results displaying after transactions."); + addFeature("Party Search fully functional."); + addFeature("Guild and Alliance system fully functional."); + addFeature("Guild contract system held in Guild Headquarters."); + addFeature("Party for novices-only."); + addFeature("P. members' HPBar accounts HP gain on equips."); + addFeature("Thoroughly reviewed P. Shops and H. Merchants."); + addFeature("Transactions on Merchs instantly announced to owner."); + addFeature("Proper meso space check on player transactions."); + addFeature("Game minirooms with functional pw system."); + addFeature("Proper item pickup cooldown on non-owned items."); + addFeature("Improved ranking system, with daily movement."); + addFeature("Protected and improved face expression system."); + addFeature("Automated support for Player NPCs and Hall of Fame."); + addFeature("Engagement & Wedding system with ring effects."); + addFeature("Wedding Wishlists - thanks Dragohe4rt!"); + addFeature("Equipments displays to everyone it's level & EXP info."); + addFeature("Further improved the existent minigame mechanics."); + addFeature("Trade complete using handshake synchronization."); + addFeature("GMS-like trade results displaying after transactions."); } function writeFeatureTab_CashItems() { - addFeature("EXP/DROP/Cosmetic Coupons."); - addFeature("EXP/DROP Coupon as buff effect during active time."); - addFeature("Great deal of cash items functional."); - addFeature("Proper depletion of picked slot for usable cash items."); - addFeature("Code coupons functional, with multi-items support."); - addFeature("Merged unique ids for pets, rings and cash items."); - addFeature("MapleTV mechanics stabilized and split by world."); - addFeature("GMS-esque omok/match card drop chances."); - addFeature("New town scroll: antibanish. Counters boss banishes."); - addFeature("Inventory system checks for free slot & stack space."); - addFeature("Storage with 'Arrange Items' feature functional."); - addFeature("Close-quarters evaluation mode for items."); - addFeature("Reviewed Karma scissors & Untradeable items."); - addFeature("Reviewed an pet position issue within CASH inventory."); - addFeature("Reviewed fashion-related contents, almost GMS-like."); - addFeature("Plastic surgeons/stylists no longer stuck characters."); - addFeature("Reworked gachapon loots, website-lists lookalike."); - addFeature("Scroll for Spikes on Shoes."); - addFeature("Scroll for Cold Protection."); - addFeature("Vega's spell."); - addFeature("Owl of Minerva."); - addFeature("Pet item ignore."); - addFeature("New Year's card."); - addFeature("Kite."); - addFeature("Cash Shop surprise."); - addFeature("Maple Life."); - addFeature("EXP Increase."); + addFeature("EXP/DROP/Cosmetic Coupons."); + addFeature("EXP/DROP Coupon as buff effect during active time."); + addFeature("Great deal of cash items functional."); + addFeature("Proper depletion of picked slot for usable cash items."); + addFeature("Code coupons functional, with multi-items support."); + addFeature("Merged unique ids for pets, rings and cash items."); + addFeature("MapleTV mechanics stabilized and split by world."); + addFeature("GMS-esque omok/match card drop chances."); + addFeature("New town scroll: antibanish. Counters boss banishes."); + addFeature("Inventory system checks for free slot & stack space."); + addFeature("Storage with 'Arrange Items' feature functional."); + addFeature("Close-quarters evaluation mode for items."); + addFeature("Reviewed Karma scissors & Untradeable items."); + addFeature("Reviewed an pet position issue within CASH inventory."); + addFeature("Reviewed fashion-related contents, almost GMS-like."); + addFeature("Plastic surgeons/stylists no longer stuck characters."); + addFeature("Reworked gachapon loots, website-lists lookalike."); + addFeature("Scroll for Spikes on Shoes."); + addFeature("Scroll for Cold Protection."); + addFeature("Vega's spell."); + addFeature("Owl of Minerva."); + addFeature("Pet item ignore."); + addFeature("New Year's card."); + addFeature("Kite."); + addFeature("Cash Shop surprise."); + addFeature("Maple Life."); + addFeature("EXP Increase."); } function writeFeatureTab_MonstersMapsReactors() { - addFeature("Every monsterbook card is now droppable."); - addFeature("Added meso drop data for many missing mobs."); - addFeature("Monsterbook displays updated drop data info."); - addFeature("Every skill/mastery book is now obtainable."); - addFeature("Enhanced aggro system, with real-time DPS detection."); - addFeature("Puppets keep targeted mobs nearby on new aggro."); - addFeature("Mobs now can drop more than one of the same equip."); - addFeature("Mobs only drop items collectable by the player/party."); - addFeature("Mobs shouldn't fall from foothold too often now."); - addFeature("Properly applying MP cost on non-skill mob moves."); - addFeature("Limited underling mob spawns."); - addFeature("Implemented mob banish by touch & skill move."); - addFeature("Redesigned HT mechanics: assemble & dmg taken."); - addFeature("Implemented Zombify disease status."); - addFeature("Dmg Reflect mobskill icons no longer lags to display."); - addFeature("Added Boss HP Bar for dozens of bosses."); - addFeature("Game will favor showing the targeted boss HPbar."); - addFeature("Boss HPBar & Srv Message toggle - GabrielSin's idea."); - addFeature("Dmg overtime on maps and neutralizers functional."); - addFeature("Items will consistently stay within the walking area."); - addFeature("Boats, elevator and other travel mechanics functional."); - addFeature("C. Balrog's boat approaching visual effect functional."); - addFeature("Maps having everlasting items no longer expires them."); - addFeature("PQs, Taxis and events warps players to random SPs."); - addFeature("Uncovered missing portal SFX on scripted portals."); - addFeature("PQ boxes sprays items when opened, GMS-like."); - addFeature("Reactors pick items up smartly from the field."); - addFeature("Updated scripted portals, now with proper portal SFX."); - addFeature("Reviewed Masteria, W. Tour, N. Desert and Neo City."); - addFeature("Added world maps for M. Castle, W. Tour & Ellin areas."); - addFeature("Added W. Tour & Masteria continents in the world map."); - addFeature("Reviewed several issues with W. Map tooltips & links."); - addFeature("Continent separated global drops."); - addFeature("Giant Cake boss drops s. bags and Maple items."); + addFeature("Every monsterbook card is now droppable."); + addFeature("Added meso drop data for many missing mobs."); + addFeature("Monsterbook displays updated drop data info."); + addFeature("Every skill/mastery book is now obtainable."); + addFeature("Enhanced aggro system, with real-time DPS detection."); + addFeature("Puppets keep targeted mobs nearby on new aggro."); + addFeature("Mobs now can drop more than one of the same equip."); + addFeature("Mobs only drop items collectable by the player/party."); + addFeature("Mobs shouldn't fall from foothold too often now."); + addFeature("Properly applying MP cost on non-skill mob moves."); + addFeature("Limited underling mob spawns."); + addFeature("Implemented mob banish by touch & skill move."); + addFeature("Redesigned HT mechanics: assemble & dmg taken."); + addFeature("Implemented Zombify disease status."); + addFeature("Dmg Reflect mobskill icons no longer lags to display."); + addFeature("Added Boss HP Bar for dozens of bosses."); + addFeature("Game will favor showing the targeted boss HPbar."); + addFeature("Boss HPBar & Srv Message toggle - GabrielSin's idea."); + addFeature("Dmg overtime on maps and neutralizers functional."); + addFeature("Items will consistently stay within the walking area."); + addFeature("Boats, elevator and other travel mechanics functional."); + addFeature("C. Balrog's boat approaching visual effect functional."); + addFeature("Maps having everlasting items no longer expires them."); + addFeature("PQs, Taxis and events warps players to random SPs."); + addFeature("Uncovered missing portal SFX on scripted portals."); + addFeature("PQ boxes sprays items when opened, GMS-like."); + addFeature("Reactors pick items up smartly from the field."); + addFeature("Updated scripted portals, now with proper portal SFX."); + addFeature("Reviewed Masteria, W. Tour, N. Desert and Neo City."); + addFeature("Added world maps for M. Castle, W. Tour & Ellin areas."); + addFeature("Added W. Tour & Masteria continents in the world map."); + addFeature("Reviewed several issues with W. Map tooltips & links."); + addFeature("Continent separated global drops."); + addFeature("Giant Cake boss drops s. bags and Maple items."); } function writeFeatureTab_PQpotentials() { - addFeature("Advanced and well-safe PQ registration system."); - addFeature("Lobby system: Same channel, multiple PQ instances."); - addFeature("Exped system: Many parties can join a same instance."); - addFeature("Guild queue: guild registration for the GPQ."); - addFeature("EIM Pool system: optimized instance loadouts."); - addFeature("Recall system: players can rejoin PQ after d/c."); + addFeature("Advanced and well-safe PQ registration system."); + addFeature("Lobby system: Same channel, multiple PQ instances."); + addFeature("Exped system: Many parties can join a same instance."); + addFeature("Guild queue: guild registration for the GPQ."); + addFeature("EIM Pool system: optimized instance loadouts."); + addFeature("Recall system: players can rejoin PQ after d/c."); } function writeFeatureTab_Playerpotentials() { - addFeature("Adventurer Mount quests functional."); - addFeature("All Equipment levels up."); - addFeature("Player level rates."); - addFeature("Gain fame by quests and event instances."); - addFeature("Pet evolutions functional (not GMS-like)."); - addFeature("Reviewed keybinding system."); - addFeature("Character slots per world/server-wide."); - addFeature("Optional cash shop inventory separated by classes."); - addFeature("Players manage 'same-typed' invites exclusively."); - addFeature("Player buffs with conditional active effects."); - addFeature("Rock-paper-scissors minigame - thanks Arnah!"); + addFeature("Adventurer Mount quests functional."); + addFeature("All Equipment levels up."); + addFeature("Player level rates."); + addFeature("Gain fame by quests and event instances."); + addFeature("Pet evolutions functional (not GMS-like)."); + addFeature("Reviewed keybinding system."); + addFeature("Character slots per world/server-wide."); + addFeature("Optional cash shop inventory separated by classes."); + addFeature("Players manage 'same-typed' invites exclusively."); + addFeature("Player buffs with conditional active effects."); + addFeature("Rock-paper-scissors minigame - thanks Arnah!"); } function writeFeatureTab_Serverpotentials() { - addFeature("Multi-worlds."); - addFeature("Each world can hold it's own rates from server bootup."); - addFeature("Dynamic World/Channel deployment."); - addFeature("Inventory auto-gather and auto-sorting feature."); - addFeature("Enhanced auto-pot system: smart pet potion handle."); - addFeature("Enhanced buff system: best buffs effects takes place."); - addFeature("Enhanced AP auto-assigner: focus on eqp demands."); - addFeature("Enhanced inventory check: free slots smartly fetched."); - addFeature("Enhanced petloot handler: no brute-force inv. checks."); - addFeature("Matching system: everyone's decision to trigger action."); - addFeature("Players-appointed bestsellers for Owl and Cash Shop."); - addFeature("Tweaked pet/mount hunger to a balanced growth rate."); - addFeature("Consistent experience and meso gain system."); - addFeature("Fredrick Store Bank warn/delete unclaimed items."); - addFeature("NPC crafters won't take items freely anymore."); - addFeature("Duey: pkg rcvd popup and many delivery mechanics."); - addFeature("Pet pickup gives preference to player attacks."); - addFeature("Channel capacity bar and worlds with capacity check."); - addFeature("Diseases visible for others, even after changing maps."); - addFeature("Persistent diseases. Players keeps status on login."); - addFeature("Poison damage value visible for other players."); - addFeature("M. book announcer displays info based on demand."); - addFeature("Custom jail system."); - addFeature("Custom buyback system, uses mesos / NX, via MTS."); - addFeature("Custom fishing system having 'seasonal' catch times."); - addFeature("Actual fishing handling w/ F. Net - thanks Dragohe4rt!"); - addFeature("Custom map leasing system."); - addFeature("Delete Character."); - addFeature("Smooth view-all-char, now showing all account chars."); - addFeature("Centralized servertime, boosting handler performance."); - addFeature("Centralized timestamping, unused rcvd timestamps."); - addFeature("Autosaver (periodically saves player's data on DB)."); - addFeature("Fixed and randomized HP/MP growth rate available."); - addFeature("Players' MaxHP/MaxMP method accounting equip gain."); - addFeature("Prevented 'NPC gone after some uptime' issue."); - addFeature("AP assigning available for novices level 10 or below."); - addFeature("SP cap past tier-level, recovered after job upgrade."); - addFeature("Bypassable PIN/PIC system for authenticated users."); - addFeature("Automatic account registration - thanks shavit!"); - addFeature("Any NPC scriptable - thanks GabrielSin!"); + addFeature("Multi-worlds."); + addFeature("Each world can hold it's own rates from server bootup."); + addFeature("Dynamic World/Channel deployment."); + addFeature("Inventory auto-gather and auto-sorting feature."); + addFeature("Enhanced auto-pot system: smart pet potion handle."); + addFeature("Enhanced buff system: best buffs effects takes place."); + addFeature("Enhanced AP auto-assigner: focus on eqp demands."); + addFeature("Enhanced inventory check: free slots smartly fetched."); + addFeature("Enhanced petloot handler: no brute-force inv. checks."); + addFeature("Matching system: everyone's decision to trigger action."); + addFeature("Players-appointed bestsellers for Owl and Cash Shop."); + addFeature("Tweaked pet/mount hunger to a balanced growth rate."); + addFeature("Consistent experience and meso gain system."); + addFeature("Fredrick Store Bank warn/delete unclaimed items."); + addFeature("NPC crafters won't take items freely anymore."); + addFeature("Duey: pkg rcvd popup and many delivery mechanics."); + addFeature("Pet pickup gives preference to player attacks."); + addFeature("Channel capacity bar and worlds with capacity check."); + addFeature("Diseases visible for others, even after changing maps."); + addFeature("Persistent diseases. Players keeps status on login."); + addFeature("Poison damage value visible for other players."); + addFeature("M. book announcer displays info based on demand."); + addFeature("Custom jail system."); + addFeature("Custom buyback system, uses mesos / NX, via MTS."); + addFeature("Custom fishing system having 'seasonal' catch times."); + addFeature("Actual fishing handling w/ F. Net - thanks Dragohe4rt!"); + addFeature("Custom map leasing system."); + addFeature("Delete Character."); + addFeature("Smooth view-all-char, now showing all account chars."); + addFeature("Centralized servertime, boosting handler performance."); + addFeature("Centralized timestamping, unused rcvd timestamps."); + addFeature("Autosaver (periodically saves player's data on DB)."); + addFeature("Fixed and randomized HP/MP growth rate available."); + addFeature("Players' MaxHP/MaxMP method accounting equip gain."); + addFeature("Prevented 'NPC gone after some uptime' issue."); + addFeature("AP assigning available for novices level 10 or below."); + addFeature("SP cap past tier-level, recovered after job upgrade."); + addFeature("Bypassable PIN/PIC system for authenticated users."); + addFeature("Automatic account registration - thanks shavit!"); + addFeature("Any NPC scriptable - thanks GabrielSin!"); } function writeFeatureTab_Commands() { - addFeature("Spawn Zakum/Horntail/Pinkbean."); - addFeature("Permanent NPCs & mobs."); - addFeature("Several new commands."); - addFeature("Rank command highlighting users by world or overall."); - addFeature("Server commands layered by GM levels."); - addFeature("Revamped command files layout - thanks Arthur L!"); - addFeature("Improved 'Search' performance & added map search."); + addFeature("Spawn Zakum/Horntail/Pinkbean."); + addFeature("Permanent NPCs & mobs."); + addFeature("Several new commands."); + addFeature("Rank command highlighting users by world or overall."); + addFeature("Server commands layered by GM levels."); + addFeature("Revamped command files layout - thanks Arthur L!"); + addFeature("Improved 'Search' performance & added map search."); } function writeFeatureTab_CustomNPCs() { - addFeature("Spiegelmann: automatized rock-refiner."); - addFeature("Asia: scroll & rarities shop NPC."); - addFeature("Abdula: lists droppers of needed skill/mastery books."); - addFeature("Agent E: accessory crafter."); - addFeature("Dalair: automatized equipment-merger."); - addFeature("Donation Box: automatized item-buyer."); - addFeature("Coco & Ace of Hearts: C. scroll crafters."); - addFeature("Barry (MapleTV): fill book & exchange items for scroll."); + addFeature("Spiegelmann: automatized rock-refiner."); + addFeature("Asia: scroll & rarities shop NPC."); + addFeature("Abdula: lists droppers of needed skill/mastery books."); + addFeature("Agent E: accessory crafter."); + addFeature("Dalair: automatized equipment-merger."); + addFeature("Donation Box: automatized item-buyer."); + addFeature("Coco & Ace of Hearts: C. scroll crafters."); + addFeature("Barry (MapleTV): fill book & exchange items for scroll."); } function writeFeatureTab_Localhostedits() { - addFeature("Removed the 'n' NPC dialog issue."); - addFeature("Removed caps for MATK, WMDEF, ACC and AVOID."); - addFeature("Removed MTS block, buyback available anywhere."); - addFeature("Removed party blocks for novices under level 10."); - addFeature("Set a much more higher cap for SPEED."); - addFeature("Removed AP usage block for novices."); - addFeature("Removed attack gem block on non-weapons w/ Maker."); - addFeature("Removed AP excess popup - thanks kevintjuh93!"); - addFeature("Removed 'GMs can't attack' - thanks kevintjuh93!"); - addFeature("Removed 'Gained a level!' - thanks PrinceReborn!"); + addFeature("Removed the 'n' NPC dialog issue."); + addFeature("Removed caps for MATK, WMDEF, ACC and AVOID."); + addFeature("Removed MTS block, buyback available anywhere."); + addFeature("Removed party blocks for novices under level 10."); + addFeature("Set a much more higher cap for SPEED."); + addFeature("Removed AP usage block for novices."); + addFeature("Removed attack gem block on non-weapons w/ Maker."); + addFeature("Removed AP excess popup - thanks kevintjuh93!"); + addFeature("Removed 'GMs can't attack' - thanks kevintjuh93!"); + addFeature("Removed 'Gained a level!' - thanks PrinceReborn!"); } function writeFeatureTab_Project() { - addFeature("Organized project code."); - addFeature("Highly updated drop data."); - addFeature("Highly configurable & optimized server."); - addFeature("Fixed/added many missing packet opcodes."); - addFeature("Uncovered many opcodes throughout the source."); - addFeature("Reviewed many Java aspects that needed attention."); - addFeature("Reviewed SQL data, eliminating duplicated entries."); - addFeature("Improved login phase, using cache over DB queries."); - addFeature("Protected many flaws with login management system."); - addFeature("Developed a robust anti-exploit login coordinator."); - addFeature("Revised uniqueness aspect of logged in accounts."); - addFeature("Usage of HikariCP to improve DB connection calls."); - addFeature("Usage of Java Threadpool to improve runnable calls."); - addFeature("Developed many survey tools for content profiling."); - addFeature("Removed dangling item name throughout game files."); - addFeature("Remodeled item scripts, properly using NPC dialogs."); - addFeature("ThreadTracker: runtime tool for deadlock detection."); - addFeature("Channel, World and Server-wide timer management."); - addFeature("Developed services as preemptive task scheduler."); - addFeature("Thoroughly reviewed encapsulation for player stats."); - addFeature("Heavily reviewed future task management, spawning much less threads and relieving task overload on the TimerManager."); + addFeature("Organized project code."); + addFeature("Highly updated drop data."); + addFeature("Highly configurable & optimized server."); + addFeature("Fixed/added many missing packet opcodes."); + addFeature("Uncovered many opcodes throughout the source."); + addFeature("Reviewed many Java aspects that needed attention."); + addFeature("Reviewed SQL data, eliminating duplicated entries."); + addFeature("Improved login phase, using cache over DB queries."); + addFeature("Protected many flaws with login management system."); + addFeature("Developed a robust anti-exploit login coordinator."); + addFeature("Revised uniqueness aspect of logged in accounts."); + addFeature("Usage of HikariCP to improve DB connection calls."); + addFeature("Usage of Java Threadpool to improve runnable calls."); + addFeature("Developed many survey tools for content profiling."); + addFeature("Removed dangling item name throughout game files."); + addFeature("Remodeled item scripts, properly using NPC dialogs."); + addFeature("ThreadTracker: runtime tool for deadlock detection."); + addFeature("Channel, World and Server-wide timer management."); + addFeature("Developed services as preemptive task scheduler."); + addFeature("Thoroughly reviewed encapsulation for player stats."); + addFeature("Heavily reviewed future task management, spawning much less threads and relieving task overload on the TimerManager."); } function writeAllFeatures() { - var re = /[ ,&\/]+/g; - - for(var i = 0; i < tabs.length; i++) { - feature_cursor = []; + var re = /[ ,&\/]+/g; - var tabName = (tabs[i]).replace(re, ""); - this["writeFeatureTab_" + tabName](); - - feature_tree.push(feature_cursor); - } + for (var i = 0; i < tabs.length; i++) { + feature_cursor = []; + + var tabName = (tabs[i]).replace(re, ""); + this["writeFeatureTab_" + tabName](); + + feature_tree.push(feature_cursor); + } } function start() { - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getPlayer().sendPacket(PacketCreator.musicChange(anthemSong)); - status = -1; - writeAllFeatures(); - action(1, 0, 0); + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getPlayer().sendPacket(PacketCreator.musicChange(anthemSong)); + status = -1; + writeAllFeatures(); + action(1, 0, 0); } function action(mode, type, selection) { - const PacketCreator = Java.type('tools.PacketCreator'); - if (mode == -1) { - cm.getPlayer().sendPacket(PacketCreator.musicChange(ambientSong)); - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.getPlayer().sendPacket(PacketCreator.musicChange(ambientSong)); - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - var sendStr = "HeavenMS was developed on the timespan of 4 years, based on where Solaxia left. I'm glad to say the development itself had continuously been agraciated by dozens of contributors and cheerers (truly thanks for the trusting vow, guys & gals!).\r\n\r\nTalking about results: many nice features emerged, development aimed to get back the old GMS experience. Now many of these so-long missing features are gracefully presented to you in the shape of this server. Long live MapleStory!!\r\n\r\nThese are the features from #bHeavenMS#k:\r\n\r\n"; - for(var i = 0; i < tabs.length; i++) { - sendStr += "#L" + i + "##b" + tabs[i] + "#k#l\r\n"; - } - - cm.sendSimple(sendStr); - } else if(status == 1) { - var tabName; - - for(var i = 0; i < tabs.length; i++) { - if(selection == i) { - tabName = feature_tree[i]; - break; - } - } - - var sendStr = "#b" + tabs[selection] + "#k:\r\n\r\n"; - for(var i = 0; i < tabName.length; i++) { - sendStr += " #L" + i + "# " + tabName[i]; - sendStr += "#l\r\n"; - } - - cm.sendPrev(sendStr); - } else { - cm.getPlayer().sendPacket(PacketCreator.musicChange(ambientSong)); - cm.dispose(); - } + const PacketCreator = Java.type('tools.PacketCreator'); + if (mode == -1) { + cm.getPlayer().sendPacket(PacketCreator.musicChange(ambientSong)); + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.getPlayer().sendPacket(PacketCreator.musicChange(ambientSong)); + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var sendStr = "HeavenMS was developed on the timespan of 4 years, based on where Solaxia left. I'm glad to say the development itself had continuously been agraciated by dozens of contributors and cheerers (truly thanks for the trusting vow, guys & gals!).\r\n\r\nTalking about results: many nice features emerged, development aimed to get back the old GMS experience. Now many of these so-long missing features are gracefully presented to you in the shape of this server. Long live MapleStory!!\r\n\r\nThese are the features from #bHeavenMS#k:\r\n\r\n"; + for (var i = 0; i < tabs.length; i++) { + sendStr += "#L" + i + "##b" + tabs[i] + "#k#l\r\n"; + } + + cm.sendSimple(sendStr); + } else if (status == 1) { + var tabName; + + for (var i = 0; i < tabs.length; i++) { + if (selection == i) { + tabName = feature_tree[i]; + break; + } + } + + var sendStr = "#b" + tabs[selection] + "#k:\r\n\r\n"; + for (var i = 0; i < tabName.length; i++) { + sendStr += " #L" + i + "# " + tabName[i]; + sendStr += "#l\r\n"; + } + + cm.sendPrev(sendStr); + } else { + cm.getPlayer().sendPacket(PacketCreator.musicChange(ambientSong)); + cm.dispose(); + } + } } function generateSelectionMenu(array) { - var menu = ""; - for (var i = 0; i < array.length; i++) { - menu += "#L" + i + "#" + array[i] + "#l\r\n"; - } - return menu; + var menu = ""; + for (var i = 0; i < array.length; i++) { + menu += "#L" + i + "#" + array[i] + "#l\r\n"; + } + return menu; } \ No newline at end of file diff --git a/scripts/npc/MagatiaPassword.js b/scripts/npc/MagatiaPassword.js index a4c10f40ab..ab9ca5bfe5 100644 --- a/scripts/npc/MagatiaPassword.js +++ b/scripts/npc/MagatiaPassword.js @@ -1,34 +1,32 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(status == 0){ - cm.sendGetText("The door reacts to the entry pass inserted. #bPassword#k!"); - } - else if(status == 1){ - if(cm.getText() == cm.getQuestProgress(3360)){ - cm.setQuestProgress(3360, 1); - const PacketCreator = Java.type('tools.PacketCreator'); - cm.getPlayer().sendPacket(PacketCreator.playPortalSound()); - cm.warp(261030000, "sp_" + ((cm.getMapId() == 261010000) ? "jenu" : "alca")); - } - else { - cm.sendOk("#rWrong!"); - } - - cm.dispose(); - } + if (status == 0) { + cm.sendGetText("The door reacts to the entry pass inserted. #bPassword#k!"); + } else if (status == 1) { + if (cm.getText() == cm.getQuestProgress(3360)) { + cm.setQuestProgress(3360, 1); + const PacketCreator = Java.type('tools.PacketCreator'); + cm.getPlayer().sendPacket(PacketCreator.playPortalSound()); + cm.warp(261030000, "sp_" + ((cm.getMapId() == 261010000) ? "jenu" : "alca")); + } else { + cm.sendOk("#rWrong!"); + } + + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/MaybeItsGrendel_end.js b/scripts/npc/MaybeItsGrendel_end.js index 8084fcdc3c..34aa2d9b3d 100644 --- a/scripts/npc/MaybeItsGrendel_end.js +++ b/scripts/npc/MaybeItsGrendel_end.js @@ -1,28 +1,26 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } - if(status == 0){ - cm.sendNext("...a black shadowy figure came out and attacked you? How can this take place at #b#p1032001##k's house? This sounds like one big conspiracy here..."); - } - else if(status == 1){ - cm.sendNextPrev("I'll have to sort this all out in my mind. Talk to me in a bit."); - } - else if(status == 2){ - cm.dispose(); - } + if (status == 0) { + cm.sendNext("...a black shadowy figure came out and attacked you? How can this take place at #b#p1032001##k's house? This sounds like one big conspiracy here..."); + } else if (status == 1) { + cm.sendNextPrev("I'll have to sort this all out in my mind. Talk to me in a bit."); + } else if (status == 2) { + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/PupeteerPassword.js b/scripts/npc/PupeteerPassword.js index 8d3ca92136..3e84269fa7 100644 --- a/scripts/npc/PupeteerPassword.js +++ b/scripts/npc/PupeteerPassword.js @@ -1,48 +1,45 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } + if (status == 0) { + if (cm.isQuestStarted(21728)) { + cm.sendOk("You search for any hints of the Puppeteer, but it seems a powerful force blocks the path... Better return to #b#p1061019##k."); + cm.setQuestProgress(21728, 21761, 0); + cm.dispose(); + return; + } - if(status == 0){ - if(cm.isQuestStarted(21728)) { - cm.sendOk("You search for any hints of the Puppeteer, but it seems a powerful force blocks the path... Better return to #b#p1061019##k."); - cm.setQuestProgress(21728, 21761, 0); - cm.dispose(); - return; - } - - cm.sendGetText("A suspicious voice pierces through the silence. #bPassword#k!"); - } - else if(status == 1){ - if(cm.getText() == "Francis is a genius Puppeteer!"){ - if(cm.isQuestStarted(20730) && cm.getQuestProgressInt(20730, 9300285) == 0) - cm.warp(910510001, 1); - else if(cm.isQuestStarted(21731) && cm.getQuestProgressInt(21731, 9300346) == 0) - cm.warp(910510001, 1); - else - cm.playerMessage(5, "Although you said the right answer, some mysterious forces are blocking the way in."); + cm.sendGetText("A suspicious voice pierces through the silence. #bPassword#k!"); + } else if (status == 1) { + if (cm.getText() == "Francis is a genius Puppeteer!") { + if (cm.isQuestStarted(20730) && cm.getQuestProgressInt(20730, 9300285) == 0) { + cm.warp(910510001, 1); + } else if (cm.isQuestStarted(21731) && cm.getQuestProgressInt(21731, 9300346) == 0) { + cm.warp(910510001, 1); + } else { + cm.playerMessage(5, "Although you said the right answer, some mysterious forces are blocking the way in."); + } - cm.dispose(); - } - else{ - cm.sendOk("#rWrong!"); - } - } - else if(status == 2){ - cm.dispose(); - } + cm.dispose(); + } else { + cm.sendOk("#rWrong!"); + } + } else if (status == 2) { + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/ThiefPassword.js b/scripts/npc/ThiefPassword.js index efc0ff1db8..83009aba93 100644 --- a/scripts/npc/ThiefPassword.js +++ b/scripts/npc/ThiefPassword.js @@ -1,39 +1,36 @@ var status; -function start(){ - status = -1; - action(1, 0, 0); +function start() { + status = -1; + action(1, 0, 0); } -function action(mode, type, selection){ - if(mode == -1 || (mode == 0 && status == 0)){ - cm.dispose(); - return; - } - else if(mode == 0) - status--; - else - status++; +function action(mode, type, selection) { + if (mode == -1 || (mode == 0 && status == 0)) { + cm.dispose(); + return; + } else if (mode == 0) { + status--; + } else { + status++; + } + if (status == 0) { + cm.sendGetText("A suspicious voice pierces through the silence. #bPassword#k!"); + } else if (status == 1) { + if (cm.getText() == "Open Sesame") { + if (cm.isQuestCompleted(3925)) { + cm.warp(260010402, 1); + } else { + cm.playerMessage(5, "Although you said the right answer, the door will not budge."); + } - if(status == 0){ - cm.sendGetText("A suspicious voice pierces through the silence. #bPassword#k!"); - } - else if(status == 1){ - if(cm.getText() == "Open Sesame"){ - if(cm.isQuestCompleted(3925)) - cm.warp(260010402, 1); - else - cm.playerMessage(5, "Although you said the right answer, the door will not budge."); - - cm.dispose(); - } - else{ - cm.sendOk("#rWrong!"); - } - } - else if(status == 2){ - cm.dispose(); - } + cm.dispose(); + } else { + cm.sendOk("#rWrong!"); + } + } else if (status == 2) { + cm.dispose(); + } } \ No newline at end of file diff --git a/scripts/npc/changeName.js b/scripts/npc/changeName.js index add15d283d..d2cca24af3 100644 --- a/scripts/npc/changeName.js +++ b/scripts/npc/changeName.js @@ -19,6 +19,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ + /* Changes the players name. Can only be accessed with the item 2430026. */ @@ -29,36 +30,37 @@ function start() { } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - if(cm.haveItem(2430026)) { - cm.sendYesNo("I can change your name for you if you would like?", 1); - } else { - cm.dispose(); - } - } else if(status == 1) { - cm.sendGetText("Please input your desired name below."); - } else if(status == 2) { - var text = cm.getText(); + if (cm.haveItem(2430026)) { + cm.sendYesNo("I can change your name for you if you would like?", 1); + } else { + cm.dispose(); + } + } else if (status == 1) { + cm.sendGetText("Please input your desired name below."); + } else if (status == 2) { + var text = cm.getText(); - const Character = Java.type('client.Character'); - var canCreate = Character.canCreateChar(text); - if(canCreate) { - cm.getPlayer().setName(text); - cm.sendOk("Your name has been changed to #b" + text + "#k. You will have to login again for this to take effect.", 1); - cm.gainItem(2430026, -1); - } else { - cm.sendNext("I'm afraid you can't use the name #b" + text + "#k or it is already taken.", 1); - } - } else if(status == 3) { - cm.dispose(); - cm.getClient().disconnect(false, false); - } + const Character = Java.type('client.Character'); + var canCreate = Character.canCreateChar(text); + if (canCreate) { + cm.getPlayer().setName(text); + cm.sendOk("Your name has been changed to #b" + text + "#k. You will have to login again for this to take effect.", 1); + cm.gainItem(2430026, -1); + } else { + cm.sendNext("I'm afraid you can't use the name #b" + text + "#k or it is already taken.", 1); + } + } else if (status == 3) { + cm.dispose(); + cm.getClient().disconnect(false, false); + } } } \ No newline at end of file diff --git a/scripts/npc/commands.js b/scripts/npc/commands.js index 37f7252671..8dfdc7aa30 100644 --- a/scripts/npc/commands.js +++ b/scripts/npc/commands.js @@ -15,57 +15,58 @@ var levels = ["Common", "Donator", "JrGM", "GM", "SuperGM", "Developer", "Admin" var commands; function writeHeavenMSCommands() { - const CommandsExecutor = Java.type('client.command.CommandsExecutor'); - commands = CommandsExecutor.getInstance().getGmCommands(); + const CommandsExecutor = Java.type('client.command.CommandsExecutor'); + commands = CommandsExecutor.getInstance().getGmCommands(); } function start() { - status = -1; - writeHeavenMSCommands(); - action(1, 0, 0); + status = -1; + writeHeavenMSCommands(); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - var sendStr = "There are all available commands for you:\r\n\r\n#b"; - for(var i = 0; i <= cm.getPlayer().gmLevel(); i++) { - sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; - } - - cm.sendSimple(sendStr); - } else if(status == 1) { - var lvComm, lvDesc, lvHead = (selection < 2) ? common_heading : staff_heading; - - if(selection > 6) { - selection = 6; - } else if(selection < 0) { - selection = 0; - } - - lvComm = commands.get(selection).getLeft(); - lvDesc = commands.get(selection).getRight(); - - var sendStr = "The following commands are available for #b" + levels[selection] + "#k:\r\n\r\n"; - for(var i = 0; i < lvComm.size(); i++) { - sendStr += " #L" + i + "# " + lvHead + lvComm.get(i) + " - " + lvDesc.get(i); - sendStr += "#l\r\n"; - } - - cm.sendPrev(sendStr); - } else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var sendStr = "There are all available commands for you:\r\n\r\n#b"; + for (var i = 0; i <= cm.getPlayer().gmLevel(); i++) { + sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; + } + + cm.sendSimple(sendStr); + } else if (status == 1) { + var lvComm, lvDesc, lvHead = (selection < 2) ? common_heading : staff_heading; + + if (selection > 6) { + selection = 6; + } else if (selection < 0) { + selection = 0; + } + + lvComm = commands.get(selection).getLeft(); + lvDesc = commands.get(selection).getRight(); + + var sendStr = "The following commands are available for #b" + levels[selection] + "#k:\r\n\r\n"; + for (var i = 0; i < lvComm.size(); i++) { + sendStr += " #L" + i + "# " + lvHead + lvComm.get(i) + " - " + lvDesc.get(i); + sendStr += "#l\r\n"; + } + + cm.sendPrev(sendStr); + } else { + cm.dispose(); + } + } } diff --git a/scripts/npc/cpqchallenge.js b/scripts/npc/cpqchallenge.js index 5da9bedf6e..5affd6fbfc 100644 --- a/scripts/npc/cpqchallenge.js +++ b/scripts/npc/cpqchallenge.js @@ -1,9 +1,9 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Jayd - translated CPQ contents to English ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Jayd - translated CPQ contents to English + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var party; @@ -27,13 +27,14 @@ function action(mode, type, selection) { return; } } - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0) { if (cm.getParty().getMembers().size() == party.size()) { @@ -41,8 +42,9 @@ function action(mode, type, selection) { const GameConstants = Java.type('constants.game.GameConstants'); var snd = ""; - for (var i = 0; i < party.size(); i++) + for (var i = 0; i < party.size(); i++) { snd += "#bName: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + GameConstants.getJobName(party.get(i).getJobId()) + "#k\r\n\r\n"; + } cm.sendAcceptDecline(snd + "Would you like to fight this party at the Monster Carnival?"); } else { cm.answerCPQChallenge(false); diff --git a/scripts/npc/cpqchallenge2.js b/scripts/npc/cpqchallenge2.js index d6c79c733b..5affd6fbfc 100644 --- a/scripts/npc/cpqchallenge2.js +++ b/scripts/npc/cpqchallenge2.js @@ -1,9 +1,9 @@ /** --- Version Info ----------------------------------------------------------------------------------- - 1.0 - First Version by Drago (MapleStorySA) - 2.0 - Second Version by Jayd - translated CPQ contents to English ---------------------------------------------------------------------------------------------------- -**/ + -- Version Info ----------------------------------------------------------------------------------- + 1.0 - First Version by Drago (MapleStorySA) + 2.0 - Second Version by Jayd - translated CPQ contents to English + --------------------------------------------------------------------------------------------------- + **/ var status = 0; var party; @@ -27,22 +27,24 @@ function action(mode, type, selection) { return; } } - if (mode == -1) + if (mode == -1) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - + } + if (status == 0) { if (cm.getParty().getMembers().size() == party.size()) { cm.getPlayer().setChallenged(true); const GameConstants = Java.type('constants.game.GameConstants'); var snd = ""; - for (var i = 0; i < party.size(); i++) + for (var i = 0; i < party.size(); i++) { snd += "#bName: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + GameConstants.getJobName(party.get(i).getJobId()) + "#k\r\n\r\n"; + } cm.sendAcceptDecline(snd + "Would you like to fight this party at the Monster Carnival?"); } else { cm.answerCPQChallenge(false); diff --git a/scripts/npc/credits.js b/scripts/npc/credits.js index e9d1bff05c..2bc92ccb02 100644 --- a/scripts/npc/credits.js +++ b/scripts/npc/credits.js @@ -17,12 +17,12 @@ var servers = ["Cosmic", "HeavenMS", "MapleSolaxia", "MoopleDEV", "BubblesDEV", var servers_history = []; function addPerson(name, role) { - name_cursor.push(name); - role_cursor.push(role); + name_cursor.push(name); + role_cursor.push(role); } function setHistory(from, to) { - servers_history.push([from, to]); + servers_history.push([from, to]); } /* @@ -34,155 +34,156 @@ function writeServerStaff_MapleNext() { */ function writeServerStaff_Cosmic() { - addPerson("Ponk", "Developer"); + addPerson("Ponk", "Developer"); - setHistory(2021, 2021); + setHistory(2021, 2021); } function writeServerStaff_HeavenMS() { - addPerson("Ronan", "Developer"); - addPerson("Vcoc", "Freelance Developer"); - addPerson("Thora", "Contributor"); - addPerson("GabrielSin", "Contributor"); - addPerson("Masterrulax", "Contributor"); - addPerson("MedicOP", "Adjunct Developer"); - - setHistory(2015, 2019); + addPerson("Ronan", "Developer"); + addPerson("Vcoc", "Freelance Developer"); + addPerson("Thora", "Contributor"); + addPerson("GabrielSin", "Contributor"); + addPerson("Masterrulax", "Contributor"); + addPerson("MedicOP", "Adjunct Developer"); + + setHistory(2015, 2019); } function writeServerStaff_MapleSolaxia() { - addPerson("Aria", "Administrator"); - addPerson("Twdtwd", "Administrator"); - addPerson("Exorcist", "Developer"); - addPerson("SharpAceX", "Developer"); - addPerson("Zygon", "Freelance Developer"); - addPerson("SourMjolk", "Game Master"); - addPerson("Kanade", "Game Master"); - addPerson("Kitsune", "Game Master"); - - setHistory(2014, 2015); + addPerson("Aria", "Administrator"); + addPerson("Twdtwd", "Administrator"); + addPerson("Exorcist", "Developer"); + addPerson("SharpAceX", "Developer"); + addPerson("Zygon", "Freelance Developer"); + addPerson("SourMjolk", "Game Master"); + addPerson("Kanade", "Game Master"); + addPerson("Kitsune", "Game Master"); + + setHistory(2014, 2015); } function writeServerStaff_MoopleDEV() { - addPerson("kevintjuh93", "Developer"); - addPerson("hindie93", "Contributor"); - addPerson("JuniarZ-", "Contributor"); - - setHistory(2010, 2012); + addPerson("kevintjuh93", "Developer"); + addPerson("hindie93", "Contributor"); + addPerson("JuniarZ-", "Contributor"); + + setHistory(2010, 2012); } function writeServerStaff_BubblesDEV() { - addPerson("David!", "Developer"); - addPerson("Moogra", "Developer"); - addPerson("XxOsirisxX", "Contributor"); - addPerson("MrMysterious", "Contributor"); - - setHistory(2009, 2010); + addPerson("David!", "Developer"); + addPerson("Moogra", "Developer"); + addPerson("XxOsirisxX", "Contributor"); + addPerson("MrMysterious", "Contributor"); + + setHistory(2009, 2010); } function writeServerStaff_MetroMS() { - addPerson("David!", "Developer"); - addPerson("XxOsirisxX", "Contributor"); - addPerson("Generic", "Contributor"); - - setHistory(2009, 2009); + addPerson("David!", "Developer"); + addPerson("XxOsirisxX", "Contributor"); + addPerson("Generic", "Contributor"); + + setHistory(2009, 2009); } function writeServerStaff_OdinMS() { - addPerson("Serpendiem", "Administrator"); - addPerson("Frz", "Developer"); - addPerson("Patrick", "Developer"); - addPerson("Matze", "Developer"); - addPerson("Vimes", "Developer"); - - setHistory(2007, 2008); + addPerson("Serpendiem", "Administrator"); + addPerson("Frz", "Developer"); + addPerson("Patrick", "Developer"); + addPerson("Matze", "Developer"); + addPerson("Vimes", "Developer"); + + setHistory(2007, 2008); } function writeServerStaff_Contributors() { - addPerson("IxianMace", "Contributor"); - addPerson("Conrad", "Contributor"); - addPerson("inhyuk", "Contributor"); - addPerson("Jayd", "Contributor"); - addPerson("Dragohe4rt", "Contributor"); - addPerson("Jvlaple", "Contributor"); - addPerson("Stereo", "Contributor"); - addPerson("AngelSL", "Contributor"); - addPerson("Lerk", "Contributor"); - addPerson("Leifde", "Contributor"); - addPerson("ThreeStep", "Contributor"); - addPerson("RMZero213", "Contributor"); - addPerson("ExtremeDevilz", "Contributor"); - addPerson("aaroncsn", "Contributor"); - addPerson("xQuasar", "Contributor"); - addPerson("Xterminator", "Contributor"); - addPerson("XoticStory", "Contributor"); + addPerson("IxianMace", "Contributor"); + addPerson("Conrad", "Contributor"); + addPerson("inhyuk", "Contributor"); + addPerson("Jayd", "Contributor"); + addPerson("Dragohe4rt", "Contributor"); + addPerson("Jvlaple", "Contributor"); + addPerson("Stereo", "Contributor"); + addPerson("AngelSL", "Contributor"); + addPerson("Lerk", "Contributor"); + addPerson("Leifde", "Contributor"); + addPerson("ThreeStep", "Contributor"); + addPerson("RMZero213", "Contributor"); + addPerson("ExtremeDevilz", "Contributor"); + addPerson("aaroncsn", "Contributor"); + addPerson("xQuasar", "Contributor"); + addPerson("Xterminator", "Contributor"); + addPerson("XoticStory", "Contributor"); } function writeAllServerStaffs() { - for(var i = 0; i < servers.length; i++) { - name_cursor = []; - role_cursor = []; + for (var i = 0; i < servers.length; i++) { + name_cursor = []; + role_cursor = []; - var srvName = servers[i]; - this["writeServerStaff_" + srvName](); - - name_tree.push(name_cursor); - role_tree.push(role_cursor); - } + var srvName = servers[i]; + this["writeServerStaff_" + srvName](); + + name_tree.push(name_cursor); + role_tree.push(role_cursor); + } } function start() { - status = -1; - writeAllServerStaffs(); - action(1, 0, 0); + status = -1; + writeAllServerStaffs(); + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - var sendStr = "There is the history tree of all participating parties on the build of this server:\r\n\r\n"; - for(var i = 0; i < servers.length; i++) { - var hist = servers_history[i]; - - if(hist && hist.length > 0) { - sendStr += "#L" + i + "##b" + servers[i] + "#k -- " + ((hist[0] != hist[1]) ? hist[0] + " ~ " + hist[1] : hist[0]) + "#l\r\n"; - } else { - sendStr += "#L" + i + "##b" + servers[i] + "#k#l\r\n"; - } - } - - cm.sendSimple(sendStr); - } else if(status == 1) { - var lvName, lvRole; - - for(var i = 0; i < servers.length; i++) { - if(selection == i) { - lvName = name_tree[i]; - lvRole = role_tree[i]; - break; - } - } - - var sendStr = "The staff of #b" + servers[selection] + "#k:\r\n\r\n"; - for(var i = 0; i < lvName.length; i++) { - sendStr += " #L" + i + "# " + lvName[i] + " - " + lvRole[i]; - sendStr += "#l\r\n"; - } - - cm.sendPrev(sendStr); - } else { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var sendStr = "There is the history tree of all participating parties on the build of this server:\r\n\r\n"; + for (var i = 0; i < servers.length; i++) { + var hist = servers_history[i]; + + if (hist && hist.length > 0) { + sendStr += "#L" + i + "##b" + servers[i] + "#k -- " + ((hist[0] != hist[1]) ? hist[0] + " ~ " + hist[1] : hist[0]) + "#l\r\n"; + } else { + sendStr += "#L" + i + "##b" + servers[i] + "#k#l\r\n"; + } + } + + cm.sendSimple(sendStr); + } else if (status == 1) { + var lvName, lvRole; + + for (var i = 0; i < servers.length; i++) { + if (selection == i) { + lvName = name_tree[i]; + lvRole = role_tree[i]; + break; + } + } + + var sendStr = "The staff of #b" + servers[selection] + "#k:\r\n\r\n"; + for (var i = 0; i < lvName.length; i++) { + sendStr += " #L" + i + "# " + lvName[i] + " - " + lvRole[i]; + sendStr += "#l\r\n"; + } + + cm.sendPrev(sendStr); + } else { + cm.dispose(); + } + } } diff --git a/scripts/npc/gachapon.js b/scripts/npc/gachapon.js index 5913301043..a0b4f51c8a 100644 --- a/scripts/npc/gachapon.js +++ b/scripts/npc/gachapon.js @@ -31,43 +31,44 @@ var curMapName = ""; function start() { status = -1; - curMapName = mapName[(cm.getNpc() != 9100117 && cm.getNpc() != 9100109) ? (cm.getNpc() - 9100100) : cm.getNpc() == 9100109 ? 9 : 11]; - + curMapName = mapName[(cm.getNpc() != 9100117 && cm.getNpc() != 9100109) ? (cm.getNpc() - 9100100) : cm.getNpc() == 9100109 ? 9 : 11]; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; + } if (status == 0 && mode == 1) { - if (cm.haveItem(ticketId)) { - cm.sendYesNo("You may use the " + curMapName + " Gachapon. Would you like to use your Gachapon ticket?"); - } else { - cm.sendSimple("Welcome to the " + curMapName + " Gachapon. How may I help you?\r\n\r\n#L0#What is Gachapon?#l\r\n#L1#Where can you buy Gachapon tickets?#l"); - } - } else if(status == 1 && cm.haveItem(ticketId)) { - if(cm.canHold(1302000) && cm.canHold(2000000) && cm.canHold(3010001) && cm.canHold(4000000)) { // One free slot in every inventory. - cm.gainItem(ticketId, -1); - cm.doGachapon(); - } else { - cm.sendOk("Please have at least one slot in your #rEQUIP, USE, SET-UP, #kand #rETC#k inventories free."); - } - cm.dispose(); - } else if(status == 1) { - if (selection == 0) { + if (cm.haveItem(ticketId)) { + cm.sendYesNo("You may use the " + curMapName + " Gachapon. Would you like to use your Gachapon ticket?"); + } else { + cm.sendSimple("Welcome to the " + curMapName + " Gachapon. How may I help you?\r\n\r\n#L0#What is Gachapon?#l\r\n#L1#Where can you buy Gachapon tickets?#l"); + } + } else if (status == 1 && cm.haveItem(ticketId)) { + if (cm.canHold(1302000) && cm.canHold(2000000) && cm.canHold(3010001) && cm.canHold(4000000)) { // One free slot in every inventory. + cm.gainItem(ticketId, -1); + cm.doGachapon(); + } else { + cm.sendOk("Please have at least one slot in your #rEQUIP, USE, SET-UP, #kand #rETC#k inventories free."); + } + cm.dispose(); + } else if (status == 1) { + if (selection == 0) { cm.sendNext("Play Gachapon to earn rare scrolls, equipment, chairs, mastery books, and other cool items! All you need is a #bGachapon Ticket#k to be the winner of a random mix of items."); } else { cm.sendNext("Gachapon Tickets are available in the #rCash Shop#k and can be purchased using NX or Maple Points. Click on the red SHOP at the lower right hand corner of the screen to visit the #rCash Shop#k where you can purchase tickets."); } - } else if(status == 2) { - cm.sendNextPrev("You'll find a variety of items from the " + curMapName + " Gachapon, but you'll most likely find items and scrolls related to " + curMapName + "."); - } else { - cm.dispose(); - } + } else if (status == 2) { + cm.sendNextPrev("You'll find a variety of items from the " + curMapName + " Gachapon, but you'll most likely find items and scrolls related to " + curMapName + "."); + } else { + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/gachaponInfo.js b/scripts/npc/gachaponInfo.js index a803118eaa..3e6b4f96f6 100644 --- a/scripts/npc/gachaponInfo.js +++ b/scripts/npc/gachaponInfo.js @@ -21,41 +21,42 @@ * @author: Ronan * @npc: Pio * @func: Gachapon Loot Announcer -*/ + */ var status; var gachaMessages; - + function start() { - const Gachapon = Java.type('server.gachapon.Gachapon'); - gachaMessages = Gachapon.GachaponType.getLootInfo(); - gachas = Gachapon.GachaponType.values(); - - status = -1; - action(1, 0, 0); + const Gachapon = Java.type('server.gachapon.Gachapon'); + gachaMessages = Gachapon.GachaponType.getLootInfo(); + gachas = Gachapon.GachaponType.values(); + + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - var sendStr = "Hi, #r#p" + cm.getNpc() + "##k here! I'm announcing all obtainable loots from the Gachapons. Which Gachapon machine would you like to look?\r\n\r\n#b" + gachaMessages[0] + "#k"; - cm.sendSimple(sendStr); - } else if(status == 1) { - var sendStr = "Loots from #b" + gachas[selection].name() + "#k:\r\n\r\n" + gachaMessages[selection + 1]; - cm.sendPrev(sendStr); - } else if(status == 2) { - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var sendStr = "Hi, #r#p" + cm.getNpc() + "##k here! I'm announcing all obtainable loots from the Gachapons. Which Gachapon machine would you like to look?\r\n\r\n#b" + gachaMessages[0] + "#k"; + cm.sendSimple(sendStr); + } else if (status == 1) { + var sendStr = "Loots from #b" + gachas[selection].name() + "#k:\r\n\r\n" + gachaMessages[selection + 1]; + cm.sendPrev(sendStr); + } else if (status == 2) { + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/gachaponRemote.js b/scripts/npc/gachaponRemote.js index 994855da15..2a07560ed7 100644 --- a/scripts/npc/gachaponRemote.js +++ b/scripts/npc/gachaponRemote.js @@ -31,28 +31,29 @@ var curMapName = ""; function start() { status = -1; - curMapName = mapName[(cm.getNpc() != 9100117 && cm.getNpc() != 9100109) ? (cm.getNpc() - 9100100) : cm.getNpc() == 9100109 ? 8 : 9]; - + curMapName = mapName[(cm.getNpc() != 9100117 && cm.getNpc() != 9100109) ? (cm.getNpc() - 9100100) : cm.getNpc() == 9100109 ? 8 : 9]; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode < 0) + if (mode < 0) { cm.dispose(); - else { - if (mode == 1) + } else { + if (mode == 1) { status++; - else + } else { status--; - if(status == 0 && cm.haveItem(ticketId)) { - if(cm.canHold(1302000) && cm.canHold(2000000) && cm.canHold(3010001) && cm.canHold(4000000)) { // One free slot in every inventory. - cm.gainItem(ticketId, -1); - cm.doGachapon(); - } else { - cm.sendOk("Please have at least one slot in your #rEQUIP, USE, SET-UP, #kand #rETC#k inventories free."); - } - } else { - cm.dispose(); - } + } + if (status == 0 && cm.haveItem(ticketId)) { + if (cm.canHold(1302000) && cm.canHold(2000000) && cm.canHold(3010001) && cm.canHold(4000000)) { // One free slot in every inventory. + cm.gainItem(ticketId, -1); + cm.doGachapon(); + } else { + cm.sendOk("Please have at least one slot in your #rEQUIP, USE, SET-UP, #kand #rETC#k inventories free."); + } + } else { + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/gachaponold.js b/scripts/npc/gachaponold.js index e4b660644f..233ae45f38 100644 --- a/scripts/npc/gachaponold.js +++ b/scripts/npc/gachaponold.js @@ -32,9 +32,10 @@ var remoteGachapon = false; var ticketId = 5220000; function start() { - if(remoteGachapon) - ticketId = 5451000; - + if (remoteGachapon) { + ticketId = 5451000; + } + if (cm.haveItem(ticketId)) { cm.sendYesNo("You may use Gachapon. Would you like to use your Gachapon ticket?"); } else { @@ -42,17 +43,17 @@ function start() { } } -function action(mode, type, selection){ - if(mode == -1) { - cm.dispose(); - } else if (mode == 1 && cm.haveItem(ticketId)) { - if(cm.canHold(1302000) && cm.canHold(2000000) && cm.canHold(3010001) && cm.canHold(4000000)) { // One free slot in every inventory. - cm.gainItem(ticketId, -1); - cm.doGachapon(); - } else { - cm.sendOk("Please have at least one slot in your #rEQUIP, USE, SET-UP, #kand #bETC#k inventories free."); - } - cm.dispose(); +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else if (mode == 1 && cm.haveItem(ticketId)) { + if (cm.canHold(1302000) && cm.canHold(2000000) && cm.canHold(3010001) && cm.canHold(4000000)) { // One free slot in every inventory. + cm.gainItem(ticketId, -1); + cm.doGachapon(); + } else { + cm.sendOk("Please have at least one slot in your #rEQUIP, USE, SET-UP, #kand #bETC#k inventories free."); + } + cm.dispose(); } else { if (mode > 0) { status++; @@ -64,10 +65,10 @@ function action(mode, type, selection){ cm.sendNext("You'll find a variety of items from the " + cm.getPlayer().getMap().getMapName() + " Gachapon, but you'll most likely find several related items and scrolls since " + cm.getPlayer().getMap().getMapName() + " is known as the town."); cm.dispose(); } else { - - } + + } } else { - cm.dispose(); - } + cm.dispose(); + } } } \ No newline at end of file diff --git a/scripts/npc/mapleTV.js b/scripts/npc/mapleTV.js index 5a66c176d9..d0cd016385 100644 --- a/scripts/npc/mapleTV.js +++ b/scripts/npc/mapleTV.js @@ -22,35 +22,36 @@ */ var status; - -function start() { - const YamlConfig = Java.type('config.YamlConfig'); - if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { - cm.dispose(); - cm.openNpc(9201088, "scroll_generator"); - return; - } - status = -1; - action(1, 0, 0); +function start() { + const YamlConfig = Java.type('config.YamlConfig'); + if (YamlConfig.config.server.USE_ENABLE_CUSTOM_NPC_SCRIPT) { + cm.dispose(); + cm.openNpc(9201088, "scroll_generator"); + return; + } + + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - // do nothing - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + // do nothing + cm.dispose(); + } + } } \ No newline at end of file diff --git a/scripts/npc/rank_user.js b/scripts/npc/rank_user.js index e99b63f908..273db7deab 100644 --- a/scripts/npc/rank_user.js +++ b/scripts/npc/rank_user.js @@ -22,43 +22,44 @@ * Player NPC Ranking System */ var status; - + function start() { - status = -1; - action(1, 0, 0); + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if(status == 0) { - var pnpc = cm.getPlayerNPCByScriptid(cm.getNpc()); - - if(pnpc != null) { - const GameConstants = Java.type('constants.game.GameConstants'); - var branchJobName = GameConstants.getJobName(pnpc.getJob()); - - var rankStr = "Hi, I am #b" + pnpc.getName() + "#k, #r" + GameConstants.ordinal(pnpc.getWorldJobRank()) + "#k in the #r" + branchJobName + "#k class to reach the max level and obtain a statue on " + GameConstants.WORLD_NAMES[cm.getPlayer().getWorld()] + ".\r\n"; - rankStr += "\r\n World rank: #e#b" + GameConstants.ordinal(pnpc.getWorldRank()) + "#k#n"; - rankStr += "\r\n Overall " + branchJobName + " rank: #e#b" + GameConstants.ordinal(pnpc.getOverallJobRank()) + "#k#n"; - rankStr += "\r\n Overall rank: #e#b" + GameConstants.ordinal(pnpc.getOverallRank()) + "#k#n"; - - cm.sendOk(rankStr); - } else { - cm.sendOk("Hi, how're you doing?"); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + var pnpc = cm.getPlayerNPCByScriptid(cm.getNpc()); + + if (pnpc != null) { + const GameConstants = Java.type('constants.game.GameConstants'); + var branchJobName = GameConstants.getJobName(pnpc.getJob()); + + var rankStr = "Hi, I am #b" + pnpc.getName() + "#k, #r" + GameConstants.ordinal(pnpc.getWorldJobRank()) + "#k in the #r" + branchJobName + "#k class to reach the max level and obtain a statue on " + GameConstants.WORLD_NAMES[cm.getPlayer().getWorld()] + ".\r\n"; + rankStr += "\r\n World rank: #e#b" + GameConstants.ordinal(pnpc.getWorldRank()) + "#k#n"; + rankStr += "\r\n Overall " + branchJobName + " rank: #e#b" + GameConstants.ordinal(pnpc.getOverallJobRank()) + "#k#n"; + rankStr += "\r\n Overall rank: #e#b" + GameConstants.ordinal(pnpc.getOverallRank()) + "#k#n"; + + cm.sendOk(rankStr); + } else { + cm.sendOk("Hi, how're you doing?"); + } + + cm.dispose(); + } + } } diff --git a/scripts/npc/scroll_generator.js b/scripts/npc/scroll_generator.js index 9b7fb4b97f..91acf32a0a 100644 --- a/scripts/npc/scroll_generator.js +++ b/scripts/npc/scroll_generator.js @@ -60,37 +60,45 @@ function action(mode, type, selection) { cm.dispose(); return; } - if (mode == 1) + if (mode == 1) { status++; - else + } else { status--; + } - if(status == 0) { + if (status == 0) { cm.sendNext("This is the MapleTV Scroll Generator broadcast. Place your supplies or mesos earned throughout your adventure to redeem a prize! You can place #bany amount of supplies#k, however take note that placing #rdifferent supplies#k with #rbigger shots of any of them#k will improve the reward possibilities!"); - } else if(status == 1) { + } else if (status == 1) { var sendStr; //print("Book: " + sgBookBuckets + " Item: " + sgItemBuckets); - - if(sgItemBuckets > 0.0) sendStr = "With the items you have currently placed, you have #r" + sgBuckets + "#k buckets (#r" + (sgItemBuckets < 1.0 ? sgItemBuckets.toFixed(2) : Math.floor(sgItemBuckets)) + "#k supply buckets) for claiming a prize. Place supplies:"; - else sendStr = "You have placed no supplies yet. Place supplies:"; + + if (sgItemBuckets > 0.0) { + sendStr = "With the items you have currently placed, you have #r" + sgBuckets + "#k buckets (#r" + (sgItemBuckets < 1.0 ? sgItemBuckets.toFixed(2) : Math.floor(sgItemBuckets)) + "#k supply buckets) for claiming a prize. Place supplies:"; + } else { + sendStr = "You have placed no supplies yet. Place supplies:"; + } var listStr = ""; var i; - for(i = 0; i < sgItems.length; i++) { + for (i = 0; i < sgItems.length; i++) { listStr += "#b#L" + i + "##t" + sgItems[i] + "##k"; - if(sgAppliedItems[i] > 0) listStr += " - " + sgAppliedItems[i]; + if (sgAppliedItems[i] > 0) { + listStr += " - " + sgAppliedItems[i]; + } listStr += "#l\r\n"; } listStr += "#b#L" + i + "#Mesos#k"; - if(sgAppliedMeso > 0) listStr += " - " + sgAppliedMeso; + if (sgAppliedMeso > 0) { + listStr += " - " + sgAppliedMeso; + } listStr += "#l\r\n"; cm.sendSimple(sendStr + "\r\n\r\n" + listStr + "#r#L" + (sgItems.length + 2) + "#Retrieve a prize!#l#k\r\n"); - } else if(status == 2) { - if(selection == (sgItems.length + 2)) { - if(sgItemBuckets < 1.0) { + } else if (status == 2) { + if (selection == (sgItems.length + 2)) { + if (sgItemBuckets < 1.0) { cm.sendPrev("You have set not enough supplies. Insert at least one bucket of #bsupplies#k to claim a prize."); } else { generateRandomScroll(); @@ -98,37 +106,42 @@ function action(mode, type, selection) { } } else { var tickSel; - if(selection < sgItems.length) { + if (selection < sgItems.length) { tickSel = "of #b#t" + sgItems[selection] + "##k"; curItemQty = cm.getItemQuantity(sgItems[selection]); } else { tickSel = "#bmesos#k"; curItemQty = cm.getMeso(); } - + curItemSel = selection; - if(curItemQty > 0) { + if (curItemQty > 0) { cm.sendGetText("How many " + tickSel + " do you want to provide? (#r" + curItemQty + "#k available)#k"); } else { cm.sendPrev("You have got #rnone#k " + tickSel + " to provide for Scroll Generation. Click '#rBack#k' to return to the main interface."); } } - } else if(status == 3) { + } else if (status == 3) { var text = cm.getText(); try { var placedQty = parseInt(text); - if(isNaN(placedQty) || placedQty < 0) throw true; + if (isNaN(placedQty) || placedQty < 0) { + throw true; + } - if(placedQty > curItemQty) { + if (placedQty > curItemQty) { cm.sendPrev("You cannot insert the given amount of #r" + (curItemSel < sgItems.length ? "#t" + sgItems[curItemSel] + "#" : "mesos") + "#k (#r" + curItemQty + "#k available). Click '#rBack#k' to return to the main interface."); } else { - if(curItemSel < sgItems.length) sgApplyItem(curItemSel, placedQty); - else sgApplyMeso(placedQty); + if (curItemSel < sgItems.length) { + sgApplyItem(curItemSel, placedQty); + } else { + sgApplyMeso(placedQty); + } cm.sendPrev("Operation succeeded. Click '#rBack#k' to return to the main interface."); } - } catch(err) { + } catch (err) { cm.sendPrev("You must enter a positive number of supplies to insert. Click '#rBack#k' to return to the main interface."); } @@ -154,7 +167,7 @@ function getJobTierScrolls() { Array.prototype.push.apply(scrolls, jobScrolls[i]); } } - + return scrolls; } @@ -167,7 +180,7 @@ function getScrollTypePool(rewardTier) { } else { Array.prototype.push.apply(scrolls, getJobTierScrolls()); } - + Array.prototype.push.apply(scrolls, tier1Scrolls); break; case 2: @@ -176,7 +189,7 @@ function getScrollTypePool(rewardTier) { default: Array.prototype.push.apply(scrolls, tier3Scrolls); } - + return scrolls; } @@ -188,7 +201,7 @@ function getScrollTier(scrollStats) { } } } - + return 4; } @@ -209,7 +222,7 @@ function getAvailableScrollsPool(baseScrolls, rewardTier, successTier) { var scrolls = []; const ItemInformationProvider = Java.type('server.ItemInformationProvider'); var ii = ItemInformationProvider.getInstance(); - + for (var i = 0; i < baseScrolls.length; i++) { for (var j = 0; j < 100; j++) { var scrollid = baseScrolls[i] + j; @@ -252,7 +265,7 @@ function getPlayerCardTierPower() { countTier[mobTier] += (ce.getValue() * 1.2); } } - + return countTier; } @@ -266,14 +279,14 @@ function calculateMobBookTierBuckets(tierSize, playerCards, tier) { if (tierHitRate > 0.5) { tierHitRate = 0.5; } - + return tierHitRate * 4; } function calculateMobBookBuckets() { var book = cm.getPlayer().getMonsterBook(); var bookLevelMult = 0.9 + (0.1 * book.getBookLevel()); - + var playerLevelTier = getLevelTier(cm.getPlayer().getLevel()); if (playerLevelTier > 8) { playerLevelTier = 8; @@ -282,17 +295,17 @@ function calculateMobBookBuckets() { const MonsterBook = Java.type('client.MonsterBook'); var tierSize = MonsterBook.getCardTierSize(); var playerCards = getPlayerCardTierPower(); - + var prevBuckets = calculateMobBookTierBuckets(tierSize, playerCards, playerLevelTier - 1); var currBuckets = calculateMobBookTierBuckets(tierSize, playerCards, playerLevelTier); - + return (prevBuckets + currBuckets) * bookLevelMult; } function recalcBuckets() { sgBookBuckets = calculateMobBookBuckets(); sgItemBuckets = calculateSuppliesBuckets(); - + var buckets = sgBookBuckets + sgItemBuckets; if (buckets > 6.0) { sgBuckets = 6; @@ -338,9 +351,9 @@ function calculateScrollTiers() { pool.push(i); } } - + var rnd = pool[Math.floor(Math.random() * pool.length)]; - + tiers[rnd]++; buckets--; } @@ -357,7 +370,7 @@ function getRandomScrollFromTiers(tiers) { var typeTier = tiers[0], subtypeTier = tiers[1], successTier = tiers[2]; var scrollTypePool = getScrollTypePool(typeTier); var scrollPool = getAvailableScrollsPool(scrollTypePool, subtypeTier, successTier); - + if (scrollPool.length > 0) { return scrollPool[Math.floor(Math.random() * scrollPool.length)]; } else { @@ -391,7 +404,7 @@ function getRandomScroll(tiers) { // worst case shift-right permutations... itemid = getRandomScrollFromRightPermutations(tiers); } - + return itemid; } @@ -399,7 +412,7 @@ function performExchange(sgItemid, sgCount) { if (cm.getMeso() < sgAppliedMeso) { return false; } - + for (var i = 0; i < sgItems.length; i++) { var itemid = sgItems[i]; var count = sgAppliedItems[i]; @@ -409,7 +422,7 @@ function performExchange(sgItemid, sgCount) { } cm.gainMeso(-sgAppliedMeso); - + for (var i = 0; i < sgItems.length; i++) { var itemid = sgItems[i]; var count = sgAppliedItems[i]; diff --git a/scripts/npc/unidentifiedNpc.js b/scripts/npc/unidentifiedNpc.js index 66ec4e2a18..2907ef6085 100644 --- a/scripts/npc/unidentifiedNpc.js +++ b/scripts/npc/unidentifiedNpc.js @@ -1,3 +1,3 @@ function start() { - cm.sendOk("NPC: " + cm.getNpc() + " is not found, please report this."); + cm.sendOk("NPC: " + cm.getNpc() + " is not found, please report this."); } \ No newline at end of file diff --git a/scripts/npc/waterOfLife.js b/scripts/npc/waterOfLife.js index fbeb877ec4..62aa82158e 100644 --- a/scripts/npc/waterOfLife.js +++ b/scripts/npc/waterOfLife.js @@ -25,69 +25,70 @@ var status; var dList; - + function start() { - status = -1; - dList = cm.getDriedPets(); - if(dList.size() == 0) { - cm.playerMessage(5, "You currently do not own a pet that needs to be treated with Water of Life."); - cm.dispose(); - return; - } - - action(1, 0, 0); + status = -1; + dList = cm.getDriedPets(); + if (dList.size() == 0) { + cm.playerMessage(5, "You currently do not own a pet that needs to be treated with Water of Life."); + cm.dispose(); + return; + } + + action(1, 0, 0); } function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) - status++; - else - status--; - - if (status == 0) { - cm.sendYesNo("I am Mar the Fairy. You have the #bWater of Life#k... With this, I can bring a doll back to life with my magic. What do you think? Do you want to use this item and reawaken your pet ...?"); - - } else if (status == 1) { - var talkStr = "So which pet you want to reawaken? Please choose the pet you'd most like to reawaken...\r\n\r\n"; - - var listStr = ""; - var i = 0; - - var dIter = dList.iterator(); - while (dIter.hasNext()){ - var dPet = dIter.next(); - - listStr += "#b#L" + i + "# " + dPet.getName() + " #k - Lv " + dPet.getLevel() + " Closeness " + dPet.getCloseness(); - listStr += "#l\r\n"; - - i++; - } - - cm.sendSimple(talkStr + listStr); - } else if (status == 2) { - var sPet = dList.get(selection); - - if(sPet != null) { - cm.sendNext("Your doll has now reawaken as your pet! However, my magic isn't perfect, so I can't promise an eternal life for your pet... Please take care of that pet before the Water of Life dries. Well then, good bye..."); - - const InventoryType = Java.type('client.inventory.InventoryType'); - var it = cm.getPlayer().getInventory(InventoryType.CASH).getItem(sPet.getPosition()); - it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90)); - cm.getPlayer().forceUpdateItem(it); - - cm.gainItem(5180000, -1); - } else { - cm.sendNext("Oh, well then. Good bye..."); - } - - cm.dispose(); - } + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; } + if (mode == 1) { + status++; + } else { + status--; + } + + if (status == 0) { + cm.sendYesNo("I am Mar the Fairy. You have the #bWater of Life#k... With this, I can bring a doll back to life with my magic. What do you think? Do you want to use this item and reawaken your pet ...?"); + + } else if (status == 1) { + var talkStr = "So which pet you want to reawaken? Please choose the pet you'd most like to reawaken...\r\n\r\n"; + + var listStr = ""; + var i = 0; + + var dIter = dList.iterator(); + while (dIter.hasNext()) { + var dPet = dIter.next(); + + listStr += "#b#L" + i + "# " + dPet.getName() + " #k - Lv " + dPet.getLevel() + " Closeness " + dPet.getCloseness(); + listStr += "#l\r\n"; + + i++; + } + + cm.sendSimple(talkStr + listStr); + } else if (status == 2) { + var sPet = dList.get(selection); + + if (sPet != null) { + cm.sendNext("Your doll has now reawaken as your pet! However, my magic isn't perfect, so I can't promise an eternal life for your pet... Please take care of that pet before the Water of Life dries. Well then, good bye..."); + + const InventoryType = Java.type('client.inventory.InventoryType'); + var it = cm.getPlayer().getInventory(InventoryType.CASH).getItem(sPet.getPosition()); + it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90)); + cm.getPlayer().forceUpdateItem(it); + + cm.gainItem(5180000, -1); + } else { + cm.sendNext("Oh, well then. Good bye..."); + } + + cm.dispose(); + } + } } \ No newline at end of file