summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-10-21 23:51:35 +0200
committerGitHub <noreply@github.com>2018-10-21 23:51:35 +0200
commiteb71c78f0872567a33196b72420d3d081651a23f (patch)
treec14b23ec6f2532487ceacb275a71f086def15ef6 /npc
parentb196e2b794bb96c1584c885f50e63326678ae89e (diff)
parent9b878ee44765010758c7c6da630431d9aaef71dc (diff)
downloadhercules-eb71c78f0872567a33196b72420d3d081651a23f.tar.gz
hercules-eb71c78f0872567a33196b72420d3d081651a23f.tar.bz2
hercules-eb71c78f0872567a33196b72420d3d081651a23f.tar.xz
hercules-eb71c78f0872567a33196b72420d3d081651a23f.zip
Merge pull request #2172 from dastgirp/enhance/getiteminfo
Updated getiteminfo and setiteminfo.
Diffstat (limited to 'npc')
-rw-r--r--npc/other/Global_Functions.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index 9882e9d71..904ed7165 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -438,3 +438,40 @@ function script F_ShuffleNumbers {
function script F_MesColor {
return sprintf("^%06X", min(getarg(0), 0xFFFFFF));
}
+
+//== Function F_GetTradeRestriction ========================
+// Function to get item trade restriction
+// Examples:
+// mes "Red Potion Restriction: "+ callfunc("F_GetTradeRestriction", Red_Potion);
+function script F_GetTradeRestriction {
+ .@trade = getiteminfo(getarg(0), ITEMINFO_TRADE);
+
+ if (.@trade == 0) {
+ return "None";
+ }
+ .@trade$ = "";
+ if (.@trade & ITR_NODROP) {
+ .@trade$ += "NoDrop|";
+ }
+ if (.@trade & ITR_NOTRADE) {
+ .@trade$ += "NoTrade|";
+ }
+ if (.@trade & ITR_PARTNEROVERRIDE) {
+ .@trade$ += "PartnerOverride|";
+ }
+ if (.@trade & ITR_NOSELLTONPC) {
+ .@trade$ += "NoSellToNpc|";
+ }
+ if (.@trade & ITR_NOSTORAGE) {
+ .@trade$ += "NoStorage|";
+ }
+ if (.@trade & ITR_NOGSTORAGE) {
+ .@trade$ += "NoGuildStorage|";
+ }
+ if (.@trade & ITR_NOMAIL) {
+ .@trade$ += "NoMail|";
+ }
+ if (.@trade & ITR_NOAUCTION) {
+ .@trade$ += "NoAuction|";
+ }
+}