summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/script_commands.txt30
-rw-r--r--npc/custom/itembind.txt10
-rw-r--r--src/map/script.c7
3 files changed, 27 insertions, 20 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 8308f4771..d9efa299f 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -5273,11 +5273,11 @@ bound to the target character as specified by the bound type. All items created
in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
some cases cannot be traded or stored.
-Valid bound types are:
- 1 - Account Bound
- 2 - Guild Bound
- 3 - Party Bound
- 4 - Character Bound
+Valid item bound types are:
+ 1 - IBT_ACCOUNT - Account Bound
+ 2 - IBT_GUILD - Guild Bound
+ 3 - IBT_PARTY - Party Bound
+ 4 - IBT_CHARACTER - Character Bound
---------------------------------------
@@ -5318,12 +5318,12 @@ If a bound type is not specified or a bound type of 0 is used, it will search th
of any type, so long as the other parameters match. In all cases, this command will return the bound type of the
item found, or 0 if the specified item was not found.
-Valid bound types are:
- 0 - All Bound types.
- 1 - Account Bound
- 2 - Guild Bound
- 3 - Party Bound
- 4 - Character Bound
+Valid item bound types are:
+ 0 - IBT_ANY - Any Bound
+ 1 - IBT_ACCOUNT - Account Bound
+ 2 - IBT_GUILD - Guild Bound
+ 3 - IBT_PARTY - Party Bound
+ 4 - IBT_CHARACTER - Character Bound
Optional Parameters:
bound_type - checks to see if the item has the specified bound type.
@@ -5341,7 +5341,7 @@ Example:
close();
// This will also check if you have a bound (any type) 1205 (Cutter).
- if (checkbound(Cutter, 0)) {
+ if (checkbound(Cutter, IBT_ANY)) {
mes("You have a bound Cutter");
} else {
mes("You do not have a bound Cutter");
@@ -5356,8 +5356,8 @@ Example:
}
close();
- // This will check if the item found, has a bound type of 2 (guild_bound)
- if (checkbound(Cutter) == 2) {
+ // This will check if the item found, has a bound type of IBT_GUILD
+ if (checkbound(Cutter) == IBT_GUILD) {
mes("You have a guild_bound Cutter");
} else {
mes("You do not have a guild_bound Cutter.");
@@ -5365,7 +5365,7 @@ Example:
close();
// This will check if you have a 'guild_bound' +7 1205 (Cutter).
- if (checkbound(Cutter, 2, 7)) {
+ if (checkbound(Cutter, IBT_GUILD, 7)) {
mes("You have a +7 guild_bound Cutter.");
} else {
mes("You don't have the required item.");
diff --git a/npc/custom/itembind.txt b/npc/custom/itembind.txt
index e104d89b1..f0e128453 100644
--- a/npc/custom/itembind.txt
+++ b/npc/custom/itembind.txt
@@ -25,7 +25,7 @@ prontera,144,174,4 script Bound Items 4_M_JP_MID,{
}
mes "What kind of bind?";
.@boundtype = 1 << (select("Account", "Guild", "Character")-1);
- if(.@boundtype == 2 && (!getcharid(CHAR_ID_GUILD) || getguildinfo(GUILDINFO_MASTER_NAME, getcharid(CHAR_ID_GUILD)) != strcharinfo(PC_NAME))) {
+ if(.@boundtype == IBT_GUILD && (!getcharid(CHAR_ID_GUILD) || getguildinfo(GUILDINFO_MASTER_NAME, getcharid(CHAR_ID_GUILD)) != strcharinfo(PC_NAME))) {
mes "In order for me to bind an item to a guild you must be the master of one.";
close;
}
@@ -68,7 +68,7 @@ prontera,144,174,4 script Bound Items 4_M_JP_MID,{
mes "You don't have any bound items in your inventory. Not much I can do here.";
close;
}
- countbound(2);
+ countbound(IBT_GUILD);
if(.unbindprice) {
mes "Unbinding an item has a fee of ^0000FF"+.unbindprice+"^000000 zeny.";
if(Zeny < .unbindprice) {
@@ -127,8 +127,8 @@ OnInit:
.logbinds = 1;
//Other stuff
- .boundtypes$[1] = "account";
- .boundtypes$[2] = "guild";
- .boundtypes$[4] = "character";
+ .boundtypes$[IBT_ACCOUNT] = "account";
+ .boundtypes$[IBT_GUILD] = "guild";
+ .boundtypes$[IBT_CHARACTER] = "character";
end;
}
diff --git a/src/map/script.c b/src/map/script.c
index c1eb2e8b7..0e30708d9 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -27862,6 +27862,13 @@ static void script_hardcoded_constants(void)
script->set_constant("ISF_INSTANTCAST", ISF_INSTANTCAST, false, false);
script->set_constant("ISF_CASTONSELF", ISF_CASTONSELF, false, false);
+ script->constdb_comment("Item Bound Types");
+ script->set_constant("IBT_ANY", IBT_NONE, false, false); // for *checkbound()
+ script->set_constant("IBT_ACCOUNT", IBT_ACCOUNT, false, false);
+ script->set_constant("IBT_GUILD", IBT_GUILD, false, false);
+ script->set_constant("IBT_PARTY", IBT_PARTY, false, false);
+ script->set_constant("IBT_CHARACTER", IBT_CHARACTER, false, false);
+
script->constdb_comment("Renewal");
#ifdef RENEWAL
script->set_constant("RENEWAL", 1, false, false);