[Turn off line numbering]
1: arg id, part, value;
2: var r, chance, times, active;
3:
4: (> .perms(sender()) <);
5: if (!reactions.contains(id))
6: throw(~noreaction, "No reaction with id \"" + id + "\".");
7: r = reactions[id];
8: if ((active = dict_contains(active_ids, id)))
9: .deactivate_reaction(id);
10: switch (part) {
11: case 'matchwith:
12: (> .check_reaction_matchwith(value) <);
13: r = replace(r, 1, value);
14: case 'template:
15: (> .check_reaction_template(value) <);
16: r = replace(r, 2, value);
17: case 'type:
18: (> .check_reaction_type(value) <);
19: r = replace(r, 3, value);
20: case 'chance:
21: (> .check_reaction_chance(value) <);
22: r = replace(r, 4, value);
23: case 'times:
24: (> .check_reaction_times(value) <);
25: r = replace(r, 5, value);
26: case 'method, 'hook_method:
27: (> .check_reaction_hook_method(value) <);
28: r = replace(r, 6, replace(r[6], 1, value));
29: case 'args, 'hook_args:
30: (> .check_reaction_hook_args(value) <);
31: r = replace(r, 6, replace(r[6], 2, value));
32: case 'min, 'min_delay:
33: (> .check_reaction_min(value) <);
34: r = replace(r, 7, value);
35: case 'max, 'max_delay:
36: (> .check_reaction_max(value) <);
37: r = replace(r, 8, value);
38: default:
39: throw(~invpart, "Invalid part '" + part + ".");
40: }
41: reactions = reactions.add(id, r);
42: if (active)
43: .activate_reaction(id);
["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]