diff options
Diffstat (limited to 'npc/other')
-rw-r--r-- | npc/other/CashShop_Functions.txt | 27 | ||||
-rw-r--r-- | npc/other/Global_Functions.txt | 37 | ||||
-rw-r--r-- | npc/other/inventory_expansion.txt | 63 | ||||
-rw-r--r-- | npc/other/poring_war.txt | 4 |
4 files changed, 129 insertions, 2 deletions
diff --git a/npc/other/CashShop_Functions.txt b/npc/other/CashShop_Functions.txt index 92fe841e1..5b957f9f2 100644 --- a/npc/other/CashShop_Functions.txt +++ b/npc/other/CashShop_Functions.txt @@ -310,3 +310,30 @@ function script F_Snowball { } end; } + +// Status reduction potion +//============================================================ +// - Permanently reduces base stat <type> by <val>. +// - Returns status points equals to points needed to raise +// that stat to original value. +// - Doesn't work if base status <type> would become lower than 1 after reduction. +// * callfunc("F_CashReduceStat", <type>{, <val>, <itemid>}); +function script F_CashReduceStat { + .@type = getarg(0); + .@amount = getarg(1, -1); + .@itemid = getarg(2, 0); + + if ((readparam(.@type) + .@amount) < 1) return; + + if (.@itemid) { + if (countitem(.@itemid)) + delitem .@itemid, 1; + else + return; + } + + StatusPoint += needed_status_point(.@type, .@amount); + statusup2 .@type, .@amount; + + return; +}
\ No newline at end of file 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|"; + } +} diff --git a/npc/other/inventory_expansion.txt b/npc/other/inventory_expansion.txt new file mode 100644 index 000000000..db18e09e1 --- /dev/null +++ b/npc/other/inventory_expansion.txt @@ -0,0 +1,63 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2018 Hercules Dev Team +//= Copyright (C) 4144 +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Inventory expansion +//========================================================================= + +- script inventory_expansion FAKE_NPC,{ + end; + +OnInvExpandRequest: + if (countitem(Inventory_Extension_Coupon) < 1) { + expandInventoryAck(EXPAND_INV_MISSING_ITEM); + end; + } + if (getInventorySize() + INVENTORY_INCREASE_STEP > MAX_INVENTORY) { + expandInventoryAck(EXPAND_INV_MAX_SIZE); + end; + } + expandInventoryAck(EXPAND_INV_ASK_CONFIRMATION, Inventory_Extension_Coupon); + end; + +OnInvExpandConfirmed: + if (countitem(Inventory_Extension_Coupon) < 1) { + expandInventoryResult(EXPAND_INV_RESULT_MISSING_ITEM); + end; + } + if (getInventorySize() + INVENTORY_INCREASE_STEP > MAX_INVENTORY) { + expandInventoryResult(EXPAND_INV_RESULT_MAX_SIZE); + end; + } + delitem(Inventory_Extension_Coupon, 1); + if (expandInventory(INVENTORY_INCREASE_STEP) == true) { + expandInventoryResult(EXPAND_INV_RESULT_SUCCESS); + } + end; + +OnInvExpandRejected: + end; +} diff --git a/npc/other/poring_war.txt b/npc/other/poring_war.txt index d89bb3fed..326c601be 100644 --- a/npc/other/poring_war.txt +++ b/npc/other/poring_war.txt @@ -1052,7 +1052,7 @@ OnInit: OnEnable: enablenpc "#wop_warp_a"; - specialeffect(EF_MAPPILLAR2, AREA, getnpcid(0, "#wop_warp_a")); + specialeffect(EF_MAPPILLAR2, AREA, getnpcid("#wop_warp_a")); end; OnDisable: @@ -1074,7 +1074,7 @@ OnInit: OnEnable: enablenpc "#wop_warp_d"; - specialeffect(EF_MAPPILLAR2, AREA, getnpcid(0, "#wop_warp_d")); + specialeffect(EF_MAPPILLAR2, AREA, getnpcid("#wop_warp_d")); end; OnDisable: |