Uncle_Muscle 发表于 2013-8-23 03:44

《收获日2》lua代码小原创,加强版医疗包和哨兵守卫,持续更新(NO3。更新面具材料图案颜色解锁,累感无爱)

本帖最后由 Uncle_Muscle 于 2013-8-23 16:58 编辑

不知道lua代码是什么,怎么用的请看这里,教程和注入工具都在:
http://bbs.3dmgame.com/thread-3981125-1-1.html

今晚闲着没事,翻了一下lua的原代码,捡几个改了一下,然后试了一试真的有效果唉,好开心。。。。:lol:lol
我没怎么学过编程也不是计算机专业的,所以这次改了点代码巨有成就感。。。
所以小技术请大家不要打击:loveliness::loveliness:,多多支持,而且在3DM发帖也是第一次。。。原来打算在贴吧发的。。代码一复制上去格式就乱了
想着破解和汉化都是用3DM的,所以就来3DM发啦,莫打击莫打击
收获日2
steam:357539725
昵称:joker_lu

代码如下:
医疗包(单个医疗包无限治疗效果,四个人怎么都吃不完)


function DoctorBagBase:_take( unit )
      --local taken = 1 - unit:character_damage():health_ratio()
      local taken = 1
      
      self._amount = self._amount
      unit:character_damage():recover_health() -- replenish()
      return taken
end

哨兵机枪(机枪无限弹、无敌,好爽好爽,游戏开始挑敌人多的地方放一个,它一直突突到你们撤离)


function SentryGunWeapon:out_of_ammo()
      if self._ammo_total then
                return self._ammo_total == 9999
      else
                return self._ammo_ratio == 1
      end
end

function SentryGunWeapon:fire( blanks, expend_ammo )
      if expend_ammo then
                if self._ammo_total <= 0 then
                        return
                end
                self._ammo_total = self._ammo_total - 0

                local ammo_percent = self._ammo_total / self._ammo_total
                if ammo_percent == 0 or math.abs( ammo_percent - self._ammo_sync ) >= self._ammo_sync_resolution then
                        self._ammo_sync = ammo_percent
                        self._unit:network():send( "sentrygun_ammo", math.ceil( ammo_percent / self._ammo_sync_resolution ) )
                end
      end
      
      local fire_obj = self._effect_align[ self._interleaving_fire ]
      local from_pos = fire_obj:position()
      local direction = fire_obj:rotation():y()
      -- mvector3.negate( direction )
      mvector3.spread( direction, tweak_data.weapon[ self._name_id ].SPREAD * self._spread_mul )
      World:effect_manager():spawn( self._muzzle_effect_table[ self._interleaving_fire ] ) -- , normal = col_ray.normal } )
      if self._use_shell_ejection_effect then
                World:effect_manager():spawn( self._shell_ejection_effect_table )
      end
      local ray_res = self:_fire_raycast( from_pos, direction, blanks )
      if self._alert_events and ray_res.rays then
                RaycastWeaponBase._check_alert( self, ray_res.rays, from_pos, direction, self._unit )
      end
      
      self._unit:movement():give_recoil()
      
      return ray_res
end


function SentryGunDamage:damage_bullet( attack_data )
      --print( "", inspect( attack_data ) )
      if self._dead or self._invulnerable or PlayerDamage:_look_for_friendly_fire( attack_data.attacker_unit ) then
                return
      end
      
      local hit_shield = attack_data.col_ray.body and attack_data.col_ray.body:name() == self._shield_body_name
      local hit_bag = attack_data.col_ray.body and attack_data.col_ray.body:name() == self._bag_body_name
      local dmg_adjusted = attack_data.damage * ( hit_shield and tweak_data.weapon.sentry_gun.SHIELD_DMG_MUL or 1 ) * ( hit_bag and tweak_data.weapon.sentry_gun.BAG_DMG_MUL or 1 )
      -- print( "hit_shield", hit_shield, "hit_bag", hit_bag, "damage", attack_data.damage, "dmg_adjusted", dmg_adjusted)
      if dmg_adjusted >= self._health then
                self:die()
      else
                self._health = self._health
      end
      
      local health_percent = self._health / self._health_max
      if health_percent == 0 or math.abs( health_percent - self._health_sync ) >= self._health_sync_resolution then
                self._health_sync = health_percent
                self._unit:network():send( "sentrygun_health", math.ceil( health_percent / self._health_sync_resolution ) )
      end
      
end



——————————————————————
第一次发帖哦,第一次哦,回复多的话会考虑更新的


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三次更新,面具的材料图案颜色,累感无爱,帖子都没人理的……本小学生自己写的啊,再没人爱去玩CF了!!!!!

面具解锁代码
managers.blackmarket:_setup_masks()

for mask_id,_ in pairs(tweak_data.blackmarket.masks) do

Global.blackmarket_manager.masks.unlocked = true

