diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-05 13:23:07 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-05 13:23:07 +0000 |
commit | 288490094a7fe9167747dc78d416940759a31197 (patch) | |
tree | 53dc4f5c2375f4b688b53ca8841630ddec5e1f88 /npc/custom/eAAC_Scripts | |
parent | 8ec1c47aed09c90343949d57c92760ba84738a46 (diff) | |
download | hercules-288490094a7fe9167747dc78d416940759a31197.tar.gz hercules-288490094a7fe9167747dc78d416940759a31197.tar.bz2 hercules-288490094a7fe9167747dc78d416940759a31197.tar.xz hercules-288490094a7fe9167747dc78d416940759a31197.zip |
- Massive EOL normalization & 'svn:eol-style native' flag setting for all txt/conf/h/c files.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/custom/eAAC_Scripts')
27 files changed, 12042 insertions, 12042 deletions
diff --git a/npc/custom/eAAC_Scripts/DonationGirl/donate.txt b/npc/custom/eAAC_Scripts/DonationGirl/donate.txt index 84824b8d7..66e619333 100644 --- a/npc/custom/eAAC_Scripts/DonationGirl/donate.txt +++ b/npc/custom/eAAC_Scripts/DonationGirl/donate.txt @@ -1,365 +1,365 @@ -//===== Athena Script =======================================
-//= Donation NPC
-//===== By ==================================================
-//= Josh
-//===== Version =============================================
-//= 1.0 - First release. Probably contains bugs/security
-//= risks
-//= 1.1 - Added a check for whether the account exists when
-//= adding a donator. Need to improve ordering when
-//= viewing all donations.
-//= 1.2 - Modified for public use. Added checkweight feature.
-//= 2.0 - Many changes, especially ones I had always wanted
-//= to add to this script. Includes reading items from
-//= a separate SQL table and more database manipulation
-//= options for GMs.
-//= 2.1 - Made few changes including the add/remove items
-//= feature.
-//= 3.0 - All strings inputed by a user and user/char names
-//= in SQL queries are now escaped. Each item has a
-//= price rather than a quantity. This script can work
-//= with decimals.
-//= 3.1 - Added quotes to some queries, fixed a variable and
-//= removed a comment.
-//= 3.2 - Fixed a problem where eAthena would crash if a
-//= query returned NULL.
-//= 3.3 - Optimized query speeds by combining a few select
-//= queries into one. Requires Trunk 7975.
-//===== Compatible With =====================================
-//= eAthena - any version that contains the new query_sql
-//= command (Trunk 7975).
-//===== Description =========================================
-//= A script that lets a player claim an item for donating.
-//= Allows a GM to input each donation.
-//===== Comments ============================================
-//= This script uses SQL tables to store variables for the
-//= amount donated by users and the items claimable.
-//===== Installation ========================================
-//= You must execute donate.sql and donate_item_db.sql before
-//= using this script.
-//===========================================================
-//= Thanks to Vich for helping me with the SQL syntax.
-//= Thanks to Lance for helping me with the the arrays and
-//= for implementing query_sql.
-//= Thanks to Skotlex for implementing escape_sql.
-//= Thanks to Toms for implementing the new multi-column
-//= query_sql command.
-//===========================================================
-
-prontera.gat,145,179,5 script Donation Girl 714,{
-
-if (getgmlevel() >= 80) goto L_GM;
-
-L_START:
-mes "[Donation Girl]";
-mes "Hello! I'm the Donation Girl!";
-mes "If you have made a donation,";
-mes "you are entitled to a reward!";
-next;
-menu "More info",-,"Make a claim",L_CHECK,"Statistics",L_STATS;
-L_INFO:
-mes "[Donation Girl]";
-mes "Each month, a lot of money is paid to keep this server running.";
-next;
-mes "[Donation Girl]";
-mes "You can support us by donating any amount of money.";
-next;
-mes "[Donation Girl]";
-mes "To show our appreciation, we will gladly give you a reward.";
-next;
-menu "Continue",L_START,"Cancel",-;
-close;
-
-L_CHECK:
-query_sql "SELECT `amount`,`claimed` FROM `donate` WHERE `account_id` = "+getcharid(3)+"", @amount$, @claimed$;
-query_sql "SELECT MIN(price) FROM `donate_item_db`", @min$;
-query_sql "SELECT '"+@amount$+"' - '"+@claimed$+"'", @value$;
-query_sql "SELECT '"+@value$+"' >= '"+@min$+"'", @enough;
-if(@enough) goto L_CLAIM;
-mes "[Donation Girl]";
-mes "Sorry, you do not have enough to make a claim.";
-mes "If you have donated but have not made a claim,";
-mes "Please give us time to process your donation.";
-close;
-
-L_CLAIM:
-mes "[Donation Girl]";
-mes "Thankyou for donating!";
-mes "You have $"+@value$+" worth of credit!";
-mes "Would you like to claim an item now?";
-next;
-menu "No",-,"Yes",L_YES;
-mes "[Donation Girl]";
-mes "Ok! You are able to collect your item(s) any time!";
-close;
-
-L_YES:
-mes "[Donation Girl]";
-mes "Very well. Which item would you like?";
-next;
-query_sql "SELECT `name` FROM `donate_item_db` ORDER BY `name` ASC",$@name$;
-set $@menu$, $@name$[0];
- for(set $@i, 1; $@i < 127; set $@i, $@i + 1){
- set $@menu$, $@menu$ + ":" + $@name$[$@i];
- }
-
-set @menu, (select($@menu$))-1;
-
-query_sql "SELECT `id`,`price` FROM `donate_item_db` WHERE `name` = '"+$@name$[@menu]+"'", @id, @price$;
-query_sql "SELECT TRUNCATE("+@value$+" / "+@price$+",0)", @max;
-
-mes "[Donation Girl]";
-mes ""+$@name$[@menu]+"s cost $"+@price$+" each.";
-mes "How many "+$@name$[@menu]+"s would you like to claim?";
-mes "Maximum: "+@max+".";
-input @quantity;
-
-if(@quantity>@max) {
- mes "[Donation Girl]";
- mes "Sorry, but you do not have enough to claim "+@quantity+" "+$@name$[@menu]+"s.";
- next;
- goto L_CLAIM;
- }
-
-if(!@quantity) {
- mes "[Donation Girl]";
- mes "You can't have 0 as an amount!";
- next;
- goto L_CLAIM;
- }
-
-if (checkweight(@id,@quantity) == 0) {
- mes "[Donation Girl]";
- mes "I'm sorry, but you cannot carry "+@quantity+" "+$@name$[@menu]+"s.";
- next;
- goto L_CLAIM;
- }
-
-query_sql "SELECT "+@quantity+" * "+@price$+"", @total$;
-mes "Are you sure you want to claim "+@quantity+" "+$@name$[@menu]+"s for $"+@total$+"?";
-next;
-menu "No",L_CLAIM,"Yes",-;
-query_sql "UPDATE `donate` SET `claimed` = `claimed` + "+@total$+" WHERE `account_id` = '"+getcharid(3)+"'";
-getitem @id,@quantity;
-mes "[Donation Girl]";
-mes "Thankyou for donating! We hope you enjoy your gift!";
-close;
-
-L_STATS:
-mes "[Donation Girl]";
-query_sql "SELECT IFNULL((SELECT SUM(amount) FROM `donate`),0)", @total$;
-mes "Our fund is at a total of $"+@total$+"";
-next;
-menu "More info",L_INFO,"Make a claim",L_CHECK,"Statistics",L_STATS;
-close;
-
-L_GM:
-mes "[GM Menu]";
-mes "Hello GM!";
-mes "What would you like to do?";
-next;
-menu "Add/Remove Donation",L_GM2,"Add/Remove Items",L_ITEM,"Test Script",L_START;
-close;
-
-L_GM2:
-menu "Add a donation",L_DONATE,"Remove a donation",L_REMOVE,"View all donations",L_VIEWALL;
-close;
-
-L_ITEM:
-menu "Add an item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS,"Return to main menu",L_GM;
-close;
-
-
-L_NEWITEM:
-mes "[GM Menu]";
-mes "Please enter the item name:";
-input @itemname$;
-query_sql "SELECT `id` FROM `item_db` WHERE `name_english` = '"+escape_sql(@itemname$)+"'", @iid;
-query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+escape_sql(@itemname$)+"'", @check;
-if(@iid==0) goto L_INONE;
-mes "[GM Menu]";
-mes "Please enter the cost of each "+@itemname$+":";
-input @cost$;
-query_sql "SELECT "+escape_sql(@cost$)+" = 0", @invalid;
-if(@invalid) goto L_ZERO;
-query_sql "SELECT CAST('"+escape_sql(@cost$)+"' AS DECIMAL)", @cost$;
-mes "[GM Menu]";
-mes "You have specified that donators can claim "+@itemname$+"s for $"+@cost$+" each.";
-mes "Would you like to continue?";
-next;
-menu "No",L_ITEM,"Yes",-;
-if(@check!=0) goto L_REPLACE;
-query_sql "INSERT INTO `donate_item_db` VALUES ('"+@iid+"', '"+escape_sql(@itemname$)+"', '"+@cost$+"')";
-mes "[GM Menu]";
-mes "Item added successfully!";
-next;
-menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS;
-close;
-
-L_REPLACE:
-mes "[GM Menu]";
-mes "Item "+@itemname$+" already exists in the database.";
-mes "Would you like to replace it?";
-next;
-menu "No",L_ITEM,"Yes",-;
-query_sql "REPLACE INTO `donate_item_db` VALUES ('"+@iid+"', '"+@itemname$+"', '"+@cost$+"')";
-mes "[GM Menu]";
-mes "Item replaced successfully!";
-next;
-menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS;
-close;
-
-L_INONE:
-mes "[GM Menu]";
-mes "Item "+@itemname$+" does not exist.";
-next;
-goto L_ITEM;
-
-L_DELITEM:
-mes "[GM Menu]";
-mes "Please enter the item name:";
-input @itemname$;
-query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+escape_sql(@itemname$)+"'", @iid;
-if(@iid==0) goto L_INONE;
-next;
-mes "[GM Menu]";
-mes "You have specified to delete "+@itemname$+" from the database.";
-mes "Would you like to continue?";
-next;
-menu "No",L_ITEM,"Yes",-;
-query_sql "DELETE FROM `donate_item_db` WHERE `id` = '"+@iid+"'";
-mes "[GM Menu]";
-mes "Item deleted successfully!";
-next;
-menu "Add an item",L_NEWITEM,"Remove another item",L_DELITEM,"View all items",L_ALLITEMS;
-close;
-
-L_ALLITEMS:
-mes "[GM Menu]";
-query_sql "SELECT `name`,`price` FROM `donate_item_db` ORDER BY `name` ASC", @items$, @itemamount$;
-for(set @i, 0; @i < getarraysize(@items$); set @i, @i + 1){
- mes ""+@items$[@i]+" - $"+@itemamount$[@i]+"";
- }
-next;
-goto L_GM;
-
-L_DONATE:
-mes "[GM Menu]";
-mes "Please enter the donator's username:";
-input @donator$;
-query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+escape_sql(@donator$)+"'", @aid;
-if(@aid==0) goto L_NONE;
-query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated$;
-query_sql "SELECT '"+@donated$+"' > 0", @donated;
-switch(@donated) {
- case 0:
- mes ""+@donator$+" has not donated before.";
- break;
- case 1:
- mes ""+@donator$+" has donated $"+@donated$+".";
- break;
- }
-next;
-mes "[GM Menu]";
-mes "Please enter the amount donated by "+@donator$+"";
-input @donating$;
-query_sql "SELECT "+escape_sql(@donating$)+" = 0", @invalid;
-if(@invalid) goto L_ZERO;
-query_sql "SELECT CAST('"+escape_sql(@donating$)+"' AS DECIMAL)", @donating$;
-mes "[GM Menu]";
-mes "You have specified that "+@donator$+" has donated $"+@donating$+".";
-mes "Would you like to continue?";
-next;
-menu "No",L_GM,"Yes",-;
-switch(@donated) {
- case 0:
- query_sql "INSERT INTO `donate` VALUES ('"+@aid+"', '"+@donating$+"', '0')";
- break;
- case 1:
- query_sql "UPDATE `donate` SET `amount` = `amount` + "+@donating$+" WHERE `account_id` = '"+@aid+"'";
- break;
- }
-query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @newdonated$;
-mes "[GM Menu]";
-mes "Donation added successfully!";
-mes ""+@donator$+" has donated a total of $"+@newdonated$+"";
-next;
-goto L_GM;
-
-L_ZERO:
-mes "[GM Menu]";
-mes "You can't have 0 as an amount!";
-next;
-goto L_GM;
-
-L_NONE:
-mes "[GM Menu]";
-mes "Account name "+@donator$+" does not exist.";
-next;
-goto L_GM;
-
-L_REMOVE:
-mes "[GM Menu]";
-mes "Please enter the donator's username:";
-input @donator$;
-query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+escape_sql(@donator$)+"'", @aid;
-if(@aid==0) goto L_NONE;
-query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated$;
-query_sql "SELECT '"+@donated$+"' > 0", @donated;
-
-if(@donated==0) {
- query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'";
- mes ""+@donator$+" is not a donator and has been deleted from the donation database.";
- goto L_GM;
- }
-
-mes ""+@donator$+" has donated $"+@donated$+".";
-next;
-menu "Deduct an amount from "+@donator$+"",L_MINUS,"Remove "+@donator$+" from the donation database",L_DELETE;
-close;
-
-L_MINUS:
-mes "[GM Menu]";
-mes "Please enter the amount "+@donator$+" is to be deducted by:";
-input @deduct$;
-query_sql "SELECT "+escape_sql(@deduct$)+" = 0", @invalid;
-if(@invalid) goto L_ZERO;
-query_sql "SELECT CAST('"+escape_sql(@deduct$)+"' AS DECIMAL)", @deduct$;
-mes "[GM Menu]";
-mes "You have specified that "+@donator$+" is to be deducted by $"+@deduct$+".";
-mes "Would you like to continue?";
-next;
-menu "No",L_GM,"Yes",-;
-query_sql "UPDATE `donate` SET `amount` = `amount` - "+@deduct$+" WHERE `account_id` = '"+@aid+"'";
-query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @afterdeduct$;
-mes "[GM Menu]";
-mes "Donation deducted successfully!";
-mes ""+@donator$+" has donated a total of $"+@afterdeduct$+"";
-next;
-goto L_GM;
-
-L_DELETE:
-mes "[GM Menu]";
-mes "You have specified to remove "+@donator$+" from the donation database.";
-mes "Would you like to continue?";
-next;
-menu "No",L_GM,"Yes",-;
-query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'";
-mes "[GM Menu]";
-mes "Donator deleted successfully!";
-next;
-goto L_GM;
-
-L_VIEWALL:
-mes "[GM Menu]";
-query_sql "SELECT `account_id`,`amount` FROM `donate` ORDER BY `amount` DESC", @donatoraid, @donatedamount$;
-for(set @i, 0; @i < getarraysize(@donatoraid); set @i, @i + 1){
- query_sql "SELECT `userid` FROM `login` WHERE `account_id` = '"+@donatoraid[@i]+"'", @donateruserid$;
- for(set @j, 0; @j < getarraysize(@donateruserid$); set @j, @j + 1){
- mes ""+@donateruserid$[@j]+" - "+@donatedamount$[@i]+"";
- }
-}
-next;
-goto L_GM;
-
+//===== Athena Script ======================================= +//= Donation NPC +//===== By ================================================== +//= Josh +//===== Version ============================================= +//= 1.0 - First release. Probably contains bugs/security +//= risks +//= 1.1 - Added a check for whether the account exists when +//= adding a donator. Need to improve ordering when +//= viewing all donations. +//= 1.2 - Modified for public use. Added checkweight feature. +//= 2.0 - Many changes, especially ones I had always wanted +//= to add to this script. Includes reading items from +//= a separate SQL table and more database manipulation +//= options for GMs. +//= 2.1 - Made few changes including the add/remove items +//= feature. +//= 3.0 - All strings inputed by a user and user/char names +//= in SQL queries are now escaped. Each item has a +//= price rather than a quantity. This script can work +//= with decimals. +//= 3.1 - Added quotes to some queries, fixed a variable and +//= removed a comment. +//= 3.2 - Fixed a problem where eAthena would crash if a +//= query returned NULL. +//= 3.3 - Optimized query speeds by combining a few select +//= queries into one. Requires Trunk 7975. +//===== Compatible With ===================================== +//= eAthena - any version that contains the new query_sql +//= command (Trunk 7975). +//===== Description ========================================= +//= A script that lets a player claim an item for donating. +//= Allows a GM to input each donation. +//===== Comments ============================================ +//= This script uses SQL tables to store variables for the +//= amount donated by users and the items claimable. +//===== Installation ======================================== +//= You must execute donate.sql and donate_item_db.sql before +//= using this script. +//=========================================================== +//= Thanks to Vich for helping me with the SQL syntax. +//= Thanks to Lance for helping me with the the arrays and +//= for implementing query_sql. +//= Thanks to Skotlex for implementing escape_sql. +//= Thanks to Toms for implementing the new multi-column +//= query_sql command. +//=========================================================== + +prontera.gat,145,179,5 script Donation Girl 714,{ + +if (getgmlevel() >= 80) goto L_GM; + +L_START: +mes "[Donation Girl]"; +mes "Hello! I'm the Donation Girl!"; +mes "If you have made a donation,"; +mes "you are entitled to a reward!"; +next; +menu "More info",-,"Make a claim",L_CHECK,"Statistics",L_STATS; +L_INFO: +mes "[Donation Girl]"; +mes "Each month, a lot of money is paid to keep this server running."; +next; +mes "[Donation Girl]"; +mes "You can support us by donating any amount of money."; +next; +mes "[Donation Girl]"; +mes "To show our appreciation, we will gladly give you a reward."; +next; +menu "Continue",L_START,"Cancel",-; +close; + +L_CHECK: +query_sql "SELECT `amount`,`claimed` FROM `donate` WHERE `account_id` = "+getcharid(3)+"", @amount$, @claimed$; +query_sql "SELECT MIN(price) FROM `donate_item_db`", @min$; +query_sql "SELECT '"+@amount$+"' - '"+@claimed$+"'", @value$; +query_sql "SELECT '"+@value$+"' >= '"+@min$+"'", @enough; +if(@enough) goto L_CLAIM; +mes "[Donation Girl]"; +mes "Sorry, you do not have enough to make a claim."; +mes "If you have donated but have not made a claim,"; +mes "Please give us time to process your donation."; +close; + +L_CLAIM: +mes "[Donation Girl]"; +mes "Thankyou for donating!"; +mes "You have $"+@value$+" worth of credit!"; +mes "Would you like to claim an item now?"; +next; +menu "No",-,"Yes",L_YES; +mes "[Donation Girl]"; +mes "Ok! You are able to collect your item(s) any time!"; +close; + +L_YES: +mes "[Donation Girl]"; +mes "Very well. Which item would you like?"; +next; +query_sql "SELECT `name` FROM `donate_item_db` ORDER BY `name` ASC",$@name$; +set $@menu$, $@name$[0]; + for(set $@i, 1; $@i < 127; set $@i, $@i + 1){ + set $@menu$, $@menu$ + ":" + $@name$[$@i]; + } + +set @menu, (select($@menu$))-1; + +query_sql "SELECT `id`,`price` FROM `donate_item_db` WHERE `name` = '"+$@name$[@menu]+"'", @id, @price$; +query_sql "SELECT TRUNCATE("+@value$+" / "+@price$+",0)", @max; + +mes "[Donation Girl]"; +mes ""+$@name$[@menu]+"s cost $"+@price$+" each."; +mes "How many "+$@name$[@menu]+"s would you like to claim?"; +mes "Maximum: "+@max+"."; +input @quantity; + +if(@quantity>@max) { + mes "[Donation Girl]"; + mes "Sorry, but you do not have enough to claim "+@quantity+" "+$@name$[@menu]+"s."; + next; + goto L_CLAIM; + } + +if(!@quantity) { + mes "[Donation Girl]"; + mes "You can't have 0 as an amount!"; + next; + goto L_CLAIM; + } + +if (checkweight(@id,@quantity) == 0) { + mes "[Donation Girl]"; + mes "I'm sorry, but you cannot carry "+@quantity+" "+$@name$[@menu]+"s."; + next; + goto L_CLAIM; + } + +query_sql "SELECT "+@quantity+" * "+@price$+"", @total$; +mes "Are you sure you want to claim "+@quantity+" "+$@name$[@menu]+"s for $"+@total$+"?"; +next; +menu "No",L_CLAIM,"Yes",-; +query_sql "UPDATE `donate` SET `claimed` = `claimed` + "+@total$+" WHERE `account_id` = '"+getcharid(3)+"'"; +getitem @id,@quantity; +mes "[Donation Girl]"; +mes "Thankyou for donating! We hope you enjoy your gift!"; +close; + +L_STATS: +mes "[Donation Girl]"; +query_sql "SELECT IFNULL((SELECT SUM(amount) FROM `donate`),0)", @total$; +mes "Our fund is at a total of $"+@total$+""; +next; +menu "More info",L_INFO,"Make a claim",L_CHECK,"Statistics",L_STATS; +close; + +L_GM: +mes "[GM Menu]"; +mes "Hello GM!"; +mes "What would you like to do?"; +next; +menu "Add/Remove Donation",L_GM2,"Add/Remove Items",L_ITEM,"Test Script",L_START; +close; + +L_GM2: +menu "Add a donation",L_DONATE,"Remove a donation",L_REMOVE,"View all donations",L_VIEWALL; +close; + +L_ITEM: +menu "Add an item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS,"Return to main menu",L_GM; +close; + + +L_NEWITEM: +mes "[GM Menu]"; +mes "Please enter the item name:"; +input @itemname$; +query_sql "SELECT `id` FROM `item_db` WHERE `name_english` = '"+escape_sql(@itemname$)+"'", @iid; +query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+escape_sql(@itemname$)+"'", @check; +if(@iid==0) goto L_INONE; +mes "[GM Menu]"; +mes "Please enter the cost of each "+@itemname$+":"; +input @cost$; +query_sql "SELECT "+escape_sql(@cost$)+" = 0", @invalid; +if(@invalid) goto L_ZERO; +query_sql "SELECT CAST('"+escape_sql(@cost$)+"' AS DECIMAL)", @cost$; +mes "[GM Menu]"; +mes "You have specified that donators can claim "+@itemname$+"s for $"+@cost$+" each."; +mes "Would you like to continue?"; +next; +menu "No",L_ITEM,"Yes",-; +if(@check!=0) goto L_REPLACE; +query_sql "INSERT INTO `donate_item_db` VALUES ('"+@iid+"', '"+escape_sql(@itemname$)+"', '"+@cost$+"')"; +mes "[GM Menu]"; +mes "Item added successfully!"; +next; +menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS; +close; + +L_REPLACE: +mes "[GM Menu]"; +mes "Item "+@itemname$+" already exists in the database."; +mes "Would you like to replace it?"; +next; +menu "No",L_ITEM,"Yes",-; +query_sql "REPLACE INTO `donate_item_db` VALUES ('"+@iid+"', '"+@itemname$+"', '"+@cost$+"')"; +mes "[GM Menu]"; +mes "Item replaced successfully!"; +next; +menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS; +close; + +L_INONE: +mes "[GM Menu]"; +mes "Item "+@itemname$+" does not exist."; +next; +goto L_ITEM; + +L_DELITEM: +mes "[GM Menu]"; +mes "Please enter the item name:"; +input @itemname$; +query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+escape_sql(@itemname$)+"'", @iid; +if(@iid==0) goto L_INONE; +next; +mes "[GM Menu]"; +mes "You have specified to delete "+@itemname$+" from the database."; +mes "Would you like to continue?"; +next; +menu "No",L_ITEM,"Yes",-; +query_sql "DELETE FROM `donate_item_db` WHERE `id` = '"+@iid+"'"; +mes "[GM Menu]"; +mes "Item deleted successfully!"; +next; +menu "Add an item",L_NEWITEM,"Remove another item",L_DELITEM,"View all items",L_ALLITEMS; +close; + +L_ALLITEMS: +mes "[GM Menu]"; +query_sql "SELECT `name`,`price` FROM `donate_item_db` ORDER BY `name` ASC", @items$, @itemamount$; +for(set @i, 0; @i < getarraysize(@items$); set @i, @i + 1){ + mes ""+@items$[@i]+" - $"+@itemamount$[@i]+""; + } +next; +goto L_GM; + +L_DONATE: +mes "[GM Menu]"; +mes "Please enter the donator's username:"; +input @donator$; +query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+escape_sql(@donator$)+"'", @aid; +if(@aid==0) goto L_NONE; +query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated$; +query_sql "SELECT '"+@donated$+"' > 0", @donated; +switch(@donated) { + case 0: + mes ""+@donator$+" has not donated before."; + break; + case 1: + mes ""+@donator$+" has donated $"+@donated$+"."; + break; + } +next; +mes "[GM Menu]"; +mes "Please enter the amount donated by "+@donator$+""; +input @donating$; +query_sql "SELECT "+escape_sql(@donating$)+" = 0", @invalid; +if(@invalid) goto L_ZERO; +query_sql "SELECT CAST('"+escape_sql(@donating$)+"' AS DECIMAL)", @donating$; +mes "[GM Menu]"; +mes "You have specified that "+@donator$+" has donated $"+@donating$+"."; +mes "Would you like to continue?"; +next; +menu "No",L_GM,"Yes",-; +switch(@donated) { + case 0: + query_sql "INSERT INTO `donate` VALUES ('"+@aid+"', '"+@donating$+"', '0')"; + break; + case 1: + query_sql "UPDATE `donate` SET `amount` = `amount` + "+@donating$+" WHERE `account_id` = '"+@aid+"'"; + break; + } +query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @newdonated$; +mes "[GM Menu]"; +mes "Donation added successfully!"; +mes ""+@donator$+" has donated a total of $"+@newdonated$+""; +next; +goto L_GM; + +L_ZERO: +mes "[GM Menu]"; +mes "You can't have 0 as an amount!"; +next; +goto L_GM; + +L_NONE: +mes "[GM Menu]"; +mes "Account name "+@donator$+" does not exist."; +next; +goto L_GM; + +L_REMOVE: +mes "[GM Menu]"; +mes "Please enter the donator's username:"; +input @donator$; +query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+escape_sql(@donator$)+"'", @aid; +if(@aid==0) goto L_NONE; +query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated$; +query_sql "SELECT '"+@donated$+"' > 0", @donated; + +if(@donated==0) { + query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'"; + mes ""+@donator$+" is not a donator and has been deleted from the donation database."; + goto L_GM; + } + +mes ""+@donator$+" has donated $"+@donated$+"."; +next; +menu "Deduct an amount from "+@donator$+"",L_MINUS,"Remove "+@donator$+" from the donation database",L_DELETE; +close; + +L_MINUS: +mes "[GM Menu]"; +mes "Please enter the amount "+@donator$+" is to be deducted by:"; +input @deduct$; +query_sql "SELECT "+escape_sql(@deduct$)+" = 0", @invalid; +if(@invalid) goto L_ZERO; +query_sql "SELECT CAST('"+escape_sql(@deduct$)+"' AS DECIMAL)", @deduct$; +mes "[GM Menu]"; +mes "You have specified that "+@donator$+" is to be deducted by $"+@deduct$+"."; +mes "Would you like to continue?"; +next; +menu "No",L_GM,"Yes",-; +query_sql "UPDATE `donate` SET `amount` = `amount` - "+@deduct$+" WHERE `account_id` = '"+@aid+"'"; +query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @afterdeduct$; +mes "[GM Menu]"; +mes "Donation deducted successfully!"; +mes ""+@donator$+" has donated a total of $"+@afterdeduct$+""; +next; +goto L_GM; + +L_DELETE: +mes "[GM Menu]"; +mes "You have specified to remove "+@donator$+" from the donation database."; +mes "Would you like to continue?"; +next; +menu "No",L_GM,"Yes",-; +query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'"; +mes "[GM Menu]"; +mes "Donator deleted successfully!"; +next; +goto L_GM; + +L_VIEWALL: +mes "[GM Menu]"; +query_sql "SELECT `account_id`,`amount` FROM `donate` ORDER BY `amount` DESC", @donatoraid, @donatedamount$; +for(set @i, 0; @i < getarraysize(@donatoraid); set @i, @i + 1){ + query_sql "SELECT `userid` FROM `login` WHERE `account_id` = '"+@donatoraid[@i]+"'", @donateruserid$; + for(set @j, 0; @j < getarraysize(@donateruserid$); set @j, @j + 1){ + mes ""+@donateruserid$[@j]+" - "+@donatedamount$[@i]+""; + } +} +next; +goto L_GM; + }
\ No newline at end of file diff --git a/npc/custom/eAAC_Scripts/Kafra_Express_files.conf b/npc/custom/eAAC_Scripts/Kafra_Express_files.conf index 11e9fd23c..2244e8eb4 100644 --- a/npc/custom/eAAC_Scripts/Kafra_Express_files.conf +++ b/npc/custom/eAAC_Scripts/Kafra_Express_files.conf @@ -1,33 +1,33 @@ -//|-----------------------------------------------------------------|
-//|- English Athena Approved Certified Script: Kafra Express Set -|
-//|-----------------------------------------------------------------|
-//| Under this is the global_functions.txt needed for this set to work.
-//| Note that if you enable this, you will have to go to the scripts_main.conf
-//| and disable the original one.
-npc: npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt
-//|
-//| The configuration file.
-npc: npc/custom/eAAC_Scripts/kafraExpress/config.txt
-
-//| The files for this npc.
-
-npc: npc/custom/eAAC_Scripts/kafraExpress/kafras.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_main.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_bank.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_broadcast.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_jobchange.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_jobswap.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_rent.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_shop.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_refine.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_uncard.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_dungeon.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_pvp.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_town.txt
-npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt
-
-//| For more info referring this script, open the provided readme.txt in this folder.
+//|-----------------------------------------------------------------| +//|- English Athena Approved Certified Script: Kafra Express Set -| +//|-----------------------------------------------------------------| +//| Under this is the global_functions.txt needed for this set to work. +//| Note that if you enable this, you will have to go to the scripts_main.conf +//| and disable the original one. +npc: npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt +//| +//| The configuration file. +npc: npc/custom/eAAC_Scripts/kafraExpress/config.txt + +//| The files for this npc. + +npc: npc/custom/eAAC_Scripts/kafraExpress/kafras.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_main.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_bank.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_broadcast.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_jobchange.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_jobswap.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_rent.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_shop.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_refine.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_uncard.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_dungeon.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_pvp.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_town.txt +npc: npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt + +//| For more info referring this script, open the provided readme.txt in this folder. //| Copyright © 2004 - 2006 Skotlex. All Rights Reserved for him (this is almost a trademark =X)
\ No newline at end of file diff --git a/npc/custom/eAAC_Scripts/banker.txt b/npc/custom/eAAC_Scripts/banker.txt index 7e0ac7584..ee98775de 100644 --- a/npc/custom/eAAC_Scripts/banker.txt +++ b/npc/custom/eAAC_Scripts/banker.txt @@ -1,461 +1,461 @@ -//| ~~~~~~~~~~~ Information ~~~~~~~~~~~
-//| | This is a simple banking npc, |
-//| | which uses coins to store zeny |
-//| | instead of using those global |
-//| | variables :P |
-//| | |
-//| | It's fully customizable, you |
-//| | can exchange the coin ID used |
-//| | at will, it won't affect the |
-//| | script whatsoever =3 |
-//| | |
-//| | The prices can also be set, the |
-//| | way you like the most, as they |
-//| | won't affect the script either |
-//| | |
-//| | No db/client files modification |
-//| | needed, just "Plug&Play" ;P |
-//| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-//| Revision:
-//| v.1.0: Released script. No problems or bugs found, at least :P
-//| It's your duty to find them now if there are.
-//| @minvalue must contain the coin price of the lowest coin value
-//| in order for the script to work correctly. By default it's set
-//| to the bronze coin
-
-//| Revision:
-//| v.2.0: Added a Mix option in the Zeny to Coin function,
-//| where it allows you to split your desired Zeny into
-//| the coins you wish to obtain, without having to go
-//| through the other functions to obtain them all. That way
-//| you can get them all at once ;3
-//|
-//| It also displays the total zeny being exchanged,
-//| the total coins obtained and the difference between
-//| the amount of zeny you've inputted and the sum of
-//| the coin's values.
-
-//| Revision:
-//| v.2.5: Replaced all the coin names with a variable that has
-//| getitemname(<coin_id), for more customization of the script.
-//|
-//| Fixed aswell a 0 at the mixing function, it had an unexistant
-//| variable plus it was rendering a message to 0. Pretty bad =/
-//|
-//| The implementation of the getitemname was because some people
-//| complaining that those items seemed to be wrong, that the name
-//| in the db was Platinum while the script had Silver, so well,
-//| there you have it. No more silver coins, thanks to you :)
-
-//| Revision:
-//| v.2.6: Added another Weight check to prevent coins from dropping
-//| to the ground because A) Too many coins (more than 30,000 ea)
-//| B) Your current weight + total coins weight were greater than
-//| your max weight, causing them to drop due to "over-weight".
-//| Thanks to Niktout for spotting it.
-
-//| Revision:
-//| v.2.7: Added a check to the Zeny -> Coin Mix label. It seems you
-//| can trade with negative zeny (meh...). This should prevent it.
-//| Thanks to Niktout.
-
-//| Revision:
-//| v.2.8: Added a n00b check for the Zeny -> Coin function. Should
-//| prevent zeny overflow. Also added a variable cleaning section
-//| at the beginning of the Mix function, to prevent old values
-//| to be used as a payout.
-
-//| Upcomming possible updates:
-//| v.3.0: Adding a refining system, so you can gather ore and the likes
-//| to make your own coins. They will have a failure chance
-//| of course. You will need, for now: 10 ores of the type of
-//| coin you wish, a mini furnace, an anvil depending on what
-//| You're crafting, and a hammer according to it.
-
-//| Copyright © 2006 erKURITA. All Rights Reserved
-
-prontera.gat,155,188,3 script Zacariath Madhat 872,{
-
-//|~~~~~~~~~ Settings of the NPC: ~~~~~~~~~~~~~~~~~
-set @npcname$,"^999999[Zach]^000000"; //|
-set @bronzeprice,10000; //|
-set @silverprice,100000; //|
-set @goldprice,1000000; //|
-set @mithrilprice,10000000; //|
-set @bronzecoinid,673; //|
-set @silvercoinid,677; //|
-set @goldcoinid,671; //|
-set @mithrilcoinid,674; //|
-set @minvalue,@bronzeprice; //|
-set @name1$,getitemname(@bronzecoinid); //|
-set @name2$,getitemname(@silvercoinid); //|
-set @name3$,getitemname(@goldcoinid); //|
-set @name4$,getitemname(@mithrilcoinid); //|
-set @MAX_ZENY,1000000000; //|
-//|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-mes @npcname$;
-mes "Hi "+strcharinfo(0)+", I'm this town's banker";
-mes "I can allow you to exchange your zeny into useful and handy coins, which you can use to make trades between players, or just save them";
-next;
-mes @npcname$;
-mes "^996600"+@name1$+"s^000000 are worth "+@bronzeprice+"z, ^999999"+@name2$+"s^000000 are worth "+@silverprice+"z, ^FFCC00"+@name3$+"s^000000 "+@goldprice+"z, ^CCCCCC"+@name4$+"s^000000 are worth "+@mithrilprice+"z";
-next;
-goto L_Menu;
-
-L_Menu:
-mes @npcname$;
-mes "What do you want to do then?";
-menu "Exchange my coins into zeny",L_CoinZeny,"Exchange my zeny into coins",L_ZenyCoin,"Nothing for now, sorry",L_End;
-
-//| Here starts the Coin to Zeny Exchange
-
-L_CoinZeny:
-
- next;
- mes @npcname$;
- mes "First than anything, what kind of coins are you going to exchange?";
- menu @name1$+"s",L_Bronze,@name2$+"s",L_Silver,@name3$+"s",L_Gold,@name4$+"s",L_Mithril,"None for now",L_Menu;
-
-
- L_Bronze:
- callsub L_Coincheckout,@bronzecoinid,@bronzeprice;
- goto L_CoinZeny;
-
- L_Silver:
- callsub L_Coincheckout,@silvercoinid,@silverprice;
- goto L_CoinZeny;
-
- L_Gold:
- callsub L_Coincheckout,@goldcoinid,@goldprice;
- goto L_CoinZeny;
-
- L_Mithril:
- callsub L_Coincheckout,@mithrilcoinid,@mithrilprice;
- goto L_CoinZeny;
-
-L_Coincheckout:
-
-switch(getarg(0)) {
- case @bronzecoinid:
- set @coinname$,"^996600"+getitemname(getarg(0))+"^000000";
- break;
- case @silvercoinid:
- set @coinname$,"^999999"+getitemname(getarg(0))+"^000000";
- break;
- case @goldcoinid:
- set @coinname$,"^FFCC00"+getitemname(getarg(0))+"^000000";
- break;
- case @mithrilcoinid:
- set @coinname$,"^CCCCCC"+getitemname(getarg(0))+"^000000";
- break;
- }
-
-
-L_PreInputing:
-next;
- mes @npcname$;
- mes "Let's see, how many coins do you want to exchange?";
- next;
- goto L_Inputing;
-
- L_Inputing:
- input @coinamount;
-
- if (@coinamount == 0) {
- mes @npcname$;
- mes "You didn't input any amount, please retry";
- next;
- goto L_Inputing;
- } else if (countitem(getarg(0)) < @coinamount) {
- mes @npcname$;
- mes "You don't have enough coins, please get some";
- next;
- goto L_Menu;
- } else if (@coinamount*getarg(1) > @MAX_ZENY) {
- mes @npcname$;
- mes "I'm sorry, the quantity you inputted gives a bigger zeny amount than the max allowed. I can't allow this.";
- next;
- goto L_Menu
- } else
-
- next;
- mes @npcname$;
- mes "So, you want to exchange "+@coinamount+" "+@coinname$+" ?";
- menu "Yes, I want to exchange this much",L_Proceed,"No, I want to exchange something else",L_CoinZeny,"No, I want to input another number",L_Inputing,"No, I dont want to exchange anything",L_Menu;
-
- L_Proceed:
- next;
- set @price,getarg(1)*@coinamount;
- set Zeny,Zeny+@price;
- delitem getarg(0),@coinamount;
- mes @npcname$;
- mes "There we go, here's your money";
- next;
- return;
-
-//| Here starts the Zeny to Coin exchange.
-
-L_ZenyCoin:
- next;
- if (MaxWeight*50/100 < Weight) {
- if (MaxWeight*90/100 < Weight) {
- mes @npcname$;
- mes "Sorry but you have more than 90% weight. Your coins might drop. I can't give you anything.";
- next;
- goto L_Menu;
- } else
- mes @npcname$;
- mes "You have 50% or more weight, do you still want to continue?";
- menu "Yes",L_ContinueZenyCoin,"No, thanks",L_Menu;
- }
-L_ContinueZenyCoin:
- mes @npcname$;
- mes "First, how much zeny do you want to exchange";
- callsub L_Inputingzeny;
- callsub L_Zenycoins;
- next;
- mes @npcname$;
- mes "You can have, with "+@zenyamount+":";
- mes "^996600"+@bronzezeny+"^000000 "+@name1$+"s";
- mes "^999999"+@silverzeny+"^000000 "+@name2$+"s";
- mes "^FFCC00"+@goldzeny+"^000000 "+@name3$+"s";
- mes "or";
- mes "^CCCCCC"+@mithrilzeny+"^000000 "+@name4$+"s";
- next;
- if (@zenyamount < @minvalue) goto L_Moremoney;
- goto L_ZenyCoin2;
-
- L_ZenyCoin2:
- mes @npcname$;
- mes "Which coins do you want? Or do you want a mix of them?";
- menu "I want the "+@name1$+"s",L_Bronzes,"I want the "+@name2$+"s",L_Silvers,"I want the "+@name3$+"s",L_Golds,"I want the "+@name4$+"s",L_Mithrils,"I want a mix of them",L_Mix,"Nothing for now, sorry",L_Menu;
-
- L_Bronzes:
- if (@bronzezeny == 0) goto L_Moremoney;
- callsub L_Zenycheckout,@bronzecoinid,@bronzeprice,@bronzezeny;
- goto L_Menu;
-
- L_Silvers:
- if (@silverzeny == 0) goto L_Moremoney;
- callsub L_Zenycheckout,@silvercoinid,@silverprice,@silverzeny;
- goto L_Menu;
-
- L_Golds:
- if (@goldzeny == 0) goto L_Moremoney;
- callsub L_Zenycheckout,@goldcoinid,@goldprice,@goldzeny;
- goto L_Menu;
-
- L_Mithrils:
- if (@mithrilzeny == 0) goto L_Moremoney;
- callsub L_Zenycheckout,@mithrilcoinid,@mithrilprice,@mithrilzeny;
- goto L_Menu;
-
-L_Zenycheckout:
- next;
- if (((getiteminfo(getarg(0),6))*getarg(2)) > (MaxWeight-Weight)) {
- mes @npcname$;
- mes "Sorry, your max weight does not allow me to give you this much of zeny coins";
- mes "Either choose another type of coins or a lower quantity, thanks";
- close;
- }
- if (getarg(2) > 30000) {
- mes @npcname$;
- mes "Sorry, I can't give you more than 30,000 ea";
- mes "Pick another coin type";
- close;
- }
- set @itemid,getarg(0);
- set @pricea,getarg(1)*getarg(2);
- getitem @itemid,getarg(2);
- set Zeny,Zeny-@pricea;
- mes @npcname$;
- mes "There you go, here's your coins";
- next;
- return;
-
-L_Zenycoins:
- set @bronzezeny,@zenyamount/@bronzeprice;
- set @silverzeny,@zenyamount/@silverprice;
- set @goldzeny,@zenyamount/@goldprice;
- set @mithrilzeny,@zenyamount/@mithrilprice;
- return;
-
-L_Inputingzeny:
-
- input @zenyamount;
- if (Zeny == 0) {
- mes @npcname$;
- mes "You don't have any Zeny left. I can't do anything. Get some Zeny first";
- next;
- goto L_Menu;
- } else if (@zenyamount == 0) {
- mes @npcname$;
- mes "You didn't input any amount, please retry";
- next;
- goto L_Inputingzeny;
- } else if (@zenyamount > Zeny) {
- mes @npcname$;
- mes "The inputted zeny amount is bigger than your actual zeny amount";
- mes "Please re-entry another amount";
- next;
- goto L_Inputingzeny;
-
- } else return;
-
-//| Other labels
-
-L_Moremoney:
- mes @npcname$;
- mes "You need to get more zeny, I can't give you anything with "+@zenyamount+"z, sorry";
- next;
- goto L_Menu;
-
-L_End:
- next;
- mes @npcname$;
- mes "Good to see you and hope to see you again. Bye";
- close;
-
-
-//| Mix function
-
-L_Mix:
- set @totalzeny,0;
- set @totalcoins,0;
- set @bronzecoins,0;
- set @silvercoins,0;
- set @goldcoins,0;
- set @mithrilcoins,0;
- next;
- mes @npcname$;
- mes "Ok, let's start with ^996600"+@name1$+"s^000000";
- next;
- mes @npcname$;
- mes "How many coins do you want?";
- input @bronzecoins;
- next;
- set @totalzeny,@bronzecoins*@bronzeprice;
- set @totalcoins,@bronzecoins;
- mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000";
- mes "Coins:";
- mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000";
- mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯";
- if (@totalzeny > @zenyamount || @totalzeny < 0) {
- mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- goto L_Overzeny;
- } else
- mes "TOTAL Zeny: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- next;
- if (@totalzeny > @zenyamount || @totalzeny < 0)
- mes @npcname$;
- mes "Is this enough or do you want more?";
- menu "It's enough, thanks",L_Payoff,"No, I want some more",-;
- next;
- mes @npcname$;
- mes "Now ^999999"+@name2$+"s^000000. How many coins do you want?";
- next;
- input @silvercoins;
- next;
- set @totalzeny,@bronzecoins*@bronzeprice+@silvercoins*@silverprice;
- set @totalcoins,@bronzecoins+@silvercoins;
- mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000";
- mes "Coins:";
- mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000";
- mes " ^999999"+@name2$+"s^000000: "+@silvercoins+" ^CC0000"+@silvercoins*@silverprice+"^000000";
- mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯";
- if (@totalzeny > @zenyamount || @totalzeny < 0) {
- mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- goto L_Overzeny;
- } else
- mes "TOTAL Zeny: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- next;
- if (@totalzeny > @zenyamount || @totalzeny < 0) goto L_Overzeny;
- mes @npcname$;
- mes "Is this enough or do you want more?";
- menu "It's enough, thanks",L_Payoff,"No, I want some more",-;
- next;
- mes @npcname$;
- mes "Now ^FFCC00"+@name3$+"s^000000. How many coins do you want?";
- input @goldcoins;
- next;
- set @totalzeny,@bronzecoins*@bronzeprice+@silvercoins*@silverprice+@goldcoins*@goldprice;
- set @totalcoins,@bronzecoins+@silvercoins+@goldcoins;
- mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000";
- mes "Coins:";
- mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000";
- mes " ^999999"+@name2$+"s^000000: "+@silvercoins+" ^CC0000"+@silvercoins*@silverprice+"^000000";
- mes " ^FFCC00"+@name3$+"s^000000: "+@goldcoins+" ^CC0000"+@goldcoins*@goldprice+"^000000";
- mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯";
- if (@totalzeny > @zenyamount || @totalzeny < 0) {
- mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- goto L_Overzeny;
- } else
- mes "TOTAL Zeny: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- next;
- if (@totalzeny > @zenyamount || @totalzeny < 0) goto L_Overzeny;
- mes @npcname$;
- mes "Is this enough or do you want more?";
- menu "It's enough, thanks",L_Payoff,"No, I want some more",-;
- next;
- mes @npcname$;
- mes "Now ^CCCCCC"+@name4$+"s^000000. How many coins do you want?";
- input @mithrilcoins;
- next;
- set @totalzeny,@bronzecoins*@bronzeprice+@silvercoins*@silverprice+@goldcoins*@goldprice+@mithrilcoins*@mithrilprice;
- set @totalcoins,@bronzecoins+@silvercoins+@goldcoins+@mithrilcoins;
- mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000";
- mes "Coins:";
- mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000";
- mes " ^999999"+@name2$+"s^000000: "+@silvercoins+" ^CC0000"+@silvercoins*@silverprice+"^000000";
- mes " ^FFCC00"+@name3$+"s^000000: "+@goldcoins+" ^CC0000"+@goldcoins*@goldprice+"^000000";
- mes " ^CCCCCC"+@name4$+"s^000000: "+@mithrilcoins+" ^CC0000"+@mithrilcoins*@mithrilprice+"^000000";
- mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯";
- if (@totalzeny > @zenyamount || @totalzeny < 0) {
- mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- goto L_Overzeny;
- } else
- mes "TOTAL: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000";
- mes "Zeny Left: "+(@zenyamount-@totalzeny);
- next;
- if (@totalzeny > @zenyamount || @totalzeny < 0) goto L_Overzeny;
- mes @npcname$;
- mes "Is this ok?: "+@bronzecoins+" "+@name1$+"s, "+@silvercoins+" "+@name2$+"s, "+@goldcoins+" "+@name3$+"s, "+@mithrilcoins+" "+@name4$+"s, for a total amount of "+@totalzeny;
- menu "Yes, it's ok",L_Payoff,"No, I want to re-intro them",L_Mix,"Sorry, I dont want anything",L_Menu;
-
-L_Payoff:
- next;
- if (@zenyamount > Zeny) goto L_Overzeny;
- set Zeny,Zeny-@totalzeny;
- getitem @bronzecoinid,@bronzecoins;
- getitem @silvercoinid,@silvercoins;
- getitem @goldcoinid,@goldcoins;
- getitem @mithrilcoinid,@mithrilcoins;
- mes @npcname$;
- mes "There you go, here's your coins";
- next;
- set @bronzecoins,0;
- set @silvercoins,0;
- set @goldcoins,0;
- set @mithrilcoins,0;
- goto L_End;
-
-L_Overzeny:
- next;
- mes @npcname$;
- mes "Sorry, I can't do anything else. Either the sum of all the coins you inputted is bigger than the zeny amount inputted, or the inputted amout of zeny is bigger that your total Zeny. Please retry.";
- next;
- goto L_Menu;
-
-OnInit:
-setitemscript 671,"{}";
-end;
+//| ~~~~~~~~~~~ Information ~~~~~~~~~~~ +//| | This is a simple banking npc, | +//| | which uses coins to store zeny | +//| | instead of using those global | +//| | variables :P | +//| | | +//| | It's fully customizable, you | +//| | can exchange the coin ID used | +//| | at will, it won't affect the | +//| | script whatsoever =3 | +//| | | +//| | The prices can also be set, the | +//| | way you like the most, as they | +//| | won't affect the script either | +//| | | +//| | No db/client files modification | +//| | needed, just "Plug&Play" ;P | +//| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +//| Revision: +//| v.1.0: Released script. No problems or bugs found, at least :P +//| It's your duty to find them now if there are. +//| @minvalue must contain the coin price of the lowest coin value +//| in order for the script to work correctly. By default it's set +//| to the bronze coin + +//| Revision: +//| v.2.0: Added a Mix option in the Zeny to Coin function, +//| where it allows you to split your desired Zeny into +//| the coins you wish to obtain, without having to go +//| through the other functions to obtain them all. That way +//| you can get them all at once ;3 +//| +//| It also displays the total zeny being exchanged, +//| the total coins obtained and the difference between +//| the amount of zeny you've inputted and the sum of +//| the coin's values. + +//| Revision: +//| v.2.5: Replaced all the coin names with a variable that has +//| getitemname(<coin_id), for more customization of the script. +//| +//| Fixed aswell a 0 at the mixing function, it had an unexistant +//| variable plus it was rendering a message to 0. Pretty bad =/ +//| +//| The implementation of the getitemname was because some people +//| complaining that those items seemed to be wrong, that the name +//| in the db was Platinum while the script had Silver, so well, +//| there you have it. No more silver coins, thanks to you :) + +//| Revision: +//| v.2.6: Added another Weight check to prevent coins from dropping +//| to the ground because A) Too many coins (more than 30,000 ea) +//| B) Your current weight + total coins weight were greater than +//| your max weight, causing them to drop due to "over-weight". +//| Thanks to Niktout for spotting it. + +//| Revision: +//| v.2.7: Added a check to the Zeny -> Coin Mix label. It seems you +//| can trade with negative zeny (meh...). This should prevent it. +//| Thanks to Niktout. + +//| Revision: +//| v.2.8: Added a n00b check for the Zeny -> Coin function. Should +//| prevent zeny overflow. Also added a variable cleaning section +//| at the beginning of the Mix function, to prevent old values +//| to be used as a payout. + +//| Upcomming possible updates: +//| v.3.0: Adding a refining system, so you can gather ore and the likes +//| to make your own coins. They will have a failure chance +//| of course. You will need, for now: 10 ores of the type of +//| coin you wish, a mini furnace, an anvil depending on what +//| You're crafting, and a hammer according to it. + +//| Copyright © 2006 erKURITA. All Rights Reserved + +prontera.gat,155,188,3 script Zacariath Madhat 872,{ + +//|~~~~~~~~~ Settings of the NPC: ~~~~~~~~~~~~~~~~~ +set @npcname$,"^999999[Zach]^000000"; //| +set @bronzeprice,10000; //| +set @silverprice,100000; //| +set @goldprice,1000000; //| +set @mithrilprice,10000000; //| +set @bronzecoinid,673; //| +set @silvercoinid,677; //| +set @goldcoinid,671; //| +set @mithrilcoinid,674; //| +set @minvalue,@bronzeprice; //| +set @name1$,getitemname(@bronzecoinid); //| +set @name2$,getitemname(@silvercoinid); //| +set @name3$,getitemname(@goldcoinid); //| +set @name4$,getitemname(@mithrilcoinid); //| +set @MAX_ZENY,1000000000; //| +//|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +mes @npcname$; +mes "Hi "+strcharinfo(0)+", I'm this town's banker"; +mes "I can allow you to exchange your zeny into useful and handy coins, which you can use to make trades between players, or just save them"; +next; +mes @npcname$; +mes "^996600"+@name1$+"s^000000 are worth "+@bronzeprice+"z, ^999999"+@name2$+"s^000000 are worth "+@silverprice+"z, ^FFCC00"+@name3$+"s^000000 "+@goldprice+"z, ^CCCCCC"+@name4$+"s^000000 are worth "+@mithrilprice+"z"; +next; +goto L_Menu; + +L_Menu: +mes @npcname$; +mes "What do you want to do then?"; +menu "Exchange my coins into zeny",L_CoinZeny,"Exchange my zeny into coins",L_ZenyCoin,"Nothing for now, sorry",L_End; + +//| Here starts the Coin to Zeny Exchange + +L_CoinZeny: + + next; + mes @npcname$; + mes "First than anything, what kind of coins are you going to exchange?"; + menu @name1$+"s",L_Bronze,@name2$+"s",L_Silver,@name3$+"s",L_Gold,@name4$+"s",L_Mithril,"None for now",L_Menu; + + + L_Bronze: + callsub L_Coincheckout,@bronzecoinid,@bronzeprice; + goto L_CoinZeny; + + L_Silver: + callsub L_Coincheckout,@silvercoinid,@silverprice; + goto L_CoinZeny; + + L_Gold: + callsub L_Coincheckout,@goldcoinid,@goldprice; + goto L_CoinZeny; + + L_Mithril: + callsub L_Coincheckout,@mithrilcoinid,@mithrilprice; + goto L_CoinZeny; + +L_Coincheckout: + +switch(getarg(0)) { + case @bronzecoinid: + set @coinname$,"^996600"+getitemname(getarg(0))+"^000000"; + break; + case @silvercoinid: + set @coinname$,"^999999"+getitemname(getarg(0))+"^000000"; + break; + case @goldcoinid: + set @coinname$,"^FFCC00"+getitemname(getarg(0))+"^000000"; + break; + case @mithrilcoinid: + set @coinname$,"^CCCCCC"+getitemname(getarg(0))+"^000000"; + break; + } + + +L_PreInputing: +next; + mes @npcname$; + mes "Let's see, how many coins do you want to exchange?"; + next; + goto L_Inputing; + + L_Inputing: + input @coinamount; + + if (@coinamount == 0) { + mes @npcname$; + mes "You didn't input any amount, please retry"; + next; + goto L_Inputing; + } else if (countitem(getarg(0)) < @coinamount) { + mes @npcname$; + mes "You don't have enough coins, please get some"; + next; + goto L_Menu; + } else if (@coinamount*getarg(1) > @MAX_ZENY) { + mes @npcname$; + mes "I'm sorry, the quantity you inputted gives a bigger zeny amount than the max allowed. I can't allow this."; + next; + goto L_Menu + } else + + next; + mes @npcname$; + mes "So, you want to exchange "+@coinamount+" "+@coinname$+" ?"; + menu "Yes, I want to exchange this much",L_Proceed,"No, I want to exchange something else",L_CoinZeny,"No, I want to input another number",L_Inputing,"No, I dont want to exchange anything",L_Menu; + + L_Proceed: + next; + set @price,getarg(1)*@coinamount; + set Zeny,Zeny+@price; + delitem getarg(0),@coinamount; + mes @npcname$; + mes "There we go, here's your money"; + next; + return; + +//| Here starts the Zeny to Coin exchange. + +L_ZenyCoin: + next; + if (MaxWeight*50/100 < Weight) { + if (MaxWeight*90/100 < Weight) { + mes @npcname$; + mes "Sorry but you have more than 90% weight. Your coins might drop. I can't give you anything."; + next; + goto L_Menu; + } else + mes @npcname$; + mes "You have 50% or more weight, do you still want to continue?"; + menu "Yes",L_ContinueZenyCoin,"No, thanks",L_Menu; + } +L_ContinueZenyCoin: + mes @npcname$; + mes "First, how much zeny do you want to exchange"; + callsub L_Inputingzeny; + callsub L_Zenycoins; + next; + mes @npcname$; + mes "You can have, with "+@zenyamount+":"; + mes "^996600"+@bronzezeny+"^000000 "+@name1$+"s"; + mes "^999999"+@silverzeny+"^000000 "+@name2$+"s"; + mes "^FFCC00"+@goldzeny+"^000000 "+@name3$+"s"; + mes "or"; + mes "^CCCCCC"+@mithrilzeny+"^000000 "+@name4$+"s"; + next; + if (@zenyamount < @minvalue) goto L_Moremoney; + goto L_ZenyCoin2; + + L_ZenyCoin2: + mes @npcname$; + mes "Which coins do you want? Or do you want a mix of them?"; + menu "I want the "+@name1$+"s",L_Bronzes,"I want the "+@name2$+"s",L_Silvers,"I want the "+@name3$+"s",L_Golds,"I want the "+@name4$+"s",L_Mithrils,"I want a mix of them",L_Mix,"Nothing for now, sorry",L_Menu; + + L_Bronzes: + if (@bronzezeny == 0) goto L_Moremoney; + callsub L_Zenycheckout,@bronzecoinid,@bronzeprice,@bronzezeny; + goto L_Menu; + + L_Silvers: + if (@silverzeny == 0) goto L_Moremoney; + callsub L_Zenycheckout,@silvercoinid,@silverprice,@silverzeny; + goto L_Menu; + + L_Golds: + if (@goldzeny == 0) goto L_Moremoney; + callsub L_Zenycheckout,@goldcoinid,@goldprice,@goldzeny; + goto L_Menu; + + L_Mithrils: + if (@mithrilzeny == 0) goto L_Moremoney; + callsub L_Zenycheckout,@mithrilcoinid,@mithrilprice,@mithrilzeny; + goto L_Menu; + +L_Zenycheckout: + next; + if (((getiteminfo(getarg(0),6))*getarg(2)) > (MaxWeight-Weight)) { + mes @npcname$; + mes "Sorry, your max weight does not allow me to give you this much of zeny coins"; + mes "Either choose another type of coins or a lower quantity, thanks"; + close; + } + if (getarg(2) > 30000) { + mes @npcname$; + mes "Sorry, I can't give you more than 30,000 ea"; + mes "Pick another coin type"; + close; + } + set @itemid,getarg(0); + set @pricea,getarg(1)*getarg(2); + getitem @itemid,getarg(2); + set Zeny,Zeny-@pricea; + mes @npcname$; + mes "There you go, here's your coins"; + next; + return; + +L_Zenycoins: + set @bronzezeny,@zenyamount/@bronzeprice; + set @silverzeny,@zenyamount/@silverprice; + set @goldzeny,@zenyamount/@goldprice; + set @mithrilzeny,@zenyamount/@mithrilprice; + return; + +L_Inputingzeny: + + input @zenyamount; + if (Zeny == 0) { + mes @npcname$; + mes "You don't have any Zeny left. I can't do anything. Get some Zeny first"; + next; + goto L_Menu; + } else if (@zenyamount == 0) { + mes @npcname$; + mes "You didn't input any amount, please retry"; + next; + goto L_Inputingzeny; + } else if (@zenyamount > Zeny) { + mes @npcname$; + mes "The inputted zeny amount is bigger than your actual zeny amount"; + mes "Please re-entry another amount"; + next; + goto L_Inputingzeny; + + } else return; + +//| Other labels + +L_Moremoney: + mes @npcname$; + mes "You need to get more zeny, I can't give you anything with "+@zenyamount+"z, sorry"; + next; + goto L_Menu; + +L_End: + next; + mes @npcname$; + mes "Good to see you and hope to see you again. Bye"; + close; + + +//| Mix function + +L_Mix: + set @totalzeny,0; + set @totalcoins,0; + set @bronzecoins,0; + set @silvercoins,0; + set @goldcoins,0; + set @mithrilcoins,0; + next; + mes @npcname$; + mes "Ok, let's start with ^996600"+@name1$+"s^000000"; + next; + mes @npcname$; + mes "How many coins do you want?"; + input @bronzecoins; + next; + set @totalzeny,@bronzecoins*@bronzeprice; + set @totalcoins,@bronzecoins; + mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000"; + mes "Coins:"; + mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000"; + mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"; + if (@totalzeny > @zenyamount || @totalzeny < 0) { + mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + goto L_Overzeny; + } else + mes "TOTAL Zeny: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + next; + if (@totalzeny > @zenyamount || @totalzeny < 0) + mes @npcname$; + mes "Is this enough or do you want more?"; + menu "It's enough, thanks",L_Payoff,"No, I want some more",-; + next; + mes @npcname$; + mes "Now ^999999"+@name2$+"s^000000. How many coins do you want?"; + next; + input @silvercoins; + next; + set @totalzeny,@bronzecoins*@bronzeprice+@silvercoins*@silverprice; + set @totalcoins,@bronzecoins+@silvercoins; + mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000"; + mes "Coins:"; + mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000"; + mes " ^999999"+@name2$+"s^000000: "+@silvercoins+" ^CC0000"+@silvercoins*@silverprice+"^000000"; + mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"; + if (@totalzeny > @zenyamount || @totalzeny < 0) { + mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + goto L_Overzeny; + } else + mes "TOTAL Zeny: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + next; + if (@totalzeny > @zenyamount || @totalzeny < 0) goto L_Overzeny; + mes @npcname$; + mes "Is this enough or do you want more?"; + menu "It's enough, thanks",L_Payoff,"No, I want some more",-; + next; + mes @npcname$; + mes "Now ^FFCC00"+@name3$+"s^000000. How many coins do you want?"; + input @goldcoins; + next; + set @totalzeny,@bronzecoins*@bronzeprice+@silvercoins*@silverprice+@goldcoins*@goldprice; + set @totalcoins,@bronzecoins+@silvercoins+@goldcoins; + mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000"; + mes "Coins:"; + mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000"; + mes " ^999999"+@name2$+"s^000000: "+@silvercoins+" ^CC0000"+@silvercoins*@silverprice+"^000000"; + mes " ^FFCC00"+@name3$+"s^000000: "+@goldcoins+" ^CC0000"+@goldcoins*@goldprice+"^000000"; + mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"; + if (@totalzeny > @zenyamount || @totalzeny < 0) { + mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + goto L_Overzeny; + } else + mes "TOTAL Zeny: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + next; + if (@totalzeny > @zenyamount || @totalzeny < 0) goto L_Overzeny; + mes @npcname$; + mes "Is this enough or do you want more?"; + menu "It's enough, thanks",L_Payoff,"No, I want some more",-; + next; + mes @npcname$; + mes "Now ^CCCCCC"+@name4$+"s^000000. How many coins do you want?"; + input @mithrilcoins; + next; + set @totalzeny,@bronzecoins*@bronzeprice+@silvercoins*@silverprice+@goldcoins*@goldprice+@mithrilcoins*@mithrilprice; + set @totalcoins,@bronzecoins+@silvercoins+@goldcoins+@mithrilcoins; + mes "Zeny Amount Inputted: ^000066"+@zenyamount+"^000000"; + mes "Coins:"; + mes " ^996600"+@name1$+"s^000000: "+@bronzecoins+" ^CC0000"+@bronzecoins*@bronzeprice+"^000000"; + mes " ^999999"+@name2$+"s^000000: "+@silvercoins+" ^CC0000"+@silvercoins*@silverprice+"^000000"; + mes " ^FFCC00"+@name3$+"s^000000: "+@goldcoins+" ^CC0000"+@goldcoins*@goldprice+"^000000"; + mes " ^CCCCCC"+@name4$+"s^000000: "+@mithrilcoins+" ^CC0000"+@mithrilcoins*@mithrilprice+"^000000"; + mes "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"; + if (@totalzeny > @zenyamount || @totalzeny < 0) { + mes "TOTAL Zeny: "+@totalcoins+" - ^CC0000"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + goto L_Overzeny; + } else + mes "TOTAL: "+@totalcoins+" ^00CC00"+@totalzeny+"^000000"; + mes "Zeny Left: "+(@zenyamount-@totalzeny); + next; + if (@totalzeny > @zenyamount || @totalzeny < 0) goto L_Overzeny; + mes @npcname$; + mes "Is this ok?: "+@bronzecoins+" "+@name1$+"s, "+@silvercoins+" "+@name2$+"s, "+@goldcoins+" "+@name3$+"s, "+@mithrilcoins+" "+@name4$+"s, for a total amount of "+@totalzeny; + menu "Yes, it's ok",L_Payoff,"No, I want to re-intro them",L_Mix,"Sorry, I dont want anything",L_Menu; + +L_Payoff: + next; + if (@zenyamount > Zeny) goto L_Overzeny; + set Zeny,Zeny-@totalzeny; + getitem @bronzecoinid,@bronzecoins; + getitem @silvercoinid,@silvercoins; + getitem @goldcoinid,@goldcoins; + getitem @mithrilcoinid,@mithrilcoins; + mes @npcname$; + mes "There you go, here's your coins"; + next; + set @bronzecoins,0; + set @silvercoins,0; + set @goldcoins,0; + set @mithrilcoins,0; + goto L_End; + +L_Overzeny: + next; + mes @npcname$; + mes "Sorry, I can't do anything else. Either the sum of all the coins you inputted is bigger than the zeny amount inputted, or the inputted amout of zeny is bigger that your total Zeny. Please retry."; + next; + goto L_Menu; + +OnInit: +setitemscript 671,"{}"; +end; }
\ No newline at end of file diff --git a/npc/custom/eAAC_Scripts/disguiser.txt b/npc/custom/eAAC_Scripts/disguiser.txt index 218de0196..7b184cc90 100644 --- a/npc/custom/eAAC_Scripts/disguiser.txt +++ b/npc/custom/eAAC_Scripts/disguiser.txt @@ -1,179 +1,179 @@ -//===== eAthena Script =======================================
-//= Disguiser Quesr
-//===== By: ==================================================
-//= PalasX (http://cashaan.dontexist.org)
-//===== Current Version: =====================================
-//= v1.20 Unified
-//===== Compatible With: =====================================
-//= SVN 5690+ (getmonsterinfo)
-//===== Description: =========================================
-//= Baphomet disguises you if you find all his brothers.
-//===== Additional Comments: =================================
-//= Gotta find them all in order
-//= Dynamically edits item 2614(eye of dullahan) with
-//= setitemscript 2614,"{bonus bdisguise,var_disguise;}";
-//= so your SVN better support it
-//= Uses GetMonsterInfo to pull monster names from server, but
-//= without sql_query, the mob IDs are set statically
-//= Went crazy with the functions, the script is TINY now :)
-//============================================================
-
-//////////////////////////
-//Places all of our NPCs//
-//////////////////////////
-prt_fild05.gat,277,226,5 script Dullahan Master 736,{
- callfunc "PXC_Disguiser",0,quest_disguise;
-Close;
-}
-
-moc_fild10.gat,34,283,4 script Dullahan Master 736,{
- callfunc "PXC_Disguiser",1,quest_disguise;
-close;
-}
-
-gef_fild00.gat,97,123,4 script Dullahan Master 736,{
- callfunc "PXC_Disguiser",2,quest_disguise;
-close;
-}
-
-pay_fild01.gat,369,305,4 script Dullahan Master 736,{
- callfunc "PXC_Disguiser",3,quest_disguise;
-close;
-}
-
-pay_fild03.gat,313,40,4 script Dullahan Master 736,{
- callfunc "PXC_Disguiser",4,quest_disguise;
-close;
-}
-
-prt_fild08.gat,362,185,4 script Dullahan Master 736,{
- callfunc "PXC_Disguiser",5,quest_disguise;
- close;
-
-
-//////////////////////////
-// edits the item used ///
-//////////////////////////
-OnInit:
- //EDIT EYE OF DULLAHAN
- setitemscript 2614,"{ bonus bdisguise,var_disguise; }";
- end;
-}
-
-
-
-
-
-//////////////////////////
-// Function. Takes:
-// INTEGER, the order number that the bapho should be visited
-// VARIABLE, the quest progression variable quest_disguise. may be changed if conflicts occur
-//
-// Puts:
-// Everything the NPC does. If you are at the right one, increase your order variable, if not, tell you where to head next on the list, when you finish, offer you to change ring properties.
-// Whenever you dont have a ring, the script will push one on you in ALL instances (wrong NPC, right NPC, and done quest).
-//////////////////////////
-
-function script PXC_Disguiser {
-
- setarray $@PXC_Next$[0],"Culvert","Morocc","Geffen","Payon","Alberta","Izlude";
-
- if(var_disguise > 1) goto Complete;
- if(getarg(0) == 5 && getarg(1) == 5) goto Last;
- if(getarg(0) == getarg(1)) goto Quest;
-
-NotMe:
- mes "[Baphomet]";
- mes "You must visit us in the proper order, as is Thor's will. Only then can we teach you the power of self-transmutation! Hunt around "+$@PXC_Next$[getarg(1)]+" Next!";
- next;
- if(countitem(2614) < 1) goto NeedRing;
- close;
-
-Cancel:
- mes "[Baphomet]";
- mes "Later.";
- close;
-
-Quest:
- set quest_disguise,getarg(1)+1;
- mes "[Baphomet]";
- mes "What am I doing here? Find my brothers and you shall learn a great secret. It is one of the secret and ancient powers of Thor! Search around "+$@PXC_Next$[getarg(1)]+" next!";
- next;
- if(countitem(2614) < 1) goto NeedRing;
- close;
-
-NeedRing:
- mes "[Baphomet]";
- mes "You will need an Eye of Dullahan ring in order to obtain our secret. I can sell you one for 500,000 zeny. Simply bring me the money, and I'll offer it unto Thor in trade!";
- next;
- menu "Buy Ring",-,"Forget it!",Cancel;
- if(Zeny < 500000) goto Cancel;
- set Zeny,Zeny-500000;
- getitem 2614,1;
- mes "[Baphomet]";
- mes "Here is your ring.";
- next;
- goto Cancel;
- close;
-
-Last:
- set quest_disguise,0;
- set var_disguise,1002;
- mes "[Baphomet]";
- mes "I am the last of the six. Forgive us for giving such horrible directions, for we, too, are born from Thor's left eye, and have a terrible mean streak. Plus, being monsters, we're complete and total idiots with a shoddy A.I.! You shall now receive your reward.";
- next;
- goto Complete;
-
-
-Complete:
- if(countitem(2614) < 1) goto NeedRing;
-
- mes "[Baphomet]";
- mes "Several millenia ago, Thor, the creator breathed life onto Midgar. In the beginning, all was well, but Thor's left eye proved to be the bane of our existance. As it's gaze set upon our land, all the monsters were let loose from within Thor's soul. Thor cast out his own eye, the only thing that could control the monsters. Your ring is made from his eye, and will give you the same powers.";
- next;
- mes "[Baphomet]";
- mes "I can change your ring's mystical properties. Which monster spirit shall I weave into your ring?";
- next;
-
- if(getarg(0)==0) callfunc "PXC_DoMenu",1001,1125;
- if(getarg(0)==1) callfunc "PXC_DoMenu",1126,1250;
- if(getarg(0)==2) callfunc "PXC_DoMenu",1251,1375;
- if(getarg(0)==3) callfunc "PXC_DoMenu",1376,1500;
- if(getarg(0)==4) callfunc "PXC_DoMenu",1503,1625;
- if(getarg(0)==5) callfunc "PXC_DoMenu",1626,1721;
-
- close;
- end;
-}
-
-//////////////////////////
-// FUNCTION.
-// Takes:
-// integer, first monster ID to show
-// integer, last monster ID to show
-//////////////////////////
-function script PXC_DoMenu {
-
- //set menu options to mob names, doing the first one manualy so we dont have an empty :
- set $@menu$, getmonsterinfo(getarg(0),MOB_NAME);
-
- for(set $@i, getarg(0)+1; $@i <= getarg(1); set $@i, $@i + 1){
- set $@menu$, $@menu$ + ":" + getmonsterinfo($@i,MOB_NAME);
- }
-
- //Fire our menu
- set @menu, select($@menu$);
-
- //Zero deliminated (off-by-one errors sux0r!!!)
- set @menu, @menu-1;
-
- //congratulate our user
- mes "Behold, whilst you wear this ring, your form shall become that of a "+getmonsterinfo(@menu + getarg(0),MOB_NAME);
-
- //update our variable, with @menu offset addded to the base getarg(0)
- set var_disguise, @menu + getarg(0);
-
- close;
- end;
-
+//===== eAthena Script ======================================= +//= Disguiser Quesr +//===== By: ================================================== +//= PalasX (http://cashaan.dontexist.org) +//===== Current Version: ===================================== +//= v1.20 Unified +//===== Compatible With: ===================================== +//= SVN 5690+ (getmonsterinfo) +//===== Description: ========================================= +//= Baphomet disguises you if you find all his brothers. +//===== Additional Comments: ================================= +//= Gotta find them all in order +//= Dynamically edits item 2614(eye of dullahan) with +//= setitemscript 2614,"{bonus bdisguise,var_disguise;}"; +//= so your SVN better support it +//= Uses GetMonsterInfo to pull monster names from server, but +//= without sql_query, the mob IDs are set statically +//= Went crazy with the functions, the script is TINY now :) +//============================================================ + +////////////////////////// +//Places all of our NPCs// +////////////////////////// +prt_fild05.gat,277,226,5 script Dullahan Master 736,{ + callfunc "PXC_Disguiser",0,quest_disguise; +Close; +} + +moc_fild10.gat,34,283,4 script Dullahan Master 736,{ + callfunc "PXC_Disguiser",1,quest_disguise; +close; +} + +gef_fild00.gat,97,123,4 script Dullahan Master 736,{ + callfunc "PXC_Disguiser",2,quest_disguise; +close; +} + +pay_fild01.gat,369,305,4 script Dullahan Master 736,{ + callfunc "PXC_Disguiser",3,quest_disguise; +close; +} + +pay_fild03.gat,313,40,4 script Dullahan Master 736,{ + callfunc "PXC_Disguiser",4,quest_disguise; +close; +} + +prt_fild08.gat,362,185,4 script Dullahan Master 736,{ + callfunc "PXC_Disguiser",5,quest_disguise; + close; + + +////////////////////////// +// edits the item used /// +////////////////////////// +OnInit: + //EDIT EYE OF DULLAHAN + setitemscript 2614,"{ bonus bdisguise,var_disguise; }"; + end; +} + + + + + +////////////////////////// +// Function. Takes: +// INTEGER, the order number that the bapho should be visited +// VARIABLE, the quest progression variable quest_disguise. may be changed if conflicts occur +// +// Puts: +// Everything the NPC does. If you are at the right one, increase your order variable, if not, tell you where to head next on the list, when you finish, offer you to change ring properties. +// Whenever you dont have a ring, the script will push one on you in ALL instances (wrong NPC, right NPC, and done quest). +////////////////////////// + +function script PXC_Disguiser { + + setarray $@PXC_Next$[0],"Culvert","Morocc","Geffen","Payon","Alberta","Izlude"; + + if(var_disguise > 1) goto Complete; + if(getarg(0) == 5 && getarg(1) == 5) goto Last; + if(getarg(0) == getarg(1)) goto Quest; + +NotMe: + mes "[Baphomet]"; + mes "You must visit us in the proper order, as is Thor's will. Only then can we teach you the power of self-transmutation! Hunt around "+$@PXC_Next$[getarg(1)]+" Next!"; + next; + if(countitem(2614) < 1) goto NeedRing; + close; + +Cancel: + mes "[Baphomet]"; + mes "Later."; + close; + +Quest: + set quest_disguise,getarg(1)+1; + mes "[Baphomet]"; + mes "What am I doing here? Find my brothers and you shall learn a great secret. It is one of the secret and ancient powers of Thor! Search around "+$@PXC_Next$[getarg(1)]+" next!"; + next; + if(countitem(2614) < 1) goto NeedRing; + close; + +NeedRing: + mes "[Baphomet]"; + mes "You will need an Eye of Dullahan ring in order to obtain our secret. I can sell you one for 500,000 zeny. Simply bring me the money, and I'll offer it unto Thor in trade!"; + next; + menu "Buy Ring",-,"Forget it!",Cancel; + if(Zeny < 500000) goto Cancel; + set Zeny,Zeny-500000; + getitem 2614,1; + mes "[Baphomet]"; + mes "Here is your ring."; + next; + goto Cancel; + close; + +Last: + set quest_disguise,0; + set var_disguise,1002; + mes "[Baphomet]"; + mes "I am the last of the six. Forgive us for giving such horrible directions, for we, too, are born from Thor's left eye, and have a terrible mean streak. Plus, being monsters, we're complete and total idiots with a shoddy A.I.! You shall now receive your reward."; + next; + goto Complete; + + +Complete: + if(countitem(2614) < 1) goto NeedRing; + + mes "[Baphomet]"; + mes "Several millenia ago, Thor, the creator breathed life onto Midgar. In the beginning, all was well, but Thor's left eye proved to be the bane of our existance. As it's gaze set upon our land, all the monsters were let loose from within Thor's soul. Thor cast out his own eye, the only thing that could control the monsters. Your ring is made from his eye, and will give you the same powers."; + next; + mes "[Baphomet]"; + mes "I can change your ring's mystical properties. Which monster spirit shall I weave into your ring?"; + next; + + if(getarg(0)==0) callfunc "PXC_DoMenu",1001,1125; + if(getarg(0)==1) callfunc "PXC_DoMenu",1126,1250; + if(getarg(0)==2) callfunc "PXC_DoMenu",1251,1375; + if(getarg(0)==3) callfunc "PXC_DoMenu",1376,1500; + if(getarg(0)==4) callfunc "PXC_DoMenu",1503,1625; + if(getarg(0)==5) callfunc "PXC_DoMenu",1626,1721; + + close; + end; +} + +////////////////////////// +// FUNCTION. +// Takes: +// integer, first monster ID to show +// integer, last monster ID to show +////////////////////////// +function script PXC_DoMenu { + + //set menu options to mob names, doing the first one manualy so we dont have an empty : + set $@menu$, getmonsterinfo(getarg(0),MOB_NAME); + + for(set $@i, getarg(0)+1; $@i <= getarg(1); set $@i, $@i + 1){ + set $@menu$, $@menu$ + ":" + getmonsterinfo($@i,MOB_NAME); + } + + //Fire our menu + set @menu, select($@menu$); + + //Zero deliminated (off-by-one errors sux0r!!!) + set @menu, @menu-1; + + //congratulate our user + mes "Behold, whilst you wear this ring, your form shall become that of a "+getmonsterinfo(@menu + getarg(0),MOB_NAME); + + //update our variable, with @menu offset addded to the base getarg(0) + set var_disguise, @menu + getarg(0); + + close; + end; + }
\ No newline at end of file diff --git a/npc/custom/eAAC_Scripts/kafraExpress/Changelog.txt b/npc/custom/eAAC_Scripts/kafraExpress/Changelog.txt index aa027b96f..2f9555f1d 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/Changelog.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/Changelog.txt @@ -1,483 +1,483 @@ -09/February/2006
-* Refine v2.7
-- Fixed buying of ores being free.
-05/February/2006
-* Readme v1.8
-- Added Kafra Shop section
-* Config v1.9
-- Added Kafra Shop section
-* Shop v0.1
-- Initial release
-* Main v5.4
-- Added support for the Kafra Shop
-* Refine v2.6
-- Inverted order of item processing to prevent overweight problems (first the
- items are charged, then you get the refined ones)
-
-08/January/2006
-* Job Swap v3.1
-- Fixed incorrect menu entry causing crash in the 2nd job menu for female classes.
-- Fixed job names from the menu not matching the job you were about to change
- into (bard/dancer adjust was broken)
-- Fixed job revert saying your previous class was always the same as the current.
-
-04/January/2006
-* readme.txt v1.7
-- Added information about the new stat reset variables.
-
-30/December/2005
-* Main v5.3
-- Fixed NPC dialog freezing after healing both HP/SP
-* Stats v2.2
-- Added option to charge reset based on base/job levels.
-* Config v1.8
-- Added reset by level cost options.
-
-20/December/2005
-* Stats v2.1
-- Fixed resets charging you again when selecting return.
-
-12/December/2005
-* Bank v2.7
-- Fixed inifite loop that would trigger on year change.
-
-08/November/2005
-* Dungeon Warping v3.1
-- Fixed a crash when warping to GonRyun
-
-02/November/2005
-* Config v1.7
-- Added Taekwon equipment variables
-- Added dungeon variables for Abyss/Thanatos/Juperos
-
-01/November/2005
-* Job Changer v3.5
-- Clean up and optimized to the new scripting engine.
-- Added Taekwon Class support
-- Acquired items will now display the slot count they have.
-
-31/October/2005
-* Pvp Warps v1.7, Woe Warps v1.7
-- Clean up and optimized to the new scripting engine.
-
-30/October/2005
-* Dungeon Warps v3.0
-- Added Abyss Lake, Thanatos Tower and Juperos.
-
-29/October/2005
-* Dungeon Warps v2.9
-- Clean up and optimized to the new scripting engine.
-
-28/October/2005
-* Refine v2.5, Renter v1.8, Stat Market v2.0, Stats v2.0, Uncard v1.5
-- Clean up and optimized to the new scripting engine.
-
-27/October/2005
-* Broadcast v3.0, Bank v2.6, Dye v1.9, Job Swapper v3.0, Main v5.2
-- Clean up and optimized to the new scripting engine.
-
-14/October/2005
-* Pvp Warps v1.6
-- Fixed standard pvp mode warps.
-
-07/October/2005
-* JobSwapper v2.5
-- Updated to work on the new script engine.
-
-06/October/2005
-* Broadcast v2.8
-- Fixed a bug when broadcasting to Room Four.
-
-17/September/2005
-* Pvp Warps v1.5
-- Made warps random.
-
-04/September/2005
-* Town Warps v1.6
-- Label fix.
-
-11/August/2005
-* PvP Warps v1.4
-- Removed the obtained item, the pvp maps are "no return" areas afterall.
-
-02/August/2005
-* Job Changer v3.2
-- Fixed issues with UpperPolicy = 1 and SkipNovice = 1 not working correctly.
-
-* readme.txt v1.6
-- Updated to reflect current changes.
-
-* Bank v2.5, Broadcast v2.7, Dye v1.7, Job Changer v3,1, Job Swapper v2.4,
- Main v5.0, Refine v2.3, Renting v1.7, StatMarket v1.9, Stats v1.8,
- Uncarder v1.3, Warp Dungeon v2.7, Warp PvP v1.3, Warp Town v1.5, Warp WoE v1.6
-- Updated all 'emotion's to use a e_* constant instead of numbers.
-- Updated function F_keIntro to simplify code.
-- Updated headers to reflect actual script requirements.
-
-* Job Changer v3.0, Job Swapper v2.6, Config v1.6
-- Removed Upper type related code as this is not really implemented in eA.
-
-07/July/2005
-* readme v1.5
-- Updated documentation regarding traveller's mode.
-- Added descriptions for the new variables in the Stat Market.
-
-* Config v1.5
-- Updated comments for Traveller's warp mode.
-- Added variables kesm_skTradeCost, kesm_stTradeCost
-- Removed Gefenia
-
-* Stat Market v1.8
-- Added support for trading directly skills->stats or stats->skills.
-
-* Town Warps v1.4
-- Added again Einbech
-- Added Traveller's Warp mode 2
-
-* Dungeon Warps v2.6
-- Added Traveller's Warp mode 2
-- Sunken Ship Traveller mode bugfix.
-- Removed Gefenia
-
-* Kafras v1.9
-- Readded Einbech's town Kafra
-- Removed Gefenia
-
-05/July/2005
-* Town Warps v1.3
-- Fixed warps being free.
-- Some optimizations.
-
-04/July/2005
-* Job Swap v2.2
-- Fixed script 'freeze' when you don't have enough to revert to the previous job.
-- Fixed job-swapping being free if you did not have enough zeny.
-
-29/June/2005
-* Config v1.4
-- Added LightHalzen Rekkeben Cost
-
-* Dungeon Warps v2.5
-- Added LightHalzen
-- Miscellanous name corrections
-
-* Town Warps v1.2
-- Removed Einbech (it is just a Einbroch Station?)
-- Added LightHalzen
-
-* Kafras v1.8
-- Removed Einbech
-- Added LightHalzen (Town + Dungeon)
-
-* Broadcast v2.6
-- Added variable kebc_showOnline to display count of recipients.
-
-* Woe Warps v1.5, Town Warps v1.1, Pvp Warps v1.2, Dungeon Warps v1.4, Config v1.2
-- Changed variable kewd_onlineStr to ked_users
-
-* Main v4.9
-- Updated to use the new warp dungeon file.
-- Some cleanup and reorganization of menus.
-
-* Warp Dungeon v2.3
-- Merged Short Warps & Deep Warps into a single file.
-
-* Main v4.8
-- Moved the warping function here.
-- ke_warp_core.txt no longer needed (removed)
-
-* Job Changer v2.9, Job Swapper v2.1
-- Some cleaning
-
-* Config v1.1
-- Reorganized, some cleaning.
-
-28/June/2005
-* readme.txt v1.3
-- Updated and cleaned documentation.
-
-* Warp Town v1.0
-- Branched off Warp Core v3.1
-
-* Warp Core v3.2
-- Removed the Town warp code.
-
-* Main v4.7
-- Reorganized Menus
-
-* Bank v2.4, Broadcast v2.5, Dye v1.6, Job Changer v2.8, Job Swap v2.0,
- Main v4.6, Refine v2.2, Rent v1.6, Stat Market v1.7, Stats v1.7,
- Uncard v1.2, Warp Core v3.1, Warp Deep v2.2, Warp Short v2.1, Warp WoE v1.4
-- Upgraded to use config.txt
-
-27/June/2005
-* Job Swap v1.9
-- Fixed another stupid bug when job-reverting
-
-14/June/2005
-* Job Changer v2.7
-- Stupid fix for changing from adv 1st class to adv 2nd...
-
-10/June/2005
-* Job Swap v1.8
-- Fixed a silly bug with the announce option.
-
-05/June/2005
-* Core Warps v3.0, Short Warps v2.0
-- Bug Fix. kewd_pyramids -> kewd_pyramid
-- kewd_turtle -> kewd_turtleIsland
-
-04/June/2005
-* Core Warps v2.9, Deep Warps v2.1
-- Bug fix related to deep warps.
-- Fixed town warp costs being always zero.
-- Fixed Niflheim cost display when online count is on.
-
-02/June/2005
-* Core Warps v2.7, Short Warps 1.9, Deep Warps 2.0, Kafras v1.7
-- Added Einbech Mines
-
-* Kafras v1.6
-- Updated Kafras with Type 2
-
-* Deep Warp v1.9, Short Warps v1.8
-- Added support for kewd_travel
-
-* Main v4.5
-- Added kewd_travel for traveller's warp system.
-- Moved Warp Menu into this module.
-
-* Pvp Warp v1.0
-- Branched off ke_warp.txt v2.4
-
-* Core Warp v2.5:
-- Added kewt_discount for town warps discount
-- Added kewd_travel for traveller's warp system.
-- Changed cost display for towns, implemented Kafra Pass discount value
-
-1/June/2005
-* Bank v 2.3
-- Added kebk_capacity variable for limited account size.
-- Added kebk_useGlobalBank variable for enabling global counter.
-
-31/May/2005
-* Job Changer v2.5, Job Swapper v1.7
-- Modified code to work around the callfunc/menu bug
-
-* Main v2.4
-- Added SaveOnSpot option
-
-26/May/2005
-* Short Warps v1.7
-- Added option kewd_turtleCave for toggling island/cave warp (Turtle Island)
-
-* Bank v2.1, Broadcast v2.4, Dye v1.5, Main v4.2, Refine v2.1, Renting v1.5
- StatMarket v1.6, Stats v1.6, Uncarder v1.1, Warp Core v2.3, Deep Warps v1.8
- Short Warps v1.6, WoE Warps v1.3, JobSwapper 1.6, JobChanger 2.4
-- Label cleaning & standarization
-
-* JobChanger v2.3
-- Replaced functions with subfunctions
-- Implemented use of new global function GF_getJobId
-
-* JobSwapper v1.5
-- Replaced functions with subfunctions
-- Implemented use of new global function GF_getJobId
-- Added Support for Baby Classes
-
-25/May/2005
-* Kafras v1.5, Bank v2.0, Broadcast v2.3, Dye v1.4, JobChange v2.1,
- JobSwapper v1.3, Main v4.1, Refine v2.0, Renting v1.4, StatMarket v1.5,
- Stats & Resets v1.5, Warp Core v2.2, Deep Warps v1.7, WoE Warps v1.2
-- Header Cleanup
-- Global Variables standarized
-
-* Bank v1.9, Refine v1.8, Warp Core v2.1, Deep Warps v1.6
-- Changed callfunc's to callsub where applicable.
-
-* Broadcast v2.2
-- Changed callfunc's to callsub where applicable.
-- Updated calls to global functions file new version.
-
-* Dye v1.3
-- New variable kedy_clothJWED specifies max dye count for wedding class
-- Changed callfunc's to callsub where applicable.
-- Updated calls to global functions file new version.
-
-* Rent v1.3
-- Removed cost of GrandPeco, simplified script to enable all classes to rent
- anything (as long as they have the required skill)
-- Updated calls to global functions file new version.
-
-* Statmarket v1.4
-- Added some more overflow checks
-
-* Stats v1.4
-- Added ke_resetbasic, specifies if basic skills are reset as well.
-
-* JobChanger v2.0
-- Restructured, updated to work with Baby Classes
-
-* UnCarder v1.0
-- Initial Release
-
-01/Apr/2005
-* Kafras v1.5
-- Updated Niflheim Kafra type
-
-* Warp Core v2.0
-- Added Nifflheim Quest Support
-- Added Ayothaya Dungeon Cost
-
-* Warp Short v1.5, Warp Deep v1.5
-- Added Ayothaya Dungeon
-- Changed callfunc's to callsub where appliable.
-
-31/Mar/2005
-* Core Module v4.0
-- Added charge functions for Kafra Pass calculations
-- Added Nifflheim Quest Support
-
-* Broadcast v2.1, JobSwaper v1.2, Renting v1.1, StatMarket v1.3,
-* Stats v1.3, Core Warping v1.9, Deep Warping v1.4, Short Warping v1.4,
-* Woe Warping v1.1
-- Updated to new charge functions
-
-* Banker v1.8
-- Updated to new charge functions
-- Refined messages when charging monthly and not having enough
-
-* Refiner v1.8
-- Updated to new charge functions
-- Fixed bug where Kafra Pass discount was ignored when repairing equipment
-
-30/Mar/2005
-
-* Warper v1.8
-- Added Cities: Ayothaya, Einbroch, Einbech
-
-* Kafras v1.4
-- Added Kafras for towns: Ayothaya, Einbroch, Einbech
-
-26/Mar/2005
-* Job Changer v1.6
-- Shortened label lengths
-
-15/Mar/2005
-* Job Changer v1.5
-- Fixed infinite loop bug on change from High Novice to High First Class
-
-03/Mar/2005
-* Job Swapper v1.1
-- Added support for saving dye on revert
-- Added support to reset dye on swap
-
-* Job Changer v1.4
-- Added support for dye reset on change
-
-* Stylist v1.2
-- Added support for independent dye ranges per job-class
-
-24/Feb/2005
-* Job Swapper v1.0
-- Initial Release
-
-* Job Changer v1.3
-- Updated to work with the latest GF_getJob version
-
-* BroadCast Module v2.0
-- Updated to work with the latest GF_getJob version
-- Added confirmation before broadcasting
-
-* Core Module v3.8
-- Added support for the Job Swap entry
-- The Kafra image is now removed after the close
-- Added option to not expire Kafra Pass on exit
-
-23/Feb/2005
-* Job Changer v1.2
-- Added alternate weapons when changing at high job levels
-- Added "show details" to display detailed information of what will happen when you change jobs.
-- Added missing '-' on female (archer/thief) raising menu
-- Fixed a typo by which first High Classes could change regardless of job level
-
-19/Feb/2005
-* Job Changer v1.0
-- Initial Release
-
-* Core Module v3.6
-- Added support for the Job change entry
-
-18/Feb/2005
-* Dye v1.1
-- Added a missing 'end;' on the OnInit event
-
-* Stat Market v1.2
-- Added a missing 'end;' on the OnInit event
-
-* Stat/Reset System v1.2
-- Added a missing 'end;' on the OnInit event
-
-16/Feb/2005
-* Broadcasting v1.8
-- Updated use of GF_getJob
-
-11/Feb/2005
-* Warping Deep/Short v1.3
-- Updated Amatsu Entrance Warp
-
-01/Feb/2005
-* Bank Module v1.7
-- Fixed Monthly costs
-- Added overflow protection
-
-26/Jan/2005
-* Stat Market v1.1
-- Fixed overflow exploit when qty*price overflows.
-
-* Refining System v1.7
-- Fixed overflow exploit when qty*price overflows.
-
-* Banking Module v1.6
-- Added maximum transaction costs
-
-12/Jan/2005
-* Core Module v3.5
-- Fixed Negative Bug exploit on regular storage
-- Added Guild Storage Support
-
-* Banking Module v1.5
-- Fixed bug when gaining interests between years
-- Added monthly maintenance fees
-- Added minimum transaction costs
-
-* Refine Module v1.6
-- Added option to display success/failure chances
-- Item names are displayed now using getitemname()
-
-* Core Warping Module v.1.7
-- Minor name corrections
-- Added entry for Guild Wars warping
-
-* Deep Warping Module v1.2
-- Minor name corrections
-- Changed Orcs Dungeon warping location
-
-* Short Warping Module v.1.2
-- Minor name corrections
-- Changed Orcs Dungeon warping location
-
-* WoE Warping Module v1.0
-- Initial Release
-
-20/Nov/2004
-* Core Module v3.2
-- Fixed Kafra Image not being removed when opening storage
-
-* Warp Core Module v1.6
-- Expanded PvP system to use 8x5 rooms
-
-* Broadcast Module v1.7
-- Expanded to include new PvP rooms
-
--- Too old to remember :P
+09/February/2006 +* Refine v2.7 +- Fixed buying of ores being free. +05/February/2006 +* Readme v1.8 +- Added Kafra Shop section +* Config v1.9 +- Added Kafra Shop section +* Shop v0.1 +- Initial release +* Main v5.4 +- Added support for the Kafra Shop +* Refine v2.6 +- Inverted order of item processing to prevent overweight problems (first the + items are charged, then you get the refined ones) + +08/January/2006 +* Job Swap v3.1 +- Fixed incorrect menu entry causing crash in the 2nd job menu for female classes. +- Fixed job names from the menu not matching the job you were about to change + into (bard/dancer adjust was broken) +- Fixed job revert saying your previous class was always the same as the current. + +04/January/2006 +* readme.txt v1.7 +- Added information about the new stat reset variables. + +30/December/2005 +* Main v5.3 +- Fixed NPC dialog freezing after healing both HP/SP +* Stats v2.2 +- Added option to charge reset based on base/job levels. +* Config v1.8 +- Added reset by level cost options. + +20/December/2005 +* Stats v2.1 +- Fixed resets charging you again when selecting return. + +12/December/2005 +* Bank v2.7 +- Fixed inifite loop that would trigger on year change. + +08/November/2005 +* Dungeon Warping v3.1 +- Fixed a crash when warping to GonRyun + +02/November/2005 +* Config v1.7 +- Added Taekwon equipment variables +- Added dungeon variables for Abyss/Thanatos/Juperos + +01/November/2005 +* Job Changer v3.5 +- Clean up and optimized to the new scripting engine. +- Added Taekwon Class support +- Acquired items will now display the slot count they have. + +31/October/2005 +* Pvp Warps v1.7, Woe Warps v1.7 +- Clean up and optimized to the new scripting engine. + +30/October/2005 +* Dungeon Warps v3.0 +- Added Abyss Lake, Thanatos Tower and Juperos. + +29/October/2005 +* Dungeon Warps v2.9 +- Clean up and optimized to the new scripting engine. + +28/October/2005 +* Refine v2.5, Renter v1.8, Stat Market v2.0, Stats v2.0, Uncard v1.5 +- Clean up and optimized to the new scripting engine. + +27/October/2005 +* Broadcast v3.0, Bank v2.6, Dye v1.9, Job Swapper v3.0, Main v5.2 +- Clean up and optimized to the new scripting engine. + +14/October/2005 +* Pvp Warps v1.6 +- Fixed standard pvp mode warps. + +07/October/2005 +* JobSwapper v2.5 +- Updated to work on the new script engine. + +06/October/2005 +* Broadcast v2.8 +- Fixed a bug when broadcasting to Room Four. + +17/September/2005 +* Pvp Warps v1.5 +- Made warps random. + +04/September/2005 +* Town Warps v1.6 +- Label fix. + +11/August/2005 +* PvP Warps v1.4 +- Removed the obtained item, the pvp maps are "no return" areas afterall. + +02/August/2005 +* Job Changer v3.2 +- Fixed issues with UpperPolicy = 1 and SkipNovice = 1 not working correctly. + +* readme.txt v1.6 +- Updated to reflect current changes. + +* Bank v2.5, Broadcast v2.7, Dye v1.7, Job Changer v3,1, Job Swapper v2.4, + Main v5.0, Refine v2.3, Renting v1.7, StatMarket v1.9, Stats v1.8, + Uncarder v1.3, Warp Dungeon v2.7, Warp PvP v1.3, Warp Town v1.5, Warp WoE v1.6 +- Updated all 'emotion's to use a e_* constant instead of numbers. +- Updated function F_keIntro to simplify code. +- Updated headers to reflect actual script requirements. + +* Job Changer v3.0, Job Swapper v2.6, Config v1.6 +- Removed Upper type related code as this is not really implemented in eA. + +07/July/2005 +* readme v1.5 +- Updated documentation regarding traveller's mode. +- Added descriptions for the new variables in the Stat Market. + +* Config v1.5 +- Updated comments for Traveller's warp mode. +- Added variables kesm_skTradeCost, kesm_stTradeCost +- Removed Gefenia + +* Stat Market v1.8 +- Added support for trading directly skills->stats or stats->skills. + +* Town Warps v1.4 +- Added again Einbech +- Added Traveller's Warp mode 2 + +* Dungeon Warps v2.6 +- Added Traveller's Warp mode 2 +- Sunken Ship Traveller mode bugfix. +- Removed Gefenia + +* Kafras v1.9 +- Readded Einbech's town Kafra +- Removed Gefenia + +05/July/2005 +* Town Warps v1.3 +- Fixed warps being free. +- Some optimizations. + +04/July/2005 +* Job Swap v2.2 +- Fixed script 'freeze' when you don't have enough to revert to the previous job. +- Fixed job-swapping being free if you did not have enough zeny. + +29/June/2005 +* Config v1.4 +- Added LightHalzen Rekkeben Cost + +* Dungeon Warps v2.5 +- Added LightHalzen +- Miscellanous name corrections + +* Town Warps v1.2 +- Removed Einbech (it is just a Einbroch Station?) +- Added LightHalzen + +* Kafras v1.8 +- Removed Einbech +- Added LightHalzen (Town + Dungeon) + +* Broadcast v2.6 +- Added variable kebc_showOnline to display count of recipients. + +* Woe Warps v1.5, Town Warps v1.1, Pvp Warps v1.2, Dungeon Warps v1.4, Config v1.2 +- Changed variable kewd_onlineStr to ked_users + +* Main v4.9 +- Updated to use the new warp dungeon file. +- Some cleanup and reorganization of menus. + +* Warp Dungeon v2.3 +- Merged Short Warps & Deep Warps into a single file. + +* Main v4.8 +- Moved the warping function here. +- ke_warp_core.txt no longer needed (removed) + +* Job Changer v2.9, Job Swapper v2.1 +- Some cleaning + +* Config v1.1 +- Reorganized, some cleaning. + +28/June/2005 +* readme.txt v1.3 +- Updated and cleaned documentation. + +* Warp Town v1.0 +- Branched off Warp Core v3.1 + +* Warp Core v3.2 +- Removed the Town warp code. + +* Main v4.7 +- Reorganized Menus + +* Bank v2.4, Broadcast v2.5, Dye v1.6, Job Changer v2.8, Job Swap v2.0, + Main v4.6, Refine v2.2, Rent v1.6, Stat Market v1.7, Stats v1.7, + Uncard v1.2, Warp Core v3.1, Warp Deep v2.2, Warp Short v2.1, Warp WoE v1.4 +- Upgraded to use config.txt + +27/June/2005 +* Job Swap v1.9 +- Fixed another stupid bug when job-reverting + +14/June/2005 +* Job Changer v2.7 +- Stupid fix for changing from adv 1st class to adv 2nd... + +10/June/2005 +* Job Swap v1.8 +- Fixed a silly bug with the announce option. + +05/June/2005 +* Core Warps v3.0, Short Warps v2.0 +- Bug Fix. kewd_pyramids -> kewd_pyramid +- kewd_turtle -> kewd_turtleIsland + +04/June/2005 +* Core Warps v2.9, Deep Warps v2.1 +- Bug fix related to deep warps. +- Fixed town warp costs being always zero. +- Fixed Niflheim cost display when online count is on. + +02/June/2005 +* Core Warps v2.7, Short Warps 1.9, Deep Warps 2.0, Kafras v1.7 +- Added Einbech Mines + +* Kafras v1.6 +- Updated Kafras with Type 2 + +* Deep Warp v1.9, Short Warps v1.8 +- Added support for kewd_travel + +* Main v4.5 +- Added kewd_travel for traveller's warp system. +- Moved Warp Menu into this module. + +* Pvp Warp v1.0 +- Branched off ke_warp.txt v2.4 + +* Core Warp v2.5: +- Added kewt_discount for town warps discount +- Added kewd_travel for traveller's warp system. +- Changed cost display for towns, implemented Kafra Pass discount value + +1/June/2005 +* Bank v 2.3 +- Added kebk_capacity variable for limited account size. +- Added kebk_useGlobalBank variable for enabling global counter. + +31/May/2005 +* Job Changer v2.5, Job Swapper v1.7 +- Modified code to work around the callfunc/menu bug + +* Main v2.4 +- Added SaveOnSpot option + +26/May/2005 +* Short Warps v1.7 +- Added option kewd_turtleCave for toggling island/cave warp (Turtle Island) + +* Bank v2.1, Broadcast v2.4, Dye v1.5, Main v4.2, Refine v2.1, Renting v1.5 + StatMarket v1.6, Stats v1.6, Uncarder v1.1, Warp Core v2.3, Deep Warps v1.8 + Short Warps v1.6, WoE Warps v1.3, JobSwapper 1.6, JobChanger 2.4 +- Label cleaning & standarization + +* JobChanger v2.3 +- Replaced functions with subfunctions +- Implemented use of new global function GF_getJobId + +* JobSwapper v1.5 +- Replaced functions with subfunctions +- Implemented use of new global function GF_getJobId +- Added Support for Baby Classes + +25/May/2005 +* Kafras v1.5, Bank v2.0, Broadcast v2.3, Dye v1.4, JobChange v2.1, + JobSwapper v1.3, Main v4.1, Refine v2.0, Renting v1.4, StatMarket v1.5, + Stats & Resets v1.5, Warp Core v2.2, Deep Warps v1.7, WoE Warps v1.2 +- Header Cleanup +- Global Variables standarized + +* Bank v1.9, Refine v1.8, Warp Core v2.1, Deep Warps v1.6 +- Changed callfunc's to callsub where applicable. + +* Broadcast v2.2 +- Changed callfunc's to callsub where applicable. +- Updated calls to global functions file new version. + +* Dye v1.3 +- New variable kedy_clothJWED specifies max dye count for wedding class +- Changed callfunc's to callsub where applicable. +- Updated calls to global functions file new version. + +* Rent v1.3 +- Removed cost of GrandPeco, simplified script to enable all classes to rent + anything (as long as they have the required skill) +- Updated calls to global functions file new version. + +* Statmarket v1.4 +- Added some more overflow checks + +* Stats v1.4 +- Added ke_resetbasic, specifies if basic skills are reset as well. + +* JobChanger v2.0 +- Restructured, updated to work with Baby Classes + +* UnCarder v1.0 +- Initial Release + +01/Apr/2005 +* Kafras v1.5 +- Updated Niflheim Kafra type + +* Warp Core v2.0 +- Added Nifflheim Quest Support +- Added Ayothaya Dungeon Cost + +* Warp Short v1.5, Warp Deep v1.5 +- Added Ayothaya Dungeon +- Changed callfunc's to callsub where appliable. + +31/Mar/2005 +* Core Module v4.0 +- Added charge functions for Kafra Pass calculations +- Added Nifflheim Quest Support + +* Broadcast v2.1, JobSwaper v1.2, Renting v1.1, StatMarket v1.3, +* Stats v1.3, Core Warping v1.9, Deep Warping v1.4, Short Warping v1.4, +* Woe Warping v1.1 +- Updated to new charge functions + +* Banker v1.8 +- Updated to new charge functions +- Refined messages when charging monthly and not having enough + +* Refiner v1.8 +- Updated to new charge functions +- Fixed bug where Kafra Pass discount was ignored when repairing equipment + +30/Mar/2005 + +* Warper v1.8 +- Added Cities: Ayothaya, Einbroch, Einbech + +* Kafras v1.4 +- Added Kafras for towns: Ayothaya, Einbroch, Einbech + +26/Mar/2005 +* Job Changer v1.6 +- Shortened label lengths + +15/Mar/2005 +* Job Changer v1.5 +- Fixed infinite loop bug on change from High Novice to High First Class + +03/Mar/2005 +* Job Swapper v1.1 +- Added support for saving dye on revert +- Added support to reset dye on swap + +* Job Changer v1.4 +- Added support for dye reset on change + +* Stylist v1.2 +- Added support for independent dye ranges per job-class + +24/Feb/2005 +* Job Swapper v1.0 +- Initial Release + +* Job Changer v1.3 +- Updated to work with the latest GF_getJob version + +* BroadCast Module v2.0 +- Updated to work with the latest GF_getJob version +- Added confirmation before broadcasting + +* Core Module v3.8 +- Added support for the Job Swap entry +- The Kafra image is now removed after the close +- Added option to not expire Kafra Pass on exit + +23/Feb/2005 +* Job Changer v1.2 +- Added alternate weapons when changing at high job levels +- Added "show details" to display detailed information of what will happen when you change jobs. +- Added missing '-' on female (archer/thief) raising menu +- Fixed a typo by which first High Classes could change regardless of job level + +19/Feb/2005 +* Job Changer v1.0 +- Initial Release + +* Core Module v3.6 +- Added support for the Job change entry + +18/Feb/2005 +* Dye v1.1 +- Added a missing 'end;' on the OnInit event + +* Stat Market v1.2 +- Added a missing 'end;' on the OnInit event + +* Stat/Reset System v1.2 +- Added a missing 'end;' on the OnInit event + +16/Feb/2005 +* Broadcasting v1.8 +- Updated use of GF_getJob + +11/Feb/2005 +* Warping Deep/Short v1.3 +- Updated Amatsu Entrance Warp + +01/Feb/2005 +* Bank Module v1.7 +- Fixed Monthly costs +- Added overflow protection + +26/Jan/2005 +* Stat Market v1.1 +- Fixed overflow exploit when qty*price overflows. + +* Refining System v1.7 +- Fixed overflow exploit when qty*price overflows. + +* Banking Module v1.6 +- Added maximum transaction costs + +12/Jan/2005 +* Core Module v3.5 +- Fixed Negative Bug exploit on regular storage +- Added Guild Storage Support + +* Banking Module v1.5 +- Fixed bug when gaining interests between years +- Added monthly maintenance fees +- Added minimum transaction costs + +* Refine Module v1.6 +- Added option to display success/failure chances +- Item names are displayed now using getitemname() + +* Core Warping Module v.1.7 +- Minor name corrections +- Added entry for Guild Wars warping + +* Deep Warping Module v1.2 +- Minor name corrections +- Changed Orcs Dungeon warping location + +* Short Warping Module v.1.2 +- Minor name corrections +- Changed Orcs Dungeon warping location + +* WoE Warping Module v1.0 +- Initial Release + +20/Nov/2004 +* Core Module v3.2 +- Fixed Kafra Image not being removed when opening storage + +* Warp Core Module v1.6 +- Expanded PvP system to use 8x5 rooms + +* Broadcast Module v1.7 +- Expanded to include new PvP rooms + +-- Too old to remember :P diff --git a/npc/custom/eAAC_Scripts/kafraExpress/config.txt b/npc/custom/eAAC_Scripts/kafraExpress/config.txt index 1e2bf3e1b..4848cb88c 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/config.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/config.txt @@ -1,400 +1,400 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Config Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 1.8
-//===== Compatible With: =====================================
-//= Any eAthena Version with function support
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= This module contains the configuration of all modules.
-//===== Additional Comments: =================================
-//= See <http://www.eathena.deltaanime.net/board/index.php?showtopic=20290>
-//= for indepth explanation of the Kafra Express Script Package.
-//============================================================
-
-- script keConfig -1,{
- //-------------------------------------------------------------------------------
- //Config for the Main Module
- //-------------------------------------------------------------------------------
-OnInit:
- set $@ke_saveOnSpot,0; //If 1, the respawn point is saved where the char is standing.
- set $@keh_hpCost,10; //Cost of HP healing (per 10HP)
- set $@keh_spCost,100; //Cost of SP healing (per 10SP)
- set $@kes_cost,50; //Cost of opening the storage
- set $@kegs_cost,500; //Cost of opening the guild storage
-
- //Kafra Pass Options:
- set $@kekp_reset,1; //Kafra passes Expire when you speak to a Kafra?
- //(otherwise duration is as long as a temporary variable)
- set $@kekp_reserveCost,100; //Cost of each Reserve Point in Zeny (0 disable)
- set $@kekp_minReserve,1; //Min Reserve Points you can earn in a single transaction
- set $@kekp_maxReserve,150; //Max Reserve Points you can earn in a single transaction
-
- //Display Options
- set $@ked_users$,"people"; //String used when referring to people (player count).
- // Values like "ppl", "users" or "on" are also recommended.
- end;
- //-------------------------------------------------------------------------------
- //Config for the Bank Module
- //-------------------------------------------------------------------------------
-OnLoadBank:
- set $@kebk_depositCost,0; //Fee for bank deposits in % (10 = 10%)
- set $@kebk_withdrawCost,5; //Fee for bank withdrawals in % (10 = 10%)
- set $@kebk_minTransact,1000; //Value of the Minimum Transaction (deposit/withdraw)
- set $@kebk_maxTransact,999999; //Value of the Maximum Transaction (deposit/withdraw)
- set $@kebk_capacity,99999999; //Account capacity: Max zeny that can be held.
- set $@kebk_dayInterest,10; //Savings daily interests in 0.01% units (100 = 1%)
- set $@kebk_monMaintenance,1000; //Monthly flat fee charged for account maintenance
- set $@kebk_useGlobalBank,0; //When 1, all charged fees go to $ke_globalbank
- end;
- //-------------------------------------------------------------------------------
- //Config for the Broadcast Module
- //-------------------------------------------------------------------------------
-OnLoadBroadcast:
- //Following costs are for current map costs:
- set $@kebc_showOnline,0; //if 1, count of recipients will be listed.
- set $@kebc_partyCost,2500; //party request broadcast cost
- set $@kebc_pvpCost,5000; //pvp request broadcast cost
- set $@kebc_cost,10000; //general broadcast cost
- set $@kebc_anonCost,100000; //anonymous broadcast cost
- set $@kebc_globalFactor,1000; //When doing server bcs, the prices are increased by this amount (500 = 500% = 5x)
- set $@kebc_discount,15; //% Discount to apply when the KafraPass is active
- end;
- //-------------------------------------------------------------------------------
- //Config for the Dye and Stylist Module
- //-------------------------------------------------------------------------------
-OnLoadDye:
- set $@kedy_enableHairstyle,0; //Set to 1 to enable haircut style change.
- set $@kedy_styles,23; //Highest available haircut style (default 23)
- set $@kedy_hair,8; //Highest available hair dye (RO default is 8)
-
- //Highest available cloth dye depending on job-class
- set $@kedy_clothJN,77; //Novice (+High/Baby)
- set $@kedy_clothJ1ST,77; //1st Jobs (+High/Baby)
- set $@kedy_clothJ2ND,77; //2nd Jobs (+High/Baby)
- set $@kedy_clothJSN,77; //Super Novice (+Baby)
- set $@kedy_clothJWED,77; //Wedding Class
- end;
- //-------------------------------------------------------------------------------
- //Config for the Job Changer Module
- //-------------------------------------------------------------------------------
-OnLoadJobChange:
- set $@kejc_skillsPolicy,0; //Remaining Skill Points Policy:
- //0: Do not allow job changing until points are used up
- //1: Discard the remaining skill points
- //2: Let extra skill points be carried to next job
-
- set $@kejc_upperPolicy,0; //Upper Job management policy:
- //0: Ignore Mode: People can change in any order
- //1: Force Mode: Job changes are forced on the correct path.
-
- set $@kejc_announce,1; //Do a global announce when someone changes job.
- set $@kejc_resetDye,1; //Set to 1 to reset cloth dye upon change
- set $@kejc_skipNovice,0; //0: Novice needs Job 10 to change, 1: Can Skip Novice Class
- set $@kejc_baseSN,30; //Base lv required to become a Super Novice
-
- //Note that the change costs can be converted into rewards by specifying a negative amount.
- set $@kejc_base2ND,1; //Base lv required to change into a second class
- set $@kejc_job2ND,40; //Job Lv required to change into a second Class
- set $@kejc_cost2ND,-25000; //Zeny cost when changing into a second Class
-
- set $@kejc_baseRebirth,99; //Base lv required to do the Rebirth
- set $@kejc_jobRebirth,50; //Job Lv required to do the Rebirth
- set $@kejc_costRebirth,1000000; //Zeny cost required to do the Rebirth
-
- set $@kejc_rebirthReset,1; //When changing to a high novice, reset base level to 1?
- set $@kejc_weaponPolicy,1; //Set to 1 to give a weapon upon job change
-
- if ($@kejc_weaponPolicy == 0) //don't touch
- end;
-
- set $@kejc_wBonusLv,50; //Job level for upgraded weapon version, use 0 to disable
-
- //Weapons awarded to each job upon change (use 0 to disable for a particular class)
- //First classes:
- set $@kejc_wAcolyte,1501; //Club
- set $@kejc_wArcher,1701; //Bow
- set $@kejc_wMage,1601; //Rod
- set $@kejc_wMerchant,1301; //Axe
- set $@kejc_wSwordman,1101; //Sword
- set $@kejc_wThief,1201; //Knife
- set $@kejc_wTaekwon,0; //Nothing (they don't wield weapons)
- set $@kejc_wSuperNovice,1202; //Knife
-
- //Normal Weapons for Second classes
- set $@kejc_wPriest,1551; //Bible
- set $@kejc_wMonk,1801; //Waghnak
- set $@kejc_wHunter,1704; //Composite Bow
- set $@kejc_wBard,1901; //Violin
- set $@kejc_wDancer,1950; //Rope
- set $@kejc_wWizard,1602; //Rod
- set $@kejc_wSage,1550; //Book
- set $@kejc_wBlacksmith,1351; //Battle Axe
- set $@kejc_wAlchemist,1351; //Battle Axe
- set $@kejc_wKnight,1116; //Katana
- set $@kejc_wCrusader,1107; //Blade
- set $@kejc_wAssassin,1250; //Jur
- set $@kejc_wRogue,1210; //Cutter
- set $@kejc_wStarGladiator,1550; //Book
- set $@kejc_wSoulLinker,1602; //Rod
-
- if ($@kejc_wBonusLv == 0) //Don't touch.
- end;
-
- //Improved versions awarded to second classes
- set $@kejc_w2Priest,1519; //Chain
- set $@kejc_w2Monk,1811; //Finger
- set $@kejc_w2Hunter,1714; //Gakkung
- set $@kejc_w2Bard,1911; //Guh Moon Goh
- set $@kejc_w2Dancer,1960; //Whip
- set $@kejc_w2Wizard,1610; //Arc Wand
- set $@kejc_w2Sage,1552; //Tablet
- set $@kejc_w2Blacksmith,1360; //Two-Handed Axe
- set $@kejc_w2Alchemist,1360; //Two-Handed Axe
- set $@kejc_w2Knight,1160; //Broad-Sword
- set $@kejc_w2Crusader,1119; //Tsurugi
- set $@kejc_w2Assassin,1254; //Jamadhar
- set $@kejc_w2Rogue,1222; //Damascus
- set $@kejc_w2StarGladiator,1552; //Tablet
- set $@kejc_w2SoulLinker,1610; //Arc Wand
- end;
- //-------------------------------------------------------------------------------
- //Config for the Job Swapping Module
- //-------------------------------------------------------------------------------
-OnLoadJobSwap:
- set $@kejs_SNpolicy,0; //Super Novice is considered as...
- //0: Super Novices can't swap job.
- //1: 1st Class Range: Can only be swapped with First classes (including baby)
-
- set $@kejs_revertPolicy,1; //Allows reverting to the last Class one changed from...
- // 0: do not allow reverting
- // 1: Can revert to last Job ONLY when the last job belongs to the same "level" as
- // the current one. (ie: it is lost on job change/upgrade)
- // 2: Can revert to the last job regardless of situation.
-
- set $@kejs_announce,0; //Do a global announce when someone swaps job.
- set $@kejs_revertCost,100000; //Cost of reverting back to previous Job.
- set $@kejs_saveDye,1; //Set to 1 to save and restore previous dye when reverting
- set $@kejs_resetDye,0; //Set to 1 to reset cloth dye when swapping
- set $@kejs_swapDiscount, 20; //Kafra Pass % Discount when swapping jobs
- set $@kejs_revertDiscount, 20; //Kafra Pass % Discount when reverting to a previous job.
-
- //Minimum Job level required for swapping
- set $@kejs_job1ST,20; //among 1st classes
- set $@kejs_job2ND,50; //among 2nd classes
-
- //Base Cost for swapping job at min job level required
- set $@kejs_cost1ST,25000; //among 1st jobs
- set $@kejs_cost2ND,250000; //among 2nd jobs
-
- //Percentage discount for every level over the minimum
- set $@kejs_discount1ST,3; //among 1st jobs
- set $@kejs_discount2ND,3; //among 2nd jobs
-
- //How much to preserve of the previous Job in %?
- //(25% means that if you change at Lv100, you will become a Lv25 upon swap)
- set $@kejs_preserve1ST,50; //among 1st jobs
- set $@kejs_preserve2ND,0; //among 2nd jobs
- end;
- //-------------------------------------------------------------------------------
- //Config for the Refining Module
- //-------------------------------------------------------------------------------
-OnLoadRefine:
- set $@kerf_maxLv,10; //Max refinement level for equipment
- set $@kerf_safe,0; //Set to 1 to enable 100% safe refinement.
- set $@kerf_showChance,0; //Set to 1 to see the refine Success Chance
- set $@kerf_refineAll,0; //Set to 1 to enable refinement of anything (ie: accesories)
- set $@kerf_discount,0; //Discount % rate for forging when Kafra Pass is active.
- set $@kerf_armorCost,2000; //Cost to refine armor (default 2000z)
- set $@kerf_weaponLv1Cost,50; //Cost to refine lv1 weapons (default 50z)
- set $@kerf_weaponLv2Cost,200; //Cost to refine lv2 weapons (default 200z)
- set $@kerf_weaponLv3Cost,5000; //Cost to refine lv3 weapons (default 5000z)
- set $@kerf_weaponLv4Cost,20000; //Cost to refine lv4 weapons (default 20000z)
- set $@kerf_purifyAll,0; //Set to 1 to enable purifying elemental stones and the like
- set $@kerf_repairCost,10000; //Cost to repair broken equipment.
- set $@kerf_repairDiscount,25; //Discount % rate for repairing when Kafra Pass is active
- set $@kerf_repairSteel,1; //Set to 1 to make repairing equipment require 1 Steel.
- end;
- //-------------------------------------------------------------------------------
- //Config for the Renting Module
- //-------------------------------------------------------------------------------
-OnLoadRent:
- set $@kert_cartOnly, 0; //Set to 1 to enable only cart rental, 0 enables all add-ons.
- set $@kert_cartCost, 1000; //Cost to rent a Cart.
- set $@kert_falconCost, 2000; //Cost to rent a Falcon.
- set $@kert_pecoCost, 2000; //Cost to rent a PecoPeco.
- end;
- //-------------------------------------------------------------------------------
- //Config for the Kafra Shop Module
- //-------------------------------------------------------------------------------
-OnLoadShop:
- set $@kesh_towntype, 0; //Town shop type (1: buy, 2: sell, Other: both)
- set $@kesh_duntype, 2; //Dungeon shop type (1: buy, 2: sell, Other: both)
- set $@kesh_townshop$, "ke_townshop"; //Name of town shop to invoke.
- set $@kesh_dunshop$, "ke_dunshop"; //Name of dungeon shop to invoke.
- end;
- //-------------------------------------------------------------------------------
- //Config for the Stat Market Module
- //-------------------------------------------------------------------------------
-OnLoadStatMarket:
- set $@kesm_stBuyPrice,10000; //Cost of buying stat points
- set $@kesm_stSellPrice,0; //Return cash for selling stat points
- set $@kesm_skBuyPrice,1000000; //Cost of buying skill points
- set $@kesm_skSellPrice,50000; //Return cash for selling skill points
- set $@kesm_skTradePrice, 20; //Stats needed to trade for a skill. (Stat->Skill)
- set $@kesm_stTradePrice, 15; //Stats received per Skill traded. (Skill->Stat)
- set $@kesm_discount,0; //Discount % applied when buying if Kafra Pass is active
- end;
- //-------------------------------------------------------------------------------
- //Config for the Stats Reset/Raising Module
- //-------------------------------------------------------------------------------
-OnLoadStats:
- set $@kest_stResetCost,50000; //Cost to reset stats
- set $@kest_skResetCost,50000; //Cost to reset skills
- set $@kest_resetCost,75000; //Cost to reset both
- set $@kest_BaseLvCost,25000; //Additional cost per base level to reset stats
- set $@kest_JobLvCost,25000; //Additional cost per job level to reset skills
- set $@kest_BothLvCost,20000; //Additional cost per base+job level to reset both
-
- set $@kest_discount,15; //Discount % to be applied when Kafra Pass is active.
- set $@kest_resetBasic,0; //Set to 1 if you want basic skills resetted as well.
- end;
- //-------------------------------------------------------------------------------
- //Config for the Uncarding Module
- //-------------------------------------------------------------------------------
-OnLoadUncard:
- set $@keuc_BaseCost, 100000; //Base Cost
- set $@keuc_CardCost, 25000; //Extra Cost per Card
- set $@keuc_UpgradeCostA, 1000; //Extra Cost per Upgrade, Armor
- set $@keuc_UpgradeCostW1, 1000; //Extra Cost per Upgrade, Weapons Lv1
- set $@keuc_UpgradeCostW2, 2000; //Extra Cost per Upgrade, Weapons Lv2
- set $@keuc_UpgradeCostW3, 3000; //Extra Cost per Upgrade, Weapons Lv3
- set $@keuc_UpgradeCostW4, 5000; //Extra Cost per Upgrade, Weapons Lv4
- set $@keuc_discount, 10; //% Discount when using a Kafra Pass
- set $@keuc_Mat1,1000; //Material #1 needed (Star Crumb)
- set $@keuc_Qty1,1; //Qty of material #1 needed (use 0 to disable)
- set $@keuc_Mat2,715; //Material #2 needed (Yellow Gemstone)
- set $@keuc_Qty2,1; //Qty of material #2 needed (use 0 to disable)
-
- //Failure Chances. 1000 = 100.0%, set to 0 to disable failing chance.
- set $@keuc_Fail0Chance, 250; //Chance of harmless failure
- set $@keuc_Fail1Chance, 100; //Chance of losing item OR card
- set $@keuc_Fail2Chance, 25; //Chance of losing both
- end;
- //-------------------------------------------------------------------------------
- //Config for the Town Warps Module
- //-------------------------------------------------------------------------------
-OnLoadWarpTown:
- set $@kewt_showOnline,1; //Set to 1 to show online count on cities
- set $@kewt_cost, 1000; //Cost of warping to a town
- set $@kewt_niflCost, 5000; //Cost of warping to Niflheim
- set $@kewt_travel, 0; //Traveller's Mode type for towns:
- //0: Disabled (normal warping)
- //1: You can only warp to towns you've been before (per character basis)
- //2: You can only warp to towns you've been before (per account basis)
- set $@kewt_free, 0; //Set to 1 to let people warp to towns even when poor
- set $@kewt_discount, 100; //Discount % to apply when the Kafra Pass is active (towns)
- end;
- //-------------------------------------------------------------------------------
- //Config for the Dungeons Warps Module
- //-------------------------------------------------------------------------------
-OnLoadWarpDungeon:
- set $@kewd_showOnline,0; //Set to 1 to show online count on dungeons
- set $@kewd_discount, 50; //Discount % to apply when the Kafra Pass is active
- set $@kewd_travel, 0; //Traveller's mode type for dungeons:
- //0: Disabled (normal warping)
- //1: You can only warp to dungeons you've been before (per character basis)
- //2: You can only warp to dungeons you've been before (per account basis)
- set $@kewd_deep, 1; //If 1, people can warp to all levels of dungeons.
- //If 0, people can only warp to the entrance of dungeons.
-
- //Variables for Deep Warping
- set $@kewd_levelCost, 30; // cost % increase for warping to floors deep into the dungeon
- set $@kewd_entryDiscount, 25; //Discount % when using the Kafra right next to the dungeon one is warping into
-
- //Variables for Short Warping
- set $@kewd_turtleCave,0; //If 1, Turtle Island's warp leads to the
- //entrance of the cave, not the Island's shore.
-
- //Dungeon Costs
- set $@kewd_abyssLake,5000; //Abyss Lake base cost
- set $@kewd_amatsu,2500; //Amatsu Dungeon base cost
- set $@kewd_antHell,1750; //Anthell base cost
- set $@kewd_ayothaya,1750; //Ayothaya Dungeon base cost
- set $@kewd_byalan,1250; //Byalan base cost
- set $@kewd_comodo,2500; //Comodo Caves base cost
- set $@kewd_clockTower,6250; //Clock Tower base cost
- set $@kewd_coalMines,3750; //Coal Mines base cost
- set $@kewd_culvert,500; //Prontera Culvert base cost
- set $@kewd_einbech,5000; //Einbech Mines base cost
- set $@kewd_gefenia,25000; //Gefenia base cost
- set $@kewd_geffen,5000; //Geffen Dungeon base cost
- set $@kewd_glastHeim,10000; //Glast Heim base cost
- set $@kewd_gonRyun,3750; //Gonryun Dungeon base cost
- set $@kewd_hiddenTemple,250; //Hidden Temple base cost
- set $@kewd_juperos,7500; //Juperos base cost
- set $@kewd_lightHalzen,15000; //LightHalzen Rekkenber base cost
- set $@kewd_louYang,2500; //Louyang Dungeon base cost
- set $@kewd_magma,3750; //Magma Dungeon base cost
- set $@kewd_orc,2500; //Orc Dungeon base cost
- set $@kewd_payon,1100; //Payon Dungeon base cost
- set $@kewd_pyramid,2500; //Pyramids base cost
- set $@kewd_sphinx,1750; //Sphinx base cost
- set $@kewd_sunkenShip,1000; //Sunken Ship base cost
- set $@kewd_thanatosTower,15000; //Thanatos Tower base cost
- set $@kewd_toyFactory,2500; //Toy Factory base cost
- set $@kewd_turtleIsland,12500; //Turtle Island base cost
- set $@kewd_umbala,3550; //Umbala Dungeon base cost
- end;
- //-------------------------------------------------------------------------------
- //Config for the Pvp Warps Module
- //-------------------------------------------------------------------------------
-OnLoadWarpPvp:
- set $@kewp_showOnline,1; //Set to 1 to show online count on pvp maps
- set $@kewp_advanced,0; //Set to 0 to enable a single group of pvp rooms
- //(no level restrictions, kewp_cost is used)
- set $@kewp_cost, 1000; //Cost for Free For All (no level restrictions)
-
- if ($@kewp_advanced == 0) //Don't touch
- end;
-
- set $@kewp_cost1, 100; //Cost of warping to a pvp arena, lvls group 1
- set $@kewp_cost2, 250; //Cost for lvls group 2
- set $@kewp_cost3, 500; //Cost for lvls group 3
- set $@kewp_cost4, 1000; //Cost for lvls group 4
- set $@kewp_cost5, 2000; //Cost for lvls group 5
- set $@kewp_cost6, 4000; //Cost for lvls group 6
- set $@kewp_cost7, 8000; //Cost for lvls group 7
- set $@kewp_baseLv1, 35; //Level required for pvp, lv1
- set $@kewp_baseLv2, 45; //Level required for pvp, lv2
- set $@kewp_baseLv3, 55; //Level required for pvp, lv3
- set $@kewp_baseLv4, 65; //Level required for pvp, lv4
- set $@kewp_baseLv5, 75; //Level required for pvp, lv5
- set $@kewp_baseLv6, 85; //Level required for pvp, lv6
- set $@kewp_baseLv7, 95; //Level required for pvp, lv7
- set $@kewp_range, 5; //Range of levels allowed (ie: Warp to Lv1: levels 10+/-5)
- end;
- //-------------------------------------------------------------------------------
- //Config for the WoE Warps Module
- //-------------------------------------------------------------------------------
-OnLoadWarpWoe:
- //Note: See ke_warp_woe.txt for instructions on how to unlock the Guild Dungeons.
- set $@kewg_check,1; //If 0, people don't need to belong to a Guild to warp
- set $@kewg_checkAgit,1; //If 1, you can't warp until WoE starts
- set $@kewg_showOnline,0; //Set to 1 to show online count and Castle Status
- set $@kewg_discount,20; //Kafra Pass discount for WoE warps
-
- set $@kewg_baldur, 25000; //Guild Dungeon - Baldur
- set $@kewg_luina, 25000; //Guild Dungeon - Luina
- set $@kewg_valkyrie, 25000; //Guild Dungeon - Valkyrie
- set $@kewg_britoniah, 25000; //Guild Dungeon - Britoniah
-
- set $@kewg_alDeBaran, 2500; //Al De Baran Guild
- set $@kewg_geffen, 2500; //Geffen Guild
- set $@kewg_payon, 2500; //Payon Guild
- set $@kewg_prontera, 2500; //Prontera Guild
- end;
- //-------------------------------------------------------------------------------
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Config Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 1.8 +//===== Compatible With: ===================================== +//= Any eAthena Version with function support +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= This module contains the configuration of all modules. +//===== Additional Comments: ================================= +//= See <http://www.eathena.deltaanime.net/board/index.php?showtopic=20290> +//= for indepth explanation of the Kafra Express Script Package. +//============================================================ + +- script keConfig -1,{ + //------------------------------------------------------------------------------- + //Config for the Main Module + //------------------------------------------------------------------------------- +OnInit: + set $@ke_saveOnSpot,0; //If 1, the respawn point is saved where the char is standing. + set $@keh_hpCost,10; //Cost of HP healing (per 10HP) + set $@keh_spCost,100; //Cost of SP healing (per 10SP) + set $@kes_cost,50; //Cost of opening the storage + set $@kegs_cost,500; //Cost of opening the guild storage + + //Kafra Pass Options: + set $@kekp_reset,1; //Kafra passes Expire when you speak to a Kafra? + //(otherwise duration is as long as a temporary variable) + set $@kekp_reserveCost,100; //Cost of each Reserve Point in Zeny (0 disable) + set $@kekp_minReserve,1; //Min Reserve Points you can earn in a single transaction + set $@kekp_maxReserve,150; //Max Reserve Points you can earn in a single transaction + + //Display Options + set $@ked_users$,"people"; //String used when referring to people (player count). + // Values like "ppl", "users" or "on" are also recommended. + end; + //------------------------------------------------------------------------------- + //Config for the Bank Module + //------------------------------------------------------------------------------- +OnLoadBank: + set $@kebk_depositCost,0; //Fee for bank deposits in % (10 = 10%) + set $@kebk_withdrawCost,5; //Fee for bank withdrawals in % (10 = 10%) + set $@kebk_minTransact,1000; //Value of the Minimum Transaction (deposit/withdraw) + set $@kebk_maxTransact,999999; //Value of the Maximum Transaction (deposit/withdraw) + set $@kebk_capacity,99999999; //Account capacity: Max zeny that can be held. + set $@kebk_dayInterest,10; //Savings daily interests in 0.01% units (100 = 1%) + set $@kebk_monMaintenance,1000; //Monthly flat fee charged for account maintenance + set $@kebk_useGlobalBank,0; //When 1, all charged fees go to $ke_globalbank + end; + //------------------------------------------------------------------------------- + //Config for the Broadcast Module + //------------------------------------------------------------------------------- +OnLoadBroadcast: + //Following costs are for current map costs: + set $@kebc_showOnline,0; //if 1, count of recipients will be listed. + set $@kebc_partyCost,2500; //party request broadcast cost + set $@kebc_pvpCost,5000; //pvp request broadcast cost + set $@kebc_cost,10000; //general broadcast cost + set $@kebc_anonCost,100000; //anonymous broadcast cost + set $@kebc_globalFactor,1000; //When doing server bcs, the prices are increased by this amount (500 = 500% = 5x) + set $@kebc_discount,15; //% Discount to apply when the KafraPass is active + end; + //------------------------------------------------------------------------------- + //Config for the Dye and Stylist Module + //------------------------------------------------------------------------------- +OnLoadDye: + set $@kedy_enableHairstyle,0; //Set to 1 to enable haircut style change. + set $@kedy_styles,23; //Highest available haircut style (default 23) + set $@kedy_hair,8; //Highest available hair dye (RO default is 8) + + //Highest available cloth dye depending on job-class + set $@kedy_clothJN,77; //Novice (+High/Baby) + set $@kedy_clothJ1ST,77; //1st Jobs (+High/Baby) + set $@kedy_clothJ2ND,77; //2nd Jobs (+High/Baby) + set $@kedy_clothJSN,77; //Super Novice (+Baby) + set $@kedy_clothJWED,77; //Wedding Class + end; + //------------------------------------------------------------------------------- + //Config for the Job Changer Module + //------------------------------------------------------------------------------- +OnLoadJobChange: + set $@kejc_skillsPolicy,0; //Remaining Skill Points Policy: + //0: Do not allow job changing until points are used up + //1: Discard the remaining skill points + //2: Let extra skill points be carried to next job + + set $@kejc_upperPolicy,0; //Upper Job management policy: + //0: Ignore Mode: People can change in any order + //1: Force Mode: Job changes are forced on the correct path. + + set $@kejc_announce,1; //Do a global announce when someone changes job. + set $@kejc_resetDye,1; //Set to 1 to reset cloth dye upon change + set $@kejc_skipNovice,0; //0: Novice needs Job 10 to change, 1: Can Skip Novice Class + set $@kejc_baseSN,30; //Base lv required to become a Super Novice + + //Note that the change costs can be converted into rewards by specifying a negative amount. + set $@kejc_base2ND,1; //Base lv required to change into a second class + set $@kejc_job2ND,40; //Job Lv required to change into a second Class + set $@kejc_cost2ND,-25000; //Zeny cost when changing into a second Class + + set $@kejc_baseRebirth,99; //Base lv required to do the Rebirth + set $@kejc_jobRebirth,50; //Job Lv required to do the Rebirth + set $@kejc_costRebirth,1000000; //Zeny cost required to do the Rebirth + + set $@kejc_rebirthReset,1; //When changing to a high novice, reset base level to 1? + set $@kejc_weaponPolicy,1; //Set to 1 to give a weapon upon job change + + if ($@kejc_weaponPolicy == 0) //don't touch + end; + + set $@kejc_wBonusLv,50; //Job level for upgraded weapon version, use 0 to disable + + //Weapons awarded to each job upon change (use 0 to disable for a particular class) + //First classes: + set $@kejc_wAcolyte,1501; //Club + set $@kejc_wArcher,1701; //Bow + set $@kejc_wMage,1601; //Rod + set $@kejc_wMerchant,1301; //Axe + set $@kejc_wSwordman,1101; //Sword + set $@kejc_wThief,1201; //Knife + set $@kejc_wTaekwon,0; //Nothing (they don't wield weapons) + set $@kejc_wSuperNovice,1202; //Knife + + //Normal Weapons for Second classes + set $@kejc_wPriest,1551; //Bible + set $@kejc_wMonk,1801; //Waghnak + set $@kejc_wHunter,1704; //Composite Bow + set $@kejc_wBard,1901; //Violin + set $@kejc_wDancer,1950; //Rope + set $@kejc_wWizard,1602; //Rod + set $@kejc_wSage,1550; //Book + set $@kejc_wBlacksmith,1351; //Battle Axe + set $@kejc_wAlchemist,1351; //Battle Axe + set $@kejc_wKnight,1116; //Katana + set $@kejc_wCrusader,1107; //Blade + set $@kejc_wAssassin,1250; //Jur + set $@kejc_wRogue,1210; //Cutter + set $@kejc_wStarGladiator,1550; //Book + set $@kejc_wSoulLinker,1602; //Rod + + if ($@kejc_wBonusLv == 0) //Don't touch. + end; + + //Improved versions awarded to second classes + set $@kejc_w2Priest,1519; //Chain + set $@kejc_w2Monk,1811; //Finger + set $@kejc_w2Hunter,1714; //Gakkung + set $@kejc_w2Bard,1911; //Guh Moon Goh + set $@kejc_w2Dancer,1960; //Whip + set $@kejc_w2Wizard,1610; //Arc Wand + set $@kejc_w2Sage,1552; //Tablet + set $@kejc_w2Blacksmith,1360; //Two-Handed Axe + set $@kejc_w2Alchemist,1360; //Two-Handed Axe + set $@kejc_w2Knight,1160; //Broad-Sword + set $@kejc_w2Crusader,1119; //Tsurugi + set $@kejc_w2Assassin,1254; //Jamadhar + set $@kejc_w2Rogue,1222; //Damascus + set $@kejc_w2StarGladiator,1552; //Tablet + set $@kejc_w2SoulLinker,1610; //Arc Wand + end; + //------------------------------------------------------------------------------- + //Config for the Job Swapping Module + //------------------------------------------------------------------------------- +OnLoadJobSwap: + set $@kejs_SNpolicy,0; //Super Novice is considered as... + //0: Super Novices can't swap job. + //1: 1st Class Range: Can only be swapped with First classes (including baby) + + set $@kejs_revertPolicy,1; //Allows reverting to the last Class one changed from... + // 0: do not allow reverting + // 1: Can revert to last Job ONLY when the last job belongs to the same "level" as + // the current one. (ie: it is lost on job change/upgrade) + // 2: Can revert to the last job regardless of situation. + + set $@kejs_announce,0; //Do a global announce when someone swaps job. + set $@kejs_revertCost,100000; //Cost of reverting back to previous Job. + set $@kejs_saveDye,1; //Set to 1 to save and restore previous dye when reverting + set $@kejs_resetDye,0; //Set to 1 to reset cloth dye when swapping + set $@kejs_swapDiscount, 20; //Kafra Pass % Discount when swapping jobs + set $@kejs_revertDiscount, 20; //Kafra Pass % Discount when reverting to a previous job. + + //Minimum Job level required for swapping + set $@kejs_job1ST,20; //among 1st classes + set $@kejs_job2ND,50; //among 2nd classes + + //Base Cost for swapping job at min job level required + set $@kejs_cost1ST,25000; //among 1st jobs + set $@kejs_cost2ND,250000; //among 2nd jobs + + //Percentage discount for every level over the minimum + set $@kejs_discount1ST,3; //among 1st jobs + set $@kejs_discount2ND,3; //among 2nd jobs + + //How much to preserve of the previous Job in %? + //(25% means that if you change at Lv100, you will become a Lv25 upon swap) + set $@kejs_preserve1ST,50; //among 1st jobs + set $@kejs_preserve2ND,0; //among 2nd jobs + end; + //------------------------------------------------------------------------------- + //Config for the Refining Module + //------------------------------------------------------------------------------- +OnLoadRefine: + set $@kerf_maxLv,10; //Max refinement level for equipment + set $@kerf_safe,0; //Set to 1 to enable 100% safe refinement. + set $@kerf_showChance,0; //Set to 1 to see the refine Success Chance + set $@kerf_refineAll,0; //Set to 1 to enable refinement of anything (ie: accesories) + set $@kerf_discount,0; //Discount % rate for forging when Kafra Pass is active. + set $@kerf_armorCost,2000; //Cost to refine armor (default 2000z) + set $@kerf_weaponLv1Cost,50; //Cost to refine lv1 weapons (default 50z) + set $@kerf_weaponLv2Cost,200; //Cost to refine lv2 weapons (default 200z) + set $@kerf_weaponLv3Cost,5000; //Cost to refine lv3 weapons (default 5000z) + set $@kerf_weaponLv4Cost,20000; //Cost to refine lv4 weapons (default 20000z) + set $@kerf_purifyAll,0; //Set to 1 to enable purifying elemental stones and the like + set $@kerf_repairCost,10000; //Cost to repair broken equipment. + set $@kerf_repairDiscount,25; //Discount % rate for repairing when Kafra Pass is active + set $@kerf_repairSteel,1; //Set to 1 to make repairing equipment require 1 Steel. + end; + //------------------------------------------------------------------------------- + //Config for the Renting Module + //------------------------------------------------------------------------------- +OnLoadRent: + set $@kert_cartOnly, 0; //Set to 1 to enable only cart rental, 0 enables all add-ons. + set $@kert_cartCost, 1000; //Cost to rent a Cart. + set $@kert_falconCost, 2000; //Cost to rent a Falcon. + set $@kert_pecoCost, 2000; //Cost to rent a PecoPeco. + end; + //------------------------------------------------------------------------------- + //Config for the Kafra Shop Module + //------------------------------------------------------------------------------- +OnLoadShop: + set $@kesh_towntype, 0; //Town shop type (1: buy, 2: sell, Other: both) + set $@kesh_duntype, 2; //Dungeon shop type (1: buy, 2: sell, Other: both) + set $@kesh_townshop$, "ke_townshop"; //Name of town shop to invoke. + set $@kesh_dunshop$, "ke_dunshop"; //Name of dungeon shop to invoke. + end; + //------------------------------------------------------------------------------- + //Config for the Stat Market Module + //------------------------------------------------------------------------------- +OnLoadStatMarket: + set $@kesm_stBuyPrice,10000; //Cost of buying stat points + set $@kesm_stSellPrice,0; //Return cash for selling stat points + set $@kesm_skBuyPrice,1000000; //Cost of buying skill points + set $@kesm_skSellPrice,50000; //Return cash for selling skill points + set $@kesm_skTradePrice, 20; //Stats needed to trade for a skill. (Stat->Skill) + set $@kesm_stTradePrice, 15; //Stats received per Skill traded. (Skill->Stat) + set $@kesm_discount,0; //Discount % applied when buying if Kafra Pass is active + end; + //------------------------------------------------------------------------------- + //Config for the Stats Reset/Raising Module + //------------------------------------------------------------------------------- +OnLoadStats: + set $@kest_stResetCost,50000; //Cost to reset stats + set $@kest_skResetCost,50000; //Cost to reset skills + set $@kest_resetCost,75000; //Cost to reset both + set $@kest_BaseLvCost,25000; //Additional cost per base level to reset stats + set $@kest_JobLvCost,25000; //Additional cost per job level to reset skills + set $@kest_BothLvCost,20000; //Additional cost per base+job level to reset both + + set $@kest_discount,15; //Discount % to be applied when Kafra Pass is active. + set $@kest_resetBasic,0; //Set to 1 if you want basic skills resetted as well. + end; + //------------------------------------------------------------------------------- + //Config for the Uncarding Module + //------------------------------------------------------------------------------- +OnLoadUncard: + set $@keuc_BaseCost, 100000; //Base Cost + set $@keuc_CardCost, 25000; //Extra Cost per Card + set $@keuc_UpgradeCostA, 1000; //Extra Cost per Upgrade, Armor + set $@keuc_UpgradeCostW1, 1000; //Extra Cost per Upgrade, Weapons Lv1 + set $@keuc_UpgradeCostW2, 2000; //Extra Cost per Upgrade, Weapons Lv2 + set $@keuc_UpgradeCostW3, 3000; //Extra Cost per Upgrade, Weapons Lv3 + set $@keuc_UpgradeCostW4, 5000; //Extra Cost per Upgrade, Weapons Lv4 + set $@keuc_discount, 10; //% Discount when using a Kafra Pass + set $@keuc_Mat1,1000; //Material #1 needed (Star Crumb) + set $@keuc_Qty1,1; //Qty of material #1 needed (use 0 to disable) + set $@keuc_Mat2,715; //Material #2 needed (Yellow Gemstone) + set $@keuc_Qty2,1; //Qty of material #2 needed (use 0 to disable) + + //Failure Chances. 1000 = 100.0%, set to 0 to disable failing chance. + set $@keuc_Fail0Chance, 250; //Chance of harmless failure + set $@keuc_Fail1Chance, 100; //Chance of losing item OR card + set $@keuc_Fail2Chance, 25; //Chance of losing both + end; + //------------------------------------------------------------------------------- + //Config for the Town Warps Module + //------------------------------------------------------------------------------- +OnLoadWarpTown: + set $@kewt_showOnline,1; //Set to 1 to show online count on cities + set $@kewt_cost, 1000; //Cost of warping to a town + set $@kewt_niflCost, 5000; //Cost of warping to Niflheim + set $@kewt_travel, 0; //Traveller's Mode type for towns: + //0: Disabled (normal warping) + //1: You can only warp to towns you've been before (per character basis) + //2: You can only warp to towns you've been before (per account basis) + set $@kewt_free, 0; //Set to 1 to let people warp to towns even when poor + set $@kewt_discount, 100; //Discount % to apply when the Kafra Pass is active (towns) + end; + //------------------------------------------------------------------------------- + //Config for the Dungeons Warps Module + //------------------------------------------------------------------------------- +OnLoadWarpDungeon: + set $@kewd_showOnline,0; //Set to 1 to show online count on dungeons + set $@kewd_discount, 50; //Discount % to apply when the Kafra Pass is active + set $@kewd_travel, 0; //Traveller's mode type for dungeons: + //0: Disabled (normal warping) + //1: You can only warp to dungeons you've been before (per character basis) + //2: You can only warp to dungeons you've been before (per account basis) + set $@kewd_deep, 1; //If 1, people can warp to all levels of dungeons. + //If 0, people can only warp to the entrance of dungeons. + + //Variables for Deep Warping + set $@kewd_levelCost, 30; // cost % increase for warping to floors deep into the dungeon + set $@kewd_entryDiscount, 25; //Discount % when using the Kafra right next to the dungeon one is warping into + + //Variables for Short Warping + set $@kewd_turtleCave,0; //If 1, Turtle Island's warp leads to the + //entrance of the cave, not the Island's shore. + + //Dungeon Costs + set $@kewd_abyssLake,5000; //Abyss Lake base cost + set $@kewd_amatsu,2500; //Amatsu Dungeon base cost + set $@kewd_antHell,1750; //Anthell base cost + set $@kewd_ayothaya,1750; //Ayothaya Dungeon base cost + set $@kewd_byalan,1250; //Byalan base cost + set $@kewd_comodo,2500; //Comodo Caves base cost + set $@kewd_clockTower,6250; //Clock Tower base cost + set $@kewd_coalMines,3750; //Coal Mines base cost + set $@kewd_culvert,500; //Prontera Culvert base cost + set $@kewd_einbech,5000; //Einbech Mines base cost + set $@kewd_gefenia,25000; //Gefenia base cost + set $@kewd_geffen,5000; //Geffen Dungeon base cost + set $@kewd_glastHeim,10000; //Glast Heim base cost + set $@kewd_gonRyun,3750; //Gonryun Dungeon base cost + set $@kewd_hiddenTemple,250; //Hidden Temple base cost + set $@kewd_juperos,7500; //Juperos base cost + set $@kewd_lightHalzen,15000; //LightHalzen Rekkenber base cost + set $@kewd_louYang,2500; //Louyang Dungeon base cost + set $@kewd_magma,3750; //Magma Dungeon base cost + set $@kewd_orc,2500; //Orc Dungeon base cost + set $@kewd_payon,1100; //Payon Dungeon base cost + set $@kewd_pyramid,2500; //Pyramids base cost + set $@kewd_sphinx,1750; //Sphinx base cost + set $@kewd_sunkenShip,1000; //Sunken Ship base cost + set $@kewd_thanatosTower,15000; //Thanatos Tower base cost + set $@kewd_toyFactory,2500; //Toy Factory base cost + set $@kewd_turtleIsland,12500; //Turtle Island base cost + set $@kewd_umbala,3550; //Umbala Dungeon base cost + end; + //------------------------------------------------------------------------------- + //Config for the Pvp Warps Module + //------------------------------------------------------------------------------- +OnLoadWarpPvp: + set $@kewp_showOnline,1; //Set to 1 to show online count on pvp maps + set $@kewp_advanced,0; //Set to 0 to enable a single group of pvp rooms + //(no level restrictions, kewp_cost is used) + set $@kewp_cost, 1000; //Cost for Free For All (no level restrictions) + + if ($@kewp_advanced == 0) //Don't touch + end; + + set $@kewp_cost1, 100; //Cost of warping to a pvp arena, lvls group 1 + set $@kewp_cost2, 250; //Cost for lvls group 2 + set $@kewp_cost3, 500; //Cost for lvls group 3 + set $@kewp_cost4, 1000; //Cost for lvls group 4 + set $@kewp_cost5, 2000; //Cost for lvls group 5 + set $@kewp_cost6, 4000; //Cost for lvls group 6 + set $@kewp_cost7, 8000; //Cost for lvls group 7 + set $@kewp_baseLv1, 35; //Level required for pvp, lv1 + set $@kewp_baseLv2, 45; //Level required for pvp, lv2 + set $@kewp_baseLv3, 55; //Level required for pvp, lv3 + set $@kewp_baseLv4, 65; //Level required for pvp, lv4 + set $@kewp_baseLv5, 75; //Level required for pvp, lv5 + set $@kewp_baseLv6, 85; //Level required for pvp, lv6 + set $@kewp_baseLv7, 95; //Level required for pvp, lv7 + set $@kewp_range, 5; //Range of levels allowed (ie: Warp to Lv1: levels 10+/-5) + end; + //------------------------------------------------------------------------------- + //Config for the WoE Warps Module + //------------------------------------------------------------------------------- +OnLoadWarpWoe: + //Note: See ke_warp_woe.txt for instructions on how to unlock the Guild Dungeons. + set $@kewg_check,1; //If 0, people don't need to belong to a Guild to warp + set $@kewg_checkAgit,1; //If 1, you can't warp until WoE starts + set $@kewg_showOnline,0; //Set to 1 to show online count and Castle Status + set $@kewg_discount,20; //Kafra Pass discount for WoE warps + + set $@kewg_baldur, 25000; //Guild Dungeon - Baldur + set $@kewg_luina, 25000; //Guild Dungeon - Luina + set $@kewg_valkyrie, 25000; //Guild Dungeon - Valkyrie + set $@kewg_britoniah, 25000; //Guild Dungeon - Britoniah + + set $@kewg_alDeBaran, 2500; //Al De Baran Guild + set $@kewg_geffen, 2500; //Geffen Guild + set $@kewg_payon, 2500; //Payon Guild + set $@kewg_prontera, 2500; //Prontera Guild + end; + //------------------------------------------------------------------------------- +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt b/npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt index dc2325ff0..5dbe75677 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/global_functionsKE.txt @@ -1,332 +1,332 @@ -//===== eAthena Script =======================================
-//= Global functions
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 1.5
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+, RO Ep6+
-//===== Description: =========================================
-//= Global Functions
-//=
-//===== Additional Comments: =================================
-//= GF_getJobName= function for getting a job's name
-//= GF_getJobName2= gets a jobs name modified by Type (see below)
-//= GF_getJobId= gets a jobs number modified by Type (see below)
-//= GF_getJobLevel= identifies novices/1st/2nd among classes
-//= GF_getJobType= identifies normal/advanced/babies classes
-//= - GF_getJobClass= identifies job class (swordie, mage, etc)
-//============================================================
-
-function script GF_getJobName {
-
- switch (getarg(0)) {
-
- case Job_Novice:
- return "novice";
- case Job_Acolyte:
- return "acolyte";
- case Job_Archer:
- return "archer";
- case Job_Mage:
- return "mage";
- case Job_Merchant:
- return "merchant";
- case Job_Swordman:
- return "swordsman";
- case Job_Thief:
- return "thief";
- case Job_Taekwon:
- return "taekwon kid";
- case Job_SuperNovice:
- return "super novice";
-
- case Job_Hunter:
- return "hunter";
- case Job_Dancer:
- return "dancer";
- case Job_Bard:
- return "bard";
- case Job_Priest:
- return "priest";
- case Job_Monk:
- return "monk";
- case Job_Wizard:
- return "wizard";
- case Job_Sage:
- return "sage";
- case Job_BlackSmith:
- return "blacksmith";
- case Job_Alchem:
- return "alchemist";
- case Job_Knight:
- case Job_Knight2:
- return "knight";
- case Job_Crusader:
- case Job_Crusader2:
- return "crusader";
- case Job_Assassin:
- return "assassin";
- case Job_Rogue:
- return "rogue";
- case Job_Star_Gladiator:
- case Job_Star_Gladiator2:
- return "star gladiator";
- case Job_Soul_Linker:
- return "soul linker";
-
- case Job_Novice_High:
- return "high novice";
- case Job_Acolyte_High:
- return "high acolyte";
- case Job_Archer_High:
- return "high archer";
- case Job_Mage_High:
- return "high mage";
- case Job_Merchant_High:
- return "high merchant";
- case Job_Swordman_High:
- return "high swordsman";
- case Job_Thief_High:
- return "high thief";
-
- case Job_Assassin_Cross:
- return "assassin cross";
- case Job_Champion:
- return "champion";
- case Job_Clown:
- return "minstrel";
- case Job_Creator:
- return "biochemist";
- case Job_Gypsy:
- return "gypsy";
- case Job_High_Priest:
- return "high priest";
- case Job_High_Wizard:
- return "high wizard";
- case Job_Lord_Knight:
- case Job_Lord_Knight2:
- return "lord knight";
- case Job_Paladin:
- case Job_Paladin2:
- return "paladin";
- case Job_Professor:
- return "professor";
- case Job_Sniper:
- return "sniper";
- case Job_Stalker:
- return "stalker";
- case Job_Whitesmith:
- return "whitesmith";
-
- case Job_Baby:
- return "baby";
- case Job_Baby_Acolyte:
- return "baby acolyte";
- case Job_Baby_Archer:
- return "baby archer";
- case Job_Baby_Mage:
- return "baby mage";
- case Job_Baby_Merchant:
- return "baby merchant";
- case Job_Baby_Swordman:
- return "baby swordsman";
- case Job_Baby_Thief:
- return "baby thief";
- case Job_Super_Baby:
- return "super baby";
-
- case Job_Baby_Hunter:
- return "baby hunter";
- case Job_Baby_Dancer:
- return "baby dancer";
- case Job_Baby_Bard:
- return "baby bard";
- case Job_Baby_Priest:
- return "baby priest";
- case Job_Baby_Monk:
- return "baby monk";
- case Job_Baby_Wizard:
- return "baby wizard";
- case Job_Baby_Sage:
- return "baby sage";
- case Job_Baby_BlackSmith:
- return "baby blacksmith";
- case Job_Baby_Alchem:
- return "baby alchemist";
- case Job_Baby_Knight:
- case Job_Baby_Knight2:
- return "baby knight";
- case Job_Baby_Crusader:
- case Job_Baby_Crusader2:
- return "baby crusader";
- case Job_Baby_Assassin:
- return "baby assassin";
- case Job_Baby_Rogue:
- return "baby rogue";
- default:
- return "unknown";
- }
-
-}
-
-//Returns job name using two params: JobId and Type
-function script GF_getJobName2 {
- set @classId, callfunc("GF_getJobId", getarg(0), getarg(1));
- return callfunc("GF_getJobName", @classId);
-}
-
-//Returns a Job's ID modified by their Type
-function script GF_getJobId {
- set @classId, getarg(0);
- set @type, getarg(1);
-
- if (@classId == Job_SuperNovice || @classId == Job_Super_Baby) {
- switch (@type) {
- case 0:
- return Job_SuperNovice;
- case 2:
- return Job_Super_Baby;
- default:
- return @classId;
- }
- }
- if (@classId >= Job_Taekwon && @classId <= Job_Soul_Linker) {
- //Currently has no alternates.
- return @classId;
- }
- if (@classId >= Job_Novice_High && @classId <= Job_Paladin2)
- set @classId, @classId -Job_Novice_High;
- else
- if (@classId >= Job_Baby && @classId <= Job_Super_Baby)
- set @classId, @classId -Job_Baby;
-
- if (@type == 1)
- set @classId, @classId +Job_Novice_High;
-
- if (@type == 2)
- set @classId, @classId +Job_Baby;
-
- return @classId;
-}
-
-//Returns the type of class:
-//0= Novice, 1= First Class, 2= Second Class, 3= Super Novice
-//4= Wedding
-function script GF_getJobLevel {
-
- set @classId, getarg(0);
-
- if (@classId >= Job_Novice_High && @classId <= Job_Paladin2)
- set @classId, @classId -Job_Novice_High;
-
- if (@classId >= Job_Baby && @classId <= Job_Baby_Crusader2)
- set @classId, @classId -Job_Baby;
-
- if(@classId == Job_Novice) {
- return 0;
- }
- if((@classId >= Job_Swordman && @classId <= Job_Thief)
- || @classId == Job_Taekwon) {
- return 1;
- }
- if ((@classId >= Job_Knight && @classId <= Job_Crusader2)
- || (@classId >= Job_Star_Gladiator && @classId <= Job_Soul_Linker)) {
- return 2;
- }
-
- if(@classId == Job_SuperNovice || @classId == Job_Super_Baby) {
- return 3;
- }
- if(@classId == 22) {
- return 4;
- }
- return -1;
-}
-
-//Returns the type of class, based on path:
-//0= Normal Jobs, 1= Upper Jobs, 2= Baby Jobs
-//Works the same as Upper, except you can pass any job id to get it's upper value
-function script GF_getJobType {
- set @classId, getarg(0);
-
- if ((@classId >= Job_Novice && @classId <= Job_SuperNovice)
- || (@classId >= Job_Taekwon && @classId <= Job_Soul_Linker)) {
- return 0;
- }
- if (@classId >= Job_Novice_High && @classId <= Job_Paladin2) {
- return 1;
- }
- if (@classId >= Job_Baby && @classId <= Job_Super_Baby) {
- return 2;
- }
- return -1;
-}
-//Returns the base class of the given job, return values are:
-//Job_Novice (Novice, Baby Novice, Super Novice
-//Job_Acolyte (Aco, Priest, Monk +High/Baby variations)
-//Job_Archer (Archer, Sniper, Bard, Dancer +High/Baby variations)
-//Job_Mage (Mage, Wizard, Sage +High/Baby variations)
-//Job_Swordman (Swordsman, Knight, Crusader +High/Baby variations)
-//Job_Thief (Thief, Assassin, Rogue +High/Baby variations)
-//-1 : others (when wearing Tux/Wedding dress, for example)
-//Works the same as baseClass, except you pass the class which you want
-//examined.
-function script GF_getJobClass {
- set @classId, getarg(0);
-
- if (@classId >= Job_Novice_High && @classId <= Job_Paladin2)
- set @classId, @classId -Job_Novice_High;
-
- if (@classId >= Job_Baby && @classId <= Job_Baby_Crusader2)
- set @classId, @classId -Job_Baby;
-
- switch (@classId) {
- case Job_Novice:
- case Job_SuperNovice:
- case Job_Super_Baby:
- return Job_Novice;
-
- case Job_Acolyte:
- case Job_Priest:
- case Job_Monk:
- return Job_Acolyte;
-
- case Job_Archer:
- case Job_Hunter:
- case Job_Bard:
- case Job_Dancer:
- return Job_Archer;
-
- case Job_Mage:
- case Job_Wizard:
- case Job_Sage:
- return Job_Mage;
-
- case Job_Merchant:
- case Job_BlackSmith:
- case Job_Alchem:
- return Job_Merchant;
-
- case Job_Swordman:
- case Job_Knight:
- case Job_Knight2:
- case Job_Paladin:
- case Job_Paladin2:
- return Job_Swordman;
-
- case Job_Thief:
- case Job_Assassin:
- case Job_Rogue:
- return Job_Thief;
-
- case Job_Taekwon:
- case Job_Star_Gladiator:
- case Job_Star_Gladiator2:
- case Job_Soul_Linker:
- return Job_Taekwon;
-
- default:
- return -1;
- }
+//===== eAthena Script ======================================= +//= Global functions +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 1.5 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+, RO Ep6+ +//===== Description: ========================================= +//= Global Functions +//= +//===== Additional Comments: ================================= +//= GF_getJobName= function for getting a job's name +//= GF_getJobName2= gets a jobs name modified by Type (see below) +//= GF_getJobId= gets a jobs number modified by Type (see below) +//= GF_getJobLevel= identifies novices/1st/2nd among classes +//= GF_getJobType= identifies normal/advanced/babies classes +//= - GF_getJobClass= identifies job class (swordie, mage, etc) +//============================================================ + +function script GF_getJobName { + + switch (getarg(0)) { + + case Job_Novice: + return "novice"; + case Job_Acolyte: + return "acolyte"; + case Job_Archer: + return "archer"; + case Job_Mage: + return "mage"; + case Job_Merchant: + return "merchant"; + case Job_Swordman: + return "swordsman"; + case Job_Thief: + return "thief"; + case Job_Taekwon: + return "taekwon kid"; + case Job_SuperNovice: + return "super novice"; + + case Job_Hunter: + return "hunter"; + case Job_Dancer: + return "dancer"; + case Job_Bard: + return "bard"; + case Job_Priest: + return "priest"; + case Job_Monk: + return "monk"; + case Job_Wizard: + return "wizard"; + case Job_Sage: + return "sage"; + case Job_BlackSmith: + return "blacksmith"; + case Job_Alchem: + return "alchemist"; + case Job_Knight: + case Job_Knight2: + return "knight"; + case Job_Crusader: + case Job_Crusader2: + return "crusader"; + case Job_Assassin: + return "assassin"; + case Job_Rogue: + return "rogue"; + case Job_Star_Gladiator: + case Job_Star_Gladiator2: + return "star gladiator"; + case Job_Soul_Linker: + return "soul linker"; + + case Job_Novice_High: + return "high novice"; + case Job_Acolyte_High: + return "high acolyte"; + case Job_Archer_High: + return "high archer"; + case Job_Mage_High: + return "high mage"; + case Job_Merchant_High: + return "high merchant"; + case Job_Swordman_High: + return "high swordsman"; + case Job_Thief_High: + return "high thief"; + + case Job_Assassin_Cross: + return "assassin cross"; + case Job_Champion: + return "champion"; + case Job_Clown: + return "minstrel"; + case Job_Creator: + return "biochemist"; + case Job_Gypsy: + return "gypsy"; + case Job_High_Priest: + return "high priest"; + case Job_High_Wizard: + return "high wizard"; + case Job_Lord_Knight: + case Job_Lord_Knight2: + return "lord knight"; + case Job_Paladin: + case Job_Paladin2: + return "paladin"; + case Job_Professor: + return "professor"; + case Job_Sniper: + return "sniper"; + case Job_Stalker: + return "stalker"; + case Job_Whitesmith: + return "whitesmith"; + + case Job_Baby: + return "baby"; + case Job_Baby_Acolyte: + return "baby acolyte"; + case Job_Baby_Archer: + return "baby archer"; + case Job_Baby_Mage: + return "baby mage"; + case Job_Baby_Merchant: + return "baby merchant"; + case Job_Baby_Swordman: + return "baby swordsman"; + case Job_Baby_Thief: + return "baby thief"; + case Job_Super_Baby: + return "super baby"; + + case Job_Baby_Hunter: + return "baby hunter"; + case Job_Baby_Dancer: + return "baby dancer"; + case Job_Baby_Bard: + return "baby bard"; + case Job_Baby_Priest: + return "baby priest"; + case Job_Baby_Monk: + return "baby monk"; + case Job_Baby_Wizard: + return "baby wizard"; + case Job_Baby_Sage: + return "baby sage"; + case Job_Baby_BlackSmith: + return "baby blacksmith"; + case Job_Baby_Alchem: + return "baby alchemist"; + case Job_Baby_Knight: + case Job_Baby_Knight2: + return "baby knight"; + case Job_Baby_Crusader: + case Job_Baby_Crusader2: + return "baby crusader"; + case Job_Baby_Assassin: + return "baby assassin"; + case Job_Baby_Rogue: + return "baby rogue"; + default: + return "unknown"; + } + +} + +//Returns job name using two params: JobId and Type +function script GF_getJobName2 { + set @classId, callfunc("GF_getJobId", getarg(0), getarg(1)); + return callfunc("GF_getJobName", @classId); +} + +//Returns a Job's ID modified by their Type +function script GF_getJobId { + set @classId, getarg(0); + set @type, getarg(1); + + if (@classId == Job_SuperNovice || @classId == Job_Super_Baby) { + switch (@type) { + case 0: + return Job_SuperNovice; + case 2: + return Job_Super_Baby; + default: + return @classId; + } + } + if (@classId >= Job_Taekwon && @classId <= Job_Soul_Linker) { + //Currently has no alternates. + return @classId; + } + if (@classId >= Job_Novice_High && @classId <= Job_Paladin2) + set @classId, @classId -Job_Novice_High; + else + if (@classId >= Job_Baby && @classId <= Job_Super_Baby) + set @classId, @classId -Job_Baby; + + if (@type == 1) + set @classId, @classId +Job_Novice_High; + + if (@type == 2) + set @classId, @classId +Job_Baby; + + return @classId; +} + +//Returns the type of class: +//0= Novice, 1= First Class, 2= Second Class, 3= Super Novice +//4= Wedding +function script GF_getJobLevel { + + set @classId, getarg(0); + + if (@classId >= Job_Novice_High && @classId <= Job_Paladin2) + set @classId, @classId -Job_Novice_High; + + if (@classId >= Job_Baby && @classId <= Job_Baby_Crusader2) + set @classId, @classId -Job_Baby; + + if(@classId == Job_Novice) { + return 0; + } + if((@classId >= Job_Swordman && @classId <= Job_Thief) + || @classId == Job_Taekwon) { + return 1; + } + if ((@classId >= Job_Knight && @classId <= Job_Crusader2) + || (@classId >= Job_Star_Gladiator && @classId <= Job_Soul_Linker)) { + return 2; + } + + if(@classId == Job_SuperNovice || @classId == Job_Super_Baby) { + return 3; + } + if(@classId == 22) { + return 4; + } + return -1; +} + +//Returns the type of class, based on path: +//0= Normal Jobs, 1= Upper Jobs, 2= Baby Jobs +//Works the same as Upper, except you can pass any job id to get it's upper value +function script GF_getJobType { + set @classId, getarg(0); + + if ((@classId >= Job_Novice && @classId <= Job_SuperNovice) + || (@classId >= Job_Taekwon && @classId <= Job_Soul_Linker)) { + return 0; + } + if (@classId >= Job_Novice_High && @classId <= Job_Paladin2) { + return 1; + } + if (@classId >= Job_Baby && @classId <= Job_Super_Baby) { + return 2; + } + return -1; +} +//Returns the base class of the given job, return values are: +//Job_Novice (Novice, Baby Novice, Super Novice +//Job_Acolyte (Aco, Priest, Monk +High/Baby variations) +//Job_Archer (Archer, Sniper, Bard, Dancer +High/Baby variations) +//Job_Mage (Mage, Wizard, Sage +High/Baby variations) +//Job_Swordman (Swordsman, Knight, Crusader +High/Baby variations) +//Job_Thief (Thief, Assassin, Rogue +High/Baby variations) +//-1 : others (when wearing Tux/Wedding dress, for example) +//Works the same as baseClass, except you pass the class which you want +//examined. +function script GF_getJobClass { + set @classId, getarg(0); + + if (@classId >= Job_Novice_High && @classId <= Job_Paladin2) + set @classId, @classId -Job_Novice_High; + + if (@classId >= Job_Baby && @classId <= Job_Baby_Crusader2) + set @classId, @classId -Job_Baby; + + switch (@classId) { + case Job_Novice: + case Job_SuperNovice: + case Job_Super_Baby: + return Job_Novice; + + case Job_Acolyte: + case Job_Priest: + case Job_Monk: + return Job_Acolyte; + + case Job_Archer: + case Job_Hunter: + case Job_Bard: + case Job_Dancer: + return Job_Archer; + + case Job_Mage: + case Job_Wizard: + case Job_Sage: + return Job_Mage; + + case Job_Merchant: + case Job_BlackSmith: + case Job_Alchem: + return Job_Merchant; + + case Job_Swordman: + case Job_Knight: + case Job_Knight2: + case Job_Paladin: + case Job_Paladin2: + return Job_Swordman; + + case Job_Thief: + case Job_Assassin: + case Job_Rogue: + return Job_Thief; + + case Job_Taekwon: + case Job_Star_Gladiator: + case Job_Star_Gladiator2: + case Job_Soul_Linker: + return Job_Taekwon; + + default: + return -1; + } }
\ No newline at end of file diff --git a/npc/custom/eAAC_Scripts/kafraExpress/kafras.txt b/npc/custom/eAAC_Scripts/kafraExpress/kafras.txt index 739dcc58e..329adf296 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/kafras.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/kafras.txt @@ -1,296 +1,296 @@ -//===== eAthena Script =======================================
-//= Kafra Express - NPC definitions
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 2.2
-//===== Compatible With: =====================================
-//= Any eAthena Version with function support; RO Episode 8+ (LightHalzen)
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Here is where the npcs are defined.
-//===== Additional Comments: =================================
-//= To define your own Kafra, keep in mind the order and meaning
-//= of the arguments for the main function.
-//============================================================
-
-//This is the model for the call: Type is 0 for towns, 1 for dungeons (2 for both)
-//callfunc "F_KafraExpress","NPC Name","Image File", type, "Save Map", Save X, Save Y;
-
-//Town Kafras
-alberta.gat,113,60,5 script Kafra Express::Alberta 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",0,"alberta.gat",116,57;
-}
-
-aldebaran.gat,133,124,5 script Kafra Express::AlDeBaran 115,{
- callfunc "F_KafraExpress","Kafra Express","kafra_03",2,"aldebaran.gat",139,131;
-}
-
-amatsu.gat,201,80,8 script Kafra Express::Amatsu 114,{
- callfunc "F_KafraExpress","Kafra Express","kafra_04",0,"amatsu.gat",197,81;
-}
-
-ayothaya.gat,195,160,8 script Kafra Express::Ayothaya 112,{
- callfunc "F_KafraExpress","Kafra Express","kafra_06",0,"ayothaya.gat",194,173;
-}
-
-comodo.gat,190,153,5 script Kafra Express::Comodo 721,{
- callfunc "F_KafraExpress","Kafra Express","kafra_07",0,"comodo.gat",189,166;
-}
-
-geffen.gat,121,62,8 script Kafra Express::Geffen 113,{
- callfunc "F_KafraExpress","Kafra Express","kafra_05",0,"geffen.gat",119,56;
-}
-
-gonryun.gat,169,188,2 script Kafra Express::GonRyun 117,{
- callfunc "F_KafraExpress","Kafra Express","kafra_01",2,"gonryun.gat",168,199;
-}
-
-einbech.gat,143,243,3 script Kafra Express::Einbech 860,{
- callfunc "F_KafraExpress","Kafra Express","kafra_08",0,"einbech.gat",157,250;
-}
-
-einbroch.gat,58,207,4 script Kafra Express::Einbroch 860,{
- callfunc "F_KafraExpress","Kafra Express","kafra_08",0,"einbroch.gat",64,184;
-}
-
-hugel.gat,101,117,1 script Kafra Express::Hugel 115,{
- callfunc "F_KafraExpress","Kafra Express","kafra_03",0,"hugel.gat",102,109;
-}
-
-izlude.gat,136,94,2 script Kafra Express::Izlude 115,{
- callfunc "F_KafraExpress","Kafra Express","kafra_03",0,"izlude.gat",147,99;
-}
-
-jawaii.gat,208,217,7 script Kafra Express::Jawaii 721,{
- callfunc "F_KafraExpress","Kafra Express","kafra_07",0,"jawaii.gat",213,209;
-}
-
-lighthalzen.gat,165,106,3 script Kafra Express::Lighthalzen 861,{
- callfunc "F_KafraExpress","Kafra Express","kafra_09",0,"lighthalzen.gat",152,106;
-}
-
-louyang.gat,220,123,3 script Kafra Express::LouYang 117,{
- callfunc "F_KafraExpress","Kafra Express","kafra_01",0,"louyang.gat",221,128;
-}
-
-xmas.gat,148,126,4 script Kafra Express::Lutie 112,{
- callfunc "F_KafraExpress","Kafra Express","kafra_06",0,"xmas.gat",149,117;
-}
-
-morocc.gat,156,97,3 script Kafra Express::Morocc 721,{
- callfunc "F_KafraExpress","Kafra Express","kafra_07",0,"morocc.gat",156,91;
-}
-
-niflheim.gat,196,192,3 script Kafra Express::Niflheim 791,{
- callfunc "F_KafraExpress","Kafra Express","",3,"niflheim.gat",194,185;
-}
-
-payon.gat,152,181,5 script Kafra Express::Payon 114,{
- callfunc "F_KafraExpress","Kafra Express","kafra_04",0,"payon.gat",162,182;
-}
-
-prontera.gat,147,177,7 script Kafra Express::Prontera 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",0,"prontera.gat",156,195;
-}
-
-umbala.gat,89,159,4 script Kafra Express::Umbala 860,{
- callfunc "F_KafraExpress","Kafra Express","kafra_08",0,"umbala.gat",91,159;
-}
-
-yuno.gat,159,87,5 script Kafra Express::Yuno 861,{
- callfunc "F_KafraExpress","Kafra Express","kafra_09",0,"yuno.gat",159,52;
-}
-
-//Dungeon Kafras
-//Abyss Lake
-hu_fild05.gat,170,305,7 script Kafra Express::D_Abyss 861,{
- callfunc "F_KafraExpress","Kafra Express","kafra_09",1,"hu_fild05.gat",160,302;
-}
-
-//Amatsu D
-ama_in02.gat,115,184,6 script Kafra Express::D_Amatsu 117,{
- callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"ama_in02.gat",118,184;
-}
-
-//AntHell North
-moc_fild04.gat,208,323,1 script Kafra Express::D_Anthell1 114,{
- callfunc "F_KafraExpress","Kafra Express","kafra_04",1,"moc_fild04.gat",207,332;
-}
-
-//AntHell South
-moc_fild15.gat,251,243,3 script Kafra Express::D_Anthell2 114,{
- callfunc "F_KafraExpress","Kafra Express","kafra_04",1,"moc_fild15.gat",246,251;
-}
-
-//Ayothaya Dungeon
-ayo_fild02.gat,289,144,3 script Kafra Express::D_Ayothaya 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"ayo_fild02.gat",289,155;
-}
-
-//Byalan Island
-izlu2dun.gat,101,82,7 script Kafra Express::D_Byalan 112,{
- callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"izlu2dun.gat",112,84;
-}
-
-//Comodo East Cave
-cmd_fild01.gat,33,321,4 script Kafra Express::D_ComodoE 721,{
- callfunc "F_KafraExpress","Kafra Express","kafra_07",1,"cmd_fild01.gat",34,325;
-}
-
-//Comodo West Cave
-comodo.gat,31,218,4 script Kafra Express::D_ComodoW 721,{
- callfunc "F_KafraExpress","Kafra Express","kafra_07",1,"comodo.gat",32,209;
-}
-
-//Comodo North Cave
-comodo.gat,182,347,2 script Kafra Express::D_ComodoN 721,{
- callfunc "F_KafraExpress","Kafra Express","kafra_07",1,"comodo.gat",180,352;
-}
-
-//Coal Mines
-mjolnir_02.gat,83,364,4 script Kafra Express::D_Coal 861,{
- callfunc "F_KafraExpress","Kafra Express","kafra_09",1,"mjolnir_02.gat",89,358;
-}
-
-//Culvert
-prt_fild05.gat,275,219,5 script Kafra Express::D_Culvert 112,{
- callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"prt_fild05.gat",274,208;
-}
-
-//Gefenia
-gefenia01.gat,56,171,6 script Kafra Express::D_Gefenia1 861,{
- callfunc "F_KafraExpress","Kafra Express","kafra_09",1,"gefenia01.gat",59,169;
-}
-
-//Geffen Dungeon
-gef_tower.gat,156,33,3 script Kafra Express::D_Geffen 113,{
- callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"gef_tower.gat",147,35;
-}
-
-//GH: Church
-glast_01.gat,193,136,5 script Kafra Express::D_GHChurch 791,{
- callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",206,136;
-}
-
-//GH: Castle
-glast_01.gat,200,350,4 script Kafra Express::D_GHCastle 791,{
- callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",200,347;
-}
-
-//GH: Staircase
-glast_01.gat,58,103,7 script Kafra Express::D_GHStair 791,{
- callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",62,107;
-}
-
-//GH: Chivalry
-glast_01.gat,62,198,6 script Kafra Express::D_GHChivalry 791,{
- callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",69,193;
-}
-
-//LightHalzen Rekkenber (Sewer Entrance)
-lighthalzen.gat,311,293,1 script Kafra Express::D_Lhz 860,{
- callfunc "F_KafraExpress","Kafra Express","kafra_08",1,"lighthalzen.gat",301,286;
-}
-
-//LightHalzen Rekkenber (Rekkenber Entrance)(
-//lighthalzen.gat,69,57,7 script Kafra Express::D_Lhz 860,{
-// callfunc "F_KafraExpress","Kafra Express","kafra_08",1,"lighthalzen.gat",78,57;
-//}
-
-//Juperos
-jupe_cave.gat,45,55,5 script Kafra Express::D_Juperos 860,{
- callfunc "F_KafraExpress","Kafra Express","kafra_08",1,"jupe_cave.gat",45,48;
-}
-
-//Laberynth
-prt_fild01.gat,143,365,3 script Kafra Express::D_Maze 112,{
- callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"prt_fild01.gat",136,361;
-}
-
-//LouYang D
-louyang.gat,35,276,6 script Kafra Express::D_Louyang 117,{
- callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"louyang.gat",41,267;
-}
-
-//Magma D
-yuno_fild03.gat,34,143,5 script Kafra Express::D_Magma 115,{
- callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"yuno_fild03.gat",35,135;
-}
-
-//Orc D North
-in_orcs01.gat,24,165,5 script Kafra Express::D_OrcsN 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"in_orcs01.gat",34,165;
-}
-
-//Orc D South
-in_orcs01.gat,103,99,5 script Kafra Express::D_OrcsS 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"in_orcs01.gat",112,99;
-}
-
-//Payon D
-pay_arche.gat,38,138,6 script Kafra Express::D_Payon 112,{
- callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"pay_arche.gat",41,133;
-}
-
-//Pyramids D
-moc_ruins.gat,60,166,5 script Kafra Express::D_Pyramid 115,{
- callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"moc_ruins.gat",62,162;
-}
-
-//Sphinx D
-moc_fild19.gat,106,97,8 script Kafra Express::D_Sphinx 115,{
- callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"moc_fild19.gat",107,100;
-}
-
-//Sunken Ship
-alb2trea.gat,75,101,5 script Kafra Express::D_Sunken 114,{
- callfunc "F_KafraExpress","Kafra Express","kafra_04",1,"alb2trea.gat",87,103;
-}
-
-//Thanatos Tower
-tha_scene01.gat,139,194,0 script Kafra Express::D_Thanatos 113,{
- callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"tha_scene01.gat",132,220;
-}
-
-//Toy Factory
-xmas.gat,138,307,6 script Kafra Express::D_Toy 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"xmas.gat",144,306;
-}
-
-//Turtle Cave Entrance
-tur_dun01.gat,147,237,6 script Kafra Express::D_TCave 113,{
- callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"tur_dun01.gat",155,234;
-}
-
-//Turtle Island Entrance
-tur_dun01.gat,148,54,6 script Kafra Express::D_TIsland 113,{
- callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"tur_dun01.gat",153,47;
-}
-
-//Umbala D
-umbala.gat,120,284,3 script Kafra Express::D_Umbala 117,{
- callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"umbala.gat",113,282;
-}
-
-//Guild War Kafras: Disabled by Default!
-
-//Al De Baran Guild Grounds
-//alde_gld.gat,156,165,3 script Kafra Express::G_AlDeBaran 116,{
-// callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"alde_gld.gat",156,157;
-//}
-
-//Geffen Guild Grounds
-//gef_fild13.gat,237,182,6 script Kafra Express::G_Geffen 113,{
-// callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"gef_fild13.gat",231,181;
-//}
-
-//Payon Guild Grounds
-//pay_gld.gat,243,172,6 script Kafra Express::G_Payon 117,{
-// callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"pay_gld.gat",243,178;
-//}
-
-//Prontera Guild Grounds
-//prt_gld.gat,127,163,5 script Kafra Express::G_Prontera 115,{
-// callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"prt_gld.gat",129,170;
-//}
+//===== eAthena Script ======================================= +//= Kafra Express - NPC definitions +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 2.2 +//===== Compatible With: ===================================== +//= Any eAthena Version with function support; RO Episode 8+ (LightHalzen) +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Here is where the npcs are defined. +//===== Additional Comments: ================================= +//= To define your own Kafra, keep in mind the order and meaning +//= of the arguments for the main function. +//============================================================ + +//This is the model for the call: Type is 0 for towns, 1 for dungeons (2 for both) +//callfunc "F_KafraExpress","NPC Name","Image File", type, "Save Map", Save X, Save Y; + +//Town Kafras +alberta.gat,113,60,5 script Kafra Express::Alberta 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",0,"alberta.gat",116,57; +} + +aldebaran.gat,133,124,5 script Kafra Express::AlDeBaran 115,{ + callfunc "F_KafraExpress","Kafra Express","kafra_03",2,"aldebaran.gat",139,131; +} + +amatsu.gat,201,80,8 script Kafra Express::Amatsu 114,{ + callfunc "F_KafraExpress","Kafra Express","kafra_04",0,"amatsu.gat",197,81; +} + +ayothaya.gat,195,160,8 script Kafra Express::Ayothaya 112,{ + callfunc "F_KafraExpress","Kafra Express","kafra_06",0,"ayothaya.gat",194,173; +} + +comodo.gat,190,153,5 script Kafra Express::Comodo 721,{ + callfunc "F_KafraExpress","Kafra Express","kafra_07",0,"comodo.gat",189,166; +} + +geffen.gat,121,62,8 script Kafra Express::Geffen 113,{ + callfunc "F_KafraExpress","Kafra Express","kafra_05",0,"geffen.gat",119,56; +} + +gonryun.gat,169,188,2 script Kafra Express::GonRyun 117,{ + callfunc "F_KafraExpress","Kafra Express","kafra_01",2,"gonryun.gat",168,199; +} + +einbech.gat,143,243,3 script Kafra Express::Einbech 860,{ + callfunc "F_KafraExpress","Kafra Express","kafra_08",0,"einbech.gat",157,250; +} + +einbroch.gat,58,207,4 script Kafra Express::Einbroch 860,{ + callfunc "F_KafraExpress","Kafra Express","kafra_08",0,"einbroch.gat",64,184; +} + +hugel.gat,101,117,1 script Kafra Express::Hugel 115,{ + callfunc "F_KafraExpress","Kafra Express","kafra_03",0,"hugel.gat",102,109; +} + +izlude.gat,136,94,2 script Kafra Express::Izlude 115,{ + callfunc "F_KafraExpress","Kafra Express","kafra_03",0,"izlude.gat",147,99; +} + +jawaii.gat,208,217,7 script Kafra Express::Jawaii 721,{ + callfunc "F_KafraExpress","Kafra Express","kafra_07",0,"jawaii.gat",213,209; +} + +lighthalzen.gat,165,106,3 script Kafra Express::Lighthalzen 861,{ + callfunc "F_KafraExpress","Kafra Express","kafra_09",0,"lighthalzen.gat",152,106; +} + +louyang.gat,220,123,3 script Kafra Express::LouYang 117,{ + callfunc "F_KafraExpress","Kafra Express","kafra_01",0,"louyang.gat",221,128; +} + +xmas.gat,148,126,4 script Kafra Express::Lutie 112,{ + callfunc "F_KafraExpress","Kafra Express","kafra_06",0,"xmas.gat",149,117; +} + +morocc.gat,156,97,3 script Kafra Express::Morocc 721,{ + callfunc "F_KafraExpress","Kafra Express","kafra_07",0,"morocc.gat",156,91; +} + +niflheim.gat,196,192,3 script Kafra Express::Niflheim 791,{ + callfunc "F_KafraExpress","Kafra Express","",3,"niflheim.gat",194,185; +} + +payon.gat,152,181,5 script Kafra Express::Payon 114,{ + callfunc "F_KafraExpress","Kafra Express","kafra_04",0,"payon.gat",162,182; +} + +prontera.gat,147,177,7 script Kafra Express::Prontera 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",0,"prontera.gat",156,195; +} + +umbala.gat,89,159,4 script Kafra Express::Umbala 860,{ + callfunc "F_KafraExpress","Kafra Express","kafra_08",0,"umbala.gat",91,159; +} + +yuno.gat,159,87,5 script Kafra Express::Yuno 861,{ + callfunc "F_KafraExpress","Kafra Express","kafra_09",0,"yuno.gat",159,52; +} + +//Dungeon Kafras +//Abyss Lake +hu_fild05.gat,170,305,7 script Kafra Express::D_Abyss 861,{ + callfunc "F_KafraExpress","Kafra Express","kafra_09",1,"hu_fild05.gat",160,302; +} + +//Amatsu D +ama_in02.gat,115,184,6 script Kafra Express::D_Amatsu 117,{ + callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"ama_in02.gat",118,184; +} + +//AntHell North +moc_fild04.gat,208,323,1 script Kafra Express::D_Anthell1 114,{ + callfunc "F_KafraExpress","Kafra Express","kafra_04",1,"moc_fild04.gat",207,332; +} + +//AntHell South +moc_fild15.gat,251,243,3 script Kafra Express::D_Anthell2 114,{ + callfunc "F_KafraExpress","Kafra Express","kafra_04",1,"moc_fild15.gat",246,251; +} + +//Ayothaya Dungeon +ayo_fild02.gat,289,144,3 script Kafra Express::D_Ayothaya 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"ayo_fild02.gat",289,155; +} + +//Byalan Island +izlu2dun.gat,101,82,7 script Kafra Express::D_Byalan 112,{ + callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"izlu2dun.gat",112,84; +} + +//Comodo East Cave +cmd_fild01.gat,33,321,4 script Kafra Express::D_ComodoE 721,{ + callfunc "F_KafraExpress","Kafra Express","kafra_07",1,"cmd_fild01.gat",34,325; +} + +//Comodo West Cave +comodo.gat,31,218,4 script Kafra Express::D_ComodoW 721,{ + callfunc "F_KafraExpress","Kafra Express","kafra_07",1,"comodo.gat",32,209; +} + +//Comodo North Cave +comodo.gat,182,347,2 script Kafra Express::D_ComodoN 721,{ + callfunc "F_KafraExpress","Kafra Express","kafra_07",1,"comodo.gat",180,352; +} + +//Coal Mines +mjolnir_02.gat,83,364,4 script Kafra Express::D_Coal 861,{ + callfunc "F_KafraExpress","Kafra Express","kafra_09",1,"mjolnir_02.gat",89,358; +} + +//Culvert +prt_fild05.gat,275,219,5 script Kafra Express::D_Culvert 112,{ + callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"prt_fild05.gat",274,208; +} + +//Gefenia +gefenia01.gat,56,171,6 script Kafra Express::D_Gefenia1 861,{ + callfunc "F_KafraExpress","Kafra Express","kafra_09",1,"gefenia01.gat",59,169; +} + +//Geffen Dungeon +gef_tower.gat,156,33,3 script Kafra Express::D_Geffen 113,{ + callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"gef_tower.gat",147,35; +} + +//GH: Church +glast_01.gat,193,136,5 script Kafra Express::D_GHChurch 791,{ + callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",206,136; +} + +//GH: Castle +glast_01.gat,200,350,4 script Kafra Express::D_GHCastle 791,{ + callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",200,347; +} + +//GH: Staircase +glast_01.gat,58,103,7 script Kafra Express::D_GHStair 791,{ + callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",62,107; +} + +//GH: Chivalry +glast_01.gat,62,198,6 script Kafra Express::D_GHChivalry 791,{ + callfunc "F_KafraExpress","Kafra Express","",1,"glast_01.gat",69,193; +} + +//LightHalzen Rekkenber (Sewer Entrance) +lighthalzen.gat,311,293,1 script Kafra Express::D_Lhz 860,{ + callfunc "F_KafraExpress","Kafra Express","kafra_08",1,"lighthalzen.gat",301,286; +} + +//LightHalzen Rekkenber (Rekkenber Entrance)( +//lighthalzen.gat,69,57,7 script Kafra Express::D_Lhz 860,{ +// callfunc "F_KafraExpress","Kafra Express","kafra_08",1,"lighthalzen.gat",78,57; +//} + +//Juperos +jupe_cave.gat,45,55,5 script Kafra Express::D_Juperos 860,{ + callfunc "F_KafraExpress","Kafra Express","kafra_08",1,"jupe_cave.gat",45,48; +} + +//Laberynth +prt_fild01.gat,143,365,3 script Kafra Express::D_Maze 112,{ + callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"prt_fild01.gat",136,361; +} + +//LouYang D +louyang.gat,35,276,6 script Kafra Express::D_Louyang 117,{ + callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"louyang.gat",41,267; +} + +//Magma D +yuno_fild03.gat,34,143,5 script Kafra Express::D_Magma 115,{ + callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"yuno_fild03.gat",35,135; +} + +//Orc D North +in_orcs01.gat,24,165,5 script Kafra Express::D_OrcsN 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"in_orcs01.gat",34,165; +} + +//Orc D South +in_orcs01.gat,103,99,5 script Kafra Express::D_OrcsS 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"in_orcs01.gat",112,99; +} + +//Payon D +pay_arche.gat,38,138,6 script Kafra Express::D_Payon 112,{ + callfunc "F_KafraExpress","Kafra Express","kafra_06",1,"pay_arche.gat",41,133; +} + +//Pyramids D +moc_ruins.gat,60,166,5 script Kafra Express::D_Pyramid 115,{ + callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"moc_ruins.gat",62,162; +} + +//Sphinx D +moc_fild19.gat,106,97,8 script Kafra Express::D_Sphinx 115,{ + callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"moc_fild19.gat",107,100; +} + +//Sunken Ship +alb2trea.gat,75,101,5 script Kafra Express::D_Sunken 114,{ + callfunc "F_KafraExpress","Kafra Express","kafra_04",1,"alb2trea.gat",87,103; +} + +//Thanatos Tower +tha_scene01.gat,139,194,0 script Kafra Express::D_Thanatos 113,{ + callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"tha_scene01.gat",132,220; +} + +//Toy Factory +xmas.gat,138,307,6 script Kafra Express::D_Toy 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"xmas.gat",144,306; +} + +//Turtle Cave Entrance +tur_dun01.gat,147,237,6 script Kafra Express::D_TCave 113,{ + callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"tur_dun01.gat",155,234; +} + +//Turtle Island Entrance +tur_dun01.gat,148,54,6 script Kafra Express::D_TIsland 113,{ + callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"tur_dun01.gat",153,47; +} + +//Umbala D +umbala.gat,120,284,3 script Kafra Express::D_Umbala 117,{ + callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"umbala.gat",113,282; +} + +//Guild War Kafras: Disabled by Default! + +//Al De Baran Guild Grounds +//alde_gld.gat,156,165,3 script Kafra Express::G_AlDeBaran 116,{ +// callfunc "F_KafraExpress","Kafra Express","kafra_02",1,"alde_gld.gat",156,157; +//} + +//Geffen Guild Grounds +//gef_fild13.gat,237,182,6 script Kafra Express::G_Geffen 113,{ +// callfunc "F_KafraExpress","Kafra Express","kafra_05",1,"gef_fild13.gat",231,181; +//} + +//Payon Guild Grounds +//pay_gld.gat,243,172,6 script Kafra Express::G_Payon 117,{ +// callfunc "F_KafraExpress","Kafra Express","kafra_01",1,"pay_gld.gat",243,178; +//} + +//Prontera Guild Grounds +//prt_gld.gat,127,163,5 script Kafra Express::G_Prontera 115,{ +// callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"prt_gld.gat",129,170; +//} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_bank.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_bank.txt index 9594dae47..6ad0c2d50 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_bank.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_bank.txt @@ -1,175 +1,175 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Bank Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 2.7
-//===== Compatible With: =====================================
-//= eAthena SVN R3524+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers banking services with daily interests, and
-//= withdrawal/deposit fees.
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_bank -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadBank";
- end;
-}
-
-function script F_keBank {
-
- function SF_calcInterest;
- SF_calcInterest();
-
- do {
- set @feeD,callfunc("F_keCost",$@kebk_depositCost,100);
- set @maxDep,Zeny;
- if (@maxDep > $@kebk_maxTransact)
- set @maxDep,$@kebk_maxTransact;
- if (#ke_bank + @maxDep > $@kebk_capacity)
- set @maxDep,$@kebk_capacity-#ke_bank;
-
- set @feeW,callfunc("F_keCost",$@kebk_withdrawCost,100);
- set @maxWith,#ke_bank-(#ke_bank*@feeW/100);
- if (@maxWith > $@kebk_maxTransact)
- set @maxWith,$@kebk_maxTransact;
-
- if (#ke_bank < $@kebk_capacity) {
- set @kmenu, select(
- "- Return (balance is "+#ke_bank+"z)",
- "- Deposit (up to "+@maxDep+"z - "+@feeD+"% fee)",
- "- Withdraw (up to "+@maxWith+"z + "+@feeW+"% fee)",
- "- Transfer from 1st B.o.P. ("+#bankstorage+"z)",
- "- Transfer from 2nd B.o.P. ("+#kafrabank+"z)"
- );
- } else {
- set @kmenu, select(
- "- Return (balance is "+#ke_bank+"z)",
- "- Withdraw (up to "+@maxWith+"z + "+@feeW+"% fee)",
- "- Transfer from 1st B.o.P. ("+#bankstorage+"z)",
- "- Transfer from 2nd B.o.P. ("+#kafrabank+"z)"
- );
- if (@kmenu > 1)
- set @kmenu, @kmenu+1;
- }
- switch (@kmenu) {
- case 2: //Deposit
- input @amount;
- if (@amount < $@kebk_minTransact) {
- callfunc "F_keIntro", -1, "Sorry, the minimum transaction value is "+$@kebk_minTransact+"z.";
- break;
- }
- if (@amount > @maxDep) {
- callfunc "F_keIntro", e_an, "You can't deposit that quantity!";
- break;
- }
- set #ke_bank,#ke_bank+@amount-(@amount*@feeD/100);
- if ($@kebk_useGlobalBank)
- set $ke_globalbank, $ke_globalbank +@amount*@feeD/100;
- set Zeny,Zeny-@amount;
- emotion e_cash;
- break;
-
- case 3: //Withdraw
- input @amount;
- if (@amount < $@kebk_minTransact) {
- callfunc "F_keIntro", -1, "Sorry, the minimum transaction value is "+$@kebk_minTransact+"z.";
- break;
- }
- if (@amount > @maxWith) {
- callfunc "F_keIntro", e_X, "You can't withdraw that quantity!";
- break;
- }
- set #ke_bank,#ke_bank-@amount-(@amount*@feeW/100);
- if ($@kebk_useGlobalBank)
- set $ke_globalbank, $ke_globalbank +@amount*@feeW/100;
- set Zeny,Zeny+@amount;
- emotion e_oh;
- break;
-
- case 4: //1st B.o.P.
- if (#bankstorage==0) {
- callfunc "F_keIntro", -1, "Sorry, there is nothing left to transfer.";
- break;
- }
- callfunc "F_keIntro", -1, #bankstorage+"z have been transferred from your account in the First Bank of Prontera.";
- set #ke_bank,#ke_bank+#bankstorage;
- set #bankstorage,0;
- break;
-
- case 5: //2nd B.o.P.
- if (#kafrabank==0) {
- callfunc "F_keIntro", -1, "Sorry, there is nothing left to transfer.";
- break;
- }
- callfunc "F_keIntro", -1, #kafrabank+"z have been transferred from your account in the Second Bank of Prontera.";
- set #ke_bank,#ke_bank+#kafrabank;
- set #kafrabank,0;
- break;
- }
- } while (@kmenu > 1);
-return;
-
-//Subfunction: SF_calcInterest
-//Calculates the interests gained on the account. Uses 30-day months
-function SF_calcInterest {
- set @day,gettime(5);
- if (@day>30)
- set @day,30; //Use 30 day-months
- set @month,gettime(6);
- if (#ke_banktick == 0) { //Init bank.
- set #ke_banktick,gettime(6)*30+@day;
- if ($@kebk_monMaintenance < 1) return;
- set #ke_bankmtick,@month;
- return;
- }
- set @banktick,gettime(6)*30+@day;
- if (@banktick == #ke_banktick) return;
- if (@banktick < #ke_banktick) { //Year change.
- do {
- set #ke_banktick,#ke_banktick-360;
- if ($@kebk_monMaintenance > 0) set #ke_bankmtick,#ke_bankmtick-12;
- } while (@banktick < #ke_banktick);
- }
- if ($@kebk_monMaintenance > 0 && #ke_bankmtick < @month){ //Month change
- set @qty,0;
- do {
- if (#ke_bank < $@kebk_monMaintenance) {
- if (@qty>0)
- mes "You've been charged "+@qty+"z for account maintenance, but it was not enough.";
- if ($@kebk_useGlobalBank)
- set $ke_globalbank, $ke_globalbank + @qty;
- mes "You owe the Bank "+($@kebk_monMaintenance*(#ke_bankmtick-@month))+"z for maintenance costs. Until paid you won't earn interests...";
- return;
- }
- set @qty, @qty+$@kebk_monMaintenance;
- set #ke_bankmtick,#ke_bankmtick+1;
- set #ke_bank, #ke_bank-$@kebk_monMaintenance;
- } while (#ke_bankmtick < @month);
- mes "You've been charged "+@qty+"z for account maintenance.";
- if ($@kebk_useGlobalBank)
- set $ke_globalbank, $ke_globalbank + @qty;
- }
- set @qty,0;
- if (#ke_bank > $@kebk_monMaintenance && #ke_bank < $@kebk_capacity)
- set @qty,#ke_bank*$@kebk_dayInterest*(@banktick-#ke_banktick)/10000;
- set #ke_banktick,@banktick;
- if (@qty == 0) return;
- if (@qty < 0) {
- callfunc "F_keIntro", -1, "Sorry, your gained interests have been cancelled for being way too much.";
- return;
- }
- if (#ke_bank + @qty > $@kebk_capacity)
- set #ke_bank, $@kebk_capacity;
- else
- set #ke_bank,#ke_bank+@qty;
-
- callfunc "F_keIntro", -1, "Since your last visit, you've earned an interest of "+@qty+"z!";
-} //SF end
-
-}
-
+//===== eAthena Script ======================================= +//= Kafra Express - Bank Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 2.7 +//===== Compatible With: ===================================== +//= eAthena SVN R3524+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers banking services with daily interests, and +//= withdrawal/deposit fees. +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_bank -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadBank"; + end; +} + +function script F_keBank { + + function SF_calcInterest; + SF_calcInterest(); + + do { + set @feeD,callfunc("F_keCost",$@kebk_depositCost,100); + set @maxDep,Zeny; + if (@maxDep > $@kebk_maxTransact) + set @maxDep,$@kebk_maxTransact; + if (#ke_bank + @maxDep > $@kebk_capacity) + set @maxDep,$@kebk_capacity-#ke_bank; + + set @feeW,callfunc("F_keCost",$@kebk_withdrawCost,100); + set @maxWith,#ke_bank-(#ke_bank*@feeW/100); + if (@maxWith > $@kebk_maxTransact) + set @maxWith,$@kebk_maxTransact; + + if (#ke_bank < $@kebk_capacity) { + set @kmenu, select( + "- Return (balance is "+#ke_bank+"z)", + "- Deposit (up to "+@maxDep+"z - "+@feeD+"% fee)", + "- Withdraw (up to "+@maxWith+"z + "+@feeW+"% fee)", + "- Transfer from 1st B.o.P. ("+#bankstorage+"z)", + "- Transfer from 2nd B.o.P. ("+#kafrabank+"z)" + ); + } else { + set @kmenu, select( + "- Return (balance is "+#ke_bank+"z)", + "- Withdraw (up to "+@maxWith+"z + "+@feeW+"% fee)", + "- Transfer from 1st B.o.P. ("+#bankstorage+"z)", + "- Transfer from 2nd B.o.P. ("+#kafrabank+"z)" + ); + if (@kmenu > 1) + set @kmenu, @kmenu+1; + } + switch (@kmenu) { + case 2: //Deposit + input @amount; + if (@amount < $@kebk_minTransact) { + callfunc "F_keIntro", -1, "Sorry, the minimum transaction value is "+$@kebk_minTransact+"z."; + break; + } + if (@amount > @maxDep) { + callfunc "F_keIntro", e_an, "You can't deposit that quantity!"; + break; + } + set #ke_bank,#ke_bank+@amount-(@amount*@feeD/100); + if ($@kebk_useGlobalBank) + set $ke_globalbank, $ke_globalbank +@amount*@feeD/100; + set Zeny,Zeny-@amount; + emotion e_cash; + break; + + case 3: //Withdraw + input @amount; + if (@amount < $@kebk_minTransact) { + callfunc "F_keIntro", -1, "Sorry, the minimum transaction value is "+$@kebk_minTransact+"z."; + break; + } + if (@amount > @maxWith) { + callfunc "F_keIntro", e_X, "You can't withdraw that quantity!"; + break; + } + set #ke_bank,#ke_bank-@amount-(@amount*@feeW/100); + if ($@kebk_useGlobalBank) + set $ke_globalbank, $ke_globalbank +@amount*@feeW/100; + set Zeny,Zeny+@amount; + emotion e_oh; + break; + + case 4: //1st B.o.P. + if (#bankstorage==0) { + callfunc "F_keIntro", -1, "Sorry, there is nothing left to transfer."; + break; + } + callfunc "F_keIntro", -1, #bankstorage+"z have been transferred from your account in the First Bank of Prontera."; + set #ke_bank,#ke_bank+#bankstorage; + set #bankstorage,0; + break; + + case 5: //2nd B.o.P. + if (#kafrabank==0) { + callfunc "F_keIntro", -1, "Sorry, there is nothing left to transfer."; + break; + } + callfunc "F_keIntro", -1, #kafrabank+"z have been transferred from your account in the Second Bank of Prontera."; + set #ke_bank,#ke_bank+#kafrabank; + set #kafrabank,0; + break; + } + } while (@kmenu > 1); +return; + +//Subfunction: SF_calcInterest +//Calculates the interests gained on the account. Uses 30-day months +function SF_calcInterest { + set @day,gettime(5); + if (@day>30) + set @day,30; //Use 30 day-months + set @month,gettime(6); + if (#ke_banktick == 0) { //Init bank. + set #ke_banktick,gettime(6)*30+@day; + if ($@kebk_monMaintenance < 1) return; + set #ke_bankmtick,@month; + return; + } + set @banktick,gettime(6)*30+@day; + if (@banktick == #ke_banktick) return; + if (@banktick < #ke_banktick) { //Year change. + do { + set #ke_banktick,#ke_banktick-360; + if ($@kebk_monMaintenance > 0) set #ke_bankmtick,#ke_bankmtick-12; + } while (@banktick < #ke_banktick); + } + if ($@kebk_monMaintenance > 0 && #ke_bankmtick < @month){ //Month change + set @qty,0; + do { + if (#ke_bank < $@kebk_monMaintenance) { + if (@qty>0) + mes "You've been charged "+@qty+"z for account maintenance, but it was not enough."; + if ($@kebk_useGlobalBank) + set $ke_globalbank, $ke_globalbank + @qty; + mes "You owe the Bank "+($@kebk_monMaintenance*(#ke_bankmtick-@month))+"z for maintenance costs. Until paid you won't earn interests..."; + return; + } + set @qty, @qty+$@kebk_monMaintenance; + set #ke_bankmtick,#ke_bankmtick+1; + set #ke_bank, #ke_bank-$@kebk_monMaintenance; + } while (#ke_bankmtick < @month); + mes "You've been charged "+@qty+"z for account maintenance."; + if ($@kebk_useGlobalBank) + set $ke_globalbank, $ke_globalbank + @qty; + } + set @qty,0; + if (#ke_bank > $@kebk_monMaintenance && #ke_bank < $@kebk_capacity) + set @qty,#ke_bank*$@kebk_dayInterest*(@banktick-#ke_banktick)/10000; + set #ke_banktick,@banktick; + if (@qty == 0) return; + if (@qty < 0) { + callfunc "F_keIntro", -1, "Sorry, your gained interests have been cancelled for being way too much."; + return; + } + if (#ke_bank + @qty > $@kebk_capacity) + set #ke_bank, $@kebk_capacity; + else + set #ke_bank,#ke_bank+@qty; + + callfunc "F_keIntro", -1, "Since your last visit, you've earned an interest of "+@qty+"z!"; +} //SF end + +} + diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_broadcast.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_broadcast.txt index 669942e72..ad7a02c4b 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_broadcast.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_broadcast.txt @@ -1,224 +1,224 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Broadcasting Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 3.0
-//===== Compatible With: =====================================
-//= eAthena SVN3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers broadcasting for party requests, pvp, general
-//= and anonymous. Broadcasts can be to the current map
-//= or server-wide
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//= For the PVP broadcasts, variables from the Pvp Warping
-//= Module are used.
-//============================================================
-
-- script keInit_broadcast -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadBroadcast";
- end;
-}
-
-//Function F_keBroadcast(String currentMapName)
-function script F_keBroadcast {
-
- function SF_calcPrice;
- function SF_broadcasts;
- function SF_bcPvp;
- function SF_doBroadcast;
-
- if ($@kebc_showOnline) {
- set @kmenu, select(
- "- Return",
- "- Map Broadcasts ("+getarg(0)+"/"+getmapusers(getarg(0))+" "+$@ked_users$+")",
- "- Global Broadcasts ("+getusers(1)+" "+$@ked_users$+")"
- );
- } else {
- set @kmenu, select(
- "- Return",
- "- Map Broadcasts ("+getarg(0)+")",
- "- Global Broadcasts"
- );
- }
- switch(@kmenu) {
- case 2:
- SF_calcPrice(0);
- set @map$,getarg(0);
- SF_broadcasts("Map ("+getarg(0)+")");
- break;
- case 3:
- SF_calcPrice(1);
- set @map$,"";
- SF_broadcasts("Global");
- break;
- }
-return;
-
-//Sub Function SF_broadcasts: Handles main broadcast menu.
-function SF_broadcasts {
-
- do {
- switch (select (
- "- Cancel "+getarg(0)+" Broadcast",
- "- Party request Broadcast ("+@partycost+"z)",
- "- PvP challenge Broadcast ("+@pvpcost+"z)",
- "- General Broadcast ("+@cost+"z)",
- "- General Anonymous Broadcast ("+@anoncost+"z)"
- )) {
- case 2: //Party
- SF_doBroadcast $@kebc_partyCost,@map$,"The "+callfunc("GF_getJobName",class)+" "+strcharinfo(0)+" (levels "+baselevel+"/"+joblevel+") is looking for a party to join.",0;
- break;
- case 3: //Pvp
- if ($@kewp_advanced == 0)
- SF_bcPvp $@kebc_pvpCost,@map$,0,0;
- else {
- do {
- set @kmenu, select (
- "- Cancel",
- "- advertise all levels rooms",
- "- advertise levels "+($@kewp_baseLv1-$@kewp_range)+"-"+($@kewp_baseLv1+$@kewp_range)+" rooms",
- "- advertise levels "+($@kewp_baseLv2-$@kewp_range)+"-"+($@kewp_baseLv2+$@kewp_range)+" rooms",
- "- advertise levels "+($@kewp_baseLv3-$@kewp_range)+"-"+($@kewp_baseLv3+$@kewp_range)+" rooms",
- "- advertise levels "+($@kewp_baseLv4-$@kewp_range)+"-"+($@kewp_baseLv4+$@kewp_range)+" rooms",
- "- advertise levels "+($@kewp_baseLv5-$@kewp_range)+"-"+($@kewp_baseLv5+$@kewp_range)+" rooms",
- "- advertise levels "+($@kewp_baseLv6-$@kewp_range)+"-"+($@kewp_baseLv6+$@kewp_range)+" rooms",
- "- advertise levels "+($@kewp_baseLv7-$@kewp_range)+"-"+($@kewp_baseLv7+$@kewp_range)+" rooms"
- );
- switch (@kmenu) {
- case 2: //All levels
- SF_bcPvp $@kebc_pvpCost,@map$,0,0;
- break;
- case 3: //Lv1
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv1-$@kewp_range,$@kewp_baseLv1+$@kewp_range;
- break;
- case 4: //Lv2
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv2-$@kewp_range,$@kewp_baseLv2+$@kewp_range;
- break;
- case 5: //Lv3
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv3-$@kewp_range,$@kewp_baseLv3+$@kewp_range;
- break;
- case 6: //Lv4
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv4-$@kewp_range,$@kewp_baseLv4+$@kewp_range;
- break;
- case 7: //Lv5
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv5-$@kewp_range,$@kewp_baseLv5+$@kewp_range;
- break;
- case 8: //Lv6
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv6-$@kewp_range,$@kewp_baseLv6+$@kewp_range;
- break;
- case 9: //Lv7
- SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv7-$@kewp_range,$@kewp_baseLv7+$@kewp_range;
- break;
- default:
- break;
- }
- } while (@kmenu > 1);
- }
- break;
- case 4: //General
- SF_doBroadcast $@kebc_cost,@map$,"(From "+strcharinfo(0)+") ",1;
- break;
- case 5: //Anonymous
- SF_doBroadcast $@kebc_anonCost,@map$,"(Anonymous) ",1;
- break;
- default:
- return;
- }
- } while (1);
-} //SF_ end
-
-//SubFunction: Calculates prices for Broadcast services (argument 0 == 1 for global bc, 0 for map bc
-function SF_calcPrice {
- set @partycost,callfunc("F_keCost",$@kebc_partyCost,$@kebc_discount);
- set @pvpcost,callfunc("F_keCost",$@kebc_pvpCost,$@kebc_discount);
- set @cost,callfunc("F_keCost",$@kebc_cost,$@kebc_discount);
- set @anoncost,callfunc("F_keCost",$@kebc_anonCost,$@kebc_discount);
- if (getarg(0)) { //Global fix
- set @partycost,@partycost*$@kebc_globalFactor/100;
- set @pvpcost,@pvpcost*$@kebc_globalFactor/100;
- set @cost,@cost*$@kebc_globalFactor/100;
- set @anoncost,@anoncost*$@kebc_globalFactor/100;
- }
-} //SF_ end
-
-//SubFunction SF_doBroadcast(int cost, String map, String message, int input)
-//If map is "", do a global broadcast
-//If input is 1, concat a user string to message.
-function SF_doBroadcast {
- set @cost, getarg(0);
- if (getarg(1)=="")
- set @cost, @cost*$@kebc_globalFactor/100;
- if (getarg(3)) { //Input message
- input @msg$;
- set @msg$,getarg(2)+@msg$;
- } else
- set @msg$,getarg(2);
-
- mes "Broadcast '"+@msg$+"'?";
- switch (select(
- "- Cancel Broadcast",
- "- Broadcast Message"
- )) {
- case 2:
- if (!(callfunc("F_keCharge",@cost,$@kebc_discount,1))) {
- callfunc "F_keIntro", e_pif, "You don't have enough Zeny...";
- return;
- }
-
- callfunc "F_keIntro", e_what, "Broadcasting...";
- if (getarg(1)=="")
- announce @msg$,16;
- else
- mapannounce getarg(1),@msg$,3;
- break;
- default:
- callfunc "F_keIntro", -1, "Ok...";
- }
-} //SF_ end
-
-//SubFunction SF_bcPvp (int cost, String map, int min level, int max level)
-//Does the second part of PvP Room Advertising. Level is the level group to
-//advertise (1->8 where 8 is free for all)
-function SF_bcPvp {
- set @msg$, "advertising";
- set @lvls$, "";
- if (getarg(3)) {
- if (BaseLevel < getarg(2) || BaseLevel > getarg(3)) {
- callfunc "F_keIntro", e_bzz, "You can only broadcast requests for PvP rooms you can enter!";
- return;
- }
- set @msg$,"levels "+getarg(2)+"-"+getarg(3);
- set @lvls$,"(levels "+getarg(2)+"-"+getarg(3)+") ";
- }
- set @pvpcost,getarg(0);
- switch(select(
- "- Cancel (PvP Rooms "+@msg$+")",
- "- advertise 'Room Sandwich'",
- "- advertise 'Room Rock On'",
- "- advertise 'Four Room'",
- "- advertise 'Room Undercross'",
- "- advertise 'Room Compass'"
- )) {
- case 2: //Sandwich
- SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Sandwich'!",0;
- break;
- case 3: //Rockon
- SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Rock On'!",0;
- break;
- case 4: //Room Four
- SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Four Room'!",0;
- break;
- case 5: //Undercross
- SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Undercross'!",0;
- break;
- case 6: //Compass
- SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Compass'!",0;
- break;
- }
-} //SF_ end
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Broadcasting Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 3.0 +//===== Compatible With: ===================================== +//= eAthena SVN3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers broadcasting for party requests, pvp, general +//= and anonymous. Broadcasts can be to the current map +//= or server-wide +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//= For the PVP broadcasts, variables from the Pvp Warping +//= Module are used. +//============================================================ + +- script keInit_broadcast -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadBroadcast"; + end; +} + +//Function F_keBroadcast(String currentMapName) +function script F_keBroadcast { + + function SF_calcPrice; + function SF_broadcasts; + function SF_bcPvp; + function SF_doBroadcast; + + if ($@kebc_showOnline) { + set @kmenu, select( + "- Return", + "- Map Broadcasts ("+getarg(0)+"/"+getmapusers(getarg(0))+" "+$@ked_users$+")", + "- Global Broadcasts ("+getusers(1)+" "+$@ked_users$+")" + ); + } else { + set @kmenu, select( + "- Return", + "- Map Broadcasts ("+getarg(0)+")", + "- Global Broadcasts" + ); + } + switch(@kmenu) { + case 2: + SF_calcPrice(0); + set @map$,getarg(0); + SF_broadcasts("Map ("+getarg(0)+")"); + break; + case 3: + SF_calcPrice(1); + set @map$,""; + SF_broadcasts("Global"); + break; + } +return; + +//Sub Function SF_broadcasts: Handles main broadcast menu. +function SF_broadcasts { + + do { + switch (select ( + "- Cancel "+getarg(0)+" Broadcast", + "- Party request Broadcast ("+@partycost+"z)", + "- PvP challenge Broadcast ("+@pvpcost+"z)", + "- General Broadcast ("+@cost+"z)", + "- General Anonymous Broadcast ("+@anoncost+"z)" + )) { + case 2: //Party + SF_doBroadcast $@kebc_partyCost,@map$,"The "+callfunc("GF_getJobName",class)+" "+strcharinfo(0)+" (levels "+baselevel+"/"+joblevel+") is looking for a party to join.",0; + break; + case 3: //Pvp + if ($@kewp_advanced == 0) + SF_bcPvp $@kebc_pvpCost,@map$,0,0; + else { + do { + set @kmenu, select ( + "- Cancel", + "- advertise all levels rooms", + "- advertise levels "+($@kewp_baseLv1-$@kewp_range)+"-"+($@kewp_baseLv1+$@kewp_range)+" rooms", + "- advertise levels "+($@kewp_baseLv2-$@kewp_range)+"-"+($@kewp_baseLv2+$@kewp_range)+" rooms", + "- advertise levels "+($@kewp_baseLv3-$@kewp_range)+"-"+($@kewp_baseLv3+$@kewp_range)+" rooms", + "- advertise levels "+($@kewp_baseLv4-$@kewp_range)+"-"+($@kewp_baseLv4+$@kewp_range)+" rooms", + "- advertise levels "+($@kewp_baseLv5-$@kewp_range)+"-"+($@kewp_baseLv5+$@kewp_range)+" rooms", + "- advertise levels "+($@kewp_baseLv6-$@kewp_range)+"-"+($@kewp_baseLv6+$@kewp_range)+" rooms", + "- advertise levels "+($@kewp_baseLv7-$@kewp_range)+"-"+($@kewp_baseLv7+$@kewp_range)+" rooms" + ); + switch (@kmenu) { + case 2: //All levels + SF_bcPvp $@kebc_pvpCost,@map$,0,0; + break; + case 3: //Lv1 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv1-$@kewp_range,$@kewp_baseLv1+$@kewp_range; + break; + case 4: //Lv2 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv2-$@kewp_range,$@kewp_baseLv2+$@kewp_range; + break; + case 5: //Lv3 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv3-$@kewp_range,$@kewp_baseLv3+$@kewp_range; + break; + case 6: //Lv4 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv4-$@kewp_range,$@kewp_baseLv4+$@kewp_range; + break; + case 7: //Lv5 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv5-$@kewp_range,$@kewp_baseLv5+$@kewp_range; + break; + case 8: //Lv6 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv6-$@kewp_range,$@kewp_baseLv6+$@kewp_range; + break; + case 9: //Lv7 + SF_bcPvp $@kebc_pvpCost,@map$,$@kewp_baseLv7-$@kewp_range,$@kewp_baseLv7+$@kewp_range; + break; + default: + break; + } + } while (@kmenu > 1); + } + break; + case 4: //General + SF_doBroadcast $@kebc_cost,@map$,"(From "+strcharinfo(0)+") ",1; + break; + case 5: //Anonymous + SF_doBroadcast $@kebc_anonCost,@map$,"(Anonymous) ",1; + break; + default: + return; + } + } while (1); +} //SF_ end + +//SubFunction: Calculates prices for Broadcast services (argument 0 == 1 for global bc, 0 for map bc +function SF_calcPrice { + set @partycost,callfunc("F_keCost",$@kebc_partyCost,$@kebc_discount); + set @pvpcost,callfunc("F_keCost",$@kebc_pvpCost,$@kebc_discount); + set @cost,callfunc("F_keCost",$@kebc_cost,$@kebc_discount); + set @anoncost,callfunc("F_keCost",$@kebc_anonCost,$@kebc_discount); + if (getarg(0)) { //Global fix + set @partycost,@partycost*$@kebc_globalFactor/100; + set @pvpcost,@pvpcost*$@kebc_globalFactor/100; + set @cost,@cost*$@kebc_globalFactor/100; + set @anoncost,@anoncost*$@kebc_globalFactor/100; + } +} //SF_ end + +//SubFunction SF_doBroadcast(int cost, String map, String message, int input) +//If map is "", do a global broadcast +//If input is 1, concat a user string to message. +function SF_doBroadcast { + set @cost, getarg(0); + if (getarg(1)=="") + set @cost, @cost*$@kebc_globalFactor/100; + if (getarg(3)) { //Input message + input @msg$; + set @msg$,getarg(2)+@msg$; + } else + set @msg$,getarg(2); + + mes "Broadcast '"+@msg$+"'?"; + switch (select( + "- Cancel Broadcast", + "- Broadcast Message" + )) { + case 2: + if (!(callfunc("F_keCharge",@cost,$@kebc_discount,1))) { + callfunc "F_keIntro", e_pif, "You don't have enough Zeny..."; + return; + } + + callfunc "F_keIntro", e_what, "Broadcasting..."; + if (getarg(1)=="") + announce @msg$,16; + else + mapannounce getarg(1),@msg$,3; + break; + default: + callfunc "F_keIntro", -1, "Ok..."; + } +} //SF_ end + +//SubFunction SF_bcPvp (int cost, String map, int min level, int max level) +//Does the second part of PvP Room Advertising. Level is the level group to +//advertise (1->8 where 8 is free for all) +function SF_bcPvp { + set @msg$, "advertising"; + set @lvls$, ""; + if (getarg(3)) { + if (BaseLevel < getarg(2) || BaseLevel > getarg(3)) { + callfunc "F_keIntro", e_bzz, "You can only broadcast requests for PvP rooms you can enter!"; + return; + } + set @msg$,"levels "+getarg(2)+"-"+getarg(3); + set @lvls$,"(levels "+getarg(2)+"-"+getarg(3)+") "; + } + set @pvpcost,getarg(0); + switch(select( + "- Cancel (PvP Rooms "+@msg$+")", + "- advertise 'Room Sandwich'", + "- advertise 'Room Rock On'", + "- advertise 'Four Room'", + "- advertise 'Room Undercross'", + "- advertise 'Room Compass'" + )) { + case 2: //Sandwich + SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Sandwich'!",0; + break; + case 3: //Rockon + SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Rock On'!",0; + break; + case 4: //Room Four + SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Four Room'!",0; + break; + case 5: //Undercross + SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Undercross'!",0; + break; + case 6: //Compass + SF_doBroadcast @pvpcost,@map$,"The "+callfunc("GF_getJobName", class)+" "+strcharinfo(0)+" is looking for PvP challengers "+@lvls$+"in the 'Room Compass'!",0; + break; + } +} //SF_ end + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt index bcd916b21..735ef5465 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_dye.txt @@ -1,139 +1,139 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Stylist Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 1.9
-//===== Compatible With: =====================================
-//= eAthena SVN 3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers dying of hair, clothes and hair-style adjusts
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_dye -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadDye";
- end;
-}
-
-function script F_keStylist {
-
- function SF_inputpalette;
- function SF_wheelpalette;
-
- set @jobClass,callfunc("GF_getJobLevel",class);
- set @maxCDye,0;
-
- switch (@jobClass) {
- case 0:
- set @maxCDye, $@kedy_clothJN;
- break;
- case 1:
- set @maxCDye, $@kedy_clothJ1ST;
- break;
- case 2:
- set @maxCDye, $@kedy_clothJ2ND;
- break;
- case 3:
- set @maxCDye, $@kedy_clothJSN;
- break;
- case 4:
- set @maxCDye, $@kedy_clothJWED;
- break;
- }
- do {
- if ($@kedy_enableHairstyle) {
- set @kmenu, select(
- "- Return",
- "- Change hairstyle (current is "+getlook(1)+"/max is "+$@kedy_styles+")",
- "- Change hairstyle (by wheel)",
- "- Dye hair (current is "+getlook(6)+"/max is "+$@kedy_hair+")",
- "- Dye hair (by wheel)",
- "- Dye clothes (current is "+getlook(7)+"/max is "+@maxCDye+")",
- "- Dye clothes (by wheel)"
- );
- } else {
- set @kmenu, select(
- "- Return",
- "- Dye hair (current is "+getlook(6)+"/max is "+$@kedy_hair+")",
- "- Dye hair (by wheel)",
- "- Dye clothes (current is "+getlook(7)+"/max is "+@maxCDye+")",
- "- Dye clothes (by wheel)"
- );
- if (@kmenu > 1)
- set @kmenu, @kmenu+2;
- }
- switch (@kmenu) {
- case 2: //Hair Style Input
- SF_inputpalette 1,$@kedy_styles;
- break;
- case 3: //Hair Style Wheel
- SF_wheelpalette 1,$@kedy_styles;
- break;
- case 4: //Hair Dye Input
- SF_inputpalette 6,$@kedy_hair;
- break;
- case 5: //Hair Dye Wheel
- SF_wheelpalette 6,$@kedy_hair;
- break;
- case 6: //Clothes Input
- SF_inputpalette 7,@maxCDye;
- break;
- case 7: //Clothes Wheel
- SF_wheelpalette 7,@maxCDye ;
- break;
- }
- } while (@kmenu > 1);
- return;
-
-//Subfunction: SF_inputpalette(int part, int maxPalette)
-//Sets a palette from the user's request.
-function SF_inputpalette {
- input @pal;
- if (@pal < 0 || @pal > getarg(1)) {
- callfunc "F_keIntro", e_swt2, "Sorry, we do not have that dye available.";
- return;
- }
- setlook getarg(0),@pal;
- emotion e_lv;
-} //SF_ end
-
-//Subfunction: SF_wheelpalette(int part, int maxPalette)
-//Sets a palette through browsing.
-function SF_wheelpalette {
- set @loc, getarg(0);
- set @max, getarg(1);
- set @pal, getlook(@loc);
- set @dir, 1;
- do {
- if (@dir > 0)
- set @submenu, select(
- "Next",
- "Previous",
- "Done (current is "+@pal+")"
- );
- else
- set @submenu, select(
- "Previous",
- "Next",
- "Done (current is "+@pal+")"
- );
- switch (@submenu) {
- case 2: //Swap direction
- set @dir, @dir*-1;
- case 1:
- set @pal, @pal+@dir;
- if (@pal < 0)
- set @pal, @max;
- else if (@pal > @max)
- set @pal, 0;
- setlook @loc,@pal;
- }
- } while (@submenu != 3);
- emotion e_lv2;
-} //SF_ end
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Stylist Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 1.9 +//===== Compatible With: ===================================== +//= eAthena SVN 3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers dying of hair, clothes and hair-style adjusts +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_dye -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadDye"; + end; +} + +function script F_keStylist { + + function SF_inputpalette; + function SF_wheelpalette; + + set @jobClass,callfunc("GF_getJobLevel",class); + set @maxCDye,0; + + switch (@jobClass) { + case 0: + set @maxCDye, $@kedy_clothJN; + break; + case 1: + set @maxCDye, $@kedy_clothJ1ST; + break; + case 2: + set @maxCDye, $@kedy_clothJ2ND; + break; + case 3: + set @maxCDye, $@kedy_clothJSN; + break; + case 4: + set @maxCDye, $@kedy_clothJWED; + break; + } + do { + if ($@kedy_enableHairstyle) { + set @kmenu, select( + "- Return", + "- Change hairstyle (current is "+getlook(1)+"/max is "+$@kedy_styles+")", + "- Change hairstyle (by wheel)", + "- Dye hair (current is "+getlook(6)+"/max is "+$@kedy_hair+")", + "- Dye hair (by wheel)", + "- Dye clothes (current is "+getlook(7)+"/max is "+@maxCDye+")", + "- Dye clothes (by wheel)" + ); + } else { + set @kmenu, select( + "- Return", + "- Dye hair (current is "+getlook(6)+"/max is "+$@kedy_hair+")", + "- Dye hair (by wheel)", + "- Dye clothes (current is "+getlook(7)+"/max is "+@maxCDye+")", + "- Dye clothes (by wheel)" + ); + if (@kmenu > 1) + set @kmenu, @kmenu+2; + } + switch (@kmenu) { + case 2: //Hair Style Input + SF_inputpalette 1,$@kedy_styles; + break; + case 3: //Hair Style Wheel + SF_wheelpalette 1,$@kedy_styles; + break; + case 4: //Hair Dye Input + SF_inputpalette 6,$@kedy_hair; + break; + case 5: //Hair Dye Wheel + SF_wheelpalette 6,$@kedy_hair; + break; + case 6: //Clothes Input + SF_inputpalette 7,@maxCDye; + break; + case 7: //Clothes Wheel + SF_wheelpalette 7,@maxCDye ; + break; + } + } while (@kmenu > 1); + return; + +//Subfunction: SF_inputpalette(int part, int maxPalette) +//Sets a palette from the user's request. +function SF_inputpalette { + input @pal; + if (@pal < 0 || @pal > getarg(1)) { + callfunc "F_keIntro", e_swt2, "Sorry, we do not have that dye available."; + return; + } + setlook getarg(0),@pal; + emotion e_lv; +} //SF_ end + +//Subfunction: SF_wheelpalette(int part, int maxPalette) +//Sets a palette through browsing. +function SF_wheelpalette { + set @loc, getarg(0); + set @max, getarg(1); + set @pal, getlook(@loc); + set @dir, 1; + do { + if (@dir > 0) + set @submenu, select( + "Next", + "Previous", + "Done (current is "+@pal+")" + ); + else + set @submenu, select( + "Previous", + "Next", + "Done (current is "+@pal+")" + ); + switch (@submenu) { + case 2: //Swap direction + set @dir, @dir*-1; + case 1: + set @pal, @pal+@dir; + if (@pal < 0) + set @pal, @max; + else if (@pal > @max) + set @pal, 0; + setlook @loc,@pal; + } + } while (@submenu != 3); + emotion e_lv2; +} //SF_ end + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_jobchange.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_jobchange.txt index 0093fe2ae..766918fd0 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_jobchange.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_jobchange.txt @@ -1,533 +1,533 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Job Changing Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 3.5
-//===== Compatible With: =====================================
-//= eAthena SVN R3579+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Enables job changing through the class trees.
-//= Novice -> 1st Class, 1st Class -> 2nd Class, rebirths, etc
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//= When using Upper Job policy, previous jobs are stored in
-//= the server wide variables kej_class1 and kej_class2
-//============================================================
-
-- script keInit_jobchange -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadJobChange";
- end;
-}
-
-function script F_keJobChange {
-
- function SF_to1stJob;
- function SF_to2ndJob;
- function SF_getJobNames;
- function SF_testChangeJob;
- function SF_changeJob;
-
- set @job, callfunc("GF_getJobLevel", class);
- set @upper, Upper; //Because it is changed when rebirthing
- set @reset, 0; //Base Level is reset only on rebirths
- switch (@job) {
- case 0: //Novices
- if ($@kejc_skipNovice)
- set @jobLv, 0; //jobLv is used again when checking for S.Novice's base level restriction.
- else
- set @jobLv, 10;
- if (SF_testChangeJob(0,0,@jobLv))
- SF_to1stJob(0);
- break;
- case 1: //First Classes
- if (SF_testChangeJob($@kejc_cost2ND,$@kejc_base2ND,$@kejc_job2ND))
- SF_to2ndJob();
- break;
- case 2: //Second Classes
- if (Upper == 0 && BaseClass != Job_Taekwon) {
- if (SF_testChangeJob($@kejc_costRebirth,$@kejc_baseRebirth,$@kejc_jobRebirth)) {
- set @upper, 1;
- if ($@kejc_skipNovice)
- SF_to1stJob(1);
- else
- SF_changeJob @job,Upper,Job_Novice,1,0,0,$@kejc_costRebirth,1,$@kejc_rebirthReset;
- }
- break;
- }
- default: //Dead End
- callfunc "F_keIntro", e_swt2, "I cannot change you from your current job.";
- break;
- }
- return;
-
-//Handles changing to 1st job.
-function SF_to1stJob {
- do {
- set @submenu, 1;
- if (@upper == 1 && $@kejc_upperPolicy && kej_class1) {
- switch (kej_class1) {
- case Job_Acolyte:
- set @submenu, 2;
- break;
- case Job_Archer:
- set @submenu, 3;
- break;
- case Job_Mage:
- set @submenu, 4;
- break;
- case Job_Merchant:
- set @submenu, 5;
- break;
- case Job_Swordman:
- set @submenu, 6;
- break;
- case Job_Thief:
- set @submenu, 7;
- break;
- case Job_Taekwon:
- set @submenu, 8;
- break;
- }
- }
- if (@submenu == 1) {
- SF_getJobNames 8,Job_Acolyte,Job_Archer,Job_Mage,Job_Merchant,Job_Swordman,Job_Thief,Job_Taekwon,Job_SuperNovice;
- switch (@upper) {
- case 0: //All
- set @submenu, select(
- "- Cancel job change",
- "- "+@name1$,
- "- "+@name2$,
- "- "+@name3$,
- "- "+@name4$,
- "- "+@name5$,
- "- "+@name6$,
- "- "+@name7$,
- "- "+@name8$
- );
- break;
- case 1: //No Taekwon/S.Novice
- set @submenu, select(
- "- Cancel job change",
- "- "+@name1$,
- "- "+@name2$,
- "- "+@name3$,
- "- "+@name4$,
- "- "+@name5$,
- "- "+@name6$
- );
- break;
- case 2: //No Taekwon
- set @submenu, select(
- "- Cancel job change",
- "- "+@name1$,
- "- "+@name2$,
- "- "+@name3$,
- "- "+@name4$,
- "- "+@name5$,
- "- "+@name6$,
- "- "+@name8$
- );
- if (@submenu == 8)
- set @submenu, 9;
- break;
- }
- }
- switch (@submenu) {
- case 2: //Acolyte
- set @newJob,Job_Acolyte;
- set @weapon, $@kejc_wAcolyte;
- break;
- case 3: //Archer
- set @newJob,Job_Archer;
- set @weapon, $@kejc_wArcher;
- break;
- case 4: //Mage
- set @newJob,Job_Mage;
- set @weapon, $@kejc_wMage;
- break;
- case 5: //Merchant
- set @newJob,Job_Merchant;
- set @weapon, $@kejc_wMerchant;
- break;
- case 6: //Swordman
- set @newJob,Job_Swordman;
- set @weapon, $@kejc_wSwordman;
- break;
- case 7: //Thief
- set @newJob,Job_Thief;
- set @weapon, $@kejc_wThief;
- break;
- case 8: //Taekwon
- set @newJob,Job_Taekwon;
- set @weapon, $@kejc_wTaekwon;
- break;
- case 9: //S. Novice
- set @newJob,Job_SuperNovice;
- set @weapon, $@kejc_wSuperNovice;
- if (SF_testChangeJob(0,$@kejc_baseSN,@jobLv) == 0)
- return;
- break;
- }
- if (@submenu > 1) {
- if (getarg(0)) { //Skipping High Novice, charge rebirth costs.
- if (SF_changeJob(@job,Upper,@newJob,1,@weapon,0,$@kejc_costRebirth,2,$@kejc_rebirthReset))
- return;
- } else {
- if (SF_changeJob(@job,Upper,@newJob,@upper,@weapon,0,0,2,0))
- return;
- }
- }
- } while (@submenu > 1);
-}
-
-function SF_to2ndJob {
- do {
- set @submenu, 1;
- if (@upper == 1 && $@kejc_upperPolicy && kej_class2) {
- switch (kej_class2) {
- case Job_Priest:
- case Job_Hunter:
- case Job_Wizard:
- case Job_Blacksmith:
- case Job_Knight:
- case Job_Knight2:
- case Job_Assassin:
- case Job_Star_Gladiator:
- case Job_Star_Gladiator2:
- set @submenu, 2;
- break;
- case Job_Monk:
- case Job_Bard:
- case Job_Dancer:
- case Job_Sage:
- case Job_Alchem:
- case Job_Crusader:
- case Job_Crusader2:
- case Job_Rogue:
- case Job_Soul_Linker:
- set @submenu, 3;
- break;
- }
- }
- if (@submenu == 1) { //Fetch from menu.
- switch (BaseClass) {
- case Job_Acolyte:
- SF_getJobNames 2,Job_Priest,Job_Monk;
- break;
- case Job_Archer:
- SF_getJobNames 3,Job_Hunter,Job_Bard,Job_Dancer;
- if (sex == 0)
- set @name2$, @name3$;
- break;
- case Job_Mage:
- SF_getJobNames 2,Job_Wizard,Job_Sage;
- break;
- case Job_Merchant:
- SF_getJobNames 2,Job_Blacksmith,Job_Alchem;
- break;
- case Job_Swordman:
- SF_getJobNames 2,Job_Knight,Job_Crusader;
- break;
- case Job_Thief:
- SF_getJobNames 2,Job_Assassin,Job_Rogue;
- break;
- case Job_Taekwon:
- SF_getJobNames 2,Job_Star_Gladiator,Job_Soul_Linker;
- break;
- default:
- callfunc "F_keIntro", e_swt2, "I don't know how to change you from your current job.";
- return;
- }
- set @submenu, select(
- "- Cancel job change",
- "- "+@name1$,
- "- "+@name2$
- );
- }
- switch (BaseClass) {
- case Job_Acolyte:
- switch (@submenu) {
- case 2: //Priest
- set @newJob,Job_Priest;
- set @weapon,$@kejc_wPriest;
- set @weapon2,$@kejc_w2Priest;
- break;
- case 3: //Monk
- set @newJob,Job_Monk;
- set @weapon,$@kejc_wMonk;
- set @weapon2,$@kejc_w2Monk;
- break;
- }
- break;
- case Job_Archer:
- switch (@submenu) {
- case 2: //Hunter
- set @newJob,Job_Hunter;
- set @weapon,$@kejc_wHunter;
- set @weapon2,$@kejc_w2Hunter;
- break;
- case 3: //Bard/Dancer
- if (sex == 1) { //Bard
- set @newJob,Job_Bard;
- set @weapon,$@kejc_wBard;
- set @weapon2,$@kejc_w2Bard;
- } else { //Dancer
- set @newJob,Job_Dancer;
- set @weapon,$@kejc_wDancer;
- set @weapon2,$@kejc_w2Dancer;
- }
- break;
- }
- break;
- case Job_Mage:
- switch (@submenu) {
- case 2: //Wizard
- set @newJob,Job_Wizard;
- set @weapon,$@kejc_wWizard;
- set @weapon2,$@kejc_w2Wizard;
- break;
- case 3: //Sage
- set @newJob,Job_Sage;
- set @weapon,$@kejc_wSage;
- set @weapon2,$@kejc_w2Sage;
- break;
- }
- break;
- case Job_Merchant:
- switch (@submenu) {
- case 2: //Blacksmith
- set @newJob,Job_Blacksmith;
- set @weapon,$@kejc_wBlacksmith;
- set @weapon2,$@kejc_w2Blacksmith;
- break;
- case 3: //Alchemist
- set @newJob,Job_Alchem;
- set @weapon,$@kejc_wAlchemist;
- set @weapon2,$@kejc_w2Alchemist;
- break;
- }
- break;
- case Job_Swordman:
- switch (@submenu) {
- case 2: //Knight
- set @newJob,Job_Knight;
- set @weapon,$@kejc_wKnight;
- set @weapon2,$@kejc_w2Knight;
- break;
- case 3: //Crusader
- set @newJob,Job_Crusader;
- set @weapon,$@kejc_wCrusader;
- set @weapon2,$@kejc_w2Crusader;
- break;
- default:
- mes "uh oh";
- break;
- }
- break;
- case Job_Thief:
- switch (@submenu) {
- case 2: //Assassin
- set @newJob,Job_Assassin;
- set @weapon,$@kejc_wAssassin;
- set @weapon2,$@kejc_w2Assassin;
- break;
- case 3: //Rogue
- set @newJob,Job_Rogue;
- set @weapon,$@kejc_wRogue;
- set @weapon2,$@kejc_w2Rogue;
- break;
- }
- break;
- case Job_Taekwon:
- switch (@submenu) {
- case 2: //Star Gladiator
- set @newJob,Job_Star_Gladiator;
- set @weapon,$@kejc_wStarGladiator;
- set @weapon2,$@kejc_w2StarGladiator;
- break;
- case 3: //Soul Linker
- set @newJob,Job_Soul_Linker;
- set @weapon,$@kejc_wSoulLinker;
- set @weapon2,$@kejc_w2SoulLinker;
- break;
- }
- break;
- }
- if (@submenu > 1) {
- if (SF_changeJob(@job,Upper,@newJob,@upper,@weapon,@weapon2,$@kejc_cost2ND,0,0))
- return;
- }
- } while (@submenu > 1);
-}
-
-//SubFunction: SF_testChangeJob(Zeny, BaseLv, JobLv)
-//Function that checks if the player qualifies for job changing.
-function SF_testChangeJob {
- set @fail, 0;
- if (Zeny < getarg(0))
- set @fail, 1;
- if (BaseLevel < getarg(1))
- set @fail, @fail+2;
- if (JobLevel < getarg(2))
- set @fail, @fail+4;
- if (@fail > 0) {
- if (@fail&1)
- mes "You need "+getarg(0)+"z for the conversion process.";
- if (@fail&2)
- mes "You need to be at least Lv "+getarg(1)+".";
- if (@fail&4)
- mes "You need at least job Lv "+getarg(2)+".";
- callfunc "F_keIntro", e_pif, "Sorry, you don't qualify for a job change yet.";
- return 0;
- }
-
- if (SkillPoint > 0 && $@kejc_skillsPolicy == 0) {
- callfunc "F_keIntro", e_dots, "Sorry, use your remaining Skill points before being able to change class.";
- return 0;
- }
- return 1;
-}
-
-//SubFunction: SF_changeJob (CurrentJobLv, CurrentJobType, NewJobBase, NewJobType
-//Weapon, Weapon2, Zeny, WipeSkills, ResetLv)
-//Attempts to change to the Jobgiven.
-//CurrentJobLv is 0-3 (novice, 1st class, 2nd class, s.novice)
-//Type is 0-2 (Normal, Advanced Class, Baby)
-//Weapon is the ID of the weapon to grant
-//Weapon2 is the alternative weapon granted when your job level is above $@kejc_wBonusLv
-//Zeny is the money required (if negative, it is money awarded)
-//WipeSkills if 1, indicates that skills should be wiped,
-//if 2, it means basic skills have to be given back
-//Reset Level indicates the base lv must be reset to 1.
-//Note: Zeny/Base/Job requirements should had been checked with SF_testChangeJob already!
-function SF_changeJob {
- set @newjob,getarg(2);
- set @newtype,getarg(3);
- set @weapon,getarg(4);
- set @weapon2,getarg(5);
- set @cost,getarg(6);
- set @wipeSkill,getarg(7);
- set @resetLv,getarg(8);
-
- set @jobStr$, callfunc("GF_getJobName2",@newjob, @newtype);
- if (@wipeSkill == 0 && SkillPoint > 0 && $@kejc_skillsPolicy == 1) {
- set @selection, select(
- "- Do not change yet",
- "- Change to "+@jobStr$+" (skill points lost)",
- "- View details"
- );
- } else {
- set @selection, select(
- "- Cancel",
- "- Change to "+@jobStr$,
- "- View details"
- );
- }
- switch (@selection) {
- case 3: //Details
- mes "Okay.. listen up:";
- next;
- mes "["+@name$+"]";
- mes "Changing to "+@jobStr$+" now means:";
- if (@wipeSkill == 0 && SkillPoint > 0 && $@kejc_skillsPolicy == 1)
- mes "- You will lose your "+SkillPoint+" unused skill points.";
- else if (@wipeSkill == 1)
- mes "- You will lose all your skills.";
- if (@resetLv)
- mes "- Your base level will be reset to 1.";
- if (@cost > 0)
- mes "- You will be charged "+@cost+"z.";
- else if (@cost < 0)
- mes "- You will be aided with "+(0-@cost)+"z.";
- if (@weapon > 0) {
- if (@weapon2 > 0 && $@kejc_wBonusLv) {
- if (JobLevel < $@kejc_wBonusLv) {
- mes "- You will receive a "+getitemname(@weapon)+"["+getitemslots(@weapon)+"].";
- mes "- If you wait until Job Lv"+$@kejc_wBonusLv+", you can receive instead a "+getitemname(@weapon2)+"["+getitemslots(@weapon)+"].";
- } else {
- mes "- You will receive a "+getitemname(@weapon2)+"["+getitemslots(@weapon)+"] for reaching Job Lv"+$@kejc_wBonusLv+".";
- }
- } else
- mes "- You will receive a "+getitemname(@weapon)+".";
- }
- mes "So... will you change?";
- if (select(
- "- Cancel",
- "- Change to "+@jobStr$
- ) != 2) {
- callfunc "F_keIntro", e_dots, "...alright.";
- return 0;
- }
- callfunc "F_keIntro", -1, "Enjoy your new Job.";
- case 2: //Change
- //Set/Unset job path variables as needed.
- if($@kejc_upperPolicy) {
- set @class,getarg(0);
- set @type, getarg(1);
- if(@class == 1 && @type == 0)
- set kej_class1,class; //Advancing to second class, so...
- if(@class == 2)
- set kej_class2,class; //Only way of being here is by doing a rebirth
- if(@type > 0)
- set kej_class1,0; //Clear when one is a high class
- if(@type > 0 && @class == 1)
- set kej_class2,0; //Clear when leaving high 1st class
- }
- if (@resetLv) {
- jobchange Job_Novice_High; //Done to give players those 100 points from High classes
- resetlvl(1);
- }
- if (@wipeSkill) {
- resetskill;
- setoption(0);
- set SkillPoint,0;
- } else if ($@kejc_skillsPolicy == 1)
- set SkillPoint,0;
- if (@wipeSkill>1)
- skill 1,9,0;
- if($@kejc_resetDye)
- setlook 7,0;
- jobchange @newjob, @newtype;
- if ($@kejc_announce)
- announce strcharinfo(0)+" has been promoted to "+@jobStr$+"!",8;
- set Zeny,Zeny-@cost;
- if ($@kejc_weaponPolicy && @weapon > 0) {
- if ($@kejc_wBonusLv && @weapon2 > 0) {
- if (JobLevel < $@kejc_wBonusLv)
- getitem @weapon,1;
- else
- getitem @weapon2,1;
- } else
- getitem @weapon,1;
- }
- emotion e_grat;
- return 1;
- default: //Cancel...
- callfunc "F_keIntro", e_dots, "...alright.";
- return 0;
- }
-}
-//SubFunction: SF_getJobNames(Qty, Jobid1, Jobid2,...)
-//Workaround until eA gets a fix for the bug where you can't use callfunc or
-//callsub within a menu
-function SF_getJobNames {
- switch (getarg(0)) {
- case 8:
- set @name8$, callfunc("GF_getJobName2",getarg(8),@upper);
- set @name7$, callfunc("GF_getJobName2",getarg(7),@upper);
- set @name6$, callfunc("GF_getJobName2",getarg(6),@upper);
- set @name5$, callfunc("GF_getJobName2",getarg(5),@upper);
- set @name4$, callfunc("GF_getJobName2",getarg(4),@upper);
- case 3:
- set @name3$, callfunc("GF_getJobName2",getarg(3),@upper);
- case 2:
- set @name2$, callfunc("GF_getJobName2",getarg(2),@upper);
- set @name1$, callfunc("GF_getJobName2",getarg(1),@upper);
- }
- return;
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Job Changing Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 3.5 +//===== Compatible With: ===================================== +//= eAthena SVN R3579+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Enables job changing through the class trees. +//= Novice -> 1st Class, 1st Class -> 2nd Class, rebirths, etc +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//= When using Upper Job policy, previous jobs are stored in +//= the server wide variables kej_class1 and kej_class2 +//============================================================ + +- script keInit_jobchange -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadJobChange"; + end; +} + +function script F_keJobChange { + + function SF_to1stJob; + function SF_to2ndJob; + function SF_getJobNames; + function SF_testChangeJob; + function SF_changeJob; + + set @job, callfunc("GF_getJobLevel", class); + set @upper, Upper; //Because it is changed when rebirthing + set @reset, 0; //Base Level is reset only on rebirths + switch (@job) { + case 0: //Novices + if ($@kejc_skipNovice) + set @jobLv, 0; //jobLv is used again when checking for S.Novice's base level restriction. + else + set @jobLv, 10; + if (SF_testChangeJob(0,0,@jobLv)) + SF_to1stJob(0); + break; + case 1: //First Classes + if (SF_testChangeJob($@kejc_cost2ND,$@kejc_base2ND,$@kejc_job2ND)) + SF_to2ndJob(); + break; + case 2: //Second Classes + if (Upper == 0 && BaseClass != Job_Taekwon) { + if (SF_testChangeJob($@kejc_costRebirth,$@kejc_baseRebirth,$@kejc_jobRebirth)) { + set @upper, 1; + if ($@kejc_skipNovice) + SF_to1stJob(1); + else + SF_changeJob @job,Upper,Job_Novice,1,0,0,$@kejc_costRebirth,1,$@kejc_rebirthReset; + } + break; + } + default: //Dead End + callfunc "F_keIntro", e_swt2, "I cannot change you from your current job."; + break; + } + return; + +//Handles changing to 1st job. +function SF_to1stJob { + do { + set @submenu, 1; + if (@upper == 1 && $@kejc_upperPolicy && kej_class1) { + switch (kej_class1) { + case Job_Acolyte: + set @submenu, 2; + break; + case Job_Archer: + set @submenu, 3; + break; + case Job_Mage: + set @submenu, 4; + break; + case Job_Merchant: + set @submenu, 5; + break; + case Job_Swordman: + set @submenu, 6; + break; + case Job_Thief: + set @submenu, 7; + break; + case Job_Taekwon: + set @submenu, 8; + break; + } + } + if (@submenu == 1) { + SF_getJobNames 8,Job_Acolyte,Job_Archer,Job_Mage,Job_Merchant,Job_Swordman,Job_Thief,Job_Taekwon,Job_SuperNovice; + switch (@upper) { + case 0: //All + set @submenu, select( + "- Cancel job change", + "- "+@name1$, + "- "+@name2$, + "- "+@name3$, + "- "+@name4$, + "- "+@name5$, + "- "+@name6$, + "- "+@name7$, + "- "+@name8$ + ); + break; + case 1: //No Taekwon/S.Novice + set @submenu, select( + "- Cancel job change", + "- "+@name1$, + "- "+@name2$, + "- "+@name3$, + "- "+@name4$, + "- "+@name5$, + "- "+@name6$ + ); + break; + case 2: //No Taekwon + set @submenu, select( + "- Cancel job change", + "- "+@name1$, + "- "+@name2$, + "- "+@name3$, + "- "+@name4$, + "- "+@name5$, + "- "+@name6$, + "- "+@name8$ + ); + if (@submenu == 8) + set @submenu, 9; + break; + } + } + switch (@submenu) { + case 2: //Acolyte + set @newJob,Job_Acolyte; + set @weapon, $@kejc_wAcolyte; + break; + case 3: //Archer + set @newJob,Job_Archer; + set @weapon, $@kejc_wArcher; + break; + case 4: //Mage + set @newJob,Job_Mage; + set @weapon, $@kejc_wMage; + break; + case 5: //Merchant + set @newJob,Job_Merchant; + set @weapon, $@kejc_wMerchant; + break; + case 6: //Swordman + set @newJob,Job_Swordman; + set @weapon, $@kejc_wSwordman; + break; + case 7: //Thief + set @newJob,Job_Thief; + set @weapon, $@kejc_wThief; + break; + case 8: //Taekwon + set @newJob,Job_Taekwon; + set @weapon, $@kejc_wTaekwon; + break; + case 9: //S. Novice + set @newJob,Job_SuperNovice; + set @weapon, $@kejc_wSuperNovice; + if (SF_testChangeJob(0,$@kejc_baseSN,@jobLv) == 0) + return; + break; + } + if (@submenu > 1) { + if (getarg(0)) { //Skipping High Novice, charge rebirth costs. + if (SF_changeJob(@job,Upper,@newJob,1,@weapon,0,$@kejc_costRebirth,2,$@kejc_rebirthReset)) + return; + } else { + if (SF_changeJob(@job,Upper,@newJob,@upper,@weapon,0,0,2,0)) + return; + } + } + } while (@submenu > 1); +} + +function SF_to2ndJob { + do { + set @submenu, 1; + if (@upper == 1 && $@kejc_upperPolicy && kej_class2) { + switch (kej_class2) { + case Job_Priest: + case Job_Hunter: + case Job_Wizard: + case Job_Blacksmith: + case Job_Knight: + case Job_Knight2: + case Job_Assassin: + case Job_Star_Gladiator: + case Job_Star_Gladiator2: + set @submenu, 2; + break; + case Job_Monk: + case Job_Bard: + case Job_Dancer: + case Job_Sage: + case Job_Alchem: + case Job_Crusader: + case Job_Crusader2: + case Job_Rogue: + case Job_Soul_Linker: + set @submenu, 3; + break; + } + } + if (@submenu == 1) { //Fetch from menu. + switch (BaseClass) { + case Job_Acolyte: + SF_getJobNames 2,Job_Priest,Job_Monk; + break; + case Job_Archer: + SF_getJobNames 3,Job_Hunter,Job_Bard,Job_Dancer; + if (sex == 0) + set @name2$, @name3$; + break; + case Job_Mage: + SF_getJobNames 2,Job_Wizard,Job_Sage; + break; + case Job_Merchant: + SF_getJobNames 2,Job_Blacksmith,Job_Alchem; + break; + case Job_Swordman: + SF_getJobNames 2,Job_Knight,Job_Crusader; + break; + case Job_Thief: + SF_getJobNames 2,Job_Assassin,Job_Rogue; + break; + case Job_Taekwon: + SF_getJobNames 2,Job_Star_Gladiator,Job_Soul_Linker; + break; + default: + callfunc "F_keIntro", e_swt2, "I don't know how to change you from your current job."; + return; + } + set @submenu, select( + "- Cancel job change", + "- "+@name1$, + "- "+@name2$ + ); + } + switch (BaseClass) { + case Job_Acolyte: + switch (@submenu) { + case 2: //Priest + set @newJob,Job_Priest; + set @weapon,$@kejc_wPriest; + set @weapon2,$@kejc_w2Priest; + break; + case 3: //Monk + set @newJob,Job_Monk; + set @weapon,$@kejc_wMonk; + set @weapon2,$@kejc_w2Monk; + break; + } + break; + case Job_Archer: + switch (@submenu) { + case 2: //Hunter + set @newJob,Job_Hunter; + set @weapon,$@kejc_wHunter; + set @weapon2,$@kejc_w2Hunter; + break; + case 3: //Bard/Dancer + if (sex == 1) { //Bard + set @newJob,Job_Bard; + set @weapon,$@kejc_wBard; + set @weapon2,$@kejc_w2Bard; + } else { //Dancer + set @newJob,Job_Dancer; + set @weapon,$@kejc_wDancer; + set @weapon2,$@kejc_w2Dancer; + } + break; + } + break; + case Job_Mage: + switch (@submenu) { + case 2: //Wizard + set @newJob,Job_Wizard; + set @weapon,$@kejc_wWizard; + set @weapon2,$@kejc_w2Wizard; + break; + case 3: //Sage + set @newJob,Job_Sage; + set @weapon,$@kejc_wSage; + set @weapon2,$@kejc_w2Sage; + break; + } + break; + case Job_Merchant: + switch (@submenu) { + case 2: //Blacksmith + set @newJob,Job_Blacksmith; + set @weapon,$@kejc_wBlacksmith; + set @weapon2,$@kejc_w2Blacksmith; + break; + case 3: //Alchemist + set @newJob,Job_Alchem; + set @weapon,$@kejc_wAlchemist; + set @weapon2,$@kejc_w2Alchemist; + break; + } + break; + case Job_Swordman: + switch (@submenu) { + case 2: //Knight + set @newJob,Job_Knight; + set @weapon,$@kejc_wKnight; + set @weapon2,$@kejc_w2Knight; + break; + case 3: //Crusader + set @newJob,Job_Crusader; + set @weapon,$@kejc_wCrusader; + set @weapon2,$@kejc_w2Crusader; + break; + default: + mes "uh oh"; + break; + } + break; + case Job_Thief: + switch (@submenu) { + case 2: //Assassin + set @newJob,Job_Assassin; + set @weapon,$@kejc_wAssassin; + set @weapon2,$@kejc_w2Assassin; + break; + case 3: //Rogue + set @newJob,Job_Rogue; + set @weapon,$@kejc_wRogue; + set @weapon2,$@kejc_w2Rogue; + break; + } + break; + case Job_Taekwon: + switch (@submenu) { + case 2: //Star Gladiator + set @newJob,Job_Star_Gladiator; + set @weapon,$@kejc_wStarGladiator; + set @weapon2,$@kejc_w2StarGladiator; + break; + case 3: //Soul Linker + set @newJob,Job_Soul_Linker; + set @weapon,$@kejc_wSoulLinker; + set @weapon2,$@kejc_w2SoulLinker; + break; + } + break; + } + if (@submenu > 1) { + if (SF_changeJob(@job,Upper,@newJob,@upper,@weapon,@weapon2,$@kejc_cost2ND,0,0)) + return; + } + } while (@submenu > 1); +} + +//SubFunction: SF_testChangeJob(Zeny, BaseLv, JobLv) +//Function that checks if the player qualifies for job changing. +function SF_testChangeJob { + set @fail, 0; + if (Zeny < getarg(0)) + set @fail, 1; + if (BaseLevel < getarg(1)) + set @fail, @fail+2; + if (JobLevel < getarg(2)) + set @fail, @fail+4; + if (@fail > 0) { + if (@fail&1) + mes "You need "+getarg(0)+"z for the conversion process."; + if (@fail&2) + mes "You need to be at least Lv "+getarg(1)+"."; + if (@fail&4) + mes "You need at least job Lv "+getarg(2)+"."; + callfunc "F_keIntro", e_pif, "Sorry, you don't qualify for a job change yet."; + return 0; + } + + if (SkillPoint > 0 && $@kejc_skillsPolicy == 0) { + callfunc "F_keIntro", e_dots, "Sorry, use your remaining Skill points before being able to change class."; + return 0; + } + return 1; +} + +//SubFunction: SF_changeJob (CurrentJobLv, CurrentJobType, NewJobBase, NewJobType +//Weapon, Weapon2, Zeny, WipeSkills, ResetLv) +//Attempts to change to the Jobgiven. +//CurrentJobLv is 0-3 (novice, 1st class, 2nd class, s.novice) +//Type is 0-2 (Normal, Advanced Class, Baby) +//Weapon is the ID of the weapon to grant +//Weapon2 is the alternative weapon granted when your job level is above $@kejc_wBonusLv +//Zeny is the money required (if negative, it is money awarded) +//WipeSkills if 1, indicates that skills should be wiped, +//if 2, it means basic skills have to be given back +//Reset Level indicates the base lv must be reset to 1. +//Note: Zeny/Base/Job requirements should had been checked with SF_testChangeJob already! +function SF_changeJob { + set @newjob,getarg(2); + set @newtype,getarg(3); + set @weapon,getarg(4); + set @weapon2,getarg(5); + set @cost,getarg(6); + set @wipeSkill,getarg(7); + set @resetLv,getarg(8); + + set @jobStr$, callfunc("GF_getJobName2",@newjob, @newtype); + if (@wipeSkill == 0 && SkillPoint > 0 && $@kejc_skillsPolicy == 1) { + set @selection, select( + "- Do not change yet", + "- Change to "+@jobStr$+" (skill points lost)", + "- View details" + ); + } else { + set @selection, select( + "- Cancel", + "- Change to "+@jobStr$, + "- View details" + ); + } + switch (@selection) { + case 3: //Details + mes "Okay.. listen up:"; + next; + mes "["+@name$+"]"; + mes "Changing to "+@jobStr$+" now means:"; + if (@wipeSkill == 0 && SkillPoint > 0 && $@kejc_skillsPolicy == 1) + mes "- You will lose your "+SkillPoint+" unused skill points."; + else if (@wipeSkill == 1) + mes "- You will lose all your skills."; + if (@resetLv) + mes "- Your base level will be reset to 1."; + if (@cost > 0) + mes "- You will be charged "+@cost+"z."; + else if (@cost < 0) + mes "- You will be aided with "+(0-@cost)+"z."; + if (@weapon > 0) { + if (@weapon2 > 0 && $@kejc_wBonusLv) { + if (JobLevel < $@kejc_wBonusLv) { + mes "- You will receive a "+getitemname(@weapon)+"["+getitemslots(@weapon)+"]."; + mes "- If you wait until Job Lv"+$@kejc_wBonusLv+", you can receive instead a "+getitemname(@weapon2)+"["+getitemslots(@weapon)+"]."; + } else { + mes "- You will receive a "+getitemname(@weapon2)+"["+getitemslots(@weapon)+"] for reaching Job Lv"+$@kejc_wBonusLv+"."; + } + } else + mes "- You will receive a "+getitemname(@weapon)+"."; + } + mes "So... will you change?"; + if (select( + "- Cancel", + "- Change to "+@jobStr$ + ) != 2) { + callfunc "F_keIntro", e_dots, "...alright."; + return 0; + } + callfunc "F_keIntro", -1, "Enjoy your new Job."; + case 2: //Change + //Set/Unset job path variables as needed. + if($@kejc_upperPolicy) { + set @class,getarg(0); + set @type, getarg(1); + if(@class == 1 && @type == 0) + set kej_class1,class; //Advancing to second class, so... + if(@class == 2) + set kej_class2,class; //Only way of being here is by doing a rebirth + if(@type > 0) + set kej_class1,0; //Clear when one is a high class + if(@type > 0 && @class == 1) + set kej_class2,0; //Clear when leaving high 1st class + } + if (@resetLv) { + jobchange Job_Novice_High; //Done to give players those 100 points from High classes + resetlvl(1); + } + if (@wipeSkill) { + resetskill; + setoption(0); + set SkillPoint,0; + } else if ($@kejc_skillsPolicy == 1) + set SkillPoint,0; + if (@wipeSkill>1) + skill 1,9,0; + if($@kejc_resetDye) + setlook 7,0; + jobchange @newjob, @newtype; + if ($@kejc_announce) + announce strcharinfo(0)+" has been promoted to "+@jobStr$+"!",8; + set Zeny,Zeny-@cost; + if ($@kejc_weaponPolicy && @weapon > 0) { + if ($@kejc_wBonusLv && @weapon2 > 0) { + if (JobLevel < $@kejc_wBonusLv) + getitem @weapon,1; + else + getitem @weapon2,1; + } else + getitem @weapon,1; + } + emotion e_grat; + return 1; + default: //Cancel... + callfunc "F_keIntro", e_dots, "...alright."; + return 0; + } +} +//SubFunction: SF_getJobNames(Qty, Jobid1, Jobid2,...) +//Workaround until eA gets a fix for the bug where you can't use callfunc or +//callsub within a menu +function SF_getJobNames { + switch (getarg(0)) { + case 8: + set @name8$, callfunc("GF_getJobName2",getarg(8),@upper); + set @name7$, callfunc("GF_getJobName2",getarg(7),@upper); + set @name6$, callfunc("GF_getJobName2",getarg(6),@upper); + set @name5$, callfunc("GF_getJobName2",getarg(5),@upper); + set @name4$, callfunc("GF_getJobName2",getarg(4),@upper); + case 3: + set @name3$, callfunc("GF_getJobName2",getarg(3),@upper); + case 2: + set @name2$, callfunc("GF_getJobName2",getarg(2),@upper); + set @name1$, callfunc("GF_getJobName2",getarg(1),@upper); + } + return; +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_jobswap.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_jobswap.txt index 59311cca5..8d91242cc 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_jobswap.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_jobswap.txt @@ -1,418 +1,418 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Job Swapping Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 3.4
-//===== Compatible With: =====================================
-//= eAthena SVN R7896+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Enables job changing among classes of the same 'type'
-//= (ie among 1st classes, or among 2nd classes)
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//= * The previous Job, when enabled, is stored in:
-//= kej_prev_job (job id)
-//= kej_prev_joblv (job level)
-//= kej_prev_skills (skill count)
-//= kej_prev_dye (cloth dye)
-//============================================================
-
-- script keInit_jobSwap -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadJobSwap";
- end;
-}
-
-function script F_keJobSwap {
-
-function SF_canRevert;
-function SF_canSwitch;
-function SF_revertJob;
-function SF_switch;
-function SF_calcSwapCost;
-function SF_testSwap;
-function SF_swapJob;
-function SF_getJobNames;
-
- set @thisLevel, callfunc("GF_getJobLevel", Class);
-
- set @prevId, kej_prev_job;
- set @prevLv, kej_prev_joblv;
- set @prevLevel, 0;
- set @prevType, 0;
-
- if ($@kejs_revertPolicy && @prevId && @prevLv) {
- set @prevLevel, callfunc("GF_getJobLevel", @prevId);
- set @prevType, callfunc("GF_getJobType", @prevId);
- }
-
- if (SF_canRevert())
- { //Qualifies for Reverting
- do {
- set @revertmenu, select(
- "- Return",
- "- Return to previous class",
- "- Change into another class"
- );
- switch (@revertmenu) {
- case 2: //Revert
- if (SF_revertJob())
- return;
- break;
- case 3: //Switch
- if (SF_switch() == 0)
- return;
- break;
- }
- } while (@revertmenu > 1);
- return;
- }
- if (SF_canSwitch())
- {
- SF_switch();
- return;
- }
-
- callfunc "F_keIntro", e_swt2, "There are no available jobs of your level.";
- return;
-
-//SubFunction SF_canRevert, specifies if the character can revert to previous job.
-function SF_canRevert {
- if ($@kejs_revertPolicy == 0 || @prevId == 0 || (Upper == 2 && @prevType != 2))
- return 0;
- if((@thisLevel == @prevLevel && Upper == @prevType) || $@kejs_revertPolicy == 2)
- return 1;
- if ($@kejs_SNpolicy && @prevType == Upper && ((@prevLevel == 3 && @thisLevel == 1) || (@prevLevel == 1 && @thisLevel == 3)))
- return 1;
- return 0;
-}
-
-//SubFunction SF_canSwitch, specifies if character can change to another job.
-function SF_canSwitch {
- if (@thisLevel == 3)
- return $@kejs_SNpolicy;
- if (@thisLevel == 1 || @thisLevel == 2)
- return 1;
- return 0;
-}
-
-//Sub Function SF_switch. Presents the switch job menu. Returns 1 only if the
-//menu was left by picking "Cancel".
-function SF_switch {
- switch (@thisLevel) {
- case 1:
- case 3: //First Classes
- set @cost, SF_calcSwapCost($@kejs_job1ST, $@kejs_cost1ST, $@kejs_discount1ST);
- set @preserve, $@kejs_preserve1ST;
- if (SF_testSwap($@kejs_job1ST, @cost)) {
- do {
- if ($@kejs_SNpolicy && Upper != 1) { //S. Novice Menu
- SF_getJobNames 7,Job_Acolyte,Job_Archer,Job_Mage,Job_Merchant,Job_Swordman,Job_Thief,Job_SuperNovice;
- set @kmenu, select(
- "- Cancel job swap",
- "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$,"- "+@name7$
- );
- } else {
- SF_getJobNames 6,Job_Acolyte,Job_Archer,Job_Mage,Job_Merchant,Job_Swordman,Job_Thief;
- set @kmenu, select(
- "- Cancel job swap",
- "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$
- );
- }
- switch (@kmenu) {
- case 2: //Acolyte
- if (SF_swapJob(callfunc("GF_getJobId", Job_Acolyte, Upper),@cost,@preserve))
- return 0;
- break;
- case 3: //Archer
- if (SF_swapJob(callfunc("GF_getJobId", Job_Archer, Upper),@cost,@preserve))
- return 0;
- break;
- case 4: //Mage
- if (SF_swapJob(callfunc("GF_getJobId", Job_Mage, Upper),@cost,@preserve))
- return 0;
- break;
- case 5: //Merchant
- if (SF_swapJob(callfunc("GF_getJobId", Job_Merchant, Upper),@cost,@preserve))
- return 0;
- break;
- case 6: //Swordman
- if (SF_swapJob(callfunc("GF_getJobId", Job_Swordman, Upper),@cost,@preserve))
- return 0;
- break;
- case 7: //Thief
- if (SF_swapJob(callfunc("GF_getJobId", Job_Thief, Upper),@cost,@preserve))
- return 0;
- break;
- case 8: //S. Novice
- if (SF_swapJob(callfunc("GF_getJobId", Job_SuperNovice, Upper),@cost,@preserve))
- return 0;
- break;
- }
- } while (@kmenu > 1);
- return 1;
- }
- break;
-
- case 2: //Second Classes
- set @cost, SF_calcSwapCost($@kejs_job2ND, $@kejs_cost2ND, $@kejs_discount2ND);
- set @preserve, $@kejs_preserve2ND;
- if (SF_testSwap($@kejs_job2ND, @cost)) {
- do {
- if (sex == 1) {
- SF_getJobNames 12,Job_Alchem,Job_Assassin,Job_Bard,Job_Blacksmith,Job_Crusader,Job_Hunter,Job_Knight,Job_Monk,Job_Priest,Job_Rogue,Job_Sage,Job_Wizard;
- set @kmenu, select(
- "- Cancel job change",
- "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$,
- "- "+@name7$,"- "+@name8$,"- "+@name9$,"- "+@name10$,"- "+@name11$,"- "+@name12$
- );
- if (@kmenu >= 7) //Dancer should be at pos 7.
- set @kmenu, @kmenu+1;
- } else {
- SF_getJobNames 12,Job_Alchem,Job_Assassin,Job_Blacksmith,Job_Crusader,Job_Dancer,Job_Hunter,Job_Knight,Job_Monk,Job_Priest,Job_Rogue,Job_Sage,Job_Wizard;
- set @kmenu, select(
- "- Cancel job change",
- "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$,
- "- "+@name7$,"- "+@name8$,"- "+@name9$,"- "+@name10$,"- "+@name11$,"- "+@name12$
- );
- if (@kmenu >= 4) //Bard should be at pos 4.
- set @kmenu, @kmenu+1;
- }
- switch (@kmenu)
- {
- case 2: //ALCHEMIST
- if (SF_swapJob(callfunc("GF_getJobId", Job_Alchem, Upper),@cost,@preserve))
- return 0;
- break;
- case 3: //ASSASSIN
- if (SF_swapJob(callfunc("GF_getJobId", Job_Assassin, Upper),@cost,@preserve))
- return 0;
- break;
- case 4: //BARD
- if (SF_swapJob(callfunc("GF_getJobId", Job_Bard, Upper),@cost,@preserve))
- return 0;
- break;
- case 5: //BLACKSMITH
- if (SF_swapJob(callfunc("GF_getJobId", Job_Blacksmith, Upper),@cost,@preserve))
- return 0;
- break;
- case 6: //CRUSADER
- if (SF_swapJob(callfunc("GF_getJobId", Job_Crusader, Upper),@cost,@preserve))
- return 0;
- break;
- case 7: //DANCER
- if (SF_swapJob(callfunc("GF_getJobId", Job_Dancer, Upper),@cost,@preserve))
- return 0;
- break;
- case 8: //HUNTER
- if (SF_swapJob(callfunc("GF_getJobId", Job_Hunter, Upper),@cost,@preserve))
- return 0;
- break;
- case 9: //KNIGHT
- if (SF_swapJob(callfunc("GF_getJobId", Job_Knight, Upper),@cost,@preserve))
- return 0;
- break;
- case 10: //MONK
- if (SF_swapJob(callfunc("GF_getJobId", Job_Monk, Upper),@cost,@preserve))
- return 0;
- break;
- case 11: //PRIEST
- if (SF_swapJob(callfunc("GF_getJobId", Job_Priest, Upper),@cost,@preserve))
- return 0;
- break;
- case 12: //ROGUE
- if (SF_swapJob(callfunc("GF_getJobId", Job_Rogue, Upper),@cost,@preserve))
- return 0;
- break;
- case 13: //SAGE
- if (SF_swapJob(callfunc("GF_getJobId", Job_Sage, Upper),@cost,@preserve))
- return 0;
- break;
- case 14: //WIZARD
- if (SF_swapJob(callfunc("GF_getJobId", Job_Wizard, Upper),@cost,@preserve))
- return 0;
- break;
- }
- } while (@kmenu > 1);
- return 1;
- }
- }
- return 0;
-}
-
-//SubFunction: SF_calcSwapCost (MinJob, BaseCost, Discount)
-//Calculates cost to swap jobs
-function SF_calcSwapCost {
- set @cost, getarg(1);
- set @cost, @cost - @cost*getarg(2)*(JobLevel-getarg(0))/100;
- if (@cost < 0)
- set @cost,0; //Free Change
- return @cost;
-}
-
-//SubFunction: SF_testSwap(MinJobLv, Cost)
-//Checks if the player qualifies for job changing.
-function SF_testSwap {
- if (JobLevel < getarg(0)) {
- callfunc "F_keIntro", e_dots, "You need to be at least Job Lv "+getarg(0)+" before exchanging.";
- return 0;
- }
-
- set @cost, callfunc("F_keCost",getarg(1),$@kejs_swapDiscount);
- if (Zeny < @cost) {
- callfunc "F_keIntro", e_dots, "You need "+@cost+"z to be able to change.";
- return 0;
- }
- return 1;
-}
-
-//SubFunction: SF_swapJob (JobNumber, Zeny, PreserveRate)
-//Attempts to swap to the Jobgiven.
-//Zeny is the money cost
-//Preserve is how much of the previous job to preserve.
-function SF_swapJob {
- set @newjobId, getarg(0);
- set @cost, callfunc("F_keCost",getarg(1),$@kejs_swapDiscount);
- set @preserve, getarg(2);
-
- if (Class == @newjobId) {
- callfunc "F_keIntro", e_meh, "Um... you are already that class!";
- return 0;
- }
-
- set @newJob$, callfunc("GF_getJobName",@newjobId);
- set @oldJob$, callfunc("GF_getJobName",Class);
- set @newjoblv, JobLevel*@preserve/100;
-
- if (@newjoblv > 1) {
- if (select("- Cancel", "- Change to a Lv"+@newjoblv+" "+@newJob$+" ("+@cost+"z)") != 2)
- return 0;
- } else {
- set @newjoblv,1;
- if (select("- Cancel", "- Change to "+@newJob$+" ("+@cost+"z)") != 2)
- return 0;
- }
-
- set @basic, getSkilllv(1);
- set @preserve, skillpointcount() -JobLevel -@basic +@newjoblv; //Preserve holds the final amount of SkillPoints you should have.
-
- if (@preserve < 0) {
- callfunc "F_keIntro", e_gasp, "You need "+(-@preserve)+" more skill points to change class!";
- return 0;
- }
-
- set @thisJoblevel, JobLevel;
- resetSkill;
-
- //Set previous job as needed.
- if ($@kejs_revertPolicy) {
- set kej_prev_job, Class;
- set kej_prev_joblv, @thisJoblevel;
- set kej_prev_skills, SkillPoint;
- }
- if ($@kejs_announce)
- announce strcharinfo(0)+" has changed from "+@oldJob$+" to "+@newJob$+"...",16;
-
- if ($@kejs_resetDye)
- setlook 7,0;
- jobchange @newjobId, 0;
- skill 1,@basic,0;
- set JobLevel, @newjoblv;
- set SkillPoint, @preserve;
- setoption(0);
- sc_end -1;
- callfunc "F_keCharge",getarg(2),$@kejs_swapDiscount,1;
-
- emotion e_ok;
- return 1;
-}
-
-//SubFunction: SF_revertJob (cost)
-//Reverts to the previous job.
-function SF_revertJob {
- if (Class == kej_prev_job) {
- callfunc "F_keIntro", e_no, "Hmm... You can't go back, because your previous class is the same as your current one??";
- return 0;
- }
- set @newjob$, callfunc ("GF_getJobName",kej_prev_job);
-
- set @cost,callfunc("F_keCost",$@kejs_revertCost,$@kejs_revertDiscount);
-
- if (select("- Cancel","- Return to a Lv"+kej_prev_joblv+" "+@newjob$+" ("+@cost+"z)") != 2)
- return 0;
-
- if (!(callfunc("F_keCharge",$@kejs_revertCost,$@kejs_revertDiscount,1))) {
- callfunc "F_keIntro", -1, "Sorry, you need "+@cost+"z before you can revert to a Lv"+kej_prev_joblv+" "+@newjob$+".";
- return 0;
- }
- set @thisJobId, Class;
- set @thisJobLv, JobLevel;
-
- set @basic, getSkilllv(1);
- resetSkill;
- set @skill, SkillPoint;
- if($@kejs_saveDye) {
- set @prevDye, getlook(7);
- setlook 7,0;
- }
- if ($@kejs_resetDye)
- setlook 7,0;
- jobchange kej_prev_job, 0;
- if($@kejs_saveDye) {
- setlook 7,kej_prev_dye;
- set kej_prev_dye,@prevDye;
- }
- set JobLevel, kej_prev_joblv;
- set SkillPoint, kej_prev_skills;
-
- skill 1, @basic, 0;
- set SkillPoint, SkillPoint-@basic;
-
- set kej_prev_job, @thisJobId;
- set kej_prev_joblv, @thisJobLv;
- set kej_prev_skills, @skill;
- setoption(0);
- sc_end -1;
-
- if ($@kejs_announce)
- announce strcharinfo(0)+" has changed from "+callfunc ("GF_getJobName",@thisJobId)+" to "+@newjob$+"...",16;
- return 1;
-}
-
-//SubFunction: SF_getJobNames(Qty, Jobid1, Jobid2,...)
-//Workaround until eA gets a fix for the bug where you can't use callfunc or
-//callsub within a menu
-function SF_getJobNames {
- switch (getarg(0)) {
- case 12:
- set @name12$, callfunc("GF_getJobName2",getarg(12),Upper);
- case 11:
- set @name11$, callfunc("GF_getJobName2",getarg(11),Upper);
- case 10:
- set @name10$, callfunc("GF_getJobName2",getarg(10),Upper);
- case 9:
- set @name9$, callfunc("GF_getJobName2",getarg(9),Upper);
- case 8:
- set @name8$, callfunc("GF_getJobName2",getarg(8),Upper);
- case 7:
- set @name7$, callfunc("GF_getJobName2",getarg(7),Upper);
- case 6:
- set @name6$, callfunc("GF_getJobName2",getarg(6),Upper);
- case 5:
- set @name5$, callfunc("GF_getJobName2",getarg(5),Upper);
- case 4:
- set @name4$, callfunc("GF_getJobName2",getarg(4),Upper);
- case 3:
- set @name3$, callfunc("GF_getJobName2",getarg(3),Upper);
- case 2:
- set @name2$, callfunc("GF_getJobName2",getarg(2),Upper);
- case 1:
- set @name1$, callfunc("GF_getJobName2",getarg(1),Upper);
- default:
- return;
- }
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Job Swapping Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 3.4 +//===== Compatible With: ===================================== +//= eAthena SVN R7896+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Enables job changing among classes of the same 'type' +//= (ie among 1st classes, or among 2nd classes) +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//= * The previous Job, when enabled, is stored in: +//= kej_prev_job (job id) +//= kej_prev_joblv (job level) +//= kej_prev_skills (skill count) +//= kej_prev_dye (cloth dye) +//============================================================ + +- script keInit_jobSwap -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadJobSwap"; + end; +} + +function script F_keJobSwap { + +function SF_canRevert; +function SF_canSwitch; +function SF_revertJob; +function SF_switch; +function SF_calcSwapCost; +function SF_testSwap; +function SF_swapJob; +function SF_getJobNames; + + set @thisLevel, callfunc("GF_getJobLevel", Class); + + set @prevId, kej_prev_job; + set @prevLv, kej_prev_joblv; + set @prevLevel, 0; + set @prevType, 0; + + if ($@kejs_revertPolicy && @prevId && @prevLv) { + set @prevLevel, callfunc("GF_getJobLevel", @prevId); + set @prevType, callfunc("GF_getJobType", @prevId); + } + + if (SF_canRevert()) + { //Qualifies for Reverting + do { + set @revertmenu, select( + "- Return", + "- Return to previous class", + "- Change into another class" + ); + switch (@revertmenu) { + case 2: //Revert + if (SF_revertJob()) + return; + break; + case 3: //Switch + if (SF_switch() == 0) + return; + break; + } + } while (@revertmenu > 1); + return; + } + if (SF_canSwitch()) + { + SF_switch(); + return; + } + + callfunc "F_keIntro", e_swt2, "There are no available jobs of your level."; + return; + +//SubFunction SF_canRevert, specifies if the character can revert to previous job. +function SF_canRevert { + if ($@kejs_revertPolicy == 0 || @prevId == 0 || (Upper == 2 && @prevType != 2)) + return 0; + if((@thisLevel == @prevLevel && Upper == @prevType) || $@kejs_revertPolicy == 2) + return 1; + if ($@kejs_SNpolicy && @prevType == Upper && ((@prevLevel == 3 && @thisLevel == 1) || (@prevLevel == 1 && @thisLevel == 3))) + return 1; + return 0; +} + +//SubFunction SF_canSwitch, specifies if character can change to another job. +function SF_canSwitch { + if (@thisLevel == 3) + return $@kejs_SNpolicy; + if (@thisLevel == 1 || @thisLevel == 2) + return 1; + return 0; +} + +//Sub Function SF_switch. Presents the switch job menu. Returns 1 only if the +//menu was left by picking "Cancel". +function SF_switch { + switch (@thisLevel) { + case 1: + case 3: //First Classes + set @cost, SF_calcSwapCost($@kejs_job1ST, $@kejs_cost1ST, $@kejs_discount1ST); + set @preserve, $@kejs_preserve1ST; + if (SF_testSwap($@kejs_job1ST, @cost)) { + do { + if ($@kejs_SNpolicy && Upper != 1) { //S. Novice Menu + SF_getJobNames 7,Job_Acolyte,Job_Archer,Job_Mage,Job_Merchant,Job_Swordman,Job_Thief,Job_SuperNovice; + set @kmenu, select( + "- Cancel job swap", + "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$,"- "+@name7$ + ); + } else { + SF_getJobNames 6,Job_Acolyte,Job_Archer,Job_Mage,Job_Merchant,Job_Swordman,Job_Thief; + set @kmenu, select( + "- Cancel job swap", + "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$ + ); + } + switch (@kmenu) { + case 2: //Acolyte + if (SF_swapJob(callfunc("GF_getJobId", Job_Acolyte, Upper),@cost,@preserve)) + return 0; + break; + case 3: //Archer + if (SF_swapJob(callfunc("GF_getJobId", Job_Archer, Upper),@cost,@preserve)) + return 0; + break; + case 4: //Mage + if (SF_swapJob(callfunc("GF_getJobId", Job_Mage, Upper),@cost,@preserve)) + return 0; + break; + case 5: //Merchant + if (SF_swapJob(callfunc("GF_getJobId", Job_Merchant, Upper),@cost,@preserve)) + return 0; + break; + case 6: //Swordman + if (SF_swapJob(callfunc("GF_getJobId", Job_Swordman, Upper),@cost,@preserve)) + return 0; + break; + case 7: //Thief + if (SF_swapJob(callfunc("GF_getJobId", Job_Thief, Upper),@cost,@preserve)) + return 0; + break; + case 8: //S. Novice + if (SF_swapJob(callfunc("GF_getJobId", Job_SuperNovice, Upper),@cost,@preserve)) + return 0; + break; + } + } while (@kmenu > 1); + return 1; + } + break; + + case 2: //Second Classes + set @cost, SF_calcSwapCost($@kejs_job2ND, $@kejs_cost2ND, $@kejs_discount2ND); + set @preserve, $@kejs_preserve2ND; + if (SF_testSwap($@kejs_job2ND, @cost)) { + do { + if (sex == 1) { + SF_getJobNames 12,Job_Alchem,Job_Assassin,Job_Bard,Job_Blacksmith,Job_Crusader,Job_Hunter,Job_Knight,Job_Monk,Job_Priest,Job_Rogue,Job_Sage,Job_Wizard; + set @kmenu, select( + "- Cancel job change", + "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$, + "- "+@name7$,"- "+@name8$,"- "+@name9$,"- "+@name10$,"- "+@name11$,"- "+@name12$ + ); + if (@kmenu >= 7) //Dancer should be at pos 7. + set @kmenu, @kmenu+1; + } else { + SF_getJobNames 12,Job_Alchem,Job_Assassin,Job_Blacksmith,Job_Crusader,Job_Dancer,Job_Hunter,Job_Knight,Job_Monk,Job_Priest,Job_Rogue,Job_Sage,Job_Wizard; + set @kmenu, select( + "- Cancel job change", + "- "+@name1$,"- "+@name2$,"- "+@name3$,"- "+@name4$,"- "+@name5$,"- "+@name6$, + "- "+@name7$,"- "+@name8$,"- "+@name9$,"- "+@name10$,"- "+@name11$,"- "+@name12$ + ); + if (@kmenu >= 4) //Bard should be at pos 4. + set @kmenu, @kmenu+1; + } + switch (@kmenu) + { + case 2: //ALCHEMIST + if (SF_swapJob(callfunc("GF_getJobId", Job_Alchem, Upper),@cost,@preserve)) + return 0; + break; + case 3: //ASSASSIN + if (SF_swapJob(callfunc("GF_getJobId", Job_Assassin, Upper),@cost,@preserve)) + return 0; + break; + case 4: //BARD + if (SF_swapJob(callfunc("GF_getJobId", Job_Bard, Upper),@cost,@preserve)) + return 0; + break; + case 5: //BLACKSMITH + if (SF_swapJob(callfunc("GF_getJobId", Job_Blacksmith, Upper),@cost,@preserve)) + return 0; + break; + case 6: //CRUSADER + if (SF_swapJob(callfunc("GF_getJobId", Job_Crusader, Upper),@cost,@preserve)) + return 0; + break; + case 7: //DANCER + if (SF_swapJob(callfunc("GF_getJobId", Job_Dancer, Upper),@cost,@preserve)) + return 0; + break; + case 8: //HUNTER + if (SF_swapJob(callfunc("GF_getJobId", Job_Hunter, Upper),@cost,@preserve)) + return 0; + break; + case 9: //KNIGHT + if (SF_swapJob(callfunc("GF_getJobId", Job_Knight, Upper),@cost,@preserve)) + return 0; + break; + case 10: //MONK + if (SF_swapJob(callfunc("GF_getJobId", Job_Monk, Upper),@cost,@preserve)) + return 0; + break; + case 11: //PRIEST + if (SF_swapJob(callfunc("GF_getJobId", Job_Priest, Upper),@cost,@preserve)) + return 0; + break; + case 12: //ROGUE + if (SF_swapJob(callfunc("GF_getJobId", Job_Rogue, Upper),@cost,@preserve)) + return 0; + break; + case 13: //SAGE + if (SF_swapJob(callfunc("GF_getJobId", Job_Sage, Upper),@cost,@preserve)) + return 0; + break; + case 14: //WIZARD + if (SF_swapJob(callfunc("GF_getJobId", Job_Wizard, Upper),@cost,@preserve)) + return 0; + break; + } + } while (@kmenu > 1); + return 1; + } + } + return 0; +} + +//SubFunction: SF_calcSwapCost (MinJob, BaseCost, Discount) +//Calculates cost to swap jobs +function SF_calcSwapCost { + set @cost, getarg(1); + set @cost, @cost - @cost*getarg(2)*(JobLevel-getarg(0))/100; + if (@cost < 0) + set @cost,0; //Free Change + return @cost; +} + +//SubFunction: SF_testSwap(MinJobLv, Cost) +//Checks if the player qualifies for job changing. +function SF_testSwap { + if (JobLevel < getarg(0)) { + callfunc "F_keIntro", e_dots, "You need to be at least Job Lv "+getarg(0)+" before exchanging."; + return 0; + } + + set @cost, callfunc("F_keCost",getarg(1),$@kejs_swapDiscount); + if (Zeny < @cost) { + callfunc "F_keIntro", e_dots, "You need "+@cost+"z to be able to change."; + return 0; + } + return 1; +} + +//SubFunction: SF_swapJob (JobNumber, Zeny, PreserveRate) +//Attempts to swap to the Jobgiven. +//Zeny is the money cost +//Preserve is how much of the previous job to preserve. +function SF_swapJob { + set @newjobId, getarg(0); + set @cost, callfunc("F_keCost",getarg(1),$@kejs_swapDiscount); + set @preserve, getarg(2); + + if (Class == @newjobId) { + callfunc "F_keIntro", e_meh, "Um... you are already that class!"; + return 0; + } + + set @newJob$, callfunc("GF_getJobName",@newjobId); + set @oldJob$, callfunc("GF_getJobName",Class); + set @newjoblv, JobLevel*@preserve/100; + + if (@newjoblv > 1) { + if (select("- Cancel", "- Change to a Lv"+@newjoblv+" "+@newJob$+" ("+@cost+"z)") != 2) + return 0; + } else { + set @newjoblv,1; + if (select("- Cancel", "- Change to "+@newJob$+" ("+@cost+"z)") != 2) + return 0; + } + + set @basic, getSkilllv(1); + set @preserve, skillpointcount() -JobLevel -@basic +@newjoblv; //Preserve holds the final amount of SkillPoints you should have. + + if (@preserve < 0) { + callfunc "F_keIntro", e_gasp, "You need "+(-@preserve)+" more skill points to change class!"; + return 0; + } + + set @thisJoblevel, JobLevel; + resetSkill; + + //Set previous job as needed. + if ($@kejs_revertPolicy) { + set kej_prev_job, Class; + set kej_prev_joblv, @thisJoblevel; + set kej_prev_skills, SkillPoint; + } + if ($@kejs_announce) + announce strcharinfo(0)+" has changed from "+@oldJob$+" to "+@newJob$+"...",16; + + if ($@kejs_resetDye) + setlook 7,0; + jobchange @newjobId, 0; + skill 1,@basic,0; + set JobLevel, @newjoblv; + set SkillPoint, @preserve; + setoption(0); + sc_end -1; + callfunc "F_keCharge",getarg(2),$@kejs_swapDiscount,1; + + emotion e_ok; + return 1; +} + +//SubFunction: SF_revertJob (cost) +//Reverts to the previous job. +function SF_revertJob { + if (Class == kej_prev_job) { + callfunc "F_keIntro", e_no, "Hmm... You can't go back, because your previous class is the same as your current one??"; + return 0; + } + set @newjob$, callfunc ("GF_getJobName",kej_prev_job); + + set @cost,callfunc("F_keCost",$@kejs_revertCost,$@kejs_revertDiscount); + + if (select("- Cancel","- Return to a Lv"+kej_prev_joblv+" "+@newjob$+" ("+@cost+"z)") != 2) + return 0; + + if (!(callfunc("F_keCharge",$@kejs_revertCost,$@kejs_revertDiscount,1))) { + callfunc "F_keIntro", -1, "Sorry, you need "+@cost+"z before you can revert to a Lv"+kej_prev_joblv+" "+@newjob$+"."; + return 0; + } + set @thisJobId, Class; + set @thisJobLv, JobLevel; + + set @basic, getSkilllv(1); + resetSkill; + set @skill, SkillPoint; + if($@kejs_saveDye) { + set @prevDye, getlook(7); + setlook 7,0; + } + if ($@kejs_resetDye) + setlook 7,0; + jobchange kej_prev_job, 0; + if($@kejs_saveDye) { + setlook 7,kej_prev_dye; + set kej_prev_dye,@prevDye; + } + set JobLevel, kej_prev_joblv; + set SkillPoint, kej_prev_skills; + + skill 1, @basic, 0; + set SkillPoint, SkillPoint-@basic; + + set kej_prev_job, @thisJobId; + set kej_prev_joblv, @thisJobLv; + set kej_prev_skills, @skill; + setoption(0); + sc_end -1; + + if ($@kejs_announce) + announce strcharinfo(0)+" has changed from "+callfunc ("GF_getJobName",@thisJobId)+" to "+@newjob$+"...",16; + return 1; +} + +//SubFunction: SF_getJobNames(Qty, Jobid1, Jobid2,...) +//Workaround until eA gets a fix for the bug where you can't use callfunc or +//callsub within a menu +function SF_getJobNames { + switch (getarg(0)) { + case 12: + set @name12$, callfunc("GF_getJobName2",getarg(12),Upper); + case 11: + set @name11$, callfunc("GF_getJobName2",getarg(11),Upper); + case 10: + set @name10$, callfunc("GF_getJobName2",getarg(10),Upper); + case 9: + set @name9$, callfunc("GF_getJobName2",getarg(9),Upper); + case 8: + set @name8$, callfunc("GF_getJobName2",getarg(8),Upper); + case 7: + set @name7$, callfunc("GF_getJobName2",getarg(7),Upper); + case 6: + set @name6$, callfunc("GF_getJobName2",getarg(6),Upper); + case 5: + set @name5$, callfunc("GF_getJobName2",getarg(5),Upper); + case 4: + set @name4$, callfunc("GF_getJobName2",getarg(4),Upper); + case 3: + set @name3$, callfunc("GF_getJobName2",getarg(3),Upper); + case 2: + set @name2$, callfunc("GF_getJobName2",getarg(2),Upper); + case 1: + set @name1$, callfunc("GF_getJobName2",getarg(1),Upper); + default: + return; + } +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_main.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_main.txt index f5d1e0ef2..5aa2d3dd4 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_main.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_main.txt @@ -1,405 +1,405 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Main Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 5.4
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= This module contains the main menu, plus the healing and
-//= storage services.
-//===== Additional Comments: =================================
-//= See <http://www.eathena.deltaanime.net/board/index.php?showtopic=20290>
-//= for indepth explanation of the Kafra Express Script Package.
-//= Services available: comment/uncomment what you want (lines 37-104)
-//= See config.txt for per-module configuration.
-//============================================================
-
-// F_KafraExpress (String "Kafra's name", String "kafra image file",
-//int location (0 = Town Kafra, 1 = Dungeon Kafra, 2 = Both),
-//String "save map", int save x, int save y)
-function script F_KafraExpress {
- set @name$,getarg(0);
- set @ke_type,getarg(2);
- if ($@kekp_reset)
- set @kafraPass,0;
- if (getarg(1) != "")
- cutin getarg(1),2;
- callfunc "F_keIntro",-1,"";
-
-M_INIT:
- set @discount, callfunc("F_keCost",1,100);
-
- if (@ke_type == 1) goto MD_INIT;
- menu
- "- Leave",L_END,
- "- Heal Service ("+($@keh_hpCost*@discount)+"z/10HP - "+($@keh_spCost*@discount)+"z/10SP)",L_HEAL,
- "- Warp Service",M_WARP,
- "- Use Storage ("+($@kes_cost*@discount)+"z)",L_STORAGE,
- "- Use Guild Storage ("+($@kegs_cost*@discount)+"z)",L_GUILD_STORAGE,
- "- Job Services",M_JOB,
- "- Other Services",M_OTHER,
- "- Save Respawn point",L_SAVE;
-
-MD_INIT:
- menu
- "- Leave",L_END,
- "- Heal Service ("+($@keh_hpCost*@discount)+"z/10HP - "+($@keh_spCost*@discount)+"z/10SP)",L_HEAL,
- "- Warp Service",M_WARP,
- "- Use Storage ("+($@kes_cost*@discount)+"z)",L_STORAGE,
- "- Use Guild Storage ("+($@kegs_cost*@discount)+"z)",L_GUILD_STORAGE,
- "- Job Services",M_JOB,
- "- Other Services",M_OTHER,
- "- Save Respawn point",L_SAVE;
-
-M_WARP:
- if (@ke_type == 3 && nif_q_done != 1)
- goto L_DENIED;
- if (@ke_type == 1)
- goto MD_WARP;
- menu
- "- Return",M_INIT,
- "- Dungeons",L_DUNGEON,
- "- PvP Arena",L_PVP,
- "- Guild Wars",L_GUILD_DUNGEON,
- "- Towns",L_TOWN;
-
-MD_WARP:
- menu
- "- Return",M_INIT,
- "- Dungeons",L_DUNGEON,
- "- PvP Arena",L_PVP,
- "- Guild Wars",L_GUILD_DUNGEON,
- "- Towns",L_TOWN;
-
-M_JOB:
- if (@ke_type == 1) goto MD_JOB;
- menu
- "- Return", M_INIT,
- "- Change Job",L_JOB_CHANGE,
- "- Swap Job",L_JOB_SWAP,
- "- Stat/Skill Services",L_STATS,
- "- Stat/Skill Market",L_STAT_MARKET,
- "- Rental Service",L_RENT;
-
-MD_JOB:
- menu
- "- Return", M_INIT,
- "- Change Job",L_JOB_CHANGE,
- "- Swap Job",L_JOB_SWAP,
- "- Stat/Skill Services",L_STATS,
- "- Stat/Skill Market",L_STAT_MARKET,
- "- Rental Service",L_RENT;
-
-M_OTHER:
- if (@ke_type == 1) goto MD_OTHER;
- menu
- "- Return",M_INIT,
- "- Bank Services",L_BANK,
- "- Use Kafra Shop",L_SHOP,
- "- Broadcast a message",L_BROADCAST,
- "- Refine Services",L_REFINE,
- "- Uncard Services",L_UNCARD,
- "- Stylist Service",L_STYLE,
- "- Use a Kafra Pass",L_PASS;
-
-MD_OTHER:
- menu
- "- Return",M_INIT,
- "- Bank Services",L_BANK,
- "- Use Kafra Shop",L_SHOP,
- "- Broadcast a message",L_BROADCAST,
- "- Refine Services",L_REFINE,
- "- Uncard Services",L_UNCARD,
- "- Stylist Service",L_STYLE,
- "- Use a Kafra Pass",L_PASS;
-
-L_HEAL:
- callfunc "F_keHeal";
- goto M_INIT;
-
-L_TOWN:
- callfunc "F_keWarpTown";
- goto M_WARP;
-
-L_DUNGEON:
- callfunc "F_keDungeonWarps", getarg(3);
- goto M_WARP;
-
-L_GUILD_DUNGEON:
- callfunc "F_keWarpWOE";
- goto M_WARP;
-
-L_PVP:
- callfunc "F_keWarpPvp";
- goto M_WARP;
-
-L_STORAGE:
- callfunc "F_keStorage", getarg(1);
- goto M_INIT;
-
-L_GUILD_STORAGE:
- callfunc "F_keGuildStorage", getarg(1);
- goto M_INIT;
-
-L_BANK:
- callfunc "F_keBank";
- goto M_OTHER;
-
-L_SHOP:
- callfunc "F_keShop",@ke_type, getarg(1);
- goto M_OTHER;
-
-L_BROADCAST:
- callfunc "F_keBroadcast",getarg(3);
- goto M_OTHER;
-
-L_PASS:
- callfunc "F_kePass";
- goto M_OTHER;
-
-L_REFINE:
- callfunc "F_keRefine";
- goto M_OTHER;
-
-L_UNCARD:
- callfunc "F_keUncard";
- goto M_OTHER;
-
-L_STYLE:
- callfunc "F_keStylist";
- goto M_OTHER;
-
-L_JOB_CHANGE:
- callfunc "F_keJobChange";
- goto M_JOB;
-
-L_JOB_SWAP:
- callfunc "F_keJobSwap";
- goto M_JOB;
-
-L_STATS:
- callfunc "F_keStats";
- goto M_JOB;
-
-L_STAT_MARKET:
- callfunc "F_keStatMarket";
- goto M_JOB;
-
-L_RENT:
- callfunc "F_keRent";
- goto M_JOB;
-
-L_SAVE:
- if (@ke_type == 3 && nif_q_done != 1)
- goto L_DENIED;
- if ($@kewt_travel && @ke_type != 1) {
- callfunc "F_keAddTravelTown", getarg(3);
- }
- if ($@kewd_travel && @ke_type != 0) {
- callfunc "F_keAddTravelDungeon", getarg(3);
- }
- if ($@ke_saveOnSpot) {
- getmapxy @map$,@x,@y,0;
- savepoint @map$,@x,@y;
- } else {
- savepoint getarg(3),getarg(4),getarg(5);
- }
- emotion e_scissors;
- goto M_INIT;
-
-L_DENIED:
- callfunc "F_keIntro", e_gg, "...no.";
- goto M_INIT;
-
-L_END:
- mes "Thank you for using Kafra Services.";
- close2;
- cutin getarg(1), 255;
- end;
-}
-
-//Function F_keIntro (emotion, message)
-//Displays a message followed by an emotion, then a next button, and finally
-//shows the intro message.
-function script F_keIntro {
- if (getarg(0) >= 0)
- emotion getarg(0);
- if (getarg(1) != "") {
- mes getarg(1);
- next;
- }
- mes "["+@name$+"]";
- mes "Welcome to Kafra Corp. Always by your side, wherever you go.";
- if(@kafraPass) mes "Your Kafra Pass is active,";
- mes "How may I be of help?";
- return;
-}
-
-//Function Heal, offers the heal subsystem.
-function script F_keHeal {
- set @qtyHP,MaxHp-Hp;
- set @qtySP,MaxSp-Sp;
- set @costHP, $@keh_hpCost*(MaxHp-Hp)/10;
- set @costSP, $@keh_spCost*(MaxSp-Sp)/10;
- set @costHPSP, @costHP+@costSP;
- set @discount, callfunc("F_keCost",1,100);
-
- if (@qtyHP + @qtySP == 0) {
- callfunc "F_keIntro", -1, "...you don't need to be healed.";
- return;
- }
- if (@qtyHP == 0) goto M_NO_HP;
- if (@qtySP == 0) goto M_NO_SP;
- menu "- Cancel",-,
- "- Heal HP ("+(@costHP*@discount)+"z)",L_HEAL_HP,
- "- Heal SP ("+(@costSP*@discount)+"z)",L_HEAL_SP,
- "- Heal Both ("+(@costHPSP*@discount)+"z)",L_HEAL_ALL;
- return;
-
-M_NO_HP:
- menu "- Cancel",-,
- "- Heal SP ("+(@costSP*@discount)+"z)",L_HEAL_SP;
- return;
-
-M_NO_SP:
- menu "- Cancel",-,
- "- Heal HP ("+(@costHP*@discount)+"z)",L_HEAL_HP;
- return;
-
-L_HEAL_HP:
- if (!(callfunc("F_keCharge",@costHP,100,0))) {
- callfunc "F_keIntro", e_sry, "Sorry, you don't have enough to be healed.";
- return;
- }
- emotion e_no1;
- heal @qtyHP,0;
- return;
-
-L_HEAL_SP:
- if (!(callfunc("F_keCharge",@costSP,100,0))) {
- callfunc "F_keIntro", e_sry, "Sorry, you don't have enough to be healed.";
- return;
- }
- emotion e_no1;
- heal 0,@qtySP;
- return;
-
-L_HEAL_ALL:
- if (!(callfunc("F_keCharge",@costHPSP,100,0))) {
- callfunc "F_keIntro", e_sry, "Sorry, you don't have enough to be healed.";
- return;
- }
- emotion e_no1;
- heal @qtyHP,@qtySP;
- return;
-}
-
-//Function storage: allows access to the storage facility
-//The sent argument is the displaying image, so we can clear it afterwards.
-function script F_keStorage {
- if(basicskillcheck(0) > 0 && getskilllv(1) < 6) {
- callfunc "F_keIntro", -1, "I am sorry, but you beed basic skill level 6 to use the storage.";
- return;
- }
- if (!(callfunc("F_keCharge",$@kes_cost,100,1))) {
- callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny.";
- return;
- }
- mes "Thank for you using Kafra services.";
- emotion e_thx;
- close2;
- openstorage;
- cutin getarg(0), 255;
- end;
-}
-
-//Function G Storage: Allows access to the Guild Storage
-function script F_keGuildStorage {
- if(basicskillcheck(0) > 0 && getskilllv(1) < 6) {
- callfunc "F_keIntro", -1, "I am sorry, but you beed basic skill level 6 to use the storage.";
- return;
- }
- if(getcharid(2) < 1) {
- callfunc "F_keIntro", e_swt, "You can't use the Guild Storage if you don't belong to a guild!";
- return;
- }
- if (callfunc("F_keCost",$@kegs_cost,100) > Zeny) {
- callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny.";
- return;
- }
- if (guildopenstorage(0) == 1) {
- callfunc "F_keIntro", -1, "Sorry, the guild storage is currently in use by someone else. Try again later.";
- return;
- }
- callfunc "F_keCharge",$@kegs_cost,100,1;
- mes "Thank for you using Kafra services.";
- emotion e_thx;
- close2;
- cutin getarg(0), 255;
- end;
-}
-
-function script F_kePass {
- if (@kafraPass) {
- callfunc "F_keIntro", -1, "You already are using a Kafra Pass...";
- return;
- }
- if (countitem(1084)<1) {
- callfunc "F_keIntro", -1, "You obviously need a 'Kafra Pass' if you want to activate it.";
- return;
- }
- delitem 1084,1;
- set @kafraPass,1;
- callfunc "F_keIntro", e_lv, "Your Kafra Pass has been activated.";
- return;
-}
-
-//F_keCost(int cost, int discount%)
-//Returns what would be the cost of a service considering the KafraPass.
-//The discount value should be between 0 and 100
-function script F_keCost {
- if (@kafraPass) {
- return getarg(0)*(100-getarg(1))/100;
- }
- return getarg(0);
-}
-
-//F_keCharge(int cost, int discount%, bool appliesKP)
-//Charges for a service, using the KafraPass state and discount value.
-//appliesKP marks if the cost savings apply for stocking Kafra Reserve Points
-//Function returns 1 if successful, 0 if there's not enough zeny.
-function script F_keCharge {
- set @savings, 0;
- if (@kafraPass)
- set @savings, getarg(0)*getarg(1)/100;
- set @cost, getarg(0)-@savings;
- if (@cost > Zeny || @cost < 0) { // (@cost < 0) for overflow protection
- return 0;
- }
- set Zeny, Zeny-@cost;
-
- if (getarg(2) && @savings > 0 && $@kekp_reserveCost > 0) {
- set @savings, @savings/$@kekp_reserveCost;
- if (@savings < $@kekp_minReserve)
- set @savings, $@kekp_minReserve;
- if (@savings > $@kekp_maxReserve)
- set @savings, $@kekp_maxReserve;
-
- set RESRVPTS, RESRVPTS + @savings;
- }
- return 1;
-}
-
-//Function F_keWarp (int cost, int discount, int emotion, String map, int x, int y)
-function script F_keWarp {
- if (!(callfunc("F_keCharge",getarg(0),getarg(1),1))) {
- callfunc "F_keIntro", e_an, "You don't have enough Zeny...";
- return;
- }
- emotion getarg(2);
- warp getarg(3),getarg(4),getarg(5);
- end;
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Main Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 5.4 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= This module contains the main menu, plus the healing and +//= storage services. +//===== Additional Comments: ================================= +//= See <http://www.eathena.deltaanime.net/board/index.php?showtopic=20290> +//= for indepth explanation of the Kafra Express Script Package. +//= Services available: comment/uncomment what you want (lines 37-104) +//= See config.txt for per-module configuration. +//============================================================ + +// F_KafraExpress (String "Kafra's name", String "kafra image file", +//int location (0 = Town Kafra, 1 = Dungeon Kafra, 2 = Both), +//String "save map", int save x, int save y) +function script F_KafraExpress { + set @name$,getarg(0); + set @ke_type,getarg(2); + if ($@kekp_reset) + set @kafraPass,0; + if (getarg(1) != "") + cutin getarg(1),2; + callfunc "F_keIntro",-1,""; + +M_INIT: + set @discount, callfunc("F_keCost",1,100); + + if (@ke_type == 1) goto MD_INIT; + menu + "- Leave",L_END, + "- Heal Service ("+($@keh_hpCost*@discount)+"z/10HP - "+($@keh_spCost*@discount)+"z/10SP)",L_HEAL, + "- Warp Service",M_WARP, + "- Use Storage ("+($@kes_cost*@discount)+"z)",L_STORAGE, + "- Use Guild Storage ("+($@kegs_cost*@discount)+"z)",L_GUILD_STORAGE, + "- Job Services",M_JOB, + "- Other Services",M_OTHER, + "- Save Respawn point",L_SAVE; + +MD_INIT: + menu + "- Leave",L_END, + "- Heal Service ("+($@keh_hpCost*@discount)+"z/10HP - "+($@keh_spCost*@discount)+"z/10SP)",L_HEAL, + "- Warp Service",M_WARP, + "- Use Storage ("+($@kes_cost*@discount)+"z)",L_STORAGE, + "- Use Guild Storage ("+($@kegs_cost*@discount)+"z)",L_GUILD_STORAGE, + "- Job Services",M_JOB, + "- Other Services",M_OTHER, + "- Save Respawn point",L_SAVE; + +M_WARP: + if (@ke_type == 3 && nif_q_done != 1) + goto L_DENIED; + if (@ke_type == 1) + goto MD_WARP; + menu + "- Return",M_INIT, + "- Dungeons",L_DUNGEON, + "- PvP Arena",L_PVP, + "- Guild Wars",L_GUILD_DUNGEON, + "- Towns",L_TOWN; + +MD_WARP: + menu + "- Return",M_INIT, + "- Dungeons",L_DUNGEON, + "- PvP Arena",L_PVP, + "- Guild Wars",L_GUILD_DUNGEON, + "- Towns",L_TOWN; + +M_JOB: + if (@ke_type == 1) goto MD_JOB; + menu + "- Return", M_INIT, + "- Change Job",L_JOB_CHANGE, + "- Swap Job",L_JOB_SWAP, + "- Stat/Skill Services",L_STATS, + "- Stat/Skill Market",L_STAT_MARKET, + "- Rental Service",L_RENT; + +MD_JOB: + menu + "- Return", M_INIT, + "- Change Job",L_JOB_CHANGE, + "- Swap Job",L_JOB_SWAP, + "- Stat/Skill Services",L_STATS, + "- Stat/Skill Market",L_STAT_MARKET, + "- Rental Service",L_RENT; + +M_OTHER: + if (@ke_type == 1) goto MD_OTHER; + menu + "- Return",M_INIT, + "- Bank Services",L_BANK, + "- Use Kafra Shop",L_SHOP, + "- Broadcast a message",L_BROADCAST, + "- Refine Services",L_REFINE, + "- Uncard Services",L_UNCARD, + "- Stylist Service",L_STYLE, + "- Use a Kafra Pass",L_PASS; + +MD_OTHER: + menu + "- Return",M_INIT, + "- Bank Services",L_BANK, + "- Use Kafra Shop",L_SHOP, + "- Broadcast a message",L_BROADCAST, + "- Refine Services",L_REFINE, + "- Uncard Services",L_UNCARD, + "- Stylist Service",L_STYLE, + "- Use a Kafra Pass",L_PASS; + +L_HEAL: + callfunc "F_keHeal"; + goto M_INIT; + +L_TOWN: + callfunc "F_keWarpTown"; + goto M_WARP; + +L_DUNGEON: + callfunc "F_keDungeonWarps", getarg(3); + goto M_WARP; + +L_GUILD_DUNGEON: + callfunc "F_keWarpWOE"; + goto M_WARP; + +L_PVP: + callfunc "F_keWarpPvp"; + goto M_WARP; + +L_STORAGE: + callfunc "F_keStorage", getarg(1); + goto M_INIT; + +L_GUILD_STORAGE: + callfunc "F_keGuildStorage", getarg(1); + goto M_INIT; + +L_BANK: + callfunc "F_keBank"; + goto M_OTHER; + +L_SHOP: + callfunc "F_keShop",@ke_type, getarg(1); + goto M_OTHER; + +L_BROADCAST: + callfunc "F_keBroadcast",getarg(3); + goto M_OTHER; + +L_PASS: + callfunc "F_kePass"; + goto M_OTHER; + +L_REFINE: + callfunc "F_keRefine"; + goto M_OTHER; + +L_UNCARD: + callfunc "F_keUncard"; + goto M_OTHER; + +L_STYLE: + callfunc "F_keStylist"; + goto M_OTHER; + +L_JOB_CHANGE: + callfunc "F_keJobChange"; + goto M_JOB; + +L_JOB_SWAP: + callfunc "F_keJobSwap"; + goto M_JOB; + +L_STATS: + callfunc "F_keStats"; + goto M_JOB; + +L_STAT_MARKET: + callfunc "F_keStatMarket"; + goto M_JOB; + +L_RENT: + callfunc "F_keRent"; + goto M_JOB; + +L_SAVE: + if (@ke_type == 3 && nif_q_done != 1) + goto L_DENIED; + if ($@kewt_travel && @ke_type != 1) { + callfunc "F_keAddTravelTown", getarg(3); + } + if ($@kewd_travel && @ke_type != 0) { + callfunc "F_keAddTravelDungeon", getarg(3); + } + if ($@ke_saveOnSpot) { + getmapxy @map$,@x,@y,0; + savepoint @map$,@x,@y; + } else { + savepoint getarg(3),getarg(4),getarg(5); + } + emotion e_scissors; + goto M_INIT; + +L_DENIED: + callfunc "F_keIntro", e_gg, "...no."; + goto M_INIT; + +L_END: + mes "Thank you for using Kafra Services."; + close2; + cutin getarg(1), 255; + end; +} + +//Function F_keIntro (emotion, message) +//Displays a message followed by an emotion, then a next button, and finally +//shows the intro message. +function script F_keIntro { + if (getarg(0) >= 0) + emotion getarg(0); + if (getarg(1) != "") { + mes getarg(1); + next; + } + mes "["+@name$+"]"; + mes "Welcome to Kafra Corp. Always by your side, wherever you go."; + if(@kafraPass) mes "Your Kafra Pass is active,"; + mes "How may I be of help?"; + return; +} + +//Function Heal, offers the heal subsystem. +function script F_keHeal { + set @qtyHP,MaxHp-Hp; + set @qtySP,MaxSp-Sp; + set @costHP, $@keh_hpCost*(MaxHp-Hp)/10; + set @costSP, $@keh_spCost*(MaxSp-Sp)/10; + set @costHPSP, @costHP+@costSP; + set @discount, callfunc("F_keCost",1,100); + + if (@qtyHP + @qtySP == 0) { + callfunc "F_keIntro", -1, "...you don't need to be healed."; + return; + } + if (@qtyHP == 0) goto M_NO_HP; + if (@qtySP == 0) goto M_NO_SP; + menu "- Cancel",-, + "- Heal HP ("+(@costHP*@discount)+"z)",L_HEAL_HP, + "- Heal SP ("+(@costSP*@discount)+"z)",L_HEAL_SP, + "- Heal Both ("+(@costHPSP*@discount)+"z)",L_HEAL_ALL; + return; + +M_NO_HP: + menu "- Cancel",-, + "- Heal SP ("+(@costSP*@discount)+"z)",L_HEAL_SP; + return; + +M_NO_SP: + menu "- Cancel",-, + "- Heal HP ("+(@costHP*@discount)+"z)",L_HEAL_HP; + return; + +L_HEAL_HP: + if (!(callfunc("F_keCharge",@costHP,100,0))) { + callfunc "F_keIntro", e_sry, "Sorry, you don't have enough to be healed."; + return; + } + emotion e_no1; + heal @qtyHP,0; + return; + +L_HEAL_SP: + if (!(callfunc("F_keCharge",@costSP,100,0))) { + callfunc "F_keIntro", e_sry, "Sorry, you don't have enough to be healed."; + return; + } + emotion e_no1; + heal 0,@qtySP; + return; + +L_HEAL_ALL: + if (!(callfunc("F_keCharge",@costHPSP,100,0))) { + callfunc "F_keIntro", e_sry, "Sorry, you don't have enough to be healed."; + return; + } + emotion e_no1; + heal @qtyHP,@qtySP; + return; +} + +//Function storage: allows access to the storage facility +//The sent argument is the displaying image, so we can clear it afterwards. +function script F_keStorage { + if(basicskillcheck(0) > 0 && getskilllv(1) < 6) { + callfunc "F_keIntro", -1, "I am sorry, but you beed basic skill level 6 to use the storage."; + return; + } + if (!(callfunc("F_keCharge",$@kes_cost,100,1))) { + callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny."; + return; + } + mes "Thank for you using Kafra services."; + emotion e_thx; + close2; + openstorage; + cutin getarg(0), 255; + end; +} + +//Function G Storage: Allows access to the Guild Storage +function script F_keGuildStorage { + if(basicskillcheck(0) > 0 && getskilllv(1) < 6) { + callfunc "F_keIntro", -1, "I am sorry, but you beed basic skill level 6 to use the storage."; + return; + } + if(getcharid(2) < 1) { + callfunc "F_keIntro", e_swt, "You can't use the Guild Storage if you don't belong to a guild!"; + return; + } + if (callfunc("F_keCost",$@kegs_cost,100) > Zeny) { + callfunc "F_keIntro", e_an, "Sorry, but you don't have enough Zeny."; + return; + } + if (guildopenstorage(0) == 1) { + callfunc "F_keIntro", -1, "Sorry, the guild storage is currently in use by someone else. Try again later."; + return; + } + callfunc "F_keCharge",$@kegs_cost,100,1; + mes "Thank for you using Kafra services."; + emotion e_thx; + close2; + cutin getarg(0), 255; + end; +} + +function script F_kePass { + if (@kafraPass) { + callfunc "F_keIntro", -1, "You already are using a Kafra Pass..."; + return; + } + if (countitem(1084)<1) { + callfunc "F_keIntro", -1, "You obviously need a 'Kafra Pass' if you want to activate it."; + return; + } + delitem 1084,1; + set @kafraPass,1; + callfunc "F_keIntro", e_lv, "Your Kafra Pass has been activated."; + return; +} + +//F_keCost(int cost, int discount%) +//Returns what would be the cost of a service considering the KafraPass. +//The discount value should be between 0 and 100 +function script F_keCost { + if (@kafraPass) { + return getarg(0)*(100-getarg(1))/100; + } + return getarg(0); +} + +//F_keCharge(int cost, int discount%, bool appliesKP) +//Charges for a service, using the KafraPass state and discount value. +//appliesKP marks if the cost savings apply for stocking Kafra Reserve Points +//Function returns 1 if successful, 0 if there's not enough zeny. +function script F_keCharge { + set @savings, 0; + if (@kafraPass) + set @savings, getarg(0)*getarg(1)/100; + set @cost, getarg(0)-@savings; + if (@cost > Zeny || @cost < 0) { // (@cost < 0) for overflow protection + return 0; + } + set Zeny, Zeny-@cost; + + if (getarg(2) && @savings > 0 && $@kekp_reserveCost > 0) { + set @savings, @savings/$@kekp_reserveCost; + if (@savings < $@kekp_minReserve) + set @savings, $@kekp_minReserve; + if (@savings > $@kekp_maxReserve) + set @savings, $@kekp_maxReserve; + + set RESRVPTS, RESRVPTS + @savings; + } + return 1; +} + +//Function F_keWarp (int cost, int discount, int emotion, String map, int x, int y) +function script F_keWarp { + if (!(callfunc("F_keCharge",getarg(0),getarg(1),1))) { + callfunc "F_keIntro", e_an, "You don't have enough Zeny..."; + return; + } + emotion getarg(2); + warp getarg(3),getarg(4),getarg(5); + end; +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_refine.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_refine.txt index 88c5104f0..b59830e89 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_refine.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_refine.txt @@ -1,339 +1,339 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Refining Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 2.7
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Does item forging, ore purifying and repairing.
-//= Can also sell phracon/emveretarcon
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_refine -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadRefine";
- end;
-}
-
-function script F_keRefine {
-
-function SF_refine;
-function SF_repair;
-function SF_purify;
-function SF_sellOres;
-
- do {
- set @kmenu, select(
- "- Return",
- "- Refine Equipment",
- "- Repair Equipment",
- "- Buy Ores",
- "- Purify Ores"
- );
- switch(@kmenu) {
- case 2: //Refine
- SF_refine();
- break;
- case 3: //Repair
- SF_repair();
- break;
- case 4: //Buy Ore
- SF_sellOres();
- break;
- case 5: //Purify Ore
- SF_purify();
- break;
- }
- } while (@kmenu > 1);
- return;
-
-//Subfunction SF_refine, presents the refining menu.
-function SF_refine {
- do {
- set @part, select(
- "- Cancel upgrading",
- "- "+getequipname(1),
- "- "+getequipname(2),
- "- "+getequipname(3),
- "- "+getequipname(4),
- "- "+getequipname(5),
- "- "+getequipname(6),
- "- "+getequipname(7),
- "- "+getequipname(8),
- "- "+getequipname(9),
- "- "+getequipname(10)
- );
- set @part, @part-1;
- if (@part == 0)
- break;
- if (getequipisequiped(@part) == 0) {
- callfunc "F_keIntro", e_swt, "There is nothing to refine there...";
- } else
- if(getequipisenableref(@part) == 0 && $@kerf_refineAll == 0) {
- callfunc "F_keIntro", -1, "Sorry, this item cannot be refined.";
- } else
- if(getequiprefinerycnt(@part) >= $@kerf_maxLv) {
- callfunc "F_keIntro", -1, "This item cannot be refined further.";
- break;
- } else {
- switch (getequipweaponlv(@part))
- {
- case 0: //Armor
- set @mat,985;
- set @cost,$@kerf_armorCost;
- break;
- case 1:
- set @mat,1010;
- set @cost,$@kerf_weaponLv1Cost;
- break;
- case 2:
- set @mat,1011;
- set @cost,$@kerf_weaponLv2Cost;
- break;
- case 3:
- set @mat,984;
- set @cost,$@kerf_weaponLv3Cost;
- break;
- default:
- set @mat,984;
- set @cost,$@kerf_weaponLv4Cost;
- break;
- }
- set @cost, callfunc("F_keCost",@cost,$@kerf_discount);
- do {
- if ($@kerf_safe==0 && getequippercentrefinery(@part) < 100) {
- if ($@kerf_showChance) {
- if (select(
- "- Return ("+(100-getequippercentrefinery(@part))+"% chance refine will fail)",
- "- Refine (Need "+getitemname(@mat)+" and "+@cost+"z)") != 2)
- break;
- } else {
- if (select(
- "- Return (Upgrade not safe, item might break!)",
- "- Refine (Need "+getitemname(@mat)+" and "+@cost+"z)") != 2)
- break;
- }
- } else {
- if (select(
- "- Refine (Need "+getitemname(@mat)+" and "+@cost+"z)",
- "- Cancel") != 1)
- break;
- }
- if (getequiprefinerycnt(@part) >= $@kerf_maxLv) {
- callfunc "F_keIntro", e_ok, "This item has reached it's maximum level.";
- break;
- }
- if (countitem(@mat) < 1) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need.";
- break;
- }
- if (!(callfunc("F_keCharge",@cost,$@kerf_discount,1))) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny.";
- break;
- }
- delitem @mat,1;
- if ($@kerf_safe || getequippercentrefinery(@part)>rand(100)) {
- successrefitem @part;
- emotion e_rock;
- } else {
- failedrefitem @part;
- callfunc "F_keIntro", e_swt, "...sorry.";
- break;
- }
- } while (1);
- }
- } while (@part > 0);
- return;
-}
-
-//Subfunction: SF_repair()
-function SF_repair {
- set @cost,callfunc("F_keCost",$@kerf_repairCost,$@kerf_repairDiscount);
- do {
- set @broken1,getbrokenid(1);
- if(@broken1==NULL) {
- callfunc "F_keIntro", -1, "You don't need anything repaired for now.";
- return;
- }
- set @broken2,getbrokenid(2);
- set @broken3,getbrokenid(3);
- set @broken4,getbrokenid(4);
- set @broken5,getbrokenid(5);
- set @broken6,getbrokenid(6);
- set @broken7,getbrokenid(7);
- set @broken8,getbrokenid(8);
- set @broken9,getbrokenid(9);
- set @broken10,getbrokenid(10);
-
- if ($@kerf_repairSteel)
- set @str$,"- Cancel (Repairing costs "+@cost+"z and 1 "+getitemname(999);
- else
- set @str$,"- Cancel (Repairing costs "+@cost+"z)";
-
- set @idRepair, select(
- @str$,
- getitemname(@broken1),
- getitemname(@broken2),
- getitemname(@broken3),
- getitemname(@broken4),
- getitemname(@broken5),
- getitemname(@broken6),
- getitemname(@broken7),
- getitemname(@broken8),
- getitemname(@broken9),
- getitemname(@broken10)
- );
- set @idRepair, @idRepair-1;
- if (@idRepair == 0) break;
- if ($@kerf_repairSteel && countitem(999) < 1) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need.";
- return;
- }
- if (!(callfunc("F_keCharge", $@kerf_repairCost, $@kerf_repairDiscount,1))) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny.";
- return;
- }
- if ($@kerf_repairSteel) delitem 999,1;
- repair(@idRepair);
- emotion e_lv2;
- } while (@idRepair > 0);
-}
-
-//Subfunction: SF_purify()
-function SF_purify {
- if ($@kerf_purifyAll) {
- set @submenu, select (
- "- Return",
- "- Purify "+getitemname(984)+" (need 5 "+getitemname(756)+")",
- "- Purify "+getitemname(985)+" (need 5 "+getitemname(757)+")",
- "- Purify "+getitemname(998)+" (need 2 "+getitemname(1002)+")",
- "- Temper "+getitemname(999)+" (need 5 "+getitemname(998)+", 1 "+getitemname(1003)+")",
- "- Temper "+getitemname(994)+" (need 10 "+getitemname(990)+")",
- "- Temper "+getitemname(995)+" (need 10 "+getitemname(991)+")",
- "- Temper "+getitemname(996)+" (need 10 "+getitemname(992)+")",
- "- Temper "+getitemname(997)+" (need 10 "+getitemname(993)+")",
- "- Temper "+getitemname(1000)+" (need 10 "+getitemname(1001)+")"
- );
- } else {
- set @submenu, select(
- "- Return",
- "- Purify "+getitemname(984)+" (need 5 "+getitemname(756)+")",
- "- Purify "+getitemname(985)+" (need 5 "+getitemname(757)+")"
- );
- }
- switch (@submenu) {
- case 2: //Oridecon
- set @item, 984;
- set @rough, 756;
- set @qty, 5;
- break;
- case 3: //Elunium
- set @item, 985;
- set @rough, 757;
- set @qty, 5;
- break;
- case 4: //Iron
- set @item, 998;
- set @rough, 1002;
- set @qty, 2;
- break;
- case 5: //Steel
- set @item,999;
- set @rough,998;
- set @qty,5;
- set @rough2,1003;
- set @qty2,1;
-
- set @count,countitem(@rough1);
- set @count2,countitem(@rough2);
- if (@count < @qty || @count2 < @qty2) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need.";
- return;
- }
- set @count, @count/@qty;
- set @count2, @count2/@qty2;
- if (@count2 < @count)
- set @count,@count2;
- delitem @rough2,@qty2*@count;
- break;
- case 6: //Fire
- set @item, 994;
- set @rough, 990;
- set @qty, 10;
- break;
- case 7: //Ice
- set @item, 995;
- set @rough, 991;
- set @qty, 10;
- break;
- case 8: //Wind
- set @item, 996;
- set @rough, 992;
- set @qty, 10;
- break;
- case 9: //Earth
- set @item, 997;
- set @rough, 993;
- set @qty, 10;
- break;
- case 10: //Star
- set @item, 1000;
- set @rough, 1001;
- set @qty, 10;
- break;
- default:
- return;
- }
- set @count,countitem(@rough);
- if (@count < @qty) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need.";
- return;
- }
- set @count, @count/@qty;
- delitem @rough,@qty*@count;
- getitem @item,@count;
- emotion e_paper;
-}
-
-//Subfunction: SF_sellOres()
-function SF_sellOres {
- do {
- set @submenu, select(
- "- Return",
- "- Buy "+getitemname(1010)+" (200z each)",
- "- Buy "+getitemname(1011)+" (1000z each)"
- );
- switch (@submenu) {
- case 2: //Phracon
- set @mat, 1010;
- set @cost, 200;
- break;
- case 3: //Emveratarcon
- set @mat, 1011;
- set @cost, 1000;
- break;
- default:
- return;
- }
- input @qty;
- set @cost,@cost*@qty;
- if (@qty < 1) {
- callfunc "F_keIntro", e_pif, "That is NOT a valid quantity...";
- } else if (@cost > Zeny) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny.";
- } else if (@cost < 0) {
- callfunc "F_keIntro", e_swt2, "Sorry, that's too much! Try buying less...";
- } else {
- set Zeny,Zeny-@cost;
- getitem @mat,@qty;
- emotion e_paper;
- }
- } while (@submenu > 1);
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Refining Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 2.7 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Does item forging, ore purifying and repairing. +//= Can also sell phracon/emveretarcon +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_refine -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadRefine"; + end; +} + +function script F_keRefine { + +function SF_refine; +function SF_repair; +function SF_purify; +function SF_sellOres; + + do { + set @kmenu, select( + "- Return", + "- Refine Equipment", + "- Repair Equipment", + "- Buy Ores", + "- Purify Ores" + ); + switch(@kmenu) { + case 2: //Refine + SF_refine(); + break; + case 3: //Repair + SF_repair(); + break; + case 4: //Buy Ore + SF_sellOres(); + break; + case 5: //Purify Ore + SF_purify(); + break; + } + } while (@kmenu > 1); + return; + +//Subfunction SF_refine, presents the refining menu. +function SF_refine { + do { + set @part, select( + "- Cancel upgrading", + "- "+getequipname(1), + "- "+getequipname(2), + "- "+getequipname(3), + "- "+getequipname(4), + "- "+getequipname(5), + "- "+getequipname(6), + "- "+getequipname(7), + "- "+getequipname(8), + "- "+getequipname(9), + "- "+getequipname(10) + ); + set @part, @part-1; + if (@part == 0) + break; + if (getequipisequiped(@part) == 0) { + callfunc "F_keIntro", e_swt, "There is nothing to refine there..."; + } else + if(getequipisenableref(@part) == 0 && $@kerf_refineAll == 0) { + callfunc "F_keIntro", -1, "Sorry, this item cannot be refined."; + } else + if(getequiprefinerycnt(@part) >= $@kerf_maxLv) { + callfunc "F_keIntro", -1, "This item cannot be refined further."; + break; + } else { + switch (getequipweaponlv(@part)) + { + case 0: //Armor + set @mat,985; + set @cost,$@kerf_armorCost; + break; + case 1: + set @mat,1010; + set @cost,$@kerf_weaponLv1Cost; + break; + case 2: + set @mat,1011; + set @cost,$@kerf_weaponLv2Cost; + break; + case 3: + set @mat,984; + set @cost,$@kerf_weaponLv3Cost; + break; + default: + set @mat,984; + set @cost,$@kerf_weaponLv4Cost; + break; + } + set @cost, callfunc("F_keCost",@cost,$@kerf_discount); + do { + if ($@kerf_safe==0 && getequippercentrefinery(@part) < 100) { + if ($@kerf_showChance) { + if (select( + "- Return ("+(100-getequippercentrefinery(@part))+"% chance refine will fail)", + "- Refine (Need "+getitemname(@mat)+" and "+@cost+"z)") != 2) + break; + } else { + if (select( + "- Return (Upgrade not safe, item might break!)", + "- Refine (Need "+getitemname(@mat)+" and "+@cost+"z)") != 2) + break; + } + } else { + if (select( + "- Refine (Need "+getitemname(@mat)+" and "+@cost+"z)", + "- Cancel") != 1) + break; + } + if (getequiprefinerycnt(@part) >= $@kerf_maxLv) { + callfunc "F_keIntro", e_ok, "This item has reached it's maximum level."; + break; + } + if (countitem(@mat) < 1) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need."; + break; + } + if (!(callfunc("F_keCharge",@cost,$@kerf_discount,1))) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny."; + break; + } + delitem @mat,1; + if ($@kerf_safe || getequippercentrefinery(@part)>rand(100)) { + successrefitem @part; + emotion e_rock; + } else { + failedrefitem @part; + callfunc "F_keIntro", e_swt, "...sorry."; + break; + } + } while (1); + } + } while (@part > 0); + return; +} + +//Subfunction: SF_repair() +function SF_repair { + set @cost,callfunc("F_keCost",$@kerf_repairCost,$@kerf_repairDiscount); + do { + set @broken1,getbrokenid(1); + if(@broken1==NULL) { + callfunc "F_keIntro", -1, "You don't need anything repaired for now."; + return; + } + set @broken2,getbrokenid(2); + set @broken3,getbrokenid(3); + set @broken4,getbrokenid(4); + set @broken5,getbrokenid(5); + set @broken6,getbrokenid(6); + set @broken7,getbrokenid(7); + set @broken8,getbrokenid(8); + set @broken9,getbrokenid(9); + set @broken10,getbrokenid(10); + + if ($@kerf_repairSteel) + set @str$,"- Cancel (Repairing costs "+@cost+"z and 1 "+getitemname(999); + else + set @str$,"- Cancel (Repairing costs "+@cost+"z)"; + + set @idRepair, select( + @str$, + getitemname(@broken1), + getitemname(@broken2), + getitemname(@broken3), + getitemname(@broken4), + getitemname(@broken5), + getitemname(@broken6), + getitemname(@broken7), + getitemname(@broken8), + getitemname(@broken9), + getitemname(@broken10) + ); + set @idRepair, @idRepair-1; + if (@idRepair == 0) break; + if ($@kerf_repairSteel && countitem(999) < 1) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need."; + return; + } + if (!(callfunc("F_keCharge", $@kerf_repairCost, $@kerf_repairDiscount,1))) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny."; + return; + } + if ($@kerf_repairSteel) delitem 999,1; + repair(@idRepair); + emotion e_lv2; + } while (@idRepair > 0); +} + +//Subfunction: SF_purify() +function SF_purify { + if ($@kerf_purifyAll) { + set @submenu, select ( + "- Return", + "- Purify "+getitemname(984)+" (need 5 "+getitemname(756)+")", + "- Purify "+getitemname(985)+" (need 5 "+getitemname(757)+")", + "- Purify "+getitemname(998)+" (need 2 "+getitemname(1002)+")", + "- Temper "+getitemname(999)+" (need 5 "+getitemname(998)+", 1 "+getitemname(1003)+")", + "- Temper "+getitemname(994)+" (need 10 "+getitemname(990)+")", + "- Temper "+getitemname(995)+" (need 10 "+getitemname(991)+")", + "- Temper "+getitemname(996)+" (need 10 "+getitemname(992)+")", + "- Temper "+getitemname(997)+" (need 10 "+getitemname(993)+")", + "- Temper "+getitemname(1000)+" (need 10 "+getitemname(1001)+")" + ); + } else { + set @submenu, select( + "- Return", + "- Purify "+getitemname(984)+" (need 5 "+getitemname(756)+")", + "- Purify "+getitemname(985)+" (need 5 "+getitemname(757)+")" + ); + } + switch (@submenu) { + case 2: //Oridecon + set @item, 984; + set @rough, 756; + set @qty, 5; + break; + case 3: //Elunium + set @item, 985; + set @rough, 757; + set @qty, 5; + break; + case 4: //Iron + set @item, 998; + set @rough, 1002; + set @qty, 2; + break; + case 5: //Steel + set @item,999; + set @rough,998; + set @qty,5; + set @rough2,1003; + set @qty2,1; + + set @count,countitem(@rough1); + set @count2,countitem(@rough2); + if (@count < @qty || @count2 < @qty2) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need."; + return; + } + set @count, @count/@qty; + set @count2, @count2/@qty2; + if (@count2 < @count) + set @count,@count2; + delitem @rough2,@qty2*@count; + break; + case 6: //Fire + set @item, 994; + set @rough, 990; + set @qty, 10; + break; + case 7: //Ice + set @item, 995; + set @rough, 991; + set @qty, 10; + break; + case 8: //Wind + set @item, 996; + set @rough, 992; + set @qty, 10; + break; + case 9: //Earth + set @item, 997; + set @rough, 993; + set @qty, 10; + break; + case 10: //Star + set @item, 1000; + set @rough, 1001; + set @qty, 10; + break; + default: + return; + } + set @count,countitem(@rough); + if (@count < @qty) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have the materials I need."; + return; + } + set @count, @count/@qty; + delitem @rough,@qty*@count; + getitem @item,@count; + emotion e_paper; +} + +//Subfunction: SF_sellOres() +function SF_sellOres { + do { + set @submenu, select( + "- Return", + "- Buy "+getitemname(1010)+" (200z each)", + "- Buy "+getitemname(1011)+" (1000z each)" + ); + switch (@submenu) { + case 2: //Phracon + set @mat, 1010; + set @cost, 200; + break; + case 3: //Emveratarcon + set @mat, 1011; + set @cost, 1000; + break; + default: + return; + } + input @qty; + set @cost,@cost*@qty; + if (@qty < 1) { + callfunc "F_keIntro", e_pif, "That is NOT a valid quantity..."; + } else if (@cost > Zeny) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny."; + } else if (@cost < 0) { + callfunc "F_keIntro", e_swt2, "Sorry, that's too much! Try buying less..."; + } else { + set Zeny,Zeny-@cost; + getitem @mat,@qty; + emotion e_paper; + } + } while (@submenu > 1); +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt index b25691cb2..286739204 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt @@ -1,128 +1,128 @@ -//===== eAthena Script =======================================
-//= Kafra Expres - Stat/Skill Market Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 2.0
-//===== Compatible With: =====================================
-//= eAthena SVN R3579+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Lets players buy/sell skill points/stat points
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_statmarket -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadStatMarket";
- end;
-}
-
-function script F_keStatMarket {
- set @discount,callfunc("F_keCost",100,$@kesm_discount);
- do {
- set @kmenu, select (
- "- Return",
- "- Buy Stat points ("+($@kesm_stBuyPrice*@discount/100)+"z each)",
- "- Sell Stat points (up to "+StatusPoint+"/"+$@kesm_stSellPrice+"z each)",
- "- Buy Skill points ("+($@kesm_skBuyPrice*@discount/100)+"z each)",
- "- Sell Skill points (up to "+SkillPoint+"/"+$@kesm_skSellPrice+"z each)",
- "- Trade Stats -> Skill ("+$@kesm_skTradePrice+" stats/skill)",
- "- Trade Skills -> Stats ("+$@kesm_stTradePrice+" stats/skill)"
- );
- if (@kmenu > 1)
- input @qty;
- switch (@kmenu) {
- case 2: //Buy Stat
- set @min, 1;
- set @max, 9999;
- set @cost, @qty*$@kesm_stBuyPrice;
- break;
- case 3: //Sell Stat
- input @qty;
- set @min, 1;
- set @max, StatusPoint;
- set @cost, @qty*$@kesm_stSellPrice;
- break;
- case 4: //Buy Skill
- set @min, 1;
- set @max, 9999;
- set @cost, @qty*$@kesm_skBuyPrice;
- break;
- case 5: //Sell Skill
- set @min, 1;
- set @max, SkillPoint;
- set @cost, @qty*$@kesm_skSellPrice;
- break;
- case 6: //Convert stats -> skills
- set @min, $@kesm_skTradePrice;
- set @max, StatusPoint;
- set @cost, @qty/$@kesm_skTradePrice;
- break;
- case 7: //Convert skills -> stats
- set @min, 1;
- set @max, SkillPoint;
- set @cost, @qty*$@kesm_stTradePrice;
- break;
- default:
- return;
- }
- if (@qty < @min) {
- if (@min == 1)
- callfunc "F_keIntro", e_dots, "Was that supposed to be funny?";
- else
- callfunc "F_keIntro", e_dots, "That is not enough to buy a single skill...";
- } else
- if (@qty > @max) {
- if (@max == 9999)
- callfunc "F_keIntro", e_X, "You can't buy that much!";
- else
- callfunc "F_keIntro", e_X, "You don't have that many to sell...";
- } else
- if (@cost < 0) {
- callfunc "F_keIntro", e_swt2, "That is too much for a single transaction! Try a smaller quantity... please?";
- } else {
- switch(@kmenu) {
- case 2: //Buy Stat
- if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) {
- callfunc "F_keIntro", e_X, "You do not have enough zeny to buy that much.";
- break;
- }
- set StatusPoint,StatusPoint+@qty;
- emotion e_oh;
- break;
- case 3: //Sell Stat
- set StatusPoint,StatusPoint-@qty;
- set Zeny,Zeny+@cost;
- emotion e_oh;
- break;
- case 4: //Buy Skill
- if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) {
- callfunc "F_keIntro", e_X, "You do not have enough zeny to buy that much.";
- break;
- }
- set SkillPoint,SkillPoint+@qty;
- emotion e_oh;
- break;
- case 5: //Sell Skill
- set SkillPoint,SkillPoint-@qty;
- set Zeny,Zeny+@cost;
- emotion e_oh;
- break;
- case 6: //Convert stats -> skills
- set @qty, @cost*$@kesm_skTradePrice;
- set StatusPoint,StatusPoint-@qty;
- set SkillPoint,SkillPoint+@cost;
- emotion e_oh;
- break;
- case 7: //Convert skills -> stats
- set SkillPoint,SkillPoint-@qty;
- set StatusPoint,StatusPoint+@cost;
- emotion e_oh;
- break;
- }
- }
- } while (@kmenu > 1);
- return;
-}
+//===== eAthena Script ======================================= +//= Kafra Expres - Stat/Skill Market Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 2.0 +//===== Compatible With: ===================================== +//= eAthena SVN R3579+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Lets players buy/sell skill points/stat points +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_statmarket -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadStatMarket"; + end; +} + +function script F_keStatMarket { + set @discount,callfunc("F_keCost",100,$@kesm_discount); + do { + set @kmenu, select ( + "- Return", + "- Buy Stat points ("+($@kesm_stBuyPrice*@discount/100)+"z each)", + "- Sell Stat points (up to "+StatusPoint+"/"+$@kesm_stSellPrice+"z each)", + "- Buy Skill points ("+($@kesm_skBuyPrice*@discount/100)+"z each)", + "- Sell Skill points (up to "+SkillPoint+"/"+$@kesm_skSellPrice+"z each)", + "- Trade Stats -> Skill ("+$@kesm_skTradePrice+" stats/skill)", + "- Trade Skills -> Stats ("+$@kesm_stTradePrice+" stats/skill)" + ); + if (@kmenu > 1) + input @qty; + switch (@kmenu) { + case 2: //Buy Stat + set @min, 1; + set @max, 9999; + set @cost, @qty*$@kesm_stBuyPrice; + break; + case 3: //Sell Stat + input @qty; + set @min, 1; + set @max, StatusPoint; + set @cost, @qty*$@kesm_stSellPrice; + break; + case 4: //Buy Skill + set @min, 1; + set @max, 9999; + set @cost, @qty*$@kesm_skBuyPrice; + break; + case 5: //Sell Skill + set @min, 1; + set @max, SkillPoint; + set @cost, @qty*$@kesm_skSellPrice; + break; + case 6: //Convert stats -> skills + set @min, $@kesm_skTradePrice; + set @max, StatusPoint; + set @cost, @qty/$@kesm_skTradePrice; + break; + case 7: //Convert skills -> stats + set @min, 1; + set @max, SkillPoint; + set @cost, @qty*$@kesm_stTradePrice; + break; + default: + return; + } + if (@qty < @min) { + if (@min == 1) + callfunc "F_keIntro", e_dots, "Was that supposed to be funny?"; + else + callfunc "F_keIntro", e_dots, "That is not enough to buy a single skill..."; + } else + if (@qty > @max) { + if (@max == 9999) + callfunc "F_keIntro", e_X, "You can't buy that much!"; + else + callfunc "F_keIntro", e_X, "You don't have that many to sell..."; + } else + if (@cost < 0) { + callfunc "F_keIntro", e_swt2, "That is too much for a single transaction! Try a smaller quantity... please?"; + } else { + switch(@kmenu) { + case 2: //Buy Stat + if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) { + callfunc "F_keIntro", e_X, "You do not have enough zeny to buy that much."; + break; + } + set StatusPoint,StatusPoint+@qty; + emotion e_oh; + break; + case 3: //Sell Stat + set StatusPoint,StatusPoint-@qty; + set Zeny,Zeny+@cost; + emotion e_oh; + break; + case 4: //Buy Skill + if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) { + callfunc "F_keIntro", e_X, "You do not have enough zeny to buy that much."; + break; + } + set SkillPoint,SkillPoint+@qty; + emotion e_oh; + break; + case 5: //Sell Skill + set SkillPoint,SkillPoint-@qty; + set Zeny,Zeny+@cost; + emotion e_oh; + break; + case 6: //Convert stats -> skills + set @qty, @cost*$@kesm_skTradePrice; + set StatusPoint,StatusPoint-@qty; + set SkillPoint,SkillPoint+@cost; + emotion e_oh; + break; + case 7: //Convert skills -> stats + set SkillPoint,SkillPoint-@qty; + set StatusPoint,StatusPoint+@cost; + emotion e_oh; + break; + } + } + } while (@kmenu > 1); + return; +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt index 8ad75e7a6..73618c9eb 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt @@ -1,130 +1,130 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Stat/Reset Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 2.2
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers stat raising and Stat/Reset skills
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_stats -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadStats";
- end;
-}
-
-function script F_keStats {
-
- function SF_statRaise;
-
- set @discount,callfunc("F_keCost",100,$@kest_discount);
- do {
- set @kmenu, select(
- "- Return",
- "- Raise Stats",
- "- Reset Stats ("+$@kest_stResetCost+"z+"+$@kest_BaseLvCost+"/blv)",
- "- Reset Skills ("+$@kest_skResetCost+"z+"+$@kest_JobLvCost+"/jlv)",
- "- Reset Both ("+$@kest_resetCost+"z+"+$@kest_BothLvCost+"/lv)"
- );
- switch (@kmenu) {
- case 2: //Stat raising
- SF_statRaise();
- set @cost, 0;
- set @reset, 0;
- break;
- case 3: //Reset Stat
- set @cost, $@kest_stResetCost+BaseLevel*$@kest_BaseLvCost;
- set @reset, 1;
- break;
- case 4: //Reset Skills
- set @cost, $@kest_skResetCost+(JobLevel+jobchange_level)*$@kest_JobLvCost;
- set @reset, 2;
- break;
- case 5: //Reset Both
- set @cost, $@kest_resetCost+(BaseLevel+JobLevel+jobchange_level)*$@kest_BothLvCost;
- set @reset, 3;
- break;
- default: //Cancel
- set @cost, 0;
- set @reset, 0;
- break;
- }
- if (@reset > 0) {
- if (select("- Cancel","- Reset for "+(@cost*@discount/100)+"z") == 2) {
- if (!(callfunc("F_keCharge",@cost,$@kest_discount,1))) {
- callfunc "F_keIntro", e_an, "Sorry, you don't have enough Zeny.";
- } else {
- if (@reset&1)
- ResetStatus;
- if (@reset&2) {
- if ($@kest_resetBasic)
- ResetSkill;
- else {
- set @skill1,getskilllv(1);
- ResetSkill;
- skill 1,@skill1,0;
- set SkillPoint,SkillPoint-@skill1;
- }
- }
- emotion e_hmm;
- }
- }
- }
- } while (@kmenu > 1);
- return;
-
-function SF_statRaise {
- do {
- set @submenu, select(
- "- Return",
- "- Raise Strength",
- "- Raise Agility",
- "- Raise Vitality",
- "- Raise Intelligence",
- "- Raise Dexterity",
- "- Raise Luck"
- );
- switch (@submenu) {
- case 2:
- set @stat,bStr;
- break;
- case 3:
- set @stat,bAgi;
- break;
- case 4:
- set @stat,bVit;
- break;
- case 5:
- set @stat,bInt;
- break;
- case 6:
- set @stat,bDex;
- break;
- case 7:
- set @stat,bLuk;
- break;
- default:
- return;
- }
- input @qty;
- if (@qty <1) {
- callfunc "F_keIntro", e_swt, "I don't lower stats, try resetting them.";
- } else if (@qty >100) {
- callfunc "F_keIntro", e_swt2, "Sorry... I can only raise stats up to 100 at a time.";
- } else {
- do {
- statusup @stat;
- set @qty,@qty-1;
- } while (@qty > 0);
- emotion e_ok;
- }
- } while (@submenu > 1);
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Stat/Reset Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 2.2 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers stat raising and Stat/Reset skills +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_stats -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadStats"; + end; +} + +function script F_keStats { + + function SF_statRaise; + + set @discount,callfunc("F_keCost",100,$@kest_discount); + do { + set @kmenu, select( + "- Return", + "- Raise Stats", + "- Reset Stats ("+$@kest_stResetCost+"z+"+$@kest_BaseLvCost+"/blv)", + "- Reset Skills ("+$@kest_skResetCost+"z+"+$@kest_JobLvCost+"/jlv)", + "- Reset Both ("+$@kest_resetCost+"z+"+$@kest_BothLvCost+"/lv)" + ); + switch (@kmenu) { + case 2: //Stat raising + SF_statRaise(); + set @cost, 0; + set @reset, 0; + break; + case 3: //Reset Stat + set @cost, $@kest_stResetCost+BaseLevel*$@kest_BaseLvCost; + set @reset, 1; + break; + case 4: //Reset Skills + set @cost, $@kest_skResetCost+(JobLevel+jobchange_level)*$@kest_JobLvCost; + set @reset, 2; + break; + case 5: //Reset Both + set @cost, $@kest_resetCost+(BaseLevel+JobLevel+jobchange_level)*$@kest_BothLvCost; + set @reset, 3; + break; + default: //Cancel + set @cost, 0; + set @reset, 0; + break; + } + if (@reset > 0) { + if (select("- Cancel","- Reset for "+(@cost*@discount/100)+"z") == 2) { + if (!(callfunc("F_keCharge",@cost,$@kest_discount,1))) { + callfunc "F_keIntro", e_an, "Sorry, you don't have enough Zeny."; + } else { + if (@reset&1) + ResetStatus; + if (@reset&2) { + if ($@kest_resetBasic) + ResetSkill; + else { + set @skill1,getskilllv(1); + ResetSkill; + skill 1,@skill1,0; + set SkillPoint,SkillPoint-@skill1; + } + } + emotion e_hmm; + } + } + } + } while (@kmenu > 1); + return; + +function SF_statRaise { + do { + set @submenu, select( + "- Return", + "- Raise Strength", + "- Raise Agility", + "- Raise Vitality", + "- Raise Intelligence", + "- Raise Dexterity", + "- Raise Luck" + ); + switch (@submenu) { + case 2: + set @stat,bStr; + break; + case 3: + set @stat,bAgi; + break; + case 4: + set @stat,bVit; + break; + case 5: + set @stat,bInt; + break; + case 6: + set @stat,bDex; + break; + case 7: + set @stat,bLuk; + break; + default: + return; + } + input @qty; + if (@qty <1) { + callfunc "F_keIntro", e_swt, "I don't lower stats, try resetting them."; + } else if (@qty >100) { + callfunc "F_keIntro", e_swt2, "Sorry... I can only raise stats up to 100 at a time."; + } else { + do { + statusup @stat; + set @qty,@qty-1; + } while (@qty > 0); + emotion e_ok; + } + } while (@submenu > 1); +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_uncard.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_uncard.txt index d39d5d1bc..4ff5b7c8b 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_uncard.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_uncard.txt @@ -1,165 +1,165 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Uncarder Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 1.5
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers uncarding services.
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_uncard -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadUncard";
- end;
-}
-
-function script F_keUncard {
-
-function SF_uncard;
-
- do {
- set @kmenu, select(
- "- Return",
- "- See Price Specifics",
- "- "+getequipname(1),
- "- "+getequipname(2),
- "- "+getequipname(3),
- "- "+getequipname(4),
- "- "+getequipname(5),
- "- "+getequipname(6),
- "- "+getequipname(7),
- "- "+getequipname(8),
- "- "+getequipname(9),
- "- "+getequipname(10)
- );
- if (@kmenu == 1)
- return;
- if (@kmenu == 2) { //Details
- mes "Okay, listen up...";
- next;
- mes "["+@name$+"]";
- if ($@keuc_BaseCost)
- mes "The base cost is of "+$@keuc_BaseCost+"z.";
- mes "Each card to be removed incurs a cost of +"+$@keuc_CardCost+"z.";
- mes "The refine level of the compounded equipment can incur an additional cost:";
- mes "Armors: "+$@keuc_UpgradeCostA+"z per level.";
- mes "Lv1 Weapons: "+$@keuc_UpgradeCostW1+"z per level.";
- mes "Lv2 Weapons: "+$@keuc_UpgradeCostW2+"z per level.";
- mes "Lv3 Weapons: "+$@keuc_UpgradeCostW3+"z per level.";
- mes "Lv4 Weapons: "+$@keuc_UpgradeCostW4+"z per level.";
-
- if ($@keuc_Mat1 && $@keuc_Qty1) {
- mes "The materials needed are:";
- mes "- "+$@keuc_Qty1+" "+getitemname($@keuc_Mat1)+".";
- }
- if ($@keuc_Mat2 && $@keuc_Qty2)
- mes "- "+$@keuc_Qty2+" "+getitemname($@keuc_Mat2)+".";
-
- if ($@keuc_Fail1Chance || $@keuc_Fail2Chance)
- mes "There is a chance the process might fail and you'll lose your items.";
-
- next;
- callfunc "F_keIntro", -1, "";
- } else {
- if (SF_uncard(@kmenu-2))
- return;
- }
- } while (@kmenu >1);
- return;
-
-//Subfunction SF_uncard (equipment-position)
-//Attempts to uncard the equipment.
-function SF_uncard {
- set @part, getarg(0);
- if(getequipcardcnt(@part) == 0) {
- callfunc "F_keIntro", e_ag, "There are no cards to remove there!";
- return 0;
- }
- set @cost, $@keuc_BaseCost;
- set @cost, @cost + $@keuc_CardCost*getequipcardcnt(@part);
-
- switch (getequipweaponlv(@part)) {
- case 0: //Armor
- set @upgradeCost, $@keuc_UpgradeCostA;
- break;
- case 1: //Lv1 Weapons
- set @upgradeCost, $@keuc_UpgradeCostW1;
- break;
- case 2: //Lv2 Weapons
- set @upgradeCost, $@keuc_UpgradeCostW2;
- break;
- case 3: //Lv3 Weapons
- set @upgradeCost, $@keuc_UpgradeCostW3;
- break;
- default: //Lv4 Weapons
- set @upgradeCost, $@keuc_UpgradeCostW4;
- }
-
- set @cost, @cost + @upgradeCost*getequiprefinerycnt(@part);
-
- set @price, callfunc("F_keCost",@cost,$@keuc_discount);
-
- if ($@keuc_Fail1Chance) {
- set @failsave, select(
- "- Cancel",
- "- Remove cards ("+@price+"z, item gets priority)",
- "- Remove cards ("+@price+"z, cards get priority)"
- );
- } else {
- set @failsave, select(
- "- Cancel",
- "- Remove cards ("+@price+"z)"
- );
- }
- if (@failsave == 1)
- return 0;
- set @failsave, @failsave-1; //1: Save item, 2: Save Card
-
- if (($@keuc_Mat1 && countitem($@keuc_Mat1) < $@keuc_Qty1)
- || ($@keuc_Mat2 && countitem($@keuc_Mat2) < $@keuc_Qty2)) {
- callfunc "F_keIntro", e_pif, "You do not have all the materials I need...";
- return 0;
- }
-
- if (!(callfunc("F_keCharge",@cost,$@keuc_discount,1))) {
- callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny.";
- return 0;
- }
-
- if ($@keuc_Mat1 && $@keuc_Qty1)
- delitem $@keuc_Mat1, $@keuc_Qty1;
- if ($@keuc_Mat2 && $@keuc_Qty2)
- delitem $@keuc_Mat2, $@keuc_Qty2;
-
- set @failtype,-1;
- //Recycling cost...
- set @cost, rand(1000);
- if (@cost < $@keuc_Fail2Chance) //Total Failure
- set @failtype, 0;
- else if (@cost < $@keuc_Fail1Chance) //Partial Failure
- set @failtype, @failsave;
- else if (@cost < $@keuc_Fail0Chance) //Harmless Failure
- set @failtype, 3;
- else { //Success
- successremovecards @part;
- emotion e_ho;
- return 1;
- }
- failedremovecards @part,@failtype;
- if (@failtype == 1)
- mes "The cards were lost...";
- if (@failtype == 2)
- mes "The item was lost...";
- if (@failtype == 0)
- mes "Lost the cards and item...";
- callfunc "F_keIntro", e_swt, "...oops.";
- return 1;
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Uncarder Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 1.5 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers uncarding services. +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_uncard -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadUncard"; + end; +} + +function script F_keUncard { + +function SF_uncard; + + do { + set @kmenu, select( + "- Return", + "- See Price Specifics", + "- "+getequipname(1), + "- "+getequipname(2), + "- "+getequipname(3), + "- "+getequipname(4), + "- "+getequipname(5), + "- "+getequipname(6), + "- "+getequipname(7), + "- "+getequipname(8), + "- "+getequipname(9), + "- "+getequipname(10) + ); + if (@kmenu == 1) + return; + if (@kmenu == 2) { //Details + mes "Okay, listen up..."; + next; + mes "["+@name$+"]"; + if ($@keuc_BaseCost) + mes "The base cost is of "+$@keuc_BaseCost+"z."; + mes "Each card to be removed incurs a cost of +"+$@keuc_CardCost+"z."; + mes "The refine level of the compounded equipment can incur an additional cost:"; + mes "Armors: "+$@keuc_UpgradeCostA+"z per level."; + mes "Lv1 Weapons: "+$@keuc_UpgradeCostW1+"z per level."; + mes "Lv2 Weapons: "+$@keuc_UpgradeCostW2+"z per level."; + mes "Lv3 Weapons: "+$@keuc_UpgradeCostW3+"z per level."; + mes "Lv4 Weapons: "+$@keuc_UpgradeCostW4+"z per level."; + + if ($@keuc_Mat1 && $@keuc_Qty1) { + mes "The materials needed are:"; + mes "- "+$@keuc_Qty1+" "+getitemname($@keuc_Mat1)+"."; + } + if ($@keuc_Mat2 && $@keuc_Qty2) + mes "- "+$@keuc_Qty2+" "+getitemname($@keuc_Mat2)+"."; + + if ($@keuc_Fail1Chance || $@keuc_Fail2Chance) + mes "There is a chance the process might fail and you'll lose your items."; + + next; + callfunc "F_keIntro", -1, ""; + } else { + if (SF_uncard(@kmenu-2)) + return; + } + } while (@kmenu >1); + return; + +//Subfunction SF_uncard (equipment-position) +//Attempts to uncard the equipment. +function SF_uncard { + set @part, getarg(0); + if(getequipcardcnt(@part) == 0) { + callfunc "F_keIntro", e_ag, "There are no cards to remove there!"; + return 0; + } + set @cost, $@keuc_BaseCost; + set @cost, @cost + $@keuc_CardCost*getequipcardcnt(@part); + + switch (getequipweaponlv(@part)) { + case 0: //Armor + set @upgradeCost, $@keuc_UpgradeCostA; + break; + case 1: //Lv1 Weapons + set @upgradeCost, $@keuc_UpgradeCostW1; + break; + case 2: //Lv2 Weapons + set @upgradeCost, $@keuc_UpgradeCostW2; + break; + case 3: //Lv3 Weapons + set @upgradeCost, $@keuc_UpgradeCostW3; + break; + default: //Lv4 Weapons + set @upgradeCost, $@keuc_UpgradeCostW4; + } + + set @cost, @cost + @upgradeCost*getequiprefinerycnt(@part); + + set @price, callfunc("F_keCost",@cost,$@keuc_discount); + + if ($@keuc_Fail1Chance) { + set @failsave, select( + "- Cancel", + "- Remove cards ("+@price+"z, item gets priority)", + "- Remove cards ("+@price+"z, cards get priority)" + ); + } else { + set @failsave, select( + "- Cancel", + "- Remove cards ("+@price+"z)" + ); + } + if (@failsave == 1) + return 0; + set @failsave, @failsave-1; //1: Save item, 2: Save Card + + if (($@keuc_Mat1 && countitem($@keuc_Mat1) < $@keuc_Qty1) + || ($@keuc_Mat2 && countitem($@keuc_Mat2) < $@keuc_Qty2)) { + callfunc "F_keIntro", e_pif, "You do not have all the materials I need..."; + return 0; + } + + if (!(callfunc("F_keCharge",@cost,$@keuc_discount,1))) { + callfunc "F_keIntro", e_ag, "Sorry, you don't have enough zeny."; + return 0; + } + + if ($@keuc_Mat1 && $@keuc_Qty1) + delitem $@keuc_Mat1, $@keuc_Qty1; + if ($@keuc_Mat2 && $@keuc_Qty2) + delitem $@keuc_Mat2, $@keuc_Qty2; + + set @failtype,-1; + //Recycling cost... + set @cost, rand(1000); + if (@cost < $@keuc_Fail2Chance) //Total Failure + set @failtype, 0; + else if (@cost < $@keuc_Fail1Chance) //Partial Failure + set @failtype, @failsave; + else if (@cost < $@keuc_Fail0Chance) //Harmless Failure + set @failtype, 3; + else { //Success + successremovecards @part; + emotion e_ho; + return 1; + } + failedremovecards @part,@failtype; + if (@failtype == 1) + mes "The cards were lost..."; + if (@failtype == 2) + mes "The item was lost..."; + if (@failtype == 0) + mes "Lost the cards and item..."; + callfunc "F_keIntro", e_swt, "...oops."; + return 1; +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_dungeon.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_dungeon.txt index 84cbef768..2bc99b515 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_dungeon.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_dungeon.txt @@ -1,1761 +1,1761 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Dungeon Warps Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 3.5
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+, RO Episode 8+ (Hugel)
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers warping to dungeons.
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//= Flag values used for dungeons:
-//= 0x00000001 Abyss Lake
-//= 0x00000002 Amatsu
-//= 0x00000004 AntHell
-//= 0x00000008 Ayothaya
-//= 0x00000010 Byalan
-//= 0x00000020 Comodo
-//= 0x00000040 Clock tower
-//= 0x00000080 Coal Mines
-//= 0x00000100 Culvert
-//= 0x00000200 Einbech
-//= 0x00000400 Gefenia
-//= 0x00000800 Geffen
-//= 0x00001000 GlastHeim
-//= 0x00002000 Gon Ryun
-//= 0x00004000 Hidden Temple
-//= 0x00008000 Juperos
-//= 0x00010000 Lighthalzen
-//= 0x00020000 Lou Yang
-//= 0x00040000 Magma Caves
-//= 0x00080000 Orcs
-//= 0x00100000 Payon
-//= 0x00200000 Pyramid
-//= 0x00400000 Sphinx
-//= 0x00800000 Sunken Ship
-//= 0x01000000 Thanatos
-//= 0x02000000 Toy Factory
-//= 0x04000000 Turtle Island
-//= 0x08000000 Umbala
-
-//============================================================
-
-- script keInit_warpDungeon -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadWarpDungeon";
- end;
-}
-
-function script F_keDungeonWarps {
-
-function SF_abyssLake;
-function SF_amatsu;
-function SF_antHell;
-function SF_ayothaya;
-function SF_byalan;
-function SF_comodo;
-function SF_clockTower;
-function SF_coalMine;
-function SF_culvert;
-function SF_einbech;
-function SF_gefenia;
-function SF_geffen;
-function SF_glastHeim;
-function SF_gonRyun;
-function SF_hiddenTemple;
-function SF_juperos;
-function SF_lightHalzen;
-function SF_louYang;
-function SF_magma;
-function SF_orcs;
-function SF_payon;
-function SF_pyramid;
-function SF_sphinx;
-function SF_sunkenShip;
-function SF_thanatosTower;
-function SF_toyFactory;
-function SF_turtleIsland;
-function SF_umbala;
- //Store player map, will be needed in any of the submenus.
- set @map$, getarg(0);
- do {
- set @discount,callfunc("F_keCost",100,$@kewd_discount);
- if ($@kewd_showOnline) {
- set @kmenu, select (
- "- Cancel",
- "- Abyss Lake ("+$@kewd_abyssLake*@discount/100+"z/"+(getmapusers("abyss_01.gat")
- +getmapusers("abyss_02.gat")+getmapusers("abyss_03.gat"))+" "+$@ked_users$+")",
- "- Amatsu Dungeon ("+$@kewd_amatsu*@discount/100+"z/"+(getmapusers("ama_dun01.gat")
- +getmapusers("ama_dun02.gat")+getmapusers("ama_dun03.gat"))+" "+$@ked_users$+")",
- "- Ant Hell ("+$@kewd_antHell*@discount/100+"z/"+(getmapusers("anthell01.gat")
- +getmapusers("anthell02.gat"))+" "+$@ked_users$+")",
- "- Ayothaya Ancient Shrine ("+$@kewd_ayothaya*@discount/100+"z/"+(getmapusers("ayo_dun01.gat")
- +getmapusers("ayo_dun02.gat"))+" "+$@ked_users$+")",
- "- Byalan Dungeon ("+$@kewd_byalan*@discount/100+"z/"+(getmapusers("iz_dun00.gat")
- +getmapusers("iz_dun01.gat")+getmapusers("iz_dun02.gat")+getmapusers("iz_dun03.gat")
- +getmapusers("iz_dun04.gat"))+" "+$@ked_users$+")",
- "- Comodo Caves ("+$@kewd_comodo*@discount/100+"z/"+(getmapusers("beach_dun.gat")
- +getmapusers("beach_dun2.gat")+getmapusers("beach_dun3.gat"))+" "+$@ked_users$+")",
- "- Clock Tower ("+$@kewd_clockTower*@discount/100+"z/"+(getmapusers("c_tower1.gat")
- +getmapusers("c_tower2.gat")+getmapusers("c_tower3.gat")+getmapusers("c_tower4.gat")
- +getmapusers("alde_dun01.gat")+getmapusers("alde_dun02.gat")+getmapusers("alde_dun03.gat")
- +getmapusers("alde_dun04.gat"))+" "+$@ked_users$+")",
- "- Coal Mine ("+$@kewd_coalMines*@discount/100+"z/"+(getmapusers("mjo_dun01.gat")
- +getmapusers("mjo_dun02.gat")+getmapusers("mjo_dun03.gat"))+" "+$@ked_users$+")",
- "- Culvert ("+$@kewd_culvert*@discount/100+"z/"+(getmapusers("prt_sewb1.gat")+getmapusers("prt_sewb2.gat")
- +getmapusers("prt_sewb3.gat")+getmapusers("prt_sewb4.gat"))+" "+$@ked_users$+")",
- "- Einbroch Station ("+$@kewd_einbech*@discount/100+"z/"+(getmapusers("ein_dun01.gat")
- +getmapusers("ein_dun02.gat"))+" "+$@ked_users$+")",
- "- Gefenia ("+$@kewd_gefenia*@discount/100+"z/"+(getmapusers("gefenia01.gat")+getmapusers("gefenia02.gat")
- +getmapusers("gefenia03.gat")+getmapusers("gefenia04.gat"))+" "+$@ked_users$+")",
- "- Geffen Dungeon ("+$@kewd_geffen*@discount/100+"z/"+(getmapusers("gef_dun00.gat")
- +getmapusers("gef_dun01.gat")+getmapusers("gef_dun02.gat")+getmapusers("gef_dun03.gat"))+" "+$@ked_users$+")",
- "- Glast Heim ("+$@kewd_glastHeim*@discount/100+"z/"+(getmapusers("gl_cas02.gat")+getmapusers("gl_church.gat")
- +getmapusers("gl_chyard.gat")+getmapusers("gl_dun01.gat")+getmapusers("gl_dun02.gat")
- +getmapusers("gl_in01.gat")+getmapusers("gl_knt01.gat")+getmapusers("gl_knt02.gat")
- +getmapusers("gl_prison.gat")+getmapusers("gl_prison1.gat")+getmapusers("gl_sew01.gat")
- +getmapusers("gl_sew02.gat")+getmapusers("gl_sew03.gat")+getmapusers("gl_sew04.gat")
- +getmapusers("gl_step.gat")+getmapusers("glast_01.gat"))+" "+$@ked_users$+")",
- "- Gon Ryun Dungeon ("+$@kewd_gonRyun*@discount/100+"z/"+(getmapusers("gon_dun01.gat")
- +getmapusers("gon_dun02.gat")+getmapusers("gon_dun03.gat"))+" "+$@ked_users$+")",
- "- Hidden Temple ("+$@kewd_hiddenTemple*@discount/100+"z/"+(getmapusers("prt_maze01.gat")
- +getmapusers("prt_maze02.gat")+getmapusers("prt_maze03.gat"))+" "+$@ked_users$+")",
- "- Juperos ("+$@kewd_juperos*@discount/100+"z/"+(getmapusers("juperos_01.gat")+getmapusers("juperos_02.gat")
- +getmapusers("jupe_area1.gat")+getmapusers("jupe_area2.gat")+getmapusers("jupe_core.gat")
- +getmapusers("jupe_gate.gat")+getmapusers("jupe_area1.gat"))+" "+$@ked_users$+")",
- "- LightHalzen Rekkenber ("+$@kewd_lightHalzen*@discount/100+"z/"+(getmapusers("lhz_dun01.gat")
- +getmapusers("lhz_dun02.gat")+getmapusers("lhz_dun03.gat"))+" "+$@ked_users$+")",
- "- Lou Yang Royal Tomb ("+$@kewd_louYang*@discount/100+"z/"+(getmapusers("lou_dun01.gat")
- +getmapusers("lou_dun02.gat")+getmapusers("lou_dun03.gat"))+" "+$@ked_users$+")",
- "- Magma Dungeon ("+$@kewd_magma*@discount/100+"z/"+(getmapusers("mag_dun01.gat")
- +getmapusers("mag_dun02.gat"))+" "+$@ked_users$+")",
- "- Orc Dungeon ("+$@kewd_orc*@discount/100+"z/"+(getmapusers("orcsdun01.gat")
- +getmapusers("orcsdun02.gat"))+" "+$@ked_users$+")",
- "- Payon Dungeon ("+$@kewd_payon*@discount/100+"z/"+(getmapusers("pay_dun00.gat")
- +getmapusers("pay_dun01.gat")+getmapusers("pay_dun02.gat")+getmapusers("pay_dun03.gat")
- +getmapusers("pay_dun04.gat"))+" "+$@ked_users$+")",
- "- Pyramid ("+$@kewd_pyramid*@discount/100+"z/"+(getmapusers("moc_pryd01.gat")+getmapusers("moc_pryd02.gat")
- +getmapusers("moc_pryd03.gat")+getmapusers("moc_pryd04.gat")+getmapusers("moc_pryd05.gat")
- +getmapusers("moc_pryd06.gat")+getmapusers("moc_prydb1.gat"))+" "+$@ked_users$+")",
- "- Sphinx ("+$@kewd_sphinx*@discount/100+"z/"+(getmapusers("in_sphinx1.gat")
- +getmapusers("in_sphinx2.gat")+getmapusers("in_sphinx3.gat")+getmapusers("in_sphinx4.gat")
- +getmapusers("in_sphinx5.gat"))+" "+$@ked_users$+")",
- "- Sunken Ship ("+$@kewd_sunkenShip*@discount/100+"z/"+(getmapusers("treasure01.gat")
- +getmapusers("treasure02.gat"))+" "+$@ked_users$+")",
- "- Thanatos Tower ("+$@kewd_thanatosTower*@discount/100+"z/"+(getmapusers("tha_t01.gat")
- +getmapusers("tha_t02.gat")+getmapusers("tha_t03.gat")+getmapusers("tha_t04.gat")
- +getmapusers("tha_t05.gat")+getmapusers("tha_t06.gat")+getmapusers("tha_t07.gat")
- +getmapusers("tha_t08.gat")+getmapusers("tha_t09.gat")+getmapusers("tha_t10.gat")
- +getmapusers("tha_t11.gat")+getmapusers("tha_t12.gat")+getmapusers("thana_step.gat")
- +getmapusers("thana_boss.gat"))+" "+$@ked_users$+")",
- "- Toy Factory ("+$@kewd_toyFactory*@discount/100+"z/"+(getmapusers("xmas_dun01.gat")
- +getmapusers("xmas_dun02.gat"))+" "+$@ked_users$+")",
- "- Turtle Island ("+$@kewd_turtleIsland*@discount/100+"z/"+(getmapusers("tur_dun01.gat")
- +getmapusers("tur_dun02.gat")+getmapusers("tur_dun03.gat")+getmapusers("tur_dun04.gat")
- +getmapusers("tur_dun05.gat")+getmapusers("tur_dun06.gat"))+" "+$@ked_users$+")",
- "- Umbala Dungeon ("+$@kewd_umbala*@discount/100+"z/"+(getmapusers("um_dun01.gat")
- +getmapusers("um_dun02.gat"))+" "+$@ked_users$+")"
- );
- } else {
- set @kmenu, select(
- "- Cancel",
- "- Abyss Lake ("+$@kewd_abyssLake*@discount/100+"z)",
- "- Amatsu Dungeon ("+$@kewd_amatsu*@discount/100+"z)",
- "- Ant Hell ("+$@kewd_antHell*@discount/100+"z)",
- "- Ayothaya Ancient Shrine ("+$@kewd_ayothaya*@discount/100+"z)",
- "- Byalan Dungeon ("+$@kewd_byalan*@discount/100+"z)",
- "- Comodo Caves ("+$@kewd_comodo*@discount/100+"z)",
- "- Clock Tower ("+$@kewd_clockTower*@discount/100+"z)",
- "- Coal Mine ("+$@kewd_coalMines*@discount/100+"z)",
- "- Culvert ("+$@kewd_culvert*@discount/100+"z)",
- "- Einbroch Mine ("+$@kewd_einbech*@discount/100+"z)",
- "- Gefenia ("+$@kewd_gefenia*@discount/100+"z)",
- "- Geffen Dungeon ("+$@kewd_geffen*@discount/100+"z)",
- "- Glast Heim ("+$@kewd_glastHeim*@discount/100+"z)",
- "- Gon Ryun Dungeon ("+$@kewd_gonRyun*@discount/100+"z)",
- "- Hidden Temple ("+$@kewd_hiddenTemple*@discount/100+"z)",
- "- Juperos ("+$@kewd_juperos*@discount/100+"z)",
- "- LightHalzen Rekkenber ("+$@kewd_lightHalzen*@discount/100+"z)",
- "- Lou Yang Royal Tomb ("+$@kewd_louYang*@discount/100+"z)",
- "- Magma Dungeon ("+$@kewd_magma*@discount/100+"z)",
- "- Orcs Dungeon ("+$@kewd_orc*@discount/100+"z)",
- "- Payon Dungeon ("+$@kewd_payon*@discount/100+"z)",
- "- Pyramid ("+$@kewd_pyramid*@discount/100+"z)",
- "- Sphinx ("+$@kewd_sphinx*@discount/100+"z)",
- "- Sunken Ship ("+$@kewd_sunkenShip*@discount/100+"z)",
- "- Thanatos Tower ("+$@kewd_thanatosTower*@discount/100+"z)",
- "- Toy Factory ("+$@kewd_toyFactory*@discount/100+"z)",
- "- Turtle Island ("+$@kewd_turtleIsland*@discount/100+"z)",
- "- Umbala Dungeon ("+$@kewd_umbala*@discount/100+"z)"
- );
- }
- switch (@kmenu) {
- case 2:
- SF_abyssLake();
- break;
- case 3:
- SF_amatsu();
- break;
- case 4:
- SF_antHell();
- break;
- case 5:
- SF_ayothaya();
- break;
- case 6:
- SF_byalan();
- break;
- case 7:
- SF_comodo();
- break;
- case 8:
- SF_clockTower();
- break;
- case 9:
- SF_coalMine();
- break;
- case 10:
- SF_culvert();
- break;
- case 11:
- SF_einbech();
- break;
- case 12:
- SF_gefenia();
- break;
- case 13:
- SF_geffen();
- break;
- case 14:
- SF_glastHeim();
- break;
- case 15:
- SF_gonRyun();
- break;
- case 16:
- SF_hiddenTemple();
- break;
- case 17:
- SF_juperos();
- break;
- case 18:
- SF_lightHalzen();
- break;
- case 19:
- SF_louYang();
- break;
- case 20:
- SF_magma();
- break;
- case 21:
- SF_orcs();
- break;
- case 22:
- SF_payon();
- break;
- case 23:
- SF_pyramid();
- break;
- case 24:
- SF_sphinx();
- break;
- case 25:
- SF_sunkenShip();
- break;
- case 26:
- SF_thanatosTower();
- break;
- case 27:
- SF_toyFactory();
- break;
- case 28:
- SF_turtleIsland();
- break;
- case 29:
- SF_umbala();
- break;
- default:
- return;
- }
- } while (@kmenu > 1);
- return;
-
-//Subfunction SF_check(flag, cost, floor-count, player-map, dungeon-map#, map#1, map#2, ...)
-//If kewd_travel is set, the flag needs to match to be to warp there.
-//Floor count is the amount of levels the dungeon needs a price for,
-//dungeon-map# is the number of maps passed that need to be checked against
-//the player's map to see if they are warping from within the entrance.
-
-function SF_check {
- if ($@kewd_travel && !((kewd_travel|#kewd_travel)&getarg(0))) {
- callfunc "F_keIntro", e_sry, "Sorry, but we can only warp you to dungeons you have saved in before.";
- return 0;
- }
- set @cost, getarg(1);
- set @discount,100;
- set @map$, getarg(3);
- set @mapI, getarg(4);
-
- while (@mapI > 0)
- {
- if (@map$ == getarg(4+@mapI)) {
- set @discount,100-$@kewd_entryDiscount;
- break;
- }
- set @mapI, @mapI-1;
- }
- set @discountKP, callfunc("F_keCost",100,$@kewd_discount);
- set @discount,@discount*@discountKP/100;
-
- set @cost,@cost*@discount/100;
- set @inc,@cost*$@kewd_levelCost/100;
-
- //@discountKP is used to reverse the price to before the KP discount takes place
- if (@discountKP == 0)
- set @discountKP,1;
- if ($@kewd_deep == 0)
- return 1;
-
- switch (getarg(2)) {
- case 9:
- set @cost9, @cost +8*@inc;
- case 8:
- set @cost8, @cost +7*@inc;
- case 7:
- set @cost7, @cost +6*@inc;
- case 6:
- set @cost6, @cost +5*@inc;
- case 5:
- set @cost5, @cost +4*@inc;
- case 4:
- set @cost4, @cost +3*@inc;
- case 3:
- set @cost3, @cost +2*@inc;
- case 2:
- set @cost2, @cost +@inc;
- }
- return 1;
-}
-
-function SF_abyssLake {
- if (!(SF_check(0x1, $@kewd_abyssLake, 3, @map$, 1, "hu_fild05.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Abyss Lake",
- "- Entrance ("+@cost+"z/"+getmapusers("abyss_01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("abyss_02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("abyss_03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Abyss Lake",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"hu_fild05.gat",173,308;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"abyss_02.gat",272,270;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"abyss_03.gat",116,29;
- break;
- }
-}
-
-function SF_amatsu {
- if (!(SF_check(0x2, $@kewd_amatsu, 3, @map$, 1, "ama_in02.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Amatsu Dungeon",
- "- Entrance ("+@cost+"z/"+getmapusers("ama_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("ama_dun02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("ama_dun03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Amatsu Dungeon",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"ama_in02.gat",120,181;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"ama_dun02.gat",34,41;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"ama_dun03.gat",119,14;
- break;
- }
-}
-
-function SF_antHell {
- if (!(SF_check(0x4, $@kewd_antHell, 1, @map$, 2, "moc_fild04.gat","moc_fild15.gat")))
- return;
- if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Ant Hell",
- "- Northern Entrance ("+@cost+"z/"+getmapusers("anthell01.gat")+" "+$@ked_users$+")",
- "- Southern Entrance ("+@cost+"z/"+getmapusers("anthell02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Ant Hell",
- "- Northern Entrance ("+@cost+"z)",
- "- Southern Entrance ("+@cost+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_fild04.gat",201,327;
- break;
- case 3:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_fild15.gat",246,251;
- break;
- }
-}
-
-function SF_ayothaya {
- if (!(SF_check(0x8, $@kewd_ayothaya, 2, @map$, 1, "ayo_fild02.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Ancient Shrine",
- "- Entrance ("+@cost+"z/"+getmapusers("ayo_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("ayo_dun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Ancient Shrine",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"ayo_fild02.gat",273,150;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"ayo_dun02.gat",24,28;
- break;
- }
-}
-
-function SF_byalan {
- if (!(SF_check(0x10, $@kewd_byalan, 5, @map$, 1, "izlu2dun.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Undersea Tunnel",
- "- Entrance ("+@cost+"z/"+getmapusers("iz_dun00.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("iz_dun01.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("iz_dun02.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost4+"z/"+getmapusers("iz_dun03.gat")+" "+$@ked_users$+")",
- "- Level 5 ("+@cost5+"z/"+getmapusers("iz_dun04.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Undersea Tunnel",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)",
- "- Level 4 ("+@cost4+"z)",
- "- Level 5 ("+@cost5+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"izlu2dun.gat",114,84;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun01.gat",253,252;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun02.gat",236,204;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun03.gat",32,63;
- break;
- case 6:
- callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun04.gat",26,27;
- break;
- }
-}
-
-function SF_comodo {
- if (!(SF_check(0x20, $@kewd_comodo, 1, @map$, 2, "comodo.gat","cmd_fild01.gat")))
- return;
-
- if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Comodo Caves",
- "- Mao, The Eastern Cave ("+@cost+"z/"+getmapusers("beach_dun3.gat")+" "+$@ked_users$+")",
- "- Karu, The Western Cave ("+@cost+"z/"+getmapusers("beach_dun.gat")+" "+$@ked_users$+")",
- "- Ruande, The Northern Cave ("+@cost+"z/"+getmapusers("beach_dun2.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Comodo Caves",
- "- Mao, The Eastern Cave ("+@cost+"z)",
- "- Karu, The Western Cave ("+@cost+"z)",
- "- Ruande, The Northern Cave ("+@cost+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"cmd_fild01.gat",34,325;
- break;
- case 3:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"comodo.gat",32,209;
- break;
- case 4:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"comodo.gat",180,352;
- break;
- }
-}
-
-function SF_clockTower {
- if (!(SF_check(0x40, $@kewd_clockTower, 5, @map$, 1, "aldebaran.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Clock Tower",
- "- Entrance ("+@cost+"z/"+getmapusers("c_tower1.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("c_tower2.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("c_tower3.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost4+"z/"+getmapusers("c_tower4.gat")+" "+$@ked_users$+")",
- "- Basement 1 ("+@cost2+"z/"+getmapusers("alde_dun01.gat")+" "+$@ked_users$+")",
- "- Basement 2 ("+@cost3+"z/"+getmapusers("alde_dun02.gat")+" "+$@ked_users$+")",
- "- Basement 3 ("+@cost4+"z/"+getmapusers("alde_dun03.gat")+" "+$@ked_users$+")",
- "- Basement 4 ("+@cost5+"z/"+getmapusers("alde_dun04.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Clock Tower",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)",
- "- Level 4 ("+@cost4+"z)",
- "- Basement 1 ("+@cost2+"z)",
- "- Basement 2 ("+@cost3+"z)",
- "- Basement 3 ("+@cost4+"z)",
- "- Basement 4 ("+@cost5+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"aldebaran.gat",140,130;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"c_tower2.gat",268,26;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"c_tower3.gat",68,146;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"c_tower4.gat",185,44;
- break;
- case 6:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun01.gat",297,25;
- break;
- case 7:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun02.gat",43,24;
- break;
- case 8:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun03.gat",18,267;
- break;
- case 9:
- callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun04.gat",82,267;
- break;
- }
-}
-
-function SF_coalMine {
- if (!(SF_check(0x80, $@kewd_coalMines, 3, @map$, 1, "mjolnir_02.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Mjolnir Dead Pit",
- "- Entrance ("+@cost+"z/"+getmapusers("mjo_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("mjo_dun02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("mjo_dun03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Mjolnir Dead Pit",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"mjolnir_02.gat",89,358;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"mjo_dun02.gat",376,342;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"mjo_dun03.gat",305,260;
- break;
- }
-}
-
-function SF_culvert {
- if (!(SF_check(0x100, $@kewd_culvert, 4, @map$, 1, "prt_fild05.gat")))
- return;
- if ($@kewd_deep == 0) {
- set @submenu, 2;
- } else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Prontera Culvert",
- "- Entrance ("+@cost+"z/"+getmapusers("prt_sewb1.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("prt_sewb2.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("prt_sewb3.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost4+"z/"+getmapusers("prt_sewb4.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Prontera Culvert",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)",
- "- Level 4 ("+@cost4+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"prt_fild05.gat",274,208;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"prt_sewb2.gat",19,19;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"prt_sewb3.gat",180,169;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"prt_sewb4.gat",100,92;
- break;
- }
-}
-
-function SF_einbech {
- if (!(SF_check(0x200, $@kewd_einbech, 2, @map$, 1, "einbech.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Einbroch Mines",
- "- Entrance ("+@cost+"z/"+getmapusers("ein_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("ein_dun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Einbech Mines",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"einbech.gat",138,244;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"ein_dun02.gat",290,285;
- break;
- }
-}
-
-function SF_geffen {
- if (!(SF_check(0x800, $@kewd_geffen, 3, @map$, 1, "gef_tower.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Geffen Dungeon",
- "- Entrance ("+@cost+"z/"+getmapusers("gef_dun00.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("gef_dun01.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("gef_dun02.gat")+" "+$@ked_users$+")"
-// "- Level 4 ("+@cost4+"z/"+getmapusers("gef_dun03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Geffen Dungeon",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
-// "- Level 4 ("+@cost4+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gef_tower.gat",147,35;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gef_dun01.gat",115,236;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gef_dun02.gat",106,132;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"gef_dun03.gat",203,200;
- break;
- }
-}
-
-function SF_gefenia {
- if (!(SF_check(0x400, $@kewd_gefenia, 2, @map$, 4, "gefenia01.gat","gefenia02.gat","gefenia03.gat","gefenia04.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Gefenia",
- "- Level 1 ("+@cost+"z/"+getmapusers("gefenia01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("gefenia02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost2+"z/"+getmapusers("gefenia03.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost+"z/"+getmapusers("gefenia04.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Gefenia",
- "- Level 1 ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost2+"z)",
- "- Level 4 ("+@cost+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gefenia01.gat",60,169;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gefenia02.gat",116,116;
- break;
- case 4:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gefenia03.gat",119,277;
- break;
- case 5:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gefenia04.gat",129,86;
- break;
- }
-}
-
-function SF_glastHeim {
- if (!(SF_check(0x1000, $@kewd_glastHeim, 7, @map$, 1, "glast_01.gat")))
- return;
- if ($@kewd_deep == 0) {
- if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Glast Heim",
- "- Church Entrance ("+@cost+"z/"+getmapusers("gl_church.gat")+" "+$@ked_users$+")",
- "- Castle Terrace ("+@cost+"z/"+(getmapusers("gl_cas01.gat")+getmapusers("gl_cas02.gat"))+" "+$@ked_users$+")",
- "- Staircase Entrance ("+@cost+"z/"+getmapusers("gl_step.gat")+" "+$@ked_users$+")",
- "- Chivalry Entrance ("+@cost+"z/"+getmapusers("gl_knt01.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Glast Heim",
- "- Church Entrance ("+@cost+"z)",
- "- Castle Terrace ("+@cost+"z)",
- "- Staircase Entrance ("+@cost+"z)",
- "- Chivalry Entrance ("+@cost+"z)"
- );
- }
- if (@submenu > 2) //Churchyard is index 3.
- set @submenu, @submenu+1;
- } else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Glast Heim",
- "- Church Entrance ("+@cost+"z/"+getmapusers("gl_church.gat")+" "+$@ked_users$+")",
- "- Churchyard ("+@cost2+"z/"+getmapusers("gl_chyard.gat")+" "+$@ked_users$+")",
- "- Castle Terrace ("+@cost+"z/"+(getmapusers("gl_cas01.gat")+getmapusers("gl_cas02.gat"))+" "+$@ked_users$+")",
- "- Staircase Entrance ("+@cost+"z/"+getmapusers("gl_step.gat")+" "+$@ked_users$+")",
- "- Chivalry Entrance ("+@cost+"z/"+getmapusers("gl_knt01.gat")+" "+$@ked_users$+")",
- "- Chivalry Level 2 ("+@cost2+"z/"+getmapusers("gl_knt02.gat")+" "+$@ked_users$+")",
- "- Underground Prison 1 ("+@cost2+"z/"+getmapusers("gl_prison.gat")+" "+$@ked_users$+")",
- "- Underground Prison 2 ("+@cost3+"z/"+getmapusers("gl_prison1.gat")+" "+$@ked_users$+")",
- "- Culvert Level 1 ("+@cost4+"z/"+getmapusers("gl_sew01.gat")+" "+$@ked_users$+")",
- "- Culvert Level 2 ("+@cost3+"z/"+getmapusers("gl_sew02.gat")+" "+$@ked_users$+")",
- "- Culvert Level 3 ("+@cost4+"z/"+getmapusers("gl_sew03.gat")+" "+$@ked_users$+")",
- "- Culvert Level 4 ("+@cost5+"z/"+getmapusers("gl_sew04.gat")+" "+$@ked_users$+")",
- "- Underground Cave 1 ("+@cost6+"z/"+getmapusers("gl_dun01.gat")+" "+$@ked_users$+")",
- "- Underground Cave 2 ("+@cost7+"z/"+getmapusers("gl_dun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Glast Heim",
- "- Church Entrance ("+@cost+"z)",
- "- Churchyard ("+@cost2+"z)",
- "- Castle Terrace ("+@cost+"z)",
- "- Staircase Entrance ("+@cost+"z)",
- "- Chivalry Entrance ("+@cost+"z)",
- "- Chivalry Level 2 ("+@cost2+"z)",
- "- Underground Prison Level 1 ("+@cost2+"z)",
- "- Underground Prison Level 2 ("+@cost3+"z)",
- "- Culvert Level 1 ("+@cost4+"z)",
- "- Culvert Level 2 ("+@cost3+"z)",
- "- Culvert Level 3 ("+@cost4+"z)",
- "- Culvert Level 4 ("+@cost5+"z)",
- "- Underground Cave Level 1 ("+@cost6+"z)",
- "- Underground Cave Level 2 ("+@cost7+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",206,136;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gl_chyard.gat",147,15;
- break;
- case 4:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",199,335;
- break;
- case 5:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",62,107;
- break;
- case 6:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",69,193;
- break;
- case 7:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gl_knt02.gat",157,287;
- break;
- case 8:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gl_prison.gat",14,70;
- break;
- case 9:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gl_prison1.gat",150,14;
- break;
- case 10:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew01.gat",258,255;
- break;
- case 11:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew02.gat",108,291;
- break;
- case 12:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew03.gat",171,283;
- break;
- case 13:
- callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew04.gat",68,277;
- break;
- case 14:
- callfunc "F_keWarp",@cost6*100/@discountKP,$@kewd_discount,e_hmm,"gl_dun01.gat",133,271;
- break;
- case 15:
- callfunc "F_keWarp",@cost7*100/@discountKP,$@kewd_discount,e_hmm,"gl_dun02.gat",224,274;
- break;
- }
-}
-
-function SF_gonRyun {
- if (!(SF_check(0x2000, $@kewd_gonRyun, 3, @map$, 1, "gonryun.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Gon Ryun Dungeon",
- "- Entrance ("+@cost+"z/"+getmapusers("gon_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("gon_dun02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("gon_dun03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Gon Ryun Dungeon",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gonryun.gat",161,195;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gon_dun02.gat",22,114;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gon_dun03.gat",68,11;
- break;
- }
-}
-
-function SF_hiddenTemple {
- if (!(SF_check(0x4000, $@kewd_hiddenTemple, 3, @map$, 1, "prt_fild01.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Laberynth Forest",
- "- Entrance ("+@cost+"z/"+getmapusers("prt_maze01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("prt_maze02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("prt_maze03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Laberynth Forest",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"prt_fild01.gat",136,361;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"prt_maze02.gat",106,62;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"prt_maze03.gat",23,8;
- break;
- }
-}
-
-function SF_juperos {
- if (!(SF_check(0x8000, $@kewd_juperos, 3, @map$, 1, "jupe_cave.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Juperos",
- "- Entrance ("+@cost+"z/"+getmapusers("juperos_01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("juperos_02.gat")+" "+$@ked_users$+")",
- "- Core ("+@cost3+"z/"+getmapusers("jupe_core.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Juperos",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Core ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"jupe_cave.gat",55,52;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"juperos_02.gat",37,63;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"jupe_gate.gat",-1,-1;
- break;
- }
-}
-
-function SF_lightHalzen {
- if (!(SF_check(0x10000, $@kewd_lightHalzen, 3, @map$, 1, "lighthalzen.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Rekkenber",
- "- Entrance ("+@cost+"z/"+getmapusers("lou_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("lou_dun02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("lou_dun03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Rekkenber",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
-//This is the Rekkenber building entrance, which officially is only a dungeon exit.
-// callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"lighthalzen.gat",74,72;
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"lighthalzen.gat",303,302;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"lhz_dun02.gat",154,18;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"lhz_dun03.gat",141,132;
- break;
- }
-}
-
-function SF_louYang {
- if (!(SF_check(0x20000, $@kewd_louYang, 3, @map$, 1, "louyang.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Royal Tomb",
- "- Entrance ("+@cost+"z/"+getmapusers("lou_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("lou_dun02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("lou_dun03.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Royal Tomb",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)"
- );
- };
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"louyang.gat",41,267;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"lou_dun02.gat",281,20;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"lou_dun03.gat",165,39;
- break;
- }
-}
-
-function SF_magma {
- if (!(SF_check(0x40000, $@kewd_magma, 2, @map$, 1, "yuno_fild03.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Nogg Road",
- "- Entrance ("+@cost+"z/"+getmapusers("mag_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("mag_dun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Nogg Road",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"yuno_fild03.gat",35,135;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"mag_dun02.gat",47,30;
- break;
- }
-}
-
-function SF_orcs {
- if (!(SF_check(0x80000, $@kewd_orc, 2, @map$, 1, "gef_fild10.gat")))
- return;
- if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Orcs Dungeon",
- "- Front Entrance ("+@cost+"z/"+getmapusers("orcsdun01.gat")+" "+$@ked_users$+")",
- "- Back Entrance ("+@cost+"z/"+getmapusers("orcsdun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Orcs Dungeon",
- "- Front Entrance ("+@cost+"z)",
- "- Back Entrance ("+@cost+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"in_orcs01.gat",34,165;
- break;
- case 3:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"in_orcs01.gat",112,99;
- break;
- }
-}
-
-function SF_payon {
- if (!(SF_check(0x100000, $@kewd_payon, 5, @map$, 1, "pay_arche.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Payon Cave",
- "- Entrance ("+@cost+"z/"+getmapusers("pay_dun00.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("pay_dun01.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("pay_dun02.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost4+"z/"+getmapusers("pay_dun03.gat")+" "+$@ked_users$+")",
- "- Level 5 ("+@cost5+"z/"+getmapusers("pay_dun04.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Payon Cave",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)",
- "- Level 4 ("+@cost4+"z)",
- "- Level 5 ("+@cost5+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"pay_arche.gat",41,133;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun01.gat",19,33;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun02.gat",19,63;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun03.gat",155,159;
- break;
- case 6:
- callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun04.gat",34,202;
- break;
- }
-}
-
-function SF_pyramid {
- if (!(SF_check(0x200000, $@kewd_pyramid, 4, @map$,1, "moc_ruins.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Pyramid",
- "- Entrance ("+@cost+"z/"+getmapusers("moc_pryd01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("moc_pryd02.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("moc_pryd03.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost4+"z/"+getmapusers("moc_pryd04.gat")+" "+$@ked_users$+")",
- "- Basement 1 ("+@cost2+"z/"+getmapusers("moc_pryd05.gat")+" "+$@ked_users$+")",
- "- Basement 2 ("+@cost3+"z/"+getmapusers("moc_pryd06.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Pyramid",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)",
- "- Level 4 ("+@cost4+"z)",
- "- Basement 1 ("+@cost2+"z)",
- "- Basement 2 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_ruins.gat",62,162;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd02.gat",10,192;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd03.gat",100,92;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd04.gat",18,187;
- break;
- case 6:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd05.gat",94,96;
- break;
- case 7:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd06.gat",192,11;
- break;
- }
-}
-
-function SF_sphinx {
- if (!(SF_check(0x400000, $@kewd_sphinx, 5, @map$, 1, "moc_fild19.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to the Sphinx",
- "- Entrance ("+@cost+"z/"+getmapusers("in_sphinx1.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("in_sphinx2.gat")+" "+$@ked_users$+")",
- "- Level 3 ("+@cost3+"z/"+getmapusers("in_sphinx3.gat")+" "+$@ked_users$+")",
- "- Level 4 ("+@cost4+"z/"+getmapusers("in_sphinx4.gat")+" "+$@ked_users$+")",
- "- Level 5 ("+@cost5+"z/"+getmapusers("in_sphinx5.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to the Sphinx",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)",
- "- Level 3 ("+@cost3+"z)",
- "- Level 4 ("+@cost4+"z)",
- "- Level 5 ("+@cost5+"z)"
- );
- }
-
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_fild19.gat",107,100;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx2.gat",149,81;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx3.gat",210,54;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx4.gat",10,222;
- break;
- case 6:
- callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx5.gat",100,99;
- break;
- }
-}
-
-function SF_sunkenShip {
- if (!(SF_check(0x800000, $@kewd_sunkenShip, 2, @map$, 1, "alb2trea.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Sunken Ship",
- "- Entrance ("+@cost+"z/"+getmapusers("treasure01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("treasure02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Sunken Ship",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)"
- );
- }
-
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"alb2trea.gat",87,103;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"treasure02.gat",102,27;
- break;
- }
-}
-
-function SF_thanatosTower {
- if (!(SF_check(0x1000000, $@kewd_thanatosTower, 9, @map$, 1, "tha_t01.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Thanatos Tower",
- "- Entrance ("+@cost+"z/"+getmapusers("tha_t01.gat")+" "+$@ked_users$+")",
- "- Floor 2 ("+@cost2+"z/"+getmapusers("tha_t02.gat")+" "+$@ked_users$+")",
- "- Floor 3 ("+@cost3+"z/"+getmapusers("tha_t03.gat")+" "+$@ked_users$+")",
- "- Floor 4 ("+@cost4+"z/"+getmapusers("tha_t04.gat")+" "+$@ked_users$+")",
- "- Floor 5 ("+@cost5+"z/"+getmapusers("tha_t05.gat")+" "+$@ked_users$+")",
- "- Floor 6 ("+@cost6+"z/"+getmapusers("tha_t06.gat")+" "+$@ked_users$+")",
- "- Floor 7 ("+@cost7+"z/"+getmapusers("tha_t07.gat")+" "+$@ked_users$+")",
- "- Floor 8 ("+@cost8+"z/"+getmapusers("tha_t08.gat")+" "+$@ked_users$+")",
- "- Floor 9 ("+@cost9+"z/"+getmapusers("tha_t09.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Thanatos Tower",
- "- Entrance ("+@cost+"z)",
- "- Floor 2 ("+@cost2+"z)",
- "- Floor 3 ("+@cost3+"z)",
- "- Floor 4 ("+@cost4+"z)",
- "- Floor 5 ("+@cost5+"z)",
- "- Floor 6 ("+@cost6+"z)",
- "- Floor 7 ("+@cost7+"z)",
- "- Floor 8 ("+@cost8+"z)",
- "- Floor 9 ("+@cost9+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"tha_scene01.gat",139,201;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"tha_t02.gat",149,136;
- break;
- case 4:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"tha_t03.gat",220,159;
- break;
- case 5:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t04.gat",59,144;
- break;
- case 6:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t05.gat",62,9;
- break;
- case 7:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t06.gat",120,225;
- break;
- case 8:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t07.gat",32,166;
- break;
- case 9:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t08.gat",108,44;
- break;
- case 10:
- callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t09.gat",87,145;
- break;
- }
-}
-
-function SF_toyFactory {
- if (!(SF_check(0x2000000, $@kewd_toyFactory, 2, @map$, 1, "xmas.gat")))
- return;
-
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Toy Factory",
- "- Entrance ("+@cost+"z/"+getmapusers("xmas_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("xmas_dun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Toy Factory",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)"
- );
- }
-
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"xmas.gat",144,306;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"xmas_dun02.gat",129,133;
- break;
- }
-}
-
-function SF_turtleIsland {
- if (!(SF_check(0x4000000, $@kewd_turtleIsland, 3, @map$, 1, "tur_dun01.gat")))
- return;
- if ($@kewd_deep == 0) {
- if ($@kewd_turtleCave)
- set @submenu, 3;
- else
- set @submenu, 2;
- } else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Turtle Island",
- "- Island Entrance ("+@cost+"z/"+getmapusers("tur_dun01.gat")+" "+$@ked_users$+")",
- "- Cave Entrance ("+@cost+"z/"+getmapusers("tur_dun02.gat")+" "+$@ked_users$+")",
- "- Cave Level 2 ("+@cost2+"z/"+getmapusers("tur_dun03.gat")+" "+$@ked_users$+")",
- "- Cave Level 3 ("+@cost3+"z/"+getmapusers("tur_dun04.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Turtle Island",
- "- Island Entrance ("+@cost+"z)",
- "- Cave Entrance ("+@cost+"z)",
- "- Cave Level 2 ("+@cost2+"z)",
- "- Cave Level 3 ("+@cost3+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun01.gat",153,47;
- break;
- case 3:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun01.gat",155,234;
- break;
- case 4:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun03.gat",132,189;
- break;
- case 5:
- callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun04.gat",100,192;
- break;
- }
-}
-
-function SF_umbala {
- if (!(SF_check(0x8000000, $@kewd_umbala, 2, @map$, 1, "umbala.gat")))
- return;
- if ($@kewd_deep == 0)
- set @submenu, 2;
- else if ($@kewd_showOnline) {
- set @submenu, select(
- "- Cancel warp to Umbala Dungeon",
- "- Entrance ("+@cost+"z/"+getmapusers("um_dun01.gat")+" "+$@ked_users$+")",
- "- Level 2 ("+@cost2+"z/"+getmapusers("um_dun02.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel warp to Umbala Dungeon",
- "- Entrance ("+@cost+"z)",
- "- Level 2 ("+@cost2+"z)"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"umbala.gat",113,282;
- break;
- case 3:
- callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"um_dun02.gat",48,31;
- break;
- }
-}
-
-}
-
-//Invoked when we want to add a map to the list of travelled-to dungeons
-function script F_keAddTravelDungeon {
- set @map$, getarg(0);
-// Temporary code to update the previous variable format to the new one.
- if(kewd_abyss) {
- set kewd_travel,kewd_travel|0x1;
- set kewd_abyss,0;
- }
- if(kewd_amatsu) {
- set kewd_travel,kewd_travel|0x2;
- set kewd_amatsu,0;
- }
- if(kewd_antHell) {
- set kewd_travel,kewd_travel|0x4;
- set kewd_antHell,0;
- }
- if(kewd_ayothaya) {
- set kewd_travel,kewd_travel|0x8;
- set kewd_ayothaya,0;
- }
- if(kewd_byalan) {
- set kewd_travel,kewd_travel|0x10;
- set kewd_byalan,0;
- }
- if(kewd_comodo) {
- set kewd_travel,kewd_travel|0x20;
- set kewd_comodo,0;
- }
- if(kewd_clockTower) {
- set kewd_travel,kewd_travel|0x40;
- set kewd_clockTower,0;
- }
- if(kewd_coalMines) {
- set kewd_travel,kewd_travel|0x80;
- set kewd_coalMines,0;
- }
- if(kewd_culvert) {
- set kewd_travel,kewd_travel|0x100;
- set kewd_culvert,0;
- }
- if(kewd_einbech) {
- set kewd_travel,kewd_travel|0x200;
- set kewd_einbech,0;
- }
- if(kewd_geffen) {
- set kewd_travel,kewd_travel|0x800;
- set kewd_geffen,0;
- }
- if(kewd_glastHeim) {
- set kewd_travel,kewd_travel|0x1000;
- set kewd_glastHeim,0;
- }
- if(kewd_gonRyun) {
- set kewd_travel,kewd_travel|0x2000;
- set kewd_gonRyun,0;
- }
- if(kewd_hiddenTemple) {
- set kewd_travel,kewd_travel|0x4000;
- set kewd_hiddenTemple,0;
- }
- if(kewd_juperos) {
- set kewd_travel,kewd_travel|0x8000;
- set kewd_juperos,0;
- }
- if(kewd_lightHalzen) {
- set kewd_travel,kewd_travel|0x10000;
- set kewd_lightHalzen,0;
- }
- if(kewd_louYang) {
- set kewd_travel,kewd_travel|0x20000;
- set kewd_louYang,0;
- }
- if(kewd_magma) {
- set kewd_travel,kewd_travel|0x40000;
- set kewd_magma,0;
- }
- if(kewd_orc) {
- set kewd_travel,kewd_travel|0x80000;
- set kewd_orc,0;
- }
- if(kewd_payon) {
- set kewd_travel,kewd_travel|0x100000;
- set kewd_payon,0;
- }
- if(kewd_pyramid) {
- set kewd_travel,kewd_travel|0x200000;
- set kewd_pyramid,0;
- }
- if(kewd_sphinx) {
- set kewd_travel,kewd_travel|0x400000;
- set kewd_sphinx,0;
- }
- if(kewd_sunkenShip) {
- set kewd_travel,kewd_travel|0x800000;
- set kewd_sunkenShip,0;
- }
- if(kewd_thanatosTower) {
- set kewd_travel,kewd_travel|0x1000000;
- set kewd_thanatosTower,0;
- }
- if(kewd_toyFactory) {
- set kewd_travel,kewd_travel|0x2000000;
- set kewd_toyFactory,0;
- }
- if(kewd_turtleIsland) {
- set kewd_travel,kewd_travel|0x4000000;
- set kewd_turtleIsland,0;
- }
- if(kewd_umbala) {
- set kewd_travel,kewd_travel|0x8000000;
- set kewd_umbala,0;
- }
-
- if(#kewd_abyss) {
- set #kewd_travel,#kewd_travel|0x1;
- set #kewd_abyss,0;
- }
- if(#kewd_amatsu) {
- set #kewd_travel,#kewd_travel|0x2;
- set #kewd_amatsu,0;
- }
- if(#kewd_antHell) {
- set #kewd_travel,#kewd_travel|0x4;
- set #kewd_antHell,0;
- }
- if(#kewd_ayothaya) {
- set #kewd_travel,#kewd_travel|0x8;
- set #kewd_ayothaya,0;
- }
- if(#kewd_byalan) {
- set #kewd_travel,#kewd_travel|0x10;
- set #kewd_byalan,0;
- }
- if(#kewd_comodo) {
- set #kewd_travel,#kewd_travel|0x20;
- set #kewd_comodo,0;
- }
- if(#kewd_clockTower) {
- set #kewd_travel,#kewd_travel|0x40;
- set #kewd_clockTower,0;
- }
- if(#kewd_coalMines) {
- set #kewd_travel,#kewd_travel|0x80;
- set #kewd_coalMines,0;
- }
- if(#kewd_culvert) {
- set #kewd_travel,#kewd_travel|0x100;
- set #kewd_culvert,0;
- }
- if(#kewd_einbech) {
- set #kewd_travel,#kewd_travel|0x200;
- set #kewd_einbech,0;
- }
- if(#kewd_geffen) {
- set #kewd_travel,#kewd_travel|0x800;
- set #kewd_geffen,0;
- }
- if(#kewd_glastHeim) {
- set #kewd_travel,#kewd_travel|0x1000;
- set #kewd_glastHeim,0;
- }
- if(#kewd_gonRyun) {
- set #kewd_travel,#kewd_travel|0x2000;
- set #kewd_gonRyun,0;
- }
- if(#kewd_hiddenTemple) {
- set #kewd_travel,#kewd_travel|0x4000;
- set #kewd_hiddenTemple,0;
- }
- if(#kewd_juperos) {
- set #kewd_travel,#kewd_travel|0x8000;
- set #kewd_juperos,0;
- }
- if(#kewd_lightHalzen) {
- set #kewd_travel,#kewd_travel|0x10000;
- set #kewd_lightHalzen,0;
- }
- if(#kewd_louYang) {
- set #kewd_travel,#kewd_travel|0x20000;
- set #kewd_louYang,0;
- }
- if(#kewd_magma) {
- set #kewd_travel,#kewd_travel|0x40000;
- set #kewd_magma,0;
- }
- if(#kewd_orc) {
- set #kewd_travel,#kewd_travel|0x80000;
- set #kewd_orc,0;
- }
- if(#kewd_payon) {
- set #kewd_travel,#kewd_travel|0x100000;
- set #kewd_payon,0;
- }
- if(#kewd_pyramid) {
- set #kewd_travel,#kewd_travel|0x200000;
- set #kewd_pyramid,0;
- }
- if(#kewd_sphinx) {
- set #kewd_travel,#kewd_travel|0x400000;
- set #kewd_sphinx,0;
- }
- if(#kewd_sunkenShip) {
- set #kewd_travel,#kewd_travel|0x800000;
- set #kewd_sunkenShip,0;
- }
- if(#kewd_thanatosTower) {
- set #kewd_travel,#kewd_travel|0x1000000;
- set #kewd_thanatosTower,0;
- }
- if(#kewd_toyFactory) {
- set #kewd_travel,#kewd_travel|0x2000000;
- set #kewd_toyFactory,0;
- }
- if(#kewd_turtleIsland) {
- set #kewd_travel,#kewd_travel|0x4000000;
- set #kewd_turtleIsland,0;
- }
- if(#kewd_umbala) {
- set #kewd_travel,#kewd_travel|0x8000000;
- set #kewd_umbala,0;
- }
-
-// End transition code.
- if ($@kewd_travel > 1) {
- if (@map$ == "hu_fild05.gat" || kewd_travel&0x1)
- set #kewd_travel,#kewd_travel|0x1;
- if (@map$ == "ama_in02.gat" || kewd_travel&0x2)
- set #kewd_travel,#kewd_travel|0x2;
- if (@map$ == "moc_fild04.gat" || @map$ == "moc_fild15.gat" || kewd_travel&0x4)
- set #kewd_travel,#kewd_travel|0x4;
- if (@map$ == "ayo_fild02.gat" || kewd_travel&0x8)
- set #kewd_travel,#kewd_travel|0x8;
- if (@map$ == "izlu2dun.gat" || kewd_travel&0x10)
- set #kewd_travel,#kewd_travel|0x10;
- if (@map$ == "comodo.gat" || @map$ == "cmd_fild01.gat" || kewd_travel&0x20)
- set #kewd_travel,#kewd_travel|0x20;
- if (@map$ == "aldebaran.gat" || kewd_travel&0x40)
- set #kewd_travel,#kewd_travel|0x40;
- if (@map$ == "mjolnir_02.gat" || kewd_travel&0x80)
- set #kewd_travel,#kewd_travel|0x80;
- if (@map$ == "prt_fild05.gat" || kewd_travel&0x100)
- set #kewd_travel,#kewd_travel|0x100;
- if (@map$ == "einbech.gat" || kewd_travel&0x200)
- set #kewd_travel,#kewd_travel|0x200;
- if (@map$ == "gef_tower.gat" || kewd_travel&0x800)
- set #kewd_travel,#kewd_travel|0x800;
- if (@map$ == "glast_01.gat" || kewd_travel&0x1000)
- set #kewd_travel,#kewd_travel|0x1000;
- if (@map$ == "gonryun.gat" || kewd_travel&0x2000)
- set #kewd_travel,#kewd_travel|0x2000;
- if (@map$ == "prt_fild01.gat" || kewd_travel&0x4000)
- set #kewd_travel,#kewd_travel|0x4000;
- if (@map$ == "jupe_cave.gat" || kewd_travel&0x8000)
- set #kewd_travel,#kewd_travel|0x8000;
- if (@map$ == "lighthalzen.gat" || kewd_travel&0x10000)
- set #kewd_travel,#kewd_travel|0x10000;
- if (@map$ == "louyang.gat" || kewd_travel&0x20000)
- set #kewd_travel,#kewd_travel|0x20000;
- if (@map$ == "yuno_fild03.gat" || kewd_travel&0x40000)
- set #kewd_travel,#kewd_travel|0x40000;
- if (@map$ == "in_orcs01.gat" || kewd_travel&0x80000)
- set #kewd_travel,#kewd_travel|0x80000;
- if (@map$ == "pay_arche.gat" || kewd_travel&0x100000)
- set #kewd_travel,#kewd_travel|0x100000;
- if (@map$ == "moc_ruins.gat" || kewd_travel&0x200000)
- set #kewd_travel,#kewd_travel|0x200000;
- if (@map$ == "moc_fild19.gat" || kewd_travel&0x400000)
- set #kewd_travel,#kewd_travel|0x400000;
- if (@map$ == "alb2trea.gat" || kewd_travel&0x800000)
- set #kewd_travel,#kewd_travel|0x800000;
- if (@map$ == "tha_t01.gat" || kewd_travel&0x1000000)
- set #kewd_travel,#kewd_travel|0x1000000;
- if (@map$ == "xmas.gat" || kewd_travel&0x2000000)
- set #kewd_travel,#kewd_travel|0x2000000;
- if (@map$ == "tur_dun01.gat" || kewd_travel&0x4000000)
- set #kewd_travel,#kewd_travel|0x4000000;
- if (@map$ == "umbala.gat" || kewd_travel&0x8000000)
- set #kewd_travel,#kewd_travel|0x8000000;
- } else {
- if (@map$ == "hu_fild05.gat")
- set kewd_travel,kewd_travel|0x1;
- if (@map$ == "ama_in02.gat")
- set kewd_travel,kewd_travel|0x2;
- if (@map$ == "moc_fild04.gat" || @map$ == "moc_fild15.gat")
- set kewd_travel,kewd_travel|0x4;
- if (@map$ == "ayo_fild02.gat")
- set kewd_travel,kewd_travel|0x8;
- if (@map$ == "izlu2dun.gat")
- set kewd_travel,kewd_travel|0x10;
- if (@map$ == "comodo.gat" || @map$ == "cmd_fild01.gat")
- set kewd_travel,kewd_travel|0x20;
- if (@map$ == "aldebaran.gat")
- set kewd_travel,kewd_travel|0x40;
- if (@map$ == "mjolnir_02.gat")
- set kewd_travel,kewd_travel|0x80;
- if (@map$ == "prt_fild05.gat")
- set kewd_travel,kewd_travel|0x100;
- if (@map$ == "einbech.gat")
- set kewd_travel,kewd_travel|0x200;
- if (@map$ == "gef_tower.gat")
- set kewd_travel,kewd_travel|0x800;
- if (@map$ == "glast_01.gat")
- set kewd_travel,kewd_travel|0x1000;
- if (@map$ == "gonryun.gat")
- set kewd_travel,kewd_travel|0x2000;
- if (@map$ == "prt_fild01.gat")
- set kewd_travel,kewd_travel|0x4000;
- if (@map$ == "jupe_cave.gat")
- set kewd_travel,kewd_travel|0x8000;
- if (@map$ == "lighthalzen.gat")
- set kewd_travel,kewd_travel|0x10000;
- if (@map$ == "louyang.gat")
- set kewd_travel,kewd_travel|0x20000;
- if (@map$ == "yuno_fild03.gat")
- set kewd_travel,kewd_travel|0x40000;
- if (@map$ == "in_orcs01.gat")
- set kewd_travel,kewd_travel|0x80000;
- if (@map$ == "pay_arche.gat")
- set kewd_travel,kewd_travel|0x100000;
- if (@map$ == "moc_ruins.gat")
- set kewd_travel,kewd_travel|0x200000;
- if (@map$ == "moc_fild19.gat")
- set kewd_travel,kewd_travel|0x400000;
- if (@map$ == "alb2trea.gat")
- set kewd_travel,kewd_travel|0x800000;
- if (@map$ == "tha_t01.gat")
- set kewd_travel,kewd_travel|0x1000000;
- if (@map$ == "xmas.gat")
- set kewd_travel,kewd_travel|0x2000000;
- if (@map$ == "tur_dun01.gat")
- set kewd_travel,kewd_travel|0x4000000;
- if (@map$ == "umbala.gat")
- set kewd_travel,kewd_travel|0x8000000;
- }
- return;
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Dungeon Warps Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 3.5 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+, RO Episode 8+ (Hugel) +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers warping to dungeons. +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//= Flag values used for dungeons: +//= 0x00000001 Abyss Lake +//= 0x00000002 Amatsu +//= 0x00000004 AntHell +//= 0x00000008 Ayothaya +//= 0x00000010 Byalan +//= 0x00000020 Comodo +//= 0x00000040 Clock tower +//= 0x00000080 Coal Mines +//= 0x00000100 Culvert +//= 0x00000200 Einbech +//= 0x00000400 Gefenia +//= 0x00000800 Geffen +//= 0x00001000 GlastHeim +//= 0x00002000 Gon Ryun +//= 0x00004000 Hidden Temple +//= 0x00008000 Juperos +//= 0x00010000 Lighthalzen +//= 0x00020000 Lou Yang +//= 0x00040000 Magma Caves +//= 0x00080000 Orcs +//= 0x00100000 Payon +//= 0x00200000 Pyramid +//= 0x00400000 Sphinx +//= 0x00800000 Sunken Ship +//= 0x01000000 Thanatos +//= 0x02000000 Toy Factory +//= 0x04000000 Turtle Island +//= 0x08000000 Umbala + +//============================================================ + +- script keInit_warpDungeon -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadWarpDungeon"; + end; +} + +function script F_keDungeonWarps { + +function SF_abyssLake; +function SF_amatsu; +function SF_antHell; +function SF_ayothaya; +function SF_byalan; +function SF_comodo; +function SF_clockTower; +function SF_coalMine; +function SF_culvert; +function SF_einbech; +function SF_gefenia; +function SF_geffen; +function SF_glastHeim; +function SF_gonRyun; +function SF_hiddenTemple; +function SF_juperos; +function SF_lightHalzen; +function SF_louYang; +function SF_magma; +function SF_orcs; +function SF_payon; +function SF_pyramid; +function SF_sphinx; +function SF_sunkenShip; +function SF_thanatosTower; +function SF_toyFactory; +function SF_turtleIsland; +function SF_umbala; + //Store player map, will be needed in any of the submenus. + set @map$, getarg(0); + do { + set @discount,callfunc("F_keCost",100,$@kewd_discount); + if ($@kewd_showOnline) { + set @kmenu, select ( + "- Cancel", + "- Abyss Lake ("+$@kewd_abyssLake*@discount/100+"z/"+(getmapusers("abyss_01.gat") + +getmapusers("abyss_02.gat")+getmapusers("abyss_03.gat"))+" "+$@ked_users$+")", + "- Amatsu Dungeon ("+$@kewd_amatsu*@discount/100+"z/"+(getmapusers("ama_dun01.gat") + +getmapusers("ama_dun02.gat")+getmapusers("ama_dun03.gat"))+" "+$@ked_users$+")", + "- Ant Hell ("+$@kewd_antHell*@discount/100+"z/"+(getmapusers("anthell01.gat") + +getmapusers("anthell02.gat"))+" "+$@ked_users$+")", + "- Ayothaya Ancient Shrine ("+$@kewd_ayothaya*@discount/100+"z/"+(getmapusers("ayo_dun01.gat") + +getmapusers("ayo_dun02.gat"))+" "+$@ked_users$+")", + "- Byalan Dungeon ("+$@kewd_byalan*@discount/100+"z/"+(getmapusers("iz_dun00.gat") + +getmapusers("iz_dun01.gat")+getmapusers("iz_dun02.gat")+getmapusers("iz_dun03.gat") + +getmapusers("iz_dun04.gat"))+" "+$@ked_users$+")", + "- Comodo Caves ("+$@kewd_comodo*@discount/100+"z/"+(getmapusers("beach_dun.gat") + +getmapusers("beach_dun2.gat")+getmapusers("beach_dun3.gat"))+" "+$@ked_users$+")", + "- Clock Tower ("+$@kewd_clockTower*@discount/100+"z/"+(getmapusers("c_tower1.gat") + +getmapusers("c_tower2.gat")+getmapusers("c_tower3.gat")+getmapusers("c_tower4.gat") + +getmapusers("alde_dun01.gat")+getmapusers("alde_dun02.gat")+getmapusers("alde_dun03.gat") + +getmapusers("alde_dun04.gat"))+" "+$@ked_users$+")", + "- Coal Mine ("+$@kewd_coalMines*@discount/100+"z/"+(getmapusers("mjo_dun01.gat") + +getmapusers("mjo_dun02.gat")+getmapusers("mjo_dun03.gat"))+" "+$@ked_users$+")", + "- Culvert ("+$@kewd_culvert*@discount/100+"z/"+(getmapusers("prt_sewb1.gat")+getmapusers("prt_sewb2.gat") + +getmapusers("prt_sewb3.gat")+getmapusers("prt_sewb4.gat"))+" "+$@ked_users$+")", + "- Einbroch Station ("+$@kewd_einbech*@discount/100+"z/"+(getmapusers("ein_dun01.gat") + +getmapusers("ein_dun02.gat"))+" "+$@ked_users$+")", + "- Gefenia ("+$@kewd_gefenia*@discount/100+"z/"+(getmapusers("gefenia01.gat")+getmapusers("gefenia02.gat") + +getmapusers("gefenia03.gat")+getmapusers("gefenia04.gat"))+" "+$@ked_users$+")", + "- Geffen Dungeon ("+$@kewd_geffen*@discount/100+"z/"+(getmapusers("gef_dun00.gat") + +getmapusers("gef_dun01.gat")+getmapusers("gef_dun02.gat")+getmapusers("gef_dun03.gat"))+" "+$@ked_users$+")", + "- Glast Heim ("+$@kewd_glastHeim*@discount/100+"z/"+(getmapusers("gl_cas02.gat")+getmapusers("gl_church.gat") + +getmapusers("gl_chyard.gat")+getmapusers("gl_dun01.gat")+getmapusers("gl_dun02.gat") + +getmapusers("gl_in01.gat")+getmapusers("gl_knt01.gat")+getmapusers("gl_knt02.gat") + +getmapusers("gl_prison.gat")+getmapusers("gl_prison1.gat")+getmapusers("gl_sew01.gat") + +getmapusers("gl_sew02.gat")+getmapusers("gl_sew03.gat")+getmapusers("gl_sew04.gat") + +getmapusers("gl_step.gat")+getmapusers("glast_01.gat"))+" "+$@ked_users$+")", + "- Gon Ryun Dungeon ("+$@kewd_gonRyun*@discount/100+"z/"+(getmapusers("gon_dun01.gat") + +getmapusers("gon_dun02.gat")+getmapusers("gon_dun03.gat"))+" "+$@ked_users$+")", + "- Hidden Temple ("+$@kewd_hiddenTemple*@discount/100+"z/"+(getmapusers("prt_maze01.gat") + +getmapusers("prt_maze02.gat")+getmapusers("prt_maze03.gat"))+" "+$@ked_users$+")", + "- Juperos ("+$@kewd_juperos*@discount/100+"z/"+(getmapusers("juperos_01.gat")+getmapusers("juperos_02.gat") + +getmapusers("jupe_area1.gat")+getmapusers("jupe_area2.gat")+getmapusers("jupe_core.gat") + +getmapusers("jupe_gate.gat")+getmapusers("jupe_area1.gat"))+" "+$@ked_users$+")", + "- LightHalzen Rekkenber ("+$@kewd_lightHalzen*@discount/100+"z/"+(getmapusers("lhz_dun01.gat") + +getmapusers("lhz_dun02.gat")+getmapusers("lhz_dun03.gat"))+" "+$@ked_users$+")", + "- Lou Yang Royal Tomb ("+$@kewd_louYang*@discount/100+"z/"+(getmapusers("lou_dun01.gat") + +getmapusers("lou_dun02.gat")+getmapusers("lou_dun03.gat"))+" "+$@ked_users$+")", + "- Magma Dungeon ("+$@kewd_magma*@discount/100+"z/"+(getmapusers("mag_dun01.gat") + +getmapusers("mag_dun02.gat"))+" "+$@ked_users$+")", + "- Orc Dungeon ("+$@kewd_orc*@discount/100+"z/"+(getmapusers("orcsdun01.gat") + +getmapusers("orcsdun02.gat"))+" "+$@ked_users$+")", + "- Payon Dungeon ("+$@kewd_payon*@discount/100+"z/"+(getmapusers("pay_dun00.gat") + +getmapusers("pay_dun01.gat")+getmapusers("pay_dun02.gat")+getmapusers("pay_dun03.gat") + +getmapusers("pay_dun04.gat"))+" "+$@ked_users$+")", + "- Pyramid ("+$@kewd_pyramid*@discount/100+"z/"+(getmapusers("moc_pryd01.gat")+getmapusers("moc_pryd02.gat") + +getmapusers("moc_pryd03.gat")+getmapusers("moc_pryd04.gat")+getmapusers("moc_pryd05.gat") + +getmapusers("moc_pryd06.gat")+getmapusers("moc_prydb1.gat"))+" "+$@ked_users$+")", + "- Sphinx ("+$@kewd_sphinx*@discount/100+"z/"+(getmapusers("in_sphinx1.gat") + +getmapusers("in_sphinx2.gat")+getmapusers("in_sphinx3.gat")+getmapusers("in_sphinx4.gat") + +getmapusers("in_sphinx5.gat"))+" "+$@ked_users$+")", + "- Sunken Ship ("+$@kewd_sunkenShip*@discount/100+"z/"+(getmapusers("treasure01.gat") + +getmapusers("treasure02.gat"))+" "+$@ked_users$+")", + "- Thanatos Tower ("+$@kewd_thanatosTower*@discount/100+"z/"+(getmapusers("tha_t01.gat") + +getmapusers("tha_t02.gat")+getmapusers("tha_t03.gat")+getmapusers("tha_t04.gat") + +getmapusers("tha_t05.gat")+getmapusers("tha_t06.gat")+getmapusers("tha_t07.gat") + +getmapusers("tha_t08.gat")+getmapusers("tha_t09.gat")+getmapusers("tha_t10.gat") + +getmapusers("tha_t11.gat")+getmapusers("tha_t12.gat")+getmapusers("thana_step.gat") + +getmapusers("thana_boss.gat"))+" "+$@ked_users$+")", + "- Toy Factory ("+$@kewd_toyFactory*@discount/100+"z/"+(getmapusers("xmas_dun01.gat") + +getmapusers("xmas_dun02.gat"))+" "+$@ked_users$+")", + "- Turtle Island ("+$@kewd_turtleIsland*@discount/100+"z/"+(getmapusers("tur_dun01.gat") + +getmapusers("tur_dun02.gat")+getmapusers("tur_dun03.gat")+getmapusers("tur_dun04.gat") + +getmapusers("tur_dun05.gat")+getmapusers("tur_dun06.gat"))+" "+$@ked_users$+")", + "- Umbala Dungeon ("+$@kewd_umbala*@discount/100+"z/"+(getmapusers("um_dun01.gat") + +getmapusers("um_dun02.gat"))+" "+$@ked_users$+")" + ); + } else { + set @kmenu, select( + "- Cancel", + "- Abyss Lake ("+$@kewd_abyssLake*@discount/100+"z)", + "- Amatsu Dungeon ("+$@kewd_amatsu*@discount/100+"z)", + "- Ant Hell ("+$@kewd_antHell*@discount/100+"z)", + "- Ayothaya Ancient Shrine ("+$@kewd_ayothaya*@discount/100+"z)", + "- Byalan Dungeon ("+$@kewd_byalan*@discount/100+"z)", + "- Comodo Caves ("+$@kewd_comodo*@discount/100+"z)", + "- Clock Tower ("+$@kewd_clockTower*@discount/100+"z)", + "- Coal Mine ("+$@kewd_coalMines*@discount/100+"z)", + "- Culvert ("+$@kewd_culvert*@discount/100+"z)", + "- Einbroch Mine ("+$@kewd_einbech*@discount/100+"z)", + "- Gefenia ("+$@kewd_gefenia*@discount/100+"z)", + "- Geffen Dungeon ("+$@kewd_geffen*@discount/100+"z)", + "- Glast Heim ("+$@kewd_glastHeim*@discount/100+"z)", + "- Gon Ryun Dungeon ("+$@kewd_gonRyun*@discount/100+"z)", + "- Hidden Temple ("+$@kewd_hiddenTemple*@discount/100+"z)", + "- Juperos ("+$@kewd_juperos*@discount/100+"z)", + "- LightHalzen Rekkenber ("+$@kewd_lightHalzen*@discount/100+"z)", + "- Lou Yang Royal Tomb ("+$@kewd_louYang*@discount/100+"z)", + "- Magma Dungeon ("+$@kewd_magma*@discount/100+"z)", + "- Orcs Dungeon ("+$@kewd_orc*@discount/100+"z)", + "- Payon Dungeon ("+$@kewd_payon*@discount/100+"z)", + "- Pyramid ("+$@kewd_pyramid*@discount/100+"z)", + "- Sphinx ("+$@kewd_sphinx*@discount/100+"z)", + "- Sunken Ship ("+$@kewd_sunkenShip*@discount/100+"z)", + "- Thanatos Tower ("+$@kewd_thanatosTower*@discount/100+"z)", + "- Toy Factory ("+$@kewd_toyFactory*@discount/100+"z)", + "- Turtle Island ("+$@kewd_turtleIsland*@discount/100+"z)", + "- Umbala Dungeon ("+$@kewd_umbala*@discount/100+"z)" + ); + } + switch (@kmenu) { + case 2: + SF_abyssLake(); + break; + case 3: + SF_amatsu(); + break; + case 4: + SF_antHell(); + break; + case 5: + SF_ayothaya(); + break; + case 6: + SF_byalan(); + break; + case 7: + SF_comodo(); + break; + case 8: + SF_clockTower(); + break; + case 9: + SF_coalMine(); + break; + case 10: + SF_culvert(); + break; + case 11: + SF_einbech(); + break; + case 12: + SF_gefenia(); + break; + case 13: + SF_geffen(); + break; + case 14: + SF_glastHeim(); + break; + case 15: + SF_gonRyun(); + break; + case 16: + SF_hiddenTemple(); + break; + case 17: + SF_juperos(); + break; + case 18: + SF_lightHalzen(); + break; + case 19: + SF_louYang(); + break; + case 20: + SF_magma(); + break; + case 21: + SF_orcs(); + break; + case 22: + SF_payon(); + break; + case 23: + SF_pyramid(); + break; + case 24: + SF_sphinx(); + break; + case 25: + SF_sunkenShip(); + break; + case 26: + SF_thanatosTower(); + break; + case 27: + SF_toyFactory(); + break; + case 28: + SF_turtleIsland(); + break; + case 29: + SF_umbala(); + break; + default: + return; + } + } while (@kmenu > 1); + return; + +//Subfunction SF_check(flag, cost, floor-count, player-map, dungeon-map#, map#1, map#2, ...) +//If kewd_travel is set, the flag needs to match to be to warp there. +//Floor count is the amount of levels the dungeon needs a price for, +//dungeon-map# is the number of maps passed that need to be checked against +//the player's map to see if they are warping from within the entrance. + +function SF_check { + if ($@kewd_travel && !((kewd_travel|#kewd_travel)&getarg(0))) { + callfunc "F_keIntro", e_sry, "Sorry, but we can only warp you to dungeons you have saved in before."; + return 0; + } + set @cost, getarg(1); + set @discount,100; + set @map$, getarg(3); + set @mapI, getarg(4); + + while (@mapI > 0) + { + if (@map$ == getarg(4+@mapI)) { + set @discount,100-$@kewd_entryDiscount; + break; + } + set @mapI, @mapI-1; + } + set @discountKP, callfunc("F_keCost",100,$@kewd_discount); + set @discount,@discount*@discountKP/100; + + set @cost,@cost*@discount/100; + set @inc,@cost*$@kewd_levelCost/100; + + //@discountKP is used to reverse the price to before the KP discount takes place + if (@discountKP == 0) + set @discountKP,1; + if ($@kewd_deep == 0) + return 1; + + switch (getarg(2)) { + case 9: + set @cost9, @cost +8*@inc; + case 8: + set @cost8, @cost +7*@inc; + case 7: + set @cost7, @cost +6*@inc; + case 6: + set @cost6, @cost +5*@inc; + case 5: + set @cost5, @cost +4*@inc; + case 4: + set @cost4, @cost +3*@inc; + case 3: + set @cost3, @cost +2*@inc; + case 2: + set @cost2, @cost +@inc; + } + return 1; +} + +function SF_abyssLake { + if (!(SF_check(0x1, $@kewd_abyssLake, 3, @map$, 1, "hu_fild05.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Abyss Lake", + "- Entrance ("+@cost+"z/"+getmapusers("abyss_01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("abyss_02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("abyss_03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Abyss Lake", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"hu_fild05.gat",173,308; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"abyss_02.gat",272,270; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"abyss_03.gat",116,29; + break; + } +} + +function SF_amatsu { + if (!(SF_check(0x2, $@kewd_amatsu, 3, @map$, 1, "ama_in02.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Amatsu Dungeon", + "- Entrance ("+@cost+"z/"+getmapusers("ama_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("ama_dun02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("ama_dun03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Amatsu Dungeon", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"ama_in02.gat",120,181; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"ama_dun02.gat",34,41; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"ama_dun03.gat",119,14; + break; + } +} + +function SF_antHell { + if (!(SF_check(0x4, $@kewd_antHell, 1, @map$, 2, "moc_fild04.gat","moc_fild15.gat"))) + return; + if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Ant Hell", + "- Northern Entrance ("+@cost+"z/"+getmapusers("anthell01.gat")+" "+$@ked_users$+")", + "- Southern Entrance ("+@cost+"z/"+getmapusers("anthell02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Ant Hell", + "- Northern Entrance ("+@cost+"z)", + "- Southern Entrance ("+@cost+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_fild04.gat",201,327; + break; + case 3: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_fild15.gat",246,251; + break; + } +} + +function SF_ayothaya { + if (!(SF_check(0x8, $@kewd_ayothaya, 2, @map$, 1, "ayo_fild02.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Ancient Shrine", + "- Entrance ("+@cost+"z/"+getmapusers("ayo_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("ayo_dun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Ancient Shrine", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"ayo_fild02.gat",273,150; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"ayo_dun02.gat",24,28; + break; + } +} + +function SF_byalan { + if (!(SF_check(0x10, $@kewd_byalan, 5, @map$, 1, "izlu2dun.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Undersea Tunnel", + "- Entrance ("+@cost+"z/"+getmapusers("iz_dun00.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("iz_dun01.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("iz_dun02.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost4+"z/"+getmapusers("iz_dun03.gat")+" "+$@ked_users$+")", + "- Level 5 ("+@cost5+"z/"+getmapusers("iz_dun04.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Undersea Tunnel", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)", + "- Level 4 ("+@cost4+"z)", + "- Level 5 ("+@cost5+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"izlu2dun.gat",114,84; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun01.gat",253,252; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun02.gat",236,204; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun03.gat",32,63; + break; + case 6: + callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"iz_dun04.gat",26,27; + break; + } +} + +function SF_comodo { + if (!(SF_check(0x20, $@kewd_comodo, 1, @map$, 2, "comodo.gat","cmd_fild01.gat"))) + return; + + if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Comodo Caves", + "- Mao, The Eastern Cave ("+@cost+"z/"+getmapusers("beach_dun3.gat")+" "+$@ked_users$+")", + "- Karu, The Western Cave ("+@cost+"z/"+getmapusers("beach_dun.gat")+" "+$@ked_users$+")", + "- Ruande, The Northern Cave ("+@cost+"z/"+getmapusers("beach_dun2.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Comodo Caves", + "- Mao, The Eastern Cave ("+@cost+"z)", + "- Karu, The Western Cave ("+@cost+"z)", + "- Ruande, The Northern Cave ("+@cost+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"cmd_fild01.gat",34,325; + break; + case 3: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"comodo.gat",32,209; + break; + case 4: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"comodo.gat",180,352; + break; + } +} + +function SF_clockTower { + if (!(SF_check(0x40, $@kewd_clockTower, 5, @map$, 1, "aldebaran.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Clock Tower", + "- Entrance ("+@cost+"z/"+getmapusers("c_tower1.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("c_tower2.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("c_tower3.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost4+"z/"+getmapusers("c_tower4.gat")+" "+$@ked_users$+")", + "- Basement 1 ("+@cost2+"z/"+getmapusers("alde_dun01.gat")+" "+$@ked_users$+")", + "- Basement 2 ("+@cost3+"z/"+getmapusers("alde_dun02.gat")+" "+$@ked_users$+")", + "- Basement 3 ("+@cost4+"z/"+getmapusers("alde_dun03.gat")+" "+$@ked_users$+")", + "- Basement 4 ("+@cost5+"z/"+getmapusers("alde_dun04.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Clock Tower", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)", + "- Level 4 ("+@cost4+"z)", + "- Basement 1 ("+@cost2+"z)", + "- Basement 2 ("+@cost3+"z)", + "- Basement 3 ("+@cost4+"z)", + "- Basement 4 ("+@cost5+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"aldebaran.gat",140,130; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"c_tower2.gat",268,26; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"c_tower3.gat",68,146; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"c_tower4.gat",185,44; + break; + case 6: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun01.gat",297,25; + break; + case 7: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun02.gat",43,24; + break; + case 8: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun03.gat",18,267; + break; + case 9: + callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"alde_dun04.gat",82,267; + break; + } +} + +function SF_coalMine { + if (!(SF_check(0x80, $@kewd_coalMines, 3, @map$, 1, "mjolnir_02.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Mjolnir Dead Pit", + "- Entrance ("+@cost+"z/"+getmapusers("mjo_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("mjo_dun02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("mjo_dun03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Mjolnir Dead Pit", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"mjolnir_02.gat",89,358; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"mjo_dun02.gat",376,342; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"mjo_dun03.gat",305,260; + break; + } +} + +function SF_culvert { + if (!(SF_check(0x100, $@kewd_culvert, 4, @map$, 1, "prt_fild05.gat"))) + return; + if ($@kewd_deep == 0) { + set @submenu, 2; + } else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Prontera Culvert", + "- Entrance ("+@cost+"z/"+getmapusers("prt_sewb1.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("prt_sewb2.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("prt_sewb3.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost4+"z/"+getmapusers("prt_sewb4.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Prontera Culvert", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)", + "- Level 4 ("+@cost4+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"prt_fild05.gat",274,208; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"prt_sewb2.gat",19,19; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"prt_sewb3.gat",180,169; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"prt_sewb4.gat",100,92; + break; + } +} + +function SF_einbech { + if (!(SF_check(0x200, $@kewd_einbech, 2, @map$, 1, "einbech.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Einbroch Mines", + "- Entrance ("+@cost+"z/"+getmapusers("ein_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("ein_dun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Einbech Mines", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"einbech.gat",138,244; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"ein_dun02.gat",290,285; + break; + } +} + +function SF_geffen { + if (!(SF_check(0x800, $@kewd_geffen, 3, @map$, 1, "gef_tower.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Geffen Dungeon", + "- Entrance ("+@cost+"z/"+getmapusers("gef_dun00.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("gef_dun01.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("gef_dun02.gat")+" "+$@ked_users$+")" +// "- Level 4 ("+@cost4+"z/"+getmapusers("gef_dun03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Geffen Dungeon", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" +// "- Level 4 ("+@cost4+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gef_tower.gat",147,35; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gef_dun01.gat",115,236; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gef_dun02.gat",106,132; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"gef_dun03.gat",203,200; + break; + } +} + +function SF_gefenia { + if (!(SF_check(0x400, $@kewd_gefenia, 2, @map$, 4, "gefenia01.gat","gefenia02.gat","gefenia03.gat","gefenia04.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Gefenia", + "- Level 1 ("+@cost+"z/"+getmapusers("gefenia01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("gefenia02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost2+"z/"+getmapusers("gefenia03.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost+"z/"+getmapusers("gefenia04.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Gefenia", + "- Level 1 ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost2+"z)", + "- Level 4 ("+@cost+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gefenia01.gat",60,169; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gefenia02.gat",116,116; + break; + case 4: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gefenia03.gat",119,277; + break; + case 5: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gefenia04.gat",129,86; + break; + } +} + +function SF_glastHeim { + if (!(SF_check(0x1000, $@kewd_glastHeim, 7, @map$, 1, "glast_01.gat"))) + return; + if ($@kewd_deep == 0) { + if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Glast Heim", + "- Church Entrance ("+@cost+"z/"+getmapusers("gl_church.gat")+" "+$@ked_users$+")", + "- Castle Terrace ("+@cost+"z/"+(getmapusers("gl_cas01.gat")+getmapusers("gl_cas02.gat"))+" "+$@ked_users$+")", + "- Staircase Entrance ("+@cost+"z/"+getmapusers("gl_step.gat")+" "+$@ked_users$+")", + "- Chivalry Entrance ("+@cost+"z/"+getmapusers("gl_knt01.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Glast Heim", + "- Church Entrance ("+@cost+"z)", + "- Castle Terrace ("+@cost+"z)", + "- Staircase Entrance ("+@cost+"z)", + "- Chivalry Entrance ("+@cost+"z)" + ); + } + if (@submenu > 2) //Churchyard is index 3. + set @submenu, @submenu+1; + } else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Glast Heim", + "- Church Entrance ("+@cost+"z/"+getmapusers("gl_church.gat")+" "+$@ked_users$+")", + "- Churchyard ("+@cost2+"z/"+getmapusers("gl_chyard.gat")+" "+$@ked_users$+")", + "- Castle Terrace ("+@cost+"z/"+(getmapusers("gl_cas01.gat")+getmapusers("gl_cas02.gat"))+" "+$@ked_users$+")", + "- Staircase Entrance ("+@cost+"z/"+getmapusers("gl_step.gat")+" "+$@ked_users$+")", + "- Chivalry Entrance ("+@cost+"z/"+getmapusers("gl_knt01.gat")+" "+$@ked_users$+")", + "- Chivalry Level 2 ("+@cost2+"z/"+getmapusers("gl_knt02.gat")+" "+$@ked_users$+")", + "- Underground Prison 1 ("+@cost2+"z/"+getmapusers("gl_prison.gat")+" "+$@ked_users$+")", + "- Underground Prison 2 ("+@cost3+"z/"+getmapusers("gl_prison1.gat")+" "+$@ked_users$+")", + "- Culvert Level 1 ("+@cost4+"z/"+getmapusers("gl_sew01.gat")+" "+$@ked_users$+")", + "- Culvert Level 2 ("+@cost3+"z/"+getmapusers("gl_sew02.gat")+" "+$@ked_users$+")", + "- Culvert Level 3 ("+@cost4+"z/"+getmapusers("gl_sew03.gat")+" "+$@ked_users$+")", + "- Culvert Level 4 ("+@cost5+"z/"+getmapusers("gl_sew04.gat")+" "+$@ked_users$+")", + "- Underground Cave 1 ("+@cost6+"z/"+getmapusers("gl_dun01.gat")+" "+$@ked_users$+")", + "- Underground Cave 2 ("+@cost7+"z/"+getmapusers("gl_dun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Glast Heim", + "- Church Entrance ("+@cost+"z)", + "- Churchyard ("+@cost2+"z)", + "- Castle Terrace ("+@cost+"z)", + "- Staircase Entrance ("+@cost+"z)", + "- Chivalry Entrance ("+@cost+"z)", + "- Chivalry Level 2 ("+@cost2+"z)", + "- Underground Prison Level 1 ("+@cost2+"z)", + "- Underground Prison Level 2 ("+@cost3+"z)", + "- Culvert Level 1 ("+@cost4+"z)", + "- Culvert Level 2 ("+@cost3+"z)", + "- Culvert Level 3 ("+@cost4+"z)", + "- Culvert Level 4 ("+@cost5+"z)", + "- Underground Cave Level 1 ("+@cost6+"z)", + "- Underground Cave Level 2 ("+@cost7+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",206,136; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gl_chyard.gat",147,15; + break; + case 4: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",199,335; + break; + case 5: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",62,107; + break; + case 6: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"glast_01.gat",69,193; + break; + case 7: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gl_knt02.gat",157,287; + break; + case 8: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gl_prison.gat",14,70; + break; + case 9: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gl_prison1.gat",150,14; + break; + case 10: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew01.gat",258,255; + break; + case 11: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew02.gat",108,291; + break; + case 12: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew03.gat",171,283; + break; + case 13: + callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"gl_sew04.gat",68,277; + break; + case 14: + callfunc "F_keWarp",@cost6*100/@discountKP,$@kewd_discount,e_hmm,"gl_dun01.gat",133,271; + break; + case 15: + callfunc "F_keWarp",@cost7*100/@discountKP,$@kewd_discount,e_hmm,"gl_dun02.gat",224,274; + break; + } +} + +function SF_gonRyun { + if (!(SF_check(0x2000, $@kewd_gonRyun, 3, @map$, 1, "gonryun.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Gon Ryun Dungeon", + "- Entrance ("+@cost+"z/"+getmapusers("gon_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("gon_dun02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("gon_dun03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Gon Ryun Dungeon", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"gonryun.gat",161,195; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"gon_dun02.gat",22,114; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"gon_dun03.gat",68,11; + break; + } +} + +function SF_hiddenTemple { + if (!(SF_check(0x4000, $@kewd_hiddenTemple, 3, @map$, 1, "prt_fild01.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Laberynth Forest", + "- Entrance ("+@cost+"z/"+getmapusers("prt_maze01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("prt_maze02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("prt_maze03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Laberynth Forest", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"prt_fild01.gat",136,361; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"prt_maze02.gat",106,62; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"prt_maze03.gat",23,8; + break; + } +} + +function SF_juperos { + if (!(SF_check(0x8000, $@kewd_juperos, 3, @map$, 1, "jupe_cave.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Juperos", + "- Entrance ("+@cost+"z/"+getmapusers("juperos_01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("juperos_02.gat")+" "+$@ked_users$+")", + "- Core ("+@cost3+"z/"+getmapusers("jupe_core.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Juperos", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Core ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"jupe_cave.gat",55,52; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"juperos_02.gat",37,63; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"jupe_gate.gat",-1,-1; + break; + } +} + +function SF_lightHalzen { + if (!(SF_check(0x10000, $@kewd_lightHalzen, 3, @map$, 1, "lighthalzen.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Rekkenber", + "- Entrance ("+@cost+"z/"+getmapusers("lou_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("lou_dun02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("lou_dun03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Rekkenber", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: +//This is the Rekkenber building entrance, which officially is only a dungeon exit. +// callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"lighthalzen.gat",74,72; + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"lighthalzen.gat",303,302; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"lhz_dun02.gat",154,18; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"lhz_dun03.gat",141,132; + break; + } +} + +function SF_louYang { + if (!(SF_check(0x20000, $@kewd_louYang, 3, @map$, 1, "louyang.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Royal Tomb", + "- Entrance ("+@cost+"z/"+getmapusers("lou_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("lou_dun02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("lou_dun03.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Royal Tomb", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)" + ); + }; + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"louyang.gat",41,267; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"lou_dun02.gat",281,20; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"lou_dun03.gat",165,39; + break; + } +} + +function SF_magma { + if (!(SF_check(0x40000, $@kewd_magma, 2, @map$, 1, "yuno_fild03.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Nogg Road", + "- Entrance ("+@cost+"z/"+getmapusers("mag_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("mag_dun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Nogg Road", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"yuno_fild03.gat",35,135; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"mag_dun02.gat",47,30; + break; + } +} + +function SF_orcs { + if (!(SF_check(0x80000, $@kewd_orc, 2, @map$, 1, "gef_fild10.gat"))) + return; + if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Orcs Dungeon", + "- Front Entrance ("+@cost+"z/"+getmapusers("orcsdun01.gat")+" "+$@ked_users$+")", + "- Back Entrance ("+@cost+"z/"+getmapusers("orcsdun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Orcs Dungeon", + "- Front Entrance ("+@cost+"z)", + "- Back Entrance ("+@cost+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"in_orcs01.gat",34,165; + break; + case 3: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"in_orcs01.gat",112,99; + break; + } +} + +function SF_payon { + if (!(SF_check(0x100000, $@kewd_payon, 5, @map$, 1, "pay_arche.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Payon Cave", + "- Entrance ("+@cost+"z/"+getmapusers("pay_dun00.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("pay_dun01.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("pay_dun02.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost4+"z/"+getmapusers("pay_dun03.gat")+" "+$@ked_users$+")", + "- Level 5 ("+@cost5+"z/"+getmapusers("pay_dun04.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Payon Cave", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)", + "- Level 4 ("+@cost4+"z)", + "- Level 5 ("+@cost5+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"pay_arche.gat",41,133; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun01.gat",19,33; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun02.gat",19,63; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun03.gat",155,159; + break; + case 6: + callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"pay_dun04.gat",34,202; + break; + } +} + +function SF_pyramid { + if (!(SF_check(0x200000, $@kewd_pyramid, 4, @map$,1, "moc_ruins.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Pyramid", + "- Entrance ("+@cost+"z/"+getmapusers("moc_pryd01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("moc_pryd02.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("moc_pryd03.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost4+"z/"+getmapusers("moc_pryd04.gat")+" "+$@ked_users$+")", + "- Basement 1 ("+@cost2+"z/"+getmapusers("moc_pryd05.gat")+" "+$@ked_users$+")", + "- Basement 2 ("+@cost3+"z/"+getmapusers("moc_pryd06.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Pyramid", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)", + "- Level 4 ("+@cost4+"z)", + "- Basement 1 ("+@cost2+"z)", + "- Basement 2 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_ruins.gat",62,162; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd02.gat",10,192; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd03.gat",100,92; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd04.gat",18,187; + break; + case 6: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd05.gat",94,96; + break; + case 7: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"moc_pryd06.gat",192,11; + break; + } +} + +function SF_sphinx { + if (!(SF_check(0x400000, $@kewd_sphinx, 5, @map$, 1, "moc_fild19.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to the Sphinx", + "- Entrance ("+@cost+"z/"+getmapusers("in_sphinx1.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("in_sphinx2.gat")+" "+$@ked_users$+")", + "- Level 3 ("+@cost3+"z/"+getmapusers("in_sphinx3.gat")+" "+$@ked_users$+")", + "- Level 4 ("+@cost4+"z/"+getmapusers("in_sphinx4.gat")+" "+$@ked_users$+")", + "- Level 5 ("+@cost5+"z/"+getmapusers("in_sphinx5.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to the Sphinx", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)", + "- Level 3 ("+@cost3+"z)", + "- Level 4 ("+@cost4+"z)", + "- Level 5 ("+@cost5+"z)" + ); + } + + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"moc_fild19.gat",107,100; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx2.gat",149,81; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx3.gat",210,54; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx4.gat",10,222; + break; + case 6: + callfunc "F_keWarp",@cost5*100/@discountKP,$@kewd_discount,e_hmm,"in_sphinx5.gat",100,99; + break; + } +} + +function SF_sunkenShip { + if (!(SF_check(0x800000, $@kewd_sunkenShip, 2, @map$, 1, "alb2trea.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Sunken Ship", + "- Entrance ("+@cost+"z/"+getmapusers("treasure01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("treasure02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Sunken Ship", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)" + ); + } + + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"alb2trea.gat",87,103; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"treasure02.gat",102,27; + break; + } +} + +function SF_thanatosTower { + if (!(SF_check(0x1000000, $@kewd_thanatosTower, 9, @map$, 1, "tha_t01.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Thanatos Tower", + "- Entrance ("+@cost+"z/"+getmapusers("tha_t01.gat")+" "+$@ked_users$+")", + "- Floor 2 ("+@cost2+"z/"+getmapusers("tha_t02.gat")+" "+$@ked_users$+")", + "- Floor 3 ("+@cost3+"z/"+getmapusers("tha_t03.gat")+" "+$@ked_users$+")", + "- Floor 4 ("+@cost4+"z/"+getmapusers("tha_t04.gat")+" "+$@ked_users$+")", + "- Floor 5 ("+@cost5+"z/"+getmapusers("tha_t05.gat")+" "+$@ked_users$+")", + "- Floor 6 ("+@cost6+"z/"+getmapusers("tha_t06.gat")+" "+$@ked_users$+")", + "- Floor 7 ("+@cost7+"z/"+getmapusers("tha_t07.gat")+" "+$@ked_users$+")", + "- Floor 8 ("+@cost8+"z/"+getmapusers("tha_t08.gat")+" "+$@ked_users$+")", + "- Floor 9 ("+@cost9+"z/"+getmapusers("tha_t09.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Thanatos Tower", + "- Entrance ("+@cost+"z)", + "- Floor 2 ("+@cost2+"z)", + "- Floor 3 ("+@cost3+"z)", + "- Floor 4 ("+@cost4+"z)", + "- Floor 5 ("+@cost5+"z)", + "- Floor 6 ("+@cost6+"z)", + "- Floor 7 ("+@cost7+"z)", + "- Floor 8 ("+@cost8+"z)", + "- Floor 9 ("+@cost9+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"tha_scene01.gat",139,201; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"tha_t02.gat",149,136; + break; + case 4: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"tha_t03.gat",220,159; + break; + case 5: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t04.gat",59,144; + break; + case 6: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t05.gat",62,9; + break; + case 7: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t06.gat",120,225; + break; + case 8: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t07.gat",32,166; + break; + case 9: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t08.gat",108,44; + break; + case 10: + callfunc "F_keWarp",@cost4*100/@discountKP,$@kewd_discount,e_hmm,"tha_t09.gat",87,145; + break; + } +} + +function SF_toyFactory { + if (!(SF_check(0x2000000, $@kewd_toyFactory, 2, @map$, 1, "xmas.gat"))) + return; + + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Toy Factory", + "- Entrance ("+@cost+"z/"+getmapusers("xmas_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("xmas_dun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Toy Factory", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)" + ); + } + + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"xmas.gat",144,306; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"xmas_dun02.gat",129,133; + break; + } +} + +function SF_turtleIsland { + if (!(SF_check(0x4000000, $@kewd_turtleIsland, 3, @map$, 1, "tur_dun01.gat"))) + return; + if ($@kewd_deep == 0) { + if ($@kewd_turtleCave) + set @submenu, 3; + else + set @submenu, 2; + } else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Turtle Island", + "- Island Entrance ("+@cost+"z/"+getmapusers("tur_dun01.gat")+" "+$@ked_users$+")", + "- Cave Entrance ("+@cost+"z/"+getmapusers("tur_dun02.gat")+" "+$@ked_users$+")", + "- Cave Level 2 ("+@cost2+"z/"+getmapusers("tur_dun03.gat")+" "+$@ked_users$+")", + "- Cave Level 3 ("+@cost3+"z/"+getmapusers("tur_dun04.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Turtle Island", + "- Island Entrance ("+@cost+"z)", + "- Cave Entrance ("+@cost+"z)", + "- Cave Level 2 ("+@cost2+"z)", + "- Cave Level 3 ("+@cost3+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun01.gat",153,47; + break; + case 3: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun01.gat",155,234; + break; + case 4: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun03.gat",132,189; + break; + case 5: + callfunc "F_keWarp",@cost3*100/@discountKP,$@kewd_discount,e_hmm,"tur_dun04.gat",100,192; + break; + } +} + +function SF_umbala { + if (!(SF_check(0x8000000, $@kewd_umbala, 2, @map$, 1, "umbala.gat"))) + return; + if ($@kewd_deep == 0) + set @submenu, 2; + else if ($@kewd_showOnline) { + set @submenu, select( + "- Cancel warp to Umbala Dungeon", + "- Entrance ("+@cost+"z/"+getmapusers("um_dun01.gat")+" "+$@ked_users$+")", + "- Level 2 ("+@cost2+"z/"+getmapusers("um_dun02.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel warp to Umbala Dungeon", + "- Entrance ("+@cost+"z)", + "- Level 2 ("+@cost2+"z)" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",@cost*100/@discountKP,$@kewd_discount,e_hmm,"umbala.gat",113,282; + break; + case 3: + callfunc "F_keWarp",@cost2*100/@discountKP,$@kewd_discount,e_hmm,"um_dun02.gat",48,31; + break; + } +} + +} + +//Invoked when we want to add a map to the list of travelled-to dungeons +function script F_keAddTravelDungeon { + set @map$, getarg(0); +// Temporary code to update the previous variable format to the new one. + if(kewd_abyss) { + set kewd_travel,kewd_travel|0x1; + set kewd_abyss,0; + } + if(kewd_amatsu) { + set kewd_travel,kewd_travel|0x2; + set kewd_amatsu,0; + } + if(kewd_antHell) { + set kewd_travel,kewd_travel|0x4; + set kewd_antHell,0; + } + if(kewd_ayothaya) { + set kewd_travel,kewd_travel|0x8; + set kewd_ayothaya,0; + } + if(kewd_byalan) { + set kewd_travel,kewd_travel|0x10; + set kewd_byalan,0; + } + if(kewd_comodo) { + set kewd_travel,kewd_travel|0x20; + set kewd_comodo,0; + } + if(kewd_clockTower) { + set kewd_travel,kewd_travel|0x40; + set kewd_clockTower,0; + } + if(kewd_coalMines) { + set kewd_travel,kewd_travel|0x80; + set kewd_coalMines,0; + } + if(kewd_culvert) { + set kewd_travel,kewd_travel|0x100; + set kewd_culvert,0; + } + if(kewd_einbech) { + set kewd_travel,kewd_travel|0x200; + set kewd_einbech,0; + } + if(kewd_geffen) { + set kewd_travel,kewd_travel|0x800; + set kewd_geffen,0; + } + if(kewd_glastHeim) { + set kewd_travel,kewd_travel|0x1000; + set kewd_glastHeim,0; + } + if(kewd_gonRyun) { + set kewd_travel,kewd_travel|0x2000; + set kewd_gonRyun,0; + } + if(kewd_hiddenTemple) { + set kewd_travel,kewd_travel|0x4000; + set kewd_hiddenTemple,0; + } + if(kewd_juperos) { + set kewd_travel,kewd_travel|0x8000; + set kewd_juperos,0; + } + if(kewd_lightHalzen) { + set kewd_travel,kewd_travel|0x10000; + set kewd_lightHalzen,0; + } + if(kewd_louYang) { + set kewd_travel,kewd_travel|0x20000; + set kewd_louYang,0; + } + if(kewd_magma) { + set kewd_travel,kewd_travel|0x40000; + set kewd_magma,0; + } + if(kewd_orc) { + set kewd_travel,kewd_travel|0x80000; + set kewd_orc,0; + } + if(kewd_payon) { + set kewd_travel,kewd_travel|0x100000; + set kewd_payon,0; + } + if(kewd_pyramid) { + set kewd_travel,kewd_travel|0x200000; + set kewd_pyramid,0; + } + if(kewd_sphinx) { + set kewd_travel,kewd_travel|0x400000; + set kewd_sphinx,0; + } + if(kewd_sunkenShip) { + set kewd_travel,kewd_travel|0x800000; + set kewd_sunkenShip,0; + } + if(kewd_thanatosTower) { + set kewd_travel,kewd_travel|0x1000000; + set kewd_thanatosTower,0; + } + if(kewd_toyFactory) { + set kewd_travel,kewd_travel|0x2000000; + set kewd_toyFactory,0; + } + if(kewd_turtleIsland) { + set kewd_travel,kewd_travel|0x4000000; + set kewd_turtleIsland,0; + } + if(kewd_umbala) { + set kewd_travel,kewd_travel|0x8000000; + set kewd_umbala,0; + } + + if(#kewd_abyss) { + set #kewd_travel,#kewd_travel|0x1; + set #kewd_abyss,0; + } + if(#kewd_amatsu) { + set #kewd_travel,#kewd_travel|0x2; + set #kewd_amatsu,0; + } + if(#kewd_antHell) { + set #kewd_travel,#kewd_travel|0x4; + set #kewd_antHell,0; + } + if(#kewd_ayothaya) { + set #kewd_travel,#kewd_travel|0x8; + set #kewd_ayothaya,0; + } + if(#kewd_byalan) { + set #kewd_travel,#kewd_travel|0x10; + set #kewd_byalan,0; + } + if(#kewd_comodo) { + set #kewd_travel,#kewd_travel|0x20; + set #kewd_comodo,0; + } + if(#kewd_clockTower) { + set #kewd_travel,#kewd_travel|0x40; + set #kewd_clockTower,0; + } + if(#kewd_coalMines) { + set #kewd_travel,#kewd_travel|0x80; + set #kewd_coalMines,0; + } + if(#kewd_culvert) { + set #kewd_travel,#kewd_travel|0x100; + set #kewd_culvert,0; + } + if(#kewd_einbech) { + set #kewd_travel,#kewd_travel|0x200; + set #kewd_einbech,0; + } + if(#kewd_geffen) { + set #kewd_travel,#kewd_travel|0x800; + set #kewd_geffen,0; + } + if(#kewd_glastHeim) { + set #kewd_travel,#kewd_travel|0x1000; + set #kewd_glastHeim,0; + } + if(#kewd_gonRyun) { + set #kewd_travel,#kewd_travel|0x2000; + set #kewd_gonRyun,0; + } + if(#kewd_hiddenTemple) { + set #kewd_travel,#kewd_travel|0x4000; + set #kewd_hiddenTemple,0; + } + if(#kewd_juperos) { + set #kewd_travel,#kewd_travel|0x8000; + set #kewd_juperos,0; + } + if(#kewd_lightHalzen) { + set #kewd_travel,#kewd_travel|0x10000; + set #kewd_lightHalzen,0; + } + if(#kewd_louYang) { + set #kewd_travel,#kewd_travel|0x20000; + set #kewd_louYang,0; + } + if(#kewd_magma) { + set #kewd_travel,#kewd_travel|0x40000; + set #kewd_magma,0; + } + if(#kewd_orc) { + set #kewd_travel,#kewd_travel|0x80000; + set #kewd_orc,0; + } + if(#kewd_payon) { + set #kewd_travel,#kewd_travel|0x100000; + set #kewd_payon,0; + } + if(#kewd_pyramid) { + set #kewd_travel,#kewd_travel|0x200000; + set #kewd_pyramid,0; + } + if(#kewd_sphinx) { + set #kewd_travel,#kewd_travel|0x400000; + set #kewd_sphinx,0; + } + if(#kewd_sunkenShip) { + set #kewd_travel,#kewd_travel|0x800000; + set #kewd_sunkenShip,0; + } + if(#kewd_thanatosTower) { + set #kewd_travel,#kewd_travel|0x1000000; + set #kewd_thanatosTower,0; + } + if(#kewd_toyFactory) { + set #kewd_travel,#kewd_travel|0x2000000; + set #kewd_toyFactory,0; + } + if(#kewd_turtleIsland) { + set #kewd_travel,#kewd_travel|0x4000000; + set #kewd_turtleIsland,0; + } + if(#kewd_umbala) { + set #kewd_travel,#kewd_travel|0x8000000; + set #kewd_umbala,0; + } + +// End transition code. + if ($@kewd_travel > 1) { + if (@map$ == "hu_fild05.gat" || kewd_travel&0x1) + set #kewd_travel,#kewd_travel|0x1; + if (@map$ == "ama_in02.gat" || kewd_travel&0x2) + set #kewd_travel,#kewd_travel|0x2; + if (@map$ == "moc_fild04.gat" || @map$ == "moc_fild15.gat" || kewd_travel&0x4) + set #kewd_travel,#kewd_travel|0x4; + if (@map$ == "ayo_fild02.gat" || kewd_travel&0x8) + set #kewd_travel,#kewd_travel|0x8; + if (@map$ == "izlu2dun.gat" || kewd_travel&0x10) + set #kewd_travel,#kewd_travel|0x10; + if (@map$ == "comodo.gat" || @map$ == "cmd_fild01.gat" || kewd_travel&0x20) + set #kewd_travel,#kewd_travel|0x20; + if (@map$ == "aldebaran.gat" || kewd_travel&0x40) + set #kewd_travel,#kewd_travel|0x40; + if (@map$ == "mjolnir_02.gat" || kewd_travel&0x80) + set #kewd_travel,#kewd_travel|0x80; + if (@map$ == "prt_fild05.gat" || kewd_travel&0x100) + set #kewd_travel,#kewd_travel|0x100; + if (@map$ == "einbech.gat" || kewd_travel&0x200) + set #kewd_travel,#kewd_travel|0x200; + if (@map$ == "gef_tower.gat" || kewd_travel&0x800) + set #kewd_travel,#kewd_travel|0x800; + if (@map$ == "glast_01.gat" || kewd_travel&0x1000) + set #kewd_travel,#kewd_travel|0x1000; + if (@map$ == "gonryun.gat" || kewd_travel&0x2000) + set #kewd_travel,#kewd_travel|0x2000; + if (@map$ == "prt_fild01.gat" || kewd_travel&0x4000) + set #kewd_travel,#kewd_travel|0x4000; + if (@map$ == "jupe_cave.gat" || kewd_travel&0x8000) + set #kewd_travel,#kewd_travel|0x8000; + if (@map$ == "lighthalzen.gat" || kewd_travel&0x10000) + set #kewd_travel,#kewd_travel|0x10000; + if (@map$ == "louyang.gat" || kewd_travel&0x20000) + set #kewd_travel,#kewd_travel|0x20000; + if (@map$ == "yuno_fild03.gat" || kewd_travel&0x40000) + set #kewd_travel,#kewd_travel|0x40000; + if (@map$ == "in_orcs01.gat" || kewd_travel&0x80000) + set #kewd_travel,#kewd_travel|0x80000; + if (@map$ == "pay_arche.gat" || kewd_travel&0x100000) + set #kewd_travel,#kewd_travel|0x100000; + if (@map$ == "moc_ruins.gat" || kewd_travel&0x200000) + set #kewd_travel,#kewd_travel|0x200000; + if (@map$ == "moc_fild19.gat" || kewd_travel&0x400000) + set #kewd_travel,#kewd_travel|0x400000; + if (@map$ == "alb2trea.gat" || kewd_travel&0x800000) + set #kewd_travel,#kewd_travel|0x800000; + if (@map$ == "tha_t01.gat" || kewd_travel&0x1000000) + set #kewd_travel,#kewd_travel|0x1000000; + if (@map$ == "xmas.gat" || kewd_travel&0x2000000) + set #kewd_travel,#kewd_travel|0x2000000; + if (@map$ == "tur_dun01.gat" || kewd_travel&0x4000000) + set #kewd_travel,#kewd_travel|0x4000000; + if (@map$ == "umbala.gat" || kewd_travel&0x8000000) + set #kewd_travel,#kewd_travel|0x8000000; + } else { + if (@map$ == "hu_fild05.gat") + set kewd_travel,kewd_travel|0x1; + if (@map$ == "ama_in02.gat") + set kewd_travel,kewd_travel|0x2; + if (@map$ == "moc_fild04.gat" || @map$ == "moc_fild15.gat") + set kewd_travel,kewd_travel|0x4; + if (@map$ == "ayo_fild02.gat") + set kewd_travel,kewd_travel|0x8; + if (@map$ == "izlu2dun.gat") + set kewd_travel,kewd_travel|0x10; + if (@map$ == "comodo.gat" || @map$ == "cmd_fild01.gat") + set kewd_travel,kewd_travel|0x20; + if (@map$ == "aldebaran.gat") + set kewd_travel,kewd_travel|0x40; + if (@map$ == "mjolnir_02.gat") + set kewd_travel,kewd_travel|0x80; + if (@map$ == "prt_fild05.gat") + set kewd_travel,kewd_travel|0x100; + if (@map$ == "einbech.gat") + set kewd_travel,kewd_travel|0x200; + if (@map$ == "gef_tower.gat") + set kewd_travel,kewd_travel|0x800; + if (@map$ == "glast_01.gat") + set kewd_travel,kewd_travel|0x1000; + if (@map$ == "gonryun.gat") + set kewd_travel,kewd_travel|0x2000; + if (@map$ == "prt_fild01.gat") + set kewd_travel,kewd_travel|0x4000; + if (@map$ == "jupe_cave.gat") + set kewd_travel,kewd_travel|0x8000; + if (@map$ == "lighthalzen.gat") + set kewd_travel,kewd_travel|0x10000; + if (@map$ == "louyang.gat") + set kewd_travel,kewd_travel|0x20000; + if (@map$ == "yuno_fild03.gat") + set kewd_travel,kewd_travel|0x40000; + if (@map$ == "in_orcs01.gat") + set kewd_travel,kewd_travel|0x80000; + if (@map$ == "pay_arche.gat") + set kewd_travel,kewd_travel|0x100000; + if (@map$ == "moc_ruins.gat") + set kewd_travel,kewd_travel|0x200000; + if (@map$ == "moc_fild19.gat") + set kewd_travel,kewd_travel|0x400000; + if (@map$ == "alb2trea.gat") + set kewd_travel,kewd_travel|0x800000; + if (@map$ == "tha_t01.gat") + set kewd_travel,kewd_travel|0x1000000; + if (@map$ == "xmas.gat") + set kewd_travel,kewd_travel|0x2000000; + if (@map$ == "tur_dun01.gat") + set kewd_travel,kewd_travel|0x4000000; + if (@map$ == "umbala.gat") + set kewd_travel,kewd_travel|0x8000000; + } + return; +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_pvp.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_pvp.txt index 73f278b5d..b12d0fcb1 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_pvp.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_pvp.txt @@ -1,156 +1,156 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Pvp Warping Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 1.7
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers warping to the PvP arenas.
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//============================================================
-
-- script keInit_warpPvp -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadWarpPvp";
- end;
-}
-
-function script F_keWarpPvp {
-
- function SF_pvpMenu;
-
- set @cost,callfunc("F_keCost",1,100);
- if ($@kewp_advanced == 0) {
- SF_pvpMenu 1,$@kewp_cost,100,0,0;
- return;
- }
-
- do {
- if ($@kewp_showOnline) {
- set @kmenu, select(
- "- Cancel",
- "- All Levels Rooms ("+($@kewp_cost*@cost)+"z/"+(getmapusers("pvp_n_8-1.gat")+getmapusers("pvp_n_8-2.gat")
- +getmapusers("pvp_n_8-3.gat")+getmapusers("pvp_n_8-4.gat")+getmapusers("pvp_n_8-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv1-$@kewp_range)+"-"+($@kewp_baseLv1+$@kewp_range)+" Rooms ("+($@kewp_cost1*@cost)+"z/"
- +(getmapusers("pvp_n_1-1.gat")+getmapusers("pvp_n_1-2.gat")+getmapusers("pvp_n_1-3.gat")
- +getmapusers("pvp_n_1-4.gat")+getmapusers("pvp_n_1-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv2-$@kewp_range)+"-"+($@kewp_baseLv2+$@kewp_range)+" Rooms ("+($@kewp_cost2*@cost)+"z/"
- +(getmapusers("pvp_n_2-1.gat")+getmapusers("pvp_n_2-2.gat")+getmapusers("pvp_n_2-3.gat")
- +getmapusers("pvp_n_2-4.gat")+getmapusers("pvp_n_2-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv3-$@kewp_range)+"-"+($@kewp_baseLv3+$@kewp_range)+" Rooms ("+($@kewp_cost3*@cost)+"z/"
- +(getmapusers("pvp_n_3-1.gat")+getmapusers("pvp_n_3-2.gat")+getmapusers("pvp_n_3-3.gat")
- +getmapusers("pvp_n_3-4.gat")+getmapusers("pvp_n_3-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv4-$@kewp_range)+"-"+($@kewp_baseLv4+$@kewp_range)+" Rooms ("+($@kewp_cost4*@cost)+"z/"
- +(getmapusers("pvp_n_4-1.gat")+getmapusers("pvp_n_4-2.gat")+getmapusers("pvp_n_4-3.gat")
- +getmapusers("pvp_n_4-4.gat")+getmapusers("pvp_n_4-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv5-$@kewp_range)+"-"+($@kewp_baseLv5+$@kewp_range)+" Rooms ("+($@kewp_cost5*@cost)+"z/"
- +(getmapusers("pvp_n_5-1.gat")+getmapusers("pvp_n_5-2.gat")+getmapusers("pvp_n_5-3.gat")
- +getmapusers("pvp_n_5-4.gat")+getmapusers("pvp_n_5-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv6-$@kewp_range)+"-"+($@kewp_baseLv6+$@kewp_range)+" Rooms ("+($@kewp_cost6*@cost)+"z/"
- +(getmapusers("pvp_n_6-1.gat")+getmapusers("pvp_n_6-2.gat")+getmapusers("pvp_n_6-3.gat")
- +getmapusers("pvp_n_6-4.gat")+getmapusers("pvp_n_6-5.gat"))+" "+$@ked_users$+")",
- "- Levels "+($@kewp_baseLv7-$@kewp_range)+"-"+($@kewp_baseLv7+$@kewp_range)+" Rooms ("+($@kewp_cost7*@cost)+"z/"
- +(getmapusers("pvp_n_7-1.gat")+getmapusers("pvp_n_7-2.gat")+getmapusers("pvp_n_7-3.gat")
- +getmapusers("pvp_n_7-4.gat")+getmapusers("pvp_n_7-5.gat"))+" "+$@ked_users$+")"
- );
- } else {
- set @kmenu, select(
- "- Cancel",
- "- No Level Restriction Rooms ("+($@kewp_cost*@cost)+"z)",
- "- Levels "+($@kewp_baseLv1-$@kewp_range)+"-"+($@kewp_baseLv1+$@kewp_range)+" Rooms ("+($@kewp_cost1*@cost)+"z)",
- "- Levels "+($@kewp_baseLv2-$@kewp_range)+"-"+($@kewp_baseLv2+$@kewp_range)+" Rooms ("+($@kewp_cost2*@cost)+"z)",
- "- Levels "+($@kewp_baseLv3-$@kewp_range)+"-"+($@kewp_baseLv3+$@kewp_range)+" Rooms ("+($@kewp_cost3*@cost)+"z)",
- "- Levels "+($@kewp_baseLv4-$@kewp_range)+"-"+($@kewp_baseLv4+$@kewp_range)+" Rooms ("+($@kewp_cost4*@cost)+"z)",
- "- Levels "+($@kewp_baseLv5-$@kewp_range)+"-"+($@kewp_baseLv5+$@kewp_range)+" Rooms ("+($@kewp_cost5*@cost)+"z)",
- "- Levels "+($@kewp_baseLv6-$@kewp_range)+"-"+($@kewp_baseLv6+$@kewp_range)+" Rooms ("+($@kewp_cost6*@cost)+"z)",
- "- Levels "+($@kewp_baseLv7-$@kewp_range)+"-"+($@kewp_baseLv7+$@kewp_range)+" Rooms ("+($@kewp_cost7*@cost)+"z)"
- );
- }
- switch(@kmenu) {
- case 2: //No restrictions
- SF_pvpMenu 8,$@kewp_cost,100,0,0;
- break;
- case 3:
- SF_pvpMenu 1,$@kewp_cost1,100,$@kewp_baseLv1-$@kewp_range,$@kewp_baseLv1+$@kewp_range;
- break;
- case 4:
- SF_pvpMenu 2,$@kewp_cost2,100,$@kewp_baseLv2-$@kewp_range,$@kewp_baseLv2+$@kewp_range;
- break;
- case 5:
- SF_pvpMenu 3,$@kewp_cost3,100,$@kewp_baseLv3-$@kewp_range,$@kewp_baseLv3+$@kewp_range;
- break;
- case 6:
- SF_pvpMenu 4,$@kewp_cost4,100,$@kewp_baseLv4-$@kewp_range,$@kewp_baseLv4+$@kewp_range;
- break;
- case 7:
- SF_pvpMenu 5,$@kewp_cost5,100,$@kewp_baseLv5-$@kewp_range,$@kewp_baseLv5+$@kewp_range;
- break;
- case 8:
- SF_pvpMenu 6,$@kewp_cost6,100,$@kewp_baseLv6-$@kewp_range,$@kewp_baseLv6+$@kewp_range;
- break;
- case 9:
- SF_pvpMenu 7,$@kewp_cost7,100,$@kewp_baseLv7-$@kewp_range,$@kewp_baseLv7+$@kewp_range;
- break;
- }
- } while (@kmenu > 1);
- return;
-
-//SubFunction: SF_pvpMenu (int map-group, int cost, int min level, int max level)
-//Displays the list of the five available Pvp rooms to warp to.
-//map-group is the first index of the pvp map names (in pvp_n_2-3.gat it would be 2)
-function SF_pvpMenu {
- if (getarg(4)) {
- if (BaseLevel < getarg(3)) {
- callfunc "F_keIntro", e_sry, "Sorry, you need at least level "+getarg(2)+" to enter these arenas.";
- return;
- }
- if (BaseLevel > getarg(4)) {
- callfunc "F_keIntro", e_bzz, "Sorry, people above level "+getarg(3)+" are not allowed within these arenas.";
- return;
- }
- set @msg$,"levels "+getarg(3)+"-"+getarg(3);
- } else
- set @msg$,"all levels";
- if ($@kewp_showOnline) {
- set @submenu, select(
- "- Cancel Warp (Rooms for "+@msg$+"/"+(getarg(1)*@cost)+"z)",
- "- Room Sandwich ("+getmapusers("pvp_n_"+getarg(0)+"-1.gat")+" "+$@ked_users$+")",
- "- Room Rock On ("+getmapusers("pvp_n_"+getarg(0)+"-2.gat")+" "+$@ked_users$+")",
- "- Four Room ("+getmapusers("pvp_n_"+getarg(0)+"-3.gat")+" "+$@ked_users$+")",
- "- Room Undercross ("+getmapusers("pvp_n_"+getarg(0)+"-4.gat")+" "+$@ked_users$+")",
- "- Room Compass ("+getmapusers("pvp_n_"+getarg(0)+"-5.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel Warp (Rooms for "+@msg$+"/"+(getarg(1)*@cost)+"z)",
- "- Room Sandwich",
- "- Room Rock On",
- "- Four Room",
- "- Room Undercross",
- "- Room Compass"
- );
- }
- switch (@submenu) {
- case 2:
- callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-1.gat",-1,-1;
- break;
- case 3:
- callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-2.gat",-1,-1;
- break;
- case 4:
- callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-3.gat",-1,-1;
- break;
- case 5:
- callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-4.gat",-1,-1;
- break;
- case 6:
- callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-5.gat",-1,-1;
- break;
- }
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Pvp Warping Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 1.7 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+ +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers warping to the PvP arenas. +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//============================================================ + +- script keInit_warpPvp -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadWarpPvp"; + end; +} + +function script F_keWarpPvp { + + function SF_pvpMenu; + + set @cost,callfunc("F_keCost",1,100); + if ($@kewp_advanced == 0) { + SF_pvpMenu 1,$@kewp_cost,100,0,0; + return; + } + + do { + if ($@kewp_showOnline) { + set @kmenu, select( + "- Cancel", + "- All Levels Rooms ("+($@kewp_cost*@cost)+"z/"+(getmapusers("pvp_n_8-1.gat")+getmapusers("pvp_n_8-2.gat") + +getmapusers("pvp_n_8-3.gat")+getmapusers("pvp_n_8-4.gat")+getmapusers("pvp_n_8-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv1-$@kewp_range)+"-"+($@kewp_baseLv1+$@kewp_range)+" Rooms ("+($@kewp_cost1*@cost)+"z/" + +(getmapusers("pvp_n_1-1.gat")+getmapusers("pvp_n_1-2.gat")+getmapusers("pvp_n_1-3.gat") + +getmapusers("pvp_n_1-4.gat")+getmapusers("pvp_n_1-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv2-$@kewp_range)+"-"+($@kewp_baseLv2+$@kewp_range)+" Rooms ("+($@kewp_cost2*@cost)+"z/" + +(getmapusers("pvp_n_2-1.gat")+getmapusers("pvp_n_2-2.gat")+getmapusers("pvp_n_2-3.gat") + +getmapusers("pvp_n_2-4.gat")+getmapusers("pvp_n_2-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv3-$@kewp_range)+"-"+($@kewp_baseLv3+$@kewp_range)+" Rooms ("+($@kewp_cost3*@cost)+"z/" + +(getmapusers("pvp_n_3-1.gat")+getmapusers("pvp_n_3-2.gat")+getmapusers("pvp_n_3-3.gat") + +getmapusers("pvp_n_3-4.gat")+getmapusers("pvp_n_3-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv4-$@kewp_range)+"-"+($@kewp_baseLv4+$@kewp_range)+" Rooms ("+($@kewp_cost4*@cost)+"z/" + +(getmapusers("pvp_n_4-1.gat")+getmapusers("pvp_n_4-2.gat")+getmapusers("pvp_n_4-3.gat") + +getmapusers("pvp_n_4-4.gat")+getmapusers("pvp_n_4-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv5-$@kewp_range)+"-"+($@kewp_baseLv5+$@kewp_range)+" Rooms ("+($@kewp_cost5*@cost)+"z/" + +(getmapusers("pvp_n_5-1.gat")+getmapusers("pvp_n_5-2.gat")+getmapusers("pvp_n_5-3.gat") + +getmapusers("pvp_n_5-4.gat")+getmapusers("pvp_n_5-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv6-$@kewp_range)+"-"+($@kewp_baseLv6+$@kewp_range)+" Rooms ("+($@kewp_cost6*@cost)+"z/" + +(getmapusers("pvp_n_6-1.gat")+getmapusers("pvp_n_6-2.gat")+getmapusers("pvp_n_6-3.gat") + +getmapusers("pvp_n_6-4.gat")+getmapusers("pvp_n_6-5.gat"))+" "+$@ked_users$+")", + "- Levels "+($@kewp_baseLv7-$@kewp_range)+"-"+($@kewp_baseLv7+$@kewp_range)+" Rooms ("+($@kewp_cost7*@cost)+"z/" + +(getmapusers("pvp_n_7-1.gat")+getmapusers("pvp_n_7-2.gat")+getmapusers("pvp_n_7-3.gat") + +getmapusers("pvp_n_7-4.gat")+getmapusers("pvp_n_7-5.gat"))+" "+$@ked_users$+")" + ); + } else { + set @kmenu, select( + "- Cancel", + "- No Level Restriction Rooms ("+($@kewp_cost*@cost)+"z)", + "- Levels "+($@kewp_baseLv1-$@kewp_range)+"-"+($@kewp_baseLv1+$@kewp_range)+" Rooms ("+($@kewp_cost1*@cost)+"z)", + "- Levels "+($@kewp_baseLv2-$@kewp_range)+"-"+($@kewp_baseLv2+$@kewp_range)+" Rooms ("+($@kewp_cost2*@cost)+"z)", + "- Levels "+($@kewp_baseLv3-$@kewp_range)+"-"+($@kewp_baseLv3+$@kewp_range)+" Rooms ("+($@kewp_cost3*@cost)+"z)", + "- Levels "+($@kewp_baseLv4-$@kewp_range)+"-"+($@kewp_baseLv4+$@kewp_range)+" Rooms ("+($@kewp_cost4*@cost)+"z)", + "- Levels "+($@kewp_baseLv5-$@kewp_range)+"-"+($@kewp_baseLv5+$@kewp_range)+" Rooms ("+($@kewp_cost5*@cost)+"z)", + "- Levels "+($@kewp_baseLv6-$@kewp_range)+"-"+($@kewp_baseLv6+$@kewp_range)+" Rooms ("+($@kewp_cost6*@cost)+"z)", + "- Levels "+($@kewp_baseLv7-$@kewp_range)+"-"+($@kewp_baseLv7+$@kewp_range)+" Rooms ("+($@kewp_cost7*@cost)+"z)" + ); + } + switch(@kmenu) { + case 2: //No restrictions + SF_pvpMenu 8,$@kewp_cost,100,0,0; + break; + case 3: + SF_pvpMenu 1,$@kewp_cost1,100,$@kewp_baseLv1-$@kewp_range,$@kewp_baseLv1+$@kewp_range; + break; + case 4: + SF_pvpMenu 2,$@kewp_cost2,100,$@kewp_baseLv2-$@kewp_range,$@kewp_baseLv2+$@kewp_range; + break; + case 5: + SF_pvpMenu 3,$@kewp_cost3,100,$@kewp_baseLv3-$@kewp_range,$@kewp_baseLv3+$@kewp_range; + break; + case 6: + SF_pvpMenu 4,$@kewp_cost4,100,$@kewp_baseLv4-$@kewp_range,$@kewp_baseLv4+$@kewp_range; + break; + case 7: + SF_pvpMenu 5,$@kewp_cost5,100,$@kewp_baseLv5-$@kewp_range,$@kewp_baseLv5+$@kewp_range; + break; + case 8: + SF_pvpMenu 6,$@kewp_cost6,100,$@kewp_baseLv6-$@kewp_range,$@kewp_baseLv6+$@kewp_range; + break; + case 9: + SF_pvpMenu 7,$@kewp_cost7,100,$@kewp_baseLv7-$@kewp_range,$@kewp_baseLv7+$@kewp_range; + break; + } + } while (@kmenu > 1); + return; + +//SubFunction: SF_pvpMenu (int map-group, int cost, int min level, int max level) +//Displays the list of the five available Pvp rooms to warp to. +//map-group is the first index of the pvp map names (in pvp_n_2-3.gat it would be 2) +function SF_pvpMenu { + if (getarg(4)) { + if (BaseLevel < getarg(3)) { + callfunc "F_keIntro", e_sry, "Sorry, you need at least level "+getarg(2)+" to enter these arenas."; + return; + } + if (BaseLevel > getarg(4)) { + callfunc "F_keIntro", e_bzz, "Sorry, people above level "+getarg(3)+" are not allowed within these arenas."; + return; + } + set @msg$,"levels "+getarg(3)+"-"+getarg(3); + } else + set @msg$,"all levels"; + if ($@kewp_showOnline) { + set @submenu, select( + "- Cancel Warp (Rooms for "+@msg$+"/"+(getarg(1)*@cost)+"z)", + "- Room Sandwich ("+getmapusers("pvp_n_"+getarg(0)+"-1.gat")+" "+$@ked_users$+")", + "- Room Rock On ("+getmapusers("pvp_n_"+getarg(0)+"-2.gat")+" "+$@ked_users$+")", + "- Four Room ("+getmapusers("pvp_n_"+getarg(0)+"-3.gat")+" "+$@ked_users$+")", + "- Room Undercross ("+getmapusers("pvp_n_"+getarg(0)+"-4.gat")+" "+$@ked_users$+")", + "- Room Compass ("+getmapusers("pvp_n_"+getarg(0)+"-5.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel Warp (Rooms for "+@msg$+"/"+(getarg(1)*@cost)+"z)", + "- Room Sandwich", + "- Room Rock On", + "- Four Room", + "- Room Undercross", + "- Room Compass" + ); + } + switch (@submenu) { + case 2: + callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-1.gat",-1,-1; + break; + case 3: + callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-2.gat",-1,-1; + break; + case 4: + callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-3.gat",-1,-1; + break; + case 5: + callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-4.gat",-1,-1; + break; + case 6: + callfunc "F_keWarp",getarg(1),getarg(2),e_com,"pvp_n_"+getarg(0)+"-5.gat",-1,-1; + break; + } +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_town.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_town.txt index 2cef196d8..d1596401a 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_town.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_town.txt @@ -1,500 +1,500 @@ -//===== eAthena Script =======================================
-//= Kafra Express - Warping Town Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 2.1
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+, RO Episode 8+ (Hugel)
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers warp services to towns.
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//= Flag values used for towns:
-//= 0x00000001 Alberta
-//= 0x00000002 AlDeBaran
-//= 0x00000004 Amatsu
-//= 0x00000008 Ayothaya
-//= 0x00000010 Comodo
-//= 0x00000020 Einbech
-//= 0x00000040 Einbroch
-//= 0x00000080 Geffen
-//= 0x00000100 Gon Ryun
-//= 0x00000200 Hugel
-//= 0x00000400 Izlude
-//= 0x00000800 Jawaii
-//= 0x00001000 LightHalzen
-//= 0x00002000 Lou Yang
-//= 0x00004000 Lutie
-//= 0x00008000 Morocc
-//= 0x00010000 Niflheim
-//= 0x00020000 Payon
-//= 0x00040000 Prontera
-//= 0x00080000 Umbala
-//= 0x00100000 Yuno
-//============================================================
-
-- script keInit_warpTown -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadWarpTown";
- end;
-}
-
-function script F_keWarpTown {
-
- function SF_check;
- function SF_warp;
-
- set @cost,callfunc("F_keCost",$@kewt_cost,$@kewt_discount);
- set @niflcost,callfunc("F_keCost",$@kewt_niflCost,$@kewd_discount);
- if (@cost > Zeny && $@kewt_free)
- set @cost, Zeny;
- do {
- if ($@kewt_showOnline) {
- set @kmenu, select(
- "- Cancel",
- "- Alberta ("+@cost+"z/"+(getmapusers("alberta.gat")+getmapusers("alberta_in.gat"))+" "+$@ked_users$+")",
- "- Al De Baran ("+@cost+"z/"+(getmapusers("aldebaran.gat")+getmapusers("aldeba_in.gat"))+" "+$@ked_users$+")",
- "- Amatsu ("+@cost+"z/"+(getmapusers("amatsu.gat")+getmapusers("ama_in01.gat")+getmapusers("ama_in02.gat"))
- +" "+$@ked_users$+")",
- "- Ayothaya ("+@cost+"z/"+(getmapusers("ayothaya.gat")+getmapusers("ayo_in01.gat")+getmapusers("ayo_in02.gat"))
- +" "+$@ked_users$+")",
- "- Comodo ("+@cost+"z/"+(getmapusers("comodo.gat")+getmapusers("cmd_in01.gat")+getmapusers("cmd_in02.gat"))
- +" "+$@ked_users$+")",
- "- Einbech ("+@cost+"z/"+(getmapusers("einbech.gat"))+" "+$@ked_users$+")",
- "- Einbroch ("+@cost+"z/"+(getmapusers("einbroch.gat")+getmapusers("ein_in01.gat"))+" "+$@ked_users$+")",
- "- Geffen ("+@cost+"z/"+(getmapusers("geffen.gat")+getmapusers("geffen_in.gat")+getmapusers("gef_tower.gat"))
- +" "+$@ked_users$+")",
- "- Gon Ryun ("+@cost+"z/"+(getmapusers("gonryun.gat")+getmapusers("gon_in.gat"))+" "+$@ked_users$+")",
- "- Hugel ("+@cost+"z/"+(getmapusers("hugel.gat")+getmapusers("hu_in01.gat"))+" "+$@ked_users$+")",
- "- Izlude ("+@cost+"z/"+(getmapusers("izlude.gat")+getmapusers("izlude_in.gat"))+" "+$@ked_users$+")",
- "- Jawaii ("+@cost+"z/"+(getmapusers("jawaii.gat")+getmapusers("jawaii_in.gat"))+" "+$@ked_users$+")",
- "- LightHalzen ("+@cost+"z/"+(getmapusers("lighthalzen.gat")+getmapusers("lhz_in01.gat")
- +getmapusers("lhz_in02.gat")+getmapusers("lhz_in03.gat"))+" "+$@ked_users$+")",
- "- Lou Yang ("+@cost+"z/"+(getmapusers("louyang.gat")+getmapusers("lou_in01.gat")+getmapusers("lou_in02.gat"))
- +" "+$@ked_users$+")",
- "- Lutie ("+@cost+"z/"+(getmapusers("xmas.gat")+getmapusers("xmas_in.gat"))+" "+$@ked_users$+")",
- "- Morocc ("+@cost+"z/"+(getmapusers("morocc.gat")+getmapusers("morocc_in.gat")+getmapusers("moc_castle.gat"))
- +" "+$@ked_users$+")",
- "- Niflheim ("+@niflcost+"z/"+(getmapusers("niflheim.gat")+getmapusers("nif_in.gat"))+" "+$@ked_users$+")",
- "- Payon ("+@cost+"z/"+(getmapusers("payon.gat")+getmapusers("payon_in01.gat")+getmapusers("payon_in02.gat"))
- +" "+$@ked_users$+")",
- "- Prontera ("+@cost+"z/"+(getmapusers("prontera.gat")+getmapusers("prt_castle.gat")
- +getmapusers("prt_church.gat")+getmapusers("prt_in.gat"))+" "+$@ked_users$+")",
- "- Umbala ("+@cost+"z/"+(getmapusers("umbala.gat")+getmapusers("um_in.gat"))+" "+$@ked_users$+")",
- "- Yuno ("+@cost+"z/"+(getmapusers("yuno.gat")+getmapusers("yuno_in01.gat")+getmapusers("yuno_in02.gat")
- +getmapusers("yuno_in03.gat")+getmapusers("yuno_in04.gat")+getmapusers("yuno_in05.gat"))+" "+$@ked_users$+")"
- );
- } else {
- set @kmenu, select(
- "- Cancel",
- "- Alberta ("+@cost+"z)",
- "- Al De Baran ("+@cost+"z)",
- "- Amatsu ("+@cost+"z)",
- "- Ayothaya ("+@cost+"z)",
- "- Comodo ("+@cost+"z)",
- "- Einbech ("+@cost+"z)",
- "- Einbroch ("+@cost+"z)",
- "- Geffen ("+@cost+"z)",
- "- Gon Ryun ("+@cost+"z)",
- "- Hugel ("+@cost+"z)",
- "- Izlude ("+@cost+"z)",
- "- Jawaii ("+@cost+"z)",
- "- LightHalzen ("+@cost+"z)",
- "- Lou Yang ("+@cost+"z)",
- "- Lutie ("+@cost+"z)",
- "- Morocc ("+@cost+"z)",
- "- Niflheim ("+@niflcost+"z)",
- "- Payon ("+@cost+"z)",
- "- Prontera ("+@cost+"z)",
- "- Umbala ("+@cost+"z)",
- "- Yuno ("+@cost+"z)"
- );
- }
- switch (@kmenu) {
- case 2: //Alberta
- if (SF_check(0x1))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"alberta.gat",117,56;
- break;
- case 3: //AlDeBaran
- if (SF_check(0x2))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"aldebaran.gat",139,124;
- break;
- case 4: //Amatsu
- if (SF_check(0x4))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"amatsu.gat",197,88;
- break;
- case 5: //Ayathoya
- if (SF_check(0x8))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"ayothaya.gat",202,174;
- break;
- case 6: //Comodo
- if (SF_check(0x10))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"comodo.gat",189,150;
- break;
- case 7: //Einbech
- if (SF_check(0x20))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"einbech.gat",137,220;
- break;
- case 8: //Einbroch
- if (SF_check(0x40))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"einbroch.gat",64,199;
- break;
- case 9: //Geffen
- if (SF_check(0x80))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"geffen.gat",120,66;
- break;
- case 10: //GonRyun
- if (SF_check(0x100))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"gonryun.gat",160,180;
- break;
- case 11: //Hugel
- if (SF_check(0x200))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"hugel.gat",96,105;
- break;
- case 12: //Izlude
- if (SF_check(0x400))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"izlude.gat",127,97;
- break;
- case 13: //Jawaii
- if (SF_check(0x800))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"jawaii.gat",214,223;
- break;
- case 14: //LightHalzen
- if (SF_check(0x1000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"lighthalzen.gat",158,92;
- break;
- case 15: //LouYang
- if (SF_check(0x2000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"louyang.gat",218,118;
- break;
- case 16: //Lutie
- if (SF_check(0x4000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"xmas.gat",148,133;
- break;
- case 17: //Morocc
- if (SF_check(0x8000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"morocc.gat",162,91;
- break;
- case 18: //Niflheim
- if (SF_check(0x10000)) {
- if (nif_q_done != 1) {
- mes "...?";
- callfunc "F_keIntro", e_no, "For some reason I can't warp you there!";
- } else
- callfunc "F_keWarp",$@kewt_niflCost,$@kewd_discount,e_yawn,"niflheim.gat",194,185;
- }
- break;
- case 19: //Payon
- if (SF_check(0x20000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"payon.gat",159,181;
- break;
- case 20: //Prontera
- if (SF_check(0x40000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"prontera.gat",156,175;
- break;
- case 21: //Umbala
- if (SF_check(0x80000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"umbala.gat",88,153;
- break;
- case 22: //Yuno
- if (SF_check(0x100000))
- SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"yuno.gat",158,77;
- break;
- }
- } while (@kmenu > 1);
- return;
-
-//SubFunction SF_check(char-flag, account_flag)
-//Checks if the character can warp to that town taking into consideration
-//traveller's mode.
-function SF_check {
- if ($@kewt_travel && !((kewt_travel|#kewt_travel)&getarg(0))) {
- callfunc "F_keIntro", e_sry, "Sorry, but we can only warp you to towns you have saved in at least once.";
- return 0;
- }
- return 1;
-}
-
-//SubFunction SF_warp (int cost, int discount, int emotion, String map, int x, int y)
-//Modded from F_keWarp to allow free warping to towns when not enough zeny.
-function SF_warp {
- set @cost, getarg(0);
- if (@cost > Zeny && $@kewt_free)
- set @cost, Zeny;
- if (!(callfunc("F_keCharge",@cost,getarg(1),1))) {
- callfunc "F_keIntro", e_an, "You don't have enough Zeny...";
- return;
- }
- emotion getarg(2);
- warp getarg(3),getarg(4),getarg(5);
- end;
-}
-
-}
-
-//Invoked when we want to add a map to the list of travelled-to towns
-function script F_keAddTravelTown {
- set @map$, getarg(0);
-// Temporary code to update variables from old format to new.
- if(ketw_alberta) {
- set kewt_travel,kewt_travel|0x1;
- set ketw_alberta,0;
- }
- if(ketw_aldebaran) {
- set kewt_travel,kewt_travel|0x2;
- set ketw_aldebaran,0;
- }
- if(ketw_amatsu) {
- set kewt_travel,kewt_travel|0x4;
- set ketw_amatsu,0;
- }
- if(ketw_ayothaya) {
- set kewt_travel,kewt_travel|0x8;
- set ketw_ayothaya,0;
- }
- if(ketw_comodo) {
- set kewt_travel,kewt_travel|0x10;
- set ketw_comodo,0;
- }
- if(ketw_einbech) {
- set kewt_travel,kewt_travel|0x20;
- set ketw_einbech,0;
- }
- if(ketw_einbroch) {
- set kewt_travel,kewt_travel|0x40;
- set ketw_einbroch,0;
- }
- if(ketw_geffen) {
- set kewt_travel,kewt_travel|0x80;
- set ketw_geffen,0;
- }
- if(ketw_gonryun) {
- set kewt_travel,kewt_travel|0x100;
- set ketw_gonryun,0;
- }
- if(ketw_hugel) {
- set kewt_travel,kewt_travel|0x200;
- set ketw_hugel,0;
- }
- if(ketw_izlude) {
- set kewt_travel,kewt_travel|0x400;
- set ketw_izlude,0;
- }
- if(ketw_jawaii) {
- set kewt_travel,kewt_travel|0x800;
- set ketw_jawaii,0;
- }
- if(ketw_lighthalzen) {
- set kewt_travel,kewt_travel|0x1000;
- set ketw_lighthalzen,0;
- }
- if(ketw_louyang) {
- set kewt_travel,kewt_travel|0x2000;
- set ketw_louyang,0;
- }
- if(ketw_lutie) {
- set kewt_travel,kewt_travel|0x4000;
- set ketw_lutie,0;
- }
- if(ketw_morroc) {
- set kewt_travel,kewt_travel|0x8000;
- set ketw_morroc,0;
- }
- if(ketw_niflheim) {
- set kewt_travel,kewt_travel|0x10000;
- set ketw_niflheim,0;
- }
- if(ketw_payon) {
- set kewt_travel,kewt_travel|0x20000;
- set ketw_payon,0;
- }
- if(ketw_prontera) {
- set kewt_travel,kewt_travel|0x40000;
- set ketw_prontera,0;
- }
- if(ketw_umbala) {
- set kewt_travel,kewt_travel|0x80000;
- set ketw_umbala,0;
- }
- if(ketw_yuno) {
- set kewt_travel,kewt_travel|0x100000;
- set ketw_yuno,0;
- }
-
- if(#ketw_alberta) {
- set #kewt_travel,#kewt_travel|0x1;
- set #ketw_alberta,0;
- }
- if(#ketw_aldebaran) {
- set #kewt_travel,#kewt_travel|0x2;
- set #ketw_aldebaran,0;
- }
- if(#ketw_amatsu) {
- set #kewt_travel,#kewt_travel|0x4;
- set #ketw_amatsu,0;
- }
- if(#ketw_ayothaya) {
- set #kewt_travel,#kewt_travel|0x8;
- set #ketw_ayothaya,0;
- }
- if(#ketw_comodo) {
- set #kewt_travel,#kewt_travel|0x10;
- set #ketw_comodo,0;
- }
- if(#ketw_einbech) {
- set #kewt_travel,#kewt_travel|0x20;
- set #ketw_einbech,0;
- }
- if(#ketw_einbroch) {
- set #kewt_travel,#kewt_travel|0x40;
- set #ketw_einbroch,0;
- }
- if(#ketw_geffen) {
- set #kewt_travel,#kewt_travel|0x80;
- set #ketw_geffen,0;
- }
- if(#ketw_gonryun) {
- set #kewt_travel,#kewt_travel|0x100;
- set #ketw_gonryun,0;
- }
- if(#ketw_hugel) {
- set #kewt_travel,#kewt_travel|0x200;
- set #ketw_hugel,0;
- }
- if(#ketw_izlude) {
- set #kewt_travel,#kewt_travel|0x400;
- set #ketw_izlude,0;
- }
- if(#ketw_jawaii) {
- set #kewt_travel,#kewt_travel|0x800;
- set #ketw_jawaii,0;
- }
- if(#ketw_lighthalzen) {
- set #kewt_travel,#kewt_travel|0x1000;
- set #ketw_lighthalzen,0;
- }
- if(#ketw_louyang) {
- set #kewt_travel,#kewt_travel|0x2000;
- set #ketw_louyang,0;
- }
- if(#ketw_lutie) {
- set #kewt_travel,#kewt_travel|0x4000;
- set #ketw_lutie,0;
- }
- if(#ketw_morroc) {
- set #kewt_travel,#kewt_travel|0x8000;
- set #ketw_morroc,0;
- }
- if(#ketw_niflheim) {
- set #kewt_travel,#kewt_travel|0x10000;
- set #ketw_niflheim,0;
- }
- if(#ketw_payon) {
- set #kewt_travel,#kewt_travel|0x20000;
- set #ketw_payon,0;
- }
- if(#ketw_prontera) {
- set #kewt_travel,#kewt_travel|0x40000;
- set #ketw_prontera,0;
- }
- if(#ketw_umbala) {
- set #kewt_travel,#kewt_travel|0x80000;
- set #ketw_umbala,0;
- }
- if(#ketw_yuno) {
- set #kewt_travel,#kewt_travel|0x100000;
- set #ketw_yuno,0;
- }
-// End update code.
-
- if ($@kewt_travel > 1) {
- if (@map$ == "alberta.gat" || kewt_travel&0x1)
- set #kewt_travel,#kewt_travel|0x1;
- if (@map$ == "aldebaran.gat" || kewt_travel&0x2)
- set #kewt_travel,#kewt_travel|0x2;
- if (@map$ == "amatsu.gat" || kewt_travel&0x4)
- set #kewt_travel,#kewt_travel|0x4;
- if (@map$ == "ayothaya.gat" || kewt_travel&0x8)
- set #kewt_travel,#kewt_travel|0x8;
- if (@map$ == "comodo.gat" || kewt_travel&0x10)
- set #kewt_travel,#kewt_travel|0x10;
- if (@map$ == "einbech.gat" || kewt_travel&0x20)
- set #kewt_travel,#kewt_travel|0x20;
- if (@map$ == "einbroch.gat" || kewt_travel&0x40)
- set #kewt_travel,#kewt_travel|0x40;
- if (@map$ == "geffen.gat" || kewt_travel&0x80)
- set #kewt_travel,#kewt_travel|0x80;
- if (@map$ == "gonryun.gat" || kewt_travel&0x100)
- set #kewt_travel,#kewt_travel|0x100;
- if (@map$ == "hugel.gat" || kewt_travel&0x200)
- set #kewt_travel,#kewt_travel|0x200;
- if (@map$ == "izlude.gat" || kewt_travel&0x400)
- set #kewt_travel,#kewt_travel|0x400;
- if (@map$ == "jawaii.gat" || kewt_travel&0x800)
- set #kewt_travel,#kewt_travel|0x800;
- if (@map$ == "lighthalzen.gat" || kewt_travel&1000)
- set #kewt_travel,#kewt_travel|0x1000;
- if (@map$ == "louyang.gat" || kewt_travel&0x2000)
- set #kewt_travel,#kewt_travel|0x2000;
- if (@map$ == "xmas.gat" || kewt_travel&0x4000)
- set #kewt_travel,#kewt_travel|0x4000;
- if (@map$ == "morocc.gat" || kewt_travel&0x8000)
- set #kewt_travel,#kewt_travel|0x8000;
- if (@map$ == "niflheim.gat" || kewt_travel&0x10000)
- set #kewt_travel,#kewt_travel|0x10000;
- if (@map$ == "payon.gat" || kewt_travel&0x20000)
- set #kewt_travel,#kewt_travel|0x20000;
- if (@map$ == "prontera.gat" || kewt_travel&0x40000)
- set #kewt_travel,#kewt_travel|0x40000;
- if (@map$ == "umbala.gat" || kewt_travel&0x80000)
- set #kewt_travel,#kewt_travel|0x80000;
- if (@map$ == "yuno.gat" || kewt_travel&0x100000)
- set #kewt_travel,#kewt_travel|0x100000;
- } else {
- if (@map$ == "alberta.gat")
- set kewt_travel,kewt_travel|0x1;
- if (@map$ == "aldebaran.gat")
- set kewt_travel,kewt_travel|0x2;
- if (@map$ == "amatsu.gat")
- set kewt_travel,kewt_travel|0x4;
- if (@map$ == "ayothaya.gat")
- set kewt_travel,kewt_travel|0x8;
- if (@map$ == "comodo.gat")
- set kewt_travel,kewt_travel|0x10;
- if (@map$ == "einbech.gat")
- set kewt_travel,kewt_travel|0x20;
- if (@map$ == "einbroch.gat")
- set kewt_travel,kewt_travel|0x40;
- if (@map$ == "geffen.gat")
- set kewt_travel,kewt_travel|0x80;
- if (@map$ == "gonryun.gat")
- set kewt_travel,kewt_travel|0x100;
- if (@map$ == "hugel.gat")
- set kewt_travel,kewt_travel|0x200;
- if (@map$ == "izlude.gat")
- set kewt_travel,kewt_travel|0x400;
- if (@map$ == "jawaii.gat")
- set kewt_travel,kewt_travel|0x800;
- if (@map$ == "lighthalzen.gat")
- set kewt_travel,kewt_travel|0x1000;
- if (@map$ == "louyang.gat")
- set kewt_travel,kewt_travel|0x2000;
- if (@map$ == "xmas.gat")
- set kewt_travel,kewt_travel|0x4000;
- if (@map$ == "morocc.gat")
- set kewt_travel,kewt_travel|0x8000;
- if (@map$ == "niflheim.gat")
- set kewt_travel,kewt_travel|0x10000;
- if (@map$ == "payon.gat")
- set kewt_travel,kewt_travel|0x20000;
- if (@map$ == "prontera.gat")
- set kewt_travel,kewt_travel|0x40000;
- if (@map$ == "umbala.gat")
- set kewt_travel,kewt_travel|0x80000;
- if (@map$ == "yuno.gat")
- set kewt_travel,kewt_travel|0x100000;
- }
- return;
-}
+//===== eAthena Script ======================================= +//= Kafra Express - Warping Town Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 2.1 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+, RO Episode 8+ (Hugel) +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers warp services to towns. +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//= Flag values used for towns: +//= 0x00000001 Alberta +//= 0x00000002 AlDeBaran +//= 0x00000004 Amatsu +//= 0x00000008 Ayothaya +//= 0x00000010 Comodo +//= 0x00000020 Einbech +//= 0x00000040 Einbroch +//= 0x00000080 Geffen +//= 0x00000100 Gon Ryun +//= 0x00000200 Hugel +//= 0x00000400 Izlude +//= 0x00000800 Jawaii +//= 0x00001000 LightHalzen +//= 0x00002000 Lou Yang +//= 0x00004000 Lutie +//= 0x00008000 Morocc +//= 0x00010000 Niflheim +//= 0x00020000 Payon +//= 0x00040000 Prontera +//= 0x00080000 Umbala +//= 0x00100000 Yuno +//============================================================ + +- script keInit_warpTown -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadWarpTown"; + end; +} + +function script F_keWarpTown { + + function SF_check; + function SF_warp; + + set @cost,callfunc("F_keCost",$@kewt_cost,$@kewt_discount); + set @niflcost,callfunc("F_keCost",$@kewt_niflCost,$@kewd_discount); + if (@cost > Zeny && $@kewt_free) + set @cost, Zeny; + do { + if ($@kewt_showOnline) { + set @kmenu, select( + "- Cancel", + "- Alberta ("+@cost+"z/"+(getmapusers("alberta.gat")+getmapusers("alberta_in.gat"))+" "+$@ked_users$+")", + "- Al De Baran ("+@cost+"z/"+(getmapusers("aldebaran.gat")+getmapusers("aldeba_in.gat"))+" "+$@ked_users$+")", + "- Amatsu ("+@cost+"z/"+(getmapusers("amatsu.gat")+getmapusers("ama_in01.gat")+getmapusers("ama_in02.gat")) + +" "+$@ked_users$+")", + "- Ayothaya ("+@cost+"z/"+(getmapusers("ayothaya.gat")+getmapusers("ayo_in01.gat")+getmapusers("ayo_in02.gat")) + +" "+$@ked_users$+")", + "- Comodo ("+@cost+"z/"+(getmapusers("comodo.gat")+getmapusers("cmd_in01.gat")+getmapusers("cmd_in02.gat")) + +" "+$@ked_users$+")", + "- Einbech ("+@cost+"z/"+(getmapusers("einbech.gat"))+" "+$@ked_users$+")", + "- Einbroch ("+@cost+"z/"+(getmapusers("einbroch.gat")+getmapusers("ein_in01.gat"))+" "+$@ked_users$+")", + "- Geffen ("+@cost+"z/"+(getmapusers("geffen.gat")+getmapusers("geffen_in.gat")+getmapusers("gef_tower.gat")) + +" "+$@ked_users$+")", + "- Gon Ryun ("+@cost+"z/"+(getmapusers("gonryun.gat")+getmapusers("gon_in.gat"))+" "+$@ked_users$+")", + "- Hugel ("+@cost+"z/"+(getmapusers("hugel.gat")+getmapusers("hu_in01.gat"))+" "+$@ked_users$+")", + "- Izlude ("+@cost+"z/"+(getmapusers("izlude.gat")+getmapusers("izlude_in.gat"))+" "+$@ked_users$+")", + "- Jawaii ("+@cost+"z/"+(getmapusers("jawaii.gat")+getmapusers("jawaii_in.gat"))+" "+$@ked_users$+")", + "- LightHalzen ("+@cost+"z/"+(getmapusers("lighthalzen.gat")+getmapusers("lhz_in01.gat") + +getmapusers("lhz_in02.gat")+getmapusers("lhz_in03.gat"))+" "+$@ked_users$+")", + "- Lou Yang ("+@cost+"z/"+(getmapusers("louyang.gat")+getmapusers("lou_in01.gat")+getmapusers("lou_in02.gat")) + +" "+$@ked_users$+")", + "- Lutie ("+@cost+"z/"+(getmapusers("xmas.gat")+getmapusers("xmas_in.gat"))+" "+$@ked_users$+")", + "- Morocc ("+@cost+"z/"+(getmapusers("morocc.gat")+getmapusers("morocc_in.gat")+getmapusers("moc_castle.gat")) + +" "+$@ked_users$+")", + "- Niflheim ("+@niflcost+"z/"+(getmapusers("niflheim.gat")+getmapusers("nif_in.gat"))+" "+$@ked_users$+")", + "- Payon ("+@cost+"z/"+(getmapusers("payon.gat")+getmapusers("payon_in01.gat")+getmapusers("payon_in02.gat")) + +" "+$@ked_users$+")", + "- Prontera ("+@cost+"z/"+(getmapusers("prontera.gat")+getmapusers("prt_castle.gat") + +getmapusers("prt_church.gat")+getmapusers("prt_in.gat"))+" "+$@ked_users$+")", + "- Umbala ("+@cost+"z/"+(getmapusers("umbala.gat")+getmapusers("um_in.gat"))+" "+$@ked_users$+")", + "- Yuno ("+@cost+"z/"+(getmapusers("yuno.gat")+getmapusers("yuno_in01.gat")+getmapusers("yuno_in02.gat") + +getmapusers("yuno_in03.gat")+getmapusers("yuno_in04.gat")+getmapusers("yuno_in05.gat"))+" "+$@ked_users$+")" + ); + } else { + set @kmenu, select( + "- Cancel", + "- Alberta ("+@cost+"z)", + "- Al De Baran ("+@cost+"z)", + "- Amatsu ("+@cost+"z)", + "- Ayothaya ("+@cost+"z)", + "- Comodo ("+@cost+"z)", + "- Einbech ("+@cost+"z)", + "- Einbroch ("+@cost+"z)", + "- Geffen ("+@cost+"z)", + "- Gon Ryun ("+@cost+"z)", + "- Hugel ("+@cost+"z)", + "- Izlude ("+@cost+"z)", + "- Jawaii ("+@cost+"z)", + "- LightHalzen ("+@cost+"z)", + "- Lou Yang ("+@cost+"z)", + "- Lutie ("+@cost+"z)", + "- Morocc ("+@cost+"z)", + "- Niflheim ("+@niflcost+"z)", + "- Payon ("+@cost+"z)", + "- Prontera ("+@cost+"z)", + "- Umbala ("+@cost+"z)", + "- Yuno ("+@cost+"z)" + ); + } + switch (@kmenu) { + case 2: //Alberta + if (SF_check(0x1)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"alberta.gat",117,56; + break; + case 3: //AlDeBaran + if (SF_check(0x2)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"aldebaran.gat",139,124; + break; + case 4: //Amatsu + if (SF_check(0x4)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"amatsu.gat",197,88; + break; + case 5: //Ayathoya + if (SF_check(0x8)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"ayothaya.gat",202,174; + break; + case 6: //Comodo + if (SF_check(0x10)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"comodo.gat",189,150; + break; + case 7: //Einbech + if (SF_check(0x20)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"einbech.gat",137,220; + break; + case 8: //Einbroch + if (SF_check(0x40)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"einbroch.gat",64,199; + break; + case 9: //Geffen + if (SF_check(0x80)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"geffen.gat",120,66; + break; + case 10: //GonRyun + if (SF_check(0x100)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"gonryun.gat",160,180; + break; + case 11: //Hugel + if (SF_check(0x200)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"hugel.gat",96,105; + break; + case 12: //Izlude + if (SF_check(0x400)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"izlude.gat",127,97; + break; + case 13: //Jawaii + if (SF_check(0x800)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"jawaii.gat",214,223; + break; + case 14: //LightHalzen + if (SF_check(0x1000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"lighthalzen.gat",158,92; + break; + case 15: //LouYang + if (SF_check(0x2000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"louyang.gat",218,118; + break; + case 16: //Lutie + if (SF_check(0x4000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"xmas.gat",148,133; + break; + case 17: //Morocc + if (SF_check(0x8000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"morocc.gat",162,91; + break; + case 18: //Niflheim + if (SF_check(0x10000)) { + if (nif_q_done != 1) { + mes "...?"; + callfunc "F_keIntro", e_no, "For some reason I can't warp you there!"; + } else + callfunc "F_keWarp",$@kewt_niflCost,$@kewd_discount,e_yawn,"niflheim.gat",194,185; + } + break; + case 19: //Payon + if (SF_check(0x20000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"payon.gat",159,181; + break; + case 20: //Prontera + if (SF_check(0x40000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"prontera.gat",156,175; + break; + case 21: //Umbala + if (SF_check(0x80000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"umbala.gat",88,153; + break; + case 22: //Yuno + if (SF_check(0x100000)) + SF_warp $@kewt_cost,$@kewt_discount,e_yawn,"yuno.gat",158,77; + break; + } + } while (@kmenu > 1); + return; + +//SubFunction SF_check(char-flag, account_flag) +//Checks if the character can warp to that town taking into consideration +//traveller's mode. +function SF_check { + if ($@kewt_travel && !((kewt_travel|#kewt_travel)&getarg(0))) { + callfunc "F_keIntro", e_sry, "Sorry, but we can only warp you to towns you have saved in at least once."; + return 0; + } + return 1; +} + +//SubFunction SF_warp (int cost, int discount, int emotion, String map, int x, int y) +//Modded from F_keWarp to allow free warping to towns when not enough zeny. +function SF_warp { + set @cost, getarg(0); + if (@cost > Zeny && $@kewt_free) + set @cost, Zeny; + if (!(callfunc("F_keCharge",@cost,getarg(1),1))) { + callfunc "F_keIntro", e_an, "You don't have enough Zeny..."; + return; + } + emotion getarg(2); + warp getarg(3),getarg(4),getarg(5); + end; +} + +} + +//Invoked when we want to add a map to the list of travelled-to towns +function script F_keAddTravelTown { + set @map$, getarg(0); +// Temporary code to update variables from old format to new. + if(ketw_alberta) { + set kewt_travel,kewt_travel|0x1; + set ketw_alberta,0; + } + if(ketw_aldebaran) { + set kewt_travel,kewt_travel|0x2; + set ketw_aldebaran,0; + } + if(ketw_amatsu) { + set kewt_travel,kewt_travel|0x4; + set ketw_amatsu,0; + } + if(ketw_ayothaya) { + set kewt_travel,kewt_travel|0x8; + set ketw_ayothaya,0; + } + if(ketw_comodo) { + set kewt_travel,kewt_travel|0x10; + set ketw_comodo,0; + } + if(ketw_einbech) { + set kewt_travel,kewt_travel|0x20; + set ketw_einbech,0; + } + if(ketw_einbroch) { + set kewt_travel,kewt_travel|0x40; + set ketw_einbroch,0; + } + if(ketw_geffen) { + set kewt_travel,kewt_travel|0x80; + set ketw_geffen,0; + } + if(ketw_gonryun) { + set kewt_travel,kewt_travel|0x100; + set ketw_gonryun,0; + } + if(ketw_hugel) { + set kewt_travel,kewt_travel|0x200; + set ketw_hugel,0; + } + if(ketw_izlude) { + set kewt_travel,kewt_travel|0x400; + set ketw_izlude,0; + } + if(ketw_jawaii) { + set kewt_travel,kewt_travel|0x800; + set ketw_jawaii,0; + } + if(ketw_lighthalzen) { + set kewt_travel,kewt_travel|0x1000; + set ketw_lighthalzen,0; + } + if(ketw_louyang) { + set kewt_travel,kewt_travel|0x2000; + set ketw_louyang,0; + } + if(ketw_lutie) { + set kewt_travel,kewt_travel|0x4000; + set ketw_lutie,0; + } + if(ketw_morroc) { + set kewt_travel,kewt_travel|0x8000; + set ketw_morroc,0; + } + if(ketw_niflheim) { + set kewt_travel,kewt_travel|0x10000; + set ketw_niflheim,0; + } + if(ketw_payon) { + set kewt_travel,kewt_travel|0x20000; + set ketw_payon,0; + } + if(ketw_prontera) { + set kewt_travel,kewt_travel|0x40000; + set ketw_prontera,0; + } + if(ketw_umbala) { + set kewt_travel,kewt_travel|0x80000; + set ketw_umbala,0; + } + if(ketw_yuno) { + set kewt_travel,kewt_travel|0x100000; + set ketw_yuno,0; + } + + if(#ketw_alberta) { + set #kewt_travel,#kewt_travel|0x1; + set #ketw_alberta,0; + } + if(#ketw_aldebaran) { + set #kewt_travel,#kewt_travel|0x2; + set #ketw_aldebaran,0; + } + if(#ketw_amatsu) { + set #kewt_travel,#kewt_travel|0x4; + set #ketw_amatsu,0; + } + if(#ketw_ayothaya) { + set #kewt_travel,#kewt_travel|0x8; + set #ketw_ayothaya,0; + } + if(#ketw_comodo) { + set #kewt_travel,#kewt_travel|0x10; + set #ketw_comodo,0; + } + if(#ketw_einbech) { + set #kewt_travel,#kewt_travel|0x20; + set #ketw_einbech,0; + } + if(#ketw_einbroch) { + set #kewt_travel,#kewt_travel|0x40; + set #ketw_einbroch,0; + } + if(#ketw_geffen) { + set #kewt_travel,#kewt_travel|0x80; + set #ketw_geffen,0; + } + if(#ketw_gonryun) { + set #kewt_travel,#kewt_travel|0x100; + set #ketw_gonryun,0; + } + if(#ketw_hugel) { + set #kewt_travel,#kewt_travel|0x200; + set #ketw_hugel,0; + } + if(#ketw_izlude) { + set #kewt_travel,#kewt_travel|0x400; + set #ketw_izlude,0; + } + if(#ketw_jawaii) { + set #kewt_travel,#kewt_travel|0x800; + set #ketw_jawaii,0; + } + if(#ketw_lighthalzen) { + set #kewt_travel,#kewt_travel|0x1000; + set #ketw_lighthalzen,0; + } + if(#ketw_louyang) { + set #kewt_travel,#kewt_travel|0x2000; + set #ketw_louyang,0; + } + if(#ketw_lutie) { + set #kewt_travel,#kewt_travel|0x4000; + set #ketw_lutie,0; + } + if(#ketw_morroc) { + set #kewt_travel,#kewt_travel|0x8000; + set #ketw_morroc,0; + } + if(#ketw_niflheim) { + set #kewt_travel,#kewt_travel|0x10000; + set #ketw_niflheim,0; + } + if(#ketw_payon) { + set #kewt_travel,#kewt_travel|0x20000; + set #ketw_payon,0; + } + if(#ketw_prontera) { + set #kewt_travel,#kewt_travel|0x40000; + set #ketw_prontera,0; + } + if(#ketw_umbala) { + set #kewt_travel,#kewt_travel|0x80000; + set #ketw_umbala,0; + } + if(#ketw_yuno) { + set #kewt_travel,#kewt_travel|0x100000; + set #ketw_yuno,0; + } +// End update code. + + if ($@kewt_travel > 1) { + if (@map$ == "alberta.gat" || kewt_travel&0x1) + set #kewt_travel,#kewt_travel|0x1; + if (@map$ == "aldebaran.gat" || kewt_travel&0x2) + set #kewt_travel,#kewt_travel|0x2; + if (@map$ == "amatsu.gat" || kewt_travel&0x4) + set #kewt_travel,#kewt_travel|0x4; + if (@map$ == "ayothaya.gat" || kewt_travel&0x8) + set #kewt_travel,#kewt_travel|0x8; + if (@map$ == "comodo.gat" || kewt_travel&0x10) + set #kewt_travel,#kewt_travel|0x10; + if (@map$ == "einbech.gat" || kewt_travel&0x20) + set #kewt_travel,#kewt_travel|0x20; + if (@map$ == "einbroch.gat" || kewt_travel&0x40) + set #kewt_travel,#kewt_travel|0x40; + if (@map$ == "geffen.gat" || kewt_travel&0x80) + set #kewt_travel,#kewt_travel|0x80; + if (@map$ == "gonryun.gat" || kewt_travel&0x100) + set #kewt_travel,#kewt_travel|0x100; + if (@map$ == "hugel.gat" || kewt_travel&0x200) + set #kewt_travel,#kewt_travel|0x200; + if (@map$ == "izlude.gat" || kewt_travel&0x400) + set #kewt_travel,#kewt_travel|0x400; + if (@map$ == "jawaii.gat" || kewt_travel&0x800) + set #kewt_travel,#kewt_travel|0x800; + if (@map$ == "lighthalzen.gat" || kewt_travel&1000) + set #kewt_travel,#kewt_travel|0x1000; + if (@map$ == "louyang.gat" || kewt_travel&0x2000) + set #kewt_travel,#kewt_travel|0x2000; + if (@map$ == "xmas.gat" || kewt_travel&0x4000) + set #kewt_travel,#kewt_travel|0x4000; + if (@map$ == "morocc.gat" || kewt_travel&0x8000) + set #kewt_travel,#kewt_travel|0x8000; + if (@map$ == "niflheim.gat" || kewt_travel&0x10000) + set #kewt_travel,#kewt_travel|0x10000; + if (@map$ == "payon.gat" || kewt_travel&0x20000) + set #kewt_travel,#kewt_travel|0x20000; + if (@map$ == "prontera.gat" || kewt_travel&0x40000) + set #kewt_travel,#kewt_travel|0x40000; + if (@map$ == "umbala.gat" || kewt_travel&0x80000) + set #kewt_travel,#kewt_travel|0x80000; + if (@map$ == "yuno.gat" || kewt_travel&0x100000) + set #kewt_travel,#kewt_travel|0x100000; + } else { + if (@map$ == "alberta.gat") + set kewt_travel,kewt_travel|0x1; + if (@map$ == "aldebaran.gat") + set kewt_travel,kewt_travel|0x2; + if (@map$ == "amatsu.gat") + set kewt_travel,kewt_travel|0x4; + if (@map$ == "ayothaya.gat") + set kewt_travel,kewt_travel|0x8; + if (@map$ == "comodo.gat") + set kewt_travel,kewt_travel|0x10; + if (@map$ == "einbech.gat") + set kewt_travel,kewt_travel|0x20; + if (@map$ == "einbroch.gat") + set kewt_travel,kewt_travel|0x40; + if (@map$ == "geffen.gat") + set kewt_travel,kewt_travel|0x80; + if (@map$ == "gonryun.gat") + set kewt_travel,kewt_travel|0x100; + if (@map$ == "hugel.gat") + set kewt_travel,kewt_travel|0x200; + if (@map$ == "izlude.gat") + set kewt_travel,kewt_travel|0x400; + if (@map$ == "jawaii.gat") + set kewt_travel,kewt_travel|0x800; + if (@map$ == "lighthalzen.gat") + set kewt_travel,kewt_travel|0x1000; + if (@map$ == "louyang.gat") + set kewt_travel,kewt_travel|0x2000; + if (@map$ == "xmas.gat") + set kewt_travel,kewt_travel|0x4000; + if (@map$ == "morocc.gat") + set kewt_travel,kewt_travel|0x8000; + if (@map$ == "niflheim.gat") + set kewt_travel,kewt_travel|0x10000; + if (@map$ == "payon.gat") + set kewt_travel,kewt_travel|0x20000; + if (@map$ == "prontera.gat") + set kewt_travel,kewt_travel|0x40000; + if (@map$ == "umbala.gat") + set kewt_travel,kewt_travel|0x80000; + if (@map$ == "yuno.gat") + set kewt_travel,kewt_travel|0x100000; + } + return; +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt index 89f536de3..2adce07a0 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt @@ -1,159 +1,159 @@ -//===== eAthena Script =======================================
-//= Kafra Express - WoE Warping Module
-//===== By: ==================================================
-//= Skotlex
-//===== Current Version: =====================================
-//= 1.7
-//===== Compatible With: =====================================
-//= eAthena SVN R3424+, RO Episode 4.1+ (War of Emperium)
-//===== Description: =========================================
-//= Part of the Kafra Express Script Package.
-//= Offers warping to the War of Emperium grounds.
-//===== Additional Comments: =================================
-//= See config.txt for configuration.
-//= Remove the comment on lines 52,53 and 63 to enable direct G. Dungeon warping
-//============================================================
-
-- script keInit_warpWoe -1,{
-OnInit: //Load Config
- donpcevent "keConfig::OnLoadWarpWoe";
- end;
-}
-
-function script F_keWarpWOE {
- if ($@kewg_check && getcharid(2) <= 0) {
- callfunc "F_keIntro", e_srt, "Sorry, these warps are only available to people who belong to a Guild.";
- return;
- }
- if ($@kewg_checkAgit && agitcheck(0) == 0) {
- callfunc "F_keIntro", e_srt, "Sorry, these warps are only enabled during the Guild Wars.";
- return;
- }
-
- function SF_dungeons;
- set @cost, callfunc("F_keCost",100,$@kewg_discount);
-
- do {
- if ($@kewg_showOnline) {
- set @kmenu, select(
- "- Cancel",
- "- Al De Baran Guild ("+($@kewg_alDeBaran*@cost/100)+"z/"+(getmapusers("alde_gld.gat")
- +getmapusers("aldeg_cas01.gat")+getmapusers("aldeg_cas02.gat")+getmapusers("aldeg_cas03.gat")
- +getmapusers("aldeg_cas04.gat")+getmapusers("aldeg_cas05.gat"))+" "+$@ked_users$+")",
- "- Geffen Guild ("+($@kewg_geffen*@cost/100)+"z/"+(getmapusers("gef_fild13.gat")
- +getmapusers("gefg_cas01.gat")+getmapusers("gefg_cas02.gat")+getmapusers("gefg_cas03.gat")
- +getmapusers("gefg_cas04.gat")+getmapusers("gefg_cas05.gat"))+" "+$@ked_users$+")",
- "- Payon Guild ("+($@kewg_payon*@cost/100)+"z/"+(getmapusers("pay_gld.gat")
- +getmapusers("payg_cas01.gat")+getmapusers("payg_cas02.gat")+getmapusers("payg_cas03.gat")
- +getmapusers("payg_cas04.gat")+getmapusers("payg_cas05.gat"))+" "+$@ked_users$+")",
- "- Prontera Guild ("+($@kewg_prontera*@cost/100)+"z/"+(getmapusers("prt_gld.gat")
- +getmapusers("prtg_cas01.gat")+getmapusers("prtg_cas02.gat")+getmapusers("prtg_cas03.gat")
- +getmapusers("prtg_cas04.gat")+getmapusers("prtg_cas05.gat"))+" "+$@ked_users$+")",
-// "- Guild Dungeons ("+(getmapusers("gld_dun01.gat")+getmapusers("gld_dun02.gat")
-// +getmapusers("gld_dun03.gat")+getmapusers("gld_dun04.gat"))+" "+$@ked_users$+")",
- "- See "+$@ked_users$+" distribution"
- );
- } else {
- set @kmenu, select(
- "- Cancel",
- "- Al De Baran Guild ("+($@kewg_alDeBaran*@cost/100)+"z)",
- "- Geffen Guild ("+($@kewg_geffen*@cost/100)+"z)",
- "- Payon Guild ("+($@kewg_payon*@cost/100)+"z)",
- "- Prontera Guild ("+($@kewg_prontera*@cost/100)+"z)"
-// ,"- Guild Dungeons"
- );
- }
- switch (@kmenu) {
- case 2: //Al De Baran
- callfunc "F_keWarp",$@kewg_alDeBaran,$@kewg_discount,44,"alde_gld.gat",153,160;
- break;
- case 3: //Geffen
- callfunc "F_keWarp",$@kewg_geffen,$@kewg_discount,44,"gef_fild13.gat",243,180;
- break;
- case 4: //Payon
- callfunc "F_keWarp",$@kewg_payon,$@kewg_discount,44,"pay_gld.gat",249,177;
- break;
- case 5: //Prontera
- callfunc "F_keWarp",$@kewg_prontera,$@kewg_discount,44,"prt_gld.gat",119,160;
- break;
- case 6: //Guild Dungeons
- SF_dungeons();
- break;
- case 7: //Info
- mes "The current distribution of "+$@ked_users$+" is as follows:";
- next;
- mes "[Al De Baran]";
- mes "- Guild Grounds: "+getmapusers("alde_gld.gat");
- mes "- Castle 1 - Noisyubantian: "+getmapusers("aldeg_cas01.gat");
- mes "- Castle 2 - Hohensyubangawoo: "+getmapusers("aldeg_cas02.gat");
- mes "- Castle 3 - Nyirenverk: "+getmapusers("aldeg_cas03.gat");
- mes "- Castle 4 - Byirtsburi: "+getmapusers("aldeg_cas04.gat");
- mes "- Castle 5 - Rotenburk: "+getmapusers("aldeg_cas05.gat");
- next;
- mes "[Geffen]";
- mes "- Guild Grounds: "+getmapusers("gef_fild13.gat");
- mes "- Castle 1 - Reprion: "+getmapusers("gefg_cas01.gat");
- mes "- Castle 2 - Yolbriger: "+getmapusers("gefg_cas02.gat");
- mes "- Castle 3 - Isinlife: "+getmapusers("gefg_cas03.gat");
- mes "- Castle 4 - Berigel: "+getmapusers("gefg_cas04.gat");
- mes "- Castle 5 - Melsedetsu: "+getmapusers("gefg_cas05.gat");
- next;
- mes "[Payon]";
- mes "- Guild Grounds: "+getmapusers("pay_gld.gat");
- mes "- Castle 1 - Mingting: "+getmapusers("payg_cas01.gat");
- mes "- Castle 2 - Tiantan: "+getmapusers("payg_cas02.gat");
- mes "- Castle 3 - Fuying: "+getmapusers("payg_cas03.gat");
- mes "- Castle 4 - Honglou: "+getmapusers("payg_cas04.gat");
- mes "- Castle 5 - Zhulinxian: "+getmapusers("payg_cas05.gat");
- next;
- mes "[Prontera]";
- mes "- Guild Grounds: "+getmapusers("prt_gld.gat");
- mes "- Castle 1 - Creamhilt: "+getmapusers("prtg_cas01.gat");
- mes "- Castle 2 - Sbanhealt: "+getmapusers("prtg_cas02.gat");
- mes "- Castle 3 - Lazrigees: "+getmapusers("prtg_cas03.gat");
- mes "- Castle 4 - Squagul: "+getmapusers("prtg_cas04.gat");
- mes "- Castle 5 - Guindull: "+getmapusers("prtg_cas05.gat");
- next;
- callfunc "F_keIntro", -1, "";
- break;
- }
- } while (@kmenu > 1);
- return;
-
-function SF_dungeons {
- do {
- if ($@kewg_showOnline) {
- set @submenu, select(
- "- Cancel",
- "- Baldur Dungeon ("+($@kewg_baldur*@cost/100)+"z/"+getmapusers("gld_dun01.gat")+" "+$@ked_users$+")",
- "- Luina Dungeon ("+($@kewg_luina*@cost/100)+"z/"+getmapusers("gld_dun02.gat")+" "+$@ked_users$+")",
- "- Valkyrie Dungeon ("+($@kewg_valkyrie*@cost/100)+"z/"+getmapusers("gld_dun03.gat")+" "+$@ked_users$+")",
- "- Britoniah Dungeon ("+($@kewg_britoniah*@cost/100)+"z/"+getmapusers("gld_dun04.gat")+" "+$@ked_users$+")"
- );
- } else {
- set @submenu, select(
- "- Cancel",
- "- Baldur Dungeon ("+($@kewg_baldur*@cost/100)+"z)",
- "- Luina Dungeon ("+($@kewg_luina*@cost/100)+"z)",
- "- Valkyrie Dungeon ("+($@kewg_valkyrie*@cost/100)+"z)",
- "- Britoniah Dungeon ("+($@kewg_britoniah*@cost/100)+"z)"
- );
- }
- switch (@submenu) {
- case 2: //Baldur
- callfunc "F_keWarp",$@kewg_baldur,$@kewg_discount,44,"gld_dun01.gat",119,18;
- break;
- case 3: //Luina
- callfunc "F_keWarp",$@kewg_luina,$@kewg_discount,44,"gld_dun02.gat",174,113;
- break;
- case 4: //Valkyrie
- callfunc "F_keWarp",$@kewg_valkyrie,$@kewg_discount,44,"gld_dun03.gat",37,34;
- break;
- case 5: //Britoniah
- callfunc "F_keWarp",$@kewg_britoniah,$@kewg_discount,44,"gld_dun04.gat",42,230;
- break;
- }
- } while (@submenu > 1);
-}
-
-}
+//===== eAthena Script ======================================= +//= Kafra Express - WoE Warping Module +//===== By: ================================================== +//= Skotlex +//===== Current Version: ===================================== +//= 1.7 +//===== Compatible With: ===================================== +//= eAthena SVN R3424+, RO Episode 4.1+ (War of Emperium) +//===== Description: ========================================= +//= Part of the Kafra Express Script Package. +//= Offers warping to the War of Emperium grounds. +//===== Additional Comments: ================================= +//= See config.txt for configuration. +//= Remove the comment on lines 52,53 and 63 to enable direct G. Dungeon warping +//============================================================ + +- script keInit_warpWoe -1,{ +OnInit: //Load Config + donpcevent "keConfig::OnLoadWarpWoe"; + end; +} + +function script F_keWarpWOE { + if ($@kewg_check && getcharid(2) <= 0) { + callfunc "F_keIntro", e_srt, "Sorry, these warps are only available to people who belong to a Guild."; + return; + } + if ($@kewg_checkAgit && agitcheck(0) == 0) { + callfunc "F_keIntro", e_srt, "Sorry, these warps are only enabled during the Guild Wars."; + return; + } + + function SF_dungeons; + set @cost, callfunc("F_keCost",100,$@kewg_discount); + + do { + if ($@kewg_showOnline) { + set @kmenu, select( + "- Cancel", + "- Al De Baran Guild ("+($@kewg_alDeBaran*@cost/100)+"z/"+(getmapusers("alde_gld.gat") + +getmapusers("aldeg_cas01.gat")+getmapusers("aldeg_cas02.gat")+getmapusers("aldeg_cas03.gat") + +getmapusers("aldeg_cas04.gat")+getmapusers("aldeg_cas05.gat"))+" "+$@ked_users$+")", + "- Geffen Guild ("+($@kewg_geffen*@cost/100)+"z/"+(getmapusers("gef_fild13.gat") + +getmapusers("gefg_cas01.gat")+getmapusers("gefg_cas02.gat")+getmapusers("gefg_cas03.gat") + +getmapusers("gefg_cas04.gat")+getmapusers("gefg_cas05.gat"))+" "+$@ked_users$+")", + "- Payon Guild ("+($@kewg_payon*@cost/100)+"z/"+(getmapusers("pay_gld.gat") + +getmapusers("payg_cas01.gat")+getmapusers("payg_cas02.gat")+getmapusers("payg_cas03.gat") + +getmapusers("payg_cas04.gat")+getmapusers("payg_cas05.gat"))+" "+$@ked_users$+")", + "- Prontera Guild ("+($@kewg_prontera*@cost/100)+"z/"+(getmapusers("prt_gld.gat") + +getmapusers("prtg_cas01.gat")+getmapusers("prtg_cas02.gat")+getmapusers("prtg_cas03.gat") + +getmapusers("prtg_cas04.gat")+getmapusers("prtg_cas05.gat"))+" "+$@ked_users$+")", +// "- Guild Dungeons ("+(getmapusers("gld_dun01.gat")+getmapusers("gld_dun02.gat") +// +getmapusers("gld_dun03.gat")+getmapusers("gld_dun04.gat"))+" "+$@ked_users$+")", + "- See "+$@ked_users$+" distribution" + ); + } else { + set @kmenu, select( + "- Cancel", + "- Al De Baran Guild ("+($@kewg_alDeBaran*@cost/100)+"z)", + "- Geffen Guild ("+($@kewg_geffen*@cost/100)+"z)", + "- Payon Guild ("+($@kewg_payon*@cost/100)+"z)", + "- Prontera Guild ("+($@kewg_prontera*@cost/100)+"z)" +// ,"- Guild Dungeons" + ); + } + switch (@kmenu) { + case 2: //Al De Baran + callfunc "F_keWarp",$@kewg_alDeBaran,$@kewg_discount,44,"alde_gld.gat",153,160; + break; + case 3: //Geffen + callfunc "F_keWarp",$@kewg_geffen,$@kewg_discount,44,"gef_fild13.gat",243,180; + break; + case 4: //Payon + callfunc "F_keWarp",$@kewg_payon,$@kewg_discount,44,"pay_gld.gat",249,177; + break; + case 5: //Prontera + callfunc "F_keWarp",$@kewg_prontera,$@kewg_discount,44,"prt_gld.gat",119,160; + break; + case 6: //Guild Dungeons + SF_dungeons(); + break; + case 7: //Info + mes "The current distribution of "+$@ked_users$+" is as follows:"; + next; + mes "[Al De Baran]"; + mes "- Guild Grounds: "+getmapusers("alde_gld.gat"); + mes "- Castle 1 - Noisyubantian: "+getmapusers("aldeg_cas01.gat"); + mes "- Castle 2 - Hohensyubangawoo: "+getmapusers("aldeg_cas02.gat"); + mes "- Castle 3 - Nyirenverk: "+getmapusers("aldeg_cas03.gat"); + mes "- Castle 4 - Byirtsburi: "+getmapusers("aldeg_cas04.gat"); + mes "- Castle 5 - Rotenburk: "+getmapusers("aldeg_cas05.gat"); + next; + mes "[Geffen]"; + mes "- Guild Grounds: "+getmapusers("gef_fild13.gat"); + mes "- Castle 1 - Reprion: "+getmapusers("gefg_cas01.gat"); + mes "- Castle 2 - Yolbriger: "+getmapusers("gefg_cas02.gat"); + mes "- Castle 3 - Isinlife: "+getmapusers("gefg_cas03.gat"); + mes "- Castle 4 - Berigel: "+getmapusers("gefg_cas04.gat"); + mes "- Castle 5 - Melsedetsu: "+getmapusers("gefg_cas05.gat"); + next; + mes "[Payon]"; + mes "- Guild Grounds: "+getmapusers("pay_gld.gat"); + mes "- Castle 1 - Mingting: "+getmapusers("payg_cas01.gat"); + mes "- Castle 2 - Tiantan: "+getmapusers("payg_cas02.gat"); + mes "- Castle 3 - Fuying: "+getmapusers("payg_cas03.gat"); + mes "- Castle 4 - Honglou: "+getmapusers("payg_cas04.gat"); + mes "- Castle 5 - Zhulinxian: "+getmapusers("payg_cas05.gat"); + next; + mes "[Prontera]"; + mes "- Guild Grounds: "+getmapusers("prt_gld.gat"); + mes "- Castle 1 - Creamhilt: "+getmapusers("prtg_cas01.gat"); + mes "- Castle 2 - Sbanhealt: "+getmapusers("prtg_cas02.gat"); + mes "- Castle 3 - Lazrigees: "+getmapusers("prtg_cas03.gat"); + mes "- Castle 4 - Squagul: "+getmapusers("prtg_cas04.gat"); + mes "- Castle 5 - Guindull: "+getmapusers("prtg_cas05.gat"); + next; + callfunc "F_keIntro", -1, ""; + break; + } + } while (@kmenu > 1); + return; + +function SF_dungeons { + do { + if ($@kewg_showOnline) { + set @submenu, select( + "- Cancel", + "- Baldur Dungeon ("+($@kewg_baldur*@cost/100)+"z/"+getmapusers("gld_dun01.gat")+" "+$@ked_users$+")", + "- Luina Dungeon ("+($@kewg_luina*@cost/100)+"z/"+getmapusers("gld_dun02.gat")+" "+$@ked_users$+")", + "- Valkyrie Dungeon ("+($@kewg_valkyrie*@cost/100)+"z/"+getmapusers("gld_dun03.gat")+" "+$@ked_users$+")", + "- Britoniah Dungeon ("+($@kewg_britoniah*@cost/100)+"z/"+getmapusers("gld_dun04.gat")+" "+$@ked_users$+")" + ); + } else { + set @submenu, select( + "- Cancel", + "- Baldur Dungeon ("+($@kewg_baldur*@cost/100)+"z)", + "- Luina Dungeon ("+($@kewg_luina*@cost/100)+"z)", + "- Valkyrie Dungeon ("+($@kewg_valkyrie*@cost/100)+"z)", + "- Britoniah Dungeon ("+($@kewg_britoniah*@cost/100)+"z)" + ); + } + switch (@submenu) { + case 2: //Baldur + callfunc "F_keWarp",$@kewg_baldur,$@kewg_discount,44,"gld_dun01.gat",119,18; + break; + case 3: //Luina + callfunc "F_keWarp",$@kewg_luina,$@kewg_discount,44,"gld_dun02.gat",174,113; + break; + case 4: //Valkyrie + callfunc "F_keWarp",$@kewg_valkyrie,$@kewg_discount,44,"gld_dun03.gat",37,34; + break; + case 5: //Britoniah + callfunc "F_keWarp",$@kewg_britoniah,$@kewg_discount,44,"gld_dun04.gat",42,230; + break; + } + } while (@submenu > 1); +} + +} diff --git a/npc/custom/eAAC_Scripts/kafraExpress/readme.txt b/npc/custom/eAAC_Scripts/kafraExpress/readme.txt index 8952d1913..d37b025e9 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/readme.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/readme.txt @@ -1,1170 +1,1170 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Kafra Express Script Package Documentation %
-% - by Skotlex %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-This file's purpose is to give an indepth explanation about setting up, and
-configuring the Kafra Express Script Package (KESP). It is intended to be
-viewed by a text editor using fixed-width font and 80-character long lines.
-
-Document Version v1.9 (15/June/2006)
-////////////////////////////////////////////////////////////////////////////////
-Table of Contents
-////////////////////////////////////////////////////////////////////////////////
-[00] Including the NPC files and menu editing
-[01] Intro to module configuring and general options (config.txt)
-[02] Module: Main Core (ke_main.txt)
-[03] Module: Bank (ke_bank.txt)
-[04] Module: Broadcast (ke_broadcast.txt)
-[05] Module: Stylist (ke_dye.txt)
-[06] Module: Job Changer (ke_jobchange.txt)
-[07] Module: Job Swapper (ke_jobswap.txt)
-[08] Module: Smithery (ke_refine.txt)
-[09] Module: Renting (ke_refine.txt)
-[10] Module: Kafra Shop (ke_shop.txt)
-[11] Module: Stat/Skill Market (ke_statmarket.txt)
-[12] Module: Stat/Skill Resets/Raising (ke_stats.txt)
-[13] Module: Uncarding (ke_uncard.txt)
-[14] Module: Town Warping (ke_warp_town.txt)
-[15] Module: Dungeon Warping (ke_warp_dungeon.txt)
-[16] Module: PvP Warping (ke_warp_pvp.txt)
-[17] Module: WoE Warping (ke_warp_woe.txt)
-[18] The kafras.txt file: About Kafra Definitions
-
-////////////////////////////////////////////////////////////////////////////////
-[00] Including the NPC files and menu editing
-////////////////////////////////////////////////////////////////////////////////
-
-Because of the script's complexity, placing everything in a single file
-is out of the question, therefore the KESP comes bundled in different
-files. Because of the dynamic nature of the script, there are two things
-you need to do in order to enable/disable a particular service:
-
-1. Include the txt file with the corresponding module.
-To include the txt files, you need to know two things: where are the script
-files located, and which is the configuration file where you place the npc
-includes. We'll assume on this guide that you unpacked the KESP in
-npc/custom/kafraExpress. The configuration file for scripts is
-conf/map_athena.conf for eA1.0rc5, and npcs/scripts_custom.txt for current eA
-SVN versions. Add the files you want in the following manner:
-
- npc: npc/custom/kafraExpress/ke_main.txt
- //npc: npc/custom/kafraExpress/ke_rent.txt
-
-The first line is including the file ke_main.,txt, while the following
-excludes ke_rent from being used. Placing the "//" at the beginning of the
-line is known as commenting, and it's a useful way of quickly toggling a
-certain script on/off. The following is the list of all files that come
-bundled in the package:
-
-npc: npc/custom/kafraExpress/kafras.txt
-npc: npc/custom/kafraExpress/config.txt
-npc: npc/custom/kafraExpress/ke_main.txt
-
-npc: npc/custom/kafraExpress/ke_bank.txt
-npc: npc/custom/kafraExpress/ke_broadcast.txt
-npc: npc/custom/kafraExpress/ke_dye.txt
-npc: npc/custom/kafraExpress/ke_jobchange.txt
-npc: npc/custom/kafraExpress/ke_jobswap.txt
-npc: npc/custom/kafraExpress/ke_rent.txt
-npc: npc/custom/kafraExpress/ke_shop.txt
-npc: npc/custom/kafraExpress/ke_statmarket.txt
-npc: npc/custom/kafraExpress/ke_stats.txt
-npc: npc/custom/kafraExpress/ke_refine.txt
-npc: npc/custom/kafraExpress/ke_uncard.txt
-npc: npc/custom/kafraExpress/ke_warp_dungeon.txt
-npc: npc/custom/kafraExpress/ke_warp_pvp.txt
-npc: npc/custom/kafraExpress/ke_warp_town.txt
-npc: npc/custom/kafraExpress/ke_warp_woe.txt
-
-What files can be commented, which files you want to include? On the minimum,
-you need ke_main.txt, kafras.txt and config.txt to have the bare-bones functionality.
-Refer to the table of context to see the relation between files and the
-services they offer.
-
-2. Configure the Menus
-The second part of the configuration is adding/removing the menu entries that
-lead to the specific services. Failure to do this can either A. leave you with
-menu entries that lead to "Function Not found!" errors on the map server, or
-B. Services that were included, but you can't pick because they don't show up
-in the menu. The main file where you should configure the menus is ke_main.txt.
-
-From the main module, ke_main.txt, you must pick which services are available.
-The file contains eight menu sections, which is made up of two pairs of
-identitical menus. The only difference is that the first menu is displayed on
-Kafras placed on towns, while the second menu is for Kafras placed on fields and
-dungeons. The menu roughly looks like this:
-
- menu
- "- Leave",L_END,
- "- Heal Service ("<some code here>"z/10SP)",L_HEAL,
- "- Warp Service",L_WARP,
-// "- Use Storage ("<some code here>"z)",L_STORAGE,
-// "- Use Guild Storage ("<some code here>"z)",L_GUILD_STORAGE,
- "- Job Services",M_JOB,
- "- Other Services",M_OTHER,
- "- Save Respawn point",L_SAVE;
-
-This is the main menu, as you can see the only service unavailable is to use
-the storage. Like in the npc/config file, you can comment the lines of the
-services you do not want.
-
-WARNING: If you need to comment the last option of a menu, remember to replace
-the comma for a semi-colon on the next-to-last option or script parsing errors
-will occur.
-
-The "Warp Service" leads to the second pair of menus you can configure:
-
- menu
- "- Return",-,
- "- Dungeons",L_DUNGEON,
-// "- PvP Arena",L_PVP,
-// "- Guild Wars",L_GUILD_DUNGEON,
- "- Towns",L_TOWN;
- goto M_INIT;
-
-As before, you can comment/uncomment the features you want or not. Likewise,
-the third menu under "Job Services" contains features related to job changing,
-stats/skills and renting. The fourth pair is the "Other Services" menu which
-contains the rest of modules which are probably not going to be used
-frequently.
-
-For your convenience, the following is the list of all the menu options and the file(s) required for it to work:
-
-//Main Menu (under labels M_INIT/MD_INIT)
-
- "- Heal Service" -> ke_main.txt
- "- Warp Service"
- "- Use Storage" -> ke_main.txt
- "- Use Guild Storage" -> ke_main.txt
- "- Job Services"
- "- Other Services"
- "- Save Respawn point" -> ke_main.txt
-
-//Warp Menu (under labels M_WARP/MD_WARP)
-
- "- Dungeons" -> ke_warp_dungeon.txt
- "- PvP Arena" -> ke_warp_pvp.txt
- "- Guild Wars" -> ke_warp_gvg.txt
- "- Towns" -> ke_warp_town.txt
-
-//Job Services Menu (under labels M_JOB/MD_JOB)
-
- "- Change Job" -> ke_jobchange.txt
- "- Swap Job" -> ke_jobswap.txt
- "- Stat/Skill Services" -> ke_stats.txt
- "- Stat/Skill Market" -> ke_statmarket.txt
- "- Rental Service" -> ke_rent.txt
-
-//Other Services Menu (under labels M_OTHER/MD_OTHER)
-
- "- Bank Services" -> ke_bank.txt
- "- Use Kafra Shop" -> ke_shop.txt
- "- Broadcast a message" -> ke_broadcast.txt
- "- Refine Services" -> ke_refine.txt
- "- Uncard Services" -> ke_uncard.txt
- "- Stylist Service" -> ke_dye.txt
- "- Use a Kafra Pass" -> ke_main.txt
-
-////////////////////////////////////////////////////////////////////////////////
-[01] Intro to individual module configuration.
-////////////////////////////////////////////////////////////////////////////////
-
-For portability reasons, the configure options for every module is in the file
-config.txt, which lets you upgrade to future versions without having to
-readjust your settings every time.
-The config file has the options separated per module to make it easier to
-read. There may be bits of code in each section to avoid parsing configure
-options for unneeded variables which should be left alone. In some rare
-occassions variables from one module will be used in a different module (ie:
-Broadcasting PvP messages uses the variables from the pvp module). all variables
-follow the standard "ke<module initials>_variablename", so a variable called
-"kewd_discount" refers to the discount variable in the deep warps module (wd).
-For example, the renting module's configuration segment is:
-
- //-------------------------------------------------------------------------------
- //Config for the Renting Module
- //-------------------------------------------------------------------------------
-OnLoadRent:
- set $@kert_cartOnly, 0; //Set to 1 to enable only cart rental, 0 enables all add-ons.
- set $@kert_cartCost, 2000; //Cost to rent a Cart.
- set $@kert_falconCost, 2000; //Cost to rent a Falcon.
- set $@kert_pecoCost, 2000; //Cost to rent a PecoPeco.
- end;
-
-Variables are usually of two types: Exact value based or Percentage based.
-Exact value variables are often price for different services, while the
-percentage based are things like 30% discount when using Kafra Passes.
-Percentage values are expressed per-hundredth (that is, 10 = 10%, 100 = 100%)
-unless otherwise specified.
-
-Each variable has a small description next to it, hence the need of this
-document. In this document the variable type is identified next to it by: (1)
-when it's boolean, (%) when it's a percentage, ($) when it's a price, (#) for
-numbers and (") for strings.
-
-////////////////////////////////////////////////////////////////////////////////
-[02] Module: Main Core (ke_main.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-This module offers the core functionality of the Kafra Express. Contains the
-main menu and handles the Kafra Pass Reserve Points system.
-
-Variables
-================================================================================
-
-(1) ke_saveOnSpot
------------------
-When 1, a character's respawn point is saved exactly where they are standing.
-otherwise, the respawn point is specified by the kafra definition (see Section
-18).
-
-($) keh_hpCost
-($) keh_spCost
---------------
-The cost of healing sp per every 10 sp. For example, if the cost is 1, it
-costs 100z to heal 1000.
-
-($) kes_cost
-($) kegs_cost
--------------
-The cost of using the storage, guild storage (respectively)
-
-(1) kekp_reset
---------------
-For Kafra Passes. When 1, the Pass expires when starting a chat with the
-Kafra. Otherwise the variable remains active a pretty long time (probably all
-session).
-
-($) kekp_reserveCost
---------------------
-The cost in zeny of reserve points. When using a Kafra Pass many services will
-be cheaper, the amount of zeny saved is "used" to grant the player reserve
-points. For example, if the reserve cost is 100, for every 100z the player
-saves, he'll earn 1 reserve points. Reserve points can be used in scripts, and
-by default is used in the Al De Baran Kafra Headquarters to gain items. Use a
-value of 0 to disable Reserve Point gaining.
-
-(#) kekp_minReserve
-(#) kekp_maxReserve
----------------
-What is the minimum/maximum reserve points the player can gain when using a
-Kafra Pass per transaction? This only applies when the player has saved at
-least 1z.
-
-(") ked_users
--------------
-Certain modules (in particular, the warping ones) have the ability to display
-the number of players related to the function (ie: number of users in a
-dungeon), in such cases this variable is used to display the 'unit' of said
-count. For example, if ked_users is "kids" then the related modules might
-display things like "- Glast Heim (6 kids)".
-
-////////////////////////////////////////////////////////////////////////////////
-[03] Module: Bank (ke_bank.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-This modules enables characters to "store" zeny on a virtual bank account
-which is shared among characters of the same account. There can be deposits,
-withdrawals, which can have transactions fees associated.
-
-It is also possible to establish a monthly maintenance fee that has to be
-payed, when the player does not has enough money in the account to pay this
-fee, they stop gaining interests until they deposit enough to pay it up.
-Finally, all fees charged by the bank can be stored in a server-wide variable
-which may be used by other custom scripts.
-
-Variables
-================================================================================
-
-(%) kebk_depositCost
-(%) kebk_withdrawCost
----------------------
-The Fee in % charged whenever a player does a deposit/withdrawal. For example,
-when a player deposits 100z and the fee is 3%, only 97z are deposited, and 3z
-are charged. Likewise, if a player withdraws 100z when the fee is of 5%,
-they'll withdraw 100z and an additional 5z will be removed from their accounts
-as fee cost.
-
-($) kebk_minTransact
-($) kebk_maxTransact
---------------------
-The minimum/maximum values of a single transaction (deposit or withdrawal)
-
-($) kebk_capacity
------------------
-Indicates what is the bank account capacity for players. That is, what is the
-maximum zeny their account can hold. You can't deposit anymore once the max
-has been reached, and daily interests are lost while maxed.
-
-(%) kebk_dayInterest
---------------------
-The daily interests that the account makes. The value is in 0.01% units, so a
-value of 100 equals 1% daily interests.
-
-($) kebk_monMaintenance
------------------------
-Monthly flat fee charged for maintenance.
-
-(1) kebk_useGlobalBank
-----------------------
-When 1, every fee charged from the player goes into a server variable
-($ke_globalbank), which can then be used by other scripts. is 0 by default
-because none of the Kafra Express modules uses it.
-
-////////////////////////////////////////////////////////////////////////////////
-[04] Module: Broadcast (ke_broadcast.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Provides broadcasting services for players. Broadcasts can be local (current
-map only) or global (server announce), there are also four types of broadcast:
-Requests for a party, PvP Challenge invitations, General Broadcasts (player
-input the string they want to say) and General Anonymous Broadcasts (player
-name is not displayed when doing the broadcast).
-
-Note that the variables from ke_warp_pvp.txt will be used for auto-configuring
-the pvp broadcasts.
-
-Variables:
-================================================================================
-
-(1) kebc_showOnline
--------------------
-When 1, the total count of players will be displayed in the menu (map users
-next to the local broadcast entry, server users next to the global broadcast
-entry).
-
-($) kebc_partyCost
-($) kebc_pvpCost
-($) kebc_cost
-($) kebc_anonCost
-------------------
-Respective base costs for doing Party-Requests/Pvp Challenge/General/Anonymous
-broadcasts.
-
-(%) kebc_globalFactor
----------------------
-When the broadcast is global, the base cost is multipled by this factor. If
-the factor is 500, then global broadcasts cost 5x times the cost of the map's
-broadcast.
-
-(%) kebc_discount
------------------
-Discount on broadcast prices when the Kafra Pass is active.
-
-////////////////////////////////////////////////////////////////////////////////
-[05] Module: Stylist (ke_dye.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Offers cloth dye, hair dye and hair style changes, both by input and by wheel
-browsing. Does not consumes dyestuffs because it is designed for custom dye
-packages.
-
-Variables
-================================================================================
-
-(1) kedy_enableHairstyle
-------------------------
-If one, the menu will include hair-style changing options, otherwise only
-dye-changes are offered
-
-(#) kedy_styles
----------------
-Specifies the number of available hair styles
-
-(#) kedy_hair
--------------
-Specificies the number of hair dyes
-
-(#) kedy_clothJN
-(#) kedy_clothJ1ST
-(#) kedy_clothJ2ND
-(#) kedy_clothJSN
-(#) kedy_clothJWED
-------------------
-Specifies the number of cloth dyes based on job-type: Novices, First Classes,
-Second Classes, Super Novices, Wedding Class.
-
-////////////////////////////////////////////////////////////////////////////////
-[06] Module: Job Changer (ke_jobchange.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Offers job changing, including rebirth and baby classes. The rebirth system
-can allow people free changing through a different path, or forcing the
-correct path. Zeny can be charged/granted as well as weapons on job-change.
-Remaining Skill Points can be wiped, ignored or prevent the change from
-happening. Before changing players can review the consequences of doing so,
-including weapons to gain.
-
-Finally, there's an option that makes it possible to skip the novice class
-altogether and change directly to first jobs.
-
-Variables
-================================================================================
-
-(#) kejc_skillsPolicy
----------------------
-Determines what to do with remaining skill points upon change:
- 0: No job changing until points are used.
- 1: Extra Skill Points are wiped.
- 2: Extra skill points are conserved.
-
-(#) kejc_upperPolicy
---------------------
-What to do about the advanced classes?
- 0: Free for all, players can pick any advanced job regardless of the previous.
- 1: Force mode, classes are auto-selected from the previous path. In the
- case the path could not be determined (players changed jobs previously
- using other npcs), players will be able to select their next job.
-
-(1) kejc_announce
------------------
-When 1, a global announce will be done upon change.
-
-(1) kejc_resetDye
------------------
-If one, the cloth dye is reset upon changing.
-
-(1) kejc_skipNovice
--------------------
-If one, players can skip the novice class and directly into their first job.
-Exploit proof, skills are wiped when changing to a 1st class this way, and
-their basic skill level is set to 9.
-
-(#) kejc_baseSN
----------------
-Base Level required before changing into a Super Novice.
-
-(#) kejc_base2ND
-(#) kejc_job2ND
-(#) kejc_cost2ND
-----------------
-Base level, Job level and zeny required to change into a second job. If the
-cost is below zero, zeny will be given to the player instead of charged.
-
-(#) kejc_baseRebirth
-(#) kejc_jobRebirth
-(#) kejc_costRebirth
---------------------
-Base level, Job level and zeny required before doing a rebirth (change to High
-Novice).
-
-(1) kejc_rebirthReset
----------------------
-If 1, when changing into a HighNovice characters will have their level reset
-to 1 (with the additional 100 stat points)
-
-(1) kejc_weaponPolicy
----------------------
-If 1, characters will get a weapon upon job change. For each first&second
-class there are two weapons to specify, the standard weapon and the "premium"
-one.
-
-(#) kejc_wBonusLv
------------------
-When characters reach this job level, they will receive the premium weapon instead of the normal one. If 0, premium weapons are disabled.
-
-(#) kejc_wAcolyte
-(#) kejc_wArcher
-(#) kejc_wMage
-(#) kejc_wMerchant
-(#) kejc_wSwordman
-(#) kejc_wThief
-(#) kejc_wSuperNovice
-(#) kejc_wPriest
-(#) kejc_wMonk
-(#) kejc_wHunter
-(#) kejc_wBard
-(#) kejc_wDancer
-(#) kejc_wWizard
-(#) kejc_wSage
-(#) kejc_wBlacksmith
-(#) kejc_wAlchemist
-(#) kejc_wKnight
-(#) kejc_wCrusader
-(#) kejc_wAssassin
-(#) kejc_wRogue
------------------------
-ID of the normal weapons received upon job change (if weapon policy is in
-effect).
-
-(#) kejc_w2Priest
-(#) kejc_w2Monk
-(#) kejc_w2Hunter
-(#) kejc_w2Bard
-(#) kejc_w2Dancer
-(#) kejc_w2Wizard
-(#) kejc_w2Sage
-(#) kejc_w2Blacksmith
-(#) kejc_w2Alchemist
-(#) kejc_w2Knight
-(#) kejc_w2Crusader
-(#) kejc_w2Assassin
-(#) kejc_w2Rogue
---------------------
-ID of the premium weapons received upon job chane (if bonus weapon policy is
-in effect). Note that first classes can't get a bonus weapon.
-
-////////////////////////////////////////////////////////////////////////////////
-[07] Module: Job Swapper (ke_jobswap.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Permits characters to change jobs among other jobs of their same "level".
-This is, between first classes or between second classes. It is also possible
-to store the last job used and revert to it at a later date. Dye, Job Level
-and Skill Point count is saved, however the skill-tree is not saved and skills
-need be reallocated. When reverting to the previous class, characters might be
-able to return from an adv class to a normal one, but if they are baby
-classes, they can't change back to a normal one.
-
-Variables
-================================================================================
-
-(1) kejs_SNpolicy
------------------
-Determines what to do with Super Novices. if 0, they can't swap jobs, if 1,
-they are considered first classes.
-
-(#) kejs_revertPolicy
----------------------
-Determines if Reverting classes is possible and when:
- 0: Cannot go back to the previous job.
- 1: Can only go back if the previous job belongs to the same type as the
- first (is also a 1st/2nd job and is the same normal/adv/baby category).
- 2: Can return to the previous job regardless (exception: when one of the
- two jobs is a baby job and the other is not).
-
-(1) kejs_announce
------------------
-If 1 does a server announce when swapping jobs.
-
-($) kejs_revertCost
--------------------
-Cost of changing to the previous job.
-
-(1) kejs_saveDye
-----------------
-If one, the dye is saved when swapping and restored upon revert.
-
-(1) kejs_resetDye
------------------
-If 1 the clothe dye is reset upon swap.
-
-(%) kejs_swapDiscount
-(%) kejs_revertDiscount
------------------------
-Discount % to apply when the kafra pass is active for swapping/reverting.
-
-(#) kejs_job1ST
-(#) kejs_job2ND
----------------
-Minimum job level before being able to swap among 1st/2nd classes.
-
-($) kejs_cost1ST
-($) kejs_cost2ND
-----------------
-Base cost of swaping jobs.
-
-(%) kejs_discount1ST
-(%) kejs_discount2ND
---------------------
-Discount % to apply to the base cost for every job level above the minimum
-required. For example, if the discount is 1% per level and you change when you
-have +10 level more than the min necessary, you get a 10% discount.
-
-(%) kejs_preserve1ST
-(%) kejs_preserve2ND
---------------------
-Indicates how much of the previous job level to preserve when changing. For
-example, if the preserve value is 50 (50%) and you change from a level 40
-Knight into Priest, you'll become a lv 20 Priest. Skill points are adjusted
-accordingly so it's exploit-free.
-
-////////////////////////////////////////////////////////////////////////////////
-[08] Module: Smithery (ke_refine.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Offers the services usually found in the town smithery and then some more:
-Item refining, Item Repairing, Ore Purification (rough oris -> pure ones).
-Also sells Phracon and Emveretarcon.
-
-Item refining can follow all the rules of normal refining, but it can also
-override them to refine everything, or safe refines up to max level.
-
-Ore Purification can be extended to include all the rough materials that
-blacksmiths can purify (star dust -> star crumbs, for example).
-
-Variables
-================================================================================
-
-(#) kerf_maxLv
---------------
-Maximum refinement level of equipment.
-
-(1) kerf_safe
--------------
-If 1 success chances are ignoring and refining never fails.
-
-(1) kerf_showChance
--------------------
-If 1 the chance of success/failure is actually shown before confirming.
-
-(1) kerf_refineAll
-------------------
-If 1 then unrefinable items will be refined too (like accesories)
-
-(%) kerf_discount
------------------
-Discount rate to be applied during forging when the Kafra Pass is active.
-
-($) kerf_armorCost
-($) kerf_weaponLv1Cost
-($) kerf_weaponLv2Cost
-($) kerf_weaponLv3Cost
-($) kerf_weaponLv4Cost
-----------------------
-Cost per level to refine armors, and level 1/2/3/4 weapons.
-
-(1) kerf_purifyAll
-------------------
-If 1, the extended purify menu will be used, which shows how to purify steels,
-star crumbs, etc; otherwise, just elus and oris are available.
-
-($) kerf_repairCost
--------------------
-Cost of repairing a broken weapon.
-
-(%) kerf_repairDiscount
------------------------
-Repair Discount% when the kafra pass is active.
-
-(1) kerf_repairSteel
---------------------
-If 1, a steel will be required to repair items.
-
-////////////////////////////////////////////////////////////////////////////////
-[09] Module: Renting (ke_refine.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Allows renting of Cart/Falcon/PecoPeco. Note that the only restriction applied
-is whether the character has "PushCart", "Falcon Taming" or "PecoPeco Riding",
-it does not checks for the character's class.
-
-It must also be noted that renting is free while the Kafra Pass is active.
-
-Variables
-================================================================================
-
-(1) kert_cartOnly
------------------
-If 1, this module only offers cart rentals. Otherwise you can rent any of the three.
-
-($) kert_cartCost
-($) kert_falconCost
-($) kert_pecoCost
--------------------
-Cost for renting carts/falcons/pecos.
-
-////////////////////////////////////////////////////////////////////////////////
-[10] Module: Kafra Shop (ke_shop.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Allows invoking of a shop from the Kafra. Note that the shops must be of
-invisible type (ke_shop.txt has an example of two such shops). The config
-enables you to select whether the shop will allow buying, selling or
-both, as well as the name of the shops to use in towns or dungeons (if you
-want to use a custom shop defined elsewhere or want to use the same shop for
-both).
-
-Variables
-================================================================================
-
-(#) $@kesh_towntype
-(#) $@kesh_duntype
--------------------
-Specifies the type of transaction allowed at the shop. Use 1 to enable only
-buying of items, 2 for only selling, or any other value for both.
-
-(#) $@kesh_townshop$
-(#) $@kesh_dunshop$
---------------------
-Specifies the name of the shop to use for buying/selling of items. By default
-the file includes two such shops which you can use, or you can disable them
-and specify your own in the config changing these variables.
-
-////////////////////////////////////////////////////////////////////////////////
-[11] Module: Stat/Skill Market (ke_statmarket.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Not really a "market", this module lets players sell and buy stat/skill
-points. Also allows for direct trading between stats/skills.
-
-NOTE: Selling stat points can lead to zeny exploits if your server uses the
-stat_db.txt file, because players can then sell all their stat points, do a
-reset and get them back! To prevent this, set the following battle config
-option:
- use_statpoint_table: no
-Alternatively, you can set the selling point of statpoints to be 0z.
-
-Variables
-================================================================================
-
-($) kesm_stBuyPrice
-($) kesm_stSellPrice
---------------------
-Price for every stat point to be bought/sold.
-
-($) kesm_skBuyPrice
-($) kesm_skSellPrice
---------------------
-Price for every skill point to be bought/sold.
-
-(%) kesm_discount
------------------
-Discount price when kafra pass is active. Only applies to buying stats/skills.
-
-(#) kesm_skTradePrice
-(#) kesm_stTradePrice
----------------------
-These two define how many stat points are traded per each skill point when
-doing a direct conversion between stats/skills. The idea is that trading
-directly one for the other should be cheaper than selling them and then buying
-from the other. You can set both to the same value and the trading will have
-no loss.
-Notice that skTradePrice is the cost for converting stats to skills and
-stTradePrice is the cost for converting skills to stats. So... NEVER set
-stTradePrice higher than skTradePrice or you allow an easy exploit of infinite
-stats/skills!
-
-////////////////////////////////////////////////////////////////////////////////
-[11] Module: Stat/Skill Resets/Raising (ke_stats.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Does stat/skills resets, and additionally helps characters raise their basic
-stats faster. Optionally, skill resets will not touch the basic-skill level.
-Price have two components: base fee and per level fee, so characters with
-higher levels will have to pay more for a reset than low level ones.
-For stat resetting, base level is taken into account. For skill resets, job
-levels. For a dual reset, the addition of both is considered. Also, when taken
-into consideration job level for second classes, the job-level at which one
-changed jobs is also considered. So a Job level 1 Knight actually has job
-level of 41~51.
-
-NOTE: Be careful with quest skills. If your server is configured to reset
-quest skills and players can get their quest skills for free, you are letting
-them exploit the system and get unlimited skill points! (even worse if they
-can sell'em in the Stat/Skills market module). Be sure to either remove free
-quest skills npcs or make quest skills not resetable.
-
-Variables:
-================================================================================
-
-($) kest_stResetCost
---------------------
-Base cost of doing a stat reset.
-
-($) kest_skResetCost
---------------------
-Base cost of doing a skill reset.
-
-($) kest_resetCost
-------------------
-Base cost of a dual reset.
-
-($) kest_BaseLvCost
--------------------
-Cost per Base level for doing a stat reset.
-
-($) kest_JobLvCost
-------------------
-Cost per Job level for doing a skill reset.
-
-($) kest_BothLvCost
--------------------
-Cost per Base+Job level for doing a dual reset.
-
-(%) kest_discount
------------------
-Discount % applied when Kafra Pass is active.
-
-(1) kest_resetBasic
--------------------
-If 1, the skill "basic skill" is also reset.
-
-////////////////////////////////////////////////////////////////////////////////
-[12] Module: Uncarding (ke_uncard.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-This module allows people to remove cards from their equipped items. Prices
-are modified by the item type, the amount of cards and the refine level of the
-item. There's also a chance the removal will fail and: Nothing is lost, the
-card or item is lost, both are lost. The procedure may also require up to two
-different items (and each one with their own specified qty).
-
-Variables:
-================================================================================
-
-($) keuc_BaseCost
------------------
-Base cost of uncarding, modified by the following conditions:
-
-($) keuc_CardCost
------------------
-Each card to be removed increases the total by this value.
-
-($) keuc_UpgradeCostA
-($) keuc_UpgradeCostW1
-($) keuc_UpgradeCostW2
-($) keuc_UpgradeCostW3
-($) keuc_UpgradeCostW4
-----------------------
-These indicate the price increase per refine level for armors and weapons
-levels 1/2/3/4. A +10 armor gets a price increases of ten times
-keuc_UpgradeCostA.
-
-(%) keuc_discount
------------------
-Discount % to apply when kafra pass is active.
-
-(#) keuc_Mat1
-(#) keuc_Qty1
--------------
-Id and Qty of the first material that is needed to uncard. If the qty is zero,
-then it's disabled.
-
-(#) keuc_Mat2
-(#) keuc_Qty2
--------------
-id & Qty of the second material to use. Only valid if the first material was
-also defined, use qty=0 to disable.
-
-(%) keuc_Fail0Chance
---------------------
-This is the safe failure chance (0-1000, where 1000 = 100.0%). A Safe failure
-means the original item remains intact, but you are still charged the money
-and the materials. Use 0 to disable this type of failure.
-
-(%) keuc_Fail1Chance
---------------------
-This is the partial failure chance (0-1000). Partial failures are when either
-the cards or the item is lost. The player gets to choose which one is more
-important before proceeding. Use 0 to disable.
-
-(%) keuc_Fail2Chance
---------------------
-Total failure chance (0-1000). When this triggers, both item and cards are
-lost. Use 0 to disable.
-
-////////////////////////////////////////////////////////////////////////////////
-[14] Module: Town Warping (ke_warp_town.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-This module enables warping to towns. Currently all towns have the same
-warping cost, independent of how far away they are placed. The only exception
-is Niflheim, which is more of a dungeon than a town.
-
-Variables
-================================================================================
-
-(1) kewt_showOnline
--------------------
-If set to 1, the menus will display the online count of players in
-towns.
-
-($) kewt_cost
--------------
-Cost of warping to a town.
-
-($) kewt_niflCost
------------------
-Cost of warping to Niflheim. Different cost since Niflheim is more of a
-dungeon than a city. Also, players can't warp to Niflheim until they do the
-Niflheim Piano Key Quest.
-
-(#) kewt_travel
----------------
-Allows enabling the traveller system. The traveller system makes it so you can't
-warp to a town until you have been there first by some other means (usually
-walking) and saved with the Kafra Express in that town.
-There are three valid values for this variable: 0, 1, 2.
-0 - Disables this mode.
-1 - Uses the mode on a per character basis; that is, each character needs to
-travel to that town and save and that unlocks warping only for that
-character.
-2 - Uses the mode on a per account basis; that is, once a character has saved
-on a town, all other (and future) characters from the same account have the
-warp unlocked.
-
-(1) kewt_free
--------------
-If 1, players will be able to warp to towns even if they run out of money.
-Niflheim excepted.
-
-(%) kewt_discount
------------------
-Discount % to apply when warping while the Kafra Pass is active.
-
-////////////////////////////////////////////////////////////////////////////////
-[15] Module: Dungeon Warping (ke_warp_dungeon.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-Offers warps to all dungeons. Dungeon warping has two main operation modes:
-Deep Dungeon Warping and Short Dungeon Warping. Deep Dungeon warping enables
-players to warp to any level of any dungeon, while Short Dungeon Warping is
-restricted to warping only to the entrance of the dungeon. Traveller's mode is
-also available for dungeons.
-
-Variables
-================================================================================
-
-(1) kewd_showOnline
--------------------
-If set to 1, the menus will display the online online count of characters in
-the dungeons.
-
-(%) kewd_discount
------------------
-Discount % to apply when warping while the Kafra Pass is active.
-
-(#) kewd_travel
----------------
-Enables the traveller system. Just like the traveller's system for towns,
-you can't warp to any dungeon to which you have not visited first on foot and
-saved with the corresponding Kafra Express first.
-If 1, traveller's mode is enabled on a per character basis (so once a
-character saves, only that character has unlocked the warp).
-If 2, traveller's mode is enabled on a per account basis (so once a character
-saves, all charaters of the corresponding account have the warp unlocked).
-
-(1) kewd_deep
--------------
-This variable decides whether deep or short warps will be used. There's no
-need to set it as it will be set automatically based on which file was
-included (ke_warp_short.txt or ke_warp_deep.txt).
-
-(%) kewd_levelCost
-------------------
-This variable only applies to deep warps. It indicates in percentage the cost
-increase per level. For example, if the dungeon costs 1000z to warp to, and
-the levelCost increase is of 50 (50%) then warping to level 2 costs 1500, lv3
-costs 2000, and so on.
-
-(%) kewd_entryDiscount
-----------------------
-The discount for using the Kafra in the dungeon entrance to warp within the
-dungeon. For example, if you use the Kafra next to Payon dungeon to warp to
-Payon Dungeon lv5, this discount is then applied. This variable only makes
-sense on deep warp mode.
-
-(1) kewd_turtleCave
--------------------
-Only used on short warps. If 1, then warping to Turtle Dungeon should lead
-directly to the cave's entrance, otherwise it warps you to the Island's
-entrance.
-
-($) kewd_amatsu
-($) kewd_antHell
-($) kewd_ayothaya
-($) kewd_byalan
-($) kewd_comodo
-($) kewd_clockTower
-($) kewd_coalMines
-($) kewd_culvert
-($) kewd_gefenia
-($) kewd_geffen
-($) kewd_glastHeim
-($) kewd_gonRyun
-($) kewd_hiddenTemple
-($) kewd_louYang
-($) kewd_magma
-($) kewd_orc
-($) kewd_payon
-($) kewd_pyramids
-($) kewd_sphinx
-($) kewd_sunkenShip
-($) kewd_toyFactory
-($) kewd_turtleIsland
-($) kewd_umbala
----------------------
-Base cost of warping to each dungeon, that is, the entrance level cost.
-
-////////////////////////////////////////////////////////////////////////////////
-[16] Module: PvP Warping (ke_pvp.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-The PvP warping module leads to the pvp maps named pvp_n_*-*.gat. It has two
-modes: simple and advanced. On simple mode, every player of every level gets
-thrown into the pvp_n_1-*.gat maps to nuke it out, on advanced mode each of
-the map groups gets their own range of permissible levels to enter. Since
-there is no sure way how characters should escape from a pvp map, they are
-currently given a butterfly wing when they warp.
-
-Variables
-================================================================================
-
-(1) kewp_showOnline
--------------------
-If 1, the menu entries will display the online count of players of each entry.
-
-(1) kewp_advanced
------------------
-Use the advanced pvp system if 1 (see module description)
-
-($) kewp_cost
--------------
-Cost of warping to the pvp rooms used in non-advanced rooms and "free for all"
-in advanced mode.
-
-($) kewp_cost1
-($) kewp_cost2
-($) kewp_cost3
-($) kewp_cost4
-($) kewp_cost5
-($) kewp_cost6
-($) kewp_cost7
---------------
-The costs for each of the pvp room groups in advanced mode.
-
-(#) kewp_baseLv1
-(#) kewp_baseLv2
-(#) kewp_baseLv3
-(#) kewp_baseLv4
-(#) kewp_baseLv5
-(#) kewp_baseLv6
-(#) kewp_baseLv7
-----------------
-These indicate the nominal base level for each room (which base level should
-characters be around to join it). Applicable only to advanced mode.
-
-(#) kewp_range
---------------
-Specifies how far away the character's level can be from the nominal value to
-still be allowed within the room. If the nominal level is 50 and the range is
-3, only characters with levels 47-53 may join.
-
-////////////////////////////////////////////////////////////////////////////////
-[17] Module: WoE Warps (warp_woe.txt)
-////////////////////////////////////////////////////////////////////////////////
-
-Description
-================================================================================
-This module allows characters to warp into the WoE grounds during (or out of)
-War of Emperium times. Players may warp directly into the Guild Dungeons if
-the proper lines are uncommented on the warp menu (See warp_woe.txt's header
-for the location of the menu entries):
-
- menu "- Cancel",-,
-// "- Guild Dungeons",M_DUNGEON,
- "- Al De Baran Guild ("<some code>"z)",L_ALDEBARAN,
- "- Geffen Guild ("<some code>"z)",L_GEFFEN,
- "- Payon Guild ("<some code>"z)",L_PAYON,
- "- Prontera Guild ("<some code>"z)",L_PRONTERA;
- return;
-
-Variables
-================================================================================
-
-(1) kewg_check
---------------
-Does a guild check. If 1, only characters who belong to a guild can use these
-warps.
-
-(1) kewg_checkAgit
-------------------
-Does the WoE times check. If 1, only during War of Emperium the warps will be
-active.
-
-(1) kewg_showOnline
--------------------
-Set to 1 to display in the menus the online count of players in each of the
-guild areas. It also adds a menu entry that displays the summary of players
-within each castle and guild grounds.
-
-(%) kewg_discount
------------------
-Discount % to be applied for warps while the Kafra Pass is active.
-
-($) kewg_baldur
-($) kewg_luina
-($) kewg_valkyrie
-($) kewg_britoniah
-------------------
-Costs to the respective guild dungeons when enabled.
-
-($) kewg_alDeBaran
-($) kewg_geffen
-($) kewg_payon
-($) kewg_prontera
-------------------
-Costs to each of the guild grounds.
-
-////////////////////////////////////////////////////////////////////////////////
-[18] The kafras.txt file: About Kafra Definitions
-////////////////////////////////////////////////////////////////////////////////
-
-The file kafras.txt contains the definition of the Kafras, which is the actual
-sprite on-screen that characters speak with. An enabled kafra may look like
-this:
-
-//Alberta
-alberta.gat,113,53,7 script Kafra Express 116,{
- callfunc "F_KafraExpress","Kafra Express","kafra_02",0,"alberta.gat",116,57;
-}
-
-And a disabled/commented Kafra would look like this:
-
-//Prontera Guild Grounds
-//prt_gld.gat,127,163,5 script Kafra Express 115,{
-// callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"prt_gld.gat",129,170;
-//}
-
-For scripters, the way to define an NPC is not new, and beyond the scope of
-this document, so I'll only document the function "F_KafraExpress":
-
-F_KafraExpress (String "Kafra's name", String "kafra image file", int location, String map, int x, int save y)
-
-The first parameter, the Kafra's name, is the name that will be displayed all
-over the dialogue windows. The Kafra Image file is the image that is to be
-displayed on the screen during the npc chat (without the extension). You can
-use "" to disable the image.
-
-Location refers to the type of Kafra. Type=0 refers to Kafras in towns while
-Type=1 refers to Kafras placed in the wild, ie: in dungeons. Type=2 is for
-Kafras that should count as both town & dungeon. Under these situations, the
-menus displayed are those of the town, the type is used for the traveller's
-warping mode. Finally, Type=3 is a special type used only for the Niflheim
-Kafra.
-
-The last three Parameters are used to define the save location when you save
-your respawn. They are not needed if you use the "Save-on-spot" feature, but
-it's recommended to pass them nevertheless. Note that the map name will still
-be used when using traveller's mode.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Kafra Express Script Package Documentation % +% - by Skotlex % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +This file's purpose is to give an indepth explanation about setting up, and +configuring the Kafra Express Script Package (KESP). It is intended to be +viewed by a text editor using fixed-width font and 80-character long lines. + +Document Version v1.9 (15/June/2006) +//////////////////////////////////////////////////////////////////////////////// +Table of Contents +//////////////////////////////////////////////////////////////////////////////// +[00] Including the NPC files and menu editing +[01] Intro to module configuring and general options (config.txt) +[02] Module: Main Core (ke_main.txt) +[03] Module: Bank (ke_bank.txt) +[04] Module: Broadcast (ke_broadcast.txt) +[05] Module: Stylist (ke_dye.txt) +[06] Module: Job Changer (ke_jobchange.txt) +[07] Module: Job Swapper (ke_jobswap.txt) +[08] Module: Smithery (ke_refine.txt) +[09] Module: Renting (ke_refine.txt) +[10] Module: Kafra Shop (ke_shop.txt) +[11] Module: Stat/Skill Market (ke_statmarket.txt) +[12] Module: Stat/Skill Resets/Raising (ke_stats.txt) +[13] Module: Uncarding (ke_uncard.txt) +[14] Module: Town Warping (ke_warp_town.txt) +[15] Module: Dungeon Warping (ke_warp_dungeon.txt) +[16] Module: PvP Warping (ke_warp_pvp.txt) +[17] Module: WoE Warping (ke_warp_woe.txt) +[18] The kafras.txt file: About Kafra Definitions + +//////////////////////////////////////////////////////////////////////////////// +[00] Including the NPC files and menu editing +//////////////////////////////////////////////////////////////////////////////// + +Because of the script's complexity, placing everything in a single file +is out of the question, therefore the KESP comes bundled in different +files. Because of the dynamic nature of the script, there are two things +you need to do in order to enable/disable a particular service: + +1. Include the txt file with the corresponding module. +To include the txt files, you need to know two things: where are the script +files located, and which is the configuration file where you place the npc +includes. We'll assume on this guide that you unpacked the KESP in +npc/custom/kafraExpress. The configuration file for scripts is +conf/map_athena.conf for eA1.0rc5, and npcs/scripts_custom.txt for current eA +SVN versions. Add the files you want in the following manner: + + npc: npc/custom/kafraExpress/ke_main.txt + //npc: npc/custom/kafraExpress/ke_rent.txt + +The first line is including the file ke_main.,txt, while the following +excludes ke_rent from being used. Placing the "//" at the beginning of the +line is known as commenting, and it's a useful way of quickly toggling a +certain script on/off. The following is the list of all files that come +bundled in the package: + +npc: npc/custom/kafraExpress/kafras.txt +npc: npc/custom/kafraExpress/config.txt +npc: npc/custom/kafraExpress/ke_main.txt + +npc: npc/custom/kafraExpress/ke_bank.txt +npc: npc/custom/kafraExpress/ke_broadcast.txt +npc: npc/custom/kafraExpress/ke_dye.txt +npc: npc/custom/kafraExpress/ke_jobchange.txt +npc: npc/custom/kafraExpress/ke_jobswap.txt +npc: npc/custom/kafraExpress/ke_rent.txt +npc: npc/custom/kafraExpress/ke_shop.txt +npc: npc/custom/kafraExpress/ke_statmarket.txt +npc: npc/custom/kafraExpress/ke_stats.txt +npc: npc/custom/kafraExpress/ke_refine.txt +npc: npc/custom/kafraExpress/ke_uncard.txt +npc: npc/custom/kafraExpress/ke_warp_dungeon.txt +npc: npc/custom/kafraExpress/ke_warp_pvp.txt +npc: npc/custom/kafraExpress/ke_warp_town.txt +npc: npc/custom/kafraExpress/ke_warp_woe.txt + +What files can be commented, which files you want to include? On the minimum, +you need ke_main.txt, kafras.txt and config.txt to have the bare-bones functionality. +Refer to the table of context to see the relation between files and the +services they offer. + +2. Configure the Menus +The second part of the configuration is adding/removing the menu entries that +lead to the specific services. Failure to do this can either A. leave you with +menu entries that lead to "Function Not found!" errors on the map server, or +B. Services that were included, but you can't pick because they don't show up +in the menu. The main file where you should configure the menus is ke_main.txt. + +From the main module, ke_main.txt, you must pick which services are available. +The file contains eight menu sections, which is made up of two pairs of +identitical menus. The only difference is that the first menu is displayed on +Kafras placed on towns, while the second menu is for Kafras placed on fields and +dungeons. The menu roughly looks like this: + + menu + "- Leave",L_END, + "- Heal Service ("<some code here>"z/10SP)",L_HEAL, + "- Warp Service",L_WARP, +// "- Use Storage ("<some code here>"z)",L_STORAGE, +// "- Use Guild Storage ("<some code here>"z)",L_GUILD_STORAGE, + "- Job Services",M_JOB, + "- Other Services",M_OTHER, + "- Save Respawn point",L_SAVE; + +This is the main menu, as you can see the only service unavailable is to use +the storage. Like in the npc/config file, you can comment the lines of the +services you do not want. + +WARNING: If you need to comment the last option of a menu, remember to replace +the comma for a semi-colon on the next-to-last option or script parsing errors +will occur. + +The "Warp Service" leads to the second pair of menus you can configure: + + menu + "- Return",-, + "- Dungeons",L_DUNGEON, +// "- PvP Arena",L_PVP, +// "- Guild Wars",L_GUILD_DUNGEON, + "- Towns",L_TOWN; + goto M_INIT; + +As before, you can comment/uncomment the features you want or not. Likewise, +the third menu under "Job Services" contains features related to job changing, +stats/skills and renting. The fourth pair is the "Other Services" menu which +contains the rest of modules which are probably not going to be used +frequently. + +For your convenience, the following is the list of all the menu options and the file(s) required for it to work: + +//Main Menu (under labels M_INIT/MD_INIT) + + "- Heal Service" -> ke_main.txt + "- Warp Service" + "- Use Storage" -> ke_main.txt + "- Use Guild Storage" -> ke_main.txt + "- Job Services" + "- Other Services" + "- Save Respawn point" -> ke_main.txt + +//Warp Menu (under labels M_WARP/MD_WARP) + + "- Dungeons" -> ke_warp_dungeon.txt + "- PvP Arena" -> ke_warp_pvp.txt + "- Guild Wars" -> ke_warp_gvg.txt + "- Towns" -> ke_warp_town.txt + +//Job Services Menu (under labels M_JOB/MD_JOB) + + "- Change Job" -> ke_jobchange.txt + "- Swap Job" -> ke_jobswap.txt + "- Stat/Skill Services" -> ke_stats.txt + "- Stat/Skill Market" -> ke_statmarket.txt + "- Rental Service" -> ke_rent.txt + +//Other Services Menu (under labels M_OTHER/MD_OTHER) + + "- Bank Services" -> ke_bank.txt + "- Use Kafra Shop" -> ke_shop.txt + "- Broadcast a message" -> ke_broadcast.txt + "- Refine Services" -> ke_refine.txt + "- Uncard Services" -> ke_uncard.txt + "- Stylist Service" -> ke_dye.txt + "- Use a Kafra Pass" -> ke_main.txt + +//////////////////////////////////////////////////////////////////////////////// +[01] Intro to individual module configuration. +//////////////////////////////////////////////////////////////////////////////// + +For portability reasons, the configure options for every module is in the file +config.txt, which lets you upgrade to future versions without having to +readjust your settings every time. +The config file has the options separated per module to make it easier to +read. There may be bits of code in each section to avoid parsing configure +options for unneeded variables which should be left alone. In some rare +occassions variables from one module will be used in a different module (ie: +Broadcasting PvP messages uses the variables from the pvp module). all variables +follow the standard "ke<module initials>_variablename", so a variable called +"kewd_discount" refers to the discount variable in the deep warps module (wd). +For example, the renting module's configuration segment is: + + //------------------------------------------------------------------------------- + //Config for the Renting Module + //------------------------------------------------------------------------------- +OnLoadRent: + set $@kert_cartOnly, 0; //Set to 1 to enable only cart rental, 0 enables all add-ons. + set $@kert_cartCost, 2000; //Cost to rent a Cart. + set $@kert_falconCost, 2000; //Cost to rent a Falcon. + set $@kert_pecoCost, 2000; //Cost to rent a PecoPeco. + end; + +Variables are usually of two types: Exact value based or Percentage based. +Exact value variables are often price for different services, while the +percentage based are things like 30% discount when using Kafra Passes. +Percentage values are expressed per-hundredth (that is, 10 = 10%, 100 = 100%) +unless otherwise specified. + +Each variable has a small description next to it, hence the need of this +document. In this document the variable type is identified next to it by: (1) +when it's boolean, (%) when it's a percentage, ($) when it's a price, (#) for +numbers and (") for strings. + +//////////////////////////////////////////////////////////////////////////////// +[02] Module: Main Core (ke_main.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +This module offers the core functionality of the Kafra Express. Contains the +main menu and handles the Kafra Pass Reserve Points system. + +Variables +================================================================================ + +(1) ke_saveOnSpot +----------------- +When 1, a character's respawn point is saved exactly where they are standing. +otherwise, the respawn point is specified by the kafra definition (see Section +18). + +($) keh_hpCost +($) keh_spCost +-------------- +The cost of healing sp per every 10 sp. For example, if the cost is 1, it +costs 100z to heal 1000. + +($) kes_cost +($) kegs_cost +------------- +The cost of using the storage, guild storage (respectively) + +(1) kekp_reset +-------------- +For Kafra Passes. When 1, the Pass expires when starting a chat with the +Kafra. Otherwise the variable remains active a pretty long time (probably all +session). + +($) kekp_reserveCost +-------------------- +The cost in zeny of reserve points. When using a Kafra Pass many services will +be cheaper, the amount of zeny saved is "used" to grant the player reserve +points. For example, if the reserve cost is 100, for every 100z the player +saves, he'll earn 1 reserve points. Reserve points can be used in scripts, and +by default is used in the Al De Baran Kafra Headquarters to gain items. Use a +value of 0 to disable Reserve Point gaining. + +(#) kekp_minReserve +(#) kekp_maxReserve +--------------- +What is the minimum/maximum reserve points the player can gain when using a +Kafra Pass per transaction? This only applies when the player has saved at +least 1z. + +(") ked_users +------------- +Certain modules (in particular, the warping ones) have the ability to display +the number of players related to the function (ie: number of users in a +dungeon), in such cases this variable is used to display the 'unit' of said +count. For example, if ked_users is "kids" then the related modules might +display things like "- Glast Heim (6 kids)". + +//////////////////////////////////////////////////////////////////////////////// +[03] Module: Bank (ke_bank.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +This modules enables characters to "store" zeny on a virtual bank account +which is shared among characters of the same account. There can be deposits, +withdrawals, which can have transactions fees associated. + +It is also possible to establish a monthly maintenance fee that has to be +payed, when the player does not has enough money in the account to pay this +fee, they stop gaining interests until they deposit enough to pay it up. +Finally, all fees charged by the bank can be stored in a server-wide variable +which may be used by other custom scripts. + +Variables +================================================================================ + +(%) kebk_depositCost +(%) kebk_withdrawCost +--------------------- +The Fee in % charged whenever a player does a deposit/withdrawal. For example, +when a player deposits 100z and the fee is 3%, only 97z are deposited, and 3z +are charged. Likewise, if a player withdraws 100z when the fee is of 5%, +they'll withdraw 100z and an additional 5z will be removed from their accounts +as fee cost. + +($) kebk_minTransact +($) kebk_maxTransact +-------------------- +The minimum/maximum values of a single transaction (deposit or withdrawal) + +($) kebk_capacity +----------------- +Indicates what is the bank account capacity for players. That is, what is the +maximum zeny their account can hold. You can't deposit anymore once the max +has been reached, and daily interests are lost while maxed. + +(%) kebk_dayInterest +-------------------- +The daily interests that the account makes. The value is in 0.01% units, so a +value of 100 equals 1% daily interests. + +($) kebk_monMaintenance +----------------------- +Monthly flat fee charged for maintenance. + +(1) kebk_useGlobalBank +---------------------- +When 1, every fee charged from the player goes into a server variable +($ke_globalbank), which can then be used by other scripts. is 0 by default +because none of the Kafra Express modules uses it. + +//////////////////////////////////////////////////////////////////////////////// +[04] Module: Broadcast (ke_broadcast.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Provides broadcasting services for players. Broadcasts can be local (current +map only) or global (server announce), there are also four types of broadcast: +Requests for a party, PvP Challenge invitations, General Broadcasts (player +input the string they want to say) and General Anonymous Broadcasts (player +name is not displayed when doing the broadcast). + +Note that the variables from ke_warp_pvp.txt will be used for auto-configuring +the pvp broadcasts. + +Variables: +================================================================================ + +(1) kebc_showOnline +------------------- +When 1, the total count of players will be displayed in the menu (map users +next to the local broadcast entry, server users next to the global broadcast +entry). + +($) kebc_partyCost +($) kebc_pvpCost +($) kebc_cost +($) kebc_anonCost +------------------ +Respective base costs for doing Party-Requests/Pvp Challenge/General/Anonymous +broadcasts. + +(%) kebc_globalFactor +--------------------- +When the broadcast is global, the base cost is multipled by this factor. If +the factor is 500, then global broadcasts cost 5x times the cost of the map's +broadcast. + +(%) kebc_discount +----------------- +Discount on broadcast prices when the Kafra Pass is active. + +//////////////////////////////////////////////////////////////////////////////// +[05] Module: Stylist (ke_dye.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Offers cloth dye, hair dye and hair style changes, both by input and by wheel +browsing. Does not consumes dyestuffs because it is designed for custom dye +packages. + +Variables +================================================================================ + +(1) kedy_enableHairstyle +------------------------ +If one, the menu will include hair-style changing options, otherwise only +dye-changes are offered + +(#) kedy_styles +--------------- +Specifies the number of available hair styles + +(#) kedy_hair +------------- +Specificies the number of hair dyes + +(#) kedy_clothJN +(#) kedy_clothJ1ST +(#) kedy_clothJ2ND +(#) kedy_clothJSN +(#) kedy_clothJWED +------------------ +Specifies the number of cloth dyes based on job-type: Novices, First Classes, +Second Classes, Super Novices, Wedding Class. + +//////////////////////////////////////////////////////////////////////////////// +[06] Module: Job Changer (ke_jobchange.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Offers job changing, including rebirth and baby classes. The rebirth system +can allow people free changing through a different path, or forcing the +correct path. Zeny can be charged/granted as well as weapons on job-change. +Remaining Skill Points can be wiped, ignored or prevent the change from +happening. Before changing players can review the consequences of doing so, +including weapons to gain. + +Finally, there's an option that makes it possible to skip the novice class +altogether and change directly to first jobs. + +Variables +================================================================================ + +(#) kejc_skillsPolicy +--------------------- +Determines what to do with remaining skill points upon change: + 0: No job changing until points are used. + 1: Extra Skill Points are wiped. + 2: Extra skill points are conserved. + +(#) kejc_upperPolicy +-------------------- +What to do about the advanced classes? + 0: Free for all, players can pick any advanced job regardless of the previous. + 1: Force mode, classes are auto-selected from the previous path. In the + case the path could not be determined (players changed jobs previously + using other npcs), players will be able to select their next job. + +(1) kejc_announce +----------------- +When 1, a global announce will be done upon change. + +(1) kejc_resetDye +----------------- +If one, the cloth dye is reset upon changing. + +(1) kejc_skipNovice +------------------- +If one, players can skip the novice class and directly into their first job. +Exploit proof, skills are wiped when changing to a 1st class this way, and +their basic skill level is set to 9. + +(#) kejc_baseSN +--------------- +Base Level required before changing into a Super Novice. + +(#) kejc_base2ND +(#) kejc_job2ND +(#) kejc_cost2ND +---------------- +Base level, Job level and zeny required to change into a second job. If the +cost is below zero, zeny will be given to the player instead of charged. + +(#) kejc_baseRebirth +(#) kejc_jobRebirth +(#) kejc_costRebirth +-------------------- +Base level, Job level and zeny required before doing a rebirth (change to High +Novice). + +(1) kejc_rebirthReset +--------------------- +If 1, when changing into a HighNovice characters will have their level reset +to 1 (with the additional 100 stat points) + +(1) kejc_weaponPolicy +--------------------- +If 1, characters will get a weapon upon job change. For each first&second +class there are two weapons to specify, the standard weapon and the "premium" +one. + +(#) kejc_wBonusLv +----------------- +When characters reach this job level, they will receive the premium weapon instead of the normal one. If 0, premium weapons are disabled. + +(#) kejc_wAcolyte +(#) kejc_wArcher +(#) kejc_wMage +(#) kejc_wMerchant +(#) kejc_wSwordman +(#) kejc_wThief +(#) kejc_wSuperNovice +(#) kejc_wPriest +(#) kejc_wMonk +(#) kejc_wHunter +(#) kejc_wBard +(#) kejc_wDancer +(#) kejc_wWizard +(#) kejc_wSage +(#) kejc_wBlacksmith +(#) kejc_wAlchemist +(#) kejc_wKnight +(#) kejc_wCrusader +(#) kejc_wAssassin +(#) kejc_wRogue +----------------------- +ID of the normal weapons received upon job change (if weapon policy is in +effect). + +(#) kejc_w2Priest +(#) kejc_w2Monk +(#) kejc_w2Hunter +(#) kejc_w2Bard +(#) kejc_w2Dancer +(#) kejc_w2Wizard +(#) kejc_w2Sage +(#) kejc_w2Blacksmith +(#) kejc_w2Alchemist +(#) kejc_w2Knight +(#) kejc_w2Crusader +(#) kejc_w2Assassin +(#) kejc_w2Rogue +-------------------- +ID of the premium weapons received upon job chane (if bonus weapon policy is +in effect). Note that first classes can't get a bonus weapon. + +//////////////////////////////////////////////////////////////////////////////// +[07] Module: Job Swapper (ke_jobswap.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Permits characters to change jobs among other jobs of their same "level". +This is, between first classes or between second classes. It is also possible +to store the last job used and revert to it at a later date. Dye, Job Level +and Skill Point count is saved, however the skill-tree is not saved and skills +need be reallocated. When reverting to the previous class, characters might be +able to return from an adv class to a normal one, but if they are baby +classes, they can't change back to a normal one. + +Variables +================================================================================ + +(1) kejs_SNpolicy +----------------- +Determines what to do with Super Novices. if 0, they can't swap jobs, if 1, +they are considered first classes. + +(#) kejs_revertPolicy +--------------------- +Determines if Reverting classes is possible and when: + 0: Cannot go back to the previous job. + 1: Can only go back if the previous job belongs to the same type as the + first (is also a 1st/2nd job and is the same normal/adv/baby category). + 2: Can return to the previous job regardless (exception: when one of the + two jobs is a baby job and the other is not). + +(1) kejs_announce +----------------- +If 1 does a server announce when swapping jobs. + +($) kejs_revertCost +------------------- +Cost of changing to the previous job. + +(1) kejs_saveDye +---------------- +If one, the dye is saved when swapping and restored upon revert. + +(1) kejs_resetDye +----------------- +If 1 the clothe dye is reset upon swap. + +(%) kejs_swapDiscount +(%) kejs_revertDiscount +----------------------- +Discount % to apply when the kafra pass is active for swapping/reverting. + +(#) kejs_job1ST +(#) kejs_job2ND +--------------- +Minimum job level before being able to swap among 1st/2nd classes. + +($) kejs_cost1ST +($) kejs_cost2ND +---------------- +Base cost of swaping jobs. + +(%) kejs_discount1ST +(%) kejs_discount2ND +-------------------- +Discount % to apply to the base cost for every job level above the minimum +required. For example, if the discount is 1% per level and you change when you +have +10 level more than the min necessary, you get a 10% discount. + +(%) kejs_preserve1ST +(%) kejs_preserve2ND +-------------------- +Indicates how much of the previous job level to preserve when changing. For +example, if the preserve value is 50 (50%) and you change from a level 40 +Knight into Priest, you'll become a lv 20 Priest. Skill points are adjusted +accordingly so it's exploit-free. + +//////////////////////////////////////////////////////////////////////////////// +[08] Module: Smithery (ke_refine.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Offers the services usually found in the town smithery and then some more: +Item refining, Item Repairing, Ore Purification (rough oris -> pure ones). +Also sells Phracon and Emveretarcon. + +Item refining can follow all the rules of normal refining, but it can also +override them to refine everything, or safe refines up to max level. + +Ore Purification can be extended to include all the rough materials that +blacksmiths can purify (star dust -> star crumbs, for example). + +Variables +================================================================================ + +(#) kerf_maxLv +-------------- +Maximum refinement level of equipment. + +(1) kerf_safe +------------- +If 1 success chances are ignoring and refining never fails. + +(1) kerf_showChance +------------------- +If 1 the chance of success/failure is actually shown before confirming. + +(1) kerf_refineAll +------------------ +If 1 then unrefinable items will be refined too (like accesories) + +(%) kerf_discount +----------------- +Discount rate to be applied during forging when the Kafra Pass is active. + +($) kerf_armorCost +($) kerf_weaponLv1Cost +($) kerf_weaponLv2Cost +($) kerf_weaponLv3Cost +($) kerf_weaponLv4Cost +---------------------- +Cost per level to refine armors, and level 1/2/3/4 weapons. + +(1) kerf_purifyAll +------------------ +If 1, the extended purify menu will be used, which shows how to purify steels, +star crumbs, etc; otherwise, just elus and oris are available. + +($) kerf_repairCost +------------------- +Cost of repairing a broken weapon. + +(%) kerf_repairDiscount +----------------------- +Repair Discount% when the kafra pass is active. + +(1) kerf_repairSteel +-------------------- +If 1, a steel will be required to repair items. + +//////////////////////////////////////////////////////////////////////////////// +[09] Module: Renting (ke_refine.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Allows renting of Cart/Falcon/PecoPeco. Note that the only restriction applied +is whether the character has "PushCart", "Falcon Taming" or "PecoPeco Riding", +it does not checks for the character's class. + +It must also be noted that renting is free while the Kafra Pass is active. + +Variables +================================================================================ + +(1) kert_cartOnly +----------------- +If 1, this module only offers cart rentals. Otherwise you can rent any of the three. + +($) kert_cartCost +($) kert_falconCost +($) kert_pecoCost +------------------- +Cost for renting carts/falcons/pecos. + +//////////////////////////////////////////////////////////////////////////////// +[10] Module: Kafra Shop (ke_shop.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Allows invoking of a shop from the Kafra. Note that the shops must be of +invisible type (ke_shop.txt has an example of two such shops). The config +enables you to select whether the shop will allow buying, selling or +both, as well as the name of the shops to use in towns or dungeons (if you +want to use a custom shop defined elsewhere or want to use the same shop for +both). + +Variables +================================================================================ + +(#) $@kesh_towntype +(#) $@kesh_duntype +------------------- +Specifies the type of transaction allowed at the shop. Use 1 to enable only +buying of items, 2 for only selling, or any other value for both. + +(#) $@kesh_townshop$ +(#) $@kesh_dunshop$ +-------------------- +Specifies the name of the shop to use for buying/selling of items. By default +the file includes two such shops which you can use, or you can disable them +and specify your own in the config changing these variables. + +//////////////////////////////////////////////////////////////////////////////// +[11] Module: Stat/Skill Market (ke_statmarket.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Not really a "market", this module lets players sell and buy stat/skill +points. Also allows for direct trading between stats/skills. + +NOTE: Selling stat points can lead to zeny exploits if your server uses the +stat_db.txt file, because players can then sell all their stat points, do a +reset and get them back! To prevent this, set the following battle config +option: + use_statpoint_table: no +Alternatively, you can set the selling point of statpoints to be 0z. + +Variables +================================================================================ + +($) kesm_stBuyPrice +($) kesm_stSellPrice +-------------------- +Price for every stat point to be bought/sold. + +($) kesm_skBuyPrice +($) kesm_skSellPrice +-------------------- +Price for every skill point to be bought/sold. + +(%) kesm_discount +----------------- +Discount price when kafra pass is active. Only applies to buying stats/skills. + +(#) kesm_skTradePrice +(#) kesm_stTradePrice +--------------------- +These two define how many stat points are traded per each skill point when +doing a direct conversion between stats/skills. The idea is that trading +directly one for the other should be cheaper than selling them and then buying +from the other. You can set both to the same value and the trading will have +no loss. +Notice that skTradePrice is the cost for converting stats to skills and +stTradePrice is the cost for converting skills to stats. So... NEVER set +stTradePrice higher than skTradePrice or you allow an easy exploit of infinite +stats/skills! + +//////////////////////////////////////////////////////////////////////////////// +[11] Module: Stat/Skill Resets/Raising (ke_stats.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Does stat/skills resets, and additionally helps characters raise their basic +stats faster. Optionally, skill resets will not touch the basic-skill level. +Price have two components: base fee and per level fee, so characters with +higher levels will have to pay more for a reset than low level ones. +For stat resetting, base level is taken into account. For skill resets, job +levels. For a dual reset, the addition of both is considered. Also, when taken +into consideration job level for second classes, the job-level at which one +changed jobs is also considered. So a Job level 1 Knight actually has job +level of 41~51. + +NOTE: Be careful with quest skills. If your server is configured to reset +quest skills and players can get their quest skills for free, you are letting +them exploit the system and get unlimited skill points! (even worse if they +can sell'em in the Stat/Skills market module). Be sure to either remove free +quest skills npcs or make quest skills not resetable. + +Variables: +================================================================================ + +($) kest_stResetCost +-------------------- +Base cost of doing a stat reset. + +($) kest_skResetCost +-------------------- +Base cost of doing a skill reset. + +($) kest_resetCost +------------------ +Base cost of a dual reset. + +($) kest_BaseLvCost +------------------- +Cost per Base level for doing a stat reset. + +($) kest_JobLvCost +------------------ +Cost per Job level for doing a skill reset. + +($) kest_BothLvCost +------------------- +Cost per Base+Job level for doing a dual reset. + +(%) kest_discount +----------------- +Discount % applied when Kafra Pass is active. + +(1) kest_resetBasic +------------------- +If 1, the skill "basic skill" is also reset. + +//////////////////////////////////////////////////////////////////////////////// +[12] Module: Uncarding (ke_uncard.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +This module allows people to remove cards from their equipped items. Prices +are modified by the item type, the amount of cards and the refine level of the +item. There's also a chance the removal will fail and: Nothing is lost, the +card or item is lost, both are lost. The procedure may also require up to two +different items (and each one with their own specified qty). + +Variables: +================================================================================ + +($) keuc_BaseCost +----------------- +Base cost of uncarding, modified by the following conditions: + +($) keuc_CardCost +----------------- +Each card to be removed increases the total by this value. + +($) keuc_UpgradeCostA +($) keuc_UpgradeCostW1 +($) keuc_UpgradeCostW2 +($) keuc_UpgradeCostW3 +($) keuc_UpgradeCostW4 +---------------------- +These indicate the price increase per refine level for armors and weapons +levels 1/2/3/4. A +10 armor gets a price increases of ten times +keuc_UpgradeCostA. + +(%) keuc_discount +----------------- +Discount % to apply when kafra pass is active. + +(#) keuc_Mat1 +(#) keuc_Qty1 +------------- +Id and Qty of the first material that is needed to uncard. If the qty is zero, +then it's disabled. + +(#) keuc_Mat2 +(#) keuc_Qty2 +------------- +id & Qty of the second material to use. Only valid if the first material was +also defined, use qty=0 to disable. + +(%) keuc_Fail0Chance +-------------------- +This is the safe failure chance (0-1000, where 1000 = 100.0%). A Safe failure +means the original item remains intact, but you are still charged the money +and the materials. Use 0 to disable this type of failure. + +(%) keuc_Fail1Chance +-------------------- +This is the partial failure chance (0-1000). Partial failures are when either +the cards or the item is lost. The player gets to choose which one is more +important before proceeding. Use 0 to disable. + +(%) keuc_Fail2Chance +-------------------- +Total failure chance (0-1000). When this triggers, both item and cards are +lost. Use 0 to disable. + +//////////////////////////////////////////////////////////////////////////////// +[14] Module: Town Warping (ke_warp_town.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +This module enables warping to towns. Currently all towns have the same +warping cost, independent of how far away they are placed. The only exception +is Niflheim, which is more of a dungeon than a town. + +Variables +================================================================================ + +(1) kewt_showOnline +------------------- +If set to 1, the menus will display the online count of players in +towns. + +($) kewt_cost +------------- +Cost of warping to a town. + +($) kewt_niflCost +----------------- +Cost of warping to Niflheim. Different cost since Niflheim is more of a +dungeon than a city. Also, players can't warp to Niflheim until they do the +Niflheim Piano Key Quest. + +(#) kewt_travel +--------------- +Allows enabling the traveller system. The traveller system makes it so you can't +warp to a town until you have been there first by some other means (usually +walking) and saved with the Kafra Express in that town. +There are three valid values for this variable: 0, 1, 2. +0 - Disables this mode. +1 - Uses the mode on a per character basis; that is, each character needs to +travel to that town and save and that unlocks warping only for that +character. +2 - Uses the mode on a per account basis; that is, once a character has saved +on a town, all other (and future) characters from the same account have the +warp unlocked. + +(1) kewt_free +------------- +If 1, players will be able to warp to towns even if they run out of money. +Niflheim excepted. + +(%) kewt_discount +----------------- +Discount % to apply when warping while the Kafra Pass is active. + +//////////////////////////////////////////////////////////////////////////////// +[15] Module: Dungeon Warping (ke_warp_dungeon.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +Offers warps to all dungeons. Dungeon warping has two main operation modes: +Deep Dungeon Warping and Short Dungeon Warping. Deep Dungeon warping enables +players to warp to any level of any dungeon, while Short Dungeon Warping is +restricted to warping only to the entrance of the dungeon. Traveller's mode is +also available for dungeons. + +Variables +================================================================================ + +(1) kewd_showOnline +------------------- +If set to 1, the menus will display the online online count of characters in +the dungeons. + +(%) kewd_discount +----------------- +Discount % to apply when warping while the Kafra Pass is active. + +(#) kewd_travel +--------------- +Enables the traveller system. Just like the traveller's system for towns, +you can't warp to any dungeon to which you have not visited first on foot and +saved with the corresponding Kafra Express first. +If 1, traveller's mode is enabled on a per character basis (so once a +character saves, only that character has unlocked the warp). +If 2, traveller's mode is enabled on a per account basis (so once a character +saves, all charaters of the corresponding account have the warp unlocked). + +(1) kewd_deep +------------- +This variable decides whether deep or short warps will be used. There's no +need to set it as it will be set automatically based on which file was +included (ke_warp_short.txt or ke_warp_deep.txt). + +(%) kewd_levelCost +------------------ +This variable only applies to deep warps. It indicates in percentage the cost +increase per level. For example, if the dungeon costs 1000z to warp to, and +the levelCost increase is of 50 (50%) then warping to level 2 costs 1500, lv3 +costs 2000, and so on. + +(%) kewd_entryDiscount +---------------------- +The discount for using the Kafra in the dungeon entrance to warp within the +dungeon. For example, if you use the Kafra next to Payon dungeon to warp to +Payon Dungeon lv5, this discount is then applied. This variable only makes +sense on deep warp mode. + +(1) kewd_turtleCave +------------------- +Only used on short warps. If 1, then warping to Turtle Dungeon should lead +directly to the cave's entrance, otherwise it warps you to the Island's +entrance. + +($) kewd_amatsu +($) kewd_antHell +($) kewd_ayothaya +($) kewd_byalan +($) kewd_comodo +($) kewd_clockTower +($) kewd_coalMines +($) kewd_culvert +($) kewd_gefenia +($) kewd_geffen +($) kewd_glastHeim +($) kewd_gonRyun +($) kewd_hiddenTemple +($) kewd_louYang +($) kewd_magma +($) kewd_orc +($) kewd_payon +($) kewd_pyramids +($) kewd_sphinx +($) kewd_sunkenShip +($) kewd_toyFactory +($) kewd_turtleIsland +($) kewd_umbala +--------------------- +Base cost of warping to each dungeon, that is, the entrance level cost. + +//////////////////////////////////////////////////////////////////////////////// +[16] Module: PvP Warping (ke_pvp.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +The PvP warping module leads to the pvp maps named pvp_n_*-*.gat. It has two +modes: simple and advanced. On simple mode, every player of every level gets +thrown into the pvp_n_1-*.gat maps to nuke it out, on advanced mode each of +the map groups gets their own range of permissible levels to enter. Since +there is no sure way how characters should escape from a pvp map, they are +currently given a butterfly wing when they warp. + +Variables +================================================================================ + +(1) kewp_showOnline +------------------- +If 1, the menu entries will display the online count of players of each entry. + +(1) kewp_advanced +----------------- +Use the advanced pvp system if 1 (see module description) + +($) kewp_cost +------------- +Cost of warping to the pvp rooms used in non-advanced rooms and "free for all" +in advanced mode. + +($) kewp_cost1 +($) kewp_cost2 +($) kewp_cost3 +($) kewp_cost4 +($) kewp_cost5 +($) kewp_cost6 +($) kewp_cost7 +-------------- +The costs for each of the pvp room groups in advanced mode. + +(#) kewp_baseLv1 +(#) kewp_baseLv2 +(#) kewp_baseLv3 +(#) kewp_baseLv4 +(#) kewp_baseLv5 +(#) kewp_baseLv6 +(#) kewp_baseLv7 +---------------- +These indicate the nominal base level for each room (which base level should +characters be around to join it). Applicable only to advanced mode. + +(#) kewp_range +-------------- +Specifies how far away the character's level can be from the nominal value to +still be allowed within the room. If the nominal level is 50 and the range is +3, only characters with levels 47-53 may join. + +//////////////////////////////////////////////////////////////////////////////// +[17] Module: WoE Warps (warp_woe.txt) +//////////////////////////////////////////////////////////////////////////////// + +Description +================================================================================ +This module allows characters to warp into the WoE grounds during (or out of) +War of Emperium times. Players may warp directly into the Guild Dungeons if +the proper lines are uncommented on the warp menu (See warp_woe.txt's header +for the location of the menu entries): + + menu "- Cancel",-, +// "- Guild Dungeons",M_DUNGEON, + "- Al De Baran Guild ("<some code>"z)",L_ALDEBARAN, + "- Geffen Guild ("<some code>"z)",L_GEFFEN, + "- Payon Guild ("<some code>"z)",L_PAYON, + "- Prontera Guild ("<some code>"z)",L_PRONTERA; + return; + +Variables +================================================================================ + +(1) kewg_check +-------------- +Does a guild check. If 1, only characters who belong to a guild can use these +warps. + +(1) kewg_checkAgit +------------------ +Does the WoE times check. If 1, only during War of Emperium the warps will be +active. + +(1) kewg_showOnline +------------------- +Set to 1 to display in the menus the online count of players in each of the +guild areas. It also adds a menu entry that displays the summary of players +within each castle and guild grounds. + +(%) kewg_discount +----------------- +Discount % to be applied for warps while the Kafra Pass is active. + +($) kewg_baldur +($) kewg_luina +($) kewg_valkyrie +($) kewg_britoniah +------------------ +Costs to the respective guild dungeons when enabled. + +($) kewg_alDeBaran +($) kewg_geffen +($) kewg_payon +($) kewg_prontera +------------------ +Costs to each of the guild grounds. + +//////////////////////////////////////////////////////////////////////////////// +[18] The kafras.txt file: About Kafra Definitions +//////////////////////////////////////////////////////////////////////////////// + +The file kafras.txt contains the definition of the Kafras, which is the actual +sprite on-screen that characters speak with. An enabled kafra may look like +this: + +//Alberta +alberta.gat,113,53,7 script Kafra Express 116,{ + callfunc "F_KafraExpress","Kafra Express","kafra_02",0,"alberta.gat",116,57; +} + +And a disabled/commented Kafra would look like this: + +//Prontera Guild Grounds +//prt_gld.gat,127,163,5 script Kafra Express 115,{ +// callfunc "F_KafraExpress","Kafra Express","kafra_03",1,"prt_gld.gat",129,170; +//} + +For scripters, the way to define an NPC is not new, and beyond the scope of +this document, so I'll only document the function "F_KafraExpress": + +F_KafraExpress (String "Kafra's name", String "kafra image file", int location, String map, int x, int save y) + +The first parameter, the Kafra's name, is the name that will be displayed all +over the dialogue windows. The Kafra Image file is the image that is to be +displayed on the screen during the npc chat (without the extension). You can +use "" to disable the image. + +Location refers to the type of Kafra. Type=0 refers to Kafras in towns while +Type=1 refers to Kafras placed in the wild, ie: in dungeons. Type=2 is for +Kafras that should count as both town & dungeon. Under these situations, the +menus displayed are those of the town, the type is used for the traveller's +warping mode. Finally, Type=3 is a special type used only for the Niflheim +Kafra. + +The last three Parameters are used to define the save location when you save +your respawn. They are not needed if you use the "Save-on-spot" feature, but +it's recommended to pass them nevertheless. Note that the map name will still +be used when using traveller's mode. diff --git a/npc/custom/eAAC_Scripts/messageboards.txt b/npc/custom/eAAC_Scripts/messageboards.txt index 73f77ca1f..331e42385 100644 --- a/npc/custom/eAAC_Scripts/messageboards.txt +++ b/npc/custom/eAAC_Scripts/messageboards.txt @@ -1,421 +1,421 @@ -geffen.gat,122,102,4 script Message Man 774,{
-mes "[Robert]";
-mes "Hello, I am here to serve you. Enjoy my service. ^_-";
-next;
-mes "[Robert]";
-mes "Please keep in mind, that all messages are wiped once every two days";
-mes "-Msg From Creator- In new version this will be set able, look forward to this! -End Msg From Creator-";
-next;
-L_Menu01:
-mes "[Robert]";
-mes "What would you like to do??";
-next;
-if((getgmlevel(0) >= 90)) menu "Public board",L_pubgmmenu,"Gm Board",L_gmmenu,"Close Public Board",L_clospub,"Open Public Board",L_openpub;
-if(($messagepubclose == 1)) goto L_pubclosed;
-menu "Read messages!",L_readmsg,"Post a message!",L_Postmsg,"Leave",L_leave;
-L_pubgmmenu:
-if(($messagepubclose == 1)) goto L_pubclosed;
-menu "Re-set the rotation",L_setrot,"Reset Message",L_Clearmsgs,"Read messages!",L_readmsg,"Post a message!",L_Postmsg,"Leave",L_leave;
-L_gmmenu:
-menu "Read messages!",L_gmboardread,"Post a Message!",L_gmboardpost,"Reset Messages",L_gmboardreset;
-
-L_openpub:
-mes "[Robert]";
-mes "Are you sure?";
-menu "Yes",-,"No",L_openpubn;
-mes "[Robert]";
-mes "It is done.";
-close2;
-set $messagepubclose,0;
-end;
-
-L_openpubn:
-mes "[Robert]";
-mes "Very well it shall remain closed.";
-close;
-
-L_pubclosed:
-mes "[Robert]";
-mes "Im sorry. The public boards are currently Closed.";
-close;
-
-L_clospub:
-mes "[Robert]";
-mes "Are you sure?";
-next;
-menu "Yes.",-,"No",L_closepubn;
-mes "[Robert]";
-mes "Very well I will not allow anyone into the public board.";
-close2;
-set $messagepubclose,1;
-end;
-
-L_closepubn:
-mes "[Robert]";
-mes "Have a nice day";
-close;
-
-L_gmboardreset:
-mes "[Robert]";
-mes "This will require atleast 2 GM's approval to reset the gm board.";
-mes "-Msg From Creator- This is bugged same gm can vote twice. Planned to revise in next version. -End Msg From Creator-";
-next;
-menu "Vote for reset.",L_gmboardresetvote,"Back to main.",L_Menu01,"Leave.",L_leave;
-
-L_gmboardresetvote:
-callfunc "F_gmresetcheck";
-set @tempid,getcharid(0);
-set $gmboardresetvotenumb,$gmboardresetvotenumb+1;
-set $gmboardresetvoted[$gmboardresetvotenumb],1;
-set $gmboardresetvoteid[$gmboardresetvotenumb],@tempid;
-set @tempid,0;
-set $gmboardreset,$gmboardreset-1;
-mes "[Robert]";
-mes "Thank you.";
-next;
-if(($gmboardreset == 0)) goto L_gmresetdone;
-if(($gmboardreset >= 1)) goto L_gmresetnotdone;
-close;
-
-L_gmresetdone:
-deletearray $gmmessageboardpost$[1],$gmmessageboardpostnumber;
-deletearray $gmmessageboardpostdate$[1],$gmmessageboardpostnumber;
-deletearray $gmmessageboardpostname$[1],$gmmessageboardpostnumber;
-deletearray $gmmessageboardeditdate$[1],$gmmessageboardpostnumber;
-deletearray $gmboardresetvoted[1],$gmboardresetvotenumber;
-deletearray $gmboardresetvoted[1],$gmboardresetvotenumber;
-deletearray $gmboardresetvoteid[1],$gmboardresetvotenumber;
-set $gmboardresetvotenumber,0;
-set $gmboardreset,2;
-mes "[Robert]";
-mes "The reset has been done.";
-close;
-
-L_gmresetnotdone:
-mes "[Robert]";
-mes "There needs to be "+$gmboardreset+" more gm(s) approval to do the reset.";
-close;
-
-L_gmboardread:
-if(($gmmessageboardpostnumber == 0)) goto L_msgno;
-callfunc "F_gmmessage";
-end;
-
-L_gmboardpost:
-if(($gmmessageboardpostnumber >= 127)) goto L_postmsgyestm;
-set @gmmessageboardpostername$,strcharinfo(0);
-set @gmmessageboarddate$,gettimestr("%Y-%m/%d %H:%M:%S",21);
-set $gmmessageboardpostnumber,$gmmessageboardpostnumber+1;
-input @gmmsgboardmsgt$;
-set $gmmessageboardpost$[$gmmessageboardpostnumber],@gmmsgboardmsgt$;
-set $gmmessageboardpostdate$[$gmmessageboardpostnumber],@gmmessageboarddate$;
-set $gmmessageboardpostname$[$gmmessageboardpostnumber],@gmmessageboardpostername$;
-mes "[Robert]";
-mes "Here is what your message looks like";
-next;
-mes "Posted by: "+$gmmessageboardpostname$[$gmmessageboardpostnumber]+".";
-mes "On: "+$gmmessageboardpostdate$[$gmmessageboardpostnumber]+".";
-mes $gmmessageboardpost$[$gmmessageboardpostnumber];
-close;
-
-
-L_setrot:
-set $@determinedayrotation,gettime(4); //this determines the day rotation for clearing messages.
-if(($@determinedayrotation == 0)) set $rotation,0;
-if(($@determinedayrotation == 1)) set $rotation,1;
-if(($@determinedayrotation == 2)) set $rotation,0;
-if(($@determinedayrotation == 3)) set $rotation,1;
-if(($@determinedayrotation == 4)) set $rotation,0;
-if(($@determinedayrotation == 5)) set $rotation,1;
-if(($@determinedayrotation == 6)) set $rotation,0;
-mes "It is done.";
-close;
-
-L_Clearmsgs:
-mes "[Robert]";
-mes "Are you sure?";
-next;
-menu "Yes",L_clearmsgsy,"No thanks.",L_Menu01;
-
-L_clearmsgsy:
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $messageboardeditdate$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-mes "[Robert]";
-mes "It is done.";
-close;
-
-L_leave:
-close;
-
-L_Postmsg:
-mes "[Robert]";
-mes "What do you want to say in your message?";
-next;
-set @msgboardmsgt$,0;
-input @msgboardmsgt$;
-mes "[Robert]";
-mes "are you sure this is the message you want?";
-mes @msgboardmsgt$;
-next;
-menu "Yes!",L_postmsgyes,"No let me re-do it!",L_Postmsg,"Ive changed my mind let me leave.",lleave;
-
-L_postmsgyes:
-if(($messageboardpostnumber >= 127)) goto L_postmsgyestm;
-set @messageboardpostername$,strcharinfo(0);
-set @messageboarddate$,gettimestr("%Y-%m/%d %H:%M:%S",21);
-set $messageboardpostnumber,$messageboardpostnumber+1;
-set @mymessage2,$messageboardpostnumber;
-set $mymessage[$messageboardpostnumber],5;
-set $messageboardpost$[$messageboardpostnumber],@msgboardmsgt$;
-set $messageboardpostdate$[$messageboardpostnumber],@messageboarddate$;
-set $messageboardpostname$[$messageboardpostnumber],@messageboardpostername$;
-mes "[Robert]";
-mes "here is what your message looks like";
-next;
-mes "Posted by: "+$messageboardpostname$[$messageboardpostnumber]+".";
-mes "On: "+$messageboardpostdate$[$messageboardpostnumber]+".";
-mes $messageboardpost$[$messageboardpostnumber];
-close;
-
-L_postmsgyestm:
-set @mesboardmsgt$,0;
-mes "[Robert]";
-mes "Im sorry your going to have to wait till more space opens up for messages, it should be in 1 or 2 days =)";
-close;
-
-lleave:
-deletearray $messageboardpost$[@tempview],@tempview;
-deletearray $messageboardpostname$[@tempview],@tempview;
-deletearray $messageboardpostdate$[@tempview],@tempview;
-deletearray $mymessage[@tempview],@tempview;
-set $messageboardpostnumber,$messageboardpostnumber-1;
-set @msgboardmsgt$,0;
-close;
-
-L_readmsg:
-if(($messageboardpostnumber == 0)) goto L_msgno;
-callfunc "F_message";
-end;
-
-L_msgno:
-mes "[Robert]";
-mes "There are currently no messages.";
-close;
-
-OnInit:
-set $gmboardreset,2;
-set $gmboardresetvotenumb,0;
-end;
-
-OnInterIfInitOnce:
-set $@determinedayrotation,gettime(4); //this determines the day rotation for clearing messages.
-if(($@determinedayrotation == 0)) set $rotation,0;
-if(($@determinedayrotation == 1)) set $rotation,1;
-if(($@determinedayrotation == 2)) set $rotation,0;
-if(($@determinedayrotation == 3)) set $rotation,1;
-if(($@determinedayrotation == 4)) set $rotation,0;
-if(($@determinedayrotation == 5)) set $rotation,1;
-if(($@determinedayrotation == 6)) set $rotation,0;
-end;
-
-
-OnSun1200:
-if(($rotation == 1)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-end;
-
-OnSat1200:
-if(($rotation == 0)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-end;
-
-OnMon1200:
-if(($rotation == 1)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-end;
-
-OnTue1200:
-if(($rotation == 0)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-end;
-
-OnWed1200:
-if(($rotation == 1)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-end;
-
-OnThu1200:
-if(($rotation == 0)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[1],$messageboardpostnumber;
-set $messageboardpostnumber,0;
-end;
-
-OnFri1200:
-if(($rotation == 1)) end;
-deletearray $messageboardpost$[1],$messageboardpostnumber;
-deletearray $messageboardpostdate$[1],$messageboardpostnumber;
-deletearray $messageboardpostname$[1],$messageboardpostnumber;
-deletearray $mymessage[@tempview],@tempview;
-set $messageboardpostnumber,0;
-end;
-}
-
-function script F_gmresetcheck {
-set @tempcheck,0;
-L_top:
-set @tempcheck,@tempcheck+1;
-if(($gmboardresetvoted[@tempview] == 1)) goto L_votecheck;
-if(($gmboardresetvoted[@tempview] == 0)) return;
-goto L_top;
-end;
-
-L_votecheck:
-set @tempcheckid,0;
-set @tempcheckid,getcharid(0);
-if(($gmboardresetvoteid[@tempview] != @tempcheckid)) goto L_top;
-if(($gmboardresetvoteid[@tempview] == @tempcheckid)) goto L_voted;
-end;
-}
-
-function script F_gmmessage {
-set @tempview,0;
-L_top:
-set @tempview,@tempview+1;
-mes "Posted By: "+$gmmessageboardpostname$[@tempview]+".";
-mes "On: "+$gmmessageboardpostdate$[@tempview]+".";
-mes $gmmessageboardpost$[@tempview]+".";
-menu "Next Message",L_top2;
-
-L_top2:
-if(($gmmessageboardpostnumber > @tempview)) goto L_top;
-close;
-}
-
-function script F_message {
-set @tempview,0;
-L_top:
-set @tempview,@tempview+1;
-mes "Posted By: "+$messageboardpostname$[@tempview]+".";
-mes "On: "+$messageboardpostdate$[@tempview]+".";
-mes $messageboardpost$[@tempview]+".";
-next;
-if(($mymessage[@tempview] == 5) && (getgmlevel(99)>0)) menu "Next Message",L_top2,"Delete My Message",L_delmy,"Edit my message",L_editmy,"Delete This message",L_Del;
-if((getgmlevel(99)>0)) menu "Next Message",L_top2,"Delete This message",L_Del;
-if(($mymessage[@tempview] == 5)) menu "Next Message",L_top2,"Delete My Message",L_delmy,"Edit my message",L_editmy;
-menu "Next message",L_top2;
-close;
-
-L_editmy:
-mes "Are you sure?";
-next;
-menu "Yes",L_editmyy,"No",L_editmyn;
-
-L_editmyy:
-mes "what do you want your new message to be?";
-next;
-mes "Current message!";
-mes $messageboardpost$[@tempview];
-set @tempeditmsg$,0;
-input @tempeditmsg$;
-next;
-mes "is this what you want?";
-mes @tempeditmsg$;
-next;
-menu "Yes!",L_editmyyy,"No.",L_editmyyn;
-
-L_editmyyy:
-deletearray $messageboardpost$[@tempview],@tempview;
-set $messageboardpost$[@tempview],@tempeditmsg$;
-mes "Here is what your new message looks like.";
-next;
-mes "Posted By: "+$messageboardpostname$[@tempview]+".";
-mes "On: "+$messageboardpostdate$[@tempview]+".";
-mes $messageboardpost$[@tempview]+".";
-close2;
-set @tempview,0;
-end;
-
-L_editmyn:
-Mes "So be it.";
-set @tempview,0;
-close;
-
-L_editmyyn:
-mes "So be it!";
-set @tempeditmsg$,0;
-set @tempview,0;
-close;
-
-L_delmy:
-mes "Are you sure...?";
-next;
-menu "Yes",L_delmyy,"No thanks.",L_delmyn;
-
-L_delmyy:
-deletearray $messageboardpost$[@tempview],@tempview;
-deletearray $messageboardpostname$[@tempview],@tempview;
-deletearray $messageboardpostdate$[@tempview],@tempview;
-deletearray $mymessage[@tempview],@tempview;
-deletearray $messageboardeditdate$[@tempview],@tempview;
-set $messageboardpostnumber,$messageboardpostnumber-1;
-set @tempview,0;
-mes "It is done.";
-close;
-
-L_delmyn:
-mes "Come back soon.";
-set @tempview,0;
-close;
-
-L_top2:
-if(($messageboardpostnumber > @tempview)) goto L_top;
-close;
-
-L_Del:
-mes "Are you sure?";
-next;
-menu "Yes",L_Dely,"No",L_Deln;
-
-L_Dely:
-deletearray $messageboardpost$[@tempview],@tempview;
-deletearray $messageboardpostname$[@tempview],@tempview;
-deletearray $messageboardpostdate$[@tempview],@tempview;
-deletearray $mymessage[@tempview],@tempview;
-deletearray $messageboardeditdate$[@tempview],@tempview;
-set $messageboardpostnumber,$messageboardpostnumber-1;
-mes "It is done.";
-set @tempview,0;
-close;
-
-L_Deln:
-mes "Come back soon!";
-set @tempview,0;
-close;
+geffen.gat,122,102,4 script Message Man 774,{ +mes "[Robert]"; +mes "Hello, I am here to serve you. Enjoy my service. ^_-"; +next; +mes "[Robert]"; +mes "Please keep in mind, that all messages are wiped once every two days"; +mes "-Msg From Creator- In new version this will be set able, look forward to this! -End Msg From Creator-"; +next; +L_Menu01: +mes "[Robert]"; +mes "What would you like to do??"; +next; +if((getgmlevel(0) >= 90)) menu "Public board",L_pubgmmenu,"Gm Board",L_gmmenu,"Close Public Board",L_clospub,"Open Public Board",L_openpub; +if(($messagepubclose == 1)) goto L_pubclosed; +menu "Read messages!",L_readmsg,"Post a message!",L_Postmsg,"Leave",L_leave; +L_pubgmmenu: +if(($messagepubclose == 1)) goto L_pubclosed; +menu "Re-set the rotation",L_setrot,"Reset Message",L_Clearmsgs,"Read messages!",L_readmsg,"Post a message!",L_Postmsg,"Leave",L_leave; +L_gmmenu: +menu "Read messages!",L_gmboardread,"Post a Message!",L_gmboardpost,"Reset Messages",L_gmboardreset; + +L_openpub: +mes "[Robert]"; +mes "Are you sure?"; +menu "Yes",-,"No",L_openpubn; +mes "[Robert]"; +mes "It is done."; +close2; +set $messagepubclose,0; +end; + +L_openpubn: +mes "[Robert]"; +mes "Very well it shall remain closed."; +close; + +L_pubclosed: +mes "[Robert]"; +mes "Im sorry. The public boards are currently Closed."; +close; + +L_clospub: +mes "[Robert]"; +mes "Are you sure?"; +next; +menu "Yes.",-,"No",L_closepubn; +mes "[Robert]"; +mes "Very well I will not allow anyone into the public board."; +close2; +set $messagepubclose,1; +end; + +L_closepubn: +mes "[Robert]"; +mes "Have a nice day"; +close; + +L_gmboardreset: +mes "[Robert]"; +mes "This will require atleast 2 GM's approval to reset the gm board."; +mes "-Msg From Creator- This is bugged same gm can vote twice. Planned to revise in next version. -End Msg From Creator-"; +next; +menu "Vote for reset.",L_gmboardresetvote,"Back to main.",L_Menu01,"Leave.",L_leave; + +L_gmboardresetvote: +callfunc "F_gmresetcheck"; +set @tempid,getcharid(0); +set $gmboardresetvotenumb,$gmboardresetvotenumb+1; +set $gmboardresetvoted[$gmboardresetvotenumb],1; +set $gmboardresetvoteid[$gmboardresetvotenumb],@tempid; +set @tempid,0; +set $gmboardreset,$gmboardreset-1; +mes "[Robert]"; +mes "Thank you."; +next; +if(($gmboardreset == 0)) goto L_gmresetdone; +if(($gmboardreset >= 1)) goto L_gmresetnotdone; +close; + +L_gmresetdone: +deletearray $gmmessageboardpost$[1],$gmmessageboardpostnumber; +deletearray $gmmessageboardpostdate$[1],$gmmessageboardpostnumber; +deletearray $gmmessageboardpostname$[1],$gmmessageboardpostnumber; +deletearray $gmmessageboardeditdate$[1],$gmmessageboardpostnumber; +deletearray $gmboardresetvoted[1],$gmboardresetvotenumber; +deletearray $gmboardresetvoted[1],$gmboardresetvotenumber; +deletearray $gmboardresetvoteid[1],$gmboardresetvotenumber; +set $gmboardresetvotenumber,0; +set $gmboardreset,2; +mes "[Robert]"; +mes "The reset has been done."; +close; + +L_gmresetnotdone: +mes "[Robert]"; +mes "There needs to be "+$gmboardreset+" more gm(s) approval to do the reset."; +close; + +L_gmboardread: +if(($gmmessageboardpostnumber == 0)) goto L_msgno; +callfunc "F_gmmessage"; +end; + +L_gmboardpost: +if(($gmmessageboardpostnumber >= 127)) goto L_postmsgyestm; +set @gmmessageboardpostername$,strcharinfo(0); +set @gmmessageboarddate$,gettimestr("%Y-%m/%d %H:%M:%S",21); +set $gmmessageboardpostnumber,$gmmessageboardpostnumber+1; +input @gmmsgboardmsgt$; +set $gmmessageboardpost$[$gmmessageboardpostnumber],@gmmsgboardmsgt$; +set $gmmessageboardpostdate$[$gmmessageboardpostnumber],@gmmessageboarddate$; +set $gmmessageboardpostname$[$gmmessageboardpostnumber],@gmmessageboardpostername$; +mes "[Robert]"; +mes "Here is what your message looks like"; +next; +mes "Posted by: "+$gmmessageboardpostname$[$gmmessageboardpostnumber]+"."; +mes "On: "+$gmmessageboardpostdate$[$gmmessageboardpostnumber]+"."; +mes $gmmessageboardpost$[$gmmessageboardpostnumber]; +close; + + +L_setrot: +set $@determinedayrotation,gettime(4); //this determines the day rotation for clearing messages. +if(($@determinedayrotation == 0)) set $rotation,0; +if(($@determinedayrotation == 1)) set $rotation,1; +if(($@determinedayrotation == 2)) set $rotation,0; +if(($@determinedayrotation == 3)) set $rotation,1; +if(($@determinedayrotation == 4)) set $rotation,0; +if(($@determinedayrotation == 5)) set $rotation,1; +if(($@determinedayrotation == 6)) set $rotation,0; +mes "It is done."; +close; + +L_Clearmsgs: +mes "[Robert]"; +mes "Are you sure?"; +next; +menu "Yes",L_clearmsgsy,"No thanks.",L_Menu01; + +L_clearmsgsy: +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $messageboardeditdate$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +mes "[Robert]"; +mes "It is done."; +close; + +L_leave: +close; + +L_Postmsg: +mes "[Robert]"; +mes "What do you want to say in your message?"; +next; +set @msgboardmsgt$,0; +input @msgboardmsgt$; +mes "[Robert]"; +mes "are you sure this is the message you want?"; +mes @msgboardmsgt$; +next; +menu "Yes!",L_postmsgyes,"No let me re-do it!",L_Postmsg,"Ive changed my mind let me leave.",lleave; + +L_postmsgyes: +if(($messageboardpostnumber >= 127)) goto L_postmsgyestm; +set @messageboardpostername$,strcharinfo(0); +set @messageboarddate$,gettimestr("%Y-%m/%d %H:%M:%S",21); +set $messageboardpostnumber,$messageboardpostnumber+1; +set @mymessage2,$messageboardpostnumber; +set $mymessage[$messageboardpostnumber],5; +set $messageboardpost$[$messageboardpostnumber],@msgboardmsgt$; +set $messageboardpostdate$[$messageboardpostnumber],@messageboarddate$; +set $messageboardpostname$[$messageboardpostnumber],@messageboardpostername$; +mes "[Robert]"; +mes "here is what your message looks like"; +next; +mes "Posted by: "+$messageboardpostname$[$messageboardpostnumber]+"."; +mes "On: "+$messageboardpostdate$[$messageboardpostnumber]+"."; +mes $messageboardpost$[$messageboardpostnumber]; +close; + +L_postmsgyestm: +set @mesboardmsgt$,0; +mes "[Robert]"; +mes "Im sorry your going to have to wait till more space opens up for messages, it should be in 1 or 2 days =)"; +close; + +lleave: +deletearray $messageboardpost$[@tempview],@tempview; +deletearray $messageboardpostname$[@tempview],@tempview; +deletearray $messageboardpostdate$[@tempview],@tempview; +deletearray $mymessage[@tempview],@tempview; +set $messageboardpostnumber,$messageboardpostnumber-1; +set @msgboardmsgt$,0; +close; + +L_readmsg: +if(($messageboardpostnumber == 0)) goto L_msgno; +callfunc "F_message"; +end; + +L_msgno: +mes "[Robert]"; +mes "There are currently no messages."; +close; + +OnInit: +set $gmboardreset,2; +set $gmboardresetvotenumb,0; +end; + +OnInterIfInitOnce: +set $@determinedayrotation,gettime(4); //this determines the day rotation for clearing messages. +if(($@determinedayrotation == 0)) set $rotation,0; +if(($@determinedayrotation == 1)) set $rotation,1; +if(($@determinedayrotation == 2)) set $rotation,0; +if(($@determinedayrotation == 3)) set $rotation,1; +if(($@determinedayrotation == 4)) set $rotation,0; +if(($@determinedayrotation == 5)) set $rotation,1; +if(($@determinedayrotation == 6)) set $rotation,0; +end; + + +OnSun1200: +if(($rotation == 1)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +end; + +OnSat1200: +if(($rotation == 0)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +end; + +OnMon1200: +if(($rotation == 1)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +end; + +OnTue1200: +if(($rotation == 0)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +end; + +OnWed1200: +if(($rotation == 1)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +end; + +OnThu1200: +if(($rotation == 0)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[1],$messageboardpostnumber; +set $messageboardpostnumber,0; +end; + +OnFri1200: +if(($rotation == 1)) end; +deletearray $messageboardpost$[1],$messageboardpostnumber; +deletearray $messageboardpostdate$[1],$messageboardpostnumber; +deletearray $messageboardpostname$[1],$messageboardpostnumber; +deletearray $mymessage[@tempview],@tempview; +set $messageboardpostnumber,0; +end; +} + +function script F_gmresetcheck { +set @tempcheck,0; +L_top: +set @tempcheck,@tempcheck+1; +if(($gmboardresetvoted[@tempview] == 1)) goto L_votecheck; +if(($gmboardresetvoted[@tempview] == 0)) return; +goto L_top; +end; + +L_votecheck: +set @tempcheckid,0; +set @tempcheckid,getcharid(0); +if(($gmboardresetvoteid[@tempview] != @tempcheckid)) goto L_top; +if(($gmboardresetvoteid[@tempview] == @tempcheckid)) goto L_voted; +end; +} + +function script F_gmmessage { +set @tempview,0; +L_top: +set @tempview,@tempview+1; +mes "Posted By: "+$gmmessageboardpostname$[@tempview]+"."; +mes "On: "+$gmmessageboardpostdate$[@tempview]+"."; +mes $gmmessageboardpost$[@tempview]+"."; +menu "Next Message",L_top2; + +L_top2: +if(($gmmessageboardpostnumber > @tempview)) goto L_top; +close; +} + +function script F_message { +set @tempview,0; +L_top: +set @tempview,@tempview+1; +mes "Posted By: "+$messageboardpostname$[@tempview]+"."; +mes "On: "+$messageboardpostdate$[@tempview]+"."; +mes $messageboardpost$[@tempview]+"."; +next; +if(($mymessage[@tempview] == 5) && (getgmlevel(99)>0)) menu "Next Message",L_top2,"Delete My Message",L_delmy,"Edit my message",L_editmy,"Delete This message",L_Del; +if((getgmlevel(99)>0)) menu "Next Message",L_top2,"Delete This message",L_Del; +if(($mymessage[@tempview] == 5)) menu "Next Message",L_top2,"Delete My Message",L_delmy,"Edit my message",L_editmy; +menu "Next message",L_top2; +close; + +L_editmy: +mes "Are you sure?"; +next; +menu "Yes",L_editmyy,"No",L_editmyn; + +L_editmyy: +mes "what do you want your new message to be?"; +next; +mes "Current message!"; +mes $messageboardpost$[@tempview]; +set @tempeditmsg$,0; +input @tempeditmsg$; +next; +mes "is this what you want?"; +mes @tempeditmsg$; +next; +menu "Yes!",L_editmyyy,"No.",L_editmyyn; + +L_editmyyy: +deletearray $messageboardpost$[@tempview],@tempview; +set $messageboardpost$[@tempview],@tempeditmsg$; +mes "Here is what your new message looks like."; +next; +mes "Posted By: "+$messageboardpostname$[@tempview]+"."; +mes "On: "+$messageboardpostdate$[@tempview]+"."; +mes $messageboardpost$[@tempview]+"."; +close2; +set @tempview,0; +end; + +L_editmyn: +Mes "So be it."; +set @tempview,0; +close; + +L_editmyyn: +mes "So be it!"; +set @tempeditmsg$,0; +set @tempview,0; +close; + +L_delmy: +mes "Are you sure...?"; +next; +menu "Yes",L_delmyy,"No thanks.",L_delmyn; + +L_delmyy: +deletearray $messageboardpost$[@tempview],@tempview; +deletearray $messageboardpostname$[@tempview],@tempview; +deletearray $messageboardpostdate$[@tempview],@tempview; +deletearray $mymessage[@tempview],@tempview; +deletearray $messageboardeditdate$[@tempview],@tempview; +set $messageboardpostnumber,$messageboardpostnumber-1; +set @tempview,0; +mes "It is done."; +close; + +L_delmyn: +mes "Come back soon."; +set @tempview,0; +close; + +L_top2: +if(($messageboardpostnumber > @tempview)) goto L_top; +close; + +L_Del: +mes "Are you sure?"; +next; +menu "Yes",L_Dely,"No",L_Deln; + +L_Dely: +deletearray $messageboardpost$[@tempview],@tempview; +deletearray $messageboardpostname$[@tempview],@tempview; +deletearray $messageboardpostdate$[@tempview],@tempview; +deletearray $mymessage[@tempview],@tempview; +deletearray $messageboardeditdate$[@tempview],@tempview; +set $messageboardpostnumber,$messageboardpostnumber-1; +mes "It is done."; +set @tempview,0; +close; + +L_Deln: +mes "Come back soon!"; +set @tempview,0; +close; }
\ No newline at end of file diff --git a/npc/custom/eAAC_Scripts/quest_warper.txt b/npc/custom/eAAC_Scripts/quest_warper.txt index 24b61f0de..bfd876060 100644 --- a/npc/custom/eAAC_Scripts/quest_warper.txt +++ b/npc/custom/eAAC_Scripts/quest_warper.txt @@ -1,2136 +1,2136 @@ -//===== eAthena Script ============================================
-//= Quest Warper Script
-//===== By: =======================================================
-//= Old Warper 2 by Darkchild - Remade with quest format by DZeroX
-//= Huge Rewrite by Neouni
-//===== Current Version: ==========================================
-//= 2.0c
-//===== Compatible With: ==========================================
-//= Any eAthena Version
-//===== Description: ==============================================
-//= Warper that works only after locations are unlocked
-//===== Warning: ==================================================
-// you have to set the securitycode value [1337] the same as in
-// functions_kafras.txt if you changed it !!
-//===== Additional Comments: ======================================
-//= 1.0 - NPCs created
-//= 1.1 - Add Dungeons by sturm
-//= 1.2 - Add All char in account unlocked by ace_killer
-//= 1.3 - Add new 7 towns and 7 dungeons by escoteiro
-// - Correct bug jawaii town by escoteiro
-// - Remove some excessive warpras by escoteiro
-//= 1.4 - Rewrite of the Warpa system [Neouni]
-// - Corrected some bugs caused by autoconverting the old script
-//= 1.4a - Rewrite of menu to be custom for each player [Neouni]
-// - Dungeon listing rewrite
-// - Town listing rewrite
-// - GameMaster can Customise Main menu
-//= 1.4b - Pricing round [Neouni]
-// - GM menu added for pricing
-// - Town Warp pricing tags added
-// - Dungeon Warp pricing tags added
-//= 1.5 - storage functions pricing [Neouni]
-// - storage pricing added
-// - kafra points setting added
-// - kafra storage code security added
-// - Healing scripts pricing added
-// - Heal Part script added
-//= 1.6 - Dungeon warp [Neouni] (beta only)
-// - added option to add a extra fee for going down deeper into dungeon
-// partly by rebuilding the dungeon warping into variable menu's
-//= 1.6a - alot of fixes for beta release [Neouni] (public release)
-// - fixed syntax problems
-// - fixed missing pyramid gats in @DGat$ array
-// - removed the culver level 5 that didn't exist
-// and caused quite alot of problems (i didn't check while converting)
-//-1.7 - Readability of Dungeon menu building increased [Neouni]
-// - Thanatos Tower & Louyang Dungeon added
-//-1.8 - changed around unlock variables [Neouni]
-// - Moved warp variables to mark what you have unlocked to an binary array in login based permanent variable
-// (warp variables are saved in login database, so all charservers have these unlocked)
-// - Town Warp unlock array max 21/(unknown max) items used instead of max account #variables 32 !
-// - Dungeon Warp unlock array 28/(unknown max) items used instead of max account #variables 32 !
-// - (max login ##variables = 16, i used 3)
-// - old variables are cleared on next save
-// - Extra Variable clear added for every character, just in case (request by Terces)
-//-1.8a - Show ammount of users on map [Neouni]
-// - Default = off, enable in GM menu
-// - Requested by escoteiro
-//-1.8b - Small typo fixed in stampcard script [Neouni]
-// - Reported by escoteiro
-//-1.9 - Making it more edit friendly [Neouni]
-// - Made Dungeon warp arrays more readable & editable (QWS_Darray)
-// - Made town warp arrays more readable & editable (QWS_Tarray)
-//-2.0 - Special Warp menu added [Neouni]
-// - when all towns and dungeons are collected a new option on the main menu will show
-// - it will only show when you setup the mapname of the warp !
-// - requested by escoteiro
-// - several bugs fixed
-//-2.0a - Dungeon Level Limit & Split dungeon fees
-// - Limits dungeon based on Depth, access special setup menu thru GM-Menu
-// - Dungeon fees split up based on Basic , Advanced & Overseas
-// - Old Dungeon fee system removed, all dungeon fees now set to 0
-//-2.0b - Special warpname menu option name bug fixed
-//-2.0c - Parenthesis fixes [KarLaeda]
-//=================================================================
-
-//========================Function=&=Script========================
-
-
-function script Q_Warpra {
-// Quick hack for backwards compatibility pre 1.8
-if (##QWS_UP < 18) callfunc "QWS_BackComp";
-// Extra clear variables because marker is saved on all char servers and variables can be on multiple servers
-if (QWS_ExtraVARClear < 18) callfunc "Extra_Variable_Clear";
-
- mes "[Warpra]";
- mes "Hello,";
- mes "I can warp you to any town or dungeon, but you need to unlock them first.";
- mes "To unlock them, you have to visit us.";
- mes "What do you need?";
-
- if(getarg(0) == 0) callfunc "QWS_MMarray",0;
- if(getarg(0) == 1) callfunc "QWS_MMarray",1;
-
- set @MMenu,select(@Mmenulist$[0],@Mmenulist$[1],@Mmenulist$[2],@Mmenulist$[3],@Mmenulist$[4],@Mmenulist$[5],@Mmenulist$[6],@Mmenulist$[7],@Mmenulist$[8],@Mmenulist$[9],@Mmenulist$[10],@Mmenulist$[11]);
-
- switch(@Mmenuref[@MMenu-1]+1){
- case 1:
- goto GM_Menu;
- case 2:
- warp $QW_SP_WarpMap$, $QW_SP_WarpX, $QW_SP_WarpY;
- close2;
- debugmes "Please check your special warp menu settings on the Warpra";
- end;
- case 3:
- goto L_town;
- case 4:
- goto L_dungeon;
- case 5:
- goto L_FewWarps;
- case 6:
- goto L_NoUnlock;
- case 7:
- goto L_heal_Full;
- case 8:
- goto L_heal_Part;
- case 9:
- goto L_Storage;
- case 10:
- goto L_GStorage;
- case 11:
- goto L_end;
- default:
- goto L_end;
-}
-
-//=====================GM-Menu=Functions===========================
-
-GM_Menu:
-next;
-//----------------Town-Warp
- if ($QW_TW_OFF == 0) mes "Town warping = ^00FF00 On ^000000";
- if ($QW_TW_OFF == 1) mes "Town warping = ^FF0000 Off ^000000";
-//----------------Dungeon-Warp
- if ($QW_DW_OFF == 0) mes "Dungeon warping = ^00FF00 On ^000000";
- if ($QW_DW_OFF == 1) mes "Dungeon warping = ^FF0000 Off ^000000";
-//----------------Dungeon-Depth-Limit
- if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000";
- if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000";
- mes "If on Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000";
-//----------------ShowMapUsers
- if ($QW_MapUserShow == 1) mes "Show Map Users = ^00FF00 On ^000000";
- if ($QW_MapUserShow == 0) mes "Show Map Users = ^FF0000 Off ^000000";
-//----------------Healfull
- if ($QW_HF == 1) mes "Healing full = ^00FF00 On ^000000";
-//----------------Healpart
- if ($QW_HP == 1) mes "Healing partly = ^00FF00 On ^000000";
- if ($QW_HF == 0 && $QW_HP == 0) mes "Healing = ^FF0000 Off ^000000";
-//----------------Storage
- if ($QW_Stor == 1) mes "Storage = ^00FF00 On ^000000";
- if ($QW_Stor == 0) mes "Storage = ^FF0000 Off ^000000";
-//----------------GuildStorage
- if ($QW_GStor == 1) mes "Guild Storage = ^00FF00 On ^000000";
- if ($QW_GStor == 0) mes "Guild Storage = ^FF0000 Off ^000000";
-//----------------KafraPoints
- if ($QW_KPoint == 1) mes "Kafra points collect = ^00FF00 On ^000000";
- if ($QW_KPoint == 0) mes "Kafra points collect = ^FF0000 Off ^000000";
-//----------------GMmenu
- switch(select("Town Warping","Dungeon Warping","Dungeon Level Limit","Show Map Users","Healing full","Healing partly","Storage","Guild Storage","Kafra points collect","Set Prices","Special Warp","Exit")) {
-
-// Using callsub and a small check to not make 1 part of the script set it on and the other turning it off again
-
-case 1:
- if ($QW_TW_OFF == 0) {
- set $QW_TW_OFF,1;
- goto GM_Menu;
- } else
- set $QW_TW_OFF,0;
- goto GM_Menu;
-case 2:
- if ($QW_DW_OFF == 0) {
- set $QW_DW_OFF,1;
- goto GM_Menu;
- } else
- set $QW_DW_OFF,0;
- goto GM_Menu;
-case 3:
- goto DungeonLevelLimit;
-case 4:
- if ($QW_MapUserShow == 0) {
- set $QW_MapUserShow,1;
- goto GM_Menu;
- } else
- set $QW_MapUserShow,0;
- goto GM_Menu;
-case 5:
- if ($QW_HF == 0) {
- set $QW_HF,1;
- set $QW_HP,0;
- goto GM_Menu;
- } else
- set $QW_HF,0;
- goto GM_Menu;
-case 6:
- if ($QW_HP == 0) {
- set $QW_HP,1;
- set $QW_HF,0;
- goto GM_Menu;
- } else
- set $QW_HP,0;
- goto GM_Menu;
-case 7:
- if ($QW_Stor == 0) {
- set $QW_Stor,1;
- goto GM_Menu;
- } else
- set $QW_Stor,0;
- goto GM_Menu;
-case 8:
- if ($QW_GStor == 0) {
- set $QW_GStor,1;
- goto GM_Menu;
- } else
- set $QW_GStor,0;
- goto GM_Menu;
-case 9:
- if ($QW_KPoint == 0) {
- set $QW_KPoint,1;
- goto GM_Menu;
- } else
- set $QW_KPoint,0;
- goto GM_Menu;
-case 10:
- goto Setprice;
-case 11:
- goto SpecialWarpMenu;
-default:
- close;
- end;
-}
-
-
-//======================GM-Menu=Pricing============================
-
-Setprice:
- if ($QW_DW_FEE != 0) set $QW_DW_FEE,0;
- next;
- mes "Scroll thru the list to see all the options";
-//----------------Warp-Basic-Price
- if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000";
- if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000";
-//----------------Warp-Advanced-Price
- if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000";
- if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000";
-//----------------Warp-Oversea-Price
- if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000";
- if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000";
-//----------------Basic-Dungeon-Level-Warp-Fee
- if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level";
- if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
-//----------------Advanced-Dungeon-Level-Warp-Fee
- if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level";
- if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
-//----------------Overseas-Dungeon-Level-Warp-Fee
- if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level";
- if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
-//----------------Heal-Full
- if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000";
- if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000";
-//----------------Heal-Part
- if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point";
- if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000";
- if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point";
- if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000";
-//----------------Storage
- if ($QW_S_PRICE != 0 && $QW_S_PRICE != 60) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000";
- if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000";
- if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000";
-//----------------Guild-Storage
- if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000";
- if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000";
-
- switch(select("Basic - Warps","Advanced - Warps","Overseas - Warps","Basic Dungeon warp fee","Advanced Dungeon warp fee","Overseas Dungeon warp fee","Full Healing","Part Healing","Storage","Guild Storage","Back","Exit")) {
-
-case 1:
- next;
- if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000";
- if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000";
- mes "Basic - Warps are starter towns and related dungeons";
- input $QW_BW_PRICE;
- goto Setprice;
-
-case 2:
- next;
- if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000";
- if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000";
- mes "Advanced - Warps are towns and dungeons on the same island but not close to any starter town";
- input $QW_AW_PRICE;
- goto Setprice;
-
-case 3:
- next;
- if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000";
- if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000";
- mes "Overseas - Warps are towns and dungeons overseas reachable by boat from alberta";
- input $QW_OW_PRICE;
- goto Setprice;
-
-case 4:
- next;
- if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level";
- if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
- mes "Basic - Warps are starter town related dungeons";
- mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee";
- mes "These costs are on top of the regular Warp costs";
- input $QW_BW_FEE;
- goto Setprice;
-
-case 5:
- next;
- if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level";
- if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
- mes "Advanced - Warps are dungeons not close to any starter town";
- mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee";
- mes "These costs are on top of the regular Warp costs";
- input $QW_AW_FEE;
- goto Setprice;
-
-case 6:
- next;
- if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level";
- if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
- mes "Overseas - Warps are dungeons related to towns overseas reachable by boat from alberta";
- mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee";
- mes "These costs are on top of the regular Warp costs";
- input $QW_OW_FEE;
- goto Setprice;
-
-case 7:
- next;
- if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000";
- if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000";
- mes "Instant full healing 1 price";
- input $QW_HF_PRICE;
- goto Setprice;
-
-case 8:
- next;
- if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point";
- if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000";
- if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point";
- if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000";
- mes "Healing price per 1 HP";
- mes "Healing price per 1 SP";
- mes "2 inputs, first HP then SP";
- input $QW_HP_H_PRICE;
- input $QW_HP_S_PRICE;
- goto Setprice;
-
-case 9:
- next;
- if ($QW_S_PRICE != 0 && $QW_S_PRICE != 60) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000";
- if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000";
- if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000";
- mes "Storage cost, if set to 60 Kafra pricing will be handled";
- input $QW_S_PRICE;
- goto Setprice;
-
-case 10:
- next;
- if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000";
- if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000";
- mes "Guild Storage, free on Guild Kafras";
- input $QW_GS_PRICE;
- goto Setprice;
-case 11:
- goto GM_Menu;
-default:
- close;
- end;
-}
-
-//======================Special=Warp=Menu==========================
-
-SpecialWarpMenu:
- if ($QW_SP_Warpname$ == "") set $QW_SP_Warpname$,"Special Warp";
- next;
- mes "Scroll down to see all the information";
- mes "The Special warp menu option will show in the main menu when all towns & dungeons are unlocked";
- mes "And when the map for special warping has been set";
- mes "menu option name set to ^0000FF"+$QW_SP_Warpname$+"^000000";
- if ($QW_SP_WarpMap$ == "") mes "map is currently ^FF0000not^000000 set, and Special warp menu is off";
- if ($QW_SP_WarpMap$ != "") mes "map is currently set to ^0000FF"+$QW_SP_WarpMap$+"^000000 and Special Warp menu is on";
- mes "coords are set to ^0000FF"+$QW_SP_WarpX+","+$QW_SP_WarpY+"^000000";
- switch(select("Set Special Warp name to show in menu", "Set WarpMap","Set Coords","Go Back to GM_Menu","Exit")){
-
-case 1:
- next;
- mes "set the name to show in the menu as option";
- input $QW_SP_Warpname$;
- goto SpecialWarpMenu;
-case 2:
- next;
- mes "set the map in the ^0000FFmapname.gat^000000 format";
- mes "when this warpmap is set the option for players will show once they meet the requirments";
- mes "to disable Special Warp Menu option clear this !";
- input $QW_SP_WarpMap$;
- goto SpecialWarpMenu;
-case 3:
- next;
- mes "First input = Xcoord";
- mes "Second input = Ycoord";
- input $QW_SP_WarpX;
- input $QW_SP_WarpY;
- goto SpecialWarpMenu;
-case 4:
- goto GM_Menu;
-default:
- close;
- end;
-}
-
-//======================Dungeon=Level=Limit========================
-DungeonLevelLimit:
- next;
- if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000";
- if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000";
- mes "If^00FF00 On ^000000Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000";
-
- switch(select("Toggle Dungeon Depth Limit", "Set Dungeon Depth Limit","Go Back to GM_Menu","Exit")){
-
-case 1:
- if ($QW_DL == 0) {
- set $QW_DL,1;
- goto DungeonLevelLimit;
- } else
- set $QW_DL,0;
- goto DungeonLevelLimit;
-case 2:
- next;
- mes "set limit of Dungeon Depth 0 = entrance";
- mes "Depth 1 is a map connected to 0 and so on";
- mes "Shortest Route to map counts as depth";
- input $QW_DDL;
- goto DungeonLevelLimit;
-case 3:
- goto GM_Menu;
-default:
- close;
- end;
-}
-
-//===========================Towns=================================
-
-L_town:
- callfunc "QWS_Tarray";
-
-// Expected maximum is set to 25 items, if you add more options add more ",@Tmenulist$[xx]"
-
- set @TWMenu,select(@Tmenulist$[0],@Tmenulist$[1],@Tmenulist$[2],@Tmenulist$[3],@Tmenulist$[4],@Tmenulist$[5],@Tmenulist$[6],@Tmenulist$[7],@Tmenulist$[8],@Tmenulist$[9],@Tmenulist$[10],@Tmenulist$[11],@Tmenulist$[12],@Tmenulist$[13],@Tmenulist$[14],@Tmenulist$[15],@Tmenulist$[16],@Tmenulist$[17],@Tmenulist$[18],@Tmenulist$[19],@Tmenulist$[20],@Tmenulist$[21],@Tmenulist$[22],@Tmenulist$[23],@Tmenulist$[24]);
-
- if (@Tmenuref[@TWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
-
- if(Zeny<@pTprice[@Tmenuref[@TWMenu-1]]) callsub L_Short_on_zeny,0;
-
- set Zeny, Zeny-@pTprice[@Tmenuref[@TWMenu-1]];
- if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@pTprice[@Tmenuref[@TWMenu-1]]/16);
- warp @pTmap$[@Tmenuref[@TWMenu-1]],@pTXcoords[@Tmenuref[@TWMenu-1]],@pTYcoords[@Tmenuref[@TWMenu-1]];
- close2; // this part safegaurds against errors/typos
- set Zeny, Zeny+@pTprice[@Tmenuref[@TWMenu-1]];
- end;
-
-//=========================Dungeons================================
-
-L_dungeon:
- callfunc "QWS_Darray";
-
-// Expected maximum is set to 35 items, if you add more options add more ",@Dmenulist$[xx]"
-
- set @DWMenu,select(@Dmenulist$[0],@Dmenulist$[1],@Dmenulist$[2],@Dmenulist$[3],@Dmenulist$[4],@Dmenulist$[5],@Dmenulist$[6],@Dmenulist$[7],@Dmenulist$[8],@Dmenulist$[9],@Dmenulist$[10],@Dmenulist$[11],@Dmenulist$[12],@Dmenulist$[13],@Dmenulist$[14],@Dmenulist$[15],@Dmenulist$[16],@Dmenulist$[17],@Dmenulist$[18],@Dmenulist$[19],@Dmenulist$[20],@Dmenulist$[21],@Dmenulist$[22],@Dmenulist$[23],@Dmenulist$[24],@Dmenulist$[25],@Dmenulist$[26],@Dmenulist$[27],@Dmenulist$[28],@Dmenulist$[29],@Dmenulist$[30],@Dmenulist$[31],@Dmenulist$[32],@Dmenulist$[33],@Dmenulist$[34]);
-
- if (@Dmenuref[@DWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
- set @DwarpMenu, (@Dmenuref[@DWMenu-1]);
- callfunc "QWS_DLarray";
-
- next;
- mes "[Warpra]";
- mes "Please select where you want to go";
-
-// Expected maximum is set to 18 items, if you have dungeons with more levels add more ",@DWLmenulist$[xx]"
- set @DWLMenu,select(@DWLmenulist$[0], @DWLmenulist$[1], @DWLmenulist$[2], @DWLmenulist$[3], @DWLmenulist$[4], @DWLmenulist$[5], @DWLmenulist$[6], @DWLmenulist$[7], @DWLmenulist$[8], @DWLmenulist$[9], @DWLmenulist$[10], @DWLmenulist$[11], @DWLmenulist$[12], @DWLmenulist$[13], @DWLmenulist$[14], @DWLmenulist$[15], @DWLmenulist$[16], @DWLmenulist$[17]);
-
- if (@DWLmenuref[@DWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex
-
- set @Darrayref, @DWLmenuref[@DWLMenu-1];
- set @warpprice, @pDprice[@Dmenuref[@DWMenu-1]]+(getd(@pDfee$[@Dmenuref[@DWMenu-1]])*(@DDepth[@Darrayref]));
-
- if(Zeny<@warpprice) callsub L_Short_on_zeny,1;
-
- set Zeny, Zeny-(@warpprice);
- if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@warpprice/16);
- warp @DGat$[@Darrayref],@DXcoords[@Darrayref],@DYcoords[@Darrayref];
- close2; // this part safegaurds against errors/typos
- set Zeny, Zeny+@pTprice[@Tmenuref[@DWMenu-1]];
- end;
-
-//=============================Healing=============================
-
-L_heal_Full:
- set @healfee, $QW_HF_PRICE;
- if(Zeny<@healfee) callsub L_Short_on_zeny,4;
- set Zeny, Zeny-@healfee;
- if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@healfee/500);
- next;
- mes "[Warpra]";
- mes "Close this window and I will Heal you.";
- close2;
- percentheal 100,100;
- end;
-
-L_heal_Part:
- set @healchoice,select("Full heal","Health Points only","Skill Points only","Exit");
- if (@healchoice == 1) callsub PHeal,1,1;
- if (@healchoice == 2) callsub PHeal,1,0;
- if (@healchoice == 3) callsub PHeal,0,1;
- goto L_end;
-
-PHeal:
- next;
- set @Hp, MaxHp-Hp;
- set @Sp, MaxSp-Sp;
- set @HpPrice, @hp*$QW_HP_H_PRICE;
- set @SpPrice, @sp*$QW_HP_S_PRICE;
- mes "[Warpra]";
- if(getarg(0) == 1) mes ""+@HpPrice+" Zeny for "+@Hp+" health points";
- if(getarg(1) == 1) mes ""+@SpPrice+" Zeny for "+@Sp+" skill points";
- set @total, @HpPrice+@SpPrice;
- mes "for a total of "+@total+" zeny";
- if (select("Heal me","Let me see the choices again")==2) goto L_heal_Part;
-
- if(getarg(0) == 1)set @HpPrice, (MaxHp-Hp)*$QW_HP_H_PRICE;
- if(getarg(1) == 1)set @SpPrice, (MaxSp-Sp)*$QW_HP_S_PRICE;
- set @healfee, @HpPrice+@SpPrice;
- if (getarg(0) == 1 && getarg(1) == 1 && Zeny<@healfee) goto Zeny_Short_Both;
- if (getarg(0) == 1 && Zeny<@healfee) goto Zeny_short_HP;
- if (getarg(1) == 1 && Zeny<@healfee) goto Zeny_short_SP;
- set Zeny, Zeny-@healfee;
- if (getarg(0) == 1 && getarg(1) == 1) percentheal 100,100;
- if (getarg(0) == 1) percentheal 100,0;
- if (getarg(1) == 1) percentheal 0,100;
- close;
- end;
-
-Zeny_Short_Both:
- mes "[Warpra]";
- mes "choose another option, you can afford both.";
- mes "I can heal as much as you can afford too.";
- if (select("OK","Exit") == 2) goto L_end;
- goto PHeal;
-
-Zeny_short_HP:
- mes "[Warpra]";
- mes "do you want me to partly heal your HP ?";
- if (select("Yes","No") == 2) goto L_end;
- set @Hp, Zeny/$QW_HP_H_PRICE;
- set @HpPrice, @Hp*$QW_HP_H_PRICE;
- if (@Hp == 1) mes "your not worth the effort";
- if (@Hp == 1) goto L_end;
- set Zeny, Zeny-@HpPrice;
- heal @Hp,0;
- close;
- end;
-
-Zeny_short_SP:
- mes "[Warpra]";
- mes "do you want me to partly heal your SP ?";
- if (select("Yes","No") == 2) goto L_end;
- set @Sp, Zeny/$QW_HP_S_PRICE;
- set @SpPrice, @Sp*$QW_HP_S_PRICE;
- if (@Sp == 1) mes "your not worth the effort";
- if (@Sp == 1) goto L_end;
- set Zeny, Zeny-@SpPrice;
- heal 0,@Sp;
- close;
- end;
-
-//=============================Storage=============================
-
-L_Storage:
- next;
- if(basicskillcheck(0) > 0 && getskilllv(1) < 6) goto L_StorageJBlow;
- set @fee, $QW_S_PRICE;
- if ($QW_S_PRICE == 60 && BaseJob == Job_Novice) set @fee, 30;
- if(Zeny<@fee) callsub L_Short_on_zeny,2;
- set Zeny, Zeny-@fee;
- if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@fee/5);
-
- mes "[Warpra]";
- mes "Close this window and i will open your storage.";
-
- callsub F_CheckKafCode; //check your storage password thru kafra coding, if set
-
- close2;
- openstorage;
- end;
-
-F_CheckKafCode:
-// you have to set the 1337 value the same as in functions_kafras.txt if you changed it !!
- if(#kafra_code==0) return;
- mes "Enter your storage password:";
- set @code_,0;
- input @code_;
- if(@code_ != #kafra_code-getcharid(3)-1337) {
- dispbottom "Wrong storage password.";
- close;
- }
- set @kafcode_try,0;
- set @code_,0;
- return;
-
-L_StorageJBlow:
- mes "[Warpra]";
- mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage.";
- return;
-
-L_GStorage:
- if(@GID==0) goto L_NoGuild;
- if(Zeny<$QW_GS_PRICE) callsub L_Short_on_zeny,3;
- set Zeny, Zeny-$QW_GS_PRICE;
- if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + ($QW_GS_PRICE/5);
- next;
- mes "[Warpra]";
- mes "Close this window and i will open the ^5533FF" + GetGuildName(@GID) + "^000000 storage.";
- close2;
- guildopenstorage;
- end;
-
-L_NoGuild:
- next;
- mes "[Warpra]";
- mes "You are not a part of a guild I can't help you.";
- close;
- end;
-
-L_end:
- close;
- end;
-
-//============================Few=Warp=============================
-L_FewWarps:
- next;
- mes "[Warpra ]";
- mes "You need to unlock locations before they come available to you.";
- mes "To unlock a location talk to my colleagues all over the world.";
- mes "Each account got it's own stamp card.";
- mes "Want me to check what stamps you have collected so far ?.";
- if (select("Yes","No")==1) callsub stampcard;
- close;
- end;
-
-
-//============================No=Unlock============================
-
-L_NoUnlock:
- next;
- mes "[Warpra ]";
- mes "I don't unlock this location, my assistant deeper in the dungeon will unlock this place.";
- close;
- end;
-
-//=========================Short=On=Zeny===========================
-L_Short_on_zeny:
- next;
- if (getarg(0) == 0) mes "you don't seem to have "+@pTprice[@Tmenuref[@TWMenu-1]]+" zeny, to pay for the warp fee to "+@pTmenuitems$[@Tmenuref[@TWMenu-1]]+"";
- if (getarg(0) == 1) mes "you don't seem to have "+@warpprice+" zeny, to pay for the warp fee to "+@DLevelName$[@DWLmenuref[@DWLMenu-1]]+" at "+@pDmenuitems$[@Dmenuref[@DWMenu-1]]+"";
- if (getarg(0) == 2) mes "you don't seem to have "+@fee+" zeny, to pay for the storage fee";
- if (getarg(0) == 3) mes "you don't seem to have "+$QW_GS_PRICE+" zeny, to pay for the guild storage fee";
- if (getarg(0) == 4) mes "you don't seem to have "+@healfee+" zeny, to pay for your healing";
- close;
- end;
-
-//===========================Stamp=Card============================
-stampcard:
-// Counting of the ammount of places you have unlocked
- next;
- mes "Let me check what Towns you have";
-
- callfunc "QWS_TownStamps";
-
- mes "you collected^00FF00 "+@Tstamp+" of "+@MaxTstamp+" ^000000Towns.";
- if (@Tstamp == 15) mes "They say there is an island you can only get to when married";
- if (@Tstamp == 15) emotion 18;
- next;
-
- mes "Let me check what dungeons you have";
-
- callfunc "QWS_DungeonStamps";
-
- mes "you collected^00FF00 "+@Dstamp+" of "+@MaxDstamp+" ^000000Dungeons";
- mes "To unlock a dungeon, search for my colleague.";
- mes "You can usually find them near the middle or end of the dungeon";
- return;
-}
-
-function script QWS_TownStamps {
- set @Tstamp,0;
- set @MaxTstamp,21; //maximum number of towns
- set @binvalue,1;
- set @Tstamploop,0;
- do {
- if ((@binvalue & ##QWS_T_Unlock) == @binvalue) set @Tstamp,@Tstamp+1;
-
- set @binvalue, @binvalue *2;
- set @Tstamploop, @Tstamploop + 1;
-
-}while (@Tstamploop < @MaxTstamp);
-return;
-}
-
-function script QWS_DungeonStamps {
- set @Dstamp,0;
- set @MaxDstamp,29; //maximum number of dungeons
- set @binvalue,1;
- set @Dstamploop,0;
- do {
- if ((@binvalue & ##QWS_D_Unlock) == @binvalue) set @Dstamp,@Dstamp+1;
-
- set @binvalue, @binvalue *2;
- set @Dstamploop, @Dstamploop + 1;
-
-}while (@Dstamploop < @MaxDstamp);
-return;
-}
-
-//======================Main=Menu=Array============================
-
-function script QWS_MMarray {
-
-// Currently 9 items
-
- setarray @pMmenuitems$[0], "GameMaster Menu", $QW_SP_Warpname$, "Warp to Towns", "Warp to Dungeons", "Why so few Warps ?", "Why don't you Unlock this location ?", "Heal", "Heal", "Storage", "Guild Storage", "Cancel";
- set @Mi,0; // That's our loop counter.
- set @Mj,0; // That's the menu lines counter.
-//----------------GameMaster-Menu
- if (getgmlevel(80)) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if (getgmlevel(80)) set @Mmenuref[@Mj],@Mi;
- if (getgmlevel(80)) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Special-Warp
- callfunc "QWS_TownStamps";
- callfunc "QWS_DungeonStamps";
- if (@Tstamp == @MaxTstamp && @Dstamp == @MaxDstamp && $QW_SP_WarpMap$ != "") {
- set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- set @Mmenuref[@Mj],@Mi;
- set @Mj,@Mj+1;
- }
- set @Mi,@Mi+1;
-//----------------Town-Warp
- if ($QW_TW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if ($QW_TW_OFF == 0) set @Mmenuref[@Mj],@Mi;
- if ($QW_TW_OFF == 0) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Dungeon-Warp
- if ($QW_DW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if ($QW_DW_OFF == 0) set @Mmenuref[@Mj],@Mi;
- if ($QW_DW_OFF == 0) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Why-So-Few-Warps
- set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- set @Mmenuref[@Mj],@Mi;
- set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------No-Unlock
- if (getarg(0) == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if (getarg(0) == 1) set @Mmenuref[@Mj],@Mi;
- if (getarg(0) == 1) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Healfull
- if ($QW_HF == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if ($QW_HF == 1) set @Mmenuref[@Mj],@Mi;
- if ($QW_HF == 1) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Healpart
- if ($QW_HP == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if ($QW_HP == 1) set @Mmenuref[@Mj],@Mi;
- if ($QW_HP == 1) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Storage
- if ($QW_Stor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if ($QW_Stor == 1) set @Mmenuref[@Mj],@Mi;
- if ($QW_Stor == 1) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------GuildStorage
- if ($QW_GStor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- if ($QW_GStor == 1) set @Mmenuref[@Mj],@Mi;
- if ($QW_GStor == 1) set @Mj,@Mj+1;
- set @Mi,@Mi+1;
-//----------------Cancel
- set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
- set @Mmenuref[@Mj],@Mi;
- return;
- }
-
-
-
-//======================Town=Menu=Array============================
-
-//----------------Prontera // I do this to find back sections quickly altho almost the same name is a line below it now
-// setarray @pTmenuitems$[@Ti], "Prontera"; // Name of Town shown in Town select Menu
-// setarray @pTprice[@Ti], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE)
-//
-// setarray @pTmap$[@Ti], "prontera.gat"; // mapfilename of town
-// setarray @pTXcoords[@Ti], 156; // X warp coords
-// setarray @pTYcoords[@Ti], 187; // Y warp coords
-//
-// QWS_Make_Town_Menu XXX;
-//
-// the full wap commands send out by this script for these example would be
-//warp example_01.gat 123 123
-//
-// use the same XXX number as you used when making your own town warpra
-// Read below how
-//
-// example:
-//
-//syntax:
-//mapname.gat,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{
-//
-// Full example using fake map & coords
-//
-//example_01.gat,213,213,4 script Warpra 112,{
-// callfunc "QWS_Town_Warpra",XXX,"A FAKE TOWN FOR EXAMPLE";
-// close;
-// }
-// use a free number for XXX, last used is 20, for Yuno
-
-function script QWS_Tarray {
- function QWS_Make_Town_Menu;
-
- set @Ti,0; // That's our loop counter.
- set @Tj,0; // That's the menu lines counter.
-//----------------Prontera
- setarray @pTmenuitems$[@Ti], "Prontera";
- setarray @pTprice[@Ti], $QW_BW_PRICE;
-
- setarray @pTmap$[@Ti], "prontera.gat";
- setarray @pTXcoords[@Ti], 156;
- setarray @pTYcoords[@Ti], 187;
-
- QWS_Make_Town_Menu 0;
-//----------------Alberta
- setarray @pTmenuitems$[@Ti], "Alberta";
- setarray @pTprice[@Ti], $QW_BW_PRICE;
-
- setarray @pTmap$[@Ti], "alberta.gat";
- setarray @pTXcoords[@Ti], 27;
- setarray @pTYcoords[@Ti], 236;
-
- QWS_Make_Town_Menu 1;
-//----------------Aldebaran
- setarray @pTmenuitems$[@Ti], "Aldebaran";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "aldebaran.gat";
- setarray @pTXcoords[@Ti], 145;
- setarray @pTYcoords[@Ti], 120;
-
- QWS_Make_Town_Menu 2;
-//----------------Amatsu:
- setarray @pTmenuitems$[@Ti], "Amatsu";
- setarray @pTprice[@Ti], $QW_OW_PRICE;
-
- setarray @pTmap$[@Ti], "amatsu.gat";
- setarray @pTXcoords[@Ti], 197;
- setarray @pTYcoords[@Ti], 86;
-
- QWS_Make_Town_Menu 3;
-//----------------Ayothaya:
- setarray @pTmenuitems$[@Ti], "Ayothaya";
- setarray @pTprice[@Ti], $QW_OW_PRICE;
-
- setarray @pTmap$[@Ti], "ayothaya.gat";
- setarray @pTXcoords[@Ti], 150;
- setarray @pTYcoords[@Ti], 57;
-
- QWS_Make_Town_Menu 4;
-//----------------Comodo:
- setarray @pTmenuitems$[@Ti], "Comodo";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "comodo.gat";
- setarray @pTXcoords[@Ti], 188;
- setarray @pTYcoords[@Ti], 161;
-
- QWS_Make_Town_Menu 5;
-//----------------Einbech:
- setarray @pTmenuitems$[@Ti], "Einbech";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "einbech.gat";
- setarray @pTXcoords[@Ti], 172;
- setarray @pTYcoords[@Ti], 126;
-
- QWS_Make_Town_Menu 6;
-//----------------Einbroch:
- setarray @pTmenuitems$[@Ti], "Einbroch";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "einbroch.gat";
- setarray @pTXcoords[@Ti], 230;
- setarray @pTYcoords[@Ti], 191;
-
- QWS_Make_Town_Menu 7;
-//----------------Geffen:
- setarray @pTmenuitems$[@Ti], "Geffen";
- setarray @pTprice[@Ti], $QW_BW_PRICE;
-
- setarray @pTmap$[@Ti], "geffen.gat";
- setarray @pTXcoords[@Ti], 119;
- setarray @pTYcoords[@Ti], 66;
-
- QWS_Make_Town_Menu 8;
-//----------------Gonryun:
- setarray @pTmenuitems$[@Ti], "Gonryun";
- setarray @pTprice[@Ti], $QW_OW_PRICE;
-
- setarray @pTmap$[@Ti], "gonryun.gat";
- setarray @pTXcoords[@Ti], 150;
- setarray @pTYcoords[@Ti], 130;
-
- QWS_Make_Town_Menu 9;
-//----------------Hugel:
- setarray @pTmenuitems$[@Ti], "Hugel";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "hugel.gat";
- setarray @pTXcoords[@Ti], 95;
- setarray @pTYcoords[@Ti], 121;
-
- QWS_Make_Town_Menu 10;
-//----------------Izlude:
- setarray @pTmenuitems$[@Ti], "Izlude";
- setarray @pTprice[@Ti], $QW_BW_PRICE;
-
- setarray @pTmap$[@Ti], "izlude.gat";
- setarray @pTXcoords[@Ti], 128;
- setarray @pTYcoords[@Ti], 111;
-
- QWS_Make_Town_Menu 11;
-//----------------Jawaii:
- setarray @pTmenuitems$[@Ti], "Jawaii";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "jawaii.gat";
- setarray @pTXcoords[@Ti], 243;
- setarray @pTYcoords[@Ti], 115;
-
- QWS_Make_Town_Menu 12;
-//----------------Lighthalzen:
- setarray @pTmenuitems$[@Ti], "Lighthalzen";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "lighthalzen.gat";
- setarray @pTXcoords[@Ti], 158;
- setarray @pTYcoords[@Ti], 110;
-
- QWS_Make_Town_Menu 13;
-//----------------Louyang:
- setarray @pTmenuitems$[@Ti], "Louyang";
- setarray @pTprice[@Ti], $QW_OW_PRICE;
-
- setarray @pTmap$[@Ti], "louyang.gat";
- setarray @pTXcoords[@Ti], 210;
- setarray @pTYcoords[@Ti], 108;
-
- QWS_Make_Town_Menu 14;
-//----------------Lutie
- setarray @pTmenuitems$[@Ti], "Lutie";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "xmas.gat";
- setarray @pTXcoords[@Ti], 148;
- setarray @pTYcoords[@Ti], 131;
-
- QWS_Make_Town_Menu 15;
-//----------------Morroc:
- setarray @pTmenuitems$[@Ti], "Morroc";
- setarray @pTprice[@Ti], $QW_BW_PRICE;
-
- setarray @pTmap$[@Ti], "morocc.gat";
- setarray @pTXcoords[@Ti], 159;
- setarray @pTYcoords[@Ti], 93;
-
- QWS_Make_Town_Menu 16;
-//----------------Niflheim:
- setarray @pTmenuitems$[@Ti], "Niflheim";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "niflheim.gat";
- setarray @pTXcoords[@Ti], 195;
- setarray @pTYcoords[@Ti], 186;
-
- QWS_Make_Town_Menu 17;
-//----------------Payon:
- setarray @pTmenuitems$[@Ti], "Payon";
- setarray @pTprice[@Ti], $QW_BW_PRICE;
-
- setarray @pTmap$[@Ti], "payon.gat";
- setarray @pTXcoords[@Ti], 152;
- setarray @pTYcoords[@Ti], 75;
-
- QWS_Make_Town_Menu 18;
-//----------------Umbala:
- setarray @pTmenuitems$[@Ti], "Umbala";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "umbala.gat";
- setarray @pTXcoords[@Ti], 130;
- setarray @pTYcoords[@Ti], 130;
-
- QWS_Make_Town_Menu 19;
-//----------------Yuno:
- setarray @pTmenuitems$[@Ti], "Yuno";
- setarray @pTprice[@Ti], $QW_AW_PRICE;
-
- setarray @pTmap$[@Ti], "yuno.gat";
- setarray @pTXcoords[@Ti], 160;
- setarray @pTYcoords[@Ti], 168;
-
- QWS_Make_Town_Menu 20;
-//----------------Cancel
- setarray @pTmenuitems$[@Ti], "Cancel";
- setarray @pTprice[@Ti], 0;
-
- set @Tmenulist$[@Tj],@pTmenuitems$[@Ti];
- set @Tmenuref[@Tj],57005; // 57005='dead' in hex
- return;
-
-
-//----------------Make Town Menu Function
-
-function QWS_Make_Town_Menu {
- set @temptownmenubin,1;
- if (getarg(0) == 0) goto menu_item;
- set @templooptownmenu,0;
- do {
- set @temptownmenubin, @temptownmenubin * 2;
- set @templooptownmenu, @templooptownmenu + 1;
- }while (getarg(0) > @templooptownmenu);
-// check marker and make menu item
-menu_item:
- if ((@temptownmenubin & ##QWS_T_Unlock) != @temptownmenubin) {
- set @Ti,@Ti+1;
- return;
- }
- if (@pTprice[@Ti] != 0 && $QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" -> "+@pTprice[@Ti];
- if (@pTprice[@Ti] == 0 && $QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti];
- if (@pTprice[@Ti] != 0 && $QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"+" -> "+@pTprice[@Ti];
- if (@pTprice[@Ti] == 0 && $QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]";
- set @Tmenuref[@Tj],@Ti;
- set @Tj,@Tj+1;
- set @Ti,@Ti+1;
- return;
-
-}
-}
-
-//====================Dungeon=Menu=Arrays==========================
-
-//----------------A FAKE DUNGEON FOR EXAMPLE // I do this to find back sections quickly altho almost the same name is a line below it now
-// setarray @pDmenuitems$[@Di], "Fake Dungeon"; // Name of Dungeon shown in Dungeon select Menu
-// setarray @pDprice[@Di], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE)
-// setarray @pDfee$[@Di], "$QW_BW_FEE"; // Identifyer for the Dungeon fee caluclation (Basic ("$QW_BW_FEE"), Advanced ("$QW_AW_FEE"), Overseas ("$QW_OW_FEE")) please use setting in relation with option above (Don't forget "")
-// setarray @DLevels[@Di], 2; //number of levels in dungeon (very important if set to high will shift all leveldata!!)
-//
-// setarray @DGat$[@Dref], "example_01.gat", "example_02.gat"; // mapfilename of dungeon level
-// setarray @DLevelName$[@Dref], "Example Level 1", "Example Level 2"; // level name shown in dungeon level select
-// setarray @DXcoords[@Dref], 123, 234; // X warp coords
-// setarray @DYcoords[@Dref], 123, 234;// Y warp coords
-// setarray @DDepth[@Dref], 0, 1; // relative depth to entrance to calculate extra warp fee
-//
-// QWS_Make_Dungeon_Menu XXX
-//
-// the full wap commands send out by this scripts for these examples would be
-// for Example Level 1:
-//warp example_01.gat 123 123
-//
-// for Example Level 2:
-//warp example_02.gat 234 234
-//
-// use the same XXX number as you used when making your own dungeon unlocker (Warpra Helper) inside the dungeon
-// (usually half way near a warp to next level)
-// Read below how
-//
-// example:
-//
-//syntax:
-//mapname.gat,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{
-//
-// Full example using fake map & coords
-//
-//example_01.gat,213,213,4 script Warpra Helper 112,{
-// callfunc "QWS_Dungeon_Warpra",XXX,"A FAKE DUNGEON FOR EXAMPLE";
-// close;
-// }
-// use a free number for XXX, last used is 28, for Kiel Dungeon
-
-function script QWS_Darray {
- function QWS_Make_Dungeon_Menu;
-
- set @Di,0;
- set @Dj,0;
- set @Dref,0;
-//----------------ABYSS LAKE
- setarray @pDmenuitems$[@Di], "Abyss Lake";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 3;
-
- setarray @DGat$[@Dref], "abyss_01.gat", "abyss_02.gat", "abyss_03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 265, 275, 116;
- setarray @DYcoords[@Dref], 273, 270, 27;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 0;
-
-//----------------AMATSU DUNGEON
- setarray @pDmenuitems$[@Di], "Amatsu Dungeon";
- setarray @pDprice[@Di], $QW_OW_PRICE;
- setarray @pDfee$[@Di], "$QW_OW_FEE";
- setarray @DLevels[@Di], 3;
-
- setarray @DGat$[@Dref], "ama_dun01.gat", "ama_dun02.gat", "ama_dun03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 227, 32, 119;
- setarray @DYcoords[@Dref], 10, 43, 15;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 1;
-
-//----------------ANT HELL
- setarray @pDmenuitems$[@Di], "Ant Hell Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[2], 2;
-
- setarray @DGat$[@Dref], "anthell01.gat", "anthell02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 32, 34;
- setarray @DYcoords[@Dref], 262, 263;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 2;
-
-//----------------AYOTAYA
- setarray @pDmenuitems$[@Di], "Ayotaya Dungeon";
- setarray @pDprice[@Di], $QW_OW_PRICE;
- setarray @pDfee$[@Di], "$QW_OW_FEE";
- setarray @DLevels[3], 2;
-
- setarray @DGat$[@Dref], "ayo_dun01.gat", "ayo_dun02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 275, 150;
- setarray @DYcoords[@Dref], 17, 13;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 3;
-
-//----------------BYALAN
- setarray @pDmenuitems$[@Di], "Byalan Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[4], 5;
-
- setarray @DGat$[@Dref], "iz_dun00.gat", "iz_dun01.gat", "iz_dun02.gat", "iz_dun03.gat", "iz_dun04.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
- setarray @DXcoords[@Dref], 168, 41, 236, 32, 26;
- setarray @DYcoords[@Dref], 168, 37, 204, 63, 27;
- setarray @DDepth[@Dref], 0, 1, 2, 3, 4;
-
- QWS_Make_Dungeon_Menu 4;
-
-//----------------CLOCK TOWER
- setarray @pDmenuitems$[@Di], "Clock Tower Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[5], 8;
-
- setarray @DGat$[@Dref], "c_tower1.gat", "c_tower2.gat", "c_tower3.gat", "c_tower4.gat", "alde_dun01.gat", "alde_dun02.gat", "alde_dun03.gat", "alde_dun04.gat";
- setarray @DLevelName$[@Dref], "Clock Tower Level 1", "Clock Tower Level 2", "Clock Tower Level 3", "Clock Tower Level 4", "Basement 1F", "Basement 2F", "Basement 3F", "Basement 4F";
- setarray @DXcoords[@Dref], 200, 268, 64, 32, 197, 262, 276, 130;
- setarray @DYcoords[@Dref], 163, 26, 148, 63, 25, 41, 53, 130;
- setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2, 3, 4;
-
- QWS_Make_Dungeon_Menu 5;
-
-//----------------COAL MINE
- setarray @pDmenuitems$[@Di], "Coal Mine Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[6], 3;
-
- setarray @DGat$[@Dref], "mjo_dun01.gat", "mjo_dun02.gat", "mjo_dun03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 52, 381, 302;
- setarray @DYcoords[@Dref], 17, 343, 261;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 6;
-
-//----------------CULVERT
- setarray @pDmenuitems$[@Di], "Culvert Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[7], 4;
-
- setarray @DGat$[@Dref], "prt_sewb1.gat", "prt_sewb2.gat", "prt_sewb3.gat", "prt_sewb4.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
- setarray @DXcoords[@Dref], 132, 19, 180, 100;
- setarray @DYcoords[@Dref], 248, 19, 169, 92;
- setarray @DDepth[@Dref], 0, 1, 2, 3;
-
- QWS_Make_Dungeon_Menu 7;
-
-//----------------EINBECH DUNGEON
- setarray @pDmenuitems$[@Di], "Einbech Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[8], 2;
-
- setarray @DGat$[@Dref], "ein_dun01.gat", "ein_dun02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 22, 292;
- setarray @DYcoords[@Dref], 14, 290;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 8;
-
-//----------------GEFENIA DUNGEON
- setarray @pDmenuitems$[@Di], "Gefenia Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[9], 4;
-
- setarray @DGat$[@Dref], "gefenia01.gat", "gefenia02.gat", "gefenia03.gat", "gefenia04.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
- setarray @DXcoords[@Dref], 59, 201, 264, 33;
- setarray @DYcoords[@Dref], 167, 35, 236, 270;
- setarray @DDepth[@Dref], 0, 1, 2, 3;
-
- QWS_Make_Dungeon_Menu 9;
-
-//----------------GEFFEN DUNGEON
- setarray @pDmenuitems$[@Di], "Geffen Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 4;
-
- setarray @DGat$[@Dref], "gef_dun00.gat", "gef_dun01.gat", "gef_dun02.gat", "gef_dun03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
- setarray @DXcoords[@Dref], 104, 115, 106, 203;
- setarray @DYcoords[@Dref], 100, 236, 132, 200;
- setarray @DDepth[@Dref], 0, 1, 2, 3;
-
- QWS_Make_Dungeon_Menu 10;
-
-//----------------GLAST HEIM
- setarray @pDmenuitems$[@Di], "Glast Heim Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 17;
-
- setarray @DGat$[@Dref], "glast_01.gat", "gl_church.gat", "gl_chyard.gat", "gl_in01.gat", "gl_cas01.gat", "gl_cas02.gat", "gl_knt01.gat", "gl_knt02.gat", "gl_prison.gat", "gl_prison1.gat", "gl_step.gat", "gl_sew01.gat", "gl_sew02.gat", "gl_sew03.gat", "gl_sew04.gat", "gl_dun01.gat", "gl_dun02.gat";
- setarray @DLevelName$[@Dref], "Glast Heim Entrance", "St. Abbey", "Churchyard", "Inside Glast Heim", "Castle 1", "Castle 2", "Chivalry 1", "Chivalry 2", "Prison 1", "Prison 2", "Steps", "Sewers 1", "Sewers 2", "Sewers 3", "Sewers 4", "Lowest Cave 1", "Lowest Cave 2";
- setarray @DXcoords[@Dref], 370, 156, 147, 121, 199, 104, 150, 157, 14, 150, 117, 258, 108, 171, 68, 133, 224;
- setarray @DYcoords[@Dref], 300, 8, 15, 59, 29, 25, 10, 287, 70, 14, 124, 255, 291, 273, 277, 271, 274;
- setarray @DDepth[@Dref], 0, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 4, 5, 6;
-
- QWS_Make_Dungeon_Menu 11;
-
-//----------------GONRYUN DUNGEON
- setarray @pDmenuitems$[@Di], "Gonryun Dungeon";
- setarray @pDprice[@Di], $QW_OW_PRICE;
- setarray @pDfee$[@Di], "$QW_OW_FEE";
- setarray @DLevels[@Di], 3;
-
- setarray @DGat$[@Dref], "gon_dun01.gat", "gon_dun02.gat", "gon_dun03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 143, 17, 68;
- setarray @DYcoords[@Dref], 59, 114, 9;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 12;
-
-//----------------HIDDEN DUNGEON
- setarray @pDmenuitems$[@Di], "Hidden Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 3;
-
- setarray @DGat$[@Dref], "prt_maze01.gat", "prt_maze02.gat", "prt_maze03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 176, 94, 23;
- setarray @DYcoords[@Dref], 6, 19, 8;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 13;
-
-//----------------JUPEROS CAVE
- setarray @pDmenuitems$[@Di], "Juperos Cave";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "juperos_01.gat", "juperos_02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 53, 36;
- setarray @DYcoords[@Dref], 247, 60;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 14;
-
-//----------------KIEL DUNGEON
- setarray @pDmenuitems$[@Di], "Kiel Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "kh_dun01.gat", "kh_dun02.gat";
- setarray @DLevelName$[@Dref], "1st Floor", "2nd Floor";
- setarray @DXcoords[@Dref], 63, 42;
- setarray @DYcoords[@Dref], 10, 197;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 28;
-
-//----------------LIGHTHALZEN BIO LAB
- setarray @pDmenuitems$[@Di], "Lighthalzen Bio Lab";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 3;
-
- setarray @DGat$[@Dref], "lhz_dun01.gat", "lhz_dun02.gat", "lhz_dun03.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 150, 150, 140;
- setarray @DYcoords[@Dref], 287, 18, 137;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 15;
-
-//----------------LOUYANG DUNGEON
- setarray @pDmenuitems$[@Di], "Louyang Dungeon";
- setarray @pDprice[@Di], $QW_OW_PRICE;
- setarray @pDfee$[@Di], "$QW_OW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "lou_dun02.gat", "lou_dun03.gat";
- setarray @DLevelName$[@Dref], "Royal Tomb Level 1", "Royal Tomb Level 2";
- setarray @DXcoords[@Dref], 282, 165;
- setarray @DYcoords[@Dref], 20, 38;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 16;
-
-//----------------MAGMA DUNGEON
- setarray @pDmenuitems$[@Di], "Magma Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "mag_dun01.gat", "mag_dun02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 126, 47;
- setarray @DYcoords[@Dref], 69, 32;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 17;
-
-//----------------ODIN TEMPLE
- setarray @pDmenuitems$[@Di], "Odin Temple";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 1;
-
- setarray @DGat$[@Dref], "odin_tem01.gat";
- setarray @DLevelName$[@Dref], "Level 1";
- setarray @DXcoords[@Dref], 96;
- setarray @DYcoords[@Dref], 145;
- setarray @DDepth[@Dref], 0;
-
- QWS_Make_Dungeon_Menu 18;
-
-//----------------ORC DUNGEON
- setarray @pDmenuitems$[@Di], "Orc Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "orcsdun01.gat", "orcsdun02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 32, 21;
- setarray @DYcoords[@Dref], 169, 185;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 19;
-
-//----------------PAYON DUNGEON
- setarray @pDmenuitems$[@Di], "Payon Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 5;
-
- setarray @DGat$[@Dref], "pay_dun00.gat", "pay_dun01.gat", "pay_dun02.gat", "pay_dun03.gat", "pay_dun04.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
- setarray @DXcoords[@Dref], 22, 19, 19, 155, 201;
- setarray @DYcoords[@Dref], 180, 33, 63, 159, 204;
- setarray @DDepth[@Dref], 0, 1, 2, 3, 4;
-
- QWS_Make_Dungeon_Menu 20;
-
-//----------------PYRAMIDS
- setarray @pDmenuitems$[@Di], "Pyramids Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 6;
-
- setarray @DGat$[@Dref], "moc_pryd01.gat", "moc_pryd02.gat", "moc_pryd03.gat", "moc_pryd04.gat", "moc_pryd05.gat", "moc_pryd06.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Basement 1", "Basement 2";
- setarray @DXcoords[@Dref], 192, 10, 100, 181, 94, 192;
- setarray @DYcoords[@Dref], 9, 192, 92, 11, 96, 8;
- setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2;
-
- QWS_Make_Dungeon_Menu 21;
-
-//----------------SPHINX
- setarray @pDmenuitems$[@Di], "Sphinx Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 5;
-
- setarray @DGat$[@Dref], "in_sphinx1.gat", "in_sphinx2.gat", "in_sphinx3.gat", "in_sphinx4.gat", "in_sphinx5.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
- setarray @DXcoords[@Dref], 192, 149, 210, 10, 100;
- setarray @DYcoords[@Dref], 9, 81, 54, 222, 99;
- setarray @DDepth[@Dref], 0, 1, 2, 3, 4;
-
- QWS_Make_Dungeon_Menu 22;
-
-//----------------SUNKEN SHIP
- setarray @pDmenuitems$[@Di], "Sunken Ship Dungeon";
- setarray @pDprice[@Di], $QW_BW_PRICE;
- setarray @pDfee$[@Di], "$QW_BW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "treasure01.gat", "treasure02.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2";
- setarray @DXcoords[@Dref], 69, 102;
- setarray @DYcoords[@Dref], 24, 27;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 23;
-
-//----------------THANATOS TOWER
- setarray @pDmenuitems$[@Di], "Thanatos Tower";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 13;
-
- setarray @DGat$[@Dref], "tha_t01.gat", "tha_t02.gat", "tha_t03.gat", "tha_t04.gat", "tha_t05.gat", "tha_t06.gat", "tha_t07.gat", "tha_t08.gat", "tha_t09.gat", "tha_t10.gat", "tha_t11.gat", "tha_t12.gat", "thana_boss.gat";
- setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6", "Level 7", "Level 8", "Level 9", "Level 10", "Level 11", "Level 12", "Thanatos Boss";
- setarray @DXcoords[@Dref], 150, 150, 220, 59, 62, 206, 35, 105, 88, 168, 90, 129, 85;
- setarray @DYcoords[@Dref], 35, 136, 158, 143, 11, 8, 166, 44, 145, 138, 36, 83, 76;
- setarray @DDepth[@Dref], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;
-
- QWS_Make_Dungeon_Menu 24;
-
-//----------------TOY FACTORY
- setarray @pDmenuitems$[@Di], "Toy Factory Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 2;
-
- setarray @DGat$[@Dref], "xmas_dun01.gat", "xmas_dun02.gat";
- setarray @DLevelName$[@Dref], "Factory Warehouse", "Classifying Room";
- setarray @DXcoords[@Dref], 205, 129;
- setarray @DYcoords[@Dref], 16, 133;
- setarray @DDepth[@Dref], 0, 1;
-
- QWS_Make_Dungeon_Menu 25;
-
-//----------------TURTLE ISTLAND
- setarray @pDmenuitems$[@Di], "Turtle Island Dungeon";
- setarray @pDprice[@Di], $QW_AW_PRICE;
- setarray @pDfee$[@Di], "$QW_AW_FEE";
- setarray @DLevels[@Di], 4;
-
- setarray @DGat$[@Dref], "tur_dun01.gat", "tur_dun02.gat", "tur_dun03.gat", "tur_dun04.gat";
- setarray @DLevelName$[@Dref], "Outside", "Level 1", "Level 2", "Level 3";
- setarray @DXcoords[@Dref], 161, 148, 132, 100;
- setarray @DYcoords[@Dref], 34, 256, 190, 192;
- setarray @DDepth[@Dref], 0, 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 26;
-
-//----------------UMBALA
- setarray @pDmenuitems$[@Di], "Umbala Dungeon";
- setarray @pDprice[@Di], $QW_OW_PRICE;
- setarray @pDfee$[@Di], "$QW_OW_FEE";
- setarray @DLevels[@Di], 3;
-
- setarray @DGat$[@Dref], "um_dun01.gat", "um_dun02.gat", "yggdrasil01.gat";
- setarray @DLevelName$[@Dref], "Carpenter's Shop in The Tree", "Passage to a Foreign World", "Hvergelmir's Fountain";
- setarray @DXcoords[@Dref], 205, 48, 40;
- setarray @DYcoords[@Dref], 16, 30, 63;
- setarray @DDepth[@Dref], 0, 1, 2;
-
- QWS_Make_Dungeon_Menu 27;
-
-//----------------Cancel
- setarray @pDmenuitems$[@Di], "Cancel";
- setarray @pDprice[@Di], 0;
-
- set @Dmenulist$[@Dj],@pDmenuitems$[@Di];
- set @Dmenuref[@Dj],57005; // 57005='dead' in hex
- return;
-
-
-//----------------Make Dungeon Menu Function
-
-function QWS_Make_Dungeon_Menu {
- set @tempdungeonmenubin,1;
- if (getarg(0) == 0) goto menu_item;
- set @temploopdungeonmenu,0;
- do {
- set @tempdungeonmenubin, @tempdungeonmenubin * 2;
- set @temploopdungeonmenu, @temploopdungeonmenu + 1;
- }while (getarg(0) > @temploopdungeonmenu);
-// check marker and make menu item
-menu_item:
- if ((@tempdungeonmenubin & ##QWS_D_Unlock) != @tempdungeonmenubin) {
- setarray @DLocRef[@Di], @Dref;
- set @Dref, @Dref+@DLevels[@Di];
- set @Di,@Di+1;
- return;
- }
- if ($QW_MapUserShow == 1) {
- set @tempmapusers,0;
- set @mapusersloop,0;
- do {
- set @tempmapusers,(getmapusers(@DGat$[@Dref+@mapusersloop]) + @tempmapusers);
- set @mapusersloop, (@mapusersloop + 1);
- }while (@DLevels[@Di] > @mapusersloop);
- if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"] -> "+@pDprice[@Di];
- if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"]";
- set @Dmenuref[@Dj],@Di;
- set @Dj,@Dj+1;
- setarray @DLocRef[@Di], @Dref;
- set @Dref, @Dref+@DLevels[@Di];
- set @Di,@Di+1;
- return;
- }
- if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" -> "+@pDprice[@Di];
- if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di];
- set @Dmenuref[@Dj],@Di;
- set @Dj,@Dj+1;
- setarray @DLocRef[@Di], @Dref;
- set @Dref, @Dref+@DLevels[@Di];
- set @Di,@Di+1;
- return;
-
-}
-}
-
-function script QWS_DLarray {
-//----------------Start building Menu
- set @DWref,@DLocRef[@DwarpMenu]; // That's our reference to the arrays with leveldata.
- set @DWi,0; // That's our loop counter.
- set @DWj,0; // That's the menu lines counter.
- cleararray @DWLmenulist$[0],"",20; // Clearing the array to get rid off ghost items in menu
- do {
- if ($QW_DL == 0 || $QW_DDL >= @DDepth[@DWref]) {
- set @warpprice, (@pDprice[@DwarpMenu]+ (getd(@pDfee$[@DwarpMenu])*@DDepth[@DWref]));
-
- if (@warpprice != 0 && $QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" -> "+@warpprice;
- if (@warpprice == 0 && $QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref];
- if (@warpprice != 0 && $QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"] -> "+@warpprice;
- if (@warpprice == 0 && $QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"]";
- set @DWLmenuref[@DWj],@DWref;
-
- set @DWj,@DWj+1;
- }
- set @DWref, @DWref+1;
- set @DWi,@DWi+1;
- }while (@DWi < @DLevels[@DwarpMenu]);
- set @DWLmenulist$[@DWj], "Exit";
- set @DWLmenuref[@DWj],57005; // 57005='dead' in hex
- return;
- }
-
-
-//=================Backwards=Compatibility=Pre=1.8=================
-
-function script QWS_BackComp {
-// reference where i put the towns: "Prontera"[0], "Alberta"[1], "Aldebaran"[2], "Amatsu"[3], "Ayothaya"[4], "Comodo"[5], "Einbech"[6], "Einbroch"[7], "Geffen"[8], "Gonryun"[9], "Hugel"[10], "Izlude"[11], "Jawaii"[12], "Lighthalzen"[13], "Louyang"[14], "Lutie"[15], "Morroc"[16], "Niflheim"[17], "Payon"[18], "Umbala"[19], "Yuno"[20];
-// reference where i put the dungeons: "Abyss Lake"[0], "Amatsu Dungeon"[1], "Ant Hell Dungeon"[2], "Ayotaya Dungeon"[3], "Byalan Dungeon"[4], "Clock Tower Dungeon"[5], "Coal Mine Dungeon"[6], "Culvert Dungeon"[7], "Einbech Dungeon"[8], "Gefenia Dungeon"[9], "Geffen Dungeon"[10], "Glast Heim Dungeon"[11], "Gonryun Dungeon"[12], "Hidden Dungeon"[13], "Juperos Cave"[14], "Lighthalzen Bio Lab"[15], "Louyang Dungeon"[16], "Magma Dungeon"[17], "Odin Temple"[18], "Orc Dungeon"[19], "Payon Dungeon"[20], "Pyramids Dungeon"[21], "Sphinx Dungeon"[22], "Sunken Ship Dungeon"[23], "Thanatos Tower"[24], "Toy Factory Dungeon"[25], "Turtle Island Dungeon"[26], "Umbala Dungeon"[27], "Kiel Dungeon[28];
-// also clears variables so that the account file variables can be used for something else variable 0 = variable delete on next save
-
-// Towns
- set @towntemp,0;
- if (#prontera != 0) set @towntemp,@towntemp + 1;
- if (#alberta != 0) set @towntemp,@towntemp + 2;
- if (#aldebaran != 0) set @towntemp,@towntemp + 4;
- if (#amatsu != 0) set @towntemp,@towntemp + 8;
- if (#ayotaya != 0) set @towntemp,@towntemp + 16;
- if (#comodo != 0) set @towntemp,@towntemp + 32;
- if (#einbech != 0) set @towntemp,@towntemp + 64;
- if (#einbroch != 0) set @towntemp,@towntemp + 128;
- if (#geffen != 0) set @towntemp,@towntemp + 256;
- if (#gonryun != 0) set @towntemp,@towntemp + 512;
- if (#hugel != 0) set @towntemp,@towntemp + 1024;
- if (#izlude != 0) set @towntemp,@towntemp + 2048;
- if (#jawaii != 0) set @towntemp,@towntemp + 4096;
- if (#lighthalzen != 0) set @towntemp,@towntemp + 8192;
- if (#louyang != 0) set @towntemp,@towntemp + 16384;
- if (#xmas != 0) set @towntemp,@towntemp + 32768;
- if (#morocc != 0) set @towntemp,@towntemp + 65536;
- if (#niflheim != 0) set @towntemp,@towntemp + 131072;
- if (#payon != 0) set @towntemp,@towntemp + 262144;
- if (#umbala != 0) set @towntemp,@towntemp + 524288;
- if (#yuno != 0) set @towntemp,@towntemp + 1048576;
-// Clear Town variables
- set #prontera,0;
- set #alberta,0;
- set #aldebaran,0;
- set #amatsu,0;
- set #ayotaya,0;
- set #comodo,0;
- set #einbech,0;
- set #einbroch,0;
- set #geffen,0;
- set #gonryun,0;
- set #hugel,0;
- set #izlude,0;
- set #jawaii,0;
- set #lighthalzen,0;
- set #louyang,0;
- set #xmas,0;
- set #morocc,0;
- set #niflheim,0;
- set #payon,0;
- set #umbala,0;
- set #yuno,0;
-// set Town warp unlock variable
-set ##QWS_T_Unlock, (##QWS_T_Unlock | @towntemp);
- //because multiple account servers now stack on 1 variable i used a 'or' to stack them
-// Dungeons
- set @dungeontemp,0;
- if (#abyss != 0) set @dungeontemp,@dungeontemp + 1;
- if (#ama_dun != 0) set @dungeontemp,@dungeontemp + 2;
- if (#anthell != 0) set @dungeontemp,@dungeontemp + 4;
- if (#ayotaya_dun != 0) set @dungeontemp,@dungeontemp + 8;
- if (#iz_dun != 0) set @dungeontemp,@dungeontemp + 16;
- if (#c_tower != 0) set @dungeontemp,@dungeontemp + 32;
- if (#mjo_dun != 0) set @dungeontemp,@dungeontemp + 64;
- if (#prt_sewb != 0) set @dungeontemp,@dungeontemp + 128;
- if (#einbech_dun != 0) set @dungeontemp,@dungeontemp + 256;
- if (#gefenia != 0) set @dungeontemp,@dungeontemp + 512;
- if (#gef_dun != 0) set @dungeontemp,@dungeontemp + 1024;
- if (#gl_dun != 0) set @dungeontemp,@dungeontemp + 2048;
- if (#gon_dun != 0) set @dungeontemp,@dungeontemp + 4096;
- if (#hid_dun != 0) set @dungeontemp,@dungeontemp + 8192;
- if (#juperos != 0) set @dungeontemp,@dungeontemp + 16384;
- if (#lighthalzen_dun != 0) set @dungeontemp,@dungeontemp + 32768;
- if (#louyang_dun != 0) set @dungeontemp,@dungeontemp + 65536;
- if (#mag_dun != 0) set @dungeontemp,@dungeontemp + 131072;
- if (#odintemple != 0) set @dungeontemp,@dungeontemp + 262144;
- if (#orcsdun != 0) set @dungeontemp,@dungeontemp + 524288;
- if (#pay_dun != 0) set @dungeontemp,@dungeontemp + 1048576;
- if (#moc_pryd != 0) set @dungeontemp,@dungeontemp + 2097152;
- if (#in_sphinx != 0) set @dungeontemp,@dungeontemp + 4194304;
- if (#treasure != 0) set @dungeontemp,@dungeontemp + 8388608;
- if (#thanatos_tower != 0) set @dungeontemp,@dungeontemp + 16777216;
- if (#xmas_dun != 0) set @dungeontemp,@dungeontemp + 33554432;
- if (#tur_dun != 0) set @dungeontemp,@dungeontemp + 67108864;
- if (#um_dun != 0) set @dungeontemp,@dungeontemp + 134217728;
-// Clear Dungeon variables
- set #abyss,0;
- set #ama_dun,0;
- set #anthell,0;
- set #ayotaya_dun,0;
- set #iz_dun,0;
- set #c_tower,0;
- set #mjo_dun,0;
- set #prt_sewb,0;
- set #einbech_dun,0;
- set #gefenia,0;
- set #gef_dun,0;
- set #gl_dun,0;
- set #gon_dun,0;
- set #hid_dun,0;
- set #juperos,0;
- set #lighthalzen_dun,0;
- set #louyang_dun,0;
- set #mag_dun,0;
- set #odintemple,0;
- set #orcsdun,0;
- set #pay_dun,0;
- set #moc_pryd,0;
- set #in_sphinx,0;
- set #treasure,0;
- set #thanatos_tower,0;
- set #xmas_dun,0;
- set #tur_dun,0;
- set #um_dun,0;
-// set Town warp unlock variable
-set ##QWS_D_Unlock, (##QWS_D_Unlock | @dungeontemp);
-//mark that this character has done the upgrade to 1.8
-set ##QWS_UP,18;
-return;
-}
-
-
-//===================Extra=Variable=Clear=Pre=1.8==================
-function script Extra_Variable_Clear {
-// Clear Town variables
- set #prontera,0;
- set #alberta,0;
- set #aldebaran,0;
- set #amatsu,0;
- set #ayotaya,0;
- set #comodo,0;
- set #einbech,0;
- set #einbroch,0;
- set #geffen,0;
- set #gonryun,0;
- set #hugel,0;
- set #izlude,0;
- set #jawaii,0;
- set #lighthalzen,0;
- set #louyang,0;
- set #xmas,0;
- set #morocc,0;
- set #niflheim,0;
- set #payon,0;
- set #umbala,0;
- set #yuno,0;
-
-// Clear Dungeon variables
- set #abyss,0;
- set #ama_dun,0;
- set #anthell,0;
- set #ayotaya_dun,0;
- set #iz_dun,0;
- set #c_tower,0;
- set #mjo_dun,0;
- set #prt_sewb,0;
- set #einbech_dun,0;
- set #gefenia,0;
- set #gef_dun,0;
- set #gl_dun,0;
- set #gon_dun,0;
- set #hid_dun,0;
- set #juperos,0;
- set #lighthalzen_dun,0;
- set #louyang_dun,0;
- set #mag_dun,0;
- set #odintemple,0;
- set #orcsdun,0;
- set #pay_dun,0;
- set #moc_pryd,0;
- set #in_sphinx,0;
- set #treasure,0;
- set #thanatos_tower,0;
- set #xmas_dun,0;
- set #tur_dun,0;
- set #um_dun,0;
-
-// as the account based variables are limited just run this on every character to save some variables
-set QWS_ExtraVARClear,18;
-return;
-}
-
-//================Dungeon=Warpras=That=Only=Unlock=================
-
-function script QWS_Dungeon_Warpra {
- function QWS_D_getbin;
- function QWS_D_setbin;
-
- if (QWS_D_getbin(getarg(0)) == 0 && getarg(1) != "") {
- mes "[Warpra]";
- mes getarg(1)+" unlocked!";
- QWS_D_setbin(getarg(0));
- return;
- } else if (QWS_D_getbin(getarg(0)) == 1){
- mes "[Warpra]";
- mes "Sorry I can only unlock this location.";
- } else
- debugmes "QWS_Dungeon_Warpra error, improper syntax ?";
- return;
-
-
-function QWS_D_setbin {
- set @tempsetbindata,1;
- if (getarg(0) == 0) goto binset;
- set @temploopsetbin,0;
- do {
- set @tempsetbindata, @tempsetbindata * 2;
- set @temploopsetbin, @temploopsetbin + 1;
- } while (getarg(0) > @temploopsetbin);
-binset:
- set ##QWS_D_Unlock,(##QWS_D_Unlock | @tempsetbindata);
- return;
-}
-
-function QWS_D_getbin {
- set @tempgetbindata,1;
- if (getarg(0) == 0) goto binget;
- set @temploopgetbin,0;
- do {
- set @tempgetbindata, @tempgetbindata * 2;
- set @temploopgetbin, @temploopgetbin + 1;
- } while (getarg(0) > @temploopgetbin);
-binget:
- if ((@tempgetbindata & ##QWS_D_Unlock) == @tempgetbindata) return 1;
- return 0;
-}
-}
-
-//==========================Town=Warpras===========================
-
-function script QWS_Town_Warpra {
- function QWS_T_getbin;
- function QWS_T_setbin;
-
- if (QWS_T_getbin(getarg(0)) == 0 && getarg(1) != "") {
- mes "[Warpra]";
- mes getarg(1)+" unlocked!";
- QWS_T_setbin(getarg(0));
- return;
- } else if (QWS_T_getbin(getarg(0)) == 1){
-callfunc "Q_Warpra",0;
- } else
- debugmes "QWS_Town_Warpra error, improper syntax ?";
- return;
-
-
-function QWS_T_setbin {
- set @tempsetbindata,1;
- if (getarg(0) == 0) goto binset;
- set @temploopsetbin,0;
- do {
- set @tempsetbindata, @tempsetbindata * 2;
- set @temploopsetbin, @temploopsetbin + 1;
- } while (getarg(0) > @temploopsetbin);
-binset:
- set ##QWS_T_Unlock,(##QWS_T_Unlock | @tempsetbindata);
- return;
-}
-
-function QWS_T_getbin {
- set @tempgetbindata,1;
- if (getarg(0) == 0) goto binget;
- set @temploopgetbin,0;
- do {
- set @tempgetbindata, @tempgetbindata * 2;
- set @temploopgetbin, @temploopgetbin + 1;
- } while (getarg(0) > @temploopgetbin);
-binget:
- if ((@tempgetbindata & ##QWS_T_Unlock) == @tempgetbindata) return 1;
- return 0;
-}
-}
-//============================Warpras==============================
-
-alb2trea.gat,73,101,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-ama_fild01.gat,178,325,1 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-gef_fild10.gat,71,339,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-izlu2dun.gat,104,82,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-mjolnir_02.gat,85,363,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-moc_fild04.gat,207,331,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-moc_fild19.gat,106,97,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-moc_ruins.gat,64,166,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-niflheim.gat,197,192,3 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-pay_arche.gat,39,135,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-prt_fild05.gat,273,215,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-tur_dun01.gat,148,239,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-valkyrie.gat,48,35,8 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-yuno_fild03.gat,37,135,4 script Warpra 113,{
- callfunc "Q_Warpra",1;
-}
-
-alberta.gat,32,240,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",1,"Alberta Town";
- close;
-}
-aldebaran.gat,146,118,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",2,"Aldebaran Town";
- close;
-}
-ayothaya.gat,216,171,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",4,"Ayotaya Town";
- close;
-}
-amatsu.gat,193,81,1 script Warpra 113,{
- callfunc "QWS_Town_Warpra",3,"Amatsu Town";
- close;
-}
-comodo.gat,195,158,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",5,"Comodo Town";
- close;
-}
-einbroch.gat,229,196,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",7,"Einbroch Town";
- close;
-}
-einbech.gat,173,131,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",6,"Einbech Town";
- close;
-}
-geffen.gat,116,66,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",8,"Geffen Town";
- close;
-}
-gonryun.gat,152,130,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",9,"Gonryun Town";
- close;
-}
-hugel.gat,90,127,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",10,"Hugel Town";
- close;
-}
-jawaii.gat,107,182,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",12,"Jawaii Town";
- close;
-}
-izlude.gat,132,116,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",11,"Izlude Town";
- close;
-}
-lighthalzen.gat,153,100,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",13,"Lighthalzen Town";
- close;
-}
-louyang.gat,211,106,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",14,"Louyang Town";
- close;
-}
-morocc.gat,157,95,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",16,"Morroc Town";
- close;
-}
-nif_fild01.gat,319,77,1 script Warpra 113,{
- callfunc "QWS_Town_Warpra",17,"Niflheim Town";
- close;
-}
-payon.gat,183,110,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",18,"Payon Town";
- close;
-}
-prontera.gat,147,172,5 script Warpra 113,{
- callfunc "QWS_Town_Warpra",0,"Prontera Town";
- close;
-}
-umbala.gat,133,130,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",19,"Umbala Town";
- close;
-}
-xmas.gat,151,136,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",15,"Lutie Town";
- close;
-}
-yuno.gat,138,162,4 script Warpra 113,{
- callfunc "QWS_Town_Warpra",20,"Yuno Town";
- close;
-}
-
-abyss_02.gat,274,266,1 script Warpra 113,{
- callfunc "QWS_Dungeon_Warpra",0,"Abyss Lake";
- close;
-}
-
-ama_dun02.gat,192,118,5 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",1,"Amatsu Dungeon";
- close;
-}
-
-anthell02.gat,170,165,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",2,"Ant Hell Dungeon";
- close;
-}
-
-ayo_dun02.gat,258,193,5 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",3,"Ayotaya Dungeon";
- close;
-}
-
-ein_dun02.gat,292,282,1 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",8,"Einbech Dungeon";
- close;
-}
-
-iz_dun03.gat,202,47,2 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",4,"Byalan Dungeon";
- close;
-}
-
-c_tower3.gat,129,106,4 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",5,"Clock Tower Dungeon";
- close;
-}
-
-mjo_dun02.gat,39,25,4 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",6,"Coal Mine Dungeon";
- close;
-}
-
-prt_sewb2.gat,176,30,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",7,"Culvert Dungeon";
- close;
-}
-
-gefenia03.gat,137,34,0 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",9,"Gefenia Dungeon";
- close;
-}
-
-gef_dun02.gat,218,61,2 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",10,"Gefen Dungeon";
- close;
-}
-
-glast_01.gat,371,308,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",11,"Glast Heim Dungeon";
- close;
-}
-
-gon_dun01.gat,167,273,4 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",12,"Gonryun Dungeon";
- close;
-}
-
-juperos_02.gat,127,154,5 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",14,"Juperos Cave";
- close;
-}
-
-kh_dun01.gat,14,224,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",28,"Kiel Dungeon";
- close;
-}
-
-lhz_dun02.gat,156,151,5 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",15,"Lighthalzen Bio Lab";
- close;
-}
-
-lou_dun02.gat,168,264,4 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",16,"Louyang Dungeon";
- close;
-}
-
-mag_dun02.gat,46,41,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",17,"Magma Dungeon";
- close;
-}
-
-odin_tem01.gat,115,148,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",18,"Odin Temple";
- close;
-}
-
-orcsdun01.gat,185,11,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",19,"Orc Dungeon";
- close;
-}
-
-pay_dun03.gat,162,143,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",20,"Payon Dungeon";
- close;
-}
-
-moc_pryd02.gat,101,95,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",21,"Pyramides Dungeon";
- close;
-}
-
-in_sphinx2.gat,274,268,1 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",22,"Sphinx Dungeon";
- close;
-}
-
-tha_t07.gat,111,162,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",24,"Thanatos Tower";
- close;
-}
-
-treasure02.gat,104,40,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",23,"Sunken Ship Dungeon";
- close;
-}
-
-xmas_dun02.gat,124,131,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",25,"Toy Factory Dungeon";
- close;
-}
-
-um_dun02.gat,44,28,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",27,"Umbala Dungeon";
- close;
-}
-
-tur_dun02.gat,162,23,3 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",26,"Turtle Island Dungeon";
- close;
-}
-prt_maze02.gat,102,69,4 script Warpra Helper 112,{
- callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon";
- close;
-}
+//===== eAthena Script ============================================ +//= Quest Warper Script +//===== By: ======================================================= +//= Old Warper 2 by Darkchild - Remade with quest format by DZeroX +//= Huge Rewrite by Neouni +//===== Current Version: ========================================== +//= 2.0c +//===== Compatible With: ========================================== +//= Any eAthena Version +//===== Description: ============================================== +//= Warper that works only after locations are unlocked +//===== Warning: ================================================== +// you have to set the securitycode value [1337] the same as in +// functions_kafras.txt if you changed it !! +//===== Additional Comments: ====================================== +//= 1.0 - NPCs created +//= 1.1 - Add Dungeons by sturm +//= 1.2 - Add All char in account unlocked by ace_killer +//= 1.3 - Add new 7 towns and 7 dungeons by escoteiro +// - Correct bug jawaii town by escoteiro +// - Remove some excessive warpras by escoteiro +//= 1.4 - Rewrite of the Warpa system [Neouni] +// - Corrected some bugs caused by autoconverting the old script +//= 1.4a - Rewrite of menu to be custom for each player [Neouni] +// - Dungeon listing rewrite +// - Town listing rewrite +// - GameMaster can Customise Main menu +//= 1.4b - Pricing round [Neouni] +// - GM menu added for pricing +// - Town Warp pricing tags added +// - Dungeon Warp pricing tags added +//= 1.5 - storage functions pricing [Neouni] +// - storage pricing added +// - kafra points setting added +// - kafra storage code security added +// - Healing scripts pricing added +// - Heal Part script added +//= 1.6 - Dungeon warp [Neouni] (beta only) +// - added option to add a extra fee for going down deeper into dungeon +// partly by rebuilding the dungeon warping into variable menu's +//= 1.6a - alot of fixes for beta release [Neouni] (public release) +// - fixed syntax problems +// - fixed missing pyramid gats in @DGat$ array +// - removed the culver level 5 that didn't exist +// and caused quite alot of problems (i didn't check while converting) +//-1.7 - Readability of Dungeon menu building increased [Neouni] +// - Thanatos Tower & Louyang Dungeon added +//-1.8 - changed around unlock variables [Neouni] +// - Moved warp variables to mark what you have unlocked to an binary array in login based permanent variable +// (warp variables are saved in login database, so all charservers have these unlocked) +// - Town Warp unlock array max 21/(unknown max) items used instead of max account #variables 32 ! +// - Dungeon Warp unlock array 28/(unknown max) items used instead of max account #variables 32 ! +// - (max login ##variables = 16, i used 3) +// - old variables are cleared on next save +// - Extra Variable clear added for every character, just in case (request by Terces) +//-1.8a - Show ammount of users on map [Neouni] +// - Default = off, enable in GM menu +// - Requested by escoteiro +//-1.8b - Small typo fixed in stampcard script [Neouni] +// - Reported by escoteiro +//-1.9 - Making it more edit friendly [Neouni] +// - Made Dungeon warp arrays more readable & editable (QWS_Darray) +// - Made town warp arrays more readable & editable (QWS_Tarray) +//-2.0 - Special Warp menu added [Neouni] +// - when all towns and dungeons are collected a new option on the main menu will show +// - it will only show when you setup the mapname of the warp ! +// - requested by escoteiro +// - several bugs fixed +//-2.0a - Dungeon Level Limit & Split dungeon fees +// - Limits dungeon based on Depth, access special setup menu thru GM-Menu +// - Dungeon fees split up based on Basic , Advanced & Overseas +// - Old Dungeon fee system removed, all dungeon fees now set to 0 +//-2.0b - Special warpname menu option name bug fixed +//-2.0c - Parenthesis fixes [KarLaeda] +//================================================================= + +//========================Function=&=Script======================== + + +function script Q_Warpra { +// Quick hack for backwards compatibility pre 1.8 +if (##QWS_UP < 18) callfunc "QWS_BackComp"; +// Extra clear variables because marker is saved on all char servers and variables can be on multiple servers +if (QWS_ExtraVARClear < 18) callfunc "Extra_Variable_Clear"; + + mes "[Warpra]"; + mes "Hello,"; + mes "I can warp you to any town or dungeon, but you need to unlock them first."; + mes "To unlock them, you have to visit us."; + mes "What do you need?"; + + if(getarg(0) == 0) callfunc "QWS_MMarray",0; + if(getarg(0) == 1) callfunc "QWS_MMarray",1; + + set @MMenu,select(@Mmenulist$[0],@Mmenulist$[1],@Mmenulist$[2],@Mmenulist$[3],@Mmenulist$[4],@Mmenulist$[5],@Mmenulist$[6],@Mmenulist$[7],@Mmenulist$[8],@Mmenulist$[9],@Mmenulist$[10],@Mmenulist$[11]); + + switch(@Mmenuref[@MMenu-1]+1){ + case 1: + goto GM_Menu; + case 2: + warp $QW_SP_WarpMap$, $QW_SP_WarpX, $QW_SP_WarpY; + close2; + debugmes "Please check your special warp menu settings on the Warpra"; + end; + case 3: + goto L_town; + case 4: + goto L_dungeon; + case 5: + goto L_FewWarps; + case 6: + goto L_NoUnlock; + case 7: + goto L_heal_Full; + case 8: + goto L_heal_Part; + case 9: + goto L_Storage; + case 10: + goto L_GStorage; + case 11: + goto L_end; + default: + goto L_end; +} + +//=====================GM-Menu=Functions=========================== + +GM_Menu: +next; +//----------------Town-Warp + if ($QW_TW_OFF == 0) mes "Town warping = ^00FF00 On ^000000"; + if ($QW_TW_OFF == 1) mes "Town warping = ^FF0000 Off ^000000"; +//----------------Dungeon-Warp + if ($QW_DW_OFF == 0) mes "Dungeon warping = ^00FF00 On ^000000"; + if ($QW_DW_OFF == 1) mes "Dungeon warping = ^FF0000 Off ^000000"; +//----------------Dungeon-Depth-Limit + if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000"; + if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000"; + mes "If on Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000"; +//----------------ShowMapUsers + if ($QW_MapUserShow == 1) mes "Show Map Users = ^00FF00 On ^000000"; + if ($QW_MapUserShow == 0) mes "Show Map Users = ^FF0000 Off ^000000"; +//----------------Healfull + if ($QW_HF == 1) mes "Healing full = ^00FF00 On ^000000"; +//----------------Healpart + if ($QW_HP == 1) mes "Healing partly = ^00FF00 On ^000000"; + if ($QW_HF == 0 && $QW_HP == 0) mes "Healing = ^FF0000 Off ^000000"; +//----------------Storage + if ($QW_Stor == 1) mes "Storage = ^00FF00 On ^000000"; + if ($QW_Stor == 0) mes "Storage = ^FF0000 Off ^000000"; +//----------------GuildStorage + if ($QW_GStor == 1) mes "Guild Storage = ^00FF00 On ^000000"; + if ($QW_GStor == 0) mes "Guild Storage = ^FF0000 Off ^000000"; +//----------------KafraPoints + if ($QW_KPoint == 1) mes "Kafra points collect = ^00FF00 On ^000000"; + if ($QW_KPoint == 0) mes "Kafra points collect = ^FF0000 Off ^000000"; +//----------------GMmenu + switch(select("Town Warping","Dungeon Warping","Dungeon Level Limit","Show Map Users","Healing full","Healing partly","Storage","Guild Storage","Kafra points collect","Set Prices","Special Warp","Exit")) { + +// Using callsub and a small check to not make 1 part of the script set it on and the other turning it off again + +case 1: + if ($QW_TW_OFF == 0) { + set $QW_TW_OFF,1; + goto GM_Menu; + } else + set $QW_TW_OFF,0; + goto GM_Menu; +case 2: + if ($QW_DW_OFF == 0) { + set $QW_DW_OFF,1; + goto GM_Menu; + } else + set $QW_DW_OFF,0; + goto GM_Menu; +case 3: + goto DungeonLevelLimit; +case 4: + if ($QW_MapUserShow == 0) { + set $QW_MapUserShow,1; + goto GM_Menu; + } else + set $QW_MapUserShow,0; + goto GM_Menu; +case 5: + if ($QW_HF == 0) { + set $QW_HF,1; + set $QW_HP,0; + goto GM_Menu; + } else + set $QW_HF,0; + goto GM_Menu; +case 6: + if ($QW_HP == 0) { + set $QW_HP,1; + set $QW_HF,0; + goto GM_Menu; + } else + set $QW_HP,0; + goto GM_Menu; +case 7: + if ($QW_Stor == 0) { + set $QW_Stor,1; + goto GM_Menu; + } else + set $QW_Stor,0; + goto GM_Menu; +case 8: + if ($QW_GStor == 0) { + set $QW_GStor,1; + goto GM_Menu; + } else + set $QW_GStor,0; + goto GM_Menu; +case 9: + if ($QW_KPoint == 0) { + set $QW_KPoint,1; + goto GM_Menu; + } else + set $QW_KPoint,0; + goto GM_Menu; +case 10: + goto Setprice; +case 11: + goto SpecialWarpMenu; +default: + close; + end; +} + + +//======================GM-Menu=Pricing============================ + +Setprice: + if ($QW_DW_FEE != 0) set $QW_DW_FEE,0; + next; + mes "Scroll thru the list to see all the options"; +//----------------Warp-Basic-Price + if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000"; + if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000"; +//----------------Warp-Advanced-Price + if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000"; + if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000"; +//----------------Warp-Oversea-Price + if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000"; + if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000"; +//----------------Basic-Dungeon-Level-Warp-Fee + if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level"; + if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; +//----------------Advanced-Dungeon-Level-Warp-Fee + if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level"; + if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; +//----------------Overseas-Dungeon-Level-Warp-Fee + if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level"; + if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; +//----------------Heal-Full + if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000"; + if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000"; +//----------------Heal-Part + if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point"; + if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000"; + if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point"; + if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000"; +//----------------Storage + if ($QW_S_PRICE != 0 && $QW_S_PRICE != 60) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000"; + if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000"; + if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000"; +//----------------Guild-Storage + if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000"; + if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000"; + + switch(select("Basic - Warps","Advanced - Warps","Overseas - Warps","Basic Dungeon warp fee","Advanced Dungeon warp fee","Overseas Dungeon warp fee","Full Healing","Part Healing","Storage","Guild Storage","Back","Exit")) { + +case 1: + next; + if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000"; + if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000"; + mes "Basic - Warps are starter towns and related dungeons"; + input $QW_BW_PRICE; + goto Setprice; + +case 2: + next; + if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000"; + if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000"; + mes "Advanced - Warps are towns and dungeons on the same island but not close to any starter town"; + input $QW_AW_PRICE; + goto Setprice; + +case 3: + next; + if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000"; + if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000"; + mes "Overseas - Warps are towns and dungeons overseas reachable by boat from alberta"; + input $QW_OW_PRICE; + goto Setprice; + +case 4: + next; + if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level"; + if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; + mes "Basic - Warps are starter town related dungeons"; + mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; + mes "These costs are on top of the regular Warp costs"; + input $QW_BW_FEE; + goto Setprice; + +case 5: + next; + if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level"; + if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; + mes "Advanced - Warps are dungeons not close to any starter town"; + mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; + mes "These costs are on top of the regular Warp costs"; + input $QW_AW_FEE; + goto Setprice; + +case 6: + next; + if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level"; + if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; + mes "Overseas - Warps are dungeons related to towns overseas reachable by boat from alberta"; + mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; + mes "These costs are on top of the regular Warp costs"; + input $QW_OW_FEE; + goto Setprice; + +case 7: + next; + if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000"; + if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000"; + mes "Instant full healing 1 price"; + input $QW_HF_PRICE; + goto Setprice; + +case 8: + next; + if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point"; + if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000"; + if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point"; + if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000"; + mes "Healing price per 1 HP"; + mes "Healing price per 1 SP"; + mes "2 inputs, first HP then SP"; + input $QW_HP_H_PRICE; + input $QW_HP_S_PRICE; + goto Setprice; + +case 9: + next; + if ($QW_S_PRICE != 0 && $QW_S_PRICE != 60) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000"; + if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000"; + if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000"; + mes "Storage cost, if set to 60 Kafra pricing will be handled"; + input $QW_S_PRICE; + goto Setprice; + +case 10: + next; + if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000"; + if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000"; + mes "Guild Storage, free on Guild Kafras"; + input $QW_GS_PRICE; + goto Setprice; +case 11: + goto GM_Menu; +default: + close; + end; +} + +//======================Special=Warp=Menu========================== + +SpecialWarpMenu: + if ($QW_SP_Warpname$ == "") set $QW_SP_Warpname$,"Special Warp"; + next; + mes "Scroll down to see all the information"; + mes "The Special warp menu option will show in the main menu when all towns & dungeons are unlocked"; + mes "And when the map for special warping has been set"; + mes "menu option name set to ^0000FF"+$QW_SP_Warpname$+"^000000"; + if ($QW_SP_WarpMap$ == "") mes "map is currently ^FF0000not^000000 set, and Special warp menu is off"; + if ($QW_SP_WarpMap$ != "") mes "map is currently set to ^0000FF"+$QW_SP_WarpMap$+"^000000 and Special Warp menu is on"; + mes "coords are set to ^0000FF"+$QW_SP_WarpX+","+$QW_SP_WarpY+"^000000"; + switch(select("Set Special Warp name to show in menu", "Set WarpMap","Set Coords","Go Back to GM_Menu","Exit")){ + +case 1: + next; + mes "set the name to show in the menu as option"; + input $QW_SP_Warpname$; + goto SpecialWarpMenu; +case 2: + next; + mes "set the map in the ^0000FFmapname.gat^000000 format"; + mes "when this warpmap is set the option for players will show once they meet the requirments"; + mes "to disable Special Warp Menu option clear this !"; + input $QW_SP_WarpMap$; + goto SpecialWarpMenu; +case 3: + next; + mes "First input = Xcoord"; + mes "Second input = Ycoord"; + input $QW_SP_WarpX; + input $QW_SP_WarpY; + goto SpecialWarpMenu; +case 4: + goto GM_Menu; +default: + close; + end; +} + +//======================Dungeon=Level=Limit======================== +DungeonLevelLimit: + next; + if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000"; + if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000"; + mes "If^00FF00 On ^000000Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000"; + + switch(select("Toggle Dungeon Depth Limit", "Set Dungeon Depth Limit","Go Back to GM_Menu","Exit")){ + +case 1: + if ($QW_DL == 0) { + set $QW_DL,1; + goto DungeonLevelLimit; + } else + set $QW_DL,0; + goto DungeonLevelLimit; +case 2: + next; + mes "set limit of Dungeon Depth 0 = entrance"; + mes "Depth 1 is a map connected to 0 and so on"; + mes "Shortest Route to map counts as depth"; + input $QW_DDL; + goto DungeonLevelLimit; +case 3: + goto GM_Menu; +default: + close; + end; +} + +//===========================Towns================================= + +L_town: + callfunc "QWS_Tarray"; + +// Expected maximum is set to 25 items, if you add more options add more ",@Tmenulist$[xx]" + + set @TWMenu,select(@Tmenulist$[0],@Tmenulist$[1],@Tmenulist$[2],@Tmenulist$[3],@Tmenulist$[4],@Tmenulist$[5],@Tmenulist$[6],@Tmenulist$[7],@Tmenulist$[8],@Tmenulist$[9],@Tmenulist$[10],@Tmenulist$[11],@Tmenulist$[12],@Tmenulist$[13],@Tmenulist$[14],@Tmenulist$[15],@Tmenulist$[16],@Tmenulist$[17],@Tmenulist$[18],@Tmenulist$[19],@Tmenulist$[20],@Tmenulist$[21],@Tmenulist$[22],@Tmenulist$[23],@Tmenulist$[24]); + + if (@Tmenuref[@TWMenu-1] == 57005) goto L_end; // 57005='dead' in hex + + if(Zeny<@pTprice[@Tmenuref[@TWMenu-1]]) callsub L_Short_on_zeny,0; + + set Zeny, Zeny-@pTprice[@Tmenuref[@TWMenu-1]]; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@pTprice[@Tmenuref[@TWMenu-1]]/16); + warp @pTmap$[@Tmenuref[@TWMenu-1]],@pTXcoords[@Tmenuref[@TWMenu-1]],@pTYcoords[@Tmenuref[@TWMenu-1]]; + close2; // this part safegaurds against errors/typos + set Zeny, Zeny+@pTprice[@Tmenuref[@TWMenu-1]]; + end; + +//=========================Dungeons================================ + +L_dungeon: + callfunc "QWS_Darray"; + +// Expected maximum is set to 35 items, if you add more options add more ",@Dmenulist$[xx]" + + set @DWMenu,select(@Dmenulist$[0],@Dmenulist$[1],@Dmenulist$[2],@Dmenulist$[3],@Dmenulist$[4],@Dmenulist$[5],@Dmenulist$[6],@Dmenulist$[7],@Dmenulist$[8],@Dmenulist$[9],@Dmenulist$[10],@Dmenulist$[11],@Dmenulist$[12],@Dmenulist$[13],@Dmenulist$[14],@Dmenulist$[15],@Dmenulist$[16],@Dmenulist$[17],@Dmenulist$[18],@Dmenulist$[19],@Dmenulist$[20],@Dmenulist$[21],@Dmenulist$[22],@Dmenulist$[23],@Dmenulist$[24],@Dmenulist$[25],@Dmenulist$[26],@Dmenulist$[27],@Dmenulist$[28],@Dmenulist$[29],@Dmenulist$[30],@Dmenulist$[31],@Dmenulist$[32],@Dmenulist$[33],@Dmenulist$[34]); + + if (@Dmenuref[@DWMenu-1] == 57005) goto L_end; // 57005='dead' in hex + set @DwarpMenu, (@Dmenuref[@DWMenu-1]); + callfunc "QWS_DLarray"; + + next; + mes "[Warpra]"; + mes "Please select where you want to go"; + +// Expected maximum is set to 18 items, if you have dungeons with more levels add more ",@DWLmenulist$[xx]" + set @DWLMenu,select(@DWLmenulist$[0], @DWLmenulist$[1], @DWLmenulist$[2], @DWLmenulist$[3], @DWLmenulist$[4], @DWLmenulist$[5], @DWLmenulist$[6], @DWLmenulist$[7], @DWLmenulist$[8], @DWLmenulist$[9], @DWLmenulist$[10], @DWLmenulist$[11], @DWLmenulist$[12], @DWLmenulist$[13], @DWLmenulist$[14], @DWLmenulist$[15], @DWLmenulist$[16], @DWLmenulist$[17]); + + if (@DWLmenuref[@DWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex + + set @Darrayref, @DWLmenuref[@DWLMenu-1]; + set @warpprice, @pDprice[@Dmenuref[@DWMenu-1]]+(getd(@pDfee$[@Dmenuref[@DWMenu-1]])*(@DDepth[@Darrayref])); + + if(Zeny<@warpprice) callsub L_Short_on_zeny,1; + + set Zeny, Zeny-(@warpprice); + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@warpprice/16); + warp @DGat$[@Darrayref],@DXcoords[@Darrayref],@DYcoords[@Darrayref]; + close2; // this part safegaurds against errors/typos + set Zeny, Zeny+@pTprice[@Tmenuref[@DWMenu-1]]; + end; + +//=============================Healing============================= + +L_heal_Full: + set @healfee, $QW_HF_PRICE; + if(Zeny<@healfee) callsub L_Short_on_zeny,4; + set Zeny, Zeny-@healfee; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@healfee/500); + next; + mes "[Warpra]"; + mes "Close this window and I will Heal you."; + close2; + percentheal 100,100; + end; + +L_heal_Part: + set @healchoice,select("Full heal","Health Points only","Skill Points only","Exit"); + if (@healchoice == 1) callsub PHeal,1,1; + if (@healchoice == 2) callsub PHeal,1,0; + if (@healchoice == 3) callsub PHeal,0,1; + goto L_end; + +PHeal: + next; + set @Hp, MaxHp-Hp; + set @Sp, MaxSp-Sp; + set @HpPrice, @hp*$QW_HP_H_PRICE; + set @SpPrice, @sp*$QW_HP_S_PRICE; + mes "[Warpra]"; + if(getarg(0) == 1) mes ""+@HpPrice+" Zeny for "+@Hp+" health points"; + if(getarg(1) == 1) mes ""+@SpPrice+" Zeny for "+@Sp+" skill points"; + set @total, @HpPrice+@SpPrice; + mes "for a total of "+@total+" zeny"; + if (select("Heal me","Let me see the choices again")==2) goto L_heal_Part; + + if(getarg(0) == 1)set @HpPrice, (MaxHp-Hp)*$QW_HP_H_PRICE; + if(getarg(1) == 1)set @SpPrice, (MaxSp-Sp)*$QW_HP_S_PRICE; + set @healfee, @HpPrice+@SpPrice; + if (getarg(0) == 1 && getarg(1) == 1 && Zeny<@healfee) goto Zeny_Short_Both; + if (getarg(0) == 1 && Zeny<@healfee) goto Zeny_short_HP; + if (getarg(1) == 1 && Zeny<@healfee) goto Zeny_short_SP; + set Zeny, Zeny-@healfee; + if (getarg(0) == 1 && getarg(1) == 1) percentheal 100,100; + if (getarg(0) == 1) percentheal 100,0; + if (getarg(1) == 1) percentheal 0,100; + close; + end; + +Zeny_Short_Both: + mes "[Warpra]"; + mes "choose another option, you can afford both."; + mes "I can heal as much as you can afford too."; + if (select("OK","Exit") == 2) goto L_end; + goto PHeal; + +Zeny_short_HP: + mes "[Warpra]"; + mes "do you want me to partly heal your HP ?"; + if (select("Yes","No") == 2) goto L_end; + set @Hp, Zeny/$QW_HP_H_PRICE; + set @HpPrice, @Hp*$QW_HP_H_PRICE; + if (@Hp == 1) mes "your not worth the effort"; + if (@Hp == 1) goto L_end; + set Zeny, Zeny-@HpPrice; + heal @Hp,0; + close; + end; + +Zeny_short_SP: + mes "[Warpra]"; + mes "do you want me to partly heal your SP ?"; + if (select("Yes","No") == 2) goto L_end; + set @Sp, Zeny/$QW_HP_S_PRICE; + set @SpPrice, @Sp*$QW_HP_S_PRICE; + if (@Sp == 1) mes "your not worth the effort"; + if (@Sp == 1) goto L_end; + set Zeny, Zeny-@SpPrice; + heal 0,@Sp; + close; + end; + +//=============================Storage============================= + +L_Storage: + next; + if(basicskillcheck(0) > 0 && getskilllv(1) < 6) goto L_StorageJBlow; + set @fee, $QW_S_PRICE; + if ($QW_S_PRICE == 60 && BaseJob == Job_Novice) set @fee, 30; + if(Zeny<@fee) callsub L_Short_on_zeny,2; + set Zeny, Zeny-@fee; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@fee/5); + + mes "[Warpra]"; + mes "Close this window and i will open your storage."; + + callsub F_CheckKafCode; //check your storage password thru kafra coding, if set + + close2; + openstorage; + end; + +F_CheckKafCode: +// you have to set the 1337 value the same as in functions_kafras.txt if you changed it !! + if(#kafra_code==0) return; + mes "Enter your storage password:"; + set @code_,0; + input @code_; + if(@code_ != #kafra_code-getcharid(3)-1337) { + dispbottom "Wrong storage password."; + close; + } + set @kafcode_try,0; + set @code_,0; + return; + +L_StorageJBlow: + mes "[Warpra]"; + mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage."; + return; + +L_GStorage: + if(@GID==0) goto L_NoGuild; + if(Zeny<$QW_GS_PRICE) callsub L_Short_on_zeny,3; + set Zeny, Zeny-$QW_GS_PRICE; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + ($QW_GS_PRICE/5); + next; + mes "[Warpra]"; + mes "Close this window and i will open the ^5533FF" + GetGuildName(@GID) + "^000000 storage."; + close2; + guildopenstorage; + end; + +L_NoGuild: + next; + mes "[Warpra]"; + mes "You are not a part of a guild I can't help you."; + close; + end; + +L_end: + close; + end; + +//============================Few=Warp============================= +L_FewWarps: + next; + mes "[Warpra ]"; + mes "You need to unlock locations before they come available to you."; + mes "To unlock a location talk to my colleagues all over the world."; + mes "Each account got it's own stamp card."; + mes "Want me to check what stamps you have collected so far ?."; + if (select("Yes","No")==1) callsub stampcard; + close; + end; + + +//============================No=Unlock============================ + +L_NoUnlock: + next; + mes "[Warpra ]"; + mes "I don't unlock this location, my assistant deeper in the dungeon will unlock this place."; + close; + end; + +//=========================Short=On=Zeny=========================== +L_Short_on_zeny: + next; + if (getarg(0) == 0) mes "you don't seem to have "+@pTprice[@Tmenuref[@TWMenu-1]]+" zeny, to pay for the warp fee to "+@pTmenuitems$[@Tmenuref[@TWMenu-1]]+""; + if (getarg(0) == 1) mes "you don't seem to have "+@warpprice+" zeny, to pay for the warp fee to "+@DLevelName$[@DWLmenuref[@DWLMenu-1]]+" at "+@pDmenuitems$[@Dmenuref[@DWMenu-1]]+""; + if (getarg(0) == 2) mes "you don't seem to have "+@fee+" zeny, to pay for the storage fee"; + if (getarg(0) == 3) mes "you don't seem to have "+$QW_GS_PRICE+" zeny, to pay for the guild storage fee"; + if (getarg(0) == 4) mes "you don't seem to have "+@healfee+" zeny, to pay for your healing"; + close; + end; + +//===========================Stamp=Card============================ +stampcard: +// Counting of the ammount of places you have unlocked + next; + mes "Let me check what Towns you have"; + + callfunc "QWS_TownStamps"; + + mes "you collected^00FF00 "+@Tstamp+" of "+@MaxTstamp+" ^000000Towns."; + if (@Tstamp == 15) mes "They say there is an island you can only get to when married"; + if (@Tstamp == 15) emotion 18; + next; + + mes "Let me check what dungeons you have"; + + callfunc "QWS_DungeonStamps"; + + mes "you collected^00FF00 "+@Dstamp+" of "+@MaxDstamp+" ^000000Dungeons"; + mes "To unlock a dungeon, search for my colleague."; + mes "You can usually find them near the middle or end of the dungeon"; + return; +} + +function script QWS_TownStamps { + set @Tstamp,0; + set @MaxTstamp,21; //maximum number of towns + set @binvalue,1; + set @Tstamploop,0; + do { + if ((@binvalue & ##QWS_T_Unlock) == @binvalue) set @Tstamp,@Tstamp+1; + + set @binvalue, @binvalue *2; + set @Tstamploop, @Tstamploop + 1; + +}while (@Tstamploop < @MaxTstamp); +return; +} + +function script QWS_DungeonStamps { + set @Dstamp,0; + set @MaxDstamp,29; //maximum number of dungeons + set @binvalue,1; + set @Dstamploop,0; + do { + if ((@binvalue & ##QWS_D_Unlock) == @binvalue) set @Dstamp,@Dstamp+1; + + set @binvalue, @binvalue *2; + set @Dstamploop, @Dstamploop + 1; + +}while (@Dstamploop < @MaxDstamp); +return; +} + +//======================Main=Menu=Array============================ + +function script QWS_MMarray { + +// Currently 9 items + + setarray @pMmenuitems$[0], "GameMaster Menu", $QW_SP_Warpname$, "Warp to Towns", "Warp to Dungeons", "Why so few Warps ?", "Why don't you Unlock this location ?", "Heal", "Heal", "Storage", "Guild Storage", "Cancel"; + set @Mi,0; // That's our loop counter. + set @Mj,0; // That's the menu lines counter. +//----------------GameMaster-Menu + if (getgmlevel(80)) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if (getgmlevel(80)) set @Mmenuref[@Mj],@Mi; + if (getgmlevel(80)) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Special-Warp + callfunc "QWS_TownStamps"; + callfunc "QWS_DungeonStamps"; + if (@Tstamp == @MaxTstamp && @Dstamp == @MaxDstamp && $QW_SP_WarpMap$ != "") { + set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + set @Mmenuref[@Mj],@Mi; + set @Mj,@Mj+1; + } + set @Mi,@Mi+1; +//----------------Town-Warp + if ($QW_TW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_TW_OFF == 0) set @Mmenuref[@Mj],@Mi; + if ($QW_TW_OFF == 0) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Dungeon-Warp + if ($QW_DW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_DW_OFF == 0) set @Mmenuref[@Mj],@Mi; + if ($QW_DW_OFF == 0) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Why-So-Few-Warps + set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + set @Mmenuref[@Mj],@Mi; + set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------No-Unlock + if (getarg(0) == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if (getarg(0) == 1) set @Mmenuref[@Mj],@Mi; + if (getarg(0) == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Healfull + if ($QW_HF == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_HF == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_HF == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Healpart + if ($QW_HP == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_HP == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_HP == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Storage + if ($QW_Stor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_Stor == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_Stor == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------GuildStorage + if ($QW_GStor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_GStor == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_GStor == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Cancel + set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + set @Mmenuref[@Mj],@Mi; + return; + } + + + +//======================Town=Menu=Array============================ + +//----------------Prontera // I do this to find back sections quickly altho almost the same name is a line below it now +// setarray @pTmenuitems$[@Ti], "Prontera"; // Name of Town shown in Town select Menu +// setarray @pTprice[@Ti], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE) +// +// setarray @pTmap$[@Ti], "prontera.gat"; // mapfilename of town +// setarray @pTXcoords[@Ti], 156; // X warp coords +// setarray @pTYcoords[@Ti], 187; // Y warp coords +// +// QWS_Make_Town_Menu XXX; +// +// the full wap commands send out by this script for these example would be +//warp example_01.gat 123 123 +// +// use the same XXX number as you used when making your own town warpra +// Read below how +// +// example: +// +//syntax: +//mapname.gat,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{ +// +// Full example using fake map & coords +// +//example_01.gat,213,213,4 script Warpra 112,{ +// callfunc "QWS_Town_Warpra",XXX,"A FAKE TOWN FOR EXAMPLE"; +// close; +// } +// use a free number for XXX, last used is 20, for Yuno + +function script QWS_Tarray { + function QWS_Make_Town_Menu; + + set @Ti,0; // That's our loop counter. + set @Tj,0; // That's the menu lines counter. +//----------------Prontera + setarray @pTmenuitems$[@Ti], "Prontera"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "prontera.gat"; + setarray @pTXcoords[@Ti], 156; + setarray @pTYcoords[@Ti], 187; + + QWS_Make_Town_Menu 0; +//----------------Alberta + setarray @pTmenuitems$[@Ti], "Alberta"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "alberta.gat"; + setarray @pTXcoords[@Ti], 27; + setarray @pTYcoords[@Ti], 236; + + QWS_Make_Town_Menu 1; +//----------------Aldebaran + setarray @pTmenuitems$[@Ti], "Aldebaran"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "aldebaran.gat"; + setarray @pTXcoords[@Ti], 145; + setarray @pTYcoords[@Ti], 120; + + QWS_Make_Town_Menu 2; +//----------------Amatsu: + setarray @pTmenuitems$[@Ti], "Amatsu"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "amatsu.gat"; + setarray @pTXcoords[@Ti], 197; + setarray @pTYcoords[@Ti], 86; + + QWS_Make_Town_Menu 3; +//----------------Ayothaya: + setarray @pTmenuitems$[@Ti], "Ayothaya"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "ayothaya.gat"; + setarray @pTXcoords[@Ti], 150; + setarray @pTYcoords[@Ti], 57; + + QWS_Make_Town_Menu 4; +//----------------Comodo: + setarray @pTmenuitems$[@Ti], "Comodo"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "comodo.gat"; + setarray @pTXcoords[@Ti], 188; + setarray @pTYcoords[@Ti], 161; + + QWS_Make_Town_Menu 5; +//----------------Einbech: + setarray @pTmenuitems$[@Ti], "Einbech"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "einbech.gat"; + setarray @pTXcoords[@Ti], 172; + setarray @pTYcoords[@Ti], 126; + + QWS_Make_Town_Menu 6; +//----------------Einbroch: + setarray @pTmenuitems$[@Ti], "Einbroch"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "einbroch.gat"; + setarray @pTXcoords[@Ti], 230; + setarray @pTYcoords[@Ti], 191; + + QWS_Make_Town_Menu 7; +//----------------Geffen: + setarray @pTmenuitems$[@Ti], "Geffen"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "geffen.gat"; + setarray @pTXcoords[@Ti], 119; + setarray @pTYcoords[@Ti], 66; + + QWS_Make_Town_Menu 8; +//----------------Gonryun: + setarray @pTmenuitems$[@Ti], "Gonryun"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "gonryun.gat"; + setarray @pTXcoords[@Ti], 150; + setarray @pTYcoords[@Ti], 130; + + QWS_Make_Town_Menu 9; +//----------------Hugel: + setarray @pTmenuitems$[@Ti], "Hugel"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "hugel.gat"; + setarray @pTXcoords[@Ti], 95; + setarray @pTYcoords[@Ti], 121; + + QWS_Make_Town_Menu 10; +//----------------Izlude: + setarray @pTmenuitems$[@Ti], "Izlude"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "izlude.gat"; + setarray @pTXcoords[@Ti], 128; + setarray @pTYcoords[@Ti], 111; + + QWS_Make_Town_Menu 11; +//----------------Jawaii: + setarray @pTmenuitems$[@Ti], "Jawaii"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "jawaii.gat"; + setarray @pTXcoords[@Ti], 243; + setarray @pTYcoords[@Ti], 115; + + QWS_Make_Town_Menu 12; +//----------------Lighthalzen: + setarray @pTmenuitems$[@Ti], "Lighthalzen"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "lighthalzen.gat"; + setarray @pTXcoords[@Ti], 158; + setarray @pTYcoords[@Ti], 110; + + QWS_Make_Town_Menu 13; +//----------------Louyang: + setarray @pTmenuitems$[@Ti], "Louyang"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "louyang.gat"; + setarray @pTXcoords[@Ti], 210; + setarray @pTYcoords[@Ti], 108; + + QWS_Make_Town_Menu 14; +//----------------Lutie + setarray @pTmenuitems$[@Ti], "Lutie"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "xmas.gat"; + setarray @pTXcoords[@Ti], 148; + setarray @pTYcoords[@Ti], 131; + + QWS_Make_Town_Menu 15; +//----------------Morroc: + setarray @pTmenuitems$[@Ti], "Morroc"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "morocc.gat"; + setarray @pTXcoords[@Ti], 159; + setarray @pTYcoords[@Ti], 93; + + QWS_Make_Town_Menu 16; +//----------------Niflheim: + setarray @pTmenuitems$[@Ti], "Niflheim"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "niflheim.gat"; + setarray @pTXcoords[@Ti], 195; + setarray @pTYcoords[@Ti], 186; + + QWS_Make_Town_Menu 17; +//----------------Payon: + setarray @pTmenuitems$[@Ti], "Payon"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "payon.gat"; + setarray @pTXcoords[@Ti], 152; + setarray @pTYcoords[@Ti], 75; + + QWS_Make_Town_Menu 18; +//----------------Umbala: + setarray @pTmenuitems$[@Ti], "Umbala"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "umbala.gat"; + setarray @pTXcoords[@Ti], 130; + setarray @pTYcoords[@Ti], 130; + + QWS_Make_Town_Menu 19; +//----------------Yuno: + setarray @pTmenuitems$[@Ti], "Yuno"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "yuno.gat"; + setarray @pTXcoords[@Ti], 160; + setarray @pTYcoords[@Ti], 168; + + QWS_Make_Town_Menu 20; +//----------------Cancel + setarray @pTmenuitems$[@Ti], "Cancel"; + setarray @pTprice[@Ti], 0; + + set @Tmenulist$[@Tj],@pTmenuitems$[@Ti]; + set @Tmenuref[@Tj],57005; // 57005='dead' in hex + return; + + +//----------------Make Town Menu Function + +function QWS_Make_Town_Menu { + set @temptownmenubin,1; + if (getarg(0) == 0) goto menu_item; + set @templooptownmenu,0; + do { + set @temptownmenubin, @temptownmenubin * 2; + set @templooptownmenu, @templooptownmenu + 1; + }while (getarg(0) > @templooptownmenu); +// check marker and make menu item +menu_item: + if ((@temptownmenubin & ##QWS_T_Unlock) != @temptownmenubin) { + set @Ti,@Ti+1; + return; + } + if (@pTprice[@Ti] != 0 && $QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" -> "+@pTprice[@Ti]; + if (@pTprice[@Ti] == 0 && $QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]; + if (@pTprice[@Ti] != 0 && $QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"+" -> "+@pTprice[@Ti]; + if (@pTprice[@Ti] == 0 && $QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"; + set @Tmenuref[@Tj],@Ti; + set @Tj,@Tj+1; + set @Ti,@Ti+1; + return; + +} +} + +//====================Dungeon=Menu=Arrays========================== + +//----------------A FAKE DUNGEON FOR EXAMPLE // I do this to find back sections quickly altho almost the same name is a line below it now +// setarray @pDmenuitems$[@Di], "Fake Dungeon"; // Name of Dungeon shown in Dungeon select Menu +// setarray @pDprice[@Di], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE) +// setarray @pDfee$[@Di], "$QW_BW_FEE"; // Identifyer for the Dungeon fee caluclation (Basic ("$QW_BW_FEE"), Advanced ("$QW_AW_FEE"), Overseas ("$QW_OW_FEE")) please use setting in relation with option above (Don't forget "") +// setarray @DLevels[@Di], 2; //number of levels in dungeon (very important if set to high will shift all leveldata!!) +// +// setarray @DGat$[@Dref], "example_01.gat", "example_02.gat"; // mapfilename of dungeon level +// setarray @DLevelName$[@Dref], "Example Level 1", "Example Level 2"; // level name shown in dungeon level select +// setarray @DXcoords[@Dref], 123, 234; // X warp coords +// setarray @DYcoords[@Dref], 123, 234;// Y warp coords +// setarray @DDepth[@Dref], 0, 1; // relative depth to entrance to calculate extra warp fee +// +// QWS_Make_Dungeon_Menu XXX +// +// the full wap commands send out by this scripts for these examples would be +// for Example Level 1: +//warp example_01.gat 123 123 +// +// for Example Level 2: +//warp example_02.gat 234 234 +// +// use the same XXX number as you used when making your own dungeon unlocker (Warpra Helper) inside the dungeon +// (usually half way near a warp to next level) +// Read below how +// +// example: +// +//syntax: +//mapname.gat,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{ +// +// Full example using fake map & coords +// +//example_01.gat,213,213,4 script Warpra Helper 112,{ +// callfunc "QWS_Dungeon_Warpra",XXX,"A FAKE DUNGEON FOR EXAMPLE"; +// close; +// } +// use a free number for XXX, last used is 28, for Kiel Dungeon + +function script QWS_Darray { + function QWS_Make_Dungeon_Menu; + + set @Di,0; + set @Dj,0; + set @Dref,0; +//----------------ABYSS LAKE + setarray @pDmenuitems$[@Di], "Abyss Lake"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "abyss_01.gat", "abyss_02.gat", "abyss_03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 265, 275, 116; + setarray @DYcoords[@Dref], 273, 270, 27; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 0; + +//----------------AMATSU DUNGEON + setarray @pDmenuitems$[@Di], "Amatsu Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "ama_dun01.gat", "ama_dun02.gat", "ama_dun03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 227, 32, 119; + setarray @DYcoords[@Dref], 10, 43, 15; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 1; + +//----------------ANT HELL + setarray @pDmenuitems$[@Di], "Ant Hell Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[2], 2; + + setarray @DGat$[@Dref], "anthell01.gat", "anthell02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 32, 34; + setarray @DYcoords[@Dref], 262, 263; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 2; + +//----------------AYOTAYA + setarray @pDmenuitems$[@Di], "Ayotaya Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[3], 2; + + setarray @DGat$[@Dref], "ayo_dun01.gat", "ayo_dun02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 275, 150; + setarray @DYcoords[@Dref], 17, 13; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 3; + +//----------------BYALAN + setarray @pDmenuitems$[@Di], "Byalan Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[4], 5; + + setarray @DGat$[@Dref], "iz_dun00.gat", "iz_dun01.gat", "iz_dun02.gat", "iz_dun03.gat", "iz_dun04.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; + setarray @DXcoords[@Dref], 168, 41, 236, 32, 26; + setarray @DYcoords[@Dref], 168, 37, 204, 63, 27; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 4; + +//----------------CLOCK TOWER + setarray @pDmenuitems$[@Di], "Clock Tower Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[5], 8; + + setarray @DGat$[@Dref], "c_tower1.gat", "c_tower2.gat", "c_tower3.gat", "c_tower4.gat", "alde_dun01.gat", "alde_dun02.gat", "alde_dun03.gat", "alde_dun04.gat"; + setarray @DLevelName$[@Dref], "Clock Tower Level 1", "Clock Tower Level 2", "Clock Tower Level 3", "Clock Tower Level 4", "Basement 1F", "Basement 2F", "Basement 3F", "Basement 4F"; + setarray @DXcoords[@Dref], 200, 268, 64, 32, 197, 262, 276, 130; + setarray @DYcoords[@Dref], 163, 26, 148, 63, 25, 41, 53, 130; + setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 5; + +//----------------COAL MINE + setarray @pDmenuitems$[@Di], "Coal Mine Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[6], 3; + + setarray @DGat$[@Dref], "mjo_dun01.gat", "mjo_dun02.gat", "mjo_dun03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 52, 381, 302; + setarray @DYcoords[@Dref], 17, 343, 261; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 6; + +//----------------CULVERT + setarray @pDmenuitems$[@Di], "Culvert Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[7], 4; + + setarray @DGat$[@Dref], "prt_sewb1.gat", "prt_sewb2.gat", "prt_sewb3.gat", "prt_sewb4.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; + setarray @DXcoords[@Dref], 132, 19, 180, 100; + setarray @DYcoords[@Dref], 248, 19, 169, 92; + setarray @DDepth[@Dref], 0, 1, 2, 3; + + QWS_Make_Dungeon_Menu 7; + +//----------------EINBECH DUNGEON + setarray @pDmenuitems$[@Di], "Einbech Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[8], 2; + + setarray @DGat$[@Dref], "ein_dun01.gat", "ein_dun02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 22, 292; + setarray @DYcoords[@Dref], 14, 290; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 8; + +//----------------GEFENIA DUNGEON + setarray @pDmenuitems$[@Di], "Gefenia Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[9], 4; + + setarray @DGat$[@Dref], "gefenia01.gat", "gefenia02.gat", "gefenia03.gat", "gefenia04.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; + setarray @DXcoords[@Dref], 59, 201, 264, 33; + setarray @DYcoords[@Dref], 167, 35, 236, 270; + setarray @DDepth[@Dref], 0, 1, 2, 3; + + QWS_Make_Dungeon_Menu 9; + +//----------------GEFFEN DUNGEON + setarray @pDmenuitems$[@Di], "Geffen Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 4; + + setarray @DGat$[@Dref], "gef_dun00.gat", "gef_dun01.gat", "gef_dun02.gat", "gef_dun03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; + setarray @DXcoords[@Dref], 104, 115, 106, 203; + setarray @DYcoords[@Dref], 100, 236, 132, 200; + setarray @DDepth[@Dref], 0, 1, 2, 3; + + QWS_Make_Dungeon_Menu 10; + +//----------------GLAST HEIM + setarray @pDmenuitems$[@Di], "Glast Heim Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 17; + + setarray @DGat$[@Dref], "glast_01.gat", "gl_church.gat", "gl_chyard.gat", "gl_in01.gat", "gl_cas01.gat", "gl_cas02.gat", "gl_knt01.gat", "gl_knt02.gat", "gl_prison.gat", "gl_prison1.gat", "gl_step.gat", "gl_sew01.gat", "gl_sew02.gat", "gl_sew03.gat", "gl_sew04.gat", "gl_dun01.gat", "gl_dun02.gat"; + setarray @DLevelName$[@Dref], "Glast Heim Entrance", "St. Abbey", "Churchyard", "Inside Glast Heim", "Castle 1", "Castle 2", "Chivalry 1", "Chivalry 2", "Prison 1", "Prison 2", "Steps", "Sewers 1", "Sewers 2", "Sewers 3", "Sewers 4", "Lowest Cave 1", "Lowest Cave 2"; + setarray @DXcoords[@Dref], 370, 156, 147, 121, 199, 104, 150, 157, 14, 150, 117, 258, 108, 171, 68, 133, 224; + setarray @DYcoords[@Dref], 300, 8, 15, 59, 29, 25, 10, 287, 70, 14, 124, 255, 291, 273, 277, 271, 274; + setarray @DDepth[@Dref], 0, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 4, 5, 6; + + QWS_Make_Dungeon_Menu 11; + +//----------------GONRYUN DUNGEON + setarray @pDmenuitems$[@Di], "Gonryun Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "gon_dun01.gat", "gon_dun02.gat", "gon_dun03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 143, 17, 68; + setarray @DYcoords[@Dref], 59, 114, 9; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 12; + +//----------------HIDDEN DUNGEON + setarray @pDmenuitems$[@Di], "Hidden Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "prt_maze01.gat", "prt_maze02.gat", "prt_maze03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 176, 94, 23; + setarray @DYcoords[@Dref], 6, 19, 8; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 13; + +//----------------JUPEROS CAVE + setarray @pDmenuitems$[@Di], "Juperos Cave"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "juperos_01.gat", "juperos_02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 53, 36; + setarray @DYcoords[@Dref], 247, 60; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 14; + +//----------------KIEL DUNGEON + setarray @pDmenuitems$[@Di], "Kiel Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "kh_dun01.gat", "kh_dun02.gat"; + setarray @DLevelName$[@Dref], "1st Floor", "2nd Floor"; + setarray @DXcoords[@Dref], 63, 42; + setarray @DYcoords[@Dref], 10, 197; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 28; + +//----------------LIGHTHALZEN BIO LAB + setarray @pDmenuitems$[@Di], "Lighthalzen Bio Lab"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "lhz_dun01.gat", "lhz_dun02.gat", "lhz_dun03.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 150, 150, 140; + setarray @DYcoords[@Dref], 287, 18, 137; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 15; + +//----------------LOUYANG DUNGEON + setarray @pDmenuitems$[@Di], "Louyang Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "lou_dun02.gat", "lou_dun03.gat"; + setarray @DLevelName$[@Dref], "Royal Tomb Level 1", "Royal Tomb Level 2"; + setarray @DXcoords[@Dref], 282, 165; + setarray @DYcoords[@Dref], 20, 38; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 16; + +//----------------MAGMA DUNGEON + setarray @pDmenuitems$[@Di], "Magma Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "mag_dun01.gat", "mag_dun02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 126, 47; + setarray @DYcoords[@Dref], 69, 32; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 17; + +//----------------ODIN TEMPLE + setarray @pDmenuitems$[@Di], "Odin Temple"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 1; + + setarray @DGat$[@Dref], "odin_tem01.gat"; + setarray @DLevelName$[@Dref], "Level 1"; + setarray @DXcoords[@Dref], 96; + setarray @DYcoords[@Dref], 145; + setarray @DDepth[@Dref], 0; + + QWS_Make_Dungeon_Menu 18; + +//----------------ORC DUNGEON + setarray @pDmenuitems$[@Di], "Orc Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "orcsdun01.gat", "orcsdun02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 32, 21; + setarray @DYcoords[@Dref], 169, 185; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 19; + +//----------------PAYON DUNGEON + setarray @pDmenuitems$[@Di], "Payon Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 5; + + setarray @DGat$[@Dref], "pay_dun00.gat", "pay_dun01.gat", "pay_dun02.gat", "pay_dun03.gat", "pay_dun04.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; + setarray @DXcoords[@Dref], 22, 19, 19, 155, 201; + setarray @DYcoords[@Dref], 180, 33, 63, 159, 204; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 20; + +//----------------PYRAMIDS + setarray @pDmenuitems$[@Di], "Pyramids Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 6; + + setarray @DGat$[@Dref], "moc_pryd01.gat", "moc_pryd02.gat", "moc_pryd03.gat", "moc_pryd04.gat", "moc_pryd05.gat", "moc_pryd06.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Basement 1", "Basement 2"; + setarray @DXcoords[@Dref], 192, 10, 100, 181, 94, 192; + setarray @DYcoords[@Dref], 9, 192, 92, 11, 96, 8; + setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2; + + QWS_Make_Dungeon_Menu 21; + +//----------------SPHINX + setarray @pDmenuitems$[@Di], "Sphinx Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 5; + + setarray @DGat$[@Dref], "in_sphinx1.gat", "in_sphinx2.gat", "in_sphinx3.gat", "in_sphinx4.gat", "in_sphinx5.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; + setarray @DXcoords[@Dref], 192, 149, 210, 10, 100; + setarray @DYcoords[@Dref], 9, 81, 54, 222, 99; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 22; + +//----------------SUNKEN SHIP + setarray @pDmenuitems$[@Di], "Sunken Ship Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "treasure01.gat", "treasure02.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 69, 102; + setarray @DYcoords[@Dref], 24, 27; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 23; + +//----------------THANATOS TOWER + setarray @pDmenuitems$[@Di], "Thanatos Tower"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 13; + + setarray @DGat$[@Dref], "tha_t01.gat", "tha_t02.gat", "tha_t03.gat", "tha_t04.gat", "tha_t05.gat", "tha_t06.gat", "tha_t07.gat", "tha_t08.gat", "tha_t09.gat", "tha_t10.gat", "tha_t11.gat", "tha_t12.gat", "thana_boss.gat"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6", "Level 7", "Level 8", "Level 9", "Level 10", "Level 11", "Level 12", "Thanatos Boss"; + setarray @DXcoords[@Dref], 150, 150, 220, 59, 62, 206, 35, 105, 88, 168, 90, 129, 85; + setarray @DYcoords[@Dref], 35, 136, 158, 143, 11, 8, 166, 44, 145, 138, 36, 83, 76; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12; + + QWS_Make_Dungeon_Menu 24; + +//----------------TOY FACTORY + setarray @pDmenuitems$[@Di], "Toy Factory Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "xmas_dun01.gat", "xmas_dun02.gat"; + setarray @DLevelName$[@Dref], "Factory Warehouse", "Classifying Room"; + setarray @DXcoords[@Dref], 205, 129; + setarray @DYcoords[@Dref], 16, 133; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 25; + +//----------------TURTLE ISTLAND + setarray @pDmenuitems$[@Di], "Turtle Island Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 4; + + setarray @DGat$[@Dref], "tur_dun01.gat", "tur_dun02.gat", "tur_dun03.gat", "tur_dun04.gat"; + setarray @DLevelName$[@Dref], "Outside", "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 161, 148, 132, 100; + setarray @DYcoords[@Dref], 34, 256, 190, 192; + setarray @DDepth[@Dref], 0, 0, 1, 2; + + QWS_Make_Dungeon_Menu 26; + +//----------------UMBALA + setarray @pDmenuitems$[@Di], "Umbala Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "um_dun01.gat", "um_dun02.gat", "yggdrasil01.gat"; + setarray @DLevelName$[@Dref], "Carpenter's Shop in The Tree", "Passage to a Foreign World", "Hvergelmir's Fountain"; + setarray @DXcoords[@Dref], 205, 48, 40; + setarray @DYcoords[@Dref], 16, 30, 63; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 27; + +//----------------Cancel + setarray @pDmenuitems$[@Di], "Cancel"; + setarray @pDprice[@Di], 0; + + set @Dmenulist$[@Dj],@pDmenuitems$[@Di]; + set @Dmenuref[@Dj],57005; // 57005='dead' in hex + return; + + +//----------------Make Dungeon Menu Function + +function QWS_Make_Dungeon_Menu { + set @tempdungeonmenubin,1; + if (getarg(0) == 0) goto menu_item; + set @temploopdungeonmenu,0; + do { + set @tempdungeonmenubin, @tempdungeonmenubin * 2; + set @temploopdungeonmenu, @temploopdungeonmenu + 1; + }while (getarg(0) > @temploopdungeonmenu); +// check marker and make menu item +menu_item: + if ((@tempdungeonmenubin & ##QWS_D_Unlock) != @tempdungeonmenubin) { + setarray @DLocRef[@Di], @Dref; + set @Dref, @Dref+@DLevels[@Di]; + set @Di,@Di+1; + return; + } + if ($QW_MapUserShow == 1) { + set @tempmapusers,0; + set @mapusersloop,0; + do { + set @tempmapusers,(getmapusers(@DGat$[@Dref+@mapusersloop]) + @tempmapusers); + set @mapusersloop, (@mapusersloop + 1); + }while (@DLevels[@Di] > @mapusersloop); + if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"] -> "+@pDprice[@Di]; + if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"]"; + set @Dmenuref[@Dj],@Di; + set @Dj,@Dj+1; + setarray @DLocRef[@Di], @Dref; + set @Dref, @Dref+@DLevels[@Di]; + set @Di,@Di+1; + return; + } + if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" -> "+@pDprice[@Di]; + if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]; + set @Dmenuref[@Dj],@Di; + set @Dj,@Dj+1; + setarray @DLocRef[@Di], @Dref; + set @Dref, @Dref+@DLevels[@Di]; + set @Di,@Di+1; + return; + +} +} + +function script QWS_DLarray { +//----------------Start building Menu + set @DWref,@DLocRef[@DwarpMenu]; // That's our reference to the arrays with leveldata. + set @DWi,0; // That's our loop counter. + set @DWj,0; // That's the menu lines counter. + cleararray @DWLmenulist$[0],"",20; // Clearing the array to get rid off ghost items in menu + do { + if ($QW_DL == 0 || $QW_DDL >= @DDepth[@DWref]) { + set @warpprice, (@pDprice[@DwarpMenu]+ (getd(@pDfee$[@DwarpMenu])*@DDepth[@DWref])); + + if (@warpprice != 0 && $QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" -> "+@warpprice; + if (@warpprice == 0 && $QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]; + if (@warpprice != 0 && $QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"] -> "+@warpprice; + if (@warpprice == 0 && $QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"]"; + set @DWLmenuref[@DWj],@DWref; + + set @DWj,@DWj+1; + } + set @DWref, @DWref+1; + set @DWi,@DWi+1; + }while (@DWi < @DLevels[@DwarpMenu]); + set @DWLmenulist$[@DWj], "Exit"; + set @DWLmenuref[@DWj],57005; // 57005='dead' in hex + return; + } + + +//=================Backwards=Compatibility=Pre=1.8================= + +function script QWS_BackComp { +// reference where i put the towns: "Prontera"[0], "Alberta"[1], "Aldebaran"[2], "Amatsu"[3], "Ayothaya"[4], "Comodo"[5], "Einbech"[6], "Einbroch"[7], "Geffen"[8], "Gonryun"[9], "Hugel"[10], "Izlude"[11], "Jawaii"[12], "Lighthalzen"[13], "Louyang"[14], "Lutie"[15], "Morroc"[16], "Niflheim"[17], "Payon"[18], "Umbala"[19], "Yuno"[20]; +// reference where i put the dungeons: "Abyss Lake"[0], "Amatsu Dungeon"[1], "Ant Hell Dungeon"[2], "Ayotaya Dungeon"[3], "Byalan Dungeon"[4], "Clock Tower Dungeon"[5], "Coal Mine Dungeon"[6], "Culvert Dungeon"[7], "Einbech Dungeon"[8], "Gefenia Dungeon"[9], "Geffen Dungeon"[10], "Glast Heim Dungeon"[11], "Gonryun Dungeon"[12], "Hidden Dungeon"[13], "Juperos Cave"[14], "Lighthalzen Bio Lab"[15], "Louyang Dungeon"[16], "Magma Dungeon"[17], "Odin Temple"[18], "Orc Dungeon"[19], "Payon Dungeon"[20], "Pyramids Dungeon"[21], "Sphinx Dungeon"[22], "Sunken Ship Dungeon"[23], "Thanatos Tower"[24], "Toy Factory Dungeon"[25], "Turtle Island Dungeon"[26], "Umbala Dungeon"[27], "Kiel Dungeon[28]; +// also clears variables so that the account file variables can be used for something else variable 0 = variable delete on next save + +// Towns + set @towntemp,0; + if (#prontera != 0) set @towntemp,@towntemp + 1; + if (#alberta != 0) set @towntemp,@towntemp + 2; + if (#aldebaran != 0) set @towntemp,@towntemp + 4; + if (#amatsu != 0) set @towntemp,@towntemp + 8; + if (#ayotaya != 0) set @towntemp,@towntemp + 16; + if (#comodo != 0) set @towntemp,@towntemp + 32; + if (#einbech != 0) set @towntemp,@towntemp + 64; + if (#einbroch != 0) set @towntemp,@towntemp + 128; + if (#geffen != 0) set @towntemp,@towntemp + 256; + if (#gonryun != 0) set @towntemp,@towntemp + 512; + if (#hugel != 0) set @towntemp,@towntemp + 1024; + if (#izlude != 0) set @towntemp,@towntemp + 2048; + if (#jawaii != 0) set @towntemp,@towntemp + 4096; + if (#lighthalzen != 0) set @towntemp,@towntemp + 8192; + if (#louyang != 0) set @towntemp,@towntemp + 16384; + if (#xmas != 0) set @towntemp,@towntemp + 32768; + if (#morocc != 0) set @towntemp,@towntemp + 65536; + if (#niflheim != 0) set @towntemp,@towntemp + 131072; + if (#payon != 0) set @towntemp,@towntemp + 262144; + if (#umbala != 0) set @towntemp,@towntemp + 524288; + if (#yuno != 0) set @towntemp,@towntemp + 1048576; +// Clear Town variables + set #prontera,0; + set #alberta,0; + set #aldebaran,0; + set #amatsu,0; + set #ayotaya,0; + set #comodo,0; + set #einbech,0; + set #einbroch,0; + set #geffen,0; + set #gonryun,0; + set #hugel,0; + set #izlude,0; + set #jawaii,0; + set #lighthalzen,0; + set #louyang,0; + set #xmas,0; + set #morocc,0; + set #niflheim,0; + set #payon,0; + set #umbala,0; + set #yuno,0; +// set Town warp unlock variable +set ##QWS_T_Unlock, (##QWS_T_Unlock | @towntemp); + //because multiple account servers now stack on 1 variable i used a 'or' to stack them +// Dungeons + set @dungeontemp,0; + if (#abyss != 0) set @dungeontemp,@dungeontemp + 1; + if (#ama_dun != 0) set @dungeontemp,@dungeontemp + 2; + if (#anthell != 0) set @dungeontemp,@dungeontemp + 4; + if (#ayotaya_dun != 0) set @dungeontemp,@dungeontemp + 8; + if (#iz_dun != 0) set @dungeontemp,@dungeontemp + 16; + if (#c_tower != 0) set @dungeontemp,@dungeontemp + 32; + if (#mjo_dun != 0) set @dungeontemp,@dungeontemp + 64; + if (#prt_sewb != 0) set @dungeontemp,@dungeontemp + 128; + if (#einbech_dun != 0) set @dungeontemp,@dungeontemp + 256; + if (#gefenia != 0) set @dungeontemp,@dungeontemp + 512; + if (#gef_dun != 0) set @dungeontemp,@dungeontemp + 1024; + if (#gl_dun != 0) set @dungeontemp,@dungeontemp + 2048; + if (#gon_dun != 0) set @dungeontemp,@dungeontemp + 4096; + if (#hid_dun != 0) set @dungeontemp,@dungeontemp + 8192; + if (#juperos != 0) set @dungeontemp,@dungeontemp + 16384; + if (#lighthalzen_dun != 0) set @dungeontemp,@dungeontemp + 32768; + if (#louyang_dun != 0) set @dungeontemp,@dungeontemp + 65536; + if (#mag_dun != 0) set @dungeontemp,@dungeontemp + 131072; + if (#odintemple != 0) set @dungeontemp,@dungeontemp + 262144; + if (#orcsdun != 0) set @dungeontemp,@dungeontemp + 524288; + if (#pay_dun != 0) set @dungeontemp,@dungeontemp + 1048576; + if (#moc_pryd != 0) set @dungeontemp,@dungeontemp + 2097152; + if (#in_sphinx != 0) set @dungeontemp,@dungeontemp + 4194304; + if (#treasure != 0) set @dungeontemp,@dungeontemp + 8388608; + if (#thanatos_tower != 0) set @dungeontemp,@dungeontemp + 16777216; + if (#xmas_dun != 0) set @dungeontemp,@dungeontemp + 33554432; + if (#tur_dun != 0) set @dungeontemp,@dungeontemp + 67108864; + if (#um_dun != 0) set @dungeontemp,@dungeontemp + 134217728; +// Clear Dungeon variables + set #abyss,0; + set #ama_dun,0; + set #anthell,0; + set #ayotaya_dun,0; + set #iz_dun,0; + set #c_tower,0; + set #mjo_dun,0; + set #prt_sewb,0; + set #einbech_dun,0; + set #gefenia,0; + set #gef_dun,0; + set #gl_dun,0; + set #gon_dun,0; + set #hid_dun,0; + set #juperos,0; + set #lighthalzen_dun,0; + set #louyang_dun,0; + set #mag_dun,0; + set #odintemple,0; + set #orcsdun,0; + set #pay_dun,0; + set #moc_pryd,0; + set #in_sphinx,0; + set #treasure,0; + set #thanatos_tower,0; + set #xmas_dun,0; + set #tur_dun,0; + set #um_dun,0; +// set Town warp unlock variable +set ##QWS_D_Unlock, (##QWS_D_Unlock | @dungeontemp); +//mark that this character has done the upgrade to 1.8 +set ##QWS_UP,18; +return; +} + + +//===================Extra=Variable=Clear=Pre=1.8================== +function script Extra_Variable_Clear { +// Clear Town variables + set #prontera,0; + set #alberta,0; + set #aldebaran,0; + set #amatsu,0; + set #ayotaya,0; + set #comodo,0; + set #einbech,0; + set #einbroch,0; + set #geffen,0; + set #gonryun,0; + set #hugel,0; + set #izlude,0; + set #jawaii,0; + set #lighthalzen,0; + set #louyang,0; + set #xmas,0; + set #morocc,0; + set #niflheim,0; + set #payon,0; + set #umbala,0; + set #yuno,0; + +// Clear Dungeon variables + set #abyss,0; + set #ama_dun,0; + set #anthell,0; + set #ayotaya_dun,0; + set #iz_dun,0; + set #c_tower,0; + set #mjo_dun,0; + set #prt_sewb,0; + set #einbech_dun,0; + set #gefenia,0; + set #gef_dun,0; + set #gl_dun,0; + set #gon_dun,0; + set #hid_dun,0; + set #juperos,0; + set #lighthalzen_dun,0; + set #louyang_dun,0; + set #mag_dun,0; + set #odintemple,0; + set #orcsdun,0; + set #pay_dun,0; + set #moc_pryd,0; + set #in_sphinx,0; + set #treasure,0; + set #thanatos_tower,0; + set #xmas_dun,0; + set #tur_dun,0; + set #um_dun,0; + +// as the account based variables are limited just run this on every character to save some variables +set QWS_ExtraVARClear,18; +return; +} + +//================Dungeon=Warpras=That=Only=Unlock================= + +function script QWS_Dungeon_Warpra { + function QWS_D_getbin; + function QWS_D_setbin; + + if (QWS_D_getbin(getarg(0)) == 0 && getarg(1) != "") { + mes "[Warpra]"; + mes getarg(1)+" unlocked!"; + QWS_D_setbin(getarg(0)); + return; + } else if (QWS_D_getbin(getarg(0)) == 1){ + mes "[Warpra]"; + mes "Sorry I can only unlock this location."; + } else + debugmes "QWS_Dungeon_Warpra error, improper syntax ?"; + return; + + +function QWS_D_setbin { + set @tempsetbindata,1; + if (getarg(0) == 0) goto binset; + set @temploopsetbin,0; + do { + set @tempsetbindata, @tempsetbindata * 2; + set @temploopsetbin, @temploopsetbin + 1; + } while (getarg(0) > @temploopsetbin); +binset: + set ##QWS_D_Unlock,(##QWS_D_Unlock | @tempsetbindata); + return; +} + +function QWS_D_getbin { + set @tempgetbindata,1; + if (getarg(0) == 0) goto binget; + set @temploopgetbin,0; + do { + set @tempgetbindata, @tempgetbindata * 2; + set @temploopgetbin, @temploopgetbin + 1; + } while (getarg(0) > @temploopgetbin); +binget: + if ((@tempgetbindata & ##QWS_D_Unlock) == @tempgetbindata) return 1; + return 0; +} +} + +//==========================Town=Warpras=========================== + +function script QWS_Town_Warpra { + function QWS_T_getbin; + function QWS_T_setbin; + + if (QWS_T_getbin(getarg(0)) == 0 && getarg(1) != "") { + mes "[Warpra]"; + mes getarg(1)+" unlocked!"; + QWS_T_setbin(getarg(0)); + return; + } else if (QWS_T_getbin(getarg(0)) == 1){ +callfunc "Q_Warpra",0; + } else + debugmes "QWS_Town_Warpra error, improper syntax ?"; + return; + + +function QWS_T_setbin { + set @tempsetbindata,1; + if (getarg(0) == 0) goto binset; + set @temploopsetbin,0; + do { + set @tempsetbindata, @tempsetbindata * 2; + set @temploopsetbin, @temploopsetbin + 1; + } while (getarg(0) > @temploopsetbin); +binset: + set ##QWS_T_Unlock,(##QWS_T_Unlock | @tempsetbindata); + return; +} + +function QWS_T_getbin { + set @tempgetbindata,1; + if (getarg(0) == 0) goto binget; + set @temploopgetbin,0; + do { + set @tempgetbindata, @tempgetbindata * 2; + set @temploopgetbin, @temploopgetbin + 1; + } while (getarg(0) > @temploopgetbin); +binget: + if ((@tempgetbindata & ##QWS_T_Unlock) == @tempgetbindata) return 1; + return 0; +} +} +//============================Warpras============================== + +alb2trea.gat,73,101,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +ama_fild01.gat,178,325,1 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +gef_fild10.gat,71,339,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +izlu2dun.gat,104,82,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +mjolnir_02.gat,85,363,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +moc_fild04.gat,207,331,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +moc_fild19.gat,106,97,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +moc_ruins.gat,64,166,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +niflheim.gat,197,192,3 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +pay_arche.gat,39,135,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +prt_fild05.gat,273,215,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +tur_dun01.gat,148,239,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +valkyrie.gat,48,35,8 script Warpra 113,{ + callfunc "Q_Warpra",1; +} +yuno_fild03.gat,37,135,4 script Warpra 113,{ + callfunc "Q_Warpra",1; +} + +alberta.gat,32,240,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",1,"Alberta Town"; + close; +} +aldebaran.gat,146,118,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",2,"Aldebaran Town"; + close; +} +ayothaya.gat,216,171,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",4,"Ayotaya Town"; + close; +} +amatsu.gat,193,81,1 script Warpra 113,{ + callfunc "QWS_Town_Warpra",3,"Amatsu Town"; + close; +} +comodo.gat,195,158,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",5,"Comodo Town"; + close; +} +einbroch.gat,229,196,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",7,"Einbroch Town"; + close; +} +einbech.gat,173,131,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",6,"Einbech Town"; + close; +} +geffen.gat,116,66,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",8,"Geffen Town"; + close; +} +gonryun.gat,152,130,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",9,"Gonryun Town"; + close; +} +hugel.gat,90,127,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",10,"Hugel Town"; + close; +} +jawaii.gat,107,182,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",12,"Jawaii Town"; + close; +} +izlude.gat,132,116,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",11,"Izlude Town"; + close; +} +lighthalzen.gat,153,100,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",13,"Lighthalzen Town"; + close; +} +louyang.gat,211,106,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",14,"Louyang Town"; + close; +} +morocc.gat,157,95,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",16,"Morroc Town"; + close; +} +nif_fild01.gat,319,77,1 script Warpra 113,{ + callfunc "QWS_Town_Warpra",17,"Niflheim Town"; + close; +} +payon.gat,183,110,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",18,"Payon Town"; + close; +} +prontera.gat,147,172,5 script Warpra 113,{ + callfunc "QWS_Town_Warpra",0,"Prontera Town"; + close; +} +umbala.gat,133,130,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",19,"Umbala Town"; + close; +} +xmas.gat,151,136,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",15,"Lutie Town"; + close; +} +yuno.gat,138,162,4 script Warpra 113,{ + callfunc "QWS_Town_Warpra",20,"Yuno Town"; + close; +} + +abyss_02.gat,274,266,1 script Warpra 113,{ + callfunc "QWS_Dungeon_Warpra",0,"Abyss Lake"; + close; +} + +ama_dun02.gat,192,118,5 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",1,"Amatsu Dungeon"; + close; +} + +anthell02.gat,170,165,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",2,"Ant Hell Dungeon"; + close; +} + +ayo_dun02.gat,258,193,5 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",3,"Ayotaya Dungeon"; + close; +} + +ein_dun02.gat,292,282,1 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",8,"Einbech Dungeon"; + close; +} + +iz_dun03.gat,202,47,2 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",4,"Byalan Dungeon"; + close; +} + +c_tower3.gat,129,106,4 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",5,"Clock Tower Dungeon"; + close; +} + +mjo_dun02.gat,39,25,4 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",6,"Coal Mine Dungeon"; + close; +} + +prt_sewb2.gat,176,30,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",7,"Culvert Dungeon"; + close; +} + +gefenia03.gat,137,34,0 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",9,"Gefenia Dungeon"; + close; +} + +gef_dun02.gat,218,61,2 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",10,"Gefen Dungeon"; + close; +} + +glast_01.gat,371,308,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",11,"Glast Heim Dungeon"; + close; +} + +gon_dun01.gat,167,273,4 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",12,"Gonryun Dungeon"; + close; +} + +juperos_02.gat,127,154,5 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",14,"Juperos Cave"; + close; +} + +kh_dun01.gat,14,224,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",28,"Kiel Dungeon"; + close; +} + +lhz_dun02.gat,156,151,5 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",15,"Lighthalzen Bio Lab"; + close; +} + +lou_dun02.gat,168,264,4 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",16,"Louyang Dungeon"; + close; +} + +mag_dun02.gat,46,41,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",17,"Magma Dungeon"; + close; +} + +odin_tem01.gat,115,148,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",18,"Odin Temple"; + close; +} + +orcsdun01.gat,185,11,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",19,"Orc Dungeon"; + close; +} + +pay_dun03.gat,162,143,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",20,"Payon Dungeon"; + close; +} + +moc_pryd02.gat,101,95,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",21,"Pyramides Dungeon"; + close; +} + +in_sphinx2.gat,274,268,1 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",22,"Sphinx Dungeon"; + close; +} + +tha_t07.gat,111,162,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",24,"Thanatos Tower"; + close; +} + +treasure02.gat,104,40,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",23,"Sunken Ship Dungeon"; + close; +} + +xmas_dun02.gat,124,131,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",25,"Toy Factory Dungeon"; + close; +} + +um_dun02.gat,44,28,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",27,"Umbala Dungeon"; + close; +} + +tur_dun02.gat,162,23,3 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",26,"Turtle Island Dungeon"; + close; +} +prt_maze02.gat,102,69,4 script Warpra Helper 112,{ + callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon"; + close; +} diff --git a/npc/custom/eAAC_Scripts/roll_a_dice.txt b/npc/custom/eAAC_Scripts/roll_a_dice.txt index 5a5e47b73..469683dd7 100644 --- a/npc/custom/eAAC_Scripts/roll_a_dice.txt +++ b/npc/custom/eAAC_Scripts/roll_a_dice.txt @@ -1,244 +1,244 @@ -//==========================================================
-//Roll a Dice NPC
-//==========================================================
-//Made by birkiczd
-//==========================================================
-//This game lets you and the Dicer throw 3 dices.
-//Whoever get's a higher number (the player or dealer) wins.
-//==========================================================
-//Version:1.0 - made script public
-// 1.1 - fixed a few bugs,added dice emos =)
-// 1.2 - made variables for the amount of zenys for
-// each bet so it is easy for people to costumize
-// the script
-// 1.3 - added more emoticons,made an Info menu
-// option which contains explanations and rules,
-// added the amount of lost/won zeny on the end
-// of each game,added more colors
-// 1.4 - some small code optimization thanks to Myzter
-//==========================================================
-
-
-cmd_in02.gat,181,98,2 script Dicer 57,{
-
-//These variables allow you to set the amount of zeny people can bet
-set @betzeny1,500; //500 zeny
-set @betzeny2,1000; //1000 zeny
-set @betzeny3,2000; //2000 zeny
-set @betzeny4,10000; //10000 zeny
-
-//Variable for the number guess zeny bet
-set @betnum, 1000; //1000 Zeny
-
-
- mes "[Dicer]";
- mes "Welcome to the Revolution Dice Game.You wanna check your luck with dices?Remember I am the dice expert and rarely someone was able to beat me.";
- next;
- mes "[Dicer]";
- mes "What would you like to do?";
- next;
- menu "Play",L_play,"Info",L_info,"Go away",L_go;
-
-L_go:
- mes "[Dicer]";
- mes "Please come again when you are ready.";
- close;
-
-L_info:
- mes "[Dicer]";
- mes "Please choose one of the following options for more informations:";
- next;
- menu "Main Rules",L_main,"Bets and Wins",L_bet,"Extra Games",L_extra,"Go away",L_go;
-
-L_main:
- mes "[Dicer]";
- mes "^0080FFRoll A Dice^000000 is a very simple game.The game allows you and the NPC to throw 3 dices.Whoever gets a higher total number wins.";
- next;
- goto L_info;
-
-L_bet:
- mes "[Dicer]";
- mes "You have 4 zeny amounts to choose for your bet.If you choose a high bet your win will also be higher,it is that simple.Also various extra games can increase your win.";
- next;
- mes "[Dicer]";
- mes "Example:";
- mes "^0080FFBet^000000 ^0080FFWin^000000";
- mes "500 1000";
- mes "1000 2000";
- mes "2000 4000";
- mes "10000 20000";
- next;
- goto L_info;
-
-L_extra:
- mes "[Dicer]";
- mes "You can also try increasing your win by playing extra games like guessing your total number at the end of the game.It will cost you an extra amount of zeny but if you guess the number your win will be tripled instead of doubled.";
- next;
- goto L_info;
-
-L_play:
- mes "[Dicer]";
- mes "Ok,please choose the amount of zeny you want to bet:";
- next;
- menu ""+@betzeny1+" Zeny",L_zeny1,""+@betzeny2+" Zeny",L_zeny2,""+@betzeny3+" Zeny",L_zeny3,""+@betzeny4+" Zeny",L_zeny4,"Too rich for my blood...",L_go;
-
- L_zeny1:
- if(Zeny < @betzeny1) goto L_nzeny;
- set @bet, @betzeny1;
- goto L_gamea;
- L_zeny2:
- if(Zeny < @betzeny2) goto L_nzeny;
- set @bet, @betzeny2;
- goto L_gamea;
- L_zeny3:
- if(Zeny < @betzeny3) goto L_nzeny;
- set @bet, @betzeny3;
- goto L_gamea;
- L_zeny4:
- if(Zeny < @betzeny4) goto L_nzeny;
- set @bet, @betzeny4;
- goto L_gamea;
-
-L_nzeny:
- mes "[Dicer]";
- emotion 20;
- mes "Sorry but it seems you don't have enough zeny!";
- close;
-
-L_gamea:
- mes "[Dicer]";
- mes "Would you like to try to increase your win by trying to guess the number you will get?";
- mes "It will cost you another ^0080FF"+@betnum+"^000000 zeny.";
- next;
- menu "Yes",L_gamec,"No",L_gameb;
-
-L_gamec:
- if(Zeny < @betnum + @bet) goto L_nzeny;
- mes "[Dicer]";
- mes "Please input the number you think you will get (3-18).";
- input @numg;
- if(@numg<3) message strcharinfo(0),"Number is too low, input again.";
- if(@numg>18) message strcharinfo(0),"Number is too high, input again.";
- if(@numg<3||@numg>18) goto L_gamec;
- set Zeny, Zeny - @betnum;
- next;
- goto L_gameb;
-
-L_gameb:
-
- set @dea1, rand(1,6);
- set @dea2, rand(1,6);
- set @dea3, rand(1,6);
- set @pla1, rand(1,6);
- set @pla2, rand(1,6);
- set @pla3, rand(1,6);
- set @deatot, @dea1+@dea2+@dea3;
- set @platot, @pla1+@pla2+@pla3;
-
- mes "[Dicer]";
- mes "I will be the first one to roll the dices,and after that you will throw them.I am feeling lucky today, so you better go away before I take every zeny you have.";
- next;
- mes "[^0080FFDicer 1st Turn^000000]";
- mes "Throwing first dice!";
- mes ".....roll.....roll....roll....";
- emotion 58;
- mes " ";
- mes "First throw: ^0080FF"+@dea1+" ^000000";
- next;
- mes "[^0080FFDicer 2nd Turn^000000]";
- mes "Throwing second dice!";
- emotion 58;
- mes ".....roll.....roll....roll....";
- mes " ";
- mes "Second throw: ^0080FF"+@dea2+" ^000000";
- next;
- mes "[^0080FFDicer 3rd Turn^000000]";
- mes "Throwing third dice!";
- emotion 58;
- mes ".....roll.....roll....roll....";
- mes " ";
- mes "Third throw: ^0080FF"+@dea3+" ^000000";
- next;
- mes "[Dicer]";
- mes "Now it's your turn to throw the dices.I bet you can't get higher numbers then me.";
- next;
- mes "[^0080FFPlayer 1st Turn^000000]";
- mes "Throwing first dice!";
- mes ".....roll.....roll....roll....";
- emotion 58;
- mes " ";
- mes "First throw: ^0080FF"+@pla1+" ^000000";
- next;
- mes "[^0080FFPlayer 2nd Turn^000000]";
- mes "Throwing second dice!";
- emotion 58;
- mes ".....roll.....roll....roll....";
- mes " ";
- mes "Second throw: ^0080FF"+@pla2+" ^000000";
- next;
- mes "[^0080FFPlayer 3rd Turn^000000]";
- mes "Throwing third dice!";
- emotion 58;
- mes ".....roll.....roll....roll....";
- mes " ";
- mes "Third throw: ^0080FF"+@pla3+" ^000000";
- next;
- mes "[Dicer]";
- mes "Let's look at our total numbers:";
- mes " ";
- mes "Dicer Total: ^0080FF"+@deatot+" ^000000.";
- mes "Player Total: ^0080FF"+@platot+" ^000000.";
- next;
- if (@platot < @deatot) goto L_lose;
- if (@platot == @deatot) goto L_again;
- if (@platot > @deatot && @platot == @numg) goto L_win2;
- if (@platot > @deatot) goto L_win1;
-
-L_lose:
- mes "[Dicer]";
- set Zeny, Zeny - @bet;
- emotion 39;
- mes "I got a higher number!!!";
- mes "See I told you nobody can beat me!";
- mes " ";
- mes "You lost ^0080FF"+@bet+"^000000 Zeny.";
- next;
- goto L_againa;
-
-L_again:
- mes "[Dicer]";
- emotion 54;
- mes "It seems it's a draw.Let's play again.";
- next;
- goto L_play;
-
-L_win1:
- mes "[Dicer]";
- set Zeny, Zeny + @bet*2;
- set @wona, @bet*2;
- emotion 36;
- mes "I can't belive I lost. Here take your money.";
- mes " ";
- mes "You won ^0080FF"+@wona+"^000000 Zeny.";
- next;
- goto L_againa;
-
-L_win2:
- mes "[Dicer]";
- set Zeny, Zeny + @bet*3;
- set @wonb, @bet*3;
- emotion 36;
- mes "You even guessed the total number you got.I can't belive I lost. Here is your money.";
- mes " ";
- mes "You won ^0080FF"+@wonb+"^000000 Zeny.";
- next;
- goto L_againa;
-
-L_againa:
- mes "[Dicer]";
- mes "Would you like to play again?";
- next;
- menu "Yes",L_play,"No",L_go;
-
-
-}
+//========================================================== +//Roll a Dice NPC +//========================================================== +//Made by birkiczd +//========================================================== +//This game lets you and the Dicer throw 3 dices. +//Whoever get's a higher number (the player or dealer) wins. +//========================================================== +//Version:1.0 - made script public +// 1.1 - fixed a few bugs,added dice emos =) +// 1.2 - made variables for the amount of zenys for +// each bet so it is easy for people to costumize +// the script +// 1.3 - added more emoticons,made an Info menu +// option which contains explanations and rules, +// added the amount of lost/won zeny on the end +// of each game,added more colors +// 1.4 - some small code optimization thanks to Myzter +//========================================================== + + +cmd_in02.gat,181,98,2 script Dicer 57,{ + +//These variables allow you to set the amount of zeny people can bet +set @betzeny1,500; //500 zeny +set @betzeny2,1000; //1000 zeny +set @betzeny3,2000; //2000 zeny +set @betzeny4,10000; //10000 zeny + +//Variable for the number guess zeny bet +set @betnum, 1000; //1000 Zeny + + + mes "[Dicer]"; + mes "Welcome to the Revolution Dice Game.You wanna check your luck with dices?Remember I am the dice expert and rarely someone was able to beat me."; + next; + mes "[Dicer]"; + mes "What would you like to do?"; + next; + menu "Play",L_play,"Info",L_info,"Go away",L_go; + +L_go: + mes "[Dicer]"; + mes "Please come again when you are ready."; + close; + +L_info: + mes "[Dicer]"; + mes "Please choose one of the following options for more informations:"; + next; + menu "Main Rules",L_main,"Bets and Wins",L_bet,"Extra Games",L_extra,"Go away",L_go; + +L_main: + mes "[Dicer]"; + mes "^0080FFRoll A Dice^000000 is a very simple game.The game allows you and the NPC to throw 3 dices.Whoever gets a higher total number wins."; + next; + goto L_info; + +L_bet: + mes "[Dicer]"; + mes "You have 4 zeny amounts to choose for your bet.If you choose a high bet your win will also be higher,it is that simple.Also various extra games can increase your win."; + next; + mes "[Dicer]"; + mes "Example:"; + mes "^0080FFBet^000000 ^0080FFWin^000000"; + mes "500 1000"; + mes "1000 2000"; + mes "2000 4000"; + mes "10000 20000"; + next; + goto L_info; + +L_extra: + mes "[Dicer]"; + mes "You can also try increasing your win by playing extra games like guessing your total number at the end of the game.It will cost you an extra amount of zeny but if you guess the number your win will be tripled instead of doubled."; + next; + goto L_info; + +L_play: + mes "[Dicer]"; + mes "Ok,please choose the amount of zeny you want to bet:"; + next; + menu ""+@betzeny1+" Zeny",L_zeny1,""+@betzeny2+" Zeny",L_zeny2,""+@betzeny3+" Zeny",L_zeny3,""+@betzeny4+" Zeny",L_zeny4,"Too rich for my blood...",L_go; + + L_zeny1: + if(Zeny < @betzeny1) goto L_nzeny; + set @bet, @betzeny1; + goto L_gamea; + L_zeny2: + if(Zeny < @betzeny2) goto L_nzeny; + set @bet, @betzeny2; + goto L_gamea; + L_zeny3: + if(Zeny < @betzeny3) goto L_nzeny; + set @bet, @betzeny3; + goto L_gamea; + L_zeny4: + if(Zeny < @betzeny4) goto L_nzeny; + set @bet, @betzeny4; + goto L_gamea; + +L_nzeny: + mes "[Dicer]"; + emotion 20; + mes "Sorry but it seems you don't have enough zeny!"; + close; + +L_gamea: + mes "[Dicer]"; + mes "Would you like to try to increase your win by trying to guess the number you will get?"; + mes "It will cost you another ^0080FF"+@betnum+"^000000 zeny."; + next; + menu "Yes",L_gamec,"No",L_gameb; + +L_gamec: + if(Zeny < @betnum + @bet) goto L_nzeny; + mes "[Dicer]"; + mes "Please input the number you think you will get (3-18)."; + input @numg; + if(@numg<3) message strcharinfo(0),"Number is too low, input again."; + if(@numg>18) message strcharinfo(0),"Number is too high, input again."; + if(@numg<3||@numg>18) goto L_gamec; + set Zeny, Zeny - @betnum; + next; + goto L_gameb; + +L_gameb: + + set @dea1, rand(1,6); + set @dea2, rand(1,6); + set @dea3, rand(1,6); + set @pla1, rand(1,6); + set @pla2, rand(1,6); + set @pla3, rand(1,6); + set @deatot, @dea1+@dea2+@dea3; + set @platot, @pla1+@pla2+@pla3; + + mes "[Dicer]"; + mes "I will be the first one to roll the dices,and after that you will throw them.I am feeling lucky today, so you better go away before I take every zeny you have."; + next; + mes "[^0080FFDicer 1st Turn^000000]"; + mes "Throwing first dice!"; + mes ".....roll.....roll....roll...."; + emotion 58; + mes " "; + mes "First throw: ^0080FF"+@dea1+" ^000000"; + next; + mes "[^0080FFDicer 2nd Turn^000000]"; + mes "Throwing second dice!"; + emotion 58; + mes ".....roll.....roll....roll...."; + mes " "; + mes "Second throw: ^0080FF"+@dea2+" ^000000"; + next; + mes "[^0080FFDicer 3rd Turn^000000]"; + mes "Throwing third dice!"; + emotion 58; + mes ".....roll.....roll....roll...."; + mes " "; + mes "Third throw: ^0080FF"+@dea3+" ^000000"; + next; + mes "[Dicer]"; + mes "Now it's your turn to throw the dices.I bet you can't get higher numbers then me."; + next; + mes "[^0080FFPlayer 1st Turn^000000]"; + mes "Throwing first dice!"; + mes ".....roll.....roll....roll...."; + emotion 58; + mes " "; + mes "First throw: ^0080FF"+@pla1+" ^000000"; + next; + mes "[^0080FFPlayer 2nd Turn^000000]"; + mes "Throwing second dice!"; + emotion 58; + mes ".....roll.....roll....roll...."; + mes " "; + mes "Second throw: ^0080FF"+@pla2+" ^000000"; + next; + mes "[^0080FFPlayer 3rd Turn^000000]"; + mes "Throwing third dice!"; + emotion 58; + mes ".....roll.....roll....roll...."; + mes " "; + mes "Third throw: ^0080FF"+@pla3+" ^000000"; + next; + mes "[Dicer]"; + mes "Let's look at our total numbers:"; + mes " "; + mes "Dicer Total: ^0080FF"+@deatot+" ^000000."; + mes "Player Total: ^0080FF"+@platot+" ^000000."; + next; + if (@platot < @deatot) goto L_lose; + if (@platot == @deatot) goto L_again; + if (@platot > @deatot && @platot == @numg) goto L_win2; + if (@platot > @deatot) goto L_win1; + +L_lose: + mes "[Dicer]"; + set Zeny, Zeny - @bet; + emotion 39; + mes "I got a higher number!!!"; + mes "See I told you nobody can beat me!"; + mes " "; + mes "You lost ^0080FF"+@bet+"^000000 Zeny."; + next; + goto L_againa; + +L_again: + mes "[Dicer]"; + emotion 54; + mes "It seems it's a draw.Let's play again."; + next; + goto L_play; + +L_win1: + mes "[Dicer]"; + set Zeny, Zeny + @bet*2; + set @wona, @bet*2; + emotion 36; + mes "I can't belive I lost. Here take your money."; + mes " "; + mes "You won ^0080FF"+@wona+"^000000 Zeny."; + next; + goto L_againa; + +L_win2: + mes "[Dicer]"; + set Zeny, Zeny + @bet*3; + set @wonb, @bet*3; + emotion 36; + mes "You even guessed the total number you got.I can't belive I lost. Here is your money."; + mes " "; + mes "You won ^0080FF"+@wonb+"^000000 Zeny."; + next; + goto L_againa; + +L_againa: + mes "[Dicer]"; + mes "Would you like to play again?"; + next; + menu "Yes",L_play,"No",L_go; + + +} diff --git a/npc/custom/eAAC_Scripts/vendmachine.txt b/npc/custom/eAAC_Scripts/vendmachine.txt index 82a514c8d..ac7735b23 100644 --- a/npc/custom/eAAC_Scripts/vendmachine.txt +++ b/npc/custom/eAAC_Scripts/vendmachine.txt @@ -1,296 +1,296 @@ -//=====================================
-// Vending Machine Script
-// v2.3
-//=====================================
-// by Celestria
-//=====================================
-// Changelog:
-// 2.3 - Added in "Slam" feature, as well as admin ability to turn machine on and off.
-// - Added admin menu. Allows GMs to put machines in/out of service, and to clear
-// all jammed items.
-//
-// 2.2 - Added in/Renamed some variables to allow a single machine to block on several
-// items simultaneously. This fix also allows the two-item drop to work with every
-// item the machine is jammed on.
-//
-// 2.1 - Fixed an error where if one machine jammed on a menu item (say 3 for example),
-// if another machine also jammed on the same menu item (3 in this case), the original
-// machine to jam would be unjammed.
-// - This fix only allows a machine to jam one item at a time. Will fix in the future.
-//
-// 2.0 - Completely redid the script using a call-function.
-// Now all replica scripts can simply be a copy of Vending Machine,
-// but with variables modified to suit it''s intended use.
-//
-// 1.1 - Fixed $jamplayer1 not being a string, thanks to Terces.
-// - Changed random number that intiates jam to 1, to allow for faster modification of jam rates.
-//
-// 1.0 - Creted a script for selling numerous items that would occasionally jam on players.
-// - Used numbered variables to allow for multiplacation of the script.
-//=====================================
-
-p_track01.gat,45,58,4 script Vending Machine#1 910,{
-
- set @machine,1; //sets the unique number of this machine
- //DO NOT have two machines with the same number
-
- set @jamrate,1000; //Odds of machine jamming will be 1 in @jamrate
-
- set @slam,0; //set this to 0 to turn on the slam feature, any other setting disables it.
- set @fallrate,10; //Odds of machine falling on someone who hits it are 1 in @fallrate
- set @freerate,10000; //Odds of machine giving an item to someone who hits it are 1 in @freerate
-
- set @admin,99; //sets GM level needed to access Admin menu
-
- // the following sets the items for sale. Script currently only handles 10 items.
- setarray @item[0], 12143, 519, 565;
- setarray @price[0], 100, 50, 200;
-
- set @itemn$[0], getitemname(@item[0]);
- set @itemn$[1], getitemname(@item[1]);
- set @itemn$[2], getitemname(@item[2]);
- set @itemn$[3], getitemname(@item[3]);
- set @itemn$[4], getitemname(@item[4]);
- set @itemn$[5], getitemname(@item[5]);
- set @itemn$[6], getitemname(@item[6]);
- set @itemn$[7], getitemname(@item[7]);
- set @itemn$[8], getitemname(@item[8]);
- set @itemn$[9], getitemname(@item[9]);
-
- set @menu$[0], @itemn$[0]+" - "+@price[0];
- set @menu$[1], @itemn$[1]+" - "+@price[1];
- set @menu$[2], @itemn$[2]+" - "+@price[2];
- set @menu$[3], "Cancel";
- set @menu$[4], "";
- set @menu$[5], "";
- set @menu$[6], "";
- set @menu$[7], "";
- set @menu$[8], "";
- set @menu$[9], "";
- set @menu$[10], ""; // "Cancel" only. Used if vending ten items.
-
- callfunc "F_Vend1";
-}
-
-
-
-
-
-
-
-
-
-//===============================================================================================
-// Functions
-//
-// !!!DO NOT EDIT BELOW THIS LINE!!!
-//
-//===============================================================================================
-
-function script F_Vend1 {
-
- if(getgmlevel() >= @admin) goto M_Admin;
-
-M_Player:
- if($outorder[@machine]) goto M_Ooo;
- if(@slam) callfunc "F_Vend2";
- mes "You see a vending machine. What would you like to do?";
- next;
- menu "Buy an item",M_Vend,"Hit it",M_Hit;
-
-M_Vend:
- callfunc "F_Vend2";
- end;
-
-M_Hit:
- callfunc "F_Slam";
- end;
-
-M_Admin:
- mes "[Admin Mode]";
- mes "What would you like to do?";
- next;
- menu "Player Mode",M_Player,"Post 'Out of Order'",M_Ooo2,"Remove 'Out of Order'",M_Ooo3,"Fix Jammed Items",M_Fix;
-
-M_Ooo:
- mes "Out of Order";
- close;
-
-M_Ooo2:
- set $outorder[@machine],1;
- mes "The machine is now Out of Service";
- close;
-
-M_Ooo3:
- set $outorder[@machine],0;
- mes "The machine is now in service.";
- close;
-
-M_Fix:
- set $itemjam0$[@machine],"0";
- set $itemjam1$[@machine],"0";
- set $itemjam2$[@machine],"0";
- set $itemjam3$[@machine],"0";
- set $itemjam4$[@machine],"0";
- set $itemjam5$[@machine],"0";
- set $itemjam6$[@machine],"0";
- set $itemjam7$[@machine],"0";
- set $itemjam8$[@machine],"0";
- set $itemjam9$[@machine],"0";
- mes "All jammed items have been fixed.";
- close;
-}
-
-function script F_Vend2 {
-
- if(strcharinfo(0)==$itemjam0$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam1$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam2$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam3$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam4$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam5$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam6$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam7$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam8$[@machine]) goto B_StillJammed;
- if(strcharinfo(0)==$itemjam9$[@machine]) goto B_StillJammed;
- set @jammed,rand(1,@jamrate);
- mes "You peek inside the vending machine to see what's available.";
- next;
- menu @menu$[0],M_Ite0, @menu$[1],M_Ite1, @menu$[2],M_Ite2, @menu$[3],M_Ite3,
- @menu$[4],M_Ite4, @menu$[5],M_Ite5, @menu$[6],M_Ite6, @menu$[7],M_Ite7,
- @menu$[8],M_Ite8, @menu$[9],M_Ite9, @menu$[10],M_Ite10;
-
- M_Ite0:
- set @num, 0;
- goto B_Buy;
- M_Ite1:
- set @num, 1;
- goto B_Buy;
- M_Ite2:
- set @num, 2;
- goto B_Buy;
- M_Ite3:
- set @num, 3;
- goto B_Buy;
- M_Ite4:
- set @num, 4;
- goto B_Buy;
- M_Ite5:
- set @num, 5;
- goto B_Buy;
- M_Ite6:
- set @num, 6;
- goto B_Buy;
- M_Ite7:
- set @num, 7;
- goto B_Buy;
- M_Ite8:
- set @num, 8;
- goto B_Buy;
- M_Ite9:
- set @num, 9;
- goto B_Buy;
- M_Ite10:
- set @num, 10;
- goto B_Buy;
-
-
-
-B_Cancel:
- mes "On second thoughts, you decide not to buy anything.";
- close;
-
-B_StillJammed:
- mes "You shake and punch the vending machine, but it appears no matter how much energy you exert, the dang item isn't going to come loose.";
- next;
- mes "["+strcharinfo(0)+"]";
- mes "DANG VENDING MACHINES!";
- close;
-
-B_Broke:
- mes "As you put your last zeny in, you realise you don't have enough to afford the product.";
- mes "Sadly you hit the refund button and pick up what little zeny you have.";
- close;
-
-B_Buy:
- if (@menu$[@num] == "Cancel") goto B_Cancel;
- if(@num==0){if($itemjam0$[@machine]!="0") set @jammed,0;}
- if(@num==1){if($itemjam1$[@machine]!="0") set @jammed,0;}
- if(@num==2){if($itemjam2$[@machine]!="0") set @jammed,0;}
- if(@num==3){if($itemjam3$[@machine]!="0") set @jammed,0;}
- if(@num==4){if($itemjam4$[@machine]!="0") set @jammed,0;}
- if(@num==5){if($itemjam5$[@machine]!="0") set @jammed,0;}
- if(@num==6){if($itemjam6$[@machine]!="0") set @jammed,0;}
- if(@num==7){if($itemjam7$[@machine]!="0") set @jammed,0;}
- if(@num==8){if($itemjam8$[@machine]!="0") set @jammed,0;}
- if(@num==9){if($itemjam9$[@machine]!="0") set @jammed,0;}
- if(Zeny < @price[@num]) goto B_Broke;
- set Zeny,Zeny-@price[@num];
- if(@jammed == 1) goto B_Jamitem;
- mes "Vrrrrrrrr~";
- mes "*clunk*";
- next;
- if(@jammed == 0) goto B_Get2;
- getitem @item[@num],1;
- mes "A "+@itemn$[@num]+" pops out.";
- close;
-B_Get2:
- getitem @item[@num],2;
- mes "What the!?";
- mes "Two "+@itemn$[@num]+"s popped out!";
- mes "It must be your lucky day.";
- if(@num==0) set $itemjam0$[@machine],"0";
- if(@num==1) set $itemjam1$[@machine],"0";
- if(@num==2) set $itemjam2$[@machine],"0";
- if(@num==3) set $itemjam3$[@machine],"0";
- if(@num==4) set $itemjam4$[@machine],"0";
- if(@num==5) set $itemjam5$[@machine],"0";
- if(@num==6) set $itemjam6$[@machine],"0";
- if(@num==7) set $itemjam7$[@machine],"0";
- if(@num==8) set $itemjam8$[@machine],"0";
- if(@num==9) set $itemjam9$[@machine],"0";
- close;
-B_Jamitem:
- mes "Vrrrrrrrr~";
- mes "*click*";
- next;
- mes "["+strcharinfo(0)+"]";
- mes "Dammit!";
- mes "I hate it when these damn things jam!";
- if(@num==0) set $itemjam0$[@machine],strcharinfo(0);
- if(@num==1) set $itemjam1$[@machine],strcharinfo(0);
- if(@num==2) set $itemjam2$[@machine],strcharinfo(0);
- if(@num==3) set $itemjam3$[@machine],strcharinfo(0);
- if(@num==4) set $itemjam4$[@machine],strcharinfo(0);
- if(@num==5) set $itemjam5$[@machine],strcharinfo(0);
- if(@num==6) set $itemjam6$[@machine],strcharinfo(0);
- if(@num==7) set $itemjam7$[@machine],strcharinfo(0);
- if(@num==8) set $itemjam8$[@machine],strcharinfo(0);
- if(@num==9) set $itemjam9$[@machine],strcharinfo(0);
- close;
-}
-
-function script F_Slam {
-
- set @fall,rand(1,@fallrate);
- set @free,rand(1,@freerate);
-R_Item:
- set @num,rand(9);
- if(@item[@num]==0) goto R_Item;
-
- mes "You give the vending machine a good solid whack.";
- next;
- mes "...";
- next;
- if(@fall==1){
- mes "The machine shakes, and then falls directly on top of you.";
- close2;
- percentheal -100,-100;
- end;}
- if(@free==1){
- getitem @item[@num],1;
- mes "The machine shakes, and then drops an item.";
- close;}
- mes "The machine shakes, but nothing happens";
- close;
-}
+//===================================== +// Vending Machine Script +// v2.3 +//===================================== +// by Celestria +//===================================== +// Changelog: +// 2.3 - Added in "Slam" feature, as well as admin ability to turn machine on and off. +// - Added admin menu. Allows GMs to put machines in/out of service, and to clear +// all jammed items. +// +// 2.2 - Added in/Renamed some variables to allow a single machine to block on several +// items simultaneously. This fix also allows the two-item drop to work with every +// item the machine is jammed on. +// +// 2.1 - Fixed an error where if one machine jammed on a menu item (say 3 for example), +// if another machine also jammed on the same menu item (3 in this case), the original +// machine to jam would be unjammed. +// - This fix only allows a machine to jam one item at a time. Will fix in the future. +// +// 2.0 - Completely redid the script using a call-function. +// Now all replica scripts can simply be a copy of Vending Machine, +// but with variables modified to suit it''s intended use. +// +// 1.1 - Fixed $jamplayer1 not being a string, thanks to Terces. +// - Changed random number that intiates jam to 1, to allow for faster modification of jam rates. +// +// 1.0 - Creted a script for selling numerous items that would occasionally jam on players. +// - Used numbered variables to allow for multiplacation of the script. +//===================================== + +p_track01.gat,45,58,4 script Vending Machine#1 910,{ + + set @machine,1; //sets the unique number of this machine + //DO NOT have two machines with the same number + + set @jamrate,1000; //Odds of machine jamming will be 1 in @jamrate + + set @slam,0; //set this to 0 to turn on the slam feature, any other setting disables it. + set @fallrate,10; //Odds of machine falling on someone who hits it are 1 in @fallrate + set @freerate,10000; //Odds of machine giving an item to someone who hits it are 1 in @freerate + + set @admin,99; //sets GM level needed to access Admin menu + + // the following sets the items for sale. Script currently only handles 10 items. + setarray @item[0], 12143, 519, 565; + setarray @price[0], 100, 50, 200; + + set @itemn$[0], getitemname(@item[0]); + set @itemn$[1], getitemname(@item[1]); + set @itemn$[2], getitemname(@item[2]); + set @itemn$[3], getitemname(@item[3]); + set @itemn$[4], getitemname(@item[4]); + set @itemn$[5], getitemname(@item[5]); + set @itemn$[6], getitemname(@item[6]); + set @itemn$[7], getitemname(@item[7]); + set @itemn$[8], getitemname(@item[8]); + set @itemn$[9], getitemname(@item[9]); + + set @menu$[0], @itemn$[0]+" - "+@price[0]; + set @menu$[1], @itemn$[1]+" - "+@price[1]; + set @menu$[2], @itemn$[2]+" - "+@price[2]; + set @menu$[3], "Cancel"; + set @menu$[4], ""; + set @menu$[5], ""; + set @menu$[6], ""; + set @menu$[7], ""; + set @menu$[8], ""; + set @menu$[9], ""; + set @menu$[10], ""; // "Cancel" only. Used if vending ten items. + + callfunc "F_Vend1"; +} + + + + + + + + + +//=============================================================================================== +// Functions +// +// !!!DO NOT EDIT BELOW THIS LINE!!! +// +//=============================================================================================== + +function script F_Vend1 { + + if(getgmlevel() >= @admin) goto M_Admin; + +M_Player: + if($outorder[@machine]) goto M_Ooo; + if(@slam) callfunc "F_Vend2"; + mes "You see a vending machine. What would you like to do?"; + next; + menu "Buy an item",M_Vend,"Hit it",M_Hit; + +M_Vend: + callfunc "F_Vend2"; + end; + +M_Hit: + callfunc "F_Slam"; + end; + +M_Admin: + mes "[Admin Mode]"; + mes "What would you like to do?"; + next; + menu "Player Mode",M_Player,"Post 'Out of Order'",M_Ooo2,"Remove 'Out of Order'",M_Ooo3,"Fix Jammed Items",M_Fix; + +M_Ooo: + mes "Out of Order"; + close; + +M_Ooo2: + set $outorder[@machine],1; + mes "The machine is now Out of Service"; + close; + +M_Ooo3: + set $outorder[@machine],0; + mes "The machine is now in service."; + close; + +M_Fix: + set $itemjam0$[@machine],"0"; + set $itemjam1$[@machine],"0"; + set $itemjam2$[@machine],"0"; + set $itemjam3$[@machine],"0"; + set $itemjam4$[@machine],"0"; + set $itemjam5$[@machine],"0"; + set $itemjam6$[@machine],"0"; + set $itemjam7$[@machine],"0"; + set $itemjam8$[@machine],"0"; + set $itemjam9$[@machine],"0"; + mes "All jammed items have been fixed."; + close; +} + +function script F_Vend2 { + + if(strcharinfo(0)==$itemjam0$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam1$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam2$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam3$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam4$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam5$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam6$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam7$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam8$[@machine]) goto B_StillJammed; + if(strcharinfo(0)==$itemjam9$[@machine]) goto B_StillJammed; + set @jammed,rand(1,@jamrate); + mes "You peek inside the vending machine to see what's available."; + next; + menu @menu$[0],M_Ite0, @menu$[1],M_Ite1, @menu$[2],M_Ite2, @menu$[3],M_Ite3, + @menu$[4],M_Ite4, @menu$[5],M_Ite5, @menu$[6],M_Ite6, @menu$[7],M_Ite7, + @menu$[8],M_Ite8, @menu$[9],M_Ite9, @menu$[10],M_Ite10; + + M_Ite0: + set @num, 0; + goto B_Buy; + M_Ite1: + set @num, 1; + goto B_Buy; + M_Ite2: + set @num, 2; + goto B_Buy; + M_Ite3: + set @num, 3; + goto B_Buy; + M_Ite4: + set @num, 4; + goto B_Buy; + M_Ite5: + set @num, 5; + goto B_Buy; + M_Ite6: + set @num, 6; + goto B_Buy; + M_Ite7: + set @num, 7; + goto B_Buy; + M_Ite8: + set @num, 8; + goto B_Buy; + M_Ite9: + set @num, 9; + goto B_Buy; + M_Ite10: + set @num, 10; + goto B_Buy; + + + +B_Cancel: + mes "On second thoughts, you decide not to buy anything."; + close; + +B_StillJammed: + mes "You shake and punch the vending machine, but it appears no matter how much energy you exert, the dang item isn't going to come loose."; + next; + mes "["+strcharinfo(0)+"]"; + mes "DANG VENDING MACHINES!"; + close; + +B_Broke: + mes "As you put your last zeny in, you realise you don't have enough to afford the product."; + mes "Sadly you hit the refund button and pick up what little zeny you have."; + close; + +B_Buy: + if (@menu$[@num] == "Cancel") goto B_Cancel; + if(@num==0){if($itemjam0$[@machine]!="0") set @jammed,0;} + if(@num==1){if($itemjam1$[@machine]!="0") set @jammed,0;} + if(@num==2){if($itemjam2$[@machine]!="0") set @jammed,0;} + if(@num==3){if($itemjam3$[@machine]!="0") set @jammed,0;} + if(@num==4){if($itemjam4$[@machine]!="0") set @jammed,0;} + if(@num==5){if($itemjam5$[@machine]!="0") set @jammed,0;} + if(@num==6){if($itemjam6$[@machine]!="0") set @jammed,0;} + if(@num==7){if($itemjam7$[@machine]!="0") set @jammed,0;} + if(@num==8){if($itemjam8$[@machine]!="0") set @jammed,0;} + if(@num==9){if($itemjam9$[@machine]!="0") set @jammed,0;} + if(Zeny < @price[@num]) goto B_Broke; + set Zeny,Zeny-@price[@num]; + if(@jammed == 1) goto B_Jamitem; + mes "Vrrrrrrrr~"; + mes "*clunk*"; + next; + if(@jammed == 0) goto B_Get2; + getitem @item[@num],1; + mes "A "+@itemn$[@num]+" pops out."; + close; +B_Get2: + getitem @item[@num],2; + mes "What the!?"; + mes "Two "+@itemn$[@num]+"s popped out!"; + mes "It must be your lucky day."; + if(@num==0) set $itemjam0$[@machine],"0"; + if(@num==1) set $itemjam1$[@machine],"0"; + if(@num==2) set $itemjam2$[@machine],"0"; + if(@num==3) set $itemjam3$[@machine],"0"; + if(@num==4) set $itemjam4$[@machine],"0"; + if(@num==5) set $itemjam5$[@machine],"0"; + if(@num==6) set $itemjam6$[@machine],"0"; + if(@num==7) set $itemjam7$[@machine],"0"; + if(@num==8) set $itemjam8$[@machine],"0"; + if(@num==9) set $itemjam9$[@machine],"0"; + close; +B_Jamitem: + mes "Vrrrrrrrr~"; + mes "*click*"; + next; + mes "["+strcharinfo(0)+"]"; + mes "Dammit!"; + mes "I hate it when these damn things jam!"; + if(@num==0) set $itemjam0$[@machine],strcharinfo(0); + if(@num==1) set $itemjam1$[@machine],strcharinfo(0); + if(@num==2) set $itemjam2$[@machine],strcharinfo(0); + if(@num==3) set $itemjam3$[@machine],strcharinfo(0); + if(@num==4) set $itemjam4$[@machine],strcharinfo(0); + if(@num==5) set $itemjam5$[@machine],strcharinfo(0); + if(@num==6) set $itemjam6$[@machine],strcharinfo(0); + if(@num==7) set $itemjam7$[@machine],strcharinfo(0); + if(@num==8) set $itemjam8$[@machine],strcharinfo(0); + if(@num==9) set $itemjam9$[@machine],strcharinfo(0); + close; +} + +function script F_Slam { + + set @fall,rand(1,@fallrate); + set @free,rand(1,@freerate); +R_Item: + set @num,rand(9); + if(@item[@num]==0) goto R_Item; + + mes "You give the vending machine a good solid whack."; + next; + mes "..."; + next; + if(@fall==1){ + mes "The machine shakes, and then falls directly on top of you."; + close2; + percentheal -100,-100; + end;} + if(@free==1){ + getitem @item[@num],1; + mes "The machine shakes, and then drops an item."; + close;} + mes "The machine shakes, but nothing happens"; + close; +} |