@LabelIndex 54485
@StringIndex 0
class 0 warrior_physicalspecial_hold : warrior_physicalspecial {
parameter:
	int	HelpCastRange = 400;
	int	DDMagic = 262209537;

handler:
	EventHandler NO_DESIRE() {
		myself::AddMoveToDesire(myself.start_x,myself.start_y,myself.start_z,30);
	}

	EventHandler CREATED() {
		myself::AddMoveToDesire(myself.start_x,myself.start_y,myself.start_z,30);
	}

	EventHandler ATTACKED(attacker,damage,i0,f0) {
		if( myself.p_state != 3 || myself.p_state != 10 ) {
			myself::BroadcastScriptEvent(10001,gg::GetIndexFromCreature(attacker),HelpCastRange);
		}
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			if( myself::DistFromMe(attacker) < 80 ) {
				if( gg::Rand(100) < 33 ) {
					if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 ) {
						myself::AddUseSkillDesire(attacker,PhysicalSpecial,0,0,1000000);
					}
				}
			} else if( myself::Skill_GetConsumeMP(DDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(DDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(DDMagic) == 0 ) {
				myself::AddUseSkillDesire(attacker,DDMagic,0,0,1000000);
			}
		}
		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,0,( f0 * 100 ));
		}
	}

	EventHandler CLAN_ATTACKED(attacker,damage,i0,f0) {
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			if( myself::DistFromMe(attacker) < 80 ) {
				if( gg::Rand(100) < 33 ) {
					if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 ) {
						myself::AddUseSkillDesire(attacker,PhysicalSpecial,0,0,1000000);
					}
				}
			} else if( myself::Skill_GetConsumeMP(DDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(DDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(DDMagic) == 0 ) {
				myself::AddUseSkillDesire(attacker,DDMagic,0,0,1000000);
			}
		}
		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,0,( f0 * 100 ));
		}
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2) {
	}

	EventHandler MOVE_TO_FINISHED(x,y,z) {
		if( x == myself.start_x && y == myself.start_y && z == myself.start_z ) {
			myself::AddDoNothingDesire(40,30);
		} else {
			myself::AddMoveToDesire(myself.start_x,myself.start_y,myself.start_z,30);
		}
	}

	EventHandler ATTACK_FINISHED(target) {
		if( target.alive == 0 && target.is_pc == 0 ) {
			if( myself::IsInCategory(12,target.class_id) != 0 ) {
				if( myself::IsNullCreature(target.master) == 0 && myself::DistFromMe(target.master) < 80 ) {
					if( gg::Rand(100) < 33 ) {
						if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 ) {
							myself::AddUseSkillDesire(target.master,PhysicalSpecial,0,0,1000000);
						}
					}
				} else if( myself::Skill_GetConsumeMP(DDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(DDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(DDMagic) == 0 ) {
					myself::AddUseSkillDesire(target.master,DDMagic,0,0,1000000);
				}
			}
			if( target.master.is_pc != 0 || myself::IsInCategory(12,target.master.class_id) ) {
				myself::AddAttackDesire(target.master,0,( 1 * 50 ));
			}
		}
	}

	EventHandler USE_SKILL_FINISHED(target,skill_name_id) {
		if( target.alive == 0 && target.is_pc == 0 ) {
			if( myself::IsInCategory(12,target.class_id) != 0 ) {
				if( myself::IsNullCreature(target.master) == 0 && myself::DistFromMe(target.master) < 80 ) {
					if( gg::Rand(100) < 33 ) {
						if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 ) {
							myself::AddUseSkillDesire(target.master,PhysicalSpecial,0,0,1000000);
						}
					}
				} else if( myself::Skill_GetConsumeMP(DDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(DDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(DDMagic) == 0 ) {
					myself::AddUseSkillDesire(target.master,DDMagic,0,0,1000000);
				}
			}
			if( target.master.is_pc != 0 || myself::IsInCategory(12,target.master.class_id) ) {
				myself::AddAttackDesire(target.master,0,( 1 * 50 ));
			}
		}
	}

	EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0) {
		if( myself::Skill_GetEffectPoint(skill_name_id) > 0 ) {
			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 * 1 ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * 1 ) / ( myself.sm.level + 7 ) ) ) );
			myself::AddAttackDesire(speller,0,( f0 * 150 ));
		}
	}

}