managers.blackmarket:add_to_inventory("normal", "masks", mask_id, false)

end

颜色解锁代码
for color_id,_ in pairs(tweak_data.blackmarket.colors) do

tweak_data.blackmarket.colors[ texture_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "colors", color_id, false)

end

图案解锁代码
for texture_id,_ in pairs(tweak_data.blackmarket.textures) do

tweak_data.blackmarket.textures[ texture_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "textures", texture_id, false)

end

材料解锁代码
for material_id,_ in pairs(tweak_data.blackmarket.materials) do

tweak_data.blackmarket.materials[ material_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "materials", material_id, false)

end





元芳到此一游 发表于 2013-8-23 07:56

求楼主更新面具全材料和全图案lua,真心求

quishuang 发表于 2013-8-23 10:04

这么牛逼?下载试试

Uncle_Muscle 发表于 2013-8-23 11:47

元芳到此一游 发表于 2013-8-23 07:56 static/image/common/back.gif
求楼主更新面具全材料和全图案lua,真心求

材料已更新,其它好像比较难写,特别是颜色

vbnshi 发表于 2013-8-23 12:04

Uncle_Muscle 发表于 2013-8-23 12:03 static/image/common/back.gif
CF求组。。。。

你不是说不玩了吗~我都不玩了~

vbnshi 发表于 2013-8-23 13:17

不过貌似没什么用哇~~好像联机无效~

Uncle_Muscle 发表于 2013-8-23 13:43

vbnshi 发表于 2013-8-23 13:17 static/image/common/back.gif
不过貌似没什么用哇~~好像联机无效~

host only。。。。没办法,这些地图上物品的信息都要在主机上运算处理,以主机的文件为准,想用的话只能自己建房。。。面具什么的个人物品还是本机有效的

quishuang 发表于 2013-8-23 13:47

来个超级隐身代码。不要突突突:D

vbnshi 发表于 2013-8-24 14:51

又要帮忙顶:lol

cuttygeneral 发表于 2013-8-25 16:54

面具有增加但是素材沒有增加

BATMANMOD 发表于 2013-8-27 11:38

弱弱的问一句这个怎么用啊 ,我按照网上说的做了,好像那个注入器把HOME 键按烂了都没用啊

sxj09128 发表于 2013-8-27 18:59

好像面具喷漆和材料没增加哎?

sxj09128 发表于 2013-8-28 12:37

跪求早日修改面具颜色

安缇 发表于 2013-8-29 17:31

面具材料图案颜色解锁.lua 只有解锁面具种类,材料、图案没有新的。。:L

feiyueltd 发表于 2013-9-1 21:16

update5闪退,更新问题还是啥问题,求解决

Koenigsegg_CCXR 发表于 2013-9-10 15:28

这个是怎么用的,你教程里的那些代码也不知道什么意思

es5671 发表于 2013-10-10 05:25

3qqqqqqqqqqqqqq

bof8910 发表于 2013-10-10 18:00

颜色解锁好像没用,面具,材料,图案亲测有效

bof8910 发表于 2013-10-10 18:03

我知道颜色不对的问题出在哪了,颜色代码应该是这样的
for color_id,_ in pairs(tweak_data.blackmarket.colors) do

tweak_data.blackmarket.colors[ color_id ].unlocked = true

managers.blackmarket:add_to_inventory("normal", "colors", color_id, false)

end

295973690 发表于 2013-10-10 20:10

材料颜色素材无效诶

syz790793849 发表于 2013-12-23 20:44

我还是不会用啊,这个东西下了放哪啊

dsa1996116 发表于 2014-1-14 18:14

无法开枪.

dsa1996116 发表于 2014-1-14 19:00

楼主为什么没办法开枪啊。

12swift 发表于 2014-1-23 16:35

我只想单独修改离岸账户,现在现金与离岸账户数字差距十位数

shirenze00 发表于 2014-1-24 20:01

求无限哨兵机枪

梅川.内酷 发表于 2014-1-28 20:29

无限机枪怎么用啊,我都折腾了一整天了

mlsdaodao 发表于 2014-2-7 01:49

Uncle_Muscle 发表于 2013-8-23 11:47 static/image/common/back.gif
材料已更新,其它好像比较难写,特别是颜色

lz,机枪无敌并不能用啊。机枪还是一会就歇菜了

15165561 发表于 2014-2-12 20:06

我自己测试能用 无限子弹 就是对有盾的敌人难打

@黑夜 发表于 2015-1-28 19:29

感谢楼主分享

BoheDamu 发表于 2015-6-13 14:13

@黑夜 发表于 2015-1-28 19:29 static/image/common/back.gif
感谢楼主分享

还能用?
页: [1] 2
查看完整版本: 《收获日2》lua代码小原创,加强版医疗包和哨兵守卫,持续更新(NO3。更新面具材料图案颜色解锁,累感无爱)