Guest User

File not loaded

a guest
Aug 4th, 2022
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.65 KB | None | 0 0
  1. local specialZombieManager = require "SpecialZombies/Manager";
  2.  
  3. local function makeNoise(zombie)
  4.     local modData = zombie:getModData();
  5.     if modData.shrieked then
  6.         return;
  7.     end
  8.     local emitter = zombie:getEmitter();
  9.     if not emitter then
  10.         print("No emitter");
  11.         return;
  12.     end
  13.     addSound(nil, zombie:getX(), zombie:getY(), zombie:getZ(), 250, 250);
  14.     emitter:playSound("Shrieker_Shriek", zombie);
  15.     print("Shrieking!");
  16.     modData.shrieked = true;
  17. end
  18.  
  19. local function isShrieker(zombie)
  20.     local modData = zombie:getModData();
  21.     return modData.specialZombie;
  22. end
  23.  
  24. local function Shrieker_Update(zombie)
  25.     local modData = zombie:getModData();
  26.  
  27.     if not modData.ZombieVariety then
  28.         print("No ZombieVariety set");
  29.         modData.ZombieVariety = {};
  30.     end
  31.  
  32.     for prop, value in pairs(specialZombieManager) do
  33.         print(prop);
  34.     end
  35.     return;
  36.  
  37.     if not specialZombieManager.types.Shrieker then
  38.         specialZombieManager.importSpecialZombieStatsByType("Shrieker");
  39.     end
  40.  
  41.     specialZombieManager.rollSpecialZombieProbability(zombie);
  42.  
  43.     if modData.ZombieVariety.applySpecial and not modData.ZombieVariety.applied then
  44.         specialZombieManager.applySpecialZombieStats(zombie, modData.ZombieVariety.type);
  45.     end
  46.  
  47.     local target = zombie:getTarget();
  48.     if not target then
  49.         return;
  50.     end
  51.  
  52.     -- Shriek in the first 5 seconds a player target is spotted
  53.     if instanceof(target, "IsoPlayer") then
  54.         print("Shriek at player " .. target:getUsername());
  55.         --makeNoise(zombie);
  56.     end
  57. end
  58.  
  59. Events.OnZombieUpdate.Add(Shrieker_Update);
Advertisement
Add Comment
Please, Sign In to add comment