Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- security = or {
- validGuards = {
- "a baleful apostate";
- "a flail-wielding knight";
- "a Blackrock cleric";
- "a malignant baalhuezen";
- "a salamandrin legionnaire";
- "a Khaal Theurgist"
- };
- guards = security.guards or {};
- addedGuards = security.addedGuards or {};
- }
- function guardCapture()
- security = security or {}
- newGuards = {}
- local location = tostring(gmcp.Room.Info.num)
- local _items = gmcp.Char.Items.List.items
- guardAdded = tonumber("0")
- for k,v in pairs(_items) do
- if table.contains(security.validGuards, v.name) and not security.guards[location] then
- cecho("\n<white>[ <cyan>S E C U R I T Y<white> ]<grey> : Room Added: <white>"..location)
- security.guards[location] = {}
- security.addedGuards[location] = {}
- table.insert(security.guards[location], 1, v.name)
- table.insert(security.addedGuards[location], 1, v.id)
- table.insert(newGuards, 1, v.name)
- guardAdded = guardAdded + 1
- elseif table.contains(security.validGuards, v.name) and security.guards[location] and not table.contains(security.addedGuards[location], v.id) then
- table.insert(security.guards[location], 1, v.name)
- table.insert(security.addedGuards[location], 1, v.id)
- table.insert(newGuards, 1, v.name)
- guardAdded = guardAdded + 1
- end
- end
- if guardAdded > 1 then
- cecho("\n<white>[ <cyan>S E C U R I T Y<white> ]<grey> : Guards Added: <white>" .. table.concat(newGuards, ", "))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement