User Tools

Site Tools


lua:ch:damage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lua:ch:damage [2014/12/27 07:27] vodurlua:ch:damage [2017/02/20 07:26] (current) vodur
Line 3: Line 3:
 damage(string) damage(string)
  
-Format: \\+Format:\\
 damage [victim|'all'] [min] [max] (kill) : deal (lethal) damage damage [victim|'all'] [min] [max] (kill) : deal (lethal) damage
  
 Accepts:[[:lua:formatargs|format arguments]]. Accepts:[[:lua:formatargs|format arguments]].
  
-Examples: \\+Examples:\\
 damage("'%s' 2000 3000 lethal", mob.name) –mob damages itself 2000-3000 damage damage("'%s' 2000 3000 lethal", mob.name) –mob damages itself 2000-3000 damage
  
-Syntax2: \\ +Syntax2:\\ 
-damage(victim[CH], damage[number], kill[boolean] <, type[string]>)+damage( victim<CH>, damage<number>, kill<boolean> [, type<string>)
  
-Examples: \\ +Examples:
-mob:damage(ch, 3000, true, "fire") – mob damages ch (will start battle if possible), 3000, lethal, fire damage+
  
-for k,v in pairs(mob.room.people) do +<code lua> 
- +mob:damage(ch3000true, "fire") -- mob damages ch (will start battle if possible), 3000, lethal, fire damage
-<code>''v:damage'' (v1000false -- damage self (won'start fight), 1000 damagenon lethal+
 </code> </code>
  
 +<code lua>
 +for k,v in pairs(mob.room.people) do
 +    v:damage(v, 1000, false)  -- damage self (won't start fight), 1000 damage, non lethal
 end end
 +</code>
  
-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