/
denial.kod
140 lines (100 loc) · 3.23 KB
/
denial.kod
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
% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse.
% All rights reserved.
%
% This software is distributed under a license that is described in
% the LICENSE file that accompanies it.
%
% Meridian is a registered trademark.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
denial is PersonalEnchantment
constants:
include blakston.khd
resources:
denial_name_rsc = "denial"
denial_icon_rsc = idenial.bgf
denial_desc_rsc = \
"Causes the caster to unrealize their wounds, but beware when "
"you realize its a hoax, because the wounds are still just as deep! "
"Requires a firesand and solagh to cast."
denial_on_rsc = "Your wounds suspiciously disappear."
denial_failed_rsc = "Hmmm, you can't seem to convince yourself of perfect health."
denial_already_enchanted_rsc = "You can't fool yourself twice about something like this, at "
"least not at the same time."
denial_off_rsc = "Ouch - you are reminded of your previous weariness."
denial_sound = rdenial.wav
classvars:
vrName = denial_name_rsc
vrIcon = denial_icon_rsc
vrDesc = denial_desc_rsc
vrAlreadyEnchanted = Denial_already_enchanted_rsc
vrEnchantment_On = Denial_On_rsc
vrEnchantment_Off = Denial_Off_rsc
viSpell_num = SID_DENIAL
viSchool = SS_RIIJA
viSpell_level = 4
viMana = 15
viSpellExertion = 5
viCast_time = 1000
vbCanCastOnOthers = FALSE
vrSucceed_wav = denial_sound
properties:
messages:
CanPayCosts(who = $, lTargets = $, bItemCast = FALSE)
{
% if they are already boosted above max health, then return FALSE
if send(who,@GetHealth) >= send(who,@GetMaxHealth)
{
if NOT bItemCast
{
send(who,@MsgSendUser,#message_rsc=denial_failed_rsc);
}
return FALSE;
}
propagate;
}
ResetReagents()
{
plReagents = $;
plReagents = Cons([&FireSand,2], plReagents);
plReagents = Cons([&Solagh,1],plReagents);
return;
}
GetDuration(iSpellPower = 0)
{
local iDuration;
% 10 - 20 plus 1 second per spellpower
iDuration = random(10000,20000) + (iSpellPower * 1000);
iDuration=bound(iDuration,20000,120000);
return iDuration;
}
GetStateValue(who = $, Target = $, iSpellPower = 1)
{
local iHPGain, iSpellpowerBonus;
iHPGain = send(who,@GetMaxHealth) - send(who,@GetHealth);
iSpellpowerBonus = (iSpellpower + 1) / 5; %0 - 20, this is the percent of damage you don't get back when the enchantment fails.
iHPGain = send(who,@GainHealthNormal,#amount=iHPGain);
return iHPGain - (iSpellpowerBonus * iHPGain)/ 100 ;
}
EndEnchantment(who = $, state=$, report = TRUE)
{
post(self,@EndEnchantmentEffects,#who=who,#state=state);
propagate;
}
EndEnchantmentEffects(who=$, state=$)
{
if state
{
Send(who,@LoseHealth,#amount=state);
if send(who,@GetHealth) < 1
{
send(who,@GainHealthNormal,#amount=1);
}
}
return;
}
GetPotionClass()
{
return &DenialPotion;
}
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%