content
stringlengths 5
1.05M
|
|---|
--------------------
-- Battery widget --
--------------------
-- Copyright (c) 2013-2015 Vladimir Gorbunov
-- Release under MIT license, see LICENSE file for more details
local wibox = require("wibox")
local awful = require('awful')
local naughty = require('naughty')
local utils = require("fainty.utils")
local base = require("fainty.widgets.base")
local gears = require("gears")
local math = math
local unpack = unpack
local setmetatable = setmetatable
local io = io
local os = os
local pairs = pairs
local table = table
local Battery = { mt = {} }
Battery.path = '/sys/class/power_supply/'
function Battery:new(bat)
local new_instance = { name = bat,
path = Battery.path .. bat .. '/' }
setmetatable(new_instance, { __index = Battery })
return new_instance
end
function Battery:read(val)
local path = self.path .. val
local fd = io.open(path, 'r')
if not fd then
return nil
end
data = fd:read('*all')
fd:close()
return utils.trim(data)
end
function Battery:is_present()
local present = self:read('present')
if present == '1' then
return true
else
return false
end
end
function Battery:status()
local data = { status = self:read('status'),
percent = nil,
time = nil,
capacity = nil,
watt = nil }
local current, full, rate
data.percent = tonumber(self:read('capacity'))
-- local rate_v = tonumber(self:read('voltage_now'))
if self:read('energy_now') then
current = tonumber(self:read('energy_now'))
full = tonumber(self:read('energy_full'))
rate = tonumber(self:read('power_now'))
elseif self:read('charge_now') then
current = tonumber(self:read('charge_now'))
full = tonumber(self:read('charge_full'))
rate = tonumber(self:read('current_now'))
else
return data
end
-- if rate ~= nil and rate_v ~= nil then
-- data.watt = (rate * rate_v) / 1e12
-- end
if not data.percent then
data.percent = math.min(math.floor(current / full * 100), 100)
end
local left
if rate ~= 0 and data.status == 'Discharging' then
left = current / rate
elseif rate ~= 0 and data.status == 'Charging' then
left = (full - current) / rate
else
left = nil
end
if left then
data.hours = math.floor(left)
data.minutes = math.floor(60 * (left - data.hours))
data.in_seconds = math.floor(data.hours * 3600 +
(data.minutes * 60))
else
data.hours = nil
data.minutes = nil
data.in_seconds = nil
end
return data
end
local BatteryWidget = { mt = {} }
function BatteryWidget:refresh()
local bat = self.selected
if bat == nil then
self:set_markup(self.settings.fmt_not_present)
return
end
if bat:is_present() then
local data = bat:status()
local fmt = self.settings.fmt_unknown
if data.status == 'Discharging' then
fmt = self.settings.fmt_discharging
elseif data.status == 'Charging' then
fmt = self.settings.fmt_charging
end
if (data.in_seconds and data.in_seconds < self.warning_seconds
and data.status == 'Discharging') then
fmt = self.settings.fmt_warning
if self.settings.notify_warning then
self.notif_id = naughty.notify({
preset = naughty.config.presets.critical,
timeout = 10,
replaces_id = self.notif_id or nil,
title = self.settings.notify_warning_title,
text = self.settings.notify_warning_text
}).id
end
end
local percent = 0
if data.percent then
percent = data.percent
end
local values = {
name = self.selected.name,
status = data.status,
percent = percent or 0,
hours = data.hours or 0,
minutes = data.minutes or 0,
in_seconds = data.in_seconds or 0,
watt = data.watt or 0
}
self:set_markup(fmt % values)
-- Update popup if needed
if self.settings.show_popup then
self.popup_wgt:set_markup(self.settings.popup_fmt % values)
end
else
self:set_markup(self.settings.fmt_not_present)
end
return
end
-- Get batteries table for awful.menu
function BatteryWidget:get_menu_items()
local battery_list = {}
for k, v in pairs(self.batteries) do
battery_list[k] = {
v.name,
function ()
self.selected = self.batteries[k]
self:refresh()
end
}
end
return battery_list
end
local function new(args)
-- TODO: Additional battery params, voltage, etc
args.selected = args.selected or 'BAT0'
settings = utils.merge_settings(
args.settings or {},
{
fmt_discharging = ' <span color="#F80000">↯</span>%(percent)3d% '
.. '(%(hours)d:%(minutes)02d)', -- Red color
fmt_charging = ' <span color="#00EE00">↯</span>%(percent)3d% ' ..
'(%(hours)d:%(minutes)02d)', -- Green color
fmt_unknown = ' <span color="#FFFFFF">↯</span>%(percent)3d%', -- White
fmt_warning = ' <span color="#F80000">↯!%(percent)3d%</span>', -- Red
fmt_not_present = ' <span color="#FFFFFF">↯</span> N/A', -- White
popup_fmt = 'Name: %(name)s\n' ..
'Status: %(status)s\n' ..
'Remaining: %(percent)s%\n' ..
'Time: %(hours)d:%(minutes)02d',
show_popup = true,
menu_theme = { width = 120, height = 15 },
bind_buttons = true,
warning_seconds = 600,
refresh_timeout = 25,
notify_warning = true,
notify_warning_title = 'Low battery',
notify_warning_text = 'Less than 10 minutes remaining'
}
)
local obj = base(wibox.widget.textbox())
-- local obj = wibox.widget.textbox()
for k, v in pairs(BatteryWidget) do
obj[k] = v
end
obj.settings = settings
obj.warning_seconds = settings.warning_seconds
-- Get battery list
obj.batteries = {}
obj.selected = nil
local batlist = io.popen('ls ' .. Battery.path)
for line in batlist:lines() do
if line:match('^BAT%d+') then
battery = Battery:new(line)
if battery.name == args.selected then
obj.selected = battery
end
table.insert(obj.batteries, battery)
end
end
if not obj.selected and #obj.batteries ~= 0 then
obj.selected = obj.batteries[1]
end
batlist:close()
local btns = {}
-- Popup
if obj.settings.show_popup then
obj:create_popup()
if settings.bind_buttons then
btns = gears.table.join(
btns,
awful.button({ }, 1, function () obj:toggle_popup() end)
)
end
end
-- Add menu if there is more than one battery
if #obj.batteries ~= 1 then
local battery_menu = awful.menu({ items = obj:get_menu_items(),
theme = settings.menu_theme })
if settings.bind_buttons then
btns = gears.table.join(
btns,
awful.button({ }, 3, function () battery_menu:toggle() end)
)
end
end
if settings.bind_buttons then
obj:buttons(btns)
obj.popup:buttons(
awful.button({ }, 1, function () obj:toggle_popup() end)
)
end
obj:refresh()
-- Set update timer
if #obj.batteries ~= 0 then
refresh_timer = gears.timer({ timeout = settings.refresh_timeout })
refresh_timer:connect_signal("timeout", function() obj:refresh() end)
refresh_timer:start()
end
return obj
end
function BatteryWidget.mt:__call(...)
return new(...)
end
return setmetatable(BatteryWidget, BatteryWidget.mt)
|
local L = LibStub("AceLocale-3.0"):NewLocale("BestInSlotNG", "deDE")
if L then
L["%1$s from raid tier: %2$s"] = "%1$s aus dem Raid Tier: %2$s"
L["%1$s needs nothing from %2$s %3$s"] = "%1$s ben\195\182tigt nichts mehr von %2$s %3$s"
L["%1$s needs the following bosses from %2$s %3$s"] = "%1$s ben\195\182tigt die folgenden Bosse aus %2$s %3$s"
L["%s - enable/disable debug messages"] = "%s - aktiviere/deaktiviere Debug Meldungen"
L["%s - Shows a debugging console"] = "%s - Zeigt eine Debug-Konsole"
L["%s - this dialog"] = "%s - diesen Dialog"
L["%s manager"] = "%s Manager"
L["%s or %s"] = "%s oder %s"
L["%s's BestInSlot lists"] = "%s's BestInSlot Liste"
L["A list with this name already exists"] = "Eine Liste mit diesem Name existiert bereits"
L["Add a custom item"] = "F\195\188ge einen benutzerdefinierten Gegenstand hinzu"
L["Add lower raid tiers"] = "F\195\188ge \195\164ltere Raid-Tiers hinzu"
L["Are you sure you want to delete %s? This item is on your Best In Slot list!"] = "Bist du sicher, dass du %s l\195\182schen willst? Dieser Gegenstand befindet sich in deiner Best In Slot Liste!"
L["Are you sure you want to delete ALL history?"] = "Bist du dir sicher, die gesamte Historie l\195\182schen zu wollen?"
L["Are you sure you want to import the %s difficulty? This will override your old BiS list!"] = "Bist du sicher, dass du aus dem %s Schwierigkeitsgrad importieren m\195\182chtest? Dies wird deine alte BiS Liste ersetzen!"
L["Are you sure you want to import the list from %s? This will override your old BiS list!"] = "Bist du sicher, dass du die Liste von %s importieren m\195\182chtest? Diese wird deine alte BiS Liste ersetzen."
L["Armor filter"] = "R\195\188stungs Filter"
L["Automatically delete history"] = "Automatisches l\195\182schen der Historie"
L["Automatically deletes history based on the time set below"] = "Automatisches l\195\182schen der Historie basierend auf der unten angegebenen Zeit."
L["Automatization"] = "Automatisierung"
L["Changes the behavior of the BestInSlot frame."] = "Ver\195\164ndert das Verhalten des BestInSlot-Fensters."
L["Checking this disables the animation, and makes the frame instantly change size."] = "Wenn dies aktiviert ist, wird die Animation deaktiviert und l\195\164sst das Fenster sofort seine Gr\195\182\195\159e \195\164ndern."
L["Class filter"] = "Klassenfilter"
L["Click"] = "Klick"
L["Click on any specialization icon to view that specializations list."] = "Klicke auf irgendein Spezialisierung Symbol, um deren Liste zu sehen."
L["Click on the class icons to view that characters BestInSlot list."] = "Klicke auf das Klassenicon um die BestInSlot-Liste des Charakters zu sehen."
L["Command not recognized, try '%s' for help"] = "Befehl noch nicht erfasst, versuche '%s' f\195\188r Hilfe"
L["commands"] = "Befehle"
L["CONQUEROR"] = "Eroberer"
L["Couldn't find item!"] = "Konnte den Gegenstand nicht finden!"
L["Created BestInSlot list"] = "Erstellte BestInSlot Liste"
L["Created by %s. Currently developed by %s."] = "Erstellt von %s. Aktuell in Entwicklung von %s."
L["Credits"] = "Danksagungen"
L["Custom Items"] = "Benutzerdefinierte Gegenst\195\164nde"
L["Custom Lists"] = "Benutzerdefinierte Listen"
L["Debug messages"] = "Debugmeldungen"
L["Debug messages will be shown in the chat window if enabled."] = "Debugmeldungen werden im Chatfenster angezeigt wenn aktiviert."
L["Delete %s completely."] = "L\195\182sche %s komplett"
L["Delete %s from this difficulty"] = "L\195\182sche %s von diesem Schwierigkeitsgrad"
L["Delete %s from this raidtier"] = "L\195\182sche %s aus diesem Raid Tier"
L["Delete options"] = "L\195\182scheinstellungen"
L["Delete this specialization from this raid tier"] = "L\195\182sche diese Spezialisierung aus dem Raid Tier"
L["Deleting this is irreversible. Are you sure?"] = "Das L\195\182schen ist unwiderruflich. Bist du dir sicher?"
L["Deselect all"] = "Alles abw\195\164hlen"
L["Deselect item"] = "Gegenstand abw\195\164hlen"
L["Difficulty"] = "Schwierigkeitsgrad"
L["Disable resizing"] = "Skalierung deaktivieren"
L["Disabling debug messages"] = "Debugmeldungen deaktivieren"
L["Each custom list must be tied to a talent specialization."] = "Jede individuelle Liste muss einer Talentspezialisierung zugeordnet sein."
L["Enabling debug messages"] = "Debugmeldungen aktivieren"
L["Export"] = "Export"
L["Failed to add item because of the following reasons:"] = "Fehler beim hinzuf\195\188gen eines Items aus folgenden Gr\195\188nden"
L["Generally encouraged to keep this disabled"] = "Vorgeschlagen: abgeschlaten lassen"
L["Guild BiS lists"] = "Gilden BiS Listen"
L["History for %s"] = "Verlauf f\195\188r %s"
L["History tracking"] = "Verlaufsverfolgung"
L["If you want to share your BestInSlot list, you can report it here."] = "Willst du deine BestInSlot Liste teilen? Das kannst du hier."
L["Import from other difficulty/character"] = "Von anderem Charakter/anderer Schwierigkeit importieren"
L["In this menu you can add custom items. Use this edit box to submit your item."] = "In diesem Men\195\188 kannst du benutzerdefinierte Gegenst\195\164nde hinzuf\195\188gen."
L["In this menu you can select different parts of the AddOn. The selected menu is displayed in white."] = "In diesem Men\195\188 kannst du verschiedene AddOn Funktionen ausw\195\164hlen. Das ausgew\195\164hlte Men\195\188 wird in wei\195\159er Schrift dargestellt."
L["Insert item ID, item link or item name"] = "Gegenstands-ID, Gegenstandslink oder Gegenstandsnamen eingeben"
L["Instant animations"] = "Sofortanimationen"
L["It could also be that you haven't set the BestInSlot for this raid tier yet"] = "Du hast scheinbar noch keine BestInSlot Liste f\195\188r diesen Raid angelegt."
L["It looks like this instance does not drop any of your BestInSlot items."] = "Es sieht so aus, als w\195\188rde in dieser Instanz kein BestInSlot Gegenstand droppen."
L["It's in use at:"] = "Wird benutzt in: "
L["Looking up item"] = "Suche nach Gegenstand"
L["Modified the %s slot. Previous item: %s, new item: %s"] = "Der Slot %s wurde ver\195\164ndert. Vorheriger Gegenstand: %s. Neuer Gegenstand: %s"
L["New custom list"] = "Neue benutzerdefinierte Liste"
L["No other characters to import"] = "Keine anderen Charaktere zu importieren"
L["Not enough data to filter"] = "Nicht genug Daten zu filtern"
L["Note: This could send a long list of items depending on the amount of items you still need, and might be considered spam."] = "Hinweis: Es kann basierend auf der Menge an noch ben\195\182tigten Gegenst\195\164nden eine sehr gro\195\159e Liste erstellt und als Spam betrachtet werden."
L["On most pages you can set your instance, difficulty and specialization in the top of the page. These settings are saved across all pages."] = "Auf den meisten Seiten k\195\182nnen Sie Ihre Instanz, Schwierigkeit und Spezialisierung oben auf der Seite festlegen. Diese Einstellungen werden synchron f\195\188r alle Seiten \195\188bernommen."
L["On this page you can overview your BestInSlot list per instance."] = "Auf dieser Seite kannst du deine BestInSlot Liste pro Instanz einsehen."
L["On this page you can request BestInSlot lists from your friends, guildmembers or raidmembers."] = "Auf dieser Seite kannst du die BestInSlot Liste von Freunden, Gildenmitgliedern oder Raidmitgliedern anfordern."
L["On this page you can set your BestInSlot list. You can use the '%s' buttons to select your item for that slot"] = "Auf dieser Seite kannst du deine BestInSlot Liste erstellen. Benutze den '%s' Button um ein Gegenstand f\195\188r diesen Slot auszuw\195\164hlen."
L["On this page you can view the BestInSlot lists of your guild."] = "Auf dieser Seite kannst du die BestInSlot Liste deiner Gilde einsehen."
L["Only show items for specialization"] = "Zeige nur Gegenst\195\164nde f\195\188r die Spezialisierung"
L["Only show missing items"] = "Zeige nur fehlende Gegenst\195\164nde"
L["Only show this raid tier"] = "Nur diesen Raidtier anzeigen"
L["Options"] = "Optionen"
L["Overview"] = "\195\156bersicht"
L["Pick a previously created custom item"] = "W\195\164hle ein zuvor erstelltes benutzerdefiniertes Objekt aus"
L["Please verify that this is the item you would like to add:"] = "Bitte \195\188berp\195\188fe, ob dies der Gegenstand ist, welches du hinzuf\195\188gen m\195\182chtest:"
L["PROTECTOR"] = "Besch\195\188tzer"
L["Queries the specified channels for versions."] = "Fr\195\164gt den gew\195\164hlten Channel nach Versionen ab."
L["Raid Instance"] = "Schlachtzugsinstanz"
L["Raid Tier"] = "Schlachtzugstier"
L["Receive automatic updates"] = "Automatische Updates empfangen"
L["Report BestInSlot"] = "Berichte dein BestInSlot"
L["Report your BestInSlot to:"] = "Berichte dein BestInSlot zu:"
L["Request"] = "Anfrage"
L["Request BiS"] = "BiS Anfragen"
L["Request from"] = "Anfragen von"
L["Resets the window to it's original position"] = "Fenster auf seine urspr\195\188ngliche Position zur\195\188cksetzen"
L["Return to character selection"] = "Zur\195\188ck zur Charakterauswahl"
L["Right clicking the icons gives you options to delete them from your Saved Variables."] = "Rechts-Klick auf die Symbole liefert dir die Optionen, um sie aus den Saved Variables zu l\195\182schen."
L["Select a channel"] = "W\195\164hle einen Chat"
L["Select all"] = "Alles ausw\195\164hlen"
L["Select an item"] = "Einen Gegenstand ausw\195\164hlen"
L["Select an option"] = "Eine Option ausw\195\164hlen"
L["Select the instance that you would like to add this item to."] = "W\195\164hle die Instanz aus, der du das Item hinzuf\195\188gen m\195\182chtest."
L["Send automatic updates"] = "Sende automatisch Aktualisierungen"
L["Show all items"] = "Alle Gegenst\195\164nde anzeigen"
L["Show BestInSlot in boss tooltips"] = "Zeige BestInSlot im Boss Tooltip an"
L["Show BestInSlot in Item tooltip"] = "Zeige BestInSlot im Gegenstandstooltip an"
L["Show guild members in Item Tooltip"] = "Zeige Gildenmitglieder im Gegenstandstooltip an"
L["Show history for %s"] = "Zeige Historie an f\195\188r %s"
L["Show item source in tooltip."] = "Zeige die Herkunft des Gegenstandes im Tooltip an."
L["Show minimap button"] = "Zeige Minimap Button"
L["Show obtained items"] = "Zeige erhaltene Gegenst\195\164nde"
L["Show the GUI"] = "GUI anzeigen"
L["Show the item source in the tooltip, for example a boss that drops it, or a quest chain."] = "Zeige die Herkunft des Gegenstandes im Tooltip an, z.B. von einem Boss oder einer Questreihe."
L["Show tooltips in combat"] = "Zeige Tooltips im Kampf"
L["Shows interactive tutorials on how to efficiently use %s"] = "Zeigt interaktive Tutorials, f\195\188r eine einfachere Benutzung von %s"
L["Specialization"] = "Spezialisierung"
L["Successfully added %s to the custom items of %s!"] = "%s erfolgriech zu den benutzerdefinierten Gegenst\195\164nden von %s hinzugef\195\188gt!"
L["Successfully deleted %s%s from the custom items!"] = "%s%s erfolgreich aus den benutzerdefinierten Gegenst\195\164nden gel\195\182scht!"
L["The filter is set to only show the items you have not obtained yet. You can also make multiple specializations appear here."] = "Der Filter ist so eingestellt, dass nur die Gegenst\195\164nde angezeigt werden, die du noch nicht erhalten hast. Du kannst auch mehrere Spezialisierungen gleichzeitig ausw\195\164hlen."
L["The following people in your guild already obtained this item"] = "Die folgenden Spieler in deiner Gilde haben diesen Gegenstand bereits erhalten:"
L["The following people in your guild also need this item:"] = "Folgende Spieler in deiner Gilde brauchen diesen Gegenstand auch:"
L["The minimum item level of custom items is %d!"] = "Die minimale Gegenstandsstufe von benutzerdefinierten Gegenst\195\164nden ist %d!"
L["There are no Best in Slot lists from any of your guild members available. Have you requested their Best In Slot info?"] = [=[Es ist keine Best In Slot Liste von einem Gildenmitglied verf\195\188gbar.
Hast du Ihre Best In Slot Listen Informationen angefordert?]=]
L["There are no custom items present"] = "Es sind keine benutzerdefinierten Gegenst\195\164nde vorhanden."
L["There is no history available for %s"] = "Es ist kein Verlauf verf\195\188gbar f\195\188r %s"
L["These can be used to identify problems."] = "Dies kann benutzt werden um Fehler zu identifizieren."
L["This addon requires atleast 1 expansion module! Please enable one!"] = "Diese Addon ben\195\182tigt mindestens ein aktiviertes Modul. Bitte aktiviere eins!"
L["This function requires a target."] = "Diese Aktion ben\195\182tigt ein Ziel."
L["This item already exists in the database! It is registered to %s"] = "Dieser Gegenstand existiert bereits in der Datenbank! Es ist eingetragen bei %s"
L["This name is invalid"] = "Dieser Name ist ung\195\188ltig"
L["This setting is account wide and saved between sessions."] = "Diese Einstellung ist Accountweit und wird zwischen dem ein- und ausloggen gespeichert."
L["This setting is not saved between sessions, and off by default."] = "Diese Einstellung wird zwischen dem ein- und ausloggen nicht gespeichert. Standardm\195\164\195\159ig deaktiviert."
L["This will disable resizing and set the window on a fixed size"] = "Deaktiviert die automatische Gr\195\182\195\159en\195\164nderung des Best In Slot Fenster und setzt das Fenster auf eine feste Gr\195\182\195\159e."
L["This will put a note underneath Item tooltips when the item is part of your BestInSlot"] = "F\195\188gt dem Gegenstand einen Tooltip hinzu, wenn sich der Gegenstand in der BestInSlot Liste befindet."
L["This will show items on the boss tooltip that you consider BestInSlot"] = "Zeigt Gegenst\195\164nde die du in deiner BestInSlot Liste hast im jeweiligem Boss Tooltip"
L["This will show the guild members who also have BestInSlot in your item tooltips."] = "Zeigt im Tooltip die Gildenmitglieder, welche ebenfalls BestInSlot benutzten."
L["Token filter"] = "Markenfilter"
L["Tooltip"] = "Tooltip"
L["Tracks changes made by Guild Members to their BestInSlot lists"] = "Verfolgt \195\132nderungen, die von Gildenmitgliedern an ihren BestInSlot-Listen vorgenommen wurden."
L["Trash Loot"] = "Trash Loot"
L["Tutorials have been reset."] = "Tutorial wurde zur\195\188ckgesetzt."
L["Usage: %s"] = "Verwendung: %s"
L["Use left-click to (de)select the left one, and right-click to select the right one"] = "Benutze Links-Klick zum Aus-/Abw\195\164hlen des Linken und Rechts-Klick zum Aus-/Abw\195\164hlen des Rechten"
L["Use the '%s' dropdown to pick where you would like to request lists from."] = "Nutze das '%s' Auswahlfeld zum selektieren, woher du Listen anfordern m\195\182chtest."
L["VANQUISHER"] = "Bezwinger"
L["Warlords crafted options:"] = "Einstellungen f\195\188r WoD Hergestelltes:"
L["Warning! Editing this item will overwrite the previous item set on this itemid!"] = "Warnung! \195\132nderungen an diesem Gegenstand wird den bisherigen Gegenstand unter dieser ID \195\188berschreiben!"
L["When others in your guild update their BiS list, automatically save it."] = "Wenn andere aus deiner Gilde ihre BiS-Liste aktualisieren, wird dies automatisch gespeichert."
L["When picking the whisper target, make sure you also fill in a recipient!"] = "Wenn du fl\195\188stern ausgew\195\164hlt hast, vergewisser dich, dass du einen Spielernamen eingegeben hast."
L["When selecting rings or trinkets, you can see both items at once."] = "Wenn du Ringe oder Schmuckst\195\188cke ausw\195\164hlst, kannst du beide Gegenst\195\164nde gleichzeitig sehen."
L["When you have successfully received BestInSlot lists you can use the filter to filter lists."] = "Wenn du eine BestInSlot Liste erhalten hast, kannst du diese Filter zum Filtern der Liste verwenden."
L["When you update your BiS list, it'll automatically send the updates to the guild"] = "Wenn du deine BiS-Liste aktualisierst, werden die Updates automatisch an alle Gildenmitglieder mit Best In Slot gesendet."
L["When you've set a difficulty before, you can easily import a previously set list."] = "Wenn du bereits eine Best In Slot Liste f\195\188r einen anderen Schwierigkeitsgrad erstellt hast, kannst du diese hier Importieren."
L["Whisper target"] = "Ziel fl\195\188stern"
L["Wipe history"] = "L\195\182sche den Verlauf"
L["You already have these %sBestInSlot%s items from %s"] = "Du hast bereits diese %sBestInSlot%s Gegenst\195\164nde von %s"
L["You can edit previously made custom items by selecting them with this dropdown box."] = "Du kannst zuvor benutzerdefinierte erstellte Gegenst\195\164nde bearbeiten, indem du sie \195\188ber diese Dropdown-Box ausw\195\164hlst."
L["You can only add items of %ssuperior%s quality or higher!"] = "Du kannst nur Gegenst\195\164nde der Qualit\195\164tsstufe %ssuperior%s oder h\195\182her hinzuf\195\188gen!"
L["You can only use the item name if you have the item in your inventory!"] = "Der Name des Gegenstands kann nur benutzt werden, sofern sich der Gegenstands im Inventar befindet!"
L["You can request BestInSlot lists in the '%s' page."] = "Du kannst BestInSlot Listen auf der '%s' Seite abrufen."
L["You can right-click icons to quickly remove them from your list."] = "Du kannst Gegenst\195\164nde rechtsklicken um sie schnell von deiner Liste zu entfernen."
L["You can use the BiS Manager on the left to set your BestInSlot"] = "Um deine BestInSlot festzulegen, benutze den BiS Manager auf der linken Seite."
L["You cannot add items of type: %s!"] = "Du kannst keine Gegenst\195\164nde dieses Typen hinzuf\195\188gen: %s!"
L["You can't delete this custom list."] = "Du kannst diese benutzerdefinierte Liste nicht l\195\182schen."
L["You have this item"] = "Du besitzt diesen Gegenstand"
L["You have this item on '%s'"] = "Du besitzt diesen Gegenstand auf '%s'"
L["You must be able to equip the item!"] = "Du musst den Gegenstand anlegen k\195\182nnen!"
L["You must select a specialization."] = "Du musst eine Spezialisierung w\195\164hlen!"
L["Your custom lists"] = "Deine benutzerdefinierten Listen"
L["Your version of BestInSlot is outdated! You can download the newest version at %s%s"] = "Deine BestInSlot-Version ist veraltet! Du kannst die neueste Version hier herunterladen: %s%s"
L["You've picked: %s"] = "Ausgew\195\164hlt: %s"
end
|
-- a script for synthesising images with MGAN
require 'torch'
require 'nn'
require 'optim'
require 'cutorch'
require 'cunn'
require 'image'
--camera--
require 'sys'
require 'camera'
require 'xlua'
loadcaffe_wrap = paths.dofile('lib/loadcaffe_wrapper.lua')
util = paths.dofile('lib/util.lua')
pl = require('pl.import_into')()
local opt = {}
--opt.model_name = '../model/VG_Alpilles_ImageNet100_epoch20.t7'
opt.model_name = '../model/Picasso.t7'
--opt.model_name = '../model/Kandinsky_Complex.t7'
opt.output_folder_name = '../Dataset/VG_Alpilles_ImageNet100/syn_VG_Alpilles_ImageNet100_epoch5/'
opt.max_length = 512 -- change this value for image size. Larger images needs more gpu memory.
opt.stand_atom = 8 -- make sure the image size can be divided by stand_atom
opt.noise_weight = 0.0 -- change this weight for balancing between style and content. Stronger noise makes the synthesis more stylish.
opt.noise_name = 'noise.jpg' -- low frequency noise image
opt.gpu = 1
-- camera
dev = 0
width = 640
height = 480
fps = 30
camera1 = image.Camera{idx=dev, width=width, height=height, fps=fps}
local image_input_ori = camera1:forward()
local image_syn = camera1:forward()
win1 = image.display{win=win1, image={image_input_ori}}
win2 = image.display{win=win2, image={image_syn}}
f = 1
-- load data
---------------
local noise_image = image.load(opt.noise_name, 3)
-------------
local net = util.load(opt.model_name, opt.gpu)
net:cuda()
print(net)
print('*****************************************************')
print('Testing: ');
print('*****************************************************')
local counter = 0
while true do
-- resize the image image
image_input_ori = camera1:forward()
local image_input = image_input_ori
local max_dim = math.max(image_input:size()[2], image_input:size()[3])
local scale = opt.max_length / max_dim
local new_dim_x = math.floor((image_input:size()[3] * scale) / opt.stand_atom) * opt.stand_atom
local new_dim_y = math.floor((image_input:size()[2] * scale) / opt.stand_atom) * opt.stand_atom
image_input = image.scale(image_input, new_dim_x, new_dim_y, 'bilinear')
-- add noise to the image (improve background quality)
local noise_image_ = image.scale(noise_image, new_dim_x, new_dim_y, 'bilinear')
image_input:add(noise_image_:mul(opt.noise_weight))
image_input:resize(1, image_input:size()[1], image_input:size()[2], image_input:size()[3])
image_input:mul(2):add(-1)
image_input = image_input:cuda()
-- decode image with a single forward prop
local tm = torch.Timer()
image_syn = net:forward(image_input)
cutorch.synchronize()
print(string.format('Image size: %d by %d, time: %f', image_input:size()[3], image_input:size()[4], tm:time().real))
image_syn = image.toDisplayTensor{input = image_syn, nrow = math.ceil(math.sqrt(image_syn:size(1)))}
-- save image
image.display{win=win1, image={image_input_ori}}
image.display{win=win2, image={image_syn}}
end
image_input = nil
image_syn = nil
noise_image_ = nil
net = nil
collectgarbage()
|
-- Selects the most recent input mode and attempts to
-- identify the best state from it
-- @classmod InputModeSelector
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
local INPUT_MODES = require("INPUT_MODES")
local Maid = require("Maid")
local ValueObject = require("ValueObject")
local InputModeSelector = {}
InputModeSelector.ClassName = "InputModeSelector"
InputModeSelector.DEFAULT_MODES = {
INPUT_MODES.Gamepads,
INPUT_MODES.Keyboard,
INPUT_MODES.Touch
}
function InputModeSelector.new(inputModes)
local self = setmetatable({}, InputModeSelector)
self._maid = Maid.new()
self._activeMode = ValueObject.new()
self._maid:GiveTask(self._activeMode)
self.Changed = self._activeMode.Changed
for _, inputMode in pairs(inputModes or InputModeSelector.DEFAULT_MODES) do
self:_addInputMode(inputMode)
end
return self
end
function InputModeSelector:GetActiveMode()
return rawget(self, "_activeMode").Value
end
function InputModeSelector:__index(index)
if index == "Value" then
return rawget(self, "_activeMode").Value
elseif InputModeSelector[index] then
return InputModeSelector[index]
else
local value = rawget(self, index)
if value then
return value
else
error(("[InputModeSelector] - Bad index '%s'"):format(tostring(index)))
end
end
end
function InputModeSelector:Bind(updateBindFunction)
local maid = Maid.new()
self._maid[updateBindFunction] = maid
local function onChange(newMode, oldMode)
maid._modeMaid = nil
if newMode then
local modeMaid = Maid.new()
maid._modeMaid = modeMaid
updateBindFunction(newMode, modeMaid)
end
end
maid:GiveTask(self._activeMode.Changed:Connect(onChange))
onChange(self._activeMode.Value, nil)
return self
end
function InputModeSelector:_addInputMode(inputMode)
assert(not self._maid[inputMode])
self._maid[inputMode] = inputMode.Enabled:Connect(function()
self._activeMode.Value = inputMode
end)
if not self._activeMode.Value then
self._activeMode.Value = inputMode
elseif inputMode:GetLastEnabledTime() > self._activeMode.Value:GetLastEnabledTime() then
self._activeMode.Value = inputMode
end
end
function InputModeSelector:Destroy()
self._maid:DoCleaning()
end
return InputModeSelector
|
ENT.Type = "anim"
ENT.Base = "base_wire_entity"
ENT.PrintName = "Wire Magnet"
ENT.Author = "cpf"
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.Spawnable = false
ENT.AdminSpawnable = false
function ENT:SetOn( boolon )
self:SetNetworkedBool( "On", boolon, true )
self:GetTable().On=boolon
end
function ENT:IsOn( name )
if SERVER then return self:GetTable().On end
return self:GetNetworkedBool( "On" )
end
function ENT:SetBackwards( boolon )
self:SetNetworkedBool( "Backwards", boolon, true )
self:GetTable().Backwards=boolon
end
function ENT:IsBackwards( name )
if SERVER then return self:GetTable().Backwards end
return self:GetNetworkedBool( "Backwards" )
end
function ENT:SetTargetOnlyMetal( boolon )
self:SetNetworkedBool( "TargetOnlyMetal", boolon, true )
self:GetTable().TargetOnlyMetal=boolon
end
function ENT:IsTargetOnlyMetal( name )
if SERVER then return self:GetTable().TargetOnlyMetal end
return self:GetNetworkedBool( "TargetOnlyMetal" ) or true
end
function ENT:SetStrength(Strength)
if Strength<0 then
self:SetBackwards(true)
Strength=math.abs(Strength)
end
Strength=math.min(Strength,GetConVarNumber("sbox_wire_magnets_maxstrength"))
self:SetNetworkedFloat("Strength", Strength)
self:GetTable().Strength=Strength
end
function ENT:GetStrength()
if SERVER then return self:GetTable().Strength or 0 end
return self:GetNetworkedFloat("Strength") or 0
end
function ENT:SetLength(len)
--print("set len:"..len)
self:SetNetworkedFloat("Length", math.min(len,GetConVarNumber("sbox_wire_magnets_maxlen")))
self:GetTable().Len=math.min(len,GetConVarNumber("sbox_wire_magnets_maxlen"))
end
function ENT:GetLength()
--PrintTable(self:GetTable())
if SERVER then return self:GetTable().Len or 0 end
return self:GetNetworkedFloat("Length") or 0
end
function ENT:SetPropFilter(pf)
self:SetNetworkedString("PropFilter", pf)
self:GetTable().PropFilter=pf
end
function ENT:GetPropFilter()
if SERVER then return self:GetTable().PropFilter end
return self:GetNetworkedString("PropFilter") or ""
end
|
local version = myModuleVersion()
local base = "/vf/users/MEGmodules/modules/megnet" .. version
family("MEGnet")
prepend_path("PATH", pathJoin(base,"bin"))
local omp_nt = os.getenv("OMP_NUM_THREADS") or "1"
pushenv("OMP_NUM_THREADS", omp_nt)
if (mode() == "load") then
LmodMessage("[+] Loading MEGnet ",version," ...")
LmodMessage("[+] Available: ")
LmodMessage("[+] ICA.py")
end
if (mode() == "unload") then
LmodMessage("[-] Unloading MEGnet ",version," ...")
end
|
---@type src.proto.text
local text = {
node = "text",
pos = { 8, 8 },
text = "У попа была собака, он её любил. Она съела кусок мяса...",
colors = { "white", "brown" },
shadow = true,
wrap = true, -- XXX
}
---@type src.proto.rect
local rect = {
id = "#rect",
node = "rect",
pos = { "50%8", "50%8" },
size = { 128, 64 },
skin = "water",
-- closed = true,
text,
-- on_update = function(self, what)
-- log.debug(what, inspect(self.abs_size))
-- end,
}
return rect
|
--Automatically generated by SWGEmu Spawn Tool v0.12 loot editor.
carbine_dh17 = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "",
directObjectTemplate = "object/weapon/ranged/carbine/carbine_dh17.iff",
craftingValues = {
{"mindamage",28,52,0},
{"maxdamage",81,150,0},
{"attackspeed",4.5,3.1,1},
{"woundchance",6,12,0},
{"roundsused",30,65,0},
{"hitpoints",750,1500,0},
{"zerorangemod",-20,-20,0},
{"maxrangemod",-60,-60,0},
{"midrange",35,35,0},
{"midrangemod",11,21,0},
{"attackhealthcost",25,13,0},
{"attackactioncost",35,19,0},
{"attackmindcost",16,8,0},
},
customizationStringNames = {},
customizationValues = {},
-- randomDotChance: The chance of this weapon object dropping with a random dot on it. Higher number means less chance. Set to 0 to always have a random dot.
randomDotChance = 625,
junkDealerTypeNeeded = JUNKARMS,
junkMinValue = 20,
junkMaxValue = 40
}
addLootItemTemplate("carbine_dh17", carbine_dh17)
|
--------------------------------
-- @module EaseBounceIn
-- @extend ActionEase
-- @parent_module cc
--------------------------------
--
-- @function [parent=#EaseBounceIn] create
-- @param self
-- @param #cc.ActionInterval action
-- @return EaseBounceIn#EaseBounceIn ret (return value: cc.EaseBounceIn)
--------------------------------
--
-- @function [parent=#EaseBounceIn] clone
-- @param self
-- @return EaseBounceIn#EaseBounceIn ret (return value: cc.EaseBounceIn)
--------------------------------
--
-- @function [parent=#EaseBounceIn] update
-- @param self
-- @param #float time
-- @return EaseBounceIn#EaseBounceIn self (return value: cc.EaseBounceIn)
--------------------------------
--
-- @function [parent=#EaseBounceIn] reverse
-- @param self
-- @return ActionEase#ActionEase ret (return value: cc.ActionEase)
--------------------------------
--
-- @function [parent=#EaseBounceIn] EaseBounceIn
-- @param self
-- @return EaseBounceIn#EaseBounceIn self (return value: cc.EaseBounceIn)
return nil
|
local pl = require "pl.file"
local read = pl.read
local g = {}
g.wtf = [[S: ``T`` (U V)]]
g.grammar_s = [[ A : B C ( E / F ) / G H
I : "J"
K : L* M+ N?
O : !P &Q !R*
`S` : ``T`` (U V)
W : {XY} [a-z]
A : (B$2)* C$-3 D$4..5* E$+4
]]
g.deco_s = [[ A: `-(B C/ D)$2..5*` ]]
g.rule_s = [[A:B C(D E)/(F G H)
C : "D"
D : E F G
]]
g.peg_s = read "peg/pegs/peg.peg"
g.lisp_s = read "peg/pegs/lisp.peg"
g.clu_s = read "peg/pegs/clu.peg"
return g
|
data:extend({
{
type = "recipe",
name = "early-roboport",
enabled = true,
energy_required = 5,
ingredients =
{
{"iron-plate", 25},
{"iron-gear-wheel", 20},
{"electronic-circuit", 15}
},
result = "early-roboport"
}
})
|
--
-- Advanced Friends Interface (SetUp)
--
local _, L = ...;
local AddOn = "Arranger_AdvancedFriendsUI"
local Path = "Interface\\AddOns\\"..AddOn.."\\"
local Build = "0150924:012"
local Constant = {ADVANCED_INTERFACE_FRIENDS_TRACKING = {}}
local function AdvancedInterface(L, key)
return key;
end
local function CopyAdvancedInterfaceOptions(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[CopyAdvancedInterfaceOptions(orig_key)] = CopyAdvancedInterfaceOptions(orig_value)
end
setmetatable(copy, CopyAdvancedInterfaceOptions(getmetatable(orig)))
else
copy = orig
end
return copy
end
local function SetAdvancedInterfaceOptions()
if Current == nil then
Current = CopyAdvancedInterfaceOptions(Constant)
end
setmetatable(L, {__index=AdvancedInterface});
RegisterAddonMessagePrefix("ADVANCED")
end
-- --
-- -- Advanced Friends Interface (Action)
-- --
local function AdvancedInterfaceFriendsFrameFavoriteButton_OnClick(self)
if not Current.ADVANCED_INTERFACE_FRIENDS_TRACKING[self.battleTag] then
if self.isOnline then
self:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Selected")
else
self:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Selected-Offline")
end
Current.ADVANCED_INTERFACE_FRIENDS_TRACKING[self.battleTag] = true
GameTooltip:SetText(L["ADVANCED_INTERFACE_FRIENDS_FRAME_UNTRACK_TOOLTIP"], HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1)
SendSystemMessage(string.format( L["ADVANCED_INTERFACE_FRIENDS_FRAME_TRACK_MESSAGE"], self.accountName))
else
if self.isOnline then
self:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Normal")
else
self:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Normal-Offline")
end
Current.ADVANCED_INTERFACE_FRIENDS_TRACKING[self.battleTag] = false
GameTooltip:SetText(L["ADVANCED_INTERFACE_FRIENDS_FRAME_TRACK_TOOLTIP"], HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1)
SendSystemMessage(string.format( L["ADVANCED_INTERFACE_FRIENDS_FRAME_UNTRACK_MESSAGE"], self.accountName))
end
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON);
end
local function AdvancedInterfaceFriendsFrameFavoriteButton_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
if not Current.ADVANCED_INTERFACE_FRIENDS_TRACKING[self.battleTag] then
GameTooltip:SetText(L["ADVANCED_INTERFACE_FRIENDS_FRAME_TRACK_TOOLTIP"], HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1)
else
GameTooltip:SetText(L["ADVANCED_INTERFACE_FRIENDS_FRAME_UNTRACK_TOOLTIP"], HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b, 1)
end
end
local function InitializeAdvancedInterfaceFriendsFrame()
local texture = Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Status-Icon"
FRIENDS_TEXTURE_ONLINE = texture.."-".."Online";
FRIENDS_TEXTURE_AFK = texture.."-".."Away";
FRIENDS_TEXTURE_DND = texture.."-".."Busy";
FRIENDS_TEXTURE_OFFLINE = texture.."-".."Offline";
FRIENDS_TEXTURE_BROADCAST = texture.."-".."Stream";
local frame = FriendsTabHeaderRecruitAFriendButton
texture = Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Recruit-Icon"
FriendsTabHeaderRecruitAFriendButtonIcon:Hide()
frame:SetNormalTexture(texture.."-".."Normal")
frame:SetPushedTexture(texture.."-".."Pushed")
frame:SetHighlightTexture("Interface\\Buttons\\UI-Common-MouseHilight")
frame:SetPoint("TOPRIGHT", -5, -54);
frame:SetSize(32,32)
for i = 1, FRIENDS_FRIENDS_TO_DISPLAY do
local frame = "FriendsFrameFriendsScrollFrameButton"
local button = "TravelPassButton"
local icon = "GameIcon"
local textures = {{type = "NormalTexture", coordinates = {0,0.5,0.5,1}},{type = "HighlightTexture", coordinates = {0.5,1,0,0.5}},{type = "PushedTexture", coordinates = {0.5,1,0.5,1}},{type = "DisabledTexture", coordinates = {0,0.5,0,0.5}}}
for _, texture in pairs(textures) do
_G[frame..i..button..texture.type]:SetTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Invitation-Buttons")
_G[frame..i..button..texture.type]:SetTexCoord(texture.coordinates[1],texture.coordinates[2],texture.coordinates[3],texture.coordinates[4])
end
_G[frame..i..button]:SetHitRectInsets(4, 4, 2, 2);
_G[frame..i..button]:SetSize(32,32)
_G[frame..i..icon]:SetSize(32,32)
end
hooksecurefunc("FriendsFrame_UpdateFriends", function()
local friends = FriendsFrameFriendsScrollFrame.buttons
for i = 1, #friends do
local friend = friends[i]
if friend:IsShown() then
if not friend.favoriteButton then
local name = friend:GetName().."FavoritesButton"
local texture = Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button"
local button = CreateFrame("Button", name, friend)
button:SetScript("OnClick", AdvancedInterfaceFriendsFrameFavoriteButton_OnClick)
button:SetScript("OnEnter", AdvancedInterfaceFriendsFrameFavoriteButton_OnEnter)
button:SetScript("OnLeave", GameTooltip_Hide)
button:SetNormalTexture(texture.."-".."Normal")
button:SetPushedTexture(texture.."-".."Pushed")
button:SetHighlightTexture(texture.."-".."Highlight")
button:SetHitRectInsets(4, 4, 2, 2);
button:SetSize(32, 32)
friend.favoriteButton = button
end
if not friend.factionFrame then
local name = friend:GetName()
local frame = friend:CreateTexture(name.."FactionFrame", "OVERLAY")
frame:SetTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Friend-Faction-Frames")
frame:SetTexCoord(0,0.5,0,1)
frame:SetSize(32,32)
friend.factionFrame = frame
end
if not friend.factionTexture then
local name = friend:GetName()
local icon = friend:CreateTexture(name.."FactionTexture", "OVERLAY", nil, 1)
icon:SetTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Friend-Faction-Icons")
icon:SetSize(16,16)
friend.factionTexture = icon
end
if not friend.gameTexture then
local name = friend:GetName()
local frame = friend:CreateTexture(name.."GameTexture", "OVERLAY", nil, -1)
frame:SetTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Friend-Game-Icons")
frame:SetSize(24,24)
friend.gameTexture = frame
end
local button = friend.favoriteButton
if friend.buttonType == FRIENDS_BUTTON_TYPE_BNET then
local _, accountName, battleTag, _, _, bnetIDGameAccount, client, isOnline = BNGetFriendInfo(friend.id)
button.accountName = accountName
button.battleTag = battleTag
button.isOnline = isOnline
if client then
local _, _, _, _, _, faction = BNGetGameAccountInfo(bnetIDGameAccount)
friend.gameTexture:Show()
friend.gameTexture:SetPoint("CENTER",friend.gameIcon, 0.5, 0)
friend.gameIcon:ClearAllPoints()
friend.gameIcon:SetTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Friend-Game-Button")
if battleTag then
friend.gameIcon:SetPoint("RIGHT", friend.favoriteButton, "LEFT", 8, 0)
else
friend.gameIcon:SetPoint("RIGHT", friend.travelPassButton, "LEFT", 8, 0)
end
if client == BNET_CLIENT_WOW then
-- friend.gameTexture:SetTexCoord(0,0.25,0.5,1)
if faction ~= "Neutral" then
friend.factionFrame:Show()
friend.factionFrame:SetPoint("CENTER",friend.status, 0, -12.5)
friend.factionTexture:Show()
friend.factionTexture:SetPoint("CENTER",friend.factionFrame, 0, 0)
if faction == "Alliance" then
friend.factionTexture:SetTexCoord(0,0.5,0,1)
elseif faction == "Horde" then
friend.factionTexture:SetTexCoord(0.5,1,0,1)
end
end
friend.gameIcon:Hide()
friend.gameTexture:Hide()
else
friend.factionFrame:Hide()
friend.factionTexture:Hide()
if client == BNET_CLIENT_APP or client == BNET_CLIENT_CLNT then
friend.gameTexture:SetTexCoord(0,0.25,0,0.5)
elseif client == BNET_CLIENT_SC2 then
friend.gameTexture:SetTexCoord(0.75,1,0,0.5)
elseif client == BNET_CLIENT_D3 then
friend.gameTexture:SetTexCoord(0.25,0.5,0,0.5)
elseif client == BNET_CLIENT_WTCG then
friend.gameTexture:SetTexCoord(0.25,0.5,0.5,1)
elseif client == BNET_CLIENT_HEROES then
friend.gameTexture:SetTexCoord(0.5,0.75,0,0.5)
elseif client == BNET_CLIENT_SC then
friend.gameTexture:SetTexCoord(0.75,1,0.5,1)
elseif client == BNET_CLIENT_OVERWATCH then
friend.gameTexture:SetTexCoord(0,0.25,0.5,1)
elseif client == BNET_CLIENT_DESTINY2 then
friend.gameTexture:SetTexCoord(0.5,0.75,0.5,1)
else
friend.gameIcon:Hide()
friend.gameTexture:Hide()
end
end
else
friend.gameTexture:Hide()
end
if battleTag then
friend.favoriteButton:Show()
if isOnline then
friend.favoriteButton:SetPoint("TOPRIGHT", friend, -23, -1)
if Current.ADVANCED_INTERFACE_FRIENDS_TRACKING[battleTag] then
friend.favoriteButton:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Selected")
else
friend.favoriteButton:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Normal")
end
else
friend.favoriteButton:SetPoint("TOPRIGHT", friend, 1, -1)
if Current.ADVANCED_INTERFACE_FRIENDS_TRACKING[battleTag] then
friend.favoriteButton:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Selected-Offline")
else
friend.favoriteButton:SetNormalTexture(Path.."Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button-Normal-Offline")
end
end
else
friend.favoriteButton:Hide()
end
if not isOnline then
friend.factionFrame:Hide()
friend.factionTexture:Hide()
end
else
friend.factionFrame:Hide()
friend.factionTexture:Hide()
friend.gameTexture:Hide()
friend.favoriteButton:Hide()
end
end
end
end)
FriendsFrameFriendsScrollFrame.update = function() return FriendsFrame_UpdateFriends() end
end
local function InitializeAdvancedInterfaceFriendsStatus()
local temp = {}
local status = {}
local function SetDefaultStatus()
local numBNetTotal = BNGetNumFriends();
for i = 1, numBNetTotal do
local _, _, battleTag, _, _, _, client, isOnline = BNGetFriendInfoByID(i)
status = { battleTag = {} }
status.battleTag["client"] = client
status.battleTag["isOnline"] = isOnline
end
end
local icon = "Interface\\CHATFRAME\\UI-ChatIcon"
local icons = {BN = "|TInterface\\FriendsFrame\\UI-Toast-FriendOnlineIcon:16:16:0:0:32:32:2:30:2:30|t", D3 = "|T"..icon.."-D3:14|t", Hero = "|T"..icon.."-HotS:14|t", S2 = "|T"..icon.."-SC2:14|t", WoW = "|T"..icon.."-WoW:14|t", WTCG = "|T"..icon.."-WTCG:14|t"}
local f = AdvancedFriendsInterface or CreateFrame("Frame", "AdvancedFriendsInterface", UIParent)
local function Messenger(self, event, friendIndex, ...)
if friendIndex then
local bnetIDAccount, _, _, _, _, bnetIDGameAccount = BNGetFriendInfo(friendIndex)
local bnetIDAccount, accountName, battleTag, isBattleTagPresence, toonName, _, client, isOnline = BNGetFriendInfoByID(bnetIDAccount)
if event == "BN_FRIEND_ACCOUNT_ONLINE" then
temp[accountName] = true
end
if event == "BN_FRIEND_INFO_CHANGED" and client and battleTag then
local globalName = string.format( "|HBNplayer:%s:%s|h[%s]|h", accountName, bnetIDAccount, accountName )
local _, _, _, realmName, _, faction = BNGetGameAccountInfo(bnetIDGameAccount)
for k,v in pairs(Current.ADVANCED_INTERFACE_FRIENDS_TRACKING) do
if k == battleTag and v == true then
if not temp[accountName] then
-- print(status.battleTag["client"],status.battleTag["isOnline"])
if client ~= nil and client == "App" and status.battleTag["client"] ~= client then
print( BATTLENET_FONT_COLOR_CODE .. icons.BN .. string.format( L["ADVANCED_INTERFACE_FRIEND_TRACKING_OFFLINE"], globalName) .. FONT_COLOR_CODE_CLOSE );
PlaySound(SOUNDKIT.UI_BNET_TOAST);
elseif client == "WoW" and status.battleTag["client"] ~= client then
local ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE
if faction == "Horde" then
ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE = "ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE_HORDE"
elseif faction == "Alliance" then
ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE = "ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE_ALLIANCE"
else
ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE = "ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE"
end
print( BATTLENET_FONT_COLOR_CODE .. icons.BN .. string.format( L[ADVANCED_INTERFACE_FRIEND_TRACKING_ONLINE], globalName, icons[client], toonName, realmName) .. FONT_COLOR_CODE_CLOSE );
PlaySound(SOUNDKIT.UI_BNET_TOAST);
end
status.battleTag["client"] = client
status.battleTag["isOnline"] = isOnline
else
temp[accountName] = nil
end
end
end
end
end
end
local function UnregisterEvent()
f:UnregisterEvent("BN_FRIEND_INFO_CHANGED")
end
local function RegisterEvent()
f:RegisterEvent("BN_FRIEND_INFO_CHANGED")
f:RegisterEvent("BN_FRIEND_ACCOUNT_ONLINE")
f:SetScript("OnEvent", Messenger)
end
GameMenuButtonLogout:HookScript("OnClick", UnregisterEvent)
GameMenuButtonQuit:HookScript("OnClick", UnregisterEvent)
C_Timer.After(2, RegisterEvent);
SetDefaultStatus()
end
-- --
-- -- Advanced Friends Interface (Initialization)
-- --
function InitializeAdvancedInterface()
SetAdvancedInterfaceOptions()
InitializeAdvancedInterfaceFriendsFrame()
InitializeAdvancedInterfaceFriendsStatus()
end
|
function os.winSdk()
local reg_arch = iif( os.is64bit(), "\\Wow6432Node\\", "\\" )
local sdk_version = os.getWindowsRegistry( "HKLM:SOFTWARE" .. reg_arch .."Microsoft\\Microsoft SDKs\\Windows\\v10.0\\ProductVersion" )
if sdk_version ~= nil then return sdk_version else return "8" end -- Assumes that at least the Windows 8 SDK is installed somewhere...
end
function os.vpaths()
files { "share/scenes/**.vkhr" }
files { "share/shaders/**.glsl",
"share/shaders/**.vert",
"share/shaders/**.geom",
"share/shaders/**.tesc",
"share/shaders/**.tese",
"share/shaders/**.frag",
"share/shaders/**.comp" }
vpaths {
["src/*"] = "src/**.cc",
["include/*"] = "include/**.hh",
["foreign/*"] = { "foreign/**.hpp",
"foreign/**.h",
"foreign/**.cpp",
"foreign/**.c" },
["scenes/*"] = { "share/scenes/**.vkhr" },
["shaders/*"] = { "share/shaders/**.glsl",
"share/shaders/**.vert",
"share/shaders/**.geom",
"share/shaders/**.tesc",
"share/shaders/**.tese",
"share/shaders/**.frag",
"share/shaders/**.comp" }
}
end
|
--[[
Desc: a component for projectile logic
Feature:
1.Death: by anim playing end / by time / by distance
2.Combat: Attack / BeHit
3.Move: forward / rotate / changeDirection
Author: SerDing
Since: 2020-03-18
Alter: 2021-05-26
]]
local _Vector3 = require("utils.vector3")
local _Base = require("entity.component.base")
---@class Entity.Component.Projectile : Entity.Component.Base
local _Projectile = require("core.class")(_Base)
local _emptyTable = {}
local _moveParamKeys = {"x", "y", "z"}
local _SPEED_VARY_TYPE = {
DECREASE = 1,
NEGATIVE_RETURN = 2,
}
function _Projectile.HandleData(data)
local moveParam = data.movementParam
if moveParam then
if moveParam.v then
for i = 1, #_moveParamKeys do
local key = _moveParamKeys[i]
moveParam.v[key] = moveParam.v[key] or 0
moveParam.a[key] = moveParam.a[key] or 0
end
end
if moveParam.direction then
for i = 1, #_moveParamKeys do
local key = _moveParamKeys[i]
moveParam.direction[key] = moveParam.direction[key] or 1
end
end
end
end
function _Projectile:Ctor(entity, data, param)
_Base.Ctor(self, entity)
self._data = data
self._attack = data.attack
self._tags = data.tags or _emptyTable
self._playEnd = data.tags.playEnd
if data.movementParam then
self._moveParam = data.movementParam
self._isMoving = false
end
self._startPosition = _Vector3.New()
self._velocity = _Vector3.New()
self._accerleration = _Vector3.New()
self._speedVaryType = _Vector3.New()
self._moveDirection = _Vector3.New()
self._hitTimes = data.hitTimes or 1
self._hitCounter = 0
self._endByDistance = self._data.movementParam and self._data.movementParam.distance
end
function _Projectile:Init()
self._OnHit = function(combat, behitEntity)
if self._tags.endOnHit then
if self._hitTimes > 1 then
self._hitCounter = self._hitCounter + 1
if self._hitCounter >= self._hitTimes then
self._identity:StartDestroy()
end
else
self._identity:StartDestroy()
end
end
end
self._entity.combat:StartAttack(self._attack, self._OnHit)
self._moveComp = self._entity.movement
self._identity = self._entity.identity
self._render = self._entity.render
self._fighter = self._entity.fighter
if self._moveComp and not self._moveComp.ignoreObstacle then
self._moveComp.eventMap.onMove:AddListener(self, self.OnMove)
end
--if self._movementParam and self._movementParam.tick == 0 then
-- self._movement:EaseMove(self._movementParam.type, self._movementParam.v, self._movementParam.a)
-- self._startPosition:Set(self._entity.transform.position:Get())
--end
end
function _Projectile:Update(dt)
if not self.enable or self._fighter.isDead then
return
end
self:_MoveUpdate(dt)
if self._identity.master then
if self._playEnd then
if self._render.renderObj:TickEnd() then
self._identity:StartDestroy()
end
end
if self._endByDistance then --and self._movement:IsEasemoving()
local distance = self._entity.transform.position:GetDistance(self._startPosition)
if distance >= self._moveParam.distance then
self._identity:StartDestroy()
Log.Debug("projectile over distance:%.3f", distance)
end
end
--todo:death by time
end
end
function _Projectile:_MoveUpdate(dt)
local param = self._moveParam
if param and not self._isMoving and self._render.renderObj:GetTick() == param.tick then
self._velocity:Set(param.v.x, param.v.y, param.v.z)
self._accerleration:Set(param.a.x, param.a.y, param.a.z)
self._moveDirection:Set(param.direction.x, param.direction.y, param.direction.z)
self._moveDirection:Set(param.direction.x * self._entity.transform.direction) -- correct x direction
self._startPosition:Set(self._entity.transform.position:Get())
self._isMoving = true
end
if self._isMoving then
for k, v in pairs(self._velocity) do
if type(v) == "number" and v ~= 0 then
self._moveComp:Move(k, v * self._moveDirection[k])
end
end
for k, a in pairs(self._accerleration) do
if type(a) == "number" and a ~= 0 then
self._velocity[k] = self._velocity[k] + a * dt
if a < 0 and self._velocity[k] < 0 then
self._velocity[k] = 0
end
end
end
end
end
function _Projectile:OnMove(axis, success, delta)
if not success then
self._identity:StartDestroy()
--SLog.Debug("projectile move failed, axis:%s delta:%.3f, destroy", axis, delta)
end
end
return _Projectile
|
-- Line buffering. push() takes arbitrarily chunked data, and
-- push_line() is called for each line.
local linebuf = {}
-- default implementation for convenience. override!
function linebuf:push_line(data)
io.stderr:write("line: " .. data)
end
function linebuf:push(data)
self.buf = self.buf .. data
while true do
local line = string.match(self.buf, '([^\n]+\n)')
if not line then return end
self:push_line(line)
self.buf = self.buf:sub(line:len()+1, self.buf:len())
end
end
function linebuf.new()
local obj = {buf = ""}
setmetatable(obj, {__index = linebuf})
return obj
end
return linebuf
|
require('!/DieRoller')
function onload()
onLoadShared("blue")
end
|
local composer = require( "composer" )
local scene = composer.newScene()
local physics = require( "physics" )
-- -----------------------------------------------------------------------------------
-- Code outside of the scene event functions below will only be executed ONCE unless
-- the scene is removed entirely (not recycled) via "composer.removeScene()"
-- -----------------------------------------------------------------------------------
-- starting the player because scope
local player
-- width and thingies cuz scop
local screenWidth = display.contentWidth
local screenHeight = display.contentHeight
local leftTouch = false
local rightTouch = false
local alive
local score = 0
local scoreDisplay
local spawnTimerDefault = 60 * 1
local spawnTimer = spawnTimerDefault
local function touchReset ( )
leftTouch = false
rightTouch = false
end
local function screenTouch( event )
local x = event.x
local y = event.y
-- alive filter
if alive then
-- phase filter
if event.phase == "began" then
-- touched to the right
if (x > display.contentCenterX ) then
rightTouch = true
-- touched to the left
elseif ( x <= display.contentCenterX ) then
leftTouch = true
end
-- reset vars to stop code from running
elseif event.phase == "ended" then
touchReset( )
end
end
end
local function spawnEnemy( x )
--if alive then
-- local copy of the scene group
local sceneGroup = scene.view
-- setting the y offscreen
local y = screenHeight * -0.1
-- enemy image
local enemy = display.newImage( "enemy.png", x, y )
sceneGroup:insert( enemy )
-- circular body
physics.addBody( enemy, "dynamic", {radius = 13} )
-- to not really collide with the player
enemy.isSensor = true
-- the name for collision purposes
enemy.name = "enemy"
local enemySpin = 200
enemy.angularVelocity = ( math.random( -enemySpin, enemySpin ) )
--end
end
-- player initialization
local function playerInit( )
-- player image
player = display.newImage("ship.png", screenWidth * 0.5, screenHeight * 0.8 )
-- player collision mask
local mask = { -2, -26, 2, -26, 22, 25, -22, 25}
physics.addBody( player , { shape = mask})
-- nullifying gravity
player.gravityScale = 0
-- setting the y-axis lock
player.lock = screenHeight * 0.8
-- aceleration per step
player.acel = 1
-- setting the alive var
alive = true
local function spawner( )
-- run the timer
spawnTimer = spawnTimer - 1
-- trigger the timer
if spawnTimer <= 0 then
print("here it comes!" )
-- setting a random x to spawn the enemy
local x = math.random( screenWidth * 0.1, screenWidth * 0.9 )
-- spawn the enemy
spawnEnemy( x )
-- adjust the time
if spawnTimerDefault > 20 then
spawnTimerDefault = spawnTimerDefault - 5
elseif spawnTimerDefault > 10 then
spawnTimerDefault = spawnTimerDefault - 1
end
print(spawnTimerDefault)
-- reset the timer
spawnTimer = spawnTimerDefault
end
end
-- player step function
function player.enterFrame ( self )
local acel = self.acel
local x = self.x
local y = self.y
-- lock the y-axis
self.y = self.lock
-- alive filter
if alive then
spawner( )
-- right thrust
if rightTouch then
self:applyForce( acel, 0, x, y )
-- left thrust
elseif leftTouch then
self:applyForce( -acel, 0, x, y )
end
end
end
-- player - enemy collision
local function collision( self, event )
-- gettint the name
local target = event.other.name
if (event.phase == "began") then
-- name filter
if ( target == "enemy" ) then
-- u ded
alive = false
-- take yourself to the graveyard
self:removeSelf( )
composer.removeScene( "gameover" )
composer.showOverlay( "gameover", { time = 500, effect = "crossFade" } )
end
end
end
player.collision = collision
player:addEventListener( "collision")
Runtime:addEventListener( "enterFrame", player )
end
local function remover( )
-- local copy of the view
local sceneGroup = scene.view
-- a rect offscreen and of it's same width
local me = display.newRect( screenWidth * 0.5, screenHeight * 1.1, screenWidth, 20 )
sceneGroup:insert ( me )
-- static body so it doesn't fall away
physics.addBody( me, "static" )
-- name for collision purpose
name = "remover"
me.isSensor = true
local function collision ( self, event, other )
local target = event.other.name
if (event.phase == "began") then
if (target == "enemy") then
-- add score if the player is alice
if alive then
score = score + 10
currentScoreDisplay.text = string.format ( score )
end
-- destroy the enemy
event.other:removeSelf( )
event.other = nil
end
end
end
me.collision = collision
me:addEventListener("collision")
end
-- -----------------------------------------------------------------------------------
-- Scene event functions
-- -----------------------------------------------------------------------------------
-- create()
function scene:create( event )
local sceneGroup = self.view
-- Code here runs when the scene is first created but has not yet appeared on screen
physics.start( )
--physics.setDrawMode( "hybrid" )
physics.pause( )
-- background
local background = display.newRect(display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight + 20)
background:setFillColor( 149/255, 199/255, 236/255 )
sceneGroup:insert(background)
--middle mark
--to show what side to press to launch the ship
local mark = display.newLine( display.contentCenterX, screenHeight * 0.05, display.contentCenterX, screenHeight * 0.95 )
mark:setStrokeColor( 36/255, 100/255, 145/255, 60/255 )
mark.strokeWidth = 3
sceneGroup:insert(mark)
-- the player
playerInit( )
sceneGroup:insert( player )
-- the remover
remover( )
-- barrier sizes
local barrierW = 10
local barrierH = screenHeight + 20
local barrierX = barrierW * 0.5
local barrierY = barrierH * 0.5
local barrierColor = { 36/255, 100/255, 145/255, 1 }
-- left barrier
local leftB = display.newRect( barrierX, barrierY, barrierW, barrierH )
leftB:setFillColor( unpack(barrierColor) )
sceneGroup:insert( leftB )
physics.addBody( leftB, "static" )
-- right barrier
local rightB = display.newRect( screenWidth - barrierX, barrierY, barrierW, barrierH )
rightB:setFillColor( unpack(barrierColor) )
sceneGroup:insert( rightB )
physics.addBody( rightB, "static" )
-- score
local options = {
text = "0",
x = screenWidth * 0.5,
y = 10,
width = screenWidth,
fontSize = 16,
align = "center",
}
currentScoreDisplay = display.newText( options )
sceneGroup:insert( currentScoreDisplay )
end
-- show()
function scene:show( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is still off screen (but is about to come on screen)
score = 0
currentScoreDisplay.text = score
elseif ( phase == "did" ) then
-- Code here runs when the scene is entirely on screen
-- Go ´phshsyhsucs
spawnEnemy( screenWidth * 0.5 )
physics.start( )
end
end
-- hide()
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is on screen (but is about to go off screen)
physics.stop( )
elseif ( phase == "did" ) then
-- Code here runs immediately after the scene goes entirely off screen
end
end
-- destroy()
function scene:destroy( event )
local sceneGroup = self.view
-- Code here runs prior to the removal of scene's view
end
-- -----------------------------------------------------------------------------------
-- Scene event function listeners
-- -----------------------------------------------------------------------------------
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )
-- -----------------------------------------------------------------------------------
display.currentStage:addEventListener( "touch", screenTouch )
return scene
|
object_tangible_component_genetic_engineering_enzyme_extraction_unit = object_tangible_component_genetic_engineering_shared_enzyme_extraction_unit:new {
}
ObjectTemplates:addTemplate(object_tangible_component_genetic_engineering_enzyme_extraction_unit, "object/tangible/component/genetic_engineering/enzyme_extraction_unit.iff")
|
local UIButton = require("lib.classes.UIButton")
local Event = require("lib.classes.Event")
local Color = require("lib.datatypes.Color")
local JUtils = require("lib.utils.JUtils")
local Slider = UIButton:subclass("Slider")
function Slider:init()
self.super:init()
self.minValue = 0
self.maxValue = 100
self.valueIncrement = 10
self.value = 10
self.smooth = false
self.orientation = "vertical"
self.valueChanged = Event:new()
self.valuePercent = 0
self.scrubDrawPosition = 0
self.scrubXSize = 20
self.scrubColor = Color:new(0.5, 0.5, 0.5)
end
function Slider:getValueIncrement()
return self.valueIncrement
end
function Slider:getValue()
return self.value
end
function Slider:getOrientation()
return self.orientation
end
function Slider:getValueRange()
return self.minValue, self.maxValue
end
function Slider:setValueRange(min, max)
self.minValue = min
self.maxValue = max
end
function Slider:setValueIncrement(inc)
self.valueIncrement = inc
end
function Slider:setValue(val)
self.value = val
end
function Slider:doMouseMoveCalculations()
-- how much length the slider can actually work with
local effectiveSize = self:getAbsoluteSize().x-self.scrubXSize
-- where the mouse is, inside of the slider
local mousePosition = math.floor(love.mouse.getX() - self:getAbsolutePosition().x)
-- so that the scrub is put in the middle of the mouse
local scrubPos = mousePosition-(self.scrubXSize/2)
-- clamp the value so it never leaves the slider
local positionClamped = JUtils.ClampNumber(scrubPos, 0, effectiveSize)
local percent = (positionClamped/effectiveSize)
local range = self.maxValue-self.minValue
local val = JUtils.NearestMultiple(percent*range, self.valueIncrement)
-- self.valuePercent = val/range
val = val + self.minValue
if val ~= self.value then
self.value = val
self.valueChanged:call(self.value)
end
end
function Slider:updateScrubPos()
local range = self.maxValue-self.minValue
self.valuePercent = (self.value-self.minValue)/range
self.scrubDrawPosition = (self.valuePercent*(self:getAbsoluteSize().x-self.scrubXSize))/self:getAbsoluteSize().x
end
function Slider:update(delta)
self.super:update(delta)
if self.parent then
self:updateScrubPos()
end
if self.mouseDown then
self:doMouseMoveCalculations()
end
end
function Slider:render()
self.super:render()
-- render the thing object idk
love.graphics.setColor(self.scrubColor:out())
love.graphics.rectangle("fill", self:getAbsolutePosition().x+(self.getAbsoluteSize().x*self.scrubDrawPosition), self.getAbsolutePosition().y, self.scrubXSize, self.getAbsoluteSize().y)
self:renderChildren()
end
return Slider
|
-- Copyright (c) 2021 Trevor Redfern
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
local types = require "game.settings.actions.types"
return function(name, value)
return {
type = types.settings_set_option,
payload = {
name = name,
value = value
}
}
end
|
return {'paadje','paaien','paaigebied','paaiplaats','paaitijd','paaivis','paal','paalbalk','paaldansen','paaldanseres','paaldorp','paalfundering','paalgat','paalgording','paalstand','paalsteek','paaltje','paalvast','paalwerk','paalwoning','paalworm','paalzitten','paan','paander','paap','paapje','paaps','paapsgezind','paar','paard','paarden','paardenarts','paardenbeenhouwer','paardenbek','paardenbeslag','paardenbiefstuk','paardenbloem','paardenboon','paardenborstel','paardenbrood','paardendek','paardendeken','paardendief','paardendistel','paardendokter','paardendressuur','paardenfokker','paardenfokkerij','paardengebit','paardengetrappel','paardengetuig','paardenhaar','paardenhals','paardenhandel','paardenhandelaar','paardenharen','paardenhoef','paardenhoofd','paardenhorzel','paardenhouderij','paardenkastanje','paardenkenner','paardenknecht','paardenkoers','paardenkoets','paardenkoorts','paardenkop','paardenkoper','paardenkracht','paardenleer','paardenleren','paardenleugen','paardenliefhebber','paardenmarkt','paardenmest','paardenmiddel','paardenmolen','paardenoog','paardenpis','paardenpoep','paardenpolo','paardenpoot','paardenpost','paardenprocessie','paardenrace','paardenras','paardenrenbaan','paardenrennen','paardenrookvlees','paardenslachter','paardenslachterij','paardenslager','paardensmid','paardenspel','paardensport','paardensportevenement','paardensprong','paardenstaart','paardenstal','paardenstamboek','paardenstoeterij','paardenteelt','paardentram','paardentuig','paardentuiser','paardenvijg','paardenvlees','paardenvlieg','paardenvoet','paardenvolk','paardenwereld','paardenwerk','paardenziekte','paardjerijden','paardmens','paardrift','paardrijden','paardrijder','paardrijdster','paardrijles','paardspringen','paargedrag','paarlemoer','paarlemoeren','paarlemoervlinder','paarlen','paarplaats','paarrelatie','paarrijden','paars','paarsachtig','paarsblauw','paarsgewijs','paarsgewijze','paarsig','paarsrood','paart','paartijd','paartje','paarvorming','paas','paasavond','paasbest','paasbestand','paasbeurt','paasbiecht','paasbloem','paasboodschap','paasbrood','paascommunie','paasdag','paasdatum','paasdrukte','paasei','paasfeest','paasgebruik','paasgezang','paashaas','paaskaars','paasklok','paaslam','paasmaal','paasmaandag','paasnacht','paasos','paasplicht','paasprocessie','paasreces','paasspel','paastijd','paasvakantie','paasviering','paasvuur','paaswake','paasweek','paasweekeinde','paasweekend','paaszaterdag','paaszondag','paardsprong','paardrijbroek','paardenlul','paasdienst','paalkrans','paardenschilder','paardenmelk','paardenbak','paardentrailer','paasontbijt','paalrot','paardengek','paardenkar','paardenlichaam','paardenman','paardenmond','paardenrug','paardensector','paardenshow','paardenstoet','paardenwei','paardrijtocht','paarseizoen','paasakkoord','paasboom','paasbult','paaskermis','paaskonijn','paaslunch','paasmaaltijd','paasmis','paasmysterie','paasverhaal','paasverlof','paardentrainer','paaltjesroute','paardenbeen','paardenkamp','paardoffer','paardenzadel','paastak','paardenevenement','paardenslee','paardeindspel','paardencentrum','paardenspektakel','paastoernooi','paardzet','paaldijk','paalkistrecht','paalrij','paaltjeswandeling','paardenkam','paardenkleed','paasgave','paasmaand','paasvlees','paal','paaseiland','paauwe','paarlberg','paalvast','paans','paassen','paauw','paanakker','paape','paats','paadjes','paai','paaide','paaiden','paaigebieden','paaigronden','paaiplaatsen','paait','paalbewoners','paalde','paalden','paaldorpen','paalgaten','paalhoofden','paalt','paaltjes','paalwerken','paalwoningen','paalwormen','paanders','paandertje','paantje','paantjes','paapjes','paapse','paapser','paapsgezinde','paapst','paarde','paardenartsen','paardenbiefstukken','paardenbloemen','paardenbonen','paardenborstels','paardendekken','paardendieven','paardendokters','paardenfokkerijen','paardenfokkers','paardenhalzen','paardenhoeven','paardenhorzels','paardenkarren','paardenkastanjes','paardenkenners','paardenknechten','paardenknechts','paardenkopers','paardenkoppen','paardenkrachten','paardenmarkten','paardenmolens','paardenogen','paardenpoten','paardenrassen','paardenslachterijen','paardenslachters','paardensmeden','paardenspellen','paardenstallen','paardenstamboeken','paardenstoeterijen','paardentrammen','paardentrams','paardenvliegen','paardenvoeten','paardenziekten','paardenziektes','paardgereden','paardje','paardjes','paardmensen','paardreden','paardreed','paardrijd','paardrijders','paardrijdsters','paardrijdt','paarplaatsen','paarse','paarser','paarst','paartijden','paartjes','paasbloemen','paasbroden','paasdagen','paaseieren','paasfeesten','paasgebruiken','paasgezangen','paaskaarsen','paaslammeren','paasnachten','paasvakanties','paasvuren','paasweken','paatje','paatjes','paaldanseressen','paaldanste','paalfunderingen','paalgordingen','paalgordings','paalsteken','paardenbekken','paardenbroden','paardenleugens','paardenliefhebbers','paardenraces','paardensprongen','paardenstaarten','paardentuisers','paardenvijgen','paardjegereden','paarrelaties','paarsachtige','paarsige','paasbiechten','paascommunies','paascommunien','paashazen','paasklokken','paasmalen','paasprocessies','paasspelen','paardendekens','paarsblauwe','paarsrode','paalvaste','paasbeste','paardendistels','paardenprocessies','paalkransen','paardenslagers','paardrijbroeken','paardsprongen','paaswaken','paaseitjes','paardenkoetsen','paardenmiddelen','paardentrailers','paardrijlessen','paardrijtochten','paashaasjes','paardenkoersen','paasdata','paashaasje','paardenshows','paardenhoofden','paardenkoetsjes','paardenbakken','paasgebeuren','paardenweitje','paardenhandelaars','paasvieringen','paardenruggen','paasbroodjes','paardensportevenementen','paasverhalen','paardenevenementen','paardenzadels','paardenmannen','paardenbiefstukje','paasfeestje','paaskonijntje','paalse'}
|
-- Automation 4 test file
-- Create a Macro feature, that displays some text
script_name = "Automation 4 set-selection test"
script_description = "Test setting the grid selection"
script_author = "Niels Martin Hansen"
script_version = "1"
function selecttest(subtitles, selected_lines, active_line)
-- get line-id of first selected line
local lid = selected_lines[1]
-- insert a copy of line 'lid' before itself
subtitles[-lid] = subtitles[lid]
-- append a copy of the copy of the copied line
subtitles[0] = subtitles[lid]
-- grab the copied line
local l = subtitles[lid]
-- modify it
l.text = "A4 was here!"
-- and store it back
subtitles[lid] = l
-- select some new lines
selected_lines = { lid-1, lid, lid+1 }
-- and set undo point (never forget!)
aegisub.set_undo_point("Insert+select Stuff")
-- return the new selection
return selected_lines
end
aegisub.register_macro("Insert+select stuff", "Inserts some lines near the active line and selects the new lines", selecttest, nil)
|
#!/usr/bin/env tarantool
local test = require("sqltester")
test:plan(1)
--!./tcltestrunner.lua
-- 2011 October 13
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, never taking more than you give.
--
-------------------------------------------------------------------------
-- This file implements regression tests for sql library. Specifically,
-- it tests that ticket [fa7bf5ec94801e7e2030e41eefe5d9dd96eaacfd] has
-- been resolved.
--
-- The problem described by this ticket was that the sqlExprCompare()
-- function was saying that expressions (x='a') and (x='A') were identical
-- because it was using sqlStrICmp() instead of strcmp() to compare string
-- literals. That was causing the query optimizer for aggregate queries to
-- believe that both count() operations were identical, and thus only
-- computing the first count() and making a copy of the result for the
-- second count().
--
-- ["set","testdir",[["file","dirname",["argv0"]]]]
-- ["source",[["testdir"],"\/tester.tcl"]]
test:do_execsql_test(
"tkt-fa7bf5ec-1",
[[
CREATE TABLE t1(id INT primary key, x TEXT);
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (2, 'A');
INSERT INTO t1 VALUES (3, 'A');
SELECT count(CASE WHEN x='a' THEN 1 END),
count(CASE WHEN x='A' THEN 1 END)
FROM t1;
]], {
-- <tkt-fa7bf5ec-1>
1, 2
-- </tkt-fa7bf5ec-1>
})
test:finish_test()
|
--[[
#class Bitmap
|Needed methods:|
-[x] clear
-[x] clear_rect
-[x] zoom_blur,box_blur,pixel_blur
**TODO:**
-[x] function 'text_size'
-[x] function 'draw_text' classic
-[x] function 'gradient'
]]--
Bitmap = class("Bitmap")
function Bitmap:init(width,height)
self._width = 0
self._height = 0
self._name = ""
getmetatable(self).__index = function(s,k)
if k == "width" or k == "height" or k=="name"then
local hk = "_" .. k
return rawget(s,hk)
end
return s.class[k]
end
getmetatable(self).__newindex = function(s,k,v)
if k == "width" or k == "height" then
local min = math.max(0,v)
local hk = "_" .. k
rawset(s,hk,min)
return
elseif k=="name" then return
end
rawset(s,k,v)
end
--print("type: " ..type(width))
if not height then
if type(width) == "string" then
self._name = width
local file = LGSS:filename(width)
local img = love.graphics.newCanvas(32,32)
if file then img = love.graphics.newImage(file) end
local w,h = img:getDimensions()
self.width,self.height = w,h
self._image = love.graphics.newCanvas(w,h)
self._image:renderTo( function() love.graphics.draw(img) end)
elseif type(width) == "number" then
--print("width")
height = width
self.width,self.height = width,height
self._image = love.graphics.newCanvas(width,height)
else
--print("none")
width,height = 32,32
self.width,self.height = width,height
self._image = love.graphics.newCanvas(width,height)
end
else
--print("height")
self.width,self.height = width,height
self._image = love.graphics.newCanvas(width,height)
end
self.rect = Rect(0,0,self.width,self.height)
self.font = Font()
getmetatable(self).__call = function(s)
return s._image
end
end
--function Bitmap:resize(w,h) end
function Bitmap:dispose()
if self.disposed then return end
self.disposed = true
self._image = love.graphics.newCanvas(self.width,self.height)
end
function Bitmap:clear()
self._image:renderTo( function() love.graphics.clear() end)
end
function Bitmap:clear_rect(x,y,w,h)
if type(x) == "table" then x,y,w,h = x.y,x.y,x.with,x.height end
self._image:renderTo( function()
love.graphics.setScissor(x,y,w,h)
love.graphics.clear()
love.graphics.setScissor()
end)
end
local function drawShader(s,shader)
local data = s._image:newImageData(0,0,s.width,s.height)
local texture = love.graphics.newImage(data)
s:clear()
s._image:renderTo( function()
love.graphics.setShader(shader)
love.graphics.draw(texture,0,0)
love.graphics.setShader()
end)
end
function Bitmap:zoom_blur(v)
local shader = Graphics.shaderZoomBlur
if v then v = v > 0 and v or 1 else v = 5 end
shader:send("strength",v*0.5)
drawShader(self,shader)
end
function Bitmap:box_blur(x,y)
y = y or x
self:horizontal_blur(x)
self:vertical_blur(y)
end
function Bitmap:horizontal_blur(v)
local shader = Graphics.shaderBoxBlur
if v then
if v == 0 then return end
v = v > 0 and v or 1
else v = 5 end
shader:send('direction', {1/self.width,0})
shader:send('radius', v*0.5)
drawShader(self,shader)
end
function Bitmap:vertical_blur(v)
local shader = Graphics.shaderBoxBlur
if v then
if v == 0 then return end
v = v > 0 and v or 1
else v = 5 end
shader:send('direction', {0,1/self.height})
shader:send('radius', v*0.5)
drawShader(self,shader)
end
function Bitmap:pixel_blur(s,f)
local shader = Graphics.shaderPixelBlur
if type(s) == "number" then s = {s,s} end
assert(type(s) == "table" and #s == 2, "Invalid value for `size'")
shader:send("size", s)
shader:send("feedback", math.min(1, math.max(0, tonumber(f) or 0)))
drawShader(self,shader)
end
function Bitmap:fill_rect(x,y,w,h,col,round)
if type(x) == "table" then x,y,w,h,col,round = x.x,x.y,x.width,x.height,y,w end
local rx,ry,seg = nil,nil,nil
if round then rx,ry,seg = round[1],round[2],round[3] end
self._image:renderTo( function()
love.graphics.setColor(col())
love.graphics.rectangle("fill", x, y, w, h, rx, ry, seg)
love.graphics.setColor(Color("white")())
end)
end
function Bitmap:gradient_fill_rect(x,y,w,h,col1,col2,d)
if type(x) == "table" then x,y,w,h,col1,col2,d = x.x,x.y,x.width,x.height,y,w,h end
local rx,ry,seg = nil,nil,nil
if round then rx,ry,seg = round[1],round[2],round[3] end
local s = d == 0 and w or h
for i=0,s do
local color = (col1*(1-(i/s)))+(col2*(i/s))
self._image:renderTo( function()
love.graphics.setColor(color())
if d == 0 then
love.graphics.rectangle("fill", x+i, y, 1, h)
else
love.graphics.rectangle("fill", x, y+i, w, 1)
end
love.graphics.setColor(Color("white")())
end)
end
end
function Bitmap:line_rect(x,y,w,h,col,line,round)
if type(x) == "table" then x,y,w,h,col,line,round = x.x,x.y,x.width,x.height,y,w,h end
local rx,ry,seg = nil,nil,nil
if round then rx,ry,seg = round[1],round[2],round[3] end
self._image:renderTo( function()
love.graphics.setColor(col())
love.graphics.setLineWidth(line)
love.graphics.rectangle("line", x+line*0.5, y+line*0.5, w-line, h-line, rx, ry, seg)
love.graphics.setColor(Color("white")())
end)
end
function Bitmap:blt(x,y,sbit,sr,opacity)
opacity = opacity or 255
--local data = sbit():newImageData(sr.x, sr.y, sr.width, sr.height)
local texture = sbit()--love.graphics.newImage(data)
local w,h = sbit():getDimensions()
local q = love.graphics.newQuad(sr.x, sr.y, sr.width, sr.height,w,h)
self._image:renderTo( function()
love.graphics.setColor(255,255,255,opacity)
love.graphics.setBlendMode("alpha", "premultiplied")
love.graphics.draw(texture,q,x,y)
love.graphics.setBlendMode("alpha")
love.graphics.setColor(Color("white")())
end)
end
function Bitmap:stretch_blt(dr,sbit,sr,opacity)
opacity = opacity or 255
local data = sbit():newImageData(sr.x, sr.y, sr.width, sr.height)
local texture = love.graphics.newImage(data)
local w,h = texture:getDimensions()
self._image:renderTo( function()
love.graphics.setColor(255,255,255,opacity)
love.graphics.setBlendMode("alpha", "premultiplied")
love.graphics.draw(texture,dr.x,dr.y,0,(dr.width/w),(dr.height/h))
love.graphics.setBlendMode("alpha")
love.graphics.setColor(Color("white")())
end)
end
function Bitmap:pattern_blt(dr,sbit,sr,opacity)
opacity = opacity or 255
local data = sbit():newImageData(sr.x, sr.y, sr.width, sr.height)
local texture = love.graphics.newImage(data)
texture:setWrap("repeat","repeat")
local w,h = texture:getDimensions()
local q = love.graphics.newQuad(0,0,dr.width,dr.height,w,h)
self._image:renderTo( function()
love.graphics.setColor(255,255,255,opacity)
love.graphics.setBlendMode("alpha", "premultiplied")
love.graphics.draw(texture,q,dr.x,dr.y,0)
love.graphics.setBlendMode("alpha")
love.graphics.setColor(Color("white")())
end)
end
function Bitmap:draw_text(x,y,width,height,text,align)
if type(x) == "table" then x,y,width,height,text,align = x.x,x.y,x.width,x.height,y,width end
--x,y,width,height,text,align = prep_rect(x,y,width,height,text,align)
align = align and math.min(3,math.max(0,align)) or 0
local al = {"left","center","right","justify","wleft","wcenter","wright","wjustify"}
local v = Rect(x,y,width,height)
self._image:renderTo( function()
love.graphics.setScissor(v.x,v.y,v.width,v.height)
love.graphics.setFont(self.font())
love.graphics.setColor(self.font.color())
if align < 4 then
local t = love.graphics.newText(self.font(),text)
local tw = t:getWidth()
if tw > width then
local scale = math.max(0.4,(width/tw))
love.graphics.draw(t,x,y,0,scale,1)
else
love.graphics.print(text,x,y)
end
else
love.graphics.printf( text, x, y, width, al[align+1])
end
love.graphics.setColor(Color("white")())
love.graphics.setScissor()
end)
end
function Bitmap:text_size(text)
local w,h = 0,0
text:gsub("([^\n]*)", function(i)
local tw = self.font():getWidth(i)
if tw > w then w = tw end
local th = self.font():getHeight(i)
if th > h then h = th end
end)
return Rect(0,0,w,h)
end
|
local rth = require("test_refactoring")
local test = {
params = {
line = { type = "current_line" },
col = { type = "current_column" },
}
}
function test:determine_input_files(params, opts)
return opts.input_files
end
function test:before_execute(ast, params, opts)
end
function test:execute(ast, params, opts)
local stmt = ast:find_child_of_type_at_loc(params.line, params.col, "assignment_statement")
if not stmt then return nil end
local list = stmt:find_parent_of_type("statement_list")
if not list then return nil end
local s = stmt:clone()
s:set_prefix(list:at(1):prefix_to_string())
list:insert_node(s, 1)
list:changed()
return ast
end
function test:after_execute(ast, params, opts)
end
return test
|
-- https://github.com/premake/premake-core/wiki
local action = _ACTION or ""
local VULKAN_SDK = os.getenv("VULKAN_SDK");
solution "cinder-vulkan"
location (action)
configurations { "Debug", "Release" }
language "C++"
configuration "vs*"
platforms {"x64", "x86"}
cppdialect "C++11"
defines {
"_CRT_SECURE_NO_WARNINGS",
"_CRT_SECURE_NO_DEPRECATE",
"NOMINMAX",
}
disablewarnings {
"4244",
"4305",
"4996",
}
flags {
"StaticRuntime",
}
configuration "x86"
targetdir ("lib/msw/x86")
configuration "x64"
targetdir ("lib/msw/x64")
-- configuration "vs*uwp"
-- platforms {"x64", "x86"}
-- defines {
-- "_CRT_SECURE_NO_WARNINGS",
-- "_CRT_SECURE_NO_DEPRECATE",
-- }
-- disablewarnings {
-- "4244",
-- "4305",
-- "4996",
-- }
-- flags {
-- "StaticRuntime",
-- }
-- configuration "x86"
-- targetdir ("lib/msw_uwp/x86")
-- configuration "x64"
-- targetdir ("lib/msw_uwp/x64")
configuration "macosx"
cppdialect "gnu++11"
platforms {"x64"}
targetdir ("lib/macos")
flags {
"MultiProcessorCompile",
}
configuration "Debug"
defines { "DEBUG" }
symbols "On"
targetsuffix "-d"
configuration "Release"
defines { "NDEBUG" }
optimize "On"
project "cinder-vulkan"
kind "StaticLib"
defines {
"AMD_EXTENSIONS",
"NV_EXTENSIONS",
}
includedirs {
"include",
"../../include",
path.join(VULKAN_SDK, "include"),
path.join(VULKAN_SDK, "glslang"),
}
-- sysincludedirs {
-- "include",
-- path.join(VULKAN_SDK, "include"),
-- path.join(VULKAN_SDK, "glslang"),
-- "../../include",
-- }
files {
"include/**",
"src/**",
path.join(VULKAN_SDK, "glslang", "SPIRV/**"),
path.join(VULKAN_SDK, "glslang", "OGLCompilersDLL/**"),
path.join(VULKAN_SDK, "glslang/glslang", "public/**"),
path.join(VULKAN_SDK, "glslang/glslang", "GenericCodeGen/**"),
path.join(VULKAN_SDK, "glslang/glslang", "MachineIndependent/**"),
path.join(VULKAN_SDK, "glslang/glslang", "OSDependent/Windows/ossource.cpp"),
}
|
Crate:describe(function(s)
s.name = 'Active Network'
s.version = '1.0'
s.date = '2019-03-09'
s.summary = 'Networking utilities'
s.description = 'Active Network provides various convenience libraries for automatic variable networking from server to client and vice versa.'
s.authors = { 'TeslaCloud Studios', 'Meow the Cat' }
s.email = 'support@teslacloud.net'
s.files = { 'lib/cl_active_network.lua', 'lib/sv_active_network.lua' }
s.website = 'https://teslacloud.net'
s.license = 'MIT'
end)
|
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
configs.verilog_language_server = {
default_config = {
cmd = {"vls"};
filetypes = {"verilog"};
root_dir = util.path.dirname;
-- root_dir = function(fname)
-- local filename = util.path.is_absolute(fname) and fname
-- or util.path.join(vim.loop.cwd(), fname)
-- return util.root_pattern("component.xml") or util.path.dirname(filename)
-- end;
};
docs = {
description = [[
verilog_language_server
]];
default_config = {
root_dir = "vim's cwd";
};
};
}
-- vim:et ts=2 sw=2
|
--[[ AscendScripting Script -
This software is provided as free and open source by the
staff of The AscendScripting Team.This script was
written and is protected by the GPL v2. The following
script was released by a AscendScripting Staff Member.
Please give credit where credit is due, if modifying,
redistributing and/or using this software. Thank you.
~~End of License Agreement
-- AscendScripting Staff, March 17, 2009. ]]
function SyndicateConjuror_OnSpawn(Unit,Event)
Unit:FullCastSpell(43896)
Unit:FullCastSpell(25085)
end
function SyndicateConjuror_OnEnterCombat(Unit,Event)
local X,Y,Z = Unit:GetX(),Unit:GetY(),Unit:GetZ()
local plr = Unit:GetMainTank()
local PX,PY,PZ = plr:GetX(),plr:GetY(),plr:GetZ()
local VoidWalker = Unit:GetCreatureNearestCoords(X,Y,Z,24476)
VoidWalker:MoveTo(PX,PY,PZ)
Unit:RegsiterEvent("ShadowBolt", 4000, 0)
Unit:RegsiterEvent("Sleep", 23000, 0)
end
function ShadowBolt(Unit,Event)
Unit:FullCastSpellOnTarget(9613,plr)
end
function Sleep(Unit,Event)
Unit:FullCastSpellOnTarget(15970,plr)
end
function SyndicateConjuror_OnLeaveCombat(Unit,Event)
Unit:RemoveEvents()
end
function SyndicateConjuror_OnDied(Unit,Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(2590,18,"SyndicateConjuror_OnSpawn")
RegisterUnitEvent(2590,1,"SyndicateConjuror_OnEnterCombat")
RegisterUnitEvent(2590,2,"SyndicateConjuror_OnLeaveCombat")
RegisterUnitEvent(2590,4,"SyndicateConjuror_OnDied")
|
local bit = require "bit32"
local utils = require "luainlua.common.utils"
local function int(str, i, n)
if n == 1 then
return str:byte(i), i + 1
end
local k = str:byte(i)
local m, i = int(str, i + 1, n-1)
return bit.lshift(m, 8) + k, i
end
local function short(str, i)
return int(str, i, 2)
end
local function byte(str, i)
return str:byte(i), i+1
end
local function string(str, i, size)
local size, i = int(str, i, size)
if size == 0 then
return nil, i
end
local str = str:sub(i, i+size-2)
return str, i+size
end
local function double(str, i)
local lo, i = int(str, i, 4)
local hi, i = int(str, i, 4)
if lo == 0 and hi == 0 then return 0, i end
-- 1 11 52
-- hi:63 - sign
-- hi:62-52 - exp
-- hilo - 0 - man
-- exp_mask = 0b01111111111100000000000000000000
local e = 2^(bit.rshift(bit.band(hi,0x7ff00000),20)-1023)
--print(bit.tohex(hi),bit.tohex(lo), e)
local m = 1
for k=1,52 do
local c = 0
local n, j = lo, k-1
if j >= 32 then
n, j = hi, j-32
end
local msk = 2^j
if bit.rshift(bit.band(n, msk), j) ~= 0 then
-- add (1/msk)/2 to m
m = m + (1/(2^(53-i)))
end
end
return m*e, i
end
local function contexualize(f)
return function(ctx, ...)
local str, i = unpack(ctx)
local r, i = f(str, i, ... or ctx.sizeof_int)
ctx[2] = i
return r
end
end
local reader = {int=contexualize(int), short=contexualize(short), byte=contexualize(byte), string=contexualize(string), double=contexualize(double), contexualize = contexualize}
function reader:configure(size)
self.sizeof_int = size
end
local function new_reader(str)
return setmetatable({str, 1, sizeof_int = 4}, {__index=utils.copy(reader)})
end
reader.new_reader = new_reader
return reader
|
FACTION.name = "USMLC"
FACTION.desc = "You're fighting the German in the United States army as a Lance Corporal."
FACTION.color = Color(229, 113, 113)
FACTION.isDefault = false
FACTION.models = {
"models/player/PMC_1/PMC__06.mdl",
"models/player/PMC_1/PMC__07.mdl",
}
FACTION.isGloballyRecognized = true
|
PLUGIN.name = "Noob Hinter"
PLUGIN.author = "Black Tea"
PLUGIN.desc = "This plugin adds good HUD."
if (SERVER) then return end
local function languageDeclare()
local langkey = "english"
do
local langTable = {
helpFist1 = "Attack with Fists",
helpFist2 = "Knock",
helpFist3 = "Pick up Object",
helpKey1 = "Unlock Door",
helpKey2 = "Lock Door",
helpKey3 = "Unlock Vehicle",
helpKey4 = "Lock Vehicle",
helpKey5 = "Get close to the door or vehicle",
helpStun1 = "Stun Target",
helpStun2 = "Push Target",
helpArr1 = "Arrest Target",
helpArr2 = "Unarrest Target",
helpTaz1 = "Stun Target In Place",
helpTaz2 = "Stun Target Unconcious",
helpCure = "Heal Target",
helpHack = "Hack Keypad",
helpShield = "The shield only blocks 'bullets'.",
helpDetect = "This Weapon detects Illegal Entities",
toggleHelper = "Enable Helper HUD",
tipAtm = "Withdraw/Deposit your Bank Account in here!",
tipBankReserve = "You can steal goverment's money from this",
tipCheckout = "You can sell your item more conviently with this",
tipCovfefe = "You can purchase small boost gain from this",
tipGoaway = "You can turn off this message in Right-Top of 'C' menu",
tipOutfitter = "You can change your look in here",
tipCrafting = "You can craft stuffs with blueprint in here",
tipCooker = "You can cook your foods with this",
tipStash = "You can store your items in here",
tipCardealer = "You can purchase vehicles from this NPC",
tipPunchBag = "You can grind your Strength Attribute with punching this with fists",
tipGunBag = "You can grind your Gun Skills Attribute with shooting this with guns",
}
table.Merge(nut.lang.stored[langkey], langTable)
end
langkey = "korean"
do
local langTable = {
helpFist1 = "주먹으로 공격",
helpFist2 = "노크",
helpFist3 = "물건 줍기",
helpKey1 = "문 열기",
helpKey2 = "문 잠금",
helpKey3 = "차량 열기",
helpKey4 = "차량 잠금",
helpKey5 = "차량이나 문에 가까이 가세요",
helpStun1 = "사람 때려 기절시키기",
helpStun2 = "사람 밀치기",
helpArr1 = "대상 체포",
helpArr2 = "대상 체포 해제",
helpCure = "대상 치료",
helpHack = "키패드 해킹",
helpShield = "이 방패는 총알만 막습니다",
helpDetect = "이 무기로 불법 물품을 감지합니다",
toggleHelper = "초보 도우미 사용",
tipAtm = "은행 계좌를 쓸 수 있는 ATM",
tipBankReserve = "정부 자금이 보관된 돈 보관함",
tipCheckout = "더 편리하게 판매를 도와주는 계산대",
tipCovfefe = "능력치를 잠시 올려주는 커피 판매기",
tipGoaway = "'C'의 오른쪽 위 메뉴에서 메세지를 끌 수 있습니다.",
tipOutfitter = "현재 옷을 바꿀수 있는 옷장",
tipCrafting = "청사진을 이용해 물건을 조합할수 있는 조합대",
tipCooker = "음식을 조리할 수 있는 물건",
tipStash = "물건을 안전하게 보관할 수 있는 보관함",
tipCardealer = "차량을 판매하는 NPC",
}
table.Merge(nut.lang.stored[langkey], langTable)
end
end
function PLUGIN:InitializedPlugins()
languageDeclare()
end
local iconMat = {
Material("hud/iconsheet1.png"),
Material("hud/iconsheet2.png"),
Material("hud/iconsheet3.png"),
}
function PLUGIN:LoadFonts(font, genericFont)
surface.CreateFont( "nutHelperFont", {
font = font,
extended = true,
size = 34,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
symbol = false,
rotary = false,
shadow = true,
additive = false,
outline = false,
} )
end
local matSize = 256
local iconSize = 60
local iconSizeSect = 64
local txtMiddle = 18
local sw, sh = ScrW(), ScrH()
local function drawIconText(_icoX, _icoY, _x, _y, _t, _icoTex, _alpha)
_alpha = _alpha or 255
surface.SetFont("nutHelperFont")
local tw, th = surface.GetTextSize(_t)
local icoSect = (iconSize + 10)
surface.SetMaterial(iconMat[_icoTex or 2])
surface.SetDrawColor(255, 255, 255, _alpha)
surface.DrawTexturedRectUV(_x - icoSect/2 - tw/2, _y - iconSize/2, iconSize, iconSize, iconSizeSect/matSize*_icoX, iconSizeSect/matSize*_icoY, iconSizeSect/matSize*(_icoX+1), iconSizeSect/matSize*(_icoY+1))
surface.SetTextColor(255, 255, 255, _alpha)
surface.SetTextPos(_x - tw/2 + icoSect/2, _y - txtMiddle)
surface.DrawText(_t)
end
local function drawIcon(_icoX, _icoY, _x, _y, _icoTex, _alpha)
_alpha = _alpha or 255
surface.SetMaterial(iconMat[_icoTex or 2])
surface.SetDrawColor(255, 255, 255, _alpha)
surface.DrawTexturedRectUV(_x - iconSize/2, _y - iconSize/2, iconSize, iconSize, iconSizeSect/matSize*_icoX, iconSizeSect/matSize*_icoY, iconSizeSect/matSize*(_icoX+1), iconSizeSect/matSize*(_icoY+1))
end
local function getEntity()
local client = LocalPlayer()
local char = client:getChar()
if (client and char) then
local trace = client:GetEyeTraceNoCursor()
if (IsValid(trace.Entity)) then
return trace.Entity
end
end
return
end
local informationDraw = {
nut_hands = function()
local client = LocalPlayer()
drawIconText(1, 0, sw/2, sh/3*2, L"helpFist1")
local ent = getEntity()
if (ent) then
local dist = ent:GetPos():Distance(client:GetPos())
if (dist > 128) then return end
if (ent:isDoor()) then
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpFist2")
else
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpFist3")
end
end
end,
nut_keys = function()
local client = LocalPlayer()
local ent = getEntity()
if (ent) then
local dist = ent:GetPos():Distance(client:GetPos())
if (dist <= 128) then
if (ent:isDoor()) then
drawIconText(1, 0, sw/2, sh/3*2, L"helpKey2")
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpKey1")
return
elseif (ent:IsVehicle()) then
drawIconText(1, 0, sw/2, sh/3*2, L"helpKey3")
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpKey4")
return
end
end
end
drawIconText(0, 0, sw/2, sh/3*2, L"helpKey5", 1)
end,
weapon_physgun = function()
end,
nut_stunstick = function()
drawIconText(1, 0, sw/2, sh/3*2, L"helpStun1")
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpStun2")
end,
nut_arrestbaton = function()
drawIconText(1, 0, sw/2, sh/3*2, L"helpArr1")
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpArr2")
end,
nut_unarrest = function()
drawIconText(1, 0, sw/2, sh/3*2, L"helpArr2")
drawIconText(0, 0, sw/2, sh/3*2+iconSize, L"helpArr2")
end,
nut_taser = function()
drawIconText(1, 0, sw/2, sh/3*2, "Stun Target In Place")
drawIconText(0, 0, sw/2, sh/3*2+iconSize, "Stun Target Unconcious")
end,
weapon_healer = function()
drawIconText(1, 0, sw/2, sh/3*2, L"helpCure")
end,
keypad_cracker = function()
drawIconText(1, 0, sw/2, sh/3*2, L"helpHack")
end,
weapon_riotshield = function()
drawIconText(0, 0, sw/2, sh/3*2, L"helpShield", 1)
end,
weapon_detector = function()
drawIconText(0, 0, sw/2, sh/3*2, L"helpDetect", 1)
end,
}
local entDraw = {
nut_bankreserve = function()
drawIconText(0, 1, sw/2, sh/3*2, "돈을 집을시 바로 현상수배가 됩니다", 1)
drawIconText(0, 2, sw/2, sh/3*2+iconSize, "은행 돈 훔치기", 1)
end,
nut_bankreserve = function()
drawIconText(0, 1, sw/2, sh/3*2, "가방에서 가격을 설정후 팔게 해줍니다", 1)
drawIconText(1, 2, sw/2, sh/3*2+iconSize, "떨어진 아이템 가격 관리", 1)
end,
}
local helperTrackingEnts = {}
local function addTrackEntity(icoX, icoY, text, lifeTime, target)
surface.PlaySound("nui/beepclear.wav")
local kek = {
pos = Vector(sw/2, sh/2),
ico = {icoX, icoY},
text = text,
alpha = 0,
lifetime = CurTime() + lifeTime,
target = target
}
table.insert(helperTrackingEnts, kek)
end
local annoyingEnts = {}
local displayInfo = {
nut_bankreserve = {"tipBankReserve", 0, 2},
nut_seller = {"tipCheckout", 1, 2},
nut_atm = {"tipAtm", 1, 2},
nut_vnd_covfefe = {"tipCovfefe", 1, 2},
nut_vnd_medical = {"tipMedven", 1, 2},
nut_attrib_gun = {"tipGunBag", 0, 0},
nut_attrib_punch = {"tipPunchBag", 0, 0},
nut_helloboard = {"tipGoaway", 0, 0},
nut_outfit = {"tipOutfitter", 0, 0},
nut_craftingtable = {"tipCrafting", 0, 0},
nut_loadingtable = {"tipCrafting", 0, 0},
nut_microwave = {"tipCooker", 0, 0},
nut_stove = {"tipCooker", 0, 0},
nut_stash = {"tipStash", 0, 0},
freshcardealer = {"tipCardealer", 0, 0},
}
local nextUpdate = 0
local lastTrace = {}
local lastEntity
local mathApproach = math.Approach
local surface = surface
local hookRun = hook.Run
local toScreen = FindMetaTable("Vector").ToScreen
function PLUGIN:HUDPaintBackground()
local realTime = RealTime()
local localPlayer = LocalPlayer()
if (localPlayer.getChar(localPlayer) and nextUpdate < realTime) then
nextUpdate = realTime + 0.8
lastTrace.start = localPlayer.GetShootPos(localPlayer)
lastTrace.endpos = lastTrace.start + localPlayer.GetAimVector(localPlayer)*512
lastTrace.filter = localPlayer
lastTrace.mins = Vector( -3, -3, -3 )
lastTrace.maxs = Vector( 3, 3, 3 )
lastEntity = util.TraceHull(lastTrace).Entity
end
if (IsValid(lastEntity)) then
local class = lastEntity:GetClass()
if (displayInfo[class]) then
if (annoyingEnts[class] and annoyingEnts[class] < CurTime()) then
annoyingEnts[class] = nil
end
if (class and !annoyingEnts[class]) then
addTrackEntity(displayInfo[class][2], displayInfo[class][3], L(displayInfo[class][1]), 5, lastEntity)
annoyingEnts[class] = CurTime() + 300
end
end
end
end
function PLUGIN:HUDPaint()
if (NUT_CVAR_HELPERS:GetBool()) then
local client = LocalPlayer()
local char = client:getChar()
if (!signal.open and client and char) then
local wep = client:GetActiveWeapon()
if (IsValid(wep)) then
if (informationDraw[wep:GetClass()]) then
informationDraw[wep:GetClass()]()
end
end
end
end
local lerpFT = RealFrameTime() * 7
for k, v in pairs(helperTrackingEnts) do
if (!IsValid(v.target)) then
helperTrackingEnts[k] = nil
return
end
local pos = isentity(v.target) and (v.target:GetPos() + v.target:OBBCenter()) or v.target
if (v.lifetime and v.lifetime < CurTime()) then
if (v.alpha) then
v.alpha = Lerp(lerpFT, v.alpha, 0)
end
if (v.alpha and v.alpha < 1) then
helperTrackingEnts[k] = nil
return
end
else
if (v.alpha) then
v.alpha = Lerp(lerpFT, v.alpha, 255)
end
end
v.pos = v.pos or Vector()
local nw, nh = sh*.1, sh*.1
local t = pos:ToScreen()
if (t.x >= nw and t.x <= (sw-nw) and
t.y >= nh and t.y <= (sh-nh)) then
v.pos = Lerp(lerpFT, v.pos, Vector(t.x, t.y, 0))
drawIconText(v.ico[1], v.ico[2], v.pos.x, v.pos.y, v.text, 1, v.alpha)
else
t.x = math.Clamp(t.x, nw*.9, sw - nw*.9)
t.y = math.Clamp(t.y, nh*.9, sh - nh*.9)
v.pos = Lerp(lerpFT, v.pos, Vector(t.x, t.y, 0))
drawIcon(v.ico[1], v.ico[2], v.pos.x, v.pos.y, 1, v.alpha)
end
end
end
NUT_CVAR_HELPERS = CreateClientConVar("nut_helpers", 1, true, true)
function PLUGIN:SetupQuickMenu(menu)
local button = menu:addCheck(L"toggleHelper", function(panel, state)
if (state) then
RunConsoleCommand("nut_helpers", "1")
else
RunConsoleCommand("nut_helpers", "0")
end
end, NUT_CVAR_HELPERS:GetBool())
menu:addSpacer()
end
|
local map = vim.api.nvim_set_keymap
map('n', '<c-p>', '<cmd>Telescope find_files find_command=fd,--type,f,--hidden<cr>', { noremap = true })
map('n', 'gb', '<cmd>Telescope buffers<cr>', { noremap = true })
|
include("terms")
measure = {"\(^\circ\)", "'", "''"}
numb = {}
index = {}
value = {}
numb[1] = {}
for i = 1,3 do
index[i] = math.random(4) - 1
if (index[i] > 0) then
index[i] = 1
end
end
numb[1][1] = math.random(80)
value[1] = numb[1][1]
for i = 2,3 do
numb[1][i] = index[i] * math.random(59)
value[1] = value[1] * 60 + numb[1][i]
end
quest = ""
for i = 1,3 do
if (numb[1][i] ~= 0) then
quest = quest .. " " .. tostring(numb[1][i]) .. measure[i]
end
end
ind = math.random(4)
name = msg[ind]
if (ind > 2) then
value[2] = 648000 - value[1]
else
if (ind == 1) then
value[2] = 324000 - value[1]
else
value[2] = value[1]
end
end
numb[2] = {}
numb[2][1] = math.floor(value[2]/3600)
rest = value[2] - numb[2][1] * 3600
numb[2][2] = math.floor(rest/60)
numb[2][3] = math.floor(rest - numb[2][2] * 60)
answ = ""
for i = 1,3 do
if (numb[2][i] ~= 0) then
if (i == 1) then
answ = answ .. " " .. lib.check_number(numb[2][i], 25) .. measure[i]
else
answ = answ .. " " .. lib.check_number(numb[2][i], 20) .. measure[i]
end
end
end
|
-- You can define factions in the factions/ folder. You need to have at least one faction that is the default faction - i.e the
-- faction that will always be available without any whitelists and etc.
FACTION.name = "Citizen"
FACTION.description = "An oppressed group of people forced to wear ridiculous blue jumpsuits."
FACTION.isDefault = true
FACTION.color = Color(100, 60, 60)
-- You should define a global variable for this faction's index for easy access wherever you need. FACTION.index is
-- automatically set, so you can simply assign the value.
-- Note that the player's team will also have the same value as their current character's faction index. This means you can use
-- client:Team() == FACTION_CITIZEN to compare the faction of the player's current character.
FACTION_CITIZEN = FACTION.index
|
pg = pg or {}
pg.box_data_template = {
{
name = "物资箱",
type = 1,
id = 1,
icon = "event2",
effect_id = 10001
},
{
name = "物资箱",
type = 1,
id = 2,
icon = "event2",
effect_id = 10002
},
{
name = "物资箱",
type = 1,
id = 3,
icon = "event2",
effect_id = 10003
},
{
name = "物资箱",
type = 1,
id = 4,
icon = "event2",
effect_id = 10004
},
{
name = "物资箱",
type = 1,
id = 5,
icon = "event2",
effect_id = 10005
},
{
name = "物资箱",
type = 1,
id = 6,
icon = "event2",
effect_id = 10006
},
{
name = "物资箱",
type = 1,
id = 7,
icon = "event2",
effect_id = 10007
},
{
name = "物资箱",
type = 1,
id = 8,
icon = "event2",
effect_id = 10008
},
{
name = "物资箱",
type = 1,
id = 9,
icon = "event2",
effect_id = 10009
},
{
name = "物资箱",
type = 1,
id = 10,
icon = "event2",
effect_id = 10010
},
[21] = {
name = "食物箱",
type = 1,
id = 21,
icon = "event2",
effect_id = 10021
},
[22] = {
name = "食物箱",
type = 1,
id = 22,
icon = "event2",
effect_id = 10022
},
[23] = {
name = "食物箱",
type = 1,
id = 23,
icon = "event2",
effect_id = 10023
},
[24] = {
name = "食物箱",
type = 1,
id = 24,
icon = "event2",
effect_id = 10024
},
[101] = {
name = "装备箱",
type = 1,
id = 101,
icon = "event2",
effect_id = 10101
},
[102] = {
name = "装备箱",
type = 1,
id = 102,
icon = "event2",
effect_id = 10102
},
[103] = {
name = "装备箱",
type = 1,
id = 103,
icon = "event2",
effect_id = 10103
},
[104] = {
name = "装备箱",
type = 1,
id = 104,
icon = "event2",
effect_id = 10104
},
[105] = {
name = "装备箱",
type = 1,
id = 105,
icon = "event2",
effect_id = 10105
},
[1001] = {
name = "事件",
type = 2,
id = 1001,
icon = "event2",
effect_id = 1
},
[1002] = {
name = "事件",
type = 2,
id = 1002,
icon = "event2",
effect_id = 2
},
[1003] = {
name = "事件",
type = 2,
id = 1003,
icon = "event2",
effect_id = 3
},
[1004] = {
name = "事件",
type = 2,
id = 1004,
icon = "event2",
effect_id = 4
},
[2001] = {
name = "触雷",
type = 7,
id = 2001,
icon = "torpedo",
effect_id = 5
},
[3001] = {
name = "空袭",
type = 4,
id = 3001,
icon = "event2",
effect_id = 5
},
[4001] = {
name = "刷怪",
type = 5,
id = 4001,
icon = "event2",
effect_id = 0
},
[5001] = {
name = "弹药补给",
type = 6,
id = 5001,
icon = "event2",
effect_id = 1
},
[6001] = {
name = "绊爱空袭",
type = 8,
id = 6001,
icon = "event2",
effect_id = 5
},
[6002] = {
name = "holo岩浆",
type = 9,
id = 6002,
icon = "event2",
effect_id = 5
},
[10001] = {
name = "拼图箱",
type = 1,
id = 10001,
icon = "event5",
effect_id = 8106
},
[10002] = {
name = "拼图箱",
type = 1,
id = 10002,
icon = "event5",
effect_id = 8107
},
[10003] = {
name = "拼图箱",
type = 1,
id = 10003,
icon = "event5",
effect_id = 8108
},
[10004] = {
name = "拼图箱",
type = 1,
id = 10004,
icon = "event5",
effect_id = 8109
},
[10005] = {
name = "拼图箱",
type = 1,
id = 10005,
icon = "event5",
effect_id = 8110
},
[10006] = {
name = "拼图箱",
type = 1,
id = 10006,
icon = "event5",
effect_id = 8111
},
[10007] = {
name = "拼图箱",
type = 1,
id = 10007,
icon = "event5",
effect_id = 8112
},
[10008] = {
name = "拼图箱",
type = 1,
id = 10008,
icon = "event5",
effect_id = 8113
},
[10101] = {
name = "港区回忆NO.17",
type = 1,
id = 10101,
icon = "event5",
effect_id = 90828
},
[10102] = {
name = "港区回忆NO.18",
type = 1,
id = 10102,
icon = "event5",
effect_id = 90829
},
[10103] = {
name = "港区回忆NO.19",
type = 1,
id = 10103,
icon = "event5",
effect_id = 90830
},
[10104] = {
name = "港区回忆NO.20",
type = 1,
id = 10104,
icon = "event5",
effect_id = 90831
},
[10105] = {
name = "徽章·克利夫兰",
type = 1,
id = 10105,
icon = "event5",
effect_id = 92023
},
[10106] = {
name = "徽章·谢菲尔德",
type = 1,
id = 10106,
icon = "event5",
effect_id = 92024
},
[10107] = {
name = "徽章·{namecode:91}",
type = 1,
id = 10107,
icon = "event5",
effect_id = 92025
},
[10108] = {
name = "徽章·希佩尔",
type = 1,
id = 10108,
icon = "event5",
effect_id = 92026
},
[10109] = {
name = "徽章·加斯科涅",
type = 1,
id = 10109,
icon = "event5",
effect_id = 92027
},
[10110] = {
name = "密码箱",
type = 1,
id = 10110,
icon = "event6",
effect_id = 92880
},
[10111] = {
name = "密码箱",
type = 1,
id = 10111,
icon = "event6",
effect_id = 92882
},
[10112] = {
name = "密码箱",
type = 1,
id = 10112,
icon = "event6",
effect_id = 92884
},
[10113] = {
name = "密码箱",
type = 1,
id = 10113,
icon = "event6",
effect_id = 92886
},
[10114] = {
name = "徽章·大青花鱼 ",
type = 1,
id = 10114,
icon = "event5",
effect_id = 94006
},
[10115] = {
name = "徽章·塔什干",
type = 1,
id = 10115,
icon = "event5",
effect_id = 94007
},
[10116] = {
name = "邮票·罗恩 ",
type = 1,
id = 10116,
icon = "event5",
effect_id = 94008
},
[10117] = {
name = "杯垫·恶毒 ",
type = 1,
id = 10117,
icon = "event5",
effect_id = 94009
},
[10118] = {
name = "写真·{namecode:97}",
type = 1,
id = 10118,
icon = "event5",
effect_id = 94010
},
[20001] = {
name = "障碍物",
type = 0,
id = 20001,
icon = "torpedo2",
effect_id = 0
},
all = {
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
21,
22,
23,
24,
101,
102,
103,
104,
105,
1001,
1002,
1003,
1004,
2001,
3001,
4001,
5001,
6001,
6002,
10001,
10002,
10003,
10004,
10005,
10006,
10007,
10008,
10101,
10102,
10103,
10104,
10105,
10106,
10107,
10108,
10109,
10110,
10111,
10112,
10113,
10114,
10115,
10116,
10117,
10118,
20001
}
}
return
|
----------------------------------------------------------------------------------
--
-- LibCompress.lua
--
-- Authors: jjsheets and Galmok of European Stormrage (Horde)
-- Email : sheets.jeff@gmail.com and galmok@gmail.com
-- Licence: GPL version 2 (General Public License)
----------------------------------------------------------------------------------
local M = dofile(kernel.DIR..'/etc/kernel/ext/libcomp/numberlua.lua')
local MAJOR, MINOR = "LibCompress", 6
LibCompress = {}
if not LibCompress then return end
-- list of codecs in this file:
-- \000 - Never used
-- \001 - Uncompressed
-- \002 - LZW
-- \003 - Huffman
-- local is faster than global
local bit = M.bit
local table_insert = table.insert
local table_remove = table.remove
local table_concat = table.concat
local string_char = string.char
local string_byte = string.byte
local string_len = string.len
local string_sub = string.sub
local unpack = unpack
local pairs = pairs
local math_modf = math.modf
local bit_band = bit.band
local bit_bor = bit.bor
local bit_bxor = bit.bxor
local bit_bnot = bit.bnot
local bit_lshift = bit.lshift
local bit_rshift = bit.rshift
--------------------------------------------------------------------------------
-- Cleanup
local tables = {} -- tables that may be cleaned have to be kept here
local tables_to_clean = {} -- list of tables by name (string) that may be reset to {} after a timeout
local timeout = -1
---Cleanup
-- tables that may be erased
local function cleanup()
for k,v in pairs(tables_to_clean) do
tables[k]={}
tables_to_clean[k]=nil
end
end
---On update
--@param frame
--@param elapsed
local function onUpdate(frame, elapsed)
timeout = timeout - elapsed
if timeout < 0 then
frame:Hide()
cleanup()
end
end
---Set cleanup tables
--@param ...
local function setCleanupTables(...)
timeout = 15 -- empty tables after 15 seconds
for i=1,select("#",...) do
tables_to_clean[(select(i, ...))] = true
end
end
----------------------------------------------------------------------
----------------------------------------------------------------------
--
-- compression algorithms
--------------------------------------------------------------------------------
-- LZW codec
-- implemented by sheets.jeff@gmail.com
-- encode is used to uniquely encode a number into a sequence of bytes that can be decoded using decode()
-- the bytes returned by this do not contain "\000"
local bytes = {}
---Encode
--@param x
local function encode(x)
for k = 1, #bytes do bytes[k] = nil end
local xmod
x, xmod = math_modf(x/255)
xmod = xmod * 255
bytes[#bytes + 1] = xmod
while x > 0 do
x, xmod = math_modf(x/255)
xmod = xmod * 255
bytes[#bytes + 1] = xmod
end
if #bytes == 1 and bytes[1] > 0 and bytes[1] < 250 then
return string_char(bytes[1])
else
for i = 1, #bytes do bytes[i] = bytes[i] + 1 end
return string_char(256 - #bytes, unpack(bytes))
end
end
---Decode
--decode converts a unique character sequence into its equivalent number, from ss, beginning at the ith char.
-- returns the decoded number and the count of characters used in the decode process.
--@param ss
--@param i
local function decode(ss,i)
i = i or 1
local a = string_byte(ss,i,i)
if a > 249 then
local r = 0
a = 256 - a
for n = i+a, i+1, -1 do
r = r * 255 + string_byte(ss,n,n) - 1
end
return r, a + 1
else
return a, 1
end
end
--------------------------------------------------------------------------------
-- Huffman codec
-- implemented by Galmok of European Stormrage (Horde), galmok@gmail.com
---Add code
--@param tree
--@param bcode
--@param len
local function addCode(tree, bcode, len)
if tree then
tree.bcode = bcode;
tree.blength = len;
if tree.c1 then
addCode(tree.c1, bit_bor(bcode, bit_lshift(1,len)), len+1)
end
if tree.c2 then
addCode(tree.c2, bcode, len+1)
end
end
end
---Escape code
--@param code
--@param len
local function escape_code(code, len)
local escaped_code = 0;
local b;
local l = 0;
for i = len-1, 0,- 1 do
b = bit_band( code, bit_lshift(1,i))==0 and 0 or 1
escaped_code = bit_lshift(escaped_code,1+b) + b
l = l + b;
end
return escaped_code, len+l
end
tables.Huffman_compressed = {}
tables.Huffman_large_compressed = {}
local compressed_size = 0
local remainder;
local remainder_length;
---Add bits
--@param tbl
--@param code
--@param len
local function addBits(tbl, code, len)
remainder = remainder + bit_lshift(code, remainder_length)
remainder_length = len + remainder_length
if remainder_length > 32 then
return true -- Bits lost due to too long code-words.
end
while remainder_length>=8 do
compressed_size = compressed_size + 1
tbl[compressed_size] = string_char(bit_band(remainder, 255))
remainder = bit_rshift(remainder, 8)
remainder_length = remainder_length -8
end
end
---LibCompress, Compress Huffman
-- word size for this huffman algorithm is 8 bits (1 byte). This means the best compression is representing 1 byte with 1 bit, i.e. compress to 0.125 of original size.
--@param uncompressed
function LibCompress:CompressHuffman(uncompressed)
if not type(uncompressed)=="string" then
return nil, "Can only compress strings"
end
if #uncompressed == 0 then
return "\001"
end
-- make histogram
local hist = {}
local n = 0
-- dont have to use all datat to make the histogram
local uncompressed_size = string_len(uncompressed)
local c;
for i = 1, uncompressed_size do
c = string_byte(uncompressed, i)
hist[c] = (hist[c] or 0) + 1
end
--Start with as many leaves as there are symbols.
local leafs = {}
local leaf;
local symbols = {}
for symbol, weight in pairs(hist) do
leaf = { symbol=string_char(symbol), weight=weight };
symbols[symbol] = leaf;
table_insert(leafs, leaf)
end
--Enqueue all leaf nodes into the first queue (by probability in increasing order so that the least likely item is in the head of the queue).
table.sort(leafs, function(a,b) if a.weight<b.weight then return true elseif a.weight>b.weight then return false else return nil end end)
local nLeafs = #leafs
-- create tree
local huff = {}
--While there is more than one node in the queues:
local l,h, li, hi, leaf1, leaf2
local newNode;
while (#leafs+#huff > 1) do
-- Dequeue the two nodes with the lowest weight.
-- Dequeue first
if not next(huff) then
li, leaf1 = next(leafs)
table_remove(leafs, li)
elseif not next(leafs) then
hi, leaf1 = next(huff)
table_remove(huff, hi)
else
li, l = next(leafs);
hi, h = next(huff);
if l.weight<=h.weight then
leaf1 = l;
table_remove(leafs, li)
else
leaf1 = h;
table_remove(huff, hi)
end
end
-- Dequeue second
if not next(huff) then
li, leaf2 = next(leafs)
table_remove(leafs, li)
elseif not next(leafs) then
hi, leaf2 = next(huff)
table_remove(huff, hi)
else
li, l = next(leafs);
hi, h = next(huff);
if l.weight<=h.weight then
leaf2 = l;
table_remove(leafs, li)
else
leaf2 = h;
table_remove(huff, hi)
end
end
--Create a new internal node, with the two just-removed nodes as children (either node can be either child) and the sum of their weights as the new weight.
newNode = { c1 = leaf1, c2 = leaf2, weight = leaf1.weight+leaf2.weight }
table_insert(huff,newNode)
end
if #leafs>0 then
li, l = next(leafs)
table_insert(huff, l)
table_remove(leafs, li)
end
huff = huff[1];
-- assign codes to each symbol
-- c1 = "0", c2 = "1"
-- As a common convention, bit '0' represents following the left child and bit '1' represents following the right child.
-- c1 = left, c2 = right
addCode(huff,0,0);
if huff then
huff.bcode = 0
huff.blength = 1
end
-- READING
-- bitfield = 0
-- bitfield_len = 0
-- read byte1
-- bitfield = bitfield + bit_lshift(byte1, bitfield_len)
-- bitfield_len = bitfield_len + 8
-- read byte2
-- bitfield = bitfield + bit_lshift(byte2, bitfield_len)
-- bitfield_len = bitfield_len + 8
-- (use 5 bits)
-- word = bit_band( bitfield, bit_lshift(1,5)-1)
-- bitfield = bit_rshift( bitfield, 5)
-- bitfield_len = bitfield_len - 5
-- read byte3
-- bitfield = bitfield + bit_lshift(byte3, bitfield_len)
-- bitfield_len = bitfield_len + 8
-- WRITING
remainder = 0;
remainder_length = 0;
local compressed = tables.Huffman_compressed
--compressed_size = 0
-- first byte is version info. 0 = uncompressed, 1 = 8-bit word huffman compressed
compressed[1] = "\003"
-- Header: byte 0=#leafs, byte 1-3=size of uncompressed data
-- max 2^24 bytes
local l = string_len(uncompressed)
compressed[2] = string_char(bit_band(nLeafs-1, 255)) -- number of leafs
compressed[3] = string_char(bit_band(l, 255)) -- bit 0-7
compressed[4] = string_char(bit_band(bit_rshift(l, 8), 255)) -- bit 8-15
compressed[5] = string_char(bit_band(bit_rshift(l, 16), 255)) -- bit 16-23
compressed_size = 5
-- create symbol/code map
for symbol, leaf in pairs(symbols) do
addBits(compressed, symbol, 8);
if addBits(compressed, escape_code(leaf.bcode, leaf.blength)) then
-- code word too long. Needs new revision to be able to handle more than 32 bits
return string_char(0)..uncompressed
end
addBits(compressed, 3, 2);
end
-- create huffman code
local large_compressed = tables.Huffman_large_compressed
local large_compressed_size = 0
local ulimit
for i = 1, l, 200 do
ulimit = l<(i+199) and l or (i+199)
for sub_i = i, ulimit do
c = string_byte(uncompressed, sub_i)
addBits(compressed, symbols[c].bcode, symbols[c].blength)
end
large_compressed_size = large_compressed_size + 1
large_compressed[large_compressed_size] = table_concat(compressed, "", 1, compressed_size)
compressed_size = 0
end
-- add remainding bits (if any)
if remainder_length>0 then
large_compressed_size = large_compressed_size + 1
large_compressed[large_compressed_size] = string_char(remainder)
end
local compressed_string = table_concat(large_compressed, "", 1, large_compressed_size)
-- is compression worth it? If not, return uncompressed data.
if (#uncompressed+1) <= #compressed_string then
return "\001"..uncompressed
end
setCleanupTables("Huffman_compressed", "Huffman_large_compressed")
return compressed_string
end
-- lookuptable (cached between calls)
local lshiftMask = {}
setmetatable(lshiftMask, {
__index = function (t, k)
local v = bit_lshift(1, k)
rawset(t, k, v)
return v
end
})
-- lookuptable (cached between calls)
local lshiftMinusOneMask = {}
setmetatable(lshiftMinusOneMask, {
__index = function (t, k)
local v = bit_lshift(1, k)-1
rawset(t, k, v)
return v
end
})
---Get code
--@param bitfield
--@param field_len
local function getCode(bitfield, field_len)
if field_len>=2 then
local b;
local p = 0;
for i = 0, field_len-1 do
b = bit_band(bitfield, lshiftMask[i])
if not (p==0) and not (b == 0) then
-- found 2 bits set right after each other (stop bits)
return bit_band( bitfield, lshiftMinusOneMask[i-1]), i-1,
bit_rshift(bitfield, i+1), field_len-i-1
end
p = b
end
end
return nil
end
---Unescape code
--@param code
--@param code_len
local function unescape_code(code, code_len)
local unescaped_code=0;
local b;
local l = 0;
local i = 0
while i < code_len do
b = bit_band( code, lshiftMask[i])
if not (b==0) then
unescaped_code = bit_bor(unescaped_code, lshiftMask[l])
i = i + 1
end
i = i + 1
l = l + 1
end
return unescaped_code, l
end
tables.Huffman_uncompressed = {}
tables.Huffman_large_uncompressed = {} -- will always be as big as the larges string ever decompressed. Bad, but clearing i every timetakes precious time.
---LibCompress, decompressed Huffman
--@param compressed
function LibCompress:DecompressHuffman(compressed)
if not type(uncompressed)=="string" then
return nil, "Can only uncompress strings"
end
local compressed_size = #compressed
--decode header
local info_byte = string_byte(compressed)
-- is data compressed
if info_byte==1 then
return compressed:sub(2) --return uncompressed data
end
if not (info_byte==3) then
return nil, "Can only decompress Huffman compressed data ("..tostring(info_byte)..")"
end
local num_symbols = string_byte(string_sub(compressed, 2, 2)) + 1
local c0 = string_byte(string_sub(compressed, 3, 3))
local c1 = string_byte(string_sub(compressed, 4, 4))
local c2 = string_byte(string_sub(compressed, 5, 5))
local orig_size = c2*65536 + c1*256 + c0
if orig_size==0 then
return "";
end
-- decode code->symbal map
local bitfield = 0;
local bitfield_len = 0;
local map = {} -- only table not reused in Huffman decode.
setmetatable(map, {
__index = function (t, k)
local v = {}
rawset(t, k, v)
return v
end
})
local i = 6; -- byte 1-5 are header bytes
local c, cl;
local minCodeLen = 1000;
local maxCodeLen = 0;
local symbol, code, code_len, _bitfield, _bitfield_len;
local n = 0;
local state = 0; -- 0 = get symbol (8 bits), 1 = get code (varying bits, ends with 2 bits set)
while n<num_symbols do
if i>compressed_size then
return nil, "Cannot decode map"
end
c = string_byte(compressed, i)
bitfield = bit_bor(bitfield, bit_lshift(c, bitfield_len))
bitfield_len = bitfield_len + 8
if state == 0 then
symbol = bit_band(bitfield, 255)
bitfield = bit_rshift(bitfield, 8)
bitfield_len = bitfield_len -8
state = 1 -- search for code now
else
code, code_len, _bitfield, _bitfield_len = getCode(bitfield, bitfield_len)
if code then
bitfield, bitfield_len = _bitfield, _bitfield_len
c, cl = unescape_code(code, code_len)
map[cl][c]=string_char(symbol)
minCodeLen = cl<minCodeLen and cl or minCodeLen
maxCodeLen = cl>maxCodeLen and cl or maxCodeLen
--print("symbol: "..string_char(symbol).." code: "..tobinary(c, cl))
n = n + 1
state = 0 -- search for next symbol (if any)
end
end
i=i+1
end
-- dont create new subtables for entries not in the map. Waste of space.
-- But do return an empty table to prevent runtime errors. (instead of returning nil)
local mt = {}
setmetatable(map, {
__index = function (t, k)
return mt
end
})
local uncompressed = tables.Huffman_uncompressed
local large_uncompressed = tables.Huffman_large_uncompressed
local uncompressed_size = 0
local large_uncompressed_size = 0
local test_code
local test_code_len = minCodeLen;
local symbol;
local dec_size = 0;
compressed_size = compressed_size + 1
local temp_limit = 200; -- first limit of uncompressed data. large_uncompressed will hold strings of length 200
temp_limit = temp_limit > orig_size and orig_size or temp_limit
while true do
if test_code_len<=bitfield_len then
test_code=bit_band( bitfield, lshiftMinusOneMask[test_code_len])
symbol = map[test_code_len][test_code]
if symbol then
uncompressed_size = uncompressed_size + 1
uncompressed[uncompressed_size]=symbol
dec_size = dec_size + 1
if dec_size >= temp_limit then
if dec_size>=orig_size then -- checked here for speed reasons
break;
end
-- process compressed bytes in smaller chunks
large_uncompressed_size = large_uncompressed_size + 1
large_uncompressed[large_uncompressed_size] = table_concat(uncompressed, "", 1, uncompressed_size)
uncompressed_size = 0
temp_limit = temp_limit + 200 -- repeated chunk size is 200 uncompressed bytes
temp_limit = temp_limit > orig_size and orig_size or temp_limit
end
bitfield = bit_rshift(bitfield, test_code_len)
bitfield_len = bitfield_len - test_code_len
test_code_len = minCodeLen
else
test_code_len = test_code_len + 1
if test_code_len>maxCodeLen then
return nil, "Decompression error at "..tostring(i).."/"..tostring(#compressed)
end
end
else
c = string_byte(compressed, i)
bitfield = bitfield + bit_lshift(c or 0, bitfield_len)
bitfield_len = bitfield_len + 8
if i > compressed_size then
break;
end
i = i + 1
end
end
setCleanupTables("Huffman_uncompressed", "Huffman_large_uncompressed")
return table_concat(large_uncompressed, "", 1, large_uncompressed_size)..table_concat(uncompressed, "", 1, uncompressed_size)
end
--------------------------------------------------------------------------------
-- Generic codec interface
---LibCompress, decompress uncompressed
--@param data
function LibCompress:DecompressUncompressed(data)
if type(data)~="string" then
return nil, "Can only handle strings"
end
if string.byte(data) ~= 1 then
return nil, "Can only handle uncompressed data"
end
return data:sub(2)
end
local compression_methods = {
[2] = LibCompress.CompressLZW,
[3] = LibCompress.CompressHuffman
}
local decompression_methods = {
[1] = LibCompress.DecompressUncompressed,
[2] = LibCompress.DecompressLZW,
[3] = LibCompress.DecompressHuffman
}
----------------------------------------------------------------------
----------------------------------------------------------------------
--
-- Encoding algorithms
--------------------------------------------------------------------------------
-- Prefix encoding algorithm
-- implemented by Galmok of European Stormrage (Horde), galmok@gmail.com
--[[
Howto: Encode and Decode:
3 functions are supplied, 2 of them are variants of the first. They return a table with functions to encode and decode text.
table, msg = LibCompress:GetEncodeTable(reservedChars, escapeChars, mapChars)
reservedChars: The characters in this string will not appear in the encoded data.
escapeChars: A string of characters used as escape-characters (don't supply more than needed). #escapeChars >= 1
mapChars: First characters in reservedChars maps to first characters in mapChars. (#mapChars <= #reservedChars)
return value:
table
if nil then msg holds an error message, otherwise use like this:
encoded_message = table:Encode(message)
message = table:Decode(encoded_message)
GetAddonEncodeTable: Sets up encoding for the addon channel (\000 is encoded)
GetChatEncodeTable: Sets up encoding for the chat channel (many bytes encoded, see the function for details)
Except for the mapped characters, all encoding will be with 1 escape character followed by 1 suffix, i.e. 2 bytes.
]]
-- to be able to match any requested byte value, the search string must be preprocessed
-- characters to escape with %:
-- ( ) . % + - * ? [ ] ^ $
-- "illegal" byte values:
-- 0 is replaces %z
local gsub_escape_table = {
['\000'] = "%z",
[('(')] = "%(",
[(')')] = "%)",
[('.')] = "%.",
[('%')] = "%%",
[('+')] = "%+",
[('-')] = "%-",
[('*')] = "%*",
[('?')] = "%?",
[('[')] = "%[",
[(']')] = "%]",
[('^')] = "%^",
[('$')] = "%$"
}
---Escape for gsub
--@param str
local function escape_for_gsub(str)
return str:gsub("([%z%(%)%.%%%+%-%*%?%[%]%^%$])", gsub_escape_table)
end
---LibCompress, Get encode table
--@param reservedChars
--@param escapeChars
--@param mapChars
function LibCompress:GetEncodeTable(reservedChars, escapeChars, mapChars)
reservedChars = reservedChars or ""
escapeChars = escapeChars or ""
mapChars = mapChars or ""
-- select a default escape character
if escapeChars == "" then
return nil, "No escape characters supplied"
end
if #reservedChars < #mapChars then
return nil, "Number of reserved characters must be at least as many as the number of mapped chars"
end
if reservedChars == "" then
return nil, "No characters to encode"
end
-- list of characters that must be encoded
encodeBytes = reservedChars..escapeChars..mapChars
-- build list of bytes not available as a suffix to a prefix byte
local taken = {}
for i=1, strlen(encodeBytes) do
taken[string.sub(encodeBytes, i, i)] = true
end
-- allocate a table to holde encode/decode strings/functions
local codecTable = {}
-- the encoding can be a single gsub, but the decoding can require multiple gsubs
local decode_func_string = {}
local encode_search = {}
local encode_translate = {}
local decode_search = {}
local decode_translate = {}
local c,r,i,to,from
local escapeCharIndex = 0
-- map single byte to single byte
if #mapChars > 0 then
for i=1, #mapChars do
from = string.sub(reservedChars, i, i)
to = string.sub(mapChars, i, i)
encode_translate[from] = to
table.insert(encode_search, from)
decode_translate[to] = from
table.insert(decode_search, to)
end
codecTable["decode_search"..tostring(escapeCharIndex)] = "([".. escape_for_gsub(table.concat(decode_search)).."])"
codecTable["decode_translate"..tostring(escapeCharIndex)] = decode_translate
tinsert(decode_func_string, "str = str:gsub(self.decode_search"..tostring(escapeCharIndex)..", self.decode_translate"..tostring(escapeCharIndex)..");")
end
-- map single byte to double-byte
escapeCharIndex = escapeCharIndex +1
escapeChar = string.sub(escapeChars, escapeCharIndex, escapeCharIndex)
r = 0 -- suffix char value to the escapeChar
decode_search = {}
decode_translate = {}
for i = 1, strlen(encodeBytes) do
c = string.sub(encodeBytes, i, i)
if not encode_translate[c] then
-- this loop will update escapeChar and r
while r<256 and taken[string.char(r)] do
r=r+1
if r>255 then -- switch to next escapeChar
if escapeChar == "" then -- we are out of escape chars and we need more!
return nil, "Out of escape characters"
end
codecTable["decode_search"..tostring(escapeCharIndex)] = escape_for_gsub(escapeChar).."([".. escape_for_gsub(table.concat(decode_search)).."])"
codecTable["decode_translate"..tostring(escapeCharIndex)] = decode_translate
tinsert(decode_func_string, "str = str:gsub(self.decode_search"..tostring(escapeCharIndex)..", self.decode_translate"..tostring(escapeCharIndex)..");")
escapeCharIndex = escapeCharIndex + 1
escapeChar = string.sub(escapeChars, escapeCharIndex, escapeCharIndex)
r = 0
decode_search = {}
decode_translate = {}
end
end
encode_translate[c] = escapeChar..string.char(r)
table.insert(encode_search, c)
decode_translate[string.char(r)] = c
table.insert(decode_search, string.char(r))
r = r + 1
end
end
if r>0 then
codecTable["decode_search"..tostring(escapeCharIndex)] = escape_for_gsub(escapeChar).."([".. escape_for_gsub(table.concat(decode_search)).."])"
codecTable["decode_translate"..tostring(escapeCharIndex)] = decode_translate
tinsert(decode_func_string, "str = str:gsub(self.decode_search"..tostring(escapeCharIndex)..", self.decode_translate"..tostring(escapeCharIndex)..");")
end
-- change last line from "str = ...;" to "return ...;";
decode_func_string[#decode_func_string] = decode_func_string[#decode_func_string]:gsub("str = (.*);", "return %1;");
decode_func_string = "return function(self, str) "..table.concat(decode_func_string).." end"
encode_search = "([".. escape_for_gsub(table.concat(encode_search)).."])"
decode_search = escape_for_gsub(escapeChars).."([".. escape_for_gsub(table.concat(decode_search)).."])"
encode_func = assert(loadstring("return function(self, str) return str:gsub(self.encode_search, self.encode_translate); end"))()
decode_func = assert(loadstring(decode_func_string))()
codecTable.encode_search = encode_search
codecTable.encode_translate = encode_translate
codecTable.Encode = encode_func
codecTable.decode_search = decode_search
codecTable.decode_translate = decode_translate
codecTable.Decode = decode_func
codecTable.decode_func_string = decode_func_string -- to be deleted
return codecTable
end
---LibCompress, Get addon encode table
-- Addons: Call this only once and reuse the returned table for all encodings/decodings.
--@param reservedChars
--@param escapeChars
--@param mapChars
function LibCompress:GetAddonEncodeTable(reservedChars, escapeChars, mapChars)
reservedChars = reservedChars or ""
escapeChars = escapeChars or ""
mapChars = mapChars or ""
-- Following byte values are not allowed:
-- \000
if escapeChars == "" then
escapeChars = "\001"
end
return self:GetEncodeTable( (reservedChars or "").."\000", escapeChars, mapChars)
end
---LibCompress, get chat endcode table
-- Addons: Call this only once and reuse the returned table for all encodings/decodings.
--@param reservesChars
--@param escapeChars
--@param mapChars
function LibCompress:GetChatEncodeTable(reservedChars, escapeChars, mapChars)
reservedChars = reservedChars or ""
escapeChars = escapeChars or ""
mapChars = mapChars or ""
-- Following byte values are not allowed:
-- \000, s, S, \010, \013, \124, %
-- Because SendChatMessage will error if an UTF8 multibyte character is incomplete,
-- all character values above 127 have to be encoded to avoid this. This costs quite a bit of bandwidth (about 13-14%)
-- Also, because drunken status is unknown for the received, strings used with SendChatMessage should be terminated with
-- an identifying byte value, after which the server MAY add "...hic!" or as much as it can fit(!).
-- Pass the identifying byte as a reserved character to this function to ensure the encoding doesn't contain that value.
-- or use this: local message, match = arg1:gsub("^(.*)\029.-$", "%1")
-- arg1 is message from channel, \029 is the string terminator, but may be used in the encoded datastream as well. :-)
-- This encoding will expand data anywhere from:
-- 0% (average with pure ascii text)
-- 53.5% (average with random data valued zero to 255)
-- 100% (only encoding data that encodes to two bytes)
local i
local r={}
for i=128, 255 do
table.insert(r, string.char(i))
end
reservedChars = "sS\000\010\013\124%"..table.concat(r)..(reservedChars or "")
if escapeChars == "" then
escapeChars = "\029\031"
end
if mapChars == "" then
mapChars = "\015\020";
end
return self:GetEncodeTable(reservedChars, escapeChars, mapChars)
end
--------------------------------------------------------------------------------
-- 7 bit encoding algorithm
-- implemented by Galmok of European Stormrage (Horde), galmok@gmail.com
-- The encoded data holds values from 0 to 127 inclusive. Additional encoding may be necessary.
-- This algorithm isn't exactly fast and be used with care and consideration
tables.encode7bit = {}
---LibCompress, Encode 7 bit
--@param str
function LibCompress:Encode7bit(str)
local remainder = 0;
local remainder_length = 0;
local tbl = tables.encode7bit
local encoded_size = 0
local l=#str
for i=1,l do
code = string.byte(str, i)
remainder = remainder + bit_lshift(code, remainder_length)
remainder_length = 8 + remainder_length
while remainder_length>=7 do
encoded_size = encoded_size + 1
tbl[encoded_size] = string_char(bit_band(remainder, 127))
remainder = bit_rshift(remainder, 7)
remainder_length = remainder_length -7
end
end
if remainder_length>0 then
encoded_size = encoded_size + 1
tbl[encoded_size] = string_char(remainder)
end
setCleanupTables("encode7bit")
return table.concat(tbl, "", 1, encoded_size)
end
tables.decode8bit = {}
---LibCompress, Decode 7 bit
--@param str
function LibCompress:Decode7bit(str)
local bit8 = tables.decode8bit
local decoded_size = 0
local ch
local i=1
local bitfield_len=0
local bitfield=0
local l=#str
while true do
if bitfield_len >=8 then
decoded_size = decoded_size + 1
bit8[decoded_size] = string_char(bit.band(bitfield, 255))
bitfield = bit_rshift(bitfield, 8)
bitfield_len = bitfield_len - 8
end
ch=string_byte(str,i)
bitfield=bitfield+bit_lshift(ch or 0, bitfield_len)
bitfield_len = bitfield_len + 7
if i > l then
break
end
i=i+1
end
setCleanupTables("decode8bit")
return table.concat(bit8, "", 1, decoded_size)
end
----------------------------------------------------------------------
----------------------------------------------------------------------
--
-- Checksum/hash algorithms
--------------------------------------------------------------------------------
-- FCS16/32 checksum algorithms
-- converted from C by Galmok of European Stormrage (Horde), galmok@gmail.com
-- usage:
-- code = LibCompress:fcs16init()
-- code = LibCompress:fcs16update(code, data1)
-- code = LibCompress:fcs16update(code, data2)
-- code = LibCompress:fcs16update(code, data...)
-- code = LibCompress:fcs16final(code)
--
-- data = string
-- fcs16 provides a 16 bit checksum, fcs32 provides a 32 bit checksum.
--[[/* The following copyright notice concerns only the FCS hash algorithm
---------------------------------------------------------------------------
Copyright (c) 2003, Dominik Reichl <dominik.reichl@t-online.de>, Germany.
All rights reserved.
Distributed under the terms of the GNU General Public License v2.
This software is provided 'as is' with no explicit or implied warranties
in respect of its properties, including, but not limited to, correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
*/]]
--// FCS-16 algorithm implemented as described in RFC 1331
local FCSINIT16 = 65535;
--// Fast 16 bit FCS lookup table
local fcs16tab = { [0]=0, 4489, 8978, 12955, 17956, 22445, 25910, 29887,
35912, 40385, 44890, 48851, 51820, 56293, 59774, 63735,
4225, 264, 13203, 8730, 22181, 18220, 30135, 25662,
40137, 36160, 49115, 44626, 56045, 52068, 63999, 59510,
8450, 12427, 528, 5017, 26406, 30383, 17460, 21949,
44362, 48323, 36440, 40913, 60270, 64231, 51324, 55797,
12675, 8202, 4753, 792, 30631, 26158, 21685, 17724,
48587, 44098, 40665, 36688, 64495, 60006, 55549, 51572,
16900, 21389, 24854, 28831, 1056, 5545, 10034, 14011,
52812, 57285, 60766, 64727, 34920, 39393, 43898, 47859,
21125, 17164, 29079, 24606, 5281, 1320, 14259, 9786,
57037, 53060, 64991, 60502, 39145, 35168, 48123, 43634,
25350, 29327, 16404, 20893, 9506, 13483, 1584, 6073,
61262, 65223, 52316, 56789, 43370, 47331, 35448, 39921,
29575, 25102, 20629, 16668, 13731, 9258, 5809, 1848,
65487, 60998, 56541, 52564, 47595, 43106, 39673, 35696,
33800, 38273, 42778, 46739, 49708, 54181, 57662, 61623,
2112, 6601, 11090, 15067, 20068, 24557, 28022, 31999,
38025, 34048, 47003, 42514, 53933, 49956, 61887, 57398,
6337, 2376, 15315, 10842, 24293, 20332, 32247, 27774,
42250, 46211, 34328, 38801, 58158, 62119, 49212, 53685,
10562, 14539, 2640, 7129, 28518, 32495, 19572, 24061,
46475, 41986, 38553, 34576, 62383, 57894, 53437, 49460,
14787, 10314, 6865, 2904, 32743, 28270, 23797, 19836,
50700, 55173, 58654, 62615, 32808, 37281, 41786, 45747,
19012, 23501, 26966, 30943, 3168, 7657, 12146, 16123,
54925, 50948, 62879, 58390, 37033, 33056, 46011, 41522,
23237, 19276, 31191, 26718, 7393, 3432, 16371, 11898,
59150, 63111, 50204, 54677, 41258, 45219, 33336, 37809,
27462, 31439, 18516, 23005, 11618, 15595, 3696, 8185,
63375, 58886, 54429, 50452, 45483, 40994, 37561, 33584,
31687, 27214, 22741, 18780, 15843, 11370, 7921, 3960 }
---LibCompress, fcs16init
function LibCompress:fcs16init()
return FCSINIT16;
end
---LibCompress, fcs16update
--@param uFcs16
--@param pBuffer
function LibCompress:fcs16update(uFcs16, pBuffer)
local i
local l=string_len(pBuffer)
for i = 1,l do
uFcs16 = bit_bxor(bit_rshift(uFcs16,8), fcs16tab[bit_band(bit_bxor(uFcs16, string_byte(pBuffer,i)), 255)])
end
return uFcs16
end
---LibCompress, fcs16final
--@param uFcs16
function LibCompress:fcs16final(uFcs16)
return bit_bxor(uFcs16,65535)
end
-- END OF FCS16
--[[/*
---------------------------------------------------------------------------
Copyright (c) 2003, Dominik Reichl <dominik.reichl@t-online.de>, Germany.
All rights reserved.
Distributed under the terms of the GNU General Public License v2.
This software is provided 'as is' with no explicit or implied warranties
in respect of its properties, including, but not limited to, correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
*/]]
--// FCS-32 algorithm implemented as described in RFC 1331
local FCSINIT32 = -1
--// Fast 32 bit FCS lookup table
local fcs32tab = { [0]=0, 1996959894, -301047508, -1727442502, 124634137, 1886057615, -379345611, -1637575261,
249268274, 2044508324, -522852066, -1747789432, 162941995, 2125561021, -407360249, -1866523247,
498536548, 1789927666, -205950648, -2067906082, 450548861, 1843258603, -187386543, -2083289657,
325883990, 1684777152, -43845254, -1973040660, 335633487, 1661365465, -99664541, -1928851979,
997073096, 1281953886, -715111964, -1570279054, 1006888145, 1258607687, -770865667, -1526024853,
901097722, 1119000684, -608450090, -1396901568, 853044451, 1172266101, -589951537, -1412350631,
651767980, 1373503546, -925412992, -1076862698, 565507253, 1454621731, -809855591, -1195530993,
671266974, 1594198024, -972236366, -1324619484, 795835527, 1483230225, -1050600021, -1234817731,
1994146192, 31158534, -1731059524, -271249366, 1907459465, 112637215, -1614814043, -390540237,
2013776290, 251722036, -1777751922, -519137256, 2137656763, 141376813, -1855689577, -429695999,
1802195444, 476864866, -2056965928, -228458418, 1812370925, 453092731, -2113342271, -183516073,
1706088902, 314042704, -1950435094, -54949764, 1658658271, 366619977, -1932296973, -69972891,
1303535960, 984961486, -1547960204, -725929758, 1256170817, 1037604311, -1529756563, -740887301,
1131014506, 879679996, -1385723834, -631195440, 1141124467, 855842277, -1442165665, -586318647,
1342533948, 654459306, -1106571248, -921952122, 1466479909, 544179635, -1184443383, -832445281,
1591671054, 702138776, -1328506846, -942167884, 1504918807, 783551873, -1212326853, -1061524307,
-306674912, -1698712650, 62317068, 1957810842, -355121351, -1647151185, 81470997, 1943803523,
-480048366, -1805370492, 225274430, 2053790376, -468791541, -1828061283, 167816743, 2097651377,
-267414716, -2029476910, 503444072, 1762050814, -144550051, -2140837941, 426522225, 1852507879,
-19653770, -1982649376, 282753626, 1742555852, -105259153, -1900089351, 397917763, 1622183637,
-690576408, -1580100738, 953729732, 1340076626, -776247311, -1497606297, 1068828381, 1219638859,
-670225446, -1358292148, 906185462, 1090812512, -547295293, -1469587627, 829329135, 1181335161,
-882789492, -1134132454, 628085408, 1382605366, -871598187, -1156888829, 570562233, 1426400815,
-977650754, -1296233688, 733239954, 1555261956, -1026031705, -1244606671, 752459403, 1541320221,
-1687895376, -328994266, 1969922972, 40735498, -1677130071, -351390145, 1913087877, 83908371,
-1782625662, -491226604, 2075208622, 213261112, -1831694693, -438977011, 2094854071, 198958881,
-2032938284, -237706686, 1759359992, 534414190, -2118248755, -155638181, 1873836001, 414664567,
-2012718362, -15766928, 1711684554, 285281116, -1889165569, -127750551, 1634467795, 376229701,
-1609899400, -686959890, 1308918612, 956543938, -1486412191, -799009033, 1231636301, 1047427035,
-1362007478, -640263460, 1088359270, 936918000, -1447252397, -558129467, 1202900863, 817233897,
-1111625188, -893730166, 1404277552, 615818150, -1160759803, -841546093, 1423857449, 601450431,
-1285129682, -1000256840, 1567103746, 711928724, -1274298825, -1022587231, 1510334235, 755167117 }
---LibCompress, fcs32init
function LibCompress:fcs32init()
return FCSINIT32;
end
---LibCompress, fcs32update
--@param uFcs32
--@param pBuffer
function LibCompress:fcs32update(uFcs32, pBuffer)
local i
local l=string_len(pBuffer)
for i = 1,l do
uFcs32 = bit_bxor(bit_rshift(uFcs32,8), fcs32tab[bit_band(bit_bxor(uFcs32, string_byte(pBuffer,i)), 255)])
end
return uFcs32
end
---LibCompress, fcs32final
--@param uFcs32
function LibCompress:fcs32final(uFcs32)
return bit_bnot(uFcs32)
end
-- Setup return object
LibCompress.Compress = LibCompress.CompressHuffman
return LibCompress
|
//NS2 Pause Plugin
local gamestate = {
gamepaused = false,
gamepausedtime = 0,
gamepausedcountdown = 0,
gamepausedmessagetime = 0,
gamepausingteam = 0,
team1pauses = 0,
team2pauses = 0,
team1resume = false,
team2resume = false,
gamepauseddelta = 0
}
local SharedGetTimeAdjustments = 0
local ClassUpdatesBlock = { }
table.insert(ClassUpdatesBlock, {name = "ResearchMixin", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "Hive", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "MaturityMixin", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "NS2Gamerules", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "ConstructMixin", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "FireMixin", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "DotMarker", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "Alien", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "MAC", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "TunnelUserMixin", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "Player", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "TeamSpectator", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "Babbler", OnUpdate = nil, OnProcessMove = nil })
table.insert(ClassUpdatesBlock, {name = "ResourceTower", OnUpdate = nil, OnProcessMove = nil })
local function OnPluginInitialized()
local originalNS2ResourceTowerOnUpdate
originalNS2ResourceTowerOnUpdate = DAK:Class_ReplaceMethod("ResourceTower", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return true
end
return originalNS2ResourceTowerOnUpdate(self, deltaTime)
end
)
local originalNS2ResearchMixinUpdateResearch
originalNS2ResearchMixinUpdateResearch = DAK:Class_ReplaceMethod("ResearchMixin", "UpdateResearch",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return true
end
return originalNS2ResearchMixinUpdateResearch(self, deltaTime)
end
)
local originalNS2CommanderProcessTechTreeAction
originalNS2CommanderProcessTechTreeAction = DAK:Class_ReplaceMethod("Commander", "ProcessTechTreeAction",
function(self, techId, pickVec, orientation, worldCoordsSpecified, targetId)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return false
end
return originalNS2CommanderProcessTechTreeAction(self, techId, pickVec, orientation, worldCoordsSpecified, targetId)
end
)
local originalNS2AlienTeamUpdate
originalNS2AlienTeamUpdate = DAK:Class_ReplaceMethod("AlienTeam", "Update",
function(self, timePassed)
if DAK:GetTournamentMode() and GetIsGamePaused() then
//Push out alien respawn time.
if self.timeNextWave ~= nil then
self.timeNextWave = self.timeNextWave + timePassed
end
if self.timeOfLastAutoHeal ~= nil then
self.timeOfLastAutoHeal = self.timeOfLastAutoHeal + timePassed
end
end
originalNS2AlienTeamUpdate(self, timePassed)
end
)
local originalNS2HiveOnUpdate
originalNS2HiveOnUpdate = DAK:Class_ReplaceMethod("Hive", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
CommandStructure.OnUpdate(self, deltaTime)
return
end
originalNS2HiveOnUpdate(self, deltaTime)
end
)
local originalNS2ConstructMixinConstruct
originalNS2ConstructMixinConstruct = DAK:Class_ReplaceMethod("ConstructMixin", "Construct",
function(self, elapsedTime, builder)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2ConstructMixinConstruct(self, elapsedTime, builder)
end
)
local originalNS2ShiftEnergizeInRange
originalNS2ShiftEnergizeInRange = DAK:Class_ReplaceMethod("Shift", "EnergizeInRange",
function(self)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return true
end
return originalNS2ShiftEnergizeInRange(self)
end
)
local originalNS2CommanderAbilityOnThink
originalNS2CommanderAbilityOnThink = DAK:Class_ReplaceMethod("CommanderAbility", "OnThink",
function(self)
if DAK:GetTournamentMode() and GetIsGamePaused() then
self:CreateRepeatEffect()
//Set Think for next frame :/ Seems wierd, but hoping I can just delay any actions and have anything queued trigger correctly once resumed.
self:SetNextThink(0.03)
end
return originalNS2CommanderAbilityOnThink(self)
end
)
local originalNS2DotMarkerOnUpdate
originalNS2DotMarkerOnUpdate = DAK:Class_ReplaceMethod("DotMarker", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
self.timeLastUpdate = self.timeLastUpdate + deltaTime
end
originalNS2DotMarkerOnUpdate(self, deltaTime)
end
)
local originalNS2DotMarkerOnCreate
originalNS2DotMarkerOnCreate = DAK:Class_ReplaceMethod("DotMarker", "OnCreate",
function(self)
self.adjustedcreationtime = Shared.GetTime()
originalNS2DotMarkerOnCreate(self)
end
)
local originalNS2DotMarkerTimeUp
originalNS2DotMarkerTimeUp = DAK:Class_ReplaceMethod("DotMarker", "TimeUp",
function(self)
if self.adjustedcreationtime + self.dotlifetime <= Shared.GetTime() then
originalNS2DotMarkerTimeUp(self)
else
self:AddTimedCallback(DotMarker.TimeUp, math.max(self.adjustedcreationtime + self.dotlifetime - Shared.GetTime() + 0.1, 0.1))
end
end
)
local originalNS2DotMarkerSetLifeTime
originalNS2DotMarkerSetLifeTime = DAK:Class_ReplaceMethod("DotMarker", "SetLifeTime",
function(self, lifeTime)
self.dotlifetime = lifeTime
originalNS2DotMarkerSetLifeTime(self, lifeTime)
end
)
local originalNS2PickupableMixin__initmixin
originalNS2PickupableMixin__initmixin = DAK:Class_ReplaceMethod("PickupableMixin", "__initmixin",
function(self)
self.adjustedcreationtime = Shared.GetTime()
originalNS2PickupableMixin__initmixin(self)
end
)
local originalNS2PickupableMixin_DestroySelf
originalNS2PickupableMixin_DestroySelf = DAK:Class_ReplaceMethod("PickupableMixin", "_DestroySelf",
function(self)
if self.adjustedcreationtime + kItemStayTime <= Shared.GetTime() then
originalNS2PickupableMixin_DestroySelf(self)
else
self:AddTimedCallback(PickupableMixin._DestroySelf, math.max(self.adjustedcreationtime + kItemStayTime - Shared.GetTime() + 0.5, 0.5))
end
end
)
local originalNS2PathingMixinMoveToTarget
originalNS2PathingMixinMoveToTarget = DAK:Class_ReplaceMethod("PathingMixin", "MoveToTarget",
function(self, physicsGroupMask, endPoint, movespeed, time)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return false
end
return originalNS2PathingMixinMoveToTarget(self, physicsGroupMask, endPoint, movespeed, time)
end
)
//No escaping the command structures pesky comms
local originalNS2CommandStructureLogout
originalNS2CommandStructureLogout = DAK:Class_ReplaceMethod("CommandStructure", "Logout",
function(self)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return self:GetCommander()
end
return originalNS2CommandStructureLogout(self)
end
)
local originalNS2CommanderHandleButtons
originalNS2CommanderHandleButtons = DAK:Class_ReplaceMethod("Commander", "HandleButtons",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2CommanderHandleButtons(self, input)
end
)
local originalNS2MaturityMixinOnUpdate
originalNS2MaturityMixinOnUpdate = DAK:Class_ReplaceMethod("MaturityMixin", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MaturityMixinOnUpdate(self, deltaTime)
end
)
local originalNS2MaturityMixinOnProcessMove
originalNS2MaturityMixinOnProcessMove = DAK:Class_ReplaceMethod("MaturityMixin", "OnProcessMove",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MaturityMixinOnProcessMove(self, input)
end
)
local originalNS2FireMixinOnUpdate
originalNS2FireMixinOnUpdate = DAK:Class_ReplaceMethod("FireMixin", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2FireMixinOnUpdate(self, deltaTime)
end
)
local originalNS2FireMixinOnProcessMove
originalNS2FireMixinOnProcessMove = DAK:Class_ReplaceMethod("FireMixin", "OnProcessMove",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2FireMixinOnProcessMove(self, input)
end
)
local originalNS2AlienUpdateAutoHeal
originalNS2AlienUpdateAutoHeal = DAK:Class_ReplaceMethod("Alien", "UpdateAutoHeal",
function(self)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2AlienUpdateAutoHeal(self)
end
)
local originalNS2ClipWeaponOnTag
originalNS2ClipWeaponOnTag = DAK:Class_ReplaceMethod("ClipWeapon", "OnTag",
function(self, tagName)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2ClipWeaponOnTag(self, tagName)
end
)
local originalNS2ClipWeaponOnUpdateAnimationInput
originalNS2ClipWeaponOnUpdateAnimationInput = DAK:Class_ReplaceMethod("ClipWeapon", "OnUpdateAnimationInput",
function(self, modelMixin)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2ClipWeaponOnUpdateAnimationInput(self, modelMixin)
end
)
local originalNS2ARCAcquireTarget
originalNS2ARCAcquireTarget = DAK:Class_ReplaceMethod("ARC", "AcquireTarget",
function(self)
if DAK:GetTournamentMode() and GetIsGamePaused() then
self:SetMode(ARC.kMode.Stationary)
return
end
originalNS2ARCAcquireTarget(self, modelMixin)
end
)
local originalNS2ARCOnTag
originalNS2ARCOnTag = DAK:Class_ReplaceMethod("ARC", "OnTag",
function(self, tagName)
if DAK:GetTournamentMode() and GetIsGamePaused() then
//Force stop to make sure it doesnt constantly fire needlessly
self:SetMode(ARC.kMode.Stationary)
return
end
originalNS2ARCOnTag(self, tagName)
end
)
local originalNS2ArmoryGetShouldResupplyPlayer
originalNS2ArmoryGetShouldResupplyPlayer = DAK:Class_ReplaceMethod("Armory", "GetShouldResupplyPlayer",
function(self, player)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return false
end
return originalNS2ArmoryGetShouldResupplyPlayer(self, player)
end
)
local originalNS2MACOnUpdate
originalNS2MACOnUpdate = DAK:Class_ReplaceMethod("MAC", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MACOnUpdate(self, deltaTime)
end
)
local originalNS2MACProcessConstruct
originalNS2MACProcessConstruct = DAK:Class_ReplaceMethod("MAC", "ProcessConstruct",
function(self, deltaTime, orderTarget, orderLocation)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MACProcessConstruct(self, deltaTime, orderTarget, orderLocation)
end
)
local originalNS2MACProcessWeldOrder
originalNS2MACProcessWeldOrder = DAK:Class_ReplaceMethod("MAC", "ProcessWeldOrder",
function(self, deltaTime, orderTarget, orderLocation)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MACProcessWeldOrder(self, deltaTime, orderTarget, orderLocation)
end
)
local originalNS2MACProcessFollowAndWeldOrder
originalNS2MACProcessFollowAndWeldOrder = DAK:Class_ReplaceMethod("MAC", "ProcessFollowAndWeldOrder",
function(self, deltaTime, orderTarget, orderLocation)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MACProcessFollowAndWeldOrder(self, deltaTime, orderTarget, orderLocation)
end
)
local originalNS2AiAttacksMixinOnTag
originalNS2AiAttacksMixinOnTag = DAK:Class_ReplaceMethod("AiAttacksMixin", "OnTag",
function(self, tagName)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2AiAttacksMixinOnTag(self, tagName)
end
)
local originalNS2MinimapMoveMixinUpdateMove
originalNS2MinimapMoveMixinUpdateMove = DAK:Class_ReplaceMethod("MinimapMoveMixin", "UpdateMove",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2MinimapMoveMixinUpdateMove(self, input)
end
)
local originalNS2PlayerOnProcessMove
originalNS2PlayerOnProcessMove = DAK:Class_ReplaceMethod("Player", "OnProcessMove",
function(self, input)
//if DAK:GetTournamentMode() and GetIsGamePaused() then
//return
//end
originalNS2PlayerOnProcessMove(self, input)
end
)
local originalNS2PlayerOnUpdatePlayer
originalNS2PlayerOnUpdatePlayer = DAK:Class_ReplaceMethod("Player", "OnUpdatePlayer",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2PlayerOnUpdatePlayer(self, deltaTime)
end
)
local originalNS2TeamSpectatorOnProcessMove
originalNS2TeamSpectatorOnProcessMove = DAK:Class_ReplaceMethod("TeamSpectator", "OnProcessMove",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2TeamSpectatorOnProcessMove(self, input)
end
)
local originalNS2TunnelUserMixinOnProcessMove
originalNS2TunnelUserMixinOnProcessMove = DAK:Class_ReplaceMethod("TunnelUserMixin", "OnProcessMove",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2TunnelUserMixinOnProcessMove(self, input)
end
)
local originalNS2TunnelUserMixinOnUpdate
originalNS2TunnelUserMixinOnUpdate = DAK:Class_ReplaceMethod("TunnelUserMixin", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2TunnelUserMixinOnUpdate(self, deltaTime)
end
)
local originalNS2BabblerOnProcessMove
originalNS2BabblerOnProcessMove = DAK:Class_ReplaceMethod("Babbler", "OnProcessMove",
function(self, input)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2BabblerOnProcessMove(self, input)
end
)
local originalNS2BabblerOnUpdate
originalNS2BabblerOnUpdate = DAK:Class_ReplaceMethod("Babbler", "OnUpdate",
function(self, deltaTime)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return
end
originalNS2BabblerOnUpdate(self, deltaTime)
end
)
local originalNS2BabblerOnInitialized
originalNS2BabblerOnInitialized = DAK:Class_ReplaceMethod("Babbler", "OnInitialized",
function(self)
self.adjustedcreationtime = Shared.GetTime()
originalNS2BabblerOnInitialized(self)
end
)
local kBabblerLifeTime = 60 * 5
local originalNS2BabblerTimeUp
originalNS2BabblerTimeUp = DAK:Class_ReplaceMethod("Babbler", "TimeUp",
function(self)
if self.adjustedcreationtime + kBabblerLifeTime <= Shared.GetTime() then
originalNS2BabblerTimeUp(self)
else
self:AddTimedCallback(Babbler.TimeUp, math.max(self.adjustedcreationtime + kBabblerLifeTime - Shared.GetTime() + 0.5, 0.5))
end
end
)
local originalNS2GameRulesGetCountingDown
originalNS2GameRulesGetCountingDown = DAK:Class_ReplaceMethod("NS2Gamerules", "GetCountingDown",
function(self)
if DAK:GetTournamentMode() and GetIsGamePaused() then
return true
else
return originalNS2GameRulesGetCountingDown(self)
end
end
)
end
if DAK.config and DAK.config.loader and DAK.config.loader.GamerulesExtensions then
DAK:RegisterEventHook("OnPluginInitialized", OnPluginInitialized, 5, "pause")
end
local function PausedJoinTeam(self, player, newTeamNumber, force)
if DAK:GetTournamentMode() and GetIsGamePaused() and (newTeamNumber ~= 1 and newTeamNumber ~= 2) then
// send message telling people that they cant do that.
return true
end
end
local function PauseEndGame(self, winningTeam)
gamestate.team1pauses = 0
gamestate.team2pauses = 0
gamestate.team1resume = false
gamestate.team2resume = false
end
DAK:RegisterEventHook("OnGameEnd", PauseEndGame, 5, "pause")
function GetIsGamePaused()
return gamestate.gamepaused
end
//This runs every tick to procedurally update any timerelevant fields of any relevant ents to insure they remain in the appropriate state.
local function UpdateEntStates(deltatime)
local playerRecords = Shared.GetEntitiesWithClassname("Player")
for _, player in ientitylist(playerRecords) do
if player ~= nil then
if not player.countingDown then
player.countingDown = true
player.followMoveEnabled = false
player:PrimaryAttackEnd()
player.cachedorigin = player:GetOrigin()
player.cachedvelocity = player:GetVelocity()
if(player.secondaryAttackLastFrame ~= nil and player.secondaryAttackLastFrame) then
player:SecondaryAttackEnd()
end
end
if player.cachedorigin ~= nil then
player:SetOrigin(player.cachedorigin)
end
if player.cachedvelocity ~= nil then
player:SetVelocity(Vector(0, 0, 0))
end
if player:isa("Embryo") and player.cachedevolveTime ~= nil then
player.evolveTime = player.cachedevolveTime
elseif player:isa("Alien") then
player.timeAbilityEnergyChanged = Shared.GetTime()
elseif player:isa("JetpackMarine") then
player.timeJetpackingChanged = Shared.GetTime()
end
if player.timeLastTunnelCorrodeCheck ~= nil then
player.timeLastTunnelCorrodeCheck = player.timeLastTunnelCorrodeCheck + deltatime
end
end
end
//Update MiniGun heat levels
local Miniguns = Shared.GetEntitiesWithClassname("Minigun")
for _, Minigun in ientitylist(Miniguns) do
if Minigun.cachedheatAmount ~= nil then
Minigun.heatAmount = Minigun.cachedheatAmount
end
end
//Update time based stuff like respawns with difference it times
//Update IPS Spawn Times
local InfantryPortals = Shared.GetEntitiesWithClassname("InfantryPortal")
for _, IP in ientitylist(InfantryPortals) do
if IP.queuedPlayerStartTime ~= nil then
IP.queuedPlayerStartTime = IP.queuedPlayerStartTime + deltatime
end
end
//Update Crag lastheal
//Set lastheal time to basically never occur but always ready to occur next frame if crag had never healed (probably rare, but might as well)
local Crags = Shared.GetEntitiesWithClassname("Crag")
for _, Crag in ientitylist(Crags) do
if Crag.timeOfLastHeal == nil then Crag.timeOfLastHeal = (Shared.GetTime() - Crag.kHealInterval) end
Crag.timeOfLastHeal = Crag.timeOfLastHeal + deltatime
end
//Ok gotta make some decisions here regarding what should be kept alive
//Umbra,Spores,Ink,HealingWave,Bonewall,Scan
local CommanderAbilities = Shared.GetEntitiesWithClassname("CommanderAbility")
for _, CommanderAbility in ientitylist(CommanderAbilities) do
if CommanderAbility.timeCreated == nil then CommanderAbility.timeCreated = Shared.GetTime() end
CommanderAbility.timeCreated = CommanderAbility.timeCreated + deltatime
end
//Meds/Ammo
local DropPacks = Shared.GetEntitiesWithClassname("DropPack")
for _, DropPack in ientitylist(DropPacks) do
if DropPack.adjustedcreationtime == nil then DropPack.adjustedcreationtime = Shared.GetTime() end
DropPack.adjustedcreationtime = DropPack.adjustedcreationtime + deltatime
end
//Babblers
local Babblers = Shared.GetEntitiesWithClassname("Babbler")
for _, Babbler in ientitylist(Babblers) do
if Babbler.adjustedcreationtime == nil then Babbler.adjustedcreationtime = Shared.GetTime() end
Babbler.adjustedcreationtime = Babbler.adjustedcreationtime + deltatime
end
//Grenades
local Grenades = Shared.GetEntitiesWithClassname("Grenade")
for _, grenade in ientitylist(Grenades) do
if not grenade.endOfLife then
grenade.endOfLife = Shared.GetTime() + kGrenadeLifetime
end
grenade.endOfLife = grenade.endOfLife + deltatime
end
//NanoShield
local nanoshieldents = GetEntitiesWithMixin("NanoShieldAble")
for _, nanoshieldent in ipairs(nanoshieldents) do
if nanoshieldent:GetIsNanoShielded() then
nanoshieldent.timeNanoShieldInit = nanoshieldent.timeNanoShieldInit + deltatime
end
end
//Cloaking
local cloakers = GetEntitiesWithMixin("Cloakable")
for _, cloak in ipairs(cloakers) do
if cloak.cachedcloakedFraction then
cloak.cloakedFraction = cloak.cachedcloakedFraction
end
end
//Update anything thats teleporting to block - Echo
local teleportEnts = GetEntitiesWithMixin("TeleportAble")
for _, teleportEnt in ipairs(teleportEnts) do
if teleportEnt.isTeleporting then
teleportEnt.timeUntilPort = teleportEnt.timeUntilPort + deltatime
end
end
//Update Vortex - This could be reallllllllllllllly annoying with the sound and effects if they loop :X:X
local vortexEnts = GetEntitiesWithMixin("VortexAble")
for _, vortexEnt in ipairs(vortexEnts) do
if vortexEnt:GetIsVortexed() then
vortexEnt.remainingVortexDuration = vortexEnt.remainingVortexDuration + deltatime
end
end
//Update Flamedamage init time
local flameableEnts = GetEntitiesWithMixin("Fire")
for _, flameableEnt in ipairs(flameableEnts) do
if flameableEnt.timeBurnInit ~= 0 then
flameableEnt.timeBurnInit = flameableEnt.timeBurnInit + deltatime
end
end
//Stunned - Stomp
local stunnedEnts = GetEntitiesWithMixin("Stun")
for _, stunnedEnt in ipairs(stunnedEnts) do
if stunnedEnt:GetIsStunned() then
stunnedEnt.stunTime = stunnedEnt.stunTime + deltatime
end
end
//Beep beep boom
local Mines = Shared.GetEntitiesWithClassname("Mine")
for _, Mine in ientitylist(Mines) do
Mine.active = false
end
//Hydras
local Hydras = Shared.GetEntitiesWithClassname("Hydra")
for _, hydra in ientitylist(Hydras) do
if hydra.timeOfNextFire ~= nil then
hydra.timeOfNextFire = hydra.timeOfNextFire + deltatime
end
end
//Update DOTS (only BB???) lifetime - MOAR DOTS
local Dots = Shared.GetEntitiesWithClassname("DotMarker")
for _, dot in ientitylist(Dots) do
if dot.adjustedcreationtime == nil then dot.adjustedcreationtime = Shared.GetTime() end
dot.adjustedcreationtime = dot.adjustedcreationtime + deltatime
end
//Infestation
local InfestationEnts = Shared.GetEntitiesWithClassname("Infestation")
for _, inf in ientitylist(InfestationEnts) do
inf.timeCycleStarted = inf.timeCycleStarted + deltatime
end
//Update Lerk Poison Bite, why isnt this a dot?...
local PoisonedMarines = Shared.GetEntitiesWithClassname("Marine")
for _, PM in ientitylist(PoisonedMarines) do
if PM.poisoned then
if PM:GetIsAlive() and PM.timeLastPoisonDamage then
PM.timeLastPoisonDamage = PM.timeLastPoisonDamage + deltatime
PM.timePoisoned = PM.timePoisoned + deltatime
end
end
end
//Updated phase delay to prevent annoying hopping.
local PGs = Shared.GetEntitiesWithClassname("PhaseGate")
for _, PG in ientitylist(PGs) do
if PG.timeOfLastPhase == nil then PG.timeOfLastPhase = (Shared.GetTime() - 0.5) end
PG.timeOfLastPhase = PG.timeOfLastPhase + deltatime
end
//Stop the bacon from spammmming.
local Obs = Shared.GetEntitiesWithClassname("Observatory")
for _, Ob in ientitylist(Obs) do
if Ob.distressBeaconTime ~= nil then
Ob.distressBeaconTime = Ob.distressBeaconTime + deltatime
Ob.distressBeaconSoundMarine:Stop()
Ob.distressBeaconSoundAlien:Stop()
//Dont wanna listen to that noise over and over and over and over and over ..
end
end
//Update dropped guns.
local Weapons = Shared.GetEntitiesWithClassname("Weapon")
for _, Weap in ientitylist(Weapons) do
if Weap.weaponWorldStateTime ~= nil then
Weap.weaponWorldStateTime = Weap.weaponWorldStateTime + deltatime
end
end
end
//This runs when game resumes, should restore any ents whos states were saved initially.
local function ResumeEntStates()
local playerRecords = Shared.GetEntitiesWithClassname("Player")
for _, player in ientitylist(playerRecords) do
if player ~= nil then
player.countingDown = false
player.followMoveEnabled = true
if player.cachedorigin ~= nil then
player:SetOrigin(player.cachedorigin)
end
if player.cachedvelocity ~= nil then
player:SetVelocity(player.cachedvelocity)
end
if player:isa("Embryo") and player.cachedevolveTime ~= nil then
player.evolveTime = player.cachedevolveTime
elseif player:isa("JetpackMarine") then
player.timeJetpackingChanged = Shared.GetTime()
elseif player:isa("Alien") then
player.timeAbilityEnergyChanged = Shared.GetTime()
end
end
end
//Resume the annoying noise
local Obs = Shared.GetEntitiesWithClassname("Observatory")
for _, Ob in ientitylist(Obs) do
if Ob.distressBeaconTime ~= nil then
Ob.distressBeaconSoundMarine:Start()
Ob.distressBeaconSoundAlien:Start()
local origin = Ob:GetDistressOrigin()
Ob.distressBeaconSoundMarine:SetOrigin(origin)
Ob.distressBeaconSoundAlien:SetOrigin(origin)
end
end
//Update MiniGun heat levels
local Miniguns = Shared.GetEntitiesWithClassname("Minigun")
for _, Minigun in ientitylist(Miniguns) do
if Minigun.cachedheatAmount ~= nil then
Minigun.heatAmount = Minigun.cachedheatAmount
Minigun.heatUISound:Start()
Minigun.cachedheatAmount = nil
end
end
//Cloaking
local cloakers = GetEntitiesWithMixin("Cloakable")
for _, cloak in ipairs(cloakers) do
if cloak.cachedcloakedFraction then
cloak.cloakedFraction = cloak.cachedcloakedFraction
end
end
//Beep beep boom
local Mines = Shared.GetEntitiesWithClassname("Mine")
for _, Mine in ientitylist(Mines) do
if Mine.wasactive then
Mine.active = true
else
local activateFunc = function(self)
self.active = true
end
Mine:AddTimedCallback(activateFunc, kMineActiveTime)
end
end
//Update Next Thinks
local CommanderAbilities = Shared.GetEntitiesWithClassname("CommanderAbility")
for _, CommanderAbility in ientitylist(CommanderAbilities) do
CommanderAbility:SetNextThink(math.max(CommanderAbility:GetThinkTime() - (Shared.GetTime() - CommanderAbility.timeCreated), 0.1))
end
end
// This runs when the pause enables, saves the times/states of any ents that cannot be procedurally correctly.
local function SaveEntStates()
//What needs to be blocked - played movement, commander abilities. Researches paused, res income blocked. Cant join spec.
//Commander probably being the only difficult part - may get pretty wierd as there is no known client side effects that block your inputs fully.
//Going to try just blocking techtree actions
//Need to block respawns and eggs
//Also block alien regen and crag heal
//Cache real creation time
local CommanderAbilities = Shared.GetEntitiesWithClassname("CommanderAbility")
for _, CommanderAbility in ientitylist(CommanderAbilities) do
CommanderAbility.timePausedCreated = CommanderAbility.timeCreated
end
//Cache MiniGun heat levels
//Stopppp the retarded sound
local Miniguns = Shared.GetEntitiesWithClassname("Minigun")
for _, Minigun in ientitylist(Miniguns) do
Minigun.cachedheatAmount = Minigun.heatAmount
Minigun.heatUISound:Stop()
end
//Stopppp the duck turrets
local Sentries = Shared.GetEntitiesWithClassname("Sentry")
for _, Sentry in ientitylist(Sentries) do
Sentry.attacking = false
end
//Beep beep boom
local Mines = Shared.GetEntitiesWithClassname("Mine")
for _, Mine in ientitylist(Mines) do
Mine.wasactive = Mine.active
Mine.active = false
end
//Cloaking
local cloakers = GetEntitiesWithMixin("Cloakable")
for _, cloak in ipairs(cloakers) do
cloak.cachedcloakedFraction = cloak.cloakedFraction
end
//Block movement instantly so that its not updated each frame needlessly
local playerRecords = Shared.GetEntitiesWithClassname("Player")
for _, player in ientitylist(playerRecords) do
if player ~= nil then
player:PrimaryAttackEnd()
player:GetActiveWeapon().reloading = false
player.countingDown = true
player.followMoveEnabled = false
player.cachedorigin = player:GetOrigin()
player.cachedvelocity = player:GetVelocity()
if(player.secondaryAttackLastFrame ~= nil and player.secondaryAttackLastFrame) then
player:SecondaryAttackEnd()
end
if player:isa("Embryo") then
player.cachedevolveTime = player.evolveTime
elseif player:isa("JetpackMarine") then
player.timeJetpackingChanged = Shared.GetTime()
elseif player:isa("Alien") then
player.timeAbilityEnergyChanged = Shared.GetTime()
end
end
end
end
local function UpdateServerPauseState(deltatime)
gamestate.gamepausedcountdown = (gamestate.gamepausedcountdown - deltatime)
if gamestate.gamepausedcountdown > 0 then
DAK:DisplayMessageToAllClients("PauseWarningMessage", ConditionalValue(GetIsGamePaused(), "resume", "pause"), (gamestate.gamepausedcountdown))
else
if not GetIsGamePaused() then
SaveEntStates()
DAK:RegisterEventHook("OnServerUpdateEveryFrame", UpdateMoveState, 5, "pause")
DAK:RegisterEventHook("OnTeamJoin", PausedJoinTeam, 5, "pause")
DAK:DisplayMessageToAllClients("PausePausedMessage")
gamestate.gamepausedtime = Shared.GetTime()
Shared.Message("Game Paused.")
else
//Since other event already running, just let the final trigger run there (will be next frame).
Shared.Message("Game Resumed.")
end
DAK:DeregisterEventHook("OnServerUpdate", UpdateServerPauseState)
gamestate.gamepaused = not GetIsGamePaused()
gamestate.gamepausedcountdown = 0
end
end
function RegisterUpdateServerPauseState()
DAK:RegisterEventHook("OnServerUpdate", UpdateServerPauseState, 5, "pause")
end
local function ValidateTeamNumber(teamnum)
return teamnum == 1 or teamnum == 2
end
local function OnCommandPause(client)
if DAK:GetTournamentMode() and client ~= nil and GetGamerules():GetGameStarted() then
local player = client:GetControllingPlayer()
if player ~= nil and not GetIsGamePaused() and gamestate.gamepausedcountdown == 0 then
local teamnumber = player:GetTeamNumber()
if teamnumber and ValidateTeamNumber(teamnumber) then
local validpause = false
if teamnumber == 1 then
if gamestate.team1pauses < DAK.config.pause.kPauseMaxPauses then
gamestate.team1pauses = gamestate.team1pauses + 1
validpause = true
end
else
if gamestate.team2pauses < DAK.config.pause.kPauseMaxPauses then
gamestate.team2pauses = gamestate.team2pauses + 1
validpause = true
end
end
if validpause then
gamestate.team1resume = false
gamestate.team2resume = false
gamestate.gamepausedcountdown = DAK.config.pause.kPauseChangeDelay
gamestate.gamepausingteam = teamnumber
DAK:RegisterEventHook("OnServerUpdate", UpdateServerPauseState, 5, "pause")
DAK:DisplayMessageToAllClients("PausePlayerMessage", player:GetName())
else
DAK:DisplayMessageToClient(client, "PauseTooManyPausesMessage")
end
end
end
end
end
Event.Hook("Console_pause", OnCommandPause)
DAK:RegisterChatCommand(DAK.config.pause.kPauseChatCommands, OnCommandPause, false)
local function OnCommandUnPause(client)
if DAK:GetTournamentMode() and client ~= nil then
local player = client:GetControllingPlayer()
if player ~= nil and GetIsGamePaused() then
local teamnumber = player:GetTeamNumber()
if teamnumber and ValidateTeamNumber(teamnumber) then
if teamnumber == 1 then
gamestate.team1resume = not gamestate.team1resume
else
gamestate.team2resume = not gamestate.team2resume
end
if gamestate.team2resume and not gamestate.team1resume then
DAK:DisplayMessageToAllClients("PauseTeamReadyMessage", player:GetName(), DAK.config.loader.TeamTwoName, DAK.config.loader.TeamOneName)
elseif gamestate.team1resume and not gamestate.team2resume then
DAK:DisplayMessageToAllClients("PauseTeamReadyMessage", player:GetName(), DAK.config.loader.TeamOneName, DAK.config.loader.TeamTwoName)
elseif not gamestate.team1resume and not gamestate.team2resume then
DAK:DisplayMessageToAllClients("PauseNoTeamReadyMessage")
elseif gamestate.gamepausedcountdown == 0 then
DAK:DisplayMessageToAllClients("PauseTeamReadiedMessage", player:GetName(), ConditionalValue(teamnumber == 1,DAK.config.loader.TeamOneName ,DAK.config.loader.TeamTwoName))
DAK:RegisterEventHook("OnServerUpdate", UpdateServerPauseState, 5, "pause")
gamestate.gamepausedcountdown = DAK.config.pause.kPauseChangeDelay
end
end
end
end
end
Event.Hook("Console_unpause", OnCommandUnPause)
DAK:RegisterChatCommand(DAK.config.pause.kUnPauseChatCommands, OnCommandUnPause, false)
local function OnCommandAdminPause(client)
if DAK:GetTournamentMode() and GetGamerules():GetGameStarted() then
if gamestate.gamepausedcountdown == 0 then
DAK:RegisterEventHook("OnServerUpdate", UpdateServerPauseState, 5, "pause")
gamestate.team1resume = false
gamestate.team2resume = false
gamestate.gamepausedcountdown = DAK.config.pause.kPauseChangeDelay
else
DAK:DeregisterEventHook("OnServerUpdate", UpdateServerPauseState)
DAK:DisplayMessageToAllClients("PauseCancelledMessage")
gamestate.gamepausedcountdown = 0
end
DAK:PrintToAllAdmins("sv_pause", client)
ServerAdminPrint(client, "Game " .. ConditionalValue(not GetIsGamePaused(), "pausing.", "unpausing."))
end
end
DAK:CreateServerAdminCommand("Console_sv_pause", OnCommandAdminPause, "Will pause or resume current game.")
|
tests = {"tests/parse.c", "tests/gen.c"}
function gen_tests()
for k, v in pairs(tests) do
b, e = v:find("/[a-z]+");
b=b+1;
name = v:sub(b,e);
print ("generating test", name)
project ("test_" .. name)
kind "ConsoleApp"
language "C"
targetdir "bin"
debugdir "tests"
includedirs "./"
links ("json")
links "m"
files (v)
-- For posix compliant systems
filter "system:linux or bsd or hurd or aix or solaris or haiku or macosx"
defines { "JSON_USE_POSIX" }
links { "m" }
-- For windows
filter "system:windows"
defines { "JSON_USE_WINAPI" }
filter "configurations:Debug"
defines { "DEBUG=1", "RELEASE=0" }
optimize "off"
symbols "on"
filter "configurations:Release"
defines { "DEBUG=0", "RELEASE=1" }
optimize "on"
symbols "off"
buildoptions "-Wall"
end
end
newoption {
trigger = "test",
description = "Build the tests",
}
workspace "jsonparser"
configurations { "Release", "Debug" }
v = "tests/parse.c"
if _OPTIONS["test"] then gen_tests() end
project "json"
kind "StaticLib"
language "C"
targetdir "bin"
debugdir "tests"
links "m"
files { "src/**.h", "src/**.c" }
-- For posix compliant systems
filter "system:linux or bsd or hurd or aix or solaris or haiku or macosx"
defines { "JSON_USE_POSIX" }
links { "m" }
-- For windows
filter "system:windows"
defines { "JSON_USE_WINAPI" }
filter "configurations:Debug"
defines { "DEBUG=1", "RELEASE=0" }
optimize "off"
symbols "on"
filter "configurations:Release"
defines { "DEBUG=0", "RELEASE=1" }
optimize "on"
symbols "off"
buildoptions "-Wall"
|
-- youtube-upnext.lua
--
-- Fetch upnext/recommended videos from youtube
-- This is forked/based on https://github.com/jgreco/mpv-youtube-quality
--
-- Diplays a menu that lets you load the upnext/recommended video from youtube
-- that appear on the right side on the youtube website.
-- If auto_add is set to true (default), the 'up next' video is automatically
-- appended to the current playlist
--
-- Bound to ctrl-u by default.
--
-- Requires wget/wget.exe in PATH. On Windows you may need to set check_certificate
-- to false, otherwise wget.exe might not be able to download the youtube website.
local mp = require 'mp'
local utils = require 'mp.utils'
local msg = require 'mp.msg'
local opts = {
--key bindings
toggle_menu_binding = "ctrl+u",
--auto load and add the "upnext" video to the playlist
auto_add = "",
--other
youtube_url = "https://www.youtube.com/watch?v=%s",
-- Fallback Invidious instance, see https://instances.invidio.us/ for alternatives e.g. https://invidious.snopyta.org
invidious_instance = "https://invidious.xyz",
-- On Windows wget.exe may not be able to check SSL certificates for HTTPS, so you can disable checking here
check_certificate = true,
-- Use a cookies file
-- (Same as youtube-dl --cookies or wget --load-cookies)
-- If you don't set this, the script will try to create a temporary cookies file for you
-- On Windows you need to use a double blackslash or a single fordwardslash
-- For example "C:\\Users\\Username\\cookies.txt"
-- Or "C:/Users/Username/cookies.txt"
-- Alternatively you can set this from the command line with --ytdl-raw-options=cookies=file.txt
cookies = ""
}
(require 'mp.options').read_options(opts, "youtube-upnext")
-- Command line options
if opts.cookies == nil or opts.cookies == "" then
local raw_options = mp.get_property_native("options/ytdl-raw-options")
for param, arg in pairs(raw_options) do
if (param == "cookies") and (arg ~= "") then
opts.cookies = arg
end
end
end
if opts.auto_add == "" then
opts.auto_add = false
end
local upnext_cache={}
local prefered_win_width = nil
local last_dheight = nil
local last_dwidth = nil
local function table_size(t)
local s = 0
for _, _ in ipairs(t) do
s = s+1
end
return s
end
local function exec(args, stdin)
local command = {
name = "subprocess",
playback_only = false,
capture_stdout = true,
detach = false,
args = args,
}
if stdin then command.stdin_data = stdin end
local ret = mp.command_native(command)
return ret.status, ret.stdout, ret
end
local function url_encode(s)
local function repl(x)
return string.format("%%%02X", string.byte(x))
end
return string.gsub(s, "([^0-9a-zA-Z!'()*._~-])", repl)
end
local function download_upnext(url, post_data, notify)
if notify then
mp.commandv("run", "notify-send", " fetching related videos ")
end
local command = {"wget", "-q", "-O", "-"}
if not opts.check_certificate then
table.insert(command, "--no-check-certificate")
end
if post_data then
table.insert(command, "--post-data")
table.insert(command, post_data)
end
if opts.cookies then
table.insert(command, "--load-cookies")
table.insert(command, opts.cookies)
table.insert(command, "--save-cookies")
table.insert(command, opts.cookies)
table.insert(command, "--keep-session-cookies")
end
table.insert(command, url)
local es, s, _ = exec(command, nil)
if (es ~= 0) or (s == nil) or (s == "") then
if es == 5 then
mp.osd_message("upnext failed: wget does not support HTTPS", 10)
msg.error("wget is missing certificates, disable check-certificate in userscript options")
elseif es == -1 or es == 127 or es == 9009 then
mp.osd_message("upnext failed: wget not found", 10)
msg.error("wget/ wget.exe is missing. Please install it or put an executable in your PATH")
else
mp.osd_message("upnext failed: error=" .. tostring(es), 10)
msg.error("failed to get upnext list: error=" .. tostring(es))
end
return "{}"
end
local consent_pos = s:find('action="https://consent.youtube.com/s"')
if consent_pos ~= nil then
-- Accept cookie consent form
msg.debug("Need to accept cookie consent form")
s = s:sub(s:find(">", consent_pos + 1, true), s:find("</form", consent_pos + 1, true))
local post_str = ""
for k, v in string.gmatch(s, "name=\"([^\"]+)\" value=\"([^\"]*)\"") do
msg.debug("name=" .. tostring(k) .. " value=".. tostring(v))
post_str = post_str .. url_encode(k) .. "=" .. url_encode(v) .. "&"
end
msg.debug("post-data=" .. tostring(post_str))
if opts.cookies == nil or opts.cookies == "" then
local temp_dir = os.getenv("TEMP")
if temp_dir == nil or temp_dir == "" then
temp_dir = os.getenv("XDG_RUNTIME_DIR")
end
if temp_dir == nil or temp_dir == "" then
opts.cookies = os.tmpname()
else
opts.cookies = temp_dir .. "/youtube-upnext.cookies"
end
msg.warn("Created a cookies jar file at \"" .. tostring(opts.cookies) ..
"\". To hide this warning, set a cookies file in the script configuration")
end
return download_upnext("https://consent.youtube.com/s", post_str, false)
end
local pos1 = string.find(s, "ytInitialData =", 1, true)
if pos1 == nil then
mp.osd_message("upnext failed, no upnext data found err01", 10)
msg.error("failed to find json position 01: pos1=nil")
return "{}"
end
local pos2 = string.find(s, ";%s*</script>", pos1 + 1)
if pos2 ~= nil then
s = string.sub(s, pos1 + 15, pos2 - 1)
return s
else
msg.error("failed to find json position 02")
end
mp.osd_message("upnext failed, no upnext data found err03", 10)
msg.error("failed to get upnext data: pos1=" .. tostring(pos1) .. " pos2=" ..tostring(pos2))
return "{}"
end
local function get_invidious(url)
-- convert to invidious API call
url = string.gsub(url, "https://youtube%.com/watch%?v=", opts.invidious_instance .. "/api/v1/videos/")
url = string.gsub(url, "https://www%.youtube%.com/watch%?v=", opts.invidious_instance .. "/api/v1/videos/")
url = string.gsub(url, "https://youtu%.be/", opts.invidious_instance .. "/api/v1/videos/")
msg.debug("Invidious url:" .. url)
local command = {"wget", "-q", "-O", "-"}
if not opts.check_certificate then
table.insert(command, "--no-check-certificate")
end
table.insert(command, url)
local es, s, _ = exec(command, nil)
if (es ~= 0) or (s == nil) or (s == "") then
if es == 5 then
mp.osd_message("upnext failed: wget does not support HTTPS", 10)
msg.error("wget is missing certificates, disable check-certificate in userscript options")
elseif es == -1 or es == 127 or es == 9009 then
mp.osd_message("upnext failed: wget not found", 10)
msg.error("wget/ wget.exe is missing. Please install it or put an executable in your PATH")
else
mp.osd_message("upnext failed: error=" .. tostring(es), 10)
msg.error("failed to get invidious: error=" .. tostring(es))
end
return {}
end
local data, err = utils.parse_json(s)
if data == nil then
mp.osd_message("upnext fetch failed (Invidious): JSON decode failed", 10)
msg.error("parse_json failed (Invidious): " .. err)
return {}
end
if data.recommendedVideos then
local res = {}
msg.verbose("wget and json decode succeeded! (Invidious)")
for i, v in ipairs(data.recommendedVideos) do
table.insert(res, {
index=i,
label=v.title .. " - " .. v.author,
file=string.format(opts.youtube_url, v.videoId)
})
end
mp.osd_message("upnext fetch from Invidious succeeded", 10)
return res
elseif data.error then
mp.osd_message("upnext fetch failed (Invidious): " .. data.error, 10)
msg.error("Invidious error: " .. data.error)
else
mp.osd_message("upnext: No recommended videos! (Invidious)", 10)
msg.error("No recommended videos! (Invidious)")
end
return {}
end
local function parse_upnext(json_str, current_video_url)
if json_str == "{}" then
return {}, 0
end
local data, err = utils.parse_json(json_str)
if data == nil then
mp.osd_message("upnext failed: JSON decode failed", 10)
msg.error("parse_json failed: " .. tostring(err))
msg.debug("Corrupted JSON:\n" .. json_str .. "\n")
return {}, 0
end
local res = {}
msg.verbose("wget and json decode succeeded!")
local index = 1
local autoplay_id = nil
if data.playerOverlays
and data.playerOverlays.playerOverlayRenderer
and data.playerOverlays.playerOverlayRenderer.autoplay
and data.playerOverlays.playerOverlayRenderer.autoplay.playerOverlayAutoplayRenderer then
local title = data.playerOverlays.playerOverlayRenderer.autoplay.playerOverlayAutoplayRenderer.videoTitle.simpleText
local video_id = data.playerOverlays.playerOverlayRenderer.autoplay.playerOverlayAutoplayRenderer.videoId
autoplay_id = video_id
msg.debug("Found autoplay video")
table.insert(res, {
index=index,
label=title,
file=string.format(opts.youtube_url, video_id)
})
index = index + 1
end
if data.playerOverlays
and data.playerOverlays.playerOverlayRenderer
and data.playerOverlays.playerOverlayRenderer.endScreen
and data.playerOverlays.playerOverlayRenderer.endScreen.watchNextEndScreenRenderer
and data.playerOverlays.playerOverlayRenderer.endScreen.watchNextEndScreenRenderer.results
then
local n = table_size(data.playerOverlays.playerOverlayRenderer.endScreen.watchNextEndScreenRenderer.results)
msg.debug("Found " .. tostring(n) .. " endScreen videos")
for i, v in ipairs(data.playerOverlays.playerOverlayRenderer.endScreen.watchNextEndScreenRenderer.results) do
if v.endScreenVideoRenderer
and v.endScreenVideoRenderer.title
and v.endScreenVideoRenderer.title.simpleText then
local title = v.endScreenVideoRenderer.title.simpleText
local video_id = v.endScreenVideoRenderer.videoId
if video_id ~= autoplay_id then
table.insert(res, {
index=index + i,
label=title,
file=string.format(opts.youtube_url, video_id)
})
end
end
end
index = index + n
end
if data.contents
and data.contents.twoColumnWatchNextResults
and data.contents.twoColumnWatchNextResults.secondaryResults
then
local secondaryResults = data.contents.twoColumnWatchNextResults.secondaryResults
if secondaryResults.secondaryResults then
secondaryResults = secondaryResults.secondaryResults
end
local n = table_size(secondaryResults.results)
msg.debug("Found " .. tostring(n) .. " watchNextResults videos")
for i, v in ipairs(secondaryResults.results) do
local compactVideoRenderer = nil
local watchnextindex = index
if v.compactAutoplayRenderer
and v.compactAutoplayRenderer
and v.compactAutoplayRenderer.contents
and v.compactAutoplayRenderer.contents.compactVideoRenderer then
compactVideoRenderer = v.compactAutoplayRenderer.contents.compactVideoRenderer
watchnextindex = 0
elseif v.compactVideoRenderer then
compactVideoRenderer = v.compactVideoRenderer
end
if compactVideoRenderer
and compactVideoRenderer.videoId
and compactVideoRenderer.title
and compactVideoRenderer.title.simpleText
then
local title = compactVideoRenderer.title.simpleText
local video_id = compactVideoRenderer.videoId
local video_url = string.format(opts.youtube_url, video_id)
local duplicate = false
for _, entry in ipairs(res) do
if video_url == entry.file then
duplicate = true
end
end
if not duplicate then
table.insert(res, {
index=watchnextindex + i,
label=title,
file=video_url
})
end
end
end
end
table.sort(res, function(a, b) return a.index < b.index end)
upnext_cache[current_video_url] = res
return res, table_size(res)
end
local function load_upnext(notify)
local url = mp.get_property("path")
url = string.gsub(url, "ytdl://", "") -- Strip possible ytdl:// prefix.
if string.find(url, "//youtu.be/") == nil
and string.find(url, "//www.youtube.co.uk/") == nil
and string.find(url, "//youtube.com/") == nil
and string.find(url, "//www.youtube.com/") == nil
then
return {}, 0
end
-- don't fetch the website if it's already cached
if upnext_cache[url] ~= nil then
local res = upnext_cache[url]
return res, table_size(res)
end
local res, n = parse_upnext(download_upnext(url, nil, notify), url)
-- Fallback to Invidious API
if n == 0 and opts.invidious_instance and opts.invidious_instance ~= "" then
res = get_invidious(url)
n = table_size(res)
end
return res, n
end
local function on_file_loaded(_)
local url = mp.get_property("path")
url = string.gsub(url, "ytdl://", "") -- Strip possible ytdl:// prefix.
if string.find(url, "youtu") ~= nil then
local upnext, num_upnext = load_upnext(false)
if num_upnext > 0 then
mp.commandv("loadfile", upnext[1].file, "append")
end
end
end
local function show_menu()
local upnext, num_upnext = load_upnext(true)
if num_upnext == 0 then
return
end
mp.osd_message("", 1)
local choiceTable = {}
for i,v in ipairs(upnext) do
choiceTable[i] = v.label.."\n"
end
local choices = table.concat(choiceTable)
local command = {
"dmenu-dwm",
"-l",
"12",
"-p",
"___ Select related video: "
}
local es, choice, _ = exec(command, choices)
local selected = -1
for k,v in pairs(choiceTable) do
if v == choice then
selected = k
break
end
end
if(selected == -1) then
return
end
if opts.auto_add then
mp.commandv("loadfile", upnext[selected].file, "replace")
else
mp.commandv("run",
"mpv",
"--ytdl-raw-options-append=cookies-from-browser=firefox",
"--script-opts=youtube-upnext-auto_add=true,dmenu-playlist-music_osc=true",
"--loop-file=no",
upnext[selected].file)
end
return
end
-- register script message to show menu
mp.register_script_message("toggle-upnext-menu",
function()
show_menu()
end)
-- keybind to launch menu
mp.add_key_binding(opts.toggle_menu_binding, "upnext-menu", show_menu)
if opts.auto_add then
mp.register_event("file-loaded", on_file_loaded)
end
|
-- Copyright 2015 Alex Browne. All rights reserved.
-- Use of this source code is governed by the MIT
-- license, which can be found in the LICENSE file.
-- get_jobs_by_ids is a lua script that takes the following arguments:
-- 1) The key of a sorted set of some job ids
-- The script then gets all the data for those job ids from their respective
-- hashes in the database. It returns an array of arrays where each element
-- contains the fields for a particular job, and the jobs are sorted by
-- priority.
-- Here's an example response:
-- [
-- [
-- "id", "afj9afjpa30",
-- "data", [34, 67, 34, 23, 56, 67, 78, 79],
-- "type", "emailJob",
-- "time", 1234567,
-- "freq", 0,
-- "priority", 100,
-- "retries", 0,
-- "status", "executing",
-- "started", 0,
-- "finished", 0,
-- ],
-- [
-- "id", "E8v2ovkdaIw",
-- "data", [46, 43, 12, 08, 34, 45, 57, 43],
-- "type", "emailJob",
-- "time", 1234568,
-- "freq", 0,
-- "priority", 95,
-- "retries", 0,
-- "status", "executing",
-- "started", 0,
-- "finished", 0,
-- ]
-- ]
-- IMPORTANT: If you edit this file, you must run go generate . to rewrite ../scripts.go
-- Assign keys to variables for easy access
local setKey = ARGV[1]
-- Get all the ids from the set name
local jobIds = redis.call('ZREVRANGE', setKey, 0, -1)
local allJobs = {}
if #jobIds > 0 then
-- Iterate over the ids and find each job
for i, jobId in ipairs(jobIds) do
local jobKey = 'jobs:' .. jobId
local jobFields = redis.call('HGETALL', jobKey)
-- Add the id itself to the fields
jobFields[#jobFields+1] = 'id'
jobFields[#jobFields+1] = jobId
-- Add the field values to allJobs
allJobs[#allJobs+1] = jobFields
end
end
return allJobs
|
local ball = dxCreateTexture("items/coloredprojectiles/texture.png")
function attachMarkerToProjectile()
for _, proj in ipairs(getElementsByType("projectile")) do
local color = getElementData(proj,"color")
if color then
local x,y,z = getElementPosition(proj)
setCoronaPosition(color[1],x,y,z)
setCoronaPosition(color[2],x,y,z)
end
end
end
addEventHandler("onClientPreRender",root,attachMarkerToProjectile)
function setProjectileColour(creator)
if creator and getElementType(creator) == "vehicle" then
local creator = getVehicleOccupant( creator )
local gcProjectileColor = getElementData(creator,"gc_projectilecolor")
if gcProjectileColor and type(gcProjectileColor) == "string" then
local r,g,b = hex2rgb(gcProjectileColor)
local x,y,z = getElementPosition(source)
local texture = createMaterialCorona(ball,x,y,z,0.8,r,g,b,40)
local marker = createCorona(x,y,z,5,r,g,b,50)
local t = {texture,marker}
setElementData(source,"color",t,false)
end
end
end
addEventHandler("onClientProjectileCreation",root,setProjectileColour)
function removeProjectileColour()
if source and getElementType(source) == "projectile" then
local colorElement = getElementData(source,"color")
if colorElement then
destroyCorona(colorElement[1])
destroyCorona(colorElement[2])
end
end
end
addEventHandler("onClientElementDestroy",root,removeProjectileColour)
function hex2rgb(hex)
hex = hex:gsub("#","")
return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6))
end
|
function Initialize()
discColor1 = SKIN:GetVariable("DiscColor1")
discColor2 = SKIN:GetVariable("DiscColor2")
name1 = SKIN:GetVariable("DiscName1")
name2 = SKIN:GetVariable("DiscName2")
col = SKIN:GetVariable("BoardCol") + 0
row = SKIN:GetVariable("BoardRow") + 0
spacing = SKIN:GetVariable("DiscSpacing") + 0
discRadius = SKIN:GetVariable("DiscRadius") + 0
dropHeight = SKIN:GetVariable("DropHeight") + 0
size = col * row
game = {}
for i=1, col do
game[i] = {}
for j=1, row do
game[i][j] = 0
end
end
gameEnded = false
currentDiscIndex = 0
-- Turn 1 = Player 1, Turn 2 = Player 2
currentTurn = 1
currentDiscMeter = nil
currentDiscMeterName = ""
gravity = 1000
velocity = 0
endY = 0
dt = 0
prevTime = os.clock()
lastX = 0
lastY = 0
end
function Update()
dt = (os.clock() - prevTime)
prevTime = os.clock()
UpdateCurrentDisc()
end
function UpdateCurrentDisc()
if currentDiscMeter ~= nil then
if velocity >= 0 and currentDiscMeter:GetY() >= endY then
if velocity <= 50 then
velocity = 0
currentDiscMeter:SetY(endY)
currentDiscMeter = nil
UpdateRedraw(currentDiscMeterName)
CheckWin()
return
else
velocity = -velocity / 3
end
end
velocity = velocity + gravity * dt
currentDiscMeter:SetY(currentDiscMeter:GetY() + velocity * dt)
UpdateRedraw(currentDiscMeterName)
end
end
function FinishCurrentDisc()
if (currentDiscMeter ~= nil) then
velocity = 0
currentDiscMeter:SetY(endY)
UpdateCurrentDisc()
end
end
function DropDisc(column)
if currentDiscIndex + 1 > size then return end
-- Calc drop Y
local canDrop = false
local indexY = 0
for i,v in ipairs(game[column]) do
if v ~= 0 and i-1 >= 1 then
canDrop = true
game[column][i-1] = currentTurn
indexY = i-1
break
elseif i >= row then
canDrop = true
game[column][i] = currentTurn
indexY = i
break
end
end
if not canDrop then return end
if currentDiscMeter ~= nil then
FinishCurrentDisc()
end
if gameEnded then return end
currentDiscIndex = currentDiscIndex + 1
currentDiscMeterName = "Disc" .. currentDiscIndex
currentDiscMeter = SKIN:GetMeter(currentDiscMeterName)
SKIN:Bang("!SetOption", currentDiscMeterName, "Hidden", "0")
if currentTurn == 1 then
SKIN:Bang("!SetOption", currentDiscMeterName, "DiscColor", "Fill Color " .. discColor1)
SetGhostColor(discColor2 .. ',80')
elseif currentTurn == 2 then
SKIN:Bang("!SetOption", currentDiscMeterName, "DiscColor", "Fill Color " .. discColor2)
SetGhostColor(discColor1 .. ',80')
end
UpdateRedraw(currentDiscMeterName)
-- There's a weird bug that says this variable is nil, eventhough i had assigned it above
currentDiscMeter = SKIN:GetMeter(currentDiscMeterName)
currentDiscMeter:SetX((column - 1) * discRadius * 2 + column * spacing)
currentDiscMeter:SetY(0)
endY = dropHeight + (indexY - 1) * discRadius * 2 + indexY * spacing
lastX = column
lastY = indexY
SwitchTurn()
end
function UpdateRedraw(meterName)
SKIN:Bang("!UpdateMeter", meterName)
-- SKIN:Bang("!Redraw")
end
function SwitchTurn()
if currentTurn == 1 then
currentTurn = 2
SetTurnText(name2 .. "'s turn")
elseif currentTurn == 2 then
currentTurn = 1
SetTurnText(name1 .. "'s turn")
end
end
function CheckWin()
if lastX < 1 or lastY < 1 or lastX > col or lastY > row then return end
local playerNum = game[lastX][lastY]
local count = 1
local winned = false
local matchCallback = function()
count = count + 1
end
local win = function()
if count >= 4 then winned = true end
count = 1
end
-- Check horizontal |
CheckDisc(lastX, lastY, playerNum, "l", matchCallback)
CheckDisc(lastX, lastY, playerNum, "r", matchCallback)
win()
-- Check vertical -
CheckDisc(lastX, lastY, playerNum, "t", matchCallback)
CheckDisc(lastX, lastY, playerNum, "b", matchCallback)
win()
-- Check left diagonal \
CheckDisc(lastX, lastY, playerNum, "tl", matchCallback)
CheckDisc(lastX, lastY, playerNum, "br", matchCallback)
win()
-- Check right diagonal /
CheckDisc(lastX, lastY, playerNum, "tr", matchCallback)
CheckDisc(lastX, lastY, playerNum, "bl", matchCallback)
win()
if winned then
gameEnded = true
if playerNum == 1 then
SetWinText(name1 .. " wins")
elseif playerNum == 2 then
SetWinText(name2 .. " wins")
end
end
end
function CheckDisc(x, y, playerNum, direction, callback)
if direction == "t" and y-1 >= 1 then
if game[x][y-1] == playerNum then
callback()
CheckDisc(x, y-1, playerNum, direction, callback)
end
elseif direction == "b" and y+1 <= row then
if game[x][y+1] == playerNum then
callback()
CheckDisc(x, y+1, playerNum, direction, callback)
end
elseif direction == "l" and x-1 >= 1 then
if game[x-1][y] == playerNum then
callback()
CheckDisc(x-1, y, playerNum, direction, callback)
end
elseif direction == "r" and x+1 <= col then
if game[x+1][y] == playerNum then
callback()
CheckDisc(x+1, y, playerNum, direction, callback)
end
elseif direction == "tl" and y-1 >= 1 and x-1 >= 1 then
if game[x-1][y-1] == playerNum then
callback()
CheckDisc(x-1, y-1, playerNum, direction, callback)
end
elseif direction == "tr" and y-1 >= 1 and x+1 <= col then
if game[x+1][y-1] == playerNum then
callback()
CheckDisc(x+1, y-1, playerNum, direction, callback)
end
elseif direction == "bl" and y+1 <= row and x-1 >= 1 then
if game[x-1][y+1] == playerNum then
callback()
CheckDisc(x-1, y+1, playerNum, direction, callback)
end
elseif direction == "br" and y+1 <= row and x+1 <= col then
if game[x+1][y+1] == playerNum then
callback()
CheckDisc(x+1, y+1, playerNum, direction, callback)
end
end
end
function SetGhostColor(color)
SKIN:Bang("!SetOptionGroup", "DiscGhostGroup", "DiscColor", "Fill Color " .. color)
SKIN:Bang("!UpdateMeterGroup", "DiscGhostGroup")
SKIN:Bang("Redraw")
end
function SetTurnText(text)
SKIN:Bang("!SetOption", "PlayerTurn", "Text", text)
SKIN:Bang("!UpdateMeter", "PlayerTurn")
SKIN:Bang("Redraw")
end
function SetWinText(text)
SKIN:Bang("!SetOption", "PlayerTurn", "Text", text)
SKIN:Bang("!UpdateMeter", "PlayerTurn")
SKIN:Bang("Redraw")
end
|
-- some material utils
function GetBillBoardMat (texpath,bAdditive) return GetTexturedMat(bAdditive and "billboard_add_base" or "billboard_base",texpath) end
gTexturedMatCache = {}
function GetTexturedMat (base,texpath)
local cachename = base.."#"..texpath
local cache = gTexturedMatCache[cachename]
if (cache) then return cache end
cache = CloneMaterial(base)
SetTexture(cache,texpath,0,0,0)
--~ SetTexture(cache,texpath,0,0,1)
--~ SetTexture(cache,texpath,0,0,2)
gTexturedMatCache[cachename] = cache
return cache
end
-- cubic material for skyboxes
gCubicTexturedMatCache = {}
function GetCubicTexturedMat (base,texpath,bForUVW)
local cachename = base.."#"..texpath..(bForUVW and "#uvw" or "#uv")
local cache = gCubicTexturedMatCache[cachename]
if (cache) then return cache end
cache = CloneMaterial(base)
if (not bForUVW) then bForUVW = false end
local pMat = MaterialManager_load(cache) assert(pMat)
local pTec = pMat:getTechnique(0) assert(pTec)
local pPas = pTec:getPass(0) assert(pPas)
local pTex = pPas:getTextureUnitState(0) assert(pTex)
pTex:setCubicTextureName(texpath,bForUVW)
gCubicTexturedMatCache[cachename] = cache
return cache
end
gPlainTextureMatCache = {}
function GetPlainTextureMat (texpath,bHasAlpha)
local cache = gPlainTextureMatCache[texpath]
if (cache) then return cache end
cache = CloneMaterial("plaincolor_base")
SetTexture(cache,texpath)
gPlainTextureMatCache[texpath] = cache
if (bHasAlpha) then
SetSceneBlend(cache,0,0,1)
SetDepthWriteEnabled(cache,0,0,1)
end
return cache
end
function GetPlainWhiteMat () return GetPlainColourMat(1,1,1) end
function GetPlainColourMat (r,g,b,a) return GetHuedMat("plaincolor_base",r,g,b,r,g,b,a) end
-- makes a copy of a material and changes color by setting ambient and diffuse colors
-- paramters : basematname, ambient-rgb, diffuse-rgba,
-- diffuse defaults to ambient if not given, diffuse-alpha defaults to 1
gHuedMatCache = {}
function GetHuedMat (basematname, ar,ag,ab, dr,dg,db,da, texpath)
dr = dr or ar
dg = dg or ag
db = db or ab
da = da or 1
local name = sprintf("%s__%f_%f_%f__%f_%f_%f_%f_%s",basematname,ar,ag,ab, dr,dg,db,da,texpath and texpath or "")
local cache = gHuedMatCache[name]
if (cache) then return cache end
cache = CloneMaterial(basematname)
if (texpath) then SetTexture(cache,texpath,0,0,0) end
SetAmbient(cache,0,0,ar,ag,ab)
SetDiffuse(cache,0,0,dr,dg,db,da)
if (da ~= 1) then SetSceneBlend(cache,0,0,1) end
if (da ~= 1) then SetDepthWriteEnabled(cache,0,0,0) end
gHuedMatCache[name] = cache
return cache
end
-- todo : place me in meshutils or something like that ?
function HueMeshEntity (gfx, ar,ag,ab, dr,dg,db,da)
local subcount = gfx:GetMeshSubEntityCount()
for i = 0,subcount-1 do gfx:SetMeshSubEntityMaterial(i,GetHuedMat(gfx:GetMeshSubEntityMaterial(i), ar,ag,ab, dr,dg,db,da)) end
end
-- todo : generic guimat(bAlpha) from texture, 3dmat from texture
|
local o={}
function o:OnActivate()
self.time=0;
self.origin = TransformBus.Event.GetWorldTranslation(self.entityId);
self.origin.x=502
self.origin.y=553
self.origin.z=41
self.tickBusHandler = TickBus.Connect(self);
self.tah= TriggerAreaNotificationBus.Connect(self,self.entityId);
self.radius = SphereShapeComponentRequestsBus.Event.GetRadius(self.entityId);
end
function o:OnTriggerAreaEntered(entityId)
Debug.Log("OnTriggerAreaEntered");
end
function o:OnTriggerAreaExited(entityId)
Debug.Log("OnTriggerAreaExited");
end
function o:OnTick(deltaTime, timePoint)
if not self.initDone then
Debug.Log("Units present in the game are:")
local tags=vector_Crc32();
tags:push_back(Crc32("unit"));
local units=GameManagerRequestBus.Broadcast.GetEntitiesHavingTags(tags);
--units=GameManagerRequestBus.Broadcast.GetEntitiesHavingTag(Crc32("unit")) in this case would do the same
if(#units>0) then
for i=1, #units do
Debug.Log("unit "..i..":"..tostring(units[i]))
end
self.initDone=true
end
end
local pos= TransformBus.Event.GetWorldTranslation(self.entityId);
local radius=self.radius*(1+math.cos(self.time * 0.3));
SphereShapeComponentRequestsBus.Event.SetRadius(self.entityId,radius);
pos.y = self.origin.y + math.cos( self.time )*15;
pos.x = self.origin.x + math.sin( self.time )*15;
TransformBus.Event.SetWorldTranslation(self.entityId,pos);
self.time = self.time+deltaTime
local units=GameManagerRequestBus.Broadcast.GetUnitsInsideSphere(pos , radius);
if(#units>0) then
Debug.Log("GetUnitsInsideSphere returned:")
for i=1, #units do
Debug.Log("unit "..i..":"..tostring(units[i]))
end
end
units=TriggerAreaRequestsBus.Event.GetEntitiesInside(self.entityId);
if(#units>0) then
Debug.Log("GetEntitiesInside returned:")
for i=1, #units do
Debug.Log("unit "..i..":"..tostring(units[i]))
end
end
local on=0;
if(#units>0) then on=1 end
LightComponentRequestBus.Event.SetState(self.entityId,on);
end
return o;
|
--!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-2020, TBOOX Open Source Group.
--
-- @author ruki
-- @file list.lua
--
-- imports
import("core.project.project")
import("core.base.task")
import("impl.package")
import("impl.repository")
import("impl.environment")
-- from xmake/system/remote?
function _from(instance)
local fetchinfo = instance:fetch()
if fetchinfo then
if instance:is3rd() then
return ", ${green}3rd${clear}"
elseif instance:isSys() then
return ", ${green}system${clear}"
else
return ""
end
elseif #instance:urls() > 0 then
return instance:supported() and format(", ${yellow}remote${clear}(in %s)", instance:repo():name()) or format(", ${yellow}remote${clear}(${red}unsupported${clear} in %s)", instance:repo():name())
elseif instance:isSys() then
return ", ${red}missing${clear}"
else
return ""
end
end
-- get package info
function _info(instance)
local info = instance:version_str() and instance:version_str() or "no version"
info = info .. _from(instance)
info = info .. (instance:optional() and ", ${yellow}optional${clear}" or "")
return info
end
-- list packages
function main()
-- list all requires
print("The package dependencies of project:")
-- get requires
local requires, requires_extra = project.requires_str()
if not requires or #requires == 0 then
return
end
-- enter environment
environment.enter()
-- pull all repositories first if not exists
if not repository.pulled() then
task.run("repo", {update = true})
end
-- list all required packages
for _, instance in ipairs(package.load_packages(requires, {requires_extra = requires_extra})) do
cprint(" ${magenta}require${clear}(%s): %s", instance:requireinfo().originstr, _info(instance))
for _, dep in ipairs(instance:orderdeps()) do
cprint(" -> ${magenta}dep${clear}(%s): %s", dep:requireinfo().originstr, _info(dep))
end
local fetchinfo = instance:fetch()
if fetchinfo then
for name, info in pairs(fetchinfo) do
cprint(" -> ${magenta}%s${clear}: %s", name, table.concat(table.wrap(info), " "))
end
end
end
-- leave environment
environment.leave()
end
|
local log = require('utils.log')
local config = require('definitions.config')
local format = require('utils.format')
local fx = require('library.fx')
local io = require('definitions.io')
local custom_actions = {
move = require('custom_actions.movement'),
select = require('custom_actions.selection')
}
function custom_actions.clearTimeSelection()
local current_position = reaper.GetCursorPosition()
reaper.GetSet_LoopTimeRange(true, false, current_position, current_position, false)
end
function getUserGridDivisionInput()
local _, num_string = reaper.GetUserInputs("Set Grid Division", 1, "Fraction/Number", "")
local first_num = num_string:match("[0-9.]+")
local divider = num_string:match("/([0-9.]+)")
local division = nil
if first_num and divider then
division = first_num / divider
elseif first_num then
division = first_num
else
log.error("Could not parse specified grid division.")
return nil
end
return division
end
function custom_actions.setMidiGridDivision()
local division = getUserGridDivisionInput()
if division then
reaper.SetMIDIEditorGrid(0, division)
end
end
function custom_actions.clearSelectedTimeline()
local current_position = reaper.GetCursorPosition()
reaper.GetSet_LoopTimeRange(true, false, current_position, current_position, false)
end
function custom_actions.setGridDivision()
local division = getUserGridDivisionInput()
if division then
reaper.SetProjectGrid(0, division)
end
end
-- this one avoids splitting all items across tracks in time selection, if no items are selected
function custom_actions.splitItemsAtTimeSelection()
if reaper.CountSelectedMediaItems(0) == 0 then
return
end
local SplitAtTimeSelection = 40061
reaper.Main_OnCommand(SplitAtTimeSelection, 0)
end
function custom_actions.updatePrefixOfSelectedTracks() trackUpdateName(1) end
function custom_actions.updateNameOfSelectedTracks() trackUpdateName(0) end
-- mv to util/track.lua
function trackUpdateName(set_prefix)
log.clear()
local num_sel = reaper.CountSelectedTracks(0)
local _, new_name_string = reaper.GetUserInputs("Change track name", 1, "Track name:", "")
if num_sel == 0 then return end
if num_sel > 0 then
for i = 1, num_sel do
local tr = reaper.GetSelectedTrack(0, i - 1)
local ret, old_name_full = reaper.GetTrackName(tr)
local s, e = string.find(old_name_full, config.name_prefix_match_str)
if s == nil then s = 0; e = 0 end
local old_prefix = string.sub(old_name_full, s, e)
local old_name = string.sub(old_name_full, e + 1)
local new_name_full
if set_prefix == 1 then
new_name_full = new_name_string .. old_name
else
new_name_full = old_prefix .. new_name_string
end
local _, str = reaper.GetSetMediaTrackInfo_String(tr, "P_NAME", new_name_full, 1);
end
return
end
end
function updateMidiPreProcessorByInputDevice(tr)
local tr_rec_in = reaper.GetMediaTrackInfo_Value(tr, 'I_RECINPUT')
local midi_device_offset = 4096
local device_mask = 2016
local dev_id = ((tr_rec_in - midi_device_offset) & device_mask) >> 5
local retval, nameout = reaper.GetMIDIInputName( dev_id, '' )
local enabled_device
for k,device_str in pairs(io.midi) do
if nameout:lower():match(device_str:lower()) then enabled_device = device_str end
end
if enabled_device == nil then return end
if enabled_device == io.midi.vkb then
fx.setParamForFxAtIndex(tr, 0, 1, 0, true) -- set device
fx.setParamForFxAtIndex(tr, 0, 2, 0, true) -- set mode
end
if enabled_device == io.midi.qmk then
fx.setParamForFxAtIndex(tr, 0, 1, 1, true) -- set device
fx.setParamForFxAtIndex(tr, 0, 2, 1, true) -- set mode
end
if enabled_device == io.midi.roland then
fx.setParamForFxAtIndex(tr, 0, 1, 2, true) -- set device
fx.setParamForFxAtIndex(tr, 0, 2, 6, true) -- set mode
end
end
function custom_actions.setupMidiInputPreProcessorOnSelTrks()
for i = 1, reaper.CountSelectedTracks(0) do
local tr = reaper.GetSelectedTrack(0,i-1)
local _, name = reaper.GetTrackName(tr, "")
local zeroth_idx_name = fx.getSetTrackFxNameByFxChainIndex(tr, 0, true) -- TODO rec fx
if zeroth_idx_name == 'RK_MIDI_PRE_PROCESSOR' then
updateMidiPreProcessorByInputDevice(tr)
else
local fx_str = 'midi-rec-pre.jsfx' -- INSERT MIDI PRE PROCESSOR JSFX
fx.insertFxAtIndex(tr, fx_str, 0, true)
fx.getSetTrackFxNameByFxChainIndex(tr,0, true, 'RK_MIDI_PRE_PROCESSOR')
updateMidiPreProcessorByInputDevice(tr)
end
end
end
function custom_actions.sidechainCompTracks(key_track_name)
-- check if not `FX_SC_GKICK` exists
-- add last fx
-- create recieve for sel track
-- from ghost 1/2 into 3/4
end
return custom_actions
|
return {
setup = {
"terryma/vim-expand-region", -- + to expand, _ to shrink
"unblevable/quick-scope", -- highlights f, t, F, T
"justinmk/vim-sneak", -- s, S to jump anywhere
},
install = {
"vim-scripts/ReplaceWithRegister", -- {Visual}["x]gr - replace {Visual} with register x
"tpope/vim-repeat", -- better repetition
"christoomey/vim-titlecase", -- gzz
"christoomey/vim-sort-motion", -- gs<motion> eg. gs2j => sort 3 lines
"tpope/vim-surround", -- s is motion, ys to add
-- "michaeljsmith/vim-indent-object", -- ai, ii, aI, iI: object of same indent (i; above, a; above and below)
-- "PeterRincker/vim-argumentative",
"wellle/targets.vim", -- 2i, 2a for more inner and outer selection
},
}
|
require('packer').use {
'FixCursorHold.nvim',
event = { "BufRead", "BufNewFile" },
config = function()
vim.g.cursorhold_updatetime = 100
end
}
|
local pathes = defs.pathes.sprites
local names = defs.names.sprites
data:extend({
{
type = "sprite",
name = names.questionmark_white,
filename = pathes.questionmark_white,
priority = "high",
width = 64,
height = 64,
scale = 0.5,
},
{
type = "sprite",
name = names.ignore_white,
filename = pathes.ignore_white,
priority = "high",
width = 64,
height = 64,
scale = 0.5,
},
{
type = "sprite",
name = names.no_path,
filename = pathes.no_path_icon,
priority = "high",
width = 32,
height = 32,
scale = 1,
},
{
type = "sprite",
name = names.no_schedule,
filename = pathes.no_schedule_icon,
priority = "high",
width = 64,
height = 64,
scale = 0.5,
},
{
type = "sprite",
name = names.alert_disabled,
filename = pathes.alert_disabled_icon,
priority = "high",
width = 64,
height = 64,
scale = 1,
},
{
type = "sprite",
name = names.selection_tool,
filename = pathes.selection_tool_icon,
priority = "high",
width = 64,
height = 64,
scale = 1,
},
})
|
local Class = require("lib.class")
local Animation = Class("Animation")
function Animation:initialize(frames, frameTime)
self.frames = frames
self.frameTime = frameTime
self.currentTime = 0
self.currentFrame = 1
end
return Animation
|
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Wall ATM"
ENT.Author = "<CODE BLUE>"
ENT.Contact = "Via Steam"
ENT.Spawnable = true
ENT.Category = "Blue's ATM"
ENT.AdminSpawnable = true
ENT.KeypadButtons = {
[1] = {
v1 = Vector(6.3242154121399, 4.6794362068176, 42.315120697021),
v2 = Vector(5.2774815559387, 3.2131419181824, 42.130558013916)
},
[2] = {
v1 = Vector(6.2842335700989, 2.8623576164246, 42.30806350708),
v2 = Vector(5.2010078430176, 1.3468786478043, 42.117069244385)
},
[3] = {
v1 = Vector(6.3260402679443, 0.99942409992218, 42.315448760986),
v2 = Vector(5.1430888175964, -0.4899827837944, 42.106864929199)
},
[4] = {
v1 = Vector(4.7365732192993, 4.6431932449341, 42.03519821167),
v2 = Vector(3.6755030155182, 3.1529352664948, 41.848094940186)
},
[5] = {
v1 = Vector(4.9846606254578, 2.9224467277527, 42.078937530518),
v2 = Vector(3.7379949092865, 1.4061270952225, 41.859127044678)
},
[6] = {
v1 = Vector(4.8523707389832, 1.0120477676392, 42.055606842041),
v2 = Vector(3.7184247970581, -0.51208257675171, 41.855659484863)
},
[7] = {
v1 = Vector(3.357097864151, 4.7287225723267, 41.791942596436),
v2 = Vector(2.2441239356995, 3.1697614192963, 41.595695495605)
},
[8] = {
v1 = Vector(3.3098621368408, 2.8721208572388, 41.783622741699),
v2 = Vector(2.2989020347595, 1.2975977659225, 41.605354309082)
},
[9] = {
v1 = Vector(3.3003168106079, 0.98232841491699, 41.781940460205),
v2 = Vector(2.3017039299011, -0.49305874109268, 41.605854034424)
},
[0] = {
v1 = Vector(1.9256201982498, 2.9167428016663, 41.539535522461),
v2 = Vector(0.76918041706085, 1.3108148574829, 41.335628509521)
},
["clear"] = {
v1 = Vector(6.3366770744324, -1.4786270856857, 42.317321777344),
v2 = Vector(5.2353281974792, -4.688268661499, 42.123134613037)
},
["enter"] = {
v1 = Vector(4.7916941642761, -1.4398620128632, 42.044898986816),
v2 = Vector(3.6682436466217, -4.7248086929321, 41.846809387207)
},
["cancel"] = {
v1 = Vector(3.2898850440979, -1.4525005817413, 41.780094146729),
v2 = Vector(2.2739601135254, -4.7292504310608, 41.600955963135)
}
}
function ENT:SetupDataTables()
end
|
---------------- DIMENSIONAL LOGISTIC -------------------
-- Matter Serialization --
local msT = {}
msT.name = "MatterSerialization"
msT.type = "technology"
msT.icon = "__Mobile_Factory_Graphics__/graphics/matter-serialization/MatterSerializationI.png"
msT.icon_size = 64
msT.unit = {
count=15,
time=60,
ingredients={
{"DimensionalSample", 100},
{"DimensionalCrystal", 1}
}
}
msT.prerequisites = {"DimensionalCrystal"}
msT.effects =
{
{type="nothing", effect_description={"description.MatterSerialization"}},
{type="unlock-recipe", recipe="MatterSerializer"},
{type="unlock-recipe", recipe="MatterPrinter"},
{type="unlock-recipe", recipe="DataStorage"},
{type="unlock-recipe", recipe="DataCenter"},
{type="unlock-recipe", recipe="DataCenterMF"},
{type="unlock-recipe", recipe="EnergyCubeMK1"}
}
data:extend{msT}
-- Data Transmission --
local dtT = {}
dtT.name = "DataTransmission"
dtT.type = "technology"
dtT.icon = "__Mobile_Factory_Graphics__/graphics/matter-serialization/WirelessDataTransmissionI.png"
dtT.icon_size = 64
dtT.unit = {
count=20,
time=60,
ingredients={
{"DimensionalSample", 100},
{"DimensionalCrystal", 1}
}
}
dtT.prerequisites = {"MatterSerialization"}
dtT.effects =
{
{type="unlock-recipe", recipe="WirelessDataTransmitter"},
{type="unlock-recipe", recipe="WirelessDataReceiver"}
}
data:extend{dtT}
-- Item Drain --
local idT = {}
idT.name = "TechItemDrain"
idT.type = "technology"
idT.icon = "__Mobile_Factory_Graphics__/graphics/icones/TechItemDrain.png"
idT.icon_size = 32
idT.unit = {
count=5,
time=60,
ingredients={
{"DimensionalSample", 200},
{"DimensionalCrystal", 1}
}
}
idT.prerequisites = {"MatterSerialization"}
idT.effects = {{type="nothing", effect_description={"description.TechItemDrain"}}}
data:extend{idT}
|
--ZFUNC-pathedges-v1
local function pathedges( path ) --> edges
local edges = {}
if #path < 2 then return edges end
for n = 2, #path do
local i = n - 1
table.insert( edges, { path[ i ], path[ n ] } )
end
return edges
end
return pathedges
|
local function init()
minetest.register_privilege("hs_admin", {
description = "Admin commands of HideNSeek mod",
give_to_singleplayer = true,
})
end
return {
init = init
}
|
local name = 'setup-autopairs'
local utils = require('utils').start_script(name)
local M = {}
M.setup = function(autopairs)
local cmp = require 'cmp'
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
autopairs.setup {
check_ts = true,
}
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({
map_char = {
tex = '',
},
}))
end
utils.end_script(name)
return M
|
local portal_targeter = util.table.deepcopy(data.raw["ammo-turret"]["gun-turret"])
portal_targeter.name = "teleportation-portal"
portal_targeter.icon = "__Teleportation_Redux__/graphics/portal-64.png"
portal_targeter.flags = {"placeable-neutral", "player-creation","placeable-off-grid"}
portal_targeter.collision_mask = {}
portal_targeter.max_health = 1
portal_targeter.inventory_size = 0
portal_targeter.collision_box = {{ 0, 0}, {0, 0}}
portal_targeter.selection_box = {{ 0, 0}, {0, 0}}
portal_targeter.folded_animation =
{
layers =
{
{
filename = "__Teleportation_Redux__/graphics/null.png",
priority = "medium",
width = 32,
height = 32,
frame_count = 1,
line_length = 1,
run_mode = "forward",
axially_symmetrical = false,
direction_count = 1,
shift = {0, 0}
}
}
}
portal_targeter.base_picture =
{
layers =
{
{
filename = "__Teleportation_Redux__/graphics/portal-64.png",
line_length = 1,
width = 64,
height = 64,
frame_count = 1,
axially_symmetrical = false,
direction_count = 1,
shift = {0, 0}
}
}
}
portal_targeter.attack_parameters =
{
type = "projectile",
ammo_category = "melee",
cooldown = 15,
projectile_center = {0, 0},
projectile_creation_distance = 1.4,
range = 2,
damage_modifier = 0,
ammo_type =
{
type = "projectile",
category = "melee",
energy_consumption = "0J"
}
}
data:extend({portal_targeter})
data:extend({
{
type = "explosion",
name = "teleport-sound",
animation_speed = 5,
animations =
{
{
filename = "__Teleportation_Redux__/graphics/empty.png",
priority = "extra-high",
width = 33,
height = 32,
frame_count = 1,
line_length = 1,
shift = {0, 0}
}
},
light = {intensity = 1, size = 20, color={r=0,g=0.3,b=1} },
smoke = "smoke",
smoke_count = 1,
smoke_slow_down_factor = 1,
}
})
--require ("prototypes.entity.demo-circuit-connector-sprites")
data:extend({
{
type = "container",
name = "teleportation-beacon",
icon = "__Teleportation_Redux__/graphics/icon.png",
icon_size = 32,
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "teleportation-beacon"},
max_health = 150,
corpse = "medium-remnants",
dying_explosion = "medium-explosion",
open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 },
close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 },
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
resistances =
{
{
type = "fire",
percent = 90
}
},
collision_box = {{-2, -2}, {1.9,1.9}},
collision_mask = {"water-tile", "item-layer", "object-layer"},
selection_box = {{-2, -2}, {2, 2}},
render_layer = decorative,
inventory_size = 10,
picture =
{
filename = "__Teleportation_Redux__/graphics/tiers/orange/spritesheet.png",
priority = "high",
width = 128,
height = 128,
shift = {0.28, 0.2}
}
},
{
type = "electric-energy-interface",
name = "teleportation-beacon-electric-energy-interface",
localised_name = {"entity-name.teleportation-beacon"},
icon = "__Teleportation_Redux__/graphics/icon.png",
icon_size = 32,
flags = {"placeable-neutral", "player-creation", "not-blueprintable", "not-deconstructable"},
minable = {hardness = 0.2, mining_time = 0.5, result = "teleportation-beacon-electric-energy-interface"},
destructible = false,
selectable_in_game = false,
max_health = 1,
corpse = "medium-remnants",
collision_box = {{-2, -2}, {2,2}},
collision_mask = {"water-tile", "item-layer", "object-layer"},
selection_box = {{0, 0}, {0, 0}},
render_layer = decorative,
energy_source =
{
type = "electric",
buffer_capacity = "300MJ",
usage_priority = "secondary-input",
input_flow_limit = "5MW",
output_flow_limit = "0W"
},
{
filename = "__Teleportation_Redux__/graphics/tiers/orange/spritesheet.png",
priority = "extra-high",
width = 128,
height = 128,
line_length = 16,
frame_count = 16,
shift = {0, 0}
},
charge_animation =
{
filename = "__Teleportation_Redux__/graphics/tiers/orange/spritesheet.png",
width = 128,
height = 128,
line_length = 16,
frame_count = 16,
shift = {0, 0},
animation_speed = 0.5
},
charge_cooldown = 30,
charge_light = {intensity = 0.3, size = 7},
discharge_animation =
{
filename = "__PersonalTeleporter__/graphics/tiers/orange/spritesheet.png",
width = 128,
height = 128,
line_length = 16,
frame_count = 16,
shift = {0, 0},
animation_speed = 0.5
},
discharge_cooldown = 60,
discharge_light = {intensity = 0.7, size = 7},
},
})
if settings.startup["Teleportation-telelogistics-enabled"].value then
local teleprovider = util.table.deepcopy(data.raw["container"]["steel-chest"])
teleprovider.name = "teleportation-teleprovider"
teleprovider.icon = "__Teleportation_Redux__/graphics/teleprovider-icon.png"
teleprovider.icon_size = 32
teleprovider.minable = {mining_time = 1, result = "teleportation-teleprovider"}
teleprovider.inventory_size = 1
teleprovider.picture = {
filename = "__Teleportation_Redux__/graphics/teleprovider-entity.png",
priority = "extra-high",
width = 38,
height = 32,
shift = {0.09375, 0}
}
data:extend({teleprovider})
end
|
#!/usr/bin/env tarantool
local tap = require('tap')
local client = require('smtp').new()
local test = tap.test("curl")
local fiber = require('fiber')
local socket = require('socket')
local os = require('os')
test:plan(1)
mails = fiber.channel(100)
local function smtp_h(s)
s:write('220 localhost ESMTP Tarantool\r\n')
local l
local mail = {rcpt = {}}
while true do
l = s:read('\r\n')
if l:find('EHLO') then
s:write('250-localhost Hello localhost.lan [127.0.0.1]\r\n')
s:write('250-SIZE 52428800\r\n')
s:write('250-8BITMIME\r\n')
s:write('250-PIPELINING\r\n')
s:write('250-CHUNKING\r\n')
s:write('250-PRDR\r\n')
s:write('250 HELP\r\n')
elseif l:find('MAIL FROM:') then
mail.from = l:sub(11):sub(1, -3)
s:write('250 OK\r\n')
elseif l:find('RCPT TO:') then
mail.rcpt[#mail.rcpt + 1] = l:sub(9):sub(1, -3)
s:write('250 OK\r\n')
elseif l == 'DATA\r\n' then
s:write('354 Enter message, ending with "." on a line by itself\r\n')
while true do
local l = s:read('\r\n')
if l == '.\r\n' then
break
end
mail.text = (mail.text or '') .. l
end
mails:put(mail)
mail = {rcpt = {}}
s:write('250 OK\r\n')
elseif l:find('QUIT') then
return
elseif l ~= nil then
s:write('502 Not implemented')
else
return
end
end
end
local server = socket.tcp_server('127.0.0.1', 0, smtp_h)
local addr = 'smtp://127.0.0.1:' .. server:name().port
test:test("smtp.client", function(test)
test:plan(10)
local r
local m
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'mail.body')
test:is(r.status, 250, 'simple mail')
m = mails:get()
test:is(m.from, '<sender@tarantool.org>', 'sender')
test:is_deeply(m.rcpt, {'<receiver@tarantool.org>'}, 'rcpt')
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'mail.body',
{cc = 'cc@tarantool.org'})
m = mails:get()
test:is_deeply(m.rcpt, {'<receiver@tarantool.org>', '<cc@tarantool.org>'}, 'cc rcpt')
r = client:request(addr, 'sender@tarantool.org',
nil,
'mail.body',
{cc = 'cc@tarantool.org'})
m = mails:get()
test:is_deeply(m.rcpt, {'<cc@tarantool.org>'}, 'no rcpt')
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'mail.body',{
attachments = {
{
body = 'Test message',
content_type = 'text/plain',
filename = 'text.txt',
}
}})
m = mails:get()
local boundaries = select(2, string.gsub(m.text, "MULTIPART%-MIXED%-BOUNDARY", ""))
local attachment = select(2, string.gsub(m.text, "VGVzdCBtZXNzYWdl", ""))
test:is(boundaries + attachment, 5, 'attach default')
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'mail.body',{
attachments = {
{
body = 'Test message',
content_type = 'text/plain',
filename = 'text.txt',
base64_encode = false,
}
}})
m = mails:get()
boundaries = select(2, string.gsub(m.text, "MULTIPART%-MIXED%-BOUNDARY", ""))
attachment = select(2, string.gsub(m.text, "Test message", ""))
test:is(boundaries + attachment, 5, 'attach plain')
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'mail.body',{
attachments = {
{
body = 'Test message',
content_type = 'text/plain',
filename = 'text.txt',
base64_encode = true,
}
}})
m = mails:get()
boundaries = select(2, string.gsub(m.text, "MULTIPART%-MIXED%-BOUNDARY", ""))
attachment = select(2, string.gsub(m.text, "VGVzdCBtZXNzYWdl", ""))
test:is(boundaries + attachment, 5, 'attach base64')
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'', {subject = 'abcdefghijklmnopqrstuvwxyz'})
m = mails:get()
local subj = select(2, string.gsub(m.text, "Subject: abcdefghijklmnopqrstuvwxyz",""))
test:is(subj, 1, 'subject codes <127')
r = client:request(addr, 'sender@tarantool.org',
'receiver@tarantool.org',
'', {subject = 'abcdefghijkяlmnopqrstuvwxyz'})
m = mails:get()
subj = select(2, string.gsub(
m.text,
"Subject: =%?utf%-8%?b%?YWJjZGVmZ2hpamvRj2xtbm9wcXJzdHV2d3h5eg==%?=", ""))
test:is(subj, 1, 'subject codes >127')
end)
os.exit(test:check() == true and 0 or -1)
|
local addonName, GreyHandling = ...;
local function defaultFunc(GreyHandling, key)
-- If this function was called, we have no localization for this key.
-- We could complain loudly to allow localizers to see the error of their ways,
-- but, for now, just return the key as its own localization. This allows you to—avoid writing the default
-- localization out explicitly.
-- print(format("No localisation for key %s", key))
return key;
end
setmetatable(GreyHandling, {__index=defaultFunc});
|
function Client_SaveConfigureUI(alert)
Mod.Settings.NoTerritory = InputNoTerritory.GetIsChecked();
end
|
local moon = require("moon")
local seri = require("seri")
local conf = ...
local pack = seri.pack
local packs = seri.packs
local unpack = seri.unpack
local co_yield = coroutine.yield
local function cluster_service()
local json = require("json")
local buffer = require("buffer")
local socket = require("moon.socket")
local clusters = {}
local print = print
local assert = assert
local pairs = pairs
local strfmt = string.format
local unpack_one = seri.unpack_one
local write_back = buffer.write_back
local queryservice = moon.queryservice
local close_watch = {}
local send_watch = {}
local connectors = {}
local function add_send_watch( fd, sender, sessionid )
local senders = send_watch[fd]
if not senders then
senders = {}
send_watch[fd] = senders
end
local key = ((-sessionid)<<32)|sender
--print("addkey", key, sessionid)
senders[key] = true
end
local function remove_send_watch( fd, sender, sessionid )
local senders = send_watch[fd]
if not senders then
assert(false)
return
end
local key = ((-sessionid)<<32)|sender
--print("remove key", key, sessionid)
senders[key] = nil
end
local services_address = {}
local function get_service_address(sname)
local addr = services_address[sname]
if not addr then
addr = queryservice(sname)
assert(addr>0, sname)
services_address[sname] = addr
end
return addr
end
local function unpack_header(msg)
local buf = msg:buffer()
local receiver_sname = unpack_one(buf,true)
local sender_addr = unpack_one(buf,true)
local sessionid = unpack_one(buf,true)
return receiver_sname, sender_addr, sessionid
end
local function do_call(fd, msg, receiver_sname, sender_addr, sessionid)
local address = get_service_address(receiver_sname)
assert(address>0, receiver_sname)
local sessionid_ = moon.make_response(address)
moon.redirect(msg, "", address, moon.PTYPE_LUA, moon.sid(), -sessionid_)
close_watch[sessionid_] = fd
local resmsg, err = co_yield()
local state = close_watch[sessionid_]
close_watch[sessionid_] = nil
if state == false then
return
end
if resmsg then
local unsafe_buf = pack(receiver_sname, sender_addr, -sessionid)
write_back(unsafe_buf, resmsg:bytes())
socket.write(fd, unsafe_buf)
else
moon.error(err)
local res = packs(receiver_sname, sender_addr, -sessionid, false, err)
socket.write(fd, res)
end
end
socket.on("connect",function(fd, msg)
print("connect", fd, msg:bytes())
end)
socket.on("accept",function(fd, msg)
socket.settimeout(fd, 180)
print("accept", fd, msg:bytes())
end)
socket.on("message", function(fd, msg)
local receiver_sname, sender_addr, sessionid = unpack_header(msg)
if sessionid < 0 then
moon.async(function ()
local ok, err = pcall(do_call, fd, msg, receiver_sname, sender_addr, sessionid)
if not ok then
local res = packs(receiver_sname,
sender_addr,
-sessionid,
false,
err)
socket.write(fd, res)
end
end)
elseif sessionid > 0 then
remove_send_watch(fd, sender_addr, -sessionid)
moon.redirect(msg, "", sender_addr, moon.PTYPE_LUA, moon.sid(), sessionid)
else-- receive send message
local address = get_service_address(receiver_sname)
moon.redirect(msg, "", address, moon.PTYPE_LUA)
end
end)
socket.on("close", function(fd, msg)
print("close", msg:bytes())
for k, v in pairs(close_watch) do
if v == fd then
close_watch[k] = false
end
end
local senders = send_watch[fd]
if senders then
for key in pairs(senders) do
local sender = key&0xFFFFFFFF
local sessionid = -(key>>32)
print("response", sender, sessionid)
moon.response("lua", sender, sessionid, packs(false, "connect closed"))
end
end
for k,v in pairs(connectors) do
if v == fd then
connectors[k] = nil
clusters[k].state = "CLOSED"
break
end
end
end)
socket.on("error", function(fd, msg)
print("socket error",fd, msg:bytes())
end)
local function connect(serverid)
local c = clusters[serverid]
c.state = "CONNECTING"
local fd, err = socket.connect(c.host, c.port, moon.PTYPE_SOCKET)
if not fd then
moon.error(err)
c.state = "CLOSED"
return
end
socket.set_enable_chunked(fd, "wr")
c.state = "CONNECTED"
return fd
end
local message_cache = {}
local function get_message_cache(serverid)
local cache = message_cache[serverid]
if not cache then
cache = {}
message_cache[serverid] = cache
end
return cache
end
local command = {}
function command.SEND(serverid, msg)
local sender = msg:sender()
local sessionid = msg:sessionid()
local fd = connectors[serverid]
if fd then
if sessionid < 0 then
add_send_watch(fd, sender, sessionid)
end
socket.write_message(fd, msg)
return
end
local data = msg:bytes()
local cache = get_message_cache(serverid)
table.insert(cache, {sender, sessionid, data})
local state = clusters[serverid].state
if state ~= "CLOSED" then
return
end
moon.async(function ()
fd = connect(serverid)
message_cache[serverid] = nil
if not fd then
for _, v in ipairs(cache) do
if v[2] ~=0 then
moon.response("lua", v[1], v[2], seri.packs(false, "not connected"))
else
moon.error("can not connect cluster node",
serverid, "drop message from", sender, "size", #v[3])
end
end
else
for _, v in ipairs(cache) do
if v[2] ~=0 then
add_send_watch(fd, v[1], v[2])
end
socket.write(fd, v[3])
end
connectors[serverid] = fd
end
end)
end
local function load_config()
local function find_host_port(config_params)
if not config_params then
return nil
end
local host,port
for k, v in pairs(config_params) do
if k == "cluster_host" then
host = v
elseif k == "cluster_port" then
port = v
end
end
return host,port
end
local content = moon.get_env("CONFIG")
local js = json.decode(content)
for _,c in ipairs(js) do
local host,port = find_host_port(c.params)
if host and port then
clusters[c.sid]={host = host,port = port, state="CLOSED"}
end
end
end
load_config()
local SERVERID = math.tointeger(moon.get_env("SID"))
if not clusters[SERVERID] then
print("unconfig cluster node:".. moon.name())
return false
end
moon.register_protocol(
{
name = "lua",
PTYPE = moon.PTYPE_LUA,
pack = function(...)return ...end,
unpack = nil,
dispatch = function(msg)
local cmd, receiver_serverid = unpack(msg:header())
local fn = command[cmd]
if fn then
fn(receiver_serverid, msg)
else
moon.error(moon.name(), "recv unknown cmd "..cmd)
end
end
})
moon.start(function()
local listenfd = socket.listen(conf.host, conf.port,moon.PTYPE_SOCKET)
socket.start(listenfd)
print(strfmt("cluster run at %s %d", conf.host, conf.port))
end)
end
if conf and conf.name then
cluster_service()
end
local cluster = {}
local cluster_address
function cluster.send(receiver_serverid, receiver_sname, ...)
if not cluster_address then
cluster_address = moon.queryservice("cluster")
if 0 == cluster_address then
return false, "clusterd service not start"
end
end
moon.raw_send("lua", cluster_address, packs("SEND",receiver_serverid) ,
pack(receiver_sname, moon.sid(), 0,...), 0)
end
function cluster.call(receiver_serverid, receiver_sname, ...)
if not cluster_address then
cluster_address = moon.queryservice("cluster")
if 0 == cluster_address then
return false, "clusterd service not start"
end
end
local sessionid = moon.make_response(cluster_address)
moon.raw_send("lua", cluster_address, packs("SEND",receiver_serverid) ,
pack(receiver_sname, moon.sid(), -sessionid,...), sessionid)
return co_yield()
end
return cluster
|
--[[
Allows you to easily construct complex hierarchies of instances.
This has been particularly useful in unit tests, as we can easily fake the
DataModel.
Usage:
local mockDataModel = new({
Name = "game"
}, {
ServerScriptService = newFolder({
Script = Instance.new("Script")
}),
ReplicatedStorage = newFolder({
Module = Instance.new("ModuleScript")
})
})
]]
local t = require("t")
local newCheck = t.tuple(t.optional(t.table), t.optional(t.table))
local function new(props, children)
assert(newCheck(props, children))
local className = props and props.ClassName
local instance = Instance.new(className or "Folder")
if props then
for prop, value in pairs(props) do
instance[prop] = value
end
end
if children then
for name, child in pairs(children) do
child.Name = name
child.Parent = instance
end
end
return instance
end
return new
|
-- Game settings
-- Part of Live Simulator: 2
-- See copyright notice in main.lua
-- luacheck: read_globals DEPLS_VERSION
local love = require("love")
local Luaoop = require("libs.Luaoop")
local Async = require("async")
local color = require("color")
local Gamestate = require("gamestate")
local LoadingInstance = require("loading_instance")
local MainFont = require("main_font")
local Util = require("util")
local Volume = require("volume")
local Setting = require("setting")
local L = require("language")
local BackgroundLoader = require("game.background_loader")
local tapSound = require("game.tap_sound")
local ColorTheme = require("game.color_theme")
local Glow = require("game.afterglow")
local CircleIconButton = require("game.ui.circle_icon_button")
local Ripple = require("game.ui.ripple")
local invisibleUI = require("game.ui.invisible")
local numberSetting = require("game.settings.number")
local switchSetting = require("game.settings.switch")
local note = require("game.live.note")
local liveUI = require("game.live.ui")
local systemInfo = require("game.systeminfo")
local interpolation = require("libs.cubic_bezier")(0.4, 0, 0.2, 1):getFunction()
local mipmap = {mipmaps = true}
local --[[const]] MAX_NOTE_STYLE = 4
local aboutString = string.format([[
Live Simulator: 2 Version %s
Live Simulator: 2 v3.0 and later is licensed under zLib license.
Copyright (c) 2041 Dark Energy Processor
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Special thanks to:
* yuyu - Note circle images and Japanese translation.
* MilesElectric168 - Note randomization algorithm.
* sr229 - v4.0 UI redesign.
* CK.Tex - Simplified Chinese translation.
* Bass & Azux - Polish translation.
* Luboss - Slovak translation.
* RayFirefist - macOS app, iOS maintainer, Italian translation.
* jwun & TheNozomi - Spanish translation.
* Salaron & Nick "Zorb" Cage - Russian translation.
And other people who contributed to the codebase
]], DEPLS_VERSION):gsub("\r\n", "\n")
local function leave(_, self)
local ct = assert(tonumber(Setting.get("COLOR_THEME")))
if
Util.compareLOVEVersion(0, 10, 2) >= 0 and
(
self.persist.currentLanguage ~= self.persist.previousLanguage or
self.persist.currentTheme ~= ct
) and
love.window.showMessageBox("Restart", L"dialog:restart", {
L"dialog:yes",
L"dialog:no",
enterbutton = 1, escapebutton = 2
}, "info") == 1
then
love.event.quit("restart")
end
return Gamestate.leave(LoadingInstance.getInstance())
end
local function setVolumeSetting(name, value)
return Volume.set(name, value * 0.01)
end
local function changeBackgroundAsync(self, v)
self.persist.background = BackgroundLoader.load(v)
end
local function startChangeBackground(self, v)
return Async.runFunction(changeBackgroundAsync):run(self, v)
end
local function setBackgroundDim(self, v)
self.persist.backgroundDim = v / 100
end
local function updateStyleData(self)
self.persist.styleLayer[1] = note.manager.getLayer(self.persist.styleData, 1, true, true, false, false)
self.persist.styleLayer[2] = note.manager.getLayer(self.persist.styleData, 2, true, true, false, false)
self.persist.styleLayer[3] = note.manager.getLayer(self.persist.styleData, 3, true, true, false, false)
self.persist.curStyle = note.manager.getLayer(self.persist.styleData, self.persist.defAttr, true, true, false, false)
-- simultaneous neon doesn't provide base frame if base frame is also neon
if self.persist.styleData.noteStyleFrame == 2 then
self.persist.curStyle[#self.persist.curStyle + 1] = self.persist.defAttr + 16
end
-- calculate note style value
Setting.set("NOTE_STYLE", 63 +
self.persist.styleData.noteStyleFrame * 64 +
self.persist.styleData.noteStyleSwing * 4096 +
self.persist.styleData.noteStyleSimul * 262144
)
end
local function isSimultaneousLayer(layerIndex)
return layerIndex == 16 or layerIndex == 28 or layerIndex == 62 or layerIndex == 86
end
local tempPosition = {x = 0, y = 0}
local function drawLayerAt(styleData, layer, x, y)
tempPosition.x, tempPosition.y = x, y
return note.manager.drawNote(styleData, layer, 1, tempPosition, 0.75, 0)
end
local function newSettingFrame()
return Glow.Frame(246, 86, 714, 548)
end
local categorySelect = Luaoop.class("Livesim2.Settings.CategorySelectUI", Glow.Element)
function categorySelect:new(font, icon, name)
self.width, self.height = 240, 48
self.x, self.y = 0, 0
self.active = false
self.ripple = Ripple(242.12393520674489483506979278946)
self.isPressed = false
self.textHeight = font:getHeight()
self.text = love.graphics.newText(font)
self.text:add(assert(name), 0, (self.height - font:getHeight()) * 0.5)
self.icon = assert(icon)
self.iconW, self.iconH = icon:getDimensions()
self.stencilFunc = function()
love.graphics.rectangle("fill", self.x, self.y, self.width, self.height)
end
self:addEventListener("mousepressed", categorySelect._pressed)
self:addEventListener("mousereleased", categorySelect._released)
self:addEventListener("mousecanceled", categorySelect._released)
end
function categorySelect:_pressed(_, x, y)
self.isPressed = true
self.ripple:pressed(x, y)
end
function categorySelect:_released()
self.isPressed = false
self.ripple:released()
end
function categorySelect:setActive(active)
self.active = active
end
function categorySelect:update(dt)
self.ripple:update(dt)
end
function categorySelect:render(x, y)
self.x, self.y = x, y
if self.active then
love.graphics.setColor(ColorTheme.get())
love.graphics.rectangle("fill", x, y, self.width, self.height)
end
love.graphics.setColor(self.active and color.white or color.black)
love.graphics.draw(self.icon, x + 24, y + 24, 0, 0.32, 0.32, self.iconW * 0.5, self.iconH * 0.5)
Util.drawText(self.text, x + 48, y)
if self.ripple:isActive() then
love.graphics.stencil(self.stencilFunc, "replace", 3, false)
love.graphics.setStencilTest("equal", 3)
self.ripple:draw(255, 255, 255, x, y)
love.graphics.setStencilTest()
end
end
local longSelect = Luaoop.class("Livesim2.Settings.LongSelectUI", Glow.Element)
function longSelect:new(font, name)
self.width, self.height = 710, 60
self.x, self.y = 0, 0
self.active = false
self.ripple = Ripple(712.53070109294238045145069048472)
self.isPressed = false
self.textHeight = font:getHeight()
self.text = love.graphics.newText(font)
self.text:add(name, (self.width - font:getWidth(name)) * 0.5, (self.height - font:getHeight()) * 0.5)
self.stencilFunc = function()
love.graphics.rectangle("fill", self.x, self.y, self.width, self.height)
end
self:addEventListener("mousepressed", categorySelect._pressed)
self:addEventListener("mousereleased", categorySelect._released)
self:addEventListener("mousecanceled", categorySelect._released)
end
function longSelect:setActive(active)
self.active = active
end
function longSelect:update(dt)
self.ripple:update(dt)
end
function longSelect:render(x, y)
self.x, self.y = x, y
love.graphics.setColor(self.active and ColorTheme.get() or color.white75PT)
love.graphics.rectangle("fill", x, y, self.width, self.height)
love.graphics.setColor(self.active and color.white or color.black)
Util.drawText(self.text, x, y)
if self.ripple:isActive() then
love.graphics.stencil(self.stencilFunc, "replace", 3, false)
love.graphics.setStencilTest("equal", 3)
self.ripple:draw(255, 255, 255, x, y)
love.graphics.setStencilTest()
end
end
local textUI = Luaoop.class("Livesim2.TextUI", invisibleUI)
function textUI:new(font, text, maxw)
self.text = love.graphics.newText(font)
self.text:addf({color.black, text}, maxw, "left")
invisibleUI.new(self, maxw, self.text:getHeight())
end
function textUI:render(x, y)
love.graphics.setColor(color.white)
Util.drawText(self.text, x, y)
end
-- Setting section frame size is 868x426+50+184
-- Tab selection is 868x62+50+162
local gameSetting = Gamestate.create {
images = {
aspectRatio = {"assets/image/ui/over_the_rainbow/aspect_ratio.png"},
contacts = {"assets/image/ui/over_the_rainbow/contacts.png"},
devInfo = {"assets/image/ui/over_the_rainbow/perm_device_information.png", mipmap},
info = {"assets/image/ui/over_the_rainbow/info.png"},
language = {"assets/image/ui/over_the_rainbow/language.png"},
navigateBack = {"assets/image/ui/over_the_rainbow/navigate_back.png", mipmap},
note = {"noteImage:assets/image/tap_circle/notes.png", mipmap},
panorama = {"assets/image/ui/over_the_rainbow/panorama.png"},
settings = {"assets/image/ui/over_the_rainbow/settings.png"},
slowMotion = {"assets/image/ui/over_the_rainbow/slow_motion_video.png"},
volume = {"assets/image/ui/over_the_rainbow/volume_up.png"},
whatsHot = {"assets/image/ui/over_the_rainbow/whatshot.png"}
},
fonts = {}
}
function gameSetting:load()
Glow.clear()
self.data = self.data or {} -- for sake of LCA
local font31, font26, font22, font16 = MainFont.get(31, 26, 22, 16)
if self.persist.background == nil then
self.persist.background = BackgroundLoader.load(tonumber(Setting.get("BACKGROUND_IMAGE")))
end
if self.data.shadowGradient == nil then
self.data.shadowGradient = Util.gradient("vertical", color.black75PT, color.transparent)
end
if self.data.titleText == nil then
local t = love.graphics.newText(font31)
local l = L"menu:settings"
t:add(l, -0.5 * font31:getWidth(l), 0)
self.data.titleText = t
end
if self.data.back == nil then
self.data.back = CircleIconButton(ColorTheme.get(), 36, self.assets.images.navigateBack, 0.48)
self.data.back:setData(self)
self.data.back:addEventListener("mousereleased", leave)
end
Glow.addFixedElement(self.data.back, 32, 4)
-- General settings
if self.persist.generalSetting == nil then
local frame = newSettingFrame()
local themeDisplay = {"μ's", "Aqours", "NijiGaku", "Liella"}
local tapSoundDisplay = {}
for i = 1, #tapSound do
tapSoundDisplay[i] = tapSound[i].name
end
self.persist.generalFrame = frame
self.persist.generalSetting = {
numberSetting(frame, L"setting:general:defaultNote", "LLP_SIFT_DEFATTR", {
min = 1, max = 11,
display = {
"Smile", "Pure", "Cool",
"Blue", "Yellow", "Orange",
"Pink", "Purple", "Gray",
"Rainbow", "Black"
}
})
:setPosition(0, 12) -- next: y+=64
:setChangedCallback(self, function(obj, v)
obj.persist.defAttr = v
updateStyleData(obj)
end),
switchSetting(frame, L"setting:general:nsAccumulation", "NS_ACCUMULATION")
:setPosition(0, 64+12),
numberSetting(frame, L"setting:general:timingOffset", "TIMING_OFFSET", {
min = -50, max = 50, default = 0
})
:setPosition(0, 128+12),
numberSetting(frame, L"setting:general:beatmapOffset", "GLOBAL_OFFSET", {
min = -5000, max = 5000, default = 0
})
:setPosition(0, 192+12),
numberSetting(frame, L"setting:general:downloadOffset", "DOWNLOAD_OFFSET", {
min = -1000, max = 1000, default = -50
})
:setPosition(0, 256+12),
numberSetting(frame, L"setting:general:tapSound", "TAP_SOUND", {
min = 1, max = #tapSound, default = 1, display = tapSoundDisplay
})
:setPosition(0, 320+12),
switchSetting(frame, L"setting:general:improvedSync", "IMPROVED_SYNC")
:setPosition(0, 384+12),
numberSetting(frame, L"setting:general:themeColor", "COLOR_THEME", {
min = 1, max = #themeDisplay, default = 1, display = themeDisplay
})
:setPosition(0, 448+12)
}
end
Glow.addFrame(self.persist.generalFrame)
-- Volume settings
if self.persist.volumeSetting == nil then
local frame = newSettingFrame()
self.persist.volumeFrame = frame
self.persist.volumeSetting = {
numberSetting(frame, L"setting:volume:master", "MASTER_VOLUME", {min = 0, max = 100, default = 80})
:setPosition(0, 12)
:setChangedCallback("master", setVolumeSetting),
numberSetting(frame, L"setting:volume:song", "SONG_VOLUME", {min = 0, max = 100, default = 80})
:setPosition(0, 64+12)
:setChangedCallback("music", setVolumeSetting),
numberSetting(frame, L"setting:volume:effect", "SE_VOLUME", {min = 0, max = 100, default = 80})
:setPosition(0, 128+12)
:setChangedCallback("se", setVolumeSetting),
numberSetting(frame, L"setting:volume:voice", "VOICE_VOLUME", {min = 0, max = 100, default = 80})
:setPosition(0, 192+12)
:setChangedCallback("voice", setVolumeSetting),
}
end
-- Background settings
if self.persist.bgSetting == nil then
local frame = newSettingFrame()
self.persist.bgFrame = frame
self.persist.bgSetting = {
switchSetting(frame, L"setting:background:loadCustom", "AUTO_BACKGROUND")
:setPosition(0, 12),
numberSetting(frame, L"setting:background:image", "BACKGROUND_IMAGE", {min = 1, max = 15})
:setChangedCallback(self, startChangeBackground)
:setPosition(0, 64+12),
numberSetting(frame, L"setting:background:dim", "LIVESIM_DIM", {min = 0, max = 100})
:setChangedCallback(self, setBackgroundDim)
:setPosition(0, 128+12)
}
end
-- Note Style settings
if self.persist.nsSetting == nil then
local frame = newSettingFrame()
local display = {"Default", "Neon", "Matte", "Lovewing"}
self.persist.nsFrame = frame
self.persist.nsSetting = {
numberSetting(frame, L"setting:noteStyle:base", nil, {min = 1, max = MAX_NOTE_STYLE, value = 1, display = display})
:setPosition(0, 12)
:setChangedCallback(self, function(obj, v)
obj.persist.styleData.noteStyleFrame = v
return updateStyleData(obj)
end),
numberSetting(frame, L"setting:noteStyle:swing", nil, {min = 1, max = MAX_NOTE_STYLE, value = 1, display = display})
:setPosition(0, 64+12)
:setChangedCallback(self, function(obj, v)
obj.persist.styleData.noteStyleSwing = v
return updateStyleData(obj)
end),
numberSetting(frame, L"setting:noteStyle:simul", nil, {min = 1, max = MAX_NOTE_STYLE, value = 1, display = display})
:setPosition(0, 128+12)
:setChangedCallback(self, function(obj, v)
obj.persist.styleData.noteStyleSimul = v
return updateStyleData(obj)
end),
}
end
-- Live settings
if self.persist.liveSetting == nil then
local frame = newSettingFrame()
local vanish = {
[0] = L"setting:live:vanish:none",
L"setting:live:vanish:hidden",
L"setting:live:vanish:sudden"
}
self.persist.liveFrame = frame
self.persist.liveSetting = {
switchSetting(frame, L"setting:live:customUnits", "CBF_UNIT_LOAD")
:setPosition(0, 12),
switchSetting(frame, L"setting:live:minimalEffect", "MINIMAL_EFFECT")
:setPosition(0, 64+12),
numberSetting(frame, L"setting:live:noteSpeed", "NOTE_SPEED", {min = 400, max = 3000, snap = 50})
:setPosition(0, 128+12),
numberSetting(frame, L"setting:live:textScaling", "TEXT_SCALING", {
min = 50, max = 100, default = 100, snap = 10, div = 100
})
:setPosition(0, 192+12),
switchSetting(frame, L"setting:live:skillPopup", "SKILL_POPUP")
:setPosition(0, 256+12),
numberSetting(frame, L"setting:live:vanish", "VANISH_TYPE", {min = 0, max = 2, default = 0, display = vanish})
:setPosition(0, 320+12)
}
end
-- Score settings
if self.persist.scoreSetting == nil then
local frame = newSettingFrame()
self.persist.scoreFrame = frame
self.persist.scoreSetting = {
numberSetting(frame, L"setting:stamina:score", "SCORE_ADD_NOTE", {min = 100, max = 8192})
:setPosition(0, 12),
numberSetting(frame, L"setting:stamina:display", "STAMINA_DISPLAY", {min = 1, max = 99})
:setPosition(0, 64+12),
switchSetting(frame, L"setting:stamina:noFail", "STAMINA_FUNCTIONAL")
:setPosition(0, 128+12),
-- DEBUG v4.0.0-beta3
numberSetting(frame, "Perfect Accuracy", "PERFECT_ACCURACY", {min = 0, max = 128})
:setPosition(0, 192+12),
numberSetting(frame, "Great Accuracy", "GREAT_ACCURACY", {min = 0, max = 128})
:setPosition(0, 256+12),
numberSetting(frame, "Good Accuracy", "GOOD_ACCURACY", {min = 0, max = 128})
:setPosition(0, 320+12),
numberSetting(frame, "Bad Accuracy", "BAD_ACCURACY", {min = 0, max = 128})
:setPosition(0, 384+12),
}
end
-- Live UI settings
if self.persist.liveUIFrame == nil then
local frame = newSettingFrame()
local playUI = Setting.get("PLAY_UI")
local elements = {}
local function setPlayUI(_, value)
Setting.set("PLAY_UI", value.real)
for i, v in ipairs(elements) do
if i == value.index then
v:setActive(true)
else
v:setActive(false)
end
end
end
for i, v in ipairs(liveUI.enum()) do
local elem = longSelect(font26, v)
elem:addEventListener("mousereleased", setPlayUI)
elem:setData({real = v, index = i})
if v == playUI then
elem:setActive(true)
end
elements[i] = elem
frame:addElement(elem, 0, (i - 1) * 64)
end
self.persist.liveUIFrame = frame
end
-- Language settings
if self.persist.langFrame == nil then
local frame = newSettingFrame()
local elements = {}
local function setLanguage(elem, value)
L.set(value.language.code)
value.instance.persist.currentLanguage = value.language.code
for _, v in ipairs(elements) do
if v == elem then
v:setActive(true)
else
v:setActive(false)
end
end
end
self.persist.previousLanguage = L.get()
self.persist.currentLanguage = self.persist.previousLanguage
for i, v in ipairs(L.enum()) do
local elem = longSelect(font26, string.format("%s (%s)", v.name, v.code))
elem.width = 678 -- uh
elem:addEventListener("mousereleased", setLanguage)
elem:setData({language = v, instance = self})
if v.code == self.persist.previousLanguage then
elem:setActive(true)
end
elements[i] = elem
frame:addElement(elem, 0, (i - 1) * 64)
end
self.persist.langFrame = frame
end
-- System Information
if self.persist.sysinfoFrame == nil then
self.persist.sysinfoFrame = newSettingFrame()
self.persist.sysinfoFrame:addElement(textUI, 4, 0, font16, systemInfo(), 674)
end
-- About
if self.persist.aboutFrame == nil then
self.persist.aboutFrame = newSettingFrame()
self.persist.aboutFrame:addElement(textUI, 4, 0, font16, aboutString, 674)
end
-- Setting selection cateogry
if self.persist.categoryFrame == nil then
self.persist.categoryFrame = Glow.Frame(0, 86, 240, 548)
self.persist.settings = {
{L"setting:general", self.persist.generalFrame, self.persist.generalSetting, nil, "settings"},
{L"setting:volume", self.persist.volumeFrame, self.persist.volumeSetting, nil, "volume"},
{L"setting:background", self.persist.bgFrame, self.persist.bgSetting, nil, "panorama"},
{L"setting:noteStyle", self.persist.nsFrame, self.persist.nsSetting, nil, "slowMotion"},
{L"setting:live", self.persist.liveFrame, self.persist.liveSetting, nil, "contacts"},
{L"setting:stamina", self.persist.scoreFrame, self.persist.scoreSetting, nil, "whatsHot"},
{L"setting:liveUI", self.persist.liveUIFrame, {}, nil, "aspectRatio"}, -- empty list
{L"setting:language", self.persist.langFrame, {}, nil, "language"}, -- empty list
{L"setting:sysinfo", self.persist.sysinfoFrame, {}, nil, "devInfo"}, -- empty list
{L"setting:about", self.persist.aboutFrame, {}, nil, "info"}, -- empty list
}
local function setSelected(elem, value)
for i, v in ipairs(self.persist.settings) do
if i == value then
v[4]:setActive(true)
Glow.addFrame(v[2])
else
v[4]:setActive(false)
Glow.removeFrame(v[2])
end
end
elem:setActive(true)
self.persist.selectedSetting = value
end
for i, v in ipairs(self.persist.settings) do
local elem = categorySelect(font22, self.assets.images[v[5]], v[1])
elem:addEventListener("mousereleased", setSelected)
elem:setData(i)
self.persist.categoryFrame:addElement(elem, 0, (i - 1) * 48)
v[4] = elem
end
-- Set element position
self.persist.categoryFrame:setElementPosition(self.persist.settings[9][4], 0, 452)
self.persist.categoryFrame:setElementPosition(self.persist.settings[10][4], 0, 500)
end
Glow.addFrame(self.persist.categoryFrame)
end
function gameSetting:start()
-- Settings
self.persist.selectedSetting = 0
self.persist.whiteOverlay = 1
-- General settings
self.persist.currentTheme = Setting.get("COLOR_THEME")
-- Background settings
self.persist.backgroundDim = Setting.get("LIVESIM_DIM") / 100
-- Note style settings
local noteStyle = Setting.get("NOTE_STYLE")
local styleData = {
opacity = 1,
noteImage = self.assets.images.note
}
local preset = noteStyle % 64
assert(preset == 63 or (preset > 0 and preset <= MAX_NOTE_STYLE), "Invalid note style")
if preset == 63 then
local value = math.floor(noteStyle / 64) % 64
styleData.noteStyleFrame = assert(value > 0 and value <= MAX_NOTE_STYLE and value, "Invalid note style frame")
value = math.floor(noteStyle / 4096) % 64
styleData.noteStyleSwing = assert(value > 0 and value <= MAX_NOTE_STYLE and value, "Invalid note style swing")
value = math.floor(noteStyle / 262144) % 64
styleData.noteStyleSimul = assert(value > 0 and value <= MAX_NOTE_STYLE and value, "Invalid note style simul")
else
styleData.noteStyleFrame, styleData.noteStyleSwing, styleData.noteStyleSimul = preset, preset, preset
end
self.persist.defAttr = self.persist.generalSetting[1]:getValue()
self.persist.styleData = styleData
self.persist.styleLayer = {}
self.persist.nsSetting[1]:setValue(styleData.noteStyleFrame)
self.persist.nsSetting[2]:setValue(styleData.noteStyleSwing)
self.persist.nsSetting[3]:setValue(styleData.noteStyleSimul)
updateStyleData(self)
end
function gameSetting:update(dt)
self.persist.categoryFrame:update(dt)
self.persist.whiteOverlay = math.min(math.max(
self.persist.whiteOverlay + dt * (self.persist.selectedSetting == 3 and -2 or 2),
0),
1
)
local set = self.persist.settings[self.persist.selectedSetting]
if set then
set[2]:update(dt)
for _, v in ipairs(set[3]) do v:update(dt) end
end
end
function gameSetting:draw()
local set = self.persist.settings[self.persist.selectedSetting]
-- Background setting specific
if self.persist.whiteOverlay < 1 then
love.graphics.setColor(color.white)
love.graphics.draw(self.persist.background)
love.graphics.setColor(color.compat(0, 0, 0, self.persist.backgroundDim))
love.graphics.rectangle("fill", -88, -43, 1136, 726)
love.graphics.setColor(color.white25PT)
love.graphics.rectangle("fill", 0, 0, 240, 640)
if set then
for i = 1, #set[3] do
love.graphics.rectangle("fill", 246, (i - 1) * 64 + 86, 710, 60, 16, 16)
love.graphics.rectangle("line", 246, (i - 1) * 64 + 86, 710, 60, 16, 16)
end
end
end
if self.persist.whiteOverlay > 0 then
local opacity = interpolation(self.persist.whiteOverlay)
love.graphics.setColor(color.compat(255, 255, 255, opacity))
love.graphics.rectangle("fill", -88, -43, 1136, 726)
if set then
local theme = ColorTheme.get()
love.graphics.setColor(theme[1], theme[2], theme[3], select(4, color.compat(0, 0, 0, opacity)))
love.graphics.rectangle("fill", 240, 86, 6, 597)
end
end
love.graphics.setColor(color.white)
love.graphics.draw(self.data.shadowGradient, -88, 77, 0, 1136, 8)
love.graphics.setColor(ColorTheme.get())
love.graphics.rectangle("fill", -88, 0, 1136, 80)
love.graphics.setColor(color.white)
Util.drawText(self.data.titleText, 480, 24)
-- Note style-specific setting
if self.persist.selectedSetting == 4 then
local curLayer = self.persist.curStyle
love.graphics.setColor(color.hex7F7F7F)
love.graphics.rectangle("fill", 318-64, 400-64, 128, 128, 32, 32)
love.graphics.rectangle("fill", 603-64, 400-64, 128, 128, 32, 32)
love.graphics.rectangle("fill", 888-64, 400-64, 128, 128, 32, 32)
love.graphics.rectangle("fill", 318-64, 560-64, 128, 128, 32, 32)
love.graphics.rectangle("fill", 603-64, 560-64, 128, 128, 32, 32)
love.graphics.rectangle("fill", 888-64, 560-64, 128, 128, 32, 32)
love.graphics.rectangle("line", 318-64, 400-64, 128, 128, 32, 32)
love.graphics.rectangle("line", 603-64, 400-64, 128, 128, 32, 32)
love.graphics.rectangle("line", 888-64, 400-64, 128, 128, 32, 32)
love.graphics.rectangle("line", 318-64, 560-64, 128, 128, 32, 32)
love.graphics.rectangle("line", 603-64, 560-64, 128, 128, 32, 32)
love.graphics.rectangle("line", 888-64, 560-64, 128, 128, 32, 32)
for i = 1, #curLayer do
local xpos = 318
local layer = self.persist.curStyle[i]
local quad = note.quadRegion[layer]
if note.manager.isUncolorableLayer(layer) then
love.graphics.setColor(color.white)
else
love.graphics.setColor(color.compat(curLayer.color[1], curLayer.color[2], curLayer.color[3], 1))
end
local w, h = select(3, quad:getViewport())
if isSimultaneousLayer(layer) then
xpos = 888
elseif note.manager.isSwingLayer(layer) then
xpos = 603
end
love.graphics.draw(self.assets.images.note, quad, xpos, 400, 0, 0.75, 0.75, w*0.5, h*0.5)
end
drawLayerAt(self.persist.styleData, self.persist.styleLayer[1], 318, 560)
drawLayerAt(self.persist.styleData, self.persist.styleLayer[2], 603, 560)
drawLayerAt(self.persist.styleData, self.persist.styleLayer[3], 888, 560)
end
Glow.draw()
self.persist.categoryFrame:draw()
if set then
set[2]:draw()
for _, v in ipairs(set[3]) do v:draw() end
end
end
gameSetting:registerEvent("keyreleased", function(self, k)
if k == "escape" then
return leave(nil, self)
end
end)
return gameSetting
|
local bit = require("bit")
local cjson = require("cjson")
local ffi = require("ffi")
local lshift = bit.lshift
local rshift = bit.rshift
local band = bit.band
local pow = math.pow
local str_find = string.find
local str_len = string.len
local str_sub = string.sub
local str_byte = string.byte
local fopen = io.open
ffi.cdef [[
int inet_pton(int af, const char *src, void *dst);
static const int AF_INET6=10;
static const int AF_INET=2;
]]
local function ip6_to_bin(ip6)
local binip6 = ffi.new('char [16]')
ffi.C.inet_pton(ffi.C.AF_INET6, ip6, binip6);
return binip6
end
local function ip4_to_bin(ip4)
local binip4 = ffi.new('char [4]')
ffi.C.inet_pton(ffi.C.AF_INET, ip4, binip4);
return binip4
end
local function bytes_to_u32(a,b,c,d)
local _int = 0
if a then
_int = _int + lshift(a, 24)
end
if b then
_int = _int + lshift(b, 16)
end
if c then
_int = _int + lshift(c, 8)
end
if d then
_int = _int + d
end
if _int >= 0 then
return _int
else
return _int + pow(2, 32)
end
end
local function split(str, separator)
local start = 1
local index = 1
local array = {}
while true do
local last = str_find(str, separator, start)
if not last then
array[index] = str_sub(str, start, str_len(str))
break
end
array[index] = str_sub(str, start, last - 1)
start = last + str_len(separator)
index = index + 1
end
return array
end
local function read_node(data, node, idx)
local off = idx * 4 + node * 8
return bytes_to_u32(
str_byte(data, off + 1),
str_byte(data, off + 2),
str_byte(data, off + 3),
str_byte(data, off + 4)
)
end
local _M = {
_VERSION = '0.1'
}
local mt = {
__index = _M
}
function _M.new(self, name)
local file = fopen(name)
assert(file, name .. " db file open failed.")
local file_size = file:seek("end")
file:seek("set", 0)
local data = file:read("*all")
file:close()
local meta_len = bytes_to_u32(
str_byte(data, 1),
str_byte(data, 2),
str_byte(data, 3),
str_byte(data, 4)
)
local meta_buf = str_sub(data, 5, meta_len + 4)
local meta = cjson.decode(meta_buf)
assert(#meta.fields > 0, "db file content error")
local dl = 4 + meta_len + meta.total_size
assert(file_size == dl, "db file content error")
return setmetatable({
data = str_sub(data, 5+meta_len, str_len(data)),
meta = meta,
node_count = meta["node_count"],
node_ipv4_start = 0,
}, mt)
end
function _M.find(self, ips, language)
assert(self.meta["languages"][language], "language no support")
local ip_address = ""
local ip_type = 0
if str_find(ips, ":") then
ip_address = ip6_to_bin(ips)
ip_type = 6
assert(self:ipv6(), "ipv6 no support")
else
ip_address = ip4_to_bin(ips)
ip_type = 4
assert(self:ipv4(), "ipv4 no support")
end
local node = 0
if ip_type == 4 then
if self.node_ipv4_start == 0 then
for i = 0, 95 do
if i >= 80 then
node = read_node(self.data, node, 1)
else
node = read_node(self.data, node, 0)
end
end
self.node_ipv4_start = node
else
node = self.node_ipv4_start
end
end
for i = 0, 128 do
local val = band(1, rshift(ip_address[rshift(i, 3)], 7 - (i % 8)))
node = read_node(self.data, node, val)
if node > self.node_count then
break
end
end
if node < self.node_count then
return nil
end
local resolved = node - self.node_count + self.node_count * 8
local size = bytes_to_u32(
0,0,
str_byte(self.data, resolved+1),
str_byte(self.data, resolved+2)
)
local temp = str_sub(self.data, resolved+3, resolved+2+size)
local loc = split(temp, "\t")
local lang_off = self.meta["languages"][language]
if type(lang_off) == "nil" then
return nil
end
local fields = self.meta["fields"]
local length = #fields
local ret = {}
local idx = 1
for i = lang_off + 1, (lang_off + length) do
ret[fields[idx]] = loc[i]
idx = idx + 1
end
return ret
end
function _M.ipv4(self)
return self.meta.ip_version == 1 or self.meta.ip_version == 3
end
function _M.ipv6(self)
return self.meta.ip_version == 2 or self.meta.ip_version == 3
end
return _M
|
notify.registry = {}
notify.registry.n = 0
local function callback(tag)
for k, v in pairs(notify.registry) do
if k ~= "n" and v ~= nil then
local fntag, fn = v[1], v[2]
if tag == fntag then
fn()
end
end
end
end
if not _notifysetup then
notify._setup(callback)
_notifysetup = true
end
--- notify.register(tag, fn()) -> id
--- Registers a function to be called when an Apple notification with the given tag is clicked.
function notify.register(tag, fn)
local id = notify.registry.n + 1
notify.registry[id] = {tag, fn}
notify.registry.n = id
return id
end
--- notify.unregister(id)
--- Unregisters a function to no longer be called when an Apple notification with the given tag is clicked.
function notify.unregister(id)
notify.registry[id] = nil
end
--- notify.unregisterall()
--- Unregisters all functions registered for notification-clicks; called automatically when user config reloads.
function notify.unregisterall()
notify.registry = {}
notify.registry.n = 0
end
|
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
client_script 'client.lua'
server_script 'server.lua'
|
local testArray = {
[0] = 4,
0,
"Background",
1,
0,
0,
"<font color=\"#C80030\">Origin:</font> The Red Prince",
2,
0,
0,
0,
"You are infamous: a brilliant warrior-general exiled from his empire for cavorting with demons. Fallen from grace, you refuse to give up. The throne will be yours again.",
2,
0,
0,
2,
"r",
2,
2,
0,
0,
1,
"Talents",
2,
93,
"Sophisticated",
94,
"Spellsong",
1,
0,
1,
"<font color=\"#C80030\">Origin:</font> Sebille",
2,
0,
1,
0,
"A slave no longer, you still bear the living scar your master used to dominate you. He turned you into an assassin; made you hunt your own kin. Now, you hunt him.",
2,
0,
1,
2,
"r",
2,
2,
0,
1,
1,
"Talents",
2,
90,
"Corpse Eater",
89,
"Ancestral Knowledge",
1,
0,
2,
"<font color=\"#C80030\">Origin:</font> Ifan ben-Mezd",
2,
0,
2,
0,
"A crusader in Lucian's army, you lost your faith as war claimed countless innocents. Now, you're a Lone Wolf mercenary. Your mission? Kill Lucian's son.",
2,
0,
2,
2,
"r",
2,
2,
0,
2,
1,
"Talents",
2,
87,
"Ingenious",
88,
"Thrifty",
1,
0,
3,
"<font color=\"#C80030\">Origin:</font> Beast",
2,
0,
3,
0,
"Your failed rebellion against the Queen nearly destroyed you - so you began a new life on the high seas. Now, your old enemy is back. If you don't stop her, no-one will.",
2,
0,
3,
2,
"r",
2,
2,
0,
3,
1,
"Talents",
2,
91,
"Sturdy",
92,
"Dwarven Guile",
1,
0,
4,
"<font color=\"#C80030\">Origin:</font> Lohse",
2,
0,
4,
0,
"You're a musician: performer, star, and host to all manner of disembodied visitors. Now, one dark voice has silenced them all - and aims to claim your body for itself.",
2,
0,
4,
2,
"r",
2,
2,
0,
4,
1,
"Talents",
2,
87,
"Ingenious",
88,
"Thrifty",
1,
0,
5,
"<font color=\"#C80030\">Origin:</font> Fane",
2,
0,
5,
0,
"You woke up and your world was gone. The last of your kind, you hide behind a charmed mask, searching for the truth about a history that no-one knew existed.",
2,
0,
5,
2,
"r",
2,
2,
0,
5,
1,
"Talents",
2,
62,
"Undead",
87,
"Ingenious",
1,
0,
6,
"<font color=\"#C80030\">Origin:</font> Deku'Deku",
2,
0,
6,
0,
"The last great war wrought devastation on all the races. You remember first-hand the massacre of your people. While the world continued to spin, your resolve only aged like a great tree - battered by time, yet steadfast and unyielding.",
2,
0,
6,
2,
"r",
2,
2,
0,
6,
1,
"Talents",
2,
90,
"Corpse Eater",
89,
"Ancestral Knowledge",
1,
0,
7,
"<font color=\"#C80030\">Origin:</font> Berobreus",
2,
0,
7,
0,
"After breaching the material plane, you find a world ripe with source. Let the feast begin.",
2,
0,
7,
2,
"r",
2,
2,
0,
7,
1,
"Talents",
2,
93,
"Sophisticated",
94,
"Spellsong",
1,
0,
8,
"<font color=\"#C80030\">Origin:</font> Null",
2,
0,
8,
0,
"Upon a mound of corpses, in a strange lab filled with flesh and strange machines, your mind snapped into consciousness. An unending abyss where your soul once resided, you persist with a singular desire - Tearing apart the one who did this to you.",
2,
0,
8,
2,
"r",
2,
2,
0,
8,
1,
"Talents",
2,
90,
"Corpse Eater",
89,
"Ancestral Knowledge",
1,
0,
9,
"<font color=\"#C80030\">Origin:</font> Oberon",
2,
0,
9,
0,
"You awoke to a body made of plush. Roaming the land in search of kin, armed only with your own sense of justice, you sought answers to the nature of your being, yet the Magistry deemed you an abomination. Time to deliver some \"Bear Justice\".",
2,
0,
9,
2,
"r",
2,
2,
0,
9,
1,
"Talents",
2,
62,
"Undead",
91,
"Sturdy",
1,
0,
10,
"<font color=\"#C80030\">Origin:</font> Zebadiah",
2,
0,
10,
0,
"While other \"conscious undead\" exist purely in skeleton form, your flesh persists, rotten skin and all. Others of your kind mindlessly shamble, yet you ponder and roam purposefully. Sure, brains taste good, but that's just how it is.",
2,
0,
10,
2,
"r",
2,
2,
0,
10,
1,
"Talents",
2,
62,
"Undead",
87,
"Ingenious",
1,
0,
11,
"<font color=\"#C80030\">Origin:</font> Harken",
2,
0,
11,
0,
"After a illustrious career as a mercenary, brutally smashing enemies with the legendary Anvilmar, you find yourself adrift on the high seas, captured by the Divine Order.",
2,
0,
11,
2,
"r",
2,
2,
0,
11,
1,
"Talents",
2,
91,
"Sturdy",
92,
"Dwarven Guile",
1,
0,
12,
"<font color=\"#C80030\">Origin:</font> Kor'vash",
2,
0,
12,
0,
"After a stressful career as a mercenary, cleaning up the aftermath of your crazy comrades, you find yourself captured by the Divine Order, charged with being a Sourcerer. If only they knew.",
2,
0,
12,
2,
"r",
2,
2,
0,
12,
1,
"Talents",
2,
93,
"Sophisticated",
94,
"Spellsong",
1,
0,
13,
"<font color=\"#C80030\">Custom:</font> Undead Elf",
2,
0,
13,
0,
"The Undead are considered abominations in Rivellon, an affront to the natural order whose mere presence invites violence. Those who walk among the living must do so masked.",
2,
0,
13,
2,
"r",
2,
2,
0,
13,
1,
"Talents",
2,
62,
"Undead",
90,
"Corpse Eater",
1,
0,
14,
"<font color=\"#C80030\">Custom:</font> Undead Human",
2,
0,
14,
0,
"The Undead are considered abominations in Rivellon, an affront to the natural order whose mere presence invites violence. Those who walk among the living must do so masked.",
2,
0,
14,
2,
"r",
2,
2,
0,
14,
1,
"Talents",
2,
62,
"Undead",
87,
"Ingenious",
1,
0,
15,
"<font color=\"#C80030\">Custom:</font> Dwarf",
2,
0,
15,
0,
"Between haves and have-nots alike, dwarves are fiercely nationalistic. Even the poorest dwarf would die for their dwindling Kingdom. But not all would die for the Queen...",
2,
0,
15,
2,
"r",
2,
2,
0,
15,
1,
"Talents",
2,
91,
"Sturdy",
92,
"Dwarven Guile",
1,
0,
16,
"<font color=\"#C80030\">Custom:</font> Elf",
2,
0,
16,
0,
"The annals of elvendom are written in flesh - elves eat of the dead and absorb their memories. Now, the elves are in peril. An unforgettable hero must rise.",
2,
0,
16,
2,
"r",
2,
2,
0,
16,
1,
"Talents",
2,
90,
"Corpse Eater",
89,
"Ancestral Knowledge",
1,
0,
17,
"<font color=\"#C80030\">Custom:</font> Human",
2,
0,
17,
0,
"Adventurous, confident, flexible, at times even clever, humans are dominant in Rivellon. They always play the hero in their own endless wars… even when they’re the villains.",
2,
0,
17,
2,
"r",
2,
2,
0,
17,
1,
"Talents",
2,
87,
"Ingenious",
88,
"Thrifty",
1,
0,
18,
"<font color=\"#C80030\">Custom:</font> Berobreus",
2,
0,
18,
0,
"After breaching the material plane, you find a world ripe with source. Let the feast begin.",
2,
0,
18,
2,
"r",
2,
2,
0,
18,
1,
"Talents",
2,
93,
"Sophisticated",
94,
"Spellsong",
1,
0,
19,
"<font color=\"#C80030\">Custom:</font> Undead Dwarf",
2,
0,
19,
0,
"The Undead are considered abominations in Rivellon, an affront to the natural order whose mere presence invites violence. Those who walk among the living must do so masked.",
2,
0,
19,
2,
"r",
2,
2,
0,
19,
1,
"Talents",
2,
62,
"Undead",
91,
"Sturdy",
1,
0,
20,
"<font color=\"#C80030\">Custom:</font> Lizard",
2,
0,
20,
0,
"To most, lizards are as exotic and mysterious as the Ancient Empire itself. The outside world knows them as warriors, philosophers and slavers, to be respected... and feared.",
2,
0,
20,
2,
"r",
2,
2,
0,
20,
1,
"Talents",
2,
93,
"Sophisticated",
94,
"Spellsong",
1,
0,
21,
"<font color=\"#C80030\">Custom:</font> Undead Lizard",
2,
0,
21,
0,
"The Undead are considered abominations in Rivellon, an affront to the natural order whose mere presence invites violence. Those who walk among the living must do so masked.",
2,
0,
21,
2,
"r",
2,
2,
0,
21,
1,
"Talents",
2,
62,
"Undead",
93,
"Sophisticated",
4,
1,
"Build Preset",
4,
9,
"Build Preset",
1,
1,
0,
"Battlemage",
2,
1,
0,
3,
"Amplifies brute strength with powerful magic.",
2,
1,
0,
2,
"s",
3,
1,
9,
0,
"Battlemage",
1,
1,
1,
"Cleric",
2,
1,
1,
3,
"Heals allies or smashes skulls, depending on the direction of the winds",
2,
1,
1,
2,
"s",
3,
1,
9,
1,
"Cleric",
1,
1,
2,
"Conjurer",
2,
1,
2,
3,
"Conjures a trusty personal demon and elemental totems to aid in battle",
2,
1,
2,
2,
"s",
3,
1,
9,
2,
"Conjurer",
1,
1,
3,
"Enchanter",
2,
1,
3,
3,
"Prefers to turn the tide of battle from afar, manipulating foes with powerful magic",
2,
1,
3,
2,
"s",
3,
1,
9,
3,
"Enchanter",
1,
1,
4,
"Fighter",
2,
1,
4,
3,
"Brutal warrior and expert in close combat",
2,
1,
4,
2,
"s",
3,
1,
9,
4,
"Fighter",
1,
1,
5,
"Inquisitor",
2,
1,
5,
3,
"A daring mace-wielder risking life and limb to decimate evil head-on",
2,
1,
5,
2,
"s",
3,
1,
9,
5,
"Inquisitor",
1,
1,
6,
"Knight",
2,
1,
6,
3,
"Specialised in war tactics, knights are trained not only to fight, but to rally troops",
2,
1,
6,
2,
"s",
3,
1,
9,
6,
"Knight",
1,
1,
7,
"Metamorph",
2,
1,
7,
3,
"Adapts to dangerous situations with transformational tricks of nature",
2,
1,
7,
2,
"s",
3,
1,
9,
7,
"Metamorph",
1,
1,
8,
"Ranger",
2,
1,
8,
3,
"A marksman with a legendary knack for self-preservation",
2,
1,
8,
2,
"s",
3,
1,
9,
8,
"Ranger",
1,
1,
9,
"Rogue",
2,
1,
9,
3,
"With a lot of skill and a little luck, this rogue sees the world as an open coffer",
2,
1,
9,
2,
"s",
3,
1,
9,
9,
"Rogue",
1,
1,
10,
"Shadowblade",
2,
1,
10,
3,
"A powerful assassin whose arsenal of both daggers and magic would terrify any enemy, if they ever saw it coming.",
2,
1,
10,
2,
"s",
3,
1,
9,
10,
"Shadowblade",
1,
1,
11,
"Wayfarer",
2,
1,
11,
3,
"A survivalist and a practitioner of magic, the Wayfarer is hard to hit and even harder to evade.",
2,
1,
11,
2,
"s",
3,
1,
9,
11,
"Wayfarer",
1,
1,
12,
"Witch",
2,
1,
12,
3,
"An intimidating presence whose bone-chilling powers terrify friend and foe alike",
2,
1,
12,
2,
"s",
3,
1,
9,
12,
"Witch",
1,
1,
13,
"Wizard",
2,
1,
13,
3,
"A scholar of magic specialised in starting and ending battles with a flick of the wrist, exacting swift victory from a safe distance",
2,
1,
13,
2,
"s",
3,
1,
9,
13,
"Wizard",
1,
1,
14,
"Assassin",
2,
1,
14,
3,
"A contract killer who slays their prey with a pair of deadly blades, whether motivated by political, religious, or financial means",
2,
1,
14,
2,
"s",
3,
1,
9,
14,
"Assassin",
1,
1,
15,
"Blademaster",
2,
1,
15,
3,
"A wanderer who wields a foreign blade, slaying evil as they pursue their own code of justice",
2,
1,
15,
2,
"s",
3,
1,
9,
15,
"Blademaster",
1,
1,
16,
"Chaos Weaver",
2,
1,
16,
3,
"Sorcerors who wield the power of Chaos, leveraging luck and foresight to lay waste upon the battlefield",
2,
1,
16,
2,
"s",
3,
1,
9,
16,
"Chaos Weaver",
1,
1,
17,
"Dragon Slayer",
2,
1,
17,
3,
"A former marksman from a long-forgotten regiment, tasked with destroying dragonkind. With their unyielding strength, Dragon Slayers utilize Greatbows to pierce their enemies with arrows the size of spears",
2,
1,
17,
2,
"s",
3,
1,
9,
17,
"Dragon Slayer",
1,
1,
18,
"Shieldmaster",
2,
1,
18,
3,
"A warrior who strives to defend the innocent through a unique style that utilizes dual shields",
2,
1,
18,
2,
"s",
3,
1,
9,
18,
"Shieldmaster",
1,
1,
19,
"Fencer",
2,
1,
19,
3,
"A former gladiator whose repertoire of blade skills once amazed crowds and foes alike",
2,
1,
19,
2,
"s",
3,
1,
9,
19,
"Fencer",
1,
1,
20,
"Halberdier",
2,
1,
20,
3,
"A warrior who wields the deadly halberd, a combination of spear and axe, taking advantage of the reach and versatility it offers",
2,
1,
20,
2,
"s",
3,
1,
9,
20,
"Halberdier",
1,
1,
21,
"Monk (Strength)",
2,
1,
21,
3,
"Disciplined warriors who wield metal quarterstaffs, overwhelming enemies with strength and sheer force of will.",
2,
1,
21,
2,
"s",
3,
1,
9,
21,
"Monk (Strength)",
1,
1,
22,
"Monk (Finesse)",
2,
1,
22,
3,
"Disciplined warriors who wield quarterstaffs, overwhelming enemies with finesse and sheer force of will",
2,
1,
22,
2,
"s",
3,
1,
9,
22,
"Monk (Finesse)",
1,
1,
23,
"Pirate",
2,
1,
23,
3,
"Adventurers who sail the high seas in search of treasure and opportunity. Equipped with a flintlock pistol, pirates tend to fire explosive lead when their enemies least expect it",
2,
1,
23,
2,
"s",
3,
1,
9,
23,
"Pirate",
1,
1,
24,
"Reaper",
2,
1,
24,
3,
"A rare type of warrior that wields an intimidating scythe. Some believe them to be soldiers of Death, as their prowess with curved blades is second only to their innate affinity with Necromancy.",
2,
1,
24,
2,
"s",
3,
1,
9,
24,
"Reaper",
1,
1,
25,
"Rifleman",
2,
1,
25,
3,
"A marksman armed with a new weapon predicted to change the art of war - The Rifle. Steel, wood, and a mysterious alchemical compound combine to create explosions that propel lead at break-neck speeds, piercing armor and flesh with ease",
2,
1,
25,
2,
"s",
3,
1,
9,
25,
"Rifleman",
1,
1,
26,
"Runic Knight",
2,
1,
26,
3,
"Adept mages who train in the ways of the sword, using special 'Runeblades' as a conduit to enhance their magic. Crafty use of the runes etched upon their blades allow Runic Knights to weave their attacks and spells together, devastating the battlefield",
2,
1,
26,
2,
"s",
3,
1,
9,
26,
"Runic Knight",
4,
4,
"Face",
4,
7,
"Facial Features",
4,
5,
"Hair Style",
4,
3,
"Skin Colour",
4,
6,
"Hair Colour",
4,
8,
"Voice",
1,
4,
0,
"Face 1",
1,
4,
1,
"Face 2",
1,
4,
2,
"Face 3",
1,
4,
3,
"Face 4",
1,
4,
4,
"Face 5",
1,
4,
5,
"Face 6",
1,
4,
6,
"Face 7",
1,
4,
7,
"Face 8",
1,
4,
8,
"Face 9",
1,
4,
9,
"Face 10",
1,
4,
10,
"Face 11",
1,
4,
11,
"Face 12",
1,
4,
12,
"Face 13",
1,
4,
13,
"Face 14",
1,
4,
14,
"Face 15",
1,
4,
15,
"Face 16",
1,
7,
0,
"None",
1,
7,
1,
"Facial Feature 1",
1,
7,
2,
"Facial Feature 2",
1,
7,
3,
"Facial Feature 3",
1,
7,
4,
"Facial Feature 4",
1,
7,
5,
"Facial Feature 5",
1,
7,
6,
"Facial Feature 6",
1,
7,
7,
"Facial Feature 7",
1,
7,
8,
"Facial Feature 8",
1,
7,
9,
"Facial Feature 9",
1,
7,
10,
"Facial Feature 10",
1,
7,
11,
"Facial Feature 11",
1,
7,
12,
"Facial Feature 12",
1,
7,
13,
"Facial Feature 13",
1,
7,
14,
"Facial Feature 14",
1,
7,
15,
"Facial Feature 15",
1,
7,
16,
"Facial Feature 16",
1,
7,
17,
"Facial Feature 17",
1,
7,
18,
"Facial Feature 18",
1,
7,
19,
"Facial Feature 19",
1,
7,
20,
"Facial Feature 20",
1,
7,
21,
"Facial Feature 21",
1,
7,
22,
"Facial Feature 22",
1,
7,
23,
"Facial Feature 23",
1,
7,
24,
"Facial Feature 24",
1,
7,
25,
"Facial Feature 25",
1,
7,
26,
"Facial Feature 26",
1,
5,
0,
"Hair Style 1",
1,
5,
1,
"Hair Style 2",
1,
5,
2,
"Hair Style 3",
1,
5,
3,
"Hair Style 4",
1,
5,
4,
"Hair Style 5",
1,
5,
5,
"Hair Style 6",
1,
5,
6,
"Hair Style 7",
1,
5,
7,
"Hair Style 8",
1,
5,
8,
"Hair Style 9",
1,
5,
9,
"Hair Style 10",
1,
5,
10,
"Hair Style 11",
1,
5,
11,
"Hair Style 12",
1,
5,
12,
"Hair Style 13",
1,
5,
13,
"Hair Style 14",
1,
5,
14,
"Hair Style 15",
1,
5,
15,
"Hair Style 16",
1,
5,
16,
"Hair Style 17",
1,
5,
17,
"Hair Style 18",
1,
5,
18,
"Hair Style 19",
1,
5,
19,
"Hair Style 20",
1,
5,
20,
"Hair Style 21",
1,
5,
21,
"Hair Style 22",
1,
5,
22,
"Hair Style 23",
1,
3,
0,
"Amethyst",
1,
6,
0,
"Zincite",
1,
6,
1,
"Padparadscha",
1,
6,
2,
"Moonstone",
1,
6,
3,
"Smoked Topaz",
1,
6,
4,
"Fire Opal",
1,
6,
5,
"Almandine",
1,
6,
6,
"Rose Alabaster",
1,
6,
7,
"Feldspar",
1,
6,
8,
"Tanzanite",
1,
6,
9,
"Corundum",
1,
6,
10,
"Amethyst",
1,
6,
11,
"Cobalt",
1,
6,
12,
"Light Sapphire",
1,
6,
13,
"Heliotrope",
1,
6,
14,
"Fluorite",
1,
6,
15,
"Still Water",
1,
6,
16,
"Chrysolite",
1,
6,
17,
"Peridot",
1,
6,
18,
"Lilac",
1,
6,
19,
"Silver",
1,
6,
20,
"Child of Light",
1,
6,
21,
"Whimsical Wisteria",
1,
6,
22,
"Princess Peach",
1,
6,
23,
"Vivid Tangerine",
1,
6,
24,
"Blue Slate",
1,
6,
25,
"Cool Breeze",
1,
6,
26,
"Astarte",
1,
6,
27,
"Jade",
1,
6,
28,
"White Smoke",
1,
6,
29,
"Glossy Grape",
1,
6,
30,
"Lemon Quartz",
1,
6,
31,
"Smokescreen",
1,
6,
32,
"Alpha Quartz",
1,
6,
33,
"Grassy Knoll",
1,
6,
34,
"Ogre Green",
1,
6,
35,
"Mountain Meadow",
1,
6,
36,
"Pink Void",
1,
6,
37,
"Orchid",
1,
6,
38,
"Violet Visionary",
1,
6,
39,
"Pink Pixie",
1,
6,
40,
"Cupid",
1,
6,
41,
"Soulsap",
1,
6,
42,
"Asphyxia",
1,
6,
43,
"Sunset Orange",
1,
6,
44,
"Sandman",
1,
6,
45,
"Smashed Pumpkin",
1,
6,
46,
"Violator",
1,
6,
47,
"Rosso Quattro",
1,
6,
48,
"Bloodstone",
1,
6,
49,
"Madder Lake",
1,
6,
50,
"Last Sin",
1,
6,
51,
"Burn Out",
1,
6,
52,
"Folklore Fuscia",
1,
6,
53,
"Sapphire",
1,
6,
54,
"Scarlet",
1,
6,
55,
"Heroine",
1,
6,
56,
"Deep Mauve",
1,
6,
57,
"Caramel",
1,
6,
58,
"Blood Brew",
1,
6,
59,
"Bright Sky",
1,
6,
60,
"Deep Freeze",
1,
6,
61,
"Blizzard Blue",
1,
6,
62,
"Sea Nymph",
1,
6,
63,
"Gentle Earth",
1,
6,
64,
"Wild Blue Yonder",
1,
6,
65,
"Shadow Blue",
1,
6,
66,
"Spring Meadow",
1,
6,
67,
"Electra",
1,
6,
68,
"The Cure",
1,
6,
69,
"Mermaid",
1,
6,
70,
"Eucalyptus",
1,
6,
71,
"Kryptonite",
1,
6,
72,
"Wintergreen Dream",
1,
6,
73,
"Hunter's Edge",
1,
6,
74,
"Lucky",
1,
6,
75,
"Pixie Dust",
1,
6,
76,
"Celestial Blue",
1,
6,
77,
"Slate Blue",
1,
6,
78,
"High Tide",
1,
6,
79,
"Royal Purple",
1,
6,
80,
"Stelvio",
1,
6,
81,
"Siren",
1,
6,
82,
"Ultramarine Blue",
1,
6,
83,
"Void Dragon",
1,
6,
84,
"Charcoal Gray",
1,
6,
85,
"Death Knight",
1,
6,
86,
"Van Dyke Brown",
1,
6,
87,
"Violet Visionary",
1,
6,
88,
"Black Opal",
1,
6,
89,
"Purple Mountains' Majesty",
1,
6,
90,
"Zombie Troll",
1,
6,
91,
"Chathams Blue",
1,
6,
92,
"Kush",
1,
6,
93,
"Dark Craft",
1,
6,
94,
"Deepest Mode",
1,
6,
95,
"Midnight Oil",
1,
6,
96,
"Moonstone",
1,
8,
0,
"The Red Prince"
}
return testArray
|
object_tangible_loot_creature_loot_collections_aurebesh_tile_orenth = object_tangible_loot_creature_loot_collections_shared_aurebesh_tile_orenth:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_aurebesh_tile_orenth, "object/tangible/loot/creature/loot/collections/aurebesh_tile_orenth.iff")
|
function lutro.graphics.setBackgroundColorTest()
red = 115
green = 27
blue = 135
alpha = 50
color = { red, green, blue, alpha }
lutro.graphics.setBackgroundColor(color)
lutro.graphics.setBackgroundColor(red, green, blue, alpha)
end
function lutro.graphics.getBackgroundColorTest()
r, g, b, a = lutro.graphics.getBackgroundColor()
unit.assertEquals(r, 115)
unit.assertEquals(g, 27)
unit.assertEquals(b, 135)
unit.assertEquals(a, 50)
end
return {
lutro.graphics.setBackgroundColorTest,
lutro.graphics.getBackgroundColorTest
}
|
local agreementKey = KEYS[1]
local agreementTxListKey = KEYS[2]
local txId = ARGV[1]
local txCounterField = ARGV[2]
local addedTx = redis.call("SADD", agreementTxListKey, txId)
if addedTx ~= 1 then
return redis.call("HGET", agreementKey, txCounterField)
end
return redis.call("HINCRBY", agreementKey, txCounterField, 1)
|
local http_cache = http_cache
local FILE = {__index = {}}
local FILE_INDEX = FILE.__index
function FILE_INDEX:Initialize(url)
self.url = url
self.xurl = http_cache.StringXOR(url)
local name, etag, lastmodified, lastvalidation, maxage, crc32 = http_cache.GetInfo(self.xurl)
if name ~= false then
local content = file.Read("http_cache/" .. name .. ".dat", "DATA")
if content == nil or tonumber(util.CRC(content)) ~= crc32 then
file.Delete("http_cache/" .. name .. ".dat")
self.name = http_cache.GenerateRandomName()
return self:Fetch()
end
self.name = name
self.etag = etag
self.lastmodified = lastmodified
self.lastvalidation = lastvalidation
self.maxage = maxage
self.crc32 = crc32
self.content = content
-- verify the output of this
return not self:IsValid() and self:Fetch()
end
self.name = http_cache.GenerateRandomName()
return self:Fetch()
end
function FILE_INDEX:IsValid()
return self.lastvalidation ~= nil and self.maxage ~= nil and http_cache.GetUTCTime() - self.lastvalidation < self.maxage
end
function FILE_INDEX:Fetch(force)
if not force and self:IsValid() then
return false
end
local reqheaders
if self.etag ~= nil then
reqheaders = reqheaders or {}
reqheaders["If-None-Match"] = self.etag
end
if self.lastmodified ~= nil then
reqheaders = reqheaders or {}
reqheaders["If-Modified-Since"] = self.lastmodified
end
http.Fetch(
self.url,
function(body, len, resheaders, code)
self:Success(code, resheaders, body)
end,
function(err)
self:Failure(err)
end,
reqheaders
)
return true
end
function FILE_INDEX:Success(code, resheaders, body)
if code ~= 200 and code ~= 304 then
return self:Failure(code)
end
print(self.url, code, #body)
PrintTable(resheaders)
self.etag = resheaders["ETag"] or self.etag
self.lastmodified = resheaders["Last-Modified"] or self.lastmodified
self.lastvalidation = http_cache.GetUTCTime()
local maxage = resheaders["Cache-Control"] ~= nil and string.match(resheaders["Cache-Control"], "max%-age=(%d+)")
self.maxage = maxage ~= nil and tonumber(maxage) or (self.maxage or 0)
if code == 200 then
self.crc32 = util.CRC(body)
self.content = body
file.Write("http_cache/" .. self.name .. ".dat", body)
end
http_cache.UpdateInfo(self.xurl, self.name, self.etag, self.lastmodified, self.lastvalidation, self.maxage, self.crc32)
return true
end
function FILE_INDEX:Failure(err)
print(self.url, err)
return false
end
function http_cache.Create(url)
local obj = setmetatable({}, FILE)
obj:Initialize(url)
return obj
end
return http_cache.Create
|
-- Objects
local FHH = Instance.new("ScreenGui")
local main = Instance.new("Frame")
local title = Instance.new("TextLabel")
local main2 = Instance.new("Frame")
local handcuff = Instance.new("TextButton")
local gamepass = Instance.new("TextButton")
local inviswalls = Instance.new("TextButton")
local roomdoors = Instance.new("TextButton")
local fly = Instance.new("TextButton")
local TextLabel = Instance.new("TextLabel")
local noclip = Instance.new("TextButton")
-- Properties
FHH.Name = "FHH"
FHH.Parent = game.CoreGui
main.Name = "main"
main.Parent = FHH
main.Active = true
main.BackgroundColor3 = Color3.new(0.666667, 0, 0)
main.BackgroundTransparency = 0.5
main.Draggable = true
main.Position = UDim2.new(0.0468846373, 0, 0.183374077, 0)
main.Size = UDim2.new(0, 297, 0, 384)
title.Name = "title"
title.Parent = main
title.BackgroundColor3 = Color3.new(1, 0, 0)
title.BackgroundTransparency = 1
title.BorderSizePixel = 0
title.Size = UDim2.new(0, 297, 0, 50)
title.Font = Enum.Font.SourceSansLight
title.FontSize = Enum.FontSize.Size14
title.Text = "Fuck Hilton Hotel"
title.TextColor3 = Color3.new(1, 1, 1)
title.TextScaled = true
title.TextSize = 14
title.TextWrapped = true
main2.Name = "main2"
main2.Parent = main
main2.BackgroundColor3 = Color3.new(1, 0.333333, 0)
main2.BackgroundTransparency = 0.69999998807907
main2.Position = UDim2.new(0, 0, 0.130208328, 0)
main2.Size = UDim2.new(0, 297, 0, 334)
handcuff.Name = "handcuff"
handcuff.Parent = main2
handcuff.BackgroundColor3 = Color3.new(1, 1, 1)
handcuff.BackgroundTransparency = 0.5
handcuff.Size = UDim2.new(0, 297, 0, 50)
handcuff.Font = Enum.Font.SourceSansLight
handcuff.FontSize = Enum.FontSize.Size14
handcuff.Text = "Handcuff Bypass"
handcuff.TextScaled = true
handcuff.TextSize = 14
handcuff.TextWrapped = true
gamepass.Name = "gamepass"
gamepass.Parent = main2
gamepass.BackgroundColor3 = Color3.new(1, 1, 1)
gamepass.BackgroundTransparency = 0.5
gamepass.Position = UDim2.new(0, 0, 0.149700597, 0)
gamepass.Size = UDim2.new(0, 297, 0, 50)
gamepass.Font = Enum.Font.SourceSansLight
gamepass.FontSize = Enum.FontSize.Size14
gamepass.Text = "Remove Gamepass Doors"
gamepass.TextScaled = true
gamepass.TextSize = 14
gamepass.TextWrapped = true
inviswalls.Name = "inviswalls"
inviswalls.Parent = main2
inviswalls.BackgroundColor3 = Color3.new(1, 1, 1)
inviswalls.BackgroundTransparency = 0.5
inviswalls.Position = UDim2.new(0, 0, 0.299401194, 0)
inviswalls.Size = UDim2.new(0, 297, 0, 50)
inviswalls.Font = Enum.Font.SourceSansLight
inviswalls.FontSize = Enum.FontSize.Size14
inviswalls.Text = "Remove Invisible Walls"
inviswalls.TextScaled = true
inviswalls.TextSize = 14
inviswalls.TextWrapped = true
roomdoors.Name = "roomdoors"
roomdoors.Parent = main2
roomdoors.BackgroundColor3 = Color3.new(1, 1, 1)
roomdoors.BackgroundTransparency = 0.5
roomdoors.Position = UDim2.new(0, 0, 0.449101806, 0)
roomdoors.Size = UDim2.new(0, 297, 0, 50)
roomdoors.Font = Enum.Font.SourceSansLight
roomdoors.FontSize = Enum.FontSize.Size14
roomdoors.Text = "Remove all room doors."
roomdoors.TextScaled = true
roomdoors.TextSize = 14
roomdoors.TextWrapped = true
fly.Name = "fly"
fly.Parent = main2
fly.BackgroundColor3 = Color3.new(1, 1, 1)
fly.BackgroundTransparency = 0.5
fly.Position = UDim2.new(0, 0, 0.598802388, 0)
fly.Size = UDim2.new(0, 297, 0, 50)
fly.Font = Enum.Font.SourceSansLight
fly.FontSize = Enum.FontSize.Size14
fly.Text = "Fly (Toggle: E)"
fly.TextScaled = true
fly.TextSize = 14
fly.TextWrapped = true
TextLabel.Parent = main2
TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
TextLabel.BackgroundTransparency = 1
TextLabel.Position = UDim2.new(0, 0, 0.901197612, 0)
TextLabel.Size = UDim2.new(0, 297, 0, 33)
TextLabel.Font = Enum.Font.SourceSansLight
TextLabel.FontSize = Enum.FontSize.Size14
TextLabel.Text = "Created by GtaMasterYT"
TextLabel.TextScaled = true
TextLabel.TextSize = 14
TextLabel.TextWrapped = true
TextLabel.TextXAlignment = Enum.TextXAlignment.Left
noclip.Name = "noclip"
noclip.Parent = main2
noclip.BackgroundColor3 = Color3.new(1, 1, 1)
noclip.BackgroundTransparency = 0.5
noclip.Position = UDim2.new(0, 0, 0.74850297, 0)
noclip.Size = UDim2.new(0, 297, 0, 50)
noclip.Font = Enum.Font.SourceSansLight
noclip.FontSize = Enum.FontSize.Size14
noclip.Text = "NoClip (Toggle: F)"
noclip.TextScaled = true
noclip.TextSize = 14
noclip.TextWrapped = true
handcuff.MouseButton1Down:connect(function()
local Playr = "LocalPlayer"
local Anchored = false
if Anchored == true then
local Anchored2 = false
else
local Anchored2 = true
end
game.Players[Playr].Character["Head"].Anchored = Anchored
game.Players[Playr].Character["Torso"].Anchored = Anchored
game.Players[Playr].Character["Right Arm"].Anchored = Anchored
game.Players[Playr].Character["Left Arm"].Anchored = Anchored
game.Players[Playr].Character["Right Leg"].Anchored = Anchored
game.Players[Playr].Character["Left Leg"].Anchored = Anchored
wait(2)
game.Players[Playr].Character["Head"].Anchored = Anchored2
game.Players[Playr].Character["Torso"].Anchored = Anchored2
game.Players[Playr].Character["Right Arm"].Anchored = Anchored2
game.Players[Playr].Character["Left Arm"].Anchored = Anchored2
game.Players[Playr].Character["Right Leg"].Anchored = Anchored2
game.Players[Playr].Character["Left Leg"].Anchored = Anchored2
end)
inviswalls.MouseButton1Down:connect(function()
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "GroupDoorArea" then
v:Destroy()
end
end
end)
gamepass.MouseButton1Down:connect(function()
while true do
wait()
game.Workspace.GamepassDoorArea:Destroy()
end
end)
roomdoors.MouseButton1Down:connect(function()
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "SuiteRoom" or v.Name == "Room" then
for a,b in pairs(v:GetChildren()) do
if b.Name == "RoomDoor" then
b:Destroy()
end
end
end
end
end)
fly.MouseButton1Down:connect(function()
repeat wait()
until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
local mouse = game.Players.LocalPlayer:GetMouse()
repeat wait() until mouse
local plr = game.Players.LocalPlayer
local torso = plr.Character.Torso
local flying = true
local deb = true
local ctrl = {f = 0, b = 0, l = 0, r = 0}
local lastctrl = {f = 0, b = 0, l = 0, r = 0}
local maxspeed = 50
local speed = 0
function Fly()
local bg = Instance.new("BodyGyro", torso)
bg.P = 9e4
bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
bg.cframe = torso.CFrame
local bv = Instance.new("BodyVelocity", torso)
bv.velocity = Vector3.new(0,0.1,0)
bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
repeat wait()
plr.Character.Humanoid.PlatformStand = true
if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
speed = speed+.5+(speed/maxspeed)
if speed > maxspeed then
speed = maxspeed
end
elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
speed = speed-1
if speed < 0 then
speed = 0
end
end
if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
else
bv.velocity = Vector3.new(0,0.1,0)
end
bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
until not flying
ctrl = {f = 0, b = 0, l = 0, r = 0}
lastctrl = {f = 0, b = 0, l = 0, r = 0}
speed = 0
bg:Destroy()
bv:Destroy()
plr.Character.Humanoid.PlatformStand = false
end
mouse.KeyDown:connect(function(key)
if key:lower() == "e" then
if flying then flying = false
else
flying = true
Fly()
end
elseif key:lower() == "w" then
ctrl.f = 1
elseif key:lower() == "s" then
ctrl.b = -1
elseif key:lower() == "a" then
ctrl.l = -1
elseif key:lower() == "d" then
ctrl.r = 1
end
end)
mouse.KeyUp:connect(function(key)
if key:lower() == "w" then
ctrl.f = 0
elseif key:lower() == "s" then
ctrl.b = 0
elseif key:lower() == "a" then
ctrl.l = 0
elseif key:lower() == "d" then
ctrl.r = 0
end
end)
Fly()
end)
noclip.MouseButton1Down:connect(function()
local noclip = false
game:GetService('RunService').Stepped:connect(function()
if noclip then
game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
end
end)
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
if key == 'f' then
noclip = not noclip
game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
end
end)
end)
|
local awful = require("awful")
local common = require("common")
local modkey = common.modkey
local ctrlkey = common.ctrlkey
-- Focus related keybindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
awful.key({ modkey, ctrlkey }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, ctrlkey }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, ctrlkey }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:activate { raise = true, context = "key.unminimize" }
end
end,
{description = "restore minimized", group = "client"}),
})
|
------------------------------------------------------------------------------
--
-- Ce travail est sous liscence:
-- Creative Commons Attribution-NonCommercial-NoDerivatives-NoDistribution 4.0 International License.
--
------------------------------------------------------------------------------
local PosWidth = -1130.0
local PosHeight = -200.0
local SpriteIndex = {
Items = {"cannabis", "cocaine", "meth", "heroine"},
Labels = {"Cannabis", "Cocaïne", "Meth", "Heroine"},
Index = 1,
Sprites = {"mp_specitem_weed", "mp_specitem_coke", "mp_specitem_meth", "mp_specitem_heroin"},
Count = 0,
PrixDeVente = 10,
PrixMoyen = {10, 80, 40, 40},
AchatMoyen = 0,
NombreDrogue = {0, 0, 0, 0},
NiveauQuartie = 1,
XPQuartie = 1
}
local MenuOpened = false
local Quartie
local isPressed = false
local pressedTime = 0
local inVente_ = false
RegisterCommand('+menurep', function()
if not inVente_ then
if not MenuOpened then
local PlyPos = GetEntityCoords(PlayerPedId())
Quartie = GetLabelText(GetNameOfZone(PlyPos.x, PlyPos.y, PlyPos.z))
TriggerServerCallback("InitialCore:hasObject", function(hasObject, Nombre)
if hasObject then
SpriteIndex.NombreDrogue[1] = Nombre
else
SpriteIndex.NombreDrogue[1] = 0
end
end, 'cannabis')
TriggerServerCallback("InitialCore:hasObject", function(hasObject, Nombre)
if hasObject then
SpriteIndex.NombreDrogue[2] = Nombre
else
SpriteIndex.NombreDrogue[2] = 0
end
end, 'cocaine')
TriggerServerCallback("InitialCore:hasObject", function(hasObject, Nombre)
if hasObject then
SpriteIndex.NombreDrogue[3] = Nombre
else
SpriteIndex.NombreDrogue[3] = 0
end
end, 'meth')
TriggerServerCallback("InitialCore:hasObject", function(hasObject, Nombre)
if hasObject then
SpriteIndex.NombreDrogue[4] = Nombre
else
SpriteIndex.NombreDrogue[4] = 0
end
end, 'heroine')
TriggerServerCallback("getInfoQuartie", function(isQuartieLegal, XP)
if isQuartieLegal then
SpriteIndex.XPQuartie = XP
if SpriteIndex.XPQuartie >= 1 and SpriteIndex.XPQuartie <= 9999 then
SpriteIndex.NiveauQuartie = 1
elseif SpriteIndex.XPQuartie >= 10000 and SpriteIndex.XPQuartie <= 19999 then
SpriteIndex.NiveauQuartie = 2
elseif SpriteIndex.XPQuartie >= 20000 and SpriteIndex.XPQuartie <= 29999 then
SpriteIndex.NiveauQuartie = 3
elseif SpriteIndex.XPQuartie >= 30000 and SpriteIndex.XPQuartie <= 39999 then
SpriteIndex.NiveauQuartie = 4
elseif SpriteIndex.XPQuartie >= 40000 and SpriteIndex.XPQuartie <= 49999 then
SpriteIndex.NiveauQuartie = 5
end
PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
MenuOpened = true
openMenuRep()
else
AdvancedNotif('Gestion vente illégal.', '~r~Erreur.', 'Vous n\'êtes pas dans un quartier.', 'CHAR_WE', 'INITIALV')
end
end, Quartie)
end
else
inVente_ = false
AdvancedNotif('Gestion vente illégal.', '~r~Recherche de client.', 'Vous avez terminé la recherche de clients.', 'CHAR_WE', 'INITIALV')
end
end, false)
RegisterCommand('-menurep', function()
end, false)
RegisterKeyMapping('+menurep', 'Rép', 'keyboard', 'F2')
function openMenuRep()
while MenuOpened do
Citizen.Wait(1)
local aUp = 150
local aDown = 150
local aLeft = 150
local aRight = 150
RenderSprite("shared", "bggradient_16x512", 1200.0+PosWidth, 225+PosHeight, 370, 500, 255, 255, 255, 255)
RenderRectangle(1200.0+PosWidth, 225+PosHeight, 370, 40,255,255,255,255)
RenderText("GESTION VENTE",1385.0+PosWidth, 230+PosHeight,2,0.4,0,0,0,255, "Center")
RenderSprite("mpinventory", SpriteIndex.Sprites[SpriteIndex.Index], 1230.0+PosWidth, 288.0+PosHeight, 90, 90, 0, 255, 255, 255, 255)
RenderText(SpriteIndex.Labels[SpriteIndex.Index], 1330.0+PosWidth, 315+PosHeight, 1,0.6,255,255,255,255)
if IsControlPressed(0, 172) then
aUp = 255
end
if IsControlPressed(0, 173) then
aDown = 255
end
if IsControlPressed(0, 174) then
aLeft = 255
end
if IsControlPressed(0, 175) then
aRight = 255
end
RenderSprite("basejumping", "arrow_pointer", 1520.0+PosWidth, 298+PosHeight, 40, 40, 0, 255, 255, 255, aUp)
RenderSprite("basejumping", "arrow_pointer", 1520.0+PosWidth, 378+PosHeight, 40, -40, 0, 255, 255, 255, aDown)
RenderSprite("commonmenu", "arrowleft", 1140.0+PosWidth, 463+PosHeight, 40, 40, 0, 255, 255, 255, aLeft)
RenderSprite("commonmenu", "arrowright", 1590.0+PosWidth, 463+PosHeight, 40, 40, 0, 255, 255, 255, aRight)
RenderText("Prix de vente", 1210.0+PosWidth, 470+PosHeight,0,0.28,255,255,255,255)
RenderText("~g~$" .. SpriteIndex.PrixDeVente, 1565.0+PosWidth, 470+PosHeight,0,0.28,255,255,255,255,"Right")
RenderText("Prix moyen sur le marché", 1210.0+PosWidth, 500+PosHeight,0,0.28,255,255,255,255)
RenderText("~g~$" .. SpriteIndex.PrixMoyen[SpriteIndex.Index], 1565.0+PosWidth, 500+PosHeight,0,0.28,255,255,255,255,"Right")
RenderText("Unité", 1210.0+PosWidth, 530+PosHeight,0,0.28,255,255,255,255)
RenderText(SpriteIndex.NombreDrogue[SpriteIndex.Index], 1565.0+PosWidth, 530+PosHeight,0,0.28,255,255,255,255,"Right")
RenderText("Gains", 1210.0+PosWidth, 560+PosHeight,0,0.28,255,255,255,255)
RenderText("~g~" .. SpriteIndex.NombreDrogue[SpriteIndex.Index]*SpriteIndex.PrixDeVente .. "$", 1565.0+PosWidth, 560+PosHeight,0,0.28,255,255,255,255,"Right")
RenderSprite("commonmenu", "shop_box_tick", 1340.0+PosWidth, 614+PosHeight, 80, 80, 0, 255, 255, 255, 255)
RenderSprite("shared", "bggradient_16x512", 1200.0+PosWidth, 700+PosHeight, 370, 200, 255, 255, 255, 255)
RenderRectangle(1200.0+PosWidth, 700+PosHeight, 370, 40,255,255,255,255)
local PlyPos = GetEntityCoords(PlayerPedId())
if GetLabelText(GetNameOfZone(PlyPos.x, PlyPos.y, PlyPos.z)) ~= Quartie then
MenuOpened = false
AdvancedNotif('Gestion vente illégal.', '~r~Erreur.', 'Vous vous êtes éloigné de la zone.', 'CHAR_WE', 'INITIALV')
end
RenderText("REPUTATION " .. Quartie, 1385.0+PosWidth, 705+PosHeight, 2,0.4,0,0,0,255, "Center")
--print(GetLabelText(GetNameOfZone(PlyPos.x, PlyPos.y, PlyPos.z)))
RenderSprite("timerbars", "damagebarfill_128", 1290.0+PosWidth, 800+PosHeight, 200, 20, 0, 255, 255, 255, 100)
local Width = 1
if SpriteIndex.XPQuartie >= 1 and SpriteIndex.XPQuartie <= 9999 then
Width = SpriteIndex.XPQuartie*100/10000
elseif SpriteIndex.XPQuartie >= 10000 and SpriteIndex.XPQuartie <= 19999 then
Width = SpriteIndex.XPQuartie-10000
Width = Width*100/10000
Width = Width*2
elseif SpriteIndex.XPQuartie >= 20000 and SpriteIndex.XPQuartie <= 29999 then
Width = SpriteIndex.XPQuartie-20000
Width = Width*100/10000
Width = Width*2
--Width = SpriteIndex.XPQuartie*100/30000
elseif SpriteIndex.XPQuartie >= 30000 and SpriteIndex.XPQuartie <= 39999 then
Width = SpriteIndex.XPQuartie-30000
Width = Width*100/10000
Width = Width*2
--Width = SpriteIndex.XPQuartie*100/40000
elseif SpriteIndex.XPQuartie >= 40000 and SpriteIndex.XPQuartie <= 49999 then
Width = SpriteIndex.XPQuartie-40000
Width = Width*100/10000
Width = Width*2
--Width = SpriteIndex.XPQuartie*100/50000
end
--print(Width)
RenderSprite("timerbars", "damagebarfill_128", 1290.0+PosWidth, 800+PosHeight, Width, 20, 0, 255, 255, 255, 255)
RenderSprite("mprankbadge", "globe", 1225.0+PosWidth, 780+PosHeight, 64, 64, 0, 200, 200, 200, 100)
RenderText(SpriteIndex.NiveauQuartie, 1255.0+PosWidth, 787+PosHeight,0,0.60,255,255,255,255,"Center")
RenderText("Prochain niveau ~g~".. SpriteIndex.XPQuartie .."~s~/~y~10000", 1385.0+PosWidth, 820+PosHeight,0,0.20,255,255,255,255, "Center")
RenderSprite("mprankbadge", "globe", 1490.0+PosWidth, 780+PosHeight, 64, 64, 0, 200, 200, 200, 100)
RenderText(SpriteIndex.NiveauQuartie+1, 1520.0+PosWidth, 787+PosHeight,0,0.60,255,255,255,255,"Center")
MenuVenteControl()
end
end
function MenuVenteControl()
if IsControlPressed(0, 172) then
if not isPressed then
isPressed = true
pressedTime = 10
PlaySoundFrontend(-1, "NAV_LEFT_RIGHT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
SpriteIndex.Index = SpriteIndex.Index+1
if SpriteIndex.Index == 5 then
SpriteIndex.Index = 1
end
SpriteIndex.PrixDeVente = SpriteIndex.PrixMoyen[SpriteIndex.Index]
end
end
if IsControlPressed(0, 173) then
if not isPressed then
isPressed = true
pressedTime = 10
PlaySoundFrontend(-1, "NAV_LEFT_RIGHT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
SpriteIndex.Index = SpriteIndex.Index-1
if SpriteIndex.Index == 0 then
SpriteIndex.Index = 4
end
SpriteIndex.PrixDeVente = SpriteIndex.PrixMoyen[SpriteIndex.Index]
end
end
if IsControlPressed(0, 174) then
if not isPressed then
isPressed = true
pressedTime = 10
PlaySoundFrontend(-1, "NAV_LEFT_RIGHT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
SpriteIndex.PrixDeVente = SpriteIndex.PrixDeVente-1
end
end
if IsControlPressed(0, 175) then
if not isPressed then
isPressed = true
pressedTime = 10
PlaySoundFrontend(-1, "NAV_LEFT_RIGHT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
SpriteIndex.PrixDeVente = SpriteIndex.PrixDeVente+1
end
end
if IsControlPressed(0, 177) then
MenuOpened = false
PlaySoundFrontend(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
end
if IsControlPressed(0, 176) then
if SpriteIndex.NombreDrogue[SpriteIndex.Index] >= 1 then
MenuOpened = false
PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
AdvancedNotif('Gestion vente illégal.', '~r~Recherche de client.', 'Vous avez débuté la recherche de clients, pour terminer appuyez sur F2.', 'CHAR_WE', 'INITIALV')
inVente_ = true
inVente()
else
AdvancedNotif('Gestion vente illégal.', '~r~Erreur.', 'Vous n\'avez plus ce type de drogue.', 'CHAR_WE', 'INITIALV')
end
end
if isPressed then
pressedTime = pressedTime-1
if pressedTime <= 0 then
pressedTime = 0
isPressed = false
end
end
end
local oldped = false
function inVente()
while inVente_ do
Citizen.Wait(1)
playerPed = GetPlayerPed(-1)
RenderText("Recherche de clients en cours", 960, 1020, 2, 0.5, 150,0,0,255, "Center")
local PlyPos = GetEntityCoords(PlayerPedId())
if GetLabelText(GetNameOfZone(PlyPos.x, PlyPos.y, PlyPos.z)) ~= Quartie then
inVente_ = false
AdvancedNotif('Gestion vente illégal.', '~r~Erreur.', 'Vous vous êtes éloigné de la zone.', 'CHAR_WE', 'INITIALV')
end
local handle, ped = FindFirstPed()
repeat
success, ped = FindNextPed(handle)
local pos = GetEntityCoords(ped)
local distance = Vdist2(pos.x, pos.y, pos.z, PlyPos.x, PlyPos.y, PlyPos.z)
if not IsPedInAnyVehicle(playerPed) then
if DoesEntityExist(ped) then
if not IsPedDeadOrDying(ped) then
if not IsPedInAnyVehicle(ped) then
local pedType = GetPedType(ped)
if pedType ~= 28 and not IsPedAPlayer(ped) then
currentped = pos
if distance <= 2 and ped ~= playerPed and ped ~= oldped then
--DrawText3Ds(pos.x, pos.y, pos.z, GuTu.Text['press'])
HelpNotif("Appuyez sur ~INPUT_PICKUP~ pour intéragir")
if IsControlJustPressed(1, 38) then
ToggleCancelEmote(false)
ClearPedTasksImmediately(ped)
ClearPedTasksImmediately(playerPed)
--FreezeEntityPosition(ped, true)
--FreezeEntityPosition(playerPed, true)
oldped = ped
local p1 = GetEntityCoords(playerPed, true)
local p2 = GetEntityCoords(ped, true)
local dx = p2.x - p1.x
local dy = p2.y - p1.y
local heading = GetHeadingFromVector_2d(dx, dy)
SetEntityHeading(playerPed, heading)
local p1 = GetEntityCoords(ped, true)
local p2 = GetEntityCoords(playerPed, true)
local dx = p2.x - p1.x
local dy = p2.y - p1.y
local heading = GetHeadingFromVector_2d(dx, dy)
SetEntityHeading(ped, heading)
--SetEntityHeading(ped, 180)
local PlyPos = GetEntityCoords(PlayerPedId())
local PedPos = GetEntityCoords(ped, true)
TaskLookAtCoord(ped, PlyPos.x, PlyPos.y, PlyPos.z, -1, 2048, 3)
TaskLookAtCoord(playerPed, PedPos.x, PedPos.y, PedPos.z, -1, 2048, 3)
TaskStandStill(ped, 100.0)
TaskStandStill(playerPed, 100.0)
SetEntityAsMissionEntity(ped)
-- ####################################################
RequestAnimDict("facials@gen_male@variations@normal")
RequestAnimDict("mp_facial")
RequestAnimDict("mp_common")
local timerConv = 100
PlayFacialAnim(GetPlayerPed(-1), "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PlyPos.x, PlyPos.y, PlyPos.z+1.2, "Yo mec, bien ou quoi?", 1.2, 6)
end
PlayFacialAnim(GetPlayerPed(-1), "mood_normal_1", "facials@gen_male@variations@normal")
local PedPos = GetEntityCoords(ped)
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+1.2, "Tranquille, je peut t'aider?", 1.2, 6)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
local timerConv = 100
PlayFacialAnim(GetPlayerPed(-1), "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PlyPos.x, PlyPos.y, PlyPos.z+1.2, "Je vend de la cam a un bon prix si t'est inttereser", 1.2, 6)
end
PlayFacialAnim(GetPlayerPed(-1), "mood_normal_1", "facials@gen_male@variations@normal")
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+1.2, "Dit moi le prix", 1.2, 6)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
local timerConv = 100
PlayFacialAnim(GetPlayerPed(-1), "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PlyPos.x, PlyPos.y, PlyPos.z+1.2, "C'est " .. SpriteIndex.PrixDeVente .. "$ le gramme", 1.2, 6)
end
PlayFacialAnim(GetPlayerPed(-1), "mood_normal_1", "facials@gen_male@variations@normal")
local chance1 = math.random(1, 12)
local prixchance2 = SpriteIndex.PrixDeVente-SpriteIndex.PrixMoyen[SpriteIndex.Index]
--print(prixchance2)
local chance2 = math.random(1, 10)
--print(chance2)
--chance1 = 1
if chance1 <= SpriteIndex.NiveauQuartie then
if chance2 > prixchance2 then
local nombre = 1
TriggerServerCallback("InitialCore:hasObject", function(hasObject, Nombre)
if hasObject then
SpriteIndex.NombreDrogue[SpriteIndex.Index] = Nombre
if Nombre >= 4 then
local nombrechance = math.random(1, 11)
if nombrechance >= 7 then
nombre = 1
elseif nombrechance >= 4 then
nombre = 2
elseif nombrechance >= 2 then
nombre = 3
else
nombre = 4
end
else
nombre = 1
end
end
end, SpriteIndex.Items[SpriteIndex.Index])
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+1.2, "Ça me vas, je prend " .. nombre .. " gramme(s)", 1.2, 6)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
TaskPlayAnim(playerPed, "mp_common", "givetake1_a", 8.0, 8.0, -1)
TaskPlayAnim(ped, "mp_common", "givetake1_a", 8.0, 8.0, -1)
Wait(2000)
TriggerServerEvent('InitialCore:DeleteItem', GetPlayerServerId(PlayerId()), SpriteIndex.Items[SpriteIndex.Index], nombre)
TriggerServerEvent('InitialCore:GiveMoney', GetPlayerServerId(PlayerId()), SpriteIndex.PrixDeVente*nombre)
TriggerServerCallback("changeRepQuartie", function(XP)
local calc = SpriteIndex.NiveauQuartie-1
CreateRankBar(calc*10000, SpriteIndex.NiveauQuartie*10000, SpriteIndex.XPQuartie, SpriteIndex.XPQuartie+130, SpriteIndex.NiveauQuartie, false)
--CreateRankBar(SpriteIndex.NiveauQuartie-1*10000, SpriteIndex.NiveauQuartie*10000, SpriteIndex.XPQuartie, SpriteIndex.XPQuartie+130, SpriteIndex.NiveauQuartie, false)
end, Quartie, 130)
Wait(500)
if SpriteIndex.NombreDrogue[SpriteIndex.Index]-nombre <= 0 then
inVente_ = false
AdvancedNotif('Gestion vente illégal.', '~r~Erreur.', 'Vous n\'avez plus ce type de drogue sur vous, fin de la vente.', 'CHAR_WE', 'INITIALV')
end
else
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+1.2, "C'est trop chèr, je vais me fournir ailleur", 1.2, 6)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
TriggerServerCallback("changeRepQuartie", function(XP)
--print(XP)
--CreateRankBar(SpriteIndex.XPQuartie, SpriteIndex.NiveauQuartie*10000, SpriteIndex.XPQuartie, SpriteIndex.XPQuartie-50.0, SpriteIndex.NiveauQuartie, true)
--CreateRankBar(150, 800, 175, 700, 5)
--[[local calc2 = SpriteIndex.NiveauQuartie*10000
local calc = SpriteIndex.XPQuartie*100
calc = calc/calc2
calc = calc+100
print(calc)]]
--[[local Width = 1
if SpriteIndex.XPQuartie >= 1 and SpriteIndex.XPQuartie <= 9999 then
Width = SpriteIndex.XPQuartie*100/10000
elseif SpriteIndex.XPQuartie >= 10000 and SpriteIndex.XPQuartie <= 19999 then
Width = SpriteIndex.XPQuartie-10000
Width = Width*100/10000
Width = Width*2
elseif SpriteIndex.XPQuartie >= 20000 and SpriteIndex.XPQuartie <= 29999 then
Width = SpriteIndex.XPQuartie-20000
Width = Width*100/10000
Width = Width*2
--Width = SpriteIndex.XPQuartie*100/30000
elseif SpriteIndex.XPQuartie >= 30000 and SpriteIndex.XPQuartie <= 39999 then
Width = SpriteIndex.XPQuartie-30000
Width = Width*100/10000
Width = Width*2
--Width = SpriteIndex.XPQuartie*100/40000
elseif SpriteIndex.XPQuartie >= 40000 and SpriteIndex.XPQuartie <= 49999 then
Width = SpriteIndex.XPQuartie-40000
Width = Width*100/10000
Width = Width*2
--Width = SpriteIndex.XPQuartie*100/50000
end]]
local calc = SpriteIndex.NiveauQuartie-1
CreateRankBar(calc*10000, SpriteIndex.NiveauQuartie*10000, SpriteIndex.XPQuartie, SpriteIndex.XPQuartie-390, SpriteIndex.NiveauQuartie, true)
print('##############')
print(calc*10000)
print(SpriteIndex.NiveauQuartie*10000)
print(SpriteIndex.XPQuartie)
print(SpriteIndex.XPQuartie-390)
print('##############')
--CreateRankBar(10000, 20000, 15000, 17500, 5)
end, Quartie, -390)
end
else
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+1.2, "J'ai pas confiance en toi", 1.2, 6)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
end
-- ####################################################
ClearPedTasksImmediately(ped)
ClearPedTasksImmediately(playerPed)
ToggleCancelEmote(true)
SetPedAsNoLongerNeeded(oldped)
end
end
end
end
end
end
end
until not success
EndFindPed(handle)
end
end
function CreateRankBar(XP_StartLimit_RankBar, XP_EndLimit_RankBar, playersPreviousXP, playersCurrentXP, CurrentPlayerLevel, TakingAwayXP)
RankBarColor = 116
if TakingAwayXP then
RankBarColor = 6
end
if not HasHudScaleformLoaded(19) then
RequestHudScaleform(19)
while not HasHudScaleformLoaded(19) do
Wait(1)
end
end
BeginScaleformMovieMethodHudComponent(19, "SET_COLOUR")
PushScaleformMovieFunctionParameterInt(RankBarColor)
EndScaleformMovieMethodReturn()
BeginScaleformMovieMethodHudComponent(19, "SET_RANK_SCORES")
PushScaleformMovieFunctionParameterInt(XP_StartLimit_RankBar)
PushScaleformMovieFunctionParameterInt(XP_EndLimit_RankBar)
PushScaleformMovieFunctionParameterInt(playersPreviousXP)
PushScaleformMovieFunctionParameterInt(playersCurrentXP)
PushScaleformMovieFunctionParameterInt(CurrentPlayerLevel)
PushScaleformMovieFunctionParameterInt(100)
--PushScaleformMovieFunctionParameterInt(8)
EndScaleformMovieMethodReturn()
end
--[[function inVente()
while inVente_ do
Citizen.Wait(1)
RenderText("Recherche de clients en cours", 960, 1020, 2, 0.5, 150,0,0,255, "Center")
local PlyPos = GetEntityCoords(PlayerPedId())
if GetLabelText(GetNameOfZone(PlyPos.x, PlyPos.y, PlyPos.z)) ~= Quartie then
inVente_ = false
AdvancedNotif('Gestion vente illégal.', '~r~Erreur.', 'Vous vous êtes éloigné de la zone.', 'CHAR_WE', 'INITIALV')
end
local valid, ped = GetClosestPed(PlyPos.x, PlyPos.y, PlyPos.z, 2.5, 1, 0, 0, 0, 26)
--print(valid)
if valid then
--TaskPlayAnim(id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
HelpNotif("Appuyez sur AA~~ pour intéragir")
if IsControlJustPressed(0, 38) then
--ClearPedTasks(ped)
--ClearPedSecondaryTask(ped)
--TaskLookAtCoord(ped, PlyPos.x, PlyPos.y, PlyPos.z, -1, 2048, 3)
--TaskLookAtCoord(GetPlayerPed(-1), PedPos.x, PedPos.y, PedPos.z, -1, 2048, 3)
-- TaskGoToEntity(GetPlayerPed(-1), ped, 5000, 1.0, 100, 1073741824, 0)
--Wait(250)
local p1 = GetEntityCoords(GetPlayerPed(-1), true)
local p2 = GetEntityCoords(ped, true)
local dx = p2.x - p1.x
local dy = p2.y - p1.y
local heading = GetHeadingFromVector_2d(dx, dy)
--SetPedDesiredHeading(GetPlayerPed(-1), GetHeadingFromVector_2d(PedPos.x, PedPos.y))
SetPedDesiredHeading(GetPlayerPed(-1), heading)
local p1 = GetEntityCoords(ped, true)
local p2 = GetEntityCoords(GetPlayerPed(-1), true)
local dx = p2.x - p1.x
local dy = p2.y - p1.y
local heading = GetHeadingFromVector_2d(dx, dy)
SetPedDesiredHeading(ped, heading)
-- print(GetHeadingFromVector_2d(PedPos.x, PedPos.y))
--TaskLookAtCoord(ped, PlyPos.x, PlyPos.y, PlyPos.z, -1, 2048, 3)
--TaskLookAtCoord(GetPlayerPed(-1), PedPos.x, PedPos.y, PedPos.z, -1, 2048, 3)
TaskStandStill(ped, 100.0)
TaskStandStill(GetPlayerPed(-1), 100.0)
SetEntityAsMissionEntity(ped)
--SetPedDesiredHeading(GetPlayerPed(-1), PlayerRotation)
RequestAnimDict("facials@gen_male@variations@normal")
RequestAnimDict("mp_facial")
RequestAnimDict("mp_common")
-- RequestAnimDict("special_ped@andy_moon@trevor_1@trevor_1a")
Wait(500)
local timerConv = 100
PlayFacialAnim(GetPlayerPed(-1), "mic_chatter", "mp_facial")
--TaskPlayAnim(GetPlayerPed(-1), "special_ped@andy_moon@trevor_1@trevor_1a", "andy_ig_4_imspeakingthetruth_0", 1.0, -1.0, 100, 0, 1, true, true, true)
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PlyPos.x, PlyPos.y, PlyPos.z+0.9, "Yo mec, bien ou quoi?", 1.2, 1)
end
PlayFacialAnim(GetPlayerPed(-1), "mood_normal_1", "facials@gen_male@variations@normal")
local PedPos = GetEntityCoords(ped)
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+0.9, "Tranquille, je peut t'aider?", 1.2, 1)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
local timerConv = 100
PlayFacialAnim(GetPlayerPed(-1), "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PlyPos.x, PlyPos.y, PlyPos.z+0.9, "Je vend de la cam a un bon prix si t'est inttereser", 1.2, 1)
end
PlayFacialAnim(GetPlayerPed(-1), "mood_normal_1", "facials@gen_male@variations@normal")
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+0.9, "Dit moi le prix", 1.2, 1)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
local timerConv = 100
PlayFacialAnim(GetPlayerPed(-1), "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PlyPos.x, PlyPos.y, PlyPos.z+0.9, "C'est " .. SpriteIndex.PrixDeVente .. "$ le gramme", 1.2, 1)
end
PlayFacialAnim(GetPlayerPed(-1), "mood_normal_1", "facials@gen_male@variations@normal")
local chance1 = math.random(1, 12)
print(chance1)
chance1 = 1
if chance1 <= SpriteIndex.NiveauQuartie then
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+0.9, "Ça me vas, envoie la cam", 1.2, 1)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
TaskPlayAnim(GetPlayerPed(-1), "mp_common", "givetake1_a", 8.0, 8.0, -1)
TaskPlayAnim(ped, "mp_common", "givetake1_a", 8.0, 8.0, -1)
else
local timerConv = 100
PlayFacialAnim(ped, "mic_chatter", "mp_facial")
while timerConv >= 0 do
Citizen.Wait(1)
timerConv = timerConv-1
DrawText3D(PedPos.x, PedPos.y, PedPos.z+0.9, "J'ai pas confiance en toi", 1.2, 1)
end
PlayFacialAnim(ped, "mood_normal_1", "facials@gen_male@variations@normal")
end
--Wait(250)
--################### SetPedAsNoLongerNeeded(ped)
--TaskLookAtEntity(ped, GetPlayerPed(-1), 100.0, 2048, 3)
print(ped)
end
end
end
end]]
function DrawText3D(x,y,z, text, scl, font)
local onScreen,_x,_y=World3dToScreen2d(x,y,z)
local px,py,pz=table.unpack(GetGameplayCamCoords())
local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
local scale = (1/dist)*scl
local fov = (1/GetGameplayCamFov())*100
local scale = scale*fov
if onScreen then
SetTextScale(0.0*scale, 1.1*scale)
SetTextFont(font)
SetTextProportional(1)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x,_y)
end
end
|
--[[
Copyright (C) 2006-2007 Nymbia
Copyright (C) 2010-2017 Hendrik "Nevcairiel" Leppkes < h.leppkes@gmail.com >
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
local Quartz3 = LibStub("AceAddon-3.0"):GetAddon("Quartz3")
local L = LibStub("AceLocale-3.0"):GetLocale("Quartz3")
local MODNAME = "EnemyCasts"
local Enemy = Quartz3:NewModule(MODNAME, "AceEvent-3.0")
local Player = Quartz3:GetModule("Player")
local Focus = Quartz3:GetModule("Focus")
local Target = Quartz3:GetModule("Target")
local TimeFmt = Quartz3.Util.TimeFormat
local media = LibStub("LibSharedMedia-3.0")
local lsmlist = AceGUIWidgetLSMlists
----------------------------
-- Upvalues
-- GLOBALS: CastingBarFrame
local tsort, tinsert = table.sort, table.insert
local bit_band, bit_bor = bit.band, bit.bor
local locked = true
local db, getOptions, castBar
local defaults = {
profile = {
icons = true,
iconside = "left",
anchor = "free", -- "free"
x = 500,
y = 700,
growdirection = "down", -- "up"
position = "topleft",
gap = 1,
spacing = 1,
offset = 3,
nametext = true,
timetext = true,
texture = "Minimalist",
width = 150,
height = 16,
font = "Friz Quadrata TT",
fontsize = 10,
alpha = 1,
textcolor = {1, 1, 1},
barcolor = {0.71, 0, 1},
instanceonly = true,
}
}
local function OnHide(frame)
frame:SetScript("OnUpdate", nil)
end
local castbars = setmetatable({}, {
__index = function(t,k)
local bar = Quartz3:CreateStatusBar(nil, UIParent)
t[k] = bar
bar:SetFrameStrata("MEDIUM")
bar:Hide()
bar:SetScript("OnHide", OnHide)
bar:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16})
bar:SetBackdropColor(0,0,0)
bar.Text = bar:CreateFontString(nil, "OVERLAY")
bar.TimeText = bar:CreateFontString(nil, "OVERLAY")
bar.Icon = bar:CreateTexture(nil, "DIALOG")
if k == 1 then
bar:SetMovable(true)
bar:RegisterForDrag("LeftButton")
bar:SetClampedToScreen(true)
end
Enemy:ApplySettings()
return bar
end
})
local casts = {}
local new, del
do
local tblCache = setmetatable({}, {__mode="k"})
function new()
local entry = next(tblCache)
if entry then tblCache[entry] = nil else entry = {} end
return entry
end
function del(t)
wipe(t)
tblCache[t] = true
end
end
function Enemy:OnInitialize()
self.db = Quartz3.db:RegisterNamespace(MODNAME, defaults)
db = self.db.profile
self:SetEnabledState(Quartz3:GetModuleEnabled(MODNAME))
Quartz3:RegisterModuleOptions(MODNAME, getOptions, L["Enemy CastBars"])
end
function Enemy:OnEnable()
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", "CLEUHandler")
media.RegisterCallback(self, "LibSharedMedia_SetGlobal", function(mtype, override)
if mtype == "statusbar" then
for i, v in pairs(castbars) do
v:SetStatusBarTexture(media:Fetch("statusbar", override))
end
end
end)
media.RegisterCallback(self, "LibSharedMedia_Registered", function(mtype, key)
if mtype == "statusbar" and key == db.texture then
for i, v in pairs(castbars) do
v:SetStatusBarTexture(media:Fetch("statusbar", db.texture))
end
end
end)
self:ApplySettings()
end
function Enemy:OnDisable()
castbars[1].Hide = nil
castbars[1]:EnableMouse(false)
castbars[1]:SetScript("OnDragStart", nil)
castbars[1]:SetScript("OnDragStop", nil)
for _, v in pairs(castbars) do
v:Hide()
end
media.UnregisterCallback(self, "LibSharedMedia_SetGlobal")
media.UnregisterCallback(self, "LibSharedMedia_Registered")
end
function Enemy:CLEUHandler()
if db.instanceonly and not IsInInstance() then return end
local timestamp, event, hideCaster, sGUID, sName, sFlags, sRaidFlags, dGUID, dName, dFlags, dRaidFlags, spellId, spellName = CombatLogGetCurrentEventInfo()
if
bit_band(sFlags, COMBATLOG_OBJECT_REACTION_FRIENDLY) == COMBATLOG_OBJECT_REACTION_FRIENDLY or
bit_band(sFlags, COMBATLOG_OBJECT_CONTROL_NPC) == 0
then
return
end
if event == "SPELL_CAST_START" then
if not casts[sGUID] then
casts[sGUID] = new()
end
local _, _, texture, castTime = GetSpellInfo(spellId)
casts[sGUID].name = sName
casts[sGUID].spellName = spellName
casts[sGUID].spellId = spellId
casts[sGUID].texture = texture
casts[sGUID].duration = castTime / 1000 * (1 + (GetCombatRatingBonus(CR_HASTE_SPELL) / 100))
casts[sGUID].startTime = GetTime()
casts[sGUID].endTime = casts[sGUID].startTime + casts[sGUID].duration
self:UpdateBars()
elseif event == "SPELL_CAST_FAILED" or event == "SPELL_CAST_SUCCESS" and casts[sGUID] then
del(casts[sGUID])
casts[sGUID] = nil
self:UpdateBars()
end
end
do
local function onUpdate(bar)
local currentTime = GetTime()
local endTime = bar.endTime
if currentTime > endTime then
Enemy:UpdateBars()
else
bar:SetValue(currentTime)
bar.TimeText:SetFormattedText(TimeFmt(endTime - currentTime))
end
end
local function barSorter(a, b)
return a.endTime < b.endTime
end
function Enemy:UpdateBars()
local tmp = new()
local currentTime = GetTime()
for guid, details in pairs(casts) do
if details.endTime > currentTime then
tinsert(tmp, details)
end
end
tsort(tmp, barSorter)
for i=1,#tmp do
local v = tmp[i]
local bar = castbars[i]
bar.Text:SetText(v.spellName)
bar.Icon:SetTexture(v.texture)
bar:SetMinMaxValues(v.startTime, v.endTime)
bar.startTime = v.startTime
bar.endTime = v.endTime
bar:Show()
bar:SetScript("OnUpdate", onUpdate)
end
for i = #tmp+1, #castbars do
castbars[i]:Hide()
end
del(tmp)
end
end
do
local function apply(i, bar, db, direction)
local position, showicons, iconside, gap, spacing, offset
local qpdb = Player.db.profile
position = db.position
showicons = db.icons
iconside = db.iconside
gap = db.gap
spacing = db.spacing
offset = db.offset
bar:ClearAllPoints()
bar:SetStatusBarTexture(media:Fetch("statusbar", db.texture))
bar:SetStatusBarColor(unpack(db.barcolor))
bar:SetWidth(db.width)
bar:SetHeight(db.height)
bar:SetScale(qpdb.scale)
bar:SetAlpha(db.alpha)
if db.anchor == "free" then
if i == 1 then
bar:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", db.x, db.y)
if db.growdirection == "up" then
direction = 1
else --L["Down"]
direction = -1
end
else
if direction == 1 then
bar:SetPoint("BOTTOMRIGHT", castbars[i-1], "TOPRIGHT", 0, spacing)
else -- -1
bar:SetPoint("TOPRIGHT", castbars[i-1], "BOTTOMRIGHT", 0, -1 * spacing)
end
end
else
if i == 1 then
local anchorframe
local anchor = db.anchor
if anchor == "focus" and Focus.Bar then
anchorframe = Focus.Bar
elseif anchor == "target" and Target.Bar then
anchorframe = Target.Bar
else -- L["Player"]
anchorframe = Player.Bar
end
if position == "top" then
direction = 1
bar:SetPoint("BOTTOM", anchorframe, "TOP", 0, gap)
elseif position == "bottom" then
direction = -1
bar:SetPoint("TOP", anchorframe, "BOTTOM", 0, -1 * gap)
elseif position == "topright" then
direction = 1
bar:SetPoint("BOTTOMRIGHT", anchorframe, "TOPRIGHT", -1 * offset, gap)
elseif position == "bottomright" then
direction = -1
bar:SetPoint("TOPRIGHT", anchorframe, "BOTTOMRIGHT", -1 * offset, -1 * gap)
elseif position == "topleft" then
direction = 1
bar:SetPoint("BOTTOMLEFT", anchorframe, "TOPLEFT", offset, gap)
elseif position == "bottomleft" then
direction = -1
bar:SetPoint("TOPLEFT", anchorframe, "BOTTOMLEFT", offset, -1 * gap)
elseif position == "leftup" then
if iconside == "right" and showicons then
offset = offset + db.height
end
if qpdb.iconposition == "left" and not qpdb.hideicon then
offset = offset + qpdb.h
end
direction = 1
bar:SetPoint("BOTTOMRIGHT", anchorframe, "BOTTOMLEFT", -1 * offset, gap)
elseif position == "leftdown" then
if iconside == "right" and showicons then
offset = offset + db.height
end
if qpdb.iconposition == "left" and not qpdb.hideicon then
offset = offset + qpdb.h
end
direction = -1
bar:SetPoint("TOPRIGHT", anchorframe, "TOPLEFT", -3 * offset, -1 * gap)
elseif position == "rightup" then
if iconside == "left" and showicons then
offset = offset + db.height
end
if qpdb.iconposition == "right" and not qpdb.hideicon then
offset = offset + qpdb.h
end
direction = 1
bar:SetPoint("BOTTOMLEFT", anchorframe, "BOTTOMRIGHT", offset, gap)
elseif position == "rightdown" then
if iconside == "left" and showicons then
offset = offset + db.height
end
if qpdb.iconposition == "right" and not qpdb.hideicon then
offset = offset + qpdb.h
end
direction = -1
bar:SetPoint("TOPLEFT", anchorframe, "TOPRIGHT", offset, -1 * gap)
end
else
if direction == 1 then
bar:SetPoint("BOTTOMRIGHT", castbars[i-1], "TOPRIGHT", 0, spacing)
else -- -1
bar:SetPoint("TOPRIGHT", castbars[i-1], "BOTTOMRIGHT", 0, -1 * spacing)
end
end
end
local timetext = bar.TimeText
if db.timetext then
timetext:Show()
timetext:ClearAllPoints()
timetext:SetWidth(db.width)
timetext:SetPoint("RIGHT", bar, "RIGHT", -2, 0)
timetext:SetJustifyH("RIGHT")
else
timetext:Hide()
end
timetext:SetFont(media:Fetch("font", db.font), db.fontsize)
timetext:SetShadowColor( 0, 0, 0, 1)
timetext:SetShadowOffset( 0.8, -0.8 )
timetext:SetTextColor(unpack(db.textcolor))
timetext:SetNonSpaceWrap(false)
timetext:SetHeight(db.height)
local temptext = timetext:GetText()
timetext:SetText("10.0")
local normaltimewidth = timetext:GetStringWidth()
timetext:SetText(temptext)
local text = bar.Text
if db.nametext then
text:Show()
text:ClearAllPoints()
text:SetPoint("LEFT", bar, "LEFT", 2, 0)
text:SetJustifyH("LEFT")
if db.timetext then
text:SetWidth(db.width - normaltimewidth)
else
text:SetWidth(db.width)
end
else
text:Hide()
end
text:SetFont(media:Fetch("font", db.font), db.fontsize)
text:SetShadowColor( 0, 0, 0, 1)
text:SetShadowOffset( 0.8, -0.8 )
text:SetTextColor(unpack(db.textcolor))
text:SetNonSpaceWrap(false)
text:SetHeight(db.height)
local icon = bar.Icon
if showicons then
icon:Show()
icon:SetWidth(db.height-1)
icon:SetHeight(db.height-1)
icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
icon:ClearAllPoints()
if iconside == "left" then
icon:SetPoint("RIGHT", bar, "LEFT", -1, 0)
else
icon:SetPoint("LEFT", bar, "RIGHT", 1, 0)
end
else
icon:Hide()
end
return direction
end
function Enemy:ApplySettings()
db = self.db.profile
if self:IsEnabled() then
local direction
if db.anchor ~= "free" then
castbars[1].Hide = nil
castbars[1]:EnableMouse(false)
castbars[1]:SetScript("OnDragStart", nil)
castbars[1]:SetScript("OnDragStop", nil)
end
for i, v in pairs(castbars) do
direction = apply(i, v, db, direction)
end
end
end
end
do
local function getfreeoptionshidden()
return db.anchor ~= "free"
end
local function getnotfreeoptionshidden()
return db.anchor == "free"
end
local function dragstart()
castbars[1]:StartMoving()
end
local function dragstop()
db.x = castbars[1]:GetLeft()
db.y = castbars[1]:GetBottom()
castbars[1]:StopMovingOrSizing()
end
local function nothing()
castbars[1]:SetAlpha(db.alpha)
end
local positions = {
["bottom"] = L["Bottom"],
["top"] = L["Top"],
["topleft"] = L["Top Left"],
["topright"] = L["Top Right"],
["bottomleft"] = L["Bottom Left"],
["bottomright"] = L["Bottom Right"],
["leftup"] = L["Left (grow up)"],
["leftdown"] = L["Left (grow down)"],
["rightup"] = L["Right (grow up)"],
["rightdown"] = L["Right (grow down)"],
}
local function setOpt(info, value)
db[info[#info]] = value
Enemy:ApplySettings()
end
local function getOpt(info)
return db[info[#info]]
end
local function getColor(info)
return unpack(getOpt(info))
end
local function setColor(info, r, g, b, a)
setOpt(info, {r, g, b, a})
end
local options
function getOptions()
if not options then
options = {
type = "group",
name = L["Enemy CastBars"],
order = 600,
set = setOpt,
get = getOpt,
childGroups = "tab",
args = {
toggle = {
type = "toggle",
name = L["Enable"],
desc = L["Enable"],
get = function()
return Quartz3:GetModuleEnabled(MODNAME)
end,
set = function(info, v)
Quartz3:SetModuleEnabled(MODNAME, v)
end,
order = 96,
width = "full",
},
settings = {
type = "group",
name = L["Settings"],
args = {
anchor = {
type = "select",
name = L["Anchor Frame"],
desc = L["Select where to anchor the bars"],
values = {["player"] = L["Player"], ["free"] = L["Free"], ["target"] = L["Target"], ["focus"] = L["Focus"]},
},
-- free
lock = {
type = "toggle",
name = L["Lock"],
desc = L["Toggle bar lock"],
get = function()
return locked
end,
set = function(info, v)
if v then
castbars[1].Hide = nil
castbars[1]:EnableMouse(false)
castbars[1]:SetScript("OnDragStart", nil)
castbars[1]:SetScript("OnDragStop", nil)
Enemy:UpdateBars()
else
castbars[1]:Show()
castbars[1]:EnableMouse(true)
castbars[1]:SetScript("OnDragStart", dragstart)
castbars[1]:SetScript("OnDragStop", dragstop)
castbars[1]:SetAlpha(1)
castbars[1].Hide = nothing
end
locked = v
end,
hidden = getfreeoptionshidden,
order = 98,
},
instanceonly = {
type = "toggle",
name = L["Only in Instances"],
desc = L["Only show the casts of enemys when inside an instance (dungeon or raid)"],
order = 99,
},
growdirection = {
type = "select",
name = L["Grow Direction"],
desc = L["Set the grow direction of the bars"],
values = {["up"] = L["Up"], ["down"] = L["Down"]},
hidden = getfreeoptionshidden,
order = 102,
},
x = {
type = "range",
name = L["X"],
desc = L["Set an exact X value for this bar's position."],
min = 0, max = 2560, bigStep = 1,
order = 103,
hidden = getfreeoptionshidden,
},
y = {
type = "range",
name = L["Y"],
desc = L["Set an exact Y value for this bar's position."],
min = 0, max = 1600, bigStep = 1,
order = 103,
hidden = getfreeoptionshidden,
},
-- anchored to a cast bar
position = {
type = "select",
name = L["Position"],
desc = L["Position the bars"],
values = positions,
hidden = getnotfreeoptionshidden,
order = 101,
},
gap = {
type = "range",
name = L["Gap"],
desc = L["Tweak the vertical position of thebars"],
min = -35, max = 35, step = 1,
hidden = getnotfreeoptionshidden,
order = 102,
},
offset = {
type = "range",
name = L["Offset"],
desc = L["Tweak the horizontal position of the bars"],
min = -35, max = 35, step = 1,
hidden = getnotfreeoptionshidden,
order = 103,
},
spacing = {
type = "range",
name = L["Spacing"],
desc = L["Tweak the space between bars"],
min = -35, max = 35, step = 1,
order = 104,
},
nl4 = {
type = "description",
name = "",
order = 109,
},
icons = {
type = "toggle",
name = L["Show Icons"],
desc = L["Show icons on the bars"],
order = 110,
},
iconside = {
type = "select",
name = L["Icon Position"],
desc = L["Set the side of the bar that the icon appears on"],
values = {["left"] = L["Left"], ["right"] = L["Right"]},
order = 111,
},
texture = {
type = "select",
dialogControl = "LSM30_Statusbar",
name = L["Texture"],
desc = L["Set the bar Texture"],
values = lsmlist.statusbar,
order = 112,
},
barcolor = {
type = "color",
name = L["Bar Color"],
desc = L["Set the color of the bars"],
get = getColor,
set = setColor,
order = 113,
},
nl5 = {
type = "description",
name = "",
order = 114,
},
width = {
type = "range",
name = L["Bar Width"],
desc = L["Set the width of the bars"],
min = 50, max = 300, step = 1,
order = 115,
},
height = {
type = "range",
name = L["Bar Height"],
desc = L["Set the height of the bars"],
min = 4, max = 25, step = 1,
order = 116,
},
alpha = {
type = "range",
name = L["Alpha"],
desc = L["Set the alpha of the bars"],
min = 0.05, max = 1, bigStep = 0.05,
isPercent = true,
order = 117,
},
nl6 = {
type = "description",
name = "",
order = 119,
},
nametext = {
type = "toggle",
name = L["Spell Name"],
desc = L["Display the name of the spell on the bars"],
order = 120,
},
timetext = {
type = "toggle",
name = L["Remaining Time"],
desc = L["Display the time remaining on the bars"],
order = 121,
},
font = {
type = "select",
dialogControl = "LSM30_Font",
name = L["Font"],
desc = L["Set the font used in the bars"],
values = lsmlist.font,
order = 122,
},
fontsize = {
type = "range",
name = L["Font Size"],
desc = L["Set the font size for the bars"],
min = 3, max = 15, step = 1,
order = 123,
},
textcolor = {
type = "color",
name = L["Text Color"],
desc = L["Set the color of the text for the bars"],
get = getColor,
set = setColor,
order = 124,
},
}
},
},
}
end
return options
end
end
|
---------------------------------
--Local and global variables
---------------------------------
local Ragdoll = false
ragdol = true
---------------------------------
--KeyMapping Register
---------------------------------
RegisterKeyMapping('rdoll', 'Toggle Ragdoll', 'keyboard', 'z') -- ('(Chat Command)', '(Keybind Menu Description)', '(Input Device)', '(Default Keymap)')
-- This essentially allows the player to set their own keybind to the ragdoll. If the player wishes to not have any keybind ragdoll, they simply select the ragdoll keybind in the keybind menu and press delete.
---------------------------------
--Ragdoll Toggle
---------------------------------
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
vehCheck() -- Stops player from ragdolling while in any vehicle. Comment out if you'd like them to have the ability to ragdoll inside a vehicle. (Doesn't really do anything in a vehicle anyways)
if Ragdoll then
SetPedToRagdoll(GetPlayerPed(-1), 1000, 1000, 0, 0, 0, 0)
if ragdol then
Ragdoll = false
end
end
end
end)
RegisterCommand('rdoll', function()
TriggerEvent("Ragdoll", source)
end, false)
TriggerEvent( "chat:addSuggestion", "/rdoll", "Chat command for enabling and disabling ragdoll. (Can also add a keybind in Setting/Key Bindings/FiveM) Default keybind is z." )
RegisterNetEvent("Ragdoll")
AddEventHandler("Ragdoll", function()
if (ragdol) then
setRagdoll(true)
ragdol = false
else
setRagdoll(false)
ragdol = true
end
end)
---------------------------------
--Functions
---------------------------------
function setRagdoll(rag)
Ragdoll = rag
end
function vehCheck()
if Ragdoll then
if IsPedInAnyVehicle(GetPlayerPed(-1), false) then
Ragdoll = false
notify("~r~You can't ragdoll while in a vehicle!")
end
end
end
function notify(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(true, true)
end
|
function loadClass(tbl)
setmetatable(tbl, {
__call = function(cls, ...)
local self = {}
setmetatable(self, {
__index = cls
})
self:__init__(...)
return self
end
})
return tbl
end
|
fluid = {}
fluid.path = minetest.get_modpath("fluid")
dofile(fluid.path.."/functions.lua")
dofile(fluid.path.."/nodes.lua")
|
--------------------------------------------------------------------------------
-- Load needed modules
--------------------------------------------------------------------------------
require("nn")
require("nngraph")
--------------------------------------------------------------------------------
-- Sequencer
--------------------------------------------------------------------------------
local Sequencer = torch.class("Sequencer")
function Sequencer:__init(length, inSize, outSize, UnitModel, opt)
opt = opt or {}
self.noAsserts = opt.noAsserts or false
self.verbose = opt.verbose or false
if not self.noAsserts then
assert(tonumber(length) > 0)
assert(tonumber(inSize) > 0)
assert(tonumber(outSize) > 0)
end
self.length = tonumber(length)
self.batchSize = opt.batchSize == nil and 1 or opt.batchSize
self.verbose = opt.verbose or false
self.allOutputs = opt.allOutputs or true
self.clones = {}
self.unitModel = UnitModel(inSize, outSize, opt)
self.clones[1] = self.unitModel:buildUnit()
self.params, self.gradParams = self.clones[1]:getParameters()
local params, gradParams = self.clones[1]:parameters()
for j = 2, self.length do
self.clones[j] =
self.unitModel:buildUnit(params, gradParams)
end
if self.verbose then
self:message("Initialized Sequencer with " .. self.length .. " clones.")
end
self:reset()
self.zeroState = torch.zeros(self.batchSize, outSize)
self.zeroOutput = torch.zeros(self.batchSize, outSize)
self.zeroGradState = torch.zeros(self.batchSize, outSize)
end
function Sequencer:getParameters()
return self.params, self.gradParams
end
function Sequencer:parameters()
return self.clones[1]:parameters()
end
function Sequencer:zeroGradParameters()
self.clones[1]:zeroGradParameters()
end
function Sequencer:reset()
self.crtIdx = 1
self.crtLength = 0
end
function Sequencer:forward(input, isTraining)
isTraining = isTraining == nil and true or isTraining
assert(self.crtIdx <= self.length or isTraining == false)
if isTraining then
if self.crtIdx == 1 then
self.clones[self.crtIdx]:forward(
{self.zeroState, self.zeroOutput, input}
)
else
self.clones[self.crtIdx]:forward({
self.clones[self.crtIdx-1].output[1],
self.clones[self.crtIdx-1].output[2],
input
})
end
self.crtLength = self.crtLength + 1
self.crtIdx = self.crtIdx + 1
return self.clones[self.crtIdx-1].output[2]
else
if self.crtLength == 0 then
self.clones[self.crtIdx]:forward(
{self.zeroState, self.zeroOutput, input}
)
else
self.clones[1]:forward({
self.clones[1].output[1]:clone(),
self.clones[1].output[2]:clone(),
input
})
end
self.crtLength = self.crtLength + 1
return self.clones[1].output[2]
end
end
function Sequencer:forwardSequence(inputs, length, isTraining)
length = length or inputs:size(1)
isTraining = isTraining == nil and true or isTraining
self:reset()
local y = {}
for i = 1, length do
if (not isTraining) and self.allOutputs then
y[i] = self:forward(inputs[i], isTraining):clone()
else
y[i] = self:forward(inputs[i], isTraining)
end
end
if isTraining then
assert((self.crtIdx == length + 1) and (self.crtLength == length))
else
assert((self.crtIdx == 1) and (self.crtLength == length))
end
if self.allOutputs then
return y
else
return y[length]
end
end
function Sequencer:backward(input, gradOutput)
self.crtIdx = self.crtIdx - 1 -- go back to the last clone
local outGrad, inSignal
if self.crtIdx == self.crtLength then
outGrad = {self.zeroGradState, gradOutput}
else
if gradOutput then
outGrad = {
self.clones[self.crtIdx+1].gradInput[1],
self.clones[self.crtIdx+1].gradInput[2] + gradOutput
}
else
outGrad = {
self.clones[self.crtIdx+1].gradInput[1],
self.clones[self.crtIdx+1].gradInput[2]
}
end
end
if self.crtIdx == 1 then
inSignal = {self.zeroState, zeroOutput, input}
else
inSignal = {
self.clones[self.crtIdx-1].output[1],
self.clones[self.crtIdx-1].output[2],
input
}
end
self.clones[self.crtIdx]:backward(inSignal, outGrad)
return self.clones[self.crtIdx].gradInput[3]
end
function Sequencer:backwardSequence(inputs, gradOutputs)
assert(inputs:size(1) >= self.crtLength)
local dx = {}
if type(gradOutputs) == "table" then
for i = self.crtLength, 1, -1 do
dx[i] = self:backward(inputs[i], gradOutputs[i])
end
else
dx[self.crtLength] = self:backward(inputs[self.crtLength], gradOutputs)
for i = self.crtLength-1, 1, -1 do
dx[i] = self:backward(inputs[i])
end
end
assert(self:backpropOver())
return dx
end
function Sequencer:backpropOver()
return self.crtIdx == 1
end
function Sequencer:message(message)
if self.verbose then
print(
string.format("[LSTM Seq] "):color("blue") ..
string.format(message):color("green")
)
end
end
function Sequencer:cuda()
require("cutorch")
require("cunn")
self.clones[1]:cuda()
self.params, self.gradParams = self.clones[1]:getParameters()
local params, gradParams = self.clones[1]:parameters()
for j = 2, self.length do
self.clones[j]:cuda()
if params and gradParams then
local crtParams, crtGradParams = self.clones[j]:parameters()
if not self.noAsserts then
assert((#crtParams == #params) and (#crtGradParams == #gradParams))
end
for i = 1, #params do
crtParams[i]:set(params[i])
end
for i = 1, #gradParams do
crtGradParams[i]:set(gradParams[i])
end
end
end
self.zeroState = self.zeroState:cuda()
self.zeroOutput = self.zeroOutput:cuda()
self.zeroGradState = self.zeroGradState:cuda()
end
function Sequencer:showParameters(zoom)
self.unitModel:showParameters(self.clones[1], zoom)
end
|
local Prop = {}
Prop.Name = "Evocity District House Farm 1"
Prop.Cat = "House"
Prop.Price = 2500
Prop.Doors = {
Vector( -7139, 13611, 252 ),
}
GM.Property:Register( Prop )
|
#!lua
my_gcc_flags = {
"-Wall", "-Wextra", "-pedantic", "-Wshadow", "-Wconversion", "-Wformat=2",
"-Wstrict-prototypes", "-Wbad-function-cast"
}
newoption {
trigger = "doxygen_path",
value = "path",
description = "Doxygen executable path"
}
newoption {
trigger = "pthread_include_path",
value = "path",
description = "PThread include directory"
}
newoption {
trigger = "pthread_library_path",
value = "path",
description = "PThread library directory"
}
newoption {
trigger = "pthread_library_name",
value = "name",
description = "PThread library name"
}
solution "ptimer" -- no ansi due to usleep
configurations { "debug", "release", "staticdebug", "staticrelease" }
filter "configurations:*"
flags "UndefinedIdentifiers"
filter "configurations:*debug"
defines { "DEBUG" }
symbols "ON"
filter { "toolset:gcc", "system:windows" }
makesettings "CC=gcc"
filter "configurations:*release"
defines { "NDEBUG" }
symbols "OFF"
optimize "Speed"
omitframepointer "ON"
flags { "NoBufferSecurityCheck", "NoRuntimeChecks" }
filter { "action:vs*", "configurations:static*" }
staticruntime "on"
filter { "action:vs*", "configurations:debug or release" }
staticruntime "OFF"
filter {
"configurations:static*", "kind:StaticLib",
"system:windows", "toolset:gcc or clang"
}
targetprefix "lib"
targetextension ".a"
filter {}
local is_win = os.host() == "windows"
local lib_path = nil
local lib_name = nil
-- usage "ptimer_common"
function ptimer_common()
language "C"
end
function link_pthread()
if lib_path then
libdirs { lib_path }
end
if lib_name then
links { lib_name }
else
links "pthread"
end
end
if _OPTIONS["pthread_library_path"] then
lib_path = _OPTIONS["pthread_library_path"]
end
if _OPTIONS["pthread_library_name"] then
lib_name = _OPTIONS["pthread_library_name"]
end
project "ptimer"
if _OPTIONS["pthread_include_path"] then
includedirs { _OPTIONS["pthread_include_path"] }
else
if _ACTION:sub(0, 2) == "vs" then
print("Warning: Your compiler may not have native support " ..
"for PThread library, \nplease consider the " ..
"--pthread_include_path option (premake5 --help)")
end
end
filter "configurations:debug or release"
kind "SharedLib"
defines "PTIMER_SHARED_BUILD"
if is_win and _ACTION:sub(0, 5) ~= "gmake" then
link_pthread {}
end
filter "configurations:static*"
kind "StaticLib"
filter "toolset:gcc"
buildoptions { my_gcc_flags, "-pthread" }
filter "toolset:clang"
buildoptions "-pthread"
filter {}
--uses { "ptimer_common" }
ptimer_common {}
files "ptimer.c"
project "example"
kind "ConsoleApp"
cdialect "C89"
ptimer_common {}
dependson "ptimer"
files "example.c"
filter "toolset:gcc"
buildoptions { my_gcc_flags }
filter { "configurations:debug or release", "system:windows" }
defines "PTIMER_SHARED"
filter { "configurations:static*",
"system:windows",
"action:not gmake*"
}
link_pthread {}
filter "system:not windows"
link_pthread {}
filter {}
links "ptimer"
project "doc"
local dp = ""
kind "Makefile"
if _OPTIONS["doxygen_path"] then
dp = _OPTIONS["doxygen_path"] .. '/'
end
buildcommands { dp .. "doxygen" }
cleancommands "{RMDIR} doc"
|
require "iuplua"
-- Bizarre kludge: For reasons I do not understand at all, radio buttons do not work in FCEUX. Switch to menus there only
local optionLetter = "o"
if FCEU then optionLetter = "l" end
function ircDialog()
local res, server, port, nick, partner, forceSend = iup.GetParam("Connection settings", nil,
"Enter an IRC server: %s\n" ..
"IRC server port: %i\n" ..
"Your nick: %s\n" ..
"Partner nick: %s\n" ..
"%t\n" .. -- <hr>
"Are you restarting\rafter a crash? %" .. optionLetter .. "|No|Yes|\n"
,"irc.speedrunslive.com", 6667, "", "", 0)
if 0 == res then return nil end
return {server=server, port=port, nick=nick, partner=partner, forceSend=forceSend==1}
end
function selectDialog(specs, reason)
local names = ""
for i, v in ipairs(specs) do
names = names .. v.name .. "|"
end
local res, selection = iup.GetParam("Select game", nil,
"Can't figure out\rwhich game to load\r(" .. reason .. ")\r" ..
"Which game is this? " ..
"%l|" .. names .. "\n",
0)
if 0 == res or nil == selection then return nil end
return specs[selection + 1]
end
function refuseDialog(options)
iup.Message("Cannot run", "No ROM is running.")
end
|
local util = {
merge = require(script.merge),
copy = require(script.copy),
}
return util
|
local local0 = 0.2
local local1 = 0 - local0
local local2 = 2.9 - local0
local local3 = 0 - local0
local local4 = 3 - local0
local local5 = 0 - local0
local local6 = 0 - local0
local local7 = 1.1 - local0
local local8 = 0 - local0
local local9 = 1.1 - local0
local local10 = 2.2 - local0
local local11 = 8.4 - local0
local local12 = 2.2 - local0
local local13 = 8.4 - local0
function OnIf_301001(arg0, arg1, arg2)
if arg2 == 0 then
DungeonResident_Slave_SwordThrow301001_ActAfter_RealTime(arg0, arg1)
end
return
end
function DungeonResident_Slave_SwordThrow301001Battle_Activate(arg0, arg1)
local local0 = {}
local local1 = {}
local local2 = {}
Common_Clear_Param(local0, local1, local2)
local local3 = arg0:GetDist(TARGET_ENE_0)
local local4 = arg0:GetRandam_Int(1, 100)
local local5 = arg0:GetExcelParam(AI_EXCEL_THINK_PARAM_TYPE__thinkAttr_doAdmirer)
local local6 = math.abs(arg0:GetDistYSigned(TARGET_ENE_0))
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_B, 120) then
local0[20] = 100
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5902) == true and local5 == 1 and arg0:GetTeamOrder(ORDER_TYPE_Role) == ROLE_TYPE_Kankyaku then
local0[24] = 100
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5902) == true and local5 == 1 and arg0:GetTeamOrder(ORDER_TYPE_Role) == ROLE_TYPE_Torimaki then
local0[24] = 100
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5902) == false and local5 == 1 and arg0:GetTeamOrder(ORDER_TYPE_Role) == ROLE_TYPE_Kankyaku then
local0[22] = 100
elseif arg0:HasSpecialEffectId(TARGET_SELF, 5902) == false and local5 == 1 and arg0:GetTeamOrder(ORDER_TYPE_Role) == ROLE_TYPE_Torimaki then
local0[23] = 100
elseif 5 <= local3 then
local0[1] = 10
local0[2] = 0
local0[4] = 0
local0[5] = 0
local0[6] = 50
local0[7] = 40
elseif 2.5 <= local3 then
local0[1] = 50
local0[2] = 35
local0[4] = 15
local0[5] = 0
local0[6] = 30
local0[7] = 15
else
local0[1] = 40
local0[2] = 30
local0[4] = 30
local0[5] = 0
local0[6] = 0
local0[7] = 0
end
local1[1] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act01)
local1[2] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act02)
local1[3] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act03)
local1[4] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act04)
local1[5] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act05)
local1[6] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act06)
local1[7] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act07)
local1[20] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act20)
local1[22] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act22)
local1[23] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act23)
local1[24] = REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_Act24)
Common_Battle_Activate(arg0, arg1, local0, local1, REGIST_FUNC(arg0, arg1, DungeonResident_Slave_SwordThrow301001_ActAfter_AdjustSpace), local2)
return
end
local0 = 3 - local0
local0 = 0 - local0
local0 = 1.8 - local0
local0 = local2
local0 = local4
function DungeonResident_Slave_SwordThrow301001_Act01(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL1
local local3 = UPVAL0
local local4 = UPVAL3
local local5 = UPVAL4
Approach_Act(arg0, arg1, UPVAL0, UPVAL0, 0, 2)
if arg0:GetRandam_Int(1, 100) <= 45 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3000, TARGET_ENE_0, local3, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3000, TARGET_ENE_0, local3, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3001, TARGET_ENE_0, UPVAL2, 0)
end
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = local2
local0 = 0 - local0
local0 = local4
function DungeonResident_Slave_SwordThrow301001_Act02(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL1
local local3 = UPVAL0
local local4 = 3002
local local5 = 3003
if arg0:HasSpecialEffectId(TARGET_SELF, 5730) == true then
local4 = 3038
local5 = 3040
end
Approach_Act(arg0, arg1, UPVAL0, UPVAL0 + 1.5, 0, 2)
if arg0:GetRandam_Int(1, 100) <= 60 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, local4, TARGET_ENE_0, local3, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, local4, TARGET_ENE_0, local3, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, local5, TARGET_ENE_0, UPVAL2, 0)
end
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = 2.4 - local0
local0 = 0 - local0
local0 = 2 - local0
local0 = local2
local0 = local4
function DungeonResident_Slave_SwordThrow301001_Act03(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = arg0:GetRandam_Int(1, 100)
local local3 = UPVAL1
local local4 = UPVAL0
local local5 = UPVAL2
local local6 = UPVAL3
local local7 = 3003
local local8 = 3004
local local9 = 3005
if arg0:HasSpecialEffectId(TARGET_SELF, 5730) == true then
local7 = 3040
local8 = 3043
local9 = 3044
end
Approach_Act(arg0, arg1, UPVAL0, UPVAL0 + 1.5, 0, 2)
if local1 <= 40 then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, local8, TARGET_ENE_0, local4, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, local8, TARGET_ENE_0, local4, 0, -1)
if local1 <= 75 then
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, local9, TARGET_ENE_0, local6, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, local9, TARGET_ENE_0, local6, 0)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, local7, TARGET_ENE_0, UPVAL4, 0)
end
end
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = 2.7 - local0
local0 = 0 - local0
local0 = local2
local0 = local4
function DungeonResident_Slave_SwordThrow301001_Act04(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = arg0:GetRandam_Int(1, 100)
local local3 = UPVAL1
local local4 = UPVAL2 + 1
local local5 = UPVAL3 + 1
Approach_Act(arg0, arg1, UPVAL0, UPVAL0 + 1.5, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3006, TARGET_ENE_0, UPVAL0 + 1, 0, -1)
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = 4.7 - local0
local0 = 0 - local0
function DungeonResident_Slave_SwordThrow301001_Act05(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL1
local local3 = 3007
if arg0:HasSpecialEffectId(TARGET_SELF, 5730) == true then
local3 = 3045
end
Approach_Act(arg0, arg1, UPVAL0, UPVAL0, 0, 2)
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, local3, TARGET_ENE_0, UPVAL0 + 1, 0, -1)
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = local11
local0 = local10
function DungeonResident_Slave_SwordThrow301001_Act06(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL1
local local3 = UPVAL0 + 15
Approach_Act(arg0, arg1, UPVAL0, UPVAL0 + 2, 0, 2)
if arg0:HasSpecialEffectId(TARGET_SELF, 5704) == true then
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3032, TARGET_ENE_0, local3, 0, -1)
else
arg1:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, 3020, TARGET_ENE_0, local3, 0, -1)
end
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
local0 = local11
local0 = local10
function DungeonResident_Slave_SwordThrow301001_Act07(arg0, arg1, arg2)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = UPVAL1
local local3 = UPVAL0 + 15
Approach_Act(arg0, arg1, UPVAL0, UPVAL0 + 2, 0, 2)
if arg0:HasSpecialEffectId(TARGET_SELF, 5704) == true then
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3032, TARGET_ENE_0, local3, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3033, TARGET_ENE_0, local3, 0)
else
arg1:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3020, TARGET_ENE_0, local3, 0, -1)
arg1:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3021, TARGET_ENE_0, local3, 0)
end
GetWellSpace_Odds = 100
return GetWellSpace_Odds
end
function DungeonResident_Slave_SwordThrow301001_Act20(arg0, arg1, arg2)
arg1:AddSubGoal(GOAL_COMMON_Turn, 2, TARGET_ENE_0, 0, 0, 0)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function DungeonResident_Slave_SwordThrow301001_Act22(arg0, arg1, arg2)
Kanshu_Act(arg0, arg1, 0)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function DungeonResident_Slave_SwordThrow301001_Act23(arg0, arg1, arg2)
Torimaki_Act(arg0, arg1, 0)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function DungeonResident_Slave_SwordThrow301001_Act24(arg0, arg1, arg2)
Gather_Act(arg0, arg1, 0, 2)
GetWellSpace_Odds = 0
return GetWellSpace_Odds
end
function DungeonResident_Slave_SwordThrow301001_ActAfter_RealTime(arg0, arg1)
local local0 = arg0:GetDist(TARGET_ENE_0)
local local1 = arg0:GetRandam_Int(1, 100)
local local2 = arg0:GetRandam_Int(0, 1)
local local3 = arg0:GetRandam_Float(1, 1.5)
local local4 = arg0:GetRandam_Float(1.5, 2.5)
if arg0:GetExcelParam(AI_EXCEL_THINK_PARAM_TYPE__thinkAttr_doAdmirer) == 1 and arg0:GetTeamOrder(ORDER_TYPE_Role) == ROLE_TYPE_Attack then
if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_F, 90) then
if local0 > 2 then
if local0 <= 3.5 then
if local1 <= 30 then
arg1:AddSubGoal(GOAL_COMMON_LeaveTarget, local3, TARGET_ENE_0, 3, TARGET_ENE_0, true, -1)
elseif local1 <= 80 then
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
end
elseif local0 <= 5.5 then
if local1 <= 70 then
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
end
elseif local0 <= 7.5 then
if local1 <= 50 then
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
end
elseif local1 <= 70 then
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
end
end
elseif arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_L, 180) then
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, 1, arg0:GetRandam_Int(45, 60), true, true, -1)
else
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, 0, arg0:GetRandam_Int(45, 60), true, true, -1)
end
elseif local0 <= 6 then
arg1:AddSubGoal(GOAL_COMMON_LeaveTarget, local3, TARGET_ENE_0, 8, TARGET_ENE_0, true, -1)
else
arg1:AddSubGoal(GOAL_COMMON_SidewayMove, local4, TARGET_ENE_0, local2, arg0:GetRandam_Int(45, 60), true, true, -1)
end
return
end
function DungeonResident_Slave_SwordThrow301001_ActAfter_AdjustSpace(arg0, arg1, arg2)
arg1:AddSubGoal(GOAL_COMMON_If, 10, 0)
return
end
function DungeonResident_Slave_SwordThrow301001Battle_Update(arg0, arg1)
return GOAL_RESULT_Continue
end
function DungeonResident_Slave_SwordThrow301001Battle_Terminate(arg0, arg1)
return
end
function DungeonResident_Slave_SwordThrow301001Battle_Interupt(arg0, arg1)
if arg0:IsLadderAct(TARGET_SELF) then
return false
else
return false
end
end
return
|
type A = { b: number, c: number }
local a: A = { b = 1,
c = 2 }
print(
a.b, a.c
)
|
---@class CS.FairyGUI.Image : CS.FairyGUI.DisplayObject
---@field public texture CS.FairyGUI.NTexture
---@field public textureScale CS.UnityEngine.Vector2
---@field public color CS.UnityEngine.Color
---@field public fillMethod number
---@field public fillOrigin number
---@field public fillClockwise boolean
---@field public fillAmount number
---@field public scale9Grid CS.System.Nullable_CS.UnityEngine.Rect
---@field public scaleByTile boolean
---@field public tileGridIndice number
---@type CS.FairyGUI.Image
CS.FairyGUI.Image = { }
---@overload fun(): CS.FairyGUI.Image
---@return CS.FairyGUI.Image
---@param optional texture CS.FairyGUI.NTexture
function CS.FairyGUI.Image.New(texture) end
function CS.FairyGUI.Image:SetNativeSize() end
---@param vb CS.FairyGUI.VertexBuffer
function CS.FairyGUI.Image:OnPopulateMesh(vb) end
---@param vb CS.FairyGUI.VertexBuffer
function CS.FairyGUI.Image:SliceFill(vb) end
return CS.FairyGUI.Image
|
require("core/anim")
--region NewFile_1.lua
--Author : KimWang
--Date : 2015/6/11
--此文件由[BabeLua]插件自动生成
if AnimBase ~= nil then
AnimBase.pause = function(self)
if anim_set_pause ~= nil then
anim_set_pause(self.m_animID,1);
end
end
AnimBase.resume = function(self)
if anim_set_pause ~= nil then
anim_set_pause(self.m_animID,0);
end
end
end
--endregion
|
--[[
Copyright (c) 2013, Ikonic
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of ChatPorter nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL IKONIC BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
_addon.name = 'ChatPorter'
_addon.version = '1.37'
_addon.author = 'Ikonic'
_addon.commands = {'ChatPorter','cp'}
require('tables')
require('strings')
require('chat')
config = require('config')
require('logger')
defaults = T{}
defaults.usechatporter = true
defaults.linkshell = T{}
defaults.linkshell.displaychat = true
defaults.linkshell.color = 41 -- 41, 70, 158, 204
defaults.linkshell.show = true
defaults.linkshell.lines = 8
defaults.linkshell.alpha = 255
defaults.linkshell.red = 152
defaults.linkshell.green = 251
defaults.linkshell.blue = 152
defaults.linkshell.fontname = "Arial"
defaults.linkshell.fontsize = 8
defaults.linkshell.x = 150
defaults.linkshell.y = 505
defaults.party = T{}
defaults.party.displaychat = true
defaults.party.color = 207 -- 207
defaults.party.show = true
defaults.party.lines = 8
defaults.party.alpha = 255
defaults.party.red = 0
defaults.party.green = 191
defaults.party.blue = 255
defaults.party.fontname = "Arial"
defaults.party.fontsize = 8
defaults.party.x = 150
defaults.party.y = 390
defaults.tell = T{}
defaults.tell.displaychat = true
defaults.tell.color = 200 -- 208
defaults.tell.show = true
defaults.tell.lines = 8
defaults.tell.alpha = 255
defaults.tell.red = 255
defaults.tell.green = 0
defaults.tell.blue = 255
defaults.tell.fontname = "Arial"
defaults.tell.fontsize = 8
defaults.tell.x = 150
defaults.tell.y = 100
defaults.ffochat = T{}
defaults.ffochat.displaychat = false
defaults.ffochat.color = 167
defaults.ffochat.show = false
defaults.ffochat.lines = 8
defaults.ffochat.alpha = 255
defaults.ffochat.red = 255
defaults.ffochat.green = 0
defaults.ffochat.blue = 0
defaults.ffochat.fontname = "Arial"
defaults.ffochat.fontsize = 4
defaults.ffochat.x = 380
defaults.ffochat.y = 300
settings = config.load(defaults)
showlinkshell = T{}
showparty = T{}
showtell = T{}
showffochat = T{}
specialChar = "|"
lastTellFrom = ""
playerResolution = T{}
playerResolution.x = windower.get_windower_settings().x_res
playerResolution.y = windower.get_windower_settings().y_res
windower.register_event('load',function ()
windower.text.create("showlinkshell")
windower.text.create("showparty")
windower.text.create("showtell")
windower.text.create("showffochat")
windower.send_command('alias l2 lua command ChatPorter l2')
windower.send_command('alias p2 lua command ChatPorter p2')
windower.send_command('alias t2 lua command ChatPorter t2')
windower.send_command('alias r2 lua command ChatPorter r2')
windower.send_command('alias f1 lua command ChatPorter f1')
windower.send_command('alias f2 lua command ChatPorter f2')
windower.send_command('alias f3 lua command ChatPorter f3')
windower.send_command('alias f4 lua command ChatPorter f4')
windower.send_command('alias f5 lua command ChatPorter f5')
windower.add_to_chat(160,' Type '..string.color('//cp help',204,160)..' for a list of possible commands.')
end)
windower.register_event('load', 'login', 'linkshell change', function()
local player = windower.ffxi.get_player()
if player then
playerName = player.name
LSname = player.linkshell
end
end)
windower.register_event('unload',function ()
windower.text.delete("showlinkshell")
windower.text.delete("showparty")
windower.text.delete("showtell")
windower.text.delete("showffochat")
windower.send_command('unalias l2')
windower.send_command('unalias p2')
windower.send_command('unalias t2')
windower.send_command('unalias r2')
windower.send_command('unalias f1')
windower.send_command('unalias f2')
windower.send_command('unalias f3')
windower.send_command('unalias f4')
windower.send_command('unalias f5')
end)
windower.register_event('login',function (name)
settings = config.load(defaults)
show("linkshell")
show("party")
show("tell")
show("ffochat")
LSname = windower.ffxi.get_player().linkshell;
playerName = windower.ffxi.get_player().name;
end)
function addon_command(...)
local args = {...}
local dummysettings = table.copy(settings)
if args[1] ~= nil then
comm = args[1]:lower()
if comm == 'help' then
if args[2] == nil or (args[2] ~= "detail" and args[2] ~= "textbox") then
windower.add_to_chat(55,_addon.name.." v".._addon.version..' possible commands:')
windower.add_to_chat(160,' '..string.color('//ChatPorter',204,160)..' and '..string.color('//cp',204,160)..' are both valid commands.')
windower.add_to_chat(160,' '..string.color('//cp help',204,160)..' : Lists this menu.')
windower.add_to_chat(160,' '..string.color('//cp status',204,160)..' : Shows current configuration.')
windower.add_to_chat(160,' '..string.color('//cp textbox',204,160)..' : Shows current textbox configurations.')
windower.add_to_chat(160,' '..string.color('//cp colors',204,160)..' : Shows possible color codes.')
windower.add_to_chat(160,' '..string.color('//cp toggle',204,160)..' : Toggles ChatPorter on/off.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t] [toggle|displaychat]',204,160)..' : Toggles linkshell|party|tell messages from showing or not.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t] color #',204,160)..' : Sets color of l|p|t text (acceptable values of 1-255).')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] show',204,160)..' : Toggles l|p|t textboxes from showing.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [fontname|fn, lines, fontsize|fs, x, y, alpha|a, red|r, green|g, blue|b] #',204,160)..' : Sets l|p|t textbox specifics.')
windower.add_to_chat(160,' '..string.color('//[l2|p2|t2 name|r2] message',204,160)..' : Sends message from second character to linkshell|party|tell|reply.')
windower.add_to_chat(160,' '..string.color('//[f#|cp f#] message',204,160)..' : Sends message from second character to ffochat channel.')
windower.add_to_chat(160,' '..string.color('//cp help detail',204,160)..' : Shows detailed ChatPorter commands.')
windower.add_to_chat(160,' '..string.color('//cp help textbox',204,160)..' : Shows detailed textbox commands.')
elseif args[2] == "detail" then
windower.add_to_chat(55,' ChatPorter detailed commands:')
windower.add_to_chat(160,' '..string.color('//l2 message',204,160)..' : Sends message from second character to linkshell.')
windower.add_to_chat(160,' '..string.color('//p2 message',204,160)..' : Sends message from second character to party.')
windower.add_to_chat(160,' '..string.color('//t2 name message',204,160)..' : Sends message from second character to name in tell.')
windower.add_to_chat(160,' '..string.color('//r2 message',204,160)..' : Sends reply message from second character.')
windower.add_to_chat(160,' '..string.color('//f# message',204,160)..' : Sends message from second character to FFOChat channel #. Works for 1-5.')
windower.add_to_chat(160,' '..string.color('//cp f# message',204,160)..' : Same as f#, but for any #.')
elseif args[2] == "textbox" then
windower.add_to_chat(55,'ChatPorter textbox commands:')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [toggle|displaychat]',204,160)..' : Toggles linkshell|party|tell|ffochat messages from showing or not.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t] color #',204,160)..' : Sets color of l|p|t text (acceptable values of 1-255).')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] show',204,160)..' : Toggles l|p|t|f textboxes from showing.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] clear',204,160)..' : Clears l|p|t|f textbox.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] lines #',204,160)..' : Sets # of lines to show in textbox.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [fontname|fn] *',204,160)..' : Sets fontname for textbox.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [fontsize|fs] #',204,160)..' : Sets fontsize for textbox.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] x #',204,160)..' : Sets x coordinate for textbox (acceptable values: 10-'.. playerResolution.x-10 ..').')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] y #',204,160)..' : Sets y coordinate for textbox (acceptable values: 10-'.. playerResolution.y-10 ..').')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [alpha|a] #',204,160)..' : Sets alpha (transparency) for textbox (acceptable values: 1-255; 0=fully transparent, 255=fully visible).')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [red|r] #',204,160)..' : Sets red value for RGB color of text in textbox.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [green|g] #',204,160)..' : Sets green value for RGB color of text in textbox.')
windower.add_to_chat(160,' '..string.color('//cp [l|p|t|f] [blue|b] #',204,160)..' : Sets blue value for RGB color of text in textbox.')
end
elseif comm == 'status' then
showStatus()
elseif comm == 'textbox' then
showStatus('textbox')
elseif comm == 'colors' then
showColors()
elseif comm == 'toggle' then
settings.usechatporter = not settings.usechatporter
showStatus('usechatporter')
elseif S({'l2','p2','t2','r2'}):contains(comm) or comm:match('^f%d%d?$') then
com2 = table.remove(args,1)
com2mess = table.sconcat(args)
com2mess = string.gsub(com2mess,"\n","\\\92\110")
if comm == 'l2' then
windower.send_ipc_message(specialChar.."l2:"..LSname..specialChar..playerName..specialChar..com2mess)
elseif comm == 'p2' then
windower.send_ipc_message(specialChar.."p2:"..""..specialChar..playerName..specialChar..com2mess)
elseif comm == 't2' then
windower.send_ipc_message(specialChar.."t2:"..playerName..specialChar..playerName..specialChar..com2mess)
elseif comm == 'r2' then
windower.send_ipc_message(specialChar.."r2:"..playerName..specialChar..playerName..specialChar..com2mess)
elseif string.first(comm, 1) == 'f' then
windower.send_ipc_message(specialChar.."f:"..string.at(comm,2)..specialChar..playerName..specialChar..com2mess)
end
elseif comm == "l" or comm == "p" or comm == "t" or comm == "f" then
com2 = args[2]
if com2 == nil then
com2 = "toggle"
end
if comm == "l" then
comm = "linkshell"
elseif comm == "p" then
comm = "party"
elseif comm == "t" then
comm = "tell"
elseif comm == "f" then
comm = "ffochat"
end
com3 = args[3]
com3num = tonumber(args[3])
if com2 == "toggle" or com2 == "displaychat" then
settings[comm].displaychat = not settings[comm].displaychat
showStatus('display'..comm..'chat')
elseif com2 == "show" then
settings[comm][com2] = not settings[comm][com2]
windower.add_to_chat(160," Setting "..comm.." textbox to display: "..string.color(onOffPrint(settings[comm][com2]),204,160))
elseif com2 == "clear" then
_G['show'..comm] = {}
elseif com2 == "fontname" or com2 == "fn" then
if com3 ~= nil then
com3 = table.slice(args,3)
com3 = tostring(table.sconcat(com3))
settings[comm].fontname = com3
windower.add_to_chat(160," Setting fontname: "..string.color(com3,204,160))
else
settings[comm].fontname = defaults[comm].fontname
windower.add_to_chat(160," No fontname specified; setting default fontname.")
end
elseif com2 == "lines" then
if com3num > 8 or com3num < 1 then
settings[comm][com2] = 8
windower.add_to_chat(160," Invalid setting. Lines must be a value from 1-8. Setting max value.")
else
settings[comm][com2] = com3num
windower.add_to_chat(160," Setting lines for "..comm.." textbox: "..string.color(tostring(com3num),204,160))
end
elseif com2 == "fontsize" or com2 == "fs" then
if com3num ~= nil and com3num >= 4 and com3num <= 144 then
settings[comm].fontsize = com3num
windower.add_to_chat(160," Setting fontsize for "..comm.." textbox: "..string.color(tostring(com3num),204,160))
else
settings[comm].fontsize = defaults[comm].fontsize
windower.add_to_chat(160," Invalid fontsize; acceptable values: 4-144. Setting to default.")
end
elseif com2 == "x" or com2 == "y" then
if com3num ~= nil and com3num >= 10 and com3num <= playerResolution[com2] - 10 then
settings[comm][com2] = com3num
windower.add_to_chat(160," Setting "..com2.." value for "..comm.." textbox: "..string.color(tostring(com3num),204,160))
else
settings[comm][com2] = defaults[comm][com2]
windower.add_to_chat(160," Invalid "..com2.." value; acceptable values: 10-".. playerResolution[com2]-10 ..". Setting to default.")
end
elseif S({'color','alpha','a','red','r','green','g','blue','b'}):contains(com2) then
if com2 == "a" then
com2 = "alpha"
elseif com2 == "r" then
com2 = "red"
elseif com2 == "g" then
com2 = "green"
elseif com2 == "b" then
com2 = "blue"
end
if (com3num ~= nil) and (com3num >= 1 and com3num <= 255) then
settings[comm][com2] = com3num
if com2 == "color" then
windower.add_to_chat(160," Setting "..com2.." for "..comm..": "..string.color(tostring(com3num),204,160))
else
windower.add_to_chat(160," Setting "..com2.." value for "..comm.." textbox: "..string.color(tostring(com3num),204,160))
end
else
settings[comm][com2] = defaults[comm][com2]
windower.add_to_chat(160," Invalid "..com2.." value; acceptable values: 1-255. Setting default.")
end
-- showStatus(_G['settings['..comm..']['..com2..']'])
-- _G['show'..tbName]
end
if comm == "linkshell" or comm == "party" or comm == "tell" or comm == "ffochat" then
show(comm)
if com3 ~= nil and tostring(com3) ~= tostring(dummysettings[comm][com2]) then
-- settings:save('all') -- all characters
settings:save() -- current character only
windower.add_to_chat(55,"Saving "..string.color('ChatPorter',204,55).." settings.")
elseif com2 == "show" or com2 == "toggle" or com2 == "displaychat" then
settings:save() -- current character only
windower.add_to_chat(55,"Saving "..string.color('ChatPorter',204,55).." settings.")
end
end
elseif comm:lower() == 'vprint' then
settings:vprint()
elseif comm:lower() == 'print' then
for key, value in pairs(settings) do
log(key, value)
end
elseif comm:lower() == 'dummy' then
dummysettings:vprint()
elseif comm:lower() == 'pt' then
showparty:vprint()
else
windower.add_to_chat(160, " Not a valid ".._addon.name.." v".._addon.version.." command. "..string.color('//cp help',204,160).." for a list of valid commands.")
return
end
else
addon_command('help')
end
end
windower.register_event('addon command',addon_command)
windower.register_event('linkshell change',function (linkshell)
LSname = windower.ffxi.get_player().linkshell;
end)
function showStatus(var)
if (var ~= nul) and var ~= "textbox" then
if var == "usechatporter" then
windower.add_to_chat(160," UseChatPorter: " .. string.color(onOffPrint(settings.usechatporter),204,160))
elseif var == "displaylinkshellchat" then
windower.add_to_chat(160," DisplayLinkshellChat: " .. string.color(onOffPrint(settings.linkshell.displaychat),204,160))
elseif var == "displaypartychat" then
windower.add_to_chat(160," DisplayPartyChat: " .. string.color(onOffPrint(settings.party.displaychat),204,160))
elseif var == "displaytellchat" then
windower.add_to_chat(160," DisplayTellChat: " .. string.color(onOffPrint(settings.tell.displaychat),204,160))
elseif var == "linkshellcolor" then
windower.add_to_chat(160," LinkshellColor: " .. string.color(tostring(settings.linkshell.color),204,160))
elseif var == "partycolor" then
windower.add_to_chat(160," PartyColor: " .. string.color(tostring(settings.party.color),204,160))
elseif var == "tellcolor" then
windower.add_to_chat(160," TellColor: " .. string.color(tostring(settings.tell.color),204,160))
end
elseif var == "textbox" then
windower.add_to_chat(55, "ChatPorter textbox settings: "..string.color('linkshell',settings.linkshell.color,160).." | "..string.color('party',settings.party.color,160).." | "..string.color('tell',settings.tell.color,160).." | "..string.color('ffochat',settings.ffochat.color,160))
-- windower.add_to_chat(160, " displaychat: "..string.color(onOffPrint(settings.linkshell.displaychat),settings.linkshell.color,160).." | "..string.color(onOffPrint(settings.party.displaychat),settings.party.color,160).." | "..string.color(onOffPrint(settings.tell.displaychat),settings.tell.color,160).." | "..string.color(onOffPrint(settings.ffochat.displaychat),settings.ffochat.color,160))
-- windower.add_to_chat(160, " color: "..string.color(tostring(settings.linkshell.color),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.color),settings.party.color,160).." | "..string.color(tostring(settings.tell.color),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.color),settings.ffochat.color,160))
windower.add_to_chat(160, " show: "..string.color(onOffPrint(settings.linkshell.show),settings.linkshell.color,160).." | "..string.color(onOffPrint(settings.party.show),settings.party.color,160).." | "..string.color(onOffPrint(settings.tell.show),settings.tell.color,160).." | "..string.color(onOffPrint(settings.ffochat.show),settings.ffochat.color,160))
windower.add_to_chat(160, " lines: "..string.color(tostring(settings.linkshell.lines),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.lines),settings.party.color,160).." | "..string.color(tostring(settings.tell.lines),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.lines),settings.ffochat.color,160))
windower.add_to_chat(160, " fontname: "..string.color(settings.linkshell.fontname,settings.linkshell.color,160).." | "..string.color(settings.party.fontname,settings.party.color,160).." | "..string.color(settings.tell.fontname,settings.tell.color,160).." | "..string.color(settings.ffochat.fontname,settings.ffochat.color,160))
windower.add_to_chat(160, " fontsize: "..string.color(tostring(settings.linkshell.fontsize),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.fontsize),settings.party.color,160).." | "..string.color(tostring(settings.tell.fontsize),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.fontsize),settings.ffochat.color,160))
windower.add_to_chat(160, " x: "..string.color(tostring(settings.linkshell.x),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.x),settings.party.color,160).." | "..string.color(tostring(settings.tell.x),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.x),settings.ffochat.color,160))
windower.add_to_chat(160, " y: "..string.color(tostring(settings.linkshell.y),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.y),settings.party.color,160).." | "..string.color(tostring(settings.tell.y),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.y),settings.ffochat.color,160))
windower.add_to_chat(160, " alpha: "..string.color(tostring(settings.linkshell.alpha),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.alpha),settings.party.color,160).." | "..string.color(tostring(settings.tell.alpha),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.alpha),settings.ffochat.color,160))
windower.add_to_chat(160, " red: "..string.color(tostring(settings.linkshell.red),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.red),settings.party.color,160).." | "..string.color(tostring(settings.tell.red),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.red),settings.ffochat.color,160))
windower.add_to_chat(160, " green: "..string.color(tostring(settings.linkshell.green),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.green),settings.party.color,160).." | "..string.color(tostring(settings.tell.green),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.green),settings.ffochat.color,160))
windower.add_to_chat(160, " blue: "..string.color(tostring(settings.linkshell.blue),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.blue),settings.party.color,160).." | "..string.color(tostring(settings.tell.blue),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.blue),settings.ffochat.color,160))
else
-- windower.add_to_chat(160," UseChatPorter: " .. string.color(onOffPrint(settings.usechatporter),204,160))
-- windower.add_to_chat(160," DisplayLinkshellChat: " .. string.color(onOffPrint(settings.linkshell.displaychat),204,160))
-- windower.add_to_chat(160," DisplayPartyChat: " .. string.color(onOffPrint(settings.party.displaychat),204,160))
-- windower.add_to_chat(160," DisplayTellChat: " .. string.color(onOffPrint(settings.tell.displaychat),204,160))
-- windower.add_to_chat(160," DisplayFFOChat: " .. string.color(onOffPrint(settings.ffochat.displaychat),204,160))
-- windower.add_to_chat(160," LinkshellColor: " .. string.color(tostring(settings.linkshell.color),204,160))
-- windower.add_to_chat(160," PartyColor: " .. string.color(tostring(settings.party.color),204,160))
-- windower.add_to_chat(160," TellColor: " .. string.color(tostring(settings.tell.color),204,160))
-- windower.add_to_chat(160," TellColor: " .. string.color(tostring(settings.ffochat.color),204,160))
windower.add_to_chat(55, "ChatPorter status: "..string.color('linkshell',settings.linkshell.color,160).." | "..string.color('party',settings.party.color,160).." | "..string.color('tell',settings.tell.color,160).." | "..string.color('ffochat',settings.ffochat.color,160))
windower.add_to_chat(160, " DisplayChat: "..string.color(onOffPrint(settings.linkshell.displaychat),settings.linkshell.color,160).." | "..string.color(onOffPrint(settings.party.displaychat),settings.party.color,160).." | "..string.color(onOffPrint(settings.tell.displaychat),settings.tell.color,160).." | "..string.color(onOffPrint(settings.ffochat.displaychat),settings.ffochat.color,160))
windower.add_to_chat(160, " Color: "..string.color(tostring(settings.linkshell.color),settings.linkshell.color,160).." | "..string.color(tostring(settings.party.color),settings.party.color,160).." | "..string.color(tostring(settings.tell.color),settings.tell.color,160).." | "..string.color(tostring(settings.ffochat.color),settings.ffochat.color,160))
windower.add_to_chat(160, " UseChatPorter: " .. string.color(onOffPrint(settings.usechatporter),204,160))
end
end
function onOffPrint(bleh)
if (bleh ~= nul) then
if (bleh == 1) or (bleh == true) then
bleh = "ON";
else
bleh = "OFF";
end
else
bleh = "OFF";
end
return bleh;
end
function showColors()
colors = {}
colors[1] = 'Menu > Font Colors > Chat > Immediate vicinity ("Say")'
colors[2] = 'Menu > Font Colors > Chat > Wide area ("Shout")'
colors[3] = 'Menu > Font Colors > Chat > Extremely wide area ("Yell")'
colors[4] = 'Menu > Font Colors > Chat > Tell target only ("Tell")'
colors[5] = 'Menu > Font Colors > Chat > All party members ("Party")'
colors[6] = 'Menu > Font Colors > Chat > Linkshell group ("Linkshell")'
colors[7] = 'Menu > Font Colors > Chat > Emotes'
colors[8] = 'Menu > Font Colors > System > Calls for help'
colors[17] = 'Menu > Font Colors > Chat > Messages ("Message")'
colors[142] = 'Menu > Font Colors > Chat > NPC Conversations' -- 143?
colors[20] = 'Menu > Font Colors > For Others > HP/MP others loose'
colors[21] = 'Menu > Font Colors > For Others > Actions others evade'
colors[22] = 'Menu > Font Colors > For Others > HP/MP others recover'
colors[60] = 'Menu > Font Colors > For Others > Beneficial effects others are granted'
colors[61] = 'Menu > Font Colors > For Others > Detrimental effects others receive'
colors[63] = 'Menu > Font Colors > For Others > Effects others resist'
colors[28] = 'Menu > Font Colors > For Self > HP/MP you loose'
colors[29] = 'Menu > Font Colors > For Self > Actions you evade'
colors[30] = 'Menu > Font Colors > For Self > HP/MP you recover'
colors[56] = 'Menu > Font Colors > For Self > Beneficial effects you are granted'
colors[57] = 'Menu > Font Colors > For Self > Detrimental effects you receive'
colors[59] = 'Menu > Font Colors > For Self > Effects you resist'
colors[8] = 'Menu > Font Colors > System > Calls for help'
colors[50] = 'Menu > Font Colors > System > Standard battle messages'
colors[121] = 'Menu > Font Colors > System > Basic system messages'
UsedColors = {9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,31,32,33,34,35,40,41,42,43,51,52,55,58,62,64,65,66,67,68,69,70,71,72,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,122,127,128,129,130,131,132,133,134,135,136,137,138,139,140,144,145,146,147,148,149,150,151,152,153,162,163,164,165,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,205,208,253,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,284,285,286,287,292,293,294,295,300,301,302,303,308,309,310,311,316,317,318,319,324,325,326,327,332,333,334,335,340,341,342,343,344,345,346,347,348,349,350,351,355,357,358,360,361,363,366,369,372,374,375,378,381,384,395,406,409,412,415,416,418,421,424,437,450,453,456,458,459,462,479,490,493,496,499,500,502,505,507,508}
makeArray = T{}
for v = 1, 255, 1 do
if colors[v] ~= nil then
windower.add_to_chat(v, string.rep(0,3-#tostring(v))..v.." - "..colors[v])
else
if table.contains(UsedColors,v) ~= true then
-- makeArray[#makeArray+1] = "\x1F"..string.char(v)..string.rep(0,3-#tostring(v))..v.."\x1F"..string.char(160)
makeArray[#makeArray+1] = string.char(0x1F,v)..string.rep(0,3-#tostring(v))..v..string.char(0x1F,v)..string.char(160)
end
end
end
windower.add_to_chat(160,table.sconcat(makeArray))
--makeArray:vprint()
end
function show(tbName)
if #_G['show'..tbName] > 8 then
table.remove(_G["show"..tbName],1)
end
windower.text.set_bg_color("show"..tbName, 200, 30, 30, 30)
if #_G['show'..tbName] == 0 then
windower.text.set_bg_visibility("show"..tbName, false)
else
windower.text.set_bg_visibility("show"..tbName, true)
end
windower.text.set_color("show"..tbName, settings[tbName].alpha, settings[tbName].red, settings[tbName].green, settings[tbName].blue)
windower.text.set_font("show"..tbName, settings[tbName].fontname)
windower.text.set_font_size("show"..tbName, settings[tbName].fontsize)
windower.text.set_location("show"..tbName, settings[tbName].x, settings[tbName].y)
windower.text.set_visibility("show"..tbName, settings[tbName].show)
if #_G['show'..tbName] <= settings[tbName].lines then
start = 1
else
start = #_G['show'..tbName]-settings[tbName].lines+1
end
windower.text.set_text("show"..tbName, " " ..table.concat(table.slice(_G['show'..tbName], start, #_G['show'..tbName]), '\n '))
end
windower.register_event('ipc message',function (msg)
if (settings.usechatporter == true) then
if (string.find(msg, "|(%w+):(%w*)|(%a+)|(.+)")) then
a,b,chatMode,senderLSname,senderName,message = string.find(msg, "|(%w+):(%w*)|(%a+)|(.+)")
if (chatMode == "l") and (settings.linkshell.displaychat == true) then
if (senderLSname ~= LSname) then
windower.add_to_chat(settings.linkshell.color,"["..senderLSname.."] <"..senderName.."> "..message)
showlinkshell[#showlinkshell +1] = " ["..senderLSname.."] <"..senderName.."> "..message:strip_format().." "
show("linkshell")
end
elseif (chatMode == "t") and (settings.tell.displaychat == true) then
if (playerName ~= senderLSname) and (playerName ~= senderName) then
windower.add_to_chat(settings.tell.color,"[t] "..senderName..">>"..senderLSname.." "..message)
end
elseif (chatMode == "p") and (settings.party.displaychat == true) then
if (T(windower.ffxi.get_party()):with('name', senderName) == nil) then
windower.add_to_chat(settings.party.color," ("..senderName..") "..message)
showparty[#showparty +1] = " ("..senderName..") "..message:strip_format():trim().." "
show("party")
end
elseif (chatMode == "l2") then
windower.send_command("input /l "..message)
elseif (chatMode == "p2") then
windower.send_command("input /p "..message)
elseif (chatMode == "t2") then
windower.send_command("input /t "..message)
elseif (chatMode == "r2") then
windower.send_command("input /t "..lastTellFrom.." "..message)
elseif (chatMode == "f") then
windower.send_command("input /"..senderLSname.." "..message)
end
end
end
end)
windower.register_event('incoming text',function (original, modified, mode)
if (playerName == nil) then
playerName = windower.ffxi.get_player().name
end
if (LSname == nil) then
LSname = windower.ffxi.get_player().linkshell
end
if (mode == 6) or (mode == 14) then -- linkshell
if (string.find(original, "<(%a+)> (.+)")) then
a,b,player,message = string.find(original, "<(%a+)> (.+)")
windower.send_ipc_message(specialChar.."l:"..LSname..specialChar..player..specialChar..message)
showlinkshell[#showlinkshell +1] = " <"..player.."> "..message:strip_format():trim().." "
show("linkshell")
end
elseif (mode == 5) or (mode == 13) then -- party
if (string.find(original, "%((%a+)%) (.+)")) then
a,b,player,message = string.find(original, "%((%a+)%) (.+)")
windower.send_ipc_message(specialChar.."p:"..""..specialChar..player..specialChar..message)
showparty[#showparty +1] = " ("..player..") "..message:strip_format():trim().." "
show("party")
end
elseif (mode == 4) or (mode == 12) then -- tell
if (string.find(original, ">>(%a+) : (.+)")) then
a,b,player,message = string.find(original, ">>(%a+) : (.+)")
windower.send_ipc_message(specialChar.."t:"..player..specialChar..playerName..specialChar..message)
showtell[#showtell +1] = ">>"..player.." : "..message:strip_format():trim().." "
show("tell")
elseif (string.find(original, "(%a+)>> (.+)")) then
a,b,player,message = string.find(original, "(%a+)>> (.+)")
windower.send_ipc_message(specialChar.."t:"..playerName..specialChar..player..specialChar..message)
showtell[#showtell +1] = playerName..">> "..message:strip_format():trim().." "
show("tell")
end
end
if (string.find(original, "%[(%d+):#(%a+)%](.+): (.+)")) then
a,b,channum,chanchan,player,message = string.find(original, "%[(%d+):#(%a+)%](.+): (.+)")
-- windower.send_ipc_message(specialChar.."f:"..player..specialChar..playerName..specialChar..message)
showffochat[#showffochat +1] = " "..original:strip_format():trim().." "
show("ffochat")
end
--[[
4: tell (out)
12: tell (in)
5: party (me)
13: party (others)
6: linkshell (me)
14: linkshell (others)
--]]
end)
--[[
possible port to ffochat LSchannel
allow cp to pass restricted characters, need to delimit them
]]--
|
--[[
=============
input.lua
=============
OpenFNaF Input wrapper in LUA
]]
-- Input Modes
INPUT_BUTTON_DOWN = 0
INPUT_KEYBOARD_DOWN = 1
-- Controller
INPUT_CROSS = 0
INPUT_SQUARE = 1
INPUT_TRIANGLE = 2
INPUT_CIRCLE = 3
INPUT_UP = 4
INPUT_DOWN = 5
INPUT_LEFT = 6
INPUT_RIGHT = 7
INPUT_LTRIGGER = 8
INPUT_RTRIGGER = 9
INPUT_START = 10
INPUT_SELECT = 11
-- Keyboard
INPUT_KEY_A = 0
INPUT_KEY_B = 1
INPUT_KEY_C = 2
INPUT_KEY_D = 3
INPUT_KEY_E = 4
INPUT_KEY_F = 5
INPUT_KEY_G = 6
INPUT_KEY_H = 7
INPUT_KEY_I = 8
INPUT_KEY_J = 9
INPUT_KEY_K = 10
INPUT_KEY_L = 11
INPUT_KEY_M = 12
INPUT_KEY_N = 13
INPUT_KEY_O = 14
INPUT_KEY_P = 15
INPUT_KEY_Q = 16
INPUT_KEY_R = 17
INPUT_KEY_S = 18
INPUT_KEY_T = 19
INPUT_KEY_U = 20
INPUT_KEY_V = 21
INPUT_KEY_W = 22
INPUT_KEY_X = 23
INPUT_KEY_Y = 24
INPUT_KEY_Z = 25
INPUT_KEY_0 = 26
INPUT_KEY_1 = 27
INPUT_KEY_2 = 28
INPUT_KEY_3 = 29
INPUT_KEY_4 = 30
INPUT_KEY_5 = 31
INPUT_KEY_6 = 32
INPUT_KEY_7 = 33
INPUT_KEY_8 = 34
INPUT_KEY_9 = 35
INPUT_KEY_LCTRL = 36
INPUT_KEY_LSHIFT = 37
INPUT_KEY_LALT = 38
-- skip 39 because its the winkey and that's a lame key
INPUT_KEY_RCTRL = 40
INPUT_KEY_RSHIFT = 41
INPUT_KEYRALT = 42
function Input_ButtonDown(button)
if OF_GetInput(button, INPUT_BUTTON_DOWN) ~= 0 then
return true
else
return false
end
end
function Input_KeyDown(key)
if OF_GetInput(key, INPUT_KEYBOARD_DOWN) ~= 0 then
return true
else
return false
end
end
|
local config = require("tabset.config")
local tabset = {}
function tabset.setup(user_config)
user_config = user_config or {}
config.set_config(user_config)
end
vim.cmd([[
augroup tabset
autocmd FileType * lua require('tabset.logic').set_settings()
augroup END
]])
return tabset
|
----------------------------------------------------------------------------------------------------
-- MUDpp Race - Human
----------------------------------------------------------------------------------------------------
human = { name = "Human"
, desc = "Human characters can master any skills but have average stats."
}
races["human"] = human
|
local N, S, E, W = 1, 2, 4, 8
local NEC, SEC, SWC, NWC = 16, 32, 64, 128
local DX = { [E] = 1, [W] = -1, [N] = 0, [S] = 0 }
local DY = { [E] = 0, [W] = 0, [N] = -1, [S] = 1 }
local OPPOSITE = { [E] = W, [W] = E, [N] = S, [S] = N }
return {
DIRECTIONS = {N, S, E, W, NEC, SEC, SWC, NWC},
DX = DX,
DY = DY,
OPPOSITE = OPPOSITE,
}
|
return function(table, methodname, args, callback)
for k, v in pairs(table) do
callback(k,v)
v[methodname](v, unpack(args))
end
end
|
plate_chest_db = {
id0 = {
source = "Shattershard",
drop_rate = "0.0",
name = "Wardenguard's Chestplate",
category_territory = "",
territory = "War Zone",
id = "0",
expansion = "",
location = "Darkshore"
},
id1 = {
source = "Onu",
drop_rate = "0.0",
name = "Deathguard's Chestplate",
category_territory = "",
territory = "War Zone",
id = "1",
expansion = "",
location = "Darkshore"
},
id2 = {
source = "Aman",
drop_rate = "0.0",
name = "Deathguard's Breastplate",
category_territory = "",
territory = "War Zone",
id = "2",
expansion = "",
location = "Darkshore"
},
id3 = {
source = "Moxo the Beheader",
drop_rate = "0.0",
name = "Wardenguard's Breastplate",
category_territory = "",
territory = "War Zone",
id = "3",
expansion = "",
location = "Darkshore"
},
id4 = {
source = "Vectis",
drop_rate = "0.0",
name = "Chestguard of Virulent Mutagens",
category_territory = "Raid",
territory = "Horde",
id = "4",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id5 = {
source = "Zul",
drop_rate = "0.0",
name = "Chestplate of Apocalyptic Machinations",
category_territory = "Raid",
territory = "Horde",
id = "5",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id6 = {
source = "Jiarak",
drop_rate = "Unknown",
name = "Stormcrash Chestguard",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "6",
expansion = "Battle For Azeroth",
location = "Zuldazar"
},
id7 = {
source = "The Lions Roar",
drop_rate = "Unknown",
name = "Molded War Machine Grill",
category_territory = "",
territory = "Horde",
id = "7",
expansion = "",
location = "Arathi Highlands"
},
id8 = {
source = "Dooms Howl",
drop_rate = "Unknown",
name = "Polished Shieldbearer's Breastplate",
category_territory = "",
territory = "Horde",
id = "8",
expansion = "",
location = "Arathi Highlands"
},
id9 = {
source = "Rawani Kanae",
drop_rate = "Unknown",
name = "Breastplate of Divine Purification",
category_territory = "Raid",
territory = "Horde",
id = "9",
expansion = "Battle For Azeroth",
location = "Battle of Dazar'alor"
},
id10 = {
source = "Laminaria",
drop_rate = "Unknown",
name = "Sea Swell Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "10",
expansion = "Battle For Azeroth",
location = "Battle of Dazar'alor"
},
id11 = {
source = "King Rastakhan",
drop_rate = "Unknown",
name = "Breastplate of the Deathbound",
category_territory = "Raid",
territory = "Horde",
id = "11",
expansion = "Battle For Azeroth",
location = "Battle of Dazar'alor"
},
id12 = {
source = "Volzith the Whisperer",
drop_rate = "0.0",
name = "Chestguard of the Deep Denizen",
category_territory = "Dungeon",
territory = "Horde",
id = "12",
expansion = "Battle For Azeroth",
location = "Shrine of the Storm"
},
id13 = {
source = "ViqGoth",
drop_rate = "Unknown",
name = "Harpooner's Plate Cuirass",
category_territory = "Dungeon",
territory = "Horde",
id = "13",
expansion = "Battle For Azeroth",
location = "Siege of Boralus"
},
id14 = {
source = "Avatar of Sethraliss",
drop_rate = "Unknown",
name = "Desert Guardian's Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "14",
expansion = "Battle For Azeroth",
location = "Temple of Sethraliss"
},
id15 = {
source = "Unbound Abomination",
drop_rate = "0.0",
name = "Breastplate of Arterial Protection",
category_territory = "Dungeon",
territory = "Horde",
id = "15",
expansion = "Battle For Azeroth",
location = "The Underrot"
},
id16 = {
source = "Overseer Korgus",
drop_rate = "0.0",
name = "Ashvane Warden's Cuirass",
category_territory = "Dungeon",
territory = "Horde",
id = "16",
expansion = "Battle For Azeroth",
location = "Tol Dagor"
},
id17 = {
source = "Gorak Tul",
drop_rate = "Unknown",
name = "Breastplate of the Vengeful",
category_territory = "Dungeon",
territory = "Horde",
id = "17",
expansion = "Battle For Azeroth",
location = "Waycrest Manor"
},
id18 = {
source = "Haegol the Hammer",
drop_rate = "0.0",
name = "Rockstopper Breastplate",
category_territory = "",
territory = "Horde",
id = "18",
expansion = "Battle For Azeroth",
location = "Stormsong Valley"
},
id19 = {
source = "Avalanche",
drop_rate = "0.0",
name = "Gryphon-Rider's Breastplate",
category_territory = "",
territory = "Horde",
id = "19",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id20 = {
source = "Bajiani the Slick",
drop_rate = "0.0",
name = "Groggy Brawler's Chestplate",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "20",
expansion = "Battle For Azeroth",
location = "Vol'dun"
},
id21 = {
source = "Skullripper",
drop_rate = "0.0",
name = "7th Legionnaire's Chestguard",
category_territory = "",
territory = "Horde",
id = "21",
expansion = "",
location = "Arathi Highlands"
},
id22 = {
source = "Yogursa",
drop_rate = "0.0",
name = "Honorbound Centurion's Breastplate",
category_territory = "",
territory = "Horde",
id = "22",
expansion = "",
location = "Arathi Highlands"
},
id23 = {
source = "Ghuun",
drop_rate = "0.0",
name = "Torgashell Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "23",
expansion = "Battle For Azeroth",
location = "Uldir"
},
id24 = {
source = "Briarwood Bulwark",
drop_rate = "0.0",
name = "Corlain Breastplate",
category_territory = "",
territory = "Horde",
id = "24",
expansion = "Battle For Azeroth",
location = "Drustvar"
},
id25 = {
source = "Dread Captain Lockwood",
drop_rate = "0.0",
name = "Ashvane Company Chestplate",
category_territory = "Dungeon",
territory = "Horde",
id = "25",
expansion = "Battle For Azeroth",
location = "Siege of Boralus"
},
id26 = {
source = "Aqusirr",
drop_rate = "0.0",
name = "Brineworks Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "26",
expansion = "Battle For Azeroth",
location = "Shrine of the Storm"
},
id27 = {
source = "Animated Guardian",
drop_rate = "0.0",
name = "Direbone Frill Chestplate",
category_territory = "Dungeon",
territory = "Horde",
id = "27",
expansion = "Battle For Azeroth",
location = "Kings' Rest"
},
id28 = {
source = "Nezara",
drop_rate = "0.0",
name = "Stormforger Chestplate",
category_territory = "Outdoor Zone",
territory = "Horde",
id = "28",
expansion = "Battle For Azeroth",
location = "Vol'dun"
},
id29 = {
source = "Garothi Worldbreaker",
drop_rate = "Unknown",
name = "Soul-Tempered Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "29",
expansion = "Legion",
location = "Antorus, the Burning Throne"
},
id30 = {
source = "Aggramar",
drop_rate = "Unknown",
name = "Breastplate of Molten Rebirth",
category_territory = "Raid",
territory = "Horde",
id = "30",
expansion = "Legion",
location = "Antorus, the Burning Throne"
},
id31 = {
source = "Felblade Shocktrooper",
drop_rate = "0.0",
name = "Impenetrable Garothi Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "31",
expansion = "Legion",
location = "Antorus, the Burning Throne"
},
id32 = {
source = "Essence of Eonar",
drop_rate = "Unknown",
name = "Dreadwake Bonecage",
category_territory = "Raid",
territory = "Horde",
id = "32",
expansion = "Legion",
location = "Antorus, the Burning Throne"
},
id33 = {
source = "Essence of Eonar",
drop_rate = "Unknown",
name = "Light's Vanguard Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "33",
expansion = "Legion",
location = "Antorus, the Burning Throne"
},
id34 = {
source = "Essence of Eonar",
drop_rate = "Unknown",
name = "Juggernaut Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "34",
expansion = "Legion",
location = "Antorus, the Burning Throne"
},
id35 = {
source = "Inquisitor Meto",
drop_rate = "Unknown",
name = "Breastplate of Terminal End",
category_territory = "",
territory = "Horde",
id = "35",
expansion = "Legion",
location = "Black Temple"
},
id36 = {
source = "Harjatan",
drop_rate = "0.0",
name = "Wave-Hammered Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "36",
expansion = "Legion",
location = "Tomb of Sargeras"
},
id37 = {
source = "Huntress Kasparian",
drop_rate = "Unknown",
name = "Cuirass of Blinding Dawn",
category_territory = "Raid",
territory = "Horde",
id = "37",
expansion = "Legion",
location = "Tomb of Sargeras"
},
id38 = {
source = "Maiden of Vigilance",
drop_rate = "0.0",
name = "Gravewarden Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "38",
expansion = "Legion",
location = "Tomb of Sargeras"
},
id39 = {
source = "Maiden of Vigilance",
drop_rate = "0.0",
name = "Radiant Lightbringer Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "39",
expansion = "Legion",
location = "Tomb of Sargeras"
},
id40 = {
source = "Maiden of Vigilance",
drop_rate = "0.0",
name = "Titanic Onslaught Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "40",
expansion = "Legion",
location = "Tomb of Sargeras"
},
id41 = {
source = "Sivash",
drop_rate = "Unknown",
name = "Si'vashi Guard's Breastplate",
category_territory = "",
territory = "Horde",
id = "41",
expansion = "Legion",
location = "Broken Shore"
},
id42 = {
source = "Talestra the Vile",
drop_rate = "0.0",
name = "World-Defiler's Cuirass",
category_territory = "",
territory = "Horde",
id = "42",
expansion = "Legion",
location = "Krokuun"
},
id43 = {
source = "Krosus",
drop_rate = "Unknown",
name = "Dreadwyrm Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "43",
expansion = "Legion",
location = "The Nighthold"
},
id44 = {
source = "Krosus",
drop_rate = "Unknown",
name = "Breastplate of the Highlord",
category_territory = "Raid",
territory = "Horde",
id = "44",
expansion = "Legion",
location = "The Nighthold"
},
id45 = {
source = "Krosus",
drop_rate = "Unknown",
name = "Chestplate of the Obsidian Aspect",
category_territory = "Raid",
territory = "Horde",
id = "45",
expansion = "Legion",
location = "The Nighthold"
},
id46 = {
source = "Spellblade Aluriel",
drop_rate = "Unknown",
name = "Captain's Parade Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "46",
expansion = "Legion",
location = "The Nighthold"
},
id47 = {
source = "Guldan",
drop_rate = "Unknown",
name = "Breastplate of the Remembered King",
category_territory = "Raid",
territory = "Horde",
id = "47",
expansion = "Legion",
location = "The Nighthold"
},
id48 = {
source = "Nightbane",
drop_rate = "0",
name = "Chestplate of Impenetrable Darkness",
category_territory = "Dungeon",
territory = "Horde",
id = "48",
expansion = "Legion",
location = "Return to Karazhan"
},
id49 = {
source = "Ana-Mouz",
drop_rate = "Unknown",
name = "Low-Cut Chestplate",
category_territory = "",
territory = "Horde",
id = "49",
expansion = "Legion",
location = "Suramar"
},
id50 = {
source = "Sharthos",
drop_rate = "Unknown",
name = "Chestplate of Blackened Emeralds",
category_territory = "",
territory = "Horde",
id = "50",
expansion = "Legion",
location = "Val'sharah"
},
id51 = {
source = "Moroes",
drop_rate = "0.0",
name = "Breastplate of Obligation",
category_territory = "Dungeon",
territory = "Horde",
id = "51",
expansion = "Legion",
location = "Return to Karazhan"
},
id52 = {
source = "Odyn",
drop_rate = "Unknown",
name = "Gleaming Val'kyr Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "52",
expansion = "Legion",
location = "Trial of Valor"
},
id53 = {
source = "Ysondre",
drop_rate = "0.0",
name = "Horror Inscribed Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "53",
expansion = "Legion",
location = "The Emerald Nightmare"
},
id54 = {
source = "Nythendra",
drop_rate = "0.0",
name = "Insect-Etched Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "54",
expansion = "Legion",
location = "The Emerald Nightmare"
},
id55 = {
source = "Oakheart",
drop_rate = "0.0",
name = "Breastplate of Preservation",
category_territory = "Dungeon",
territory = "Horde",
id = "55",
expansion = "Legion",
location = "Darkheart Thicket"
},
id56 = {
source = "Ivanyr",
drop_rate = "0.0",
name = "Crackling Overcharge Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "56",
expansion = "Legion",
location = "The Arcway"
},
id57 = {
source = "Talixae Flamewreath",
drop_rate = "0.0",
name = "Inferno Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "57",
expansion = "Legion",
location = "Court of Stars"
},
id58 = {
source = "Amalgam of Souls",
drop_rate = "0.0",
name = "Etheldrin's Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "58",
expansion = "Legion",
location = "Black Rook Hold"
},
id59 = {
source = "Festerface",
drop_rate = "0.0",
name = "Slimeflow Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "59",
expansion = "Legion",
location = "Violet Hold"
},
id60 = {
source = "Fel Lord Betrug",
drop_rate = "0.0",
name = "Chestplate of the Obstinate Conqueror",
category_territory = "Dungeon",
territory = "Horde",
id = "60",
expansion = "Legion",
location = "Violet Hold"
},
id61 = {
source = "Glazer",
drop_rate = "Unknown",
name = "Polished Jade Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "61",
expansion = "Legion",
location = "Vault of the Wardens"
},
id62 = {
source = "Thrashbite the Scornful",
drop_rate = "0.0",
name = "Tenderized Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "62",
expansion = "Legion",
location = "Cathedral of Eternal Night"
},
id63 = {
source = "Zuraal the Ascended",
drop_rate = "0.0",
name = "Breastplate of the Dark Touch",
category_territory = "Dungeon",
territory = "Horde",
id = "63",
expansion = "Legion",
location = "The Seat of the Triumvirate"
},
id64 = {
source = "Sentinax Interrogator",
drop_rate = "0.0",
name = "Aethrynn's Everwarm Chestplate",
category_territory = "",
territory = "Horde",
id = "64",
expansion = "Legion",
location = "Broken Shore"
},
id65 = {
source = "Quartermaster Ozorg",
drop_rate = "Unknown",
name = "Deathlord's Chestguard",
category_territory = "",
territory = "Horde",
id = "65",
expansion = "Legion",
location = "Broken Shore"
},
id66 = {
source = "Quartermaster Durnolf",
drop_rate = "Unknown",
name = "Battlelord's Chestplate",
category_territory = "",
territory = "",
id = "66",
expansion = "Legion",
location = "Skyhold"
},
id67 = {
source = "Eadric the Pure",
drop_rate = "Unknown",
name = "Breastplate of the Silver Hand",
category_territory = "",
territory = "Horde",
id = "67",
expansion = "",
location = "Eastern Plaguelands"
},
id68 = {
source = "Shade of Xavius",
drop_rate = "0.0",
name = "Wracksoul Chestplate",
category_territory = "Dungeon",
territory = "Horde",
id = "68",
expansion = "Legion",
location = "Darkheart Thicket"
},
id69 = {
source = "Gelthrog",
drop_rate = "0.0",
name = "Breastplate of Kel'balor",
category_territory = "",
territory = "Horde",
id = "69",
expansion = "Legion",
location = "Stormheim"
},
id70 = {
source = "Dargrul",
drop_rate = "0.0",
name = "Rockbound Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "70",
expansion = "Legion",
location = "Neltharion's Lair"
},
id71 = {
source = "Ymiron, the Fallen King",
drop_rate = "0.0",
name = "Skoldiir Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "71",
expansion = "Legion",
location = "Maw of Souls"
},
id72 = {
source = "Warlord Parjesh",
drop_rate = "0.0",
name = "Coralplate Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "72",
expansion = "Legion",
location = "Eye of Azshara"
},
id73 = {
source = "Advisor Vandros",
drop_rate = "0.0",
name = "Arcane Defender's Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "73",
expansion = "Legion",
location = "The Arcway"
},
id74 = {
source = "Felsiege Infernal",
drop_rate = "0.0",
name = "Ley-Scarred Chestplate",
category_territory = "",
territory = "Horde",
id = "74",
expansion = "Legion",
location = "Highmountain"
},
id75 = {
source = "Legion Brutallizer",
drop_rate = "0.0",
name = "Portalguard Chestplate",
category_territory = "",
territory = "Horde",
id = "75",
expansion = "Legion",
location = "Azsuna"
},
id76 = {
source = "Hellfire Infernal",
drop_rate = "0.0",
name = "Wardbreaker Chestplate",
category_territory = "",
territory = "Horde",
id = "76",
expansion = "Legion",
location = "Thunder Totem"
},
id77 = {
source = "Iroxus",
drop_rate = "0.0",
name = "Nightsfall Breastplate",
category_territory = "",
territory = "Horde",
id = "77",
expansion = "Legion",
location = "Highmountain"
},
id78 = {
source = "Zarvok",
drop_rate = "0.0",
name = "Greystone Chestpiece",
category_territory = "",
territory = "Horde",
id = "78",
expansion = "Legion",
location = "Highmountain"
},
id79 = {
source = "Lord Commander Alexius",
drop_rate = "0.0",
name = "Xorothian Breastplate",
category_territory = "",
territory = "Horde",
id = "79",
expansion = "Legion",
location = "Stormheim"
},
id80 = {
source = "The Tears of Elune",
drop_rate = "quest",
name = "Shaladrassil Chestguard",
category_territory = "",
territory = "Horde",
id = "80",
expansion = "Legion",
location = "Val'sharah"
},
id81 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "81",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id82 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "War Zone",
id = "82",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id83 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Plate Breastplate",
category_territory = "",
territory = "War Zone",
id = "83",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id84 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Plate Chestguard",
category_territory = "",
territory = "War Zone",
id = "84",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id85 = {
source = "Holly McTilla",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Plate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "85",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id86 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "86",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id87 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "87",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id88 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Plate Breastplate",
category_territory = "",
territory = "Alliance",
id = "88",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id89 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Plate Chestguard",
category_territory = "",
territory = "Alliance",
id = "89",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id90 = {
source = "Malukah Lightsong",
drop_rate = "Unknown",
name = "Warmongering Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "90",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id91 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "91",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id92 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "War Zone",
id = "92",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id93 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Plate Breastplate",
category_territory = "",
territory = "War Zone",
id = "93",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id94 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Plate Chestguard",
category_territory = "",
territory = "War Zone",
id = "94",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id95 = {
source = "Amelia Clarke",
drop_rate = "Unknown",
name = "Wild Gladiator's Plate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "95",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id96 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "96",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id97 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "97",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id98 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Plate Breastplate",
category_territory = "",
territory = "Alliance",
id = "98",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id99 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Plate Chestguard",
category_territory = "",
territory = "Alliance",
id = "99",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id100 = {
source = "Cladd Dawnstrider",
drop_rate = "Unknown",
name = "Wild Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "100",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id101 = {
source = "Li ",
drop_rate = "Unknown",
name = "Warmongering Combatant's Dreadplate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "101",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id102 = {
source = "Li ",
drop_rate = "Unknown",
name = "Warmongering Combatant's Scaled Chestpiece",
category_territory = "",
territory = "War Zone",
id = "102",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id103 = {
source = "Li ",
drop_rate = "Unknown",
name = "Warmongering Combatant's Plate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "103",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id104 = {
source = "Taeloxe Soulshrivel",
drop_rate = "Unknown",
name = "Warmongering Combatant's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "104",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id105 = {
source = "Taeloxe Soulshrivel",
drop_rate = "Unknown",
name = "Warmongering Combatant's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "105",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id106 = {
source = "Taeloxe Soulshrivel",
drop_rate = "Unknown",
name = "Warmongering Combatant's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "106",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id107 = {
source = "Shadow-Lord Iskar",
drop_rate = "0.0",
name = "Chestguard of Ill Fate",
category_territory = "Raid",
territory = "Horde",
id = "107",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id108 = {
source = "Mannoroth",
drop_rate = "0.0",
name = "Demongaze Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "108",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id109 = {
source = "Mannoroth",
drop_rate = "0.0",
name = "Cuirass of the Ceaseless Vigil",
category_territory = "Raid",
territory = "Horde",
id = "109",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id110 = {
source = "Mannoroth",
drop_rate = "0.0",
name = "Breastplate of Iron Wrath",
category_territory = "Raid",
territory = "Horde",
id = "110",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id111 = {
source = "Iron Reaver",
drop_rate = "0.0",
name = "Stamped Felsteel Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "111",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id112 = {
source = "Kormrok",
drop_rate = "Unknown",
name = "Chestplate of Potential Energy",
category_territory = "Raid",
territory = "Horde",
id = "112",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id113 = {
source = "Archimonde",
drop_rate = "0",
name = "Demonbreaker Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "113",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id114 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "114",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id115 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "115",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id116 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Plate Breastplate",
category_territory = "",
territory = "Alliance",
id = "116",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id117 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Plate Chestguard",
category_territory = "",
territory = "Alliance",
id = "117",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id118 = {
source = "Blood Guard Axelash",
drop_rate = "Unknown",
name = "Primal Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "118",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id119 = {
source = "Phemos",
drop_rate = "0.0",
name = "Chestplate of Arcane Volatility",
category_territory = "Raid",
territory = "Horde",
id = "119",
expansion = "Warlords Of Draenor",
location = "Highmaul"
},
id120 = {
source = "Oregorger",
drop_rate = "0.0",
name = "Chestplate of Rolling Fury",
category_territory = "Raid",
territory = "Horde",
id = "120",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id121 = {
source = "Marak the Blooded",
drop_rate = "0.0",
name = "Bloodsoaked Heart Protector",
category_territory = "Raid",
territory = "Horde",
id = "121",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id122 = {
source = "Flamebender Kagraz",
drop_rate = "0.0",
name = "Ogreskull Boneplate Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "122",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id123 = {
source = "Flamebender Kagraz",
drop_rate = "0.0",
name = "Battleplate of Guiding Light",
category_territory = "Raid",
territory = "Horde",
id = "123",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id124 = {
source = "Flamebender Kagraz",
drop_rate = "0.0",
name = "Blackhand's Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "124",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id125 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "125",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id126 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "War Zone",
id = "126",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id127 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Plate Breastplate",
category_territory = "",
territory = "War Zone",
id = "127",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id128 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Plate Chestguard",
category_territory = "",
territory = "War Zone",
id = "128",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id129 = {
source = "Ingrid Blackingot",
drop_rate = "Unknown",
name = "Primal Gladiator's Plate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "129",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id130 = {
source = "Kromog",
drop_rate = "Unknown",
name = "Chestplate of Runed Earth",
category_territory = "Raid",
territory = "Horde",
id = "130",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id131 = {
source = "Beastlord Darmac",
drop_rate = "0",
name = "Heartsmasher Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "131",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id132 = {
source = "Tarlna the Ageless",
drop_rate = "0.0",
name = "Falling Leaf Breastplate",
category_territory = "",
territory = "Horde",
id = "132",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id133 = {
source = "Flamebender Kagraz",
drop_rate = "0",
name = "Blacksteel Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "133",
expansion = "Warlords Of Draenor",
location = "Blackrock Foundry"
},
id134 = {
source = "Shadow-Lord Iskar",
drop_rate = "0",
name = "Corrupted Talonguard Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "134",
expansion = "Warlords Of Draenor",
location = "Hellfire Citadel"
},
id135 = {
source = "Feasting on the Dragon",
drop_rate = "quest",
name = "Nar'thalas Chestplate",
category_territory = "",
territory = "Horde",
id = "135",
expansion = "Legion",
location = "Azsuna"
},
id136 = {
source = "Entangled Dreams",
drop_rate = "quest",
name = "Rooksguard Breastplate",
category_territory = "",
territory = "Horde",
id = "136",
expansion = "Legion",
location = "Val'sharah"
},
id137 = {
source = "Slugg Spinbolt",
drop_rate = "Unknown",
name = "Wild Combatant's Dreadplate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "137",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id138 = {
source = "Slugg Spinbolt",
drop_rate = "Unknown",
name = "Wild Combatant's Scaled Chestpiece",
category_territory = "",
territory = "War Zone",
id = "138",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id139 = {
source = "Slugg Spinbolt",
drop_rate = "Unknown",
name = "Wild Combatant's Plate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "139",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id140 = {
source = "Fobbly Kickfix",
drop_rate = "Unknown",
name = "Wild Combatant's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "140",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id141 = {
source = "Fobbly Kickfix",
drop_rate = "Unknown",
name = "Wild Combatant's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "141",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id142 = {
source = "Fobbly Kickfix",
drop_rate = "Unknown",
name = "Wild Combatant's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "142",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id143 = {
source = "Glubglok",
drop_rate = "0.0",
name = "Murktide's Coveted Chestplate",
category_territory = "",
territory = "Horde",
id = "143",
expansion = "Warlords Of Draenor",
location = "Tanaan Jungle"
},
id144 = {
source = "Cant Hold a Candle To You",
drop_rate = "quest",
name = "Thunderpeak Breastplate",
category_territory = "",
territory = "Horde",
id = "144",
expansion = "Legion",
location = "Highmountain"
},
id145 = {
source = "Gurbog da Basher",
drop_rate = "0.0",
name = "Da Basher's Toy Armor",
category_territory = "",
territory = "Horde",
id = "145",
expansion = "Legion",
location = "Highmountain"
},
id146 = {
source = "Fate of the Queens Reprisal",
drop_rate = "quest",
name = "Alliance Crusader's Breastplate",
category_territory = "",
territory = "Horde",
id = "146",
expansion = "Legion",
location = "Azsuna"
},
id147 = {
source = "Fate of the Queens Reprisal",
drop_rate = "quest",
name = "Kor'kron Breastplate",
category_territory = "",
territory = "Horde",
id = "147",
expansion = "Legion",
location = "Azsuna"
},
id148 = {
source = "Felsworn Defiler",
drop_rate = "0.0",
name = "Rhut'van Breastplate",
category_territory = "",
territory = "Horde",
id = "148",
expansion = "Legion",
location = "Azsuna"
},
id149 = {
source = "Bloodgazer Patriarch",
drop_rate = "0.0",
name = "Ettinbone Breastplate",
category_territory = "",
territory = "Horde",
id = "149",
expansion = "Legion",
location = "Azsuna"
},
id150 = {
source = "Helhound",
drop_rate = "0.0",
name = "Valarsmidd Breastplate",
category_territory = "",
territory = "Horde",
id = "150",
expansion = "Legion",
location = "Helheim"
},
id151 = {
source = "Nethos Starwalker",
drop_rate = "0.0",
name = "Kal'delar Breastplate",
category_territory = "",
territory = "Horde",
id = "151",
expansion = "Legion",
location = "Val'sharah"
},
id152 = {
source = "Felborne Marauder",
drop_rate = "0.0",
name = "Jandvik Breastplate",
category_territory = "",
territory = "Horde",
id = "152",
expansion = "Legion",
location = "Suramar"
},
id153 = {
source = "Scout It Out",
drop_rate = "quest",
name = "Lead-Studded Chestplate",
category_territory = "",
territory = "Horde",
id = "153",
expansion = "Legion",
location = "Highmountain"
},
id154 = {
source = "Built to Scale",
drop_rate = "quest",
name = "Stormwing Plate Chestguard",
category_territory = "",
territory = "Horde",
id = "154",
expansion = "Legion",
location = "Stormheim"
},
id155 = {
source = "What the Bonespeakers Buried",
drop_rate = "quest",
name = "Dreadsworn Breastplate",
category_territory = "",
territory = "Horde",
id = "155",
expansion = "Legion",
location = "Stormheim"
},
id156 = {
source = "Our Very Bones",
drop_rate = "quest",
name = "Traitor's Bane Breastplate",
category_territory = "",
territory = "Horde",
id = "156",
expansion = "Legion",
location = "Azsuna"
},
id157 = {
source = "Assault and Battery",
drop_rate = "quest",
name = "Dreadsworn Chestguard",
category_territory = "",
territory = "Horde",
id = "157",
expansion = "Legion",
location = "Stormheim"
},
id158 = {
source = "Spray and Prey",
drop_rate = "quest",
name = "Thunderpeak Chestguard",
category_territory = "",
territory = "Horde",
id = "158",
expansion = "Legion",
location = "Highmountain"
},
id159 = {
source = "Imperator Margok",
drop_rate = "0",
name = "Chestplate of Destructive Resonance",
category_territory = "Raid",
territory = "Horde",
id = "159",
expansion = "Warlords Of Draenor",
location = "Highmaul"
},
id160 = {
source = "Forgemaster Gogduh",
drop_rate = "Unknown",
name = "Incarnadine Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "160",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id161 = {
source = "Forgemaster Gogduh",
drop_rate = "Unknown",
name = "Verdant Plate Chest",
category_territory = "Dungeon",
territory = "Horde",
id = "161",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id162 = {
source = "Forgemaster Gogduh",
drop_rate = "Unknown",
name = "Goldsteel Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "162",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id163 = {
source = "Forgemaster Gogduh",
drop_rate = "Unknown",
name = "Gutcrusher Chestplate",
category_territory = "Dungeon",
territory = "Horde",
id = "163",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id164 = {
source = "Forgemaster Gogduh",
drop_rate = "Unknown",
name = "Rivet-Sealed Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "164",
expansion = "Warlords Of Draenor",
location = "Bloodmaul Slag Mines"
},
id165 = {
source = "The Bone Crawler",
drop_rate = "0.0",
name = "The Bone Crawler's Carapace",
category_territory = "",
territory = "Horde",
id = "165",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id166 = {
source = "Grunlek",
drop_rate = "Unknown",
name = "Blackrock Chestplate",
category_territory = "",
territory = "Horde",
id = "166",
expansion = "Warlords Of Draenor",
location = "Frostwall"
},
id167 = {
source = "The Ritual of Binding",
drop_rate = "quest",
name = "Plainsthunder Chestplate",
category_territory = "",
territory = "Horde",
id = "167",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id168 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Dreadplate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "168",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id169 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Scaled Chestpiece",
category_territory = "",
territory = "War Zone",
id = "169",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id170 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Plate Breastplate",
category_territory = "",
territory = "War Zone",
id = "170",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id171 = {
source = "Bregg Coppercast",
drop_rate = "Unknown",
name = "Primal Combatant's Plate Chestpiece",
category_territory = "",
territory = "War Zone",
id = "171",
expansion = "Warlords Of Draenor",
location = "Stormshield"
},
id172 = {
source = "Blackfang Prowler",
drop_rate = "0.0",
name = "Chyler's Charming Chestguard",
category_territory = "",
territory = "Horde",
id = "172",
expansion = "Warlords Of Draenor",
location = "Tanaan Jungle"
},
id173 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "173",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id174 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "174",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id175 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Plate Breastplate",
category_territory = "",
territory = "Alliance",
id = "175",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id176 = {
source = "Stone Guard Brokefist",
drop_rate = "Unknown",
name = "Primal Combatant's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "176",
expansion = "Warlords Of Draenor",
location = "Warspear"
},
id177 = {
source = "Bloodmaul Brute",
drop_rate = "0.0",
name = "Stonecrag Breastplate",
category_territory = "",
territory = "Horde",
id = "177",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id178 = {
source = "Sargerei Demonlord",
drop_rate = "0.0",
name = "Ironfist Breastplate",
category_territory = "",
territory = "Horde",
id = "178",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id179 = {
source = "Sethe, the Dead God",
drop_rate = "quest",
name = "Cragplate Chestplate",
category_territory = "",
territory = "Horde",
id = "179",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id180 = {
source = "Defungination",
drop_rate = "quest",
name = "Fireproof Venture Co. Blastplate",
category_territory = "",
territory = "Horde",
id = "180",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id181 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Chestguard of Cyclopean Dread",
category_territory = "",
territory = "War Zone",
id = "181",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id182 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Breastplate of Cyclopean Dread",
category_territory = "",
territory = "War Zone",
id = "182",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id183 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Chestguard of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "183",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id184 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Breastplate of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "184",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id185 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Battleplate of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "185",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id186 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Battleplate of the Prehistoric Marauder",
category_territory = "",
territory = "War Zone",
id = "186",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id187 = {
source = "Lorry Warmheart",
drop_rate = "Unknown",
name = "Chestguard of the Prehistoric Marauder",
category_territory = "",
territory = "War Zone",
id = "187",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id188 = {
source = "Ordos",
drop_rate = "Unknown",
name = "Hoodrych's Bloodied Chestplate",
category_territory = "",
territory = "Horde",
id = "188",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id189 = {
source = "Ordos",
drop_rate = "Unknown",
name = "Omegal's Crushing Carapace",
category_territory = "",
territory = "Horde",
id = "189",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id190 = {
source = "Ordos",
drop_rate = "Unknown",
name = "Gleaming Eye Spellplate",
category_territory = "",
territory = "Horde",
id = "190",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id191 = {
source = "Tamed Clefthoof",
drop_rate = "0.0",
name = "Ravenskar Breastplate",
category_territory = "",
territory = "Horde",
id = "191",
expansion = "Warlords Of Draenor",
location = "Nagrand"
},
id192 = {
source = "Skyreach Sun Talon",
drop_rate = "0.0",
name = "Talon Guard Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "192",
expansion = "Warlords Of Draenor",
location = "Skyreach"
},
id193 = {
source = "Into the Hollow",
drop_rate = "quest",
name = "Sha'tari Keeper Chestplate",
category_territory = "",
territory = "Horde",
id = "193",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id194 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Chestguard of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "194",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id195 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Breastplate of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "195",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id196 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Battleplate of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "196",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id197 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Chestguard of Cyclopean Dread",
category_territory = "",
territory = "War Zone",
id = "197",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id198 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Breastplate of Cyclopean Dread",
category_territory = "",
territory = "War Zone",
id = "198",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id199 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Battleplate of the Prehistoric Marauder",
category_territory = "",
territory = "War Zone",
id = "199",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id200 = {
source = "Clarice Chapmann",
drop_rate = "Unknown",
name = "Chestguard of the Prehistoric Marauder",
category_territory = "",
territory = "War Zone",
id = "200",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id201 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "201",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id202 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "202",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id203 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "203",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id204 = {
source = "Starlight Sinclair",
drop_rate = "Unknown",
name = "Prideful Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "204",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id205 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "205",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id206 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "206",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id207 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "207",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id208 = {
source = "Shonn Su",
drop_rate = "Unknown",
name = "Prideful Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "208",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id209 = {
source = "Cackling Pyromaniac",
drop_rate = "0.0",
name = "Sharptusk Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "209",
expansion = "Warlords Of Draenor",
location = "Auchindoun"
},
id210 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Chestplate of Violent Detonation",
category_territory = "Raid",
territory = "Horde",
id = "210",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id211 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Ionized Yojamban Carapace",
category_territory = "Raid",
territory = "Horde",
id = "211",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id212 = {
source = "Sul the Sandcrawler",
drop_rate = "Unknown",
name = "Overloaded Bladebreaker Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "212",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id213 = {
source = "Flaming Head",
drop_rate = "Unknown",
name = "Rot-Proof Greatplate",
category_territory = "Raid",
territory = "Horde",
id = "213",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id214 = {
source = "Ji-Kun",
drop_rate = "0.0",
name = "Talonrender Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "214",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id215 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Lei Shen's Grounded Carapace",
category_territory = "Raid",
territory = "Horde",
id = "215",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id216 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Breastplate of the All-Consuming Maw",
category_territory = "",
territory = "Horde",
id = "216",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id217 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Chestguard of the All-Consuming Maw",
category_territory = "",
territory = "Horde",
id = "217",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id218 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Battleplate",
category_territory = "",
territory = "Horde",
id = "218",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id219 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Breastplate",
category_territory = "",
territory = "Horde",
id = "219",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id220 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Chestguard",
category_territory = "",
territory = "Horde",
id = "220",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id221 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Battleplate of the Last Mogu",
category_territory = "",
territory = "Horde",
id = "221",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id222 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Chestguard of the Last Mogu",
category_territory = "",
territory = "Horde",
id = "222",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id223 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Chestplate of Violent Detonation",
category_territory = "Raid",
territory = "Horde",
id = "223",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id224 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Ionized Yojamban Carapace",
category_territory = "Raid",
territory = "Horde",
id = "224",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id225 = {
source = "High Priestess Marli",
drop_rate = "0.0",
name = "Overloaded Bladebreaker Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "225",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id226 = {
source = "Ji-Kun",
drop_rate = "0.0",
name = "Talonrender Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "226",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id227 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Lei Shen's Grounded Carapace",
category_territory = "Raid",
territory = "Horde",
id = "227",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id228 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Chestguard of the Prehistoric Marauder",
category_territory = "",
territory = "War Zone",
id = "228",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id229 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Battleplate of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "229",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id230 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Chestguard of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "230",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id231 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Battleplate of the Prehistoric Marauder",
category_territory = "",
territory = "War Zone",
id = "231",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id232 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Breastplate of Cyclopean Dread",
category_territory = "",
territory = "War Zone",
id = "232",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id233 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Breastplate of Winged Triumph",
category_territory = "",
territory = "War Zone",
id = "233",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id234 = {
source = "Thelett Shaleheart",
drop_rate = "Unknown",
name = "Chestguard of Cyclopean Dread",
category_territory = "",
territory = "War Zone",
id = "234",
expansion = "Mists Of Pandaria",
location = "Shrine of Seven Stars"
},
id235 = {
source = "Iron Juggernaut",
drop_rate = "0.0",
name = "Earthbreaker's Steaming Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "235",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id236 = {
source = "Wavebinder Kardris",
drop_rate = "Unknown",
name = "Breastplate of Shamanic Mirrors",
category_territory = "Raid",
territory = "Horde",
id = "236",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id237 = {
source = "Malkorok",
drop_rate = "0.0",
name = "Terrorguard Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "237",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id238 = {
source = "Thok the Bloodthirsty",
drop_rate = "0.0",
name = "Icy Blood Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "238",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id239 = {
source = "Garrosh Hellscream",
drop_rate = "0.0",
name = "Chestplate of Fallen Passion",
category_territory = "Raid",
territory = "Horde",
id = "239",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id240 = {
source = "Chains of Iron",
drop_rate = "quest",
name = "Foundry-Fired Plate Chestplate",
category_territory = "",
territory = "Horde",
id = "240",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id241 = {
source = "Spore Drifter",
drop_rate = "0.0",
name = "Stonebreaker Breastplate",
category_territory = "",
territory = "Horde",
id = "241",
expansion = "Warlords Of Draenor",
location = "Spires of Arak"
},
id242 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Chestplate of Violent Detonation",
category_territory = "Raid",
territory = "Horde",
id = "242",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id243 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Ionized Yojamban Carapace",
category_territory = "Raid",
territory = "Horde",
id = "243",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id244 = {
source = "High Priestess Marli",
drop_rate = "0.0",
name = "Overloaded Bladebreaker Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "244",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id245 = {
source = "Ji-Kun",
drop_rate = "0.0",
name = "Talonrender Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "245",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id246 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Lei Shen's Grounded Carapace",
category_territory = "Raid",
territory = "Horde",
id = "246",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id247 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Breastplate of Winged Triumph",
category_territory = "",
territory = "Horde",
id = "247",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id248 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Chestguard of Winged Triumph",
category_territory = "",
territory = "Horde",
id = "248",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id249 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Chestguard of the Prehistoric Marauder",
category_territory = "",
territory = "Horde",
id = "249",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id250 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Battleplate of the Prehistoric Marauder",
category_territory = "",
territory = "Horde",
id = "250",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id251 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Battleplate of Winged Triumph",
category_territory = "",
territory = "Horde",
id = "251",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id252 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Chestguard of Cyclopean Dread",
category_territory = "",
territory = "Horde",
id = "252",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id253 = {
source = "Welbiz Cheerwhistle",
drop_rate = "Unknown",
name = "Breastplate of Cyclopean Dread",
category_territory = "",
territory = "Horde",
id = "253",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id254 = {
source = "Ratok the Hammer",
drop_rate = "0.0",
name = "Gul'rok Breastplate",
category_territory = "",
territory = "Horde",
id = "254",
expansion = "Warlords Of Draenor",
location = "Talador"
},
id255 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Chestplate of Violent Detonation",
category_territory = "Raid",
territory = "Horde",
id = "255",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id256 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Ionized Yojamban Carapace",
category_territory = "Raid",
territory = "Horde",
id = "256",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id257 = {
source = "Sul the Sandcrawler",
drop_rate = "Unknown",
name = "Overloaded Bladebreaker Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "257",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id258 = {
source = "Flaming Head",
drop_rate = "Unknown",
name = "Rot-Proof Greatplate",
category_territory = "Raid",
territory = "Horde",
id = "258",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id259 = {
source = "Ji-Kun",
drop_rate = "0.0",
name = "Talonrender Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "259",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id260 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Lei Shen's Grounded Carapace",
category_territory = "Raid",
territory = "Horde",
id = "260",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id261 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Hauberk of Gleaming Fire",
category_territory = "",
territory = "Horde",
id = "261",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id262 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Gianttooth Chestplate",
category_territory = "",
territory = "Horde",
id = "262",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id263 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Breastplate of Brutal Strikes",
category_territory = "",
territory = "Horde",
id = "263",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id264 = {
source = "Oondasta",
drop_rate = "Unknown",
name = "Scorched Spiritfire Drape",
category_territory = "",
territory = "Horde",
id = "264",
expansion = "Mists Of Pandaria",
location = "Isle of Giants"
},
id265 = {
source = "Oondasta",
drop_rate = "Unknown",
name = "Breastplate of the Iguanocolossus",
category_territory = "",
territory = "Horde",
id = "265",
expansion = "Mists Of Pandaria",
location = "Isle of Giants"
},
id266 = {
source = "Oondasta",
drop_rate = "Unknown",
name = "Tyrant King Battleplate",
category_territory = "",
territory = "Horde",
id = "266",
expansion = "Mists Of Pandaria",
location = "Isle of Giants"
},
id267 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Breastplate of the All-Consuming Maw",
category_territory = "",
territory = "Horde",
id = "267",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id268 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Chestguard of the All-Consuming Maw",
category_territory = "",
territory = "Horde",
id = "268",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id269 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Battleplate",
category_territory = "",
territory = "Horde",
id = "269",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id270 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Breastplate",
category_territory = "",
territory = "Horde",
id = "270",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id271 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Chestguard",
category_territory = "",
territory = "Horde",
id = "271",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id272 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Battleplate of the Last Mogu",
category_territory = "",
territory = "Horde",
id = "272",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id273 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Chestguard of the Last Mogu",
category_territory = "",
territory = "Horde",
id = "273",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id274 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "274",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id275 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "275",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id276 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "276",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id277 = {
source = "Acon Deathwielder",
drop_rate = "Unknown",
name = "Grievous Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "277",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id278 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "278",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id279 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "279",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id280 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "280",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id281 = {
source = "Ethan Natice",
drop_rate = "Unknown",
name = "Grievous Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "281",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id282 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Breastplate of the Lost Catacomb",
category_territory = "",
territory = "Horde",
id = "282",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id283 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Chestguard of the Lost Catacomb",
category_territory = "",
territory = "Horde",
id = "283",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id284 = {
source = "Imperial Vizier Zorlok",
drop_rate = "0.0",
name = "Chestplate of the Forbidden Tower",
category_territory = "Raid",
territory = "Horde",
id = "284",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id285 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Battleplate",
category_territory = "",
territory = "Horde",
id = "285",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id286 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Breastplate",
category_territory = "",
territory = "Horde",
id = "286",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id287 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Chestguard",
category_territory = "",
territory = "Horde",
id = "287",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id288 = {
source = "Lei Shi",
drop_rate = "Unknown",
name = "Cuirass of the Animated Protector",
category_territory = "Raid",
territory = "Horde",
id = "288",
expansion = "Mists Of Pandaria",
location = "Terrace of Endless Spring"
},
id289 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Battleplate of Resounding Rings",
category_territory = "",
territory = "Horde",
id = "289",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id290 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Chestguard of Resounding Rings",
category_territory = "",
territory = "Horde",
id = "290",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id291 = {
source = "Garalon",
drop_rate = "Unknown",
name = "Garalon's Graven Carapace",
category_territory = "Raid",
territory = "Horde",
id = "291",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id292 = {
source = "Swamplighter Queen",
drop_rate = "quest",
name = "Karabor Honor Guard Chestplate",
category_territory = "",
territory = "Horde",
id = "292",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id293 = {
source = "Thorny Stabber",
drop_rate = "0.0",
name = "Shardback Breastplate",
category_territory = "",
territory = "Horde",
id = "293",
expansion = "Warlords Of Draenor",
location = "Gorgrond"
},
id294 = {
source = "Game of Thorns",
drop_rate = "quest",
name = "Lightly Perforated Chestplate",
category_territory = "",
territory = "Horde",
id = "294",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id295 = {
source = "The Eldest",
drop_rate = "quest",
name = "Grimfrost Plate Chestguard",
category_territory = "",
territory = "Horde",
id = "295",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id296 = {
source = "Qiang the Merciless",
drop_rate = "Unknown",
name = "Breastplate of the Kings' Guard",
category_territory = "Raid",
territory = "Horde",
id = "296",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id297 = {
source = "Jan-xi",
drop_rate = "0.0",
name = "Chestguard of Eternal Vigilance",
category_territory = "Raid",
territory = "Horde",
id = "297",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id298 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Chestplate of Violent Detonation",
category_territory = "Raid",
territory = "Horde",
id = "298",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id299 = {
source = "Jinrokh the Breaker",
drop_rate = "0.0",
name = "Ionized Yojamban Carapace",
category_territory = "Raid",
territory = "Horde",
id = "299",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id300 = {
source = "Sul the Sandcrawler",
drop_rate = "Unknown",
name = "Overloaded Bladebreaker Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "300",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id301 = {
source = "Flaming Head",
drop_rate = "Unknown",
name = "Rot-Proof Greatplate",
category_territory = "Raid",
territory = "Horde",
id = "301",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id302 = {
source = "Ji-Kun",
drop_rate = "0.0",
name = "Talonrender Chestplate",
category_territory = "Raid",
territory = "Horde",
id = "302",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id303 = {
source = "Lei Shen",
drop_rate = "0.0",
name = "Lei Shen's Grounded Carapace",
category_territory = "Raid",
territory = "Horde",
id = "303",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id304 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Breastplate of the All-Consuming Maw",
category_territory = "",
territory = "Horde",
id = "304",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id305 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Chestguard of the All-Consuming Maw",
category_territory = "",
territory = "Horde",
id = "305",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id306 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Battleplate",
category_territory = "",
territory = "Horde",
id = "306",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id307 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Breastplate",
category_territory = "",
territory = "Horde",
id = "307",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id308 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Lightning Emperor's Chestguard",
category_territory = "",
territory = "Horde",
id = "308",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id309 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Battleplate of the Last Mogu",
category_territory = "",
territory = "Horde",
id = "309",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id310 = {
source = "Teng of the Flying Daggers",
drop_rate = "Unknown",
name = "Chestguard of the Last Mogu",
category_territory = "",
territory = "Horde",
id = "310",
expansion = "Mists Of Pandaria",
location = "Isle of Thunder"
},
id311 = {
source = "Shadowmoon Raider",
drop_rate = "0.0",
name = "Rockspine Breastplate",
category_territory = "",
territory = "Horde",
id = "311",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id312 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Chestguard of the Lost Catacomb",
category_territory = "",
territory = "Horde",
id = "312",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id313 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Chestguard",
category_territory = "",
territory = "Horde",
id = "313",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id314 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Chestguard of Resounding Rings",
category_territory = "",
territory = "Horde",
id = "314",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id315 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Battleplate of Resounding Rings",
category_territory = "",
territory = "Horde",
id = "315",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id316 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Breastplate of the Lost Catacomb",
category_territory = "",
territory = "Horde",
id = "316",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id317 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Battleplate",
category_territory = "",
territory = "Horde",
id = "317",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id318 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Breastplate",
category_territory = "",
territory = "Horde",
id = "318",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id319 = {
source = "Qiang the Merciless",
drop_rate = "Unknown",
name = "Breastplate of the Kings' Guard",
category_territory = "Raid",
territory = "Horde",
id = "319",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id320 = {
source = "Imperial Vizier Zorlok",
drop_rate = "0.0",
name = "Chestplate of the Forbidden Tower",
category_territory = "Raid",
territory = "Horde",
id = "320",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id321 = {
source = "Lei Shi",
drop_rate = "Unknown",
name = "Cuirass of the Animated Protector",
category_territory = "Raid",
territory = "Horde",
id = "321",
expansion = "Mists Of Pandaria",
location = "Terrace of Endless Spring"
},
id322 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Chestguard of the Lost Catacomb",
category_territory = "",
territory = "Horde",
id = "322",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id323 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Chestguard",
category_territory = "",
territory = "Horde",
id = "323",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id324 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Chestguard of Resounding Rings",
category_territory = "",
territory = "Horde",
id = "324",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id325 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Battleplate of Resounding Rings",
category_territory = "",
territory = "Horde",
id = "325",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id326 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Breastplate of the Lost Catacomb",
category_territory = "",
territory = "Horde",
id = "326",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id327 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Battleplate",
category_territory = "",
territory = "Horde",
id = "327",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id328 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "White Tiger Breastplate",
category_territory = "",
territory = "Horde",
id = "328",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id329 = {
source = "Meng the Demented",
drop_rate = "Unknown",
name = "Breastplate of the Kings' Guard",
category_territory = "Raid",
territory = "Horde",
id = "329",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id330 = {
source = "Imperial Vizier Zorlok",
drop_rate = "0.0",
name = "Chestplate of the Forbidden Tower",
category_territory = "Raid",
territory = "Horde",
id = "330",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id331 = {
source = "Lei Shi",
drop_rate = "Unknown",
name = "Cuirass of the Animated Protector",
category_territory = "Raid",
territory = "Horde",
id = "331",
expansion = "Mists Of Pandaria",
location = "Terrace of Endless Spring"
},
id332 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Dawnblade's Chestguard",
category_territory = "",
territory = "Horde",
id = "332",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id333 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Cuirass of the Twin Monoliths",
category_territory = "",
territory = "Horde",
id = "333",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id334 = {
source = "Commander Oxheart",
drop_rate = "Unknown",
name = "Battleguard of Guo-Lai",
category_territory = "",
territory = "Horde",
id = "334",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id335 = {
source = "Qin-xi",
drop_rate = "0.0",
name = "Chestguard of Eternal Vigilance",
category_territory = "Raid",
territory = "Horde",
id = "335",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id336 = {
source = "Garalon",
drop_rate = "Unknown",
name = "Garalon's Graven Carapace",
category_territory = "Raid",
territory = "Horde",
id = "336",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id337 = {
source = "Garalon",
drop_rate = "Unknown",
name = "Garalon's Graven Carapace",
category_territory = "Raid",
territory = "Horde",
id = "337",
expansion = "Mists Of Pandaria",
location = "Heart of Fear"
},
id338 = {
source = "Jan-xi",
drop_rate = "Unknown",
name = "Chestguard of Eternal Vigilance",
category_territory = "Raid",
territory = "Horde",
id = "338",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Vaults"
},
id339 = {
source = "Galleon",
drop_rate = "Unknown",
name = "Chestguard of the Unbowed Back",
category_territory = "",
territory = "Horde",
id = "339",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id340 = {
source = "Galleon",
drop_rate = "Unknown",
name = "Ravaging Warrior's Chestplate",
category_territory = "",
territory = "Horde",
id = "340",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id341 = {
source = "Galleon",
drop_rate = "Unknown",
name = "Carapace of Crushed Conviction",
category_territory = "",
territory = "Horde",
id = "341",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id342 = {
source = "Dragonmaw Cannoneer",
drop_rate = "0.0",
name = "Boblet's Bouncing Hauberk",
category_territory = "Raid",
territory = "Horde",
id = "342",
expansion = "Mists Of Pandaria",
location = "Siege of Orgrimmar"
},
id343 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "343",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id344 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "344",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id345 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "345",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id346 = {
source = "Doris Chiltonius",
drop_rate = "Unknown",
name = "Malevolent Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "346",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id347 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "347",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id348 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "348",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id349 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "349",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id350 = {
source = "Armsmaster Holinka",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "350",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id351 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "351",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id352 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "352",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id353 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "353",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id354 = {
source = "Roo Desvin",
drop_rate = "Unknown",
name = "Tyrannical Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "354",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id355 = {
source = "Raigonn",
drop_rate = "0.0",
name = "Swarmbringer Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "355",
expansion = "Mists Of Pandaria",
location = "Gate of the Setting Sun"
},
id356 = {
source = "Wise Mari",
drop_rate = "0.0",
name = "Riverbed Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "356",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id357 = {
source = "Raigonn",
drop_rate = "0.0",
name = "Swarmbringer Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "357",
expansion = "Mists Of Pandaria",
location = "Gate of the Setting Sun"
},
id358 = {
source = "Xin the Weaponmaster",
drop_rate = "0.0",
name = "Mind's Eye Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "358",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Palace"
},
id359 = {
source = "Houndmaster Braun",
drop_rate = "0.0",
name = "Canine Commander's Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "359",
expansion = "Mists Of Pandaria",
location = "Scarlet Halls"
},
id360 = {
source = "Instructor Chillhearts Phylactery",
drop_rate = "0.0",
name = "Breastplate of Wracking Souls",
category_territory = "Dungeon",
territory = "Horde",
id = "360",
expansion = "Mists Of Pandaria",
location = "Scholomance"
},
id361 = {
source = "The Point of No Return",
drop_rate = "quest",
name = "Goldtalon Chestguard",
category_territory = "",
territory = "Horde",
id = "361",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id362 = {
source = "The Point of No Return",
drop_rate = "quest",
name = "Temple Guardian Chestpiece",
category_territory = "",
territory = "Horde",
id = "362",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id363 = {
source = "The Point of No Return",
drop_rate = "quest",
name = "Palewind Chestpiece",
category_territory = "",
territory = "Horde",
id = "363",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id364 = {
source = "Hayden Christophen",
drop_rate = "Unknown",
name = "Dreadful Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "364",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id365 = {
source = "Hayden Christophen",
drop_rate = "Unknown",
name = "Dreadful Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "365",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id366 = {
source = "Hayden Christophen",
drop_rate = "Unknown",
name = "Dreadful Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "366",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id367 = {
source = "Hayden Christophen",
drop_rate = "Unknown",
name = "Dreadful Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "367",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id368 = {
source = "Xin the Weaponmaster",
drop_rate = "0.0",
name = "Mind's Eye Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "368",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Palace"
},
id369 = {
source = "An End to the Suffering",
drop_rate = "quest",
name = "Runed Deathbone Chestplate",
category_territory = "Dungeon",
territory = "Horde",
id = "369",
expansion = "Mists Of Pandaria",
location = "Scholomance"
},
id370 = {
source = "An End to the Suffering",
drop_rate = "quest",
name = "Carver's Bloodsplattered Chestpiece",
category_territory = "Dungeon",
territory = "Horde",
id = "370",
expansion = "Mists Of Pandaria",
location = "Scholomance"
},
id371 = {
source = "An End to the Suffering",
drop_rate = "quest",
name = "Coldforge Carapace",
category_territory = "Dungeon",
territory = "Horde",
id = "371",
expansion = "Mists Of Pandaria",
location = "Scholomance"
},
id372 = {
source = "Zandalari Dinomancer",
drop_rate = "0.0",
name = "Cryptwarden's Breastplate",
category_territory = "",
territory = "Horde",
id = "372",
expansion = "Mists Of Pandaria",
location = "Isle of Giants"
},
id373 = {
source = "Nalash Verdantis",
drop_rate = "0.0",
name = "Kunchong Carapace Chestguard",
category_territory = "",
territory = "Horde",
id = "373",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id374 = {
source = "Nalash Verdantis",
drop_rate = "0.0",
name = "Spinebreaker Chestpiece",
category_territory = "",
territory = "Horde",
id = "374",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id375 = {
source = "Ai-Li Skymirror",
drop_rate = "0.0",
name = "Chestplate of Manifest Dread",
category_territory = "",
territory = "Horde",
id = "375",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id376 = {
source = "Commander Lo Ping",
drop_rate = "Unknown",
name = "Inner Serenity Chestplate",
category_territory = "",
territory = "Horde",
id = "376",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id377 = {
source = "Commander Lo Ping",
drop_rate = "Unknown",
name = "Chestplate of the Stone Lion",
category_territory = "",
territory = "Horde",
id = "377",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id378 = {
source = "Raigonn",
drop_rate = "0.0",
name = "Swarmbringer Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "378",
expansion = "Mists Of Pandaria",
location = "Gate of the Setting Sun"
},
id379 = {
source = "Xin the Weaponmaster",
drop_rate = "0.0",
name = "Mind's Eye Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "379",
expansion = "Mists Of Pandaria",
location = "Mogu'shan Palace"
},
id380 = {
source = "Wise Mari",
drop_rate = "0.0",
name = "Riverbed Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "380",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id381 = {
source = "Houndmaster Braun",
drop_rate = "0.0",
name = "Canine Commander's Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "381",
expansion = "Mists Of Pandaria",
location = "Scarlet Halls"
},
id382 = {
source = "Instructor Chillheart",
drop_rate = "Unknown",
name = "Breastplate of Wracking Souls",
category_territory = "Dungeon",
territory = "Horde",
id = "382",
expansion = "Mists Of Pandaria",
location = "Scholomance"
},
id383 = {
source = "Fresh Pots",
drop_rate = "quest",
name = "Lucidity Chestguard",
category_territory = "",
territory = "Horde",
id = "383",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id384 = {
source = "Fresh Pots",
drop_rate = "quest",
name = "Bladesworn Chestpiece",
category_territory = "",
territory = "Horde",
id = "384",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id385 = {
source = "Fresh Pots",
drop_rate = "quest",
name = "Coldbite Chestpiece",
category_territory = "",
territory = "Horde",
id = "385",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id386 = {
source = "Falling to Pieces",
drop_rate = "quest",
name = "Sunset Burnished Chestguard",
category_territory = "",
territory = "Horde",
id = "386",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id387 = {
source = "Falling to Pieces",
drop_rate = "quest",
name = "Sunset Heavy Chestpiece",
category_territory = "",
territory = "Horde",
id = "387",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id388 = {
source = "Falling to Pieces",
drop_rate = "quest",
name = "Sunset Armored Chestpiece",
category_territory = "",
territory = "Horde",
id = "388",
expansion = "Mists Of Pandaria",
location = "Dread Wastes"
},
id389 = {
source = "Pale Crawler",
drop_rate = "0.0",
name = "Bladespire Breastplate",
category_territory = "",
territory = "Horde",
id = "389",
expansion = "Warlords Of Draenor",
location = "Shadowmoon Valley"
},
id390 = {
source = "Bladespire Geomancer",
drop_rate = "0.0",
name = "Rimeplate Breastplate",
category_territory = "",
territory = "Horde",
id = "390",
expansion = "Warlords Of Draenor",
location = "Frostfire Ridge"
},
id391 = {
source = "Destroying Sha",
drop_rate = "0.0",
name = "Temple Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "391",
expansion = "Mists Of Pandaria",
location = "Shado-Pan Monastery"
},
id392 = {
source = "Grounded Welcome",
drop_rate = "quest",
name = "Farwatch Burnished Chestguard",
category_territory = "",
territory = "Horde",
id = "392",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id393 = {
source = "Grounded Welcome",
drop_rate = "quest",
name = "Farwatch Heavy Chestpiece",
category_territory = "",
territory = "Horde",
id = "393",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id394 = {
source = "Grounded Welcome",
drop_rate = "quest",
name = "Farwatch Armored Chestpiece",
category_territory = "",
territory = "Horde",
id = "394",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id395 = {
source = "Skittering Spiderling",
drop_rate = "0.0",
name = "Primordial Bloodsoaked Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "395",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id396 = {
source = "Zandalari Prophet",
drop_rate = "0.0",
name = "Forgotten Peacekeeper Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "396",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id397 = {
source = "Zandalari Blade Initiate",
drop_rate = "0.0",
name = "Tarnished Fanatic's Battlevest",
category_territory = "Raid",
territory = "Horde",
id = "397",
expansion = "Mists Of Pandaria",
location = "Throne of Thunder"
},
id398 = {
source = "Unyielding Fists: Trial of Stone",
drop_rate = "quest",
name = "Paoquan Burnished Chestguard",
category_territory = "",
territory = "Horde",
id = "398",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id399 = {
source = "Unyielding Fists: Trial of Stone",
drop_rate = "quest",
name = "Thunderfoot Heavy Chestpiece",
category_territory = "",
territory = "Horde",
id = "399",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id400 = {
source = "Unyielding Fists: Trial of Stone",
drop_rate = "quest",
name = "Sunsong Armored Chestpiece",
category_territory = "",
territory = "Horde",
id = "400",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id401 = {
source = "One Travelers Misfortune",
drop_rate = "quest",
name = "Serenity Chestguard",
category_territory = "",
territory = "Horde",
id = "401",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id402 = {
source = "One Travelers Misfortune",
drop_rate = "quest",
name = "Summit Guardian Chestpiece",
category_territory = "",
territory = "Horde",
id = "402",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id403 = {
source = "One Travelers Misfortune",
drop_rate = "quest",
name = "Wallwatcher Chestpiece",
category_territory = "",
territory = "Horde",
id = "403",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id404 = {
source = "Thumping Knucklethump",
drop_rate = "quest",
name = "Wallwatcher Vest",
category_territory = "",
territory = "Horde",
id = "404",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id405 = {
source = "Thumping Knucklethump",
drop_rate = "quest",
name = "Summit Guardian Vest",
category_territory = "",
territory = "Horde",
id = "405",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id406 = {
source = "Thumping Knucklethump",
drop_rate = "quest",
name = "Serenity Vest",
category_territory = "",
territory = "Horde",
id = "406",
expansion = "Mists Of Pandaria",
location = "Kun-Lai Summit"
},
id407 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Colossal Dragonplate Battleplate",
category_territory = "",
territory = "Alliance",
id = "407",
expansion = "",
location = "Orgrimmar"
},
id408 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Colossal Dragonplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "408",
expansion = "",
location = "Orgrimmar"
},
id409 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Necrotic Boneplate Breastplate",
category_territory = "",
territory = "Alliance",
id = "409",
expansion = "",
location = "Orgrimmar"
},
id410 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Necrotic Boneplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "410",
expansion = "",
location = "Orgrimmar"
},
id411 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Breastplate of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "411",
expansion = "",
location = "Orgrimmar"
},
id412 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Battleplate of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "412",
expansion = "",
location = "Orgrimmar"
},
id413 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Chestguard of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "413",
expansion = "",
location = "Orgrimmar"
},
id414 = {
source = "Wise Mari",
drop_rate = "0.0",
name = "Riverbed Chestguard",
category_territory = "Dungeon",
territory = "Horde",
id = "414",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id415 = {
source = "Sudsy Brew Alemental",
drop_rate = "0.0",
name = "Deathspite Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "415",
expansion = "Mists Of Pandaria",
location = "Stormstout Brewery"
},
id416 = {
source = "Krikthik Deep-Scout",
drop_rate = "0.0",
name = "Snowy Breastplate",
category_territory = "",
territory = "Horde",
id = "416",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id417 = {
source = "Agitated Nettleskin",
drop_rate = "0.0",
name = "Highpeak Breastplate",
category_territory = "",
territory = "Horde",
id = "417",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id418 = {
source = "Len at Arms",
drop_rate = "Unknown",
name = "Wasteland Burnished Chestguard",
category_territory = "",
territory = "Horde",
id = "418",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id419 = {
source = "Len at Arms",
drop_rate = "Unknown",
name = "Wasteland Heavy Chestpiece",
category_territory = "",
territory = "Horde",
id = "419",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id420 = {
source = "Len at Arms",
drop_rate = "Unknown",
name = "Wasteland Armored Chestpiece",
category_territory = "",
territory = "Horde",
id = "420",
expansion = "Mists Of Pandaria",
location = "Vale of Eternal Blossoms"
},
id421 = {
source = "The Mantid",
drop_rate = "quest",
name = "Narsong Chestguard",
category_territory = "",
territory = "Horde",
id = "421",
expansion = "Mists Of Pandaria",
location = "Krasarang Wilds"
},
id422 = {
source = "The Mantid",
drop_rate = "quest",
name = "Korjan Chestpiece",
category_territory = "",
territory = "Horde",
id = "422",
expansion = "Mists Of Pandaria",
location = "Krasarang Wilds"
},
id423 = {
source = "The Mantid",
drop_rate = "quest",
name = "Dojani Chestpiece",
category_territory = "",
territory = "Horde",
id = "423",
expansion = "Mists Of Pandaria",
location = "Krasarang Wilds"
},
id424 = {
source = "Mothallus!",
drop_rate = "quest",
name = "Sunsong Vest",
category_territory = "",
territory = "Horde",
id = "424",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id425 = {
source = "Mothallus!",
drop_rate = "quest",
name = "Thunderfoot Vest",
category_territory = "",
territory = "Horde",
id = "425",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id426 = {
source = "Mothallus!",
drop_rate = "quest",
name = "Paoquan Vest",
category_territory = "",
territory = "Horde",
id = "426",
expansion = "Mists Of Pandaria",
location = "Valley of the Four Winds"
},
id427 = {
source = "Bethtilac",
drop_rate = "0.0",
name = "Carapace of Imbibed Flame",
category_territory = "Raid",
territory = "Horde",
id = "427",
expansion = "Cataclysm",
location = "Firelands"
},
id428 = {
source = "Alysrazor",
drop_rate = "0.0",
name = "Clutch of the Firemother",
category_territory = "Raid",
territory = "Horde",
id = "428",
expansion = "Cataclysm",
location = "Firelands"
},
id429 = {
source = "Majordomo Staghelm",
drop_rate = "0.0",
name = "Breastplate of Shifting Visions",
category_territory = "Raid",
territory = "Horde",
id = "429",
expansion = "Cataclysm",
location = "Firelands"
},
id430 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Elementium Deathplate Breastplate",
category_territory = "",
territory = "Alliance",
id = "430",
expansion = "",
location = "Orgrimmar"
},
id431 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Elementium Deathplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "431",
expansion = "",
location = "Orgrimmar"
},
id432 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Immolation Battleplate",
category_territory = "",
territory = "Alliance",
id = "432",
expansion = "",
location = "Orgrimmar"
},
id433 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Immolation Breastplate",
category_territory = "",
territory = "Alliance",
id = "433",
expansion = "",
location = "Orgrimmar"
},
id434 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Immolation Chestguard",
category_territory = "",
territory = "Alliance",
id = "434",
expansion = "",
location = "Orgrimmar"
},
id435 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Battleplate of the Molten Giant",
category_territory = "",
territory = "Alliance",
id = "435",
expansion = "",
location = "Orgrimmar"
},
id436 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Chestguard of the Molten Giant",
category_territory = "",
territory = "Alliance",
id = "436",
expansion = "",
location = "Orgrimmar"
},
id437 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "437",
expansion = "",
location = "Orgrimmar"
},
id438 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Alliance",
id = "438",
expansion = "",
location = "Orgrimmar"
},
id439 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "439",
expansion = "",
location = "Orgrimmar"
},
id440 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "440",
expansion = "",
location = "Orgrimmar"
},
id441 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Breastplate of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "441",
expansion = "",
location = "Orgrimmar"
},
id442 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Battleplate of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "442",
expansion = "",
location = "Orgrimmar"
},
id443 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Necrotic Boneplate Breastplate",
category_territory = "",
territory = "Alliance",
id = "443",
expansion = "",
location = "Orgrimmar"
},
id444 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Colossal Dragonplate Battleplate",
category_territory = "",
territory = "Alliance",
id = "444",
expansion = "",
location = "Orgrimmar"
},
id445 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Colossal Dragonplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "445",
expansion = "",
location = "Orgrimmar"
},
id446 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Chestguard of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "446",
expansion = "",
location = "Orgrimmar"
},
id447 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Necrotic Boneplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "447",
expansion = "",
location = "Orgrimmar"
},
id448 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Bones of the Damned",
category_territory = "",
territory = "Alliance",
id = "448",
expansion = "",
location = "Orgrimmar"
},
id449 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Chestplate of the Unshakable Titan",
category_territory = "",
territory = "Alliance",
id = "449",
expansion = "",
location = "Orgrimmar"
},
id450 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Shining Carapace of Glory",
category_territory = "",
territory = "Alliance",
id = "450",
expansion = "",
location = "Orgrimmar"
},
id451 = {
source = "Sergeant Thunderhorn",
drop_rate = "Unknown",
name = "Cataclysmic Gladiator's Ornamented Battlerobe",
category_territory = "",
territory = "Alliance",
id = "451",
expansion = "",
location = "Orgrimmar"
},
id452 = {
source = "Kiatke",
drop_rate = "Unknown",
name = "Bones of the Damned",
category_territory = "",
territory = "War Zone",
id = "452",
expansion = "",
location = "Stormwind City"
},
id453 = {
source = "Hatescale Spitter",
drop_rate = "0.0",
name = "Miner Breastplate",
category_territory = "",
territory = "Horde",
id = "453",
expansion = "Mists Of Pandaria",
location = "The Veiled Stair"
},
id454 = {
source = "Alin the Finder",
drop_rate = "Unknown",
name = "Mountainscaler Burnished Chestguard",
category_territory = "",
territory = "Horde",
id = "454",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id455 = {
source = "Alin the Finder",
drop_rate = "Unknown",
name = "Mountainscaler Heavy Chestpiece",
category_territory = "",
territory = "Horde",
id = "455",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id456 = {
source = "Alin the Finder",
drop_rate = "Unknown",
name = "Mountainscaler Armored Chestpiece",
category_territory = "",
territory = "Horde",
id = "456",
expansion = "Mists Of Pandaria",
location = "Townlong Steppes"
},
id457 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Colossal Dragonplate Battleplate",
category_territory = "",
territory = "Alliance",
id = "457",
expansion = "",
location = "Orgrimmar"
},
id458 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Colossal Dragonplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "458",
expansion = "",
location = "Orgrimmar"
},
id459 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Necrotic Boneplate Breastplate",
category_territory = "",
territory = "Alliance",
id = "459",
expansion = "",
location = "Orgrimmar"
},
id460 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Necrotic Boneplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "460",
expansion = "",
location = "Orgrimmar"
},
id461 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Breastplate of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "461",
expansion = "",
location = "Orgrimmar"
},
id462 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Battleplate of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "462",
expansion = "",
location = "Orgrimmar"
},
id463 = {
source = "JamusVaz",
drop_rate = "Unknown",
name = "Chestguard of Radiant Glory",
category_territory = "",
territory = "Alliance",
id = "463",
expansion = "",
location = "Orgrimmar"
},
id464 = {
source = "The Silkwood Road",
drop_rate = "quest",
name = "Glass Lake Chestguard",
category_territory = "",
territory = "Horde",
id = "464",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id465 = {
source = "The Silkwood Road",
drop_rate = "quest",
name = "Thunderwood Chestpiece",
category_territory = "",
territory = "Horde",
id = "465",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id466 = {
source = "The Silkwood Road",
drop_rate = "quest",
name = "Jade Tiger Chestpiece",
category_territory = "",
territory = "Horde",
id = "466",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id467 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Ghost-Forged Breastplate",
category_territory = "",
territory = "",
id = "467",
expansion = "Legion",
location = "Dalaran"
},
id468 = {
source = "Atramedes",
drop_rate = "0.0",
name = "Battleplate of Ancient Kings",
category_territory = "Raid",
territory = "Horde",
id = "468",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id469 = {
source = "Magmaw",
drop_rate = "0.0",
name = "Breastplate of Avenging Flame",
category_territory = "Raid",
territory = "Horde",
id = "469",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id470 = {
source = "Chogall",
drop_rate = "0.0",
name = "Battleplate of the Apocalypse",
category_territory = "Raid",
territory = "Horde",
id = "470",
expansion = "Cataclysm",
location = "The Bastion of Twilight"
},
id471 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Earthen Battleplate",
category_territory = "",
territory = "Alliance",
id = "471",
expansion = "",
location = "Orgrimmar"
},
id472 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Earthen Chestguard",
category_territory = "",
territory = "Alliance",
id = "472",
expansion = "",
location = "Orgrimmar"
},
id473 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Magma Plated Battleplate",
category_territory = "",
territory = "Alliance",
id = "473",
expansion = "",
location = "Orgrimmar"
},
id474 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Reinforced Sapphirium Battleplate",
category_territory = "",
territory = "Alliance",
id = "474",
expansion = "",
location = "Orgrimmar"
},
id475 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Magma Plated Chestguard",
category_territory = "",
territory = "Alliance",
id = "475",
expansion = "",
location = "Orgrimmar"
},
id476 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Reinforced Sapphirium Chestguard",
category_territory = "",
territory = "Alliance",
id = "476",
expansion = "",
location = "Orgrimmar"
},
id477 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Reinforced Sapphirium Breastplate",
category_territory = "",
territory = "Alliance",
id = "477",
expansion = "",
location = "Orgrimmar"
},
id478 = {
source = "Blazzek the Biter",
drop_rate = "Unknown",
name = "Vicious Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "478",
expansion = "",
location = "Tanaris"
},
id479 = {
source = "Blazzek the Biter",
drop_rate = "Unknown",
name = "Vicious Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "479",
expansion = "",
location = "Tanaris"
},
id480 = {
source = "Blazzek the Biter",
drop_rate = "Unknown",
name = "Vicious Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "480",
expansion = "",
location = "Tanaris"
},
id481 = {
source = "Blazzek the Biter",
drop_rate = "Unknown",
name = "Vicious Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "481",
expansion = "",
location = "Tanaris"
},
id482 = {
source = "Magmaw",
drop_rate = "0.0",
name = "Breastplate of Avenging Flame",
category_territory = "Raid",
territory = "Horde",
id = "482",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id483 = {
source = "Atramedes",
drop_rate = "0.0",
name = "Battleplate of Ancient Kings",
category_territory = "Raid",
territory = "Horde",
id = "483",
expansion = "Cataclysm",
location = "Blackwing Descent"
},
id484 = {
source = "Chogall",
drop_rate = "0.0",
name = "Battleplate of the Apocalypse",
category_territory = "Raid",
territory = "Horde",
id = "484",
expansion = "Cataclysm",
location = "The Bastion of Twilight"
},
id485 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Magma Plated Battleplate",
category_territory = "",
territory = "Alliance",
id = "485",
expansion = "",
location = "Orgrimmar"
},
id486 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Magma Plated Chestguard",
category_territory = "",
territory = "Alliance",
id = "486",
expansion = "",
location = "Orgrimmar"
},
id487 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Reinforced Sapphirium Battleplate",
category_territory = "",
territory = "Alliance",
id = "487",
expansion = "",
location = "Orgrimmar"
},
id488 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Reinforced Sapphirium Breastplate",
category_territory = "",
territory = "Alliance",
id = "488",
expansion = "",
location = "Orgrimmar"
},
id489 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Reinforced Sapphirium Chestguard",
category_territory = "",
territory = "Alliance",
id = "489",
expansion = "",
location = "Orgrimmar"
},
id490 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Earthen Battleplate",
category_territory = "",
territory = "Alliance",
id = "490",
expansion = "",
location = "Orgrimmar"
},
id491 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Earthen Chestguard",
category_territory = "",
territory = "Alliance",
id = "491",
expansion = "",
location = "Orgrimmar"
},
id492 = {
source = "Garr",
drop_rate = "0.0",
name = "Icebone Hauberk",
category_territory = "",
territory = "Horde",
id = "492",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id493 = {
source = "Wushoolay",
drop_rate = "0.0",
name = "Troll Skull Chestplate",
category_territory = "Dungeon",
territory = "Horde",
id = "493",
expansion = "Cataclysm",
location = "Zul'Gurub"
},
id494 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "494",
expansion = "",
location = "Orgrimmar"
},
id495 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "495",
expansion = "",
location = "Orgrimmar"
},
id496 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "496",
expansion = "",
location = "Orgrimmar"
},
id497 = {
source = "Blood Guard Zarshi",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Alliance",
id = "497",
expansion = "",
location = "Orgrimmar"
},
id498 = {
source = "Bethtilac",
drop_rate = "0.0",
name = "Carapace of Imbibed Flame",
category_territory = "Raid",
territory = "Horde",
id = "498",
expansion = "Cataclysm",
location = "Firelands"
},
id499 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Chestguard of the Molten Giant",
category_territory = "",
territory = "Alliance",
id = "499",
expansion = "",
location = "Orgrimmar"
},
id500 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Immolation Chestguard",
category_territory = "",
territory = "Alliance",
id = "500",
expansion = "",
location = "Orgrimmar"
},
id501 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Elementium Deathplate Chestguard",
category_territory = "",
territory = "Alliance",
id = "501",
expansion = "",
location = "Orgrimmar"
},
id502 = {
source = "Alysrazor",
drop_rate = "0.0",
name = "Clutch of the Firemother",
category_territory = "Raid",
territory = "Horde",
id = "502",
expansion = "Cataclysm",
location = "Firelands"
},
id503 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Elementium Deathplate Breastplate",
category_territory = "",
territory = "Alliance",
id = "503",
expansion = "",
location = "Orgrimmar"
},
id504 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Immolation Battleplate",
category_territory = "",
territory = "Alliance",
id = "504",
expansion = "",
location = "Orgrimmar"
},
id505 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Battleplate of the Molten Giant",
category_territory = "",
territory = "Alliance",
id = "505",
expansion = "",
location = "Orgrimmar"
},
id506 = {
source = "Gunra",
drop_rate = "Unknown",
name = "Immolation Breastplate",
category_territory = "",
territory = "Alliance",
id = "506",
expansion = "",
location = "Orgrimmar"
},
id507 = {
source = "Majordomo Staghelm",
drop_rate = "0.0",
name = "Breastplate of Shifting Visions",
category_territory = "Raid",
territory = "Horde",
id = "507",
expansion = "Cataclysm",
location = "Firelands"
},
id508 = {
source = "Ecton Brasstumbler",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Horde",
id = "508",
expansion = "",
location = "Tanaris"
},
id509 = {
source = "Ecton Brasstumbler",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Horde",
id = "509",
expansion = "",
location = "Tanaris"
},
id510 = {
source = "Ecton Brasstumbler",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Horde",
id = "510",
expansion = "",
location = "Tanaris"
},
id511 = {
source = "Ecton Brasstumbler",
drop_rate = "Unknown",
name = "Ruthless Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Horde",
id = "511",
expansion = "",
location = "Tanaris"
},
id512 = {
source = "Echo of Jaina",
drop_rate = "0.0",
name = "Breastplate of Sorrow",
category_territory = "Dungeon",
territory = "Horde",
id = "512",
expansion = "Cataclysm",
location = "End Time"
},
id513 = {
source = "Time-Twisted Geist",
drop_rate = "0.0",
name = "Breastplate of Despair",
category_territory = "Dungeon",
territory = "Horde",
id = "513",
expansion = "Cataclysm",
location = "End Time"
},
id514 = {
source = "Asira Dawnslayer",
drop_rate = "0.0",
name = "Chestguard of Futility",
category_territory = "Dungeon",
territory = "Horde",
id = "514",
expansion = "Cataclysm",
location = "Hour of Twilight"
},
id515 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Redsteel Breastplate",
category_territory = "",
territory = "",
id = "515",
expansion = "Legion",
location = "Dalaran"
},
id516 = {
source = "Earthrager Ptah",
drop_rate = "0.0",
name = "Breastplate of the Risen Land",
category_territory = "Dungeon",
territory = "Horde",
id = "516",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id517 = {
source = "Beauty",
drop_rate = "0.0",
name = "Beauty's Plate",
category_territory = "Dungeon",
territory = "Horde",
id = "517",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id518 = {
source = "Earthrager Ptah",
drop_rate = "0.0",
name = "Breastplate of the Risen Land",
category_territory = "Dungeon",
territory = "Horde",
id = "518",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id519 = {
source = "Anraphet",
drop_rate = "0.0",
name = "Omega Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "519",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id520 = {
source = "Anraphet",
drop_rate = "0.0",
name = "Omega Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "520",
expansion = "Cataclysm",
location = "Halls of Origination"
},
id521 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Breastplate of Raging Fury",
category_territory = "",
territory = "Alliance",
id = "521",
expansion = "",
location = "Orgrimmar"
},
id522 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Chestplate of the Steadfast",
category_territory = "",
territory = "Alliance",
id = "522",
expansion = "",
location = "Orgrimmar"
},
id523 = {
source = "Rugok",
drop_rate = "Unknown",
name = "Chestguard of Dancing Waves",
category_territory = "",
territory = "Alliance",
id = "523",
expansion = "",
location = "Orgrimmar"
},
id524 = {
source = "Provisioner Arok",
drop_rate = "Unknown",
name = "Peacemaker's Breastplate",
category_territory = "",
territory = "Horde",
id = "524",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id525 = {
source = "Lord Walden",
drop_rate = "0.0",
name = "Phantom Armor",
category_territory = "Dungeon",
territory = "Alliance",
id = "525",
expansion = "",
location = "Shadowfang Keep"
},
id526 = {
source = "Lord Godfrey",
drop_rate = "0.0",
name = "Lord Walden's Breastplate",
category_territory = "Dungeon",
territory = "Alliance",
id = "526",
expansion = "",
location = "Shadowfang Keep"
},
id527 = {
source = "Krazz Works!",
drop_rate = "quest",
name = "Skyshredder Battleplate",
category_territory = "",
territory = "Horde",
id = "527",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id528 = {
source = "Doing It Like a Dunwald",
drop_rate = "quest",
name = "Flynn's Favorite Chestplate",
category_territory = "",
territory = "Horde",
id = "528",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id529 = {
source = "Rogoc",
drop_rate = "Unknown",
name = "Bloodthirsty Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "529",
expansion = "",
location = "Orgrimmar"
},
id530 = {
source = "Rogoc",
drop_rate = "Unknown",
name = "Bloodthirsty Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "Alliance",
id = "530",
expansion = "",
location = "Orgrimmar"
},
id531 = {
source = "Rogoc",
drop_rate = "Unknown",
name = "Bloodthirsty Gladiator's Plate Chestpiece",
category_territory = "",
territory = "Alliance",
id = "531",
expansion = "",
location = "Orgrimmar"
},
id532 = {
source = "Rogoc",
drop_rate = "Unknown",
name = "Bloodthirsty Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "Alliance",
id = "532",
expansion = "",
location = "Orgrimmar"
},
id533 = {
source = "Closing a Dark Chapter",
drop_rate = "quest",
name = "Breastplate of the Witness",
category_territory = "Dungeon",
territory = "Horde",
id = "533",
expansion = "Cataclysm",
location = "Grim Batol"
},
id534 = {
source = "Twilight Windwarper",
drop_rate = "0.0",
name = "Harbinger's Breastplate",
category_territory = "",
territory = "Horde",
id = "534",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id535 = {
source = "Echo of Jaina",
drop_rate = "0.0",
name = "Breastplate of Sorrow",
category_territory = "Dungeon",
territory = "Horde",
id = "535",
expansion = "Cataclysm",
location = "End Time"
},
id536 = {
source = "Echo of Jaina",
drop_rate = "0.0",
name = "Breastplate of Despair",
category_territory = "Dungeon",
territory = "Horde",
id = "536",
expansion = "Cataclysm",
location = "End Time"
},
id537 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Stormforged Breastplate",
category_territory = "",
territory = "",
id = "537",
expansion = "Legion",
location = "Dalaran"
},
id538 = {
source = "Crafter Kwon",
drop_rate = "Unknown",
name = "Faded Forest Burnished Chestguard",
category_territory = "",
territory = "Horde",
id = "538",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id539 = {
source = "Crafter Kwon",
drop_rate = "Unknown",
name = "Faded Forest Heavy Chestpiece",
category_territory = "",
territory = "Horde",
id = "539",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id540 = {
source = "Crafter Kwon",
drop_rate = "Unknown",
name = "Faded Forest Armored Chestpiece",
category_territory = "",
territory = "Horde",
id = "540",
expansion = "Mists Of Pandaria",
location = "Timeless Isle"
},
id541 = {
source = "Pearly Tortoise",
drop_rate = "0.0",
name = "Wall Breastplate",
category_territory = "",
territory = "Horde",
id = "541",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id542 = {
source = "Corrupt Droplet",
drop_rate = "0.0",
name = "Brick Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "542",
expansion = "Mists Of Pandaria",
location = "Temple of the Jade Serpent"
},
id543 = {
source = "Seein Red",
drop_rate = "quest",
name = "Burnished Chestguard of Eminent Domain",
category_territory = "",
territory = "Horde",
id = "543",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id544 = {
source = "Seein Red",
drop_rate = "quest",
name = "Armored Chestpiece of Eminent Domain",
category_territory = "",
territory = "Horde",
id = "544",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id545 = {
source = "Seein Red",
drop_rate = "quest",
name = "Heavy Chestpiece of Eminent Domain",
category_territory = "",
territory = "Horde",
id = "545",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id546 = {
source = "The Right Tool For The Job",
drop_rate = "quest",
name = "Burnished Chestguard of Eminent Domain",
category_territory = "",
territory = "Horde",
id = "546",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id547 = {
source = "The Right Tool For The Job",
drop_rate = "quest",
name = "Armored Chestpiece of Eminent Domain",
category_territory = "",
territory = "Horde",
id = "547",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id548 = {
source = "The Right Tool For The Job",
drop_rate = "quest",
name = "Heavy Chestpiece of Eminent Domain",
category_territory = "",
territory = "Horde",
id = "548",
expansion = "Mists Of Pandaria",
location = "The Jade Forest"
},
id549 = {
source = "The Wrong Sequence",
drop_rate = "quest",
name = "Gateshattering Hauberk",
category_territory = "",
territory = "Horde",
id = "549",
expansion = "Cataclysm",
location = "Deepholm"
},
id550 = {
source = "The Wrong Sequence",
drop_rate = "quest",
name = "Gateshattering Hauberk",
category_territory = "",
territory = "Horde",
id = "550",
expansion = "Cataclysm",
location = "Deepholm"
},
id551 = {
source = "Total War",
drop_rate = "quest",
name = "Wound-Binder Chestguard",
category_territory = "",
territory = "Horde",
id = "551",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id552 = {
source = "Fight Like a Wildhammer",
drop_rate = "quest",
name = "Blundy's Breastplate",
category_territory = "",
territory = "Horde",
id = "552",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id553 = {
source = "Dressed to Kill",
drop_rate = "quest",
name = "Ogre-Slayer Chestplate",
category_territory = "",
territory = "Horde",
id = "553",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id554 = {
source = "Anything But Water",
drop_rate = "quest",
name = "Keg-Sized Chestplate",
category_territory = "",
territory = "Horde",
id = "554",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id555 = {
source = "Amanishi Handler",
drop_rate = "0.0",
name = "Crystalvein Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "555",
expansion = "Cataclysm",
location = "Zul'Aman"
},
id556 = {
source = "Fortune and Glory",
drop_rate = "quest",
name = "Colossus Smasher Breastplate",
category_territory = "",
territory = "Horde",
id = "556",
expansion = "Cataclysm",
location = "Uldum"
},
id557 = {
source = "A Disarming Distraction",
drop_rate = "quest",
name = "Tomb-Curse Chestplate",
category_territory = "",
territory = "Horde",
id = "557",
expansion = "Cataclysm",
location = "Uldum"
},
id558 = {
source = "Fashionism",
drop_rate = "quest",
name = "Bullet-Pierced Chestplate",
category_territory = "",
territory = "Horde",
id = "558",
expansion = "Cataclysm",
location = "Uldum"
},
id559 = {
source = "Fire From the Sky",
drop_rate = "quest",
name = "Canopic Chestplate",
category_territory = "",
territory = "Horde",
id = "559",
expansion = "Cataclysm",
location = "Uldum"
},
id560 = {
source = "Beauty",
drop_rate = "0.0",
name = "Beauty's Plate",
category_territory = "Dungeon",
territory = "Horde",
id = "560",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id561 = {
source = "Ascendant Lord Obsidius",
drop_rate = "quest",
name = "Raz's Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "561",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id562 = {
source = "Twilight Bloodshaper",
drop_rate = "0.0",
name = "Breastplate of Solemn Vows",
category_territory = "",
territory = "Horde",
id = "562",
expansion = "Cataclysm",
location = "Deepholm"
},
id563 = {
source = "Mercurial Ooze",
drop_rate = "0.0",
name = "Fargodeep Breastplate",
category_territory = "",
territory = "Horde",
id = "563",
expansion = "Cataclysm",
location = "Deepholm"
},
id564 = {
source = "Dragonmaw Skyclaw",
drop_rate = "0.0",
name = "Ravencrest Breastplate",
category_territory = "",
territory = "Horde",
id = "564",
expansion = "Cataclysm",
location = "Twilight Highlands"
},
id565 = {
source = "Oaf Lackey",
drop_rate = "0.0",
name = "Stonewrought Breastplate",
category_territory = "Dungeon",
territory = "War Zone",
id = "565",
expansion = "",
location = "The Deadmines"
},
id566 = {
source = "Troggzor the Earthinator",
drop_rate = "quest",
name = "Troggzor's Crystalline Plate",
category_territory = "",
territory = "Horde",
id = "566",
expansion = "Cataclysm",
location = "Deepholm"
},
id567 = {
source = "Aessinas Miracle",
drop_rate = "quest",
name = "Chestplate of Viridian Renewal",
category_territory = "",
territory = "Horde",
id = "567",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id568 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Hardened Obsidium Breastplate",
category_territory = "",
territory = "",
id = "568",
expansion = "Legion",
location = "Dalaran"
},
id569 = {
source = "Stonecore Warbringer",
drop_rate = "0.0",
name = "Direforge Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "569",
expansion = "Cataclysm",
location = "The Stonecore"
},
id570 = {
source = "Question the Slaves",
drop_rate = "quest",
name = "Rough Stone Carapace",
category_territory = "",
territory = "Horde",
id = "570",
expansion = "Cataclysm",
location = "Deepholm"
},
id571 = {
source = "Lord Marrowgar",
drop_rate = "0.0",
name = "Gendarme's Cuirass",
category_territory = "Raid",
territory = "Horde",
id = "571",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id572 = {
source = "Rotface",
drop_rate = "0.0",
name = "Rot-Resistant Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "572",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id573 = {
source = "Rotface",
drop_rate = "0.0",
name = "Blightborne Warplate",
category_territory = "Raid",
territory = "Horde",
id = "573",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id574 = {
source = "Crusader Grimtong",
drop_rate = "Unknown",
name = "Sanctified Ymirjar Lord's Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "574",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id575 = {
source = "Crusader Grimtong",
drop_rate = "Unknown",
name = "Sanctified Ymirjar Lord's Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "575",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id576 = {
source = "Crusader Halford",
drop_rate = "Unknown",
name = "Sanctified Lightsworn Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "576",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id577 = {
source = "Crusader Halford",
drop_rate = "Unknown",
name = "Sanctified Lightsworn Tunic",
category_territory = "Raid",
territory = "Horde",
id = "577",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id578 = {
source = "Crusader Halford",
drop_rate = "Unknown",
name = "Sanctified Lightsworn Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "578",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id579 = {
source = "Ormus the Penitent",
drop_rate = "Unknown",
name = "Sanctified Scourgelord Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "579",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id580 = {
source = "Ormus the Penitent",
drop_rate = "Unknown",
name = "Sanctified Scourgelord Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "580",
expansion = "Wrath Of The Lich King",
location = "Icecrown Citadel"
},
id581 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Rethban Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "581",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id582 = {
source = "Stone Trogg Digger",
drop_rate = "0.0",
name = "Jasperlode Breastplate",
category_territory = "",
territory = "Horde",
id = "582",
expansion = "Cataclysm",
location = "Deepholm"
},
id583 = {
source = "Twilight Zealot",
drop_rate = "0.0",
name = "Dreadmaul Breastplate",
category_territory = "Dungeon",
territory = "Horde",
id = "583",
expansion = "Cataclysm",
location = "Blackrock Caverns"
},
id584 = {
source = "War on the Twilights Hammer",
drop_rate = "quest",
name = "Druidic Guardian Plate",
category_territory = "",
territory = "Horde",
id = "584",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id585 = {
source = "Trial By Fire",
drop_rate = "quest",
name = "Chestplate of Exceptional Expectations",
category_territory = "",
territory = "Horde",
id = "585",
expansion = "Cataclysm",
location = "Mount Hyjal"
},
id586 = {
source = "Swift Approach",
drop_rate = "quest",
name = "Chestguard of Alarming Dreams",
category_territory = "",
territory = "Horde",
id = "586",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id587 = {
source = "Swift Approach",
drop_rate = "quest",
name = "Chestguard of Alarming Dreams",
category_territory = "",
territory = "Horde",
id = "587",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id588 = {
source = "Crafty Crabs",
drop_rate = "quest",
name = "Oddly Revealing Chestguard",
category_territory = "",
territory = "Horde",
id = "588",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id589 = {
source = "Odor Coater",
drop_rate = "quest",
name = "Chestplate of Fragrant Desire",
category_territory = "",
territory = "Horde",
id = "589",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id590 = {
source = "Backed Into a Corner",
drop_rate = "quest",
name = "Damplight Chestplate",
category_territory = "",
territory = "Horde",
id = "590",
expansion = "Cataclysm",
location = "Shimmering Expanse"
},
id591 = {
source = "Gluth",
drop_rate = "0.0",
name = "Chivalric Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "591",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id592 = {
source = "Gluth",
drop_rate = "0.0",
name = "Chestplate of the Risen Soldier",
category_territory = "Raid",
territory = "Horde",
id = "592",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id593 = {
source = "Sapphiron",
drop_rate = "0.0",
name = "Massive Skeletal Ribcage",
category_territory = "Raid",
territory = "Horde",
id = "593",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id594 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Dreadnaught Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "594",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id595 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Dreadnaught Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "595",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id596 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Scourgeborne Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "596",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id597 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Scourgeborne Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "597",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id598 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Redemption Tunic",
category_territory = "Raid",
territory = "Horde",
id = "598",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id599 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Redemption Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "599",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id600 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Heroes' Redemption Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "600",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id601 = {
source = "Gluth",
drop_rate = "0.0",
name = "Undiminished Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "601",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id602 = {
source = "Gluth",
drop_rate = "0.0",
name = "Breastplate of Tormented Rage",
category_territory = "Raid",
territory = "Horde",
id = "602",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id603 = {
source = "Gluth",
drop_rate = "0.0",
name = "Chestguard of Bitter Charms",
category_territory = "Raid",
territory = "Horde",
id = "603",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id604 = {
source = "Gluth",
drop_rate = "0.0",
name = "Chestguard of the Exhausted",
category_territory = "Raid",
territory = "Horde",
id = "604",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id605 = {
source = "Sapphiron",
drop_rate = "0.0",
name = "Breastplate of Frozen Pain",
category_territory = "Raid",
territory = "Horde",
id = "605",
expansion = "Wrath Of The Lich King",
location = "Naxxramas"
},
id606 = {
source = "Sartharion",
drop_rate = "0.0",
name = "Chestplate of the Great Aspects",
category_territory = "Raid",
territory = "Horde",
id = "606",
expansion = "Wrath Of The Lich King",
location = "The Obsidian Sanctum"
},
id607 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Dreadnaught Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "607",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id608 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Dreadnaught Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "608",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id609 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Scourgeborne Battleplate",
category_territory = "Raid",
territory = "Horde",
id = "609",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id610 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Scourgeborne Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "610",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id611 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Redemption Tunic",
category_territory = "Raid",
territory = "Horde",
id = "611",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id612 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Redemption Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "612",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id613 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Valorous Redemption Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "613",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id614 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Hateful Gladiator's Dreadplate Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "614",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id615 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Hateful Gladiator's Scaled Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "615",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id616 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Hateful Gladiator's Plate Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "616",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id617 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Deadly Gladiator's Dreadplate Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "617",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id618 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Deadly Gladiator's Scaled Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "618",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id619 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Deadly Gladiator's Plate Chestpiece",
category_territory = "Raid",
territory = "Horde",
id = "619",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id620 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "",
id = "620",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id621 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "",
id = "621",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id622 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Plate Chestpiece",
category_territory = "",
territory = "",
id = "622",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id623 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Plate Chestpiece",
category_territory = "",
territory = "",
id = "623",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id624 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Dreadplate Chestpiece",
category_territory = "",
territory = "",
id = "624",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id625 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Scaled Chestpiece",
category_territory = "",
territory = "",
id = "625",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id626 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Hateful Gladiator's Ornamented Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "626",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id627 = {
source = "Archavon the Stone Watcher",
drop_rate = "0.0",
name = "Deadly Gladiator's Ornamented Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "627",
expansion = "Wrath Of The Lich King",
location = "Vault of Archavon"
},
id628 = {
source = "Kylo Kelwin",
drop_rate = "Unknown",
name = "Furious Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "",
id = "628",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id629 = {
source = "Zom Bocom",
drop_rate = "Unknown",
name = "Relentless Gladiator's Ornamented Chestguard",
category_territory = "",
territory = "",
id = "629",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id630 = {
source = "Arcanomancer Vridiel",
drop_rate = "Unknown",
name = "Icebane Chestguard",
category_territory = "",
territory = "",
id = "630",
expansion = "Legion",
location = "Dalaran"
},
id631 = {
source = "Sartharion",
drop_rate = "0.0",
name = "Dragonstorm Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "631",
expansion = "Wrath Of The Lich King",
location = "The Obsidian Sanctum"
},
id632 = {
source = "Ignis the Furnace Master",
drop_rate = "0.0",
name = "Lifeforge Breastplate",
category_territory = "Raid",
territory = "Horde",
id = "632",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id633 = {
source = "Runemaster Molgeim",
drop_rate = "0.0",
name = "Steelbreaker's Embrace",
category_territory = "Raid",
territory = "Horde",
id = "633",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id634 = {
source = "Razorscale",
drop_rate = "0.0",
name = "Breastplate of the Afterlife",
category_territory = "Raid",
territory = "Horde",
id = "634",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id635 = {
source = "Auriaya",
drop_rate = "0.0",
name = "Unbreakable Chestguard",
category_territory = "Raid",
territory = "Horde",
id = "635",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id636 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Darkruned Chestguard",
category_territory = "",
territory = "",
id = "636",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id637 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Darkruned Battleplate",
category_territory = "",
territory = "",
id = "637",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id638 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Aegis Tunic",
category_territory = "",
territory = "",
id = "638",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id639 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Aegis Battleplate",
category_territory = "",
territory = "",
id = "639",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id640 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Aegis Breastplate",
category_territory = "",
territory = "",
id = "640",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id641 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Siegebreaker Breastplate",
category_territory = "",
territory = "",
id = "641",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id642 = {
source = "Dubin Clay",
drop_rate = "Unknown",
name = "Valorous Siegebreaker Battleplate",
category_territory = "",
territory = "",
id = "642",
expansion = "Wrath Of The Lich King",
location = "Dalaran"
},
id643 = {
source = "XT-002 Deconstructor",
drop_rate = "0.0",
name = "Breastplate of the Devoted",
category_territory = "Raid",
territory = "Horde",
id = "643",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id644 = {
source = "XT-002 Deconstructor",
drop_rate = "0.0",
name = "Chestplate of Vicious Potency",
category_territory = "Raid",
territory = "Horde",
id = "644",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id645 = {
source = "Auriaya",
drop_rate = "0.0",
name = "Chestplate of Titanic Fury",
category_territory = "Raid",
territory = "Horde",
id = "645",
expansion = "Wrath Of The Lich King",
location = "Ulduar"
},
id646 = {
source = "Stone Guard Mukar",
drop_rate = "Unknown",
name = "Titan-Forged Chestguard of Salvation",
category_territory = "",
territory = "",
id = "646",
expansion = "Wrath Of The Lich King",
location = "Wintergrasp"
},
id647 = {
source = "Stone Guard Mukar",
drop_rate = "Unknown",
name = "Titan-Forged Breastplate of Triumph",
category_territory = "",
territory = "",
id = "647",
expansion = "Wrath Of The Lich King",
location = "Wintergrasp"
}
}
|
T.vs2010_sln = { }
local vs_magic_cpp_build_tool_id = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942"
local constant_uuid = "AE61726D-187C-E440-BD07-2556188A6565"
local constant_project_name = "MyProject"
--
-- Configure a solution for testing
--
local sln
function T.vs2010_sln.setup()
_ACTION = "vs2010"
sln = solution "MySolution"
configurations { "Debug", "Release" }
platforms {}
prj = project(constant_project_name)
language "C++"
kind "ConsoleApp"
uuid(constant_uuid)
premake.buildconfigs()
end
local function escape_id(str)
return string.gsub(str,"%-+","%%%-")
end
local function assert_has_project(buffer,uid,name,ext)
test.string_contains(buffer,"Project(\"{"..escape_id(vs_magic_cpp_build_tool_id).."}\") = \""..name.."\", \""..name.."."..ext.."\", \"{"..escape_id(uid).."}\"")
end
local function assert_find_uuid(buffer,id)
test.string_contains(buffer,escape_id(id))
end
local function get_buffer()
io.capture()
premake.vs_generic_solution(sln)
buffer = io.endcapture()
return buffer
end
function T.vs2010_sln.action_formatVersionis11()
local buffer = get_buffer()
test.string_contains(buffer,'Format Version 11.00')
end
function T.vs2010_sln.action_vsIs2010()
local buffer = get_buffer()
test.string_contains(buffer,'# Visual Studio 2010')
end
function T.vs2010_sln.action_hasProjectScope()
local buffer = get_buffer()
test.string_contains(buffer,"Project(.*)EndProject")
end
function T.vs2010_sln.containsVsCppMagicId()
local buffer = get_buffer()
assert_find_uuid(buffer,vs_magic_cpp_build_tool_id)
end
function T.vs2010_sln.action_findMyProjectID()
local buffer = get_buffer()
test.string_contains(buffer,escape_id(constant_uuid))
end
function T.vs2010_sln.action_findsExtension()
local buffer = get_buffer()
test.string_contains(buffer,".vcxproj")
end
function T.vs2010_sln.action_hasGlobalStartBlock()
local buffer = get_buffer()
test.string_contains(buffer,"Global")
end
function T.vs2010_sln.action_hasGlobalEndBlock()
local buffer = get_buffer()
test.string_contains(buffer,"EndGlobal")
end
function T.vs2010_sln.BasicLayout()
io.capture()
premake.vs_generic_solution(sln)
test.capture ('\239\187\191' .. [[
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcxproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.ActiveCfg = Debug|Win32
{AE61726D-187C-E440-BD07-2556188A6565}.Debug|Win32.Build.0 = Debug|Win32
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.ActiveCfg = Release|Win32
{AE61726D-187C-E440-BD07-2556188A6565}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
]])
end
|
local SkillQueueViewModel = my_load_mod_script("skill_queue_view_model")
local QueuedSkillContainer = my_load_mod_script("queued_skill_container")
local SkillValidator = my_load_mod_script("skill_validator")
local SkillQueuer = my_load_mod_script("skill_queuer")
local SkillQueueUi = {} --# assume SkillQueueUi: SKILL_QUEUE_UI
SkillQueueUi.__index = SkillQueueUi;
SkillQueueUi.viewModel = nil --: SKILL_QUEUE_VIEW_MODEL
SkillQueueUi.skillQueuer = nil --: SKILL_QUEUER
SkillQueueUi.skillsPanel = nil --: CA_UIC
SkillQueueUi.skillList = nil --: CA_UIC
SkillQueueUi.skillQueuePanel = nil --: CONTAINER
SkillQueueUi.skillQueueButton = nil --: TEXT_BUTTON
SkillQueueUi.skillQueuerButton = nil --: TEXT_BUTTON
SkillQueueUi.queuedSkillToQueuedSkillContainer = {} --: map<QUEUED_SKILL, CONTAINER>
SkillQueueUi.markedSkills = {} --: vector<CA_UIC>
SkillQueueUi.markedSkillLabels = {} --: vector<TEXT>
SkillQueueUi.panelSwitched = false --: boolean
--v function(self: SKILL_QUEUE_UI, switched: boolean)
function SkillQueueUi.panelClosed(self, switched)
self.panelSwitched = switched;
self.skillQueueButton:Delete();
self.skillQueuePanel:Clear();
if not switched then
self.skillQueuer:resetSkillHighlights();
else
core:remove_listener("SkillCardClickListener");
end
core:remove_listener("SkillButtonSkillAllocationListener");
core:remove_listener("resetSkillButtonListener");
self.skillQueuer:resetDefaultStates();
self.markedSkills = {};
self.viewModel:setQueueExpanded(false);
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.addSkillQueueButton(self)
local skillQueueButton = TextButton.new("skillQueueButton", self.skillsPanel, "TEXT_TOGGLE_SMALL", "Queue Skills");
skillQueueButton:Resize(self.viewModel.skillQueueWidth, skillQueueButton:Height());
local statsResetHolder = find_uicomponent(self.skillsPanel, "stats_reset_holder");
local x, y = statsResetHolder:Position();
local w, h = statsResetHolder:Bounds();
skillQueueButton:PositionRelativeTo(self.skillList, self.skillList:Bounds() - skillQueueButton:Width(), 0);
skillQueueButton:MoveTo(skillQueueButton:XPos(), y + h );
skillQueueButton:RegisterForClick(
function(context)
self.viewModel:setQueueExpanded(not self.viewModel.queueExpanded);
end
);
self.skillQueueButton = skillQueueButton;
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.addSkillQueuerButton(self)
local skillQueuerButton = TextButton.new("skillQueuerButton", self.skillsPanel, "TEXT_TOGGLE_SMALL", "Select skills...");
skillQueuerButton:Resize(self.viewModel.skillQueueWidth, skillQueuerButton:Height());
skillQueuerButton:RegisterForClick(
function(context)
if not skillQueuerButton:IsSelected() then
self.skillQueuer:highightQueueableSkills();
else
self.skillQueuer:resetSkillHighlights();
end
end
);
skillQueuerButton:SetVisible(false);
self.skillQueuePanel:AddComponent(skillQueuerButton);
self.skillQueuerButton = skillQueuerButton;
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.resizeSkillList(self)
local skillList = self.skillList;
skillList:SetCanResizeHeight(true);
skillList:SetCanResizeWidth(true);
local skillListWidth = self.viewModel.skillListWidth;
if not skillListWidth then
out("Failed to resize skill list as skill list width not known.")
return;
end
local w, h = skillList:Dimensions();
if self.viewModel.queueExpanded then
skillList:Resize(skillListWidth - self.viewModel.skillQueueWidth, h);
else
skillList:Resize(skillListWidth, h);
end
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.updateSkillQueuePanel(self)
local skillQueuePanel = self.skillQueuePanel;
if skillQueuePanel:Visible() ~= self.viewModel.queueExpanded then
skillQueuePanel:SetVisible(self.viewModel.queueExpanded);
end
if not self.viewModel.queueExpanded then
self.skillQueuer:resetSkillHighlights();
return;
end
skillQueuePanel:Reposition();
end
--v function(self: SKILL_QUEUE_UI) --> map<QUEUED_SKILL, CONTAINER>
function SkillQueueUi.calculateMissingSkillQueueContainers(self)
local missingSkillQueueContrainers = {} --: map<QUEUED_SKILL, CONTAINER>
for queuedSkill, container in pairs(self.queuedSkillToQueuedSkillContainer) do
if not listContains(self.viewModel.queuedSkills, queuedSkill) then
missingSkillQueueContrainers[queuedSkill] = container;
end
end
return missingSkillQueueContrainers;
end
--v function(self: SKILL_QUEUE_UI, queuedSkillsContainer: CONTAINER)
function SkillQueueUi.updateQueuedSkillPanel(self, queuedSkillsContainer)
local previousList = queuedSkillsContainer.components[1];
if previousList then
--# assume previousList: LIST_VIEW
previousList:DeleteOnlySelf();
end
queuedSkillsContainer:Empty();
local queuedSkillList = ListView.new("queuedSkillList", self.skillsPanel, "VERTICAL");
local queueDivider = Util.getComponentWithName("skillQueuePanelSideDivider");
--# assume queueDivider: IMAGE
queuedSkillList:Resize(self.viewModel.skillQueueWidth, queueDivider:Height());
queuedSkillsContainer:AddComponent(queuedSkillList);
for i, queuedSkill in ipairs(self.viewModel.queuedSkills) do
local queuedSkillContainer = self.queuedSkillToQueuedSkillContainer[queuedSkill];
if not queuedSkillContainer then
queuedSkillContainer = QueuedSkillContainer.new(queuedSkill, self.skillsPanel, self.viewModel):getContainer();
self.queuedSkillToQueuedSkillContainer[queuedSkill] = queuedSkillContainer;
end
queuedSkillList:AddComponent(queuedSkillContainer);
end
local missingSkillQueueContrainers = self:calculateMissingSkillQueueContainers();
for queuedSkill, missingSkillQueueContainer in pairs(missingSkillQueueContrainers) do
missingSkillQueueContainer:Clear();
self.queuedSkillToQueuedSkillContainer[queuedSkill] = nil;
end
queuedSkillsContainer:Reposition();
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.markSelectedSkills(self)
for i, markedSkill in ipairs(self.markedSkills) do
markedSkill:SetState("locked");
markedSkill:SetOpacity(255);
end
for i, markedSkillLabel in ipairs(self.markedSkillLabels) do
markedSkillLabel:Delete();
end
self.markedSkills = {};
self.markedSkillLabels = {};
if self.viewModel.queueExpanded then
local queuedSkills = self.viewModel.queuedSkills;
for i, queuedSkill in ipairs(queuedSkills) do
local skillRankUic = self.viewModel:getUicForSkillRank(queuedSkill.skill, queuedSkill.skillRank);
skillRankUic:SetState("active");
skillRankUic:SetOpacity(150);
table.insert(self.markedSkills, skillRankUic);
local skillLabel = Text.new("markedSkillLabel" .. i, skillRankUic, "NORMAL", tostring(i));
skillLabel:Resize(18, 12);
local skillRankUicW, skillRankUicH = skillRankUic:Bounds();
skillLabel:PositionRelativeTo(skillRankUic, skillRankUicW, skillRankUicH/2);
table.insert(self.markedSkillLabels, skillLabel);
end
end
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.disableResetSkillsButton(self)
local resetButton = find_uicomponent(self.skillsPanel, "stats_reset_holder", "button_stats_reset");
local currentState = resetButton:CurrentState();
if #self.viewModel.queuedSkills > 0 then
resetButton:SetState("active");
resetButton:SetDisabled(true);
resetButton:SetOpacity(50);
resetButton:SetState("inactive");
resetButton:SetDisabled(true);
resetButton:SetOpacity(50);
else
resetButton:SetState("active");
resetButton:SetDisabled(false);
resetButton:SetOpacity(255);
resetButton:SetState("inactive");
resetButton:SetDisabled(false);
resetButton:SetOpacity(255);
end
resetButton:SetState(currentState);
end
--v function(self: SKILL_QUEUE_UI) --> CONTAINER
function SkillQueueUi.createQueuedSkillsPanel(self)
local queuedSkillsContainer = Container.new(FlowLayout.VERTICAL);
self.viewModel:RegisterForEvent(
"SKILL_QUEUE_UPDATED",
function()
self:updateQueuedSkillPanel(queuedSkillsContainer);
self.skillQueuePanel:Reposition();
self:markSelectedSkills();
self:disableResetSkillsButton();
end
)
self:updateQueuedSkillPanel(queuedSkillsContainer);
return queuedSkillsContainer;
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.createSkillQueuePanel(self)
local skillQueuePanel = Container.new(FlowLayout.VERTICAL);
skillQueuePanel:AddGap(20);
local skillQueuePanelDivider = Image.new("skillQueuePanelDivider", self.skillsPanel, "ui/skins/default/separator_line.png");
skillQueuePanelDivider:Resize(self.viewModel.skillQueueWidth, 2);
skillQueuePanel:AddComponent(skillQueuePanelDivider);
local skillListW, skillListH = self.skillList:Bounds();
local outerPanel = Container.new(FlowLayout.HORIZONTAL);
local skillQueuePanelSideDivider = Image.new("skillQueuePanelSideDivider", self.skillsPanel, "ui/skins/default/separator_line.png");
skillQueuePanelSideDivider:Resize(4, skillListH - 50);
outerPanel:AddComponent(skillQueuePanelSideDivider);
local queuedSkillsPanel = self:createQueuedSkillsPanel();
outerPanel:AddComponent(queuedSkillsPanel);
skillQueuePanel:AddComponent(outerPanel);
skillQueuePanel:SetVisible(false);
skillQueuePanel:PositionRelativeTo(self.skillList, skillListW - self.viewModel.skillQueueWidth, 0);
self.skillQueuePanel = skillQueuePanel;
self:updateSkillQueuePanel();
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.resetHandlePosition(self)
local handle = find_uicomponent(self.skillList, "hslider", "handle");
local frameLeft = find_uicomponent(self.skillList, "hslider", "frame_left");
local handleX, handleY = handle:Bounds();
handle:MoveTo(frameLeft:Position() + frameLeft:Bounds() - 1, handleY);
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.setUpRegistrations(self)
self.viewModel:RegisterForEvent(
"QUEUE_EXPANDED_CHANGE",
function()
self:resizeSkillList();
if not self.panelSwitched then
self:updateSkillQueuePanel();
self.skillQueuerButton:SetState("active");
self:markSelectedSkills();
self:resetHandlePosition();
end
end
);
end
SkillQueueUi.disableButtonIfSkillPoints = nil --: function(self: SKILL_QUEUE_UI)
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.disableButtonIfSkillPoints(self)
local skillPointsUic = find_uicomponent(core:get_ui_root(), "character_details_panel", "dy_pts");
local skillPoints = tonumber(skillPointsUic:GetStateText(), 10);
if skillPoints > 0 then
self.skillQueueButton:SetDisabled(true);
core:add_listener(
"SkillButtonSkillAllocationListener",
"CharacterSkillPointAllocated",
function(context)
return true;
end,
function(context)
cm:callback(
function()
self:disableButtonIfSkillPoints();
self.viewModel:detectAllSkillLevels();
end, 0, "SkillButtonSkillAllocationListenerCallback"
)
end,
false
);
else
self.skillQueueButton:SetDisabled(false);
end
end
--v function(self: SKILL_QUEUE_UI)
function SkillQueueUi.listenToResetButtonClick(self)
local resetButton = find_uicomponent(self.skillsPanel, "stats_reset_holder", "button_stats_reset");
Util.registerForClick(
resetButton,
"resetSkillButtonListener",
function(context)
self.viewModel:setQueueExpanded(false);
cm:callback(
function()
self:disableButtonIfSkillPoints();
end, 0, "ResetButtonClickedCallback"
)
end
);
end
--v function(characterSkillQueue: CHARACTER_SKILL_QUEUE) --> SKILL_QUEUE_UI
function SkillQueueUi.new(characterSkillQueue)
out("SkillQueueUi init");
local squi = {};
setmetatable(squi, SkillQueueUi);
--# assume squi: SKILL_QUEUE_UI
squi.viewModel = SkillQueueViewModel.new(characterSkillQueue);
squi.markedSkills = {};
squi.markedSkillLabels = {};
squi.skillQueuer = SkillQueuer.new(
function(skill)
squi.viewModel:queueSkill(skill);
end, SkillValidator.new(squi.viewModel)
);
squi.queuedSkillToQueuedSkillContainer = {};
squi.skillsPanel = find_uicomponent(core:get_ui_root(), "character_details_panel", "background", "skills_subpanel");
squi.skillList = find_uicomponent(core:get_ui_root(), "character_details_panel", "background", "skills_subpanel", "listview");
squi.panelSwitched = false;
squi:setUpRegistrations();
squi:addSkillQueueButton();
squi:createSkillQueuePanel();
squi:addSkillQueuerButton();
squi:disableButtonIfSkillPoints();
squi:disableResetSkillsButton();
squi:listenToResetButtonClick();
return squi;
end
return {
new = SkillQueueUi.new
}
|
return {
summary = 'Get the current operating system.',
description = 'Returns the current operating system.',
arguments = {},
returns = {
{
name = 'os',
type = 'string',
description = 'Either "Windows", "macOS", "Linux", "Android" or "Web".'
}
}
}
|
OrbItem = class(CustomItemOrb)
-- states
-- 0 => unknown
-- 1 => undine
-- 2 => gnome
-- 3 => sylphid
-- 4 => salamando
-- 5 => shade
-- 6 => lumina
-- 7 => luna
-- 8 => dryad
function OrbItem:init(name, code)
self:createItem(name)
self.code = code
self.baseCode = code
self:setProperty("active", false)
self.isSpriteDisabled = 0
self.isGirlDisabled = 0
self.state = 0
self.ImageUnknown = ImageReference:FromPackRelativePath("images/orb.png")
self.ImageUndine = ImageReference:FromPackRelativePath("images/orb_undine.png")
self.ImageGnome = ImageReference:FromPackRelativePath("images/orb_gnome.png")
self.ImageSylphid = ImageReference:FromPackRelativePath("images/orb_sylphid.png")
self.ImageSalamando = ImageReference:FromPackRelativePath("images/orb_salamando.png")
self.ImageShade = ImageReference:FromPackRelativePath("images/orb_shade.png")
self.ImageLumina = ImageReference:FromPackRelativePath("images/orb_lumina.png")
self.ImageLuna = ImageReference:FromPackRelativePath("images/orb_luna.png")
self.ImageDryad = ImageReference:FromPackRelativePath("images/orb_dryad.png")
self.ItemInstance.PotentialIcon = self.ImageUnknown
self:updateIcon()
end
function OrbItem:getState()
return self.state
end
function OrbItem:setState(state)
self:propertyChanged("state",state)
end
function OrbItem:getNextState(state)
if state == 8 then
return 0
else
return state + 1
end
end
function OrbItem:getPrevState(state)
if state == 0 then
return 8
else
return state - 1
end
end
function OrbItem:advanceState()
if self.isSpriteDisabled == 1 and self.isGirlDisabled == 1 then
if(self.state ~= 0 ) then self:setState(0) end
return
end
local nextState = self:getNextState(self.state)
if self.isSpriteDisabled == 1 then
while nextState == 1 or nextState == 2 or nextState == 5 or nextState == 7 or nextState == 8 do
nextState = self:getNextState(nextState)
end
elseif self.isGirlDisabled == 1 then
if nextState == 6 then
nextState = self:getNextState(nextState)
end
end
self:setState(nextState)
end
function OrbItem:decreaseState()
if self.isSpriteDisabled == 1 and self.isGirlDisabled == 1 then
if(self.state ~= 0 ) then self:setState(0) end
return
end
local nextState = self:getPrevState(self.state)
if self.isSpriteDisabled == 1 then
while nextState == 1 or nextState == 2 or nextState == 5 or nextState == 7 or nextState == 8 do
nextState = self:getPrevState(nextState)
end
elseif self.isGirlDisabled == 1 then
if nextState == 6 then
nextState = self:getPrevState(nextState)
end
end
self:setState(nextState)
end
function OrbItem:setActive(active)
if active ~= true then
self:setState(0)
elseif self.state == 0 then
self:setState(1)
end
end
function OrbItem:getActive()
return (self.state > 0 or (self.isSpriteDisabled == 1 and self.isGirlDisabled == 1))
end
function OrbItem:updateIcon()
if self.state == 0 then
self.ItemInstance.Icon = self.ImageUnknown
elseif self.state == 1 then
self.ItemInstance.Icon = self.ImageUndine
elseif self.state == 2 then
self.ItemInstance.Icon = self.ImageGnome
elseif self.state == 3 then
self.ItemInstance.Icon = self.ImageSylphid
elseif self.state == 4 then
self.ItemInstance.Icon = self.ImageSalamando
elseif self.state == 5 then
self.ItemInstance.Icon = self.ImageShade
elseif self.state == 6 then
self.ItemInstance.Icon = self.ImageLumina
elseif self.state == 7 then
self.ItemInstance.Icon = self.ImageLuna
elseif self.state == 8 then
self.ItemInstance.Icon = self.ImageDryad
end
end
function OrbItem:onLeftClick()
self:advanceState()
end
function OrbItem:onRightClick()
self:decreaseState()
end
function OrbItem:canProvideCode(code)
if code == self.code then
return true
else
return false
end
end
function OrbItem:providesCode(code)
if code == self.code then
return self.state
end
return 0
end
function OrbItem:advanceToCode(code)
end
function OrbItem:save()
local saveData = {}
saveData["state"] = self:getState()
return saveData
end
function OrbItem:load(data)
if data["state"] ~= nil then
self:setState(data["state"])
end
return true
end
function OrbItem:propertyChanged(key, value)
if (key == "state") then
self.state = value
end
if key == "isSpriteDisabled" then
self.isSpriteDisabled = value
if self.state == 1 or self.state == 2 or self.state == 5 or self.state == 7 or self.state == 8 then
self:setState(0)
end
end
if key == "isGirlDisabled" then
self.isGirlDisabled = value
if self.state == 6 then
self:setState(0)
end
end
if (key == "isSpriteDisabled" or key == "isGirlDisabled") and self.isGirlDisabled == 1 and self.isSpriteDisabled == 1 then
self:setState(0)
end
self:updateIcon()
end
|
--- === FadeLogo ===
---
--- Show a fading-and-zooming image in the center of the screen
---
--- By default the Hammerspoon logo is shown. Typical use is to show it as an indicator when your configuration finishes loading, by adding the following to the bottom of your `~/.hammerspoon/init.lua` file:
--- ```
--- hs.loadSpoon('FadeLogo'):start()
--- ```
--- Which looks like this: http://imgur.com/a/TbZOl
---
--- Download: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/FadeLogo.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/FadeLogo.spoon.zip)
local obj={}
obj.__index = obj
-- Metadata
obj.name = "FadeLogo"
obj.version = "0.3"
obj.author = "Diego Zamboni <diego@zzamboni.org>"
obj.homepage = "https://github.com/Hammerspoon/Spoons"
obj.license = "MIT - https://opensource.org/licenses/MIT"
--- FadeLogo.logger
--- Variable
--- Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.
obj.logger = hs.logger.new('FadeLogo')
--- FadeLogo.image
--- Variable
--- Image to display. Must be an `hs.image` object. Defaults to `hs.image.imageFromName(hs.image.systemImageNames.ApplicationIcon)` (the Hammerspoon app icon)
obj.image = hs.image.imageFromName(hs.image.systemImageNames.ApplicationIcon)
--- FadeLogo.image_size
--- Variable
--- `hs.geometry` object specifying the initial size of the image to display in the center of the screen. The image object will be resizes proportionally to fit in this size. Defaults to `hs.geometry.size(w=200, h=200)`
obj.image_size = hs.geometry.size(200, 200)
--- FadeLogo.image_alpha
--- Variable
--- Initial transparency of the image. Defaults to 1.0.
obj.image_alpha = 1.0
--- FadeLogo.zoom
--- Variable
--- Do zoom-and-fade if `true`, otherwise do a regular fade
obj.zoom = true
--- FadeLogo.fade_in_time
--- Variable
--- Number of seconds over which to fade in the image. Defaults to 0.3.
obj.fade_in_time = 0.3
--- FadeLogo.fade_out_time
--- Variable
--- Number of seconds over which to fade out the image. Defaults to 0.5.
obj.fade_out_time = 0.5
--- FadeLogo.run_time
--- Variable
--- Number of seconds to leave the image on the screen when `start()` is called.
obj.run_time = 2.0
--- FadeLogo.zoom_scale_factor
--- Variable
--- Factor by which to scale the image at every iteration during the zoom-and-fade. Defaults to 1.1.
obj.zoom_scale_factor = 1.1
--- FadeLogo.zoom_scale_timer
--- Variable
--- Seconds between the zooming iterations
obj.zoom_scale_timer = 0.01
----------------------------------------------------------------------
-- Internal variable to hold the canvas where the image is drawn
obj.canvas = nil
--- FadeLogo:delete()
--- Method
--- Hide and delete the canvas
function obj:delete()
if self.canvas then
self.canvas = self.canvas:delete()
end
end
--- FadeLogo:show()
--- Method
--- Display the image, fading it in over `fade_in_time` seconds
function obj:show()
if self.canvas then self:delete() end
local frame = hs.screen.mainScreen():frame()
local imgsz = self.image_size
self.canvas = hs.canvas.new(frame)
self.canvas[1] = {
type = 'image',
image = self.image,
frame = {
x = (frame.w - imgsz.w) / 2,
y = (frame.h - imgsz.h) / 2,
w = imgsz.w,
h = imgsz.h,
},
imageAlpha = self.image_alpha,
}
self.canvas:show(self.fade_in_time)
end
--- FadeLogo:hide()
--- Method
--- Hide the image without zoom, fading it out over `fade_out_time` seconds
function obj:hide()
self.canvas:hide(self.fade_out_time)
end
--- FadeLogo:zoom_and_fade()
--- Method
--- Zoom-and-fade the image over `fade_out_time` seconds
function obj:zoom_and_fade()
local canvas=self.canvas
local size=hs.geometry.new(canvas[1].frame)
-- This timer will zoom the image while it is fading
local timer
timer=hs.timer.doEvery(
self.zoom_scale_timer,
function()
if canvas:isShowing() then
size:scale(self.zoom_scale_factor)
canvas[1].frame = {x = size.x, y = size.y, w = size.w, h = size.h }
else
timer:stop()
timer = nil
self:delete()
end
end)
canvas:hide(self.fade_out_time)
end
--- FadeLogo:start()
--- Method
--- Show the image, wait `run_time` seconds, and then zoom-and-fade it out.
function obj:start(howlong)
if not howlong then howlong = self.run_time end
self:show()
obj._timer = hs.timer.doAfter(howlong, hs.fnutils.partial(self.zoom and self.zoom_and_fade or self.hide, self))
end
return obj
|
local tempKey = "tmp-key"
local cycles
redis.call("SET", tempKey, "1")
redis.call("PEXPIRE", tempKey, 10)
for i = 0; ARGV[1], 1 do
local isKeyExist = redis.call("EXISTS", tempKey)
cycles = i
if isKeyExist == 0 then
break;
end
end
return cycles
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.