From bae4b92e560c2694eaaf0e8b4d9e95e56204471b Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 18 Jun 2011 21:58:47 -0700 Subject: Move to a subdirectory --- world/map/npc/functions/banker.txt | 228 ++++++++++++++++++++++++++++++ world/map/npc/functions/barber.txt | 63 +++++++++ world/map/npc/functions/clear_vars.txt | 126 +++++++++++++++++ world/map/npc/functions/dailyquest.txt | 99 +++++++++++++ world/map/npc/functions/evil_obelisk.txt | 70 +++++++++ world/map/npc/functions/ferry.txt | 73 ++++++++++ world/map/npc/functions/game_rules.txt | 155 ++++++++++++++++++++ world/map/npc/functions/inn.txt | 29 ++++ world/map/npc/functions/magic.txt | 176 +++++++++++++++++++++++ world/map/npc/functions/mob_points.txt | 126 +++++++++++++++++ world/map/npc/functions/process_equip.txt | 27 ++++ world/map/npc/functions/slot_machine.txt | 35 +++++ world/map/npc/functions/soul_menhir.txt | 47 ++++++ world/map/npc/functions/strangerquiz.txt | 7 + world/map/npc/functions/water_bottle.txt | 34 +++++ 15 files changed, 1295 insertions(+) create mode 100644 world/map/npc/functions/banker.txt create mode 100644 world/map/npc/functions/barber.txt create mode 100644 world/map/npc/functions/clear_vars.txt create mode 100644 world/map/npc/functions/dailyquest.txt create mode 100644 world/map/npc/functions/evil_obelisk.txt create mode 100644 world/map/npc/functions/ferry.txt create mode 100644 world/map/npc/functions/game_rules.txt create mode 100644 world/map/npc/functions/inn.txt create mode 100644 world/map/npc/functions/magic.txt create mode 100644 world/map/npc/functions/mob_points.txt create mode 100644 world/map/npc/functions/process_equip.txt create mode 100644 world/map/npc/functions/slot_machine.txt create mode 100644 world/map/npc/functions/soul_menhir.txt create mode 100644 world/map/npc/functions/strangerquiz.txt create mode 100644 world/map/npc/functions/water_bottle.txt (limited to 'world/map/npc/functions') diff --git a/world/map/npc/functions/banker.txt b/world/map/npc/functions/banker.txt new file mode 100644 index 00000000..3c060071 --- /dev/null +++ b/world/map/npc/functions/banker.txt @@ -0,0 +1,228 @@ +// + +function script Banker { + + if (BankAccount > 0) callsub S_MoveAccount; + +L_Start: + mes "[" + @npcname$ + "]"; + mes "\"Welcome to the bank!"; + mes "How can I help you?\""; + next; + menu + "Deposit", L_Dep, + "Withdraw", L_With, + "Check my balance", L_Balance, + "Open my storage", L_Storage, + "Change Bank Options", L_Change, + "Nevermind", L_Nev; + + close; + +// need to close window before opening storage. +L_Storage: + if (#BankOptions & OPT_STORAGE_CLOSE) close2; + openstorage; + if (#BankOptions & OPT_STORAGE_CLOSE) end; + goto L_Start; + +L_Dep: + mes "[" + @npcname$ + "]"; + mes "\"How much would you like to deposit?\""; + next; + menu + "Other", L_Dep_Input, + "5,000 GP", L_Dep_5k, + "10,000 GP", L_Dep_10k, + "25,000 GP", L_Dep_25k, + "50,000 GP", L_Dep_50k, + "100,000 GP", L_Dep_100k, + "250,000 GP", L_Dep_250k, + "500,000 GP", L_Dep_500k, + "1,000,000 GP", L_Dep_1kk, + "All of my money", L_Dep_All, + "I've changed my mind", L_Start, + "Quit", -; + return; + +L_Dep_Input: + input @Amount; + if (@Amount >= 0) goto L_Dep_Continue; + mes "[" + @npcname$ + "]"; + mes "\"I need a positive amount. What would you like to do?\""; + menu + "Go back", L_Start, + "Try again", L_Dep_Input, + "Deposit all", L_Dep_All, + "Nevermind", -; + goto L_Nev; + +L_Dep_5k: + if (zeny<5000) goto L_NoMoney; + set @Amount, 5000; + goto L_Dep_Continue; + +L_Dep_10k: + if (zeny<10000) goto L_NoMoney; + set @Amount, 10000; + goto L_Dep_Continue; + +L_Dep_25k: + if (zeny<25000) goto L_NoMoney; + set @Amount, 25000; + goto L_Dep_Continue; + +L_Dep_50k: + if (zeny<50000) goto L_NoMoney; + set @Amount, 50000; + goto L_Dep_Continue; + +L_Dep_100k: + if (zeny<100000) goto L_NoMoney; + set @Amount, 100000; + goto L_Dep_Continue; + +L_Dep_250k: + if (zeny<250000) goto L_NoMoney; + set @Amount, 250000; + goto L_Dep_Continue; + +L_Dep_500k: + if (zeny<500000) goto L_NoMoney; + set @Amount, 500000; + goto L_Dep_Continue; + +L_Dep_1kk: + if (zeny<1000000) goto L_NoMoney; + set @Amount, 1000000; + goto L_Dep_Continue; + +L_Dep_All: + if (zeny<1) goto L_NoMoney; + set @Amount, zeny; + +L_Dep_Continue: + if (zeny < @Amount) goto L_NoMoney; + set zeny, zeny - @Amount; + set #BankAccount, #BankAccount + @Amount; + goto L_Balance; + +L_With: + mes "[" + @npcname$ + "]"; + mes "\"How much would you like to withdraw?\""; + menu + "Other", L_With_Input, + "5,000 GP", L_With_5k, + "10,000 GP", L_With_10k, + "25,000 GP", L_With_25k, + "50,000 GP", L_With_50k, + "100,000 GP", L_With_100k, + "250,000 GP", L_With_250k, + "500,000 GP", L_With_500k, + "1,000,000 GP", L_With_1kk, + "All of my money", L_With_All, + "I've changed my mind", L_Start, + "Quit", -; + return; + +L_With_Input: + input @Amount; + if (@Amount >= 0) goto L_With_Continue; + mes "[" + @npcname$ + "]"; + mes "\"I need a positive amount. What would you like to do?\""; + menu + "Go back", L_Start, + "Try again", L_With_Input, + "Withdraw all", L_With_All, + "Nevermind", -; + goto L_Nev; + +L_With_5k: + if (#BankAccount < 5000) goto L_NoMoney; + set @Amount, 5000; + goto L_With_Continue; + +L_With_10k: + if (#BankAccount < 10000) goto L_NoMoney; + set @Amount, 10000; + goto L_With_Continue; + +L_With_25k: + if (#BankAccount < 25000) goto L_NoMoney; + set @Amount, 25000; + goto L_With_Continue; + +L_With_50k: + if (#BankAccount < 50000) goto L_NoMoney; + set @Amount, 50000; + goto L_With_Continue; + +L_With_100k: + if (#BankAccount < 100000) goto L_NoMoney; + set @Amount, 100000; + goto L_With_Continue; + +L_With_250k: + if (#BankAccount < 250000) goto L_NoMoney; + set @Amount, 250000; + goto L_With_Continue; + +L_With_500k: + if (#BankAccount < 500000) goto L_NoMoney; + set @Amount, 500000; + goto L_With_Continue; + +L_With_1kk: + if (#BankAccount < 1000000) goto L_NoMoney; + set @Amount, 1000000; + goto L_With_Continue; + +L_With_All: + if (#BankAccount < 0) goto L_NoMoney; + set @Amount, #BankAccount; + +L_With_Continue: + if (#BankAccount < @Amount) goto L_NoMoney; + set zeny, zeny + @Amount; + set #BankAccount, #BankAccount - @Amount; + goto L_Balance; + +L_Balance: + mes "[" + @npcname$ + "]"; + mes "\"Your current bank balance is:"; + mes #BankAccount + " GP\""; + if (#BankOptions & OPT_BANK_CLOSE) close; + goto L_Start; + +L_Nev: + mes "[" + @npcname$ + "]"; + mes "\"Goodbye then.\""; + return; + +L_NoMoney: + mes "[" + @npcname$ + "]"; + mes "\"Oh dear, it seems that you don't have enough money.\""; + goto L_Start; + +S_MoveAccount: + set #BankAccount, #BankAccount + BankAccount; + set BankAccount, 0; + return; + +L_Change: + setarray @menuitems$, "Keep the current settings", "Close NPC dialog after selecting storage option", "Close NPC dialog after checking your balance"; + if (#BankOptions & OPT_STORAGE_CLOSE) set @menuitems$[1], "Return to main menu after leaving storage"; + if (#BankOptions & OPT_BANK_CLOSE) set @menuitems$[2], "Return to main menu after leaving bank"; + menu + @menuitems$[0], L_Start, + @menuitems$[1], L_Change_Storage, + @menuitems$[2], L_Change_Bank; + +L_Change_Storage: + set #BankOptions, (#BankOptions ^ OPT_STORAGE_CLOSE); + goto L_Start; + +L_Change_Bank: + set #BankOptions, (#BankOptions ^ OPT_BANK_CLOSE); + goto L_Start; +} diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt new file mode 100644 index 00000000..8d0a32e3 --- /dev/null +++ b/world/map/npc/functions/barber.txt @@ -0,0 +1,63 @@ +// + +function script Barber { + menu + "Change my style", L_Style, + "Change my color", L_Color, + "Nah, I'm fine", L_Done; + + goto L_Done; + +L_Style: + menu + "Bald", -, + "Flat ponytail", -, + "Bowl cut", -, + "Combed back", -, + "Emo", -, + "Mohawk", -, + "Pompadour", -, + "Center parting/Short and slick", -, + "Long and slick", -, + "Short and curly", -, + "Pigtails", -, + "Long and curly", -, + "Parted", -, + "Perky ponytail", -, + "Wave", -, + "Mane", -, + "Bun", -, + "Shoulder Length Flick", -, + "Fizzy", -, + "Surprise me", -, + "Nah, I'm fine", L_Done; + +L_Process_Style: + set @style, @menu - 1; + if (@style == 19) set @style, rand(19); + setlook 1, @style; + return; + +L_Color: + menu + "Brunette", -, + "Green", -, + "Dark red", -, + "Light purple", -, + "Gray", -, + "Blonde", -, + "Teal", -, + "Light red", -, + "Blue", -, + "Dark purple", -, + "Black", -, + "Surprise me", -, + "Nah, I'm fine", L_Done; + set @color, @menu - 1; + if (@color == 11) set @color, rand(11); + setlook 6, @color; + return; + +L_Done: + return; +} diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt new file mode 100644 index 00000000..62eada3d --- /dev/null +++ b/world/map/npc/functions/clear_vars.txt @@ -0,0 +1,126 @@ +// Clears old variables + +function script ClearVariables { + // Halloween 2006 + set HWQUEST1, 0; + set HWQUEST2, 0; + set HWQUEST3, 0; + set HWQUEST4, 0; + set HWQUEST5, 0; + set HWQUEST6, 0; + set HWQUEST7, 0; + set HWQUEST8, 0; + set HWQUEST9, 0; + set HWQUEST10, 0; + set HWQUEST11, 0; + set HWQUEST12, 0; + set HWQUEST13, 0; + set HWQUEST14, 0; + set HWQUEST15, 0; + set HWQUEST16, 0; + set HWQUEST17, 0; + set HWQUEST18, 0; + set HWQUEST18, 0; + set HWQUEST19, 0; + set HWQUEST20, 0; + + // Christmas 2006 + set XMASQUEST1, 0; + set XMASQUEST2, 0; + set XMASQUEST3, 0; + set XMASQUEST4, 0; + set XMASQUEST5, 0; + set XMASQUEST6, 0; + set XMASQUEST7, 0; + set XMASQUEST8, 0; + set XMASQUEST9, 0; + set XMASQUEST10, 0; + set XMASQUEST11, 0; + set XMASQUEST12, 0; + set XMASQUEST13, 0; + set XMASQUEST14, 0; + set XMASQUEST15, 0; + set XMASQUEST16, 0; + set XMASQUEST17, 0; + set XMASQUEST18, 0; + set XMASQUEST19, 0; + set XMASQUEST20, 0; + + set QUEST_xmas07_state, 0; + set QUEST_xmas07_milk, 0; + set QUEST_xmas07_cookies, 0; + set QUEST_xmas07_presents, 0; + + set QUEST_Easter08_state, 0; + + set Halloween08, 0; + + set QUEST_xmas08_state, 0; + + set QUEST_Easter09, 0; + + set Candyman, 0; // Halloween 2009 + + set QUEST_Christmas09_state, 0; + + set QUEST_Easter09_slots, 0; + + // easter 2010 + // This must not be cleared: since some people would like to go to the easter island! + // set Easter_2010_QuestState, 0; + set Easter_2010_EggState1, 0; + set Easter_2010_EggState2, 0; + set Easter_2010_EggState3, 0; + set Easter_2010_EggState4, 0; + set Easter_2010_EggState5, 0; + + // halloween 2010 + set hween10, 0; + set hween10_collect_canpump, 0; + set hween10_credits, 0; + set hween10_collect, 0; + set hween10_collect_mmallow, 0; + set hween10_collect_jelskul, 0; + set hween10_bonecount, 0; + set hween10_collect_tondel, 0; + set hween10_paid, 0; + + // Xmas 2010: + set Count_Yellow, 0; + set Count_White, 0; + set Maze, 0; + set Yellow, 0; + set White, 0; + set Xmas2010, 0; + set Golbenez_Inn_Cost, 0; + + + //These lines are needed to migrate stuff from variables to flags + if (Open_Underground_Palace_Barrier) set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND; + set Open_Underground_Palace_Barrier, 0; + + if (Naem_Quest_Done) set FLAGS, FLAGS | FLAG_GOT_NAEM_GLOVES; + set Naem_Quest_Done, 0; + + if (#BankAccount < 0) goto FixBank; + + return; + +FixBank: + if (zeny >= -#BankAccount) goto L_Fix_Full; + + // Partial fix + set #BankAccount, #BankAccount + zeny; + set zeny, 0; + return; + +L_Fix_Full: + set zeny, zeny + #BankAccount; + set #BankAccount, 0; + return; +//Tulimshar and Mine Variables + set Scorp, 0; + set Bugleg, 0; + set ChestQuest, 0; + +} diff --git a/world/map/npc/functions/dailyquest.txt b/world/map/npc/functions/dailyquest.txt new file mode 100644 index 00000000..dc56895b --- /dev/null +++ b/world/map/npc/functions/dailyquest.txt @@ -0,0 +1,99 @@ +// The daily quests + +// Variables returned: +// @dq_return - Code of what happend +// 0 = Low level +// 1 = Ignored NPC +// 2 = Not enough points +// 3 = Not enough items +// 4 = Success + +// Variables to set: +// @dq_level - Minimal level needed to use the quest +// @dq_cost - The number of points this quest uses +// @dq_count - The number of given item needed +// @dq_name$ - String name of the item as seen by server +// @dq_friendly_name$ - String name of the item as seen by user +// @dq_money - The money reward for doing the quest +// @dq_exp - Experince gained by doing the quest + +// Optional: +// @dq_handle_return - When set to anything other then 0 the function will not print exiting text + +// Variables used inside: +// DailyQuestPoints - The number of points the player currently has +// DailyQuestTime - Time since DailyQuestPoints was lasted renewed +// DailyQuestBonus - Additional points added once in addition to player BaseLevel + +// (DailyQuestBonus makes a good reward from non-daily quests) + +function script DailyQuest { + set @dq_earliest, gettimetick(2) - 86400; + if (DailyQuestTime < @dq_earliest) set DailyQuestTime, @dq_earliest; + + //how many whole daily quest points the player has earned + //we increment DailyQuestTime by the number of seconds in that many increments + set @dq_increments, (gettimetick(2) - DailyQuestTime)*BaseLevel / 86400; + set DailyQuestTime, DailyQuestTime+@dq_increments*86400/BaseLevel; + + //player can't regenerate any quest points, but might have a bonus + if (DailyQuestPoints >= BaseLevel) goto L_Bonus; + + //normal recharging case - increment, but don't let it recharge more than a day's worth + set DailyQuestPoints, DailyQuestPoints + @dq_increments; + if (DailyQuestPoints > BaseLevel) set DailyQuestPoints, BaseLevel; + //fallthrough to bonus, which *is* allowed to push DailyQuestPoints above BaseLevel +L_Bonus: + if (DailyQuestBonus != 0) set DailyQuestPoints, DailyQuestPoints + DailyQuestBonus; + set DailyQuestBonus, 0; + + if (BaseLevel < @dq_level) goto L_Low_Level; + if (DailyQuestPoints < @dq_cost) goto L_Not_Enough_Points; + + mes "\"If you bring me " + @dq_count + " " + @dq_friendly_name$ + ", I will give you a reward.\""; + menu "I have what you want.", L_Trade, + "Ok, I'll get to work.", -, + "Nah, I'm not going to help you.", -; + + set @dq_return, 1; + goto L_Exit; + +L_Trade: + if (countitem(@dq_name$) < @dq_count) goto L_Not_Enough; + delitem @dq_name$, @dq_count; + + set zeny, zeny + @dq_money; + getexp @dq_exp, 0; + + set DailyQuestPoints, DailyQuestPoints - @dq_cost; + + if (@dq_handle_return) goto L_Exit_Good; + + mes "\"Thank you!\""; + mes ""; + mes "[" + @dq_money + " money]"; + mes "[" + @dq_exp + " experience points]"; + +L_Exit_Good: + set @dq_return, 4; + goto L_Exit; + +L_Not_Enough: + if (!@dq_handle_return) mes "\"I said " + @dq_count + " " + @dq_friendly_name$ + "; you should learn to count.\""; + set @dq_return, 3; + goto L_Exit; + +L_Low_Level: + if (!@dq_handle_return) mes "\"Hey, you should go kill some things to get stronger first.\""; + set @dq_return, 0; + goto L_Exit; + +L_Not_Enough_Points: + if (!@dq_handle_return) mes "\"You look exhausted, maybe you should rest a bit.\""; + set @dq_return, 2; + goto L_Exit; + +L_Exit: + set @dq_handle_return, 0; // Incase they forget + return; +} diff --git a/world/map/npc/functions/evil_obelisk.txt b/world/map/npc/functions/evil_obelisk.txt new file mode 100644 index 00000000..4de46eb9 --- /dev/null +++ b/world/map/npc/functions/evil_obelisk.txt @@ -0,0 +1,70 @@ +function script EvilObelisk { + mes "[Evil Obelisk]"; + mes "(A mystical aura surrounds this stone. It seems to crave money.)"; + next; + + menu + "Pay it 200,000 gold", L_JACKO, + "Pay it 100,000 gold", L_GRAVEYARD1, + "Pay it 75,000 gold", L_GRAVEYARD2, + "Pay it 50,000 gold", L_SKULL, + "Pay it 25,000 gold", L_SNAKE, + "Don't pay it anything.", -; + close; + return; + +L_JACKO: + if (zeny < 200000) goto L_NotEnough; + set zeny, zeny - 200000; + set @mob_id, 1022; + set @mob_count, rand(2) + 1; + goto L_Summon; + +L_GRAVEYARD1: + if (zeny < 100000) goto L_NotEnough; + set @temp, rand(2); + if(@temp == 0) set @mob_id, 1036; // Zombie + if(@temp == 1) set @mob_id, 1045; // Fallen + set @mob_count, rand(2) + 1; + set zeny, zeny - 100000; + goto L_Summon; + +L_GRAVEYARD2: + if (zeny < 75000) goto L_NotEnough; + set @temp, rand(2); + if(@temp == 0) set @mob_id, 1044; // Lady Skelly + if(@temp == 1) set @mob_id, 1043; // Normal Skelly + set @mob_count, rand(2) + 1; + set zeny, zeny - 75000; + goto L_Summon; + +L_SKULL: + if (zeny < 50000) goto L_NotEnough; + set @temp, rand(2); + if(@temp == 0) set @mob_id, 1024; // Poison + if(@temp == 1) set @mob_id, 1023; // Fire + set @mob_count, rand(4) + 1; + set zeny, zeny - 50000; + goto L_Summon; + +L_SNAKE: + if (zeny < 25000) goto L_NotEnough; + set @temp, rand(4); + if(@temp == 0) set @mob_id, 1034; // Grass + if(@temp == 1) set @mob_id, 1026; // Mnt. + if(@temp == 2) set @mob_id, 1010; // Normal + if(@temp == 3) set @mob_id, 1021; // Cave + set @mob_count, rand(4) + 1; + set zeny, zeny - 25000; + goto L_Summon; + +L_Summon: + monster @map$, @x, @y, "Evil", @mob_id, @mob_count; + close; + return; + +L_NotEnough: + mes "You don't have that much money"; + close; + return; +} diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt new file mode 100644 index 00000000..95a176ec --- /dev/null +++ b/world/map/npc/functions/ferry.txt @@ -0,0 +1,73 @@ +// The ferry system + +function script Ferry { + if (BaseLevel < 20) goto L_LowerCost; + set @cost_tulimshar, 500; + set @cost_hurnscald, 500; + +L_Start: + set @cost_candor, 1500; + mes "Where would you like to go?"; + next; + if (BaseLevel < 40) goto L_PlainMenu; + goto L_MenuWithCandor; + + +L_PlainMenu: + menu + "Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar, + "Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald, + "Nevermind", -; + close; + +L_MenuWithCandor: + menu + "Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar, + "Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald, + "Candor (" + @cost_candor + "GP)", L_Candor, + "Nevermind", -; + close; + +L_Tulimshar: + if (@loc == DOCK_tulimshar) + goto L_AlreadyThere; + if (zeny < @cost_tulimshar) + goto L_NotEnoughGP; + + set zeny, zeny - @cost_tulimshar; + warp "022-1.gat", 76, 72; + close; + +L_Hurnscald: + if (@loc == DOCK_hurnscald) + goto L_AlreadyThere; + if (zeny < @cost_hurnscald) + goto L_NotEnoughGP; + + set zeny, zeny - @cost_hurnscald; + warp "008-1.gat", 137, 64; + close; + +L_Candor: + if (@loc == DOCK_candor) + goto L_AlreadyThere; + if (zeny < @cost_candor) + goto L_NotEnoughGP; + + set zeny, zeny - @cost_candor; + warp "029-1.gat", 25, 37; + close; + +L_AlreadyThere: + mes "You're already here!"; + close; + +L_NotEnoughGP: + mes "You don't have enough money to go there!"; + close; + +L_LowerCost: + set @cost_tulimshar, 250; + set @cost_hurnscald, 250; + goto L_Start; +} diff --git a/world/map/npc/functions/game_rules.txt b/world/map/npc/functions/game_rules.txt new file mode 100644 index 00000000..d67887f3 --- /dev/null +++ b/world/map/npc/functions/game_rules.txt @@ -0,0 +1,155 @@ +// + +function script GameRules { + set @read, 0; + + menu + "English", L_English, + "Deutsch (German)", L_German, + "Nederlands (Dutch)", L_Dutch, + "Dansk (Danish)", L_Danish, + "Francais (French)", L_French, + "Castellano (Spanish)", L_Spanish, + "Svenska (Swedish)", L_Swedish, + "Portugues (Portuguese)", L_Portuguese, + "Polski (Polish)", L_Polish, + "Italiano (Italian)", L_Italian; + if (@canSkip) return; + +L_English: + mes "Players breaking the following rules may be banned (up to and including a permanent ban) or have their characters reset at the GM's discretion:"; + mes "1. Do not abuse other players (insults, swearing, and the like directed to a particular person or persons)"; + mes "2. No bots (and botting means ANY activity while away from keyboard)"; + mes "3. No spamming / flooding (including trade spam)"; + mes "4. No begging"; + mes "5. Speak English on public chat"; + mes "6. Treat others the same way you would like to be treated"; + next; + mes "Botting will be determined by talking to players who are moving and/or attacking."; + next; + goto L_End; + +L_German: + mes "Wir bitten um das Einhalten der folgenden Regeln:"; + mes "1. Keine Beleidigungen, Schimpfwoerter, Schmaehungen oder Rufmord."; + mes "2. Keine 'bots' (automatisierte Spieler). Dies beinhaltet JEGLICHE Teilnahme am Spiel waehrend der Abwesenheit des Spielers."; + mes "3. Kein 'spamming' oder 'flooding' (schnelles Wiederholen von Nachrichten oder Aufforderungen zum Warenhandel)."; + mes "4. Kein Betteln."; + mes "5. Englisch ist die einzige zulaessige Sprache im oeffentlichen Raum."; + mes "6. Behandelt andere so, wie Ihr behandelt werden wollt."; + mes "Jegliche Regelverstoesse koennen bestraft werden, entweder durch ein Zuruecksetzen der Charaktereigenschaften und -besitztuemer auf den Ausgangszustand, oder durch einen temporaeren oder permanenten Ausschluss aus dem Spiel."; + next; + mes "Automatisiertes Spielverhalten liegt vor, wenn ein sich bewegender/kaempfender Spieler nicht intelligent auf Gespraechsaufforderungen reagiert."; + next; + goto L_End; + +L_Dutch: + mes "Spelers die de volgende regels overtreden lopen het risico gebanned te worden (oplopend tot een permanente ban) of een reset te krijgen:"; + mes "1. Misbruik geen andere spelers (vloeken, groftaal gebruik, enzovoort tegen een bepaalde persoon of personen)"; + mes "2. Geen 'bots' (geautomatiseerde speler) en botten betekend ELKE activiteit terwijl je van je toetsenboord weg bent"; + mes "3. Verboden te 'spammen' (inclusief het spammen van ruilaanvragen)"; + mes "4. Verboden te bedelen"; + mes "5. Spreek Engels op de publieke chat"; + mes "6. Behandel andere zoals ook jij behandeld wilt worden"; + next; + mes "Botten word bepaald door te praten tegen spelers die aan het bewegen en/of aanvallen zijn."; + next; + goto L_End; + +L_Danish: + mes "Spillere der ikke overholder de foelgende regner, kan risikere at blive banned (op til et permanent ban) eller faa deres bruger nulstillet af en spilmester (GM)."; + mes "1. Misbrug ikke medspillere (fornaerm dem ikke, svaerg ikke og mobning er forbudt)"; + mes "2. Det er forbudt at bruge bots (Botting betyder at man er aktiv inde i spillet, imens man er vaek fra ens keyboard)"; + mes "3. Det er forbudt at spamme i chatten, eller lave trade spam (spamme betyder at man sender mange beskeder efter hinanden)"; + mes "4. Det er forbudt at tigge (for eksempel: Maa jeg ikke nok faa dit svaerd, kom nu, vaer nu soed... og saa videre)"; + mes "5. Det er forbudt at snakke andre sprog end Engelsk, i den aabne chat. (Dog er det lovligt ved at bruge foelgende kommandoen /whisper)"; + mes "6. Husk at goere mod andre, som du vil have de skal goere imod dig (opfoer dig ordenligt!)"; + next; + mes "Botting bliver fastlagt paa grundlag af, at man snakker til andre spillere, der gaar rundt og/eller der angriber og de ikke svare igen."; + next; + goto L_End; + +L_French: + mes "Les joueurs ne respectant pas les regles suivantes pourront, a la discretion des moderateurs (GM), etre bannis (jusqu'au banissement eternel inclus) ou avoir leur personnage reinitialise :"; + mes "1. Ne manquez pas de respect envers les autres joueurs (insultes, language grossier, et autres choses du meme genre a l'intention d'un(e) joueur(se) en particulier ou d'un groupe de joueurs(ses))"; + mes "2. N'utilisez pas de \"bot\" (ceci inclus n'importe quelle activite dans le jeu en etant loin du clavier, dont poser un objet sur le clavier pour attaquer automatiquement les monstres)"; + mes "3. Ne faites pas de publicite inadequate (spam) et de repetitions intempestives (flood) (ceci inclus la repetition de demande de troc (trade))"; + mes "4. Ne demandez pas d'items ou d'argent (les echanges doivent se faire de preference sur forums.themanaworld.org)"; + mes "5. Parlez anglais dans les salons de discussions publics (principalement en ville)"; + mes "6. Traitez les autres de la meme maniere que vous voudriez etre traite(e)"; + next; + mes "L'utilisation de \"bot\" sera determinee en parlant aux joueurs(ses) en train de bouger et/ou d'attaquer."; + next; + goto L_End; + +L_Spanish: + mes "Los jugadores que infringan las normas siguientes pueden ser censurados( incluso de forma permanente) o se podran resetear sus cuentas a la discrecion de los administradores:"; + mes "1. No abuse de otros jugadores (incluye insultos, palabras mal sonantes , y demas dirigidos a una o varias personas en particular)"; + mes "2. No utilizar programas automaticos ( se entiende por esto cualquier actividad realizada sin que el jugador este tocando el teclado fisicamente)"; + mes "3. No envie mensajes publicitarios o inunde el chat de mensajes (incluyendo los mensajes referidos al comercio en el juego)"; + mes "4. Esta prohibida cualquier forma de mendicidad"; + mes "5. Hable solamente en Ingles en el chat publico"; + mes "6. Trata a los demas de la misma manera que te gustaria ser tratado"; + next; + mes "El uso de programas automaticos se investigara hablando con jugadores que esten moviendose y/o atacando."; + next; + goto L_End; + +L_Swedish: + mes "Spelare som bryter mot dessa regler riskerar att helt sonika bli utkastade (antingen under kort period eller permanent), den som kastats ut kan be en GM om att starta om sitt konto."; + mes "1. Skymfa inte andra (svordomar och annat riktat till att skada en eller flera individer)"; + mes "2. Inga bottar (med bottande avses ALLA aktiviteter som sker bortom tangentbordet)"; + mes "3. Inget spammande/floodande (inklusive meddelanden om byteshandel)"; + mes "4. Tigg inte"; + mes "5. Prata bara engelska i den offentliga chatten"; + mes "6. Behandla andra som du vill bli behandlad"; + next; + mes "Hysta misstankar om bottande kontrolleras genom att prata med spelaren under dess kringvandrande eller attackerande."; + next; + goto L_End; + +L_Portuguese: + mes "Jogadores que quebrarem as regras que se seguem serao banidos (temporariamente ou permanentemente), ou a possibilidade dos caracteres serem limpos a descricao do Mestre do Jogo (GM)."; + mes "1. Nao tratar mal os outros jogadores (isto, insultar, dizer palavroes ou chamar nomes a pessoas em particular, etc.)"; + mes "2. Proibido \"botting\", que quer dizer qualquer actividade do caracter enquanto o jogador estiver longe do teclado."; + mes "3. Nao abusar da caixa de texto com mensagens repetitivas, ou abusar da funcao de trocar com outros jogadores."; + mes "4. Pedintes serao ignorados, ou banidos."; + mes "5. Fale ingles em lugares publicos."; + mes "6. Trate os outros da mesma maneira que quer ser tratado(a)."; + next; + mes "O \"botting\" sera determinado, falando com os jogadores que se movem e/ou atacam."; + next; + goto L_End; + +L_Polish: + mes "Konta graczy lamiacych nastepujace zasady moga zostac zablokowane (w niektorych przypadkach nawet nieodwolalnie) lub zresetowane przez GM:"; + mes "1. Nie wykorzystuj innych graczy (wymuszenia, przeklinanie, itp.)"; + mes "2. Zabrania sie korzystania z botow (przez boty rozumiemy kazda aktywnosc gdy gracz przebywa z dala od klawiatury)"; + mes "3. Zabrania sie spamowania / flodowania (wliczajac takze natarczywe oferty handlowe)"; + mes "4. Zabrania sie zebrania"; + mes "5. Na publicznym kanale rozmawiamy po angielsku"; + mes "6. Traktuj innych tak jak sam chcesz byc traktowany"; + next; + mes "Uzywanie botow zostanie okreslone na podstawie rozmow z innymi graczami podczas aktywnosci gracza."; + next; + goto L_End; + +L_Italian: + mes "I giocatori che infrangeranno le seguenti regole saranno bannati (anche permanentemente) o saranno resettati, a discrezione dei Game Masters:"; + mes "1. Vietato abusare degli altri giocatori (insulti, imprecazioni e simili, diretti verso una particolare persona o gruppi di persone)"; + mes "2. Vietato usare bot (ossia effettuare QUALSIASI attività quando non si è presenti alla tastiera)"; + mes "3. Vietato spammare / postare ripetutamente messaggi inutili (incluso spam di richieste di scambio)"; + mes "4. Vietato implorare"; + mes "5. Parlare solo inglese nella chat pubblica"; + mes "6. Tratta gli altri giocatori come vuoi che gli altri trattino te."; + next; + mes "I bot saranno determinati in base alle risposte e ai movimenti dei giocatori esaminati."; + next; + goto L_End; + +L_End: + set @read, 1; + if (TUT_var == 0) + set TUT_var, gettimetick(2); + return; +} diff --git a/world/map/npc/functions/inn.txt b/world/map/npc/functions/inn.txt new file mode 100644 index 00000000..810dbd1d --- /dev/null +++ b/world/map/npc/functions/inn.txt @@ -0,0 +1,29 @@ +// INN + +function script Inn { + mes "[" + @npcname$ + "]"; + mes "\"Would you like to rest? It's only " + @cost + " gp.\""; + next; + + menu + "Yes", -, + "No", L_No; + + if (zeny < @cost) goto L_NoMoney; + set zeny, zeny - @cost; + heal 10000, 10000; + + mes "[" + @npcname$ + "]"; + mes "\"Sleep well!\""; + close; + +L_No: + mes "[" + @npcname$ + "]"; + mes "\"See you.\""; + close; + +L_NoMoney: + mes "[" + @npcname$ + "]"; + mes "\"You don't have enough money to stay here.\""; + close; +} diff --git a/world/map/npc/functions/magic.txt b/world/map/npc/functions/magic.txt new file mode 100644 index 00000000..c4abcab6 --- /dev/null +++ b/world/map/npc/functions/magic.txt @@ -0,0 +1,176 @@ +// Basic magic functionality + +// Magic system uses: +// - MAGIC_EXP (magic experience points, gained for spellcasting) +// - MAGIC_FLAGS +// Magic quests use: +// - QUEST_MAGIC +// - QUEST_MAGIC2 + +// ------------------------------------------------------------ +// Gain initial magic skill +// ------------------------------------------------------------ +function script MagicGainBasic { + + set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION; + close; + +} + +// ------------------------------------------------------------ +// Initialise Menu for selecting a choice of things to ask about +// ------------------------------------------------------------ +function script MagicTalkOptionsSetup { + set @QQ_ELANORE, 1; + set @QQ_MANASEED, 2; + set @QQ_MANAPOTION, 4; + set @QQ_WYARA, 8; + set @QQ_SAGATHA, 16; + set @QQ_AULDSBEL, 32; + set @QQ_IMP, 64; + set @QQ_OLDWIZ, 128; + set @QQ_ASTRALSOUL, 256; + return; +} + +// ------------------------------------------------------------ +// Print and run menu for choice of things to ask about +// Ignores the entry in @ignore +// Returns the result in @c, or returns 0 if there is no result +// ------------------------------------------------------------ + + +function script MagicTalkMenu { + setarray @choice$, "", "", "", "", "", "", "", "", "", ""; + set @choices_nr, 0; + setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; + + if (@ignore & @QQ_ELANORE) + goto L_Q_post_elanore; + set @choice$[@choices_nr], "...Elanore the Healer?"; + set @choice_idx[@choices_nr], @QQ_ELANORE; + set @choices_nr, @choices_nr + 1; +L_Q_post_elanore: + + if (@ignore == @QQ_MANASEED) + goto L_Q_post_manaseed; + if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR))) + goto L_Q_post_manaseed; + set @choice$[@choices_nr], "...the Mana Seed?"; + set @choice_idx[@choices_nr], @QQ_MANASEED; + set @choices_nr, @choices_nr + 1; +L_Q_post_manaseed: + + if (@ignore & @QQ_MANAPOTION) + goto L_Q_post_manapotion; + if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION)) + goto L_Q_post_manapotion; + set @choice$[@choices_nr], "...Mana Potions?"; + set @choice_idx[@choices_nr], @QQ_MANAPOTION; + set @choices_nr, @choices_nr + 1; +L_Q_post_manapotion: + + if (@ignore & @QQ_WYARA) + goto L_Q_post_wyara; + if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA)) + goto L_Q_post_wyara; + set @choice$[@choices_nr], "...Wyara the Witch?"; + set @choice_idx[@choices_nr], @QQ_WYARA; + set @choices_nr, @choices_nr + 1; +L_Q_post_wyara: + + if (@ignore & @QQ_SAGATHA) + goto L_Q_post_sagatha; + if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA)) + goto L_Q_post_sagatha; + set @choice$[@choices_nr], "...Sagatha the Witch?"; + set @choice_idx[@choices_nr], @QQ_SAGATHA; + set @choices_nr, @choices_nr + 1; +L_Q_post_sagatha: + + if (@ignore & @QQ_AULDSBEL) + goto L_Q_post_auldsbel; + if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL)) + goto L_Q_post_auldsbel; + set @choice$[@choices_nr], "...Auldsbel the Wizard?"; + set @choice_idx[@choices_nr], @QQ_AULDSBEL; + set @choices_nr, @choices_nr + 1; +L_Q_post_auldsbel: + + if (@ignore & @QQ_OLDWIZ) + goto L_Q_post_oldwiz; + if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD)) + goto L_Q_post_oldwiz; + set @choice$[@choices_nr], "...the Old Wizard?"; + set @choice_idx[@choices_nr], @QQ_OLDWIZ; + set @choices_nr, @choices_nr + 1; +L_Q_post_oldwiz: + + if (@ignore & @QQ_IMP) + goto L_Q_post_imp; + if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP)) + goto L_Q_post_imp; + set @choice$[@choices_nr], "...the Earth Spirit in the desert well?"; + set @choice_idx[@choices_nr], @QQ_IMP; + set @choices_nr, @choices_nr + 1; +L_Q_post_imp: + + if (@ignore & @QQ_ASTRALSOUL) + goto L_Q_post_astralsoul; + if (!(getskilllv(SKILL_MAGIC))) + goto L_Q_post_astralsoul; + if (!(getskilllv(SKILL_POOL))) + goto L_Q_post_astralsoul; + set @choice$[@choices_nr], "...ways to improve my magic?"; + set @choice_idx[@choices_nr], @QQ_ASTRALSOUL; + set @choices_nr, @choices_nr + 1; +L_Q_post_astralsoul: + + set @choice$[@choices_nr], "...never mind."; + set @choice_idx[@choices_nr], 0; + set @choices_nr, @choices_nr + 1; + + menu @choice$[0], -, + @choice$[1], -, + @choice$[2], -, + @choice$[3], -, + @choice$[4], -, + @choice$[5], -, + @choice$[6], -, + @choice$[7], -, + @choice$[8], -, + @choice$[9], -; + + set @menu, @menu - 1; + + if (@menu >= @choices_nr) + set @menu, 0; + + set @c, @choice_idx[@menu]; + return; +} + + +// ------------------------------------------------------------ +// Level up a skill +// @SUP_id skill ID to level up +// @SUP_lvl skill level to attain +// @SUP_name$ name of the skill to level up +// @SUP_xp # of experience points to award if the level up succeeds +// ------------------------------------------------------------ +function script SkillUp { + if (getskilllv(@SUP_id) >= @SUP_lvl) + goto L_shortcut; + + misceffect sfx_skillup, strcharinfo(0); + setskill @SUP_id, @SUP_lvl; + getexp @SUP_xp, 0; + if (@SUP_xp) + mes "[" + @SUP_xp + " experience points]"; + mes "[Level " + @SUP_lvl + " in " + @SUP_name$ + "]"; + return; + +L_shortcut: + mes "[You already have level " + getskilllv(@SUP_id) + " in " + @SUP_name$ + "]"; + return; +} diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt new file mode 100644 index 00000000..a84e24a5 --- /dev/null +++ b/world/map/npc/functions/mob_points.txt @@ -0,0 +1,126 @@ +// Mob points + +function script MobPoints { + if (@mobID < 1002) return; + + setarray @points, + 1, // Maggot + 2, // Scorpion + 20, // Red Scorpion + 40, // Green Slime + 30, // Giant Maggot + 15, // Yellow Slime + 25, // Red Slime + 45, // Black Scorpion + 50, // Snake + 6, // Fire Goblin + 55, // Spider + 35, // Evil Mushroom + 35, // Pink Flower + 40, // Santa Slime + 15, // Rudolph Slime + 2, // Bat + 16, // Pinkie + 10, // Spiky Mushroom + 14, // Fluffy + 25, // Cave Snake + 200, // Jack O + 85, // Fire Skull + 85, // Poison Skull + 20, // Log Head + 70, // Mountain Snake + 15, // Easter Fluffy + 40, // Mouboo + 0, // Mauve Plant + 0, // Cobalt Plant + 0, // Gamboge Plant + 0, // Alizarin Plant + 20, // Sea Slime + 75, // Grass Snake + 0, // Silk Worm + 125, // Zombie + 0, // Clover Patch + 5, // Squirrel + 0, // Fire Lizard + 80, // Wisp + 15, // Snail + 80, // Spectre + 100, // Skeleton + 100, // Lady Skeleton + 150, // Fallen + 0, // Snake Lord + 80, // Poltergeist + 0, // Duck + 15, // Bee + 0, // Larvespa + 0, // Vespa + 0, // Hivespa + 0, // Froad + 0, // Troll + 15, // Butterfly + 2, // Cave Maggot + 10, // Angry Scorpion + 6, // Ice Goblin + 20, // Archant + 40, // Giant Cave Maggot + 35, // Moggun + 100, // Terranite + 10, // Pumpkin + 10, // Bandit + 20, // Bandit Lord + 30, // Vampire Bat + 20, // Reaper + 100, // Reaper 2 + 100, // Scythe + 20, // Ball Lightning + 60, // Ice Element + 80, // Yeti + 100, // The Lost + 0, // Red Bone + 0, // Stalker + 0, // Dreadwing + 100, // Drunken Skeleton + 100, // Tipsy Skeleton + 100, // Drunken Lady Skeleton + 60, // BlueSpark + 60, // RedSpark + 0, // Serqet + // Add more here + 0; // END + + + if (MPQUEST == 1) set Mobpt, Mobpt + @points[@mobID - 1002]; + +// Scorpion, Red Scorpion, Black Scorpion, Angry Scorpion + if ((@mobID == 1003) || (@mobID == 1004) || (@mobID == 1008) || (@mobID == 1057)) + goto L_good; + + + // Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth) + + set @value, 0; +// Fluffy + if (@mobID == 1020) + set @value, 3; +// Easter Fluffy + if (@mobID == 1027) + set @value, 3; +// Mouboo + if (@mobID == 1028) + set @value, 4; +// Squirrel + if (@mobID == 1038) + set @value, 2; + + if (@value == 0) + goto L_end; + + callfunc "QuestSagathaAnnoy"; + goto L_end; + +L_good: + set @value, 1; + callfunc "QuestSagathaHappy"; +L_end: + set @value, 0; +} diff --git a/world/map/npc/functions/process_equip.txt b/world/map/npc/functions/process_equip.txt new file mode 100644 index 00000000..6a56dcbc --- /dev/null +++ b/world/map/npc/functions/process_equip.txt @@ -0,0 +1,27 @@ +// + +function script ProcessEquip { + set @head, getequipid(equip_head); + set @torso, getequipid(equip_torso); + set @legs, getequipid(equip_legs); + + set @torsoB, @torso; + if (@torsoB >= 2050 && @torsoB <= 2059) set @torsoB, 1202; // Cotton shirt + if (@torsoB >= 2060 && @torsoB <= 2069) set @torsoB, 624; // V Neck + if (@torsoB >= 2070 && @torsoB <= 2079) set @torsoB, 564; // T Neck + if (@torsoB >= 2080 && @torsoB <= 2089) set @torsoB, 720; // Silk Robe + if (@torsoB >= 2090 && @torsoB <= 2099) set @torsoB, 688; // Tanktop + if (@torsoB >= 2120 && @torsoB <= 2129) set @torsoB, 689; // Short tanktop + set @torsoC, cNone; + if (@torso == 1202 || @torso == 624 || @torso == 564 || @torso == 688 || @torso == 689 || @torso == 720) set @torsoC, cWhite; + if (@torso >= 2050) set @torsoC, @torso % 10; + + set @legsB, @legs; + if (@legsB >= 2100 && @legsB <= 2109) set @legsB, 632; // Cotton skirt + if (@legsB >= 2110 && @legsB <= 2119) set @legsB, 586; // Cotton shorts + set @legsC, cNone; + if (@legs == 632 || @legs == 586) set @legsC, cWhite; + if (@legs >= 2050) set @legsC, @legs % 10; + + return; +} diff --git a/world/map/npc/functions/slot_machine.txt b/world/map/npc/functions/slot_machine.txt new file mode 100644 index 00000000..8f4482cc --- /dev/null +++ b/world/map/npc/functions/slot_machine.txt @@ -0,0 +1,35 @@ +// + +function script SlotMachine { + mes "Pull the lever..."; + next; + menu + "Pull", L_Play, + "Maybe later", -; + close; + +L_Play: + if(countitem("CasinoCoins") < 1) goto L_NoCoin; + delitem "CasinoCoins", 1; + set @Temp1,rand(7); + set @Temp2,rand(7); + set @Temp3,rand(7); + mes "Numbers: " + @Temp1 + "/" + @Temp2 + "/" + @Temp3 + "."; + next; + + if(@Temp1 != @Temp2) goto L_Lost; + if(@Temp2 != @Temp3) goto L_Lost; + if(@Temp1 != @Temp3) goto L_Lost; + mes "Congratulations! You won!"; + mes "You get 10 casino coins"; + getitem "CasinoCoins", 10; + close; + +L_Lost: + mes "You lost!"; + close; + +L_NoCoin: + mes "Insert coin"; + close; +} diff --git a/world/map/npc/functions/soul_menhir.txt b/world/map/npc/functions/soul_menhir.txt new file mode 100644 index 00000000..a98681c6 --- /dev/null +++ b/world/map/npc/functions/soul_menhir.txt @@ -0,0 +1,47 @@ +function script SoulMenhir { + mes "[Soul Menhir]"; + mes "(A mystical aura surrounds this stone. You feel mysteriously attracted to it. Something tells you to touch it. What do you do?)"; + next; + + menu + "Touch it", -, + "Leave it alone", L_Return; + + if (Menhir_Activated == 1) goto L_Shortversion; + + mes "[Soul Menhir]"; + mes "(You touch the mysteriouse stone. Somehow it feels warm and cold at the same time.)"; + next; + + mes "[Soul Menhir]"; + mes "(Suddenly a strange sensation flows through you. It feels like your soul leaves your body and becomes one with the stone.)"; + next; + + mes "[Soul Menhir]"; + mes "(As suddenly as the feeling started it stops. The strange attraction is away from one moment to the next and the menhir feels like just an ordinary stone.)"; + next; + + set Menhir_Activated, 1; + goto L_Save; + +L_Shortversion: + mes "[Soul Menhir]"; + mes "(A strange sensation flows through you. It feels like your soul leaves your body and becomes one with the stone. as suddenly as the feeling started it stops.)"; + next; + +L_Save: + if (@x == 0 && @y == 0) goto L_FindPoint; + +L_Do_Save: + savepoint @map$, @x, @y; + goto L_Return; + +L_FindPoint: + set @n, rand(getarraysize(@Xs)); + set @x, @Xs[@n]; + set @y, @Ys[@n]; + goto L_Do_Save; + +L_Return: + return; +} diff --git a/world/map/npc/functions/strangerquiz.txt b/world/map/npc/functions/strangerquiz.txt new file mode 100644 index 00000000..28fc6887 --- /dev/null +++ b/world/map/npc/functions/strangerquiz.txt @@ -0,0 +1,7 @@ + +function script StrangerQuiz { + // param @quizparam$$ + // return in @quizanswer$ + set @quizanswer$, getspellinvocation(@quizparam$); + return; +} diff --git a/world/map/npc/functions/water_bottle.txt b/world/map/npc/functions/water_bottle.txt new file mode 100644 index 00000000..c2d9a1e0 --- /dev/null +++ b/world/map/npc/functions/water_bottle.txt @@ -0,0 +1,34 @@ +// Fills empty bottles with water + +function script WaterBottle { + set @COST_PER_BOTTLE, 150; + + mes "How many empty bottles do you want to fill with water? It costs " + @COST_PER_BOTTLE + "gp per bottle."; + input @count; + + if (@count == 0) close; + set @cost, @count * @COST_PER_BOTTLE; + set @empty, countitem("EmptyBottle"); + + if (@empty < @count) goto L_NotEnoughBottles; + if (zeny < @cost) goto L_NotEnoughMoney; + getinventorylist; + if (@inventorylist_count == 100 && countitem("BottleOfWater") == 0 && @empty > @count) goto L_NotEnoughSlots; + + set zeny, zeny - @cost; + delitem "EmptyBottle", @count; + getitem "BottleOfWater", @count; + close; + +L_NotEnoughBottles: + mes "You don't have that many empty bottles!"; + close; + +L_NotEnoughMoney: + mes "You don't have enough gp! You need " + @cost + "gp."; + close; + +L_NotEnoughSlots: + mes "You don't have room for these bottles!"; + close; +} -- cgit v1.2.3-70-g09d2