* eAAC Update + Fix [erKURITA]

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6682 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
eaac 2006-05-21 20:10:42 +00:00
parent 752cd268ef
commit 6a3fbf2605
5 changed files with 1270 additions and 1035 deletions

View File

@ -31,6 +31,7 @@ Evera
Date Added Date Added
====== ======
05/19 05/19
* eAAC Update + Fix [erKURITA]
* Translated sample/gstorage_test.txt * Translated sample/gstorage_test.txt
* Commented a warp that stands in the middle of nowhere [Playtester] * Commented a warp that stands in the middle of nowhere [Playtester]
05/17 05/17

View File

@ -15,9 +15,13 @@
//= options for GMs. //= options for GMs.
//= 2.1 - Made few changes including the add/remove items //= 2.1 - Made few changes including the add/remove items
//= feature. //= 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.
//===== Compatible With ===================================== //===== Compatible With =====================================
//= eAthena - any version that contains the sql_query //= eAthena - any version that contains the escape_sql
//= function (4368) //= function (Stable 6299 OR Trunk 6262)
//===== Description ========================================= //===== Description =========================================
//= A script that lets a player claim an item for donating. //= A script that lets a player claim an item for donating.
//= Allows a GM to input each donation. //= Allows a GM to input each donation.
@ -30,15 +34,13 @@
//=========================================================== //===========================================================
//= Thanks to Vich for helping me with the SQL syntax. //= Thanks to Vich for helping me with the SQL syntax.
//= Thanks to Lance for helping me with the the arrays and //= Thanks to Lance for helping me with the the arrays and
//= for implementing this feature. XD //= for implementing query_sql.
//= Thanks to Skotlex for implementing escape_sql.
//=========================================================== //===========================================================
prontera.gat,145,179,5 script Donation Girl 714,{ prontera.gat,145,179,5 script Donation Girl 714,{
//Set how many 'dollars' per reward. if (getgmlevel() >= 80) goto L_GM;
set @currency, 10;
if (getgmlevel(99) == 99) goto L_GM;
L_START: L_START:
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "Hello! I'm the Donation Girl!"; mes "Hello! I'm the Donation Girl!";
@ -48,7 +50,7 @@ next;
menu "More info",-,"Make a claim",L_CHECK,"Statistics",L_STATS; menu "More info",-,"Make a claim",L_CHECK,"Statistics",L_STATS;
L_INFO: L_INFO:
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "Every month, we (the admins) are required to pay hundreds of dollars to keep this server running."; mes "Each month, a lot of money is paid to keep this server running.";
next; next;
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "You can support us by donating any amount of money."; mes "You can support us by donating any amount of money.";
@ -56,27 +58,27 @@ next;
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "To show our appreciation, we will gladly give you a reward."; mes "To show our appreciation, we will gladly give you a reward.";
next; next;
next; menu "Continue",L_START,"Cancel",-;
menu "Continue",L_START,"Cancel",L_CLOSE;
close; close;
L_CHECK: L_CHECK:
query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+getcharid(3)+"", @amount; query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+escape_sql(getcharid(3))+"", @amount$;
query_sql "SELECT `claimed` FROM `donate` WHERE `account_id` = "+getcharid(3)+"", @claimed; query_sql "SELECT `claimed` FROM `donate` WHERE `account_id` = "+escape_sql(getcharid(3))+"", @claimed$;
set @value, @amount-@claimed; query_sql "SELECT MIN(price) FROM `donate_item_db`", @min$;
if(@value>=@currency) goto L_CLAIM; query_sql "SELECT "+@amount$+" - "+@claimed$+"", @value$;
query_sql "SELECT "+@value$+" >= "+@min$+"", @enough;
if(@enough) goto L_CLAIM;
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "Sorry, but I have no records of your donation."; mes "Sorry, you do not have enough to make a claim.";
mes "If you have donated but have not made a claim,"; mes "If you have donated but have not made a claim,";
mes "Please give us time to process your donation."; mes "Please give us time to process your donation.";
close; close;
L_CLAIM: L_CLAIM:
set @items, @value/@currency;
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "Thankyou for donating!"; mes "Thankyou for donating!";
mes "You are able to claim "+@items+" item(s)."; mes "You have $"+@value$+" worth of credit!";
mes "Would you like to claim them now?"; mes "Would you like to claim an item now?";
next; next;
menu "No",-,"Yes",L_YES; menu "No",-,"Yes",L_YES;
mes "[Donation Girl]"; mes "[Donation Girl]";
@ -96,37 +98,52 @@ set $@menu$, $@name$[0];
set @menu, (select($@menu$))-1; set @menu, (select($@menu$))-1;
query_sql "SELECT ID FROM `donate_item_db` WHERE name = '"+$@name$[@menu]+"'", @id; query_sql "SELECT ID FROM `donate_item_db` WHERE name = '"+$@name$[@menu]+"'", @id;
query_sql "SELECT amount FROM `donate_item_db` WHERE ID = "+@id+"", @amount; query_sql "SELECT price FROM `donate_item_db` WHERE ID = "+@id+"", @price$;
query_sql "SELECT TRUNCATE("+@value$+" / "+@price$+",0)", @max;
//query_sql "SELECT "+@value$+" div "+@price$+"", @max;
if (checkweight(@id,@amount) == 0) goto L_OVERWEIGHT; mes "[Donation Girl]";
mes "Are you sure you want to claim "+@amount+" "+$@name$[@menu]+"?"; 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; next;
menu "No",L_YES,"Yes",-; menu "No",L_CLAIM,"Yes",-;
getitem @id,@amount; query_sql "UPDATE `donate` SET `claimed` = `claimed` + "+@total$+" WHERE `account_id` = '"+escape_sql(getcharid(3))+"'";
query_sql "UPDATE `donate` SET `claimed` = `claimed` + "+@currency+" WHERE `account_id` = '"+getcharid(3)+"'"; getitem @id,@quantity;
set @amount, 0;
set @claimed, 0;
set @value, 0;
set @items, 0;
mes "[Donation Girl]"; mes "[Donation Girl]";
mes "Thankyou for donating! We hope you enjoy your gift!"; mes "Thankyou for donating! We hope you enjoy your gift!";
close; close;
L_OVERWEIGHT:
set @amount, 0;
set @claimed, 0;
set @value, 0;
set @items, 0;
mes "[Donation Girl]";
mes "I'm sorry, but you cannot carry so many things.";
close;
L_STATS: L_STATS:
mes "[Donation Girl]"; mes "[Donation Girl]";
query_sql "SELECT SUM(amount) FROM `donate`", @total; query_sql "SELECT SUM(amount) FROM `donate`", @total$;
mes "Our fund is at a total of $"+@total+""; mes "Our fund is at a total of $"+@total$+"";
next; next;
set @total, 0;
menu "More info",L_INFO,"Make a claim",L_CHECK,"Statistics",L_STATS; menu "More info",L_INFO,"Make a claim",L_CHECK,"Statistics",L_STATS;
close; close;
@ -151,27 +168,25 @@ L_NEWITEM:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the item name:"; mes "Please enter the item name:";
input @itemname$; input @itemname$;
query_sql "SELECT `id` FROM `item_db` WHERE `name_english` = '"+@itemname$+"'", @iid; query_sql "SELECT `id` FROM `item_db` WHERE `name_english` = '"+escape_sql(@itemname$)+"'", @iid;
query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+@itemname$+"'", @check; query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+escape_sql(@itemname$)+"'", @check;
if(@iid==0) goto L_INONE; if(@iid==0) goto L_INONE;
next;
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the amount claimable of "+@itemname$+" per donation"; mes "Please enter the cost of each "+@itemname$+":";
input @quantity; input @cost$;
if(@quantity==0) goto L_ZERO; 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 "[GM Menu]";
mes "You have specified that donators can claim "+@quantity+" "+@itemname$+"s."; mes "You have specified that donators can claim "+@itemname$+"s for $"+@cost$+" each.";
mes "Would you like to continue?"; mes "Would you like to continue?";
next; next;
menu "No",L_ITEM,"Yes",-; menu "No",L_ITEM,"Yes",-;
if(@check!=0) goto L_REPLACE; if(@check!=0) goto L_REPLACE;
query_sql "INSERT INTO `donate_item_db` VALUES ('"+@iid+"', '"+@itemname$+"', '"+@quantity+"')"; query_sql "INSERT INTO `donate_item_db` VALUES ('"+@iid+"', '"+escape_sql(@itemname$)+"', '"+@cost$+"')";
mes "[GM Menu]"; mes "[GM Menu]";
mes "Item added successfully!"; mes "Item added successfully!";
next; next;
set @itemname$, 0;
set @iid, 0;
set @quantity, 0;
menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS; menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS;
close; close;
@ -181,13 +196,10 @@ mes "Item "+@itemname$+" already exists in the database.";
mes "Would you like to replace it?"; mes "Would you like to replace it?";
next; next;
menu "No",L_ITEM,"Yes",-; menu "No",L_ITEM,"Yes",-;
query_sql "REPLACE INTO `donate_item_db` VALUES ('"+@iid+"', '"+@itemname$+"', '"+@quantity+"')"; query_sql "REPLACE INTO `donate_item_db` VALUES ('"+@iid+"', '"+@itemname$+"', '"+@cost$+"')";
mes "[GM Menu]"; mes "[GM Menu]";
mes "Item replaced successfully!"; mes "Item replaced successfully!";
next; next;
set @itemname$, 0;
set @iid, 0;
set @quantity, 0;
menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS; menu "Add annother item",L_NEWITEM,"Remove an item",L_DELITEM,"View all items",L_ALLITEMS;
close; close;
@ -195,15 +207,13 @@ L_INONE:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Item "+@itemname$+" does not exist."; mes "Item "+@itemname$+" does not exist.";
next; next;
set @itemname$, 0;
set @iid, 0;
goto L_ITEM; goto L_ITEM;
L_DELITEM: L_DELITEM:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the item name:"; mes "Please enter the item name:";
input @itemname$; input @itemname$;
query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+@itemname$+"'", @iid; query_sql "SELECT `id` FROM `donate_item_db` WHERE `name` = '"+escape_sql(@itemname$)+"'", @iid;
if(@iid==0) goto L_INONE; if(@iid==0) goto L_INONE;
next; next;
mes "[GM Menu]"; mes "[GM Menu]";
@ -215,56 +225,61 @@ query_sql "DELETE FROM `donate_item_db` WHERE `id` = '"+@iid+"'";
mes "[GM Menu]"; mes "[GM Menu]";
mes "Item deleted successfully!"; mes "Item deleted successfully!";
next; next;
set @itemname$, 0;
set @iid, 0;
menu "Add an item",L_NEWITEM,"Remove another item",L_DELITEM,"View all items",L_ALLITEMS; menu "Add an item",L_NEWITEM,"Remove another item",L_DELITEM,"View all items",L_ALLITEMS;
close; close;
L_ALLITEMS: L_ALLITEMS:
mes "[GM Menu]"; mes "[GM Menu]";
query_sql "SELECT `name` FROM `donate_item_db` ORDER BY `name` ASC", @items$; query_sql "SELECT `name` FROM `donate_item_db` ORDER BY `name` ASC", @items$;
query_sql "SELECT `amount` FROM `donate_item_db` ORDER BY `name` ASC", @itemamount; query_sql "SELECT `price` FROM `donate_item_db` ORDER BY `name` ASC", @itemamount$;
for(set @i, 0; @i < getarraysize(@items$); set @i, @i + 1){ for(set @i, 0; @i < getarraysize(@items$); set @i, @i + 1){
mes ""+@items$[@i]+" - "+@itemamount[@i]+""; mes ""+@items$[@i]+" - $"+@itemamount$[@i]+"";
} }
next; next;
set @items$, 0;
set @itemamount, 0;
goto L_GM; goto L_GM;
L_DONATE: L_DONATE:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the donator's username:"; mes "Please enter the donator's username:";
input @donator$; input @donator$;
query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+@donator$+"'", @aid; query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+escape_sql(@donator$)+"'", @aid;
query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated;
if(@aid==0) goto L_NONE; if(@aid==0) goto L_NONE;
if(@donated>0) mes ""+@donator$+" has donated $"+@donated+"."; query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated$;
if(@donated==0) mes ""+@donator$+" has not donated before."; 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; next;
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the amount donated by "+@donator$+""; mes "Please enter the amount donated by "+@donator$+"";
input @donating; input @donating$;
if(@donating==0) goto L_ZERO; 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 "[GM Menu]";
mes "You have specified that "+@donator$+" has donated $"+@donating+"."; mes "You have specified that "+@donator$+" has donated $"+@donating$+".";
mes "Would you like to continue?"; mes "Would you like to continue?";
next; next;
menu "No",L_GM,"Yes",-; menu "No",L_GM,"Yes",-;
if(@donated>0) query_sql "UPDATE `donate` SET `amount` = `amount` + "+@donating+" WHERE `account_id` = '"+@aid+"'"; switch(@donated) {
if(@donated==0) query_sql "INSERT INTO `donate` VALUES ('"+@aid+"', '"+@donating+"', '0')"; case 0:
query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @newdonated; 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 "[GM Menu]";
mes "Donation added successfully!"; mes "Donation added successfully!";
mes ""+@donator$+" has donated a total of $"+@newdonated+""; mes ""+@donator$+" has donated a total of $"+@newdonated$+"";
next; next;
set @donator$, 0;
set @aid, 0;
set @donated, 0;
set @donating, 0;
set @newdonated, 0;
goto L_GM; goto L_GM;
close;
L_ZERO: L_ZERO:
mes "[GM Menu]"; mes "[GM Menu]";
@ -276,27 +291,24 @@ L_NONE:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Account name "+@donator$+" does not exist."; mes "Account name "+@donator$+" does not exist.";
next; next;
set @donator$, 0;
set @aid, 0;
set @donated, 0;
set @donating, 0;
set @newdonated, 0;
goto L_GM; goto L_GM;
L_REMOVE: L_REMOVE:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the donator's username:"; mes "Please enter the donator's username:";
input @donator$; input @donator$;
query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+@donator$+"'", @aid; query_sql "SELECT `account_id` FROM `login` WHERE `userid` = '"+escape_sql(@donator$)+"'", @aid;
query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated;
if(@aid==0) goto L_NONE; if(@aid==0) goto L_NONE;
if(@donated>0) mes ""+@donator$+" has donated $"+@donated+"."; query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @donated$;
query_sql "SELECT "+@donated$+" > 0", @donated;
if(@donated==0) { if(@donated==0) {
query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'"; query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'";
mes ""+@donator$+" is not a donator and has been deleted from the donation database."; mes ""+@donator$+" is not a donator and has been deleted from the donation database.";
goto L_GM; goto L_GM;
close;
} }
mes ""+@donator$+" has donated $"+@donated$+".";
next; next;
menu "Deduct an amount from "+@donator$+"",L_MINUS,"Remove "+@donator$+" from the donation database",L_DELETE; menu "Deduct an amount from "+@donator$+"",L_MINUS,"Remove "+@donator$+" from the donation database",L_DELETE;
close; close;
@ -304,23 +316,21 @@ close;
L_MINUS: L_MINUS:
mes "[GM Menu]"; mes "[GM Menu]";
mes "Please enter the amount "+@donator$+" is to be deducted by:"; mes "Please enter the amount "+@donator$+" is to be deducted by:";
input @deduct; 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 "[GM Menu]";
mes "You have specified that "+@donator$+" is to be deducted by $"+@deduct+"."; mes "You have specified that "+@donator$+" is to be deducted by $"+@deduct$+".";
mes "Would you like to continue?"; mes "Would you like to continue?";
next; next;
menu "No",L_GM,"Yes",-; menu "No",L_GM,"Yes",-;
query_sql "UPDATE `donate` SET `amount` = `amount` - "+@deduct+" WHERE `account_id` = '"+@aid+"'"; query_sql "UPDATE `donate` SET `amount` = `amount` - "+@deduct$+" WHERE `account_id` = '"+@aid+"'";
query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @afterdeduct; query_sql "SELECT `amount` FROM `donate` WHERE `account_id` = "+@aid+"", @afterdeduct$;
mes "[GM Menu]"; mes "[GM Menu]";
mes "Donation deducted successfully!"; mes "Donation deducted successfully!";
mes ""+@donator$+" has donated a total of $"+@afterdeduct+""; mes ""+@donator$+" has donated a total of $"+@afterdeduct$+"";
next; next;
set @donator$, 0;
set @aid, 0;
set @donated, 0;
set @deduct, 0;
set @afterdeduct, 0;
goto L_GM; goto L_GM;
L_DELETE: L_DELETE:
@ -333,27 +343,19 @@ query_sql "DELETE FROM `donate` WHERE `account_id` = '"+@aid+"'";
mes "[GM Menu]"; mes "[GM Menu]";
mes "Donator deleted successfully!"; mes "Donator deleted successfully!";
next; next;
set @donator$, 0;
set @aid, 0;
set @donated, 0;
goto L_GM; goto L_GM;
L_VIEWALL: L_VIEWALL:
mes "[GM Menu]"; mes "[GM Menu]";
query_sql "SELECT `account_id` FROM `donate` ORDER BY `amount` DESC", @donatoraid; query_sql "SELECT `account_id` FROM `donate` ORDER BY `amount` DESC", @donatoraid;
query_sql "SELECT `amount` FROM `donate` ORDER BY `amount` DESC", @donatedamount; query_sql "SELECT `amount` FROM `donate` ORDER BY `amount` DESC", @donatedamount$;
for(set @i, 0; @i < getarraysize(@donatoraid); set @i, @i + 1){ for(set @i, 0; @i < getarraysize(@donatoraid); set @i, @i + 1){
query_sql "SELECT `userid` FROM `login` WHERE `account_id` = '"+@donatoraid[@i]+"'", @donateruserid$; query_sql "SELECT `userid` FROM `login` WHERE `account_id` = '"+@donatoraid[@i]+"'", @donateruserid$;
for(set @j, 0; @j < getarraysize(@donateruserid$); set @j, @j + 1){ for(set @j, 0; @j < getarraysize(@donateruserid$); set @j, @j + 1){
mes ""+@donateruserid$[@j]+" - "+@donatedamount[@i]+""; mes ""+@donateruserid$[@j]+" - "+@donatedamount$[@i]+"";
} }
} }
next; next;
set @donatoraid, 0;
set @donatedamount, 0;
set @donateruserid$, 0;
goto L_GM; goto L_GM;
L_CLOSE:
close;
} }

View File

@ -378,10 +378,10 @@ L_Payoff:
next; next;
if (@zenyamount > Zeny) goto L_Overzeny; if (@zenyamount > Zeny) goto L_Overzeny;
set Zeny,Zeny-@totalzeny; set Zeny,Zeny-@totalzeny;
getitem 673,@bronzecoins; getitem @bronzecoinid,@bronzecoins;
getitem 677,@silvercoins; getitem @silvercoinid,@silvercoins;
getitem 671,@goldcoins; getitem @goldcoinid,@goldcoins;
getitem 674,@mithrilcoins; getitem @mithrilcoinid,@mithrilcoins;
mes @npcname$; mes @npcname$;
mes "There you go, here's your coins"; mes "There you go, here's your coins";
next; next;

View File

@ -1,62 +1,62 @@
===== eAthena Script ======================================= //===== eAthena Script =======================================
= Disguiser Quesr //= Disguiser Quesr
===== By ================================================== //===== By: ==================================================
= PalasX (httpcashaan.dontexist.org) //= PalasX (http://cashaan.dontexist.org)
===== Current Version ===================================== //===== Current Version: =====================================
= v1.20 Unified //= v1.20 Unified
===== Compatible With ===================================== //===== Compatible With: =====================================
= SVN 5690+ (getmonsterinfo) //= SVN 5690+ (getmonsterinfo)
===== Description ========================================= //===== Description: =========================================
= Baphomet disguises you if you find all his brothers. //= Baphomet disguises you if you find all his brothers.
===== Additional Comments ================================= //===== Additional Comments: =================================
= Gotta find them all in order //= Gotta find them all in order
= Dynamically edits item 2614(eye of dullahan) with //= Dynamically edits item 2614(eye of dullahan) with
= setitemscript 2614,{bonus bdisguise,var_disguise;}; //= setitemscript 2614,"{bonus bdisguise,var_disguise;}";
= so your SVN better support it //= so your SVN better support it
= Uses GetMonsterInfo to pull monster names from server, but //= Uses GetMonsterInfo to pull monster names from server, but
= without sql_query, the mob IDs are set statically //= without sql_query, the mob IDs are set statically
= Went crazy with the functions, the script is TINY now ) //= Went crazy with the functions, the script is TINY now :)
============================================================ //============================================================
Places all of our NPCs
//////////////////////////
//Places all of our NPCs//
//////////////////////////
prt_fild05.gat,277,226,5 script Dullahan Master 736,{ prt_fild05.gat,277,226,5 script Dullahan Master 736,{
callfunc PXC_Disguiser,0,quest_disguise; callfunc "PXC_Disguiser",0,quest_disguise;
Close; Close;
} }
moc_fild10.gat,34,283,4 script Dullahan Master 736,{ moc_fild10.gat,34,283,4 script Dullahan Master 736,{
callfunc PXC_Disguiser,1,quest_disguise; callfunc "PXC_Disguiser",1,quest_disguise;
close; close;
} }
gef_fild00.gat,97,123,4 script Dullahan Master 736,{ gef_fild00.gat,97,123,4 script Dullahan Master 736,{
callfunc PXC_Disguiser,2,quest_disguise; callfunc "PXC_Disguiser",2,quest_disguise;
close; close;
} }
pay_fild01.gat,369,305,4 script Dullahan Master 736,{ pay_fild01.gat,369,305,4 script Dullahan Master 736,{
callfunc PXC_Disguiser,3,quest_disguise; callfunc "PXC_Disguiser",3,quest_disguise;
close; close;
} }
pay_fild03.gat,313,40,4 script Dullahan Master 736,{ pay_fild03.gat,313,40,4 script Dullahan Master 736,{
callfunc PXC_Disguiser,4,quest_disguise; callfunc "PXC_Disguiser",4,quest_disguise;
close; close;
} }
prt_fild08.gat,362,185,4 script Dullahan Master 736,{ prt_fild08.gat,362,185,4 script Dullahan Master 736,{
callfunc PXC_Disguiser,5,quest_disguise; callfunc "PXC_Disguiser",5,quest_disguise;
close; close;
//////////////////////////
edits the item used // edits the item used ///
//////////////////////////
OnInit OnInit:
EDIT EYE OF DULLAHAN //EDIT EYE OF DULLAHAN
setitemscript 2614,{ bonus bdisguise,var_disguise; }; setitemscript 2614,"{ bonus bdisguise,var_disguise; }";
end; end;
} }
@ -64,113 +64,113 @@ OnInit
//////////////////////////
Function. Takes // Function. Takes:
INTEGER, the order number that the bapho should be visited // INTEGER, the order number that the bapho should be visited
VARIABLE, the quest progression variable quest_disguise. may be changed if conflicts occur // VARIABLE, the quest progression variable quest_disguise. may be changed if conflicts occur
//
Puts // 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. // 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). // 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 { function script PXC_Disguiser {
setarray $@PXC_Next$[0],Culvert,Morocc,Geffen,Payon,Alberta,Izlude; setarray $@PXC_Next$[0],"Culvert","Morocc","Geffen","Payon","Alberta","Izlude";
if(var_disguise 1) goto Complete; if(var_disguise > 1) goto Complete;
if(getarg(0) == 5 && getarg(1) == 5) goto Last; if(getarg(0) == 5 && getarg(1) == 5) goto Last;
if(getarg(0) == getarg(1)) goto Quest; if(getarg(0) == getarg(1)) goto Quest;
NotMe NotMe:
mes [Baphomet]; 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!; 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; next;
if(countitem(2614) 1) goto NeedRing; if(countitem(2614) < 1) goto NeedRing;
close; close;
Cancel Cancel:
mes [Baphomet]; mes "[Baphomet]";
mes Later.; mes "Later.";
close; close;
Quest Quest:
set quest_disguise,getarg(1)+1; set quest_disguise,getarg(1)+1;
mes [Baphomet]; 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!; 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; next;
if(countitem(2614) 1) goto NeedRing; if(countitem(2614) < 1) goto NeedRing;
close; close;
NeedRing NeedRing:
mes [Baphomet]; 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!; 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; next;
menu Buy Ring,-,Forget it!,Cancel; menu "Buy Ring",-,"Forget it!",Cancel;
if(Zeny 500000) goto Cancel; if(Zeny < 500000) goto Cancel;
set Zeny,Zeny-500000; set Zeny,Zeny-500000;
getitem 2614,1; getitem 2614,1;
mes [Baphomet]; mes "[Baphomet]";
mes Here is your ring.; mes "Here is your ring.";
next; next;
goto Cancel; goto Cancel;
close; close;
Last Last:
set quest_disguise,0; set quest_disguise,0;
set var_disguise,1002; set var_disguise,1002;
mes [Baphomet]; 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.; 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; next;
goto Complete; goto Complete;
Complete Complete:
if(countitem(2614) 1) goto NeedRing; if(countitem(2614) < 1) goto NeedRing;
mes [Baphomet]; 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.; 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; next;
mes [Baphomet]; mes "[Baphomet]";
mes I can change your ring's mystical properties. Which monster spirit shall I weave into your ring; mes "I can change your ring's mystical properties. Which monster spirit shall I weave into your ring?";
next; next;
if(getarg(0)==0) callfunc PXC_DoMenu,1001,1125; if(getarg(0)==0) callfunc "PXC_DoMenu",1001,1125;
if(getarg(0)==1) callfunc PXC_DoMenu,1126,1250; if(getarg(0)==1) callfunc "PXC_DoMenu",1126,1250;
if(getarg(0)==2) callfunc PXC_DoMenu,1251,1375; if(getarg(0)==2) callfunc "PXC_DoMenu",1251,1375;
if(getarg(0)==3) callfunc PXC_DoMenu,1376,1500; if(getarg(0)==3) callfunc "PXC_DoMenu",1376,1500;
if(getarg(0)==4) callfunc PXC_DoMenu,1503,1625; if(getarg(0)==4) callfunc "PXC_DoMenu",1503,1625;
if(getarg(0)==5) callfunc PXC_DoMenu,1626,1721; if(getarg(0)==5) callfunc "PXC_DoMenu",1626,1721;
close; close;
end; end;
} }
//////////////////////////
FUNCTION. // FUNCTION.
Takes // Takes:
integer, first monster ID to show // integer, first monster ID to show
integer, last monster ID to show // integer, last monster ID to show
//////////////////////////
function script PXC_DoMenu { function script PXC_DoMenu {
set menu options to mob names, doing the first one manualy so we dont have an empty //set menu options to mob names, doing the first one manualy so we dont have an empty :
set $@menu$, getmonsterinfo(getarg(0),MOB_NAME); set $@menu$, getmonsterinfo(getarg(0),MOB_NAME);
for(set $@i, getarg(0)+1; $@i = getarg(1); set $@i, $@i + 1){ for(set $@i, getarg(0)+1; $@i <= getarg(1); set $@i, $@i + 1){
set $@menu$, $@menu$ + + getmonsterinfo($@i,MOB_NAME); set $@menu$, $@menu$ + ":" + getmonsterinfo($@i,MOB_NAME);
} }
Fire our menu //Fire our menu
set @menu, select($@menu$); set @menu, select($@menu$);
Zero deliminated (off-by-one errors sux0r!!!) //Zero deliminated (off-by-one errors sux0r!!!)
set @menu, @menu-1; set @menu, @menu-1;
congratulate our user //congratulate our user
mes Behold, whilst you wear this ring, your form shall become that of a +getmonsterinfo(@menu + getarg(0),MOB_NAME); 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) //update our variable, with @menu offset addded to the base getarg(0)
set var_disguise, @menu + getarg(0); set var_disguise, @menu + getarg(0);
close; close;

File diff suppressed because it is too large Load Diff