DSB/Monster Scripting: Difference between revisions
From DmWiki
				
				
				Jump to navigationJump to search
				
				
 New page: ==Monster Scripting== See the base/monster.lua file for more information on functions called by objects (monsters!) but be careful of overriding them.     ;<b>special_attack</b>(monster_ar...  | 
				No edit summary  | 
				||
| (One intermediate revision by one other user not shown) | |||
| Line 4: | Line 4: | ||
;<b>special_attack</b>(monster_arch, monster_id, target_position, target_char, damage_type, damage_amount)  | ;<b>special_attack</b>(monster_arch, monster_id, target_position, target_char, damage_type, damage_amount)  | ||
:Adds a special_attack method to the monster's archetype. By default, it has a 50% chance of occurring, but you can set <b>special_chance</b> in the archetype to change this percentage. This function is executed after the character takes normal damage from an attack.  | :Adds a special_attack method to the monster's archetype. By default, it has a 50% chance of occurring, but you can set <b>special_chance</b> in the archetype to change this percentage. This function is executed after the character takes normal damage from an attack.  [http://www.dungeon-master.com/forum/viewtopic.php?f=53&t=28854&p=118957#p118893 Example]  | ||
[[Category:DSB|Monster Scripting]]  | |||
Latest revision as of 14:04, 9 May 2011
Monster Scripting
See the base/monster.lua file for more information on functions called by objects (monsters!) but be careful of overriding them.
- special_attack(monster_arch, monster_id, target_position, target_char, damage_type, damage_amount)
 - Adds a special_attack method to the monster's archetype. By default, it has a 50% chance of occurring, but you can set special_chance in the archetype to change this percentage. This function is executed after the character takes normal damage from an attack. Example