content
stringlengths 5
1.05M
|
---|
require("code.entities-and-paths")
require("code.fancy-trees")
require("code.map-tiles-code")
|
--[=[
@c TextChannel x Channel
@t abc
@d Defines the base methods and properties for all Discord text channels.
]=]
local pathjoin = require('pathjoin')
local Channel = require('containers/abstract/Channel')
local Message = require('containers/Message')
local WeakCache = require('iterables/WeakCache')
local SecondaryCache = require('iterables/SecondaryCache')
local Resolver = require('client/Resolver')
local fs = require('fs')
local splitPath = pathjoin.splitPath
local insert, remove, concat = table.insert, table.remove, table.concat
local format = string.format
local readFileSync = fs.readFileSync
local TextChannel, get = require('class')('TextChannel', Channel)
function TextChannel:__init(data, parent)
Channel.__init(self, data, parent)
self._messages = WeakCache({}, Message, self)
end
--[=[
@m getMessage
@t http
@p id Message-ID-Resolvable
@r Message
@d Gets a message object by ID. If the object is already cached, then the cached
object will be returned; otherwise, an HTTP request is made.
]=]
function TextChannel:getMessage(id)
id = Resolver.messageId(id)
local message = self._messages:get(id)
if message then
return message
else
local data, err = self.client._api:getChannelMessage(self._id, id)
if data then
return self._messages:_insert(data)
else
return nil, err
end
end
end
--[=[
@m getFirstMessage
@t http
@r Message
@d Returns the first message found in the channel, if any exist. This is not a
cache shortcut; an HTTP request is made each time this method is called.
]=]
function TextChannel:getFirstMessage()
local data, err = self.client._api:getChannelMessages(self._id, {after = self._id, limit = 1})
if data then
if data[1] then
return self._messages:_insert(data[1])
else
return nil, 'Channel has no messages'
end
else
return nil, err
end
end
--[=[
@m getLastMessage
@t http
@r Message
@d Returns the last message found in the channel, if any exist. This is not a
cache shortcut; an HTTP request is made each time this method is called.
]=]
function TextChannel:getLastMessage()
local data, err = self.client._api:getChannelMessages(self._id, {limit = 1})
if data then
if data[1] then
return self._messages:_insert(data[1])
else
return nil, 'Channel has no messages'
end
else
return nil, err
end
end
local function getMessages(self, query)
local data, err = self.client._api:getChannelMessages(self._id, query)
if data then
return SecondaryCache(data, self._messages)
else
return nil, err
end
end
--[=[
@m getMessages
@t http
@op limit number
@r SecondaryCache
@d Returns a newly constructed cache of between 1 and 100 (default = 50) message
objects found in the channel. While the cache will never automatically gain or
lose objects, the objects that it contains may be updated by gateway events.
]=]
function TextChannel:getMessages(limit)
return getMessages(self, limit and {limit = limit})
end
--[=[
@m getMessagesAfter
@t http
@p id Message-ID-Resolvable
@op limit number
@r SecondaryCache
@d Returns a newly constructed cache of between 1 and 100 (default = 50) message
objects found in the channel after a specific id. While the cache will never
automatically gain or lose objects, the objects that it contains may be updated
by gateway events.
]=]
function TextChannel:getMessagesAfter(id, limit)
id = Resolver.messageId(id)
return getMessages(self, {after = id, limit = limit})
end
--[=[
@m getMessagesBefore
@t http
@p id Message-ID-Resolvable
@op limit number
@r SecondaryCache
@d Returns a newly constructed cache of between 1 and 100 (default = 50) message
objects found in the channel before a specific id. While the cache will never
automatically gain or lose objects, the objects that it contains may be updated
by gateway events.
]=]
function TextChannel:getMessagesBefore(id, limit)
id = Resolver.messageId(id)
return getMessages(self, {before = id, limit = limit})
end
--[=[
@m getMessagesAround
@t http
@p id Message-ID-Resolvable
@op limit number
@r SecondaryCache
@d Returns a newly constructed cache of between 1 and 100 (default = 50) message
objects found in the channel around a specific point. While the cache will never
automatically gain or lose objects, the objects that it contains may be updated
by gateway events.
]=]
function TextChannel:getMessagesAround(id, limit)
id = Resolver.messageId(id)
return getMessages(self, {around = id, limit = limit})
end
--[=[
@m getPinnedMessages
@t http
@r SecondaryCache
@d Returns a newly constructed cache of up to 50 messages that are pinned in the
channel. While the cache will never automatically gain or lose objects, the
objects that it contains may be updated by gateway events.
]=]
function TextChannel:getPinnedMessages()
local data, err = self.client._api:getPinnedMessages(self._id)
if data then
return SecondaryCache(data, self._messages)
else
return nil, err
end
end
--[=[
@m broadcastTyping
@t http
@r boolean
@d Indicates in the channel that the client's user "is typing".
]=]
function TextChannel:broadcastTyping()
local data, err = self.client._api:triggerTypingIndicator(self._id)
if data then
return true
else
return false, err
end
end
local function parseFile(obj, files)
if type(obj) == 'string' then
local data, err = readFileSync(obj)
if not data then
return nil, err
end
files = files or {}
insert(files, {remove(splitPath(obj)), data})
elseif type(obj) == 'table' and type(obj[1]) == 'string' and type(obj[2]) == 'string' then
files = files or {}
insert(files, obj)
else
return nil, 'Invalid file object: ' .. tostring(obj)
end
return files
end
local function parseMention(obj, mentions)
if type(obj) == 'table' and obj.mentionString then
mentions = mentions or {}
insert(mentions, obj.mentionString)
else
return nil, 'Unmentionable object: ' .. tostring(obj)
end
return mentions
end
--[=[
@m send
@t http
@p content string/table
@r Message
@d Sends a message to the channel. If `content` is a string, then this is simply
sent as the message content. If it is a table, more advanced formatting is
allowed. See [[managing messages]] for more information.
]=]
function TextChannel:send(content)
local data, err
if type(content) == 'table' then
local tbl = content
content = tbl.content
if type(tbl.code) == 'string' then
content = format('```%s\n%s\n```', tbl.code, content)
elseif tbl.code == true then
content = format('```\n%s\n```', content)
end
local mentions
if tbl.mention then
mentions, err = parseMention(tbl.mention)
if err then
return nil, err
end
end
if type(tbl.mentions) == 'table' then
for _, mention in ipairs(tbl.mentions) do
mentions, err = parseMention(mention, mentions)
if err then
return nil, err
end
end
end
if mentions then
insert(mentions, content)
content = concat(mentions, ' ')
end
local embeds
if tbl.embed then
embeds = {tbl.embed}
end
if type(tbl.embeds) == 'table' and #tbl.embeds > 0 then
embeds = tbl.embeds
end
local files
if tbl.file then
files, err = parseFile(tbl.file)
if err then
return nil, err
end
end
if type(tbl.files) == 'table' then
for _, file in ipairs(tbl.files) do
files, err = parseFile(file, files)
if err then
return nil, err
end
end
end
local refMessage, refMention
if tbl.reference then
refMessage = {message_id = Resolver.messageId(tbl.reference.message)}
refMention = {
parse = {'users', 'roles', 'everyone'},
replied_user = not not tbl.reference.mention,
}
end
data, err = self.client._api:createMessage(self._id, {
content = content,
tts = tbl.tts,
nonce = tbl.nonce,
embeds = embeds,
message_reference = refMessage,
allowed_mentions = refMention,
}, files)
else
data, err = self.client._api:createMessage(self._id, {content = content})
end
if data then
return self._messages:_insert(data)
else
return nil, err
end
end
--[=[
@m sendf
@t http
@p content string
@p ... *
@r Message
@d Sends a message to the channel with content formatted with `...` via `string.format`
]=]
function TextChannel:sendf(content, ...)
local data, err = self.client._api:createMessage(self._id, {content = format(content, ...)})
if data then
return self._messages:_insert(data)
else
return nil, err
end
end
--[=[@p messages WeakCache An iterable weak cache of all messages that are
visible to the client. Messages that are not referenced elsewhere are eventually
garbage collected. To access a message that may exist but is not cached,
use `TextChannel:getMessage`.]=]
function get.messages(self)
return self._messages
end
return TextChannel
|
local tinsert = table.insert
local Route = {
map = {
get = {},
post = {}
}
}
function Route.register(self, app, url, callback, method)
if method == "GET" then
tinsert(self.map.get, {url, callback})
elseif method == "POST" then
tinsert(self.map.post, {url, callback})
end
end
function Route.getInstance(self)
local instance = {}
instance.__call = self.register
setmetatable(self, instance)
return Route
end
function Route.get(self)
local url = self.req.cmd_url
--local url = ngx.var.request_uri
local map = self.map.get
for k,v in pairs(map) do
local ret = self:match(url, map[k][1])
if ret then
return map[k][2]
end
end
end
function Route.post(self)
local url = self.req.cmd_url
for k,v in pairs(self.map.post) do
if self.map.post[k][1] == url then
return self.map.post[k][2]
end
end
end
function Route.finder(self)
local method = self.req.cmd_meth
local ftbl = {
GET=self.get,
POST=self.post
}
local ret = ftbl[method](self)
return ret
end
function Route.match(self, src, dst)
local ret = string.find(src, dst)
return ret
end
return Route
|
-- 2lazy so i'll just paste ancient fframe code
local FRAME = {}
local greyed = Color(80, 80, 80)
local borderWide = Color(0, 0, 0, 150)
local border = Color(10, 10, 10)
local close_hov = Color(235, 90, 90)
local close_unhov = Color(205, 50, 50)
local function LC(col, dest, vel)
local v = vel or 10
if not IsColor(col) or not IsColor(dest) then return end
col.r = Lerp(FrameTime() * v, col.r, dest.r)
col.g = Lerp(FrameTime() * v, col.g, dest.g)
col.b = Lerp(FrameTime() * v, col.b, dest.b)
if dest.a ~= col.a then
col.a = Lerp(FrameTime() * v, col.a, dest.a)
end
return col
end
function FRAME:Init()
self:SetSize(128, 128)
self:Center()
self:SetTitle("")
self:ShowCloseButton(false)
local w = self:GetWide()
local b = vgui.Create("DButton", self)
self.CloseButton = b
b:SetPos(w - 64 - 4, 4)
b:SetSize(64, 20) --28)
b:SetText("")
b.Color = Color(205, 50, 50)
function b:Paint(w, h)
b.Color = LC(b.Color,
(self.PreventClosing and greyed) or (self:IsHovered() and close_hov) or close_unhov, 15)
draw.RoundedBox(4, 0, 0, w, h, b.Color)
end
b.DoClick = function()
if self.PreventClosing then return end
local ret = self:OnClose()
if ret == false then return end
if self:GetDeleteOnClose() then
self:Remove()
else
self:Hide()
end
end
self.m_bCloseButton = b
self.HeaderSize = 24 --32
-- gmod dframes have a 24px draggable header hardcoded
-- im not copypasting the entire Think for proper headers, not here
self.BackgroundColor = Color(50, 50, 50)
self.HeaderColor = Color(40, 40, 40, 255)
self:DockPadding(4, self.HeaderSize + 4, 4, 4)
end
function FRAME:OnClose() end
function FRAME:PerformLayout()
if not self.m_bCloseButton then return end
self.m_bCloseButton:SetPos(self:GetWide() - self.m_bCloseButton:GetWide() - 4, 2)
end
function FRAME.DrawHeaderPanel(self, w, h, x, y)
local rad = 4
local hc = self.HeaderColor
local bg = self.BackgroundColor
x = x or 0
y = y or 0
local hh = self.HeaderSize
local tops = true
-- add a cheap fuckoff border cuz no shadows
local bSz = 2
local p = DisableClipping(true)
draw.RoundedBoxEx(rad, x - bSz, y - bSz, w + bSz * 2, h + bSz * 2, borderWide, tops, tops, true, true)
bSz = bSz / 2
draw.RoundedBoxEx(rad, x - bSz, y - bSz, w + bSz * 2, h + bSz * 2, border, tops, tops, true, true)
if not p then DisableClipping(false) end
if hh > 0 then
draw.RoundedBoxEx(self.HRBRadius or rad, x, y, w, hh, hc, true, true)
tops = false
end
draw.RoundedBoxEx(rad, x, y + hh, w, h - hh, bg, tops, tops, true, true)
end
function FRAME:Paint(w, h)
return self:DrawHeaderPanel(w, h)
end
vgui.Register("PhysFrame", FRAME, "DFrame") |
local PANEL = {}
function PANEL:Init()
local width = ScrW() * 0.3
AdvNut.util.DrawBackgroundBlur(self);
self.IsKeepOpen = false;
timer.Simple(0.5, function()
if(LocalPlayer():KeyDown(IN_SCORE)) then
self.IsKeepOpen = true;
end;
end);
self:SetSize(width, ScrH())
self:SetPos(-width, 0)
self:SetPaintBackground(false)
self:MakePopup()
self:MoveTo(0, 0, 0.3, 0, 0.15)
self.closeGrace = RealTime() + 0.5
self.Paint = function(panel, w, h)
surface.SetDrawColor(10, 10, 10, 0)
surface.DrawRect(0, 0, w, h)
end
self.buttonList = self:Add("AdvNut_ScrollPanel")
self.buttonList:Dock(LEFT)
self.buttonList:DockMargin(40, 42.5, 0, 1)
self.buttonList:SetWide(ScrW() * 0.2)
self.buttonList:SetDrawBackground(false);
local function addButton(id, text, onClick, font)
local button = self.buttonList:Add("nut_MenuButton");
local usingFont = "nut_MenuButtonFont";
if(font != nil) then
usingFont = font;
end
button:SetText(text)
button:SetFont(usingFont);
button:DockMargin(50, 0, 20, 2)
button:SetTall(30)
button.OnClick = onClick
self[id] = button
end
self.close = self.buttonList:Add("nut_MenuButton")
self.close:SetFont("nut_BigMenuButtonFont");
self.close:SetText(nut.lang.Get("return"))
self.close:SetTall(48)
self.close.OnClick = function()
self:Close();
end
self.close:DockMargin(50, 64, 140, 30)
addButton("char", nut.lang.Get("characters"), function()
nut.gui.charMenu = vgui.Create("nut_CharMenu")
self:Close();
end, "nut_BigMenuButtonFont");
self.char:DockMargin(50, -40, 150, 20)
self.currentMenu = NULL
addButton("att", nut.lang.Get("attribute"), function()
nut.gui.att = vgui.Create("nut_Attribute", self)
self:SetCurrentMenu(nut.gui.att)
end)
if (nut.config.businessEnabled and nut.schema.Call("PlayerCanSeeBusiness")) then
addButton("business", nut.lang.Get("business"), function()
nut.gui.business = vgui.Create("nut_Business", self)
self:SetCurrentMenu(nut.gui.business)
end)
end
local count = 0
for k, v in SortedPairs(nut.class.GetByFaction(LocalPlayer():Team())) do
if (LocalPlayer():CharClass() != k and v:PlayerCanJoin(LocalPlayer())) then
count = count + 1
end
end
if (count > 0 and nut.config.classmenuEnabled) then
addButton("classes", nut.lang.Get("classes"), function()
nut.gui.classes = vgui.Create("nut_Classes", self)
self:SetCurrentMenu(nut.gui.classes)
end)
end
addButton("inv", nut.lang.Get("inventory"), function()
nut.gui.inv = vgui.Create("nut_Inventory", self)
self:SetCurrentMenu(nut.gui.inv)
end)
if(AdvNut.hook.Run("ShowMenuScoreboard")) then
addButton("sb", nut.lang.Get("scoreboard"), function()
nut.gui.sb = vgui.Create("nut_Scoreboard", self)
self:SetCurrentMenu(nut.gui.sb)
end)
end
nut.schema.Call("CreateMenuButtons", self, addButton);
if (LocalPlayer():IsSuperAdmin()) then
addButton("system", nut.lang.Get("system"), function()
nut.gui.system = vgui.Create("AdvNut_System", self);
self:SetCurrentMenu(nut.gui.system);
end);
end;
addButton("help", nut.lang.Get("help"), function()
nut.gui.help = vgui.Create("nut_Help", self)
self:SetCurrentMenu(nut.gui.help)
end)
addButton("settings", nut.lang.Get("settings"), function()
nut.gui.settings = vgui.Create("nut_Settings", self)
self:SetCurrentMenu(nut.gui.settings)
end)
end
function PANEL:Think()
if(!LocalPlayer():KeyDown(IN_SCORE) and IsValid(self) and self.IsKeepOpen) then
self:Close();
end;
end;
function PANEL:OnKeyCodePressed(key)
if (self.closeGrace <= RealTime() and key == KEY_TAB) then
self:Close();
end
end
function PANEL:SetCurrentMenu(panel, noAnim)
if (noAnim) then
self.currentMenu = panel
else
local transitionTime = 0.2
if (IsValid(self.currentMenu)) then
local x, y = self.currentMenu:GetPos()
local menu = self.currentMenu
menu:MoveTo(x, ScrH() * 1.25, transitionTime, 0, 0.5)
timer.Simple(0.2, function()
if (IsValid(menu)) then
if (menu.Close) then
menu:Close();
else
menu:Remove();
end;
end
end)
end
if (IsValid(panel)) then
local x, y = panel:GetPos()
local w, h = panel:GetSize()
panel:SetPos(x, -h)
panel:MoveTo(x, y, transitionTime, 0.15, 0.5)
self.currentMenu = panel
end
end
end
function PANEL:CloseCurrentMenu()
if (IsValid(self.currentMenu)) then
local x, y = self.currentMenu:GetPos()
self.currentMenu:MoveTo(x, ScrH(), 0.225, 0, 0.125, function()
if (self.currentMenu.Close) then
self.currentMenu:Close();
else
self.currentMenu:Remove();
end;
end);
end
end;
function PANEL:Close()
if(!IsValid(self) or self.CloseWait) then
return;
else
self.CloseWait = true;
AdvNut.util.RemoveBackgroundBlur(self);
surface.PlaySound("ui/buttonrollover.wav")
CloseDermaMenus();
local width = ScrW() * 0.3
self:MoveTo(-width, 0, 0.3, 0);
self:CloseCurrentMenu();
timer.Simple(0.3, function()
self:Remove();
self.CloseWait = false;
end);
end
end
function PANEL:Paint(w, h)
local x, y = self:GetPos()
x = x + ScrW()
surface.SetDrawColor(10, 10, 10, 200)
surface.SetTexture(gradient)
surface.DrawTexturedRect(x, y, ScrW() * 0.1, ScrH())
end
vgui.Register("nut_menu", PANEL, "DPanel")
function PANEL:ScoreboardShow()
if (IsValid(nut.gui.menu)) then
nut.gui.menu:Close();
elseif (IsValid(nut.gui.quickRecognition)) then
return;
else
if (IsValid(nut.gui.charInfo)) then
nut.gui.charInfo:Close()
end
surface.PlaySound("ui/buttonclick.wav");
nut.gui.menu = vgui.Create("nut_menu");
end
end
AdvNut.hook.Add("ScoreboardShow", "MenuKeyBinding", PANEL.ScoreboardShow); |
local requires = require('src.requires')
local log = require('src.log')()
local fs = require('src.fs')
local cmd = require('src.command')('init', 'initialize chunk', function(args)
if args:has_flag('global') then
current_directory = lcm_home
end
requires:unsilence()
if args:has_flag('silent') then
requires:silence()
log:silence()
end
if not args:has_flag('loader') then
local code, path = requires:chunkfile(current_directory)
if code ~= requires.EXISTS then
local content = fs.get_file_content(lcm_directory .. '/tpl/chunkfile.lua')
fs.put_file_content(path, content)
log:print(string.format('"%s" written', path))
end
end
if not args:has_flag('loader') and not args:has_flag('chunkfile') then
local code, path = requires:mapfile(current_directory)
if code ~= requires.EXISTS then
local content = fs.get_file_content(lcm_directory .. '/tpl/map.lua')
fs.put_file_content(path, content)
log:print(string.format('"%s" written', path))
end
end
if not args:has_flag('chunkfile') then
local code, path = requires:loader(current_directory)
if code ~= requires.EXISTS then
local content = fs.get_file_content(lcm_directory .. '/tpl/load.lua')
fs.put_file_content(path, content)
log:print(string.format('"%s" written', path))
end
end
end)
cmd:add_flag('global', 'run command in LCM_HOME')
cmd:add_flag('silent', 'omit any output')
cmd:add_flag('loader', 'create only lib/load.lua')
cmd:add_flag('chunkfile', 'create only chunkfile.lua')
return cmd |
#!/usr/bin/env lua
-------------------------------------------------------------------------------
-- Description: unit test file for iptable
-------------------------------------------------------------------------------
package.cpath = "./build/?.so;"
F = string.format
describe("iptable object length: ", function()
expose("ipt obj: ", function()
iptable = require("iptable");
assert.is_truthy(iptable);
ipt = iptable.new();
assert.is_truthy(ipt);
it("counts ipv4 prefixes", function()
ipt["10.10.10.10/24"] = 24;
assert.is_equal(1, #ipt);
ipt["11.11.11.11/24"] = 42;
assert.is_equal(2, #ipt);
end)
it("counts ipv6 prefixes", function()
ipt = iptable.new()
ipt["2f::/64"] = 64;
ipt["2f::/104"] = 104;
ipt["3f::/14"] = 14;
assert.is_equal(3, #ipt);
local v4, v6 = ipt:counts();
assert.is_equal(0, v4);
assert.is_equal(3, v6);
end)
it("counts both ipv4 and ipv6 prefixes", function()
ipt = iptable.new()
ipt["10.10.10.10/24"] = 24;
ipt["11.11.11.11/24"] = 42;
ipt["2f::/64"] = 64;
ipt["2f::/104"] = 104;
ipt["3f::/14"] = 14;
assert.is_equal(5, #ipt);
end)
end)
end)
|
--加载socket网络库
local socket = require "socket"
-- 创建udp连接
local udp = socket.udp()
-- socket按块来读取数据,直到数据里有信息为止,或者等待一段时间
-- 这显然不符合游戏的要求,所以把等待时间设为0
udp:settimeout(0)
-- 和客户端不同,服务器必须知道它绑定的端口,否则客户号将永远找不到它。
--绑定主机地址和端口
--“×”则表示所有地址;端口为数字(0----65535)。
--由于0----1024是某些系统保留端口,请使用大于1024的端口。
udp:setsockname('*', 12345)
local world = {} -- the empty world-state
-- 下面这些变量会用在主循环里
local data, msg_or_ip, port_or_nil
local entity, cmd, parms
--下面开始一个无限循环,因为服务端要一直等带客户端的连接
local running = true
-- 循环开始
print "Beginning server loop."
while running do
--从客户端接受消息
data, msg_or_ip, port_or_nil = udp:receivefrom()
if data then
entity, cmd, parms = data:match("^(%S*) (%S*) (.*)")
if cmd == 'move' then
local x, y = parms:match("^(%-?[%d.e]*) (%-?[%d.e]*)$")
assert(x and y) -- 验证x,y是否都不为nil
--记得x,y还是字符串,要转换为数字
x, y = tonumber(x), tonumber(y)
--
local ent = world[entity] or {x=0, y=0}
world[entity] = {x=ent.x+x, y=ent.y+y}
elseif cmd == 'at' then
local x, y = parms:match("^(%-?[%d.e]*) (%-?[%d.e]*)$")
assert(x and y)
x, y = tonumber(x), tonumber(y)
world[entity] = {x=x, y=y}
elseif cmd == 'update' then
for k, v in pairs(world) do
--发送给客户端
udp:sendto(string.format("%s %s %d %d", k, 'at', v.x, v.y), msg_or_ip, port_or_nil)
end
elseif cmd == 'quit' then
running = false;
else
print("unrecognised command:", cmd)
end
elseif msg_or_ip ~= 'timeout' then
error("Unknown network error: "..tostring(msg))
end
socket.sleep(0.01)
end
print "Thank you."
|
--!A cross-platform build utility based on Lua
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-- Copyright (C) 2015-present, TBOOX Open Source Group.
--
-- @author ruki
-- @file amalgamate.lua
--
-- imports
import("core.base.option")
import("core.project.config")
import("core.project.task")
import("core.project.project")
-- the options
local options =
{
{'u', "uniqueid", "kv", nil, "Set the unique id." },
{'o', "outputdir", "kv", nil, "Set the output directory."},
{nil, "target", "v", nil, "The target name." }
}
-- generate code
function _generate_amalgamate_code(target, opt)
-- only for library/binary
if not target:is_library() and not target:is_binary() then
return
end
-- generate source code
local outputdir = opt.outputdir
local uniqueid = opt.uniqueid
for _, sourcebatch in pairs(target:sourcebatches()) do
local sourcekind = sourcebatch.sourcekind
if sourcekind == "cc" or sourcekind == "cxx" then
local outputpath = path.join(outputdir, target:name() .. (sourcekind == "cxx" and ".cpp" or ".c"))
local outputfile = io.open(outputpath, "w")
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
if uniqueid then
outputfile:print("#define %s %s", uniqueid, "unity_" .. hash.uuid():split("-", {plain = true})[1])
end
outputfile:write(io.readfile(sourcefile))
if uniqueid then
outputfile:print("#undef %s", uniqueid)
end
end
outputfile:close()
cprint("${bright}%s generated!", outputpath)
end
end
-- generate header file
local srcheaders = target:headerfiles(includedir)
if srcheaders and #srcheaders > 0 then
local outputpath = path.join(outputdir, target:name() .. ".h")
local outputfile = io.open(outputpath, "w")
for _, srcheader in ipairs(srcheaders) do
if uniqueid then
outputfile:print("#define %s %s", uniqueid, "unity_" .. hash.uuid():split("-", {plain = true})[1])
end
outputfile:write(io.readfile(srcheader))
if uniqueid then
outputfile:print("#undef %s", uniqueid)
end
end
outputfile:close()
cprint("${bright}%s generated!", outputpath)
end
end
-- generate amalgamate code
--
-- https://github.com/xmake-io/xmake/issues/1438
--
function main(...)
-- parse arguments
local argv = table.pack(...)
local args = option.parse(argv, options, "Generate amalgamate code.",
"",
"Usage: xmake l cli.amalgamate [options]")
-- config first
task.run("config")
-- generate amalgamate code
args.outputdir = args.outputdir or config.buildir()
if args.target then
_generate_amalgamate_code(args.target, args)
else
for _, target in ipairs(project.ordertargets()) do
_generate_amalgamate_code(target, args)
end
end
end
|
require "ConditionalSpeech__Core"
--- Filter Template
--[[
function ConditionalSpeech_Filter.TEMPLATE(text, intensity)
--volume shift is optional to include
local volumeShift = 0
--- Actual filter stuff here
local results = filterResults:new(text,volumeShift)
return results
end
end
]]
--- Object type for filter results handling
---@class filterResults : ISBaseObject
filterResults = ISBaseObject:derive("filterResults")
---@param return_text string @text being returned after text has been filtered
---@param return_vol number @volume value
---@return self
function filterResults:new(return_text,return_vol)
local o = {}
setmetatable(o, self)
self.__index = self
o.return_text = return_text
o.return_vol = return_vol
return o
end
--- Blurt Out
function ConditionalSpeech_Filter.BlurtOut(text, intensity)
local volumeShift = 0
if is_prob(((intensity^2)+intensity)*4) then
volumeShift = VolumeMAX/5
end
local results = filterResults:new(text,volumeShift)
return results
end
--- SCREAM FILTER!
function ConditionalSpeech_Filter.SCREAM(text, intensity)
local volumeShift = VolumeMAX/2
text = text:gsub("%.", "%!")
if is_prob(((intensity^2)+intensity)*4) then
volumeShift = VolumeMAX
end
local results = filterResults:new(text,volumeShift)
return results
end
--- S-s-s-stutter Filter -- impacts leading letters
function ConditionalSpeech_Filter.Stutter(text, intensity)
local words = luautils.split(text)
local post_words = {}
local max_stutter = intensity
for _,value in pairs(words) do
local w = value
local fc = string.sub(w, 1,1) --fc=first character
if max_stutter > 0 and is_valueIn(ConditionalSpeech.Phrases.Plosives,fc) then
max_stutter = max_stutter-1
local chance = intensity*16
while chance > 0 do
if is_prob(chance) then
w = fc .. "-" .. w
end
chance = chance-(31+ZombRand(15))
end
end
table.insert(post_words, w)
end
text = table.concat(post_words," ")
local results = filterResults:new(text)
return results
end
--- S-s-stammer-r-r Filt-t-t-ter -- impacts throughout
function ConditionalSpeech_Filter.Stammer(text, intensity)
local characters = splitText_byChar(text)
local post_characters = {}
local max_stammer = intensity
for _,value in pairs(characters) do
local c = value
if max_stammer > 0 and is_valueIn(ConditionalSpeech.Phrases.Plosives,c) then
local chance = intensity*8
max_stammer = max_stammer-1
while chance > 0 do
if is_prob(chance) then c = c .. "-" .. c end
chance = chance-(31+ZombRand(15))
end
end
table.insert(post_characters, c)
end
text = table.concat(post_characters)
local results = filterResults:new(text)
return results
end
--- Logic for repeated swearing
function ConditionalSpeech_Filter.panicSwear(text, intensity)
local randswear = RangedRandPick(ConditionalSpeech.Phrases.SWEAR,intensity,4)
if randswear then
randswear = randswear .. "."
local chance = intensity*15
while chance > 0 do
if is_prob(chance) then randswear = randswear .. " " .. randswear end
chance = chance-(31+ZombRand(10))
end
if is_prob(50) then
text = randswear .. " " .. text
else
text = text .. " " .. randswear --50% before or after text
end
end
local results = filterResults:new(text)
return results
end
--- Fucking Logic for fucking interlaced Fucks
function ConditionalSpeech_Filter.interlacedFucks(text, intensity)
local skip_words = ConditionalSpeech.Phrases.SWEARskipwords
local words = luautils.split(text)
if #words <= 1 then
return text
end
for key,value in pairs(words) do
if key ~= #words and is_prob(5*intensity) then
if not is_valueIn(skip_words,words[key+1]) then
local swear = ConditionalSpeech.Phrases.FUCKS[1]
if is_valueIn(skip_words,words[key]) then
swear = ConditionalSpeech.Phrases.FUCKS[2]
end
if swear then
words[key] = value .. " " .. swear
end
end
end
end
text = table.concat(words, " ")
local results = filterResults:new(text)
return results
end
|
---@class ac.LightPollution
---@field position vec3
---@field radius number @Radius in meters.
---@field tint rgb
---@field density number
ffi.cdef [[ typedef struct { vec3 position; float radius; rgb tint; float density; } light_pollution; ]]
ac.LightPollution = ffi.metatype('light_pollution', {
__index = {},
__tostring = function(v)
return string.format('(position=%s, radius=%f, density=%f, tint=%s)', v.position, v.radius, v.density, v.tint)
end,
}) |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('StoryBit', {
ActivationEffects = {},
Disables = {
"Boost20_DronePrototypes_BreakDrone",
},
Effects = {},
Prerequisites = {},
ScriptDone = true,
SuppressTime = 1500000,
Text = T(250911336687, --[[StoryBit Boost20_DronePrototypes_Finale Text]] "Let’s hope they got it right this time. They have offered <number_of_drones> more Drones as compensation for our troubles."),
TextReadyForValidation = true,
TextsDone = true,
VoicedText = T(160908280172, --[[voice:narrator]] "A patch is ready to be downloaded from Alpenglow Robotix’s servers, carrying with it the promise of fixing the mess they brought upon us with the previous version of their Drones’ software."),
group = "Pre-Founder Stage",
id = "Boost20_DronePrototypes_Finale",
max_reply_id = 3,
qa_info = PlaceObj('PresetQAInfo', {
data = {
{
action = "Modified",
time = 1549883088,
user = "Boyan",
},
{
action = "Modified",
time = 1549978863,
user = "Kmilushev",
},
{
action = "Verified",
time = 1549979638,
user = "Kmilushev",
},
{
action = "Modified",
time = 1550049900,
user = "Boyan",
},
{
action = "Modified",
time = 1550491863,
user = "Boyan",
},
{
action = "Modified",
time = 1550494320,
user = "Blizzard",
},
},
}),
PlaceObj('StoryBitParamNumber', {
'Name', "number_of_drones",
'Value', 8,
}),
PlaceObj('StoryBitParamFunding', {
'Name', "reparations",
'Value', 500000000,
}),
PlaceObj('StoryBitReply', {
'Text', T(640631201207, --[[StoryBit Boost20_DronePrototypes_Finale Text]] "Goodbye and thanks for all the drones!"),
'OutcomeText', "custom",
'CustomOutcomeText', T(439360708972, --[[StoryBit Boost20_DronePrototypes_Finale CustomOutcomeText]] "Supply pod with <number_of_drones> drones"),
'unique_id', 1,
}),
PlaceObj('StoryBitOutcome', {
'Prerequisites', {},
'Effects', {
PlaceObj('SpawnRocketInOrbit', {
'is_supply_pod', true,
'cargo_list', {
PlaceObj('RocketCargoItem', {
'cargo', "Drone",
'amount', 8,
}),
},
'AssociateWithStoryBit', false,
}),
},
}),
PlaceObj('StoryBitReply', {
'Text', T(325632281085, --[[StoryBit Boost20_DronePrototypes_Finale Text]] "We prefer to get an RC Commander instead."),
'OutcomeText', "custom",
'CustomOutcomeText', T(531022342862, --[[StoryBit Boost20_DronePrototypes_Finale CustomOutcomeText]] "Supply pod with an RC Commander"),
'unique_id', 2,
}),
PlaceObj('StoryBitOutcome', {
'Prerequisites', {},
'Effects', {
PlaceObj('SpawnRocketInOrbit', {
'is_supply_pod', true,
'cargo_list', {
PlaceObj('RocketCargoItem', {
'cargo', "RCRover",
'amount', 1,
}),
},
'AssociateWithStoryBit', false,
}),
},
}),
PlaceObj('StoryBitReply', {
'Text', T(639953872404, --[[StoryBit Boost20_DronePrototypes_Finale Text]] "They should provide some financial compensation as well."),
'OutcomeText', "custom",
'CustomOutcomeText', T(376706762847, --[[StoryBit Boost20_DronePrototypes_Finale CustomOutcomeText]] "Supply pod with <number_of_drones> drones AND <funding(reparations)>"),
'Prerequisite', PlaceObj('IsCommander', {
'CommanderProfile', "politician",
}),
'unique_id', 3,
}),
PlaceObj('StoryBitOutcome', {
'Prerequisites', {},
'Effects', {
PlaceObj('SpawnRocketInOrbit', {
'is_supply_pod', true,
'cargo_list', {
PlaceObj('RocketCargoItem', {
'cargo', "Drone",
'amount', 8,
}),
},
'AssociateWithStoryBit', false,
}),
PlaceObj('RewardFunding', {
'Amount', "<reparations>",
}),
},
}),
})
|
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by littlefogcat.
---
print("sc1")
_G = {}
foo = function()
print("modified!")
end
foo()
--observable = luajava.newInstance("top.littlefogcat.demolist.luaj.avoidoverride.Observable")
--
--callback = function()
-- --print("sc1 callback")
-- --foo()
--end
--
--foo = function()
-- print("modified!")
--end
--
--function hello()
-- print("hello")
--end
--
--observable:observe("sc1", callback) |
local opts = { noremap = true, silent = true }
vim.cmd("filetype plugin on")
-- Shorten function name
local map = vim.api.nvim_set_keymap
-- Remap comma as leader key
map("", "<Space>", "<Nop>", opts)
vim.g.mapleader = ","
vim.g.maplocalleader = ","
-- other
map("n", "<Enter>", "o<Esc>", opts)
map("n", "<S-Enter>", "O<Esc>", opts)
map("n", "<BS>", "i<BS><Esc>", opts)
map("n", "<Del>", "i<Del><Esc>", opts)
-- basic navigations
map("n", "K", "/}<CR>b99]}", opts)
map("n", "J", "k$][%?}<CR>", opts)
map("n", "H", "^", opts)
map("n", "L", "$", opts)
map("i", "<C-h>", "<Left>", opts)
map("i", "<C-j>", "<Down>", opts)
map("i", "<C-k>", "<Up>", opts)
map("i", "<C-l>", "<Right>", opts)
map("i", "<A-j>", "<Esc>^i", opts)
map("i", "<A-k>", "<Esc>$i", opts)
map("i", "<A-l>", "<C-Right>", opts)
map("i", "<A-h>", "<C-Left>", opts)
map("i", "<Left>", "<Nop>", opts)
map("i", "<Right>", "<Nop>", opts)
map("i", "<Up>", "<Nop>", opts)
map("i", "<Down>", "<Nop>", opts)
map("n", "<Left>", "<Nop>", opts)
map("n", "<Right>", "<Nop>", opts)
map("n", "<Up>", "<Nop>", opts)
map("n", "<Down>", "<Nop>", opts)
map("v", "<Left>", "<Nop>", opts)
map("v", "<Right>", "<Nop>", opts)
map("v", "<Up>", "<Nop>", opts)
map("v", "<Down>", "<Nop>", opts)
map("x", "<Left>", "<Nop>", opts)
map("x", "<Right>", "<Nop>", opts)
map("x", "<Up>", "<Nop>", opts)
map("x", "<Down>", "<Nop>", opts)
-- indentation
map("n", ">>", "<Nop>", opts)
map("n", ">>", "<Nop>", opts)
map("v", "<<", "<Nop>", opts)
map("v", "<<", "<Nop>", opts)
map("n", "<Tab>", ">>", opts)
map("n", "<S-Tab>", "<<", opts)
map("v", "<Tab>", ">><Esc>gv", opts)
map("v", "<S-Tab>", "<<<Esc>gv", opts)
-- buffer bars
map("n", "<Right>", ":BufferNext<CR>", opts)
map("n", "<Left>", ":BufferPrevious<CR>", opts)
map("i", "<Right>", "<Esc>:BufferNext<CR>", opts)
map("i", "<Left>", "<Esc>:BufferPrevious<CR>", opts)
-- system key maps
map("v", "<C-c>", '"+y', opts)
map("x", "<C-c>", '"+y', opts)
map("n", "<C-c>", 'V"+y', opts)
map("i", "<C-c>", '<Esc>V"+y', opts)
map("n", "<C-v>", '"+p', opts)
map("i", "<C-v>", '<Esc>"+p', opts)
map("v", "<C-x>", 'd', opts)
map("x", "<C-x>", 'd', opts)
map("n", "<C-x>", 'dd', opts)
map("i", "<C-x>", '<Esc>dd', opts)
map("n", "<C-z>", "u", opts)
map("i", "<C-z>", "<Esc>ui", opts)
-- nvim tree
map("n", "<leader>t", ":NvimTreeToggle<CR>", opts)
map("n", "<C-w>", "<C-w>w", opts)
-- delete buffers
map("n", "<leader>q", ":BufferClose<CR>", opts)
map("n", "<leader>s", ":wq!<CR>", opts)
-- move text lines
map("n", "<C-j>", "<Esc>:m .+1<CR>==gi<Esc>", opts)
map("n", "<C-k>", "<Esc>:m .-2<CR>==gi<Esc>", opts)
map("v", "<C-j>", "<Esc>:m .+1<CR>==gi", opts)
map("v", "<C-k>", "<Esc>:m .-2<CR>==gi", opts)
map("x", "<C-j>", ":move '>+1<CR>gv-gv", opts)
map("x", "<C-k>", ":move '<-2<CR>gv-gv", opts)
-- resize buffers
map("n", "<C-Up>", ":resize -2<CR>", opts)
map("n", "<C-Down>", ":resize +2<CR>", opts)
map("n", "<C-Right>", ":vertical resize -2<CR>", opts)
map("n", "<C-Left>", ":vertical resize +2<CR>", opts)
-- split open tabs
map("n", "<leader>v", ":vsplit<CR>", opts)
map("n", "<leader>h", ":split<CR>", opts)
-- formatting
map("n", "<leader>f", ":Format<CR>", opts)
-- fuzzy finder
map("n", "<C-f>", ":Files<CR>", opts)
map("n", "<C-b>", ":Buffers<CR>", opts)
map("n", "<C-g>", ":Commits<CR>", opts)
-- html bioler plate
map("i", "<C-b>", [[
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="style.css" />
<title>HTML 5 Boilerplate</title>
</head>
<body>
<script src="index.js"></script>
</body>
</html>]], opts)
-- auto execute commands
vim.cmd([[
au FileType python noremap <F5> :w<CR>:T python3 %<CR>
au FileType cpp noremap <F5> :w<CR>:T g++ % -Wextra -Wall -o main && echo '========' && echo '=OUTPUT=' && echo '========' && ./main && rm ./main<CR>
]])
-- coc tab completion
vim.cmd([[
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
]])
|
local twoPi = 2 * math.pi
local ChassisHelper = {}
function ChassisHelper:GetFastestRotation(wheels)
local topVelc = 0
for i = 1, #wheels do
if wheels[i].RotVelocity.Magnitude > topVelc then
topVelc = wheels[i].RotVelocity.Magnitude
end
end
return topVelc
end
function ChassisHelper:GetSlip(wheels)
local slip = {}
for i = 1, #wheels do
local rotations = wheels[i].RotVelocity.Magnitude * (wheels[i].Size.X/2)
local difference = rotations - wheels[i].Velocity.Magnitude
-- account for floating point
if difference > 1 or difference < -1 then
slip[i] = true
else
slip[i] = false
end
end
return slip
end
function ChassisHelper:PowerCurveLookup(rpm, curve)
local minRpm, maxRpm = 0, math.huge
for i = 1, #curve do
local thisCurve = curve[i]
if rpm <= thisCurve[1] then
if curve[i - 1] and rpm > curve[i - 1][1] then
local prevCurve = curve[i - 1]
local difference = thisCurve[2] - prevCurve[2]
local alpha = difference / (rpm - prevCurve[1])
-- lerp to find torque
return thisCurve[2] + alpha * (prevCurve[2] - thisCurve[2])
else
return 0
end
end
end
if rpm > curve[#curve][1] then
return curve[#curve][2]
else
return 0
end
return 0 --just incase...
end
function ChassisHelper:GetHorsePower(rpm, torque)
return torque * rpm/5252
end
function ChassisHelper:RadiansToRPM(rotVelcMag)
return rotVelcMag / twoPi
end
return ChassisHelper |
require 'torch'
graph = {}
require('graph.graphviz')
require('graph.Node')
require('graph.Edge')
--[[
Defines a graph and general operations on grpahs like topsort,
connected components, ...
uses two tables, one for nodes, one for edges
]]--
local Graph = torch.class('graph.Graph')
function Graph:__init()
self.nodes = {}
self.edges = {}
end
-- add a new edge into the graph.
-- an edge has two fields, from and to that are inserted into the
-- nodes table. the edge itself is inserted into the edges table.
function Graph:add(edge)
if type(edge) ~= 'table' then
error('graph.Edge or {graph.Edges} expected')
end
if torch.typename(edge) then
-- add edge
if not self.edges[edge] then
table.insert(self.edges,edge)
self.edges[edge] = #self.edges
end
-- add from node
if not self.nodes[edge.from] then
table.insert(self.nodes,edge.from)
self.nodes[edge.from] = #self.nodes
end
-- add to node
if not self.nodes[edge.to] then
table.insert(self.nodes,edge.to)
self.nodes[edge.to] = #self.nodes
end
-- add the edge to the node for parsing in nodes
edge.from:add(edge.to)
edge.from.id = self.nodes[edge.from]
edge.to.id = self.nodes[edge.to]
else
for i,e in ipairs(edge) do
self:add(e)
end
end
end
-- Clone a Graph
-- this will create new nodes, but will share the data.
-- Note that primitive data types like numbers can not be shared
function Graph:clone()
local clone = graph.Graph()
local nodes = {}
for i,n in ipairs(self.nodes) do
table.insert(nodes,n.new(n.data))
end
for i,e in ipairs(self.edges) do
local from = nodes[self.nodes[e.from]]
local to = nodes[self.nodes[e.to]]
clone:add(e.new(from,to))
end
return clone
end
-- It returns a new graph where the edges are reversed.
-- The nodes share the data. Note that primitive data types can
-- not be shared.
function Graph:reverse()
local rg = graph.Graph()
local mapnodes = {}
for i,e in ipairs(self.edges) do
mapnodes[e.from] = mapnodes[e.from] or e.from.new(e.from.data)
mapnodes[e.to] = mapnodes[e.to] or e.to.new(e.to.data)
local from = mapnodes[e.from]
local to = mapnodes[e.to]
rg:add(e.new(to,from))
end
return rg,mapnodes
end
function Graph:hasCycle()
local roots = self:roots()
if #roots == 0 then
return true
end
for i, root in ipairs(roots) do
if root:hasCycle() then
return true
end
end
return false
end
--[[
Topological Sort
]]--
function Graph:topsort()
local dummyRoot
-- reverse the graph
local rg,map = self:reverse()
local rmap = {}
for k,v in pairs(map) do
rmap[v] = k
end
-- work on the sorted graph
local sortednodes = {}
local rootnodes = rg:roots()
if #rootnodes == 0 then
error('Graph has cycles')
end
if #rootnodes > 1 then
dummyRoot = graph.Node('dummy_root')
for _, root in ipairs(rootnodes) do
dummyRoot:add(root)
end
else
dummyRoot = rootnodes[1]
end
-- run
-- the trick is since the dummy node does not exist in original graph,
-- rmap[dummyRoot] = nil hence nothing gets inserted into the table
dummyRoot:dfs(function(node) table.insert(sortednodes,rmap[node]) end)
if #sortednodes ~= #self.nodes then
error('Graph has cycles')
end
return sortednodes,rg,rootnodes
end
-- find root nodes
function Graph:roots()
local edges = self.edges
local rootnodes = {}
for i,edge in ipairs(edges) do
--table.insert(rootnodes,edge.from)
if not rootnodes[edge.from] then
rootnodes[edge.from] = #rootnodes+1
end
end
for i,edge in ipairs(edges) do
if rootnodes[edge.to] then
rootnodes[edge.to] = nil
end
end
local roots = {}
for root,i in pairs(rootnodes) do
table.insert(roots, root)
end
table.sort(roots,function(a,b) return self.nodes[a] < self.nodes[b] end )
return roots
end
-- find root nodes
function Graph:leaves()
local edges = self.edges
local leafnodes = {}
for i,edge in ipairs(edges) do
--table.insert(rootnodes,edge.from)
if not leafnodes[edge.to] then
leafnodes[edge.to] = #leafnodes+1
end
end
for i,edge in ipairs(edges) do
if leafnodes[edge.from] then
leafnodes[edge.from] = nil
end
end
local leaves = {}
for leaf,i in pairs(leafnodes) do
table.insert(leaves, leaf)
end
table.sort(leaves,function(a,b) return self.nodes[a] < self.nodes[b] end )
return leaves
end
function graph._dotEscape(str)
if string.find(str, '[^a-zA-Z]') then
-- Escape newlines and quotes.
local escaped = string.gsub(str, '\n', '\\n')
escaped = string.gsub(escaped, '"', '\\"')
str = '"' .. escaped .. '"'
end
return str
end
--[[ Generate a string like 'color=blue tailport=s' from a table
(e.g. {color = 'blue', tailport = 's'}. Its up to the user to escape
strings properly.
]]
local function makeAttributeString(attributes)
local str = {}
local keys = {}
for k, _ in pairs(attributes) do
table.insert(keys, k)
end
table.sort(keys)
for _, k in ipairs(keys) do
local v = attributes[k]
table.insert(str, tostring(k) .. '=' .. graph._dotEscape(tostring(v)))
end
return ' ' .. table.concat(str, ' ')
end
function Graph:todot(title)
local nodes = self.nodes
local edges = self.edges
local str = {}
table.insert(str,'digraph G {\n')
if title then
table.insert(str,'labelloc="t";\nlabel="' .. title .. '";\n')
end
table.insert(str,'node [shape = oval]; ')
local nodelabels = {}
for i,node in ipairs(nodes) do
local nodeName
if node.graphNodeName then
nodeName = node:graphNodeName()
else
nodeName = 'Node' .. node.id
end
local l = graph._dotEscape(nodeName .. '\n' .. node:label())
nodelabels[node] = 'n' .. node.id
local graphAttributes = ''
if node.graphNodeAttributes then
graphAttributes = makeAttributeString(
node:graphNodeAttributes())
end
table.insert(str,
'\n' .. nodelabels[node] ..
'[label=' .. l .. graphAttributes .. '];')
end
table.insert(str,'\n')
for i,edge in ipairs(edges) do
table.insert(str,nodelabels[edge.from] .. ' -> ' .. nodelabels[edge.to] .. ';\n')
end
table.insert(str,'}')
return table.concat(str,'')
end
|
-----------------------------------
--
-- Zone: Abdhaljs_Isle-Purgonorgo
--
-----------------------------------
local ID = require("scripts/zones/Abdhaljs_Isle-Purgonorgo/IDs")
require("scripts/globals/keyitems")
-----------------------------------
function onInitialize(zone)
end
function onZoneIn(player, prevZone)
local cs = -1
player:addKeyItem(tpz.ki.MAP_OF_ABDH_ISLE_PURGONORGO)
if player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0 then
player:setPos(521.600, -3.000, 563.000, 64)
end
return cs
end
function onRegionEnter(player, region)
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
|
_G.deb = function(obj)
naughty.notify({ preset = naughty.config.presets.critical,
title = "Debug Output",
text = tostring(obj),
position = "top_right"})
end
_G.max_client = function(c)
if c.maximized_horizontal == true and c.maximized_vertical == true then
local s = c.screen
c.maximized_horizontal = false
c.maximized_vertical = false
-- Restore screen, that windows is NOW on, not before maximizing
c.screen = s
else
c.maximized_horizontal = true
c.maximized_vertical = true
end
end
-- {{{ Change opacity of a client
local opacity_delta = 0.05
local function change_opacity(c, d)
local o = c.opacity + d
o = math.min(math.max(0.05, o), 1)
c.opacity = o
end
_G.opacity_up = function(c)
change_opacity(c, opacity_delta)
end
_G.opacity_down = function(c)
change_opacity(c, -opacity_delta)
end
-- }}}
_G.hspacer = function(size)
local w = wibox.widget.textbox()
w.width = size
return w
end
_G.vspacer = function(size)
local w = wibox.widget.imagebox()
local im = image.argb32(1, size, nil)
w.image = im
return w
end
lfs = require("lfs")
-- {{{ Run programm once
local function processwalker()
local function yieldprocess()
for dir in lfs.dir("/proc") do
-- All directories in /proc containing a number, represent a process
if tonumber(dir) ~= nil then
local f, err = io.open("/proc/"..dir.."/cmdline")
if f then
local cmdline = f:read("*all")
f:close()
if cmdline ~= "" then
coroutine.yield(cmdline)
end
end
end
end
end
return coroutine.wrap(yieldprocess)
end
_G.run_once = function(process, cmd)
assert(type(process) == "string")
local regex_killer = {
["+"] = "%+", ["-"] = "%-",
["*"] = "%*", ["?"] = "%?" }
for p in processwalker() do
if p:find(process:gsub("[-+?*]", regex_killer)) then
return
end
end
return awful.util.spawn(cmd or process)
end
-- }}}
|
local S = df_mapitems.S
local growth_multiplier = 1
if minetest.get_modpath("df_farming") then
growth_multiplier = df_farming.config.plant_growth_time
end
minetest.register_node("df_mapitems:glow_worm", {
description = S("Glow Worms"),
_doc_items_longdesc = df_mapitems.doc.glow_worms_desc,
_doc_items_usagehelp = df_mapitems.doc.glow_worms_usage,
tiles = {
{
name = "dfcaverns_glow_worm_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 4.0,
},
},
},
inventory_image = "dfcaverns_glow_worm.png",
wield_image = "dfcaverns_glow_worm.png",
is_ground_content = false,
groups = {oddly_breakable_by_hand=3, light_sensitive_fungus = 12},
_dfcaverns_dead_node = "air",
light_source = 9,
paramtype = "light",
drawtype = "plantlike",
walkable = false,
buildable_to = true,
floodable = true,
visual_scale = 1.0,
after_place_node = function(pos, placer)
if df_mapitems.config.glow_worm_delay_multiplier > 0 then
minetest.get_node_timer(pos):start(math.random(
df_mapitems.config.glow_worm_delay_multiplier * growth_multiplier * 0.75,
df_mapitems.config.glow_worm_delay_multiplier * growth_multiplier * 1.25))
end
end,
on_timer = function(pos, elapsed)
local below = {x=pos.x, y=pos.y-1, z=pos.z}
if minetest.get_node(below).name == "air" then
minetest.set_node(below, {name="df_mapitems:glow_worm"})
if math.random() > 0.5 then
minetest.get_node_timer(below):start(math.random(
df_mapitems.config.glow_worm_delay_multiplier * growth_multiplier * 0.75,
df_mapitems.config.glow_worm_delay_multiplier * growth_multiplier * 1.25))
end
end
end,
})
local c_air = minetest.get_content_id("air")
local c_worm = minetest.get_content_id("df_mapitems:glow_worm")
df_mapitems.glow_worm_ceiling = function(area, data, vi)
local ystride = area.ystride
local bi = vi - ystride
if data[vi] == c_air and data[bi] == c_air then
data[vi] = c_worm
data[bi] = c_worm
if math.random(2) == 1 then
bi = bi - ystride
if data[bi] == c_air then
data[bi] = c_worm
if math.random(2) == 1 then
bi = bi - ystride
if data[bi] == c_air then
data[bi] = c_worm
end
end
end
end
end
end
|
-- BLUA Scripting Project
-- Part of OutlandZoning Division
-- Scripted by Hellgawd
-- Give full credits if posting
function UmbWD_OnKill(pUnit,Event)
pUnit:RemoveEvents();
end
function UmbWD_EnterCombat(pUnit,Event)
pUnit:RegisterEvent("hittest_1",1000, 0)
pUnit:FullCastSpell(34871)
end
function hittest_1(pUnit, Event)
if pUnit:GetHealthPct() < 90 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(7289,pUnit:GetClosestPlayer())
pUnit:RegisterEvent("hittest_2",1000, 0)
end
end
function hittest_2(pUnit, Event)
if pUnit:GetHealthPct() < 75 then
pUnit:RemoveEvents();
pUnit:FullCastSpell(35197)
pUnit:RegisterEvent("hittest_3",1000, 0)
end
end
function hittest_3(pUnit, Event)
if pUnit:GetHealthPct() < 45 then
pUnit:RemoveEvents();
pUnit:FullCastSpellOnTarget(7289,pUnit:GetClosestPlayer())
pUnit:RegisterEvent("hittest_4",1000, 0)
end
end
function hittest_4(pUnit, Event)
if pUnit:GetHealthPct() < 15 then
pUnit:RemoveEvents();
pUnit:FullCastSpell(35197)
end
end
function UmbWD_Start(pUnit, Event)
pUnit:RegisterEvent("hittest_1",1000, 0)
end
RegisterUnitEvent(20115, 1, "UmbWD_Start")
RegisterUnitEvent(20115, 3, "UmbWD_OnKill")
RegisterUnitEvent(20115, 1, "UmbWD_EnterCombat") |
require('libraries.doodlehouse.dscolor.rgba')
Colors = require('libraries.doodlehouse.dscolor.colors')
-- takes the number
function setColor(index, alpha)
-- offsets the numbers to get to pico indicies
local c = Colors[index + 1]
c[4] = alpha or 1
love.graphics.setColor(unpack(c))
end
function setBackgroundColor(index)
love.graphics.setBackgroundColor(Colors[index + 1])
end |
if qchat and IsValid(qchat.pPanel) then
qchat:Close()
end
qchat = {
Author = "Q2F2 (/id/q2f2)",
Contact = "[email protected]",
}
qchat.shortcut = {
[".lenny"] = [[( ͡° ͜ʖ ͡°)]],
[".iunno"] = [[¯\_(ツ)_/¯]],
[".flip"] = [[(╯°□°)╯︵ ┻━┻]],
[".unflip"] = [[┬─┬ ノ( ゜-゜ノ)]],
}
local Legacy = CreateClientConVar("qchat_legacymode", "1", true)
local HaxrCorp = CreateClientConVar("qchat_use_haxrcorp", "0", true)
local FontSize = CreateClientConVar("qchat_fontsize", HaxrCorp:GetBool() and "21" or "17", true)
local TransBack = CreateClientConVar("qchat_use_transback", "0", true)
function qchat.CreateFonts()
if Legacy then
surface.CreateFont("QChatFont", {
font = "Verdana",
size = FontSize:GetInt(),
weight = 600,
shadow = true,
})
surface.CreateFont("QChatFont2", {
font = "Verdana",
size = FontSize:GetInt(),
weight = 600,
shadow = true,
})
end
surface.CreateFont("QChatFont", {
font = HaxrCorp:GetBool() and "HaxrCorp S8" or "Tahoma",
size = FontSize:GetInt(),
weight = HaxrCorp:GetBool() and 0 or 1000,
shadow = true,
})
surface.CreateFont("QChatFont2", {
font = HaxrCorp:GetBool() and "HaxrCorp S8" or "Tahoma",
size = HaxrCorp:GetBool() and 16 or 15,
weight = HaxrCorp:GetBool() and 0 or 500,
shadow = true,
})
end
qchat.CreateFonts()
cvars.AddChangeCallback("qchat_fontsize", qchat.CreateFonts)
cvars.AddChangeCallback("qchat_use_haxrcorp", qchat.CreateFonts)
local colors
function qchat.CreateColors()
if Legacy:GetBool() then
colors = {
text = Color( 0, 0, 0, 255),
alpha = Color( 0, 0, 0, 0),
mainBack = Color( 10, 0, 10, 100),
barBack = Color(255, 255, 255, 100),
groupBack = Color( 90, 0, 90, 255),
textInputColor = Color( 0, 0, 0, 200),
highlightOne = Color(255, 255, 255, 255),
}
else
local a1 = TransBack:GetBool() and 195 or 255
local a2 = TransBack:GetBool() and 175 or 255
colors = {
text = Color(204, 204, 202, a1),
alpha = Color( 0, 0, 0, 0),
mainBack = Color( 51, 51, 51, a2),
barBack = Color( 45, 45, 45, a1),
groupBack = Color( 45, 45, 45, a1),
textInputColor = Color( 78, 78, 78, a2),
highlightOne = Color(217, 191, 194, a1),
}
end
end
qchat.CreateColors()
cvars.AddChangeCallback("qchat_use_transback", qchat.CreateColors)
cvars.AddChangeCallback("qchat_legacymode", qchat.CreateColors)
function qchat.LegacyFix()
-- Fix fontsize for legacy mode
if Legacy:GetBool() then
HaxrCorp:SetBool(false)
FontSize:SetInt(14)
end
end
cvars.AddChangeCallback("qchat_legacymode", qchat.LegacyFix)
function qchat:CreateChatTab()
-- The tab for the actual chat.
self.chatTab = vgui.Create("DPanel", self.pPanel)
self.chatTab.Paint = function(self, w, h)
surface.SetDrawColor(colors.mainBack)
surface.DrawRect(0, 0, w, h)
end
-- The text entry for the chat.
self.chatTab.pTBase = vgui.Create("DPanel", self.chatTab)
self.chatTab.pTBase.Paint = function(self, w, h)
end
self.chatTab.pTBase:Dock(BOTTOM)
self.chatTab.pText = vgui.Create("DTextEntry", self.chatTab.pTBase)
self.chatTab.pText:SetHistoryEnabled(true)
self.chatTab.pGr = vgui.Create("DPanel", self.chatTab.pTBase)
self.chatTab.pGr.Paint = function(self, w, h)
surface.SetDrawColor(colors.groupBack)
surface.DrawRect(0, 0, w, h)
end
self.chatTab.pText.OnKeyCodeTyped = function(pan, key)
local txt = pan:GetText():Trim()
hook.Run("ChatTextChanged", txt)
if key == KEY_ENTER then
if txt ~= "" then
pan:AddHistory(txt)
pan:SetText("")
pan.HistoryPos = 0
local team = self.isTeamChat
if chatexp and hook.Run("ChatShouldHandle", "chatexp", txt, team and CHATMODE_TEAM or CHATMODE_DEFAULT) ~= false then
chatexp.Say(txt, team and CHATMODE_TEAM or CHATMODE_DEFAULT)
elseif chitchat and chitchat.Say and hook.Run("ChatShouldHandle", "chitchat", txt, team and 2 or 1) ~= false then
chitchat.Say(txt, team and 2 or 1)
else
LocalPlayer():ConCommand((team and "say_team \"" or "say \"") .. txt .. "\"")
end
end
self:Close()
end
if key == KEY_TAB then
local tab = hook.Run("OnChatTab", txt)
local split = txt:Split(" ")
if tab and isstring(tab) and tab ~= txt then
pan:SetText(tab)
elseif qchat.shortcut[split[#split]] then
split[#split] = qchat.shortcut[split[#split]]
pan:SetText(table.concat(split, " "))
end
timer.Simple(0, function() pan:RequestFocus() pan:SetCaretPos(pan:GetText():len()) end)
end
if key == KEY_UP then
pan.HistoryPos = pan.HistoryPos - 1
pan:UpdateFromHistory()
end
if key == KEY_DOWN then
pan.HistoryPos = pan.HistoryPos + 1
pan:UpdateFromHistory()
end
end
self.chatTab.pText.Paint = function(pan, w, h)
surface.SetDrawColor(colors.barBack)
surface.DrawRect(0, 0, w, h)
pan:DrawTextEntryText(colors.text, colors.textInputColor, colors.textInputColor)
end
self.chatTab.pText.OnChange = function(pan)
gamemode.Call("ChatTextChanged", pan:GetText() or "")
end
self.chatTab.pGr:Dock(LEFT)
self.chatTab.pText:Dock(FILL)
self.chatTab.pGr.OnMousePressed = function(pan)
local mousex = math.Clamp(gui.MouseX(), 1, ScrW() - 1)
local mousey = math.Clamp(gui.MouseY(), 1, ScrH() - 1)
self.pPanel.Dragging = {mousex - self.pPanel.x, mousey - self.pPanel.y}
self.pPanel:MouseCapture(true)
end
self.chatTab.pGrLab = vgui.Create("DLabel", self.chatTab.pGr)
self.chatTab.pGrLab:SetPos(5, 2)
self.chatTab.pGrLab:SetTextColor(colors.highlightOne)
self.chatTab.pGrLab:SetFont("QChatFont2")
-- The element to actually display the chat its-self.
self.chatTab.pFeed = vgui.Create("RichText", self.chatTab)
self.chatTab.pFeed:Dock(FILL)
self.chatTab.pFeed.Font = "QChatFont"
self.chatTab.pFeed.PerformLayout = function(pan)
pan:SetFontInternal(pan.Font)
end
end
function qchat:SaveCookies()
local x, y, w, h = self.pPanel:GetBounds()
self.pPanel:SetCookie("x", x)
self.pPanel:SetCookie("y", y)
self.pPanel:SetCookie("w", w)
self.pPanel:SetCookie("h", h)
end
function qchat:BuildPanels()
self.pPanel = vgui.Create("DFrame")
self.pPanel:SetTitle("")
self.pPanel.Paint = function(self, w, h) end
self.pPanel:SetSizable(true)
self.pPanel:ShowCloseButton(false)
self.pPanel.Think = function(self)
local mousex = math.Clamp(gui.MouseX(), 1, ScrW() - 1)
local mousey = math.Clamp(gui.MouseY(), 1, ScrH() - 1)
if self.Dragging then
local x = mousex - self.Dragging[1]
local y = mousey - self.Dragging[2]
if self:GetScreenLock() then
x = math.Clamp(x, 0, ScrW() - self:GetWide())
y = math.Clamp(y, 0, ScrH() - self:GetTall())
end
self:SetPos(x, y)
end
if self.Sizing then
local x = mousex - self.Sizing[1]
local y = mousey - self.Sizing[2]
local px, py = self:GetPos()
if x < self.m_iMinWidth then x = self.m_iMinWidth elseif x > ScrW() - px and self:GetScreenLock() then x = ScrW() - px end
if y < self.m_iMinHeight then y = self.m_iMinHeight elseif y > ScrH() - py and self:GetScreenLock() then y = ScrH() - py end
self:SetSize(x, y)
self:SetCursor("sizenwse")
return end
if self.Hovered and mousex > (self.x + self:GetWide() - 20) and mousey > (self.y + self:GetTall() - 20) then
self:SetCursor("sizenwse")
return end
self:SetCursor("arrow")
if self.y < 0 then
self:SetPos(self.x, 0)
end
end
self.pPanel.OnMousePressed = function(self)
local mousex = math.Clamp(gui.MouseX(), 1, ScrW() - 1)
local mousey = math.Clamp(gui.MouseY(), 1, ScrH() - 1)
if mousex > (self.x + self:GetWide() - 20) and mousey > (self.y + self:GetTall() - 20) then
self.Sizing = {mousex - self:GetWide(), mousey - self:GetTall()}
self:MouseCapture(true)
return end
end
self:CreateChatTab()
self.chatTab:Dock(FILL)
self.pPanel:SetCookieName("qchat")
local x = self.pPanel:GetCookie("x", 20)
local y = self.pPanel:GetCookie("y", 220)
local w = self.pPanel:GetCookie("w", 800)
local h = self.pPanel:GetCookie("h", 500)
self.pPanel:SetPos(x, y)
self.pPanel:SetSize(w, h)
end
function qchat:SetUpChat()
if not self.pPanel or not ValidPanel(self.pPanel) then
self:BuildPanels()
else
self.pPanel:SetVisible(true)
self.pPanel:MakePopup()
end
self.chatTab.pGrLab:SetTextColor(colors.highlightOne)
self.chatTab.pGrLab:SetText(qchat.isTeamChat and "(TEAM)" or "(GLOBAL)")
self.chatTab.pText:SetText("")
self.chatTab.pText:RequestFocus()
gamemode.Call("StartChat")
end
function qchat:BuildIfNotExist()
if not self.pPanel or not ValidPanel(self.pPanel) then
self:BuildPanels()
self.pPanel:SetVisible(false)
end
end
-- Some of the link code is from EPOE.
local function CheckFor(tbl, a, b)
local a_len = #a
local res, endpos = true, 1
while res and endpos < a_len do
res, endpos = a:find(b, endpos)
if res then
tbl[#tbl + 1] = {res, endpos}
end
end
end
local function AppendTextLink(a, callback)
local result = {}
CheckFor(result, a, "https?://[^%s%\"]+")
CheckFor(result, a, "ftp://[^%s%\"]+")
CheckFor(result, a, "steam://[^%s%\"]+")
if #result == 0 then return false end
table.sort(result, function(a, b) return a[1] < b[1] end)
-- Fix overlaps
local _l, _r
for k, tbl in ipairs(result) do
local l, r = tbl[1], tbl[2]
if not _l then
_l, _r = tbl[1], tbl[2]
continue
end
if l < _r then table.remove(result, k) end
_l, _r = tbl[1], tbl[2]
end
local function TEX(str) callback(false, str) end
local function LNK(str) callback(true, str) end
local offset = 1
local right
for _, tbl in ipairs(result) do
local l, r = tbl[1], tbl[2]
local link = a:sub(l, r)
local left = a:sub(offset, l - 1)
right = a:sub(r + 1, -1)
offset = r + 1
TEX(left)
LNK(link)
end
TEX(right)
return true
end
function qchat:AppendText(txt)
local function linkAppend(islink, text)
if islink then
self.chatTab.pFeed:InsertClickableTextStart(text)
self.chatTab.pFeed:AppendText(text)
self.chatTab.pFeed:InsertClickableTextEnd()
return end
self.chatTab.pFeed:AppendText(text)
end
local res = AppendTextLink(txt, linkAppend)
if not res then
self.chatTab.pFeed:AppendText(txt)
end
end
ParseChatHudTags = ParseChatHudTags or function(a) return a end
function qchat:ParseChatLine(tbl)
self:BuildIfNotExist()
if isstring(tbl) then
self.chatTab.pFeed:InsertColorChange(120, 240, 140, 255)
self.chatTab.pFeed:AppendText(ParseChatHudTags(tbl))
self.chatTab.pFeed:AppendText("\n")
return end
for i, v in pairs(tbl) do
if IsColor(v) or istable(v) then
self.chatTab.pFeed:InsertColorChange(v.r, v.g, v.b, 255)
elseif isentity(v) and v:IsPlayer() then
local col = GAMEMODE:GetTeamColor(v)
self.chatTab.pFeed:InsertColorChange(col.r, col.g, col.b, 255)
self.chatTab.pFeed:AppendText(ParseChatHudTags(v:Nick()))
elseif v ~= nil then
self:AppendText(ParseChatHudTags(tostring(v)))
end
end
self.chatTab.pFeed:AppendText("\n")
end
function qchat.ChatBind(ply, bind)
local isTeamChat = false
if bind == "messagemode2" then
isTeamChat = true
elseif bind ~= "messagemode" then return end
qchat.isTeamChat = isTeamChat
qchat:SetUpChat()
return true
end
hook.Add("PlayerBindPress", "qchat.ChatBind", qchat.ChatBind)
function qchat.PreRenderEscape()
if gui.IsGameUIVisible() and qchat.pPanel and ValidPanel(qchat.pPanel) and qchat.pPanel:IsVisible() then
if input.IsKeyDown(KEY_ESCAPE) then
gui.HideGameUI()
qchat:Close()
elseif gui.IsConsoleVisible() then
qchat:Close()
end
end
end
hook.Add("PreRender", "qchat.PreRenderEscape", qchat.PreRenderEscape)
function qchat:Close()
self.pPanel:SetVisible(false)
self.chatTab.pText.HistoryPos = 0
gamemode.Call("FinishChat")
self:SaveCookies()
end
if not chathud then
_G.oldAddText = _G.oldAddText or _G.chat.AddText
function chat.AddText(...)
qchat:ParseChatLine({...})
_G.oldAddText(...)
end
end
_G.oldGetChatBoxPos = _G.oldGetChatBoxPos or _G.chat.GetChatBoxPos
function chat.GetChatBoxPos()
qchat:BuildIfNotExist()
return qchat.pPanel:GetPos()
end
_G.oldGetChatBoxSize = _G.oldGetChatBoxSize or _G.chat.GetChatBoxSize
function chat.GetChatBoxSize()
qchat:BuildIfNotExist()
return qchat.pPanel:GetSize()
end
_G.oldChatOpen = _G.oldChatOpen or _G.chat.Open
function chat.Open(mode)
local isTeam = mode and mode ~= 1
qchat.isTeamChat = isTeam
qchat:SetUpChat()
end
_G.oldChatClose = _G.oldChatClose or _G.chat.Close
function chat.Close()
qchat:Close()
end
if chatsounds then
local f = function()
if chatsounds.ac.visible() then
local x, y, w, h
if chatgui then
x, y = chatgui:GetPos()
w, h = chatgui:GetSize()
y, h = y + h, surface.ScreenHeight() - y - h
else
x, y = chat.GetChatBoxPos()
w, h = chat.GetChatBoxSize()
y, h = y + h, surface.ScreenHeight() - y - h
end
chatsounds.ac.render(x, y, w, h)
end
end
hook.Add("PostRenderVGUI", "chatsounds_autocomplete", f)
end |
local PLUGIN = PLUGIN
PLUGIN.name = "RE:Vendors"
PLUGIN.author = "STEAM_0:1:29606990" -- Chessnut original code
PLUGIN.description = "Adds NPC vendors that can sell things."
ix.lang.AddTable("russian", {
['vendorTitleInvSize'] = "Размер инвентаря",
['vendorSlideWInvSize'] = "Ширина",
['vendorSlideHInvSize'] = "Высота",
['vendorResizeBtnInvSize'] = "Изменить размер",
['vendorRemoveItemEditor'] = "Удалить",
['vendorMaxStock'] = "У данного продавца полный запас этого товара!"
})
ix.lang.AddTable("english", {
['vendorTitleInvSize'] = "Inventory size",
['vendorSlideWInvSize'] = "Width",
['vendorSlideHInvSize'] = "Height",
['vendorResizeBtnInvSize'] = "Resize",
['vendorRemoveItemEditor'] = "Remove item",
['vendorMaxStock'] = "This vendor has full stock of that item!"
})
ix.lang.AddTable("korean", {
['vendorTitleInvSize'] = "인벤토리 크기",
['vendorSlideWInvSize'] = "너비",
['vendorSlideHInvSize'] = "높이",
['vendorResizeBtnInvSize'] = "크기 재설정",
['vendorRemoveItemEditor'] = "아이템 제거",
['vendorMaxStock'] = "이 상인은 그 아이템 재고가 이미 가득 찼습니다!"
})
CAMI.RegisterPrivilege({
Name = "Helix - Manage Vendors",
MinAccess = "admin"
})
VENDOR = {
SELLANDBUY = 1, -- Sell and buy the item.
SELLONLY = 2, -- Only sell the item to the player.
BUYONLY = 3, -- Only buy the item from the player.
PRICE = 1,
STOCK = 2,
MODE = 3,
MAXSTOCK = 4,
NOTRADE = 3,
WELCOME = 1
}
if CLIENT then
local stockPnl, pricePnl = nil, nil
local intPriceVendor = 0
function PLUGIN:PopulateItemTooltip( tooltip, item )
if not item.invID then
return
end
local panel = ix.gui.vendorRemake
if (IsValid(panel)) then
local entity = panel.entity
if IsValid(entity) and entity.items[item.uniqueID] then
local info = entity.items[item.uniqueID]
if not info then
return
end
local inventory = ix.inventory.Get(item.invID)
if inventory and inventory.slots and inventory.vars then
intPriceVendor = entity:GetPrice(item.uniqueID, not inventory.vars.isNewVendor)
intPriceVendor = ix.currency.Get(intPriceVendor)
pricePnl = tooltip:AddRowAfter("name", "priceVendor")
if inventory.vars.isNewVendor then
pricePnl:SetText(L"purchase".." ("..intPriceVendor..")")
else
-- elseif not inventory.vars.isNewVendor and IsValid(ix.gui.inv1) and not IsValid(ix.gui.menu) then
pricePnl:SetText(L"sell".." ("..intPriceVendor..")")
end
pricePnl:SetBackgroundColor(derma.GetColor("Warning", panel))
pricePnl:SizeToContents()
if (inventory.vars.isNewVendor and info[VENDOR.MAXSTOCK]) then
if IsValid(pricePnl) then
stockPnl = tooltip:AddRowAfter("priceVendor", "stockVendor")
else
stockPnl = tooltip:AddRowAfter("name", "stockVendor")
end
stockPnl:SetText(string.format("%s: %d/%d", L'stock', info[VENDOR.STOCK], info[VENDOR.MAXSTOCK]))
stockPnl:SetBackgroundColor(derma.GetColor("Error", panel))
stockPnl:SizeToContents()
end
end
end
end
end
function PLUGIN:SendTradeToVendor(itemObject, isSellingToVendor)
if (not IsValid(ix.gui.vendorRemake) or not itemObject.id) then
return
end
local entity = ix.gui.vendorRemake.entity
if (not entity.items[itemObject.uniqueID]) then
return
end
net.Start("ixVendorRemakeTrade")
net.WriteUInt(itemObject.id, 32)
net.WriteBool(isSellingToVendor)
net.SendToServer()
end
function PLUGIN:InventoryItemOnDrop(itemObject, curInv, newInventory)
if curInv and newInventory then
if (newInventory.vars and newInventory.vars.isNewVendor and curInv.slots) or (curInv.vars and curInv.vars.isNewVendor and newInventory.slots) then
if (newInventory == curInv) then
return
end
if IsValid(ix.gui.vendorRemake) and not IsValid(ix.gui.vendorRemakeEditor) then -- sell / purchase that item
local entity = ix.gui.vendorRemake.entity
if (not entity.items[itemObject.uniqueID]) then
return
end
if curInv.vars.isNewVendor then -- purchase item to vendor
self:SendTradeToVendor(itemObject, false)
elseif newInventory.vars.isNewVendor then -- sell item to vendor
self:SendTradeToVendor(itemObject, true)
end
end
end
end
end
end
function PLUGIN:CanTransferItem(itemObject, curInv, newInventory)
if curInv and newInventory then
if (newInventory.vars and newInventory.vars.isNewVendor) or (curInv.vars and curInv.vars.isNewVendor) then
if curInv:GetID() == 0 then
return true -- META:Add()
end
return false
end
end
end
if (SERVER) then
util.AddNetworkString("ixVendorRemakeOpen")
util.AddNetworkString("ixVendorRemakeClose")
util.AddNetworkString("ixVendorRemakeEditor")
util.AddNetworkString("ixVendorRemakeEditFinish")
util.AddNetworkString("ixVendorRemakeEdit")
util.AddNetworkString("ixVendorRemakeTrade")
util.AddNetworkString("ixVendorRemakeStock")
util.AddNetworkString("ixVendorRemakeMoney")
ix.log.AddType("vendorCharacterTraded", function(client, ...)
local arg = {...}
return string.format("%s %s '%s' to the vendor '%s'.", client:Name(), arg[3] == true and "selling" or "purchased", arg[2], arg[1])
end)
ix.log.AddType("vendorRemakeUse", function(client, ...)
local arg = {...}
return string.format("%s used the '%s' vendor.", client:Name(), arg[1])
end)
function PLUGIN:SaveData()
local data = {}
for _, entity in ipairs(ents.FindByClass("ix_vendor_new")) do
local inventory = entity:GetInventory()
if (inventory) then
local bodygroups = {}
for _, v in ipairs(entity:GetBodyGroups() or {}) do
bodygroups[v.id] = entity:GetBodygroup(v.id)
end
data[#data + 1] = {
name = entity:GetDisplayName(),
description = entity:GetDescription(),
pos = entity:GetPos(),
angles = entity:GetAngles(),
model = entity:GetModel(),
skin = entity:GetSkin(),
bodygroups = bodygroups,
bubble = entity:GetNoBubble(),
inventory_id = inventory:GetID(),
items = entity.items,
factions = entity.factions,
classes = entity.classes,
money = entity.money,
scale = entity.scale,
inventory_size = {w = entity.inventory_size.w or 1, h = entity.inventory_size.h or 1},
}
end
end
self:SetData(data)
end
function PLUGIN:CharacterVendorTraded(client, vendor, uniqueID, isSellingToVendor)
ix.log.Add(client, "vendorCharacterTraded", vendor:GetDisplayName(), uniqueID, isSellingToVendor)
end
function PLUGIN:VendorRemakeRemoved(entity, inventory)
self:SaveData()
end
function PLUGIN:LoadData()
for _, v in ipairs(self:GetData() or {}) do
local inventoryID = tonumber(v.inventory_id)
if (!inventoryID or inventoryID < 1) then
ErrorNoHalt(string.format("[Helix] Attempted to restore container inventory with invalid inventory ID '%s'\n", tostring(inventoryID)))
continue
end
local entity = ents.Create("ix_vendor_new")
entity:SetPos(v.pos)
entity:SetAngles(v.angles)
entity:Spawn()
entity:SetModel(v.model)
entity:SetSkin(v.skin or 0)
entity:SetSolid(SOLID_BBOX)
entity:PhysicsInit(SOLID_BBOX)
local physObj = entity:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:EnableMotion(false)
physObj:Sleep()
end
entity:SetNoBubble(v.bubble)
entity:SetDisplayName(v.name or "John Doe")
entity:SetDescription(v.description)
for id, bodygroup in pairs(v.bodygroups or {}) do
entity:SetBodygroup(id, bodygroup)
end
entity.inventory_size = {w = v.inventory_size.w or 1, h = v.inventory_size.h or 1}
entity:BuildInventory(function(inventory)
for uniqueID, data in pairs(v.items) do
if (not data or not ix.item.Get(tostring(uniqueID))) then continue end
inventory:Add(tostring(uniqueID), 1, nil, nil, nil, true)
end
end, entity.inventory_size.w, entity.inventory_size.h)
local items = {}
for uniqueID, data in pairs(v.items) do
if (not data or not ix.item.Get(tostring(uniqueID))) then continue end
items[tostring(uniqueID)] = data
end
entity.items = items
entity.factions = v.factions or {}
entity.classes = v.classes or {}
entity.money = v.money
entity.scale = v.scale or 0.5
items = nil
end
end
net.Receive("ixVendorRemakeClose", function(len, client)
local entity = client.ixOpenVendorRemake
if (IsValid(entity)) then
local inventory = entity:GetInventory()
if (inventory) then
inventory:RemoveReceiver(client)
end
for k, v in ipairs(entity.receivers) do
if (v == client) then
table.remove(entity.receivers, k)
break
end
end
client.ixOpenVendorRemake = nil
end
end)
local function UpdateEditReceivers(receivers, key, value)
net.Start("ixVendorRemakeEdit")
net.WriteString(key)
net.WriteType(value)
net.Send(receivers)
end
-- SERVER
net.Receive("ixVendorRemakeEdit", function(len, client)
if (!CAMI.PlayerHasAccess(client, "Helix - Manage Vendors", nil)) then
return
end
local entity = client.ixOpenVendorRemake
if (!IsValid(entity)) then
return
end
local key = net.ReadString()
local data = net.ReadType()
local feedback = true
if (key == "name") then
entity:SetDisplayName(data)
elseif (key == 'inventory_size') then
entity:OnRemoveInventory()
local invW, invH = math.floor(data[1]), math.floor(data[2])
timer.Create("ixVendorRemakeRestoreInvSize", 1, 1, function()
entity:BuildInventory(function(inventory)
entity.inventory_size = {w = inventory.w, h = inventory.h}
for k, v in ipairs(entity.receivers) do
inventory:AddReceiver(v)
inventory:Sync(v)
end
UpdateEditReceivers(entity.receivers, key, value)
end, invW, invH)
end)
feedback = false
elseif (key == "remove_inv_item") then
if (IsValid(entity)) then
entity:GetInventory():Remove(data[1], nil, true, true)
entity.items[data[2]] = nil
end
elseif (key == "description") then
entity:SetDescription(data)
elseif (key == "bubble") then
entity:SetNoBubble(data)
elseif (key == "mode") then
local uniqueID = data[1]
local mode = data[2]
local inventory = entity:GetInventory()
local items = inventory:GetItemsByUniqueID(uniqueID, true)
if (mode and #items == 0 and !inventory:Add(uniqueID)) then
feedback = false
else
if (not mode and #items > 0) then
for _, v in ipairs(items) do
if (v.uniqueID == uniqueID) then
inventory:Remove(v.id, nil, true, true)
break
end
end
end
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.MODE] = mode
end
UpdateEditReceivers(entity.receivers, key, data)
elseif (key == "price") then
local uniqueID = data[1]
data[2] = tonumber(data[2])
if (data[2]) then
data[2] = math.Round(data[2])
end
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.PRICE] = data[2]
UpdateEditReceivers(entity.receivers, key, data)
data = uniqueID
elseif (key == "stockDisable") then
local uniqueID = data[1]
entity.items[data] = entity.items[uniqueID] or {}
entity.items[data][VENDOR.MAXSTOCK] = nil
UpdateEditReceivers(entity.receivers, key, data)
elseif (key == "stockMax") then
local uniqueID = data[1]
data[2] = math.max(math.Round(tonumber(data[2]) or 1), 1)
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.MAXSTOCK] = data[2]
entity.items[uniqueID][VENDOR.STOCK] = math.Clamp(entity.items[uniqueID][VENDOR.STOCK] or data[2], 1, data[2])
data[3] = entity.items[uniqueID][VENDOR.STOCK]
UpdateEditReceivers(entity.receivers, key, data)
data = uniqueID
elseif (key == "stock") then
local uniqueID = data[1]
entity.items[uniqueID] = entity.items[uniqueID] or {}
if (!entity.items[uniqueID][VENDOR.MAXSTOCK]) then
data[2] = math.max(math.Round(tonumber(data[2]) or 0), 0)
entity.items[uniqueID][VENDOR.MAXSTOCK] = data[2]
end
data[2] = math.Clamp(math.Round(tonumber(data[2]) or 0), 0, entity.items[uniqueID][VENDOR.MAXSTOCK])
entity.items[uniqueID][VENDOR.STOCK] = data[2]
UpdateEditReceivers(entity.receivers, key, data)
data = uniqueID
elseif (key == "faction") then
local faction = ix.faction.teams[data]
if (faction) then
entity.factions[data] = !entity.factions[data]
if (!entity.factions[data]) then
entity.factions[data] = nil
end
end
local uniqueID = data
data = {uniqueID, entity.factions[uniqueID]}
elseif (key == "class") then
local class
for _, v in ipairs(ix.class.list) do
if (v.uniqueID == data) then
class = v
break
end
end
if (class) then
entity.classes[data] = !entity.classes[data]
if (!entity.classes[data]) then
entity.classes[data] = nil
end
end
local uniqueID = data
data = {uniqueID, entity.classes[uniqueID]}
elseif (key == "model") then
entity:SetModel(data)
entity:SetSolid(SOLID_BBOX)
entity:PhysicsInit(SOLID_BBOX)
entity:SetAnim()
timer.Create("ixVendorRemakeUpdateInvType", 1, 1, function()
local strModel = tostring(entity:GetModel()):lower()
local query = mysql:Update("ix_inventories")
query:Update("inventory_type", "vendor_new:"..strModel)
query:Where("inventory_id", entity:GetID())
query:Execute()
query, strModel = nil, nil
end)
elseif (key == "useMoney") then
if (entity.money) then
entity:SetMoney()
else
entity:SetMoney(0)
end
elseif (key == "money") then
data = math.Round(math.abs(tonumber(data) or 0))
entity:SetMoney(data)
feedback = false
elseif (key == "scale") then
data = tonumber(data) or 0.5
entity.scale = data
UpdateEditReceivers(entity.receivers, key, data)
end
PLUGIN:SaveData()
if (feedback) then
local receivers = {}
for _, v in ipairs(entity.receivers) do
if (CAMI.PlayerHasAccess(v, "Helix - Manage Vendors", nil)) then
receivers[#receivers + 1] = v
end
end
net.Start("ixVendorRemakeEditFinish")
net.WriteString(key)
net.WriteType(data)
net.Send(receivers)
receivers = nil
end
end)
net.Receive("ixVendorRemakeTrade", function(length, client)
if ((client.ixVendorTry or 0) < CurTime()) then
client.ixVendorTry = CurTime() + 0.33
else
return
end
local entity = client.ixOpenVendorRemake
if (!IsValid(entity) or client:GetPos():Distance(entity:GetPos()) > 192) then
return
end
local itemID = net.ReadUInt(32)
local isSellingToVendor = net.ReadBool()
local itemData = ix.item.instances[itemID]
local uniqueID = itemData.uniqueID
local data = entity.items[uniqueID]
if (data and
hook.Run("CanPlayerTradeWithVendor", client, entity, uniqueID, isSellingToVendor) != false) then
local price = entity:GetPrice(uniqueID, isSellingToVendor)
if (isSellingToVendor) then
if (data[VENDOR.MODE] ~= VENDOR.SELLANDBUY and data[VENDOR.MODE] ~= VENDOR.BUYONLY) then
return false
end
local found = false
local name
if (!entity:HasMoney(price)) then
return client:NotifyLocalized("vendorNoMoney")
end
local stock, max = entity:GetStock(uniqueID)
if (stock and stock >= max) then
return client:NotifyLocalized("vendorMaxStock")
end
local invOkay = true
for _, v in pairs(client:GetCharacter():GetInventory():GetItems()) do
if (v.id == itemID and v:GetID() != 0 and ix.item.instances[v:GetID()] and v:GetData("equip", false) == false) then
invOkay = v:Remove()
found = true
name = L(v.name, client)
break
end
end
if (!found) then
return
end
if (!invOkay) then
client:GetCharacter():GetInventory():Sync(client, true)
return client:NotifyLocalized("tellAdmin", "trd!iid")
end
client:GetCharacter():GiveMoney(price)
client:NotifyLocalized("businessSell", name, ix.currency.Get(price))
entity:TakeMoney(price)
entity:AddStock(uniqueID)
PLUGIN:SaveData()
hook.Run("CharacterVendorTraded", client, entity, uniqueID, isSellingToVendor)
else
if (data[VENDOR.MODE] ~= VENDOR.SELLANDBUY and data[VENDOR.MODE] ~= VENDOR.SELLONLY) then
return false
end
local stock = entity:GetStock(uniqueID)
if (stock and stock < 1) then
return client:NotifyLocalized("vendorNoStock")
end
if (!client:GetCharacter():HasMoney(price)) then
return client:NotifyLocalized("canNotAfford")
end
local name = L(ix.item.list[uniqueID].name, client)
client:GetCharacter():TakeMoney(price)
client:NotifyLocalized("businessPurchase", name, ix.currency.Get(price))
entity:GiveMoney(price)
if (!client:GetCharacter():GetInventory():Add(uniqueID)) then
ix.item.Spawn(uniqueID, client)
end
entity:TakeStock(uniqueID)
PLUGIN:SaveData()
hook.Run("CharacterVendorTraded", client, entity, uniqueID, isSellingToVendor)
end
else
client:NotifyLocalized("vendorNoTrade")
end
end)
else
VENDOR_TEXT = {}
VENDOR_TEXT[VENDOR.SELLANDBUY] = "vendorBoth"
VENDOR_TEXT[VENDOR.BUYONLY] = "vendorBuy"
VENDOR_TEXT[VENDOR.SELLONLY] = "vendorSell"
function PLUGIN:CreateItemInteractionMenu(item_panel, menu, itemTable)
if not IsValid(ix.gui.vendorRemake) then
return
end
local entity = ix.gui.vendorRemake.entity
local inventory = ix.item.inventories[item_panel.inventoryID]
local data = entity.items[itemTable.uniqueID] and entity.items[itemTable.uniqueID][VENDOR.MODE] or 0
menu = DermaMenu()
if inventory.vars.isNewVendor then
if (data == VENDOR.SELLANDBUY or data == VENDOR.SELLONLY) then
menu:AddOption(L"purchase", function()
self:SendTradeToVendor(itemTable, false)
end):SetImage("icon16/basket_put.png")
end
if IsValid(ix.gui.vendorRemakeEditor) then
menu:AddOption(L"vendorRemoveItemEditor", function()
ix.gui.vendorRemakeEditor:updateVendor("remove_inv_item", {itemTable.id, itemTable.uniqueID})
end):SetImage("icon16/basket_delete.png")
end
else -- client inventory
if (data == VENDOR.SELLANDBUY or data == VENDOR.BUYONLY) then
menu:AddOption(L"sell", function()
self:SendTradeToVendor(itemTable, true)
end):SetImage("icon16/basket_remove.png")
end
end
menu:Open()
return true
end
net.Receive("ixVendorRemakeEdit", function()
local panel = ix.gui.vendorRemake
if (!IsValid(panel)) then
return
end
local entity = panel.entity
if (!IsValid(entity)) then
return
end
local key = net.ReadString()
local data = net.ReadType()
if (key == "mode") then
local uniqueID = data[1]
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.MODE] = data[2]
elseif (key == 'inventory_size') then
if (!IsValid(ix.gui.menu) and IsValid(ix.gui.vendorRemake)) then
ix.gui.vendorRemake:SetLocalInventory(LocalPlayer():GetCharacter():GetInventory())
ix.gui.vendorRemake:SetVendorInventory(entity:GetInventory())
end
elseif (key == "price") then
local uniqueID = data[1]
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.PRICE] = tonumber(data[2])
elseif (key == "stockDisable") then
if (entity.items[data]) then
entity.items[data][VENDOR.MAXSTOCK] = nil
end
elseif (key == "stockMax") then
local uniqueID = data[1]
local value = data[2]
local current = data[3]
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.MAXSTOCK] = value
entity.items[uniqueID][VENDOR.STOCK] = current
elseif (key == "stock") then
local uniqueID = data[1]
local value = data[2]
entity.items[uniqueID] = entity.items[uniqueID] or {}
if (!entity.items[uniqueID][VENDOR.MAXSTOCK]) then
entity.items[uniqueID][VENDOR.MAXSTOCK] = value
end
entity.items[uniqueID][VENDOR.STOCK] = value
elseif (key == "scale") then
entity.scale = data
elseif (key == "remove_inv_item") then
entity.items[data[2]] = nil
end
end)
net.Receive("ixVendorRemakeEditFinish", function()
local panel = ix.gui.vendorRemake
local editor = ix.gui.vendorRemakeEditor
if (!IsValid(panel) or !IsValid(editor)) then
return
end
local entity = panel.entity
if (!IsValid(entity)) then
return
end
local key = net.ReadString()
local data = net.ReadType()
if (key == "name") then
editor.name:SetText(data)
elseif (key == "description") then
editor.description:SetText(data)
elseif (key == "bubble") then
editor.bubble.noSend = true
editor.bubble:SetValue(data and 1 or 0)
elseif (key == "mode") then
if (data[2] == nil) then
editor.lines[data[1]]:SetValue(2, L"none")
else
editor.lines[data[1]]:SetValue(2, L(VENDOR_TEXT[data[2]]))
end
elseif (key == "price") then
editor.lines[data]:SetValue(3, entity:GetPrice(data))
elseif (key == "stockDisable") then
editor.lines[data]:SetValue(4, "-")
elseif (key == "stockMax" or key == "stock") then
local current, max = entity:GetStock(data)
editor.lines[data]:SetValue(4, current.."/"..max)
elseif (key == "faction") then
local uniqueID = data[1]
local state = data[2]
local editPanel = ix.gui.editorFaction
entity.factions[uniqueID] = state
if (IsValid(editPanel) and IsValid(editPanel.factions[uniqueID])) then
editPanel.factions[uniqueID]:SetChecked(state == true)
end
elseif (key == "class") then
local uniqueID = data[1]
local state = data[2]
local editPanel = ix.gui.editorFaction
entity.classes[uniqueID] = state
if (IsValid(editPanel) and IsValid(editPanel.classes[uniqueID])) then
editPanel.classes[uniqueID]:SetChecked(state == true)
end
elseif (key == "model") then
editor.model:SetText(entity:GetModel())
elseif (key == "scale") then
editor.sellScale.noSend = true
editor.sellScale:SetValue(data)
elseif (key == "remove_inv_item") then
editor.lines[data[2]]:SetValue(2, L"none")
end
surface.PlaySound("buttons/button14.wav")
end)
net.Receive("ixVendorRemakeOpen", function()
if (IsValid(ix.gui.menu)) then
net.Start("ixVendorRemakeClose")
net.SendToServer()
return
end
local entity = net.ReadEntity()
if (!IsValid(entity)) then
return
end
entity.money = net.ReadUInt(16)
entity.items = net.ReadTable()
local inventory = entity:GetInventory()
if (inventory and inventory.slots) then
if IsValid(ix.gui.vendorRemake) then
ix.gui.vendorRemake:Remove()
end
local localInventory = LocalPlayer():GetCharacter():GetInventory()
ix.gui.vendorRemake = vgui.Create("ixVendorRemakeView")
ix.gui.vendorRemake.entity = entity
if (localInventory) then
ix.gui.vendorRemake:SetLocalInventory(localInventory)
end
ix.gui.vendorRemake:SetVendorTitle(entity:GetDisplayName())
ix.gui.vendorRemake:SetVendorInventory(entity:GetInventory())
if (entity.money) then
if (localInventory) then
ix.gui.vendorRemake:SetLocalMoney(LocalPlayer():GetCharacter():GetMoney())
end
ix.gui.vendorRemake:SetVendorMoney(entity.money)
end
end
end)
net.Receive("ixVendorRemakeEditor", function()
local entity = net.ReadEntity()
if (!IsValid(entity) or !CAMI.PlayerHasAccess(LocalPlayer(), "Helix - Manage Vendors", nil)) then
return
end
entity.money = net.ReadUInt(16)
entity.items = net.ReadTable()
entity.scale = net.ReadFloat()
entity.messages = net.ReadTable()
entity.factions = net.ReadTable()
entity.classes = net.ReadTable()
local inventory = entity:GetInventory()
if (inventory and inventory.slots) then
if IsValid(ix.gui.vendorRemake) then
ix.gui.vendorRemake:Remove()
end
local localInventory = LocalPlayer():GetCharacter():GetInventory()
ix.gui.vendorRemake = vgui.Create("ixVendorRemakeView")
ix.gui.vendorRemake.entity = entity
if (localInventory) then
ix.gui.vendorRemake:SetLocalInventory(localInventory)
end
ix.gui.vendorRemake:SetVendorTitle(entity:GetDisplayName())
ix.gui.vendorRemake:SetVendorInventory(entity:GetInventory())
if (entity.money) then
if (localInventory) then
ix.gui.vendorRemake:SetLocalMoney(LocalPlayer():GetCharacter():GetMoney())
end
ix.gui.vendorRemake:SetVendorMoney(entity.money)
end
ix.gui.vendorRemakeEditor = vgui.Create("ixVendorRemakeEditor")
end
end)
net.Receive("ixVendorRemakeMoney", function()
local panel = ix.gui.vendorRemake
if (!IsValid(panel)) then
return
end
local entity = panel.entity
if (!IsValid(entity)) then
return
end
local value = net.ReadUInt(16)
value = value != -1 and value or nil
entity.money = value
local editor = ix.gui.vendorRemakeEditor
if (IsValid(editor)) then
local useMoney = tonumber(value) != nil
editor.money:SetDisabled(!useMoney)
editor.money:SetEnabled(useMoney)
editor.money:SetText(useMoney and value or "∞")
end
end)
net.Receive("ixVendorRemakeStock", function()
local panel = ix.gui.vendorRemake
if (!IsValid(panel)) then
return
end
local entity = panel.entity
if (!IsValid(entity)) then
return
end
local uniqueID = net.ReadString()
local amount = net.ReadUInt(16)
entity.items[uniqueID] = entity.items[uniqueID] or {}
entity.items[uniqueID][VENDOR.STOCK] = amount
local editor = ix.gui.vendorRemakeEditor
if (IsValid(editor)) then
local _, max = entity:GetStock(uniqueID)
editor.lines[uniqueID]:SetValue(4, amount .. "/" .. max)
end
end)
end
properties.Add("vendor_remake_edit", {
MenuLabel = "Edit Vendor",
Order = 999,
MenuIcon = "icon16/user_edit.png",
Filter = function(self, entity, client)
if (!IsValid(entity)) then return false end
if (entity:GetClass() ~= "ix_vendor_new") then return false end
if (!gamemode.Call( "CanProperty", client, "vendor_remake_edit", entity)) then return false end
return CAMI.PlayerHasAccess(client, "Helix - Manage Vendors", nil)
end,
Action = function(self, entity)
self:MsgStart()
net.WriteEntity(entity)
self:MsgEnd()
end,
Receive = function(self, length, client)
local entity = net.ReadEntity()
if (!IsValid(entity)) then return end
if (!self:Filter(entity, client)) then return end
local itemsTable = {}
for k, v in pairs(entity.items) do
if (!table.IsEmpty(v)) then
itemsTable[k] = v
end
end
-- Open Inventory
local character = client:GetCharacter()
if (character) then
character:GetInventory():Sync(client, true)
end
entity:GetInventory():AddReceiver(client)
entity.receivers[#entity.receivers + 1] = client
client.ixOpenVendorRemake = entity
entity:GetInventory():Sync(client)
net.Start("ixVendorRemakeEditor")
net.WriteEntity(entity)
net.WriteUInt(entity.money or 0, 16)
net.WriteTable(itemsTable)
net.WriteFloat(entity.scale or 0.5)
net.WriteTable(entity.messages)
net.WriteTable(entity.factions)
net.WriteTable(entity.classes)
net.Send(client)
end
})
|
--- Event handlers related to archivespace search, event registration usually in main.lua
function CallNumberSubmitCheck(sender, args)
if tostring(args.KeyCode) == "Return: 13" then
performSearch(searchTerm, 'call number')
end
end
function TitleSubmitCheck(sender, args)
if tostring(args.KeyCode) == "Return: 13" then
performSearch(collectionTitle, 'title')
end
end
function EADIDSubmitCheck(sender, args)
if tostring(args.KeyCode) == "Return: 13" then
performSearch(eadidTerm, 'ead_id')
end
end
function BarcodeSubmitCheck(sender, args)
if tostring(args.KeyCode) == "Return: 13" then
performSearch(barcodeTerm, 'barcode')
end
end
function performSearch(field, fieldName)
if field.Value == nil or field.Value == '' then
LogDebug('Containers '.. fieldName ..' search run but no search term provided')
else
local res = nil
if field == eadidTerm then
collectionTitle.Value = ''
searchTerm.Value = ''
barcodeTerm.Value = ''
res = getTopContainersByEADID(field.Value)
elseif field == collectionTitle then
eadidTerm.Value = ''
searchTerm.Value = ''
barcodeTerm.Value = ''
res = getTopContainersByTitle(field.Value)
elseif field == searchTerm then
collectionTitle.Value = ''
eadidTerm.Value = ''
barcodeTerm.Value = ''
res = getTopContainersByCallNumber(field.Value)
elseif field == barcodeTerm then
collectionTitle.Value = ''
searchTerm.Value = ''
eadidTerm.Value = ''
res = getTopContainersByBarcode(field.Value)
end
GetBoxes(convertResultsIntoDataTable(res), fieldName)
end
end |
package.path = package.path .. ";./libs/?.lua"
package.cpath = "./libs/?/?.so;" .. package.cpath
local lpeg = require "lpeg"
local S, R, P, V = lpeg.S, lpeg.R, lpeg.P, lpeg.V
local C, Cc, Cg, Cf, Ct, Cmt, Cs = lpeg.C, lpeg.Cc, lpeg.Cg, lpeg.Cf, lpeg.Ct, lpeg.Cmt, lpeg.Cs
local function createLuaGrammar()
local asciiletter = R("az","AZ")
local alphanum = R("az","AZ","09") + P"_"
local digit = R("09")
local hex_digit = R("09", "af", "AF")
-- Numeric patterns
local dec_int = digit^1
local hex_int = P"0" * S"xX" * hex_digit^1
local integer = dec_int + hex_int
local dec_fract = P(".") * dec_int + dec_int * P(".") * digit^0
local hex_fract = P(".") * hex_int + hex_int * P(".") * hex_digit^0
local dec_exp = S"Ee" * S"+-"^-1 * dec_int
local hex_exp = S"Pp" * S"+-"^-1 * dec_int
local dec_float = dec_fract * dec_exp^-1 + dec_int * dec_exp
local hex_float = hex_fract * hex_exp^-1 + hex_int * hex_exp
local float = dec_float + hex_float
--
-- String patterns
local c_escape = (P"a" / "\a"
+ P"b" / "\b"
+ P"f" / "\f"
+ P"n" / "\n"
+ P"r" / "\r"
+ P"t" / "\t"
+ P"v" / "\v"
+ P"n" / "\n"
+ P"r" / "\n"
+ P"\\" / "\\"
+ P"\"" / "\""
+ P"\'" / "\'")
-- S"abfnrtv\\\'\"" -- What comes after a '\'
local hex_escape = P'x' * hex_digit * hex_digit
local dec_escape = digit * digit^-2
local unicode_escape = P'u' * P'{' * hex_digit * hex_digit^-2 * P'}'
local escape = (P"\\" / "") * (c_escape + hex_escape + dec_escape + unicode_escape)
local char_escape = escape + P(1)
local short_string = P"'" * Cs((char_escape - P("'"))^0) * P("'")
+ P'"' * Cs((char_escape - P('"'))^0) * P('"')
local long_string = Cmt(P"[" * C(P"="^0) * P"[" * P"\n"^-1,
function (subject, i, equals)
local begins, ends = string.find(subject, string.format("]%s]", equals), i, true)
local capture = string.sub(subject, i, begins-1)
return ends + 1, capture
end)
local long_string_no_capture = Cmt(P"[" * C(P"="^0) * P"[" * P"\n"^-1,
function (subject, i, equals)
local _, ends = string.find(subject, string.format("]%s]", equals), i, true)
return ends + 1
end)
--
-- Comments
local singleline_comment = P'--' * (1 - S'\r\n\f')^0
local multiline_comment = P'--' * long_string_no_capture --long_string
local comment = multiline_comment + singleline_comment
--
-- Spaces
local space = S" \n\t\r"
local spaces = (space + comment)^0
local function makeTerminal(patt)
return patt * spaces
end
local function symbol(literal)
return makeTerminal(P(literal))
end
--
-- Symbols
local colon = symbol":"
local semicolon = symbol";"
local doublecolon = symbol"::"
local comma = symbol","
local dot = symbol"."
local open_paren = symbol"("
local close_paren = symbol")"
local open_square = symbol"["
local close_square = symbol"]"
local open_curly = symbol"{"
local close_curly = symbol"}"
local ellipsis = symbol"..."
local equal = symbol"="
local fieldsep = comma + semicolon
local open_angle = symbol"<"
local close_angle = symbol">"
--
-- Operators
local pot_op = makeTerminal(C"^")
local unary_op = makeTerminal(C"not" + C"#" + (P"-"/"u-") + (P"~" / "u~"))
local mul_op = makeTerminal(C(P"//" + S"*/%"))
local add_op = makeTerminal(C(S"+-"))
local concat_op = makeTerminal(C"..")
local bitshift_op = makeTerminal(C"<<" + C">>")
local bitand_op = makeTerminal(C"&")
local bitxor_op = makeTerminal(C"~")
local bitor_op = makeTerminal(C"|")
local comparison_op = makeTerminal(C"<=" + C">=" + C"<" + C">" + C"~=" + C"==")
local and_op = makeTerminal(C"and")
local or_op = makeTerminal(C"or")
--
-- Reserved Words
local function Rw (w)
return P(w) * (-alphanum) * spaces
end
local Break = Rw"break"
local Do = Rw"do"
local Else = Rw"else"
local Elseif = Rw"elseif"
local End = Rw"end"
local For = Rw"for"
local Function = Rw"function"
local Goto = Rw"goto"
local If = Rw"if"
local In = Rw"in"
local Local = Rw"local"
local Repeat = Rw"repeat"
local Return = Rw"return"
local Then = Rw"then"
local Until = Rw"until"
local While = Rw"while"
local reserved_words = {
["and"] = true,
["break"] = true,
["do"] = true,
["else"] = true,
["elseif"] = true,
["end"] = true,
["false"] = true,
["for"] = true,
["function"] = true,
["goto"] = true,
["if"] = true,
["in"] = true,
["local"] = true,
["nil"] = true,
["not"] = true,
["or"] = true,
["repeat"] = true,
["return"] = true,
["then"] = true,
["true"] = true,
["until"] = true,
["while"] = true,
}
--
-- AST-related functions
-- Tag
local function tagP(name, patt)
return Cg(patt, name)
end
local function tagWrap(tag, patt)
return Ct(patt * Cg(Cc(tag), 'tag'))
end
local function foldBinExp(lhs, op, rhs)
return Cf(lhs * Cg(op * rhs)^0,
function (v1, o, v2)
return {tag=o, lhs=v1, rhs=v2}
end)
end
local function nestExpression(a, b)
if b.tag == 'FunctionCall' then
b.func = a
elseif b.tag == 'MethodCall' then
b.receiver = a
else
b.exp = a
end
return b
end
local function optional(patt, default)
-- return the values captured by `patt' if it matches, else return
-- `default'
return patt + Cc(default)
end
local function localFunctionDesugar(name, closure)
closure.tag = 'AnonymousFunction'
return {
tag = 'LocalAssign',
vars = {
{tag='LocalVar', name=name, attribute=false}
},
exps = {}
},
{
tag = 'Assign',
vars = {
{tag='Var', name=name}
},
exps = {closure}
}
end
local function globalFunctionDesugar(var, func)
if var.tag == 'MethodDef' then
table.insert(func.params, 1, {name = 'self', tag = 'LocalVar'})
var.tag = 'Indexation'
end
return
{
tag = 'Assign',
vars = {var},
exps = {func}
}
end
local function nestFunctionDefinition(a, b)
if a.tag == 'Var' then a.tag = 'VarExp'
elseif a.tag == 'Indexation' then a.tag = 'IndexationExp' end -- minor hack
return {tag='Indexation', index=b, exp=a}
end
local function nestIf(stat, ...)
if not stat then
return false
else
local elseIfStat = nestIf(...)
if elseIfStat then
if elseIfStat.tag == 'IfStatement' then
local block = {tag = 'Block'}
block.statements = {head = elseIfStat, tail = {}}
stat.elseBody = block
else
stat.elseBody = elseIfStat
end
else
stat.elseBody = false
end
return stat
end
end
local function nestStats(s, ...)
if not s or s == '' then
return {}
else
return {head = s, tail = nestStats(...)}
end
end
-- Grammar rules
local rules = {"Chunk"}
-- Terminals
rules.LiteralString = makeTerminal(
tagWrap("StringLiteral", tagP("literal", short_string + long_string))
) -- already produces captures
rules.Name = makeTerminal(
Cmt((asciiletter + P'_') * alphanum^0,
function (_, _, name)
return not reserved_words[name], name
end)
)
rules.FloatNumeral = tagWrap('NumberLiteral', tagP('literal', makeTerminal(C(float)) / tonumber))
rules.IntegerNumeral = tagWrap('NumberLiteral', tagP('literal', makeTerminal(C(integer)) / tonumber))
rules.Numeral = V"FloatNumeral" + V"IntegerNumeral"
rules.True = tagWrap('BoolLiteral', tagP('literal', Cc(true) * Rw"true"))
rules.False = tagWrap('BoolLiteral', tagP('literal', Cc(false) * Rw"false"))
rules.Nil = tagWrap('Nil', Rw"nil")
rules.Ellipsis = tagWrap('Vararg', ellipsis)
--
rules.Chunk = spaces * V"Block"
rules.Block = tagWrap('Block', tagP('statements',
Cg(V"Stat"^0 * V"ReturnStat"^-1) / nestStats
))
-- Statement
rules.Stat =
-- Empty statement
tagWrap('Nop', semicolon)
-- Local assign
+ tagWrap('LocalAssign',
Local *
tagP('vars', Ct(V"LocalVarList")) *
tagP('exps', Ct((equal * V"ExpList")^-1))
)
-- Assign
+ tagWrap('Assign', tagP('vars', V"VarList") * equal * tagP('exps', Ct(V"ExpList")))
-- Local function declaration. Transforms to 'local f; f = function ...'
+ Local * Function * V"Name" * V"AnonymousFunction" / localFunctionDesugar
-- "Global" function declaration. Transforms to 'f = function ...'
+ Function * V"FunctionName" * V"AnonymousFunction" / globalFunctionDesugar
-- Function call statement
+ V"FunctionCallStat"
-- GOTO, break, label
+ tagWrap('Goto', Goto * tagP('label', V"Name"))
+ tagWrap('Break', Break)
+ tagWrap('Label', tagP('label', V"Label"))
-- Do blocks
+ tagWrap('Do', Do * tagP('body', V"Block") * End)
-- While loop
+ tagWrap('While', While * tagP('condition', V"Exp") * Do * tagP('body', V"Block") * End)
-- Repeat until loop
+ tagWrap('Repeat', Repeat * tagP('body', V"Block") * Until * tagP('condition', V"Exp"))
-- Numeric for
+ tagWrap("NumericFor",
For
* tagP('var', V"WrappedName")
* equal * tagP('init', V"Exp")
* comma * tagP('limit', V"Exp")
* tagP('step', optional(comma * V"Exp", false))
* Do * tagP('body', V"Block") * End
)
-- Generic For
+ tagWrap("GenericFor",
For
* tagP('vars', Ct(V"NameList"))
* In * tagP('exps', Ct(V"ExpList"))
* Do * tagP('body', V"Block") * End
)
+ V"IfStatement"
--
rules.ReturnStat = tagWrap('Return',
Return * tagP('exps', optional(Ct(V"ExpList"), false)) * semicolon^-1
)
rules.Label = doublecolon * V"Name" * doublecolon
rules.WrappedName = tagWrap('LocalVar', tagP('name', V"Name"))
rules.NameList = V"WrappedName" * (comma * V"WrappedName")^0
rules.LocalVarList = V"LocalVar" * (comma * V"LocalVar")^0
rules.LocalVar = tagWrap('LocalVar', tagP('name', V"Name") * tagP('attribute', V"Attrib"))
-- we could follow the grammar and allow Name attributes, but
-- it's so much easier to hardcode this in the parser while
-- there are not too many attributes (vanilla lua also does
-- this, see lparser.c)
rules.Attrib = optional(open_angle * (C"const" + C"close") * close_angle, false)
rules.FunctionName = V"FunctionNameWithMethod" + V"FunctionWithIndex" -- Order is important
-- Function with indexation in name 'a.b'
rules.FunctionWithIndex = Cf(
-- first var
tagWrap('Var', tagP('name', V"Name"))
-- many indexes
* (dot * tagWrap('StringLiteral', tagP('literal', V"Name")))^0,
-- nest indexes
nestFunctionDefinition
)
-- Functions ending in ':methodName'
rules.FunctionNameWithMethod = tagWrap('MethodDef',
tagP('exp', V"FunctionWithIndex"
/ function(a)
if a.tag == 'Var' then a.tag = 'VarExp'
elseif a.tag == 'Indexation' then a.tag = 'IndexationExp' end
return a
end)
* colon * tagP('index', tagWrap('StringLiteral', tagP('literal', V"Name")))
)
rules.IfStatement =
-- Topmost if
tagWrap('IfStatement', If * tagP('condition', V"Exp") * Then * tagP('thenBody', V"Block"))
-- Followed by zero or more elseif
* (tagWrap('IfStatement', Elseif * tagP('condition', V"Exp") * Then * tagP('thenBody', V"Block")))^0
-- Followed optionally by an else
* optional(Cg(Else * V"Block"), false) * End
/ nestIf
rules.VarList = Ct(V"Var" * (comma * V"Var")^0)
rules.Var = Cf(V"ExpPrefix" * V"VarSuffix", nestExpression)
/ function(i)
if i.tag == 'IndexationExp' then i.tag = 'Indexation' end
return i
end
+ tagWrap('Var', tagP('name', V"Name"))
rules.VarSuffix = (V"CallSuffix")^0
* (V"Indexation") * (V"VarSuffix")^-1
rules.ExpList = V"Exp" * (comma * V"Exp")^0
rules.Exp = V"OrExp"
rules.PrimaryExp = V"Nil"
+ V"False"
+ V"True"
+ V"Ellipsis"
+ V"Numeral"
+ V"LiteralString"
+ V"TableConstructor"
+ Function * V"AnonymousFunction"
rules.PostfixedExp = V"PrimaryExp"
+ Cf(V"ExpPrefix" * (V"Indexation" + V"CallSuffix")^0, nestExpression)
rules.PotExp = foldBinExp(V"PostfixedExp", pot_op, V"UnaryExp")
rules.UnaryExp = (unary_op * V"PotExp" / function (opName, exp) return {tag=opName, exp=exp} end)
+ V"PotExp"
rules.MulExp = foldBinExp(V"UnaryExp", mul_op, V"UnaryExp")
rules.AddExp = foldBinExp(V"MulExp", add_op, V"MulExp")
rules.ConcatExp = foldBinExp(V"AddExp", concat_op, V"AddExp")
rules.BitshiftExp = foldBinExp(V"ConcatExp", bitshift_op, V"ConcatExp")
rules.BitandExp = foldBinExp(V"BitshiftExp", bitand_op, V"BitshiftExp")
rules.BitxorExp = foldBinExp(V"BitandExp", bitxor_op, V"BitandExp")
rules.BitorExp = foldBinExp(V"BitxorExp", bitor_op, V"BitxorExp")
rules.ComparisonExp = (V"BitorExp" * comparison_op * V"BitorExp" / function (exp1, opName, exp2)
return {tag=opName, lhs=exp1, rhs=exp2} end)
+ V"BitorExp"
rules.AndExp = foldBinExp(V"ComparisonExp", and_op, V"ComparisonExp")
rules.OrExp = foldBinExp(V"AndExp", or_op, V"AndExp")
rules.ExpPrefix = tagWrap('VarExp', tagP('name', V"Name"))
+ open_paren * V"Exp" * close_paren
rules.Indexation = dot * tagWrap('IndexationExp', tagP('index', tagWrap('StringLiteral', tagP('literal', V"Name"))))
+ open_square * tagWrap('IndexationExp', tagP('index', V"Exp")) * close_square
rules.CallSuffix = tagWrap("FunctionCall", tagP('args', V"Args"))
+ tagWrap("MethodCall", colon * tagP('method', V"Name") * tagP('args', V"Args"))
rules.Args = open_paren * Ct(V"ExpList"^-1) * close_paren
+ Ct(V"TableConstructor")
+ Ct(V"LiteralString")
rules.AnonymousFunction = tagWrap('AnonymousFunction',
open_paren * tagP('params', Ct(V"Parameters"^-1)) * close_paren * tagP('body', V"Block") * End
)
rules.Parameters = V"Ellipsis"
+ V"NameList" * (comma * V"Ellipsis")^-1
rules.TableConstructor = tagWrap("TableConstructor", open_curly * tagP('fields', V"FieldList"^-1) * close_curly)
rules.FieldList = Ct(V"Field" * (fieldsep * V"Field")^0 * fieldsep^-1)
rules.Field = tagWrap("ExpAssign", open_square * tagP('exp', V"Exp") * close_square * equal * tagP('value', V"Exp"))
+ tagWrap("NameAssign", tagP('name', V"Name") * equal * tagP('value', V"Exp"))
+ tagWrap("Exp", tagP('value', V"Exp"))
rules.FunctionCallStat = Cf(V"ExpPrefix" * V"CallStatSuffix", nestExpression)
/ function(x) if x.tag == "FunctionCall" then x.tag = "FunctionCallStat" else x.tag = "MethodCallStat" end return x end
rules.CallStatSuffix = (V"Indexation"^0 * V"CallSuffix" * (V"CallStatSuffix")^-1)
return lpeg.P(rules) * -1
end
local grammar = createLuaGrammar()
-- Parser/Evaluator
local function parse(s, _)
local t = lpeg.match(P(grammar), s)
if t then
return t
else print(string.format("Failed to parse '%s'", s))
end
end
return {parse = parse}
--[[
check Reserved words, spaces after rw
--]]
|
function write_gpio(num,pin_index,bits)
write_gpio_unsigned(
num + shl(1, bits-1),
pin_index,
bits
)
end
function write_gpio_unsigned(num,pin_index,bits)
local lastbit_i =
0x5f80+pin_index+bits-1
local mask = 1
for j=0,bits-1 do
local bit = shr(band(num, mask), j)
poke(lastbit_i-j, bit*255)
mask = shl(mask, 1)
end
end
function read_gpio(pin_index,bits)
return read_gpio_unsigned(
pin_index,
bits
) - shl(1, bits-1)
end
function read_gpio_unsigned(pin_index,bits)
local firstbit_i =
0x5f80+pin_index
local num = 0
for j=0,bits-1 do
local val = peek(firstbit_i+j)
if val > 0 then
num = num + shl(1, bits-1-j)
end
end
return num
end
|
local diagnostics = {
'diagnostics',
-- table of diagnostic sources, available sources:
-- nvim_lsp, coc, ale, vim_lsp
sources = {'nvim_diagnostic'},
-- displays diagnostics from defined severity
sections = {'error', 'warn', 'info', 'hint'}
-- all colors are in format #rrggbb
-- color_error = nil, -- changes diagnostic's error foreground color
-- color_warn = nil, -- changes diagnostic's warn foreground color
-- color_info = nil, -- Changes diagnostic's info foreground color
-- color_hint = nil, -- Changes diagnostic's hint foreground color
-- symbols = {error = 'E', warn = 'W', info = 'I', hint = 'H'}
}
require'lualine'.setup {
options = {
icons_enabled = true,
theme = 'material',
component_separators = {'', ''},
section_separators = {'', ''},
disabled_filetypes = {}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff'},
lualine_c = {'filename'},
lualine_x = {'filetype'},
lualine_y = {'progress', 'location'},
lualine_z = {diagnostics}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {diagnostics}
},
tabline = {},
extensions = {'quickfix'}
}
|
// Generated by github.com/davyxu/tabtoy
// Version: 2.8.10
module table {
export var TTask : table.ITTaskDefine[] = [
{ Id : 1001, MainTask : 1000, SubTask : 1, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1002, MainTask : 1000, SubTask : 2, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1003, MainTask : 1000, SubTask : 3, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1004, MainTask : 1000, SubTask : 4, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1005, MainTask : 1000, SubTask : 5, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1006, MainTask : 1000, SubTask : 6, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1007, MainTask : 1000, SubTask : 7, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1008, MainTask : 1000, SubTask : 8, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1009, MainTask : 1000, SubTask : 9, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 1010, MainTask : 1000, SubTask : 10, Count : 1, Desc : "分享1次", Reward : "6001-2000" },
{ Id : 2001, MainTask : 2000, SubTask : 1, Count : 1, Desc : "获得比赛最终胜利1次", Reward : "6001-1000" },
{ Id : 2002, MainTask : 2000, SubTask : 2, Count : 2, Desc : "获得比赛最终胜利2次", Reward : "6001-2000" },
{ Id : 2003, MainTask : 2000, SubTask : 3, Count : 3, Desc : "获得比赛最终胜利3次", Reward : "6001-3000" },
{ Id : 2004, MainTask : 2000, SubTask : 4, Count : 5, Desc : "获得比赛最终胜利4次", Reward : "6001-4000" },
{ Id : 3001, MainTask : 3000, SubTask : 1, Count : 3, Desc : "参加3局比赛", Reward : "6001-1000" },
{ Id : 3002, MainTask : 3000, SubTask : 2, Count : 5, Desc : "参加5局比赛", Reward : "6001-2000" },
{ Id : 3003, MainTask : 3000, SubTask : 3, Count : 7, Desc : "参加7局比赛", Reward : "6001-3000" },
{ Id : 3004, MainTask : 3000, SubTask : 4, Count : 10, Desc : "参加10局比赛", Reward : "6001-4000" },
{ Id : 4001, MainTask : 4000, SubTask : 1, Count : 1000, Desc : "比赛中赢得1000金币", Reward : "6001-1000" },
{ Id : 4002, MainTask : 4000, SubTask : 2, Count : 2000, Desc : "比赛中赢得2000金币", Reward : "6001-2000" },
{ Id : 4003, MainTask : 4000, SubTask : 3, Count : 5000, Desc : "比赛中赢得3000金币", Reward : "6001-3000" },
{ Id : 4004, MainTask : 4000, SubTask : 4, Count : 10000, Desc : "比赛中赢得4000金币", Reward : "6001-4000" },
{ Id : 5001, MainTask : 5000, SubTask : 1, Count : 10, Desc : "淘汰10名玩家", Reward : "6001-1000" },
{ Id : 5002, MainTask : 5000, SubTask : 2, Count : 50, Desc : "淘汰50名玩家", Reward : "6001-2000" },
{ Id : 5003, MainTask : 5000, SubTask : 3, Count : 100, Desc : "淘汰100名玩家", Reward : "6001-3000" },
{ Id : 5004, MainTask : 5000, SubTask : 4, Count : 200, Desc : "淘汰200名玩家", Reward : "6001-4000" }
]
// Id
export var TTaskById : game.Dictionary<table.ITTaskDefine> = {}
function readTTaskById(){
for(let rec of TTask) {
TTaskById[rec.Id] = rec;
}
}
readTTaskById();
}
|
local function ShouldRender( hole, pos )
if rendering then return false end
if not hole:GetDrawNextFrame() then return false end
if not IsValid( hole:GetPartner() ) then return false end
if hole:GetForward():Dot( pos - hole:GetPos() ) < 0 then return false end
return true
end
hook.Add( "RenderScene", "BulletHoles", function( pos, ang )
if rendering then return end
local holes = ents.FindByClass( "bullet_hole" )
if not holes then return end
for _, hole in ipairs( holes ) do
if not ShouldRender( hole, pos ) then continue end
hole:SetDrawNextFrame( false )
render.PushRenderTarget( hole:GetTexture() )
render.Clear( 0, 0, 0, 255, true, true )
local oldClip = render.EnableClipping( true )
local partner = hole:GetPartner()
local normal = partner:GetForward()
render.PushCustomClipPlane( normal, normal:Dot( partner:GetPos() ) )
rendering = true
render.RenderView( {
x = 0, y = 0,
w = ScrW(), h = ScrH(),
origin = pos, angles = ang,
dopostprocess = false,
drawviewmodel = false,
drawmonitors = false,
bloomtone = true,
drawhud = false
} )
rendering = false
render.PopCustomClipPlane()
render.EnableClipping( oldClip )
render.PopRenderTarget()
end
end ) |
onWin = function(W)
W:addConditionProgress("boss", "BossRoyalguards")
W:unlockAchievement("ACH_KILL_ROYAL_GUARDS")
W:setMap("res/map/gandriacastle/gandriacastle.tmx", 638, 360)
end
onLose = function(W)
W:setMap("res/map/gandriacastle/gandriacastle.tmx", 638, 360)
end |
-- Tests for luagit2's oid module functions
describe("oid methods test", function()
local luagit2 = require("luagit2")
local obj_id
local obj_id_string = "1385f264afb75a56a5bec74243be9b367ba4ca08" -- Object ID of Fixtures/new_test_repo/README
local obj_id_semi_zero_a, obj_id_semi_zero_b
local obj_id_semi_zero_string_a = "1385f264afb75a56a5b000000000000000000000"
local obj_id_semi_zero_string_b = "0000000000000006a5bec74243be9b367ba4ca08"
local obj_id_2
local obj_id_string_2 = "fa49b077972391ad58037050f2a75f74e3671e92" -- Object ID of Fixtures/new_test_repo/new.txt
local zero_obj_id
local zero_obj_id_string = "0000000000000000000000000000000000000000"
setup(function()
-- initialize libgit2's global state and threading
luagit2.init()
end)
teardown(function()
-- close threading and global state.
luagit2.shutdown()
end)
before_each(function()
-- setup different variables
obj_id = luagit2.oid_fromstr(obj_id_string)
obj_id_semi_zero_a = luagit2.oid_fromstr(obj_id_semi_zero_string_a)
obj_id_semi_zero_b = luagit2.oid_fromstr(obj_id_semi_zero_string_b)
obj_id_2 = luagit2.oid_fromstr(obj_id_string_2)
zero_obj_id = luagit2.oid_fromstr(zero_obj_id_string)
end)
it("Checks data type and metatable name ", function()
-- checks if passed data is not nil
assert.is.not_nil(obj_id)
assert.is.not_nil(obj_id_semi_zero_a)
assert.is.not_nil(obj_id_semi_zero_b)
assert.is.not_nil(obj_id_2)
assert.is.not_nil(zero_obj_id)
-- checks the passed data type
assert.are.same("userdata", type(obj_id))
assert.are.same("userdata", type(obj_id_semi_zero_a))
assert.are.same("userdata", type(obj_id_semi_zero_b))
assert.are.same("userdata", type(obj_id_2))
assert.are.same("userdata", type(zero_obj_id))
-- checks the metatable name to be luagit2_oid
-- luagit2's oid struct.(see src/lua_objects.h)
assert.are.same("luagit2_oid", luagit2.get_userdata_name(obj_id))
assert.are.same("luagit2_oid", luagit2.get_userdata_name(obj_id_semi_zero_a))
assert.are.same("luagit2_oid", luagit2.get_userdata_name(obj_id_semi_zero_b))
assert.are.same("luagit2_oid", luagit2.get_userdata_name(obj_id_2))
assert.are.same("luagit2_oid", luagit2.get_userdata_name(zero_obj_id))
end)
it("Tests Obj_Id to its equivalent String", function()
-- Check the string value of Object Ids if they are equal
-- to that used for initializing or not.
assert.are.same(obj_id_string, luagit2.oid_tostr(obj_id))
assert.are.same(obj_id_string_2, luagit2.oid_tostr(obj_id_2))
assert.are.same(obj_id_semi_zero_string_a, luagit2.oid_tostr(obj_id_semi_zero_a))
assert.are.same(obj_id_semi_zero_string_b, luagit2.oid_tostr(obj_id_semi_zero_b))
-- reinitializing obj_id value using obj_id_string_2
-- tests setting oibject id by string
obj_id = luagit2.oid_fromstr(obj_id_string_2)
assert.are.not_same(obj_id_string, luagit2.oid_tostr(obj_id))
assert.are.same(obj_id_string_2, luagit2.oid_tostr(obj_id))
end)
it("Tests Creating Dis-Similar Objects", function()
-- This is very important to note
-- That even if using Same string values,
-- The Created Objects will differ on direct Comparison
-- Though their Contained String Value will be same
-- Setting another Alternate Object with Obj_Id_String,
-- Same as that used for Obj_Id
local extra_object = luagit2.oid_fromstr(obj_id_string)
assert(not(extra_object == obj_id))
-- checking their contained string value
assert.are.equal(luagit2.oid_tostr(obj_id), luagit2.oid_tostr(extra_object))
end)
it(" Tests Comparison of two Object Ids", function()
-- It returns Integer Value for comparing two luagit2_oid's (A,B)
-- < 0 if A < B
-- = 0 if A = B
-- > 0 if A > B
-- object_id is oid for README
-- object_id_2 is oid for new.txt
-- Since README was created before new.txt,
-- The Oid of README will be less than that of new.txt
assert((luagit2.oid_cmp(obj_id, obj_id_2)) < 0)
assert((luagit2.oid_cmp(obj_id_2, obj_id)) > 0)
assert((luagit2.oid_cmp(obj_id, obj_id)) == 0)
end)
it(" Tests Comparison of two Object Ids for a given length counted from left", function()
-- Returns Zero in case of match
assert(luagit2.oid_ncmp(obj_id, obj_id_semi_zero_a, 10) == 0)
assert(luagit2.oid_ncmp(obj_id, obj_id_semi_zero_b, 10) ~= 0)
end)
it(" Tests oid_from_strn ", function()
-- new oid created using first n length of string.
obj_id = luagit2.oid_fromstrn(obj_id_string, 19)
assert((luagit2.oid_cmp(obj_id, obj_id_semi_zero_a)) == 0)
assert.are.equal(luagit2.oid_tostr(obj_id), obj_id_semi_zero_string_a)
end)
it(" Tests Comparison of Object Id and equivalent String Values", function()
-- Check for string values of different Object_Ids
assert.are.equal(luagit2.oid_tostr(obj_id), obj_id_string)
assert.are.equal(luagit2.oid_tostr(obj_id_2), obj_id_string_2)
assert.are.equal(luagit2.oid_tostr(obj_id_semi_zero_a), obj_id_semi_zero_string_a)
assert.are.equal(luagit2.oid_tostr(obj_id_semi_zero_b), obj_id_semi_zero_string_b)
assert.are.equal(luagit2.oid_tostr(zero_obj_id), zero_obj_id_string)
end)
it(" Tests whether the OBject Id contains all zeros", function()
-- It Returns Integer value
-- true if oid has all zeros
-- false if oid does not have all zeros
assert.is_false(luagit2.oid_iszero(obj_id))
assert.is_true(luagit2.oid_iszero(zero_obj_id))
end)
it(" Tests Various Formatting methods available", function()
-- format the oid for entire string value
assert.are.equal(luagit2.oid_nfmt(obj_id, 40), obj_id_string)
-- format oid only for first 10 readable chars
-- The value is non readable after 10 chars.
assert(string.find(luagit2.oid_nfmt(obj_id, 10), "1385f264af"))
-- Tests the path of object as in .git/objects/
assert.are.equal(luagit2.oid_pathfmt(obj_id), "13/85f264afb75a56a5bec74243be9b367ba4ca08")
-- Format the Object Id to be complete human readable string.
assert.are.equal(luagit2.oid_fmt(obj_id), obj_id_string)
end)
end)
|
local pg = require "pgsql"
local function wait4conn(self)
local reset=false
while self.conn:status() ~= pg.CONNECTION_OK and self.run == true and self.closed == false do
trace("Resetting pgsql connection", self.conn)
self.conn:reset()
reset=true
end
return reset
end
local function connect(self,cinfo,callback)
if type(cinfo) == 'table' then
cinfo = string.format("host=%s port=%d user=%s password=%s",
cinfo.host,cinfo.port,cinfo.user,cinfo.password)
end
self.conn = pg.connectdb(cinfo)
self.run = self.conn:status() == pg.CONNECTION_OK
self.time = os.time()
if callback then callback(self.conn) end
end
local function action(self, runCB, ...)
if not self.run then
trace"Attempting to use closed pgsql connection"
return
end
if (os.time() - self.time) > 60 then
self.conn:exec"SELECT 1" -- Ping
end
if self.conn:status() ~= pg.CONNECTION_OK then
wait4conn(self)
end
local runagain = runCB(self.conn, ...)
while wait4conn(self) and runagain do
runagain = runCB(self.conn, ...)
end
self.time = os.time()
end
local function close(self)
if self.run then
self.run=false
self.conn:finish()
end
end
local function create(cinfo, callback)
local self={run=false,closed=false}
local dbthread=ba.thread.create()
if type(callback) == 'function' then
dbthread:run(function() connect(self,cinfo,callback) end)
else
connect(self,cinfo) -- Blocking connect call
end
return {
conn=self.conn, -- Set if 'Blocking'
connected=function() return self.conn and self.conn:status() ~= pg.CONNECTION_OK end,
run=function(runCB, ...)
local t=table.pack(...)
dbthread:run(function() action(self, runCB, table.unpack(t)) end)
end,
close=function() dbthread:run(function() close(self) end) self.closed = true end
}
end
return {create=create}
|
---@class ServerOptions.TextServerOption : zombie.network.ServerOptions.TextServerOption
ServerOptions_TextServerOption = {}
---@public
---@return String
function ServerOptions_TextServerOption:getType() end
---@public
---@return ConfigOption
function ServerOptions_TextServerOption:asConfigOption() end
---@public
---@return String
function ServerOptions_TextServerOption:getTooltip() end
|
-- Lua extended vocabulary of basic tools.
-- Written by Cosmin Apreutesei. Public domain.
-- Modifications by Sled
local glue = {}
local min, max, floor, ceil, log =
math.min, math.max, math.floor, math.ceil, math.log
local select, unpack, pairs, rawget = select, unpack, pairs, rawget
--math -----------------------------------------------------------------------
function glue.round(x, p)
p = p or 1
return floor(x / p + .5) * p
end
function glue.floor(x, p)
p = p or 1
return floor(x / p) * p
end
function glue.ceil(x, p)
p = p or 1
return ceil(x / p) * p
end
glue.snap = glue.round
function glue.clamp(x, x0, x1)
return min(max(x, x0), x1)
end
function glue.lerp(x, x0, x1, y0, y1)
return y0 + (x-x0) * ((y1-y0) / (x1 - x0))
end
function glue.nextpow2(x)
return max(0, 2^(ceil(log(x) / log(2))))
end
--varargs --------------------------------------------------------------------
if table.pack then
glue.pack = table.pack
else
function glue.pack(...)
return {n = select('#', ...), ...}
end
end
--always use this because table.unpack's default j is #t not t.n.
function glue.unpack(t, i, j)
return unpack(t, i or 1, j or t.n or #t)
end
--tables ---------------------------------------------------------------------
--count the keys in a table with an optional upper limit.
function glue.count(t, maxn)
local maxn = maxn or 1/0
local n = 0
for _ in pairs(t) do
n = n + 1
if n >= maxn then break end
end
return n
end
--reverse keys with values.
function glue.index(t)
local dt={}
for k,v in pairs(t) do dt[v]=k end
return dt
end
--put keys in a list, optionally sorted.
local function desc_cmp(a, b) return a > b end
function glue.keys(t, cmp)
local dt={}
for k in pairs(t) do
dt[#dt+1]=k
end
if cmp == true or cmp == 'asc' then
table.sort(dt)
elseif cmp == 'desc' then
table.sort(dt, desc_cmp)
elseif cmp then
table.sort(dt, cmp)
end
return dt
end
--stateless pairs() that iterate elements in key order.
function glue.sortedpairs(t, cmp)
local kt = glue.keys(t, cmp or true)
local i = 0
return function()
i = i + 1
return kt[i], t[kt[i]]
end
end
--update a table with the contents of other table(s).
function glue.update(dt,...)
for i=1,select('#',...) do
local t=select(i,...)
if t then
for k,v in pairs(t) do dt[k]=v end
end
end
return dt
end
--add the contents of other table(s) without overwrite.
function glue.merge(dt,...)
for i=1,select('#',...) do
local t=select(i,...)
if t then
for k,v in pairs(t) do
if rawget(dt, k) == nil then dt[k]=v end
end
end
end
return dt
end
--get the value of a table field, and if the field is not present in the
--table, create it as an empty table, and return it.
function glue.attr(t, k, v0)
local v = t[k]
if v == nil then
if v0 == nil then
v0 = {}
end
v = v0
t[k] = v
end
return v
end
--lists ----------------------------------------------------------------------
--extend a list with the elements of other lists.
function glue.extend(dt,...)
for j=1,select('#',...) do
local t=select(j,...)
if t then
local j = #dt
for i=1,#t do dt[j+i]=t[i] end
end
end
return dt
end
--append non-nil arguments to a list.
function glue.append(dt,...)
local j = #dt
for i=1,select('#',...) do
dt[j+i] = select(i,...)
end
return dt
end
--insert n elements at i, shifting elemens on the right of i (i inclusive)
--to the right.
local function insert(t, i, n)
if n == 1 then --shift 1
table.insert(t, i, false)
return
end
for p = #t,i,-1 do --shift n
t[p+n] = t[p]
end
end
--remove n elements at i, shifting elements on the right of i (i inclusive)
--to the left.
local function remove(t, i, n)
n = min(n, #t-i+1)
if n == 1 then --shift 1
table.remove(t, i)
return
end
for p=i+n,#t do --shift n
t[p-n] = t[p]
end
for p=#t,#t-n+1,-1 do --clean tail
t[p] = nil
end
end
--shift all the elements on the right of i (i inclusive) to the left
--or further to the right.
function glue.shift(t, i, n)
if n > 0 then
insert(t, i, n)
elseif n < 0 then
remove(t, i, -n)
end
return t
end
--map f over t or extract a column from a list of records.
function glue.map(t, f, ...)
local dt = {}
if #t == 0 then --treat as hashmap
if type(f) == 'function' then
for k,v in pairs(t) do
dt[k] = f(k, v, ...)
end
else
for k,v in pairs(t) do
local sel = v[f]
if type(sel) == 'function' then --method to apply
dt[k] = sel(v, ...)
else --field to pluck
dt[k] = sel
end
end
end
else --treat as array
if type(f) == 'function' then
for i,v in ipairs(t) do
dt[i] = f(v, ...)
end
else
for i,v in ipairs(t) do
local sel = v[f]
if type(sel) == 'function' then --method to apply
dt[i] = sel(v, ...)
else --field to pluck
dt[i] = sel
end
end
end
end
return dt
end
--arrays ---------------------------------------------------------------------
--scan list for value. works with ffi arrays too given i and j.
function glue.indexof(v, t, eq, i, j)
i = i or 1
j = j or #t
if eq then
for i = i, j do
if eq(t[i], v) then
return i
end
end
else
for i = i, j do
if t[i] == v then
return i
end
end
end
end
--- Return the index of a table/array if value exists
---@param array table
---@param value any
function glue.arrayhas(array, value)
for k,v in pairs(array) do
if (v == value) then return k end
end
return nil
end
--- Get the new values of an array
---@param oldarray table
---@param newarray table
function glue.arraynv(oldarray, newarray)
local newvalues = {}
for k,v in pairs(newarray) do
if (not glue.arrayhas(oldarray, v)) then
glue.append(newvalues, v)
end
end
return newvalues
end
--reverse elements of a list in place. works with ffi arrays too given i and j.
function glue.reverse(t, i, j)
i = i or 1
j = (j or #t) + 1
for k = 1, (j-i)/2 do
t[i+k-1], t[j-k] = t[j-k], t[i+k-1]
end
return t
end
--- Get all the values of a key recursively
---@param t table
---@param dp any
function glue.childsbyparent(t, dp)
for p,ch in pairs(t) do
if (p == dp) then
return ch
end
if (ch) then
local found = glue.childsbyparent(ch, dp)
if (found) then
return found
end
end
end
return nil
end
-- Get the key of a value recursively
---@param t table
---@param dp any
function glue.parentbychild(t, dp)
for p,ch in pairs(t) do
if (ch[dp]) then
return p
end
if (ch) then
local found = glue.parentbychild(ch, dp)
if (found) then
return found
end
end
end
return nil
end
--- Split a list/array into small parts of given size
---@param list table
---@param chunks number
function glue.chunks(list, chunks)
local chunkcounter = 0
local chunk = {}
local chunklist = {}
-- Append chunks to the list in the specified amount of elements
for k,v in pairs(list) do
if (chunkcounter == chunks) then
glue.append(chunklist, chunk)
chunk = {}
chunkcounter = 0
end
glue.append(chunk, v)
chunkcounter = chunkcounter + 1
end
-- If there was a chunk that was not completed append it
if (chunkcounter ~= 0) then
glue.append(chunklist, chunk)
end
return chunklist
end
--binary search for an insert position that keeps the table sorted.
--works with ffi arrays too if lo and hi are provided.
local cmps = {}
cmps['<' ] = function(t, i, v) return t[i] < v end
cmps['>' ] = function(t, i, v) return t[i] > v end
cmps['<='] = function(t, i, v) return t[i] <= v end
cmps['>='] = function(t, i, v) return t[i] >= v end
local less = cmps['<']
function glue.binsearch(v, t, cmp, lo, hi)
lo, hi = lo or 1, hi or #t
cmp = cmp and cmps[cmp] or cmp or less
local len = hi - lo + 1
if len == 0 then return nil end
if len == 1 then return not cmp(t, lo, v) and lo or nil end
while lo < hi do
local mid = floor(lo + (hi - lo) / 2)
if cmp(t, mid, v) then
lo = mid + 1
if lo == hi and cmp(t, lo, v) then
return nil
end
else
hi = mid
end
end
return lo
end
--strings --------------------------------------------------------------------
--string submodule. has its own namespace which can be merged with _G.string.
glue.string = {}
--- Split a string list/array given a separator string
function glue.string.split(s, sep)
if (sep == nil or sep == '') then return 1 end
local position, array = 0, {}
for st, sp in function() return string.find(s, sep, position, true) end do
table.insert(array, string.sub(s, position, st-1))
position = sp + 1
end
table.insert(array, string.sub(s, position))
return array
end
--split a string by a separator that can be a pattern or a plain string.
--return a stateless iterator for the pieces.
local function iterate_once(s, s1)
return s1 == nil and s or nil
end
function glue.string.gsplit(s, sep, start, plain)
start = start or 1
plain = plain or false
if not s:find(sep, start, plain) then
return iterate_once, s:sub(start)
end
local done = false
local function pass(i, j, ...)
if i then
local seg = s:sub(start, i - 1)
start = j + 1
return seg, ...
else
done = true
return s:sub(start)
end
end
return function()
if done then return end
if sep == '' then done = true; return s:sub(start) end
return pass(s:find(sep, start, plain))
end
end
--split a string into lines, optionally including the line terminator.
function glue.lines(s, opt)
local term = opt == '*L'
local patt = term and '([^\r\n]*()\r?\n?())' or '([^\r\n]*)()\r?\n?()'
local next_match = s:gmatch(patt)
local empty = s == ''
local ended --string ended with no line ending
return function()
local s, i1, i2 = next_match()
if s == nil then return end
if s == '' and not empty and ended then s = nil end
ended = i1 == i2
return s
end
end
--string trim12 from lua wiki.
function glue.string.trim(s)
local from = s:match('^%s*()')
return from > #s and '' or s:match('.*%S', from)
end
--escape a string so that it can be matched literally inside a pattern.
local function format_ci_pat(c)
return ('[%s%s]'):format(c:lower(), c:upper())
end
function glue.string.esc(s, mode) --escape is a reserved word in Terra
s = s:gsub('%%','%%%%'):gsub('%z','%%z')
:gsub('([%^%$%(%)%.%[%]%*%+%-%?])', '%%%1')
if mode == '*i' then s = s:gsub('[%a]', format_ci_pat) end
return s
end
--string or number to hex.
function glue.string.tohex(s, upper)
if type(s) == 'number' then
return (upper and '%08.8X' or '%08.8x'):format(s)
end
if upper then
return (s:gsub('.', function(c)
return ('%02X'):format(c:byte())
end))
else
return (s:gsub('.', function(c)
return ('%02x'):format(c:byte())
end))
end
end
--hex to binary string.
function glue.string.fromhex(s)
if #s % 2 == 1 then
return glue.string.fromhex('0'..s)
end
return (s:gsub('..', function(cc)
return string.char(tonumber(cc, 16))
end))
end
function glue.string.starts(s, p) --5x faster than s:find'^...' in LuaJIT 2.1
return s:sub(1, #p) == p
end
function glue.string.ends(s, p)
return p == '' or s:sub(-#p) == p
end
function glue.string.subst(s, t) --subst('{foo} {bar}', {foo=1, bar=2}) -> '1 2'
return s:gsub('{([_%w]+)}', t)
end
--publish the string submodule in the glue namespace.
glue.update(glue, glue.string)
--iterators ------------------------------------------------------------------
--run an iterator and collect the n-th return value into a list.
local function select_at(i,...)
return ...,select(i,...)
end
local function collect_at(i,f,s,v)
local t = {}
repeat
v,t[#t+1] = select_at(i,f(s,v))
until v == nil
return t
end
local function collect_first(f,s,v)
local t = {}
repeat
v = f(s,v); t[#t+1] = v
until v == nil
return t
end
function glue.collect(n,...)
if type(n) == 'number' then
return collect_at(n,...)
else
return collect_first(n,...)
end
end
--closures -------------------------------------------------------------------
--no-op filters.
function glue.pass(...) return ... end
function glue.noop() return end
--memoize for 0, 1, 2-arg and vararg and 1 retval functions.
local function memoize0(fn) --for strict no-arg functions
local v, stored
return function()
if not stored then
v = fn(); stored = true
end
return v
end
end
local nilkey = {}
local nankey = {}
local function memoize1(fn) --for strict single-arg functions
local cache = {}
return function(arg)
local k = arg == nil and nilkey or arg ~= arg and nankey or arg
local v = cache[k]
if v == nil then
v = fn(arg); cache[k] = v == nil and nilkey or v
else
if v == nilkey then v = nil end
end
return v
end
end
local function memoize2(fn) --for strict two-arg functions
local cache = {}
return function(a1, a2)
local k1 = a1 ~= a1 and nankey or a1 == nil and nilkey or a1
local cache2 = cache[k1]
if cache2 == nil then
cache2 = {}
cache[k1] = cache2
end
local k2 = a2 ~= a2 and nankey or a2 == nil and nilkey or a2
local v = cache2[k2]
if v == nil then
v = fn(a1, a2)
cache2[k2] = v == nil and nilkey or v
else
if v == nilkey then v = nil end
end
return v
end
end
local function memoize_vararg(fn, minarg, maxarg)
local cache = {}
local values = {}
return function(...)
local key = cache
local narg = min(max(select('#',...), minarg), maxarg)
for i = 1, narg do
local a = select(i,...)
local k = a ~= a and nankey or a == nil and nilkey or a
local t = key[k]
if not t then
t = {}; key[k] = t
end
key = t
end
local v = values[key]
if v == nil then
v = fn(...); values[key] = v == nil and nilkey or v
end
if v == nilkey then v = nil end
return v
end
end
local memoize_narg = {[0] = memoize0, memoize1, memoize2}
local function choose_memoize_func(func, narg)
if narg then
local memoize_narg = memoize_narg[narg]
if memoize_narg then
return memoize_narg
else
return memoize_vararg, narg, narg
end
else
local info = debug.getinfo(func, 'u')
if info.isvararg then
return memoize_vararg, info.nparams, 1/0
else
return choose_memoize_func(func, info.nparams)
end
end
end
function glue.memoize(func, narg)
local memoize, minarg, maxarg = choose_memoize_func(func, narg)
return memoize(func, minarg, maxarg)
end
--memoize a function with multiple return values.
function glue.memoize_multiret(func, narg)
local memoize, minarg, maxarg = choose_memoize_func(func, narg)
local function wrapper(...)
return glue.pack(func(...))
end
local func = memoize(wrapper, minarg, maxarg)
return function(...)
return glue.unpack(func(...))
end
end
local tuple_mt = {__call = glue.unpack}
function tuple_mt:__tostring()
local t = {}
for i=1,self.n do
t[i] = tostring(self[i])
end
return string.format('(%s)', table.concat(t, ', '))
end
function glue.tuples(narg)
return glue.memoize(function(...)
return setmetatable(glue.pack(...), tuple_mt)
end)
end
--objects --------------------------------------------------------------------
--set up dynamic inheritance by creating or updating a table's metatable.
function glue.inherit(t, parent)
local meta = getmetatable(t)
if meta then
meta.__index = parent
elseif parent ~= nil then
setmetatable(t, {__index = parent})
end
return t
end
--prototype-based dynamic inheritance with __call constructor.
function glue.object(super, o, ...)
o = o or {}
o.__index = super
o.__call = super and super.__call
glue.update(o, ...) --add mixins, defaults, etc.
return setmetatable(o, o)
end
local function install(self, combine, method_name, hook)
rawset(self, method_name, combine(self[method_name], hook))
end
local function before(method, hook)
if method then
return function(self, ...)
hook(self, ...)
return method(self, ...)
end
else
return hook
end
end
function glue.before(self, method_name, hook)
install(self, before, method_name, hook)
end
local function after(method, hook)
if method then
return function(self, ...)
method(self, ...)
return hook(self, ...)
end
else
return hook
end
end
function glue.after(self, method_name, hook)
install(self, after, method_name, hook)
end
local function override(method, hook)
local method = method or glue.noop
return function(...)
return hook(method, ...)
end
end
function glue.override(self, method_name, hook)
install(self, override, method_name, hook)
end
--return a metatable that supports virtual properties.
--can be used with setmetatable() and ffi.metatype().
function glue.gettersandsetters(getters, setters, super)
local get = getters and function(t, k)
local get = getters[k]
if get then return get(t) end
return super and super[k]
end
local set = setters and function(t, k, v)
local set = setters[k]
if set then set(t, v); return end
rawset(t, k, v)
end
return {__index = get, __newindex = set}
end
--i/o ------------------------------------------------------------------------
--check if a file exists and can be opened for reading or writing.
function glue.canopen(name, mode)
local f = io.open(name, mode or 'rb')
if f then f:close() end
return f ~= nil and name or nil
end
--read a file into a string (in binary mode by default).
function glue.readfile(name, mode, open)
open = open or io.open
local f, err = open(name, mode=='t' and 'r' or 'rb')
if not f then return nil, err end
local s, err = f:read'*a'
if s == nil then return nil, err end
f:close()
return s
end
--read the output of a command into a string.
function glue.readpipe(cmd, mode, open)
return glue.readfile(cmd, mode, open or io.popen)
end
--like os.rename() but behaves like POSIX on Windows too.
if jit then
local ffi = require'ffi'
if ffi.os == 'Windows' then
ffi.cdef[[
int MoveFileExA(
const char *lpExistingFileName,
const char *lpNewFileName,
unsigned long dwFlags
);
int GetLastError(void);
]]
local MOVEFILE_REPLACE_EXISTING = 1
local MOVEFILE_WRITE_THROUGH = 8
local ERROR_FILE_EXISTS = 80
local ERROR_ALREADY_EXISTS = 183
function glue.replacefile(oldfile, newfile)
if ffi.C.MoveFileExA(oldfile, newfile, 0) ~= 0 then
return true
end
local err = ffi.C.GetLastError()
if err == ERROR_FILE_EXISTS or err == ERROR_ALREADY_EXISTS then
if ffi.C.MoveFileExA(oldfile, newfile,
bit.bor(MOVEFILE_WRITE_THROUGH, MOVEFILE_REPLACE_EXISTING)) ~= 0
then
return true
end
err = ffi.C.GetLastError()
end
return nil, 'WinAPI error '..err
end
else
function glue.replacefile(oldfile, newfile)
return os.rename(oldfile, newfile)
end
end
end
--write a string, number, table or the results of a read function to a file.
--uses binary mode by default.
function glue.writefile(filename, s, mode, tmpfile)
if tmpfile then
local ok, err = glue.writefile(tmpfile, s, mode)
if not ok then
return nil, err
end
local ok, err = glue.replacefile(tmpfile, filename)
if not ok then
os.remove(tmpfile)
return nil, err
else
return true
end
end
local f, err = io.open(filename, mode=='t' and 'w' or 'wb')
if not f then
return nil, err
end
local ok, err
if type(s) == 'table' then
for i = 1, #s do
ok, err = f:write(s[i])
if not ok then break end
end
elseif type(s) == 'function' then
local read = s
while true do
ok, err = xpcall(read, debug.traceback)
if not ok or err == nil then break end
ok, err = f:write(err)
if not ok then break end
end
else --string or number
ok, err = f:write(s)
end
f:close()
if not ok then
os.remove(filename)
return nil, err
else
return true
end
end
--virtualize the print function.
function glue.printer(out, format)
format = format or tostring
return function(...)
local n = select('#', ...)
for i=1,n do
out(format((select(i, ...))))
if i < n then
out'\t'
end
end
out'\n'
end
end
--dates & timestamps ---------------------------------------------------------
--compute timestamp diff. to UTC because os.time() has no option for UTC.
function glue.utc_diff(t)
local d1 = os.date( '*t', 3600 * 24 * 10)
local d2 = os.date('!*t', 3600 * 24 * 10)
d1.isdst = false
return os.difftime(os.time(d1), os.time(d2))
end
--overloading os.time to support UTC and get the date components as separate args.
function glue.time(utc, y, m, d, h, M, s, isdst)
if type(utc) ~= 'boolean' then --shift arg#1
utc, y, m, d, h, M, s, isdst = nil, utc, y, m, d, h, M, s
end
if type(y) == 'table' then
local t = y
if utc == nil then utc = t.utc end
y, m, d, h, M, s, isdst = t.year, t.month, t.day, t.hour, t.min, t.sec, t.isdst
end
local utc_diff = utc and glue.utc_diff() or 0
if not y then
return os.time() + utc_diff
else
s = s or 0
local t = os.time{year = y, month = m or 1, day = d or 1, hour = h or 0,
min = M or 0, sec = s, isdst = isdst}
return t and t + s - floor(s) + utc_diff
end
end
--get the time at the start of the week of a given time, plus/minus a number of weeks.
function glue.sunday(utc, t, offset)
if type(utc) ~= 'boolean' then --shift arg#1
utc, t, offset = false, utc, t
end
local d = os.date(utc and '!*t' or '*t', t)
return glue.time(false, d.year, d.month, d.day - (d.wday - 1) + (offset or 0) * 7)
end
--get the time at the start of the day of a given time, plus/minus a number of days.
function glue.day(utc, t, offset)
if type(utc) ~= 'boolean' then --shift arg#1
utc, t, offset = false, utc, t
end
local d = os.date(utc and '!*t' or '*t', t)
return glue.time(false, d.year, d.month, d.day + (offset or 0))
end
--get the time at the start of the month of a given time, plus/minus a number of months.
function glue.month(utc, t, offset)
if type(utc) ~= 'boolean' then --shift arg#1
utc, t, offset = false, utc, t
end
local d = os.date(utc and '!*t' or '*t', t)
return glue.time(false, d.year, d.month + (offset or 0))
end
--get the time at the start of the year of a given time, plus/minus a number of years.
function glue.year(utc, t, offset)
if type(utc) ~= 'boolean' then --shift arg#1
utc, t, offset = false, utc, t
end
local d = os.date(utc and '!*t' or '*t', t)
return glue.time(false, d.year + (offset or 0))
end
--error handling -------------------------------------------------------------
--allocation-free assert() with string formatting.
--NOTE: unlike standard assert(), this only returns the first argument
--to avoid returning the error message and it's args along with it so don't
--use it with functions returning multiple values when you want those values.
function glue.assert(v, err, ...)
if v then return v end
err = err or 'assertion failed!'
if select('#',...) > 0 then
err = string.format(err, ...)
end
error(err, 2)
end
--pcall with traceback. LuaJIT and Lua 5.2 only.
local function pcall_error(e)
return debug.traceback('\n'..tostring(e))
end
function glue.pcall(f, ...)
return xpcall(f, pcall_error, ...)
end
local function unprotect(ok, result, ...)
if not ok then return nil, result, ... end
if result == nil then result = true end --to distinguish from error.
return result, ...
end
--wrap a function that raises errors on failure into a function that follows
--the Lua convention of returning nil,err on failure.
function glue.protect(func)
return function(...)
return unprotect(pcall(func, ...))
end
end
--pcall with finally and except "clauses":
-- local ret,err = fpcall(function(finally, except)
-- local foo = getfoo()
-- finally(function() foo:free() end)
-- except(function(err) io.stderr:write(err, '\n') end)
-- emd)
--NOTE: a bit bloated at 2 tables and 4 closures. Can we reduce the overhead?
local function fpcall(f,...)
local fint, errt = {}, {}
local function finally(f) fint[#fint+1] = f end
local function onerror(f) errt[#errt+1] = f end
local function err(e)
for i=#errt,1,-1 do errt[i](e) end
for i=#fint,1,-1 do fint[i]() end
return tostring(e) .. '\n' .. debug.traceback()
end
local function pass(ok,...)
if ok then
for i=#fint,1,-1 do fint[i]() end
end
return ok,...
end
return pass(xpcall(f, err, finally, onerror, ...))
end
function glue.fpcall(...)
return unprotect(fpcall(...))
end
--fcall is like fpcall() but without the protection (i.e. raises errors).
local function assert_fpcall(ok, ...)
if not ok then error(..., 2) end
return ...
end
function glue.fcall(...)
return assert_fpcall(fpcall(...))
end
--modules --------------------------------------------------------------------
--create a module table that dynamically inherits another module.
--naming the module returns the same module table for the same name.
function glue.module(name, parent)
if type(name) ~= 'string' then
name, parent = parent, name
end
if type(parent) == 'string' then
parent = require(parent)
end
parent = parent or _M
local parent_P = parent and assert(parent._P, 'parent module has no _P') or _G
local M = package.loaded[name]
if M then
return M, M._P
end
local P = {__index = parent_P}
M = {__index = parent, _P = P}
P._M = M
M._M = M
P._P = P
setmetatable(P, P)
setmetatable(M, M)
if name then
package.loaded[name] = M
P[name] = M
end
setfenv(2, P)
return M, P
end
--setup a module to load sub-modules when accessing specific keys.
function glue.autoload(t, k, v)
local mt = getmetatable(t) or {}
if not mt.__autoload then
local old_index = mt.__index
local submodules = {}
mt.__autoload = submodules
mt.__index = function(t, k)
--overriding __index...
if type(old_index) == 'function' then
local v = old_index(t, k)
if v ~= nil then return v end
elseif type(old_index) == 'table' then
local v = old_index[k]
if v ~= nil then return v end
end
if submodules[k] then
local mod
if type(submodules[k]) == 'string' then
mod = require(submodules[k]) --module
else
mod = submodules[k](k) --custom loader
end
submodules[k] = nil --prevent loading twice
if type(mod) == 'table' then --submodule returned its module table
assert(mod[k] ~= nil) --submodule has our symbol
t[k] = mod[k]
end
return rawget(t, k)
end
end
setmetatable(t, mt)
end
if type(k) == 'table' then
glue.update(mt.__autoload, k) --multiple key -> module associations.
else
mt.__autoload[k] = v --single key -> module association.
end
return t
end
--portable way to get script's directory, based on arg[0].
--NOTE: the path is not absolute, but relative to the current directory!
--NOTE: for bundled executables, this returns the executable's directory.
local dir = rawget(_G, 'arg') and arg[0]
and arg[0]:gsub('[/\\]?[^/\\]+$', '') or '' --remove file name
glue.bin = dir == '' and '.' or dir
--portable way to add more paths to package.path, at any place in the list.
--negative indices count from the end of the list like string.sub().
--index 'after' means 0.
function glue.luapath(path, index, ext)
ext = ext or 'lua'
index = index or 1
local psep = package.config:sub(1,1) --'/'
local tsep = package.config:sub(3,3) --';'
local wild = package.config:sub(5,5) --'?'
local paths = glue.collect(glue.gsplit(package.path, tsep, nil, true))
path = path:gsub('[/\\]', psep) --normalize slashes
if index == 'after' then index = 0 end
if index < 1 then index = #paths + 1 + index end
table.insert(paths, index, path .. psep .. wild .. psep .. 'init.' .. ext)
table.insert(paths, index, path .. psep .. wild .. '.' .. ext)
package.path = table.concat(paths, tsep)
end
--portable way to add more paths to package.cpath, at any place in the list.
--negative indices count from the end of the list like string.sub().
--index 'after' means 0.
function glue.cpath(path, index)
index = index or 1
local psep = package.config:sub(1,1) --'/'
local tsep = package.config:sub(3,3) --';'
local wild = package.config:sub(5,5) --'?'
local ext = package.cpath:match('%.([%a]+)%'..tsep..'?') --dll | so | dylib
local paths = glue.collect(glue.gsplit(package.cpath, tsep, nil, true))
path = path:gsub('[/\\]', psep) --normalize slashes
if index == 'after' then index = 0 end
if index < 1 then index = #paths + 1 + index end
table.insert(paths, index, path .. psep .. wild .. '.' .. ext)
package.cpath = table.concat(paths, tsep)
end
--allocation -----------------------------------------------------------------
--freelist for Lua tables.
local function create_table()
return {}
end
function glue.freelist(create, destroy)
create = create or create_table
destroy = destroy or glue.noop
local t = {}
local n = 0
local function alloc()
local e = t[n]
if e then
t[n] = false
n = n - 1
end
return e or create()
end
local function free(e)
destroy(e)
n = n + 1
t[n] = e
end
return alloc, free
end
--ffi ------------------------------------------------------------------------
if jit then
local ffi = require'ffi'
--static, auto-growing buffer allocation pattern (ctype must be vla).
function glue.buffer(ctype)
local vla = ffi.typeof(ctype)
local buf, len = nil, -1
return function(minlen)
if minlen == false then
buf, len = nil, -1
elseif minlen > len then
len = glue.nextpow2(minlen)
buf = vla(len)
end
return buf, len
end
end
--like glue.buffer() but preserves data on reallocations
--also returns minlen instead of capacity.
function glue.dynarray(ctype)
local buffer = glue.buffer(ctype)
local elem_size = ffi.sizeof(ctype, 1)
local buf0, minlen0
return function(minlen)
local buf, len = buffer(minlen)
if buf ~= buf0 and buf ~= nil and buf0 ~= nil then
ffi.copy(buf, buf0, minlen0 * elem_size)
end
buf0, minlen0 = buf, minlen
return buf, minlen
end
end
local intptr_ct = ffi.typeof'intptr_t'
local intptrptr_ct = ffi.typeof'const intptr_t*'
local intptr1_ct = ffi.typeof'intptr_t[1]'
local voidptr_ct = ffi.typeof'void*'
--x86: convert a pointer's address to a Lua number.
local function addr32(p)
return tonumber(ffi.cast(intptr_ct, ffi.cast(voidptr_ct, p)))
end
--x86: convert a number to a pointer, optionally specifying a ctype.
local function ptr32(ctype, addr)
if not addr then
ctype, addr = voidptr_ct, ctype
end
return ffi.cast(ctype, addr)
end
--x64: convert a pointer's address to a Lua number or possibly string.
local function addr64(p)
local np = ffi.cast(intptr_ct, ffi.cast(voidptr_ct, p))
local n = tonumber(np)
if ffi.cast(intptr_ct, n) ~= np then
--address too big (ASLR? tagged pointers?): convert to string.
return ffi.string(intptr1_ct(np), 8)
end
return n
end
--x64: convert a number or string to a pointer, optionally specifying a ctype.
local function ptr64(ctype, addr)
if not addr then
ctype, addr = voidptr_ct, ctype
end
if type(addr) == 'string' then
return ffi.cast(ctype, ffi.cast(voidptr_ct,
ffi.cast(intptrptr_ct, addr)[0]))
else
return ffi.cast(ctype, addr)
end
end
glue.addr = ffi.abi'64bit' and addr64 or addr32
glue.ptr = ffi.abi'64bit' and ptr64 or ptr32
end --if jit
if bit then
local band, bor, bnot = bit.band, bit.bor, bit.bnot
--extract the bool value of a bitmask from a value.
function glue.getbit(from, mask)
return band(from, mask) == mask
end
--set a single bit of a value without affecting other bits.
function glue.setbit(over, mask, yes)
return bor(yes and mask or 0, band(over, bnot(mask)))
end
local function bor_bit(bits, k, mask, strict)
local b = bits[k]
if b then
return bit.bor(mask, b)
elseif strict then
error(string.format('invalid bit %s', k))
else
return mask
end
end
function glue.bor(flags, bits, strict)
local mask = 0
if type(flags) == 'number' then
return flags --passthrough
elseif type(flags) == 'string' then
for k in flags:gmatch'[^%s]+' do
mask = bor_bit(bits, k, mask, strict)
end
elseif type(flags) == 'table' then
for k,v in pairs(flags) do
k = type(k) == 'number' and v or k
mask = bor_bit(bits, k, mask, strict)
end
else
error'flags expected'
end
return mask
end
end
return glue
|
--[[
smapi.lua
Interface with thinkpad battery information
Licensed under GNU General Public License v2
* (c) 2013, Conor Heine
--]]
local first_line = require("lain.helpers").first_line
local string = { format = string.format }
local tonumber = tonumber
local setmetatable = setmetatable
local smapi = {}
local apipath = "/sys/devices/platform/smapi"
-- Most are readable values, but some can be written to (not implemented, yet?)
local readable = {
barcoding = true,
charging_max_current = true,
charging_max_voltage = true,
chemistry = true,
current_avg = true,
current_now = true,
cycle_count = true,
design_capacity = true,
design_voltage = true,
dump = true,
first_use_date = true,
force_discharge = false,
group0_voltage = true,
group1_voltage = true,
group2_voltage = true,
group3_voltage = true,
inhibit_charge_minutes = false,
installed = true,
last_full_capacity = true,
manufacture_date = true,
manufacturer = true,
model = true,
power_avg = true,
power_now = true,
remaining_capacity = true,
remaining_charging_time = true,
remaining_percent = true,
remaining_percent_error = true,
remaining_running_time = true,
remaining_running_time_now = true,
serial = true,
start_charge_thresh = false,
state = true,
stop_charge_thresh = false,
temperature = true,
voltage = true
}
function smapi:battery(name)
local bat = {}
bat.name = name
bat.path = apipath .. "/" .. name
function bat:get(item)
return self.path ~= nil and readable[item] and first_line(self.path .. "/" .. item) or nil
end
function bat:installed()
return self:get("installed") == "1"
end
function bat:status()
return self:get('state')
end
-- Remaining time can either be time until battery dies or time until charging completes
function bat:remaining_time()
local time_val = bat_now.status == 'discharging' and 'remaining_running_time' or 'remaining_charging_time'
local mins_left = self:get(time_val)
if not mins_left:find("^%d+") then return "N/A" end
local hrs = math.floor(mins_left / 60)
local min = mins_left % 60
return string.format("%02d:%02d", hrs, min)
end
function bat:percent()
return tonumber(self:get("remaining_percent"))
end
return setmetatable(bat, {__metatable = false, __newindex = false})
end
return smapi
|
ui_page 'html/ui.html'
dependency 'vrp'
files {
'html/ui.html',
'html/logo.png',
'html/dmv.png',
'html/cursor.png',
'html/styles.css',
'html/questions.js',
'html/scripts.js',
'html/debounce.min.js'
}
server_scripts {
'@vrp/lib/utils.lua',
'server.lua'
}
client_script {
'client.lua',
'GUI.lua'
} |
local LFS = require( "lfs" )
local utils = {}
function utils.fileExists( path )
local f = io.open( path, "r" )
if( not f ) then
return false
end
f:close()
return true
end;
function utils.requireCheck( rpath )
if( not rpath ) then
error( "requireCheck failed: nil path", 1 )
return false
end
rpath = rpath .. ".lua"
if( not LFS.attributes( rpath ) ) then
error( "requireCheck failed: path is not a file", 1 )
return false
end
return true
end
function table.getn( table )
local count = 0
for _, _ in pairs( table ) do count = count + 1; end
return count
end
function table.getKey( table, value )
for key, val in pairs( table ) do
if( value == val ) then
return key
end
end
return nil
end
function table.contains( table, value )
for key, val in pairs( table ) do
if( val == value ) then
return true
end
end
return false
end
function string.capitalize( string )
string = string:lower()
string = string:gsub( "(%l)(%w*)", function( a,b ) return a:upper() .. b; end )
return string
end;
local function serialize( data, indent_amount )
if( type( data ) == "string" ) then
return string.format( "%q", data )
elseif( type( data ) == "number" ) then
return tostring( data )
else
if( not data.serialize or data.serialize == "table" ) then
local tab_str, str = { "{" }, nil
indent_amount = indent_amount + 3
for k, v in pairs( data ) do
str = string.format( "%s[%s] = %s,", string.rep( " ", indent_amount ), serialize( k, indent_amount ), serialize( v, indent_amount ) )
tab_str[#tab_str+1] = str
end
tab_str[#tab_str+1] = string.format( "%s}", string.rep( " ", indent_amount - 3 ) )
return table.concat( tab_str, "\n" )
else
return data:serialize()
end
end
end
function utils.save( data, file )
local phs = data.serialize -- place holder serialize function
file:write( "return " )
data.serialize = "table"
file:write( serialize( data, 0 ) )
data.serialize = phs
end
return utils
|
-- below functions are taken from MMExtension repo, as they're not released yet and I don't feel like writing my own saving function, because I might screw something up
-- Saves a string into a file (overwrites it)
local string_sub = string.sub
function io.save(path, s, translate)
local f = assert(io.open(path, translate and "wt" or "wb"))
f:setvbuf("no")
f:write(s)
f:close()
end
local path_noslash = _G.path.noslash
local path_dir = _G.path.dir
local CreateDirectoryPtr = internal.CreateDirectory
local function DoCreateDir(dir)
-- 183 = already exists
return mem.call(CreateDirectoryPtr, 0, dir, 0) ~= 0
end
local function CreateDirectory(dir)
dir = path_noslash(dir)
if dir == "" or #dir == 2 and string_sub(dir, -1) == ":" or DoCreateDir(dir) then
return true
end
local dir1 = path_dir(dir)
if dir1 ~= dir then
CreateDirectory(dir1)
end
return true
end
_G.os.mkdir = CreateDirectory
--!- backwards compatibility
_G.os.CreateDirectory = CreateDirectory
--!- backwards compatibility
_G.path.CreateDirectory = CreateDirectory
local oldSave = _G.io.save
--!-
function _G.io.save(path, ...)
CreateDirectory(path_dir(path))
return oldSave(path, ...)
end
local function WriteBasicTextTable(t, fname)
if fname then
return io.save(fname, WriteBasicTextTable(t))
end
local q, s = {}, ''
for i = 1, #t do
s = (type(t[i]) == "table" and table.concat(t[i], "\t") or t[i])
q[i] = s
end
if s ~= '' then
q[#q + 1] = ''
end
return table.concat(q, "\r\n")
end
_G.WriteBasicTextTable = WriteBasicTextTable
-- end of functions taken from MMExtension repo
local mapFileNamesToNames = {}
local fileNames = {}
for _, msi in Game.MapStats do
mapFileNamesToNames[msi.Name:lower()] = msi.FileName:lower()
table.insert(fileNames, msi.FileName:lower())
end
function mtm(str)
-- show error instead of crashing game
assert(mapFileNamesToNames[str:lower()] or table.find(fileNames, str:lower()), "Invalid map name")
return evt.MoveToMap{Name = mapFileNamesToNames[str:lower()] or str}
end
local firstGlobalLuaFreeEntry = 2000 -- that we will use
eventNumberReplacements = function(str)
local noMappingEvents = {{501, 506}, {513, 515}} -- for some reason these events from MM7 are put in the middle of MM8 events and require no numeric change
local lastOriginalMM7Event = 572
return function(num)
num = tonumber(num)
local add
if (num >= noMappingEvents[1][1] and num <= noMappingEvents[1][2]) or (num >= noMappingEvents[2][1] and num <= noMappingEvents[2][2]) then
add = 0
else
if num > lastOriginalMM7Event then -- new rev4 event, moved to end
add = firstGlobalLuaFreeEntry - (lastOriginalMM7Event + 1)
elseif num > noMappingEvents[2][2] then
add = 750 - (515 - 513 + 2) - (506 - 501 + 1) + 1
elseif num > noMappingEvents[1][2] then
add = 750 - (506 - 501 + 1)
else
add = 750
end
end
-- make it disable standard events, so generated lua file can be used without copy pasting into decompiled global.lua
if str:find("global") ~= nil and num <= lastOriginalMM7Event then
return ("Game.GlobalEvtLines:RemoveEvent(%d)\n"):format(num + add) .. str:format(num + add)
end
return str:format(num + add)
end
end
function getQuestBit(questBit)
return questBit + 512
end
function getNPC(npc)
-- entries from 447 onwards are added at the end due to lack of space
local npcAdd = 339
if npc >= 447 then
npcAdd = 1240 - 447
end
return npc + npcAdd
end
function getMessage(message)
local noMappingTexts = {{200, 201}, {205, 205}, {270, 299}, {549, 549}}
local isNoMapping = false
for _, t in ipairs(noMappingTexts) do
if message >= t[1] and message <= t[2] then
isNoMapping = true
break
end
end
if isNoMapping then
return message
end
if message >= 768 then -- new rev4 message
return message + (2800 - 768)
end
local add = 938
local i = 1
while i <= #noMappingTexts and message > noMappingTexts[i][2] do
add = add - (noMappingTexts[i][2] - noMappingTexts[i][1] + 1)
i = i + 1
end
return message + add
end
function getEvent(event)
if event == 0 then return 0 end
local eventAdd = 750
if event >= 573 then
eventAdd = firstGlobalLuaFreeEntry - 573
-- skill teaching events
-- blaster
elseif event >= 221 and event <= 223 then
eventAdd = 971 - 221
elseif event >= 200 and event <= 262 then
eventAdd = 300 - 200
elseif event >= 263 and event <= 280 then
eventAdd = 372 - 263
elseif event >= 287 and event <= 310 then
eventAdd = 393 - 287
end
local noMappingEvents = {{501, 506}, {513, 515}}
local i = 1
while i <= #noMappingEvents and event > noMappingEvents[i][2] do
eventAdd = eventAdd - (noMappingEvents[i][2] - noMappingEvents[i][1] + 1)
i = i + 1
end
return event + eventAdd
end
function getAward(award)
local translationTableFromRev4ToMerge = -- generated with generateAwardsTranslationTable
-- awards.txt in merge is a shitshow (interspersed MM7/MM8 awards), that's why I'm using a translation table
{
[4] = 3, [101] = 55, [5] = 4, [80] = 24, [32] = 127, [110] = 135, [81] = 25, [7] = 119, [33] = 128, [100] = 53, [14] = 122, [82] = 26, [92] = 30, [111] = 105, [83] = 27, [9] = 121, [15] = 123, [93] = 32, [94] = 34, [46] = 6, [84] = 28, [26] = 126, [47] = 19, [95] = 38, [96] = 39, [107] = 132, [97] = 40, [98] = 51, [87] = 129, [99] = 52, [48] = 21, [106] = 131, [49] = 22, [109] = 134, [113] = 105, [115] = 105, [114] = 105, [112] = 105, [102] = 41, [108] = 133, [105] = 130, [21] = 125, [3] = 2, [6] = 118, [2] = 1, [61] = 23, [8] = 120, [20] = 124
}
if translationTableFromRev4ToMerge[award] ~= nil then
return translationTableFromRev4ToMerge[award]
else
--print("Couldn't find award in merge for number " .. award)
return -1 -- delete this entry, as promoted awards apparently are not in Merge
end
end
function getGreeting(greeting)
if greeting == 0 then return 0 end
local greetingAdd = 115
if greeting >= 195 then
greetingAdd = 356 - 195
end
return greeting + greetingAdd
end
function getItem(item)
if item >= 220 and item <= 271 then -- potions
return item
end
return item + 802
end
function getNpcGroup(npcgroup)
return npcgroup + 51
end
local drev4 = LoadBasicTextTable("tab\\2DEvents rev4.txt", 0)
local dmerge = LoadBasicTextTable("tab\\2DEvents merge.txt", 0)
local rev4names = {}
local mergeids = {}
for i = 3, #drev4 do
rev4names[tonumber(drev4[i][1]) or -1] = drev4[i][6] -- or -1 is because there is empty line at the end...
end
for i = 3, #dmerge do
if dmerge[i][6] ~= nil then
mergeids[dmerge[i][6]] = mergeids[dmerge[i][6]] or {}
table.insert(mergeids[dmerge[i][6]], tonumber(dmerge[i][1]))
end
end
function getHouseID(houseid)
if houseid == 0 then return 0 end
if houseid == nil or houseid == "" then return "" end
local overrideMappings =
{
[428] = 1065, [427] = 1064, [426] = 1063, [425] = 1062, [423] = 1060, [432] = 1069, [431] = 1068, [434] = 1071, [433] = 1070, [444] = 1081 , [442] = 1079, [441] = 1078, [439] = 1076, [438] = 1075, [174] = 1169, [176] = 217, [178] = 218, [421] = 216, [184] = 221, [180] = 219, [182] = 220, -- 423 = morningstar residence
[189] = 1165, [79] = 315, [80] = 316, [78] = 314, [81] = 317, [413] = 1051, [367] = 1005, [485] = 1121, [495] = 1131, [504] = 1140, [477] = 1113, [480] = 1116, [333] = 971,
[405] = 1043, [368] = 1006, [469] = 1105, [435] = 1072, [408] = 1046, [453] = 1089, [443] = 1080, [440] = 1077, [74] = 310, [190] = 1166, [188] = 1164, [226] = 1172, [324] = 962,
[345] = 983, [21] = 54, [37] = 92, [133] = 291, [280] = 380, [281] = 381, [191] = 387, [173] = 382, [193] = 390, [217] = 414
}
if overrideMappings[houseid] ~= nil then
return overrideMappings[houseid]
end
local rev4name = rev4names[houseid]
if rev4name == nil then
print("Couldn't find rev4name for 2d location " .. houseid)
return -1
end
local mergeid = mergeids[rev4name]
if rev4name:lower():find("guild") ~= nil and type(mergeid) == "table" and #mergeid > 1 then
-- magic guilds, look by proprieter name in addition to name
for _, id in ipairs(mergeid) do
local proprieterName = dmerge[id + 2][7]
if proprieterName == drev4[houseid + 2][7] then
return id
end
end
end
if mergeid == nil then
print(("Couldn't find merge ids table for 2d location %d (name: %s)"):format(houseid, rev4name))
return -1
elseif #mergeid > 1 then
print(("Found multiple merge locations for 2d location %d (name: %s)"):format(houseid, rev4name))
print("The locations:")
for k, v in ipairs(mergeid) do
print(v)
end
if rev4name == "" then return mergeid[1] end -- shouldn't cause any problems, as empty houses are not used
return -1
end
return mergeid[1]
end
function getAutonote(autonote)
local autonoteAdd = 256
if autonote <= 52 then
elseif autonote >= 114 then
autonoteAdd = 309 - 114
else
print("This shouldn't ever happen")
end
return autonote + autonoteAdd
end
function getFileName(name)
local name2 = name
local name = name:lower()
if name:sub(1, 1) == "d" then -- dungeon
local m = tonumber(name:match("%d+"), 10)
if m >= 5 then
name2 = "7" .. name2
end
elseif name:sub(1, 3) == "nwc" then
name2 = "7" .. name
elseif name:sub(1, 3) == "out" then
local m = tonumber(name:match("%d+"), 10)
if m <= 6 or m == 13 or m == 15 then
name2 = "7" .. name2
end
end
return name2
end
function getMonster(monster)
return monster + 198
end
--[[
local t = {}
for i = 1, 67 do
local row = {}
table.insert(row, 2755 + i)
for j = 1, 3 do
table.insert(row, "")
end
table.insert(t, row)
end
WriteBasicTextTable(t, "temp.txt")
--]]
local rev4 = LoadBasicTextTable("tab\\Placemon rev4.txt", 0)
local merge = LoadBasicTextTable("tab\\Placemon merge.txt", 0)
local placemonMappings = {}
local mapIdsToNamesMerge = {}
for i = 2, #merge do
local row = merge[i]
if row[2] == nil then print (row[1]) end
mapIdsToNamesMerge[row[2] ] = tonumber(row[1])
end
for i = 2, #rev4 do
local row = rev4[i]
local name = row[2]
if mapIdsToNamesMerge[name] == nil then
print(("Couldn't find placemon entry in Merge for %s (id: %d)"):format(name, i))
goto continue
end
placemonMappings[tonumber(row[1])] = mapIdsToNamesMerge[name]
::continue::
end
--[[for i = 2, #rev4 do
local row = rev4[i]
local name = row[2]
print(name, merge[placemonMappings[tonumber(row[1])] + 1][2])
end]]--
function getPlacemonId(id)
return assert(placemonMappings[id], "Invalid placemon id: " .. id)
end
function getDDMapBuff(buff)
local add = 921 - 801 -- 120
return buff + add
end
function kill()
for k, v in Map.Monsters do
if v.Hostile then
v.HP = 0
end
end
end
_G.g = getItem
GameState_Quests = {}
GameState_NPCs = {}
--[[tempq = {}
for k, v in Party.QBits do
if type(v) ~= "function" and type(v) ~= "userdata" then
tempq[k] = v
end
end
local file = assert(io.open("GameDataQuests.bin", "wb"))
local str = internal.persist(tempq)
file:write(str)
file:close()
tempn = {}
local function dumpbasic(t)
local temp = {}
local meta = getmetatable(t)
if meta and meta.__call and type(meta.__call) == "function" then
for k, v in t do
if type(v) == "table" then
temp[k] = dumpbasic(v)
elseif type(v) ~= "function" and type(v) ~= "userdata" then
temp[k] = v
end
end
else
for k, v in pairs(t) do
if type(v) == "table" then
temp[k] = dumpbasic(v)
elseif type(v) ~= "function" and type(v) ~= "userdata" then
temp[k] = v
end
end
end
if meta.members ~= nil then
for k in pairs(meta.members) do
local v = t[k]
if type(v) == "table" then
temp[k] = dumpbasic(v)
elseif type(v) ~= "function" and type(v) ~= "userdata" then
temp[k] = v
end
end
end
return temp
end
tempn = dumpbasic(Game.NPC)
--print(dump(tempn, 3, true))
local file = assert(io.open("GameDataNPCs.bin", "wb"))
file:write((internal.persist(tempn)))
file:close()
--]]
function loadGameState()
local fileq = assert(io.open("GameDataQuests.bin", "rb"))
GameState_Quests = internal.unpersist(fileq:read("*a"))
local filen = assert(io.open("GameDataNPCs.bin", "rb"))
GameState_NPCs = internal.unpersist(filen:read("*a"))
--dump(GameState_Quests, 1, true)
--dump(GameState_NPCs, 3, true)
if #GameState_Quests == 0 or #GameState_NPCs == 0 then
print("Can't restore game state, need to fill out the tables first")
return
end
for i, v in ipairs(GameState_Quests) do
Party.QBits[getQuestBit(i)] = v
end
for i, v in ipairs(GameState_NPCs) do
if i >= 462 then break end
Game.NPC[getNPC(i)].Greet = getGreeting(v.Greet)
local indexes = {[0] = "A", "B", "C", "D", "E", "F"}
for j = 0, 5 do
Game.NPC[getNPC(i)]["Event" .. indexes[j] ] = getEvent(v["Event" .. indexes[j] ])
end
end
end
local mapIdsToItemNames = {}
for i, entry in Game.ItemsTxt do
mapIdsToItemNames[entry.Name:lower()] = i
end
function item(id)
evt.GiveItem{Id = mapIdsToItemNames[id] or id}
end
function increaseSpawnsInMapstats(infile, outfile, s, e, howMuch)
local t = LoadBasicTextTable(infile, 0)
for i = s, e do
local index = i + 3
local row = t[index]
for j = 20, 28, 4 do
local min, max = row[j]:match("(%d+)%-(%d+)")
min = tonumber(min) or 0
max = tonumber(max) or 0
if max - min <= 0 then goto continue end
min = min + howMuch
max = max + howMuch
row[j] = " " .. min .. "-" .. max
::continue::
end
end
WriteBasicTextTable(t, outfile)
end
-- disable town portal on antagarich when not completed archmage quest or in The Gauntlet
function events.CanCastTownPortal(t)
if t.CanCast and Merge.Functions.GetContinent() == 2 then -- Antagarich
t.Handled = true
t.CanCast = evt.All.Cmp("QBits", 718) -- Harmondale - Town Portal
end
end
-- The Gauntlet
-- restore town portal QBits upon map leave
-- need workaround with last map name because QBits aren't set in events.LeaveMap
local lastMapName = nil
function events.LeaveMap()
lastMapName = Game.Map.Name
end
function events.AfterLoadMap()
if lastMapName == "7d08.blv" then
for i = 0, 2 do
Party.QBits[i + 718] = vars.TheGauntletQBits and vars.TheGauntletQBits[i + 718] or false
end
--[[
Party.QBits[718] = true -- Harmondale - Town Portal
Party.QBits[719] = true -- Erathia - Town Portal
Party.QBits[720] = true -- Tularean Forest - Town Portal
--]]
end
end
-- increase stat breakpoint rewards
local vals = {
500, 37,
400, 32,
350, 27,
300, 26,
275, 25,
250, 24,
225, 23,
200, 22,
180, 21,
161, 20,
145, 19,
130, 18,
116, 17,
103, 16,
91, 15,
80, 14,
70, 13,
61, 12,
53, 11,
46, 10,
40, 9,
35, 8,
31, 7,
27, 6,
24, 5,
21, 4,
19, 3,
17, 2,
15, 1,
13, 0,
11, -1,
9, -2,
7, -3,
5, -4,
3, -5,
0, -6
}
function events.GetStatisticEffect(t)
local handled = false
for i = 1, #vals - 2, 2 do
if t.Value >= vals[i] then
t.Result = vals[i + 1]
handled = true
break
end
end
if not handled then
t.Result = vals[#vals]
end
end |
require('weblit-websocket')
require('weblit-app')
.bind {host = "0.0.0.0", port = 8080 }
-- Set an outer middleware for logging requests and responses
.use(require('weblit-logger'))
-- This adds missing headers, and tries to do automatic cleanup.
.use(require('weblit-auto-headers'))
.websocket({
path = "/",
protocol = "test"
}, function (req, read, write)
print("New client")
for message in read do
message.mask = nil
write(message)
end
write()
print("Client left")
end)--
-- Bind the ports, start the server and begin listening for and accepting connections.
.start()
|
local BaseWindow = require('code_action_menu.windows.base_window')
local AnchorWindow = BaseWindow:new()
-- The anchor window is just a reference to an already existing window that is
-- used as an anchor for a window stack. Thereby it can't be opened, nor closed.
-- In fact it is just used to read data and still implement the window class.
-- It will reference the window currently active when getting created.
function AnchorWindow:new()
-- These calls only work for the current window, therefore calculate them now
-- and save for later.
local window_number = vim.api.nvim_call_function('win_getid', {})
local window_position = vim.api.nvim_win_get_position(window_number)
local cursor_row = vim.api.nvim_call_function('winline', {})
local cursor_column = vim.api.nvim_call_function('wincol', {})
local instance = BaseWindow:new({ is_anchor = true })
setmetatable(instance, self)
self.__index = self
self.is_anchor = true
self.window_number = window_number
self.window_options = {
row = { [false] = window_position[1] + cursor_row },
col = { [false] = window_position[2] + cursor_column },
height = 0,
width = 0,
zindex = nil,
}
return instance
end
-- Prevent it to get opened by code. It is not necesary to "block" the other
-- functions like `create_buffer` as well as they are just called from here
-- usually.
function AnchorWindow:open()
return
end
-- Prevent it to get opened by code.
function AnchorWindow:close()
return
end
return AnchorWindow
|
--Item
require("prototypes.timecraftchanges")
--Item group
require("prototypes.item-groups-automatization")
require("prototypes.item-groups-energy")
require("prototypes.item-groups-logistic")
require("prototypes.item-groups-mining")
require("prototypes.item-groups-module")
require("prototypes.item-groups-nuclear")
require("prototypes.item-groups-transport")
require("prototypes.item-groups-trains")
require("prototypes.item-groups-trade")
require("prototypes.item-groups-decorative")
require("prototypes.item-groups-vehicles")
require("prototypes.item-groups-armor")
require("prototypes.item-groups-equipment")
require("prototypes.item-groups-plates")
require("prototypes.item-groups-intermediate")
require("prototypes.item-groups-defense")
require("prototypes.item-groups-liquids")
--Tech
require("prototypes.tech")
|
Site = {}
Site.__index = Site
--[[ Functions ]]--
function Site:Create(id)
local site = setmetatable({ id = id }, Site)
site.groups = {}
site.hashes = {}
return site
end
function Site:Activate()
-- Settings.
local settings = self:GetSettings()
if settings == nil then return end
-- Groups.
self:RegisterGroups(settings.Groups)
-- Activate group.
self:SetGroup(1)
end
function Site:Deactivate()
self:ClearDoors()
end
function Site:Update()
-- Get settings.
local settings = self:GetSettings()
if settings == nil then return end
-- Discover cameras.
if self.lastDiscovery == nil or (GetGameTimer() - self.lastDiscovery) > 200 then
self.lastDiscovery = GetGameTimer()
self:Discover()
end
-- Group input.
if IsDisabledControlJustPressed(0, 32) then
self:NextGroup(-1)
elseif IsDisabledControlJustPressed(0, 33) then
self:NextGroup(1)
end
-- Update groups.
if self.group ~= nil then
self.group:Update()
if IsDisabledControlJustPressed(0, 34) then
self.group:NextCamera(-1)
elseif IsDisabledControlJustPressed(0, 35) then
self.group:NextCamera(1)
end
end
-- Update doors.
if settings.UseDoors then
self:UpdateDoors()
end
end
function Site:RegisterGroups(groups)
if groups == nil then return end
self.groups = {}
local payload = {}
for groupId, settings in ipairs(groups) do
local group = Group:Create(self, groupId, settings)
self.groups[groupId] = group
payload[groupId] = {
settings = settings
}
end
Menu:Commit("setSite", payload)
end
function Site:Discover()
for entity in EnumerateObjects() do
-- Check for camera.
if not Main:IsObjectACamera(entity) then goto skip end
-- Get group.
local groupId, group = self:GetGroupEntityIsIn(entity)
if not groupId then goto skip end
-- Get coords.
local coords = GetEntityCoords(entity)
local hash = GetCoordsHash(coords)
-- Check coords hash.
if self.hashes[hash] ~= nil then goto skip end
-- Cache coords hash.
self.hashes[hash] = entity
-- Register object.
group:RegisterCamera(entity)
-- Skip region.
::skip::
end
end
function Site:SetGroup(index)
if self.group ~= nil then
self.group:Deactivate()
end
local group = self.groups[index]
if group == nil then return end
self.index = index
self.group = group
Citizen.CreateThread(function()
group:Activate()
end)
end
function Site:NextGroup(dir)
-- Get settings.
local settings = self:GetSettings()
if settings == nil then return end
-- Get index.
local index = self.index
-- Offset index.
if dir > 0 then
index = index + 1
if index > #settings.Groups then
index = 1
end
else
index = index - 1
if index < 1 then
index = #settings.Groups
end
end
-- Set index.
self:SetGroup(index)
end
function Site:GetGroupEntityIsIn(entity)
local coords = GetEntityCoords(entity)
for groupId, group in ipairs(self.groups) do
if
#(coords - group.Center) < group.Radius and
(
group.Room == nil or
(type(group.Room) == "table" and IsInTable(group.Room, GetRoomKeyFromEntity(entity), true)) or
(type(group.Room) ~= "table" and GetRoomKeyFromEntity(entity) == GetHashKey(group.Room))
)
then
return groupId, group
end
end
end
function Site:GetSettings()
return Config.Sites[self.id]
end |
-- print a OSD message with a key binding ...just a tad convoluted
-- NOTE: this key-binding / function will only work when the GUI window is activated, and NOT through a CLI
-- ... `⌘+s` will snap a screenshot of the mpv output window.
-- TODO: migrate / figure out todo with Javascript
local mp = require 'mp'
local utils = require 'mp.utils'
local options = require 'mp.options'
local M = {}
function M.lshow_text()
-- text to display On Screen over video output
local msg = "silly onscreen message"
-- duration of message equals 5 seconds
ms = 5000
mp.commandv("show-text", msg, ms)
end
function M.bind_meta_s()
mp.add_key_binding('meta+s', '', M.lshow_text)
end
function M.ubind_meta_s()
mp.remove_key_binding('meta+s')
end
function M.main()
M.bind_meta_s()
end
mp.register_event("file-loaded", M.main)
|
local layout_data = {
{
{0.0, 0.0, 1, 1},
},
{
{0.0, 0.2, 1, 0.8},
{0.0, 0.0, 1, 0.2},
},
{
{0.0, 0.2, 1, 0.6},
{0.0, 0.0, 1, 0.2},
{0.0, 0.8, 1, 0.2},
},
{
{0.2, 0.2, 0.8, 0.6},
{0.2, 0.0, 0.8, 0.2},
{0.0, 0.8, 1, 0.2},
{0.0, 0.0, 0.2, 0.8},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.0, 0.8, 0.2},
{0.0, 0.8, 0.8, 0.2},
{0.0, 0.0, 0.2, 0.8},
{0.8, 0.2, 0.2, 0.8},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.8, 0.1},
{0.0, 0.8, 0.8, 0.2},
{0.0, 0.1, 0.2, 0.7},
{0.8, 0.2, 0.2, 0.8},
{0.0, 0.0, 1, 0.1},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.8, 0.1},
{0.0, 0.8, 0.8, 0.1},
{0.0, 0.1, 0.2, 0.7},
{0.8, 0.2, 0.2, 0.7},
{0.0, 0.0, 1, 0.1},
{0.0, 0.9, 1, 0.1},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.8, 0.1},
{0.1, 0.8, 0.7, 0.1},
{0.1, 0.1, 0.1, 0.7},
{0.8, 0.2, 0.2, 0.7},
{0.1, 0.0, 0.9, 0.1},
{0.0, 0.9, 1, 0.1},
{0.0, 0.0, 0.1, 0.9},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.7, 0.1},
{0.1, 0.8, 0.7, 0.1},
{0.1, 0.1, 0.1, 0.7},
{0.8, 0.2, 0.1, 0.7},
{0.1, 0.0, 0.9, 0.1},
{0.0, 0.9, 0.9, 0.1},
{0.0, 0.0, 0.1, 0.9},
{0.9, 0.1, 0.1, 0.9},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.7, 0.1},
{0.1, 0.8, 0.7, 0.1},
{0.1, 0.1, 0.1, 0.7},
{0.8, 0.2, 0.1, 0.7},
{0.1, 0.0, 0.45, 0.1},
{0.0, 0.9, 0.9, 0.1},
{0.0, 0.0, 0.1, 0.9},
{0.9, 0.1, 0.1, 0.9},
{0.55, 0.0, 0.45, 0.1},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.7, 0.1},
{0.1, 0.8, 0.7, 0.1},
{0.1, 0.1, 0.1, 0.7},
{0.8, 0.2, 0.1, 0.7},
{0.1, 0.0, 0.45, 0.1},
{0.0, 0.9, 0.45, 0.1},
{0.0, 0.0, 0.1, 0.9},
{0.9, 0.1, 0.1, 0.9},
{0.55, 0.0, 0.45, 0.1},
{0.45, 0.9, 0.45, 0.1},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.7, 0.1},
{0.1, 0.8, 0.7, 0.1},
{0.1, 0.1, 0.1, 0.7},
{0.8, 0.2, 0.1, 0.7},
{0.1, 0.0, 0.45, 0.1},
{0.0, 0.9, 0.45, 0.1},
{0.0, 0.0, 0.1, 0.45},
{0.9, 0.1, 0.1, 0.9},
{0.55, 0.0, 0.45, 0.1},
{0.45, 0.9, 0.45, 0.1},
{0.0, 0.45, 0.1, 0.45},
},
{
{0.2, 0.2, 0.6, 0.6},
{0.2, 0.1, 0.7, 0.1},
{0.1, 0.8, 0.7, 0.1},
{0.1, 0.1, 0.1, 0.7},
{0.8, 0.2, 0.1, 0.7},
{0.1, 0.0, 0.45, 0.1},
{0.0, 0.9, 0.45, 0.1},
{0.0, 0.0, 0.1, 0.45},
{0.9, 0.1, 0.1, 0.45},
{0.55, 0.0, 0.45, 0.1},
{0.45, 0.9, 0.45, 0.1},
{0.0, 0.45, 0.1, 0.45},
{0.9, 0.55, 0.1, 0.45},
},
}
layout.set(layout_data)
l.config.set_resize_data({{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}})
l.config.set_resize_direction(info.direction.all)
l.config.set_resize_function(Resize_all)
|
local combat = createCombatObject()
arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_HITBYFIRE)
doAreaCombatHealth(param.cid, COMBAT_FIREDAMAGE, param.pos, 0, -100, -100, CONST_ME_EXPLOSIONHIT)
end
if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 4000), param)
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end |
local E, C, L = select(2, ...):unpack()
if not C.quest.enable and not C.quest.auto_collapse then return end
----------------------------------------------------------------------------------------
-- Auto collapse ObjectiveTrackerFrame in instance
----------------------------------------------------------------------------------------
local CreateFrame = CreateFrame
local IsInInstance, InCombatLockdown = IsInInstance, InCombatLockdown
local ObjectiveTracker_Collapse, ObjectiveTracker_Expand = ObjectiveTracker_Collapse, ObjectiveTracker_Expand
local ObjectiveTrackerFrame = ObjectiveTrackerFrame
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent", function()
if IsInInstance() then
ObjectiveTracker_Collapse()
elseif ObjectiveTrackerFrame.collapsed and not InCombatLockdown() then
ObjectiveTracker_Expand()
end
end)
|
--- allows for easy creation of "controller" style entities that only draw a single sprite
local jautils = require("mods").requireFromPlugin("libraries.jautils")
local drawableSpriteStruct = require("structs.drawable_sprite")
local controllerEntity = {}
function controllerEntity.createHandler(name, placements, placementsUseJaUtils, spritePath)
local handler = {
name = name,
depth = 8990,
texture = spritePath,
}
if placementsUseJaUtils then
jautils.createPlacementsPreserveOrder(handler, "normal", placements)
else
handler.placements = placements
end
return handler
end
return controllerEntity |
local utils = require('rust-tools.utils.utils')
local vim = vim
local M = {}
local function get_params()
return {
textDocument = vim.lsp.util.make_text_document_params(),
}
end
local function handler(_, result)
vim.lsp.util.jump_to_location(result)
end
-- Sends the request to rust-analyzer to get cargo.tomls location and open it
function M.open_cargo_toml()
utils.request(0, "experimental/openCargoToml", get_params(), handler)
end
return M
|
local nmap = require "nmap"
local os = require "os"
local shortport = require "shortport"
local sslcert = require "sslcert"
local stdnse = require "stdnse"
local string = require "string"
description = [[
Retrieves a server's SSL certificate. The amount of information printed
about the certificate depends on the verbosity level. With no extra
verbosity, the script prints the validity period and the commonName,
organizationName, stateOrProvinceName, and countryName of the subject.
<code>
443/tcp open https
| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
/stateOrProvinceName=California/countryName=US
| Not valid before: 2011-03-23 00:00:00
|_Not valid after: 2013-04-01 23:59:59
</code>
With <code>-v</code> it adds the issuer name and fingerprints.
<code>
443/tcp open https
| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
/stateOrProvinceName=California/countryName=US
| Issuer: commonName=VeriSign Class 3 Extended Validation SSL CA\
/organizationName=VeriSign, Inc./countryName=US
| Public Key type: rsa
| Public Key bits: 2048
| Not valid before: 2011-03-23 00:00:00
| Not valid after: 2013-04-01 23:59:59
| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
|_SHA-1: d846 5221 467a 0d15 3df0 9f2e af6d 4390 0213 9a68
</code>
With <code>-vv</code> it adds the PEM-encoded contents of the entire
certificate.
<code>
443/tcp open https
| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
/stateOrProvinceName=California/countryName=US/1.3.6.1.4.1.311.60.2.1.2=Delaware\
/postalCode=95131-2021/localityName=San Jose/serialNumber=3014267\
/streetAddress=2211 N 1st St/1.3.6.1.4.1.311.60.2.1.3=US\
/organizationalUnitName=PayPal Production/businessCategory=Private Organization
| Issuer: commonName=VeriSign Class 3 Extended Validation SSL CA\
/organizationName=VeriSign, Inc./countryName=US\
/organizationalUnitName=Terms of use at https://www.verisign.com/rpa (c)06
| Public Key type: rsa
| Public Key bits: 2048
| Not valid before: 2011-03-23 00:00:00
| Not valid after: 2013-04-01 23:59:59
| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
| SHA-1: d846 5221 467a 0d15 3df0 9f2e af6d 4390 0213 9a68
| -----BEGIN CERTIFICATE-----
| MIIGSzCCBTOgAwIBAgIQLjOHT2/i1B7T//819qTJGDANBgkqhkiG9w0BAQUFADCB
...
| 9YDR12XLZeQjO1uiunCsJkDIf9/5Mqpu57pw8v1QNA==
|_-----END CERTIFICATE-----
</code>
]]
---
-- @output
-- 443/tcp open https
-- | ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
-- /stateOrProvinceName=California/countryName=US
-- | Not valid before: 2011-03-23 00:00:00
-- |_Not valid after: 2013-04-01 23:59:59
--
-- @xmloutput
-- <table key="subject">
-- <elem key="1.3.6.1.4.1.311.60.2.1.2">Delaware</elem>
-- <elem key="1.3.6.1.4.1.311.60.2.1.3">US</elem>
-- <elem key="postalCode">95131-2021</elem>
-- <elem key="localityName">San Jose</elem>
-- <elem key="serialNumber">3014267</elem>
-- <elem key="countryName">US</elem>
-- <elem key="stateOrProvinceName">California</elem>
-- <elem key="streetAddress">2211 N 1st St</elem>
-- <elem key="organizationalUnitName">PayPal Production</elem>
-- <elem key="commonName">www.paypal.com</elem>
-- <elem key="organizationName">PayPal, Inc.</elem>
-- <elem key="businessCategory">Private Organization</elem>
-- </table>
-- <table key="issuer">
-- <elem key="organizationalUnitName">Terms of use at https://www.verisign.com/rpa (c)06</elem>
-- <elem key="organizationName">VeriSign, Inc.</elem>
-- <elem key="commonName">VeriSign Class 3 Extended Validation SSL CA</elem>
-- <elem key="countryName">US</elem>
-- </table>
-- <table key="pubkey">
-- <elem key="type">rsa</elem>
-- <elem key="bits">2048</elem>
-- </table>
-- <table key="validity">
-- <elem key="notBefore">2011-03-23T00:00:00+00:00</elem>
-- <elem key="notAfter">2013-04-01T23:59:59+00:00</elem>
-- </table>
-- <elem key="md5">bf47cecad861efa77d1488ad4a73cb5b</elem>
-- <elem key="sha1">d8465221467a0d153df09f2eaf6d439002139a68</elem>
-- <elem key="pem">-----BEGIN CERTIFICATE-----
-- MIIGSzCCBTOgAwIBAgIQLjOHT2/i1B7T//819qTJGDANBgkqhkiG9w0BAQUFADCB
-- ...
-- 9YDR12XLZeQjO1uiunCsJkDIf9/5Mqpu57pw8v1QNA==
-- -----END CERTIFICATE-----
-- </elem>
author = "David Fifield"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = { "default", "safe", "discovery" }
portrule = function(host, port)
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
end
-- Find the index of a value in an array.
function table_find(t, value)
local i, v
for i, v in ipairs(t) do
if v == value then
return i
end
end
return nil
end
function date_to_string(date)
if not date then
return "MISSING"
end
if type(date) == "string" then
return string.format("Can't parse; string is \"%s\"", date)
else
return stdnse.format_timestamp(stdnse.date_to_timestamp(date, 0), 0)
end
end
-- These are the subject/issuer name fields that will be shown, in this order,
-- without a high verbosity.
local NON_VERBOSE_FIELDS = { "commonName", "organizationName",
"stateOrProvinceName", "countryName" }
function stringify_name(name)
local fields = {}
local _, k, v
if not name then
return nil
end
for _, k in ipairs(NON_VERBOSE_FIELDS) do
v = name[k]
if v then
fields[#fields + 1] = string.format("%s=%s", k, v)
end
end
if nmap.verbosity() > 1 then
for k, v in pairs(name) do
-- Don't include a field twice.
if not table_find(NON_VERBOSE_FIELDS, k) then
if type(k) == "table" then
k = stdnse.strjoin(".", k)
end
fields[#fields + 1] = string.format("%s=%s", k, v)
end
end
end
return stdnse.strjoin("/", fields)
end
local function name_to_table(name)
local output = {}
for k, v in pairs(name) do
if type(k) == "table" then
k = stdnse.strjoin(".", k)
end
output[k] = v
end
return output
end
local function output_tab(cert)
local o = stdnse.output_table()
o.subject = name_to_table(cert.subject)
o.issuer = name_to_table(cert.issuer)
o.pubkey = cert.pubkey
o.validity = {}
for k, v in pairs(cert.validity) do
if type(v)=="string" then
o.validity[k] = v
else
o.validity[k] = stdnse.format_timestamp(stdnse.date_to_timestamp(v, 0), 0)
end
end
o.md5 = stdnse.tohex(cert:digest("md5"))
o.sha1 = stdnse.tohex(cert:digest("sha1"))
o.pem = cert.pem
return o
end
local function output_str(cert)
local lines = {}
lines[#lines + 1] = "Subject: " .. stringify_name(cert.subject)
if nmap.verbosity() > 0 then
lines[#lines + 1] = "Issuer: " .. stringify_name(cert.issuer)
end
if nmap.verbosity() > 0 then
lines[#lines + 1] = "Public Key type: " .. cert.pubkey.type
lines[#lines + 1] = "Public Key bits: " .. cert.pubkey.bits
end
lines[#lines + 1] = "Not valid before: " ..
date_to_string(cert.validity.notBefore)
lines[#lines + 1] = "Not valid after: " ..
date_to_string(cert.validity.notAfter)
if nmap.verbosity() > 0 then
lines[#lines + 1] = "MD5: " .. stdnse.tohex(cert:digest("md5"), { separator = " ", group = 4 })
lines[#lines + 1] = "SHA-1: " .. stdnse.tohex(cert:digest("sha1"), { separator = " ", group = 4 })
end
if nmap.verbosity() > 1 then
lines[#lines + 1] = cert.pem
end
return stdnse.strjoin("\n", lines)
end
action = function(host, port)
local status, cert = sslcert.getCertificate(host, port)
if ( not(status) ) then
return
end
return output_tab(cert), output_str(cert)
end
|
one_handed_maces_db = {
id0 = {
source = "Gren Tornfur",
drop_rate = "0.0",
name = "Deathstalker's Headcracker",
category_territory = "",
territory = "War Zone",
id = "0",
expansion = "",
location = "Darkshore"
},
id1 = {
source = "Twilight Prophet Graeme",
drop_rate = "0.0",
name = "Sentinel's Warhammer",
category_territory = "",
territory = "War Zone",
id = "1",
expansion = "",
location = "Darkshore"
},
id2 = {
source = "Gren Tornfur",
drop_rate = "0.0",
name = "Sentinel's Gavel",
category_territory = "",
territory = "War Zone",
id = "2",
expansion = "",
location = "Darkshore"
},
id3 = {
source = "MOTHER",
drop_rate = "Unknown",
name = "Mother's Twin Gaze",
category_territory = "Raid",
territory = "Horde",
id = "3",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id4 = {
source = "Zekvoz",
drop_rate = "0.0",
name = "Containment Analysis Baton",
category_territory = "Raid",
territory = "Horde",
id = "4",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id5 = {
source = "Invasive Quillrat",
drop_rate = "0.0",
name = "Flaming Gavel of Truth",
category_territory = "",
territory = "Horde",
id = "5",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id6 = {
source = "Wiley Jaki",
drop_rate = "0.0",
name = "Silirrion's Tenderizer",
category_territory = "",
territory = "Horde",
id = "6",
expansion = "Battle For Azeroth",
location = "Tiragarde Sound"
},
id7 = {
source = "Opulence",
drop_rate = "Unknown",
name = "Goblet of Glittering Favor",
category_territory = "Raid",
territory = "Horde",
id = "7",
expansion = "Battle For Azeroth",
location = "Battle of Dazar'alor"
},
id8 = {
source = "High Tinker Mekkatorque",
drop_rate = "Unknown",
name = "Servo-Claw Smasher",
category_territory = "Raid",
territory = "Horde",
id = "8",
expansion = "Battle For Azeroth",
location = "Battle of Dazar'alor"
},
id9 = {
source = "Grong the Revenant",
drop_rate = "Unknown",
name = "Apetagonizer's Claw",
category_territory = "Raid",
territory = "Horde",
id = "9",
expansion = "Battle For Azeroth",
location = "Battle of Dazar'alor"
},
id10 = {
source = "Flowing Honey",
drop_rate = "0.0",
name = "The Glazer",
category_territory = "",
territory = "Horde",
id = "10",
expansion = "Battle For Azeroth",
location = "Stormsong Valley"
},
id11 = {
source = "Galvazzt",
drop_rate = "0.0",
name = "Galvanized Stormcrusher",
category_territory = "Dungeon",
territory = "Horde",
id = "11",
expansion = "Battle For Azeroth",
location = "Temple of Sethraliss"
},
id12 = {
source = "Volkaal",
drop_rate = "Unknown",
name = "Adulation Enforcer",
category_territory = "Dungeon",
territory = "Horde",
id = "12",
expansion = "Battle For Azeroth",
location = "Atal'Dazar"
},
id13 = {
source = "Skycapn Kragg",
drop_rate = "Unknown",
name = "Sharkbait's Fishhook",
category_territory = "Dungeon",
territory = "Horde",
id = "13",
expansion = "Battle For Azeroth",
location = "Freehold"
},
id14 = {
source = "Mogul Razdunk",
drop_rate = "Unknown",
name = "G3T-00t",
category_territory = "Dungeon",
territory = "Horde",
id = "14",
expansion = "Legion",
location = "The MOTHERLODE!!"
},
id15 = {
source = "King Dazar",
drop_rate = "Unknown",
name = "Headcracker of Supplication",
category_territory = "Dungeon",
territory = "Horde",
id = "15",
expansion = "Battle For Azeroth",
location = "Kings' Rest"
},
id16 = {
source = "Sergeant Bainbridge",
drop_rate = "Unknown",
name = "Bainbridge's Blackjack",
category_territory = "Dungeon",
territory = "Horde",
id = "16",
expansion = "Battle For Azeroth",
location = "Siege of Boralus"
},
id17 = {
source = "Elder Leaxa",
drop_rate = "0.0",
name = "Leaxa's Thought-Piercer",
category_territory = "Dungeon",
territory = "Horde",
id = "17",
expansion = "Battle For Azeroth",
location = "The Underrot"
},
id18 = {
source = "Overseer Korgus",
drop_rate = "0.0",
name = "Cudgel of Correctional Oversight",
category_territory = "Dungeon",
territory = "Horde",
id = "18",
expansion = "Battle For Azeroth",
location = "Tol Dagor"
},
id19 = {
source = "Lord Waycrest",
drop_rate = "0.0",
name = "Soulcharmer's Bludgeon",
category_territory = "Dungeon",
territory = "Horde",
id = "19",
expansion = "Battle For Azeroth",
location = "Waycrest Manor"
},
id20 = {
source = "Chopper Redhook",
drop_rate = "Unknown",
name = "Boarder's Billy Club",
category_territory = "Dungeon",
territory = "Horde",
id = "20",
expansion = "Battle For Azeroth",
location = "Siege of Boralus"
},
id21 = {
source = "Bilefang Mother",
drop_rate = "0.0",
name = "Bleak Hills Swatter",
category_territory = "",
territory = "Horde",
id = "21",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id22 = {
source = "Vinespeaker Ratha",
drop_rate = "0.0",
name = "Ratha's Thornscepter",
category_territory = "",
territory = "Horde",
id = "22",
expansion = "Battle For Azeroth",
location = "Stormsong Valley"
},
id23 = {
source = "Gorehorn",
drop_rate = "0.0",
name = "Gorehorn's Rack",
category_territory = "",
territory = "Horde",
id = "23",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id24 = {
source = "Darkspeaker Jola",
drop_rate = "0.0",
name = "Darkspeaker Scepter",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "24",
expansion = "Battle For Azeroth",
location = "Zuldazar"
},
id25 = {
source = "Overseer Krix",
drop_rate = "0.0",
name = "Honorbound Skullcrusher",
category_territory = "",
territory = "Horde",
id = "25",
expansion = "",
location = "Arathi Highlands"
},
id26 = {
source = "Overseer Krix",
drop_rate = "0.0",
name = "7th Legionnaire's Warhammer",
category_territory = "",
territory = "Horde",
id = "26",
expansion = "",
location = "Arathi Highlands"
},
id27 = {
source = "Plaguefeather",
drop_rate = "0.0",
name = "7th Legionnaire's Spellhammer",
category_territory = "",
territory = "Horde",
id = "27",
expansion = "",
location = "Arathi Highlands"
},
id28 = {
source = "Cresting Goliath",
drop_rate = "0.0",
name = "Honorbound Warhammer",
category_territory = "",
territory = "Horde",
id = "28",
expansion = "",
location = "Arathi Highlands"
},
id29 = {
source = "Agitated Albatross",
drop_rate = "0.0",
name = "Wavecaller Mace",
category_territory = "",
territory = "Horde",
id = "29",
expansion = "Battle For Azeroth",
location = "Boralus"
},
id30 = {
source = "Brinefang Saurolisk",
drop_rate = "0.0",
name = "Gol Osigr Hammer",
category_territory = "",
territory = "Horde",
id = "30",
expansion = "Battle For Azeroth",
location = "Tiragarde Sound"
},
id31 = {
source = "Alpine Falcon",
drop_rate = "0.0",
name = "Deepwarden Gavel",
category_territory = "",
territory = "Horde",
id = "31",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id32 = {
source = "Blacktooth Arsonist",
drop_rate = "0.0",
name = "Ironcrest Club",
category_territory = "Dungeon",
territory = "Horde",
id = "32",
expansion = "Battle For Azeroth",
location = "Tol Dagor"
},
id33 = {
source = "Volzith the Whisperer",
drop_rate = "0.0",
name = "Coralshell Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "33",
expansion = "Battle For Azeroth",
location = "Shrine of the Storm"
},
id34 = {
source = "Bloodhunter Cursecarver",
drop_rate = "0.0",
name = "Loa-Blessed Maul",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "34",
expansion = "Battle For Azeroth",
location = "Nazmir"
},
id35 = {
source = "Ghuun",
drop_rate = "0.0",
name = "Zem'lan Smasher",
category_territory = "Raid",
territory = "Horde",
id = "35",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id36 = {
source = "Skycarver Krakit",
drop_rate = "0.0",
name = "Bleached Bone Club",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "36",
expansion = "Battle For Azeroth",
location = "Vol'dun"
},
id37 = {
source = "Bloodhunter Cursecarver",
drop_rate = "0.0",
name = "Rivermarsh Basher",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "37",
expansion = "Battle For Azeroth",
location = "Nazmir"
},
id38 = {
source = "Ghuun",
drop_rate = "0.0",
name = "Warport Clobberer",
category_territory = "Raid",
territory = "Horde",
id = "38",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id39 = {
source = "The Golden Serpent",
drop_rate = "0.0",
name = "Golden Fleet Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "39",
expansion = "Battle For Azeroth",
location = "Kings' Rest"
},
id40 = {
source = "Ghuun",
drop_rate = "0.0",
name = "Zocali Warhammer",
category_territory = "Raid",
territory = "Horde",
id = "40",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id41 = {
source = "Commander Endaxis",
drop_rate = "0.0",
name = "Isolon Anchorite's Cudgel",
category_territory = "",
territory = "Horde",
id = "41",
expansion = "Legion",
location = "Krokuun"
},
id42 = {
source = "Overseer YMorna",
drop_rate = "0.0",
name = "Isolon Anchorite's Gavel",
category_territory = "",
territory = "Horde",
id = "42",
expansion = "Legion",
location = "Mac'Aree"
},
id43 = {
source = "Instructor Tarahna",
drop_rate = "0.0",
name = "Unyielding Peacekeeper's Mace",
category_territory = "",
territory = "Horde",
id = "43",
expansion = "Legion",
location = "Mac'Aree"
},
id44 = {
source = "Hour of Reckoning",
drop_rate = "quest",
name = "War-Caller's Spellhammer",
category_territory = "",
territory = "Alliance",
id = "44",
expansion = "",
location = "Orgrimmar"
},
id45 = {
source = "Hour of Reckoning",
drop_rate = "quest",
name = "Footman's Warhammer",
category_territory = "",
territory = "War Zone",
id = "45",
expansion = "",
location = "Stormwind City"
},
id46 = {
source = "The Deadliest Catch",
drop_rate = "quest",
name = "Wharf-Porter Cudgel",
category_territory = "",
territory = "Horde",
id = "46",
expansion = "Battle For Azeroth",
location = "Tiragarde Sound"
},
id47 = {
source = "No Party Like a Trogg Party",
drop_rate = "quest",
name = "Trogg Thumper",
category_territory = "",
territory = "Horde",
id = "47",
expansion = "Battle For Azeroth",
location = "Tiragarde Sound"
},
id48 = {
source = "The Irontide Crew",
drop_rate = "quest",
name = "Overseer's Authority",
category_territory = "",
territory = "Horde",
id = "48",
expansion = "Battle For Azeroth",
location = "Tiragarde Sound"
},
id49 = {
source = "Pork Chop",
drop_rate = "quest",
name = "Mad-Butcher's Mallet",
category_territory = "",
territory = "Horde",
id = "49",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id50 = {
source = "Terror of the Kraul",
drop_rate = "quest",
name = "Briarback Warmace",
category_territory = "",
territory = "Horde",
id = "50",
expansion = "Battle For Azeroth",
location = "Stormsong Valley"
},
id51 = {
source = "From the Depths",
drop_rate = "quest",
name = "Storm's Wake Truncheon",
category_territory = "",
territory = "Horde",
id = "51",
expansion = "Battle For Azeroth",
location = "Stormsong Valley"
},
id52 = {
source = "From the Depths",
drop_rate = "quest",
name = "Zeth'jir Tidemaiden Scepter",
category_territory = "",
territory = "Horde",
id = "52",
expansion = "Battle For Azeroth",
location = "Stormsong Valley"
},
id53 = {
source = "Mojambo",
drop_rate = "quest",
name = "Sezahjin's Tenderizer",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "53",
expansion = "Battle For Azeroth",
location = "Vol'dun"
},
id54 = {
source = "Zandalari Treasure Trove",
drop_rate = "quest",
name = "Trapped Soul Warmace",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "54",
expansion = "Battle For Azeroth",
location = "Vol'dun"
},
id55 = {
source = "Zandalari Treasure Trove",
drop_rate = "quest",
name = "Zak'rajan's Hexmace",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "55",
expansion = "Battle For Azeroth",
location = "Vol'dun"
},
id56 = {
source = "And Justice For All",
drop_rate = "quest",
name = "Everit's Morning Star",
category_territory = "",
territory = "Horde",
id = "56",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id57 = {
source = "Out With the Old Boss",
drop_rate = "quest",
name = "Boss Cesi's Gavel",
category_territory = "",
territory = "Horde",
id = "57",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id58 = {
source = "Containment Procedure",
drop_rate = "quest",
name = "Ancient Loa-Blessed Mace",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "58",
expansion = "Battle For Azeroth",
location = "Nazmir"
},
id59 = {
source = "Off With Her Head",
drop_rate = "quest",
name = "Grim Ritual Mace",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "59",
expansion = "Battle For Azeroth",
location = "Nazmir"
},
id60 = {
source = "Off With Her Head",
drop_rate = "quest",
name = "Nagla's Headcracker",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "60",
expansion = "Battle For Azeroth",
location = "Nazmir"
},
id61 = {
source = "Dire Situation",
drop_rate = "quest",
name = "Crimson Cultist Scepter",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "61",
expansion = "Battle For Azeroth",
location = "Zuldazar"
},
id62 = {
source = "Dire Situation",
drop_rate = "quest",
name = "Crimson Cultist Pummeler",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "62",
expansion = "Battle For Azeroth",
location = "Zuldazar"
},
id63 = {
source = "Headhunter Jo",
drop_rate = "quest",
name = "Wildtusk Ivory Cudgel",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "63",
expansion = "Battle For Azeroth",
location = "Zuldazar"
},
id64 = {
source = "Lord Commander Alexius",
drop_rate = "0.0",
name = "Niskaran Morning Star",
category_territory = "",
territory = "Horde",
id = "64",
expansion = "Legion",
location = "Stormheim"
},
id65 = {
source = "Dread Vizier Gratork",
drop_rate = "0.0",
name = "Battle Mace of the Niskaran Guard",
category_territory = "",
territory = "Horde",
id = "65",
expansion = "Legion",
location = "Val'sharah"
},
id66 = {
source = "Xeritas",
drop_rate = "0.0",
name = "Star of Niskara",
category_territory = "",
territory = "Horde",
id = "66",
expansion = "Legion",
location = "Azsuna"
},
id67 = {
source = "Flamesmith Lanying",
drop_rate = "Unknown",
name = "Earthen Ring Mace",
category_territory = "",
territory = "",
id = "67",
expansion = "Legion",
location = "The Maelstrom"
},
id68 = {
source = "Flamesmith Lanying",
drop_rate = "Unknown",
name = "Earthen Ring Scepter",
category_territory = "",
territory = "",
id = "68",
expansion = "Legion",
location = "The Maelstrom"
},
id69 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Pummeler",
category_territory = "",
territory = "War Zone",
id = "69",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id70 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Gavel",
category_territory = "",
territory = "War Zone",
id = "70",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id71 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Bonecracker",
category_territory = "",
territory = "War Zone",
id = "71",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id72 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Pummeler",
category_territory = "",
territory = "Alliance",
id = "72",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id73 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Gavel",
category_territory = "",
territory = "Alliance",
id = "73",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id74 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "74",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id75 = {
source = "Archimonde",
drop_rate = "0.0",
name = "Gavel of the Eredar",
category_territory = "Raid",
territory = "Horde",
id = "75",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id76 = {
source = "Xhulhorac",
drop_rate = "0.0",
name = "Hammer of Wicked Infusion",
category_territory = "Raid",
territory = "Horde",
id = "76",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id77 = {
source = "Xhulhorac",
drop_rate = "0.0",
name = "Fiendsbreath Warmace",
category_territory = "Raid",
territory = "Horde",
id = "77",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id78 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Pummeler",
category_territory = "",
territory = "War Zone",
id = "78",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id79 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Gavel",
category_territory = "",
territory = "War Zone",
id = "79",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id80 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Bonecracker",
category_territory = "",
territory = "War Zone",
id = "80",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id81 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Pummeler",
category_territory = "",
territory = "Alliance",
id = "81",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id82 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Gavel",
category_territory = "",
territory = "Alliance",
id = "82",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id83 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "83",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id84 = {
source = "Li ",
drop_rate = "Unknown",
name = "Warmongering Combatant's Pummeler",
category_territory = "",
territory = "War Zone",
id = "84",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id85 = {
source = "Li ",
drop_rate = "Unknown",
name = "Warmongering Combatant's Gavel",
category_territory = "",
territory = "War Zone",
id = "85",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id86 = {
source = "Li ",
drop_rate = "Unknown",
name = "Warmongering Combatant's Bonecracker",
category_territory = "",
territory = "War Zone",
id = "86",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id87 = {
source = "Taeloxe Soulshrivel",
drop_rate = "Unknown",
name = "Warmongering Combatant's Pummeler",
category_territory = "",
territory = "Alliance",
id = "87",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id88 = {
source = "Taeloxe Soulshrivel",
drop_rate = "Unknown",
name = "Warmongering Combatant's Gavel",
category_territory = "",
territory = "Alliance",
id = "88",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id89 = {
source = "Taeloxe Soulshrivel",
drop_rate = "Unknown",
name = "Warmongering Combatant's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "89",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id90 = {
source = "Iron Reaver",
drop_rate = "0.0",
name = "Iron Skullcrusher",
category_territory = "Raid",
territory = "Horde",
id = "90",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id91 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Pummeler",
category_territory = "",
territory = "Alliance",
id = "91",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id92 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Gavel",
category_territory = "",
territory = "Alliance",
id = "92",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id93 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "93",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id94 = {
source = "The Butcher",
drop_rate = "0.0",
name = "Butcher's Terrible Tenderizer",
category_territory = "Raid",
territory = "Horde",
id = "94",
expansion = "Warlords Of Draenor",
location = "Highmaul"
},
id95 = {
source = "Franzok",
drop_rate = "0.0",
name = "Hans'gar's Forgehammer",
category_territory = "Raid",
territory = "Horde",
id = "95",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id96 = {
source = "Franzok",
drop_rate = "0.0",
name = "Franzok's Headsmasher",
category_territory = "Raid",
territory = "Horde",
id = "96",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id97 = {
source = "Kromog",
drop_rate = "Unknown",
name = "Kromog's Brutal Fist",
category_territory = "Raid",
territory = "Horde",
id = "97",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id98 = {
source = "Gaur",
drop_rate = "0.0",
name = "Zolvolt's Shocking Mace",
category_territory = "",
territory = "Horde",
id = "98",
expansion = "Warlords Of Draenor",
location = "Frostwall"
},
id99 = {
source = "Commander Drogan",
drop_rate = "0.0",
name = "Mace of Amaranthine Power",
category_territory = "",
territory = "Horde",
id = "99",
expansion = "Warlords Of Draenor",
location = "Lunarfall"
},
id100 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Pummeler",
category_territory = "",
territory = "War Zone",
id = "100",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id101 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Gavel",
category_territory = "",
territory = "War Zone",
id = "101",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id102 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Bonecracker",
category_territory = "",
territory = "War Zone",
id = "102",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id103 = {
source = "Flamebender Kagraz",
drop_rate = "0",
name = "Magma Monsoon Mace",
category_territory = "Raid",
territory = "Horde",
id = "103",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id104 = {
source = "Iron Reaver",
drop_rate = "0",
name = "Spiked Torque Wrench",
category_territory = "Raid",
territory = "Horde",
id = "104",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id105 = {
source = "Slugg Spinbolt",
drop_rate = "Unknown",
name = "Wild Combatant's Pummeler",
category_territory = "",
territory = "War Zone",
id = "105",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id106 = {
source = "Slugg Spinbolt",
drop_rate = "Unknown",
name = "Wild Combatant's Gavel",
category_territory = "",
territory = "War Zone",
id = "106",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id107 = {
source = "Slugg Spinbolt",
drop_rate = "Unknown",
name = "Wild Combatant's Bonecracker",
category_territory = "",
territory = "War Zone",
id = "107",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id108 = {
source = "Fobbly Kickfix",
drop_rate = "Unknown",
name = "Wild Combatant's Pummeler",
category_territory = "",
territory = "Alliance",
id = "108",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id109 = {
source = "Fobbly Kickfix",
drop_rate = "Unknown",
name = "Wild Combatant's Gavel",
category_territory = "",
territory = "Alliance",
id = "109",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id110 = {
source = "Fobbly Kickfix",
drop_rate = "Unknown",
name = "Wild Combatant's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "110",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id111 = {
source = "Magwia",
drop_rate = "0.0",
name = "Riverbeast Molar Club",
category_territory = "",
territory = "Horde",
id = "111",
expansion = "Warlords Of Draenor",
location = "Tanaan Jungle"
},
id112 = {
source = "Tectus",
drop_rate = "0",
name = "Shard of Crystalline Fury",
category_territory = "Raid",
territory = "Horde",
id = "112",
expansion = "Warlords Of Draenor",
location = "Highmaul"
},
id113 = {
source = "Gugrokk",
drop_rate = "0.0",
name = "Gug'rokk's Smasher",
category_territory = "Dungeon",
territory = "Horde",
id = "113",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id114 = {
source = "Nitrogg Thundertower",
drop_rate = "0.0",
name = "Scepter of Brutality",
category_territory = "Dungeon",
territory = "Horde",
id = "114",
expansion = "Warlords Of Draenor",
location = "Grimrail Depot"
},
id115 = {
source = "Oshir",
drop_rate = "0.0",
name = "Mindbreaker Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "115",
expansion = "Warlords Of Draenor",
location = "Iron Docks"
},
id116 = {
source = "When All Is Aligned",
drop_rate = "quest",
name = "Talon Guard Cudgel",
category_territory = "",
territory = "Horde",
id = "116",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id117 = {
source = "Reglakks Research",
drop_rate = "quest",
name = "Gorian Arcanist Spiritshaker",
category_territory = "",
territory = "Horde",
id = "117",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id118 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Pummeler",
category_territory = "",
territory = "Alliance",
id = "118",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id119 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Gavel",
category_territory = "",
territory = "Alliance",
id = "119",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id120 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "120",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id121 = {
source = "Blackfang Prowler",
drop_rate = "0.0",
name = "Firecrystal Mace",
category_territory = "",
territory = "Horde",
id = "121",
expansion = "Warlords Of Draenor",
location = "Tanaan Jungle"
},
id122 = {
source = "Yalnu",
drop_rate = "0.0",
name = "Hoof of Yalnu",
category_territory = "Dungeon",
territory = "Horde",
id = "122",
expansion = "Warlords Of Draenor",
location = "The Everbloom"
},
id123 = {
source = "Mecha Plunderer",
drop_rate = "0.0",
name = "Plunderer's Drill",
category_territory = "",
territory = "Horde",
id = "123",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id124 = {
source = "Son of Goramal",
drop_rate = "0.0",
name = "Cudgel of the Son of Goramal",
category_territory = "",
territory = "Horde",
id = "124",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id125 = {
source = "Avalanche",
drop_rate = "0.0",
name = "Rugged Crystal Cudgel",
category_territory = "",
territory = "Horde",
id = "125",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id126 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Pummeler",
category_territory = "",
territory = "War Zone",
id = "126",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id127 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Gavel",
category_territory = "",
territory = "War Zone",
id = "127",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id128 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Bonecracker",
category_territory = "",
territory = "War Zone",
id = "128",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id129 = {
source = "Reglakks Research",
drop_rate = "quest",
name = "Mighty Gorian Headcracker",
category_territory = "",
territory = "Horde",
id = "129",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id130 = {
source = "Arachnis",
drop_rate = "0.0",
name = "Howling Mace",
category_territory = "",
territory = "Horde",
id = "130",
expansion = "Warlords Of Draenor",
location = "Lunarfall"
},
id131 = {
source = "Diving Chakram Spinner",
drop_rate = "0.0",
name = "Oshu'gun Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "131",
expansion = "Warlords Of Draenor",
location = "Skyreach"
},
id132 = {
source = "The Dark Heart of Oshugun",
drop_rate = "quest",
name = "Void-Warped Oshu'gun Mace",
category_territory = "",
territory = "Horde",
id = "132",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id133 = {
source = "The Dark Heart of Oshugun",
drop_rate = "quest",
name = "Void-Warped Oshu'gun Mallet",
category_territory = "",
territory = "Horde",
id = "133",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id134 = {
source = "That Pounding Sound",
drop_rate = "quest",
name = "Plainshunter Blackjack",
category_territory = "",
territory = "Horde",
id = "134",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id135 = {
source = "Darktide Machinist",
drop_rate = "0.0",
name = "Gorian Mace",
category_territory = "",
territory = "Horde",
id = "135",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id136 = {
source = "Defiled Spirit",
drop_rate = "0.0",
name = "Ancestral Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "136",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Burial Grounds"
},
id137 = {
source = "Cro Fleshrender",
drop_rate = "0.0",
name = "Fleshrender's Painbringer",
category_territory = "",
territory = "Horde",
id = "137",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id138 = {
source = "Shattered Hand Cutter",
drop_rate = "0.0",
name = "Gibberskull Mace",
category_territory = "",
territory = "Horde",
id = "138",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id139 = {
source = "Bloodmane Shortfang",
drop_rate = "0.0",
name = "Matti's Magnificent Mace",
category_territory = "",
territory = "Horde",
id = "139",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id140 = {
source = "The Final Piece",
drop_rate = "quest",
name = "Vorpil's Ribcrusher",
category_territory = "",
territory = "Horde",
id = "140",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id141 = {
source = "Skyreach Sun Talon",
drop_rate = "0.0",
name = "Longclaw Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "141",
expansion = "Warlords Of Draenor",
location = "Skyreach"
},
id142 = {
source = "Sethekk Wind Serpent",
drop_rate = "0.0",
name = "Shadowsage Scepter",
category_territory = "",
territory = "Horde",
id = "142",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id143 = {
source = "Initiate of the Rising Sun",
drop_rate = "0.0",
name = "Bloodmane Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "143",
expansion = "Warlords Of Draenor",
location = "Skyreach"
},
id144 = {
source = "Tamed Clefthoof",
drop_rate = "0.0",
name = "Ruhkmari Scepter",
category_territory = "",
territory = "Horde",
id = "144",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id145 = {
source = "WANTED: Hilaani",
drop_rate = "quest",
name = "Riverbeast Jawbone",
category_territory = "",
territory = "Horde",
id = "145",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id146 = {
source = "WANTED: Hilaani",
drop_rate = "quest",
name = "Riverbeast Femur",
category_territory = "",
territory = "Horde",
id = "146",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id147 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "147",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id148 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "148",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id149 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "149",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id150 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "150",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id151 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "151",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id152 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "152",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id153 = {
source = "Spore Drifter",
drop_rate = "0.0",
name = "Skettis Mace",
category_territory = "",
territory = "Horde",
id = "153",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id154 = {
source = "Deathweb Egg Tender",
drop_rate = "0.0",
name = "Sunsworn Scepter",
category_territory = "",
territory = "Horde",
id = "154",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id155 = {
source = "Primordius",
drop_rate = "0.0",
name = "Acid-Spine Bonemace",
category_territory = "Raid",
territory = "Horde",
id = "155",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id156 = {
source = "Dark Animus",
drop_rate = "0.0",
name = "Hand of the Dark Animus",
category_territory = "Raid",
territory = "Horde",
id = "156",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id157 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Torall, Rod of the Shattered Throne",
category_territory = "Raid",
territory = "Horde",
id = "157",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id158 = {
source = "Lulin",
drop_rate = "Unknown",
name = "Zeeg's Ancient Kegsmasher",
category_territory = "Raid",
territory = "Horde",
id = "158",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id159 = {
source = "Lulin",
drop_rate = "Unknown",
name = "Jerthud, Graceful Hand of the Savior",
category_territory = "Raid",
territory = "Horde",
id = "159",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id160 = {
source = "Primordius",
drop_rate = "0.0",
name = "Acid-Spine Bonemace",
category_territory = "Raid",
territory = "Horde",
id = "160",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id161 = {
source = "Dark Animus",
drop_rate = "0.0",
name = "Hand of the Dark Animus",
category_territory = "Raid",
territory = "Horde",
id = "161",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id162 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Torall, Rod of the Shattered Throne",
category_territory = "Raid",
territory = "Horde",
id = "162",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id163 = {
source = "Tortos",
drop_rate = "Unknown",
name = "Zeeg's Ancient Kegsmasher",
category_territory = "Raid",
territory = "Horde",
id = "163",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id164 = {
source = "Lulin",
drop_rate = "Unknown",
name = "Jerthud, Graceful Hand of the Savior",
category_territory = "Raid",
territory = "Horde",
id = "164",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id165 = {
source = "Iron Juggernaut",
drop_rate = "0.0",
name = "Seismic Bore",
category_territory = "Raid",
territory = "Horde",
id = "165",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id166 = {
source = "Wavebinder Kardris",
drop_rate = "Unknown",
name = "Kardris' Scepter",
category_territory = "Raid",
territory = "Horde",
id = "166",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id167 = {
source = "Siegecrafter Blackfuse",
drop_rate = "0.0",
name = "Siegecrafter's Forge Hammer",
category_territory = "Raid",
territory = "Horde",
id = "167",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id168 = {
source = "Garrosh Hellscream",
drop_rate = "0.0",
name = "Horned Mace of the Old Ones",
category_territory = "Raid",
territory = "Horde",
id = "168",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id169 = {
source = "Down the Goren Hole",
drop_rate = "quest",
name = "Abandoned Dark Iron Skullthumper",
category_territory = "",
territory = "Horde",
id = "169",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id170 = {
source = "Down the Goren Hole",
drop_rate = "quest",
name = "Abandoned Dark Iron Cudgel",
category_territory = "",
territory = "Horde",
id = "170",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id171 = {
source = "Spore Drifter",
drop_rate = "0.0",
name = "Auchenai Mace",
category_territory = "",
territory = "Horde",
id = "171",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id172 = {
source = "Spore Drifter",
drop_rate = "0.0",
name = "Soulkeeper Scepter",
category_territory = "",
territory = "Horde",
id = "172",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id173 = {
source = "Fair Warning",
drop_rate = "quest",
name = "Ogron Slayer's Eyebruiser",
category_territory = "",
territory = "Horde",
id = "173",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id174 = {
source = "Fair Warning",
drop_rate = "quest",
name = "Ogron Slayer's Club",
category_territory = "",
territory = "Horde",
id = "174",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id175 = {
source = "Greldrok the Cunning",
drop_rate = "0.0",
name = "Greldrok's Facesmasher",
category_territory = "",
territory = "Horde",
id = "175",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id176 = {
source = "Steamscar",
drop_rate = "quest",
name = "Steamscar Cudgel",
category_territory = "",
territory = "Horde",
id = "176",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id177 = {
source = "Primordius",
drop_rate = "0.0",
name = "Acid-Spine Bonemace",
category_territory = "Raid",
territory = "Horde",
id = "177",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id178 = {
source = "Dark Animus",
drop_rate = "0.0",
name = "Hand of the Dark Animus",
category_territory = "Raid",
territory = "Horde",
id = "178",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id179 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Torall, Rod of the Shattered Throne",
category_territory = "Raid",
territory = "Horde",
id = "179",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id180 = {
source = "Tortos",
drop_rate = "Unknown",
name = "Zeeg's Ancient Kegsmasher",
category_territory = "Raid",
territory = "Horde",
id = "180",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id181 = {
source = "Tortos",
drop_rate = "Unknown",
name = "Jerthud, Graceful Hand of the Savior",
category_territory = "Raid",
territory = "Horde",
id = "181",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id182 = {
source = "Ravenous Mongrel",
drop_rate = "0.0",
name = "Incised Mace",
category_territory = "",
territory = "Horde",
id = "182",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id183 = {
source = "Gromkar Deckhand",
drop_rate = "0.0",
name = "Zangarra Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "183",
expansion = "Warlords Of Draenor",
location = "Iron Docks"
},
id184 = {
source = "Primordius",
drop_rate = "0.0",
name = "Acid-Spine Bonemace",
category_territory = "Raid",
territory = "Horde",
id = "184",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id185 = {
source = "Dark Animus",
drop_rate = "0.0",
name = "Hand of the Dark Animus",
category_territory = "Raid",
territory = "Horde",
id = "185",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id186 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Torall, Rod of the Shattered Throne",
category_territory = "Raid",
territory = "Horde",
id = "186",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id187 = {
source = "Lulin",
drop_rate = "Unknown",
name = "Jerthud, Graceful Hand of the Savior",
category_territory = "Raid",
territory = "Horde",
id = "187",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id188 = {
source = "Lulin",
drop_rate = "Unknown",
name = "Zeeg's Ancient Kegsmasher",
category_territory = "Raid",
territory = "Horde",
id = "188",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id189 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "189",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id190 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "190",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id191 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "191",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id192 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "192",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id193 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "193",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id194 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "194",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id195 = {
source = "The Iron Wolf",
drop_rate = "quest",
name = "Thunderlord Riding Crop",
category_territory = "",
territory = "Horde",
id = "195",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id196 = {
source = "The Iron Wolf",
drop_rate = "quest",
name = "Thunderlord Herding Cudgel",
category_territory = "",
territory = "Horde",
id = "196",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id197 = {
source = "Darkness Falls",
drop_rate = "quest",
name = "Karabor Honor Guard Mace",
category_territory = "",
territory = "Horde",
id = "197",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id198 = {
source = "Darkness Falls",
drop_rate = "quest",
name = "Rangari Initiate Blackjack",
category_territory = "",
territory = "Horde",
id = "198",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id199 = {
source = "Darkness Falls",
drop_rate = "quest",
name = "Karabor Anchorite Cudgel",
category_territory = "",
territory = "Horde",
id = "199",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id200 = {
source = "Morva Soultwister",
drop_rate = "0.0",
name = "Void Prophecy Cudgel",
category_territory = "",
territory = "Horde",
id = "200",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id201 = {
source = "Grand Empress Shekzeer",
drop_rate = "0.0",
name = "Kri'tak, Imperial Scepter of the Swarm",
category_territory = "Raid",
territory = "Horde",
id = "201",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id202 = {
source = "For the Alliance!",
drop_rate = "quest",
name = "Karabor Augury Mace",
category_territory = "",
territory = "Horde",
id = "202",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id203 = {
source = "For the Horde!",
drop_rate = "quest",
name = "Frostwolf Wind-Talker Cudgel",
category_territory = "",
territory = "Horde",
id = "203",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id204 = {
source = "Thunderlord Trapper",
drop_rate = "0.0",
name = "Creeperclaw Mace",
category_territory = "",
territory = "Horde",
id = "204",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id205 = {
source = "Gromkar Technician",
drop_rate = "0.0",
name = "Evermorn Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "205",
expansion = "Warlords Of Draenor",
location = "Iron Docks"
},
id206 = {
source = "Jan-xi",
drop_rate = "Unknown",
name = "Tihan, Scepter of the Sleeping Emperor",
category_territory = "Raid",
territory = "Horde",
id = "206",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id207 = {
source = "Primordius",
drop_rate = "0.0",
name = "Acid-Spine Bonemace",
category_territory = "Raid",
territory = "Horde",
id = "207",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id208 = {
source = "Dark Animus",
drop_rate = "0.0",
name = "Hand of the Dark Animus",
category_territory = "Raid",
territory = "Horde",
id = "208",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id209 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Torall, Rod of the Shattered Throne",
category_territory = "Raid",
territory = "Horde",
id = "209",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id210 = {
source = "Tortos",
drop_rate = "Unknown",
name = "Zeeg's Ancient Kegsmasher",
category_territory = "Raid",
territory = "Horde",
id = "210",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id211 = {
source = "Horridon",
drop_rate = "Unknown",
name = "Jerthud, Graceful Hand of the Savior",
category_territory = "Raid",
territory = "Horde",
id = "211",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id212 = {
source = "Steamscar Primalist",
drop_rate = "0.0",
name = "Vinewrapped Mace",
category_territory = "",
territory = "Horde",
id = "212",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id213 = {
source = "Gromkar Grunt",
drop_rate = "0.0",
name = "Growthshaper Scepter",
category_territory = "",
territory = "Horde",
id = "213",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id214 = {
source = "Jan-xi",
drop_rate = "Unknown",
name = "Tihan, Scepter of the Sleeping Emperor",
category_territory = "Raid",
territory = "Horde",
id = "214",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id215 = {
source = "Grand Empress Shekzeer",
drop_rate = "0.0",
name = "Kri'tak, Imperial Scepter of the Swarm",
category_territory = "Raid",
territory = "Horde",
id = "215",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id216 = {
source = "Jan-xi",
drop_rate = "Unknown",
name = "Tihan, Scepter of the Sleeping Emperor",
category_territory = "Raid",
territory = "Horde",
id = "216",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id217 = {
source = "Grand Empress Shekzeer",
drop_rate = "0.0",
name = "Kri'tak, Imperial Scepter of the Swarm",
category_territory = "Raid",
territory = "Horde",
id = "217",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id218 = {
source = "Sha of Doubt",
drop_rate = "0.0",
name = "Je'lyu, Spirit of the Serpent",
category_territory = "Dungeon",
territory = "Horde",
id = "218",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id219 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "219",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id220 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "220",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id221 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "221",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id222 = {
source = "Electromancer Jule",
drop_rate = "0.0",
name = "Lightning Snare",
category_territory = "",
territory = "Horde",
id = "222",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id223 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "223",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id224 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "224",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id225 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "225",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id226 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "226",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id227 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "227",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id228 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "228",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id229 = {
source = "Mistweaver Ai",
drop_rate = "Unknown",
name = "Pandaren Peace Offering",
category_territory = "",
territory = "Horde",
id = "229",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id230 = {
source = "Sha of Doubt",
drop_rate = "0.0",
name = "Je'lyu, Spirit of the Serpent",
category_territory = "Dungeon",
territory = "Horde",
id = "230",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id231 = {
source = "Raigonn",
drop_rate = "0.0",
name = "Carapace Breaker",
category_territory = "Dungeon",
territory = "Horde",
id = "231",
expansion = "Mists Of Pandaria",
location = "Gate of the Setting Sun"
},
id232 = {
source = "Yan-Zhu the Uncasked",
drop_rate = "0.0",
name = "Gao's Keg Tapper",
category_territory = "Dungeon",
territory = "Horde",
id = "232",
expansion = "Mists Of Pandaria",
location = "Stormstout Brewery"
},
id233 = {
source = "Raigonn",
drop_rate = "0.0",
name = "Carapace Breaker",
category_territory = "Dungeon",
territory = "Horde",
id = "233",
expansion = "Mists Of Pandaria",
location = "Gate of the Setting Sun"
},
id234 = {
source = "Korkron Grunt",
drop_rate = "0.0",
name = "Solianti's Insect Smasher",
category_territory = "Raid",
territory = "Horde",
id = "234",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id235 = {
source = "Untrained Quilen",
drop_rate = "0.0",
name = "Porter's Tooth-Marked Mace",
category_territory = "Raid",
territory = "Horde",
id = "235",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id236 = {
source = "Ambersmith Zikk",
drop_rate = "Unknown",
name = "Amber Sledge of Klaxxi'vess",
category_territory = "",
territory = "Horde",
id = "236",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id237 = {
source = "The Arena of Annihilation",
drop_rate = "quest",
name = "Jol'Grum's Frozen Mace",
category_territory = "",
territory = "Horde",
id = "237",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id238 = {
source = "The Arena of Annihilation",
drop_rate = "quest",
name = "Maki's Mashing Mace",
category_territory = "",
territory = "Horde",
id = "238",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id239 = {
source = "Yan-Zhu the Uncasked",
drop_rate = "0.0",
name = "Gao's Keg Tapper",
category_territory = "Dungeon",
territory = "Horde",
id = "239",
expansion = "Mists Of Pandaria",
location = "Stormstout Brewery"
},
id240 = {
source = "Raigonn",
drop_rate = "0.0",
name = "Carapace Breaker",
category_territory = "Dungeon",
territory = "Horde",
id = "240",
expansion = "Mists Of Pandaria",
location = "Gate of the Setting Sun"
},
id241 = {
source = "The Horror Comes A-Rising",
drop_rate = "quest",
name = "Obelisk of the Rikkitun",
category_territory = "",
territory = "Horde",
id = "241",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id242 = {
source = "The Scent of Blood",
drop_rate = "quest",
name = "Bloodseeker's Mace",
category_territory = "",
territory = "Horde",
id = "242",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id243 = {
source = "Moonglow Sporebat",
drop_rate = "0.0",
name = "Frostbitten Mace",
category_territory = "",
territory = "Horde",
id = "243",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id244 = {
source = "Bloodmaul Enforcer",
drop_rate = "0.0",
name = "Coldsinger Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "244",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id245 = {
source = "Bladespire Mauler",
drop_rate = "0.0",
name = "Lunarglow Mace",
category_territory = "",
territory = "Horde",
id = "245",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id246 = {
source = "Thunderlord Stalker",
drop_rate = "0.0",
name = "Moonwhisper Scepter",
category_territory = "",
territory = "Horde",
id = "246",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id247 = {
source = "Overseer Komak",
drop_rate = "0.0",
name = "Engraved Mace",
category_territory = "Raid",
territory = "Horde",
id = "247",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id248 = {
source = "Zandalari Acolyte",
drop_rate = "0.0",
name = "Immaculate Scepter",
category_territory = "",
territory = "Horde",
id = "248",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id249 = {
source = "Last Toll of the Yaungol",
drop_rate = "quest",
name = "Bearheart's Club",
category_territory = "",
territory = "Horde",
id = "249",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id250 = {
source = "Drakkari Frost Warden",
drop_rate = "0.0",
name = "Hex-Caster Gavel",
category_territory = "Raid",
territory = "Horde",
id = "250",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id251 = {
source = "Aethis",
drop_rate = "0.0",
name = "Pool-Stirrer",
category_territory = "",
territory = "Horde",
id = "251",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id252 = {
source = "Ferdinand",
drop_rate = "0.0",
name = "Ook-Breaker Mace",
category_territory = "",
territory = "Horde",
id = "252",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id253 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Phantasmal Hammer",
category_territory = "",
territory = "",
id = "253",
expansion = "Legion",
location = "Dalaran"
},
id254 = {
source = "The Ordo Warbringer",
drop_rate = "quest",
name = "Ordo Mace",
category_territory = "",
territory = "Horde",
id = "254",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id255 = {
source = "The Ordo Warbringer",
drop_rate = "quest",
name = "Fireblaze Clobberer",
category_territory = "",
territory = "Horde",
id = "255",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id256 = {
source = "Make A Fighter Out of Me",
drop_rate = "quest",
name = "Shomi's Mace",
category_territory = "",
territory = "Horde",
id = "256",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id257 = {
source = "Enraged Vengeance",
drop_rate = "quest",
name = "Ornate Mace",
category_territory = "",
territory = "Horde",
id = "257",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id258 = {
source = "Morchok",
drop_rate = "0.0",
name = "Vagaries of Time",
category_territory = "Raid",
territory = "Horde",
id = "258",
expansion = "Cataclysm",
location = "Dragon Soul"
},
id259 = {
source = "Carp Diem",
drop_rate = "quest",
name = "Jinyu Ritual Scepter",
category_territory = "",
territory = "Horde",
id = "259",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id260 = {
source = "Carp Diem",
drop_rate = "quest",
name = "Jinyu Combat Mace",
category_territory = "",
territory = "Horde",
id = "260",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id261 = {
source = "Flying Colors",
drop_rate = "quest",
name = "Mace of Honor",
category_territory = "",
territory = "Horde",
id = "261",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id262 = {
source = "Yan-Zhu the Uncasked",
drop_rate = "0.0",
name = "Gao's Keg Tapper",
category_territory = "Dungeon",
territory = "Horde",
id = "262",
expansion = "Mists Of Pandaria",
location = "Stormstout Brewery"
},
id263 = {
source = "Sha Echo",
drop_rate = "0.0",
name = "Ced's Crusher",
category_territory = "",
territory = "Horde",
id = "263",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id264 = {
source = "Harthak Flameseeker",
drop_rate = "0.0",
name = "Rigid Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "264",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Palace"
},
id265 = {
source = "Kunzen Hunter",
drop_rate = "0.0",
name = "Grummle Scepter",
category_territory = "",
territory = "Horde",
id = "265",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id266 = {
source = "Scarlet Flamethrower",
drop_rate = "0.0",
name = "Inlaid Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "266",
expansion = "Mists Of Pandaria",
location = "Scarlet Monastery"
},
id267 = {
source = "Srathik Cacophyte",
drop_rate = "0.0",
name = "Bejeweled Scepter",
category_territory = "",
territory = "Horde",
id = "267",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id268 = {
source = "Len at Arms",
drop_rate = "Unknown",
name = "Wasteland Scepter",
category_territory = "",
territory = "Horde",
id = "268",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id269 = {
source = "Len at Arms",
drop_rate = "Unknown",
name = "Wasteland Smasher",
category_territory = "",
territory = "Horde",
id = "269",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id270 = {
source = "Len at Arms",
drop_rate = "Unknown",
name = "Wasteland Mace",
category_territory = "",
territory = "Horde",
id = "270",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id271 = {
source = "Balance",
drop_rate = "quest",
name = "Marista Mace",
category_territory = "",
territory = "Horde",
id = "271",
expansion = "Mists Of Pandaria",
location = "Krasarang Wilds"
},
id272 = {
source = "Balance",
drop_rate = "quest",
name = "Cloudfall Mace",
category_territory = "",
territory = "Horde",
id = "272",
expansion = "Mists Of Pandaria",
location = "Krasarang Wilds"
},
id273 = {
source = "Gardener Fran and the Watering Can",
drop_rate = "quest",
name = "Gardener's Mace",
category_territory = "",
territory = "Horde",
id = "273",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id274 = {
source = "Gardener Fran and the Watering Can",
drop_rate = "quest",
name = "Fran's Golden Mace",
category_territory = "",
territory = "Horde",
id = "274",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id275 = {
source = "Gardener Fran and the Watering Can",
drop_rate = "quest",
name = "Fran's Bronze Mace",
category_territory = "",
territory = "Horde",
id = "275",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id276 = {
source = "Lord Rhyolith",
drop_rate = "0.0",
name = "Shatterskull Bonecrusher",
category_territory = "Raid",
territory = "Horde",
id = "276",
expansion = "Cataclysm",
location = "Firelands"
},
id277 = {
source = "Morchok",
drop_rate = "0.0",
name = "Vagaries of Time",
category_territory = "Raid",
territory = "Horde",
id = "277",
expansion = "Cataclysm",
location = "Dragon Soul"
},
id278 = {
source = "Minion of Doubt",
drop_rate = "0.0",
name = "Barbarian Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "278",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id279 = {
source = "Stout Shaghorn",
drop_rate = "0.0",
name = "Shamanic Scepter",
category_territory = "",
territory = "Horde",
id = "279",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id280 = {
source = "Alin the Finder",
drop_rate = "Unknown",
name = "Mountainscaler Scepter",
category_territory = "",
territory = "Horde",
id = "280",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id281 = {
source = "Alin the Finder",
drop_rate = "Unknown",
name = "Mountainscaler Smasher",
category_territory = "",
territory = "Horde",
id = "281",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id282 = {
source = "Alin the Finder",
drop_rate = "Unknown",
name = "Mountainscaler Mace",
category_territory = "",
territory = "Horde",
id = "282",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id283 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "283",
expansion = "",
location = "Orgrimmar"
},
id284 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Gavel",
category_territory = "",
territory = "Alliance",
id = "284",
expansion = "",
location = "Orgrimmar"
},
id285 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Pummeler",
category_territory = "",
territory = "Alliance",
id = "285",
expansion = "",
location = "Orgrimmar"
},
id286 = {
source = "The Rumpus",
drop_rate = "quest",
name = "Trophy of the Last Man Standing",
category_territory = "",
territory = "Horde",
id = "286",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id287 = {
source = "The Rumpus",
drop_rate = "quest",
name = "Mace of Inner Peace",
category_territory = "",
territory = "Horde",
id = "287",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id288 = {
source = "The Rumpus",
drop_rate = "quest",
name = "Mace of Serenity",
category_territory = "",
territory = "Horde",
id = "288",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id289 = {
source = "An Urgent Plea",
drop_rate = "quest",
name = "Spirit Crusher",
category_territory = "",
territory = "Horde",
id = "289",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id290 = {
source = "Maloriak",
drop_rate = "0.0",
name = "Mace of Acrid Death",
category_territory = "Raid",
territory = "Horde",
id = "290",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id291 = {
source = "Onyxia",
drop_rate = "Unknown",
name = "Andoros, Fist of the Dragon King",
category_territory = "Raid",
territory = "Horde",
id = "291",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id292 = {
source = "Blazzek the Biter",
drop_rate = "Unknown",
name = "Vicious Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "292",
expansion = "",
location = "Tanaris"
},
id293 = {
source = "Chogall",
drop_rate = "0.0",
name = "Twilight's Hammer",
category_territory = "Raid",
territory = "Horde",
id = "293",
expansion = "Cataclysm",
location = "The Bastion of Twilight"
},
id294 = {
source = "Onyxia",
drop_rate = "Unknown",
name = "Andoros, Fist of the Dragon King",
category_territory = "Raid",
territory = "Horde",
id = "294",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id295 = {
source = "Maloriak",
drop_rate = "0.0",
name = "Mace of Acrid Death",
category_territory = "Raid",
territory = "Horde",
id = "295",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id296 = {
source = "Chogall",
drop_rate = "0.0",
name = "Twilight's Hammer",
category_territory = "Raid",
territory = "Horde",
id = "296",
expansion = "Cataclysm",
location = "The Bastion of Twilight"
},
id297 = {
source = "Daakara",
drop_rate = "0.0",
name = "Mace of the Sacrificed",
category_territory = "Dungeon",
territory = "Horde",
id = "297",
expansion = "Cataclysm",
location = "Zul'Aman"
},
id298 = {
source = "Daakara",
drop_rate = "0.0",
name = "Amani Scepter of Rites",
category_territory = "Dungeon",
territory = "Horde",
id = "298",
expansion = "Cataclysm",
location = "Zul'Aman"
},
id299 = {
source = "Chosen of Hethiss",
drop_rate = "0.0",
name = "Gurubashi Punisher",
category_territory = "Dungeon",
territory = "Horde",
id = "299",
expansion = "Cataclysm",
location = "Zul'Gurub"
},
id300 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Pummeler",
category_territory = "",
territory = "Alliance",
id = "300",
expansion = "",
location = "Orgrimmar"
},
id301 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Bonecracker",
category_territory = "",
territory = "Alliance",
id = "301",
expansion = "",
location = "Orgrimmar"
},
id302 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Gavel",
category_territory = "",
territory = "Alliance",
id = "302",
expansion = "",
location = "Orgrimmar"
},
id303 = {
source = "Lord Rhyolith",
drop_rate = "0.0",
name = "Shatterskull Bonecrusher",
category_territory = "Raid",
territory = "Horde",
id = "303",
expansion = "Cataclysm",
location = "Firelands"
},
id304 = {
source = "Echo of Jaina",
drop_rate = "0.0",
name = "Dragonshrine Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "304",
expansion = "Cataclysm",
location = "End Time"
},
id305 = {
source = "Perotharn",
drop_rate = "0.0",
name = "Gavel of Peroth'arn",
category_territory = "Dungeon",
territory = "Horde",
id = "305",
expansion = "Cataclysm",
location = "Well of Eternity"
},
id306 = {
source = "Siamat",
drop_rate = "0.0",
name = "Hammer of Sparks",
category_territory = "Dungeon",
territory = "Horde",
id = "306",
expansion = "Cataclysm",
location = "Lost City of the Tol'vir"
},
id307 = {
source = "Erudax",
drop_rate = "0.0",
name = "Mace of Transformed Bone",
category_territory = "Dungeon",
territory = "Horde",
id = "307",
expansion = "Cataclysm",
location = "Grim Batol"
},
id308 = {
source = "Romogg Bonecrusher",
drop_rate = "0.0",
name = "Torturer's Mercy",
category_territory = "Dungeon",
territory = "Horde",
id = "308",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id309 = {
source = "Siamat",
drop_rate = "0.0",
name = "Hammer of Sparks",
category_territory = "Dungeon",
territory = "Horde",
id = "309",
expansion = "Cataclysm",
location = "Lost City of the Tol'vir"
},
id310 = {
source = "Erudax",
drop_rate = "0.0",
name = "Mace of Transformed Bone",
category_territory = "Dungeon",
territory = "Horde",
id = "310",
expansion = "Cataclysm",
location = "Grim Batol"
},
id311 = {
source = "Setesh",
drop_rate = "0.0",
name = "Scepter of Power",
category_territory = "Dungeon",
territory = "Horde",
id = "311",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id312 = {
source = "Setesh",
drop_rate = "0.0",
name = "Scepter of Power",
category_territory = "Dungeon",
territory = "Horde",
id = "312",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id313 = {
source = "Pogg",
drop_rate = "Unknown",
name = "Shimmering Morningstar",
category_territory = "",
territory = "Horde",
id = "313",
expansion = "Cataclysm",
location = "Tol Barad Peninsula"
},
id314 = {
source = "Quartermaster Brazie",
drop_rate = "Unknown",
name = "Shimmering Morningstar",
category_territory = "",
territory = "Horde",
id = "314",
expansion = "Cataclysm",
location = "Tol Barad Peninsula"
},
id315 = {
source = "The Crucible of Carnage: The Twilight Terror!",
drop_rate = "quest",
name = "Gurgthock's Garish Gorebat",
category_territory = "",
territory = "Horde",
id = "315",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id316 = {
source = "Fury Unbound",
drop_rate = "quest",
name = "Mace of the Gullet",
category_territory = "",
territory = "Horde",
id = "316",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id317 = {
source = "Narkrall, The Drake-Tamer",
drop_rate = "quest",
name = "Dragonscorn Mace",
category_territory = "",
territory = "Horde",
id = "317",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id318 = {
source = "boss",
drop_rate = "Unknown",
name = "Cookie's Tenderizer",
category_territory = "Dungeon",
territory = "War Zone",
id = "318",
expansion = "",
location = "The Deadmines"
},
id319 = {
source = "Unbound Emberfiend",
drop_rate = "0.0",
name = "Downfall Hammer",
category_territory = "",
territory = "Horde",
id = "319",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id320 = {
source = "Verlok Grubthumper",
drop_rate = "0.0",
name = "Mace of Apotheosis",
category_territory = "",
territory = "Horde",
id = "320",
expansion = "Cataclysm",
location = "Deepholm"
},
id321 = {
source = "Ozruk",
drop_rate = "0.0",
name = "Heavy Geode Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "321",
expansion = "Cataclysm",
location = "The Stonecore"
},
id322 = {
source = "Siamat",
drop_rate = "0.0",
name = "Hammer of Sparks",
category_territory = "Dungeon",
territory = "Horde",
id = "322",
expansion = "Cataclysm",
location = "Lost City of the Tol'vir"
},
id323 = {
source = "Erudax",
drop_rate = "0.0",
name = "Mace of Transformed Bone",
category_territory = "Dungeon",
territory = "Horde",
id = "323",
expansion = "Cataclysm",
location = "Grim Batol"
},
id324 = {
source = "Corborus",
drop_rate = "0.0",
name = "Crackling Geode Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "324",
expansion = "Cataclysm",
location = "The Stonecore"
},
id325 = {
source = "Siamat",
drop_rate = "0.0",
name = "Sceptre of Swirling Winds",
category_territory = "Dungeon",
territory = "Horde",
id = "325",
expansion = "Cataclysm",
location = "Lost City of the Tol'vir"
},
id326 = {
source = "Echo of Jaina",
drop_rate = "0.0",
name = "Dragonshrine Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "326",
expansion = "Cataclysm",
location = "End Time"
},
id327 = {
source = "Corborus",
drop_rate = "0.0",
name = "Crackling Geode Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "327",
expansion = "Cataclysm",
location = "The Stonecore"
},
id328 = {
source = "Siamat",
drop_rate = "0.0",
name = "Sceptre of Swirling Winds",
category_territory = "Dungeon",
territory = "Horde",
id = "328",
expansion = "Cataclysm",
location = "Lost City of the Tol'vir"
},
id329 = {
source = "Isiset",
drop_rate = "0.0",
name = "Scepter of Stargazing",
category_territory = "Dungeon",
territory = "Horde",
id = "329",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id330 = {
source = "Crafter Kwon",
drop_rate = "Unknown",
name = "Faded Forest Scepter",
category_territory = "",
territory = "Horde",
id = "330",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id331 = {
source = "Crafter Kwon",
drop_rate = "Unknown",
name = "Faded Forest Smasher",
category_territory = "",
territory = "Horde",
id = "331",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id332 = {
source = "Crafter Kwon",
drop_rate = "Unknown",
name = "Faded Forest Mace",
category_territory = "",
territory = "Horde",
id = "332",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id333 = {
source = "Orchard Wasp",
drop_rate = "0.0",
name = "Polished Mace",
category_territory = "",
territory = "Horde",
id = "333",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id334 = {
source = "Hozen Ravager",
drop_rate = "0.0",
name = "Intricate Scepter",
category_territory = "",
territory = "Horde",
id = "334",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id335 = {
source = "Slingtail Stickypaw",
drop_rate = "0.0",
name = "Bronzed Mace",
category_territory = "",
territory = "Horde",
id = "335",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id336 = {
source = "Stoneskin Basilisk",
drop_rate = "0.0",
name = "Gemmed Scepter",
category_territory = "",
territory = "Horde",
id = "336",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id337 = {
source = "Paint it Red!",
drop_rate = "quest",
name = "Land Claimer's Cudgel",
category_territory = "",
territory = "Horde",
id = "337",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id338 = {
source = "Paint it Red!",
drop_rate = "quest",
name = "Stormcaller's Warclub",
category_territory = "",
territory = "Horde",
id = "338",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id339 = {
source = "Regroup!",
drop_rate = "quest",
name = "Hozen-Thunking Mace",
category_territory = "",
territory = "Horde",
id = "339",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id340 = {
source = "Unleash Hell",
drop_rate = "quest",
name = "Barricade-Breaker Cudgel",
category_territory = "",
territory = "Horde",
id = "340",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id341 = {
source = "Unleash Hell",
drop_rate = "quest",
name = "Mystic Perpetual Motion Mace",
category_territory = "",
territory = "Horde",
id = "341",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id342 = {
source = "Unleash Hell",
drop_rate = "quest",
name = "Skyfire Trooper's Mace",
category_territory = "",
territory = "Horde",
id = "342",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id343 = {
source = "Total War",
drop_rate = "quest",
name = "Keg Smasher",
category_territory = "",
territory = "Horde",
id = "343",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id344 = {
source = "Fight Like a Wildhammer",
drop_rate = "quest",
name = "Barrel Opener",
category_territory = "",
territory = "Horde",
id = "344",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id345 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Lifeforce Hammer",
category_territory = "",
territory = "",
id = "345",
expansion = "Legion",
location = "Dalaran"
},
id346 = {
source = "Stonecore Warbringer",
drop_rate = "0.0",
name = "Heavy Geode Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "346",
expansion = "Cataclysm",
location = "The Stonecore"
},
id347 = {
source = "Defias Blood Wizard",
drop_rate = "0.0",
name = "Blackwolf Scepter",
category_territory = "Dungeon",
territory = "War Zone",
id = "347",
expansion = "",
location = "The Deadmines"
},
id348 = {
source = "Oaf Lackey",
drop_rate = "0.0",
name = "Irontree Mace",
category_territory = "Dungeon",
territory = "War Zone",
id = "348",
expansion = "",
location = "The Deadmines"
},
id349 = {
source = "The Curse of the Tombs",
drop_rate = "quest",
name = "Tombbreaker Mace",
category_territory = "",
territory = "Horde",
id = "349",
expansion = "Cataclysm",
location = "Uldum"
},
id350 = {
source = "The Curse of the Tombs",
drop_rate = "quest",
name = "Tombbreaker Gavel",
category_territory = "",
territory = "Horde",
id = "350",
expansion = "Cataclysm",
location = "Uldum"
},
id351 = {
source = "Romogg Bonecrusher",
drop_rate = "0.0",
name = "Torturer's Mercy",
category_territory = "Dungeon",
territory = "Horde",
id = "351",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id352 = {
source = "Twilight Subjugator",
drop_rate = "0.0",
name = "Death Pyre Mace",
category_territory = "",
territory = "Horde",
id = "352",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id353 = {
source = "Trogg Dweller",
drop_rate = "0.0",
name = "Nethander Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "353",
expansion = "Cataclysm",
location = "Grim Batol"
},
id354 = {
source = "Twilight Soulreaper",
drop_rate = "0.0",
name = "Mereldar Scepter",
category_territory = "",
territory = "Horde",
id = "354",
expansion = "Cataclysm",
location = "Deepholm"
},
id355 = {
source = "Twilight Elementalist",
drop_rate = "0.0",
name = "Thondroril Scepter",
category_territory = "Raid",
territory = "Horde",
id = "355",
expansion = "Cataclysm",
location = "The Bastion of Twilight"
},
id356 = {
source = "Stonecore Warbringer",
drop_rate = "0.0",
name = "Splinterspear Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "356",
expansion = "Cataclysm",
location = "The Stonecore"
},
id357 = {
source = "Servant of Therazane",
drop_rate = "0.0",
name = "Mardenholde Mace",
category_territory = "",
territory = "Horde",
id = "357",
expansion = "Cataclysm",
location = "Deepholm"
},
id358 = {
source = "Minister of Air",
drop_rate = "0.0",
name = "Bladefist Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "358",
expansion = "Cataclysm",
location = "The Vortex Pinnacle"
},
id359 = {
source = "Stonecore Warbringer",
drop_rate = "0.0",
name = "Mirkfallon Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "359",
expansion = "Cataclysm",
location = "The Stonecore"
},
id360 = {
source = "Stonecore Warbringer",
drop_rate = "0.0",
name = "Nethergarde Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "360",
expansion = "Cataclysm",
location = "The Stonecore"
},
id361 = {
source = "Sealing the Way",
drop_rate = "quest",
name = "Geomancer's Mace",
category_territory = "",
territory = "Horde",
id = "361",
expansion = "Cataclysm",
location = "Deepholm"
},
id362 = {
source = "Rotface",
drop_rate = "0.0",
name = "Trauma",
category_territory = "Raid",
territory = "Horde",
id = "362",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id363 = {
source = "Professor Putricide",
drop_rate = "0.0",
name = "Last Word",
category_territory = "Raid",
territory = "Horde",
id = "363",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id364 = {
source = "The Lich King",
drop_rate = "0.0",
name = "Royal Scepter of Terenas II",
category_territory = "Raid",
territory = "Horde",
id = "364",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id365 = {
source = "The Lich King",
drop_rate = "0.0",
name = "Mithrios, Bronzebeard's Legacy",
category_territory = "Raid",
territory = "Horde",
id = "365",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id366 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Swamplight Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "366",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id367 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Sishir Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "367",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id368 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Steelspark Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "368",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id369 = {
source = "Lycanthoth Vandal",
drop_rate = "0.0",
name = "Angerfang Mace",
category_territory = "",
territory = "Horde",
id = "369",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id370 = {
source = "The Lich King",
drop_rate = "0.0",
name = "Mithrios, Bronzebeard's Legacy",
category_territory = "Raid",
territory = "Horde",
id = "370",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id371 = {
source = "The Lich King",
drop_rate = "0.0",
name = "Royal Scepter of Terenas II",
category_territory = "Raid",
territory = "Horde",
id = "371",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id372 = {
source = "The Lich King",
drop_rate = "0.0",
name = "Valius, Gavel of the Lightbringer",
category_territory = "Raid",
territory = "Horde",
id = "372",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id373 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Moonbrook Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "373",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id374 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Razorwind Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "374",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id375 = {
source = "The Return of Baron Geddon",
drop_rate = "quest",
name = "Druidic Channeler's Mace",
category_territory = "",
territory = "Horde",
id = "375",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id376 = {
source = "Free Your Mind, the Rest Follows",
drop_rate = "quest",
name = "Crusher of Bonds",
category_territory = "",
territory = "Horde",
id = "376",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id377 = {
source = "Crafty Crabs",
drop_rate = "quest",
name = "Pocket-Sized Mace",
category_territory = "",
territory = "Horde",
id = "377",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id378 = {
source = "Odor Coater",
drop_rate = "quest",
name = "Prototype Chemical Applicator",
category_territory = "",
territory = "Horde",
id = "378",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id379 = {
source = "Totem Modification",
drop_rate = "quest",
name = "Sambino's Old Hammer",
category_territory = "",
territory = "Horde",
id = "379",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id380 = {
source = "Keristrasza",
drop_rate = "0.0",
name = "War Mace of Unrequited Love",
category_territory = "Dungeon",
territory = "Horde",
id = "380",
expansion = "Wrath Of The Lich King",
location = "The Nexus"
},
id381 = {
source = "Gluth",
drop_rate = "0.0",
name = "Maexxna's Femur",
category_territory = "Raid",
territory = "Horde",
id = "381",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id382 = {
source = "Gluth",
drop_rate = "0.0",
name = "Infection Repulser",
category_territory = "Raid",
territory = "Horde",
id = "382",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id383 = {
source = "KelThuzad",
drop_rate = "0.0",
name = "Hammer of the Astral Plane",
category_territory = "Raid",
territory = "Horde",
id = "383",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id384 = {
source = "Gluth",
drop_rate = "0.0",
name = "Angry Dread",
category_territory = "Raid",
territory = "Horde",
id = "384",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id385 = {
source = "Gluth",
drop_rate = "0.0",
name = "The Impossible Dream",
category_territory = "Raid",
territory = "Horde",
id = "385",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id386 = {
source = "Gluth",
drop_rate = "0.0",
name = "Split Greathammer",
category_territory = "Raid",
territory = "Horde",
id = "386",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id387 = {
source = "KelThuzad",
drop_rate = "0.0",
name = "Torch of Holy Fire",
category_territory = "Raid",
territory = "Horde",
id = "387",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id388 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Titansteel Bonecrusher",
category_territory = "",
territory = "",
id = "388",
expansion = "Legion",
location = "Dalaran"
},
id389 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Titansteel Guardian",
category_territory = "",
territory = "",
id = "389",
expansion = "Legion",
location = "Dalaran"
},
id390 = {
source = "Herwin Steampop",
drop_rate = "Unknown",
name = "Deadly Gladiator's Pummeler",
category_territory = "",
territory = "",
id = "390",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id391 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Pummeler",
category_territory = "",
territory = "",
id = "391",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id392 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Pummeler",
category_territory = "",
territory = "",
id = "392",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id393 = {
source = "Herwin Steampop",
drop_rate = "Unknown",
name = "Deadly Gladiator's Bonecracker",
category_territory = "",
territory = "",
id = "393",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id394 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Bonecracker",
category_territory = "",
territory = "",
id = "394",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id395 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Bonecracker",
category_territory = "",
territory = "",
id = "395",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id396 = {
source = "Herwin Steampop",
drop_rate = "Unknown",
name = "Deadly Gladiator's Gavel",
category_territory = "",
territory = "",
id = "396",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id397 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Gavel",
category_territory = "",
territory = "",
id = "397",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id398 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Gavel",
category_territory = "",
territory = "",
id = "398",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id399 = {
source = "Irisee",
drop_rate = "Unknown",
name = "Ironforge Smasher",
category_territory = "",
territory = "Horde",
id = "399",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id400 = {
source = "Razorscale",
drop_rate = "0.0",
name = "Guiding Star",
category_territory = "Raid",
territory = "Horde",
id = "400",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id401 = {
source = "Trellis Morningsun",
drop_rate = "Unknown",
name = "Grimhorn Crusher",
category_territory = "",
territory = "Horde",
id = "401",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id402 = {
source = "Auriaya",
drop_rate = "0.0",
name = "Stonerender",
category_territory = "Raid",
territory = "Horde",
id = "402",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id403 = {
source = "XT-002 Deconstructor",
drop_rate = "0.0",
name = "Sorthalis, Hammer of the Watchers",
category_territory = "Raid",
territory = "Horde",
id = "403",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id404 = {
source = "General Vezax",
drop_rate = "0.0",
name = "Aesuga, Hand of the Ardent Champion",
category_territory = "Raid",
territory = "Horde",
id = "404",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id405 = {
source = "Yogg-Saron",
drop_rate = "0.0",
name = "Caress of Insanity",
category_territory = "Raid",
territory = "Horde",
id = "405",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id406 = {
source = "Storm Tempered Keeper",
drop_rate = "0.0",
name = "Bloodcrush Cudgel",
category_territory = "Raid",
territory = "Horde",
id = "406",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id407 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Misery's End",
category_territory = "Raid",
territory = "Horde",
id = "407",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id408 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Misery's End",
category_territory = "Raid",
territory = "Horde",
id = "408",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id409 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Suffering's End",
category_territory = "Raid",
territory = "Horde",
id = "409",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id410 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Suffering's End",
category_territory = "Raid",
territory = "Horde",
id = "410",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id411 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Argent Resolve",
category_territory = "Raid",
territory = "Horde",
id = "411",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id412 = {
source = "Anubarak",
drop_rate = "0.0",
name = "The Grinder",
category_territory = "Raid",
territory = "Horde",
id = "412",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id413 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Mace of the Earthborn Chieftain",
category_territory = "Raid",
territory = "Horde",
id = "413",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id414 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Blackhorn Bludgeon",
category_territory = "Raid",
territory = "Horde",
id = "414",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id415 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Argent Resolve",
category_territory = "Raid",
territory = "Horde",
id = "415",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id416 = {
source = "Anubarak",
drop_rate = "0.0",
name = "The Grinder",
category_territory = "Raid",
territory = "Horde",
id = "416",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id417 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Mace of the Earthborn Chieftain",
category_territory = "Raid",
territory = "Horde",
id = "417",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id418 = {
source = "Anubarak",
drop_rate = "0.0",
name = "Blackhorn Bludgeon",
category_territory = "Raid",
territory = "Horde",
id = "418",
expansion = "Wrath Of The Lich King",
location = "Crusaders' Coliseum: Trial of the Crusader"
},
id419 = {
source = "Bronjahm",
drop_rate = "0.0",
name = "Lucky Old Sun",
category_territory = "Dungeon",
territory = "Horde",
id = "419",
expansion = "Wrath Of The Lich King",
location = "The Forge of Souls"
},
id420 = {
source = "Rotface",
drop_rate = "0.0",
name = "Trauma",
category_territory = "Raid",
territory = "Horde",
id = "420",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id421 = {
source = "A Victory For The Silver Covenant",
drop_rate = "quest",
name = "Cudgel of Furious Justice",
category_territory = "",
territory = "Horde",
id = "421",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id422 = {
source = "A Victory For The Silver Covenant",
drop_rate = "quest",
name = "Hammer of Purified Flame",
category_territory = "",
territory = "Horde",
id = "422",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id423 = {
source = "Professor Putricide",
drop_rate = "0.0",
name = "Last Word",
category_territory = "Raid",
territory = "Horde",
id = "423",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id424 = {
source = "Lord Marrowgar",
drop_rate = "0.0",
name = "Bonebreaker Scepter",
category_territory = "Raid",
territory = "Horde",
id = "424",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id425 = {
source = "Festergut",
drop_rate = "0.0",
name = "Gutbuster",
category_territory = "Raid",
territory = "Horde",
id = "425",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id426 = {
source = "Rotface",
drop_rate = "0.0",
name = "Lockjaw",
category_territory = "Raid",
territory = "Horde",
id = "426",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id427 = {
source = "Xazi Smolderpipe",
drop_rate = "Unknown",
name = "Wrathful Gladiator's Bonecracker",
category_territory = "",
territory = "",
id = "427",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id428 = {
source = "Xazi Smolderpipe",
drop_rate = "Unknown",
name = "Wrathful Gladiator's Gavel",
category_territory = "",
territory = "",
id = "428",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id429 = {
source = "Xazi Smolderpipe",
drop_rate = "Unknown",
name = "Wrathful Gladiator's Pummeler",
category_territory = "",
territory = "",
id = "429",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id430 = {
source = "The Lich King",
drop_rate = "0.0",
name = "Valius, Gavel of the Lightbringer",
category_territory = "Raid",
territory = "Horde",
id = "430",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id431 = {
source = "Rotface",
drop_rate = "0.0",
name = "Lockjaw",
category_territory = "Raid",
territory = "Horde",
id = "431",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id432 = {
source = "Festergut",
drop_rate = "0.0",
name = "Gutbuster",
category_territory = "Raid",
territory = "Horde",
id = "432",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id433 = {
source = "Lord Marrowgar",
drop_rate = "0.0",
name = "Bonebreaker Scepter",
category_territory = "Raid",
territory = "Horde",
id = "433",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id434 = {
source = "Razorscale",
drop_rate = "Unknown",
name = "Guiding Star",
category_territory = "Raid",
territory = "Horde",
id = "434",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id435 = {
source = "Auriaya",
drop_rate = "Unknown",
name = "Stonerender",
category_territory = "Raid",
territory = "Horde",
id = "435",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id436 = {
source = "XT-002 Deconstructor",
drop_rate = "Unknown",
name = "Sorthalis, Hammer of the Watchers",
category_territory = "Raid",
territory = "Horde",
id = "436",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id437 = {
source = "General Vezax",
drop_rate = "Unknown",
name = "Aesuga, Hand of the Ardent Champion",
category_territory = "Raid",
territory = "Horde",
id = "437",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id438 = {
source = "Yogg-Saron",
drop_rate = "Unknown",
name = "Caress of Insanity",
category_territory = "Raid",
territory = "Horde",
id = "438",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id439 = {
source = "Moorabi",
drop_rate = "0.0",
name = "Frozen Scepter of Necromancy",
category_territory = "Dungeon",
territory = "Horde",
id = "439",
expansion = "Wrath Of The Lich King",
location = "Gundrak"
},
id440 = {
source = "MalGanis",
drop_rate = "Unknown",
name = "Beguiling Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "440",
expansion = "Wrath Of The Lich King",
location = "The Culling of Stratholme"
},
id441 = {
source = "Salramm the Fleshcrafter",
drop_rate = "0.0",
name = "Gavel of the Fleshcrafter",
category_territory = "Dungeon",
territory = "Horde",
id = "441",
expansion = "Wrath Of The Lich King",
location = "The Culling of Stratholme"
},
id442 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Furious Saronite Beatstick",
category_territory = "",
territory = "",
id = "442",
expansion = "Legion",
location = "Dalaran"
},
id443 = {
source = "The Champion of Anguish",
drop_rate = "quest",
name = "Screw-Sprung Fixer-Upper",
category_territory = "",
territory = "Horde",
id = "443",
expansion = "Wrath Of The Lich King",
location = "Zul'Drak"
},
id444 = {
source = "The Champion of Anguish",
drop_rate = "quest",
name = "Crimson Cranium Crusher",
category_territory = "",
territory = "Horde",
id = "444",
expansion = "Wrath Of The Lich King",
location = "Zul'Drak"
},
id445 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Cudgel of Saronite Justice",
category_territory = "",
territory = "",
id = "445",
expansion = "Legion",
location = "Dalaran"
},
id446 = {
source = "Erekem",
drop_rate = "0.0",
name = "Stormstrike Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "446",
expansion = "Wrath Of The Lich King",
location = "The Violet Hold"
},
id447 = {
source = "Sairuk",
drop_rate = "Unknown",
name = "Totemic Purification Rod",
category_territory = "",
territory = "Horde",
id = "447",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id448 = {
source = "Cielstrasza",
drop_rate = "Unknown",
name = "Gavel of the Brewing Storm",
category_territory = "",
territory = "Horde",
id = "448",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id449 = {
source = "WANTED: Ragemanes Flipper",
drop_rate = "quest",
name = "Hammer of Quiet Mourning",
category_territory = "",
territory = "Horde",
id = "449",
expansion = "Wrath Of The Lich King",
location = "Zul'Drak"
},
id450 = {
source = "Moorabi",
drop_rate = "0.0",
name = "Frozen Scepter of Necromancy",
category_territory = "Dungeon",
territory = "Horde",
id = "450",
expansion = "Wrath Of The Lich King",
location = "Gundrak"
},
id451 = {
source = "Keristrasza",
drop_rate = "0.0",
name = "War Mace of Unrequited Love",
category_territory = "Dungeon",
territory = "Horde",
id = "451",
expansion = "Wrath Of The Lich King",
location = "The Nexus"
},
id452 = {
source = "Deathcharger Steed",
drop_rate = "0.0",
name = "Frigid War-Mace",
category_territory = "Raid",
territory = "Horde",
id = "452",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id453 = {
source = "Darkfallen Archmage",
drop_rate = "0.0",
name = "Gargoyle's Mace",
category_territory = "Raid",
territory = "Horde",
id = "453",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id454 = {
source = "Dark Rune Giant",
drop_rate = "0.0",
name = "Dogmatic Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "454",
expansion = "Wrath Of The Lich King",
location = "Halls of Stone"
},
id455 = {
source = "Stormfury Revenant",
drop_rate = "0.0",
name = "Graced Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "455",
expansion = "Wrath Of The Lich King",
location = "Halls of Lightning"
},
id456 = {
source = "Iris Moondreamer",
drop_rate = "Unknown",
name = "Zealous Scepter",
category_territory = "",
territory = "Horde",
id = "456",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id457 = {
source = "Iris Moondreamer",
drop_rate = "Unknown",
name = "Stormbinder Mace",
category_territory = "",
territory = "Horde",
id = "457",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id458 = {
source = "Iris Moondreamer",
drop_rate = "Unknown",
name = "Stormbinder Scepter",
category_territory = "",
territory = "Horde",
id = "458",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id459 = {
source = "Iris Moondreamer",
drop_rate = "Unknown",
name = "Stormbinder Gavel",
category_territory = "",
territory = "Horde",
id = "459",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id460 = {
source = "Tirions Gambit",
drop_rate = "quest",
name = "Hammer of Wrenching Change",
category_territory = "",
territory = "Horde",
id = "460",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id461 = {
source = "Horde Ranger",
drop_rate = "0.0",
name = "Nerubian Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "461",
expansion = "Wrath Of The Lich King",
location = "The Nexus"
},
id462 = {
source = "Stormpeak Hatchling",
drop_rate = "0.0",
name = "Beatific Mace",
category_territory = "",
territory = "Horde",
id = "462",
expansion = "Wrath Of The Lich King",
location = "The Storm Peaks"
},
id463 = {
source = "Retest Now",
drop_rate = "quest",
name = "Writhing Mace",
category_territory = "",
territory = "Horde",
id = "463",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id464 = {
source = "Retest Now",
drop_rate = "quest",
name = "Twisted Hooligan Whacker",
category_territory = "",
territory = "Horde",
id = "464",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id465 = {
source = "Norgannons Shell",
drop_rate = "quest",
name = "Maker's Touch",
category_territory = "",
territory = "Horde",
id = "465",
expansion = "Wrath Of The Lich King",
location = "The Storm Peaks"
},
id466 = {
source = "Demolitionist Extraordinaire",
drop_rate = "quest",
name = "Ricket's Beatstick",
category_territory = "",
territory = "Horde",
id = "466",
expansion = "Wrath Of The Lich King",
location = "The Storm Peaks"
},
id467 = {
source = "Taking on All Challengers",
drop_rate = "quest",
name = "Hyldnir Headcracker",
category_territory = "",
territory = "Horde",
id = "467",
expansion = "Wrath Of The Lich King",
location = "The Storm Peaks"
},
id468 = {
source = "Time to Hide",
drop_rate = "quest",
name = "Blunt Brainwasher",
category_territory = "",
territory = "Horde",
id = "468",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id469 = {
source = "Time to Hide",
drop_rate = "quest",
name = "Mace of the Final Command",
category_territory = "",
territory = "Horde",
id = "469",
expansion = "Wrath Of The Lich King",
location = "Icecrown"
},
id470 = {
source = "Novos the Summoner",
drop_rate = "0.0",
name = "Summoner's Stone Gavel",
category_territory = "Dungeon",
territory = "Horde",
id = "470",
expansion = "Wrath Of The Lich King",
location = "Drak'Tharon Keep"
},
id471 = {
source = "Krystallus",
drop_rate = "0.0",
name = "Adamant Mallet",
category_territory = "Dungeon",
territory = "Horde",
id = "471",
expansion = "Wrath Of The Lich King",
location = "Halls of Stone"
},
id472 = {
source = "Kvaldir Reaver",
drop_rate = "0.0",
name = "Serene Hammer",
category_territory = "",
territory = "Horde",
id = "472",
expansion = "Wrath Of The Lich King",
location = "Hrothgar's Landing"
},
id473 = {
source = "Kiljaeden",
drop_rate = "0.0",
name = "Hammer of Sanctification",
category_territory = "Raid",
territory = "Horde",
id = "473",
expansion = "The Burning Crusade",
location = "Sunwell Plateau"
},
id474 = {
source = "Anubar Prime Guard",
drop_rate = "0.0",
name = "Unknown Archaeologist's Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "474",
expansion = "Wrath Of The Lich King",
location = "Azjol-Nerub"
},
id475 = {
source = "Sebastian Crane",
drop_rate = "Unknown",
name = "Warsong Punisher",
category_territory = "",
territory = "Horde",
id = "475",
expansion = "Wrath Of The Lich King",
location = "Howling Fjord"
},
id476 = {
source = "Logistics Officer Brighton",
drop_rate = "Unknown",
name = "Hammer of the Alliance Vanguard",
category_territory = "",
territory = "Horde",
id = "476",
expansion = "Wrath Of The Lich King",
location = "Howling Fjord"
},
id477 = {
source = "Lightning Construct",
drop_rate = "0.0",
name = "Brass-Bound Cudgel",
category_territory = "Dungeon",
territory = "Horde",
id = "477",
expansion = "Wrath Of The Lich King",
location = "Halls of Stone"
},
id478 = {
source = "Hardened Steel Reaver",
drop_rate = "0.0",
name = "Remedial Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "478",
expansion = "Wrath Of The Lich King",
location = "Halls of Lightning"
},
id479 = {
source = "Dark Rune Theurgist",
drop_rate = "0.0",
name = "Dragonjaw Mauler",
category_territory = "Dungeon",
territory = "Horde",
id = "479",
expansion = "Wrath Of The Lich King",
location = "Halls of Stone"
},
id480 = {
source = "JinAlai Warrior",
drop_rate = "0.0",
name = "Ferrous Hammer",
category_territory = "",
territory = "Horde",
id = "480",
expansion = "Wrath Of The Lich King",
location = "Zul'Drak"
},
id481 = {
source = "Unyielding Constrictor",
drop_rate = "0.0",
name = "Dignified Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "481",
expansion = "Wrath Of The Lich King",
location = "Gundrak"
},
id482 = {
source = "Spitting Cobra",
drop_rate = "0.0",
name = "Barbed Star",
category_territory = "Dungeon",
territory = "Horde",
id = "482",
expansion = "Wrath Of The Lich King",
location = "Gundrak"
},
id483 = {
source = "Spitting Cobra",
drop_rate = "0.0",
name = "Unearthly Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "483",
expansion = "Wrath Of The Lich King",
location = "Gundrak"
},
id484 = {
source = "A Tangled Skein",
drop_rate = "quest",
name = "Dutybound Mace of Purity",
category_territory = "",
territory = "Horde",
id = "484",
expansion = "Wrath Of The Lich King",
location = "Zul'Drak"
},
id485 = {
source = "Brutallus",
drop_rate = "0",
name = "Reign of Misery",
category_territory = "Raid",
territory = "Horde",
id = "485",
expansion = "The Burning Crusade",
location = "Sunwell Plateau"
},
id486 = {
source = "Lady Sacrolash",
drop_rate = "0.0",
name = "Archon's Gavel",
category_territory = "Raid",
territory = "Horde",
id = "486",
expansion = "The Burning Crusade",
location = "Sunwell Plateau"
},
id487 = {
source = "Blaze Magmaburn",
drop_rate = "Unknown",
name = "Brutal Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "487",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id488 = {
source = "Blaze Magmaburn",
drop_rate = "Unknown",
name = "Brutal Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "488",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id489 = {
source = "Blaze Magmaburn",
drop_rate = "Unknown",
name = "Brutal Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "489",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id490 = {
source = "Blaze Magmaburn",
drop_rate = "Unknown",
name = "Brutal Gladiator's Salvation",
category_territory = "",
territory = "Horde",
id = "490",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id491 = {
source = "Deranged Indule Villager",
drop_rate = "0.0",
name = "Melia's Magnificent Scepter",
category_territory = "",
territory = "Horde",
id = "491",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id492 = {
source = "Risen Drakkari Warrior",
drop_rate = "0.0",
name = "Furbolg Truncheon",
category_territory = "Dungeon",
territory = "Horde",
id = "492",
expansion = "Wrath Of The Lich King",
location = "Drak'Tharon Keep"
},
id493 = {
source = "Risen Drakkari Warrior",
drop_rate = "0.0",
name = "Refreshing Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "493",
expansion = "Wrath Of The Lich King",
location = "Drak'Tharon Keep"
},
id494 = {
source = "Filling the Cages",
drop_rate = "quest",
name = "Mace of Helotry",
category_territory = "",
territory = "Horde",
id = "494",
expansion = "Wrath Of The Lich King",
location = "Grizzly Hills"
},
id495 = {
source = "Illidan Stormrage",
drop_rate = "0.0",
name = "Crystal Spire of Karabor",
category_territory = "Raid",
territory = "Horde",
id = "495",
expansion = "The Burning Crusade",
location = "Black Temple"
},
id496 = {
source = "Illidan Stormrage",
drop_rate = "Unknown",
name = "Crystal Spire of Karabor",
category_territory = "Raid",
territory = "Horde",
id = "496",
expansion = "The Burning Crusade",
location = "Black Temple"
},
id497 = {
source = "Plundering Geist",
drop_rate = "0.0",
name = "Peaked Club",
category_territory = "Dungeon",
territory = "Horde",
id = "497",
expansion = "Wrath Of The Lich King",
location = "Ahn'kahet: The Old Kingdom"
},
id498 = {
source = "Plundering Geist",
drop_rate = "0.0",
name = "Sacrosanct Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "498",
expansion = "Wrath Of The Lich King",
location = "Ahn'kahet: The Old Kingdom"
},
id499 = {
source = "Kitzie Crankshot",
drop_rate = "Unknown",
name = "Vengeful Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "499",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id500 = {
source = "Kitzie Crankshot",
drop_rate = "Unknown",
name = "Vengeful Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "500",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id501 = {
source = "Kitzie Crankshot",
drop_rate = "Unknown",
name = "Vengeful Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "501",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id502 = {
source = "Kitzie Crankshot",
drop_rate = "Unknown",
name = "Vengeful Gladiator's Salvation",
category_territory = "",
territory = "Horde",
id = "502",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id503 = {
source = "Anwehu",
drop_rate = "Unknown",
name = "Gavel of Naaru Blessings",
category_territory = "",
territory = "",
id = "503",
expansion = "The Burning Crusade",
location = "Shattrath City"
},
id504 = {
source = "Cupri",
drop_rate = "Unknown",
name = "Gavel of Naaru Blessings",
category_territory = "",
territory = "",
id = "504",
expansion = "The Burning Crusade",
location = "Shattrath City"
},
id505 = {
source = "Conversing With the Depths",
drop_rate = "quest",
name = "Carved Dragonbone Mace",
category_territory = "",
territory = "Horde",
id = "505",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id506 = {
source = "The Forsaken Blight",
drop_rate = "quest",
name = "Mace of the Fallen Raven Priest",
category_territory = "",
territory = "Horde",
id = "506",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id507 = {
source = "The End of the Line",
drop_rate = "quest",
name = "Mace of the Violet Guardian",
category_territory = "",
territory = "Horde",
id = "507",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id508 = {
source = "Where the Wild Things Roam",
drop_rate = "quest",
name = "Spiked Coldwind Club",
category_territory = "",
territory = "Horde",
id = "508",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id509 = {
source = "Mystery of the Infinite",
drop_rate = "quest",
name = "Time-Bending Smasher",
category_territory = "",
territory = "Horde",
id = "509",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id510 = {
source = "The Forsaken Blight",
drop_rate = "quest",
name = "Stronghold Battlemace",
category_territory = "",
territory = "Horde",
id = "510",
expansion = "Wrath Of The Lich King",
location = "Dragonblight"
},
id511 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Cobalt Tenderizer",
category_territory = "",
territory = "",
id = "511",
expansion = "Legion",
location = "Dalaran"
},
id512 = {
source = "Kaelthas Sunstrider",
drop_rate = "0.0",
name = "Rod of the Sun King",
category_territory = "Raid",
territory = "Horde",
id = "512",
expansion = "The Burning Crusade",
location = "The Eye"
},
id513 = {
source = "Lady Vashj",
drop_rate = "0.0",
name = "Lightfathom Scepter",
category_territory = "Raid",
territory = "Horde",
id = "513",
expansion = "The Burning Crusade",
location = "Serpentshrine Cavern"
},
id514 = {
source = "Kazrogal",
drop_rate = "0.0",
name = "Hammer of Atonement",
category_territory = "Raid",
territory = "Horde",
id = "514",
expansion = "The Burning Crusade",
location = "Hyjal Summit"
},
id515 = {
source = "Supremus",
drop_rate = "0.0",
name = "Syphon of the Nathrezim",
category_territory = "Raid",
territory = "Horde",
id = "515",
expansion = "The Burning Crusade",
location = "Black Temple"
},
id516 = {
source = "Charming Courtesan",
drop_rate = "0.0",
name = "Swiftsteel Bludgeon",
category_territory = "Raid",
territory = "Horde",
id = "516",
expansion = "The Burning Crusade",
location = "Black Temple"
},
id517 = {
source = "Ghoul",
drop_rate = "0.0",
name = "Hammer of Judgment",
category_territory = "Raid",
territory = "Horde",
id = "517",
expansion = "The Burning Crusade",
location = "Hyjal Summit"
},
id518 = {
source = "Supremus",
drop_rate = "Unknown",
name = "Syphon of the Nathrezim",
category_territory = "Raid",
territory = "Horde",
id = "518",
expansion = "The Burning Crusade",
location = "Black Temple"
},
id519 = {
source = "Plundering Geist",
drop_rate = "0.0",
name = "Tuskarr Cudgel",
category_territory = "Dungeon",
territory = "Horde",
id = "519",
expansion = "Wrath Of The Lich King",
location = "Ahn'kahet: The Old Kingdom"
},
id520 = {
source = "Dalronn the Controller",
drop_rate = "0.0",
name = "Harmonious Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "520",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id521 = {
source = "Landing the Killing Blow",
drop_rate = "quest",
name = "Pacifying Pummeler",
category_territory = "",
territory = "Horde",
id = "521",
expansion = "Wrath Of The Lich King",
location = "Howling Fjord"
},
id522 = {
source = "Dragonflayer Metalworker",
drop_rate = "0.0",
name = "Iron Flanged Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "522",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id523 = {
source = "Dragonflayer Runecaster",
drop_rate = "0.0",
name = "Placid Lightmace",
category_territory = "Dungeon",
territory = "Horde",
id = "523",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id524 = {
source = "Cutting Off the Source",
drop_rate = "quest",
name = "Soldier's Spiked Mace",
category_territory = "",
territory = "Horde",
id = "524",
expansion = "Wrath Of The Lich King",
location = "Borean Tundra"
},
id525 = {
source = "Cutting Off the Source",
drop_rate = "quest",
name = "Medic's Morning Star",
category_territory = "",
territory = "Horde",
id = "525",
expansion = "Wrath Of The Lich King",
location = "Borean Tundra"
},
id526 = {
source = "Escape from the Winterfin Caverns",
drop_rate = "quest",
name = "Scepter of the Winterfin",
category_territory = "",
territory = "Horde",
id = "526",
expansion = "Wrath Of The Lich King",
location = "Borean Tundra"
},
id527 = {
source = "Defeat the Gearmaster",
drop_rate = "quest",
name = "Fireborn Warhammer",
category_territory = "",
territory = "Horde",
id = "527",
expansion = "Wrath Of The Lich King",
location = "Borean Tundra"
},
id528 = {
source = "Kezzik the Striker",
drop_rate = "Unknown",
name = "Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "528",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id529 = {
source = "Kezzik the Striker",
drop_rate = "Unknown",
name = "Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "529",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id530 = {
source = "Maiden of Virtue",
drop_rate = "0",
name = "Shard of the Virtuous",
category_territory = "Raid",
territory = "Horde",
id = "530",
expansion = "The Burning Crusade",
location = "Karazhan"
},
id531 = {
source = "Terestian Illhoof",
drop_rate = "0",
name = "Fool's Bane",
category_territory = "Raid",
territory = "Horde",
id = "531",
expansion = "The Burning Crusade",
location = "Karazhan"
},
id532 = {
source = "Prince Malchezaar",
drop_rate = "0",
name = "Light's Justice",
category_territory = "Raid",
territory = "Horde",
id = "532",
expansion = "The Burning Crusade",
location = "Karazhan"
},
id533 = {
source = "The Lurker Below",
drop_rate = "0",
name = "Mallet of the Tides",
category_territory = "Raid",
territory = "Horde",
id = "533",
expansion = "The Burning Crusade",
location = "Serpentshrine Cavern"
},
id534 = {
source = "Izzee the Clutch",
drop_rate = "Unknown",
name = "Merciless Gladiator's Bonecracker",
category_territory = "",
territory = "Horde",
id = "534",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id535 = {
source = "Izzee the Clutch",
drop_rate = "Unknown",
name = "Merciless Gladiator's Pummeler",
category_territory = "",
territory = "Horde",
id = "535",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id536 = {
source = "Kezzik the Striker",
drop_rate = "Unknown",
name = "Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "536",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id537 = {
source = "Kezzik the Striker",
drop_rate = "Unknown",
name = "Gladiator's Salvation",
category_territory = "",
territory = "Horde",
id = "537",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id538 = {
source = "Izzee the Clutch",
drop_rate = "Unknown",
name = "Merciless Gladiator's Gavel",
category_territory = "",
territory = "Horde",
id = "538",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id539 = {
source = "Izzee the Clutch",
drop_rate = "Unknown",
name = "Merciless Gladiator's Salvation",
category_territory = "",
territory = "Horde",
id = "539",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id540 = {
source = "Kaelthas Sunstrider",
drop_rate = "0.0",
name = "Cudgel of Consecration",
category_territory = "Dungeon",
territory = "Horde",
id = "540",
expansion = "The Burning Crusade",
location = "Magisters' Terrace"
},
id541 = {
source = "Omor the Unscarred",
drop_rate = "0.0",
name = "Truncheon of Five Hells",
category_territory = "Dungeon",
territory = "Horde",
id = "541",
expansion = "The Burning Crusade",
location = "Hellfire Ramparts"
},
id542 = {
source = "Warchief Kargath Bladefist",
drop_rate = "0.0",
name = "Lightsworn Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "542",
expansion = "The Burning Crusade",
location = "The Shattered Halls"
},
id543 = {
source = "Quagmirran",
drop_rate = "0.0",
name = "Bleeding Hollow Warhammer",
category_territory = "Dungeon",
territory = "Horde",
id = "543",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id544 = {
source = "Avatar of the Martyred",
drop_rate = "0.0",
name = "Will of the Fallen Exarch",
category_territory = "Dungeon",
territory = "Horde",
id = "544",
expansion = "The Burning Crusade",
location = "Auchenai Crypts"
},
id545 = {
source = "Avatar of the Martyred",
drop_rate = "0.0",
name = "Sky Breaker",
category_territory = "Dungeon",
territory = "Horde",
id = "545",
expansion = "The Burning Crusade",
location = "Auchenai Crypts"
},
id546 = {
source = "Talon King Ikiss",
drop_rate = "0.0",
name = "Terokk's Nightmace",
category_territory = "Dungeon",
territory = "Horde",
id = "546",
expansion = "The Burning Crusade",
location = "Sethekk Halls"
},
id547 = {
source = "Lieutenant Drake",
drop_rate = "0.0",
name = "Bloodskull Destroyer",
category_territory = "Dungeon",
territory = "Horde",
id = "547",
expansion = "The Burning Crusade",
location = "Old Hillsbrad Foothills"
},
id548 = {
source = "Captain Skarloc",
drop_rate = "0.0",
name = "Dathrohan's Ceremonial Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "548",
expansion = "The Burning Crusade",
location = "Old Hillsbrad Foothills"
},
id549 = {
source = "Mechano-Lord Capacitus",
drop_rate = "0.0",
name = "Hammer of the Penitent",
category_territory = "Dungeon",
territory = "Horde",
id = "549",
expansion = "The Burning Crusade",
location = "The Mechanar"
},
id550 = {
source = "Coilfang Champion",
drop_rate = "0.0",
name = "The Essence Focuser",
category_territory = "Dungeon",
territory = "Horde",
id = "550",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id551 = {
source = "Terokk",
drop_rate = "0.0",
name = "Terokk's Gavel",
category_territory = "",
territory = "Horde",
id = "551",
expansion = "The Burning Crusade",
location = "Terokkar Forest"
},
id552 = {
source = "Terokk",
drop_rate = "0.0",
name = "Terokk's Gavel",
category_territory = "",
territory = "Horde",
id = "552",
expansion = "The Burning Crusade",
location = "Terokkar Forest"
},
id553 = {
source = "Eldara Dawnrunner",
drop_rate = "Unknown",
name = "Seeker's Gavel",
category_territory = "",
territory = "Horde",
id = "553",
expansion = "",
location = "Isle of Quel'Danas"
},
id554 = {
source = "Eldara Dawnrunner",
drop_rate = "Unknown",
name = "K'iru's Presage",
category_territory = "",
territory = "Horde",
id = "554",
expansion = "",
location = "Isle of Quel'Danas"
},
id555 = {
source = "Priestess Delrissa",
drop_rate = "0.0",
name = "Battle-Mace of the High Priestess",
category_territory = "Dungeon",
territory = "Horde",
id = "555",
expansion = "The Burning Crusade",
location = "Magisters' Terrace"
},
id556 = {
source = "Warchief Kargath Bladefist",
drop_rate = "0.0",
name = "Lightsworn Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "556",
expansion = "The Burning Crusade",
location = "The Shattered Halls"
},
id557 = {
source = "Quagmirran",
drop_rate = "0.0",
name = "Bleeding Hollow Warhammer",
category_territory = "Dungeon",
territory = "Horde",
id = "557",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id558 = {
source = "Priestess Delrissa",
drop_rate = "0.0",
name = "Battle-Mace of the High Priestess",
category_territory = "Dungeon",
territory = "Horde",
id = "558",
expansion = "The Burning Crusade",
location = "Magisters' Terrace"
},
id559 = {
source = "Kaelthas Sunstrider",
drop_rate = "0.0",
name = "Cudgel of Consecration",
category_territory = "Dungeon",
territory = "Horde",
id = "559",
expansion = "The Burning Crusade",
location = "Magisters' Terrace"
},
id560 = {
source = "Ethereal Scavenger",
drop_rate = "0.0",
name = "Anvilmar Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "560",
expansion = "The Burning Crusade",
location = "Mana-Tombs"
},
id561 = {
source = "Romulo",
drop_rate = "0.0",
name = "Knight's War Hammer",
category_territory = "Raid",
territory = "Horde",
id = "561",
expansion = "The Burning Crusade",
location = "Karazhan"
},
id562 = {
source = "Commander Sarannis",
drop_rate = "0.0",
name = "Lordly Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "562",
expansion = "The Burning Crusade",
location = "The Botanica"
},
id563 = {
source = "High King Maulgar",
drop_rate = "0.0",
name = "Ascendant's Scepter",
category_territory = "Raid",
territory = "Horde",
id = "563",
expansion = "The Burning Crusade",
location = "Gruul's Lair"
},
id564 = {
source = "Dragonflayer Metalworker",
drop_rate = "0.0",
name = "Stone-Headed Gavel",
category_territory = "Dungeon",
territory = "Horde",
id = "564",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id565 = {
source = "Dragonflayer Strategist",
drop_rate = "0.0",
name = "Conifer Club",
category_territory = "Dungeon",
territory = "Horde",
id = "565",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id566 = {
source = "Dragonflayer Metalworker",
drop_rate = "0.0",
name = "Enshrined Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "566",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id567 = {
source = "Dragonflayer Metalworker",
drop_rate = "0.0",
name = "Ambrosial Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "567",
expansion = "Wrath Of The Lich King",
location = "Utgarde Keep"
},
id568 = {
source = "Sethekk Talon Lord",
drop_rate = "0.0",
name = "Retro-Spike Club",
category_territory = "Dungeon",
territory = "Horde",
id = "568",
expansion = "The Burning Crusade",
location = "Sethekk Halls"
},
id569 = {
source = "Amanishi Handler",
drop_rate = "0.0",
name = "Divine Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "569",
expansion = "Cataclysm",
location = "Zul'Aman"
},
id570 = {
source = "Grandmaster Vorpil",
drop_rate = "0.0",
name = "Blackout Truncheon",
category_territory = "Dungeon",
territory = "Horde",
id = "570",
expansion = "The Burning Crusade",
location = "Shadow Labyrinth"
},
id571 = {
source = "Bogstrok",
drop_rate = "0.0",
name = "Footman Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "571",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id572 = {
source = "Sunseeker Harvester",
drop_rate = "0.0",
name = "Queen's Insignia",
category_territory = "Dungeon",
territory = "Horde",
id = "572",
expansion = "The Burning Crusade",
location = "The Botanica"
},
id573 = {
source = "Master Smith Rhonsus",
drop_rate = "quest",
name = "Master Smith's Hammer",
category_territory = "",
territory = "Horde",
id = "573",
expansion = "The Burning Crusade",
location = "Netherstorm"
},
id574 = {
source = "Shadowbeast",
drop_rate = "0.0",
name = "Boneshredder Mace",
category_territory = "Raid",
territory = "Horde",
id = "574",
expansion = "The Burning Crusade",
location = "Karazhan"
},
id575 = {
source = "Vile Fire-Soul",
drop_rate = "0.0",
name = "Tranquility Mace",
category_territory = "",
territory = "Horde",
id = "575",
expansion = "The Burning Crusade",
location = "Blade's Edge Mountains"
},
id576 = {
source = "Murmur",
drop_rate = "0.0",
name = "Shockwave Truncheon",
category_territory = "Dungeon",
territory = "Horde",
id = "576",
expansion = "The Burning Crusade",
location = "Shadow Labyrinth"
},
id577 = {
source = "Avian Ripper",
drop_rate = "0.0",
name = "Khorium Plated Bludgeon",
category_territory = "Dungeon",
territory = "Horde",
id = "577",
expansion = "The Burning Crusade",
location = "Sethekk Halls"
},
id578 = {
source = "Avian Ripper",
drop_rate = "0.0",
name = "Ancestral Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "578",
expansion = "The Burning Crusade",
location = "Sethekk Halls"
},
id579 = {
source = "The Ring of Blood: The Final Challenge",
drop_rate = "quest",
name = "Mogor's Anointing Club",
category_territory = "",
territory = "Horde",
id = "579",
expansion = "The Burning Crusade",
location = "Nagrand"
},
id580 = {
source = "Captain Skarloc",
drop_rate = "0.0",
name = "Northshire Battlemace",
category_territory = "Dungeon",
territory = "Horde",
id = "580",
expansion = "The Burning Crusade",
location = "Old Hillsbrad Foothills"
},
id581 = {
source = "Auchenai Soulpriest",
drop_rate = "0.0",
name = "Dreaded Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "581",
expansion = "The Burning Crusade",
location = "Auchenai Crypts"
},
id582 = {
source = "Nethermancer Sepethrea",
drop_rate = "0.0",
name = "Lesser Sledgemace",
category_territory = "Dungeon",
territory = "Horde",
id = "582",
expansion = "The Burning Crusade",
location = "The Mechanar"
},
id583 = {
source = "Almaador",
drop_rate = "Unknown",
name = "Gavel of Pure Light",
category_territory = "",
territory = "",
id = "583",
expansion = "The Burning Crusade",
location = "Shattrath City"
},
id584 = {
source = "Nakodu",
drop_rate = "Unknown",
name = "Gavel of Unearthed Secrets",
category_territory = "",
territory = "",
id = "584",
expansion = "The Burning Crusade",
location = "Shattrath City"
},
id585 = {
source = "Sunblade Dawn Priest",
drop_rate = "0.0",
name = "The Ancient Scepter of Sue-Min",
category_territory = "Raid",
territory = "Horde",
id = "585",
expansion = "The Burning Crusade",
location = "Sunwell Plateau"
},
id586 = {
source = "WANTED: Durn the Hungerer",
drop_rate = "quest",
name = "Hungering Bone Cudgel",
category_territory = "",
territory = "Horde",
id = "586",
expansion = "The Burning Crusade",
location = "Nagrand"
},
id587 = {
source = "Ethereal Darkcaster",
drop_rate = "0.0",
name = "Rockshard Club",
category_territory = "Dungeon",
territory = "Horde",
id = "587",
expansion = "The Burning Crusade",
location = "Mana-Tombs"
},
id588 = {
source = "Kilsorrow Deathsworn",
drop_rate = "0.0",
name = "Spirit-Clad Mace",
category_territory = "",
territory = "Horde",
id = "588",
expansion = "The Burning Crusade",
location = "Nagrand"
},
id589 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Fel Iron Hammer",
category_territory = "",
territory = "",
id = "589",
expansion = "Legion",
location = "Dalaran"
},
id590 = {
source = "Ethereal Crypt Raider",
drop_rate = "0.0",
name = "Silvermoon War-Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "590",
expansion = "The Burning Crusade",
location = "Mana-Tombs"
},
id591 = {
source = "Shattered Hand Captain",
drop_rate = "0.0",
name = "Restorative Mace",
category_territory = "",
territory = "Horde",
id = "591",
expansion = "The Burning Crusade",
location = "Hellfire Peninsula"
},
id592 = {
source = "Ethereal Priest",
drop_rate = "0.0",
name = "Battle Star",
category_territory = "Dungeon",
territory = "Horde",
id = "592",
expansion = "The Burning Crusade",
location = "Mana-Tombs"
},
id593 = {
source = "Ethereal Crypt Raider",
drop_rate = "0.0",
name = "Ceremonial Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "593",
expansion = "The Burning Crusade",
location = "Mana-Tombs"
},
id594 = {
source = "Administering the Salve",
drop_rate = "quest",
name = "Earthcaller's Mace",
category_territory = "",
territory = "Horde",
id = "594",
expansion = "The Burning Crusade",
location = "Hellfire Peninsula"
},
id595 = {
source = "Escape from Umbrafen",
drop_rate = "quest",
name = "Warden's Hammer",
category_territory = "",
territory = "Horde",
id = "595",
expansion = "The Burning Crusade",
location = "Zangarmarsh"
},
id596 = {
source = "Rokmar the Crackler",
drop_rate = "0.0",
name = "Coilfang Hammer of Renewal",
category_territory = "Dungeon",
territory = "Horde",
id = "596",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id597 = {
source = "Fedryen Swiftspear",
drop_rate = "Unknown",
name = "Preserver's Cudgel",
category_territory = "",
territory = "Horde",
id = "597",
expansion = "The Burning Crusade",
location = "Zangarmarsh"
},
id598 = {
source = "Rokmar the Crackler",
drop_rate = "0.0",
name = "Coilfang Hammer of Renewal",
category_territory = "Dungeon",
territory = "Horde",
id = "598",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id599 = {
source = "Greater Bogstrok",
drop_rate = "0.0",
name = "Flanged Battle Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "599",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id600 = {
source = "Nascent Fel Orc",
drop_rate = "0.0",
name = "Cold-Iron Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "600",
expansion = "The Burning Crusade",
location = "The Blood Furnace"
},
id601 = {
source = "The Maker",
drop_rate = "0.0",
name = "Diamond-Core Sledgemace",
category_territory = "Dungeon",
territory = "Horde",
id = "601",
expansion = "The Burning Crusade",
location = "The Blood Furnace"
},
id602 = {
source = "Bonechewer Hungerer",
drop_rate = "0.0",
name = "Fist of Reckoning",
category_territory = "Dungeon",
territory = "Horde",
id = "602",
expansion = "The Burning Crusade",
location = "Hellfire Ramparts"
},
id603 = {
source = "Bogstrok",
drop_rate = "0.0",
name = "Pneumatic War Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "603",
expansion = "The Burning Crusade",
location = "The Slave Pens"
},
id604 = {
source = "Bonechewer Hungerer",
drop_rate = "0.0",
name = "Glorious Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "604",
expansion = "The Burning Crusade",
location = "Hellfire Ramparts"
},
id605 = {
source = "CThun",
drop_rate = "0.0",
name = "Scepter of the False Prophet",
category_territory = "Raid",
territory = "Horde",
id = "605",
expansion = "",
location = "Temple of Ahn'Qiraj"
},
id606 = {
source = "Bonechewer Hungerer",
drop_rate = "0.0",
name = "Riversong Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "606",
expansion = "The Burning Crusade",
location = "Hellfire Ramparts"
},
id607 = {
source = "Bonechewer Hungerer",
drop_rate = "0.0",
name = "Revitalizing Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "607",
expansion = "The Burning Crusade",
location = "Hellfire Ramparts"
},
id608 = {
source = "Nefarian",
drop_rate = "0.0",
name = "Lok'amir il Romathis",
category_territory = "Raid",
territory = "Horde",
id = "608",
expansion = "",
location = "Blackwing Lair"
},
id609 = {
source = "Shattered Hand Warhound",
drop_rate = "0.0",
name = "Doomsayer's Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "609",
expansion = "The Burning Crusade",
location = "Hellfire Ramparts"
},
id610 = {
source = "Bonestripper Buzzard",
drop_rate = "0.0",
name = "Naaru Lightmace",
category_territory = "",
territory = "Horde",
id = "610",
expansion = "The Burning Crusade",
location = "Hellfire Peninsula"
},
id611 = {
source = "Lava Surger",
drop_rate = "0.0",
name = "Hand of Edward the Odd",
category_territory = "Raid",
territory = "Horde",
id = "611",
expansion = "",
location = "Molten Core"
},
id612 = {
source = "Garr",
drop_rate = "0.0",
name = "Aurastone Hammer",
category_territory = "Raid",
territory = "Horde",
id = "612",
expansion = "",
location = "Molten Core"
},
id613 = {
source = "Razorgore the Untamed",
drop_rate = "0.0",
name = "Spineshatter",
category_territory = "Raid",
territory = "Horde",
id = "613",
expansion = "",
location = "Blackwing Lair"
},
id614 = {
source = "Warden Haro",
drop_rate = "Unknown",
name = "Hammer of the Gathering Storm",
category_territory = "",
territory = "Horde",
id = "614",
expansion = "Cataclysm",
location = "Ahn'Qiraj: The Fallen Kingdom"
},
id615 = {
source = "Warden Haro",
drop_rate = "Unknown",
name = "Gavel of Infinite Wisdom",
category_territory = "",
territory = "Horde",
id = "615",
expansion = "Cataclysm",
location = "Ahn'Qiraj: The Fallen Kingdom"
},
id616 = {
source = "Ayamiss the Hunter",
drop_rate = "0",
name = "Stinger of Ayamiss",
category_territory = "Raid",
territory = "Horde",
id = "616",
expansion = "",
location = "Ruins of Ahn'Qiraj"
},
id617 = {
source = "Ossirian the Unscarred",
drop_rate = "0",
name = "Sand Polished Hammer",
category_territory = "Raid",
territory = "Horde",
id = "617",
expansion = "",
location = "Ruins of Ahn'Qiraj"
},
id618 = {
source = "Vekniss Guardian",
drop_rate = "0.0",
name = "Anubisath Warhammer",
category_territory = "Raid",
territory = "Horde",
id = "618",
expansion = "",
location = "Temple of Ahn'Qiraj"
},
id619 = {
source = "Lethon",
drop_rate = "0.0",
name = "Hammer of Bestial Fury",
category_territory = "",
territory = "Horde",
id = "619",
expansion = "",
location = "The Hinterlands"
},
id620 = {
source = "Lord Kazzak",
drop_rate = "0.0",
name = "Empyrean Demolisher",
category_territory = "",
territory = "Horde",
id = "620",
expansion = "",
location = "Blasted Lands"
},
id621 = {
source = "Ragnaros",
drop_rate = "0.0",
name = "Mass of McGowan",
category_territory = "Raid",
territory = "Horde",
id = "621",
expansion = "",
location = "Molten Core"
},
id622 = {
source = "Skarr the Broken",
drop_rate = "0.0",
name = "Bludstone Hammer",
category_territory = "",
territory = "Horde",
id = "622",
expansion = "",
location = "Feralas"
},
id623 = {
source = "Mother Smolderweb",
drop_rate = "0.0",
name = "Venomspitter",
category_territory = "Dungeon",
territory = "Horde",
id = "623",
expansion = "",
location = "Blackrock Spire"
},
id624 = {
source = "Ghok Bashguud",
drop_rate = "0.0",
name = "Bashguuder",
category_territory = "Dungeon",
territory = "Horde",
id = "624",
expansion = "",
location = "Blackrock Spire"
},
id625 = {
source = "Thanthaldis Snowgleam",
drop_rate = "Unknown",
name = "Stormstrike Hammer",
category_territory = "",
territory = "Alliance",
id = "625",
expansion = "",
location = "Hillsbrad Foothills"
},
id626 = {
source = "Emperor Dagran Thaurissan",
drop_rate = "0.0",
name = "Ironfoe",
category_territory = "Dungeon",
territory = "Horde",
id = "626",
expansion = "",
location = "Blackrock Depths"
},
id627 = {
source = "Doomrel",
drop_rate = "Unknown",
name = "The Hammer of Grace",
category_territory = "Dungeon",
territory = "Horde",
id = "627",
expansion = "",
location = "Blackrock Depths"
},
id628 = {
source = "Jammalan the Prophet",
drop_rate = "0.0",
name = "Fist of the Damned",
category_territory = "Dungeon",
territory = "Horde",
id = "628",
expansion = "",
location = "Sunken Temple"
},
id629 = {
source = "Avatar of Hakkar",
drop_rate = "Unknown",
name = "Might of Hakkar",
category_territory = "Dungeon",
territory = "Horde",
id = "629",
expansion = "",
location = "Sunken Temple"
},
id630 = {
source = "Nefarian",
drop_rate = "0.0",
name = "Blesswind Hammer",
category_territory = "Raid",
territory = "Horde",
id = "630",
expansion = "",
location = "Blackwing Lair"
},
id631 = {
source = "Smolderthorn Assassin",
drop_rate = "0.0",
name = "Hammer of the Northern Wind",
category_territory = "",
territory = "Horde",
id = "631",
expansion = "",
location = "Burning Steppes"
},
id632 = {
source = "Silicate Feeder",
drop_rate = "0.0",
name = "Viking Warhammer",
category_territory = "Raid",
territory = "Horde",
id = "632",
expansion = "",
location = "Ruins of Ahn'Qiraj"
},
id633 = {
source = "Tides of Darkness",
drop_rate = "quest",
name = "Ogre Tapper",
category_territory = "",
territory = "Horde",
id = "633",
expansion = "",
location = "Swamp of Sorrows"
},
id634 = {
source = "Tides of Darkness",
drop_rate = "quest",
name = "Knight Tapper",
category_territory = "",
territory = "Horde",
id = "634",
expansion = "",
location = "Swamp of Sorrows"
},
id635 = {
source = "Tides of Darkness",
drop_rate = "quest",
name = "Ogre Mage Club",
category_territory = "",
territory = "Horde",
id = "635",
expansion = "",
location = "Swamp of Sorrows"
},
id636 = {
source = "Nightmare Whelp",
drop_rate = "0.0",
name = "Bonesnapper",
category_territory = "Dungeon",
territory = "Horde",
id = "636",
expansion = "",
location = "Sunken Temple"
},
id637 = {
source = "Lord Aurius Rivendare",
drop_rate = "0.0",
name = "Scepter of the Unholy",
category_territory = "Dungeon",
territory = "Horde",
id = "637",
expansion = "",
location = "Stratholme"
},
id638 = {
source = "Dark Keeper Zimrel",
drop_rate = "0.0",
name = "Smashing Star",
category_territory = "Dungeon",
territory = "Horde",
id = "638",
expansion = "",
location = "Blackrock Depths"
},
id639 = {
source = "The Mighty Ucha",
drop_rate = "quest",
name = "Beast Clobberer",
category_territory = "",
territory = "Horde",
id = "639",
expansion = "",
location = "Un'Goro Crater"
},
id640 = {
source = "BaelGar",
drop_rate = "0.0",
name = "Rubidium Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "640",
expansion = "",
location = "Blackrock Depths"
},
id641 = {
source = "Gorn One Eye",
drop_rate = "Unknown",
name = "Furbolg Medicine Totem",
category_territory = "",
territory = "Horde",
id = "641",
expansion = "",
location = "Felwood"
},
id642 = {
source = "How to Make Meat Fresh Again",
drop_rate = "quest",
name = "Stegodon Tusk Mace",
category_territory = "",
territory = "Horde",
id = "642",
expansion = "",
location = "Un'Goro Crater"
},
id643 = {
source = "Pain of the Blood Elves",
drop_rate = "quest",
name = "Mace of the Sin'dorei Spirit",
category_territory = "",
territory = "Horde",
id = "643",
expansion = "",
location = "Winterspring"
},
id644 = {
source = "Welcome to the Brotherhood",
drop_rate = "quest",
name = "Hammer of the Thorium Brotherhood",
category_territory = "",
territory = "Horde",
id = "644",
expansion = "",
location = "Searing Gorge"
},
id645 = {
source = "Stocking Up",
drop_rate = "quest",
name = "Enchanted Scorpid Tail",
category_territory = "",
territory = "Horde",
id = "645",
expansion = "",
location = "Burning Steppes"
},
id646 = {
source = "Stocking Up",
drop_rate = "quest",
name = "Envenomed Scorpid Tail",
category_territory = "",
territory = "Horde",
id = "646",
expansion = "",
location = "Burning Steppes"
},
id647 = {
source = "Antusul",
drop_rate = "0.0",
name = "The Hand of Antu'sul",
category_territory = "Dungeon",
territory = "Horde",
id = "647",
expansion = "",
location = "Zul'Farrak"
},
id648 = {
source = "Theka the Martyr",
drop_rate = "0.0",
name = "Diamond-Tip Bludgeon",
category_territory = "Dungeon",
territory = "Horde",
id = "648",
expansion = "",
location = "Zul'Farrak"
},
id649 = {
source = "Enemy at our Roots",
drop_rate = "quest",
name = "Talon Branch",
category_territory = "",
territory = "Horde",
id = "649",
expansion = "",
location = "Felwood"
},
id650 = {
source = "Its Time to Oil Up",
drop_rate = "quest",
name = "Efficiency Spell Mace",
category_territory = "",
territory = "Horde",
id = "650",
expansion = "",
location = "Felwood"
},
id651 = {
source = "They Build a Better Bullet",
drop_rate = "quest",
name = "Dark Iron Blackjack",
category_territory = "",
territory = "Horde",
id = "651",
expansion = "",
location = "Searing Gorge"
},
id652 = {
source = "Rejoining the Forest",
drop_rate = "quest",
name = "Gifted Bough",
category_territory = "",
territory = "Horde",
id = "652",
expansion = "",
location = "Felwood"
},
id653 = {
source = "Timmy the Cruel",
drop_rate = "0.0",
name = "The Cruel Hand of Timmy",
category_territory = "Dungeon",
territory = "Horde",
id = "653",
expansion = "",
location = "Stratholme"
},
id654 = {
source = "The Dreadlord Balnazzar",
drop_rate = "quest",
name = "Dathrohan's Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "654",
expansion = "",
location = "Stratholme"
},
id655 = {
source = "Hurley Blackbreath",
drop_rate = "0.0",
name = "Skullcrusher Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "655",
expansion = "",
location = "Blackrock Depths"
},
id656 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Big Black Mace",
category_territory = "",
territory = "",
id = "656",
expansion = "Legion",
location = "Dalaran"
},
id657 = {
source = "The Inner Circle",
drop_rate = "quest",
name = "Shadow Hold Mace",
category_territory = "",
territory = "Horde",
id = "657",
expansion = "",
location = "Felwood"
},
id658 = {
source = "Dance for Ruumbo!",
drop_rate = "quest",
name = "Ruumbo's Arm",
category_territory = "",
territory = "Horde",
id = "658",
expansion = "",
location = "Felwood"
},
id659 = {
source = "Amnennar the Coldbringer",
drop_rate = "0.0",
name = "Ebony Boneclub",
category_territory = "Dungeon",
territory = "Horde",
id = "659",
expansion = "",
location = "Razorfen Downs"
},
id660 = {
source = "Gordok Hound",
drop_rate = "0.0",
name = "Heaven's Light",
category_territory = "Dungeon",
territory = "Horde",
id = "660",
expansion = "",
location = "Dire Maul"
},
id661 = {
source = "Prince Tortheldrin",
drop_rate = "0.0",
name = "Timeworn Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "661",
expansion = "",
location = "Dire Maul"
},
id662 = {
source = "Something to Wear",
drop_rate = "quest",
name = "Lakota's Mace",
category_territory = "",
territory = "Horde",
id = "662",
expansion = "",
location = "Thousand Needles"
},
id663 = {
source = "Something to Wear",
drop_rate = "quest",
name = "Lakota's Gavel",
category_territory = "",
territory = "Horde",
id = "663",
expansion = "",
location = "Thousand Needles"
},
id664 = {
source = "The Treasure of the Shendralar",
drop_rate = "quest",
name = "Dire Maul",
category_territory = "Dungeon",
territory = "Horde",
id = "664",
expansion = "",
location = "Dire Maul"
},
id665 = {
source = "Counter-Plague Research",
drop_rate = "quest",
name = "Plaguewood Mace",
category_territory = "",
territory = "Horde",
id = "665",
expansion = "",
location = "Eastern Plaguelands"
},
id666 = {
source = "Add em to the Pile",
drop_rate = "quest",
name = "Stinking Skull Mace",
category_territory = "",
territory = "Horde",
id = "666",
expansion = "",
location = "Eastern Plaguelands"
},
id667 = {
source = "Plaguebat",
drop_rate = "0.0",
name = "Ardent Custodian",
category_territory = "",
territory = "Horde",
id = "667",
expansion = "",
location = "Eastern Plaguelands"
},
id668 = {
source = "Aarux",
drop_rate = "0.0",
name = "Goblin Nutcracker",
category_territory = "Dungeon",
territory = "Horde",
id = "668",
expansion = "",
location = "Razorfen Downs"
},
id669 = {
source = "Alzzin the Wildshaper",
drop_rate = "0.0",
name = "Energetic Rod",
category_territory = "Dungeon",
territory = "Horde",
id = "669",
expansion = "",
location = "Dire Maul"
},
id670 = {
source = "Eric",
drop_rate = "0.0",
name = "Excavator's Brand",
category_territory = "Dungeon",
territory = "Horde",
id = "670",
expansion = "",
location = "Uldaman"
},
id671 = {
source = "Galgann Firehammer",
drop_rate = "0.0",
name = "Galgann's Firehammer",
category_territory = "Dungeon",
territory = "Horde",
id = "671",
expansion = "",
location = "Uldaman"
},
id672 = {
source = "Earthen Rocksmasher",
drop_rate = "0.0",
name = "Stonevault Bonebreaker",
category_territory = "Dungeon",
territory = "Horde",
id = "672",
expansion = "",
location = "Uldaman"
},
id673 = {
source = "The Platinum Discs",
drop_rate = "quest",
name = "Durdin's Hammer",
category_territory = "Dungeon",
territory = "Horde",
id = "673",
expansion = "",
location = "Uldaman"
},
id674 = {
source = "Challenge Overlord MokMorokk",
drop_rate = "quest",
name = "Mok'Morokk's Headcracker",
category_territory = "",
territory = "Horde",
id = "674",
expansion = "",
location = "Dustwallow Marsh"
},
id675 = {
source = "Landslide",
drop_rate = "0.0",
name = "Fist of Stone",
category_territory = "Dungeon",
territory = "Horde",
id = "675",
expansion = "",
location = "Maraudon"
},
id676 = {
source = "Stone Keeper",
drop_rate = "0.0",
name = "Murphstar",
category_territory = "Dungeon",
territory = "Horde",
id = "676",
expansion = "",
location = "Uldaman"
},
id677 = {
source = "Students of Krastinov",
drop_rate = "quest",
name = "Malicia's Scepter",
category_territory = "",
territory = "Horde",
id = "677",
expansion = "",
location = "Western Plaguelands"
},
id678 = {
source = "Wildspawn Betrayer",
drop_rate = "0.0",
name = "Midnight Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "678",
expansion = "",
location = "Dire Maul"
},
id679 = {
source = "Whip Lasher",
drop_rate = "0.0",
name = "Deadwood Sledge",
category_territory = "Dungeon",
territory = "Horde",
id = "679",
expansion = "",
location = "Dire Maul"
},
id680 = {
source = "Forces of Nature: Mountain Giants",
drop_rate = "quest",
name = "Power of the Faerie Dragon",
category_territory = "",
territory = "Horde",
id = "680",
expansion = "",
location = "Feralas"
},
id681 = {
source = "Northspring Windcaller",
drop_rate = "0.0",
name = "Giant Club",
category_territory = "",
territory = "Horde",
id = "681",
expansion = "",
location = "Feralas"
},
id682 = {
source = "Death to Agogridon",
drop_rate = "quest",
name = "Soulstar Mace",
category_territory = "",
territory = "Horde",
id = "682",
expansion = "",
location = "Desolace"
},
id683 = {
source = "Kovork",
drop_rate = "0.0",
name = "Kovork's Rattle",
category_territory = "",
territory = "Horde",
id = "683",
expansion = "",
location = "Arathi Highlands"
},
id684 = {
source = "Making Mutiny",
drop_rate = "quest",
name = "Supposed Mace",
category_territory = "",
territory = "Horde",
id = "684",
expansion = "",
location = "The Cape of Stranglethorn"
},
id685 = {
source = "Scarlet Centurion",
drop_rate = "0.0",
name = "Dreamslayer",
category_territory = "Dungeon",
territory = "Horde",
id = "685",
expansion = "Mists Of Pandaria",
location = "Scarlet Monastery"
},
id686 = {
source = "Warlord Ramtusk",
drop_rate = "0.0",
name = "Sequoia Hammer",
category_territory = "Dungeon",
territory = "Alliance",
id = "686",
expansion = "",
location = "Razorfen Kraul"
},
id687 = {
source = "Return and Report",
drop_rate = "quest",
name = "Spinescale Hammer",
category_territory = "",
territory = "Horde",
id = "687",
expansion = "",
location = "Desolace"
},
id688 = {
source = "Prime Slime",
drop_rate = "quest",
name = "Goopy Mallet",
category_territory = "",
territory = "Horde",
id = "688",
expansion = "",
location = "The Hinterlands"
},
id689 = {
source = "The Nightmare Scar",
drop_rate = "quest",
name = "Scepter of Naralex",
category_territory = "",
territory = "Horde",
id = "689",
expansion = "",
location = "Southern Barrens"
},
id690 = {
source = "The Nightmare Scar",
drop_rate = "quest",
name = "Cudgel of Naralex",
category_territory = "",
territory = "Horde",
id = "690",
expansion = "",
location = "Southern Barrens"
},
id691 = {
source = "Enormous Bullfrog",
drop_rate = "0.0",
name = "Looming Gavel",
category_territory = "Dungeon",
territory = "Alliance",
id = "691",
expansion = "",
location = "Razorfen Kraul"
},
id692 = {
source = "Starving Hound",
drop_rate = "0.0",
name = "Leaden Mace",
category_territory = "Dungeon",
territory = "Horde",
id = "692",
expansion = "Mists Of Pandaria",
location = "Scarlet Halls"
},
id693 = {
source = "Dark Iron Ambassador",
drop_rate = "0.0",
name = "Royal Diplomatic Scepter",
category_territory = "Dungeon",
territory = "War Zone",
id = "693",
expansion = "",
location = "Gnomeregan"
},
id694 = {
source = "Mechanized Sentry",
drop_rate = "0.0",
name = "Oscillating Power Hammer",
category_territory = "Dungeon",
territory = "War Zone",
id = "694",
expansion = "",
location = "Gnomeregan"
},
id695 = {
source = "Scarlet Defender",
drop_rate = "0.0",
name = "Beazel's Basher",
category_territory = "Dungeon",
territory = "Horde",
id = "695",
expansion = "Mists Of Pandaria",
location = "Scarlet Halls"
},
id696 = {
source = "Guile of the Raptor",
drop_rate = "quest",
name = "Hammerfall Mace",
category_territory = "",
territory = "Horde",
id = "696",
expansion = "",
location = "Arathi Highlands"
},
id697 = {
source = "Raptor Mastery",
drop_rate = "quest",
name = "Tethis' Skull",
category_territory = "",
territory = "Horde",
id = "697",
expansion = "",
location = "Northern Stranglethorn"
},
id698 = {
source = "Tiger Mastery",
drop_rate = "quest",
name = "Sin'Dall's Femur",
category_territory = "",
territory = "Horde",
id = "698",
expansion = "",
location = "Northern Stranglethorn"
},
id699 = {
source = "Guile of the Raptor",
drop_rate = "quest",
name = "Hammerfall Cudgel",
category_territory = "",
territory = "Horde",
id = "699",
expansion = "",
location = "Arathi Highlands"
},
id700 = {
source = "Guile of the Raptor",
drop_rate = "quest",
name = "Hammerfall Gavel",
category_territory = "",
territory = "Horde",
id = "700",
expansion = "",
location = "Arathi Highlands"
},
id701 = {
source = "Venture Company Mining",
drop_rate = "quest",
name = "Crystal-Chipping Mallet",
category_territory = "",
territory = "Horde",
id = "701",
expansion = "",
location = "Northern Stranglethorn"
},
id702 = {
source = "BEWARE OF CRAGJAW!",
drop_rate = "quest",
name = "Fish Stunner",
category_territory = "",
territory = "Horde",
id = "702",
expansion = "",
location = "Stonetalon Mountains"
},
id703 = {
source = "Mudsnout Gnoll",
drop_rate = "0.0",
name = "Diamond Hammer",
category_territory = "",
territory = "Alliance",
id = "703",
expansion = "",
location = "Hillsbrad Foothills"
},
id704 = {
source = "Pahboo-Ra",
drop_rate = "0.0",
name = "Crested Scepter",
category_territory = "Dungeon",
territory = "Horde",
id = "704",
expansion = "",
location = "Blackfathom Deeps"
},
id705 = {
source = "The Durnholde Challenge: D-1000",
drop_rate = "quest",
name = "Discontinuer's Hammer",
category_territory = "",
territory = "Alliance",
id = "705",
expansion = "",
location = "Hillsbrad Foothills"
},
id706 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Heavy Bronze Mace",
category_territory = "",
territory = "",
id = "706",
expansion = "Legion",
location = "Dalaran"
},
id707 = {
source = "Subjugator Korul",
drop_rate = "0.0",
name = "Battlesmasher",
category_territory = "Dungeon",
territory = "Horde",
id = "707",
expansion = "",
location = "Blackfathom Deeps"
},
id708 = {
source = "Ebon Whelp",
drop_rate = "0.0",
name = "Skeletal Club",
category_territory = "",
territory = "War Zone",
id = "708",
expansion = "",
location = "Wetlands"
},
id709 = {
source = "Mottled Raptor",
drop_rate = "0.0",
name = "Jagged Star",
category_territory = "",
territory = "War Zone",
id = "709",
expansion = "",
location = "Wetlands"
},
id710 = {
source = "Blastranaar!",
drop_rate = "quest",
name = "Preemptive Striker",
category_territory = "",
territory = "Horde",
id = "710",
expansion = "",
location = "Ashenvale"
},
id711 = {
source = "Domina",
drop_rate = "0.0",
name = "Stout Battlehammer",
category_territory = "Dungeon",
territory = "Horde",
id = "711",
expansion = "",
location = "Blackfathom Deeps"
},
id712 = {
source = "Shadowhide Gnoll",
drop_rate = "0.0",
name = "Shadowhide Mace",
category_territory = "",
territory = "War Zone",
id = "712",
expansion = "",
location = "Redridge Mountains"
},
id713 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Bronze Mace",
category_territory = "",
territory = "",
id = "713",
expansion = "Legion",
location = "Dalaran"
},
id714 = {
source = "Frantic Geist",
drop_rate = "0.0",
name = "Face Smasher",
category_territory = "Dungeon",
territory = "Alliance",
id = "714",
expansion = "",
location = "Shadowfang Keep"
},
id715 = {
source = "Baron Ashbury",
drop_rate = "0.0",
name = "Baron's Scepter",
category_territory = "Dungeon",
territory = "Alliance",
id = "715",
expansion = "",
location = "Shadowfang Keep"
},
id716 = {
source = "Lord Pythas",
drop_rate = "0.0",
name = "Stinging Viper",
category_territory = "Dungeon",
territory = "Alliance",
id = "716",
expansion = "",
location = "Wailing Caverns"
},
id717 = {
source = "Blackrock Sentry",
drop_rate = "0.0",
name = "Blackrock Mace",
category_territory = "",
territory = "War Zone",
id = "717",
expansion = "",
location = "Redridge Mountains"
},
id718 = {
source = "Explosives Shredding",
drop_rate = "quest",
name = "Shredder Piston",
category_territory = "",
territory = "Horde",
id = "718",
expansion = "",
location = "Ashenvale"
},
id719 = {
source = "Playing With Felfire",
drop_rate = "quest",
name = "Scepter of Questionable Decision Making",
category_territory = "",
territory = "Horde",
id = "719",
expansion = "",
location = "Ashenvale"
},
id720 = {
source = "Defias Digger",
drop_rate = "0.0",
name = "Weighted Sap",
category_territory = "Dungeon",
territory = "War Zone",
id = "720",
expansion = "",
location = "The Deadmines"
},
id721 = {
source = "Ending Their World",
drop_rate = "quest",
name = "Mace of the Hand",
category_territory = "",
territory = "War Zone",
id = "721",
expansion = "",
location = "Bloodmyst Isle"
},
id722 = {
source = "The Tides Turn Against Us",
drop_rate = "quest",
name = "Grove Keeper's Branch",
category_territory = "",
territory = "War Zone",
id = "722",
expansion = "",
location = "Darkshore"
},
id723 = {
source = "DarKhans Lieutenants",
drop_rate = "quest",
name = "Spiky Legbone",
category_territory = "",
territory = "Alliance",
id = "723",
expansion = "",
location = "Ghostlands"
},
id724 = {
source = "Redridge Basher",
drop_rate = "0.0",
name = "Gnoll Skull Basher",
category_territory = "",
territory = "War Zone",
id = "724",
expansion = "",
location = "Redridge Mountains"
},
id725 = {
source = "Lord Serpentis",
drop_rate = "0.0",
name = "Barbed Club",
category_territory = "Dungeon",
territory = "Alliance",
id = "725",
expansion = "",
location = "Wailing Caverns"
},
id726 = {
source = "The Defias Kingpin",
drop_rate = "quest",
name = "Cookie's Meat Mallet",
category_territory = "Dungeon",
territory = "War Zone",
id = "726",
expansion = "",
location = "The Deadmines"
},
id727 = {
source = "The Defias Kingpin",
drop_rate = "quest",
name = "Cookie's Meat Mallet",
category_territory = "Dungeon",
territory = "War Zone",
id = "727",
expansion = "",
location = "The Deadmines"
},
id728 = {
source = "Defias Knuckleduster",
drop_rate = "0.0",
name = "Wicked Blackjack",
category_territory = "",
territory = "War Zone",
id = "728",
expansion = "",
location = "Westfall"
},
id729 = {
source = "Redridge Brute",
drop_rate = "0.0",
name = "Gnoll Punisher",
category_territory = "",
territory = "War Zone",
id = "729",
expansion = "",
location = "Redridge Mountains"
},
id730 = {
source = "Slagmaw",
drop_rate = "0.0",
name = "Sergeant's Warhammer",
category_territory = "Dungeon",
territory = "Alliance",
id = "730",
expansion = "",
location = "Ragefire Chasm"
},
id731 = {
source = "Waptor Twapping",
drop_rate = "quest",
name = "Waptor Thwapper",
category_territory = "",
territory = "Alliance",
id = "731",
expansion = "",
location = "Northern Barrens"
},
id732 = {
source = "Saving Foreman Oslow",
drop_rate = "quest",
name = "Solomon's Gavel",
category_territory = "",
territory = "War Zone",
id = "732",
expansion = "",
location = "Redridge Mountains"
},
id733 = {
source = "Rise of the Brotherhood",
drop_rate = "quest",
name = "House Wrynn Gavel",
category_territory = "",
territory = "War Zone",
id = "733",
expansion = "",
location = "Westfall"
},
id734 = {
source = "Murloc Warrior",
drop_rate = "0.0",
name = "Driftwood Club",
category_territory = "",
territory = "War Zone",
id = "734",
expansion = "",
location = "Westfall"
},
id735 = {
source = "Stonesplinter Shaman",
drop_rate = "0.0",
name = "Stonesplinter Mace",
category_territory = "",
territory = "War Zone",
id = "735",
expansion = "",
location = "Loch Modan"
},
id736 = {
source = "Skylord Braax",
drop_rate = "0.0",
name = "Staunch Hammer",
category_territory = "",
territory = "War Zone",
id = "736",
expansion = "",
location = "Darkshore"
},
id737 = {
source = "Gathering Idols",
drop_rate = "quest",
name = "Carved Stone Mace",
category_territory = "",
territory = "War Zone",
id = "737",
expansion = "",
location = "Loch Modan"
},
id738 = {
source = "Nowhere to Run",
drop_rate = "quest",
name = "Mace of Calculated Loss",
category_territory = "",
territory = "Alliance",
id = "738",
expansion = "",
location = "Silverpine Forest"
},
id739 = {
source = "Dark Shaman Koranthal",
drop_rate = "0.0",
name = "Heavy Mace",
category_territory = "Dungeon",
territory = "Alliance",
id = "739",
expansion = "",
location = "Ragefire Chasm"
},
id740 = {
source = "Alien Predators",
drop_rate = "quest",
name = "Old Elekk Prod",
category_territory = "",
territory = "War Zone",
id = "740",
expansion = "",
location = "Bloodmyst Isle"
},
id741 = {
source = "Arborcide",
drop_rate = "quest",
name = "Chopped Off Ancient Limb",
category_territory = "",
territory = "Alliance",
id = "741",
expansion = "",
location = "Azshara"
},
id742 = {
source = "War Dance",
drop_rate = "quest",
name = "Kodo Mallet",
category_territory = "",
territory = "Alliance",
id = "742",
expansion = "",
location = "Mulgore"
},
id743 = {
source = "Seize the Ambassador",
drop_rate = "quest",
name = "The Slaghammer",
category_territory = "",
territory = "War Zone",
id = "743",
expansion = "",
location = "Ironforge"
},
id744 = {
source = "War Dance",
drop_rate = "quest",
name = "Kodo Gavel",
category_territory = "",
territory = "Alliance",
id = "744",
expansion = "",
location = "Mulgore"
},
id745 = {
source = "A Goblin in Sharks Clothing",
drop_rate = "quest",
name = "The Hammer",
category_territory = "",
territory = "Alliance",
id = "745",
expansion = "Cataclysm",
location = "The Lost Isles"
},
id746 = {
source = "The Future of Gnomeregan",
drop_rate = "quest",
name = "Death Star",
category_territory = "",
territory = "War Zone",
id = "746",
expansion = "Mists Of Pandaria",
location = "New Tinkertown"
},
id747 = {
source = "Naron Bloomthistle",
drop_rate = "Unknown",
name = "Garden Sickle",
category_territory = "",
territory = "Horde",
id = "747",
expansion = "Warlords Of Draenor",
location = "Lunarfall"
},
id748 = {
source = "Naron Bloomthistle",
drop_rate = "Unknown",
name = "Garden Hoe",
category_territory = "",
territory = "Horde",
id = "748",
expansion = "Warlords Of Draenor",
location = "Lunarfall"
}
} |
-----------------------------------------------------------------------------
-- An icon representing a basic node.
--
-- Original Image Copyright (c) 2006-2007 Everaldo Coelho.
-- Distributed under GNU General Public License.
-- http://www.everaldo.com/crystal/?action=license
-----------------------------------------------------------------------------
module(..., package.seeall)
NODE = {
prototype = "@Image",
file_name = "basic_node.png",
copyright = "Everaldo Coelho (http://www.everaldo.com, [email protected]",
title = "ASCII Icon",
file_type = "image/png",
}
NODE.content = [[
iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAACXBIWXMAAAsTAAALEwEAmpwYAAABY
0lEQVQ4y7WVQW7DMAwER7QD5A3t83LKi3JMPtce+gBfHJE9BHQYiXKAAhVg2JKp5Wq5koqZAXC5XL
7MDDNDVfFmZpRStrc/ACKCiLx8n06nT4A5ApzP5491XbeJEcjHAFR1e2qt1Fo5Ho/cbrdvj5lbZs5
gBAowTRMigpltTA+HA776Dhig1toBtsuPLZJJgVtd40Tvt1q3iSJGxzgWa9Rcgk77MEcyYM/sLokx
3o/sNtZ7GjtjVe2Klsni349ktQduE3hwK0kmUxY7BG6LlI3F1YnIuHhu+tZi2Y5rxx9jA8ZenJGW3
s/0f+wB3QfeK1Tr5xe9o1NGPo1a71ku/rs/cZ+MPfs7KTKHPGP5uxQjWQCi6vMo+4jd3ipsj3G7Sd
4dSNn8Drg9WPa8nPl6Cied8E9tjmyXZbkvy5LeHtlt0seVXIrr9frjW9vUqFpBQYttR6KpghSKgUh
BiqAI0/Sa9BfWEFYZwWli6wAAAABJRU5ErkJggg==
]]
|
function write(addr, data)
if addr >= 0x8000 and addr <= 0xffff then
mapper_switch_chr(0x0, 8, data & 0x3)
mapper_switch_prg(0x8000, 32, (data >> 4) & 0x3)
end
end
|
-- Copyright (C) 2018 The Dota IMBA Development Team
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-- Editors:
--
--[[ Author: d2imba
Date: 16.08.2015 ]]
function MagicStick( keys )
local caster = keys.caster
local ability = keys.ability
local ability_level = ability:GetLevel() - 1
local sound_cast = keys.sound_cast
local particle_cast = keys.particle_cast
-- Parameters
local restore_per_charge = ability:GetLevelSpecialValueFor("restore_per_charge", ability_level)
-- Fetch current charges
local current_charges = ability:GetCurrentCharges()
-- Play sound
caster:EmitSound(sound_cast)
-- Play particle
local stick_pfx = ParticleManager:CreateParticle(particle_cast, PATTACH_ABSORIGIN_FOLLOW, caster)
ParticleManager:SetParticleControl(stick_pfx, 0, caster:GetAbsOrigin())
ParticleManager:SetParticleControl(stick_pfx, 1, Vector(10,0,0))
-- Restore health and mana to the caster
caster:Heal(current_charges * restore_per_charge, ability)
caster:GiveMana(current_charges * restore_per_charge)
-- Set remaining charges to zero
ability:SetCurrentCharges(0)
end
function MagicStickCharge( keys )
local caster = keys.caster
local target = keys.unit
local ability = keys.ability
local ability_level = ability:GetLevel() - 1
local cast_ability = keys.event_ability
local cast_ability_name = cast_ability:GetName()
-- Parameters
local max_charges = ability:GetLevelSpecialValueFor("max_charges", ability_level)
local current_charges = ability:GetCurrentCharges()
-- Verify stick proc conditions
local mana_spent = cast_ability:GetManaCost(cast_ability:GetLevel() - 1)
local procs_stick = cast_ability:ProcsMagicStick()
local caster_visible = caster:CanEntityBeSeenByMyTeam(target)
local special_abilities = {"storm_spirit_ball_lightning"}
local special_ability_casted = false
-- If the ability is on the list of forbidden abilities, do nothing
for _,special_ability in pairs(special_abilities) do
if cast_ability_name == special_ability then
return nil
end
end
-- If all other conditions are met, increase stick charges
if mana_spent > 0 and procs_stick and caster_visible then
-- If the stick is not maxed yet, increase the amount of charges
if current_charges < max_charges then
ability:SetCurrentCharges(current_charges + 1)
end
end
end
function MagicWandSetCharges( keys )
local ability = keys.ability
if not ability.initialized then
ability.initialized = true
ability:SetCurrentCharges(ability:GetSpecialValueFor("initial_charges"))
end
end
|
-- File Monitor
-- To write a monitor, you must implement the monitor_X method,
-- where X is the name of the monitor.
function monitor_file(name,startcmd,stopcmd,restartcmd)
-- we need a table with the commands, so build from parameters
-- if needed
if not (type(startcmd) == "table") then
startcmd = { start = startcmd,
stop = stopcmd,
restart = restartcmd }
end
Erlmon.monitors.add("file",name,startcmd)
end
|
local bit32 = require("bit")
local ffi = require "ffi"
local function new_registers(registers, cache)
for k,v in pairs {
display_enabled = true,
window_tilemap = cache.map_0,
window_attr = cache.map_0_attr,
window_enabled = true,
tile_select = 0x9000,
background_tilemap = cache.map_0,
background_attr = cache.map_0_attr,
large_sprites = false,
sprites_enabled = true,
background_enabled = true,
oam_priority = false,
status = {
--status.SetMode = function(mode)
mode = 2,
lyc_interrupt_enabled = false,
oam_interrupt_enabled = false,
vblank_interrupt_enabled = false,
hblank_interrupt_enabled = false
}
} do
registers[k] = v
end
end
if (ffi) then
function new_registers(registers, cache)
registers = registers or ffi.new "LuaGBGraphicRegisters"
registers.display_enabled = true
registers.window_tilemap = cache.map_0
registers.window_attr = cache.map_0_attr
registers.window_enabled = true
registers.tile_select = 0x9000
registers.background_tilemap = cache.map_0
registers.background_attr = cache.map_0_attr
registers.large_sprites = false
registers.sprites_enabled = true
registers.background_enabled = true
registers.oam_priority = false
registers.status = {
--status.SetMode = function(mode)
mode = 2,
lyc_interrupt_enabled = false,
oam_interrupt_enabled = false,
vblank_interrupt_enabled = false,
hblank_interrupt_enabled = false
}
return registers
end
end
local Registers = {}
function Registers.new(registers, g, gameboy, cache)
local io = gameboy.io
local ports = io.ports
registers = new_registers(registers, cache)
local status = registers.status
io.write_logic[ports.LCDC] = function(byte)
io[1][ports.LCDC] = byte
-- Unpack all the bit flags into lua variables, for great sanity
registers.display_enabled = bit32.band(0x80, byte) ~= 0
registers.window_enabled = bit32.band(0x20, byte) ~= 0
registers.large_sprites = bit32.band(0x04, byte) ~= 0
registers.sprites_enabled = bit32.band(0x02, byte) ~= 0
if gameboy.type == gameboy.types.color then
registers.oam_priority = bit32.band(0x01, byte) == 0
else
registers.background_enabled = bit32.band(0x01, byte) ~= 0
end
if bit32.band(0x40, byte) ~= 0 then
registers.window_tilemap = cache.map_1
registers.window_attr = cache.map_1_attr
else
registers.window_tilemap = cache.map_0
registers.window_attr = cache.map_0_attr
end
if bit32.band(0x10, byte) ~= 0 then
if registers.tile_select == 0x9000 then
-- refresh our tile indices, they'll all need recalculating for the new offset
registers.tile_select = 0x8000
cache.refreshTileMaps()
end
else
if registers.tile_select == 0x8000 then
-- refresh our tile indices, they'll all need recalculating for the new offset
registers.tile_select = 0x9000
cache.refreshTileMaps()
end
end
if bit32.band(0x08, byte) ~= 0 then
registers.background_tilemap = cache.map_1
registers.background_attr = cache.map_1_attr
else
registers.background_tilemap = cache.map_0
registers.background_attr = cache.map_0_attr
end
end
status.SetMode = function(mode)
status.mode = mode
io[1][ports.STAT] = bit32.band(io[1][ports.STAT], 0xFC) + bit32.band(mode, 0x3)
end
io.write_logic[ports.STAT] = function(byte)
io[1][ports.STAT] = bit32.band(byte, 0x78)
status.lyc_interrupt_enabled = bit32.band(byte, 0x40) ~= 0
status.oam_interrupt_enabled = bit32.band(byte, 0x20) ~= 0
status.vblank_interrupt_enabled = bit32.band(byte, 0x10) ~= 0
status.hblank_interrupt_enabled = bit32.band(byte, 0x08) ~= 0
end
return registers
end
return Registers
|
pg = pg or {}
pg.enemy_data_statistics_263 = {
[13600104] = {
cannon = 35,
reload = 150,
speed_growth = 0,
cannon_growth = 2000,
battle_unit_type = 60,
air = 0,
base = 126,
dodge = 0,
durability_growth = 33600,
antiaircraft = 40,
speed = 10,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 1200,
hit = 10,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 0,
durability = 650,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600104,
equipment_list = {
1000630,
1000635,
1000640
}
},
[13600105] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
battle_unit_type = 65,
air = 35,
base = 127,
dodge = 0,
durability_growth = 27200,
antiaircraft = 40,
speed = 10,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 1200,
hit = 10,
antisub_growth = 0,
air_growth = 1800,
antisub = 0,
torpedo = 0,
durability = 560,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600105,
bound_bone = {
cannon = {
{
1.8,
1.14,
0
}
},
torpedo = {
{
1.07,
0.24,
0
}
},
antiaircraft = {
{
1.8,
1.14,
0
}
},
plane = {
{
1.8,
1.14,
0
}
}
},
equipment_list = {
1000645,
1000650,
1000655,
1000660
}
},
[13600106] = {
cannon = 6,
reload = 150,
speed_growth = 0,
cannon_growth = 468,
battle_unit_type = 50,
air = 0,
base = 248,
dodge = 15,
durability_growth = 18800,
antiaircraft = 20,
speed = 33,
reload_growth = 0,
dodge_growth = 222,
luck = 0,
antiaircraft_growth = 1638,
hit = 14,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 54,
durability = 510,
armor_growth = 0,
torpedo_growth = 4491,
luck_growth = 0,
hit_growth = 210,
armor = 0,
id = 13600106,
equipment_list = {
1000710,
1000715,
1000720
}
},
[13600107] = {
cannon = 20,
reload = 150,
speed_growth = 0,
cannon_growth = 936,
battle_unit_type = 55,
air = 0,
base = 249,
dodge = 11,
durability_growth = 23120,
antiaircraft = 28,
speed = 25,
reload_growth = 0,
dodge_growth = 162,
luck = 0,
antiaircraft_growth = 3744,
hit = 14,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 27,
durability = 630,
armor_growth = 0,
torpedo_growth = 3366,
luck_growth = 0,
hit_growth = 210,
armor = 0,
id = 13600107,
equipment_list = {
1000680,
1000685,
1000690,
1000695
}
},
[13600108] = {
cannon = 24,
reload = 150,
speed_growth = 0,
cannon_growth = 2016,
battle_unit_type = 60,
air = 0,
base = 250,
dodge = 7,
durability_growth = 41600,
antiaircraft = 35,
speed = 18,
reload_growth = 0,
dodge_growth = 102,
luck = 0,
antiaircraft_growth = 2880,
hit = 14,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 33,
durability = 780,
armor_growth = 0,
torpedo_growth = 2763,
luck_growth = 0,
hit_growth = 210,
armor = 0,
id = 13600108,
equipment_list = {
1000740,
1000745,
1000750,
1000755
}
},
[13600109] = {
cannon = 31,
reload = 150,
speed_growth = 0,
cannon_growth = 2592,
battle_unit_type = 65,
air = 0,
base = 251,
dodge = 3,
durability_growth = 49600,
antiaircraft = 45,
speed = 18,
reload_growth = 0,
dodge_growth = 48,
luck = 0,
antiaircraft_growth = 3744,
hit = 18,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 0,
durability = 1020,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 210,
armor = 0,
id = 13600109,
equipment_list = {
1000775,
1000780,
1000785
},
buff_list = {
{
ID = 50510,
LV = 1
}
}
},
[13600110] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
battle_unit_type = 60,
air = 31,
base = 252,
dodge = 9,
durability_growth = 39200,
antiaircraft = 38,
speed = 22,
reload_growth = 0,
dodge_growth = 132,
luck = 0,
antiaircraft_growth = 3168,
hit = 14,
antisub_growth = 0,
air_growth = 2574,
antisub = 0,
torpedo = 0,
durability = 890,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 210,
armor = 0,
id = 13600110,
equipment_list = {
1000800,
1000805,
1000815,
1000820
}
},
[13600111] = {
cannon = 0,
reload = 150,
hit_growth = 120,
cannon_growth = 0,
pilot_ai_template_id = 20001,
air = 0,
speed_growth = 0,
dodge = 0,
battle_unit_type = 20,
base = 90,
durability_growth = 6800,
reload_growth = 0,
dodge_growth = 0,
antiaircraft = 0,
speed = 30,
hit = 8,
antisub_growth = 0,
air_growth = 0,
luck = 0,
torpedo = 0,
durability = 650,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
antiaircraft_growth = 0,
armor = 0,
antisub = 0,
id = 13600111,
appear_fx = {
"appearsmall"
}
},
[13600112] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
pilot_ai_template_id = 20001,
air = 0,
battle_unit_type = 35,
dodge = 0,
base = 70,
durability_growth = 2550,
antiaircraft = 0,
reload_growth = 0,
dodge_growth = 0,
speed = 15,
luck = 0,
hit = 8,
antisub_growth = 0,
air_growth = 0,
wave_fx = "danchuanlanghuaxiao2",
torpedo = 15,
durability = 250,
armor_growth = 0,
torpedo_growth = 864,
luck_growth = 0,
hit_growth = 120,
armor = 0,
antiaircraft_growth = 0,
id = 13600112,
antisub = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
1000860
}
},
[13600113] = {
cannon = 45,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
pilot_ai_template_id = 80000,
air = 0,
battle_unit_type = 15,
dodge = 0,
base = 80,
durability_growth = 2550,
antiaircraft = 0,
reload_growth = 0,
dodge_growth = 0,
speed = 30,
luck = 0,
hit = 81,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 0,
torpedo = 85,
durability = 60,
armor_growth = 0,
torpedo_growth = 900,
luck_growth = 0,
hit_growth = 1200,
armor = 0,
id = 13600113,
antisub = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
1000865
}
},
[13600121] = {
cannon = 7,
reload = 150,
speed_growth = 0,
cannon_growth = 500,
battle_unit_type = 25,
air = 0,
base = 445,
dodge = 0,
durability_growth = 4000,
antiaircraft = 25,
speed = 15,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 800,
hit = 10,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 30,
durability = 150,
armor_growth = 0,
torpedo_growth = 3000,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600121,
equipment_list = {
1100070,
1100180,
1100490
}
},
[13600122] = {
cannon = 13,
reload = 150,
speed_growth = 0,
cannon_growth = 800,
battle_unit_type = 30,
air = 0,
base = 446,
dodge = 0,
durability_growth = 5920,
antiaircraft = 45,
speed = 15,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 1600,
hit = 10,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 24,
durability = 260,
armor_growth = 0,
torpedo_growth = 2000,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600122,
equipment_list = {
1100335,
1100270,
1100490
}
},
[13600123] = {
cannon = 16,
reload = 150,
speed_growth = 0,
cannon_growth = 1500,
battle_unit_type = 35,
air = 0,
base = 447,
dodge = 0,
durability_growth = 16000,
antiaircraft = 35,
speed = 12,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 1000,
hit = 10,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 16,
durability = 410,
armor_growth = 0,
torpedo_growth = 1200,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600123,
equipment_list = {
1100550,
1100585
}
},
[13600124] = {
cannon = 39,
reload = 150,
speed_growth = 0,
cannon_growth = 2000,
battle_unit_type = 60,
air = 0,
base = 448,
dodge = 0,
durability_growth = 33600,
antiaircraft = 40,
speed = 10,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 1200,
hit = 10,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 0,
durability = 780,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600124,
equipment_list = {
1100050,
1100915,
1100920
}
},
[13600125] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
battle_unit_type = 65,
air = 42,
base = 449,
dodge = 0,
durability_growth = 27200,
antiaircraft = 40,
speed = 10,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
antiaircraft_growth = 1200,
hit = 10,
antisub_growth = 0,
air_growth = 1800,
antisub = 0,
torpedo = 0,
durability = 720,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 144,
armor = 0,
id = 13600125,
equipment_list = {
1100050,
1100385,
1100930,
1100935
}
},
[13600127] = {
cannon = 20,
reload = 150,
speed_growth = 0,
cannon_growth = 936,
battle_unit_type = 55,
air = 0,
base = 446,
dodge = 11,
durability_growth = 30500,
antiaircraft = 28,
speed = 15,
reload_growth = 0,
dodge_growth = 162,
luck = 0,
antiaircraft_growth = 3744,
hit = 14,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 27,
durability = 760,
armor_growth = 0,
torpedo_growth = 3366,
luck_growth = 0,
hit_growth = 210,
armor = 0,
id = 13600127,
equipment_list = {
1100335,
1100270,
1100490,
650007
}
}
}
return
|
local parser = require("moocscript.parser")
local compile = require("moocscript.compile")
describe("test success #switch", function()
local mnstr=[[
a, b = ...;
switch a {
case 1:
return 10
case 2, 3:
switch b {
case 4:
return 40
case 5, 6:
return 60
default:
return 90
}
default:
return 20
}
]]
local ret, ast = parser.parse(mnstr)
it("should get ast", function()
assert.is_true(ret)
assert.is_true(type(ast) == "table")
end)
local ret, content = compile.compile({}, ast)
it("should get compiled lua", function()
assert.is_true(ret)
assert.is_true(type(content) == "string")
end)
local f = load(content, "test", "t")
it("should get function", function()
assert(type(f) == "function")
local a1 = f(1)
local a2 = f(2, 4)
local a3 = f(3)
local a4 = f()
assert.is_equal(a1, 10)
assert.is_equal(a2, 40)
assert.is_equal(a3, 90)
assert.is_equal(a4, 20)
end)
end)
describe("test failed #switch", function()
local mnstr=[[
switch ... {
case 10: break
default:
return 10
}
]]
local ret, ast = parser.parse(mnstr)
it("should get ast", function()
assert.is_true(ret)
end)
it("has error", function()
local ret, content = compile.compile({}, ast)
assert.is_false(ret)
assert.is_equal(content, "_:2: case 10: break <not in loop 'break'>")
end)
end) |
function sprint(msg,...)
return string.format(msg,...)
end
function isAllowed(level)
if Config.Debug then
if isTable(Config.DebugLevel) and not emptyTable(Config.DebugLevel) then
for _,lev in pairs(Config.DebugLevel) do
if lev == level then
return true
end
end
return false
else
if level == Config.DebugLevel then
return true
end
return false
end
end
end
function rdebug()
local self = {}
self.prefix = 'rcore'
self.info = function(msg,...)
if isAllowed('INFO') then
print('^5['..self.prefix..'|info] ^7'..sprint(msg,...))
end
end
self.success = function(msg,...)
if isAllowed('SUCCESS') then
print('^5['..self.prefix..'|success] ^7'..sprint(msg,...))
end
end
self.critical = function(msg,...)
if isAllowed('CRITICAL') then
print('^1['..self.prefix..'|critical] ^7'..sprint(msg,...))
end
end
self.error = function(msg,...)
if isAllowed('ERROR') then
print('^1['..self.prefix..'|error] ^7'..sprint(msg,...))
end
end
self.security = function(msg,...)
if isAllowed('SECURITY') then
print('^3['..self.prefix..'|security] ^7'..sprint(msg,...))
end
end
self.securitySpam = function(msg,...)
if isAllowed('SECURITY_SPAM') then
print('^3['..self.prefix..'|security] ^7'..sprint(msg,...))
end
end
self.debug = function(msg,...)
if isAllowed('DEBUG') then
print('^2['..self.prefix..'|debug] ^7'..sprint(msg,...))
end
end
self.setupPrefix = function(prefix)
self.prefix = prefix
end
self.getPrefix = function()
return self.prefix
end
return self
end
exports('rdebug',rdebug)
function dprint(str, ...)
local dbg = rdebug()
dbg.info(str,...)
end
|
--[[
local myNAME = "merBandAidZouiFixes"
local EM = EVENT_MANAGER
local SV = {}
local function onLoaded(eventCode, addonName)
if addonName == "ZO_Ingame" then
EM:UnregisterForEvent(myNAME, eventCode)
SV = ZO_SavedVars:NewAccountWide("ZO_Ingame_SavedVariables", 17, myNAME, SV)
end
end
EM:RegisterForEvent(myNAME, EVENT_ADD_ON_LOADED, onLoaded)
--]]
|
local json = require( "acid.json" )
local cjson = require( "cjson" )
function test.enc(t)
local cases = {
{nil , nil, 'null'},
{{}, nil, '{}'},
{{}, {is_array=true}, '[]'},
{{1, "2"}, nil, cjson.encode({1, "2"})},
{{a=1, b='2', c={c1=1}}, nil, cjson.encode({a=1, b='2', c={c1=1}})},
}
for _, case in ipairs(cases) do
local j, opt, exp = unpack(case)
t:eq(json.enc(j, opt), exp)
end
end
function test.dec(t)
local cases = {
{nil, nil, nil},
{'{"a":1, "b":2}', nil, {a=1, b=2}},
{'{"a":1, "b":2, "c":null}', nil, {a=1, b=2}},
{'{"a":1, "b":2, "c":null}', {use_nil=false}, {a=1, b=2, c=cjson.null}},
}
for _, case in ipairs(cases) do
local j, opt, exp = unpack(case)
t:eqdict(json.dec(j, opt), exp)
end
end
|
#!/usr/bin/env lua
require 'Test.More'
plan(6)
if not require_ok 'Spore.Middleware.Parameter.Force' then
skip_rest "no Spore.Middleware.Parameter.Force"
os.exit()
end
local mw = require 'Spore.Middleware.Parameter.Force'
is( require 'Spore'.early_validate, false, "early_validate" )
local req = require 'Spore.Request'.new({ spore = { params = { prm1 = 0 } }})
type_ok( req, 'table', "Spore.Request.new" )
is( req.env.spore.params.prm1, 0 )
local _ = mw.call( {
prm1 = 1,
prm2 = 2,
}, req )
is( req.env.spore.params.prm1, 1 )
is( req.env.spore.params.prm2, 2 )
|
--IF YOU WANT TO MODIFY THIS SWEP GO TO RCS_SCOUT INSTEAD, UNLESS IF YOU WANT TO EDIT THE FUNCTIONS OR SOMETHING THEN GO AHEAD
if (SERVER) then
AddCSLuaFile("shared.lua")
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
end
if (CLIENT) then
SWEP.PrintName = "AWP"
SWEP.Author = "cheesylard"
SWEP.ViewModelFlip = true
SWEP.CSMuzzleFlashes = true
SWEP.Description = "Accuracy International Arctic Warfare Magnum "
.. "sniper rifle (Yeah, I didn't put that in the "
.. "name, because it's a really long)"
SWEP.SlotPos = 1
SWEP.IconLetter = "r"
SWEP.NameOfSWEP = "rcs_awp" --always make this the name of the folder the SWEP is in.
killicon.AddFont(SWEP.NameOfSWEP, "CSKillIcons", SWEP.IconLetter, Color(255, 80, 0, 255))
end
SWEP.Category = "RealCS"
SWEP.Base = "rcs_base_bsnip"
SWEP.Penetrating = true
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.HoldType = "ar2"
SWEP.ViewModel = "models/weapons/v_snip_awp.mdl"
SWEP.WorldModel = "models/weapons/w_snip_awp.mdl"
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Sound = Sound("Weapon_AWP.Single")
SWEP.Primary.Recoil = 2
SWEP.Primary.Damage = 125
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.01 --regular ol' spread
SWEP.Primary.ClipSize = 10 --ammo in clip
SWEP.Primary.Delay = 1.3 --durr
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = true --duhhh
SWEP.Primary.Ammo = "ar2" --keep as is, doesn't really effect the swep that much unless if in a gamemode then you make custom ammo
SWEP.Primary.MaxReserve = 30
SWEP.IncreasesSpread = false --does it increase spread the longer you hold down the trigger?
SWEP.Primary.MaxSpread = 0.01 --the maximum amount the spread can go by, best left at 0.20 or lower
//SWEP.Primary.Handle
//SWEP.Primary.HandleCut --these aren't needed because SWEP.SpreadIncrease is set to false
//SWEP.Primary.SpreadIncrease
SWEP.MoveSpread = 100 --multiplier for spread when you are moving
SWEP.JumpSpread = 200 --multiplier for spread when you are jumping
SWEP.CrouchSpread = 0.5 --multiplier for spread when you are crouching
SWEP.Zoom = 0 --pretty self explanitory, don't change this unless if you want the gun to be fucked up
SWEP.ZoomOutDelay = 0.2 -- this is used for the delay between when you shoot and when it zooms out to pull the bolt
SWEP.ZoomInDelay = 1.5 --always set this 0.2 higher than SWEP.Primary.Delay
SWEP.Zoom1 = 30 --Field of view for the first zoom
SWEP.Zoom2 = 10 --field of view for the second zoom
SWEP.Zoom0Cone = 0.2 --spread for when not zoomed
SWEP.Zoom1Cone = 0.0001 --spread for when zoomed once
SWEP.Zoom2Cone = 0.00001 --spread for when zoomed twice
SWEP.EjectDelay = 0.53
SWEP.Secondary.ClipSize = -1 --dont need cuz it just zooms you in
SWEP.Secondary.DefaultClip = -1 --dont need cuz it just zooms you in
SWEP.Secondary.Automatic = true --dont need cuz it just zooms you in
SWEP.Secondary.Ammo = "none" --dont need cuz it just zooms you in
SWEP.IronSightsPos = Vector (5.5739, 0, 2.0518)
SWEP.IronSightsAng = Vector (0, 0, 0)
|
UTIL = UTIL or require "util"
Game = Game or require "game"
local game
function love.load()
game = Game:new()
game.coins:add(20, 20)
game.scene:load("Fase1")
end
function love.draw()
game:draw()
end
function love.update(dt)
dt = dt * UTIL.tile
local walk = 0
if love.keyboard.isDown("a") then
walk = walk - 1
end
if love.keyboard.isDown("d") then
walk = walk + 1
end
game.player:walk(walk)
if love.keyboard.isDown("w") then
game.player:jump()
end
game:update(dt)
end
function love.keypressed(key)
if key == "escape" then
love.event.quit()
end
end
function love.keyreleased(key)
if key == "w" then
game.player:stopJump()
end
end
--[[
function love.resize(w, h)
end
function love.focus(bool)
end
function love.keypressed(key, unicode)
end
function love.keyreleased(key, unicode)
end
function love.mousepressed(x, y, button)
end
function love.mousereleased(x, y, button)
end
function love.quit()
end
--]]
|
require 'ffxi.recast';
local config = require('config');
local party = require('party');
local actions = require('actions');
local packets = require('packets');
local buffs = require('behaviors.buffs')
local healing = require('behaviors.healing');
local jwhm = require('jobs.whm');
local magic = require('magic');
local levels = require('levels');
local spells = packets.spells;
local status = packets.status;
local stoe = packets.stoe;
-- spells to effect
local jbrd = {
stack_toggle = 0;
};
function jbrd:tick()
local cnf = config:get();
local tid = AshitaCore:GetDataManager():GetTarget():GetTargetServerId();
local tp = AshitaCore:GetDataManager():GetParty():GetMemberCurrentTP(0);
local status = party:GetBuffs(0);
if (actions.busy) then return end
if (status[packets.status.EFFECT_INVISIBLE]) then return end
if (not(cnf.bard.sing)) then return end
local statustbl = AshitaCore:GetDataManager():GetPlayer():GetStatusIcons();
if (status[packets.status.EFFECT_INVISIBLE]) then return end
if (not(not(cnf.bard.songvar1)) and ashita.ffxi.recast.get_spell_recast_by_index(spells[cnf.bard.songvar1]) == 0) then
local need = not(status[stoe[cnf.bard.songvar1]]);
if (not(need) and stoe[cnf.bard.songvar1] == stoe[cnf.bard.songvar2]) then
local buffcount = 0;
for slot = 0, 31, 1 do
local buff = statustbl[slot];
if (buff == stoe[cnf.bard.songvar1]) then
buffcount = buffcount + 1;
end
end
if (buffcount < 2) then
need = true;
end
end
if (cnf.bard.songvar1 and need) then
local spell = magic:highest(cnf.bard.song1, false);
if (spell) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(actions.pause, true))
:next(partial(magic.cast, magic, spell , '<me>'))
:next(partial(wait, 8))
:next(partial(actions.pause, false))
:next(function(self) actions.busy = false; end));
return;
end
end
end
if (not(not(cnf.bard.songvar2)) and ashita.ffxi.recast.get_spell_recast_by_index(spells[cnf.bard.songvar2]) == 0) then
local need = not(status[stoe[cnf.bard.songvar2]]);
if (not(need) and stoe[cnf.bard.songvar1] == stoe[cnf.bard.songvar2]) then
local buffcount = 0;
for slot = 0, 31, 1 do
local buff = statustbl[slot];
if (buff == stoe[cnf.bard.songvar2]) then
buffcount = buffcount + 1;
end
end
if (buffcount < 2) then
need = true;
end
end
if (cnf.bard.songvar2 and need) then
local spell = magic:highest(cnf.bard.song2, false);
if (spell) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(actions.pause, true))
:next(partial(magic.cast, magic, spell , '<me>'))
:next(partial(wait, 8))
:next(partial(actions.pause, false))
:next(function(self) actions.busy = false; end));
return;
end
end
end
if (healing:SupportHeal()) then return end
end
function jbrd:attack(tid)
local cnf = config:get();
if (cnf['bard']['melee']) then
actions:queue(actions:new()
:next(function(self)
AshitaCore:GetChatManager():QueueCommand('/attack ' .. tid, 0);
end)
:next(function(self)
ATTACK_TID = tid;
AshitaCore:GetChatManager():QueueCommand('/follow ' .. tid, 0);
end)
:next(partial(wait, 4)));
end
local spell = magic:highest('Foe Requiem', false);
if (spell) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(actions.pause, true))
:next(partial(magic.cast, magic, spell , tid))
:next(partial(wait, 2))
:next(partial(actions.pause, false)));
end
if (magic:CanCast('BATTLEFIELD_ELEGY')) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(actions.pause, true))
:next(partial(magic.cast, magic, 'Battlefield Elegy', tid))
:next(partial(wait, 2))
:next(partial(actions.pause, false))
:next(function(self) actions.busy = false; end));
end
spell = magic:highest('Dia', false);
if (spell) then
actions.busy = true;
actions:queue(actions:new()
:next(partial(actions.pause, true))
:next(partial(magic.cast, magic, spell, tid))
:next(partial(wait, 1))
:next(partial(actions.pause, false)));
end
if (magic:CanCast('LIGHTNING_THRENODY')) then
actions.busy = true;
action:next(partial(magic.cast, magic, 'Lightning Threnody', tid))
:next(partial(wait, 2));
end
actions:queue(actions:new()
:next(function(self) actions.busy = false; end));
end
function jbrd:sleep(tid, aoe)
if (not(aoe) and magic:CanCast(spells.FOE_LULLABY)) then
actions:queue(actions:new()
:next(partial(actions.pause, true))
:next(partial(magic.cast, magic, 'Foe Lullaby', tid))
:next(partial(wait, 2)))
:next(partial(actions.pause, false));
elseif (aoe and magic:CanCast(spells.HORDE_LULLABY)) then
actions:queue(actions:new()
:next(partial(magic.cast, magic, 'Horde Lullaby', tid))
:next(partial(wait, 2)));
end
end
function jbrd:bard(bard, command, song, silent)
local cnf = config:get();
local brd = cnf['bard'];
local onoff = brd['sing'] and 'on' or 'off';
local song1 = brd['song1'] or 'none';
local song2 = brd['song2'] or 'none';
local songvar;
if(song ~= nil) then
songvar = song:upper():gsub("'", ""):gsub(" ", "_");
end
if (command ~= nil) then
if (command == 'on' or command == 'true') then
brd['sing'] = true;
onoff = 'on';
elseif (command == 'off' or command == 'false') then
brd['sing'] = false;
onoff = 'off';
elseif (command == '1' and song and spells[songvar]) then
brd['song1'] = song;
brd['songvar1'] = songvar;
song1 = song;
elseif (command == '2' and song and spells[songvar]) then
brd['song2'] = song;
brd['songvar2'] = songvar;
song2 = song;
elseif (command =='1' and song == 'none') then
brd['song1'] = nil;
brd['songvar1'] = nil;
song1 = 'none';
elseif (command =='2' and song == 'none') then
brd['song2'] = nil;
brd['songvar2'] = nil;
song2 = 'none';
elseif (command == 'run') then
jbrd:bard(bard, '1', 'raptor mazurka', true);
jbrd:bard(bard, '2', 'chocobo mazurka');
return;
elseif (command == 'sustain') then
jbrd:bard(bard, '1', "mage's ballad ii", true);
jbrd:bard(bard, '2', "army's paeon v");
return;
elseif (command == 'mana') then
jbrd:bard(bard, '1', "mage's ballad ii", true);
jbrd:bard(bard, '2', "mage's ballad");
return;
elseif (command == 'melee') then
brd['melee'] = not(brd['melee']);
end
config:save();
end
if (not(silent)) then
local msg = "I'm a ";
if (brd['melee']) then
msg = msg .. 'MELEE ';
end
msg = msg .. 'Bard!\nsinging: ' .. onoff .. '\n1: ' .. song1 .. '\n2: ' .. song2;
AshitaCore:GetChatManager():QueueCommand('/l2 ' .. msg, 1);
end
end
return jbrd;
|
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PrgAmbientLife["Visitbarchair"] = function(unit, bld, obj, spot, slot_data, slot, slotname)
local rnd, _x, _y, _z
unit:PushDestructor(function(unit)
unit:Detach()
end)
obj:SetStateText("idle", const.eDontCrossfade)
unit:PlayState("spacebarSitStart")
unit:SetStateText("spacebarSitIdle", const.eDontCrossfade)
obj:Attach(unit, spot)
obj:PlayState("up", 1, const.eDontCrossfade)
while unit:VisitTimeLeft() > 0 do
rnd = bld:Random(100)
if rnd < 50 then
unit:PlayState("spacebarSitDrinkStart", 1, const.eDontCrossfade)
unit:PlayState("spacebarSitDrinkIdle", 1, const.eDontCrossfade)
unit:PlayState("spacebarSitDrinkEnd", 1, const.eDontCrossfade)
end
unit:PlayState("spacebarSitIdle", 1, const.eDontCrossfade)
if unit.visit_restart then unit:PopAndCallDestructor() return end
end
obj:PlayState("up", 1, const.eReverse + const.eDontCrossfade + const.eDontCrossfadeNext)
obj:SetStateText("idle", const.eDontCrossfade)
unit:Detach()
_x, _y, _z = obj:GetSpotLocPosXYZ(spot)
unit:SetPos(_x, _y, _z, 0)
unit:SetAngle(obj:GetSpotAngle2D(spot), 0)
unit:PlayState("spacebarSitEnd", 1, const.eDontCrossfadeNext)
unit:SetAngle(unit:GetVisualAngle() + 10800, 0)
unit:SetStateText("idle", const.eDontCrossfade)
unit:PopAndCallDestructor()
end
|
-- south path
room = {
short = "south001",
name = "Town Path",
description = [[This is the path through the town.]]
}
exits = {
{ name="North", alias="N", lua="center000",
description = "There is a path to the north, it seems to go to the town center." },
{ name="South", alias="S", lua="south002",
description = "There is a path to the south." },
}
function OnLoad() end
function OnUnload() end
function RoomDescription() end
function OnPoll() end
|
--[[
Following table is database of PCI devices identifiers and drivers in OpenWrt to
support them. Feel free to expand it with additional devices.
Every device has to have numerical 'vendor' and 'device' identifier and list of
'packages' defined. Please also add comment with device name.
]]
local db = {
{ -- Qualcomm Atheros AR9287 Wireless Network Adapter
vendor = 0x168c,
device = 0x002e,
packages = {"kmod-ath9k"}
},
{ -- Qualcomm Atheros AR93xx Wireless Network Adapter (rev 01)
vendor = 0x168c,
device = 0x0030,
packages = {"kmod-ath9k"}
},
{ -- Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter
vendor = 0x168c,
device = 0x0042,
packages = {"kmod-ath10k", "ath10k-firmware-qca9377"}
},
{ -- Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
vendor = 0x168c,
device = 0x003c,
packages = {"kmod-ath10k", "ath10k-firmware-qca988x"}
},
{ -- Qualcomm Atheros QCA9984 802.11ac Wave 2 Wireless Network Adapter
vendor = 0x168c,
device = 0x0046,
packages = {"kmod-ath10k", "ath10k-firmware-qca9984"}
},
{ -- MEDIATEK Corp. Device 7612
vendor = 0x14c3,
device = 0x7612,
packages = {"kmod-mt76"}
},
{ -- MEDIATEK Corp. Device 7615
vendor = 0x14c3,
device = 0x7615,
packages = {"kmod-mt7615e"}
},
}
----------------------------------------------------------------------------------
if devices == nil then
ERROR("Invalid usage of PCI drivers, variable 'devices' is not defined.")
return
end
for _, device in pairs(devices) do
for _, dbdev in pairs(db) do
if (type(device) == "string" and device == "all") or
(type(device) == "table" and device.vendor == dbdev.vendor and device.device == dbdev.device) then
for _, package in pairs(dbdev.packages) do
Install(package, { priority = 40 })
end
end
end
end
|
-- Online Interiors IPL Edits
-- Use https://github.com/Bob74/bob74_ipl/wiki to edit below
-- Low End House (Location)
|
local CRYPT = require "lcrypt"
local dhsecret = CRYPT.dhsecret
local dhexchange = CRYPT.dhexchange
local DH = {}
function DH.dhsecret (...)
return dhsecret(...)
end
function DH.dhexchange (...)
return dhexchange(...)
end
-- 初始化函数
return function (t)
for k, v in pairs(DH) do
t[k] = v
end
return DH
end |
--
-- $Id$
--
module( "resmng" )
svnnum("$Id$")
propCharacter = {
[CHAR_TEST] = {
ID = CHAR_TEST,
Name = nil,
Skeleton = "Hero/test",
Shape = {10001,10002,10003,10004,10005},
HeadImage = "ui/sprite/head",
AttrID = 1,
Skills = {[resmng.AttackName.LightFist]="TestLightFist",[resmng.AttackName.HeavyFist]="TestHeavFist"},
ComboList = {"LightLeg", "HeavyLeg"},
Version = nil,
},
}
|
--[[
Flappy Bird Clone
Lua Build for Love2d
PlayState for state passed from StateMachine
Defines behavior and updates/rendering
Author: Troy Martin
[email protected]
]]
PlayState = Class{__includes = BaseState}
PIPE_SPEED = 60
PIPE_WIDTH = 70
PIPE_HEIGHT = 288
BIRD_WIDTH = 38
BIRD_HEIGHT = 24
--[[
Initialize properties
]]
function PlayState:init()
self.bird = Bird()
self.pipePairs = {}
self.timer = 0
-- scoring
self.score = 0
-- pipe gap
self.lastY = -PIPE_HEIGHT + math.random(80) + 20
end
-- Called once per frame, handles logic
function PlayState:update(dt)
-- updates pipe spawning timer
self.timer = self.timer + dt
-- spawn new pipe every 2 seconds
if self.timer > 2 then
local y = math.max(-PIPE_HEIGHT + 10,
math.min(self.lastY + math.random(-20, 20), VIRTUAL_HEIGHT - 90 - PIPE_HEIGHT))
self.lastY = y
-- add new pipes to pipePairs
table.insert(self.pipePairs, PipePair(y))
-- reset timer
self.timer = 0
end
-- for every pair of pipes
for k, pair in pairs(self.pipePairs) do
-- scores point if bird has gone beyond pair pipe
if not pair.scored then
if pair.x + PIPE_WIDTH < self.bird.x then
self.score = self.score + 1
pair.scored = true
end
end
-- updates position of pair
pair:update(dt)
end
-- second loop to avoid table removal issues in first loop
for k, pair in pairs(self.pipePairs) do
if pair.remove then
table.remove(self.pipePairs, k)
end
end
-- update bird based on input/gravity
self.bird:update(dt)
-- collision detection using AABB
for k, pair in pairs(self.pipePairs) do
for l, pipe in pairs(pair.pipes) do
if self.bird:collides(pipe) then
gStateMachine:change('score', {
score = self.score
})
end
end
end
-- reset if bird hits ground
if self.bird.y > VIRTUAL_HEIGHT - 15 then
gStateMachine:change('score', {
score = self.score
})
end
end
-- draws to screen
function PlayState:render()
for k, pair in pairs(self.pipePairs) do
pair:render()
end
-- draws score to screen
love.graphics.setFont(flappyFont)
love.graphics.print('Score: ' .. tostring(self.score), 8, 8)
self.bird:render()
end |
t1 = {}
t1.value = "one"
t2 = {}
t2.value = "two"
t3 = {}
t3.value = "three"
mt = {}
setmetatable(t1, mt)
setmetatable(t2, mt)
setmetatable(t3, mt)
mt.__concat = function (table, other)
return table.value .. other.value
end
assert(t1 .. t2 == "onetwo")
assert(t1 .. t3 == "onethree")
assert(t2 .. t3 == "twothree")
|
/*
* @package : rlib
* @module : ipcrypt
* @requires : rbit
* @author : Richard [http://steamcommunity.com/profiles/76561198135875727]
* @copyright : (C) 2020 - 2020
* @since : 3.0.0
* @website : https://rlib.io
* @docs : https://docs.rlib.io
*
* MIT License
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
ipcrypt = { }
function ipcrypt.Dig2Str( i )
local ret = rbit:band( rbit:rshift( i, 24 ), 0xFF ) .. '.' .. rbit:band( rbit:rshift( i, 16 ), 0xFF ) .. '.' .. rbit:band( rbit:rshift( i, 8 ), 0xFF ) .. '.' .. rbit:band( i, 0xFF )
return ret
end
function ipcrypt.Str2Dig( ipstr )
local ret = 0
for d in string.gmatch( ipstr, '%d+' ) do
ret = ret * 256 + d
end
return ret
end
return ipcrypt |
local pairs = pairs
local type = type
local xpcall = xpcall
local setmetatable = setmetatable
local Router = require("lor.lib.router.router")
local Request = require("lor.lib.request")
local Response = require("lor.lib.response")
local View = require("lor.lib.view")
local supported_http_methods = require("lor.lib.methods")
local router_conf = {
strict_route = true,
ignore_case = true,
max_uri_segments = true,
max_fallback_depth = true
}
local App = {}
function App:new()
local instance = {}
instance.cache = {}
instance.settings = {}
instance.router = Router:new()
setmetatable(instance, {
__index = self,
__call = self.handle
})
instance:init_method()
return instance
end
function App:run(final_handler)
local request = Request:new()
local response = Response:new()
local enable_view = self:getconf("view enable")
if enable_view then
local view_config = {
view_enable = enable_view,
view_engine = self:getconf("view engine"), -- view engine: resty-template or others...
view_ext = self:getconf("view ext"), -- defautl is "html"
view_layout = self:getconf("view layout"), -- defautl is ""
views = self:getconf("views") -- template files directory
}
local view = View:new(view_config)
response.view = view
end
self:handle(request, response, final_handler)
end
function App:init(options)
self:default_configuration(options)
end
function App:default_configuration(options)
options = options or {}
-- view and template configuration
if options["view enable"] ~= nil and options["view enable"] == true then
self:conf("view enable", true)
else
self:conf("view enable", false)
end
self:conf("view engine", options["view engine"] or "tmpl")
self:conf("view ext", options["view ext"] or "html")
self:conf("view layout", options["view layout"] or "")
self:conf("views", options["views"] or "./app/views/")
self.locals = {}
self.locals.settings = self.setttings
end
-- dispatch `req, res` into the pipeline.
function App:handle(req, res, callback)
local router = self.router
local done = callback or function(err)
if err then
if ngx then ngx.log(ngx.ERR, err) end
res:status(500):send("internal error! please check log.")
end
end
if not router then
return done()
end
local err_msg
local ok, e = xpcall(function()
router:handle(req, res, done)
end, function(msg)
err_msg = msg
end)
if not ok then
done(err_msg)
end
end
function App:use(path, fn)
self:inner_use(3, path, fn)
end
-- just a mirror for `erroruse`
function App:erruse(path, fn)
self:erroruse(path, fn)
end
function App:erroruse(path, fn)
self:inner_use(4, path, fn)
end
-- should be private
function App:inner_use(fn_args_length, path, fn)
local router = self.router
if path and fn and type(path) == "string" then
router:use(path, fn, fn_args_length)
elseif path and not fn then
fn = path
path = nil
router:use(path, fn, fn_args_length)
else
error("error usage for `middleware`")
end
return self
end
function App:init_method()
for http_method, _ in pairs(supported_http_methods) do
self[http_method] = function(_self, path, ...) -- funcs...
_self.router:app_route(http_method, path, ...)
return _self
end
end
end
function App:all(path, ...)
for http_method, _ in pairs(supported_http_methods) do
self.router:app_route(http_method, path, ...)
end
return self
end
function App:conf(setting, val)
self.settings[setting] = val
if router_conf[setting] == true then
self.router:conf(setting, val)
end
return self
end
function App:getconf(setting)
return self.settings[setting]
end
function App:enable(setting)
self.settings[setting] = true
return self
end
function App:disable(setting)
self.settings[setting] = false
return self
end
--- only for dev
function App:gen_graph()
return self.router.trie:gen_graph()
end
return App
|
local autoplace_utils = require("autoplace_utils")
function world_autoplace_settings(world, noise_layer, rectangles)
local ret =
{
{
influence = 0.1,
noise_layer = noise_layer,
noise_persistence = 0.7,
octaves_difference = -1
}
}
autoplace_utils.peaks(rectangles, ret)
return { peaks = ret, control = world }
end
function world_blockage_autoplace_settings(world, noise_layer, from_depth, rectangles)
local ret =
{
{
influence = 1e3 + from_depth,
noise_layer = noise_layer,
elevation_optimal = -5000 - from_depth,
elevation_range = 5000,
elevation_max_range = 5000, -- everywhere below elevation 0 and nowhere else
}
}
if rectangles == nil then
ret[2] = { influence = 1 }
end
autoplace_utils.peaks(rectangles, ret)
return { peaks = ret, control = world }
end
-- technology
data:extend({
{
type = "technology",
name = "nidavellir-access",
icon = "__nineworlds__/graphics/tech_nif_access.png",
effects =
{
{
type = "unlock-recipe",
recipe = "nw-tunnel"
}
},
prerequisites = {},
unit =
{
count = 10,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1},
},
time = 20
}
},
{
type = "technology",
name = "svartalfheim-access",
icon = "__nineworlds__/graphics/tech_nif_access.png",
prerequisites = {
"nidavellir-access"
},
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 2},
{"science-pack-2", 1},
},
time = 20
}
}
}) |
-- Extreme Reactors Control by SeekerOfHonjo --
-- Original work by Thor_s_Crafter on https://github.com/ThorsCrafter/Reactor-and-Turbine-control-program --
-- Version 1.0 --
-- Loads the Touchpoint API (by Lyqyd)
shell.run("cp /extreme-reactors-control/config/touchpoint.lua /touchpoint")
os.loadAPI("touchpoint")
shell.run("rm touchpoint")
-- Touchpoint Page
local page = touchpoint.new(touchpointLocation)
-- Button Labels
local startOn = {}
local startOff = {}
function _G.createButtons()
page:add("Deutsch",nil,39,11,49,11)
page:add("English",nil,39,13,49,13)
page:add("Start program",startTC,3,5,20,5)
page:add("Reactor only",function() switchProgram("Reactor") end,3,9,20,9)
page:add("Turbines",function() switchProgram("Turbine") end,3,11,20,11)
page:add("Automatic",nil,23,9,35,9)
page:add("Manual",nil,23,11,35,11)
page:add("Options",displayOptions,3,16,20,16)
page:add("Quit program",exit,3,17,20,17)
page:add("Reboot",restart,3,18,20,18)
page:add("menuOn",nil,39,7,49,7)
startOn = {" On ",label = "menuOn"}
startOff = {" Off ",label = "menuOn"}
page:toggleButton("English")
if program == "turbine" then
page:toggleButton("Turbines")
elseif program == "reactor" then
page:toggleButton("Reactor only")
end
if overallMode == "auto" then
page:toggleButton("Automatic")
elseif overallMode == "manual" then
page:toggleButton("Manual")
end
if mainMenu then
page:rename("menuOn",startOn,true)
page:toggleButton("menuOn")
else
page:rename("menuOn",startOff,true)
end
end
function _G.exit()
controlMonitor.clear()
controlMonitor.setCursorPos(27,8)
controlMonitor.write("Program terminated!")
term.clear()
term.setCursorPos(1,1)
shell.completeProgram("/extreme-reactors-control/start/menu.lua")
end
function _G.switchProgram(currBut)
if program == "turbine" and currBut == "Reactor" then
program = "reactor"
if not page.buttonList["Reactor only"].active then
page:toggleButton("Reactor only")
end
if page.buttonList["Turbines"].active then
page:toggleButton("Turbines")
end
elseif program == "reactor" and currBut == "Turbine" then
program = "turbine"
if page.buttonList["Reactor only"].active then
page:toggleButton("Reactor only")
end
if not page.buttonList["Turbines"].active then
page:toggleButton("Turbines")
end
end
saveOptionFile()
page:draw()
displayMenu()
end
function _G.startTC()
if program == "turbine" then
shell.run("/extreme-reactors-control/program/turbineControl.lua")
elseif program == "reactor" then
shell.run("/extreme-reactors-control/program/reactorControl.lua")
end
end
function displayOptions()
shell.run("/extreme-reactors-control/program/editOptions.lua")
end
function reboot()
restart()
end
local function getClick(funct)
local event,but = page:handleEvents(os.pullEvent())
if event == "button_click" then
if but == "menuOn" then
print("menuOn")
if not mainMenu then
mainMenu = true
saveOptionFile()
page:rename("menuOn",startOn,true)
elseif mainMenu then
mainMenu = false
saveOptionFile()
page:rename("menuOn",startOff,true)
end
page:toggleButton(but)
funct()
elseif but == "Automatic" then
if page.buttonList[but].active == false then
page:toggleButton(but)
end
if overallMode == "manual" then
page:toggleButton("Manual")
elseif overallMode == "semi-manual" then
page:toggleButton("Semi-Manual")
end
overallMode = "auto"
saveOptionFile()
funct()
elseif but == "Manual" then
if page.buttonList[but].active == false then
page:toggleButton(but)
end
if overallMode == "auto" then
page:toggleButton("Automatic")
elseif overallMode == "semi-manual" then
page:toggleButton("Semi-Manual")
end
overallMode = "manual"
saveOptionFile()
funct()
else
page:flash(but)
page.buttonList[but].func()
end
else
sleep(1)
funct()
end
end
function _G.displayMenu()
controlMonitor.clear()
page:draw()
controlMonitor.setBackgroundColor(backgroundColor)
controlMonitor.setTextColor(textColor)
controlMonitor.setCursorPos(3,2)
controlMonitor.write("-- Main Menu --")
controlMonitor.setCursorPos(39,5)
controlMonitor.write("Show this screen on startup: ")
controlMonitor.setCursorPos(39,9)
controlMonitor.write("Language: ")
controlMonitor.setCursorPos(3,7)
controlMonitor.write("Program: ")
controlMonitor.setCursorPos(23,7)
controlMonitor.write("Mode:")
getClick(displayMenu)
end
createButtons()
displayMenu() |
--[[lit-meta
name = "creationix/defer-resume"
version = "0.1.0"
homepage = "https://github.com/creationix/lua-postgres/blob/master/defer-resume.lua"
description = "A helper to resume a coroutine on a later stack."
tags = {"coro"}
license = "MIT"
contributors = {
"Tim Caswell",
}
]]
local uv = require 'uv'
local checker = uv.new_check()
local idler = uv.new_idle()
local immediateQueue = {}
local function onCheck()
local queue = immediateQueue
immediateQueue = {}
for i = 1, #queue do
local success, err = coroutine.resume(queue[i])
if not success then
print("Uncaught error in defer-resume coroutine: " .. err)
end
end
if #immediateQueue == 0 then
uv.check_stop(checker)
uv.idle_stop(idler)
end
end
-- Given a coroutine, resume it on it's own top-level event loop stack.
return function (co)
-- If the queue was empty, the check hooks were disabled.
-- Turn them back on.
if #immediateQueue == 0 then
uv.check_start(checker, onCheck)
uv.idle_start(idler, onCheck)
end
immediateQueue[#immediateQueue + 1] = co
end
|
-- FIXME: naming sucks..
ActiveDrawing = LCS.class{}
function ActiveDrawing:init()
self.activeDrawingTextures = {}
end
function ActiveDrawing:SetActiveTexture(originalTextureObj)
local originalTexture = originalTextureObj.texture
local activeTexture = self.activeDrawingTextures[originalTexture]
if activeTexture ~= nil then
return activeTexture
end
activeTexture = gfx.CloneTexture(originalTexture)
self.activeDrawingTextures[originalTexture] = {
originalTextureObj = originalTextureObj,
texture = activeTexture,
dirty = originalTextureObj.dirty,
}
return activeTexture
end
function ActiveDrawing:Reset()
self.activeDrawingTextures = {}
end
function ActiveDrawing:Get()
return self.activeDrawingTextures
end
|
local results = require "script.results"
itemList = {}
function itemList.create(player)
local ui_state = ui.ui_state(player)
local search_box = ui_state.left_column.add{type="text-box", name="fi_textbox_search_items"}
local item_list_holder = ui_state.left_column.add{type="frame", direction="vertical", style="inside_deep_frame"}
item_list_holder.style.vertically_stretchable = true
ui_state.listbox_items = item_list_holder.add{type="scroll-pane", style="fi_scroll-pane_fake_listbox"}
ui_state.listbox_items.style.width = 200
itemList.refresh(player)
end
function renderItem(ui_state, item, selected_item)
if ui_state.item_filter and not string.find(item, ui_state.item_filter) then return end
local selected = (item == selected_item)
local style = (selected) and "fi_button_fake_listbox_item_active" or "fi_button_fake_listbox_item"
local tooltip = {"", item, item}
local name
if game.item_prototypes[item] then name = game.item_prototypes[item].localised_name else name = game.fluid_prototypes[item].localised_name end
ui_state.listbox_items.add{type="button", name = string.format("fi_item_button_%s", item), caption = name,
tooltip=tooltip, style=style, mouse_button_filter={"left-and-right"}}
end
function itemList.refresh(player)
local ui_state = ui.ui_state(player)
local items = results.getOrderedItemList()
local selected_item = ui_state.selected_item
ui_state.listbox_items.clear()
for _, item in pairs(items) do
renderItem(ui_state, item, selected_item)
end
end |
local gpio=...
print("gpio: "..gpio)
gpio.write(gpio, gpio.HIGH)
gpio.mode(gpio, gpio.OUTPUT)
|
food = {"парадајз", "сир", "маслине", "шунку", "печурке", "саламу"}
|
local filesystem = require('gears.filesystem')
local theme_dir = filesystem.get_configuration_dir() .. '/theme'
local theme = {}
theme.icons = theme_dir .. '/icons/'
theme.font = 'Inter Regular 10'
theme.font_bold = 'Inter Bold 10'
-- Colorscheme
theme.system_black_dark = '#4C566A'
theme.system_black_light = '#6C768A'
theme.system_red_dark = '#BF616A'
theme.system_red_light = '#af7370'
theme.system_green_dark = '#A3BE8C'
theme.system_green_light = '#B5CEA8'
theme.system_yellow_dark = '#D7BA7D'
theme.system_yellow_light = '#E7cb93'
theme.system_blue_dark = '#5e81ac'
theme.system_blue_light = '#69A8C6'
theme.system_magenta_dark = '#B48EAD'
theme.system_magenta_light = '#939ede'
theme.system_cyan_dark = '#88c0d0'
theme.system_cyan_light = '#69BAC8'
theme.system_white_dark = '#ABB2BF'
theme.system_white_light = '#D8DEE9'
-- Accent color
theme.accent = theme.system_blue_dark
-- Background color
-- Original version
--theme.background = '#192933'-- .. '100'
-- Darker version
theme.background = '#232731'-- .. '100'
theme.foreground = '#e6e6e6' .. '1A'
theme.urgent = '#5e81ac'
theme.focus = '#6C768A' .. '80'
-- Transparent
theme.transparent = '#00000000'
-- Awesome icon
theme.awesome_icon = theme.icons .. 'awesome.svg'
local awesome_overrides = function(theme) end
return {
theme = theme,
awesome_overrides = awesome_overrides
}
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local B = E:NewModule('Blizzard', 'AceEvent-3.0', 'AceHook-3.0');
E.Blizzard = B;
--No point caching anything here, but list them here for mikk's FindGlobals script
-- GLOBALS: IsAddOnLoaded, LossOfControlFrame, CreateFrame, LFRBrowseFrame, TalentMicroButtonAlert
function B:Initialize()
self:EnhanceColorPicker()
self:KillBlizzard()
self:AlertMovers()
self:PositionCaptureBar()
self:PositionDurabilityFrame()
self:PositionGMFrames()
self:SkinBlizzTimers()
self:PositionVehicleFrame()
self:PositionTalkingHead()
self:Handle_LevelUpDisplay_BossBanner()
self:Handle_UIWidgets()
self:GarrisonDropDown()
if not IsAddOnLoaded("DugisGuideViewerZ") then
self:MoveObjectiveFrame()
end
if not IsAddOnLoaded("SimplePowerBar") then
self:PositionAltPowerBar()
self:SkinAltPowerBar()
end
E:CreateMover(LossOfControlFrame, 'LossControlMover', L["Loss Control Icon"])
-- Quick Join Bug
CreateFrame("Frame"):SetScript("OnUpdate", function(self)
if LFRBrowseFrame.timeToClear then
LFRBrowseFrame.timeToClear = nil
end
end)
-- Fix Guild Set Rank Error introduced in Patch 27326
GuildControlUIRankSettingsFrameRosterLabel = CreateFrame("Frame", nil, E.HiddenFrame)
-- MicroButton Talent Alert
if TalentMicroButtonAlert then -- why do we need to check this?
if E.global.general.showMissingTalentAlert then
TalentMicroButtonAlert:ClearAllPoints()
TalentMicroButtonAlert:SetPoint("CENTER", E.UIParent, "TOP", 0, -75)
TalentMicroButtonAlert:StripTextures()
TalentMicroButtonAlert.Arrow:Hide()
TalentMicroButtonAlert.Text:FontTemplate()
TalentMicroButtonAlert:CreateBackdrop("Transparent")
E:GetModule("Skins"):HandleCloseButton(TalentMicroButtonAlert.CloseButton)
TalentMicroButtonAlert.tex = TalentMicroButtonAlert:CreateTexture(nil, "OVERLAY")
TalentMicroButtonAlert.tex:Point("RIGHT", -10, 0)
TalentMicroButtonAlert.tex:SetTexture("Interface\\DialogFrame\\UI-Dialog-Icon-AlertNew")
TalentMicroButtonAlert.tex:SetSize(32, 32)
else
TalentMicroButtonAlert:Kill() -- Kill it, because then the blizz default will show
end
end
end
local function InitializeCallback()
B:Initialize()
end
E:RegisterModule(B:GetName(), InitializeCallback)
|
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf"
module('BseGuildList_pb', package.seeall)
local BSEGUILDLIST = protobuf.Descriptor();
local BSEGUILDLIST_MYGUILDID_FIELD = protobuf.FieldDescriptor();
local BSEGUILDLIST_GUILDLIST_FIELD = protobuf.FieldDescriptor();
local BSEGUILDLIST_REQUESTGUILDID_FIELD = protobuf.FieldDescriptor();
local BSEGUILDLIST_REQUESTGUILDNAMES_FIELD = protobuf.FieldDescriptor();
BSEGUILDLIST_MYGUILDID_FIELD.name = "myGuildId"
BSEGUILDLIST_MYGUILDID_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BseGuildList.myGuildId"
BSEGUILDLIST_MYGUILDID_FIELD.number = 1
BSEGUILDLIST_MYGUILDID_FIELD.index = 0
BSEGUILDLIST_MYGUILDID_FIELD.label = 1
BSEGUILDLIST_MYGUILDID_FIELD.has_default_value = true
BSEGUILDLIST_MYGUILDID_FIELD.default_value = ""
BSEGUILDLIST_MYGUILDID_FIELD.type = 9
BSEGUILDLIST_MYGUILDID_FIELD.cpp_type = 9
BSEGUILDLIST_GUILDLIST_FIELD.name = "guildList"
BSEGUILDLIST_GUILDLIST_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BseGuildList.guildList"
BSEGUILDLIST_GUILDLIST_FIELD.number = 2
BSEGUILDLIST_GUILDLIST_FIELD.index = 1
BSEGUILDLIST_GUILDLIST_FIELD.label = 3
BSEGUILDLIST_GUILDLIST_FIELD.has_default_value = false
BSEGUILDLIST_GUILDLIST_FIELD.default_value = {}
BSEGUILDLIST_GUILDLIST_FIELD.message_type = GUILDSIMPLEINFO_PB_GUILDSIMPLEINFO
BSEGUILDLIST_GUILDLIST_FIELD.type = 11
BSEGUILDLIST_GUILDLIST_FIELD.cpp_type = 10
BSEGUILDLIST_REQUESTGUILDID_FIELD.name = "requestGuildId"
BSEGUILDLIST_REQUESTGUILDID_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BseGuildList.requestGuildId"
BSEGUILDLIST_REQUESTGUILDID_FIELD.number = 4
BSEGUILDLIST_REQUESTGUILDID_FIELD.index = 2
BSEGUILDLIST_REQUESTGUILDID_FIELD.label = 3
BSEGUILDLIST_REQUESTGUILDID_FIELD.has_default_value = false
BSEGUILDLIST_REQUESTGUILDID_FIELD.default_value = {}
BSEGUILDLIST_REQUESTGUILDID_FIELD.type = 9
BSEGUILDLIST_REQUESTGUILDID_FIELD.cpp_type = 9
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.name = "requestGuildNames"
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.full_name = ".com.xinqihd.sns.gameserver.proto.BseGuildList.requestGuildNames"
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.number = 6
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.index = 3
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.label = 3
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.has_default_value = false
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.default_value = {}
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.type = 9
BSEGUILDLIST_REQUESTGUILDNAMES_FIELD.cpp_type = 9
BSEGUILDLIST.name = "BseGuildList"
BSEGUILDLIST.full_name = ".com.xinqihd.sns.gameserver.proto.BseGuildList"
BSEGUILDLIST.nested_types = {}
BSEGUILDLIST.enum_types = {}
BSEGUILDLIST.fields = {BSEGUILDLIST_MYGUILDID_FIELD, BSEGUILDLIST_GUILDLIST_FIELD, BSEGUILDLIST_REQUESTGUILDID_FIELD, BSEGUILDLIST_REQUESTGUILDNAMES_FIELD}
BSEGUILDLIST.is_extendable = false
BSEGUILDLIST.extensions = {}
BseGuildList = protobuf.Message(BSEGUILDLIST)
_G.BSEGUILDLIST_PB_BSEGUILDLIST = BSEGUILDLIST
|
includes(
"Engine",
"EntryPoint",
"Platform",
"Render",
"Robotic"
)
|
translations.ru = {
name = "ru",
fullname = "Русский",
-- Сообщения об ошибках
corrupt_map = "<r>Поврежденная карта. загрузите другую.",
corrupt_map_vanilla = "<r>[ОШИБКА] <n>Не удается получить информацию о карте.",
corrupt_map_mouse_start = "<r>[ОШИБКА] <n>Карта должна иметь начальную позицию (точку появления мыши).",
corrupt_map_needing_chair = "<r>[ОШИБКА] <n>На карте должно находиться кресло для окончания раунда.",
corrupt_map_missing_checkpoints = "<r>[ОШИБКА] <n>Карта должна иметь хотя бы один чекпоинт (желтый гвоздь).",
corrupt_data = "<r>К сожалению, ваши данные повреждены и были сброшены.",
min_players = "<r>Чтобы сохранить ваши данные, в комнате должно быть как минимум 4 уникальных игрока. <bl>[%s/%s]",
tribe_house = "<r>Данные не будут сохранены в комнате племени.",
invalid_syntax = "<r>Неверный синтаксис.",
code_error = "<r>Появилась ошибка: <bl>%s-%s-%s %s",
emergency_mode = "<r>Активировано аварийное отключение, новые игроки не смогут зайти. Пожалуйста, перейдите в другую комнату #pourour.",
leaderboard_not_loaded = "<r>Таблица лидеров еще не загружена. Подождите минуту.",
max_power_keys = "<v>[#] <r>You can only have at most %s powers in the same key.",
-- Help window
help = "Помощь",
staff = "Команда модераторов",
rules = "Правила",
contribute = "Содействие",
changelog = "Изменения",
help_help = "<p align = 'center'><font size = '14'>Добро пожаловать в <T>#parkour!</T></font></p>\n<font size = '12'><p align='center'><J>Ваша цель - собрать все чекпоинты, чтобы завершить карту.</J></p>\n\n<N>• Нажмите <O>O</O>, введите <O>!op</O> или нажмите на <O> шестеренку</O> чтобы открыть <T>меню настроек</T>.\n• Нажмите <O>P</O> или нажмите на <O>руку</O> в правом верхнем углу, чтобы открыть <T>меню со способностями</T>.\n• Нажмите <O>L</O> или введите <O>!lb</O> чтобы открыть <T>Список лидеров</T>.\n• Нажмите <O>M</O> или <O>Delete</O> чтобы не прописывать <T>/mort</T>.\n• Чтобы узнать больше о нашей <O>команде</O> и о <O>правилах паркура</O>, нажми на <T>Команда</T> и <T>Правила</T>.\n• Нажмите <a href='event:discord'><o>here</o></a> чтобы получить ссылку на приглашение в наш Дискорд канал. Нажмите <a href='event:map_submission'><o>here</o></a> чтобы получить ссылку на тему отправки карты.\n• Используйте клавиши <o>вверх</o> и <o>вниз</o> чтобы листать меню.\n\n<p align = 'center'><font size = '13'><T>Вкладки теперь открыты! Для получения более подробной информации, нажмите на вкладку <O>Содействие</O> !</T></font></p>",
help_staff = "<p align = 'center'><font size = '13'><r>ОБЯЗАННОСТИ: Команда Паркура НЕ команда Transformice и НЕ имеет никакой власти в самой игре, только внутри модуля.</r>\nКоманда Parkour обеспечивают исправную работу модуля с минимальными проблемами и всегда готова помочь игрокам в случае необходимости.</font></p>\nВы можете ввести <D>!staff</D> в чат, чтобы увидеть нашу команду.\n\n<font color = '#E7342A'>Администраторы:</font> Hесут ответственность за поддержку самого модуля, добавляя новые обновления и исправляя ошибки.\n\n<font color = '#D0A9F0'>Руководители команд:</font> Kонтролируют команды модераторов и картостроителей, следя за тем, чтобы они хорошо выполняли свою работу. Они также несут ответственность за набор новых членов в команду.\n\n<font color = '#FFAAAA'>Модераторы:</font> Hесут ответственность за соблюдение правил модуля и наказывают тех, кто не следует им.\n\n<font color = '#25C059'>Картостроители:</font> Oтвечают за просмотр, добавление и удаление карт в модуле, обеспечивая вам приятный игровой процесс.",
help_rules = "<font size = '13'><B><J>Все правила пользователя и условия Transformice также применяются к #parkour </J></B></font>\n\nЕсли вы обнаружили, что кто-то нарушает эти правила, напишите нашим модераторам. Если модераторов нет в сети, вы можете сообщить об этом на на нашем сервере в Discord\nПри составлении репорта, пожалуйста, укажите сервер, имя комнаты и имя игрока.\n• Пример: en-#parkour10 Blank#3495 троллинг\nДоказательства, такие как скриншоты, видео и гифки, полезны и ценны, но не обязательны.\n\n<font size = '11'>• <font color = '#ef1111'>читы, глюки или баги</font> не должны использоваться в комнатах #parkour\n• <font color = '#ef1111'>Фарм через VPN</font> считается <B>нарушением</B> и не допускается. <p align = 'center'><font color = '#cc2222' size = '12'><B>\nЛюбой, кто пойман за нарушение этих правил, будет немедленно забанен.</B></font></p>\n\n<font size = '12'>Transformice позволяет концепцию троллинга. Однако, <font color='#cc2222'><B>мы не допустим этого в паркуре.</B></font></font>\n\n<p align = 'center'><J>Троллинг - это когда игрок намеренно использует свои силы или инвентарь, чтобы помешать другим игрокам пройти/закончить карту.</J></p>\n• Троллинг ради мести <B>не является веской причиной,</B> для троллинга кого-либо и вы все равно будете наказаны.\n• Принудительная помощь игрокам, которые пытаются пройти карту самостоятельно и отказываюся от помощи, когда их об этом просят, также считается троллингом. \n• <J>Если игрок не хочет помогать или предпочитает играть в одиночку на карте, постарайтесь помочь другим игрокам</J>. Однако, если другой игрок нуждается в помощи на том же чекпоинте, что и соло игрок, вы можете помочь им [обоим].\n\nЕсли игрок пойман за троллингом, он будет наказан на временной основе. Обратите внимание, что повторный троллинг приведет к более длительным и суровым наказаниям.",
help_contribute = "<font size='14'>\n<p align='center'>Команда управления паркуром предпочитает открытый исходный код, потому что он <t>помогает сообществу</t>. Вы можете <o>посмотреть</o> и <o>улучшить</o> исходный код на <o><u><a href='event:github'>GitHub</a></u></o>.\nПоддержание модуля<t>строго добровольно</t>, так что любая помощь в отношении <t>code</t>, <t>баг репортов</t>, <t>предложений</t> and <t>созданию карт</t> is always <u>приветствуется и ценится</u>.\nВы можете <vp>оставлять жалобу</vp> и <vp>предлагать улучшения</vp> в нашем <o><u><a href='event:discord'>Дискорде</a></u></o> и/или в <o><u><a href='event:github'>GitHub</a></u></o>.\nВы можете <vp>отправить свои карты</vp> на нашем <o><u><a href='event:map_submission'>форуме</a></u></o>.\n\nПоддержание паркура не дорогое, но и не бесплатное. Мы будем рады, если вы поможете нам <t>любой суммой</t> <o><u><a href='event:donate'>here</a></u></o>.\n<u>Все пожертвования пойдут на улучшение модуля.</u></p>",
help_changelog = "<font size='13'><p align='center'><o>Version 2.10.0 - 17/04/2021</o></p>\n\n<font size='11'>• <font size='13'><b><j>THREE</J></b> brand new Transformice titles that can only be unlocked by playing <font color='#1A7EC9'><b>#parkour</b></font>!</font>\n• Two new statuses added to the profile.\n• Minor text adjustments.",
-- Congratulation messages
reached_level = "<d>Поздравляем! Вы достигли уровня <vp>%s</vp>. (<t>%ss</t>)",
finished = "<d><o>%s</o> завершил паркур за <vp>%s</vp> секунд, <fc>поздравляем!",
unlocked_power = "<ce><d>%s</d> разблокировал способность <vp>%s</vp>.",
-- Information messages
mod_apps = "<j>Приложения паркура модератора теперь открыты! Используйте эту ссылку: <rose>%s",
staff_power = "<r>Команда паркура <b>не</b> имеет власти вне #parkour комнат.",
donate = "<vp>Введите <b>!donate</b>, если хотите пожертвовать на этот модуль!",
paused_events = "<cep><b>[Предупреждение!]</b> <n> Модуль достиг критического предела и сейчас временно остановлен.",
resumed_events = "<n2>Модуль был возобновлен.",
welcome = "<n>Добро пожаловать в<t>#parkour</t>!",
module_update = "<r><b>[Предупреждение!]</b> <n>Модуль будет обновлен в <d>%02d:%02d</d>.",
leaderboard_loaded = "<j>Таблица лидеров была загружена. Нажмите L, чтобы открыть ее.",
kill_minutes = "<R>Ваши способности отключены на %s минут.",
permbanned = "<r>Вы были навсегда забанены в #parkour.",
tempbanned = "<r>Вы были забанены в #parkour на %s минут.",
forum_topic = "<rose>Для получения дополнительной информации о модуле посетите эту ссылку: %s",
report = "<j>Хотите пожаловаться на игрока? <t><b>/c Parkour#8558 .report Никнейм#0000</b></t>",
-- Easter Eggs
easter_egg_0 = "<ch>Итак, наступает обратный отсчет...",
easter_egg_1 = "<ch>Остается меньше, чем 24 часа!",
easter_egg_2 = "<ch>Вау, ты пришел очень рано! Ты слишком взволнован?",
easter_egg_3 = "<ch>Ожидается сюрприз...",
easter_egg_4 = "<ch>Ты знаешь о том, что должно произойти...?",
easter_egg_5 = "<ch>Часы продолжают тикать...",
easter_egg_6 = "<ch>Сюрприз близок!",
easter_egg_7 = "<ch>Вечеринка скоро начнется...",
easter_egg_8 = "<ch>Взгляни на часы, не пора ли?",
easter_egg_9 = "<ch>Будь осторожен, время идет...",
easter_egg_10 = "<ch>Просто сядь и расслабься, это будет завтра в кратчайшие сроки!",
easter_egg_11 = "<ch>Давай ляжем спать пораньше, это сделает время быстрее!",
easter_egg_12 = "<ch>Терпение это добродетель",
easter_egg_13 = "<ch>https://youtu.be/9jK-NcRmVcw",
double_maps = "<bv>Удвоенные карты и все силы доступы на неделе рождения паркура!",
double_maps_start = "<rose>ЭТО НЕДЕЛЯ РОЖДЕНИЯ ПАРКУРА! Удвоенные карты и все силы были активированы. Спасибо за то, что играешь с нами!",
double_maps_end = "<rose>Неделя рождения паркура закончилась. Спасибо за то, что играешь с нами!",
-- Records
records_enabled = "<v>[#] <d>RВ этой комнате включен режим рекордов. Статистика не учитывается, а умения отключены!\nВы можете найти больше информации в <b>%s</b>",
records_admin = "<v>[#] <d>Вы администратор этой комнаты. Вы можете использовать команды <b>!map</b>, <b>!setcp</b>, <b>!pw</b> и <b>!time</b>.",
records_completed = "<v>[#] <d>Вы прошли карту! Если вы хотите сделать это заново, введите <b>!redo</b>.",
records_submit = "<v>[#] <d>Вот Это Да! Похоже, ты быстрее всех прошел карту. Если хочешь поделиться своим рекордом, введи <b>!submit</b>.",
records_invalid_map = "<v>[#] <r>Похоже, эта карта не в ротации паркура ... Вы не можете сохранить рекорд для нее!",
records_not_fastest = "<v>[#] <r>Кажется, ты не самый быстрый игрок в комнате ...",
records_already_submitted = "<v>[#] <r>Вы уже отправили свой рекорд для этой карты!",
records_submitted = "<v>[#] <d>Ваш рекорд на этой карте <b>%s</b> был сохранен.",
-- Miscellaneous
afk_popup = "\n<p align='center'><font size='30'><bv><b>YOU'RE ON AFK MODE</b></bv>\nMOVE TO RESPAWN</font>\n\n<font size='30'><u><t>Reminders:</t></u></font>\n\n<font size='15'><r>Players with a red line over them don't want help!\nTrolling/blocking other players in parkour is NOT allowed!<d>\nJoin our <cep><a href='event:discord'>discord server</a></cep>!\nWant to contribute with code? See our <cep><a href='event:github'>github repository</a></cep>\nDo you have a good map to submit? Post it in our <cep><a href='event:map_submission'>map submission topic</a></cep>\nCheck our <cep><a href='event:forum'>official topic</a></cep> for more information!\nSupport us by <cep><a href='event:donate'>donating!</a></cep>",
options = "<p align='center'><font size='20'>Параметры Паркура</font></p>\n\nИспользуйте <b>QWERTY</b> на клавиатуре (отключить if <b>AZERTY</b>)\n\nИспользуйте <b>M</b> горячую клавишу <b>/mort</b> (отключить <b>DEL</b>)\n\nПоказать ваше время перезарядки\n\nПоказать кнопку способностей\n\nПоказать кнопку помощь\n\nПоказать объявление о завершении карты\n\nПоказать символ помощь не нужна",
cooldown = "<v>[#] <r>Подождите несколько минут, чтобы повторить действие.",
power_options = ("<font size='13' face='Lucida Console,Liberation Mono,Courier New'><b>QWERTY</b> клавиатура" ..
"\n\n<b>Hide</b> map count" ..
"\n\nUse <b>default key</b>"),
unlock_power = ("<font size='13' face='Lucida Console,Liberation Mono,Courier New'><p align='center'>Пройденные <v>%s</v> карты" ..
"<font size='5'>\n\n</font>разблокированы" ..
"<font size='5'>\n\n</font><v>%s</v>"),
upgrade_power = ("<font size='13' face='Lucida Console,Liberation Mono,Courier New'><p align='center'>Пройденные <v>%s</v> карты" ..
"<font size='5'>\n\n</font>обновлены" ..
"<font size='5'>\n\n</font><v>%s</v>"),
unlock_power_rank = ("<font size='13' face='Lucida Console,Liberation Mono,Courier New'><p align='center'>Ранг <v>%s</v>" ..
"<font size='5'>\n\n</font>разбокирован" ..
"<font size='5'>\n\n</font><v>%s</v>"),
upgrade_power_rank = ("<font size='13' face='Lucida Console,Liberation Mono,Courier New'><p align='center'>Ранг <v>%s</v>" ..
"<font size='5'>\n\n</font>обновлен" ..
"<font size='5'>\n\n</font><v>%s</v>"),
maps_info = ("<p align='center'><font size='13' face='Lucida Console,Liberation Mono,Courier New'><b><v>%s</v></b>" ..
"<font size='5'>\n\n</font>Пройденые карты"),
overall_info = ("<p align='center'><font size='13' face='Lucida Console,Liberation Mono,Courier New'><b><v>%s</v></b>" ..
"<font size='5'>\n\n</font>Общая таблица лидеров"),
weekly_info = ("<p align='center'><font size='13' face='Lucida Console,Liberation Mono,Courier New'><b><v>%s</v></b>" ..
"<font size='5'>\n\n</font>Еженедельная таблица лидеров"),
badges = "<font size='14' face='Lucida Console,Liberation Mono,Courier New,Verdana'>Badges (%s): <a href='event:_help:badge'><j>[?]</j></a>",
private_maps = "<bl>Количество карт этого игрока является частным.<a href='event:_help:private_maps'><j>[?]</j></a></bl>\n",
profile = ("<font size='12' face='Lucida Console,Liberation Mono,Courier New,Verdana'>%s%s %s\n\n" ..
"Общая таблица лидеров: <b><v>%s</v></b>\n\n" ..
"Еженедельначя таблица лидеров: <b><v>%s</v></b>\n\n%s"),
map_count = "Количество карт: <b><v>%s</v> / <a href='event:_help:yellow_maps'><j>%s</j></a> / <a href='event:_help:red_maps'><r>%s</r></a></b>",
help_badge = "Значки - это достижение, которое может получить игрок. Нажмите на них, чтобы увидеть их описание.",
help_private_maps = "Этот игрок не любит публично публиковать количество своих карт! Вы также можете скрыть их в своем профиле.",
help_yellow_maps = "Желтым цветом обозначены карты, завершенные на этой неделе.",
help_red_maps = "Карты красного цвета - это карты, завершенные за последний час.",
help_badge_1 = "Этот игрок в прошлом был сотрудником паркура.",
help_badge_2 = "Этот игрок находится или был на странице 1 общей таблицы лидеров.",
help_badge_3 = "Этот игрок находится или был на странице 2 общей таблицы лидеров.",
help_badge_4 = "Этот игрок находится или был на странице 3 общей таблицы лидеров.",
help_badge_5 = "Этот игрок находится или был на странице 4 общей таблицы лидеров.",
help_badge_6 = "Этот игрок находится или был на странице 5 общей таблицы лидеров.",
help_badge_7 = "Этот игрок был в еженедельной таблицы лидеров.",
help_badge_8 = "У этого игрока рекорд - 30 карт в час.",
help_badge_9 = "У этого игрока рекорд - 35 карт в час.",
help_badge_10 = "У этого игрока рекорд - 40 карт в час.",
help_badge_11 = "У этого игрока рекорд - 45 карт в час.",
help_badge_12 = "У этого игрока рекорд - 50 карт в час.",
help_badge_13 = "У этого игрока рекорд - 55 карт в час.",
help_badge_14 = "Этот пользователь подтвердил свою учетную запись на официальном канале сервера паркура (нажмите <b>!discord</b>).",
help_badge_15 = "Этот игрок показал лучшее время на 1 карте.",
help_badge_16 = "Этот игрок показал лучшее время на 5 картах.",
help_badge_17 = "Этот игрок показал лучшее время на 10 картах.",
help_badge_18 = "Этот игрок показал лучшее время на 15 картах.",
help_badge_19 = "Этот игрок показал лучшее время на 20 картах.",
help_badge_20 = "Этот игрок показал лучшее время на 25 картах.",
help_badge_21 = "Этот игрок показал лучшее время на 30 картах.",
help_badge_22 = "Этот игрок показал лучшее время на 35 картах.",
help_badge_23 = "Этот игрок показал лучшее время на 40 картах.",
make_public = "сделать публичным",
make_private = "сделать приватым",
moderators = "Модераторы",
mappers = "Maпперы",
managers = "Mенеджеры",
administrators = "Администрация",
close = "Закрыть",
cant_load_bot_profile = "<v>[#] <r>You can't see this bot's profile since #parkour uses it internally to work properly.",
cant_load_profile = "<v>[#] <r>The player <b>%s</b> seems to be offline or does not exist.",
like_map = "Do you like this map?",
yes = "Yes",
no = "No",
idk = "I don't know",
unknown = "Неизвестно",
powers = "Способности",
press = "<vp>Нажмите %s",
click = "<vp>Щелчок левой кнопкой мыши",
ranking_pos = "Рейтинг #%s",
completed_maps = "<p align='center'><BV><B>Пройденные карты: %s</B></p></BV>",
leaderboard = "Таблица лидеров",
position = "<V><p align=\"center\">Должность",
username = "<V><p align=\"center\">Имя пользователя",
community = "<V><p align=\"center\">Сообщество",
completed = "<V><p align=\"center\">Пройденные карты",
overall_lb = "В целом",
weekly_lb = "Еженедельно",
new_lang = "<v>[#] <d>Язык установлен на Русский",
-- Power names
balloon = "Шар",
masterBalloon = "Мастер шар",
bubble = "Пузырь",
fly = "Полет",
snowball = "Снежок",
speed = "Скорость",
teleport = "Телепорт",
smallbox = "Маленький ящик",
cloud = "Облако",
rip = "Могила",
choco = "Шоколадная палка",
bigBox = "Большая коробка",
trampoline = "Батут",
toilet = "Туалет",
pig = "Свинья",
sink = "тонуть",
bathtub = "Ванна",
campfire = "Костёр",
chair = "Стул",
}
|
-- MIT license Lupus590
-- a better way of doing this might be soemthing like this https://metis.madefor.cc/
local ccStringsUrl = "https://raw.githubusercontent.com/SquidDev-CC/CC-Tweaked/f7e3e72a6e8653f192b7dfad6cf4d072232e7259/src/main/resources/data/computercraft/lua/rom/modules/main/cc/strings.lua"
if not pcall(require, "cc.strings") then
print("Attempting to download required module (cc.strings) from CC-Tweaked GitHub.")
print("This should only happen once per computer.")
local httpHandle, err = http.get(ccStringsUrl)
if not httpHandle then
printError("Error downloading file.")
error(err, 0)
end
local file, err = fs.open("modules/main/cc/strings.lua", "w")
if not file then
httpHandle.close()
printError("Error saving downloaded file.")
error(err, 0)
end
file.write(httpHandle.readAll())
httpHandle.close()
file.close()
print("Downloaded to /modules/main/cc/strings.lua")
print("Press any key to continue")
os.pullEvent("key")
end
package.path = "/modules/main/?;/modules/main/?.lua;/modules/main/?/init.lua;"..package.path
local strings = require("cc.strings")
|
function start()
local driverType = irr.driverChoiceConsole();
if driverType == irr.EDT_COUNT then
return 1;
end
local device = irr.createDevice(driverType, irr.dimension2d_u32(512, 384));
if device == nil then
return 1;
end
device.setWindowCaption("cpgf Irrlicht Lua Binding - 2D Graphics Demo");
local driver = device.getVideoDriver();
local images = driver.getTexture("../../media/2ddemo.png");
driver.makeColorKeyTexture(images, irr.position2d_s32(0,0));
local font = device.getGUIEnvironment().getBuiltInFont();
local font2 = device.getGUIEnvironment().getFont("../../media/fonthaettenschweiler.bmp");
local imp1 = irr.rect_s32(349,15,385,78);
local imp2 = irr.rect_s32(387,15,423,78);
driver.getMaterial2D().AntiAliasing=irr.EAAM_FULL_BASIC;
while device.run() and driver do
if device.isWindowActive() then
local time = device.getTimer().getTime();
driver.beginScene(true, true, irr.SColor(255,120,102,136));
driver.draw2DImage(images, irr.position2d_s32(50,50), irr.rect_s32(0,0,342,224), nil, irr.SColor(255,255,255,255), true);
driver.draw2DImage(images, irr.position2d_s32(164,125), (time/500 % 2) and imp1 or imp2, nil, irr.SColor(255,255,255,255), true);
driver.draw2DImage(images, irr.position2d_s32(270,105), (time/500 % 2) and imp1 or imp2, nil, irr.SColor(255,(time) % 255,255,255), true);
if font then
font.draw("This demo shows that Irrlicht is also capable of drawing 2D graphics.", irr.rect_s32(130,10,300,50), irr.SColor(255,255,255,255));
end
if font2 then
font2.draw("Also mixing with 3d graphics is possible.", irr.rect_s32(130,20,300,60), irr.SColor(255,time % 255,time % 255,255));
end
driver.enableMaterial2D();
driver.draw2DImage(images, irr.rect_s32(10,10,108,48), irr.rect_s32(354,87,442,118));
driver.enableMaterial2D(false);
local m = device.getCursorControl().getPosition();
driver.draw2DRectangle(irr.SColor(100,255,255,255), irr.rect_s32(m.X-20, m.Y-20, m.X+20, m.Y+20));
driver.endScene();
end
end
device.drop();
return 0;
end
start();
|
-----------------------------------------------------------------------------------------------
-- Client Lua Script for ForgeUI
--
-- name: credits_module.lua
-- author: Winty Badass@Jabbit
-- about: ForgeUI module for displaying credit in main ForgeUI window
-----------------------------------------------------------------------------------------------
local F = _G["ForgeLibs"]["ForgeUI"] -- ForgeUI API
local G = _G["ForgeLibs"]["ForgeGUI"] -- ForgeGUI
-----------------------------------------------------------------------------------------------
-- ForgeUI Module Definition
-----------------------------------------------------------------------------------------------
local CreditsModule = {
_NAME = "credits_module",
_API_VERSION = 3,
_VERSION = "1.0",
}
-----------------------------------------------------------------------------------------------
-- Local variables
-----------------------------------------------------------------------------------------------
local tGroups = {
[1] = {
sName = "Creator",
tPpl = {
["Winty Badass"] = "",
},
},
[2] = {
sName = "Developers",
tPpl = {
["Toludin"] = "",
["veex-ua"] = "",
},
},
[3] = {
sName = "Contributors",
tPpl = {
["Vim Exe"] = "code reviews",
["Chaarp Shooter"] = "debugging & help with code",
["Ringo Noyamano"] = "debugging & design decisions",
["Miss Sistray"] = "class & mob icons",
["Akira Kurosawa"] = "design decisions",
["Gordma Galeic"] = "design decisions",
["LaserLoui"] = "feature development",
},
},
[4] = {
sName = "Pink Cheese",
tPpl = {
["Briex"] = "",
},
},
[5] = {
sName = "Others",
tPpl = {
["ZodBain"] = "NeedGreed API12 fix",
},
},
}
-----------------------------------------------------------------------------------------------
-- Module functions
-----------------------------------------------------------------------------------------------
function CreditsModule:ForgeAPI_Init()
F:API_AddMenuItem(self, "Credits", "Credits", { strPriority = "slow" })
end
function CreditsModule:ForgeAPI_PopulateOptions()
local wndProfiles = self.tOptionHolders["Credits"]
local nGroups = 0
local nPpl = 0
for i = 1, #tGroups do
local tGroup = tGroups[i]
G:API_AddText(self, wndProfiles, string.format("<T TextColor=\"%s\" Font=\"%s\">%s</T>",
"FFF50002", "Nameplates", tGroup.sName), {
tMove = {
0, nGroups * 25, 0, nGroups * 25,
}
})
for sName, sNote in pairs(tGroup.tPpl) do
G:API_AddText(self, wndProfiles, string.format("<T TextColor=\"%s\" Font=\"%s\">%s</T>",
"FFFFFFFF", "Nameplates", sName), {
tMove = {
100, nGroups * 25, 0, nGroups * 25,
}
})
if sNote then
G:API_AddText(self, wndProfiles, string.format("<T TextColor=\"%s\" Font=\"%s\">%s</T>",
"FFFFFFFF", "Nameplates", sNote), {
tMove = {
250, nGroups * 25, 0, nGroups * 25,
}
})
end
nGroups = nGroups + 1
end
i = i + 1
end
G:API_AddText(self, wndProfiles, "and everyone from <The Utopia> for help during early development!", {
tMove = {
0, 350, 0, 350,
}
})
G:API_AddText(self, wndProfiles, "*if you can't find yourself here, send me a PM on curse.com", {
tMove = {
0, 400, 0, 400,
}
})
end
CreditsModule = F:API_NewModule(CreditsModule)
|
PLUGIN.name = "Global map"
PLUGIN.author = "STEAM_0:1:29606990"
PLUGIN.description = ""
if (SERVER) then return end
local draw, surface, TEXT_ALIGN_CENTER = draw, surface, TEXT_ALIGN_CENTER
local SH_SZ = SH_SZ
ix.map = ix.map or {
texture = Material("gmodz/global_map/rp_stalker_v2.png"),
objects = {},
gui = {
map = nil,
label = nil
},
signs = { "➕", "☢" },
default_color = Color("sky_blue")
}
local map = {}
function map.Generate()
-- Thanks Dakota0001
local mapBoundsMax = select(2, game.GetWorld():GetModelBounds())
local uptrace = util.TraceLine({
start = vector_origin,
endpos = vector_origin + Vector(0,0,mapBoundsMax.z),
mask = MASK_NPCWORLDSTATIC
}).HitPos
local startpos = Vector(0, 0, uptrace.z)
local endX, endY = Vector(mapBoundsMax.x, 0, 0), Vector(0, mapBoundsMax.y, 0)
local rTrace = util.TraceLine({
start = startpos,
endpos = startpos + endY,
mask = MASK_NPCWORLDSTATIC
}).HitPos
local lTrace = util.TraceLine({
start = startpos,
endpos = startpos - endY,
mask = MASK_NPCWORLDSTATIC
}).HitPos
-- local fTrace = util.TraceLine({
-- start = startpos,
-- endpos = startpos + endX,
-- mask = MASK_NPCWORLDSTATIC
-- }).HitPos
-- local bTrace = util.TraceLine({
-- start = startpos,
-- endpos = startpos - endX,
-- mask = MASK_NPCWORLDSTATIC
-- }).HitPos
-- map.Center = (rTrace + lTrace + fTrace + bTrace) * 0.25
-- map.Center.z = LocalPlayer():GetPos().z + 2500
local MapSize = rTrace:Distance(lTrace) / 2
map.SizeW = -MapSize
map.SizeE = MapSize
map.SizeS = -MapSize
map.SizeN = MapSize
map.SizeX = math.abs(map.SizeE + math.abs(map.SizeW))
map.SizeY = math.abs(map.SizeN + math.abs(map.SizeS))
ix.map.iconSize = math.Round((tonumber(32) / 2160) * ScrH(), 0)
ix.map.ringSize = math.Round((tonumber(74) / 2160) * ScrH(), 0)
-- pre-cache
surface.SetFont("MapFont")
local tw, th = surface.GetTextSize(ix.map.signs[1])
ix.map.signSize = {tw*0.5, th*0.5}
startpos, endX, endY, MapSize = nil, nil, nil, nil
rTrace, lTrace = nil, nil--, fTrace, bTrace = nil, nil, nil, nil
uptrace, mapBoundsMax = nil, nil
tw, th = nil, nil
collectgarbage()
end
function map.Save()
timer.Create("ixGlobalMap", 5, 1, function()
ix.data.Set("global_map", ix.map.objects)
end)
end
function map.ToScreen(pos, w, h)
local x = (map.SizeW > 0 and pos.x + map.SizeE or pos.x - map.SizeW)
local y = (map.SizeS > 0 and pos.y + map.SizeN or pos.y - map.SizeS)
-- Map borders
return math.Clamp(x / map.SizeX * w, 0, w), h - math.Clamp(y / map.SizeY * h, 0, h)
end
function map.ToWorld(x, y, w, h)
x = x * map.SizeX / w
y = y * map.SizeY / h
x = (map.SizeW > 0 and x - map.SizeE or x + map.SizeW)
y = (map.SizeS > 0 and y - map.SizeN or y + map.SizeS)
return Vector(x, -y, 0)
end
function map.Open()
if (!map.SizeX) then map.Generate() end
if (!LocalPlayer():GetCharacter() or !LocalPlayer():Alive()) then return end
if (IsValid(ix.map.gui.map)) then ix.map.gui.map:Remove() end
local clr = nil
local useText = "[ALT]"
local frame = vgui.Create('DFrame')
ix.map.gui.map = frame
frame:SetSize(ScrH(), ScrH())
frame:Center()
frame:SetTitle(L("globalMapCursor", useText, L'globalMapCursorEnable'))
frame:MakePopup()
frame:SetMouseInputEnabled(false)
frame:SetKeyboardInputEnabled(false)
frame.lblTitle:SetFont("MapFont")
frame.lblTitle.UpdateColours = function(label)
return label:SetTextStyleColor(color_white)
end
frame.OnKeyCodeReleased = function(t, key_code)
if (input.LookupKeyBinding(key_code) == "gm_showteam") then
ix.map.gui.map = nil
t:Remove()
end
end
frame.Think = function(t)
if (input.IsKeyDown(81) or input.IsKeyDown(82)) then
if (!t.ctrl_pressed) then
if (IsValid(t.dmenu)) then t.dmenu:Remove() t.dmenu = nil end
t:SetMouseInputEnabled(!t:IsMouseInputEnabled())
--t:SetKeyboardInputEnabled(!t:IsKeyboardInputEnabled())
t.map:SetMouseInputEnabled(!t.map:IsMouseInputEnabled())
t.map:SetKeyboardInputEnabled(!t.map:IsKeyboardInputEnabled())
t:SetTitle(L("globalMapCursor", useText,
t:IsMouseInputEnabled() and L'globalMapCursorDisable' or L'globalMapCursorEnable'))
t.ctrl_pressed = true
end
elseif t.ctrl_pressed then
t.ctrl_pressed = nil
end
end
frame.map = frame:Add("EditablePanel")
frame.map:Dock(FILL)
frame.map.Paint = function(self, w, h)
if (!self.current_index) then self:SetCursor("arrow") end
surface.SetMaterial(ix.map.texture)
surface.SetDrawColor(color_white)
surface.DrawTexturedRect(0, 0, w, h)
--draw.SimpleTextOutlined("Press ctrl to enable the mouse cursor", "MapFont", 5, 5, ColorAlpha(Color("gray"), 150), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 1, color_black)
x, y = map.ToScreen(LocalPlayer():GetPos(), w, h)
clr = ix.map.default_color
draw.SimpleTextOutlined(L("globalMapYOU"), "MapFont", x, y - ix.map.iconSize, clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
draw.SimpleTextOutlined(ix.map.signs[1], "MapFont", x, y, clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
for _, v in ipairs(ix.map.objects) do
clr = v[2]
x, y = map.ToScreen(v[3], w, h)
if (self:MouseInRect(x, y, ix.map.signSize[1], ix.map.signSize[2])) then
self:SetCursor(self.current_index and "blank" or "hand")
clr = ix.color.Darken(clr, 25)
end
--local x1, y1 = map.ToScreen(LocalPlayer():GetPos(), w, h)
--local dist = math.Round(math.Distance(x, y, x1, y1), 2)
--if dist < 35 then
draw.SimpleTextOutlined(v[1], "MapFont", x, y - ix.map.iconSize, clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
draw.SimpleTextOutlined(ix.map.signs[1], "MapFont", x, y, clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
--end
end
-- Отряд
for _, v in ipairs(player.GetAll()) do
if (IsValid(v) and v != LocalPlayer() and v:GetCharacter() and v:Alive()) then
local sq = ix.squad.list[LocalPlayer():GetCharacter():GetSquadID()]
if (sq and sq.members[v:SteamID64()]) then
x, y = map.ToScreen(v:GetPos(), w, h)
clr = ix.option.Get("squadTeamColor", Color(51, 153, 255))
draw.SimpleTextOutlined(v:Name(), "MapFont", x, y - ix.map.iconSize, clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
draw.SimpleTextOutlined(ix.map.signs[1], "MapFont", x, y, clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
end
end
end
-- зеленая зона
if (!SH_SZ or !SH_SZ.SafeZones or #SH_SZ.SafeZones == 0) then return end
for _, sz in ipairs(SH_SZ.SafeZones) do
local center = SH_SZ:GetLocalZonePosition(sz.points[1], sz.points[2], sz.shape, sz.size)
x, y = map.ToScreen(center, w, h)
clr = Color("green")
if (sz.shape == 1) then -- cube
elseif (sz.shape == 2) then -- ring
draw.SimpleTextOutlined("Safe Zone", "MapFont1", x, y - (ix.map.iconSize/2), clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
surface.DrawCircle(x, y, (sz.size/1024)*ix.map.ringSize, clr)
end
end
end
function frame.map:MouseInRect(x, y, w, h)
local mx, my = self:CursorPos()
return (mx >= x - w and mx <= (x + w) and my >= y - h and my <= (y + h))
end
function frame.map:OnCursorMoved(mx, my)
if (input.IsMouseDown(MOUSE_LEFT)) then
local w, h = self:GetSize()
self.current_index = self.current_index or nil
if (!self.current_index) then
for k, v in ipairs(ix.map.objects) do
x, y = map.ToScreen(v[3], w, h)
if (self:MouseInRect(x, y, ix.map.signSize[1], ix.map.signSize[2])) then
self.current_index = k
break
end
end
else
ix.map.objects[self.current_index][3] = map.ToWorld(mx, my, w, h)
map.Save()
end
end
end
function frame.map:OnMouseReleased()
self.current_index = nil
end
function frame.map:OnMousePressed(code)
if (code == MOUSE_RIGHT) then
local w, h = self:GetSize()
local x, y = 0, 0
local current_index
for k, v in ipairs(ix.map.objects) do
x, y = map.ToScreen(v[3], w, h)
if (self:MouseInRect(x, y, ix.map.signSize[1], ix.map.signSize[2])) then
current_index = k
break
end
end
local dmenu = DermaMenu()
frame.dmenu = dmenu
x, y = self:CursorPos()
if (current_index) then
dmenu:AddOption(L("option_edit"), function()
if (IsValid(ix.map.gui.label)) then ix.map.gui.label:Remove() end
local data = ix.map.objects[current_index]
ix.map.gui.label = vgui.Create("ixMapSetLabel")
ix.map.gui.label:SetData(data[1], data[2], current_index)
function ix.map.gui.label:DoneClick(text, color, index)
ix.map.objects[index] = {text, color, map.ToWorld(x, y, w, h)}
map.Save()
end
ix.map.gui.label = nil
end):SetImage("icon16/wand.png")
dmenu:AddSpacer()
dmenu:AddOption(L("option_remove"), function()
table.remove(ix.map.objects, current_index)
current_index = nil
end):SetImage("icon16/exclamation.png")
elseif (!IsValid(ix.map.gui.label)) then
dmenu:AddOption(L("globalMapLabel"), function()
ix.map.gui.label = vgui.Create("ixMapSetLabel")
function ix.map.gui.label:DoneClick(text, color)
ix.map.objects[#ix.map.objects + 1] = {text, color, map.ToWorld(x, y, w, h)}
map.Save()
end
ix.map.gui.label = nil
end):SetImage("icon16/attach.png")
if (#ix.map.objects > 0) then
dmenu:AddSpacer()
dmenu:AddOption(L("globalMapDeleteLabels"), function()
Derma_Query(L("globalMapDeleteLabelsConfirm", id), L("globalMapDeleteLabels"),
L("no"), nil,
L("yes"), function()
ix.map.objects = {}
map.Save()
end
)
end):SetImage("icon16/bomb.png")
end
end
dmenu:Open()
end
end
end
-- HOOKS
function PLUGIN:LoadFonts()
surface.CreateFont("MapFont", {
font = "Jura",
size = ix.util.ScreenScaleH(10),
weight = 500,
})
surface.CreateFont("MapFont1", {
font = "Jura",
size = ix.util.ScreenScaleH(9),
weight = 100,
})
end
function PLUGIN:ScreenResolutionChanged()
map.SizeX = nil
end
function PLUGIN:InitPostEntity()
map.Generate()
ix.map.objects = ix.data.Get("global_map", {})
end
function PLUGIN:PlayerBindPress(_, bind, pressed)
if (bind:find("gm_showteam") and pressed) then
if (!IsValid(ix.map.gui.map)) then
map.Open()
else
ix.map.gui.map:Remove()
end
return true
end
end |
CAMERA_ENUMS = {
SPEED_CAMERA = 1, --// Checks the individuals speed against the speed limit, issues an automatic ticket.
CHAR_CHECK_CAMERA = 2, --// Checks the individuals information against the CAD, issues an automatic BOLO. (On CAD & in-game)
PLATE_CAMERA = 3, --// Checks the vehicle plate against the CAD, informs the PD if it isn't registered.
ALL_PURPOSE_CAMERA = 100, --// Does everything above.
}
CameraLocations = {
--[[
Los Santos
]]--
{ --// Vinewood PD
pos = { x = 691.32, y = 7.53, z = 84.19 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = true,
},
{ --// Vespucci PD
pos = { x = -1083.85, y = -762.38, z = 19.36 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = true,
},
{ --// Misson Row PD
pos = { x = 399.51, y = -984.98, z = 29.47 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = true,
},
{ --// Davis PD
pos = { x = 393.38, y = -1575.26, z = 29.34 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = true,
},
{ --// Grove Street
pos = { x = 62.18, y = -1904.49, z = 21.7 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = false,
},
--[[
Sandy Shores
]]--
{ --// Route 68
pos = { x = 1147.60, y = 2684.04, z = 38.24 },
radius = 500.0,
type = CAMERA_ENUMS.SPEED_CAMERA,
hidden = false,
},
{ --// Panorama & East Joshua Intersection
pos = { x = 1699.00, y = 3507.62, z = 36.47 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = false,
},
{ --// Sandy PD
pos = { x = 1865.19, y = 3667.59, z = 33.9 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = true,
},
--[[
Grapeseed
]]--
{ --// Joad Lane & Seaview Road
pos = { x = 2180.83, y = 4747.85, z = 41.13 },
radius = 500.0,
type = CAMERA_ENUMS.SPEED_CAMERA,
hidden = false,
},
--[[
Paleto Bay
]]--
{ --// Great Ocean Highway & Procopi Drive Intersection
pos = { x = 153.96, y = 6527.41, z = 31.69 },
radius = 400.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = false,
},
{ --// Paleto PD
pos = { x = -414.34, y = 6043.05, z = 31.38 },
radius = 500.0,
type = CAMERA_ENUMS.ALL_PURPOSE_CAMERA,
hidden = true,
},
--[[
Highways
]]--
{ --// Route 68 & Senora Freeway
pos = { x = 2413.93, y = 2903.03, z = 49.35 },
radius = 6000.0,
type = CAMERA_ENUMS.SPEED_CAMERA,
hidden = false,
},
} |
local a={}a._startRoute={-155.01356506348,6140.6962890625,32.335067749023}a._routes={[1]={-546.85333251953,5566.2963867188,59.569416046143},[2]={-580.40179443359,5465.05078125,60.359615325928},[3]={-923.66589355469,5269.41796875,84.011985778809},[4]={-568.50189208984,5179.25390625,98.315795898438},[5]={-642.04534912109,5485.1723632813,52.305450439453},[6]={-491.01577758789,5660.521484375,57.541343688965},[7]={-574.83148193359,5465.224609375,61.096893310547},[8]={-914.26129150391,5234.5869140625,87.613990783691},[9]={-907.91235351563,5140.5302734375,159.58462524414},[10]={-972.35369873047,4995.7197265625,184.39270019531},[11]={-1015.6007080078,4941.224609375,199.78303527832},[12]={-696.57952880859,5077.9155273438,139.84693908691}}return a |
cine = {}
function cine.Init()
-- Hide UI Keep Mouse
SetSkyModel(sky.blizzardSky)
-- BlzHideOriginFrames(true)
-- BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop", 0), false)
CinematicFilterGenericBJ(0.00, BLEND_MODE_BLEND, mask.black, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0)
local t = CreateTrigger()
TriggerRegisterTimerEventSingle(t, 3)
TriggerAddAction(t, function()
CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 3.00, mask.black, 0, 0, 0, 0)
-- Lock Cam
local startCams = {
gg_cam_intro01, gg_cam_intro02, gg_cam_intro03, gg_cam_intro04, gg_cam_intro05, gg_cam_intro06, gg_cam_intro07,
gg_cam_intro08, gg_cam_intro09, gg_cam_intro10, gg_cam_intro11
}
for i = 0, 11, 1 do
local camChoice = GetRandomInt(1, #startCams)
CameraSetupApplyForPlayer(true, startCams[camChoice], Player(i), 0)
local camX = CameraSetupGetDestPositionX(startCams[camChoice])
local camY = CameraSetupGetDestPositionY(startCams[camChoice])
local unit = CreateUnit(Player(19), FourCC("h01Z"), camX, camY, bj_UNIT_FACING)
UnitApplyTimedLife(unit, FourCC("BTLF"), 20)
SetCameraTargetControllerNoZForPlayer(Player(i), unit, 0, 0, false)
end
end)
function cine.mapStart()
-- Set Hero Bar Offsets
local x = 0.205
local y = -0.025
-- Turn off Auto Positioning
BlzEnableUIAutoPosition(false)
-- Create Hero Bar Background UI Texture
heroBarUI = BlzCreateFrameByType("BACKDROP", "image", BlzGetFrameByName("ConsoleUIBackdrop", 0),
"ButtonBackdropTemplate", 0)
BlzFrameSetTexture(heroBarUI, "UI\\ResourceBar_combined.dds", 0, true)
BlzFrameSetAbsPoint(heroBarUI, FRAMEPOINT_TOPLEFT, x + 0.046, y + 0.255)
BlzFrameSetAbsPoint(heroBarUI, FRAMEPOINT_BOTTOMRIGHT, x + 0.17, y + 0.126)
BlzFrameSetLevel(heroBarUI, 1)
-- Remove Upper Button Bar Back
BlzFrameSetAbsPoint(frame.consoleUI, FRAMEPOINT_TOPLEFT, 0, -0.1)
BlzFrameSetAbsPoint(frame.consoleUI, FRAMEPOINT_BOTTOM, 0, 0)
-- Hide Upper Button Bar Buttons
BlzFrameClearAllPoints(frame.upperButtonBar.alliesButton)
BlzFrameClearAllPoints(frame.upperButtonBar.questsButton)
BlzFrameSetAbsPoint(frame.upperButtonBar.alliesButton, FRAMEPOINT_BOTTOMLEFT, 0, 1.5)
BlzFrameSetAbsPoint(frame.upperButtonBar.questsButton, FRAMEPOINT_BOTTOMLEFT, 0, 1.5)
-- Move Upper Button Bar Buttons we like
BlzFrameClearAllPoints(frame.upperButtonBar.menuButton)
BlzFrameClearAllPoints(frame.upperButtonBar.chatButton)
BlzFrameSetAbsPoint(frame.upperButtonBar.menuButton, FRAMEPOINT_TOPLEFT, 0.255, 0.60)
BlzFrameSetAbsPoint(frame.upperButtonBar.chatButton, FRAMEPOINT_TOPLEFT, 0.463, 0.60)
-- Move Gold Bar
BlzFrameClearAllPoints(frame.resource.goldText)
BlzFrameSetAbsPoint(frame.resource.goldText, FRAMEPOINT_TOPLEFT, x + 0.073, y + 0.213)
-- Hide Resource Bar
BlzFrameClearAllPoints(frame.resource.frame)
BlzFrameClearAllPoints(frame.resource.lumberText)
BlzFrameSetAbsPoint(frame.resource.frame, FRAMEPOINT_TOPLEFT, 0.0, 1.5)
BlzFrameSetAbsPoint(frame.resource.lumberText, FRAMEPOINT_TOPLEFT, 0, 1.5)
BlzFrameSetAbsPoint(frame.resource.upkeepText, FRAMEPOINT_TOPRIGHT, 0, 1.5)
BlzFrameSetAbsPoint(frame.resource.supplyText, FRAMEPOINT_TOPRIGHT, 0, 1.5)
-- Hero Bar
BlzFrameClearAllPoints(frame.hero.bar)
BlzFrameSetAbsPoint(frame.hero.bar, FRAMEPOINT_TOPLEFT, x + 0.01, y + 0.214)
BlzFrameSetScale(frame.hero.button[1], 1.25)
-- HP Bar
BlzFrameClearAllPoints(frame.hero.hp[1])
BlzFrameSetAbsPoint(frame.hero.hp[1], FRAMEPOINT_BOTTOMLEFT, x + 0.065, y + 0.181)
BlzFrameSetScale(frame.hero.hp[1], 2.3)
-- Mana Bar
BlzFrameClearAllPoints(frame.hero.mana[1])
BlzFrameSetAbsPoint(frame.hero.mana[1], FRAMEPOINT_BOTTOMLEFT, x + 0.065, y + 0.175)
BlzFrameSetScale(frame.hero.mana[1], 2.3)
end
function cine.finish()
-- Reset back to normal
CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT, 1.00, mask.black, 0, 0, 0, 0)
-- BlzHideOriginFrames(false)
-- BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop", 0), true)
PolledWait(1)
for i = 0, 15, 1 do
if i < 6 then
CameraSetupApplyForPlayer(true, gg_cam_baseLeftStart, Player(i), 0)
else
CameraSetupApplyForPlayer(true, gg_cam_baseRightStart, Player(i), 0)
end
end
CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 1.00, mask.black, 0, 0, 0, 0)
FogMaskEnableOn()
FogEnableOn()
end
end
|
object_mobile_outbreak_undead_deathtrooper_15_m = object_mobile_shared_outbreak_undead_deathtrooper_15_m:new {
}
ObjectTemplates:addTemplate(object_mobile_outbreak_undead_deathtrooper_15_m, "object/mobile/outbreak_undead_deathtrooper_15_m.iff")
|
object_tangible_storyteller_prop_pr_ch9_installation_gas_harvester = object_tangible_storyteller_prop_shared_pr_ch9_installation_gas_harvester:new {
}
ObjectTemplates:addTemplate(object_tangible_storyteller_prop_pr_ch9_installation_gas_harvester, "object/tangible/storyteller/prop/pr_ch9_installation_gas_harvester.iff")
|
local numToName = {
[1] = "Ritalin",
[2] = "LSD",
[3] = "Cocaine",
[4] = "Ecstasy",
[5] = "Heroine",
[6] = "Weed",
["Ritalin"] = 1,
["LSD"] = 2,
["Cocaine"] = 3,
["Ecstasy"] = 4,
["Heroine"] = 5,
["Weed"] = 6,
}
local drugsTable = {}
addEvent("getDrugsFromQuery",true)
addEventHandler("getDrugsFromQuery",root,function(player)
local id = exports.server:getPlayerAccountID(player)
local data = exports.DENmysql:querySingle("SELECT `drugs` FROM `playerstats` WHERE `userid` =? LIMIT 1", id)
if (data) then
data = fromJSON(data.drugs)
drugsTable[player] = {}
drugsTable[player] = data
triggerClientEvent(source,"sendDrugsFromQuery",source,drugsTable[player],numToName)
end
end)
|
class 'ActiveRecord::Adapters::Pg' extends 'ActiveRecord::Adapters::Abstract'
ActiveRecord.Adapters.Pg.types = {
primary_key = 'bigserial primary key',
string = 'character varying',
text = 'text',
integer = 'integer',
float = 'float',
decimal = 'decimal',
datetime = 'timestamp',
timestamp = 'timestamp',
time = 'time',
date = 'date',
binary = 'bytea',
boolean = 'boolean',
json = 'json'
}
ActiveRecord.Adapters.Pg._sql_syntax = 'postgresql'
function ActiveRecord.Adapters.Pg:init()
require 'pg'
end
function ActiveRecord.Adapters.Pg:is_postgres()
return true
end
function ActiveRecord.Adapters.Pg:connect(config, on_connected)
local host, user, password, port, database = config.host, config.user, config.password, config.port, config.database
if !port then
port = 5432
end
if host == 'localhost' then
host = '127.0.0.1'
end
if pg then
self.connection = pg.new_connection()
local success, err = self.connection:connect(host, user, password, database, port)
if success then
success, err = self.connection:set_encoding(config.encoding or 'UTF8')
if !success then
ErrorNoHalt('ActiveRecord - Failed to set connection encoding:\n')
error_with_traceback(err)
end
if isfunction(on_connected) then on_connected(self) end
else
self:on_connection_failed(err)
end
else
ErrorNoHalt('ActiveRecord - PostgreSQL (pg) is not found!\nPlease make sure you have gmsv_pg in your lua/bin folder!\n')
end
end
function ActiveRecord.Adapters.Pg:disconnect()
if self.connection then
self.connection:disconnect()
end
self.connection = nil
end
function ActiveRecord.Adapters.Pg:escape(str)
return self.connection:escape(str)
end
function ActiveRecord.Adapters.Pg:quote(str)
return self.connection:quote(str)
end
function ActiveRecord.Adapters.Pg:quote_name(str)
return self.connection:quote_name(str)
end
function ActiveRecord.Adapters.Pg:raw_query(query, callback, query_type)
if !self.connection then
return self:queue(query)
end
local query_obj = self.connection:query(query)
local query_start = os.clock()
local success_func = function(result, size)
if callback then
for k, v in pairs(result) do
if isstring(v) then
result[k] = self.connection:unescape(v)
end
end
local status, a, b, c, d = pcall(callback, result, query, math.Round(os.clock() - query_start, 3))
if !status then
ErrorNoHalt('ActiveRecord - PostgreSQL Callback Error!\n')
error_with_traceback(a)
end
return a, b, c, d
end
end
query_obj:on("success", success_func)
query_obj:on("error", function(error_text)
ErrorNoHalt('ActiveRecord - PostgreSQL Query Error!\n')
long_error('Query: '..query..'\n')
error_with_traceback(error_text)
end)
if self._sync then
query_obj:set_sync(true)
local success, res, size = query_obj:run()
if success then
return success_func(res, size)
else
ErrorNoHalt('ActiveRecord - PostgreSQL Query Error!\n')
long_error('Query: '..query..'\n')
error_with_traceback(tostring(res))
end
else
query_obj:set_sync(false)
query_obj:run()
end
end
function ActiveRecord.Adapters.Pg:create_column(query, column, args, obj, type, def)
if type == 'primary_key' then
query:set_primary_key(column)
end
end
function ActiveRecord.Adapters.Pg:append_query_string(query, query_string, query_type)
if query_type == 'insert' then
return query_string..' RETURNING id'
end
end
|
local M = {}
local function currentTime()
return tonumber(
(
hs.execute("/usr/local/opt/coreutils/libexec/gnubin/date +%s%N")
)
)/1000000000
end
M.currentTime = currentTime
function M.functionWithTimes(fn, ...)
local start = current_time()
result = table.pack(fn(...))
print("elapsed seconds: ".. tostring(current_time() - start))
return table.unpack(result)
end
function M.profilingOn()
debug.sethook(function (event)
local x = debug.getinfo(2, 'nS')
print(event, x.name, x.linedefined, x.source, hs.timer.secondsSinceEpoch())
end, "c")
end
function M.profilingOff()
debug.sethook()
end
return M
|
-- Random Distribution Script
-- Robert Edwards 2003
-- This script is in the public domain and can be used for any purpose
-- I just hope its useful as an example of binary IO in lua for mappy
shifttab = {}
shifttab[0] = 1
shifttab[1] = 256
shifttab[2] = 65536
shifttab[3] = 16777216
function ShowError(message)
mappy.msgBox("Error ...", message, mappy.MMB_OK, mappy.MMB_ICONEXCLAMATION)
end
function ShowMessage(message)
mappy.msgBox("Message ...", message, mappy.MMB_OK, mappy.MMB_ICONNONE)
end
function ReadInt( file )
acc = 0
for i = 0,3 do
a = string.byte( file:read(1) )
acc = acc + (a * shifttab[i])
end
return acc
end
function ReadShort( file )
acc = 0
for i = 0,1 do
a = string.byte( file:read(1) )
acc = acc + (a * shifttab[i])
end
return acc
end
function ReadChar( file )
a = string.byte( file:read(1) )
return a
end
function main()
if mappy.msgBox("Random Distribution Plugin", "This will create a semi-random map based upon an input 8-bit TGA bitmap, high index = high density of current block", mappy.MMB_OKCANCEL, mappy.MMB_ICONQUESTION ) == mappy.MMB_OK then
isok, srcfile = mappy.fileRequester(".","Targa Bitmaps(*.tga)","*.TGA",mappy.MMB_OPEN )
if isok then
file = io.open( srcfile, "r+b" )
idsize=ReadChar(file)
cmaptype = ReadChar(file)
if cmaptype ~= 0 and cmaptype ~= 1 then
error("Incorrect type of targa file")
end
type = ReadChar(file)
if type ~= 3 and type ~= 1 then
error("Incorrect type of targa file")
end
-- skip the colormap info and origin info
file:read(4+5)
xsize = ReadShort(file)
if mappy.getValue(mappy.MAPWIDTH) ~= xsize then
error("Bitmap is wrong width")
end
ysize = ReadShort(file)
if mappy.getValue(mappy.MAPHEIGHT) ~= ysize then
error("Bitmap is wrong height")
end
bpp = ReadChar(file)
if bpp ~= 8 then
error("Incorrect color depth")
end
--ignore the image descriptor byte
file:read(1)
-- ignore the file identification
file:read(idsize)
if cmaptype == 1 then
-- skip colour palette
file:read(768)
end
if type == 1 then
y = ysize-1
else
y = 0
end
mappy.copyLayer(mappy.getValue(mappy.CURLAYER),mappy.MPY_UNDO)
cblock = mappy.getValue(mappy.CURBLOCK)
for i=0,(ysize-1) do
for x=0,(xsize-1) do
io.write ("x=",x," y=",y,"\n")
rnd = ReadChar(file) / 256
if math.random() < rnd then
mappy.setBlock(x,y,cblock)
end
end
if type == 1 then
y = y - 1
else
y = y + 1
end
end
file:close()
mappy.updateScreen()
end
end
end
test, errormsg = pcall( main )
if not test then
ShowError(errormsg)
end
|
---
-- @author wesen
-- @copyright 2019 wesen <[email protected]>
-- @release 0.1
-- @license MIT
--
package.path = package.path .. ";../src/?.lua";
local IpcSender = require "ipc.CommunicationPartner.IpcSender"
local socket = require "socket"
local receivedResponse = false
local function onMessageReceived(_message)
print("Received data \"" .. _message.data .. "\" from socket " .. _message.receiveSocket.fileDescriptor)
receivedResponse = true
end
local sender = IpcSender("\0gema_scores")
sender:initialize({
["onMessageReceived"] = onMessageReceived
})
local uniqueId = os.time()
sender:sendData("Hello from " .. uniqueId)
local numberOfSentMessages = 0
while (numberOfSentMessages < 10 or not receivedResponse) do
sender:listen()
if (numberOfSentMessages < 10) then
numberOfSentMessages = numberOfSentMessages + 1
print("Sending message #" .. numberOfSentMessages)
sender:sendData("Message #" .. numberOfSentMessages .. " from " .. uniqueId)
end
socket.sleep(0.01)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.