1+ package game.location.varrock
2+
3+ import api.predef.*
4+ import api.predef.ext.*
5+ import api.shop.dsl.ShopHandler
6+ import io.luna.game.event.impl.ServerStateChangedEvent.ServerLaunchEvent
7+ import io.luna.game.model.item.shop.BuyPolicy
8+ import io.luna.game.model.item.shop.Currency
9+ import io.luna.game.model.item.shop.RestockPolicy
10+ import io.luna.game.model.mob.dialogue.Expression
11+ import io.luna.game.model.item.shop.*
12+ import io.luna.game.model.mob.wandering.*
13+
14+ val shopkeeperId = 546
15+
16+ ShopHandler .create(" Zaff's Superior Staffs!" ) {
17+ buy = BuyPolicy .EXISTING
18+ restock = RestockPolicy .FAST
19+ currency = Currency .COINS
20+
21+ sell {
22+ " Staff" x 5
23+ " Magic staff" x 5
24+ " Staff of air" x 2
25+ " Staff of water" x 2
26+ " Staff of earth" x 2
27+ " Staff of fire" x 2
28+ }
29+
30+ open {
31+ npc2 + = shopkeeperId
32+ }
33+ }
34+
35+ npc1(shopkeeperId) {
36+ plr.newDialogue()
37+ .npc(targetNpc.id, " Would you like to buy or sell some staffs?" )
38+ .options(" Yes, please!" , {
39+ plr.overlays.open(ShopInterface (world, " Zaff's Superior Staffs!" ))
40+ }, " No, thank you." , {
41+ plr.newDialogue()
42+ .player(" No, thank you." )
43+ .npc(targetNpc.id, " Well, 'stick' your head in again" , " if you change your mind." )
44+ .player(" Huh, terrible pun!" , " You just can't get the 'staff' these days!" )
45+ .open()
46+ })
47+ .open()
48+ }
49+
50+ on(ServerLaunchEvent ::class ) {
51+ world.addNpc(
52+ id = shopkeeperId,
53+ x = 3202 ,
54+ y = 3433 )
55+ .startWandering(2 , WanderingFrequency .NORMAL )
56+ }
0 commit comments