diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-12-05 22:54:35 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-12-05 22:54:35 -0300 |
commit | 95e947eb25c8274060c04bb2d585714ce93bba4a (patch) | |
tree | 95831f0e471e93aa6fe3a90bb75fc74b1a1810da /npc | |
parent | 39c68b2d7115684a179b5511753b56836197185f (diff) | |
download | serverdata-95e947eb25c8274060c04bb2d585714ce93bba4a.tar.gz serverdata-95e947eb25c8274060c04bb2d585714ce93bba4a.tar.bz2 serverdata-95e947eb25c8274060c04bb2d585714ce93bba4a.tar.xz serverdata-95e947eb25c8274060c04bb2d585714ce93bba4a.zip |
Set up Gak's Halloween Revival Shop, taking advantage of the new system.
Note: Price must be tweaked.
Diffstat (limited to 'npc')
-rw-r--r-- | npc/080-1/final.txt | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/npc/080-1/final.txt b/npc/080-1/final.txt index c389aa99..6351aae0 100644 --- a/npc/080-1/final.txt +++ b/npc/080-1/final.txt @@ -15,17 +15,68 @@ OnInit: } 080-1,97,41,0 script Gak#X21 NPC183,{ + openshop; + closedialog; end; OnInit: .distance=4; + setarray .prizes, BlinkingEvil, BlinkingEvilRed, BlinkingEvilBlue, + BlinkingEvilPink, BlinkingEvilYellow, GuyFawkesMask, + OperaMask, JesterMask, GoblinMask, WitchHat; + setarray .prices, 15000, 15000, 15000, + 15000, 15000, 2500, + 9000, 7000, 2500, 4500; + tradertype(NST_CUSTOM); + freeloop(true); + for (.@i = 0; .@i < getarraysize(.prizes); .@i++) { + sellitem(.prizes[.@i], .prices[.@i]); + } + freeloop(false); end; + +OnCountFunds: + setcurrency(countitem(AquaTicket)); + end; + +/* @price is total cost. @points is if we accept two items as currency. */ +OnPayFunds: + //dispbottom "Hi: price="+@price+" and points="+@points; + if( countitem(AquaTicket) < @price ) + end; + /* Verify if you're not purchasing a dupe */ + /* This requires servercode@712c09c2c6d848243c3426aeb3dbdf730c1e0b08 to work */ + for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) { + if (debug || $@XMAS21_OVERRIDE) + debugmes("%dx %s", @bought_quantity[.@i], getitemname(@bought_nameid[.@i])); + + .@arr = array_find(.prizes, @bought_nameid[.@i]); + if (.@arr < 0) { dispbottom "REPORT ME: Array Error (Gak)"; end;} + .@bit = (2 ** .@arr); + + if (#X21PRIZES_GAK & .@bit) { + dispbottom l("You already purchased a(n) %s during the event.", getitemlink(@bought_nameid[.@i])); + dispbottom l("Therefore, the operation was cancelled."); + end; + } + } + delitem AquaTicket, @price; + /* Record the items on the bitmask (far more important) */ + /* This requires servercode@712c09c2c6d848243c3426aeb3dbdf730c1e0b08 to work */ + for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) { + .@arr = array_find(.prizes, @bought_nameid[.@i]); + if (.@arr < 0) { dispbottom "REPORT ME: Fatal Array Error (Gak)"; end;} + .@bit = (2 ** .@arr); + #X21PRIZES_GAK = #X21PRIZES_GAK | .@bit; + } + purchaseok(); + end; } // But then, Gak *did* "kidnap" a zealite specialist, right? 080-1,83,136,0 script #X21BarrierF NPC_HIDDEN,3,0,{ if (!'XMAS21FINAL) - npctalkonce strcharinfo(0) + " : " + l("This clearly is not a real gate; Most likely an illusion to prevent access. I should be able to dispel it by killing the guardians."); + dispbottom strcharinfo(0) + " : " + l("This clearly is not a real gate; Most likely an illusion to prevent access. I should be able to dispel it by killing the guardians."); // TODO: Verify again if all guardians are dead end; OnInit: |