@LabelIndex 33808
@StringIndex 6373
class 0 ssq_event_slow_type : ssq_event_basic_warrior {
parameter:
	int	DDMagic = 262209537;
	int	IsStrong = 0;

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

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

	EventHandler ATTACKED(attacker,damage,i0,i1,i2) {
		if( myself::InMyTerritory(attacker) == 0 ) {
			return;
		}
		i1 = 1;
		i2 = 100;
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			myself::AddAttackDesire(attacker,1,( i1 * i2 ));
		}
		if( IsStrong == 1 ) {
			i0 = 40;
		} else {
			i0 = 3;
		}
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			if( myself::IsNullCreature(myself.top_desire_target) == 0 ) {
				if( gg::Rand(100) < i0 && myself.top_desire_target == attacker ) {
					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,1,1000000);
					}
				}
			}
		}
		if( gg::Rand(100) < 10 && attacker.is_pc == 1 && myself::IsMyBossAlive() ) {
			gg::SendScriptEvent(myself.boss,10012,gg::GetIndexFromCreature(myself.sm));
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage) {
		if( gg::Rand(100) < 3 && attacker.is_pc == 1 && myself::IsMyBossAlive() ) {
			gg::SendScriptEvent(myself.boss,10012,gg::GetIndexFromCreature(myself.sm));
		}
		super;
	}

	EventHandler SEE_CREATURE(creature) {
		if( myself.p_state != 3 ) {
			if( creature.is_pc == 0 && myself::IsInCategory(12,creature.class_id) == 0 ) {
				return;
			}
			if( myself::GetLifeTime() > SeeCreatureAttackerTime && myself::InMyTerritory(myself.sm) ) {
				myself::AddAttackDesire(creature,1,200);
			}
		}
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,c1) {
		c1 = gg::GetCreatureFromIndex(script_event_arg3);
		if( myself::IsNullCreature(c1) == 0 ) {
			if( myself::InMyTerritory(c1) ) {
				if( script_event_arg1 == 10007 ) {
					if( myself.p_state != 3 && myself.p_state != 10 ) {
						myself::AddMoveToDesire(myself.sm.param1,script_event_arg2,gg::FloatToInt(myself.sm.z),50);
					}
				}
				if( script_event_arg1 == 10013 ) {
					if( myself::IsNullCreature(myself.top_desire_target) == 0 && myself.top_desire_target.is_pc == 1 ) {
						myself::BroadcastScriptEvent(10014,gg::GetIndexFromCreature(myself.top_desire_target),800);
						switch(gg::Rand(3)) {
							case 0: {
								myself::Say(gg::MakeFString(1000291,myself.top_desire_target.name,"","","",""));
								break;
							}
							case 1: {
								myself::Say(gg::MakeFString(1000398,myself.top_desire_target.name,"","","",""));
								break;
							}
							case 2: {
								myself::Say(gg::MakeFString(1000399,myself.top_desire_target.name,"","","",""));
								break;
							}
						}
					}
				}
			}
		}
	}

	EventHandler MY_DYING(c0,c1,party0,i1,i2,i3) {
		myself::BroadcastScriptEvent(10008,myself.sm.param3,1500);
		if( myself.i_ai1 == 1 ) {
			i3 = 3;
			c0 = myself::GetLastAttacker();
			if( myself::IsNullCreature(c0) == 0 ) {
				if( c0.is_pc == 0 ) {
					c0 = c0.master;
				}
				if( myself::IsNullCreature(c0) == 0 ) {
					c0 = gg::Party_GetLeader(c0);
				}
				party0 = gg::GetPartyFromEventRoom(RoomIndex,SSQPart);
				c1 = myself::GetLeaderOfParty(party0);
				if( myself::IsNullCreature(c0) == 0 && myself::IsNullCreature(c1) == 0 ) {
					if( c0 == c1 ) {
						if( gg::HaveMemo(c0,505) ) {
							i1 = ( i3 + gg::FloatToInt(( ( i3 * 25 ) / 100 )) );
							if( myself::IsInCategory(2,c0.occupation) ) {
								if( myself::DistFromMe(c0) < 40 ) {
									i1 = ( i1 + gg::FloatToInt(( ( i1 * 30 ) / 100 )) );
								}
							} else if( myself::DistFromMe(c0) < 80 ) {
								i1 = ( i1 + gg::FloatToInt(( ( i1 * 30 ) / 100 )) );
							}
							if( myself::IsInCategory(2,c0.occupation) ) {
								if( gg::Rand(2) > 0 ) {
									i1 = ( i1 + gg::FloatToInt(( ( i1 * 7 ) / 100 )) );
								} else {
									i1 = ( i1 - gg::FloatToInt(( ( i1 * 15 ) / 100 )) );
								}
							} else if( gg::Rand(2) > 0 ) {
								i1 = ( i1 + gg::FloatToInt(( ( i1 * 15 ) / 100 )) );
							} else {
								i1 = ( i1 - gg::FloatToInt(( ( i1 * 7 ) / 100 )) );
							}
							myself::ShowSysMsgToParty2(party0,2,1381,3,5901,1,i1);
							myself::GiveItem1(c0,5901,i1);
						}
					}
				}
			}
		} else if( IsStrong == 0 ) {
			i3 = 10;
			c0 = myself::GetLastAttacker();
			if( myself::IsNullCreature(c0) == 0 ) {
				if( c0.is_pc == 0 ) {
					c0 = c0.master;
				}
				if( myself::IsNullCreature(c0) == 0 ) {
					c0 = gg::Party_GetLeader(c0);
				}
				party0 = gg::GetPartyFromEventRoom(RoomIndex,SSQPart);
				c1 = myself::GetLeaderOfParty(party0);
				if( myself::IsNullCreature(c0) == 0 && myself::IsNullCreature(c1) == 0 ) {
					if( c0 == c1 ) {
						if( gg::HaveMemo(c0,505) ) {
							i1 = ( i3 + gg::FloatToInt(( ( i3 * 25 ) / 100 )) );
							if( myself::IsInCategory(2,c0.occupation) ) {
								if( myself::DistFromMe(c0) < 40 ) {
									i1 = ( i1 + gg::FloatToInt(( ( i1 * 30 ) / 100 )) );
								}
							} else if( myself::DistFromMe(c0) < 80 ) {
								i1 = ( i1 + gg::FloatToInt(( ( i1 * 30 ) / 100 )) );
							}
							if( myself::IsInCategory(2,c0.occupation) ) {
								if( gg::Rand(2) > 0 ) {
									i1 = ( i1 + gg::FloatToInt(( ( i1 * 7 ) / 100 )) );
								} else {
									i1 = ( i1 - gg::FloatToInt(( ( i1 * 15 ) / 100 )) );
								}
							} else if( gg::Rand(2) > 0 ) {
								i1 = ( i1 + gg::FloatToInt(( ( i1 * 15 ) / 100 )) );
							} else {
								i1 = ( i1 - gg::FloatToInt(( ( i1 * 7 ) / 100 )) );
							}
							myself::ShowSysMsgToParty2(party0,2,1381,3,5901,1,i1);
							myself::GiveItem1(c0,5901,i1);
						}
					}
				}
			}
		} else {
			i3 = 15;
			c0 = myself::GetLastAttacker();
			if( myself::IsNullCreature(c0) == 0 ) {
				if( c0.is_pc == 0 ) {
					c0 = c0.master;
				}
				if( myself::IsNullCreature(c0) == 0 ) {
					c0 = gg::Party_GetLeader(c0);
				}
				party0 = gg::GetPartyFromEventRoom(RoomIndex,SSQPart);
				c1 = myself::GetLeaderOfParty(party0);
				if( myself::IsNullCreature(c0) == 0 && myself::IsNullCreature(c1) == 0 ) {
					if( c0 == c1 ) {
						if( gg::HaveMemo(c0,505) ) {
							i1 = ( i3 + gg::FloatToInt(( ( i3 * 25 ) / 100 )) );
							if( myself::IsInCategory(2,c0.occupation) ) {
								if( myself::DistFromMe(c0) < 40 ) {
									i1 = ( i1 + gg::FloatToInt(( ( i1 * 30 ) / 100 )) );
								}
							} else if( myself::DistFromMe(c0) < 80 ) {
								i1 = ( i1 + gg::FloatToInt(( ( i1 * 30 ) / 100 )) );
							}
							if( myself::IsInCategory(2,c0.occupation) ) {
								if( gg::Rand(2) > 0 ) {
									i1 = ( i1 + gg::FloatToInt(( ( i1 * 7 ) / 100 )) );
								} else {
									i1 = ( i1 - gg::FloatToInt(( ( i1 * 15 ) / 100 )) );
								}
							} else if( gg::Rand(2) > 0 ) {
								i1 = ( i1 + gg::FloatToInt(( ( i1 * 15 ) / 100 )) );
							} else {
								i1 = ( i1 - gg::FloatToInt(( ( i1 * 7 ) / 100 )) );
							}
							myself::ShowSysMsgToParty2(party0,2,1381,3,5901,1,i1);
							myself::GiveItem1(c0,5901,i1);
						}
					}
				}
			}
		}
	}

}
