Перейти к контенту

Сообщество Мапперов


Рекомендуемые сообщения

Вылетает при первом разговоре с сидоровичем, как заканчиваю.

--------------------------------------------------------------------------------------------------------
-- Trader Factions - ABC Mod by Speed aka Cabrobro.
--------------------------------------------------------------------------------------------------------

function wish_pre(trader, actor)
   if db.storage[db.actor:id()].pstor["wish_zombied"] == "yes" then
        return true 
    else
        return false
    end
end
function wish_pre_money(trader, actor)
   if db.actor:money() >= 15000 then return true end
return false
end
function wish_give_med(trader, actor)
   db.storage[db.actor:id()].pstor["wish_zombied"] = "no"
   db.storage[db.actor:id()].pstor["count_zombie "] = 0
   db.actor:set_character_community("actor", 0, 0)
   dialogs.relocate_money(actor, 15000, "out")
   level.remove_pp_effector (1986)
   level.remove_pp_effector (1987)
   level.add_pp_effector ("deadcity_wake1.ppe", 1976, false)
   dialogs.break_dialog(trader, actor)
end

function factions_repair_checkduty_r(trader, actor)
   if relation_registry.community_goodwill ("dolg", db.actor:id ()) < 0 then
        local chkgoodwill = relation_registry.community_goodwill("dolg",  db.actor:id())
        if chkgoodwill > -100 and db.actor:money() >= 5000 then return true end
        if chkgoodwill < -100 and chkgoodwill >= -1000 and db.actor:money() >= 10000 then return true end
        if chkgoodwill < -1000 and db.actor:money() >= 25000 then return true end
   end
return false
end

function factions_repair_checkduty_j(trader, actor)
local whatami = db.actor:character_community()
   if (relation_registry.community_goodwill ("dolg", db.actor:id()) >= 0) and (db.actor:money() >= 50000) and (whatami ~= "actor_dolg") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkfree_r(trader, actor)
   if relation_registry.community_goodwill ("freedom", db.actor:id()) < 0 then
        local chkgoodwill = relation_registry.community_goodwill("dolg",  db.actor:id())
        if chkgoodwill > -100 and db.actor:money() >= 5000 then return true end
        if chkgoodwill < -100 and chkgoodwill >= -1000 and  db.actor:money() >= 10000 then return true end
        if chkgoodwill < -1000 and db.actor:money() >= 25000 then return true end
   else return false
   end
return false
end

function factions_repair_checkfree_j(trader, actor)
local whatami = db.actor:character_community()
   if (relation_registry.community_goodwill ("freedom", db.actor:id()) >= 0) and (db.actor:money() >= 50000) and (whatami ~= "actor_freedom") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkstalker_r(trader, actor)
    local whatami = db.actor:character_community()
    local gulag = xr_gulag.get_gulag_by_name ("esc_lager")
    if (gulag) then
        if (gulag:npc_is_enemy_to_anybody(db.actor)) and (db.actor:money() >= 5000) and (whatami ~= "monolith") and (whatami ~= "bandit") and (whatami ~= "military") and (whatami ~= "killer") then
           return true
        end
    end
    return false
end

