Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. security = or {
  2.  
  3. validGuards = {
  4. "a baleful apostate";
  5. "a flail-wielding knight";
  6. "a Blackrock cleric";
  7. "a malignant baalhuezen";
  8. "a salamandrin legionnaire";
  9. "a Khaal Theurgist"
  10.  
  11. };
  12.  
  13. guards = security.guards or {};
  14.  
  15. addedGuards = security.addedGuards or {};
  16.  
  17. }
  18.  
  19. function guardCapture()
  20. security = security or {}
  21. newGuards = {}
  22. local location = tostring(gmcp.Room.Info.num)
  23. local _items = gmcp.Char.Items.List.items
  24. guardAdded = tonumber("0")
  25. for k,v in pairs(_items) do
  26. if table.contains(security.validGuards, v.name) and not security.guards[location] then
  27. cecho("\n<white>[ <cyan>S E C U R I T Y<white> ]<grey> : Room Added: <white>"..location)
  28. security.guards[location] = {}
  29. security.addedGuards[location] = {}
  30. table.insert(security.guards[location], 1, v.name)
  31. table.insert(security.addedGuards[location], 1, v.id)
  32. table.insert(newGuards, 1, v.name)
  33. guardAdded = guardAdded + 1
  34. elseif table.contains(security.validGuards, v.name) and security.guards[location] and not table.contains(security.addedGuards[location], v.id) then
  35. table.insert(security.guards[location], 1, v.name)
  36. table.insert(security.addedGuards[location], 1, v.id)
  37. table.insert(newGuards, 1, v.name)
  38. guardAdded = guardAdded + 1
  39. end
  40. end
  41. if guardAdded > 1 then
  42. cecho("\n<white>[ <cyan>S E C U R I T Y<white> ]<grey> : Guards Added: <white>" .. table.concat(newGuards, ", "))
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement