edited 3×, last 14.04.14 01:44:17 pm
Forum
Scripts
Building stats?
Building stats?
2 replies
1

1
2
3
4
2
3
4
function _objectdamage(id,damage,player)
	msg(damage+(object(id,"health")))
end
addhook("objectdamage","_objectdamage")
I made it list the building's HP before it was hit, without the damage it had taken, then the damage it had taken, and then the HP before it was hit minus the damage it had taken.
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
function _objectdamage(id,damage,player)
	 msg"--OBJECT HIT--"
	 msg"Old HP"
	 msg((object(id,"health")))
	 msg"Damage"
	 msg(damage)
	 msg"New HP"
	 msg((object(id,"health"))-damage)
end
addhook("objectdamage","_objectdamage")
EDIT: After a while I figured out how to show upgrade value as well.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function _objectdamage(id,damage,player)
	 msg"--OBJECT HIT--"
	 msg"Old HP"
	 msg((object(id,"health")))
	 msg"Damage"
	 msg(damage)
	 msg"New HP"
	 msg((object(id,"health"))-damage)
end
addhook("objectdamage","_objectdamage")
function _objectupgrade(id,player,progress,total)
	 msg"Upgrade value"
	 msg(object(id,"upgrade")+1)
	 msg"Needed"
	 msg(total)
end
addhook("objectupgrade","_objectupgrade")
edited 1×, last 14.04.14 01:39:18 pm
1

Offline
