lua:ch:damage
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lua:ch:damage [2014/12/27 07:27] – vodur | lua:ch:damage [2017/02/20 07:26] (current) – vodur | ||
---|---|---|---|
Line 3: | Line 3: | ||
damage(string) | damage(string) | ||
- | Format: \\ | + | Format:\\ |
damage [victim|' | damage [victim|' | ||
Accepts: | Accepts: | ||
- | Examples: \\ | + | Examples:\\ |
damage("' | damage("' | ||
- | Syntax2: \\ | + | Syntax2: |
- | damage(victim[CH], damage[number], kill[boolean] | + | damage( victim<CH>, damage<number>, kill<boolean> [, type<string>] ) |
- | Examples: | + | Examples: |
- | mob: | + | |
- | for k,v in pairs(mob.room.people) do | + | < |
- | + | mob:damage(ch, 3000, true, " | |
- | < | + | |
</ | </ | ||
+ | <code lua> | ||
+ | for k,v in pairs(mob.room.people) do | ||
+ | v:damage(v, 1000, false) | ||
end | end | ||
+ | </ | ||
- | Notes: \\ | + | Notes:\\ |
- | For syntax2, the damage counts as actor damaging the victim. This means that if the damage kills the victim, the kill will be attributed to the damager. If actor is not in battle with the victim, battle will also start (if possible). \\ | + | For syntax2, the damage counts as actor damaging the victim. This means that if the damage kills the victim, the kill will be attributed to the damager. If actor is not in battle with the victim, battle will also start (if possible).\\ |
You can have the victim damage itself to prevent battle starting. | You can have the victim damage itself to prevent battle starting. | ||
+ | |||
lua/ch/damage.1419665238.txt.gz · Last modified: 2014/12/27 07:27 by vodur