function factions_repair_checkstalker(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 5000
    local gulag = xr_gulag.get_gulag_by_name ("esc_lager")
    if (gulag) then
        if gulag:npc_is_enemy_to_anybody(db.actor) and db.actor:money() >= 5000 then
            item_name_and_price = game.translate_string("list_factions_repair_4").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
    end
end

function factions_repair_setstalker_r(trader, actor)
    local howmuch = 5000
    local gulag = xr_gulag.get_gulag_by_name ("esc_lager")
    if (gulag) then
        if gulag:npc_is_enemy_to_anybody(db.actor) and db.actor:money() >= 5000 then
            local chkgoodwill = relation_registry.community_goodwill("stalker",  db.actor:id())
            xr_gulag.setGulagRelation ("esc_lager", game_object.neutral, db.actor)    
            relation_registry.set_community_goodwill ("stalker", db.actor:id(), 0)    
            dialogs.relocate_money(actor, howmuch, "out")
        end
    end
end

function factions_repair_checkduty(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 0
    if db.actor ~= nil then 
      if relation_registry.community_goodwill ("dolg", db.actor:id()) < 0 then
        local chkgoodwill = relation_registry.community_goodwill("dolg",  db.actor:id())
        if chkgoodwill > -100 and db.actor:money() >= 5000 then howmuch = 5000     end
        if chkgoodwill < -100 and chkgoodwill >= -1000 and db.actor:money() >= 10000 then howmuch = 10000 end
        if chkgoodwill < -1000 and db.actor:money() >= 25000 then howmuch = 25000 end
        item_name_and_price = game.translate_string("list_factions_repair_0").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
        db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
      elseif (relation_registry.community_goodwill ("dolg", db.actor:id()) >= 0) and (db.actor:money() >= 50000) then
        howmuch = 50000
        item_name_and_price = game.translate_string("list_factions_repair_1").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
        db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
      end
    end
end

function factions_repair_checkfree(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 0
  if db.actor ~= nil then 
   if relation_registry.community_goodwill ("freedom", db.actor:id()) < 0 then
        local chkgoodwill = relation_registry.community_goodwill("freedom",  db.actor:id ())
        if chkgoodwill > -100 and db.actor:money() >= 5000 then howmuch = 5000 end
        if chkgoodwill < -100 and chkgoodwill >= -1000 and db.actor:money() >= 10000 then howmuch = 10000 end
        if chkgoodwill < -1000 and  db.actor:money() >= 25000 then howmuch = 25000 end
        item_name_and_price = game.translate_string("list_factions_repair_2").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
        db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
    elseif (relation_registry.community_goodwill ("freedom", db.actor:id()) >= 0) and (db.actor:money() >= 50000) then
        howmuch = 50000
        item_name_and_price = game.translate_string("list_factions_repair_3").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
        db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
    end
  end
end

function factions_repair_setduty_r(trader, actor)
    local howmuch = 0
    if db.actor ~= nil then 
        local chkgoodwill = relation_registry.community_goodwill("dolg",  db.actor:id())
        if chkgoodwill > -100 and db.actor:money() >= 5000 then howmuch = 5000 end
        if chkgoodwill < -100 and chkgoodwill >= -1000 and db.actor:money() >= 10000 then howmuch = 10000 end
        if chkgoodwill < -1000 and  db.actor:money() >= 25000 then howmuch = 25000 end
        dialogs.relocate_money(actor, howmuch, "out")
        relation_registry.set_community_goodwill ("dolg", db.actor:id(), 0)
    end
end

function factions_repair_setduty_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 50000, "out")
        db.actor:set_character_community("actor_dolg", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("dolg",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("dolg", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("dolg", db.actor:id (), 200)
        end
    end
end

function factions_repair_setfree_r(trader, actor)
    local howmuch = 0
    if db.actor ~= nil then 
        local chkgoodwill = relation_registry.community_goodwill("freedom",  db.actor:id())
        if chkgoodwill > -100 and db.actor:money() >= 5000 then howmuch = 5000 end
        if chkgoodwill < -100 and chkgoodwill >= -1000 and db.actor:money() >= 10000 then howmuch = 10000 end
        if chkgoodwill < -1000 and  db.actor:money() >= 25000 then howmuch = 25000 end
        dialogs.relocate_money(actor, howmuch, "out")
        relation_registry.set_community_goodwill ("dolg", db.actor:id(), 0)
    end
end

function factions_repair_setfree_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 50000, "out")
        db.actor:set_character_community("actor_freedom", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("freedom",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("freedom", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("freedom", db.actor:id(), 200)
        end
    end
end

function factions_repair_checkmon_j(trader, actor)
   local whatami = db.actor:character_community()
   local playhitemb = db.actor:object("h_2")
   local freep = db.storage[db.actor:id()].pstor["freepplay"]    
   if (freep == "yes" or playhitemb ~= nil or db.joinfactions == "yes") and (db.actor:money() >= 50000) and (whatami ~= "monolith") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkmonolith(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 50000
        if  db.actor:money() >= 50000 then
            item_name_and_price = game.translate_string("list_factions_repair_5").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
end

function factions_repair_setmon_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 50000, "out")
        db.actor:set_character_community("monolith", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("monolith",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("monolith", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("monolith", db.actor:id(), 200)
        end
    end
end

function factions_repair_bandit_j(trader, actor)
   local whatami = db.actor:character_community()
   local playhitemb = db.actor:object("h_2")
   local freep = db.storage[db.actor:id()].pstor["freepplay"]    
   if (freep == "yes" or playhitemb ~= nil or db.joinfactions == "yes") and (db.actor:money() >= 10000) and (whatami ~= "bandit") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkbandit(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 10000
        if  db.actor:money() >= 10000 then
            item_name_and_price = game.translate_string("list_factions_repair_7").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
end

function factions_repair_setbandit_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 10000, "out")
        db.actor:set_character_community("bandit", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("bandit",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("bandit", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("bandit", db.actor:id(), 200)
        end
    end
end


function factions_repair_mil_j(trader, actor)
   local whatami = db.actor:character_community()
   local playhitemb = db.actor:object("h_2")
   local freep = db.storage[db.actor:id()].pstor["freepplay"]    
   if (freep == "yes" or playhitemb ~= nil or db.joinfactions == "yes") and (db.actor:money() >= 40000) and (whatami ~= "military") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkmil(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 40000
        if  db.actor:money() >= 40000 then
            item_name_and_price = game.translate_string("list_factions_repair_6").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
end

function factions_repair_setmil_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 40000, "out")
        db.actor:set_character_community("military", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("military",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("military", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("military", db.actor:id(), 200)
        end
    end
end


function factions_repair_kill_j(trader, actor)
   local whatami = db.actor:character_community()
   local playhitemb = db.actor:object("h_2")
   local freep = db.storage[db.actor:id()].pstor["freepplay"]    
   if (freep == "yes" or playhitemb ~= nil or db.joinfactions == "yes") and (db.actor:money() >= 30000) and (whatami ~= "killer") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkkill(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 30000
        if  db.actor:money() >= 30000 then
            item_name_and_price = game.translate_string("list_factions_repair_8").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
end

function factions_repair_setkill_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 30000, "out")
        db.actor:set_character_community("killer", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("military",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("killer", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("killer", db.actor:id(), 200)
        end
    end
end


function factions_repair_eco_j(trader, actor)
   local whatami = db.actor:character_community()
   if (db.actor:money() >= 50000) and (whatami ~= "ecolog") and (whatami == "actor") then return true
   else return false
   end
end

function factions_repair_checkeco(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 50000
        if  db.actor:money() >= 50000 then
            item_name_and_price = game.translate_string("list_factions_repair_10").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
end

function factions_repair_seteco_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 50000, "out")
        db.actor:set_character_community("ecolog", 0, 0)
        local chkgoodwill = relation_registry.community_goodwill("ecolog",  db.actor:id())
        if chkgoodwill > 0 then 
            chkgoodwill = chkgoodwill + 200
            relation_registry.set_community_goodwill ("ecolog", db.actor:id(), chkgoodwill)
        else
            relation_registry.set_community_goodwill ("ecolog", db.actor:id(), 200)
        end
    end
end



function factions_repair_quit_j(trader, actor)
   local whatami = db.actor:character_community()
   if (whatami == "actor_dolg") or (whatami == "actor_freedom") or (whatami == "monolith") or (whatami == "bandit") or (whatami == "military") or (whatami == "killer") or (whatami == "ecolog") then
       if (db.actor:money() >= 10000) then return true end
   end
   return false
end

function factions_repair_checkquit(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
    local item_name_and_price = ""
    local howmuch = 10000
        if  db.actor:money() >= 10000 then
            item_name_and_price = game.translate_string("list_factions_repair_9").." %c[255,238,155,23]"..howmuch.."Ru%c[default]"
            db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
        end
end

function factions_repair_setquit_j(trader, actor)
    if db.actor ~= nil then 
        dialogs.relocate_money(actor, 10000, "out")
        db.actor:set_character_community("actor", 0, 0)
    end
end


--------------------------------------------------------------------------------------------------------
-- Trader Repair by Shebuka, edited by Speed aka Cabrobro.
--------------------------------------------------------------------------------------------------------

local weapon_profit_margin = 1.5
local armor_profit_margin = 1.4
local weapon_cond = 0.90
local suit_cond = 0.90

function trader_repair_precond(trader, actor)
    local item_in_slot_1 = db.actor:item_in_slot(1)
    local item_in_slot_2 = db.actor:item_in_slot(2)
    local item_in_slot_6 = db.actor:item_in_slot(6)
    if item_in_slot_1 ~= nil and weapon_cond > item_in_slot_1:condition() + 0.01 then return true
    elseif item_in_slot_2 ~= nil and weapon_cond > item_in_slot_2:condition() + 0.01 then return true
    elseif item_in_slot_6 ~= nil and suit_cond > item_in_slot_6:condition() + 0.01 then return true
    else return false
    end     
end

function trader_check_money_s1(trader, actor)
    local item_in_slot = db.actor:item_in_slot(1)
    if item_in_slot ~= nil then 
        local item_repair_cost = math.floor( (1-item_in_slot:condition()) * item_in_slot:cost() * weapon_profit_margin )
        if item_repair_cost > 0 and db.actor:money() >= item_repair_cost and (weapon_cond - 0.01) > item_in_slot:condition() then
            return true
        end 
    end
    return false
end

function trader_check_money_s2(trader, actor)
    local item_in_slot = db.actor:item_in_slot(2)
    if item_in_slot ~= nil then 
        local item_repair_cost = math.floor( (1-item_in_slot:condition()) * item_in_slot:cost() * weapon_profit_margin )
        if item_repair_cost > 0 and db.actor:money() >= item_repair_cost and (weapon_cond - 0.01) > item_in_slot:condition() then
            return true
        end 
    end
    return false
end

function trader_check_money_s6(trader, actor)
    local item_in_slot = db.actor:item_in_slot(6)
    if item_in_slot ~= nil then 
        local item_repair_cost = math.floor( (1-item_in_slot:condition()) * item_in_slot:cost() * armor_profit_margin )
        if item_repair_cost > 0 and db.actor:money() >= item_repair_cost and (suit_cond - 0.01) > item_in_slot:condition() then
            return true
        end 
    end
    return false
end

function trader_repiar_weapon_s1(trader, actor)
   weapon_profit_margin = 1.5
   armor_profit_margin = 1.4
   weapon_cond = 0.90
   suit_cond = 0.90
   if actor:name() == "esc_cabrobro" then
    weapon_profit_margin = 1.0
    armor_profit_margin = 1.1
    weapon_cond = 0.96
    suit_cond = 0.96
   end
    local item_in_slot = db.actor:item_in_slot(1)
    if item_in_slot ~= nil then
        local item_repair_cost = math.floor( (1-item_in_slot:condition()) * item_in_slot:cost() * weapon_profit_margin )
        item_in_slot:set_condition(weapon_cond)
        db.storage[db.actor:id()].pstor[item_in_slot:id().."_repair"] = "trader"
        dialogs.relocate_money(actor, item_repair_cost, "out")
    end
end

function trader_repiar_weapon_s2(trader, actor)
   weapon_profit_margin = 1.5
   armor_profit_margin = 1.4
   weapon_cond = 0.90
   suit_cond = 0.90
   if actor:name() == "esc_cabrobro" then
    weapon_profit_margin = 1.0
    armor_profit_margin = 1.1
    weapon_cond = 0.96
    suit_cond = 0.96
   end
    local item_in_slot = db.actor:item_in_slot(2)
    if item_in_slot ~= nil then
        local item_repair_cost = math.floor( (1-item_in_slot:condition()) * item_in_slot:cost() * weapon_profit_margin )
        item_in_slot:set_condition(weapon_cond)
        db.storage[db.actor:id()].pstor[item_in_slot:id().."_repair"] = "trader"
        dialogs.relocate_money(actor, item_repair_cost, "out")
    end
end

function trader_repiar_armor_s6(trader, actor)
   weapon_profit_margin = 1.5
   armor_profit_margin = 1.4
   weapon_cond = 0.90
   suit_cond = 0.90
   if actor:name() == "esc_cabrobro" then
    weapon_profit_margin = 1.0
    armor_profit_margin = 1.1
    weapon_cond = 0.96
    suit_cond = 0.96
   end
    local item_in_slot = db.actor:item_in_slot(6)
    if item_in_slot ~= nil then
        local suitsc
        if db.storage[db.actor:id()].pstor[item_in_slot:id().."_helmet"] == "off" then suitsc = 0.2 else suitsc = 0 end
        local item_repair_cost = math.floor( (1-item_in_slot:condition()) * item_in_slot:cost() * armor_profit_margin )
        item_in_slot:set_condition(suit_cond - suitsc)
        db.storage[db.actor:id()].pstor[item_in_slot:id().."_repair"] = "trader"
        dialogs.relocate_money(actor, item_repair_cost, "out")
    end    
end

function repair_costs(first_speaker, second_speaker)
    local task_texture, task_rect = get_texture_info("ui_iconsTotal_lost_money")
   weapon_profit_margin = 1.5
   armor_profit_margin = 1.4
   weapon_cond = 0.90
   suit_cond = 0.90
   if first_speaker:name() == "esc_cabrobro" then
    weapon_profit_margin = 1.0
    armor_profit_margin = 1.1
    weapon_cond = 0.96
    suit_cond = 0.96
   end
    
    local item_name_and_price = ""
    local item_repair_cost = 0
    if db.actor ~= nil then 
        local item_in_slot_1 = db.actor:item_in_slot(1)
        local item_in_slot_2 = db.actor:item_in_slot(2)
        local item_in_slot_6 = db.actor:item_in_slot(6)
    
        if item_in_slot_1 ~= nil then 
            item_repair_cost = math.floor( (1-item_in_slot_1:condition()) * item_in_slot_1:cost() * weapon_profit_margin )
            if item_repair_cost > 0 and (weapon_cond - 0.01) > item_in_slot_1:condition() then
                item_name_and_price = game.translate_string("list_trader_repair_0").." %c[255,238,155,23]"..item_repair_cost.."Ru%c[default]"
                db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
            end
        end
        if item_in_slot_2 ~= nil then
            item_repair_cost = math.floor( (1-item_in_slot_2:condition()) * item_in_slot_2:cost() * weapon_profit_margin )
            if item_repair_cost > 0 and (weapon_cond - 0.01) > item_in_slot_2:condition() then
                item_name_and_price = game.translate_string("list_trader_repair_1").." %c[255,238,155,23]"..item_repair_cost.."Ru%c[default]"
                db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
            end
        end
        if item_in_slot_6 ~= nil then
            item_repair_cost = math.floor( (1-item_in_slot_6:condition()) * item_in_slot_6:cost() * armor_profit_margin )
            if item_repair_cost > 0 and (suit_cond - 0.01) > item_in_slot_6:condition() then
                item_name_and_price = game.translate_string("list_trader_repair_2").." %c[255,238,155,23]"..item_repair_cost.."Ru%c[default]"
                db.actor:give_talk_message(item_name_and_price, task_texture, task_rect, "iconed_trade_info")
            end
        end
    end
end


--------------------------------------------------------------------------------------------------------
-- Dialog & InfoPortions Function
--------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------
-- Trader
--------------------------------------------------------------------------------------------------------
function trader_alredy_give_job(trader, actor)
    if (has_alife_info("agroprom_military_case") and not has_alife_info("agroprom_military_case_done")) or
       (has_alife_info("escape_blockpost_case") and not has_alife_info("escape_blockpost_case_done")) or
       (has_alife_info("tutorial_artefact_start") and not has_alife_info("tutorial_artefact_done")) or
       (has_alife_info("tutorial_wounded_start") and not has_alife_info("esc_serious_talk"))
    then
        return true
    end
    return false 
end

function trader_give_extra_job(trader, actor)
    local actor = db.actor
    if has_alife_info("escape_blockpost_case") and not has_alife_info("escape_blockpost_case_done")
    then
        return true
    end
    return false
end

function bandits_die(actor,npc)
    local actor = db.actor
    if has_alife_info("esc_kill_bandits_quest_kill") and not has_alife_info("esc_kill_bandits_noquest_kill")
    then
        return true
    end
    return false
end

function trader_need_extra_job(trader, actor)
    if not has_alife_info("escape_blockpost_case") and 
        has_alife_info("esc_return")
    then
        return true
    end
    return false
end

function is_tutorial()
    return not has_alife_info("tutorial_end")
end

function is_not_tutorial()
    return has_alife_info("tutorial_end")
end

function is_not_tutorial_art(actor, trader)
    local tutorial_artefact = db.actor:object("af_blood_tutorial")
    if (has_alife_info("tutorial_artefact_start") and not has_alife_info("tutorial_artefact_done")
        and  tutorial_artefact ~= nil) or has_alife_info("tutorial_artefact_done")
    then
        return true
    end
    return false
end

function not_final_job(trader, actor)
    local actor = db.actor
    return not has_alife_info("escape_blockpost_case_done")
end

function trader_test(actor, npc)
    printf ("!!!!!")    
    return true
end



function trader_dont_give_job(first_speaker, second_speaker)
    return not trader_alredy_give_job(first_speaker, second_speaker)
end

function finalize_quests(first_speaker, second_speaker)
    if tutorial_artefact_end(first_speaker, second_speaker) == true or
       tutorial_wounded_end(first_speaker, second_speaker) == true
    then
        return true
    end
    return false
end

function not_finalize_quests(first_speaker, second_speaker)
    return not this.finalize_quests(first_speaker, second_speaker)    
end

function tutorial_artefact_end(first_speaker, second_speaker)
    local actor = db.actor
    local tutorial_artefact = first_speaker:object("af_blood_tutorial")
    if has_alife_info("tutorial_artefact_start") and 
       not has_alife_info("tutorial_artefact_done") and
       tutorial_artefact ~= nil
    then
        return true
    end
    return false
end

function tutorial_artefact_have_not(first_speaker, second_speaker)
    local actor = db.actor
    local tutorial_artefact = first_speaker:object("af_blood_tutorial")
    if has_alife_info("tutorial_artefact_start") and 
       not has_alife_info("tutorial_artefact_done") and
       tutorial_artefact == nil
    then
        return true
    end
    return false
end

function tutorial_wounded_end(first_speaker, second_speaker)
    local actor = db.actor
    -- local wounded_flash = first_speaker:object("esc_wounded_flash")
    if has_alife_info("tutorial_wounded_start")    and 
        has_alife_info("tutorial_wounded_give_info")    and     
       not has_alife_info("esc_serious_talk")
-- and   wounded_flash ~= nil
    then
        return true
    end
    return false
end

function trader_dont_has_job(first_speaker, second_speaker)
    if trader_need_military_case(first_speaker, second_speaker) == false and
       trader_need_blockpost_box(first_speaker, second_speaker) == false
    then
        return true
    end
    return false
end


--' Escape tutorial artefact
function have_tutorial_artefact(first_speaker, second_speaker)
      return first_speaker:object("af_blood_tutorial") ~= nil
end
function give_medkit(first_speaker, second_speaker)
    dialogs.relocate_item_section(first_speaker, "medkit", "in")
end
function give_tutorial_artefact(first_speaker, second_speaker)
    dialogs.relocate_item_section(second_speaker, "af_blood_tutorial", "out")
end


--' Meet fox
function have_fox_info(first_speaker, second_speaker)
      return first_speaker:object("fox_flash") ~= nil
end

--' fox help

function transfer_medikit_to_fox (player, wounded)
    wounded:set_relation(game_object.friend, player)
    db.actor:give_info_portion("escape_fox_heal")
end

function give_weapon_to_actor (trader, actor)
    dialogs.relocate_item_section(trader, "wpn_usp", "in")
    dialogs.relocate_item_section(trader, "ammo_11.43x23_fmj", "in")
    dialogs.relocate_item_section(trader, "ammo_11.43x23_fmj", "in")
    dialogs.relocate_item_section(trader, "ammo_11.43x23_fmj", "in")
    dialogs.relocate_item_section(trader, "ammo_11.43x23_fmj", "in")
    dialogs.relocate_item_section(trader, "wpn_knife", "in")
    dialogs.relocate_item_section(trader, "antirad", "in")
    dialogs.relocate_item_section(trader, "bandage", "in")

end


--' Escape blockpost box
function have_blockpost_case(first_speaker, second_speaker)
      return first_speaker:object("quest_case_01") ~= nil
end


function give_blockpost_case(first_speaker, second_speaker)
    dialogs.relocate_item_section(second_speaker, "quest_case_01", "out")
end

function give_blockpost_case_reward(first_speaker, second_speaker)
    dialogs.relocate_money(first_speaker, 2000, "in")
end

--' Agroprom military case
function trader_need_military_case(first_speaker, second_speaker)
    if has_alife_info("esc_serious_talk") and
       not has_alife_info("agroprom_military_case")
    then
        return true
    end
    return false
end

--' Escape trader artefact
function have_artefact_from_fleshes(first_speaker, second_speaker)
    local actor = db.actor
    if actor ~= nil and
       (actor:object("af_vyvert") ~= nil or
       actor:object("af_gravi") ~= nil or
       actor:object("af_gold_fish") ~= nil)
    then
        return true
    end
      return false
end


--' Ящик с блокпоста
function trader_need_blockpost_box(first_speaker, second_speaker)
    if has_alife_info("tutorial_end") and
       has_alife_info("esc_trader_speak") and
       not has_alife_info("escape_blockpost_case")
    then
        return true
    end
    return false
end

--' tutorial wounded in vagon
function wounded_need_help(first_speaker, second_speaker)
    local actor = db.actor
    return actor ~= nil and not has_alife_info( "tutorial_wounded_help" )
end

--' trader needs military documents
function trader_need_military_document(first_speaker, second_speaker)
    if has_alife_info("escape_blockpost_case_done") and
       not has_alife_info("agroprom_military_case")
    then
        return true
    end
    return false
end

--' trader dialog about docs from labx18
function actor_has_documents (actor, npc)
    if actor:object("dar_document4") then
        return true
    else
        return false
    end
end

--' Escape dynamite for Wolf
function transfer_wolf_reward(first_speaker, second_speaker)
    dialogs.relocate_item_section(actor, "af_medusa", "in")
    dialogs.relocate_item_section(actor, "ammo_9x19_fmj", "in")
    dialogs.relocate_item_section(actor, "ammo_9x19_fmj", "in")
    dialogs.relocate_item_section(actor, "medkit_scientic", "in")
            -- alterei logf("spawing mutants wolf 2nd talk")
            local bloodvilla = vector():set( -201.74, -15.31, -161.78 )
            alife():create("chimera_weak", bloodvilla, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            fracunderbridge = vector():set( -201.74, -15.31, -161.78 ) 
            alife():create("chimera_weak", fracunderbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            local snorkvilla = vector():set( -163.81, -18.28, -128.66 )
            alife():create("cat_weak", snorkvilla, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            local snorkvilla = vector():set( -201.74, -15.31, -161.78 )
            alife():create("cat_weak", snorkvilla, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            local snorkbridge = vector():set( 28.65, 2.90, 26.77 )
            alife():create("cat_weak", snorkbridge, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            local nmsp = vector():set( 10, 10, 20 )
            nmsp.x = nmsp.x + 10
            alife():create("tushkano_normal", nmsp, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            alife():create("tushkano_normal", nmsp, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            alife():create("tushkano_normal", nmsp, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            alife():create("tushkano_normal", nmsp, db.actor:level_vertex_id() , db.actor:game_vertex_id() )
            local nmsp = vector():set( -15.43, 3.93, 56.08 )
            alife():create("gigant_strong", nmsp, db.actor:level_vertex_id(), db.actor:game_vertex_id())
end

function wolf_additional_reward(first_speaker, second_speaker)
    dialogs.relocate_item_section(first_speaker, "medkit", "in")
    dialogs.relocate_item_section(first_speaker, "bandage", "in")
    dialogs.relocate_item_section(first_speaker, "wpn_fort", "in")
    dialogs.relocate_item_section(first_speaker, "grenade_f1", "in") 
    dialogs.relocate_item_section(first_speaker, "ammo_9x18_fmj", "in")    
end


--' Escape Wounded's flash
function wounded_give_flash(first_speaker, second_speaker)
    dialogs.relocate_item_section(first_speaker, "esc_wounded_flash", "in")
end

function have_wounded_flash(first_speaker, second_speaker)
      return first_speaker:object("esc_wounded_flash") ~= nil
end
function dont_have_wounded_flash(first_speaker, second_speaker)
      return not have_wounded_flash(first_speaker, second_speaker)
end

function give_wounded_flash(first_speaker, second_speaker)
    dialogs.relocate_item_section(second_speaker, "esc_wounded_flash", "out")
    dialogs.relocate_money(second_speaker, 1500, "in")
end

function give_knife_to_actor(first_speaker, second_speaker)
    dialogs.relocate_item_section(first_speaker, "wpn_knife", "in")
end

--' Escape bandits factory
function give_factory_reward_trader(first_speaker, second_speaker)
    dialogs.relocate_money(first_speaker, 500, "in")
end

--' Give X-18 documents read

function give_documents_reward (first_speaker, second_speaker)
    dialogs.relocate_money(first_speaker, 1000, "in")
end


--' Kill killers raid
function give_reward_killers(first_speaker, second_speaker)
    dialogs.relocate_money(first_speaker, 2500, "in")
end


--' Soldiers on bridge
function has_soldiers_bribe(actor, npc)
    return actor:money() >= 500
end

function give_soldiers_bribe(actor, npc)
    dialogs.relocate_money(npc, 500, "out")    
end

function fox_pay_money(actor, npc)
    dialogs.relocate_money(npc, 1500, "in")    
    treasure_manager.get_treasure_manager():give_treasure("esc_secret_truck_goods")
end

function run_tutorial_pda(first_speaker, second_speaker)
    printf("!-!-!")
    first_speaker:stop_talk()
    second_speaker:stop_talk()
    game.start_tutorial("part_1_pda")
end

function wolf_precond_univ (actor, npc)
    return has_alife_info("esc_kill_bandits_quest_done") or (has_alife_info("tutorial_wounded_give_info") and not has_alife_info("esc_kill_bandits_quest_have"))
end

 

 

И ёще вопрос добавлял группировку, но вылетает при синхронизации

Expression : e_entity

Function : xrServer::Process_event_reject

File : E:\stalker\patch_1_0004\xr_3da\xrGame\xrServer_process_event_reject.cpp

Line : 12

Description : entity not found. id_parent=1917 id_entity=1918 frame=17140

 

 

Изменено пользователем Руслан
Ссылка на комментарий

Добрый день всем!

Итак, встречайте. Тов. macron буквально на днях сделал компиляцию локации Темный кордон

на высоких для build 2571.

http://narod.ru/disk/26656057000/darkscape_2571_hq.7z.html

 

Совместимость: необходима адапатация нескольких шейдеров.

 

Скриншоты:

dx98.th.jpgdx8.th.jpgdx91.th.jpgdx92.th.jpg

dx93.th.jpgdx94.th.jpgdx95.th.jpgdx96.th.jpg

(автор скриншотов не я)

 

Выкладывается с разрешения автора.

Изменено пользователем AK-103

Intel Centrino Mobile (Dual-core) T2700 2,328 GHz, Intel GMA 945GM, 2x1024 MB DDR2-667, WD Scorpio 1200BEVS

Microsoft Windows 7 Professional N + Novell Linux 11.2 (OpenSUSE) Dual boot

S.T.A.L.K.E.R. SHOC 1.0004 + AMK 1.4.1 + NS3 + NLC3 + Arsenal + Arsenal beta +New weapons

 

Опытный американский дробовик XM1014 =O

Хозяйке на заметку: Не спешите выбрасывать чеку от использованной гранаты Ф-1 или РГД-5 - с её помощью можно легко и удобно прикрепить игрушечного пингвинчика к своему рюкзаку. © not me

Ссылка на комментарий

Народ, пожалуйста ответьте безграмотному!

На всех территориях после установки 9 пака карт пропала пробиваемость кутов и веток т.е. можно спрятаться за одним листочком и стрелять ни ты ни тебя не убьют. Это исправляется или это глобальная ошибка. на 7 паке SMP1 всё было нормально.

Если можно исправить без sdk то как?

 

Ссылка на комментарий

дядяСаша

Можно, http://www.amk-team.ru/forum/index.php?s=&...st&p=465414

не знаю почитай дальше возможно там будет другая версия автора...

Мой архив

Сталкером не занимаюсь.

Ссылка на комментарий

AK-103,

шейдеры - дело совместимое. Главное - подключить эту локу к паку теперь. Кто-нибудь займётся?

С меня обещанные настроенные переходы, как раз доделываю.

Ссылка на комментарий
Вот я заспавнил через сдк аномалию, теперь пытаюсь ее разобрать с acdc, но вылазит ошибка:

....

Проверь аллспавн еще раз, посмотри каким классом ты прописал свою аномалию в acdc.pl.

Цензура ограничивает творчество © by me
Ссылка на комментарий

Люди подскажите пожалуйста материал почитать, как связать карту в ПДА на радаре ГГ и метку ГГ на карте в ПДА, методом тыка не получилось.

Ссылка на комментарий

дядяСаша,

Посмотрите здесь. Раздел "Полезная информация по работе с картами локаций в ПДА". В этом сообщении камрады Shadows и XMK подготовили неплохой и понятный тутор.

Ссылка на комментарий
Проверь аллспавн еще раз, посмотри каким классом ты прописал свою аномалию в acdc.pl.

Можно про это подробней обьяснить? Тоже спавню аномалию в сдк, а потом олспаун с acdc не могу декомпилить. Аномалию прописывал,но эффекта никакого.

"Все сложное - не нужно, все нужное - просто"(М. Калашников)

Ссылка на комментарий

Shadows, по логике надо перекомпилить на high, предварительно проверив, что для решетки стоят примерно такие настройки шейдера:

 

shader def_shaders\def_trans

compile def_shaders\def_translucensy

material materials\setka_rabica

2 sided да

 

или

 

shader def_shaders\def_aref

compile def_shaders\def_noshadow

material materials\setka_rabica

2 sided да

Ссылка на комментарий

BeeRseK, проверь, правильно у тебя присвоен класс аномалии в acdc.pl и проверь правильность конфига.

Shadows, можно просто поменять текстуру. Найди эту текстуру и поменяй на нормальную (если есть). Если нет, смотри пост выше..

Изменено пользователем dimos
Цензура ограничивает творчество © by me
Ссылка на комментарий

Кордон. Билд 1842. Качество компиляции чуть выше драфта. Для самостоятельного добавления в игру.

http://narod.ru/disk/27171178000/escape_1842.7z.html

 

Добавлено через 4 мин.:

dimos, Хорошо,попробую...

 

Добавлено через 26 мин.:

Темная долина. Билд 1865. Качество компиляции чуть выше драфта. Тоже для самостоятельного добавления в игру

45c594a0dd69t.jpg

http://narod.ru/disk/27215423000/darkdolina1865.7z.html

Изменено пользователем BeeRseK

"Все сложное - не нужно, все нужное - просто"(М. Калашников)

Ссылка на комментарий

Beerseek, добавь пожалуйста скрин кордона из билда. интересно посмотреть сверху.

Intel Centrino Mobile (Dual-core) T2700 2,328 GHz, Intel GMA 945GM, 2x1024 MB DDR2-667, WD Scorpio 1200BEVS

Microsoft Windows 7 Professional N + Novell Linux 11.2 (OpenSUSE) Dual boot

S.T.A.L.K.E.R. SHOC 1.0004 + AMK 1.4.1 + NS3 + NLC3 + Arsenal + Arsenal beta +New weapons

 

Опытный американский дробовик XM1014 =O

Хозяйке на заметку: Не спешите выбрасывать чеку от использованной гранаты Ф-1 или РГД-5 - с её помощью можно легко и удобно прикрепить игрушечного пингвинчика к своему рюкзаку. © not me

Ссылка на комментарий

AK-103, только из СДК. Это по сути тот же кордон что и в 1935, но тут локацию ограждают каменные утесы, и мост не разрушен,а остальное все в принципе также.

705b70abbd78t.jpg

992cdce321d4t.jpg

"Все сложное - не нужно, все нужное - просто"(М. Калашников)

Ссылка на комментарий

В предбаннике столкнулся с такой ошибкой:

контроллер на 3-ем этаже в здании, дверь одна открыта, а дубль-дверь закрыта и не открывается. Контроллера не убить. Кто может иправлял, подскажите есть ли способ победить ошибку, не удаляя контроллера и не залезая в СДК?

Если нет. придётся его ликвидировать - нет мутанта, нет проблеммы! -))

Ссылка на комментарий

Камрады, объясните пожалуйста, принципиальную разницу между картами сингла и мультиплеера, и почему нельзя их взаимозаменять ?

 

Ссылка на комментарий

Серый Волк, для сингла на локации должна быть АИ-сетка и переходы, чтобы неписи и зверушки могли ходить тюда-сюда. В мультиплеере этого не надо, так как там отключен алайф.

Серый Волк, разве уж очень теоретическая, но считай, что ее однозначно нет... Это могли бы сделать только ПЫС, но и они не сделали. Можно сделать AI-сетку на мультиплеерных локах и играть на них в сингле.

Изменено пользователем dimos
Цензура ограничивает творчество © by me
Ссылка на комментарий

Создайте аккаунт или авторизуйтесь, чтобы оставить комментарий

Комментарии могут оставлять только зарегистрированные пользователи

Создать аккаунт

Зарегистрировать новый аккаунт в нашем сообществе. Это несложно!

Зарегистрировать новый аккаунт

Войти

Есть аккаунт? Войти.

Войти
  • Недавно просматривали   0 пользователей

    • Ни один зарегистрированный пользователь не просматривает эту страницу.
×
×
  • Создать...