#################################################################
#   )      (\_     # 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
	agression( char, defender, spell )

	if( defender.hastag( "strength" ) ):
		char.socket.sysmessage( "Already under the influence!" )
		return 1

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

	# skill 1.0 = 10 point
	str = floor( 1 + attacker.skill[ MAGERY ] / 100 )

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

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