[Scummvm-git-logs] scummvm master -> f10023f2c4f324b7c265a75a3d580510eedfc782

dreammaster noreply at scummvm.org
Mon Mar 27 01:58:28 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f10023f2c4 NUVIE: Fix Ultima 6 spawned NPC weapon loadout


Commit: f10023f2c4f324b7c265a75a3d580510eedfc782
    https://github.com/scummvm/scummvm/commit/f10023f2c4f324b7c265a75a3d580510eedfc782
Author: PushmePullyu (127053144+PushmePullyu at users.noreply.github.com)
Date: 2023-03-26T18:58:22-07:00

Commit Message:
NUVIE: Fix Ultima 6 spawned NPC weapon loadout

Fixes #13530

Changed paths:
    devtools/create_ultima/files/ultima6/scripts/u6/actor.lua


diff --git a/devtools/create_ultima/files/ultima6/scripts/u6/actor.lua b/devtools/create_ultima/files/ultima6/scripts/u6/actor.lua
index 6d020bd57fe..67c6264428c 100644
--- a/devtools/create_ultima/files/ultima6/scripts/u6/actor.lua
+++ b/devtools/create_ultima/files/ultima6/scripts/u6/actor.lua
@@ -587,32 +587,34 @@ function actor_init(actor, alignment)
    --actor weapon
    chance = 2
    for i,v in ipairs(actor_base[23]) do
-      if v >= 36 and v <= 38 then --spear, throwing axe, dagger
-         qty = math.random(6, 12)
-      else
-         qty = 1
-      end
-
-      for j=1,qty do
-         obj = Obj.new(v)
-         obj.status = 57
-         if v == 90 then
-            obj.qty = 1
+      if math.random(1,chance) == 1 then
+         if v >= 36 and v <= 38 then --spear, throwing axe, dagger
+            qty = math.random(6, 12)
          else
-            obj.qty = 0
+            qty = 1
          end
-         Actor.inv_add_obj(actor, obj)
-         Actor.inv_ready_obj(actor, obj)
-         if v == 41 or v == 54 then --bow, magic bow
-            obj = Obj.new(55) --arrow
-            obj.status = 49
-            obj.qty = math.random(12, 24)
-            Actor.inv_add_obj(actor, obj)
-         elseif v == 42 or v == 50 then --crossbow, triple crossbow
-            obj = Obj.new(56) --bolt
-            obj.status = 49
-            obj.qty = math.random(12, 24)
+
+         for j=1,qty do
+            obj = Obj.new(v)
+            obj.status = 57
+            if v == 90 then
+               obj.qty = 1
+            else
+               obj.qty = 0
+            end
             Actor.inv_add_obj(actor, obj)
+            Actor.inv_ready_obj(actor, obj)
+            if v == 41 or v == 54 then --bow, magic bow
+               obj = Obj.new(55) --arrow
+               obj.status = 49
+               obj.qty = math.random(12, 24)
+               Actor.inv_add_obj(actor, obj)
+            elseif v == 42 or v == 50 then --crossbow, triple crossbow
+               obj = Obj.new(56) --bolt
+               obj.status = 49
+               obj.qty = math.random(12, 24)
+               Actor.inv_add_obj(actor, obj)
+            end
          end
       end
 




More information about the Scummvm-git-logs mailing list