SHOW:
|
|
- or go back to the newest paste.
1 | -- this is what I would do: | |
2 | Pattern: ^(\w+) quickly eats (?:some|an|a) (.*)\.$ | |
3 | ||
4 | local herb_table = { | |
5 | ["galingale flower"] = "galingale", | |
6 | ["hyssop stem"] = "hyssop", | |
7 | ["juniper berry"] = "juniper", | |
8 | ["piece of kelp"] = "kelp", | |
9 | ["maidenhair leaf"] = "maidenhair", | |
10 | ["mandrake root"] = "mandrake", | |
11 | ["nightshade root"] = "nightshade", | |
12 | ["orphine seed"] = "orphine", | |
13 | ["wormwood root"] = "wormwood", | |
14 | } | |
15 | ||
16 | local herb = herb_table[matches[3]] | |
17 | ||
18 | if herb then | |
19 | cecho(" <yellow>Person ate "..herb) | |
20 | TrackSlice(herb) | |
21 | if shadowplanted and shadowplant == herb then | |
22 | shadowplanted = false | |
23 | killTimer(shadowplantTimer_init) | |
24 | killTimer(shadowplantTimer_exec) | |
25 | end | |
26 | end | |
27 | ||
28 | ||
29 | Trigger: | |
30 | ^You force a small opening in your wormhole and a shadowy replica of (?:some|a|an) (.*) pops out of it and lands in .+ hands.$ | |
31 | ||
32 | local herb = matches[2] | |
33 | ||
34 | local herb_table = { | |
35 | ["galingale flower"] = "galingale", | |
36 | ["hyssop stem"] = "hyssop", | |
37 | ["juniper berry"] = "juniper", | |
38 | ["piece of kelp"] = "kelp", | |
39 | ["maidenhair leaf"] = "maidenhair", | |
40 | ["mandrake root"] = "mandrake", | |
41 | ["nightshade root"] = "nightshade", | |
42 | ["orphine seed"] = "orphine", | |
43 | ["wormwood root"] = "wormwood", | |
44 | } | |
45 | ||
46 | herb = herb_table[herb] | |
47 | shadowplanted = false | |
48 | shadowplant = "" | |
49 | if shadowplantTimer_init then killTimer(shadowplantTimer_init) end | |
50 | if shadowplantTimer_exec then killTimer(shadowplantTimer_exec) end | |
51 | shadowplantTimer_init = tempTimer( 1, function() | |
52 | shadowplanted = true | |
53 | shadowplant = herb | |
54 | if shadowplantTimer_init then killTimer( shadowplantTimer_init ) end | |
55 | end) | |
56 | shadowplantTimer_exec = tempTimer( 4, function() | |
57 | shadowplanted = false | |
58 | shadowplant = "" | |
59 | if shadowplantTimer_init then killTimer( shadowplantTimer_init ) end | |
60 | if shadowplantTimer_exec then killTimer( shadowplantTimer_exec ) end | |
61 | end) | |
62 | cecho("<orange_red>\nSHADOWPLANTED: "..herb) | |
63 | ||
64 | ||
65 | function TrackSlice(name) | |
66 | if shadowplanted then | |
67 | if combat.afflictions.paralysis and shadowplant == "maidenhair" then | |
68 | cecho("<orange_red>\nSHADOWPLANT <green>MAIDENHAIR <orange_red> EATEN") | |
69 | elseif combat.afflictions.sensitivity and shadowplant == "maidenhair" then | |
70 | cecho("<orange_red>\nSHADOWPLANT <green>MAIDENHAIR <orange_red> EATEN") | |
71 | elseif combat.afflictions.slickness and shadowplant == "maidenhair" then | |
72 | cecho("<orange_red>\nSHADOWPLANT <green>MAIDENHAIR <orange_red> EATEN") | |
73 | elseif combat.afflictions.numbness and shadowplant == "maidenhair" then | |
74 | cecho("<orange_red>\nSHADOWPLANT <green>MAIDENHAIR <orange_red> EATEN") | |
75 | elseif combat.afflictions.frostbite and shadowplant == "maidenhair" then | |
76 | cecho("<orange_red>\nSHADOWPLANT <green>MAIDENHAIR <orange_red> EATEN") | |
77 | elseif combat.afflictions.limbparalysis and shadowplant == "maidenhair" then | |
78 | cecho("<orange_red>\nSHADOWPLANT <green>MAIDENHAIR <orange_red> EATEN") | |
79 | elseif combat.afflictions.asthma and shadowplant == "kelp" then | |
80 | cecho("<orange_red>\nSHADOWPLANT <cyan>KELP <orange_red> EATEN") | |
81 | elseif combat.afflictions.hemotoxin and shadowplant == "kelp" then | |
82 | cecho("<orange_red>\nSHADOWPLANT <cyan>KELP <orange_red> EATEN") | |
83 | elseif combat.afflictions.butisol and shadowplant == "kelp" then | |
84 | cecho("<orange_red>\nSHADOWPLANT <cyan>KELP <orange_red> EATEN") | |
85 | elseif combat.afflictions.clumsiness and shadowplant == "kelp" then | |
86 | cecho("<orange_red>\nSHADOWPLANT <cyan>KELP <orange_red> EATEN") | |
87 | elseif combat.afflictions.weakness and shadowplant == "kelp" then | |
88 | cecho("<orange_red>\nSHADOWPLANT <cyan>KELP <orange_red> EATEN") | |
89 | ||
90 | ..yadayadayada.. | |
91 | ||
92 | else | |
93 | for _,v in ipairs(tarcuringorder[name]) do | |
94 | if combat.afflictions[v] then | |
95 | combat.afflictions[v] = false | |
96 | combat.afflictions.anorexia = false | |
97 | echo("\nCombatSystem: ENEMY CURED " .. string.upper(v) .. " (herb/slice)") | |
98 | enemyAffshow() | |
99 | return | |
100 | end | |
101 | end | |
102 | end | |
103 | end |