<commit_before>from templeplus.pymod import PythonModifier
from toee import *
import tpdp
from spell_utils import verifyItem

# Object spell effect
# args:
#		0: spell_id
#		1: duration
#		2: dc
#		3: extra
#		4: extra

print "Registering sp_disrupting_weapon"

def AddChar(weapon, args, evt_obj):
	spell_id = args.get_arg(0)
	duration = args.get_arg(1)
	dc = args.get_arg(2)

	packet = tpdp.SpellPacket(spell_id)
	clvl = packet.caster_level

	weapon.item_condition_add_with_args(
			'Disrupting Weapon', dc, clvl, 0, 0, spell_id)
	parent = weapon.obj_get_obj(obj_f_item_parent)

	return 0

def OnEnd(weapon, args, evt_obj):
	weapon.item_condition_remove('Disrupting Weapon', args.get_arg(0))
	return 0

def Yes(weapon, args, evt_obj):
	evt_obj.return_val = 1
	return 0

wpn = PythonModifier('sp-Disrupting Weapon', 5, 1)
# Note: no tooltip because it doesn't seem to matter
wpn.AddHook(ET_OnConditionAdd, EK_NONE, AddChar, ())
wpn.AddHook(ET_OnConditionRemove, EK_NONE, OnEnd, ())

wpn.AddSpellDispelCheckStandard()
wpn.AddSpellTeleportPrepareStandard()
wpn.AddSpellTeleportReconnectStandard()<commit_msg>Remove an unused function<commit_after>from templeplus.pymod import PythonModifier
from toee import *
import tpdp
from spell_utils import verifyItem

# Object spell effect
# args:
#		0: spell_id
#		1: duration
#		2: dc
#		3: extra
#		4: extra

print "Registering sp_disrupting_weapon"

def AddChar(weapon, args, evt_obj):
	spell_id = args.get_arg(0)
	duration = args.get_arg(1)
	dc = args.get_arg(2)

	packet = tpdp.SpellPacket(spell_id)
	clvl = packet.caster_level

	weapon.item_condition_add_with_args(
			'Disrupting Weapon', dc, clvl, 0, 0, spell_id)
	parent = weapon.obj_get_obj(obj_f_item_parent)

	return 0

def OnEnd(weapon, args, evt_obj):
	weapon.item_condition_remove('Disrupting Weapon', args.get_arg(0))
	return 0

wpn = PythonModifier('sp-Disrupting Weapon', 5, 1)
# Note: no tooltip because it doesn't seem to matter
wpn.AddHook(ET_OnConditionAdd, EK_NONE, AddChar, ())
wpn.AddHook(ET_OnConditionRemove, EK_NONE, OnEnd, ())

wpn.AddSpellDispelCheckStandard()
wpn.AddSpellTeleportPrepareStandard()
wpn.AddSpellTeleportReconnectStandard()
{'fraction_non_alphanumeric': 0.1024571163653222, 'fraction_numerical': 0.01483541956420955, 'mean_word_length': 5.894568690095847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3749186', 'n_tokens_mistral': 853, 'n_tokens_neox': 850, 'n_words': 186}