@LabelIndex 218435
@StringIndex 24697
class 0 fortress_prisoner_i : raid_boss_type1 {
handler:
	EventHandler MY_DYING(always_list,c1,c2,code_info,i1,i2,i3,i4,i9,last_attacker,lparty,member,random1_list,target) {
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		if( gg::HaveMemo(target,511) == 1 ) {
			random1_list::SetInfo(0,target);
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch (code_info.code) {
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(511);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c2 = myself::GetLastAttacker();
						if( c2.master ) {
							c2 = c2.master;
						}
						i3 = 0;
						i1 = gg::Party_GetCount(c2);
						if( i1 <= 0 ) {
							myself::GiveItem1(c2,9797,137);
							myself::SoundEffect(c2,"ItemSound.quest_middle");
						} else {
							for(i2 = 0; i2 < i1; i2++) {
								c1 = gg::Party_GetCreature(c2,i2);
								if( gg::HaveMemo(c1,511) == 1 ) {
									i3++;
								}
							}
							if( i3 > 0 ) {
								i4 = ( 1200 / i3 );
							} else {
								i4 = 1200;
							}
							for(i2 = 0; i2 < i1; i2++) {
								c1 = gg::Party_GetCreature(c2,i2);
								if( gg::HaveMemo(c1,511) == 1 ) {
									myself::GiveItem1(c1,9797,i4);
									myself::SoundEffect(c1,"ItemSound.quest_middle");
								}
							}
						}
					}
					break;
				}
			}
		}
		super;
	}

}
