blob: b5f18fa85cf3ffd6b46e10b04ba334e4d25faa7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
## Complete Quest Example: "Clear the Rats"
### 1. Quest giver mob (`data/mobs/quest_giver.yaml`)
```yaml
id: "quest_giver"
name: "Elder"
unique: true
protected: true
talk:
nodes:
start:
message: "\"Rats! Rats everywhere in the cellar. Clear them out and I'll reward you.\""
options:
- text: "\"I'll handle it.\""
goto: accept_quest
condition:
player_flag: rat_quest
not: true
- text: "\"I killed the rats.\""
goto: turn_in
condition:
player_flag: rat_quest
value: started
- text: "\"Goodbye.\""
end: true
accept_quest:
message: "\"Good lad. The cellar is west of here. Come back when they're dead.\""
action:
set_player_flags:
rat_quest: started
options:
- text: "\"On my way.\""
end: true
turn_in:
message: "\"You did it! The village owes you a debt. Here — take this.\""
action:
give_item: rusty_sword
set_player_flags:
rat_quest: complete
heal: 10
options:
- text: "\"Thanks!\""
end: true
attack: 1
strength: 1
defense: 1
hp: 20
speed: 5
aggressive: false
idle_descriptions:
- "mutters about the rat infestation"
```
Talk configs are inline on the mob under the `talk:` key. No separate behavior file needed.
### 2. Rat mobs (`data/mobs/rat.yaml`)
```yaml
id: "rat"
name: "giant rat"
attack: 2
strength: 1
defense: 1
hp: 3
speed: 4
aggressive: true
respawn_ticks: 60
drops:
remains: "rat bones"
```
### 3. Cellar room (`data/rooms/20.yaml`)
```yaml
id: 20
name: "Cellar"
description: "A damp, dark cellar. The floor scuttles with movement."
exits:
east: 1
mobs:
- "rat"
- "rat"
- "rat"
- "rat"
- "rat"
```
### 4. Room 1 with quest giver (`data/rooms/1.yaml`)
```yaml
id: 1
name: "Town Square"
description: "Cobblestone paths lead in all directions. The Elder stands near the fountain."
exits:
west: 20
north: 2
mobs:
- "quest_giver"
objects:
- id: lumby_fountain
```
---
|