class 1 wizard_parameter : monster_parameter
{
parameter:
	int	SpecialSkill = 0;

handler:
	EventHandler CREATED(c0)
	{
		if( myself.sm.param1 == 1000 )
		{
			c0 = myself::GetCreatureFromIndex(myself.sm.param2);
			if( myself::IsNullCreature(c0) == 0 )
			{
				myself::AddHateInfo(c0,500,0,1,1);
				myself::AddUseSkillDesire(c0,1193729,0,1,1000000);
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 1 )
		{
			if( AttackLowLevel == 1 )
			{
				myself::LookNeighbor(300);
			}
		}
		if( timer_id == 2 )
		{
			if( IsVs == 1 )
			{
				myself.c_ai0 = myself.sm;
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage,h0,i0,i1,f0)
	{
		if( CreviceOfDiminsion != 0 )
		{
			if( myself::InMyTerritory(attacker) == 0 )
			{
				myself::RemoveAttackDesire(attacker.id);
				return;
			}
		}
		if( SSQLoserTeleport != 0 )
		{
			if( attacker.builder_level == 0 )
			{
				if( SSQLoserTeleport != 1 && SSQLoserTeleport != 2 )
				{
					myself::Say("Bug: Entered wrong price in the SSQLoserTeleport. Price = " + SSQLoserTeleport);
				}
				else if( myself::GetSSQStatus() == 3 )
				{
					i0 = myself::GetSSQSealOwner(SSQLoserTeleport);
					if( attacker.is_pc == 1 )
					{
						if( i0 == 0 && myself::GetSSQPart(attacker) == 0 )
						{
							myself::RemoveAttackDesire(attacker.id);
							myself::InstantTeleport(attacker,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 1 && myself::GetSSQPart(attacker) != 1 )
						{
							myself::RemoveAttackDesire(attacker.id);
							myself::InstantTeleport(attacker,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 2 && myself::GetSSQPart(attacker) != 2 )
						{
							myself::RemoveAttackDesire(attacker.id);
							myself::InstantTeleport(attacker,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
					else if( myself::IsInCategory(11,attacker.npc_class_id) == 1 )
					{
						if( i0 == 0 && myself::GetSSQPart(attacker.master) == 0 )
						{
							myself::RemoveAttackDesire(attacker.master.id);
							myself::InstantTeleport(attacker.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 1 && myself::GetSSQPart(attacker.master) != 1 )
						{
							myself::RemoveAttackDesire(attacker.master.id);
							myself::InstantTeleport(attacker.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 2 && myself::GetSSQPart(attacker.master) != 2 )
						{
							myself::RemoveAttackDesire(attacker.master.id);
							myself::InstantTeleport(attacker.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
				}
				else if( myself::GetSSQStatus() == 1 )
				{
					i0 = myself::GetSSQSealOwner(SSQLoserTeleport);
					if( attacker.is_pc == 1 )
					{
						if( myself::GetSSQPart(attacker) == 0 )
						{
							myself::RemoveAttackDesire(attacker.id);
							myself::InstantTeleport(attacker,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
					else if( myself::IsInCategory(11,attacker.npc_class_id) == 1 )
					{
						if( myself::GetSSQPart(attacker.master) == 0 )
						{
							myself::RemoveAttackDesire(attacker.master.id);
							myself::InstantTeleport(attacker.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
				}
			}
		}
		if( myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) <= 20 && i0 == 1 )
		{
			if( SetCurse != 0 && gg::Rand(100) < 3 && attacker == h0.creature )
			{
				myself::Say(myself::MakeFString(1000452,"","","","",""));
				if( myself::Skill_GetConsumeMP(SetCurse) < myself.sm.mp && myself::Skill_GetConsumeHP(SetCurse) < myself.sm.hp && myself::Skill_InReuseDelay(SetCurse) == 0 )
				{
					myself::AddUseSkillDesire(attacker,SetCurse,0,1,1000000);
				}
			}
		}
		if( SoulShot != 0 )
		{
			i0 = myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(25601));
			i1 = myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(1053953));
			if( i0 <= 0 && i1 <= 0 )
			{
				if( gg::Rand(100) < SoulShotRate )
				{
					myself::UseSoulShot(SoulShot);
				}
			}
		}
		if( SpiritShot != 0 )
		{
			i0 = myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(25601));
			if( i0 <= 0 )
			{
				i0 = myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(1053953));
				if( gg::Rand(100) < SpiritShotRate && i0 <= 0 )
				{
					myself::UseSpiritShot(SpiritShot,SpeedBonus,HealBonus);
				}
			}
		}
		if( AttackLowLevel == 1 && myself.p_state != 3 && myself.p_state != 10 )
		{
			myself::AddTimerEx(1,7000);
		}
		if( AttackLowHP == 1 && myself::FloatToInt(( ( attacker.hp / attacker.max_hp ) * 100 )) < 30 && gg::Rand(100) < 10 )
		{
			h0 = myself::GetMaxHateInfo(0);
			i0 = 0;
			if( myself::IsNullHateInfo(h0) == 0 )
			{
				if( myself::IsNullCreature(h0.creature) == 0 )
				{
					i0 = 1;
				}
			}
			if( i0 == 1 )
			{
				if( h0.creature != attacker )
				{
					myself::RemoveAllHateInfoIF(0,0);
					if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
					{
						if( myself::GetHateInfoCount() == 0 )
						{
							f0 = 0;
							if( SetHateGroup >= 0 )
							{
								if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
								{
									f0 = ( f0 + SetHateGroupRatio );
								}
							}
							if( attacker.occupation == SetHateOccupation )
							{
								f0 = ( f0 + SetHateOccupationRatio );
							}
							if( SetHateRace == attacker.race )
							{
								f0 = ( f0 + SetHateRaceRatio );
							}
							f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
							myself::AddHateInfo(attacker,myself::FloatToInt(( ( f0 * 100 ) + 300 )),0,1,1);
						}
						else
						{
							f0 = 0;
							if( SetHateGroup >= 0 )
							{
								if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
								{
									f0 = ( f0 + SetHateGroupRatio );
								}
							}
							if( attacker.occupation == SetHateOccupation )
							{
								f0 = ( f0 + SetHateOccupationRatio );
							}
							if( SetHateRace == attacker.race )
							{
								f0 = ( f0 + SetHateRaceRatio );
							}
							f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
							myself::AddHateInfo(attacker,myself::FloatToInt(( f0 * 100 )),0,1,1);
						}
					}
				}
			}
		}
		if( HelpHeroSilhouette != 0 )
		{
			if( myself::FloatToInt(( ( attacker.hp / attacker.max_hp ) * 100 )) < 20 && gg::Rand(100) < 3 && attacker.is_pc == 1 )
			{
				myself::CreateOnePrivateEx(HelpHeroSilhouette,HelpHeroAI,0,0,( myself::FloatToInt(myself.sm.x) + 80 ),( myself::FloatToInt(myself.sm.y) + 80 ),myself::FloatToInt(myself.sm.z),0,0,0,myself::GetIndexFromCreature(myself.sm));
			}
		}
		if( SpecialSkill == 1 )
		{
			if( myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 30 && gg::Rand(100) < 10 )
			{
				if( myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(SpecialSkill)) <= 0 )
				{
					switch(gg::Rand(4))
					{
						case 0:
						{
							myself::Say(myself::MakeFString(1000290,"","","","",""));
							break;
						}
						case 1:
						{
							myself::Say(myself::MakeFString(1000395,"","","","",""));
							break;
						}
						case 2:
						{
							myself::Say(myself::MakeFString(1000396,"","","","",""));
							break;
						}
						case 3:
						{
							myself::Say(myself::MakeFString(1000397,"","","","",""));
							break;
						}
					}
					if( myself::Skill_GetConsumeMP(SpecialSkill) < myself.sm.mp && myself::Skill_GetConsumeHP(SpecialSkill) < myself.sm.hp && myself::Skill_InReuseDelay(SpecialSkill) == 0 )
					{
						myself::AddUseSkillDesire(myself.sm,SpecialSkill,1,1,1000000);
					}
				}
			}
		}
		h0 = myself::GetMaxHateInfo(0);
		i0 = 0;
		if( myself::IsNullHateInfo(h0) == 0 )
		{
			if( myself::IsNullCreature(h0.creature) == 0 )
			{
				i0 = 1;
			}
		}
		if( gg::Rand(100) < 5 && i0 == 1 && ShoutTarget != 0 )
		{
			if( h0.creature == attacker )
			{
				myself::BroadcastScriptEvent(10016,myself::GetIndexFromCreature(attacker),300);
			}
		}
		if( gg::Rand(100) < 5 && SelfExplosion != 0 )
		{
			i0 = myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 ));
			i0 = ( 10 - myself::FloatToInt(( i0 / 10 )) );
			if( i0 > gg::Rand(100) )
			{
				if( myself::Skill_GetConsumeMP(SelfExplosion) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfExplosion) < myself.sm.hp && myself::Skill_InReuseDelay(SelfExplosion) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,SelfExplosion,0,1,1000000);
				}
				if( myself::Skill_GetConsumeMP(SelfExplosion) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfExplosion) < myself.sm.hp && myself::Skill_InReuseDelay(SelfExplosion) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,SelfExplosion,0,1,1000000);
				}
				if( myself::Skill_GetConsumeMP(SelfExplosion) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfExplosion) < myself.sm.hp && myself::Skill_InReuseDelay(SelfExplosion) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,SelfExplosion,0,1,1000000);
				}
			}
		}
		if( IsTransform > 0 )
		{
			switch(myself.sm.param3)
			{
				case 0:
				{
					if( myself.sm.param3 < IsTransform && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 70 && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) > 50 && gg::Rand(100) < 30 )
					{
						myself.c_ai0 = attacker;
						switch(gg::Rand(3))
						{
							case 0:
							{
								myself::Say(myself::MakeFString(1000406,"","","","",""));
								break;
							}
							case 1:
							{
								myself::Say(myself::MakeFString(1000407,"","","","",""));
								break;
							}
							case 2:
							{
								myself::Say(myself::MakeFString(1000408,"","","","",""));
								break;
							}
						}
						i0 = myself::GetDirection(myself.sm);
						myself::CreateOnePrivateEx(step1,myself.sm.ai,0,0,myself::FloatToInt(myself.sm.x),myself::FloatToInt(myself.sm.y),myself::FloatToInt(myself.sm.z),( i0 * 182 ),1000,myself::GetIndexFromCreature(myself.c_ai0),1);
						myself::Despawn();
					}
					break;
				}
				case 1:
				{
					if( myself.sm.param3 < IsTransform && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 50 && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) > 30 && gg::Rand(100) < 20 )
					{
						myself.c_ai0 = attacker;
						switch(gg::Rand(3))
						{
							case 0:
							{
								myself::Say(myself::MakeFString(1000409,"","","","",""));
								break;
							}
							case 1:
							{
								myself::Say(myself::MakeFString(1000410,"","","","",""));
								break;
							}
							case 2:
							{
								myself::Say(myself::MakeFString(1000411,"","","","",""));
								break;
							}
						}
						i0 = myself::GetDirection(myself.sm);
						myself::CreateOnePrivateEx(step2,myself.sm.ai,0,0,myself::FloatToInt(myself.sm.x),myself::FloatToInt(myself.sm.y),myself::FloatToInt(myself.sm.z),( i0 * 182 ),1000,myself::GetIndexFromCreature(myself.c_ai0),2);
						myself::Despawn();
					}
					break;
				}
				case 2:
				{
					if( myself.sm.param3 < IsTransform && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 30 && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) > 5 && gg::Rand(100) < 10 )
					{
						myself.c_ai0 = attacker;
						switch(gg::Rand(3))
						{
							case 0:
							{
								myself::Say(myself::MakeFString(1000412,"","","","",""));
								break;
							}
							case 1:
							{
								myself::Say(myself::MakeFString(1000413,"","","","",""));
								break;
							}
							case 2:
							{
								myself::Say(myself::MakeFString(1000414,"","","","",""));
								break;
							}
						}
						i0 = myself::GetDirection(myself.sm);
						myself::CreateOnePrivateEx(step3,myself.sm.ai,0,0,myself::FloatToInt(myself.sm.x),myself::FloatToInt(myself.sm.y),myself::FloatToInt(myself.sm.z),( i0 * 182 ),1000,myself::GetIndexFromCreature(myself.c_ai0),3);
						myself::Despawn();
					}
					break;
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage,h0,f0,i0)
	{
		if( AttackLowHP == 1 && myself::FloatToInt(( ( attacker.hp / attacker.max_hp ) * 100 )) < 30 && gg::Rand(100) < 3 )
		{
			h0 = myself::GetMaxHateInfo(0);
			i0 = 0;
			if( myself::IsNullHateInfo(h0) == 0 )
			{
				if( myself::IsNullCreature(h0.creature) == 0 )
				{
					i0 = 1;
				}
			}
			if( i0 == 1 )
			{
				if( h0.creature != attacker )
				{
					myself::RemoveAllHateInfoIF(0,0);
					if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
					{
						if( myself::GetHateInfoCount() == 0 )
						{
							f0 = 0;
							if( SetHateGroup >= 0 )
							{
								if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
								{
									f0 = ( f0 + SetHateGroupRatio );
								}
							}
							if( attacker.occupation == SetHateOccupation )
							{
								f0 = ( f0 + SetHateOccupationRatio );
							}
							if( SetHateRace == attacker.race )
							{
								f0 = ( f0 + SetHateRaceRatio );
							}
							f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
							myself::AddHateInfo(attacker,myself::FloatToInt(( ( f0 * 100 ) + 300 )),0,1,1);
						}
						else
						{
							f0 = 0;
							if( SetHateGroup >= 0 )
							{
								if( myself::IsInCategory(SetHateGroup,attacker.occupation) )
								{
									f0 = ( f0 + SetHateGroupRatio );
								}
							}
							if( attacker.occupation == SetHateOccupation )
							{
								f0 = ( f0 + SetHateOccupationRatio );
							}
							if( SetHateRace == attacker.race )
							{
								f0 = ( f0 + SetHateRaceRatio );
							}
							f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
							myself::AddHateInfo(attacker,myself::FloatToInt(( f0 * 100 )),0,1,1);
						}
					}
				}
			}
		}
		if( AttackLowLevel == 1 && myself.p_state != 3 && myself.p_state != 10 )
		{
			myself::AddTimerEx(1,7000);
		}
		super;
	}

	EventHandler SEE_CREATURE(creature,i0)
	{
		if( creature.is_pc == 0 && myself::IsInCategory(11,creature.npc_class_id) == 0 )
		{
			return;
		}
		if( myself.sm.alive == 0 )
		{
			return;
		}
		if( SSQLoserTeleport != 0 )
		{
			if( creature.builder_level == 0 )
			{
				if( SSQLoserTeleport != 1 && SSQLoserTeleport != 2 )
				{
					myself::Say("Bug: Entered wrong price in the SSQLoserTeleport. Price = " + SSQLoserTeleport);
				}
				else if( myself::GetSSQStatus() == 3 )
				{
					i0 = myself::GetSSQSealOwner(SSQLoserTeleport);
					if( creature.is_pc == 1 )
					{
						if( i0 == 0 && myself::GetSSQPart(creature) == 0 )
						{
							myself::RemoveAttackDesire(creature.id);
							myself::InstantTeleport(creature,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 1 && myself::GetSSQPart(creature) != 1 )
						{
							myself::RemoveAttackDesire(creature.id);
							myself::InstantTeleport(creature,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 2 && myself::GetSSQPart(creature) != 2 )
						{
							myself::RemoveAttackDesire(creature.id);
							myself::InstantTeleport(creature,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
					else if( myself::IsInCategory(11,creature.npc_class_id) == 1 )
					{
						if( i0 == 0 && myself::GetSSQPart(creature.master) == 0 )
						{
							myself::RemoveAttackDesire(creature.master.id);
							myself::InstantTeleport(creature.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 1 && myself::GetSSQPart(creature.master) != 1 )
						{
							myself::RemoveAttackDesire(creature.master.id);
							myself::InstantTeleport(creature.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 2 && myself::GetSSQPart(creature.master) != 2 )
						{
							myself::RemoveAttackDesire(creature.master.id);
							myself::InstantTeleport(creature.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
				}
				else if( myself::GetSSQStatus() == 1 )
				{
					i0 = myself::GetSSQSealOwner(SSQLoserTeleport);
					if( creature.is_pc == 1 )
					{
						if( myself::GetSSQPart(creature) == 0 )
						{
							myself::RemoveAttackDesire(creature.id);
							myself::InstantTeleport(creature,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
					else if( myself::IsInCategory(11,creature.npc_class_id) == 1 )
					{
						if( myself::GetSSQPart(creature.master) == 0 )
						{
							myself::RemoveAttackDesire(creature.master.id);
							myself::InstantTeleport(creature.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
				}
			}
		}
		if( AttackLowLevel == 1 )
		{
			if( ( myself.p_state == 3 || myself.p_state == 10 ) && myself::DistFromMe(creature) < 300 )
			{
				if( ( creature.level + 15 ) < myself.sm.level )
				{
					myself::RemoveAllHateInfoIF(0,0);
					if( creature.is_pc != 0 || myself::IsInCategory(11,creature.npc_class_id) )
					{
						myself::AddHateInfo(creature,( 7 * 100 ),0,1,1);
					}
				}
				myself::AddTimerEx(1,7000);
			}
		}
		super;
	}

	EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0)
	{
		if( SSQLoserTeleport != 0 )
		{
			if( speller.builder_level == 0 )
			{
				if( SSQLoserTeleport != 1 && SSQLoserTeleport != 2 )
				{
					myself::Say("Bug: Entered wrong price in the SSQLoserTeleport. Price = " + SSQLoserTeleport);
				}
				else if( myself::GetSSQStatus() == 3 )
				{
					i0 = myself::GetSSQSealOwner(SSQLoserTeleport);
					if( speller.is_pc == 1 )
					{
						if( i0 == 0 && myself::GetSSQPart(speller) == 0 )
						{
							myself::RemoveAttackDesire(speller.id);
							myself::InstantTeleport(speller,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 1 && myself::GetSSQPart(speller) != 1 )
						{
							myself::RemoveAttackDesire(speller.id);
							myself::InstantTeleport(speller,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 2 && myself::GetSSQPart(speller) != 2 )
						{
							myself::RemoveAttackDesire(speller.id);
							myself::InstantTeleport(speller,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
					else if( myself::IsInCategory(11,speller.npc_class_id) == 1 )
					{
						if( i0 == 0 && myself::GetSSQPart(speller.master) == 0 )
						{
							myself::RemoveAttackDesire(speller.master.id);
							myself::InstantTeleport(speller.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 1 && myself::GetSSQPart(speller.master) != 1 )
						{
							myself::RemoveAttackDesire(speller.master.id);
							myself::InstantTeleport(speller.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
						else if( i0 == 2 && myself::GetSSQPart(speller.master) != 2 )
						{
							myself::RemoveAttackDesire(speller.master.id);
							myself::InstantTeleport(speller.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
				}
				else if( myself::GetSSQStatus() == 1 )
				{
					i0 = myself::GetSSQSealOwner(SSQLoserTeleport);
					if( speller.is_pc == 1 )
					{
						if( myself::GetSSQPart(speller) == 0 )
						{
							myself::RemoveAttackDesire(speller.id);
							myself::InstantTeleport(speller,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
					else if( myself::IsInCategory(11,speller.npc_class_id) == 1 )
					{
						if( myself::GetSSQPart(speller.master) == 0 )
						{
							myself::RemoveAttackDesire(speller.master.id);
							myself::InstantTeleport(speller.master,SSQTelPosX,SSQTelPosY,SSQTelPosZ);
							return;
						}
					}
				}
			}
		}
		if( ( speller.level + 15 ) < myself.sm.level )
		{
			myself::RemoveAllHateInfoIF(0,0);
			if( myself::Skill_GetEffectPoint(skill_name_id) > 0 )
			{
				if( myself.p_state == 3 && myself.top_desire_target == speller )
				{
					i0 = myself::Skill_GetEffectPoint(skill_name_id);
					f0 = 0;
					if( SetHateGroup >= 0 )
					{
						if( myself::IsInCategory(SetHateGroup,speller.occupation) )
						{
							f0 = ( f0 + SetHateGroupRatio );
						}
					}
					if( speller.occupation == SetHateOccupation )
					{
						f0 = ( f0 + SetHateOccupationRatio );
					}
					if( SetHateRace == speller.race )
					{
						f0 = ( f0 + SetHateRaceRatio );
					}
					f0 = ( ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) ) );
					myself::AddHateInfo(speller,myself::FloatToInt(( f0 * 150 )),0,1,1);
				}
				else
				{
					i0 = myself::Skill_GetEffectPoint(skill_name_id);
					f0 = 0;
					if( SetHateGroup >= 0 )
					{
						if( myself::IsInCategory(SetHateGroup,speller.occupation) )
						{
							f0 = ( f0 + SetHateGroupRatio );
						}
					}
					if( speller.occupation == SetHateOccupation )
					{
						f0 = ( f0 + SetHateOccupationRatio );
					}
					if( SetHateRace == speller.race )
					{
						f0 = ( f0 + SetHateRaceRatio );
					}
					f0 = ( ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) ) );
					myself::AddHateInfo(speller,myself::FloatToInt(( f0 * 75 )),0,1,1);
				}
			}
		}
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,c0)
	{
		if( gg::Rand(100) < 50 && script_event_arg1 == 10016 )
		{
			myself::RemoveAllHateInfoIF(0,0);
			c0 = myself::GetCreatureFromIndex(script_event_arg2);
			if( c0.is_pc != 0 || myself::IsInCategory(11,c0.npc_class_id) )
			{
				myself::AddHateInfo(c0,( 2 * 100 ),0,1,1);
			}
		}
		if( script_event_arg1 == 10020 )
		{
			c0 = myself::GetCreatureFromIndex(script_event_arg2);
			if( myself::IsNullCreature(c0) == 0 )
			{
				myself::LookNeighbor(500);
			}
		}
	}

	EventHandler USE_SKILL_FINISHED(target,skill_name_id)
	{
		if( SelfExplosion != 0 )
		{
			if( skill_name_id == SelfExplosion )
			{
				myself::Suicide();
			}
		}
	}

}
