English NPC - weapon dmg

2 replies
Goto Page
To the start Previous 1 Next To the start
12.10.13 06:23:16 am
Up
pbeloto
User
Offline Off
help me create the damage each weapon differently?


> examples
• laser = dmg npc 30% for shot
• m4a1 = dmg npc 3% for shot
• machet = dmg npc for 10% for shot
• FN9000 = dmg npc for 6% for shot

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
npc_force_1 = true

addhook("objectdamage","_objectdamage")
function _objectdamage(id_o,dmg,id_pl)
     if npc_force_1 then
          if id_o > 0 then
               if object(id_o,"type") == 30 then
                    if object(id_o,"player") == 1 then     -- Zumbie --
                         npc_force_1 = false
                         parse("damageobject "..id_o.." 3 "..id_pl)
                         npc_force_1 = true
                    return 1
                    end
               end
          end
     end
end


I tested
did not work: #

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
npc_force_1 = true

addhook("objectdamage","_objectdamage")
function _objectdamage(id_o,dmg,id_pl)
     if npc_force_1 then
          if id_o > 0 then
               if player(id,"weapontype") == 45 then
                    if object(id_o,"type") == 30 then
                         if object(id_o,"player") == 1 then     -- Zumbie --
                              npc_force_1 = false
                              parse("damageobject "..id_o.." 3 "..id_pl)
                              npc_force_1 = true
                         return 1
                         end
                    end
               end
          end
     end
end


plz help ??, thanks '-'
12.10.13 09:28:39 am
Up
Alistaire
User
Offline Off
I made a seperate NPC handling system, that allows for such things. First of all I replace all NPC stats by a table that handles them separately, so you can e.g poison or burn NPC's without actually damaging their ingame health.
IMG:http://i.imgur.com/5zhwOTP.png
13.10.13 01:29:47 am
Up
pbeloto
User
Offline Off
user Alistaire has written:
I made a seperate NPC handling system, that allows for such things. First of all I replace all NPC stats by a table that handles them separately, so you can e.g poison or burn NPC's without actually damaging their ingame health.


I'm wondering what the npc get more health

but the damage of the weapons are different, laser takes self damage.

plz help me , or give you script?
To the start Previous 1 Next To the start