Skip to content

Commit 0b768df

Browse files
committed
Thessalias clothes
1 parent 23aa5f9 commit 0b768df

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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.*
8+
import io.luna.game.model.mob.*
9+
import io.luna.game.model.mob.block.PlayerAppearance.DesignPlayerInterface
10+
import io.luna.game.model.mob.wandering.*
11+
12+
/**
13+
* todo make the interfaces work
14+
* interface id
15+
* 0 = legs (male)
16+
* 4731 = legs (female)
17+
* 2851 = torso (male)
18+
* 3038 = torso (female)
19+
* @author hydrozoa
20+
*/
21+
22+
val shopkeeperId = 548
23+
24+
ShopHandler.create("Thessalia's Fine Clothes.") {
25+
buy = BuyPolicy.EXISTING
26+
restock = RestockPolicy.FAST
27+
currency = Currency.COINS
28+
29+
sell {
30+
"White apron" x 3
31+
"Leather body" x 12
32+
"Leather gloves" x 10
33+
"Brown apron" x 1
34+
"Pink skirt" x 5
35+
"Black skirt" x 3
36+
"Blue skirt" x 2
37+
1007 x 4
38+
"Silk" x 5
39+
"Silk" x 5
40+
426 x 3
41+
428 x 3
42+
}
43+
44+
open {
45+
npc2 += shopkeeperId
46+
}
47+
}
48+
49+
npc1(shopkeeperId) {
50+
plr.newDialogue()
51+
.npc(targetNpc.id, "Do you want to buy any fine clothes?")
52+
.options("What have you got?", {
53+
plr.newDialogue()
54+
.player("What have you got?")
55+
.npc(targetNpc.id, "Well, I have a number of fine pieces of clothing", "on sale or, if you prefer, I can offer you ", "an exclusive, total-clothing makeover?")
56+
.options("Tell me more about this makeover.", {
57+
plr.newDialogue()
58+
.npc(targetNpc.id, "Certainly!")
59+
.npc(targetNpc.id, "Here at Thessalia's fine clothing boutique,", "we offer a unique service where we will totally", "revamp your outfit to your choosing.")
60+
.npc(targetNpc.id, "It's on the house, completely free! Tired of ", "always wearing the same old outfit, day in, day out?", "This is the service for you!")
61+
.npc(targetNpc.id, "So what do you say? Interested?")
62+
.options("I'd like the makeover please.", {
63+
plr.overlays.open(DesignPlayerInterface())
64+
}, "I'd just like to buy some clothes.", {
65+
plr.overlays.open(ShopInterface(world, "Thessalia's Fine Clothes."))
66+
}, "No, thank you.", {
67+
noThanksDialogue(plr, targetNpc)
68+
})
69+
.open()
70+
}, "I'd just like to buy some clothes.", {
71+
plr.overlays.open(ShopInterface(world, "Thessalia's Fine Clothes."))
72+
}, "No, thank you.", {
73+
noThanksDialogue(plr, targetNpc)
74+
})
75+
.open()
76+
}, "No, thank you.", {
77+
noThanksDialogue(plr, targetNpc)
78+
})
79+
.open()
80+
}
81+
82+
fun noThanksDialogue(plr: Player, targetNpc: Npc) {
83+
plr.newDialogue()
84+
.player("No, thank you.")
85+
.npc(targetNpc.id, "Well, please return if ", "you change your mind.")
86+
.open()
87+
}
88+
89+
on(ServerLaunchEvent::class) {
90+
world.addNpc(
91+
id = shopkeeperId,
92+
x = 3205,
93+
y = 3417)
94+
.startWandering(3, WanderingFrequency.NORMAL)
95+
}

0 commit comments

Comments
 (0)