|
@@ -23698,6 +23698,36 @@ BUILDIN_FUNC(round) {
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+BUILDIN_FUNC(getequiptradability) {
|
|
|
|
+ int i, num;
|
|
|
|
+ TBL_PC *sd;
|
|
|
|
+
|
|
|
|
+ num = script_getnum(st, 2);
|
|
|
|
+
|
|
|
|
+ if (!script_charid2sd(3, sd)) {
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (equip_index_check(num))
|
|
|
|
+ i = pc_checkequip(sd, equip_bitmask[num]);
|
|
|
|
+ else{
|
|
|
|
+ ShowError("buildin_getequiptradability: Unknown equip index '%d'\n",num);
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (i >= 0) {
|
|
|
|
+ bool tradable = (sd->inventory.u.items_inventory[i].expire_time == 0 &&
|
|
|
|
+ (!sd->inventory.u.items_inventory[i].bound || pc_can_give_bounded_items(sd)) &&
|
|
|
|
+ itemdb_cantrade(&sd->inventory.u.items_inventory[i], pc_get_group_level(sd), pc_get_group_level(sd))
|
|
|
|
+ );
|
|
|
|
+ script_pushint(st, tradable);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ script_pushint(st, false);
|
|
|
|
+
|
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
#include "../custom/script.inc"
|
|
#include "../custom/script.inc"
|
|
|
|
|
|
// declarations that were supposed to be exported from npc_chat.c
|
|
// declarations that were supposed to be exported from npc_chat.c
|
|
@@ -24345,6 +24375,7 @@ struct script_function buildin_func[] = {
|
|
BUILDIN_DEF2(round, "round", "i"),
|
|
BUILDIN_DEF2(round, "round", "i"),
|
|
BUILDIN_DEF2(round, "ceil", "i"),
|
|
BUILDIN_DEF2(round, "ceil", "i"),
|
|
BUILDIN_DEF2(round, "floor", "i"),
|
|
BUILDIN_DEF2(round, "floor", "i"),
|
|
|
|
+ BUILDIN_DEF(getequiptradability, "i?"),
|
|
#include "../custom/script_def.inc"
|
|
#include "../custom/script_def.inc"
|
|
|
|
|
|
{NULL,NULL,NULL},
|
|
{NULL,NULL,NULL},
|