From 9b878ee44765010758c7c6da630431d9aaef71dc Mon Sep 17 00:00:00 2001 From: Dastgir Date: Wed, 8 Aug 2018 15:34:57 +0530 Subject: Updated getiteminfo and setiteminfo. Added ITR_TRADE (Trade restriction) for both script commands --- npc/other/Global_Functions.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'npc') 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|"; + } +} -- cgit v1.2.3-60-g2f50