class 1 wizard_ag_corpse_vampire_basic : wizard_corpse_vampire_basic
{
handler:
	EventHandler SEE_CREATURE(creature,i0)
	{
		if( creature.is_pc == 0 && myself::IsInCategory(11,creature.npc_class_id) == 0 )
		{
			super;
			return;
		}
		if( myself::GetLifeTime() > 7 && myself::InMyTerritory(myself.sm) && myself::GetHateInfoCount() == 0 )
		{
			if( myself::DistFromMe(creature) > 100 )
			{
				if( myself::Skill_GetConsumeMP(W_LongRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_LongRangeDDMagic) < myself.sm.hp )
				{
					if( myself::Skill_InReuseDelay(W_LongRangeDDMagic) == 0 )
					{
						myself::AddUseSkillDesire(creature,W_LongRangeDDMagic,0,1,1000000);
					}
					else
					{
						myself::AddUseSkillDesire(creature,W_LongRangeDDMagic,0,1,1000000);
					}
				}
				else
				{
					myself.i_ai0 = 1;
					myself::AddAttackDesire(creature,1,1000);
				}
			}
			else if( myself::Skill_GetConsumeMP(W_ShortRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_ShortRangeDDMagic) < myself.sm.hp )
			{
				if( myself::Skill_InReuseDelay(W_ShortRangeDDMagic) == 0 )
				{
					myself::AddUseSkillDesire(creature,W_ShortRangeDDMagic,0,1,1000000);
				}
				else
				{
					myself::AddUseSkillDesire(creature,W_ShortRangeDDMagic,0,1,1000000);
				}
			}
			else
			{
				myself.i_ai0 = 1;
				myself::AddAttackDesire(creature,1,1000);
			}
			if( creature.is_pc == 0 && myself::IsInCategory(11,creature.npc_class_id) == 0 )
			{
				return;
			}
			i0 = 0;
			if( SetAggressiveTime == -1 )
			{
				if( myself::GetLifeTime() >= ( gg::Rand(5) + 3 ) && myself::InMyTerritory(myself.sm) )
				{
					i0 = 1;
				}
			}
			else if( SetAggressiveTime == 0 )
			{
				if( myself::InMyTerritory(myself.sm) )
				{
					i0 = 1;
				}
			}
			else if( myself::GetLifeTime() > ( SetAggressiveTime + gg::Rand(4) ) && myself::InMyTerritory(myself.sm) )
			{
				i0 = 1;
			}
			if( myself::GetLifeTime() > -1 && myself::InMyTerritory(myself.sm) )
			{
				i0 = 1;
			}
			if( myself::GetHateInfoCount() == 0 && i0 == 1 )
			{
				myself::AddHateInfo(creature,300,0,1,1);
			}
			else
			{
				myself::AddHateInfo(creature,100,0,1,1);
			}
			super;
		}
	}

}
