diff options
author | sevenzz23 <sevenzz23@yahoo.com> | 2013-11-01 02:22:55 +0700 |
---|---|---|
committer | sevenzz23 <sevenzz23@yahoo.com> | 2013-11-01 02:22:55 +0700 |
commit | c5795013b52c95847491e13a5549381016629640 (patch) | |
tree | e28ccdebc2a1d308acf6f1117c2253ae61fb4f5c | |
parent | c47d8e4b8f9d63ab6b4e7e286e91cd50a5bdd151 (diff) | |
download | hercules-c5795013b52c95847491e13a5549381016629640.tar.gz hercules-c5795013b52c95847491e13a5549381016629640.tar.bz2 hercules-c5795013b52c95847491e13a5549381016629640.tar.xz hercules-c5795013b52c95847491e13a5549381016629640.zip |
Item Binding System Final.
Fixed, some issue thanks to Master Ind ;)
Signed-off-by: sevenzz23 <sevenzz23@yahoo.com>
-rw-r--r-- | conf/groups.conf | 1 | ||||
-rw-r--r-- | conf/messages.conf | 4 | ||||
-rw-r--r-- | npc/custom/itembind.txt | 132 | ||||
-rw-r--r-- | npc/scripts_custom.conf | 1 | ||||
-rw-r--r-- | src/map/pc.c | 1 |
5 files changed, 137 insertions, 2 deletions
diff --git a/conf/groups.conf b/conf/groups.conf index 7c97352dc..9a4c57126 100644 --- a/conf/groups.conf +++ b/conf/groups.conf @@ -260,6 +260,7 @@ groups: ( log_commands: true permissions: { can_trade: true + can_trade_bounded: false can_party: true all_skill: false all_equipment: false diff --git a/conf/messages.conf b/conf/messages.conf index d2e57bb0e..a20b1353b 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -319,8 +319,8 @@ //Item Bound System 293: This bounded item cannot be traded to that character. 294: This bounded item cannot be stored there. -295: Please enter an item name or ID (usage: @item <item name/ID> <quantity> <bound_type>). -296: Please enter all parameters (usage: @item2 <item name/ID> <quantity> +295: Please enter an item name or ID (usage: @itembound <item name/ID> <quantity> <bound_type>). +296: Please enter all parameters (usage: @itembound2 <item name/ID> <quantity> 297: <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4> <bound_type>). 298: Invalid bound type. Valid types are - 1:Account 2:Guild 3:Party 4:Character // Guild Castles Number diff --git a/npc/custom/itembind.txt b/npc/custom/itembind.txt new file mode 100644 index 000000000..f290c48ef --- /dev/null +++ b/npc/custom/itembind.txt @@ -0,0 +1,132 @@ +//===== rAthena Script ======================================= +//= Item Bound Script +//===== By: ================================================== +//= Akinari +//===== Compatible With: ===================================== +//= Revision 17351+ (rAthena Only) +//===== Description: ========================================= +//= Item Bound Script +//= Allows users to pay a price to make an item bound to +//= Account, Character, or Guild +//============================================================ + +prontera,144,174,4 script Bound Items 429,{ + + mes "I can bind your items to your account, guild, or character"+((.bindprice)?" for a ^0000FF"+.bindprice+"^000000 zeny fee":"")+"."; + next; + mes "With this, you can rest assured your items are safe."; + next; + mes "What would you like to do?"; + if(select("Bind:Unbind") == 1) { + if(zeny < .bindprice) { + mes "You don't have enough zeny to bind an item."; + close; + } + mes "What kind of bind?"; + .@boundtype = 1 << (select("Account:Guild:Character")-1); + if(.@boundtype == 2 && (!getcharid(2) || getguildmaster(getcharid(2)) != strcharinfo(0))) { + mes "In order for me to bind an item to a guild you must be the master of one."; + close; + } + getinventorylist(); + for(.@i = 0; .@i < @inventorylist_count; .@i++) { + //We only show the items that you allow to be bound + //Allows equipment (default) + if(@inventorylist_bound[.@i]) + continue; + if(((.allowbind & 1) && (getiteminfo(@inventorylist_id[.@i],2) == (4|5))) || + ((.allowbind & 2) && (getiteminfo(@inventorylist_id[.@i],2) == (0|2|11|18))) || + ((.allowbind & 4) && (getiteminfo(@inventorylist_id[.@i],2) == (3|6|7|8|10))) + ) { + set .@bindlist$, .@bindlist$ + ":" + getitemname(@inventorylist_id[.@i]) + " - " + @inventorylist_id[.@i]; + set .@bindlist[.@j],.@i; + .@j++; + } + } + .@item = .@bindlist[select(.@bindlist$)-2]; + next; + mes "Before I continue, I want you to know I can't tell the difference between multiple items. If you have a specific item you want bounded, please remove any duplicates from inventory."; + if(select("I understand, continue:Wait a minute") == 2) { + next; + mes "I'll be here when you're ready."; + close; + } + next; + mes "Are you sure you'd like to bind your "+ getitemname(@inventorylist_id[.@item]) +" to your "+.boundtypes$[.@boundtype]+"?"; + if(select("Yes:No") == 1) { + zeny -= .bindprice; + delitem2 @inventorylist_id[.@item],@inventorylist_amount[.@item],@inventorylist_identify[.@item],@inventorylist_refine[.@item],@inventorylist_attribute[.@item],@inventorylist_card1[.@item],@inventorylist_card2[.@item],@inventorylist_card3[.@item],@inventorylist_card4[.@item]; + getitembound2 @inventorylist_id[.@item],@inventorylist_amount[.@item],@inventorylist_identify[.@item],@inventorylist_refine[.@item],@inventorylist_attribute[.@item],@inventorylist_card1[.@item],@inventorylist_card2[.@item],@inventorylist_card3[.@item],@inventorylist_card4[.@item],.@boundtype; + mes "All done!"; + if(.logbinds) + logmes "Bound "+ @inventorylist_amount[.@item]+" "+@inventorylist_id[.@item]+" as "+.boundtypes$[.@boundtype]+" type."; + } + } else { + /*if(!countbound()) { + mes "You don't have any bound items in your inventory. Not much I can do here."; + close; + } + countbound(2); + if(.unbindprice) { + mes "Unbinding an item has a fee of ^0000FF"+.unbindprice+"^000000 zeny."; + if(zeny < .unbindprice) { + mes "You don't have enough to unbind an item."; + close; + } + }*/ + getinventorylist(); + for(.@i = 0; .@i < @inventorylist_count; .@i++) { + if(@inventorylist_bound[.@i]) { + set .@bindlist$, .@bindlist$ + ":" + getitemname(@inventorylist_id[.@i]) + " - " + @inventorylist_id[.@i]; + set .@bindlist[.@j],.@i; + .@j++; + } + } + .@item = .@bindlist[select(.@bindlist$)-2]; + next; + for(.@i = 0; .@i < getarraysize(@bound_items); .@i++) { + if(@inventorylist_id[.@item] == @bound_items[.@i] && + (!getcharid(2) || getguildmaster(getcharid(2)) != strcharinfo(0)) + ) { + mes "I will only unbind guild bound items that the guild master requests."; + close; + } + } + mes "Before I continue, I want you to know I can't tell the difference between multiple items. If you have a specific item you want unbounded, please remove any duplicates from inventory."; + if(select("I understand, continue:Wait a minute") == 2) { + next; + mes "I'll be here when you're ready."; + close; + } + next; + mes "Are you sure you'd like to unbind your "+ getitemname(@inventorylist_id[.@item]) +"?"; + if(select("Yes:No") == 1) { + zeny -= .unbindprice; + delitem2 @inventorylist_id[.@item],@inventorylist_amount[.@item],@inventorylist_identify[.@item],@inventorylist_refine[.@item],@inventorylist_attribute[.@item],@inventorylist_card1[.@item],@inventorylist_card2[.@item],@inventorylist_card3[.@item],@inventorylist_card4[.@item]; + getitem2 @inventorylist_id[.@item],@inventorylist_amount[.@item],@inventorylist_identify[.@item],@inventorylist_refine[.@item],@inventorylist_attribute[.@item],@inventorylist_card1[.@item],@inventorylist_card2[.@item],@inventorylist_card3[.@item],@inventorylist_card4[.@item]; + mes "All done!"; + if(.logbinds) + logmes "Unbound "+ @inventorylist_amount[.@item]+" "+@inventorylist_id[.@item]+"."; + } + } + close; + +OnInit: + //* Configuration *\\ + //Price + .bindprice = 0; + .unbindprice = 100000; + + //What to allow to be bound - Add as necessary + //1 = Equipment - 2 = Consumables - 4 = Etc + .allowbind = 1; + + //Log binds via NPC? + .logbinds = 1; + + //Other stuff + .boundtypes$[1] = "account"; + .boundtypes$[2] = "guild"; + .boundtypes$[4] = "character"; + end; +}
\ No newline at end of file diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index c6e550864..aeae9e22f 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -7,6 +7,7 @@ //npc: npc/location/to/script.txt // ----------------------- Basic Scripts ----------------------- +//npc: npc/custom/itembind.txt //npc: npc/custom/warper.txt //npc: npc/custom/jobmaster.txt //npc: npc/custom/platinum_skills.txt diff --git a/src/map/pc.c b/src/map/pc.c index ba445b4f4..6c4ebe149 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -10331,6 +10331,7 @@ void pc_defaults(void) { pc->class2idx = pc_class2idx; pc->get_group_level = pc_get_group_level; pc->can_give_items = pc_can_give_items; + pc->bound_chk = pc_bound_chk; pc->can_give_bounded_items = pc_can_give_bounded_items; pc->can_use_command = pc_can_use_command; |