-
Notifications
You must be signed in to change notification settings - Fork 2
/
whistle.txt
118 lines (93 loc) · 3.06 KB
/
whistle.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
/* do_whistle : Summon a wolf, or a pack of wolves to assist you. */
/* These are the vnums of the wolfs that can be summoned, VISCIOUS should be
stronger then TIMBER and TIMBER should be stronger then WOLF */
#define WHISTLE_MOVE_COST 30
#define WHISTLE_WOLF 8094
#define WHISTLE_TIMBER 7502
#define WHISTLE_VISCIOUS 7502
int bob(int num)
{
if (number(1,100) <= num) return 1;
else return 0;
}
ACMD(do_whistle) {
struct obj_data *obj;
struct char_data *pet;
struct follow_type *f;
int chance;
int penalty=0;
if (!GET_SKILL(ch, SKILL_WHISTLE)) {
send_to_char("You have no idea how.\r\n", ch);
return;
}
if (GET_MOVE(ch) <= WHISTLE_MOVE_COST) {
send_to_char("You are too tired.\r\n", ch);
return;
}
obj = get_obj_in_list_vis(ch, "whistle", ch->carrying);
if (!obj) {
send_to_char("But you need something to whistle with!\r\n", ch);
return;
}
GET_MOVE(ch) -= WHISTLE_MOVE_COST;
for (f = ch->followers; f; f = f->next)
if (IN_ROOM(ch) == IN_ROOM(f->follower)) {
if (IS_MOB(f->follower))
penalty += 5;
else
penalty += 2;
}
if (GET_CHA(ch) < (penalty + 5)) {
send_to_char("You can not attract any more followers now.\r\n", ch);
return;
}
chance = number(0, GET_SKILL(ch, SKILL_WHISTLE) + GET_LEVEL(ch));
if (chance < 50) {
act("Your whistle fails. No wolves were attracted.", FALSE, ch,
0, 0, TO_CHAR);
act("$n lets out one hell of a whistle, but nothing seems interested.", FALSE, ch, 0, 0, TO_NOTVICT);
return;
} else if (chance < 100)
pet = read_mobile(WHISTLE_TIMBER, VIRTUAL);
else if (chance < 120)
pet = read_mobile(WHISTLE_VISCIOUS, VIRTUAL);
else
pet = read_mobile(WHISTLE_WOLF, VIRTUAL);
act("Your whistle is answered by $N.", FALSE, ch, 0, pet, TO_CHAR);
act("$ns whistle is answered by $N.", FALSE, ch, 0, pet, TO_ROOM);
IS_CARRYING_W(pet) = 1000;
IS_CARRYING_N(pet) = 100;
SET_BIT(AFF_FLAGS(pet), AFF_CHARM);
char_to_room(pet, IN_ROOM(ch));
add_follower(pet, ch);
if (number(1, 10) >= 5) {
if (chance < 70) {
return;
}
if (chance < 100)
pet = read_mobile(WHISTLE_TIMBER, VIRTUAL);
else if (chance < 120)
pet = read_mobile(WHISTLE_VISCIOUS, VIRTUAL);
else
pet = read_mobile(WHISTLE_WOLF, VIRTUAL);
act("Your whistle is answered by $N.", FALSE, ch, 0, pet, TO_CHAR);
act("$ns whistle is answered by $N.", FALSE, ch, 0, pet, TO_ROOM);
char_to_room(pet, IN_ROOM(ch));
add_follower(pet, ch);
}
else if (number(1, 10) >= 8) {
if (chance < 90) {
return;
}
if (chance < 100)
pet = read_mobile(WHISTLE_WOLF, VIRTUAL);
else if (chance < 120)
pet = read_mobile(WHISTLE_VISCIOUS, VIRTUAL);
if (bob(50))
pet = read_mobile(WHISTLE_TIMBER, VIRTUAL);
act("Your whistle is answered by $N.", FALSE, ch, 0, pet, TO_CHAR);
act("$ns whistle is answered by $N.", FALSE, ch, 0, pet, TO_ROOM);
char_to_room(pet, IN_ROOM(ch));
add_follower(pet, ch);
}
}