@LabelIndex 36763
@StringIndex 0
class 0 wizard_corpse_necro_summon : wizard_corpse_necro {
parameter:
	int	ClearCorpse = 272039937;
	int	SummonPrivate = 1020130;
	string	SummonPrivateAI = "warrior";

handler:
	EventHandler CREATED() {
		myself::AddTimerEx(3456,5000);
		super;
	}

	EventHandler SEE_CREATURE(creature,h0,i0) {
		if( creature.alive == 0 && creature.is_pc == 0 && gg::Rand(100) < 30 && myself::DistFromMe(creature) < 200 ) {
			h0 = myself::GetMaxHateInfo(0);
			i0 = 0;
			if( myself::IsNullHateInfo(h0) == 0 ) {
				if( myself::IsNullCreature(h0.creature) == 0 ) {
					i0 = 1;
				}
			}
			if( i0 == 1 ) {
				if( myself::IsNullCreature(h0.creature) == 0 ) {
					myself::UseSkill(creature,ClearCorpse);
					myself::CreateOnePrivateEx(SummonPrivate,SummonPrivateAI,0,0,gg::FloatToInt(creature.x),gg::FloatToInt(creature.y),gg::FloatToInt(creature.z),0,1000,gg::GetIndexFromCreature(h0.creature),0);
				}
			}
			return;
		}
		if( creature.is_pc == 0 && myself::IsInCategory(12,creature.class_id) == 0 ) {
			return;
		} else {
			super;
		}
	}

	EventHandler ATTACKED(attacker,damage,h0,f0,i0,i1,f0) {
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			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::AddAttackDesire(attacker,1,( f0 * 100 ));
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 3456 ) {
			myself::LookNeighbor(200);
			myself::AddTimerEx(3456,5000);
		}
		super;
	}

}
