-
Notifications
You must be signed in to change notification settings - Fork 3
/
healer.txt
231 lines (189 loc) · 6.35 KB
/
healer.txt
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
HEALER
1.- In MUD.H look for ACT_ bits and add one more
#define ACT_HEALER XX /* Where XX is a free bit_vector (in original code 22 is unused */
Add also:
DECLARE_DO_FUN( do_heal );
2.- In TABLES.C: add in the right places
if ( !str_cmp( name, "do_heal" )) return do_heal;
if ( skill == do_heal ) return "do_heal";
3.- Add this file called HEALER.C
/***************************************************************************
* ROM 2.4 is copyright 1993-1998 Russ Taylor *
* ROM has been brought to you by the ROM consortium *
* Russ Taylor (rtaylor@hypercube.org) *
* Gabrielle Taylor (gtaylor@hypercube.org) *
* Brian Moore (zump@rom.org) *
* By using this code, you have agreed to follow the terms of the *
* ROM license, in the file Rom24/doc/rom.license *
***************************************************************************/
/***************************************************************************
* Ported to Smaug 1.4 by Desden, el Chaman Tibetano in November 1998 *
* ( Jose Luis Sogorb ) Email: jose@luisso.net *
* *
***************************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mud.h"
void do_heal(CHAR_DATA *ch, char *argument)
{
CHAR_DATA *mob;
char arg[MAX_INPUT_LENGTH];
int cost,sn;
SPELL_FUN *spell;
char *words;
/* Search for an act_healer */
for ( mob = ch->in_room->first_person; mob; mob = mob->next_in_room )
{
if ( IS_NPC(mob) && xIS_SET(mob->act, ACT_HEALER) )
break;
}
if ( mob == NULL )
{
send_to_char( "You can't do that here.\n\r", ch );
return;
}
one_argument(argument,arg);
if (arg[0] == '\0')
{
/* display price list */
act(AT_PLAIN,"$N says 'I offer the following spells:'",ch,NULL,mob,TO_CHAR);
send_to_char(" light: cure light wounds 10 gold\n\r",ch);
send_to_char(" serious: cure serious wounds 15 gold\n\r",ch);
send_to_char(" critical: cure critical wounds 25 gold\n\r",ch);
send_to_char(" heal: healing spell 50 gold\n\r",ch);
send_to_char(" blind: cure blindness 20 gold\n\r",ch);
send_to_char(" poison: cure poison 25 gold\n\r",ch);
send_to_char(" curse: remove curse 50 gold\n\r",ch);
send_to_char(" refresh: restore movement 5 gold\n\r",ch);
send_to_char(" mana: restore mana 10 gold\n\r",ch);
send_to_char(" Type heal <type> to be healed.\n\r",ch);
return;
}
if (!str_cmp(arg,"light"))
{
spell = spell_smaug;
sn = skill_lookup("cure light");
words = "judicandus dies";
cost = 1000;
}
else if (!str_cmp(arg,"serious"))
{
spell = spell_smaug;
sn = skill_lookup("cure serious");
words = "judicandus gzfuajg";
cost = 1600;
}
else if (!str_cmp(arg,"critical"))
{
spell = spell_smaug;
sn = skill_lookup("cure critical");
words = "judicandus qfuhuqar";
cost = 2500;
}
else if (!str_cmp(arg,"heal"))
{
spell = spell_smaug;
sn = skill_lookup("heal");
words = "pzar";
cost = 5000;
}
else if (!str_cmp(arg,"blind"))
{
spell = spell_cure_blindness;
sn = skill_lookup("cure blindness");
words = "judicandus noselacri";
cost = 2000;
}
else if (!str_cmp(arg,"poison"))
{
spell = spell_cure_poison;
sn = skill_lookup("cure poison");
words = "judicandus sausabru";
cost = 2500;
}
else if (!str_cmp(arg,"curse"))
{
spell = spell_remove_curse;
sn = skill_lookup("remove curse");
words = "candussido judifgz";
cost = 5000;
}
else if (!str_cmp(arg,"mana"))
{
spell = NULL;
sn = -1;
words = "energizer";
cost = 1000;
}
else if (!str_cmp(arg,"refresh") )
{
spell = spell_smaug;
sn = skill_lookup("refresh");
words = "candusima";
cost = 500;
}
else
{
act(AT_PLAIN,"$N says ' Type 'heal' for a list of spells.'",
ch,NULL,mob,TO_CHAR);
return;
}
if (cost > ch->gold )
{
act(AT_PLAIN,"$N says 'You do not have enough gold for my services.'",
ch,NULL,mob,TO_CHAR);
return;
}
WAIT_STATE(ch, PULSE_VIOLENCE);
ch->gold -= cost;
act(AT_PLAIN,"$n utters the words '$T'.",mob,NULL,words,TO_ROOM);
if (spell == NULL)
{
ch->mana += dice(2,8) + ch->level / 3;
ch->mana += UMIN(ch->level,ch->max_mana - ch->mana);
send_to_char("A warm glow passes through you.\n\r",ch);
return;
}
if (sn == -1)
return;
spell(sn,ch->level,mob,ch);
}
/********* End of code *****************************************/
4.- Add in MAKEFILE: healer.o and healer.c in the right sections.
5.- Do a 'make clean' and a 'make.
6.- You must add the command in /SYSTEM/COMMANDS.DAT:
#COMMAND
Name heal~
Code do_heal
Position 100
Level 1
Log 0
End
7.- And the last thing: set the act_healer to your chosen mob.
If you want to add this act_flag online you must edit build.c, look for
char * const act_flags []
{
and add the new flag in the right place (the order is set by the bit vector values) .
An example:
If you have
#define ACT_HEALER 3 (in MUD.H)
you must change it to:
{
"npc", "sentinel", "scavenger", "healer", "r2", "aggressive", "stayarea",
"wimpy", "pet", "train", "practice", "immortal", "deadly", "polyself",
"meta_aggr", "guardian", "running", "nowander", "mountable", "mounted",
"scholar", "secretive", "hardhat", "mobinvis", "noassist", "autonomous",
"pacifist", "noattack", "annoying", "statshield", "prototype", "r14"
};
Where 'npc' is bitvector 0, 'sentinel' is 1, and so on.
To mset an act_flag to a mob, it must be a prototype, so you must do:
mset <mobname> flags prototype
mset <mobname> flags healer
mset <mobname> flags prototype
foldarea <area_file>
/***********************************************************************
* Ported to Smaug 1.4 by Desden, el Chaman Tibetano (J.L.Sogorb) *
* November 1998 - Email: jose@luisso.net *
* *
***********************************************************************/