Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Modified by Surs for A.R.E.A.
- local feature_is_active = axr_main.config:r_value("mm_options","enable_loot_money",1,false)
- local function opt_menu_on_init(menu)
- menu.gameplay_options["loot_money"] = {default=false, debug_only=false, typ="check",
- on_accept=function(handler,optMgr,ctrl)
- feature_is_active = ctrl:GetCheck()
- end
- }
- end
- function on_game_start()
- RegisterScriptCallback("opt_menu_on_init",opt_menu_on_init)
- end
- function lootmoney(npc)
- if not (feature_is_active) then return end
- if not (npc) then return end
- local money = npc:money()
- local actor = db.actor
- if money and (money > 0) and (money < 10000) then
- local deadmoney = money
- local npc_rank = ranks.get_obj_rank_name(npc)
- if npc_rank then
- if npc_rank == "legend" and deadmoney >=800
- then deadmoney=math.random(600,2000)
- elseif npc_rank == "master" and deadmoney >=750
- then deadmoney=math.random(500,1500)
- elseif npc_rank == "expert" and deadmoney >=700
- then deadmoney=math.random(500,1000)
- elseif npc_rank == "veteran" and deadmoney >=650
- then deadmoney=math.random(400,800)
- elseif npc_rank == "professional" and deadmoney >=600
- then deadmoney=math.random(400,600)
- elseif npc_rank == "experienced" and deadmoney >=550
- then deadmoney=math.random(200,400)
- elseif npc_rank == "trainee" and deadmoney >=500
- then deadmoney=math.random(50,300)
- elseif npc_rank == "trainee" and deadmoney >=500
- then deadmoney=math.random(50,300)
- elseif npc_rank == "novice" and deadmoney >=300
- then deadmoney=math.random(25,200)
- end
- end
- if actor:has_info("hacking_soft_installed") then
- local news_caption = strformat(game.translate_string("st_dead_stalker"),npc:character_name())
- local news_text = strformat(game.translate_string("st_intercept_funds"),"%c[255,255,0,0]"..deadmoney.."%c[default]")
- actor:give_game_news(news_caption, news_text, "ui_iconsTotal_found_money", 0, 10000)
- actor:give_money(deadmoney)
- -- game_stats.money_quest_update(deadmoney)
- npc:give_money(-money)
- -- game_stats.money_quest_update(-money)
- if (math.random(1,100) >= 90) then
- coc_treasure_manager.create_random_stash(nil,strformat(game.translate_string("st_coc_cache"),npc:character_name()))
- end
- end
- if area_skills then area_skills.raise_skill("marauder_skill", 0.5) end
- end
- end
- function lootmoney_effect(npc,corpse)
- if not (feature_is_active) then return end
- if not (npc and corpse) then return end
- local money=corpse:money()
- if money and (money > 0) and (money < 10000) then
- local deadmoney = money
- local gi_rank = ranks.get_obj_rank_name(corpse)
- if gi_rank then
- if gi_rank == "legend" and deadmoney >=500
- then deadmoney=math.random(600,1000)
- elseif gi_rank == "master" and deadmoney >=450
- then deadmoney=math.random(500,900)
- elseif gi_rank == "expert" and deadmoney >=400
- then deadmoney=math.random(500,800)
- elseif gi_rank == "veteran" and deadmoney >=350
- then deadmoney=math.random(400,700)
- elseif gi_rank == "professional" and deadmoney >=300
- then deadmoney=math.random(400,600)
- elseif gi_rank == "experienced" and deadmoney >=250
- then deadmoney=math.random(200,500)
- elseif gi_rank == "trainee" and deadmoney >=200
- then deadmoney=math.random(50,400)
- elseif gi_rank == "novice" and deadmoney >=100
- then deadmoney=math.random(25,400)
- end
- end
- npc:give_money(deadmoney)
- -- game_stats.money_quest_update(deadmoney)
- corpse:give_money(-money)
- -- game_stats.money_quest_update(-money)
- end
- end
Add Comment
Please, Sign In to add comment