@LabelIndex 114647
@StringIndex 14104
class 0 inzone_raid_boss_standard : inzone_combat_monster {
parameter:
	string	AreaName = "";
	int	near_kamaloka = 0;
	int	BadgeName = 13002;
	int	BadgeNumber = 1;

handler:
	EventHandler CREATED() {
		myself.i_ai0 = 0;
		myself.i_quest0 = 0;
		myself.i_ai4 = 0;
		myself.i_quest4 = 0;
		super;
	}

	EventHandler ATTACKED(attacker,damage,h0,i0,skill_name_id) {
		if( attacker.is_pc == 1 || myself::IsInCategory(12,attacker.class_id) == 1 ) {
			myself.i_quest4 = myself::GetCurrentTick();
		}
		if( myself.i_ai4 == 0 ) {
			if( myself.i_ai0 == 0 ) {
				myself::AddAttackDesire(attacker,1,10);
				myself::AddTimerEx(1001,( 60 * 1000 ));
				gg::Area_SetOnOffEx(AreaName,1,myself::InstantZone_GetId());
				myself.i_ai0 = 1;
				myself.i_ai4 = 1;
			} else if( myself.i_ai0 == 1 ) {
				myself::AddTimerEx(1001,( 60 * 1000 ));
				gg::Area_SetOnOffEx(AreaName,1,myself::InstantZone_GetId());
				myself.i_ai4 = 1;
			}
		}
		if( gg::FloatToInt(myself.sm.hp) == 0 && myself.i_quest0 == 0 ) {
			myself.i_quest0 = 1;
			myself::InstantZone_MarkRestriction();
		}
		super;
	}

	EventHandler PARTY_ATTACKED(attacker,private,damage,f0) {
		if( attacker.is_pc == 1 || myself::IsInCategory(12,attacker.class_id) == 0 ) {
			myself.i_quest4 = myself::GetCurrentTick();
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0,i1,i10,i11,c0,party0,h0,private,maker0) {
		if( timer_id == 1001 ) {
			i0 = ( myself::GetCurrentTick() - myself.i_quest4 );
			if( i0 > 60 ) {
				myself::BroadcastScriptEvent(4,0,4000);
				myself::InstantZone_Finish(5);
				myself::Despawn();
			}
			myself::AddTimerEx(1001,( 60 * 1000 ));
		}
		super;
	}

	EventHandler MY_DYING(i0,i1,i2,c0,c1,party0) {
		myself::EffectMusic(myself.sm,4000,"RM01_S");
		myself::InstantZone_MarkRestriction();
		myself::InstantZone_Finish(5);
		gg::Area_SetOnOffEx(AreaName,0,myself::InstantZone_GetId());
		if( near_kamaloka == 1 ) {
			c1 = myself::GetLastAttacker();
			if( myself::IsNullCreature(c1) ) {
			} else if( c1.master ) {
				c1 = c1.master;
			}
			i1 = gg::Party_GetCount(c1);
			i2 = myself::InstantZone_GetId();
			for(i0 = 0; i0 < i1; i0++) {
				c0 = gg::Party_GetCreature(c1,i0);
				if( c0.instant_zone_id == i2 ) {
					myself::GiveItem1(c0,BadgeName,BadgeNumber);
				}
			}
		}
	}

}
