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
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
addhook("hit","_hit") function _hit(id,s,wpn,hpdmg,apdmg) 	dmg = math.floor(((hpdmg)/2) + (atk[s] - (def[id]*0.3))) 	barrierdmg = math.ceil(hpdmg + atk[s]) 	if dmg <= 0 then 		dmg = 1 	end 	if player(id,"team") ~= player(s,"team") then 		if barrier[id] > 0 then 			barrier[id] = barrier[id] - barrierdmg 			if barrier[id] < 0 then 				barrier[id] = 0 			end 			parse("sv_sound2 "..id.." \"tajifuns_rpg/magicalbarrier.wav\"") 			parse("sv_sound2 "..s.." \"tajifuns_rpg/magicalbarrier.wav\"") 			barrierimg[id] = image("gfx/tajifuns_rpg/barrier.png",player(id,"x"),player(id,"y"),1) 			tween_scale(barrierimg[id],150,0,0) 		else 			if shieldwall[id] == 1 then 				dmg = (math.ceil(dmg*SPELLS[11].power)) 			end 			if dmg_ref[id] == 1 then 				dmg = (math.ceil(dmg/SPELLS[9].power)) 			end 			if dmg >= hp2[id] then 				-- Kill 				parse('customkill '..s..' "killed" '..id..'') 				add = expratio+math.random(-10,15) 				exp[s] = exp[s] + add 				newexp[s] = newexp[s] + add 				if exp[s] >= needexp[s] then 					lvlup(s) 				end 			else 				hp2[id] = hp2[id] - dmg 			end 		end 		 	end 	return 1 end
1
dmg = math.floor(((hpdmg)/2) + (atk[s] - (def[id]*0.3)))
edited 1×, last 08.07.13 11:21:50 am