if(Get_Skill(obj_pid(attack_weapon)) == SKILL_UNARMED_COMBAT) or (Get_Skill(obj_pid(attack_weapon)) == SKILL_MELEE) then
begin
target_special_flag := 0;
attacker_special_flag := 0;
random_roll := random(1,100);
crit_chance := get_critter_extra_stat(attacker, STAT_crit_chance) + get_critter_base_stat(attacker, STAT_crit_chance) + get_sfall_global_int("critic_4");
attacker_special_flag := 256;
target_special_flag := 256;
attacker_melee_damage := (get_critter_extra_stat(attacker, STAT_melee_dmg) + get_critter_base_stat(attacker, STAT_melee_dmg));
maximum := attacker_melee_damage + Get_Max(obj_pid(attack_weapon)) + get_sfall_global_int("melee_04");
minimum := Get_Min(obj_pid(attack_weapon)) + get_sfall_global_int("ranged_4");
float_msg(dude_obj, "Damage Fired" + " " + obj_pid(attack_weapon) + " " + Get_Min(obj_pid(attack_weapon)) + " " + Get_Max(obj_pid(attack_weapon)), 3);
random_damage := random(minimum, maximum);
if(random(1,100) > (100 - crit_chance)) then
begin
random_damage := random_damage * 2;
attacker_special_flag := attacker_special_flag + 512;
target_special_flag := target_special_flag + 512;
knockdown_incapacitate := random(1,100);
if(knockdown_incapacitate >= 100 - (get_sfall_global_int("knock_04")))then
begin
if(obj_pid(target) != MYRON) and (obj_pid(target) != MARCUS) and (obj_pid(target) != CASSIDY) and (obj_pid(target) != SULIK) and (obj_pid(target) != LENNY)and (obj_pid(target) != CYBERDOG) and (obj_pid(target) != GORIS) and (obj_pid(target) != ROBOBRAIN) and (obj_pid(target) != VIC) and (obj_pid(target) != DAVIN) and (obj_pid(target) != MIRIA) and (obj_pid(target) != KLINT) and (obj_pid(target) != DOGMEAT) and (obj_pid(target) != K9) and (obj_pid(target) != DIAGO) and (obj_pid(target) != MERIS) and (obj_pid(target) != LENNY_HUMAN) and (obj_pid(target) != ROBOBRAIN_SKYNET) and (target != dude_obj) then
begin
target_special_flag := target_special_flag + 2;
sfall := 1;
end
else
if (has_fake_perk(Imoble) != 4) and ((obj_pid(target) == MYRON) or (obj_pid(target) == MARCUS) or (obj_pid(target) == CASSIDY) or (obj_pid(target) == SULIK) or (obj_pid(target) == LENNY)or (obj_pid(target) == CYBERDOG) or (obj_pid(target) == GORIS) or (obj_pid(target) == ROBOBRAIN) or (obj_pid(target) == VIC) or (obj_pid(target) == DAVIN) or (obj_pid(target) == MIRIA) or (obj_pid(target) == KLINT) or (obj_pid(target) == DOGMEAT) or (obj_pid(target) == K9) or (obj_pid(target) == DIAGO) or (obj_pid(target) == MERIS) or (obj_pid(target) == LENNY_HUMAN) or (obj_pid(target) == ROBOBRAIN_SKYNET)) then
begin
target_special_flag := target_special_flag + 2;
sfall := 1;
end
else
if (not(has_fake_perk(Imoble) >= 3)) and (target == dude_obj) then
begin
target_special_flag := target_special_flag + 2;
sfall := 1;
end
end
end
if(knockdown_incapacitate >= 100 - (get_sfall_global_int("knock_04")))then
begin
if(obj_pid(target) != MYRON) and (obj_pid(target) != MARCUS) and (obj_pid(target) != CASSIDY) and (obj_pid(target) != SULIK) and (obj_pid(target) != LENNY)and (obj_pid(target) != CYBERDOG) and (obj_pid(target) != GORIS) and (obj_pid(target) != ROBOBRAIN) and (obj_pid(target) != VIC) and (obj_pid(target) != DAVIN) and (obj_pid(target) != MIRIA) and (obj_pid(target) != KLINT) and (obj_pid(target) != DOGMEAT) and (obj_pid(target) != K9) and (obj_pid(target) != DIAGO) and (obj_pid(target) != MERIS) and (obj_pid(target) != LENNY_HUMAN) and (obj_pid(target) != ROBOBRAIN_SKYNET) and (target != dude_obj) then
begin
target_special_flag := target_special_flag + 2;
sfall := 1;
end
else
if (has_fake_perk(Imoble) != 2) and ((obj_pid(target) == MYRON) or (obj_pid(target) == MARCUS) or (obj_pid(target) == CASSIDY) or (obj_pid(target) == SULIK) or (obj_pid(target) == LENNY)or (obj_pid(target) == CYBERDOG) or (obj_pid(target) == GORIS) or (obj_pid(target) == ROBOBRAIN) or (obj_pid(target) == VIC) or (obj_pid(target) == DAVIN) or (obj_pid(target) == MIRIA) or (obj_pid(target) == KLINT) or (obj_pid(target) == DOGMEAT) or (obj_pid(target) == K9) or (obj_pid(target) == DIAGO) or (obj_pid(target) == MERIS) or (obj_pid(target) == LENNY_HUMAN) or (obj_pid(target) == ROBOBRAIN_SKYNET)) then
begin
target_special_flag := target_special_flag + 2;
sfall := 1;
end
else
if (not(has_fake_perk(Imoble) >= 1)) and (target == dude_obj) then
begin
target_special_flag := target_special_flag + 2;
sfall := 1;
end
end
if(target == dude_obj) then
begin
random_damage := (random_damage - (get_critter_extra_stat(dude_obj, STAT_dmg_thresh) + get_critter_base_stat(dude_obj, STAT_dmg_thresh)));
random_damage := (random_damage - (random_damage * ((get_critter_extra_stat(dude_obj, STAT_dmg_resist) + get_critter_base_stat(dude_obj, STAT_dmg_resist)) / 100)));
end
else
begin
random_damage := (random_damage - (get_critter_extra_stat(target, STAT_dmg_thresh) + get_critter_base_stat(target, STAT_dmg_thresh)));
random_damage := (random_damage - (random_damage * ((get_critter_extra_stat(target, STAT_dmg_resist) + get_critter_base_stat(target, STAT_dmg_resist)) / 100)));
end
if(random_damage > 250) then
begin
display_msg("Damage Fired" + " " + obj_pid(attack_weapon) + " " + Get_Min(obj_pid(attack_weapon)) + " " + Get_Max(obj_pid(attack_weapon)));
end
set_sfall_return(random_damage);
set_sfall_return(0);
set_sfall_return(target_special_flag);
set_sfall_return(attacker_special_flag);
end
end