#################################################################
#   )      (\_     # WOLFPACK 13.0.0 Scripts                    #
#  ((    _/{  "-;  # Created by: khpae                          #
#   )).-" {{ ;"`   # Revised by:                                #
#  ( (  ;._ \\ ctr # Last Modification: Created                 #
#################################################################

import wolfpack
from wolfpack.consts import *
from wolfpack.utilities import *
from math import floor

def onSpellSuccess( char, spell, type, target ):
	# target check is done at c++ code
	defender = target.char
	if not defender:
		return

	# check criminal : noto - party, guild, faction systems are affected
	aggression( char, defender, spell )

	# effects
	defender.soundeffect( 0x1e8 )
	defender.effect( 0x373a )

	# not a resistable spell : just check the damage : 1 ~ 11
	# skill 1.0 = 10 point
	damage = floor( 1 + attacker.skill[ MAGERY ] / 100 ) # One Bonus point per 10.0 Skill

	# Will be more or less put into defender.disturb() + defender.unfreeze() 
	# Stand by!
	# disturb medi
	# unfreeze - needed to be implemented
	defender.disturb()
	#defender.unfreeze()

	# FIXME: Duration is more or less unknown for this spell
	statmodifier( defender, 60000, 0, damage, 0 )
	return 1
