blob: a4f7cdac53ecae5e397bd81a7028d4bf23c4bc08 (
plain) (
blame)
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
|
// TMW-2 Script.
// Author:
// Jesusalva
// Description:
// Applies effects for INC_* (STR doesn't exist)
// Valid values: INCAGI INCVIT INCINT INCDEX INCLUK INCHIT
/// Untested Values: INCHIT INCFLEE INCMHP INCMSP WALKSPEED INVINCIBLE
//
// Variables:
// @delay Second of buffing
// @min Min amount of type
// @max Max amount of type
// @type SC_*
- script inc_sc_bonus -1,{
OnUse:
if (@delay <= 0) close;
// Get the bonus value
.@bonus=rand(@min, @max);
// Remaining time and effect conversion
@v=getstatus(@type, 1);
@t=getstatus(@type, 5);
// Convert remaining time to seconds, rounded down
if (@t > 1000)
@t=@t/1000;
else
@t=0;
// If there was effect previously, get ponderate average
if (@v > 0)
@v=(.@bonus*@delay+@v*@t)/(@t+@delay);
else
@v=.@bonus;
// Update time value to ms and to stack
@t+=@delay;
@t*=1000;
// Restart the bonus
sc_end @type;
sc_start @type,@t,@v;
close;
}
|