content
stringlengths 5
1.05M
|
|---|
local bounds = require "lib.bounds"
local vector = require "lib.vector"
local entities = {}
function entities.getBounds (entity)
if not ((entity.minimum or entity.position) and entity.size) then
return nil
else
local min = entity.minimum or (entity.position - (entity.origin or vector.zero()))
local max = min + entity.size
return bounds.new{ min = min, max = max }
end
end
function entities.newWorld ()
local world = { _next = 1, population = {} }
function world:create(entity)
entity.id = self._next
self.population[entity.id] = entity
self._next = self._next + 1
return entity
end
function world:destroy (entity)
if not (type(entity) == 'table') or not entity.id then
error('not an entity')
elseif self.population[entity.id] ~= entity then
error('entity not in population')
else
self.population[entity.id] = nil
end
end
function world:each ()
return pairs(self.population)
end
function world:update (dt, env)
for id, entity in self:each() do
if entity.update then entity:update(dt, env) end
end
end
function world:draw (env)
for id, entity in self:each() do
if entity.draw then entity:draw(env) end
end
end
return world
end
return entities
|
memory = {}
function memory.initRam()
for address = 0, 0x007FF do
memory[address] = 0x0
end
end
function memory.get(address)
local controller1ReadTimes = 0
local controller2ReadTimes = 0
local byte = 0x0
::getaddress::
if address < 0x0800 then
byte = ram[address]
elseif address < 0x1000 then
byte = ram[address - 0x0800]
elseif address < 0x1800 then
byte = ram[address - 0x1000]
elseif address < 0x2000 then
byte = ram[address - 0x1800]
elseif address < 0x2008 then
byte = 0x0
print("ppu not implemented yet")
elseif address < 0x4000 then
address = 0x2000 + math.mod(address, 0x8)
goto getaddress
elseif address < 0x4018 then
if address == 0x4016 then
if controller1ReadTimes < 1 then
button = "a"
elseif controller1ReadTimes < 2 then
button = "b"
elseif controller1ReadTimes < 2 then
button = "select"
elseif controller1ReadTimes < 2 then
button = "start"
elseif controller1ReadTimes < 2 then
button = "up"
elseif controller1ReadTimes < 2 then
button = "down"
elseif controller1ReadTimes < 2 then
button = "left"
elseif controller1ReadTimes < 2 then
button = "right"
end
if input[button] then
byte = 0x1
end
end
elseif address < 0x4020 then
print("cpu is not in test mode, returning 0")
else
byte = cart[address - 0x4020]
end
return byte
end
|
local forest = {
seed=603020305,
mapcolor = "darkgreen",
minPercent = 10,
maxPercent = 100,
symbol = "f",
neighborBioms= {
"g"
}
}
function forest:createWorld()
end
function forest:getBiomChance(map,point)
local range = 100
biomCount = {}
-- < >
local sidx = point[1]-range/2
for iy = 1, point[1]-range/2 ,1 do
for ix = 1, point[2]-range/2, 1 do
if(biomCount[self.map[iy][ix]] == nil) then
biomCount[self.map[iy][ix]] = 0
end
biomCount[self.map[iy][ix]] = biomCount[self.map[iy][ix]]+1
end
end
local nextBiom = "f"
local percentage = biomCount/(range*range)
if (percentage > minPercent) then
math.randomseed(percentage)
local chance = math.random(1, 100)
if(chance >percentage ) then
math.randomseed(percentage)
local bIdx = math.random(1,#neighborBioms)
nextBiom = neighborBioms[bIdx]
end
end
return nextBiom
end
return forest
|
local Classifier, parent = torch.class('nn.SpatialClassifier', 'nn.Module')
function Classifier:__init(classifier)
parent.__init(self)
-- public:
self.classifier = classifier or nn.Sequential()
self.spatialOutput = true
-- private:
self.inputF = torch.Tensor()
self.inputT = torch.Tensor()
self.outputF = torch.Tensor()
self.output = torch.Tensor()
self.gradOutputF = torch.Tensor()
self.gradOutputT = torch.Tensor()
self.gradInputF = torch.Tensor()
self.gradInput = torch.Tensor()
-- compat:
self.modules = {self.classifier}
end
function Classifier:add(module)
self.classifier:add(module)
end
function Classifier:updateOutput(input)
-- get dims:
if input:nDimension() ~= 3 then
error('<nn.SpatialClassifier> input should be 3D: KxHxW')
end
local K = input:size(1)
local H = input:size(2)
local W = input:size(3)
local HW = H*W
-- transpose input:
self.inputF:set(input):resize(K, HW)
self.inputT:resize(HW, K):copy(self.inputF:t())
-- classify all locations:
self.outputT = self.classifier:updateOutput(self.inputT)
if self.spatialOutput then
-- transpose output:
local N = self.outputT:size(2)
self.outputF:resize(N, HW):copy(self.outputT:t())
self.output:set(self.outputF):resize(N,H,W)
else
-- leave output flat:
self.output = self.outputT
end
return self.output
end
function Classifier:updateGradInput(input, gradOutput)
-- get dims:
local K = input:size(1)
local H = input:size(2)
local W = input:size(3)
local HW = H*W
local N = gradOutput:size(1)
-- transpose input
self.inputF:set(input):resize(K, HW)
self.inputT:resize(HW, K):copy(self.inputF:t())
if self.spatialOutput then
-- transpose gradOutput
self.gradOutputF:set(gradOutput):resize(N, HW)
self.gradOutputT:resize(HW, N):copy(self.gradOutputF:t())
else
self.gradOutputT = gradOutput
end
-- backward through classifier:
self.gradInputT = self.classifier:updateGradInput(self.inputT, self.gradOutputT)
-- transpose gradInput
self.gradInputF:resize(K, HW):copy(self.gradInputT:t())
self.gradInput:set(self.gradInputF):resize(K,H,W)
return self.gradInput
end
function Classifier:accGradParameters(input, gradOutput, scale)
-- get dims:
local K = input:size(1)
local H = input:size(2)
local W = input:size(3)
local HW = H*W
local N = gradOutput:size(1)
-- transpose input
self.inputF:set(input):resize(K, HW)
self.inputT:resize(HW, K):copy(self.inputF:t())
if self.spatialOutput then
-- transpose gradOutput
self.gradOutputF:set(gradOutput):resize(N, HW)
self.gradOutputT:resize(HW, N):copy(self.gradOutputF:t())
else
self.gradOutputT = gradOutput
end
-- backward through classifier:
self.classifier:accGradParameters(self.inputT, self.gradOutputT, scale)
end
function Classifier:zeroGradParameters()
self.classifier:zeroGradParameters()
end
function Classifier:updateParameters(learningRate)
self.classifier:updateParameters(learningRate)
end
|
-- luacheck: push ignore 211 (unused variable)
--local api = vim.api
-- TODO(elpiloto): make debug level based on sidekick option.
--local log = require('plenary.log').new({ plugin = 'prompts.nvim', level='debug' })
-- luacheck: pop
loader = require('prompts.prompt_loader')
local M = {}
M.DATE_AND_EXTENSION = "date_and_extension"
M.VIMWIKI_FN = "vimwiki_fn"
local call_vimwiki_fn = function(fn_call)
local fn_call_cmd = ":echo " .. fn_call
local output = vim.api.nvim_exec(fn_call_cmd, true)
return output
end
M.is_diary_file = function(fname, method)
if method == M.DATE_AND_EXTENSION then
local date_ext_pattern = '%d%d%d%d%-%d%d%-%d%d%.(.*)$'
local ext_capture = string.match(fname, date_ext_pattern)
for _, valid_ext in pairs(vim.g.prompts_valid_diary_extensions) do
if ext_capture == valid_ext then
return true
end
end
return false
elseif method == M.VIMWIKI_FN then
local cmd = ":echom vimwiki#base#is_diary_file('" .. fname .. "')"
local is_diary = vim.api.nvim_exec(cmd, true)
return is_diary == "1"
end
end
local check_buffer_is_empty = function(buf_nr)
--todo set default value of 0 for buf_nr if not specified
-- 0 as bufnr gives current buffer
local num_lines = vim.api.nvim_buf_line_count(buf_nr)
if num_lines > 1 then
-- TODO(elpiloto): Prompt user to insert prompt at top line.
--print(tostring(num_lines))
print('Diary file has too many lines, cannot insert prompt.')
return
end
local buf_line = vim.api.nvim_buf_get_lines(buf_nr, 0, 1, false)
if buf_line[1]:gsub("^%s*(.-)%s*$", "%1") ~= '' then
return false
end
return true
end
M.add_prompt_if_empty = function()
local fname = vim.fn.expand("<afile>")
local new_buf_nr = vim.fn.expand("<abuf>")
local method = M.VIMWIKI_FN
if vim.g.prompts_manual_diary_check == 1 then
method = M.DATE_AND_EXTENSION
end
local is_diary = M.is_diary_file(fname, method)
local is_empty = check_buffer_is_empty(new_buf_nr)
if is_empty then
local prompts = loader.load_prompts()
local prompt = loader.choose_random_element(prompts)
vim.api.nvim_buf_set_lines(buf_nr, 0, 1, false, {prompt})
end
end
return M
|
math.randomseed(os.time())
local x = 1000
local y = 1000
local z = 1000
local k = math.min(3000, x * y * z)
io.output("randinput.txt")
io.write(string.format("%d %d %d %d\n", x, y, z, k))
do
local a = {}
for i = 1, x do
table.insert(a, math.random(10^10-1, 10^10))
end
io.write(table.concat(a, " "), "\n")
end
do
local a = {}
for i = 1, y do
table.insert(a, math.random(10^10-1, 10^10))
end
io.write(table.concat(a, " "), "\n")
end
do
local a = {}
for i = 1, z do
table.insert(a, math.random(10^10-1, 10^10))
end
io.write(table.concat(a, " "), "\n")
end
|
-- This file is part of the LrMediaWiki project and distributed under the terms
-- of the MIT license (see LICENSE.txt file in the project root directory or
-- [0]). See [1] for more information about LrMediaWiki.
--
-- Copyright (C) 2014 by the LrMediaWiki team (see CREDITS.txt file in the
-- project root directory or [2])
--
-- [0] <https://raw.githubusercontent.com/ireas/LrMediaWiki/master/LICENSE.txt>
-- [1] <https://commons.wikimedia.org/wiki/Commons:LrMediaWiki>
-- [2] <https://raw.githubusercontent.com/ireas/LrMediaWiki/master/CREDITS.txt>
-- Code status:
-- doc: missing
-- i18n: complete
return {
metadataFieldsForPhotos = {
{
id = 'description_en',
title = LOC '$$$/LrMediaWiki/Metadata/DescriptionEn=Description (en)',
dataType = 'string',
},
{
id = 'description_de',
title = LOC '$$$/LrMediaWiki/Metadata/DescriptionDe=Description (de)',
dataType = 'string',
},
{
id = 'description_additional',
title = LOC '$$$/LrMediaWiki/Metadata/DescriptionAdditional=Description (other)',
dataType = 'string',
},
{
id = 'templates',
title = LOC '$$$/LrMediaWiki/Metadata/Templates=Templates',
dataType = 'string',
},
{
id = 'categories',
title = LOC '$$$/LrMediaWiki/Metadata/Categories=Categories',
dataType = 'string',
},
},
schemaVersion = 3,
}
|
Content = nil
Type = nil
IsCut = false
Bedrock = nil
LastPaste = 0
function Initialise(self, bedrock)
local new = {} -- the new instance
setmetatable( new, {__index = self} )
new.Bedrock = bedrock
new.Bedrock:RegisterEvent('paste', function(bedrock, event, text)
Log.i('paste event!')
Log.i(text)
new.LastPaste = os.clock()
end)
return new
end
function Empty(self)
self.Content = nil
self.Type = nil
self.IsCut = false
end
function isEmpty(self)
return self.Content == nil
end
function Copy(self, content, _type)
self.Content = content
self.Type = _type or 'generic'
self.IsCut = false
end
function Cut(self, content, _type)
self.Content = content
self.Type = _type or 'generic'
self.IsCut = true
end
function Paste(self, callback)
-- This is to allow for the user's real OS clipboard to do it's thing first
self.Bedrock:StartTimer(function()
if self.LastPaste + 0.15 < os.clock() then
local c, t, is = self.Content, self.Type, self.IsCut
if self.IsCut then
self.Empty()
end
callback(c, t, is)
end
end, 0.2)
end
function PasteToActiveObject(self, bedrock)
bedrock = bedrock or self.Bedrock
local obj = bedrock:GetActiveObject()
if obj then
self:Paste(function(content, _type)
if type(content) == 'string' then
if obj.OnPaste then
obj:OnPaste('oneos_paste', content)
end
end
end)
end
end
|
return function()
local liter = require(game:GetService('ReplicatedStorage').liter)
it('should endlessly cycle through the array', function()
local iter = liter.array({ 5, 4, 3 }):cycle()
expect(iter:after()).to.equal(5)
expect(iter:after()).to.equal(4)
expect(iter:after()).to.equal(3)
expect(iter:after()).to.equal(5)
expect(iter:after()).to.equal(4)
expect(iter:after()).to.equal(3)
expect(iter:after()).to.equal(5)
expect(iter:after()).to.equal(4)
expect(iter:after()).to.equal(3)
end)
end
|
object_mobile_cts_sarlacc_s02 = object_mobile_shared_cts_sarlacc_s02:new {
}
ObjectTemplates:addTemplate(object_mobile_cts_sarlacc_s02, "object/mobile/cts_sarlacc_s02.iff")
|
--[[
Various utility functions for fake updater implementations.
]]
local type = type
local pairs = pairs
module "utils"
-- luacheck: globals map set2arr arr2set merge
--[[
Run a function for each key and value in the table.
The function shall return new key and value (may be
the same and may be modified). A new table with
the results is returned.
]]
function map(table, fun)
local result = {}
for k, v in pairs(table) do
local nk, nv = fun(k, v)
result[nk] = nv
end
return result
end
-- Convert a set to an array
function set2arr(set)
local idx = 0
return map(set, function (key)
idx = idx + 1
return idx, key
end)
end
function arr2set(arr)
return map(arr, function (_, name) return name, true end)
end
-- Add all elements of src to dest
function merge(dest, src)
for k, v in pairs(src) do
dest[k] = v
end
end
--[[
Make a deep copy of passed data. This does not work on userdata, on functions
(which might have some local upvalues) and metatables (it doesn't fail, it just
doesn't copy them and uses the original).
]]
function clone(data)
local cloned = {}
local function clone_internal(data)
if cloned[data] ~= nil then
return cloned[data]
elseif type(data) == "table" then
local result = {}
cloned[data] = result
for k, v in pairs(data) do
result[clone_internal(k)] = clone_internal(v)
end
return result
else
return data
end
end
return clone_internal(data)
end
-- Make a shallow copy of passed data structure. Same limitations as with clone.
function shallow_copy(data)
if type(data) == 'table' then
local result = {}
for k, v in pairs(data) do
result[k] = v
end
return result
else
return data
end
end
return _M
|
local mock = require('luassert.mock')
local buffer = require('vgit.buffer')
local it = it
local describe = describe
local after_each = after_each
local before_each = before_each
local eq = assert.are.same
local api = nil
describe('current', function()
before_each(function()
api = mock(vim.api, true)
api.nvim_get_current_buf.returns(5)
end)
after_each(function()
mock.revert(api)
end)
it(
'should call nvim_get_current_buf to retrieve the current buffer',
function()
eq(buffer.current(), 5)
assert.stub(api.nvim_get_current_buf).was_called_with()
end
)
end)
describe('is_valid', function()
before_each(function()
api = mock(vim.api, true)
api.nvim_buf_is_valid.returns(true)
api.nvim_buf_is_loaded.returns(true)
end)
after_each(function()
mock.revert(api)
end)
it(
'should call nvim_buf_is_valid and nvim_buf_is_loaded with correct arguments',
function()
eq(buffer.is_valid(1), true)
assert.stub(api.nvim_buf_is_valid).was_called_with(1)
assert.stub(api.nvim_buf_is_loaded).was_called_with(1)
end
)
end)
describe('get_lines', function()
before_each(function()
api = mock(vim.api, true)
api.nvim_buf_get_lines.returns({ 'foo', 'bar' })
end)
after_each(function()
mock.revert(api)
end)
it('should call nvim_buf_get_lines with correct arguments', function()
eq(buffer.get_lines(1), { 'foo', 'bar' })
assert.stub(api.nvim_buf_get_lines).was_called_with(1, 0, -1, false)
end)
it(
'should call nvim_buf_get_lines with specified start and end with correct arguments',
function()
eq(buffer.get_lines(1, 22, 33), { 'foo', 'bar' })
assert.stub(api.nvim_buf_get_lines).was_called_with(1, 22, 33, false)
end
)
end)
describe('set_lines', function()
before_each(function()
api = mock(vim.api, true)
api.nvim_buf_set_lines.returns()
end)
after_each(function()
mock.revert(api)
end)
it(
'should call nvim_buf_set_lines and nvim_buf_get_option with correct arguments',
function()
api.nvim_buf_get_option.returns(true)
buffer.set_lines(29, { 'foo', 'bar' })
assert.stub(api.nvim_buf_set_lines).was_called_with(
29,
0,
-1,
false,
{ 'foo', 'bar' }
)
assert.stub(api.nvim_buf_get_option).was_called_with(29, 'modifiable')
assert.stub(api.nvim_buf_set_option).was_not_called_with(
29,
'modifiable',
false
)
end
)
it(
'should call nvim_buf_set_lines, nvim_buf_get_option and nvim_buf_set_option with correct arguments',
function()
api.nvim_buf_get_option.returns(false)
buffer.set_lines(29, { 'foo', 'bar' })
assert.stub(api.nvim_buf_set_lines).was_called_with(
29,
0,
-1,
false,
{ 'foo', 'bar' }
)
assert.stub(api.nvim_buf_get_option).was_called_with(29, 'modifiable')
assert.stub(api.nvim_buf_set_option).was_called_with(
29,
'modifiable',
false
)
end
)
end)
describe('assign_options', function()
before_each(function()
api = mock(vim.api, true)
api.nvim_buf_set_option.returns()
end)
after_each(function()
mock.revert(api)
end)
it('should call nvim_buf_set_option with correct arguments', function()
local buf = 15
buffer.assign_options(buf, {
foo = 'bar',
bar = 'foo',
baz = 'jaz',
})
assert.stub(api.nvim_buf_set_option).was_called_with(buf, 'foo', 'bar')
assert.stub(api.nvim_buf_set_option).was_called_with(buf, 'bar', 'foo')
assert.stub(api.nvim_buf_set_option).was_called_with(buf, 'baz', 'jaz')
end)
end)
describe('add_keymap', function()
before_each(function()
api = mock(vim.api, true)
api.nvim_buf_set_keymap.returns()
end)
after_each(function()
mock.revert(api)
end)
it('should call nvim_buf_set_keymap with correct arguments', function()
local buf = 15
buffer.add_keymap(buf, '<enter>', '_rerender_history()')
assert.stub(api.nvim_buf_set_keymap).was_called_with(
buf,
'n',
'<enter>',
':lua require("vgit")._rerender_history()<CR>',
{
silent = true,
noremap = true,
}
)
end)
end)
|
-----------------------------------------
-- Spell: Comet
-- Deals dark damage to an enemy.
-- Successive use enhances spell potency.
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/magic")
-----------------------------------------
function onMagicCastingCheck(caster, target, spell)
return 0
end
function onSpellCast(caster, target, spell)
local spellParams = {}
spellParams.hasMultipleTargetReduction = false
spellParams.resistBonus = 1.0
spellParams.V0 = 1000
spellParams.V50 = 1200
spellParams.V100 = 1387
spellParams.V200 = 1737
spellParams.M0 = 4
spellParams.M50 = 3.75
spellParams.M100 = 3.5
spellParams.M200 = 3
return doElementalNuke(caster, spell, target, spellParams)
end
|
-----------------------------------------
-- ID: 5258
-- Item: Revive Feather
-- Status Effect: Reraise
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
return 0
end
function onItemUse(target)
local duration = 7200
target:delStatusEffect(tpz.effect.RERAISE)
target:addStatusEffect(tpz.effect.RERAISE, 1, 0, duration)
target:messageBasic(tpz.msg.basic.GAINS_EFFECT_OF_STATUS, tpz.effect.RERAISE)
end
|
--[[ 1. addon variables ]]
-- namespaces
GuildPanel = {};
GuildPanel.Permissions = {};
GuildPanel.MemberTable = {};
GuildPanel.currentMemberTable = {};
GuildPanel.RankList = {};
GuildPanel.helpers = {};
-- addon detail
GuildPanel.AddonVersion = "0.34";
GuildPanel.AddonAuthor = "Amiya";
GuildPanel.AddonName = "GuildPanel";
-- variables
GuildPanel.SelectedMember = {};
GuildPanel.ownRank = 0;
GuildPanel.onlineCount = 0;
GuildPanel.enabled = false;
GuildPanel.initDone = false;
GuildPanel.ResourceLoaded = false;
GuildPanel.ResourcePage = 0;
GuildPanel.currentCount = 0;
GuildPanel.updatePending = 0;
GuildPanel.nextUpdate = 30; -- initial value will catch more, later time is set to 15 sec.
GuildPanel.selectionLock = false;
GuildPanel.Settings = {
sortOrder = 2,
sortOnlineTop = 0,
lastRow = "rank",
showColors = 1,
showColorsOffline = 1,
colorType = "class",
showOnline = 1,
showOffline = 1,
showMIA = 1,
swapDruidWarden = 1,
swapDruidWardenRaid = 0,
showOffline = 1
};
-- number of entries in member list
GuildPanel_Length = 16;
numGuildMembers = GetNumGuildMembers();
local guildName, leaderName, _, alreadyCreate, maxMemberCount, guildScore, guildNotice, _,
_, _, _, guildLevel, _, _ = GetGuildInfo();
GuildPanel.Permissions["alreadyCreate"] = alreadyCreate;
--[[ language var init ]]
local gamelang = GetLanguage():upper();
local language = "";
if(gamelang == "DE") then
language = "de";
elseif(gamelang == "ENUS" or gamelang == "ENEU") then
language = "en";
elseif(gamelang == "ES") then
language = "es";
elseif(gamelang == "FR") then
language = "fr";
elseif(gamelang == "RU") then
language = "ru";
elseif(gamelang == "KR") then
language = "kr";
elseif(gamelang == "PL") then
language = "pl";
elseif(gamelang == "TW") then
language = "tw";
else
-- fallback
language = "en";
end;
dofile("Interface/AddOns/GuildPanel/locale/language."..language..".lua");
--[[ slash commands ]]
SLASH_GuildPanel1 = "/gp";
SLASH_GuildPanel2 = "/guildpanel";
SlashCmdList["GuildPanel"] = function(editBox, msg)
if(msg == "toggle") then
if(GuildPanel.enabled) then
GuildPanel.UnHook();
GuildPanel.SendMsg("|cff00ff00"..GuildPanel.locale["GP_Unloaded"]);
else
GuildPanel.Hook();
GuildPanel.SendMsg("|cff00ff00"..GuildPanel.locale["GP_Loaded"]);
end;
else
GuildPanelConfigFrame:Show();
end;
end;
--[[ 2. event handlers ]]
--[[ addon ]]
function GuildPanel_OnLoad(frame)
-- config and init
frame:RegisterEvent("VARIABLES_LOADED");
frame:RegisterEvent("LOADING_END");
frame:RegisterEvent("SAVE_VARIABLES");
-- list updates
--frame:RegisterEvent("UPDATE_GUILD_INFO");
--frame:RegisterEvent("UPDATE_GUILD_MEMBER");
--frame:RegisterEvent("UPDATE_GUILD_MEMBER_INFO");
frame:RegisterEvent("GUILD_INVITE_REQUEST");
frame:RegisterEvent("GUILD_KICK");
-- war frames, not registered here, they have their own frame
-- frame:RegisterEvent("GUILDHOUSEWAR_STATE_CHANGE");
-- frame:RegisterEvent("GUILDHOUSEWAR_INFOS_UPDATE");
-- leader change
frame:RegisterEvent("GUILD_ASK_LEADERCHANGE");
frame:RegisterEvent("GUILD_ASK_LEADERCHANGE_RESULT");
SaveVariables("GuildPanel_SavedSettings");
end;
--[[ load addon ]]--
function GuildPanel.Initialize()
if(GuildPanel.InitDone) then return end;
-- check for guild
if(numGuildMembers < 1) then
-- we're inactive
GuildPanel.active = false;
GuildPanel.SendMsg("|cff00ff00"..GuildPanel.locale["GP_LoadedInactive"].." (v"..GuildPanel.AddonVersion..")");
else
-- hook guild frame
GuildPanel.Hook();
GuildPanel.active = true;
if not AddonManager then
-- show message only without addon manager
GuildPanel.SendMsg("|cff00ff00"..GuildPanel.locale["GP_Loaded"].." (v"..GuildPanel.AddonVersion..")");
end;
end;
GuildPanel.InitDone = true;
end;
-- create hooks
function GuildPanel.Hook()
--[[ hook UI display function for guild panel ]]
GuildPanel.ToggleUIFrame = ToggleUIFrame;
GuildPanel.GF_SortName = GuildFrame_sortOpName;
function ToggleUIFrame(frame)
if(frame == GuildFrame) then frame = GuildPanelFrame; end;
GuildPanel.ToggleUIFrame(frame);
end;
-- sort: 1) is match, then: 2) alphabetical
function GuildFrame_sortOpName(m1,m2)
-- wtf?
if(m1 == nil or m2 == nil) then return false end;
if(GuildPanel.SelectedMember["name"] == m1.name) then return true end;
return GuildPanel.GF_SortName(m1,m2);
end;
-- initialize original game frames
local success,errmsg = pcall(GuildPanel.InitGameFrames);
if not success then
GuildPanel.SendMsg("|cffbbbbbbGuildPanel - FrameInit: "..errmsg); -- should never happen
end;
GuildPanel.enabled = true;
GuildPanel.InitList();
end;
function GuildPanel.InitGameFrames()
-- initialize original game frames
GuildFrame.class.sort = 1;
GuildFrame.class.SortT = 0;
GuildFrame.class:UpDate();
GuildFrame.class.TotalMember = numGuildMembers; -- workaround, this is otherwise not available here
GuildLeaderFrame:SetParent(UIParent);
GuildLeaderFrame.class:LoadDate();
GuildBoardFrame:SetParent(UIParent);
GuildBoardFrame_OnShow(GuildBoardFrame);
GuildWarFrame:SetParent(UIParent);
GuildOutdoorsWarFrame_OnShow(GuildOutdoorsWarFrame);
GuildFrame:UnregisterEvent("UPDATE_GUILD_MEMBER");
GuildFrame:UnregisterEvent("UPDATE_GUILD_MEMBER_INFO");
GuildFrame:UnregisterEvent("GUILD_INVITE_REQUEST");
GuildFrame:UnregisterEvent("GUILD_KICK");
GuildFrame:UnregisterEvent( "UPDATE_GUILD_INFO" );
GuildFrame:UnregisterEvent("GUILDINVITE_SELF");
GuildFrame:UnregisterEvent("ZONE_CHANGED");
GuildFrame:UnregisterEvent("GUILD_ASK_LEADERCHANGE");
GuildFrame:UnregisterEvent("GUILD_ASK_LEADERCHANGE_RESULT");
GuildFrame:UnregisterEvent("GUILDHOUSEWAR_STATE_CHANGE");
GuildFrame:UnregisterEvent("GUILDHOUSEWAR_INFOS_UPDATE");
end;
--[[ unload addon ]]--
function GuildPanel.UnHook()
-- return game frames to their original state
GuildLeaderFrame:SetParent(GuildFrame);
GuildBoardFrame:SetParent(GuildFrame);
GuildWarFrame:SetParent(GuildFrame);
-- return default frame hook
ToggleUIFrame = GuildPanel.ToggleUIFrame;
GuildPanel.enabled = false;
end;
function GuildPanel.CheckPendingUpdates(elapsedTime)
if(GuildPanel.updatePending == 0) then return end;
GuildPanel.nextUpdate = GuildPanel.nextUpdate - elapsedTime;
if(GuildPanel.nextUpdate > 0) then
return
end;
GuildPanel.updatePending = 0;
GuildPanel.nextUpdate = 15;
GuildPanel_OnShow(GuildPanelFrame);
end;
--[[ event handler ]]
function GuildPanel_OnEvent(frame,event)
if(event == "VARIABLES_LOADED") then
if(GuildPanel_SavedSettings) then
for k,v in pairs(GuildPanel.Settings) do
if(GuildPanel_SavedSettings[k] ~= nil) then
GuildPanel.Settings[k] = GuildPanel_SavedSettings[k];
end;
end;
end;
-- register with addon manager
if AddonManager then
local addon =
{
name = "|cffE6FF05"..GuildPanel.AddonName.."|r",
description = GuildPanel.locale.GP_Description,
category = "Interface",
version = "|cffE6FF05 "..GuildPanel.AddonVersion.."|r",
author = GuildPanel.AddonAuthor,
icon = "Interface/Addons/GuildPanel/resources/icon.tga",
configFrame = GuildPanelConfigFrame,
slashCommands = SLASH_GuildPanel2,
}
if AddonManager.RegisterAddonTable then
AddonManager.RegisterAddonTable(addon)
else
AddonManager.RegisterAddon(addon.name, addon.description, addon.icon, addon.category, addon.configFrame, addon.slashCommands, addon.miniButton, addon.onClickScript)
end
end
g_ClassColors["WARDEN_ORIG"] = g_ClassColors["WARDEN"];
g_ClassColors["DRUID_ORIG"] = g_ClassColors["DRUID"];
-- trigger our druid/warden switch for the raidframe
if(GuildPanel.Settings["swapDruidWardenRaid"] == 1) then
g_ClassColors["WARDEN"] = g_ClassColors["DRUID_ORIG"];
g_ClassColors["DRUID"] = g_ClassColors["WARDEN_ORIG"];
end;
elseif(event == "UPDATE_GUILD_INFO" or event == "GUILD_INVITE_REQUEST" or event == "GUILD_KICK") then
if GuildPanel.active then
GuildPanel.InitList();
end;
-- warning: this will fire a lot on game starts
elseif(event == "UPDATE_GUILD_MEMBER" or event == "UPDATE_GUILD_MEMBER_INFO") then
if GuildPanel.active then
GuildPanel.updatePending = GuildPanel.updatePending + 1;
end;
elseif(event == "GUILD_ASK_LEADERCHANGE") then
StaticPopup_Show("GUILD_ASK_LEADERCHANGE",arg1);
elseif(event == "GUILD_ASK_LEADERCHANGE_RESULT") then
StaticPopup_Show("GUILD_ASK_LEADERCHANGE_RESULT",arg1);
elseif(event == "SAVE_VARIABLES") then
GuildPanel_SavedSettings = GuildPanel.Settings;
elseif(event == "LOADING_END") then
GuildPanel.Initialize();
end;
end;
--[[ show main frame ]]
function GuildPanel_OnShow(frame)
numGuildMembers = GetNumGuildMembers();
guildName, leaderName, _, _, maxMemberCount, guildScore, guildNotice, _, _, _, _, guildLevel = GetGuildInfo();
GuildPanel_MemberListSlider:SetValueStepMode("INT");
GuildPanel_MemberListSlider:SetMinValue(1);
GuildPanel_MemberListSlider:SetMaxValue(1);
GuildPanel_MemberListSlider:SetValue(1);
-- init addon lists
GuildPanel.InitList();
GuildPanel.InitRanks();
GuildPanel.InitPermissions();
GuildPanel_Sort(GuildPanel.Settings["sortOrder"]);
UIDropDownMenu_Initialize(GuildPanel_Dropdown, GuildPanel_Dropdown_Show);
UIDropDownMenu_SetSelectedID(GuildPanel_Dropdown, GuildPanel.Settings["sortOrder"]);
GuildPanelFrame_Title:SetText(string.format(GuildPanel.locale["MainTitleText"],guildName,GuildPanel.onlineCount,numGuildMembers,maxMemberCount,guildLevel,leaderName));
GuildPanel_MemberListTitle:SetText(GuildPanel.locale["MemberList"]);
GuildPanel_GuildNotice:SetText(guildNotice);
GuildPanelFrame_ButtonToMembers:SetText(GuildPanel.locale["MemberList"]);
GP_Button_ToGPConfig:SetText(GuildPanel.locale["Config_Name"])
GuildPanel_Dropdown_Title:SetText(GuildPanel.locale["SortTitle"]);
GuildPanelConfig_ShowOffline_Text:SetText(GuildPanel.locale["OfflineDesc"]);
if(GuildPanel.Settings["showOffline"] == 1) then
GuildPanelConfig_ShowOffline:SetChecked(true);
else
GuildPanelConfig_ShowOffline:SetChecked(false);
end;
-- disable scroll buttons first
getglobal("GuildPanel_MemberListSlider".."ScrollUpButton"):Disable();
getglobal("GuildPanel_MemberListSlider".."ScrollDownButton"):Disable();
-- create list entry
GuildPanel.PopulateList();
GuildPanel.CheckScrollPosition("GuildPanel_MemberListSlider");
-- hide buttons without permissions
if(not GuildPanel.Permissions["leader"]) then
GP_Button_Leader:Hide();
else
GP_Button_Leader:Show();
end;
if(not GuildPanel.Permissions["invite"]) then
GP_Button_Add:Hide();
else
GP_Button_Add:Show();
end;
end;
--[[ member selected ]]
function GuildPanel_MemberList_OnClick(button,key)
-- cancel when GuildFrame is in locked mode (while showing some StaticPopups)
if(GuildPanel.selectionLock == true) then return end;
GuildPanel.SelectedMember = GuildPanel.currentMemberTable[button.id];
SetGuildRosterSelection(GuildPanel.SelectedMember["index"]);
local note = "";
if(GuildPanel.SelectedMember["guildNote"] ~= nil and GuildPanel.SelectedMember["guildNote"] ~= "") then
note = " - "..GuildPanel.SelectedMember["guildNote"];
else
note = "";
end;
getglobal("GuildPanelFrame_SelectedMember_Content"):SetText(GuildPanel.SelectedMember["name"]..note);
getglobal("GuildPanelFrame_SelectedMember_Content2"):SetText(GuildPanel.SelectedMember["rankname"]);
if (key=="RBUTTON") then
UIDropDownMenu_SetAnchor(GP_Frame_Menu, 20, 0, "TOP", "CENTER", button);
ToggleDropDownMenu(GP_Frame_Menu);
else
CloseDropDownMenus();
end
end;
--[[ this will change the scroll bar value when somebody scrolls ]]
function GuildPanel_MemberList_OnMouseWheel(slider,delta)
if (delta > 0) then
slider:SetValue(slider:GetValue() - 1);
else
slider:SetValue(slider:GetValue() + 1);
end
end;
--[[ scroll bar value change: adjust list items]]
function GuildPanel_MemberList_OnValueChanged(frame,arg1)
local val = frame:GetValue();
GuildPanel.PopulateList();
GuildPanel.CheckScrollPosition("GuildPanel_MemberListSlider");
end;
--[[ panel functions ]]--
function GuildPanel.PopulateList()
local x,y = 9,13;
local num = 1;
local from = getglobal("GuildPanel_MemberListSlider"):GetValue();
local to = from + GuildPanel_Length - 1;
local fields = {"Name","Classes","Levels","Status","RankNote"};
-- check if we want to show more than possible
if(to > GuildPanel.currentCount) then to = GuildPanel.currentCount; end;
-- populate buttons
for i = from, to, 1 do
local member = GuildPanel.currentMemberTable[i];
local memberstatus, lastrow;
framename = "GuildPanel_MemberList_Member_"..num;
if(member["isOnline"] == 1) then
memberstatus = member["currentZone"];
else
memberstatus = member["logoutString"];
end;
if(GuildPanel.Settings["lastRow"] == "note") then
lastrow = member["guildNote"];
else
lastrow = member["rankname"];
end;
--[[ coloring ]]
local r,g,b = 1,1,1;
if(GuildPanel.Settings["showColors"] == 1) then
if(GuildPanel.Settings["showColorsOffline"] == 1 or member["isOnline"] == 1) then
-- online or overriden by setting
if(GuildPanel.Settings["colorType"] == "rank") then
r,g,b = GuildPanel.GetRankColor(member["rank"]);
end;
if(GuildPanel.Settings["colorType"] == "class") then
r,g,b = GuildPanel.GetClassColor(member["class"]);
end;
else
-- offline
r,g,b = 0.6,0.6,0.6;
end;
else
-- no specific coloring
if(member["isOnline"] == 1) then
r,g,b = 1,1,1;
else
r,g,b = 0.6,0.6,0.6;
end;
end;
--[[ end colors ]]
for k,v in ipairs(fields) do
getglobal(framename.."_"..v):SetColor(r,g,b);
end;
btn = getglobal(framename);
getglobal(framename.."_Name"):SetText(member["name"]);
getglobal(framename.."_Classes"):SetText(member["classCom"]);
getglobal(framename.."_Levels"):SetText(member["levelCom"]);
getglobal(framename.."_Status"):SetText(memberstatus);
getglobal(framename.."_RankNote"):SetText(lastrow);
btn.memberid = member["index"];
btn.id = i;
btn.num = num;
btn:ClearAllAnchors();
btn:SetAnchor("TOPLEFT", "TOPLEFT", "GuildPanel_MemberList", x, (21 * num) + y);
btn:Show();
num = num + 1;
end;
if(num < GuildPanel_Length) then
-- hide empty fields
for i = num, GuildPanel_Length do
getglobal("GuildPanel_MemberList_Member_"..i):Hide();
end;
end;
end;
--[[ check for scroll buttons: disable/enable ]]
function GuildPanel.CheckScrollPosition(this)
local scrollbar = getglobal(this);
local currentval = scrollbar:GetValue();
local minval,maxval = scrollbar:GetMinMaxValues();
-- Check for list end
if (currentval == maxval) then
getglobal(this.."ScrollDownButton"):Disable();
else
getglobal(this.."ScrollDownButton"):Enable();
end
-- check for list start
if (currentval == 1) then
getglobal(this.."ScrollUpButton"):Disable();
else
getglobal(this.."ScrollUpButton"):Enable();
end
-- check for list length below border
--if (maxval <= GuildPanel_Length) then
-- getglobal(this.."ScrollDownButton"):Disable();
-- getglobal(this.."ScrollUpButton"):Disable();
--end
end
--[[ init member list ]]
function GuildPanel.InitList()
GuildPanel.currentCount = 0;
GuildPanel.onlineCount = 0;
GuildPanel.currentMemberTable = {};
GF_ReadAllDate();
if(type(numGuildMembers) ~= "number" or numGuildMembers < 1) then return; end;
for i = 1, numGuildMembers, 1 do
-- online status
-- SetGuildRosterSelection(i);
local a,b,c,d,e,f,g,h,j,k,l,m,n,o = GetGuildRosterInfo(i);
local classCombination = tostring(c);
local levelCombination = tostring(d);
if(e~="") then classCombination = classCombination.." / "..tostring(e); end;
if(f > 0) then levelCombination = levelCombination.." / "..tostring(f); end;
if(m == "??:??:??") then m = "99:99:99"; end;
if(UnitName("player") == a) then
GuildPanel.ownRank = b;
end;
if(l) then GuildPanel.onlineCount = GuildPanel.onlineCount + 1; end;
local p,r = GuildPanel.helpers.ParseTime(m);
GuildPanel.MemberTable[i] = {
name = a,
rank = b,
rankname = GF_GetRankStr(b),
class = c,
level = d,
subClass = e,
subLevel = f,
isHeader = g and 1 or 0,
isCollapsed = h and 1 or 0,
dbid = j,
guildTitle = k,
isOnline = l and 1 or 0,
logoutTime = m,
currentZone = n,
guildNote = o,
levelCom = levelCombination,
classCom = classCombination,
index = i,
logoutSort = p,
logoutString = r
}
if(GuildPanel.MemberTable[i]["isOnline"] == 1 or GuildPanel.Settings["showOffline"] == 1) then
GuildPanel.currentCount = GuildPanel.currentCount + 1;
GuildPanel.currentMemberTable[GuildPanel.currentCount] = GuildPanel.MemberTable[i];
end;
end;
local slideMax = 1;
-- set values for slider ( 16 members, slideMax = 1; 18 members, slideMax = 3; etc...)
if(GuildPanel.currentCount > GuildPanel_Length) then slideMax = GuildPanel.currentCount - GuildPanel_Length + 1; end;
GuildPanel_MemberListSlider:SetMaxValue(slideMax);
end;
-- [[ load all guild ranks and their permissions ]]
function GuildPanel.InitRanks()
--local rankCount = GF_GetRankCount();
local rankCount = 10;
for i = 1, rankCount, 1 do
local t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 = GF_GetRankInfo(i);
local rname = GF_GetRankStr(i);
if(rname ~= nil and rname ~= "") then
GuildPanel.RankList[i] = {
recruit = t1,
kick = t2,
changerank = t3,
changenote = t4,
announce = t5,
guildboard = t6,
gbmanage = t7,
castle = t8,
placeinventory = t9,
unknown = t10,
rankname = rname
}
end;
end;
end;
--[[ call this only when InitList and InitRanks are done at least once]]--
function GuildPanel.InitPermissions()
local bKick,bInvite,bNote,bPost,bBBSManage,bLeader = GF_GetGuildFunc();
GuildPanel.Permissions["kick"] = bKick;
GuildPanel.Permissions["invite"] = bInvite;
GuildPanel.Permissions["note"] = bNote;
GuildPanel.Permissions["post"] = bPost;
GuildPanel.Permissions["board"] = bBBSManage;
GuildPanel.Permissions["leader"] = bLeader;
if(GuildPanel.ownRank > 0) then
GuildPanel.Permissions["rank"] = GuildPanel.RankList[GuildPanel.ownRank]["changerank"];
end;
end;
function GuildPanel.GetRankColor(rank)
if rank == 10 then
return .8,0,0;
elseif rank == 9 then
return .8,.4,0;
elseif rank == 8 then
return .8,.4,.4;
elseif rank == 7 then
return .8,.8,.4;
elseif rank == 6 then
return .4,.8,.8;
elseif rank == 5 then
return .4,.4,.8;
elseif rank == 4 then
return .4,.8,.4;
elseif rank == 3 then
return 0,.8,.8;
elseif rank == 2 then
return 0,.4,.8;
elseif rank == 1 then
return 0,.8,.4;
else
return 1,1,1;
end;
end;
function GuildPanel.GetClassColor(class)
-- modified version of pbInfo addon function
-- by p.b. a.k.a. novayuna
-- released under the Creative Commons License By-Nc-Sa: http://creativecommons.org/licenses/by-nc-sa/3.0/
local ctable = {
[GetSystemString("SYS_CLASSNAME_WARRIOR")] = {r = 1, g = 0, b = 0},
[GetSystemString("SYS_CLASSNAME_RANGER")] = {r = 0.65, g = 0.84, b = 0.01},
[GetSystemString("SYS_CLASSNAME_THIEF")] = {r = 0, g = 0.84, b = 0.77},
[GetSystemString("SYS_CLASSNAME_MAGE")] = {r = 1, g = 0.75, b = 0},
[GetSystemString("SYS_CLASSNAME_AUGUR")] = {r = 0.04, g = 0.55, b = 0.93},
[GetSystemString("SYS_CLASSNAME_KNIGHT")] = {r = 1, g = 1, b = 0.28},
[GetSystemString("SYS_CLASSNAME_WARDEN")] = {r = 0.757 , g = 0.290 , b = 0.819},
[GetSystemString("SYS_CLASSNAME_DRUID")] = {r = 0.380 , g = 0.819 , b = 0.378},
[GetSystemString("SYS_CLASSNAME_HARPSYN")] = {r = 0.38, g = 0.17, b = 0.91},
[GetSystemString("SYS_CLASSNAME_PSYRON")] = {r = 0.19, g = 0.15, b = 0.95},
[GetSystemString("SYS_CLASSNAME_GM")] = {r = 1, g = 1, b = 1},
["WARDEN_TMP"] = {r = 0.757 , g = 0.290 , b = 0.819},
["DRUID_TMP"] = {r = 0.380 , g = 0.819 , b = 0.378}
};
if(GuildPanel.Settings["swapDruidWarden"] == 1) then
ctable[GetSystemString("SYS_CLASSNAME_WARDEN")] = ctable["DRUID_TMP"];
ctable[GetSystemString("SYS_CLASSNAME_DRUID")] = ctable["WARDEN_TMP"];
else
ctable[GetSystemString("SYS_CLASSNAME_WARDEN")] = ctable["WARDEN_TMP"];
ctable[GetSystemString("SYS_CLASSNAME_DRUID")] = ctable["DRUID_TMP"];
end;
-- end extract pbInfo
if(type(ctable[class]) == "table") then
return ctable[class]["r"],ctable[class]["g"],ctable[class]["b"];
else
return 1,1,1;
end;
end;
--[[ reload the guild member list at its current position]]
function GuildPanel.ReloadList()
local val = GuildPanel_MemberListSlider:GetValue();
GuildPanel.InitList();
GuildPanel_Sort(GuildPanel.Settings["sortOrder"]);
GuildPanel.PopulateList();
GuildPanel_MemberListSlider:SetValue(val);
GuildPanel.CheckScrollPosition("GuildPanel_MemberListSlider");
end;
--[[ Dropdown functions ]]--
--[[ load dropdown ]]--
function GuildPanel_Dropdown_Onload(this)
UIDropDownMenu_SetWidth(this, 92);
UIDropDownMenu_Initialize(this, GuildPanel_Dropdown_Show);
UIDropDownMenu_SetSelectedID(this, GuildPanel.Settings["sortOrder"]);
end;
--[[ init dropdown values ]]
function GuildPanel_Dropdown_Show()
local info = {};
local clickfunc = GuildPanel_Dropdown_Click;
info[1] = { value = 1, text = GuildPanel.locale["dropdown_name"], func = clickfunc };
info[2] = { value = 2, text = GuildPanel.locale["dropdown_online"], func = clickfunc };
info[3] = { value = 3, text = GuildPanel.locale["dropdown_zone"], func = clickfunc };
info[4] = { value = 4, text = GuildPanel.locale["dropdown_rank"], func = clickfunc };
info[5] = { value = 5, text = GuildPanel.locale["dropdown_level"], func = clickfunc };
info[6] = { value = 6, text = GuildPanel.locale["dropdown_class"], func = clickfunc };
for i,v in ipairs(info) do UIDropDownMenu_AddButton(v) end;
end;
--[[ dropdown click handler ]]
function GuildPanel_Dropdown_Click(button)
GuildPanel.Settings["sortOrder"] = button.value;
GuildPanel_Sort(GuildPanel.Settings["sortOrder"]);
-- Liste neu initialisieren
GuildPanel.PopulateList();
UIDropDownMenu_SetSelectedID(GuildPanel_Dropdown, GuildPanel.Settings["sortOrder"]);
end;
--[[ sort function ]]
function GuildPanel_Sort(field)
--[[
1 = name
2 = online
3 = zone
4 = rank
5 = level
6 = class
]]
if(field == 1) then
table.sort(GuildPanel.currentMemberTable,GuildPanel.helpers.SortName);
elseif(field == 2) then
table.sort(GuildPanel.currentMemberTable,GuildPanel.helpers.SortOnline);
elseif(field == 3) then
table.sort(GuildPanel.currentMemberTable,GuildPanel.helpers.SortZone);
elseif(field == 4) then
table.sort(GuildPanel.currentMemberTable,GuildPanel.helpers.SortRank);
elseif(field == 5) then
table.sort(GuildPanel.currentMemberTable,GuildPanel.helpers.SortLevel);
elseif(field == 6) then
table.sort(GuildPanel.currentMemberTable,GuildPanel.helpers.SortClass);
end;
if(field > 0) then
GuildPanel_MemberListSlider:SetValue(1);
end;
end;
|
class 'RotationHelper'
-- local m_Logger = Logger("RotationHelper", false)
--YPR: yaw, pitch, roll
--LUF: left, up, forward
--LT: LinearTransform
function RotationHelper:GetYawfromForward(forward)
return math.atan(forward.x, forward.z) + math.pi
end
function RotationHelper:GetYPRfromLUF(left, up, forward)
-- Reference: http://www.jldoty.com/code/DirectX/YPRfromUF/YPRfromUF.html
-- Special case, forward is (0,1,0) or (0,-1,0)
if forward.x == 0 and forward.z == 0 then
local yaw = 0
local pitch = forward.y * math.pi/2
local roll = math.asin(-up.x)
return yaw, pitch, roll
end
-- Ranges: (0, 2*PI)
local pitch = math.asin(-forward.y) + math.pi
local yaw = math.atan(forward.x,forward.z) + math.pi
local roll = math.pi
local y = Vec3(0,1,0)
-- r0 is the right vector before pitch rotation
local r0 = Vec3(0,0,0)
local r1 = y:Cross(forward)
-- Normalizing r0
local mod_r1 = math.sqrt(r1.x^2 + r1.y^2 + r1.z^2)
r0.x = r1.x / mod_r1
r0.y = r1.y / mod_r1
r0.z = r1.z / mod_r1
-- u0 is the up vector before pitch rotation
local u0 = forward:Cross(r0)
local cosPitch = u0:Dot(up)
if r0.x > r0.y and r0.x > r0.z and r0.x ~= 0 then
roll = roll + math.asin( (u0.x * cosPitch - up.x) / r0.x)
elseif r0.y > r0.x and r0.y > r0.z and r0.y ~= 0 then
roll = roll + math.asin( (u0.y * cosPitch - up.y) / r0.y)
elseif r0.z > r0.x and r0.z > r0.y and r0.z ~= 0 then
roll = roll + math.asin( (u0.z * cosPitch - up.z) / r0.z)
else
if r0.x ~= 0 then
roll = roll + math.asin( (u0.x * cosPitch - up.x) / r0.x)
elseif r0.y ~= 0 then
roll = roll + math.asin( (u0.y * cosPitch - up.y) / r0.y)
elseif r0.z ~= 0 then
roll = roll + math.asin( (u0.z * cosPitch - up.z) / r0.z)
else
-- m_Logger:Write("All denominators are 0, something went wrong")
print("All denominators are 0, something went wrong")
end
end
return self:AdjustRangeRad(yaw), self:AdjustRangeRad(pitch), self:AdjustRangeRad(roll)
end
function RotationHelper:GetLUFfromYPR(yaw, pitch, roll)
-- Reference: http://planning.cs.uiuc.edu/node102.html
local fx = math.sin(yaw)*math.cos(pitch)
local fy = math.sin(pitch)
local fz = math.cos(yaw)*math.cos(pitch)
local forward = Vec3(fx, fy, fz)
local ux = -(math.sin(yaw)*math.sin(pitch)*math.cos(roll) + math.cos(yaw)*math.sin(roll))
local uy = math.cos(pitch)*math.cos(roll)
local uz = -(math.cos(yaw)*math.sin(pitch)*math.cos(roll) - math.sin(yaw)*math.sin(roll))
local up = Vec3(ux, uy, uz)
local left = forward:Cross(Vec3(up.x * -1, up.y * -1, up.z * -1))
return left, up, forward
end
--------------Linear Transform variants-------
function RotationHelper:GetYPRfromLT(linearTransform)
if linearTransform.typeInfo.name == nil or linearTransform.typeInfo.name ~= "LinearTransform" then
-- m_Logger:Write("Wrong argument, expected LinearTransform")
print("Wrong argument, expected LinearTransform")
return
end
local yaw, pitch, roll = self:GetYPRfromRUF(
linearTransform.left,
linearTransform.up,
linearTransform.forward
)
return self:AdjustRangeRad(yaw), self:AdjustRangeRad(pitch), self:AdjustRangeRad(roll)
end
function RotationHelper:GetLTfromYPR(yaw, pitch, roll)
local left, up, forward = self:GetLUFfromYPR(yaw, pitch, roll)
return LinearTransform(left, up, forward, Vec3(0,0,0) )
end
function RotationHelper:AdjustRangeRad(angle)
if angle > 2 * math.pi then
return angle - 2 * math.pi
elseif angle < 0 then
return angle + 2 * math.pi
end
return angle
end
return RotationHelper
|
--[=[
@client
@class PlayerProductManagerClient
]=]
local require = require(script.Parent.loader).load(script)
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local PlayerProductManagerBase = require("PlayerProductManagerBase")
local PlayerProductManagerConstants = require("PlayerProductManagerConstants")
local GameConfigServiceClient = require("GameConfigServiceClient")
local PlayerProductManagerClient = setmetatable({}, PlayerProductManagerBase)
PlayerProductManagerClient.ClassName = "PlayerProductManagerClient"
PlayerProductManagerClient.__index = PlayerProductManagerClient
require("PromiseRemoteEventMixin"):Add(PlayerProductManagerClient, PlayerProductManagerConstants.REMOTE_EVENT_NAME)
function PlayerProductManagerClient.new(obj, serviceBag)
local self = setmetatable(PlayerProductManagerBase.new(obj), PlayerProductManagerClient)
self._serviceBag = assert(serviceBag, "No serviceBag")
self._gameConfigServiceClient = self._serviceBag:GetService(GameConfigServiceClient)
if self._obj == Players.LocalPlayer then
self:PromiseRemoteEvent():Then(function(remoteEvent)
self:_setupRemoteEventLocal(remoteEvent)
end)
end
return self
end
function PlayerProductManagerClient:_setupRemoteEventLocal(remoteEvent)
-- Gear and other assets
self._maid:GiveTask(MarketplaceService.PromptPurchaseFinished:Connect(function(player, assetId, isPurchased)
if player == self._obj then
remoteEvent:FireServer(PlayerProductManagerConstants.NOTIFY_PROMPT_FINISHED, assetId, isPurchased)
end
end))
-- Products
self._maid:GiveTask(MarketplaceService.PromptProductPurchaseFinished:Connect(function(userId, assetId, isPurchased)
if self._obj.UserId == userId then
remoteEvent:FireServer(PlayerProductManagerConstants.NOTIFY_PROMPT_FINISHED, assetId, isPurchased)
end
end))
-- Gamepasses
self._maid:GiveTask(MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, isPurchased)
if player == self._obj then
remoteEvent:FireServer(PlayerProductManagerConstants.NOTIFY_GAMEPASS_FINISHED, gamePassId, isPurchased)
end
end))
end
-- For overrides
function PlayerProductManagerClient:GetConfigPicker()
return self._gameConfigServiceClient:GetConfigPicker()
end
return PlayerProductManagerClient
|
dofile(minetest.get_modpath("techtest") .. "/beeswax.lua")
dofile(minetest.get_modpath("techtest") .. "/aluminum.lua")
dofile(minetest.get_modpath("techtest") .. "/pyrite.lua")
dofile(minetest.get_modpath("techtest") .. "/matches.lua")
dofile(minetest.get_modpath("techtest") .. "/gems.lua")
minetest.register_craftitem("techtest:carrot_fruit_snacks", {
description = "Carrot Fruit Snacks",
inventory_image = "carrot.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "techtest:carrot_fruit_snacks",
recipe = {
{"bonemeal:gelatain_powder", "bucket:bucket_water"},
{"farming:carrot", ""}
},
replacements={{'bucket:bucket_water','bucket:bucket_empty'}}
})
minetest.register_craftitem("techtest:blueberry_fruit_snacks", {
description = "Blueberry Fruit Snacks",
inventory_image = "blueberry.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
output = "techtest:blueberry_fruit_snacks",
recipe = {
{"bonemeal:gelatain_powder", "bucket:bucket_water"},
{"farming:blueberry", ""},
},
replacements={{'bucket:bucket_water','bucket:bucket_empty'}}
})
minetest.register_craftitem("techtest:raspberry_fruit_snacks", {
description = "Raspberry Fruit Snacks",
inventory_image = "raspberry.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
output = "techtest:raspberry_fruit_snacks",
recipe = {
{"bonemeal:gelatain_powder", "bucket:bucket_water"},
{"farming:raspberry", ""},
},
replacements={{'bucket:bucket_water','bucket:bucket_empty'}}
})
minetest.register_craftitem("techtest:peppermint", {
description = "Peppermint Candy",
inventory_image = "peppermint.png",
on_use = minetest.item_eat(8),
})
minetest.register_craft({
output = "techtest:peppermint",
recipe = {
{"dye:red", "farming:mint_leaf", "dye:white"},
{"farming:mint_leaf", "farming:sugar", "farming:mint_leaf"},
{"dye:white", "farming:mint_leaf", "dye:red"},
},
})
minetest.register_craftitem("techtest:hershey5", {
description = "Hershey Bar",
inventory_image = "hershey5.png",
on_use = minetest.item_eat(3,"techtest:hershey4"),
})
minetest.register_craft({
output = "techtest:hershey5",
recipe = {
{"farming:chocolate", "farming:chocolate", "farming:chocolate"},
{"farming:chocolate", "farming:chocolate", "farming:chocolate"},
},
})
minetest.register_craftitem("techtest:hershey4", {
description = "Hershey Bar",
inventory_image = "hershey4.png",
on_use = minetest.item_eat(3,"techtest:hershey3"),
})
minetest.register_craftitem("techtest:hershey3", {
description = "Hershey Bar",
inventory_image = "hershey3.png",
on_use = minetest.item_eat(3,"techtest:hershey2"),
})
minetest.register_craftitem("techtest:hershey2", {
description = "Hershey Bar",
inventory_image = "hershey2.png",
on_use = minetest.item_eat(3,"techtest:hershey1"),
})
minetest.register_craftitem("techtest:hershey1", {
description = "Hershey Bar",
inventory_image = "hershey1.png",
on_use = minetest.item_eat(3,"techtest:hershey0"),
})
minetest.register_craftitem("techtest:hershey0", {
description = "Hershey Bar",
inventory_image = "hershey0.png",
on_use = minetest.item_eat(3),
})
-- make sure that stuff made fom artificial leather is 10x less good, durable, effective, etc.
minetest.register_craftitem("techtest:leather", {
description = "Artificial Leather",
inventory_image = "leather.png",
})
minetest.register_craft({
output = "techtest:leather",
recipe = {
{"dye:brown", "techtest:beeswax", "dye:brown"},
{"techtest:beeswax", "basic_materials:plastic", "techtest:beeswax"},
{"dye:brown", "techtest:beeswax", "dye:brown"},
},
})
minetest.register_craftitem("techtest:caramel", {
description = "Caramel",
inventory_image = "caramel.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "techtest:caramel",
type = "cooking",
recipe = "farming:sugar",
})
minetest.register_craftitem("techtest:soda_bucket", {
description = "Soda Bucket",
inventory_image = "soda.png",
one_use = minetest.item_eat(3)
})
minetest.register_craft({
output = "techtest:soda_bucket",
type = "cooking",
recipe = "techtest:caramel",
})
-- i will not add the "rrplacements" variable, if i do, you can prouduce buckets from soda
minetest.register_craft({
output = "homedecor:soda_can",
recipe = {
{"techtest:aluminum", "", "techtest:aluminum"},
{"techtest:aluminum", "techtest:soda_bucket", "techtest:aluminum"},
{"techtest:aluminum", "techtest:aluminum", "techtest:aluminum"},
},
})
minetest.register_craftitem("techtest:candy_cane", {
description = "Candy Cane",
inventory_image = "candy_cane.png",
on_use = minetest.item_eat(6)
})
minetest.register_craft({
output = "techtest:candy_cane",
recipe = {
{"farming:mint_leaf", "dye:white", "farming:mint_leaf"},
{"dye:red", "farming:sugar", "dye:red"},
{"farming:mint_leaf", "farming:mint_leaf", "dye:white"},
},
})
minetest.register_craftitem("techtest:wchoco_ppmpretzel", {
description = "White Chocolate Peppermint Pretzel",
inventory_image = "wchoco_ppmpretzel.png",
on_use = minetest.item_eat(12)
})
minetest.register_craft({
output = "techtest:wchoco_ppmpretzel",
recipe = {
{"dye:red", "techtest:pretzel", "dye:white"},
{"farming:mint_leaf", "farming:cocoa_beans", "farming:mint_leaf"},
{"farming:sugar", "techtest:candy_cane", "farming:sugar"},
},
})
minetest.register_craftitem("techtest:pretzel", {
description = "Pretzel",
inventory_image = "pretzel.png",
on_use = minetest.item_eat(8)
})
minetest.register_craft({
output = "techtest:pretzel",
recipe = {
{"farming:sugar", "mobs:bucket_milk", "farming:sugar"},
{"farming:flour", "bucket:bucket_water", "farming:flour"},
{"mobs:butter", "mobs:egg", "mobs:butter"},
},
replacements = {{"mobs:bucket_milk","bucket:bucket",},{"bucket:bucket_water","bucket:bucket"},}
})
minetest.register_craftitem("techtest:golden_pretzel", {
description = "Golden Pretzel",
inventory_image = "golden_pretzel.png",
on_use = minetest.item_eat(16)
})
minetest.register_craft({
output = "techtest:golden_pretzel",
recipe = {
{"", "default:gold_lump",""},
{"default:gold_lump", "techtest:pretzel", "default:gold_lump"},
{"", "default:gold_lump", ""},
},
})
function make_color_bed( Colorname , hex , ratio)
beds.register_bed("techtest:"..Colorname.."_bed", {
description = Colorname.." Bed",
inventory_image = "(colors_bed_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed.png)",
wield_image = "(colors_bed_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed.png)",
tiles = {
bottom = {
"colors_bed_top_bottom.png^[colorize:"..hex..":"..ratio.."^[transformR90",
"colors_bed_under.png",
"colors_bed_side_bottom_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed_side_bottom_r.png",
"colors_bed_side_bottom_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed_side_bottom_r.png^[transformfx",
"beds_transparent.png",
"colors_bed_side_bottom_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed_side_bottom.png"
},
top = {
"colors_bed_top_top_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed_top_top.png^[transformR90",
"colors_bed_under.png",
"colors_bed_side_top_r_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed_side_top_r.png",
"colors_bed_side_top_r_sheet.png^[colorize:"..hex..":"..ratio.."^colors_bed_side_top_r.png^[transformfx",
"beds_bed_side_top.png",
"beds_transparent.png",
}
},
recipe = {
{"wool:"..Colorname, "wool:"..Colorname, "wool"..Colorname},
{"group:wood", "group:wood", "group:wood"},
},
nodebox = {
bottom = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, 0.0625, 0.5},
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.0625, 1.5},
})
minetest.register_craft({
output = "techtest:"..Colorname.."_bed_bottom",
recipe = {
{tostring("wool:"..Colorname), tostring("wool:"..Colorname), tostring("wool:"..Colorname)},
{"group:wood", "group:wood", "group:wood"}}
})
end
make_color_bed("blue" , "#003579" , "175")
make_color_bed("yellow" , "#FCF110" , "175")
make_color_bed("green" , "#67EB1C" , "175")
make_color_bed("black" , "#1C1C1C" , "200")
make_color_bed("cyan" , "#00959D" , "175")
make_color_bed("grey" , "#9B9B9B" , "175")
make_color_bed("dark_grey" , "#464646" , "175")
make_color_bed("dark_green" , "#2B7B00" , "200")
make_color_bed("brown" , "#6C3800" , "200")
make_color_bed("orange" , "#E0601A" , "200")
make_color_bed("pink" , "#FEA4A4" , "200")
make_color_bed("magenta" , "#D70481" , "175")
make_color_bed("violet" , "#480680" , "175")
|
local P = require("core.packet")
local L = require("core.link")
local Datagram = require("lib.protocol.datagram")
local Ethernet = require("lib.protocol.ethernet")
local IPV4 = require("lib.protocol.ipv4")
local IPV6 = require("lib.protocol.ipv6")
local GRE = require("lib.protocol.gre")
local TCP = require("lib.protocol.tcp")
local bit = require("bit")
local ffi = require("ffi")
local band = bit.band
local rshift = bit.rshift
local godefs = require("godefs")
require("networking_magic_numbers")
require("five_tuple")
local IPFragReassembly = require("ip_frag/reassembly")
_G._NAME = "rewriting" -- Snabb requires this for some reason
-- Return the backend associated with a five-tuple
local function get_backend(five_tuple, five_tuple_len)
return godefs.Lookup(five_tuple, five_tuple_len)
end
local Rewriting = {}
-- Arguments:
-- ipv4_addr or ipv6_addr (string) -- the IP address of the spike
-- src_mac (string) -- the MAC address to send from; defaults to the
-- destination MAC of incoming packets
-- dst_mac (string) -- the MAC address to send packets to
-- ttl (int, default 30) -- the TTL to set on outgoing packets
function Rewriting:new(opts)
local ipv4_addr, ipv6_addr, err
if opts.ipv4_addr then
ipv4_addr, err = IPV4:pton(opts.ipv4_addr)
if not ipv4_addr then
error(err)
end
end
if opts.ipv6_addr then
ipv6_addr, err = IPV6:pton(opts.ipv6_addr)
if not ipv6_addr then
error(err)
end
end
if not opts.dst_mac then
error("need to specify dst_mac")
end
return setmetatable(
{ipv4_addr = ipv4_addr,
ipv6_addr = ipv6_addr,
src_mac = opts.src_mac and Ethernet:pton(opts.src_mac),
dst_mac = Ethernet:pton(opts.dst_mac),
ttl = opts.ttl or 30,
ip_frag_reassembly = IPFragReassembly:new()},
{__index = Rewriting})
end
function Rewriting:push()
local i = assert(self.input.input, "input port not found")
local o = assert(self.output.output, "output port not found")
while not L.empty(i) do
self:process_packet(i, o)
end
end
-- Parses a datagram to compute the packet's five tuple and the backend
-- pool to forward to packet to. Due to IP fragmentation, the packet to
-- be forwarded may be different from the packet received.
-- See reassembly.lua for an explanation of IP fragmentation handling.
-- Expected input datagram structure:
-- IPv4 fragment --
-- Ethernet (popped) | IPv4 (parsed) | payload
-- Redirected IPv4 fragment --
-- Ethernet (popped) | IPv4 (parsed) | GRE | IPv4 | payload
-- Full packet --
-- Ethernet (popped) | IPv4/IPv6 (parsed) | TCP/UDP | payload
-- Expected output datagram structure:
-- Ethernet (popped/missing) | IPv4 (parsed) | TCP/UDP | payload
-- Arguments:
-- datagram (datagram) -- Datagram to process. Should have Ethernet
-- header popped and IP header parsed.
-- ip_header (header) -- Parsed IP header of datagram.
-- ip_type (int) -- IP header type, can be L3_IPV4 or L3_IPV6
-- Returns:
-- forward_datagram (bool) -- Indicates whether there is a datagram to
-- forward.
-- t (binary) -- Five tuple of datagram.
-- t_len (int) -- Length of t.
-- backend_pool (int) -- Backend pool to forward the packet to.
-- new_datagram (datagram) -- Datagram to forward. Should have Ethernet
-- header popped or missing, and IP header parsed.
-- new_datagram_len (int) -- Length of new_datagram.
function Rewriting:handle_fragmentation_and_get_forwarding_params(datagram, ip_header, ip_type)
local ip_src = ip_header:src()
local ip_dst = ip_header:dst()
local l4_type, ip_total_length
if ip_type == L3_IPV4 then
l4_type = ip_header:protocol()
ip_total_length = ip_header:total_length()
else
l4_type = ip_header:next_header()
ip_total_length = ip_header:payload_length() + ip_header:sizeof()
end
local prot_class = ip_header:upper_layer()
-- TODO: handle IPv6 fragments
if ip_type == L3_IPV4 then
local frag_off = ip_header:frag_off()
local mf = band(ip_header:flags(), IP_MF_FLAG) ~= 0
if frag_off ~= 0 or mf then
-- Packet is an IPv4 fragment; redirect to another spike
-- Set ports to zero to get three-tuple
local t3, t3_len = five_tuple(ip_type, ip_src, 0, ip_dst, 0)
-- TODO: Return spike backend pool
return true, t3, t3_len, nil, datagram, ip_total_length
end
end
if l4_type == L4_GRE then
-- Packet is a redirected IPv4 fragment
local new_datagram, new_ip_header = self.ip_frag_reassembly:process_datagram(datagram)
if not new_datagram then
return false
end
datagram = new_datagram
datagram:parse_match(IPV4)
ip_src = new_ip_header:src()
ip_dst = new_ip_header:dst()
ip_total_length = new_ip_header:total_length()
prot_class = new_ip_header:upper_layer()
elseif not (l4_type == L4_TCP or l4_type == L4_UDP) then
return false
end
local prot_header = datagram:parse_match(prot_class)
if prot_header == nil then
return false
end
local src_port = prot_header:src_port()
local dst_port = prot_header:dst_port()
local t, t_len = five_tuple(ip_type,
ip_src, src_port, ip_dst, dst_port)
-- TODO: Use IP destination to determine backend pool.
-- unparse L4
datagram:unparse(1)
return true, t, t_len, nil, datagram, ip_total_length
end
function Rewriting:process_packet(i, o)
local p = L.receive(i)
local datagram = Datagram:new(p, nil, {delayed_commit = true})
local eth_header = datagram:parse_match(Ethernet)
if eth_header == nil then
P.free(p)
return
end
local eth_dst = eth_header:dst()
local l3_type = eth_header:type()
if not (l3_type == L3_IPV4 or l3_type == L3_IPV6) then
P.free(p)
return
end
-- Maybe consider moving packet parsing after ethernet into go?
local ip_class = eth_header:upper_layer()
-- decapsulate from ethernet
datagram:pop(1)
local ip_header = datagram:parse_match(ip_class)
if ip_header == nil then
P.free(p)
return
end
local forward_datagram, t, t_len,
backend_pool, new_datagram, ip_total_length =
self:handle_fragmentation_and_get_forwarding_params(
datagram, ip_header, l3_type
)
if not forward_datagram then
P.free(p)
return
end
if datagram ~= new_datagram then
P.free(p)
datagram = new_datagram
end
local backend, backend_len = get_backend(t, t_len)
if backend_len == 0 then
P.free(p)
return
end
-- unparse L4 and L3
datagram:unparse(2)
local gre_header = GRE:new({protocol = l3_type})
datagram:push(gre_header)
local outer_ip_header, outer_l3_type
if backend_len == 4 then -- IPv4
if self.ipv4_addr == nil then
error("Spike's IPv4 address not specified.")
end
outer_l3_type = L3_IPV4
outer_ip_header = IPV4:new({src = self.ipv4_addr,
dst = backend,
protocol = L4_GRE,
ttl = self.ttl})
outer_ip_header:total_length(
ip_total_length + gre_header:sizeof() + outer_ip_header:sizeof())
-- need to recompute checksum after changing total_length
outer_ip_header:checksum()
elseif backend_len == 16 then -- IPv6
if self.ipv6_addr == nil then
error("Spike's IPv6 address not specified.")
end
outer_l3_type = L3_IPV6
outer_ip_header = IPV6:new({src= self.ipv6_addr,
dst = backend,
next_header = L4_GRE,
hop_limit = self.ttl})
outer_ip_header:payload_length(ip_total_length + gre_header:sizeof())
else
error("backend length must be 4 (for IPv4) or 16 (for IPv6)")
end
datagram:push(outer_ip_header)
local outer_eth_header = Ethernet:new({src = self.src_mac or eth_dst,
dst = self.dst_mac,
type = outer_l3_type})
datagram:push(outer_eth_header)
datagram:commit()
link.transmit(o, datagram:packet())
end
return Rewriting
|
function player_Spawn ( )
--outputChatBox ( "called for "..getClientName ( source ) )
skin = getElementModel ( source )
notrolley = getAttachedElements ( source )
for k,v in pairs(notrolley) do
if getElementType ( v ) == "object" then
destroyElement ( v )
end
end
if ( skin ~= 217 ) then
local x,y,z = getElementPosition ( source )
trolley = createObject ( 1349, x, y, z, 0, 0, 0 )
attachElements ( trolley, source, 0, 1.0, -0.45, 0.000000, 0.000000, 90 )
toggleControl ( source, "jump", false )
else
setElementAlpha( source, 255 )
toggleControl ( source, "jump", true )
end
end
-- add the player_Spawn function as a handler for onPlayerSpawn
addEventHandler ( "onPlayerSpawn", root, player_Spawn )
function player_Quit ( )
notrolley = getAttachedElements ( source )
for k,v in pairs(notrolley) do
if getElementType ( v ) == "object" then
destroyElement ( v )
end
end
end
addEventHandler ( "onPlayerQuit", root, player_Quit )
|
-- COMMS by Tammya-MoonGuard --
CommsAddon = LibStub("AceAddon-3.0"):NewAddon( "Comms",
"AceComm-3.0", "AceEvent-3.0", "AceSerializer-3.0",
"AceTimer-3.0" )
local Main = CommsAddon
local L = CommsLocale
--local PUB_CHAT_CHANNEL = "xtensionxtooltip2"
-------------------------------------------------------------------------------
Main.db_template = {
global = {
comms = {
-- indexed by chat
-- chat - chat channel
-- name - name of community
-- rank - rank in community
-- alias - username
-- channels - list of channels in community, indexed by name
-- cipher - channel cipher
-- hosts - list of host toons
-- admins - list of admin toons
-- ishost - is host of community
-- isadmin - is admin of community
};
};
}
-- a note why simple channels should use pub channels:
-- we dont want non-admins sharing private community channels with people
-------------------------------------------------------------------------------
function Main:OnInitialize()
self.db = LibStub( "AceDB-3.0" ):New( "CommsAddonSaved", self.db_template, true )
end
-------------------------------------------------------------------------------
function Main:OnEnable()
self:InitProtocol()
self:JoinChannels()
self:ScheduleTimer( "SendHostMessages", 3 )
self:SetupConsole()
-- self:OpenWindow()
end
-------------------------------------------------------------------------------
function Main:SendHostMessages()
for k,v in pairs( self.db.global.comms ) do
if v.ishost then
self:SendChannelMessage( v.chat, "host", {
chat = v.chat;
hosts = v.hosts;
})
end
end
end
-------------------------------------------------------------------------------
function Main:MakeHostsList( alts )
local hosts = { UnitName( "player" ) }
alts = alts or {}
for _,v in pairs( alts ) do
local duplicate = false
for _,v2 in pairs( hosts ) do
if v == v2 then
duplicate = true
break
end
end
if not duplicate then
table.insert( hosts, v )
end
end
end
-------------------------------------------------------------------------------
function Main:GetCommInfo( chat )
return self.db.global.comms[chat]
end
-------------------------------------------------------------------------------
local function BadString( s, pattern )
if not s or type( s ) ~= "string" then return true end
pattern = pattern or ".+"
if not s:match( pattern ) then return true end
end
-------------------------------------------------------------------------------
-- Create a new comm.
--
-- Data:
-- name = name of comm
-- chat = chat channel to use
-- rank = rank name of host (default: Host)
-- channels = channel list e.g {
-- General = { desc="general chat", admins={ "pootytang" } },
-- Officers = { desc="officer chat" }
-- }
-- ciphers will be generated if not specified
-- hosts = host list, e.g. { "Me", "Myself" } character names
-- admins = global admin list, e.g. { "Myfriend", "Otherfriend" }
--
function Main:CreateComm( data )
local comm = {
ishost = true;
isadmin = true;
hosts = self:MakeHostsList( data.hosts );
admins = data.admins or {};
}
if BadString( data.name ) then self:Print( "Bad comm name." ) return end
if BadString( data.chat ) then self:Print( "Bad chat-channel." ) return end
comm.chat = data.chat
-- catch duplicates
if self:GetCommInfo( comm.chat ) then
self:Print( "Chat-channel already in use." )
return
end
comm.name = data.name
comm.rank = data.rank or "Host"
if not data.channels then self:Print( "Missing channel list." ) return end
comm.channels = data.channels
for k,v in pairs( comm.channels ) do
if not v.cipher or v.cipher == "" then
v.cipher = CcmCipher:Generate()
end
if BadString( k ) then
print( "Bad channel name." )
return
end
end
self.db.global.comms[comm.chat] = comm
self:JoinChatChannel( comm.chat )
self:SendMessage( "COMM_CREATED", comm )
self:Print( "Comm created: %s", comm.name )
end
-------------------------------------------------------------------------------
-- invite player to comm
--
-- player = name of player
-- options = {
-- chat = chat channel (comm)
-- rank = player title
-- channels = list of channel names for them to have access to
-- }
function Main:CommInvite( player, options )
if not player then return end
if not options.rank then options.rank = "Member" end
if not options.channels then self:Print( "Missing channel list." ) return end
if BadString( options.chat ) then self:Print( "Missing comm chat." ) return end
local comm = self:GetCommInfo( options.chat )
if not comm then self:Print( "Undefined comm." ) return end
if not comm.ishost then self:Print( "You are not the host of that channel." ) return end
local channels = {}
for k, v in pairs( options.channels ) do
if not comm.channels[v] then
self:Print( "Unknown channel: %s", v )
return
end
channels[v] = comm.channels[v]
end
local msg = {
name = comm.name;
chat = comm.chat;
rank = options.rank;
channels = channels;
hosts = comm.hosts;
admins = comm.admins;
}
self:SendWhisperMessage( player, "inv", msg )
end
-------------------------------------------------------------------------------
-- kick player from comm channel(s)
--
-- player = player name
-- options = {
-- chat = chat channel
-- channels = list of channels to remove from, nil to remove from all
-- }
function Main:CommKick( player, options )
if BadString( options.chat ) then self:Print( "Missing comm chat." ) return end
local comm = self:GetCommInfo( options.chat )
if not comm then self:Print( "Undefined comm." ) return end
if not comm.isadmin then self:Print( "You are not an admin of that channel." ) return end
local msg = {
chat = comm.chat;
channels = options.channels;
}
self:SendWhisperMessage( player, "kick", msg )
end
-------------------------------------------------------------------------------
function Main:RegisterModule( name, tbl, options )
Main.modules[name] = tbl
options = options or {}
options.name = options.name or name
if options.db then
self.db_template.profile[name] = options.db
tbl.db = function() return self.db.profile[name] end
end
--[[ change these into functions
if options.config_section then
self.config_options.args[ name .. "_config" ] = {
name = L[options.name];
type = "group";
args = options.config_section;
}
end
if options.config_general then
self.Config:AddGeneral( options.config_general )
end]]
end
-------------------------------------------------------------------------------
function Main:GetModuleConfigOption( mod, name )
return self.Config.options.args[ mod .. "_config" ].args[name]
end
-------------------------------------------------------------------------------
function Main:GetModuleConfigSection( mod )
return self.Config.options.args[ mod .. "_config" ].args
end
-------------------------------------------------------------------------------
function Main:ModCall( module, method, ... )
return self.modules[module][method]( self.modules[module], ... )
end
-------------------------------------------------------------------------------
function Main:ModMethod( module, method, ... )
return self.modules[module][method]
end
-------------------------------------------------------------------------------
function Main:ModStaticCall( module, method, ... )
return self.modules[module][method]( ... )
end
-------------------------------------------------------------------------------
function Main:SendMessage( msgname, ... )
-- pass to modules
for k,v in pairs( self.modules ) do
if v["MSG_" .. msgname] then
v["MSG_" .. msgname]( v, ... )
end
end
-- pass to other addons
AceEvent:SendMessage( msgname, ... )
end
-------------------------------------------------------------------------------
function Main:Print( msg, ... )
if select( "#", ... ) > 0 then
msg = string.format( msg, ... )
end
print( "|cffd9bfb1<Comms>|r " .. msg )
end
|
------------------------
-- PhysicsBody [mixin](https://github.com/kikito/middleclass/wiki/Mixins).
-- Apply to classes to give them physics body, along with relevant positional and rotational functions.
-- @mixin PhysicsBody
-- @usage local MyClass = class("MyClass")
-- MyClass:include( PhysicsBody )
--- @type PhysicsBody
local PhysicsBody = {}
local lp = love.physics
function PhysicsBody:initialize( world, btype )
btype = btype or "dynamic"
self._body = lp.newBody(world, 0, 0, btype)
self._body:setUserData( self )
end
--- Get the [LÖVE physics body](https://www.love2d.org/wiki/Body).
-- @treturn Body body
function PhysicsBody:getBody()
return self._body
end
--- Set the body's position.
-- @number x x-coordinate.
-- @number y y-coordinate.
-- @treturn PhysicsBody self
function PhysicsBody:setPos( x, y )
self:getBody():setPosition(x, y)
return self
end
--- Gets the body's position.
-- @treturn number x
-- @treturn number y
function PhysicsBody:getPos()
return self:getBody():getPosition()
end
--- Move this body relative to its current position.
-- @number x relative x
-- @number y relative y
-- @treturn PhysicsBody self
function PhysicsBody:move( x, y )
self._pos.x = self._pos.x + x
self._pos.y = self._pos.y + y
return self
end
--- Set the body's angle.
-- @number r angle (radians)
-- @treturn PhysicsBody self
function PhysicsBody:setAngle( r )
self:getBody():setAngle( r )
return self
end
--- Gets the body's angle.
-- @treturn number r angle
function PhysicsBody:getAngle()
return self:getBody():getAngle()
end
--- Rotate this body relatively to its current angle.
-- @number r angle (radians)
-- @treturn PhysicsBody self
function PhysicsBody:rotate( r )
self:getBody():setAngle( self._body:getAngle() + r )
return self
end
--- Move this body forward (according to its current angle) by a given distance.
-- @number d distance
-- @treturn PhysicsBody self
function PhysicsBody:moveForward( d )
local px, py = self:getPos()
local fx, fy = angle.forward( self:getAngle() )
local dx, dy = fx * d, fy * d
self:setPos( px + dx, py + dy )
return self
end
--- Get the normal angle of the body's current angle.
-- @treturn Vector normal vector
function PhysicsBody:getDirection()
return angle.forward( self:getAngle() )
end
--- Called when the actor is removed.
function PhysicsBody:onRemove()
self:getBody():destroy()
end
return PhysicsBody
|
local curl = require "lcurl.safe"
script_info = {
["title"] = "大力盘",
["description"] = "https://www.dalipan.com/; 搜索框输入:config设置是否过滤失效链接",
["version"] = "0.0.3",
}
function request(url,header)
local r = ""
local c = curl.easy{
url = url,
httpheader = header,
ssl_verifyhost = 0,
ssl_verifypeer = 0,
followlocation = 1,
timeout = 15,
proxy = pd.getProxy(),
writefunction = function(buffer)
r = r .. buffer
return #buffer
end,
}
local _, e = c:perform()
c:close()
return r
end
function onSearch(key, page)
if key == ":config" and page == 1 then
return setConfig()
end
local header = {
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
}
local data = request("https://www.dalipan.com/search?keyword=" .. pd.urlEncode(key) .. "&page=" .. page, header)
local result = {}
local start = 1
if page == 1 then
local p_start,p_end,count = string.find(data,'<p class="tip".-><span .-class="em" .->(.-)</span>')
table.insert(result, { ["time"] = "找到约 "..count.." 条数据", ["enabled"] = "false",["showhtml"] = "true"})
end
while true do
local a, b, img, id, title, time = string.find(data, '<div class="resource%-item"><img src="(.-)".-<a href="/detail/(.-)" target="_blank" class="valid">(.-)</a>.-<p class="time">(.-)</p>', start)
if id == nil then
break
end
--title = string.gsub(title, "^%s*", "", 1)
local tooltip = string.gsub(title, "<mark>(.-)</mark>", "%1")
title = string.gsub(title, "<mark>(.-)</mark>", "{c #ff0000}%1{/c}")
local url
local filtration = pd.getConfig("大力盘","filtration")
if filtration == "yes" then
url = parseDetail(id)
else
url = nil
end
table.insert(result, {["id"] = id , ["title"] = title, ["showhtml"] = "true", ["tooltip"] = tooltip, ["time"] = time, ["image"] = "https://dalipan.com" .. img, ["icon_size"] = "32,32", ["check_url"] = "true", ["url"]=url})
-- table.insert(result, {["url"] = url .. " " .. pwd, ["title"] = title, ["showhtml"] = "true", ["tooltip"] = tooltip, ["check_url"] = "true", ["time"] = time})
start = b + 1
end
return result
end
function parseDetail(id)
local deatil_url = "https://www.dalipan.com/detail/".. id
header = {
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
"referer: " .. deatil_url,
}
local image_url = "https://www.dalipan.com/images/recommand.png"
request(image_url, header)
local api_url = 'https://www.dalipan.com/api/private?id=' .. id
local ret = request(api_url, header)
local a, c, pwd, url = string.find(ret, '"pwd": "(.-)",.-"url": "(.-)"')
return url .. " " .. pwd
end
function onItemClick(item)
if item.isConfig then
if item.isSel == "1" then
return ACT_NULL
else
pd.setConfig("大力盘", item.key, item.val)
return ACT_MESSAGE, "设置成功! (请手动刷新页面)"
end
end
local url = item.url or parseDetail(item.id)
return ACT_SHARELINK, url
end
function setConfig()
local config = {}
local filtration = pd.getConfig("大力盘","filtration")
table.insert(config, {["title"] = "过滤失效链接", ["enabled"] = "false"})
table.insert(config, createConfigItem("不过滤失效链接", "filtration", "no", #filtration == 0 or filtration == "no"))
table.insert(config, createConfigItem("过滤失效链接", "filtration", "yes", filtration == "yes"))
return config
end
function createConfigItem(title, key, val, isSel)
local item = {}
item.title = title
item.key = key
item.val = val
item.icon_size = "14,14"
item.isConfig = "1"
if isSel then
item.image = "option/selected.png"
item.isSel = "1"
else
item.image = "option/normal.png"
item.isSel = "0"
end
return item
end
|
------------------------
-- hash::replace tests
------------------------
hash = box.schema.space.create('tweedledum')
tmp = hash:create_index('primary', { type = 'hash', parts = {1, 'unsigned'}, unique = true })
tmp = hash:create_index('field1', { type = 'hash', parts = {2, 'unsigned'}, unique = true })
tmp = hash:create_index('field2', { type = 'hash', parts = {3, 'unsigned'}, unique = true })
tmp = hash:create_index('field3', { type = 'hash', parts = {4, 'unsigned'}, unique = true })
hash:insert{0, 0, 0, 0}
hash:insert{1, 1, 1, 1}
hash:insert{2, 2, 2, 2}
-- OK
hash:replace{1, 1, 1, 1}
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
hash.index['primary']:get{1}
hash.index['field1']:get{1}
hash.index['field2']:get{1}
hash.index['field3']:get{1}
-- OK
hash:insert{10, 10, 10, 10}
hash:delete{10}
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
-- TupleFound (primary key)
hash:insert{1, 10, 10, 10}
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
hash.index['primary']:get{1}
-- TupleNotFound (primary key)
hash:replace{10, 10, 10, 10}
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
-- TupleFound (key --1)
hash:insert{10, 0, 10, 10}
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
hash.index['field1']:get{0}
-- TupleFound (key --1)
-- hash:replace_if_exists(2, 0, 10, 10)
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
hash.index['field1']:get{0}
-- TupleFound (key --3)
hash:insert{10, 10, 10, 0}
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
hash.index['field3']:get{0}
-- TupleFound (key --3)
-- hash:replace_if_exists(2, 10, 10, 0)
hash.index['primary']:get{10}
hash.index['field1']:get{10}
hash.index['field2']:get{10}
hash.index['field3']:get{10}
hash.index['field3']:get{0}
hash:drop()
hash = box.schema.space.create('tweedledum')
hi = hash:create_index('primary', { type = 'hash', parts = {1, 'unsigned'}, unique = true })
hash:insert{0}
hash:insert{16}
for _, tuple in hi:pairs(nil, {iterator = box.index.ALL}) do hash:delete{tuple[1]} end
hash:drop()
|
BrokerUpgrade = BrokerUpgrade or {}
-- * name
-- * onInstall
-- * id
-- * description
-- * installMessage
-- * price
-- * unique
-- * requiredUpgrade
BrokerUpgrade = {
--- an upgrade that can be bought
--- @param self
--- @param config table
--- @field name string (mandatory)
--- @field onInstall function gets the `upgrade` and the `player` as arguments.
--- @field id string|nil
--- @field description string|function|nil
--- @field installMessage string|function|nil
--- @field price number (default: `0`)
--- @field unique boolean (default: `false`)
--- @field requiredUpgrade string|BrokerUpgrade|nil
--- @return BrokerUpgrade
new = function(self, config)
config = config or {}
if not isTable(config) then error("Expected config to be a table, but got " .. typeInspect(config), 2) end
local name = config.name
if not isString(name) then error("Expected name to be a string, but got " .. typeInspect(name), 2) end
local onInstall = config.onInstall or (function() end)
if not isFunction(onInstall) then error("Expected onInstall routine to be a function, but got " .. typeInspect(onInstall), 2) end
local id = config.id or Util.randomUuid()
if not isString(id) then error("Expected id to be a string, but got " .. typeInspect(id), 2) end
local description = config.description
if not isNil(description) and not isString(description) and not isFunction(description) then error("Expected description to be string or function, but got " .. typeInspect(description), 2) end
local installMessage = config.installMessage
if not isNil(installMessage) and not isString(installMessage) and not isFunction(installMessage) then error("Expected installMessage to be string or function, but got " .. typeInspect(installMessage), 2) end
local price = config.price or 0
if not isNumber(price) then error("Expected price to be numeric, but got " .. typeInspect(price), 2) end
local unique = config.unique or false
if not isBoolean(unique) then error("Expected unique to be boolean, but got " .. typeInspect(unique), 2) end
local requiredUpgrade = config.requiredUpgrade
if not isNil(requiredUpgrade) and not isString(requiredUpgrade) and not BrokerUpgrade:isUpgrade(requiredUpgrade) then error("Expected requiredUpgrade to be an Upgrade or id, but got " .. typeInspect(requiredUpgrade), 2) end
return {
--- get the id of the upgrade
--- @internal
--- @param self
--- @return string
getId = function(self) return id end,
--- get the name of this upgrade
--- @param self
--- @return string
getName = function(self) return name end,
--- install the upgrade on the player
--- @param self
--- @param player PlayerSpaceship
--- @return BrokerUpgrade
install = function(self, player)
if not isEePlayer(player) then error("Expected player, but got " .. typeInspect(player), 2) end
local success, msg = self:canBeInstalled(player)
if not success then error("Upgrade " .. id .. " can not be installed, because requirement is not fulfilled: " .. (msg or "")) end
onInstall(self, player)
player:takeReputationPoints(self:getPrice(player))
if Player:hasUpgradeTracker(player) then
player:addUpgrade(self)
end
return self
end,
--- get the price of the upgrade
--- @param self
--- @return number
getPrice = function(self) return price end,
--- check if the upgrade can be installed on the player
--- @param self
--- @param player PlayerSpaceship
--- @return boolean
canBeInstalled = function(self, player)
if not isEePlayer(player) then error("Expected player, but got " .. typeInspect(player), 2) end
local success, msg = true, nil
if isFunction(config.canBeInstalled) then
success, msg = config.canBeInstalled(self, player)
if isNil(success) then
logInfo("canBeInstalled returned nil as state, so true is assumed")
success = true
elseif not isBoolean(success) then
logWarning("canBeInstalled returned " .. typeInspect(success) .. "as success state, so true is assumed")
success = true
end
if success == true and not isNil(msg) then
logWarning("ignoring message on success in canBeInstalled")
msg = nil
elseif not isNil(msg) and not isString(msg) then
logWarning("expected message to be a string, but got " .. typeInspect(msg) .. ", asuming nil.")
msg = nil
end
end
if success == true and unique == true then
if not Player:hasUpgradeTracker(player) then
success, msg = false, "no_upgrade_tracker"
elseif player:hasUpgrade(self) then
success, msg = false, "unique"
end
end
if success == true and requiredUpgrade ~= nil then
if not Player:hasUpgradeTracker(player) then
success, msg = false, "no_upgrade_tracker"
elseif not player:hasUpgrade(requiredUpgrade) then
success, msg = false, "required_upgrade"
end
end
return success, msg
end,
--- get the description of the upgrade
--- @param self
--- @param player PlayerSpaceship
--- @return nil|string
getDescription = function(self, player)
if not isEePlayer(player) then error("Expected player to be a player object, but got " .. typeInspect(player), 2) end
if isFunction(description) then
return description(self, player)
else
return description
end
end,
--- get the install message of the upgrade
--- @param self
--- @param player PlayerSpaceship
--- @return nil|string
getInstallMessage = function(self, player)
if not isEePlayer(player) then error("Expected player to be a player object, but got " .. typeInspect(player), 2) end
if isFunction(installMessage) then
return installMessage(self, player)
else
return installMessage
end
end,
--- get the id of the required upgrade
--- @param self
--- @return string|nil
getRequiredUpgradeString = function(self)
return config.requiredUpgrade
end,
}
end,
--- check if the given thing is a BrokerUpgrade
--- @param self
--- @param thing any
--- @return boolean
isUpgrade = function(self, thing)
return isTable(thing) and
isFunction(thing.getId) and
isFunction(thing.canBeInstalled) and
isFunction(thing.install) and
isFunction(thing.getName) and
isFunction(thing.getPrice) and
isFunction(thing.getDescription) and
isFunction(thing.getInstallMessage) and
isFunction(thing.getRequiredUpgradeString)
end
}
setmetatable(BrokerUpgrade,{
__index = Generic
})
|
local Component = require "component"
local Lock = Component:extend()
Lock.name = "Lock"
function Lock:initialize(actor)
actor.setKey = self.setKey
actor.hasKey = self.hasKey
end
function Lock:setKey(item)
self.key = item
end
function Lock:hasKey(actor)
return self.key and actor.inventory and actor.hasItem(actor, self.key)
end
return Lock
|
local theme={colors={normal={blue={0.4,0.6,0.8,1},green={0.6,0.8,0.6,1},cyan={0.4,0.8,0.8,1},white={0.82745098039216,0.8156862745098,0.7843137254902,1},red={0.94901960784314,0.46666666666667,0.47843137254902,1},magenta={0.8,0.6,0.8,1},black={0.17647058823529,0.17647058823529,0.17647058823529,1},yellow={1.0,0.8,0.4,1}},primary={background={0.17647058823529,0.17647058823529,0.17647058823529,1},foreground={0.82745098039216,0.8156862745098,0.7843137254902,1}},bright={blue={0.62745098039216,0.62352941176471,0.57647058823529,1},green={0.22352941176471,0.22352941176471,0.22352941176471,1},cyan={0.82352941176471,0.48235294117647,0.32549019607843,1},white={0.94901960784314,0.94117647058824,0.92549019607843,1},red={0.97647058823529,0.56862745098039,0.34117647058824,1},magenta={0.90980392156863,0.90196078431373,0.87450980392157,1},black={0.45490196078431,0.45098039215686,0.41176470588235,1},yellow={0.31764705882353,0.31764705882353,0.31764705882353,1}},cursor={text={0.17647058823529,0.17647058823529,0.17647058823529,1},cursor={0.82745098039216,0.8156862745098,0.7843137254902,1}}}}
return theme.colors
|
local session = {
_VERSION = "",
_DESCRIPTION = "",
_LICENSE = [[]],
}
function session.new()
return {}
end
-------------------------------------------------------------------------------
-- Returning module
-------------------------------------------------------------------------------
return session
|
-- This is sorta horrible
AddCSLuaFile()
local keypad_crack_time = CreateConVar("keypad_crack_time", "30", {FCVAR_ARCHIVE}, "Seconds for keypad cracker to crack keypad")
if SERVER then
util.AddNetworkString("KeypadCracker_Hold")
util.AddNetworkString("KeypadCracker_Sparks")
end
if CLIENT then
SWEP.PrintName = "Keypad Cracker"
SWEP.Slot = 4
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
end
SWEP.Author = "Willox"
SWEP.Instructions = "Left click to crack keypad"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.ViewModelFOV = 62
SWEP.ViewModelFlip = false
SWEP.ViewModel = Model("models/weapons/v_c4.mdl")
SWEP.WorldModel = Model("models/weapons/w_c4.mdl")
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.AnimPrefix = "python"
SWEP.Sound = Sound("weapons/deagle/deagle-1.wav")
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = ""
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = ""
SWEP.KeyCrackSound = Sound("buttons/blip2.wav")
SWEP.IdleStance = "slam"
function SWEP:Initialize()
self:SetHoldType(self.IdleStance)
if SERVER then
net.Start("KeypadCracker_Hold")
net.WriteEntity(self)
net.WriteBit(true)
net.Broadcast()
self:SetCrackTime( keypad_crack_time:GetInt() )
end
end
function SWEP:SetupDataTables()
self:NetworkVar( "Int", 0, "CrackTime" )
end
function SWEP:PrimaryAttack()
self:SetNextPrimaryFire(CurTime() + 0.4)
if self.IsCracking or not IsValid(self.Owner) then return end
local tr = self.Owner:GetEyeTrace()
local ent = tr.Entity
if IsValid(ent) and tr.HitPos:Distance(self.Owner:GetShootPos()) <= 50 and ent.IsKeypad then
self.IsCracking = true
self.StartCrack = CurTime()
self.EndCrack = CurTime() + self:GetCrackTime()
self:SetWeaponHoldType("pistol") -- TODO: Send as networked message for other clients to receive
if SERVER then
net.Start("KeypadCracker_Hold")
net.WriteEntity(self)
net.WriteBit(true)
net.Broadcast()
timer.Create("KeyCrackSounds: "..self:EntIndex(), 1, self:GetCrackTime(), function()
if IsValid(self) and self.IsCracking then
self:EmitSound(self.KeyCrackSound, 100, 100)
end
end)
else
self.Dots = self.Dots or ""
local entindex = self:EntIndex()
timer.Create("KeyCrackDots: "..entindex, 0.5, 0, function()
if not IsValid(self) then
timer.Destroy("KeyCrackDots: "..entindex)
else
local len = string.len(self.Dots)
local dots = {[0] = ".", [1] = "..", [2]= "...", [3] = ""}
self.Dots = dots[len]
end
end)
end
end
end
function SWEP:Holster()
self.IsCracking = false
if SERVER then
timer.Destroy("KeyCrackSounds: "..self:EntIndex())
else
timer.Destroy("KeyCrackDots: "..self:EntIndex())
end
return true
end
function SWEP:Reload()
return true
end
function SWEP:Succeed()
self.IsCracking = false
local tr = self.Owner:GetEyeTrace()
local ent = tr.Entity
self:SetWeaponHoldType(self.IdleStance)
if SERVER and IsValid(ent) and tr.HitPos:Distance(self.Owner:GetShootPos()) <= 50 and ent.IsKeypad then
ent:Process(true)
net.Start("KeypadCracker_Hold")
net.WriteEntity(self)
net.WriteBit(true)
net.Broadcast()
net.Start("KeypadCracker_Sparks")
net.WriteEntity(ent)
net.Broadcast()
end
if SERVER then
timer.Destroy("KeyCrackSounds: "..self:EntIndex())
else
timer.Destroy("KeyCrackDots: "..self:EntIndex())
end
end
function SWEP:Fail()
self.IsCracking = false
self:SetWeaponHoldType(self.IdleStance)
if SERVER then
net.Start("KeypadCracker_Hold")
net.WriteEntity(self)
net.WriteBit(true)
net.Broadcast()
timer.Destroy("KeyCrackSounds: "..self:EntIndex())
else
timer.Destroy("KeyCrackDots: "..self:EntIndex())
end
end
function SWEP:Think()
if not self.StartCrack then
self.StartCrack = 0
self.EndCrack = 0
end
if self.IsCracking and IsValid(self.Owner) then
local tr = self.Owner:GetEyeTrace()
if not IsValid(tr.Entity) or tr.HitPos:Distance(self.Owner:GetShootPos()) > 50 or not tr.Entity.IsKeypad then
self:Fail()
elseif self.EndCrack <= CurTime() then
self:Succeed()
end
else
self.StartCrack = 0
self.EndCrack = 0
end
self:NextThink(CurTime())
return true
end
if(CLIENT) then
SWEP.BoxColor = Color(10, 10, 10, 100)
surface.CreateFont("KeypadCrack", {
font = "Trebuchet",
size = 18,
weight = 600,
})
function SWEP:DrawHUD()
if self.IsCracking then
if not self.StartCrack then
self.StartCrack = CurTime()
self.EndCrack = CurTime() + self:GetCrackTime()
end
local frac = math.Clamp((CurTime() - self.StartCrack) / (self.EndCrack - self.StartCrack), 0, 1) -- Between 0 and 1 (a fraction omg segregation)
local dots = self.Dots or ""
local w, h = ScrW(), ScrH()
local x, y = (w / 2) - 150, (h / 2) - 25
local w, h = 300, 50
draw.RoundedBox(4, x, y, w, h, self.BoxColor)
surface.SetDrawColor(Color(255 + (frac * -255), frac * 255, 40))
surface.DrawRect(x + 5, y + 5, frac * (w - 10), h - 10)
surface.SetFont("KeypadCrack")
local fontw, fonth = surface.GetTextSize("Cracking")
local fontx, fonty = (x + (w / 2)) - (fontw / 2), (y + (h / 2)) - (fonth / 2)
surface.SetTextPos(fontx + 1, fonty+1)
surface.SetTextColor(color_black)
surface.DrawText("Cracking"..dots)
surface.SetTextPos(fontx, fonty)
surface.SetTextColor(color_white)
surface.DrawText("Cracking"..dots)
end
end
SWEP.DownAngle = Angle(-10, 0, 0)
SWEP.LowerPercent = 1
SWEP.SwayScale = 0
function SWEP:GetViewModelPosition(pos, ang)
if self.IsCracking then
local delta = FrameTime() * 3.5
self.LowerPercent = math.Clamp(self.LowerPercent - delta, 0, 1)
else
local delta = FrameTime() * 5
self.LowerPercent = math.Clamp(self.LowerPercent + delta, 0, 1)
end
ang:RotateAroundAxis(ang:Forward(), self.DownAngle.p * self.LowerPercent)
ang:RotateAroundAxis(ang:Right(), self.DownAngle.p * self.LowerPercent)
return self.BaseClass.GetViewModelPosition(self, pos, ang)
end
net.Receive("KeypadCracker_Hold", function()
local ent = net.ReadEntity()
local state = (net.ReadBit() == 1)
if IsValid(ent) and ent:IsWeapon() and ent:GetClass():lower() == "keypad_cracker" and not game.SinglePlayer() and ent.SetWeaponHoldType then
if not state then
ent:SetWeaponHoldType(ent.IdleStance)
ent.IsCracking = false
else
ent:SetWeaponHoldType("pistol")
ent.IsCracking = true
end
end
end)
net.Receive("KeypadCracker_Sparks", function()
local ent = net.ReadEntity()
if IsValid(ent) then
local vPoint = ent:GetPos()
local effect = EffectData()
effect:SetStart(vPoint)
effect:SetOrigin(vPoint)
effect:SetEntity(ent)
effect:SetScale(2)
util.Effect("cball_bounce", effect)
ent:EmitSound("buttons/combine_button7.wav", 100, 100)
end
end)
end
|
LinkLuaModifier("modifier_mutation_track_buff_ms", "components/mutation/modifiers/periodic_spellcast/modifier_mutation_track.lua", LUA_MODIFIER_MOTION_NONE )
modifier_mutation_track = class({})
function modifier_mutation_track:IsPurgable() return false end
function modifier_mutation_track:OnCreated()
-- Ability properties
self.particle_shield = "particles/units/heroes/hero_bounty_hunter/bounty_hunter_track_shield.vpcf"
self.particle_trail = "particles/units/heroes/hero_bounty_hunter/bounty_hunter_track_trail.vpcf"
-- Ability specials
self.bonus_gold_allies = 300
self.haste_radius = 900
self.haste_linger = 0.5
if IsServer() then
-- Adjust custom lobby gold settings to the gold
self.bonus_gold_allies = self.bonus_gold_allies
-- Add overhead particle only for the caster's team
self.particle_shield_fx = ParticleManager:CreateParticle(self.particle_shield, PATTACH_OVERHEAD_FOLLOW, self:GetParent())
ParticleManager:SetParticleControl(self.particle_shield_fx, 0, self:GetParent():GetAbsOrigin())
self:AddParticle(self.particle_shield_fx, false, false, -1, false, true)
-- Add the track particle only for the caster's team
self.particle_trail_fx = ParticleManager:CreateParticle(self.particle_trail, PATTACH_ABSORIGIN_FOLLOW, self:GetParent())
ParticleManager:SetParticleControl(self.particle_trail_fx, 0, self:GetParent():GetAbsOrigin())
ParticleManager:SetParticleControlEnt(self.particle_trail_fx, 1, self:GetParent(), PATTACH_ABSORIGIN_FOLLOW, nil, self:GetParent():GetAbsOrigin(), true)
ParticleManager:SetParticleControl(self.particle_trail_fx, 8, Vector(1,0,0))
self:AddParticle(self.particle_trail_fx, false, false, -1, false, false)
-- Play cast sound for the player's team only
EmitSoundOnLocationForAllies(self:GetParent():GetAbsOrigin(), "Hero_BountyHunter.Target", self:GetParent())
end
end
function modifier_mutation_track:GetTexture()
return "bounty_hunter_track"
end
function modifier_mutation_track:OnRefresh()
self:OnCreated()
end
function modifier_mutation_track:OnIntervalThink()
AddFOWViewer(self:GetCaster():GetTeamNumber(), self:GetParent():GetAbsOrigin(), self.talent_2_vision_radius, FrameTime(), false)
end
function modifier_mutation_track:CheckState()
if self:GetParent():HasModifier("modifier_slark_shadow_dance") then
return nil
end
local state = {[MODIFIER_STATE_INVISIBLE] = false}
return state
end
function modifier_mutation_track:GetAuraDuration()
return self.haste_linger
end
function modifier_mutation_track:GetAuraRadius()
return self.haste_radius
end
function modifier_mutation_track:GetAuraSearchFlags()
return DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES
end
function modifier_mutation_track:GetAuraSearchTeam()
return DOTA_UNIT_TARGET_TEAM_ENEMY
end
function modifier_mutation_track:GetAuraSearchType()
return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC
end
function modifier_mutation_track:GetModifierAura()
return "modifier_imba_track_buff_ms"
end
function modifier_mutation_track:IsAura()
return true
end
function modifier_mutation_track:IsDebuff()
return true
end
function modifier_mutation_track:IsPurgable()
return false
end
function modifier_mutation_track:RemoveOnDeath()
return false
end
function modifier_mutation_track:IsHidden()
return false
end
function modifier_mutation_track:DeclareFunctions()
local decFuncs = {MODIFIER_PROPERTY_PROVIDES_FOW_POSITION,
MODIFIER_EVENT_ON_HERO_KILLED,
MODIFIER_PROPERTY_INCOMING_DAMAGE_PERCENTAGE}
return decFuncs
end
function modifier_mutation_track:GetModifierIncomingDamage_Percentage()
-- Only apply if the caster has #1 Talent: Tracked enemies take increased damage from any source
-- if self:GetCaster():HasTalent("special_bonus_imba_bounty_hunter_1") then
-- Gather talent info
-- local bonus_damage_pct = self:GetCaster():FindTalentValue("special_bonus_imba_bounty_hunter_1", "bonus_damage_pct")
-- return bonus_damage_pct
-- end
return nil
end
function modifier_mutation_track:OnHeroKilled(keys)
if IsServer() then
local target = keys.target
local reincarnate = keys.reincarnate
-- Only apply if the target of the track debuff is the one who just died
if target == self:GetParent() then
-- If the target was an illusion, do nothing
if not target:IsRealHero() then
return nil
end
-- If the target is reincarnating, do nothing
if reincarnate then
return nil
end
-- Find caster's allies nearby
local allies = FindUnitsInRadius(self:GetCaster():GetTeamNumber(),
self:GetParent():GetAbsOrigin(),
nil,
self.haste_radius,
DOTA_UNIT_TARGET_TEAM_FRIENDLY,
DOTA_UNIT_TARGET_HERO,
DOTA_UNIT_TARGET_FLAG_INVULNERABLE + DOTA_UNIT_TARGET_FLAG_OUT_OF_WORLD,
FIND_ANY_ORDER,
false
)
for _,ally in pairs(allies) do
-- Give allies bonus allied gold, except caster
if ally ~= self:GetCaster() then
ally:ModifyGold(self.bonus_gold_allies, true, 0)
SendOverheadEventMessage(ally, OVERHEAD_ALERT_GOLD, ally, self.bonus_gold_allies, nil)
end
end
-- Remove the debuff modifier from the enemy that just died
self:Destroy()
end
end
end
function modifier_mutation_track:GetModifierProvidesFOWVision()
return 1
end
function modifier_mutation_track:GetPriority()
return MODIFIER_PRIORITY_HIGH
end
function modifier_mutation_track:IsPermanent()
return false
end
modifier_mutation_track_buff_ms = modifier_mutation_track_buff_ms or class({})
function modifier_mutation_track_buff_ms:OnCreated()
-- Ability properties
self.particle_haste = "particles/units/heroes/hero_bounty_hunter/bounty_hunter_track_haste.vpcf"
-- Ability specials
self.ms_bonus_allies_pct = 20
if IsServer() then
-- Create haste particle
self.particle_haste_fx = ParticleManager:CreateParticle(self.particle_haste, PATTACH_ABSORIGIN_FOLLOW, self:GetParent())
ParticleManager:SetParticleControl(self.particle_haste_fx, 0, self:GetParent():GetAbsOrigin())
ParticleManager:SetParticleControl(self.particle_haste_fx, 1, self:GetParent():GetAbsOrigin())
ParticleManager:SetParticleControl(self.particle_haste_fx, 2, self:GetParent():GetAbsOrigin())
self:AddParticle(self.particle_haste_fx, false, false, -1, false, false)
end
end
function modifier_mutation_track_buff_ms:DeclareFunctions()
local decFuncs = {MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE}
return decFuncs
end
function modifier_mutation_track_buff_ms:GetModifierMoveSpeedBonus_Percentage()
return self.ms_bonus_allies_pct
end
|
local game = {
GAMESTATE = "",
SERVERGAMESTATE = "",
usersMoved = {},
newUserPositions = {},
crashedUsers = {}, -- remembers how many rounds the user has to wait
time = 0,
maxTime = 0,
timerEvent = nil,
time2 = 0,
maxTime2 = 0,
timerEvent2 = nil,
roundTime = 10,
winnerID = nil
}
local tease = {
"Server: Hah, you crashed, ",
"Server: Drunk driving, ",
"Server: Come on, ",
"Server: ",
}
local tease2 = {
"!",
"!",
", what was that?!",
", that was embarrassing...",
}
-- Possible gamestates:
-- "startup": camera should move to start line
-- "move": players are allowed to make their move.
-- "wait": waiting for server or other players, or for animtion
local scr = nil
local panel = require( "panel" )
function game:init()
scr = ui:newScreen( "game" )
scr:addPanel( "topPanel",
0, 0,
love.graphics.getWidth(), 35 )
scr:addFunction( "topPanel", "leave", 20, 0, "Leave", "q", game.close )
scr:addFunction( "topPanel", "help", love.graphics.getWidth() -160, 0, "Help", "h", game.toggleHelp )
self.winnerPanel = panel:new( love.graphics.getWidth()/3, love.graphics.getHeight()/2 - 100,
love.graphics.getWidth()/3, love.graphics.getFont():getHeight() + 10 )
self.userPanel = panel:new( 0, 0, 450, 19 )
end
function game:toggleHelp()
if scr:panelByName( "helpPanel" ) ~= nil then
scr:removePanel( "helpPanel" )
else
local width = 300
local x = love.graphics.getWidth() - 370
local y = 0
scr:addPanel( "helpPanel",
x,
80,
width, 410 )
scr:addHeader( "helpPanel", "h1", 0, y, "Help:" )
y = y + 30
scr:addText( "helpPanel", "helpText", 10, y, nil, 7, "Move your car by clicking the fields around it. Once every player has planned their move, the cars start driving. The places you can drive to this round depends on how your carr drove during the last movement phase: The same vector you moved last round will be added onto your car's position; from the resulting point, all neighbouring fields are available.\nBe the first to finsih the race, but don't leave the road or crash into other cars!\n\nUse W-A-S-D or cursor keys to move the camera, use mouse wheel or + and - to zoom.\n\nCrashes:\nStay on the road! If you leave the road, you will crash. The time you have to wait afterwards depends on how fast you were.\nYou can crash into other player's cars if you click on the same position. Whoever clicks second, crashes." )
scr:addFunction( "helpPanel", "close", 10, 360, "Close", "h", nil )
end
end
function game:show()
STATE = "Game"
game.winnerID = nil
map:removeAllCars()
if server then
-- For exery player who's playing, add one start position to the list of available positions:
local availablePositions = {}
local i = 1
for id, u in pairs( server:getUsers() ) do
if u.customData.ingame then
-- add one start position to the list of available positions:
table.insert( availablePositions, map.startPositions[i] )
i = i + 1
end
end
for id, u in pairs( server:getUsers() ) do
if u.customData.ingame then
local col = {
u.customData.red,
u.customData.green,
u.customData.blue,
255
}
local x, y = 0,0
local startPosNum = math.random(1,#availablePositions)
if availablePositions[startPosNum] then
x, y = availablePositions[startPosNum].x, availablePositions[startPosNum].y
table.remove( availablePositions, startPosNum )
end
map:newCar( u.id, x, y, col )
server:send( CMD.NEW_CAR, u.id .. "|" .. x .. "|" .. y )
else
-- If the client is not racing this round, let him look like he's
-- already moved:
server:setUserValue( u, "moved", true )
end
server:setUserValue( u, "crashed", false )
server:setUserValue( u, "numCrashes", 0 )
server:setUserValue( u, "topCrashSpeed", 0 )
server:setUserValue( u, "speed", 0 )
server:setUserValue( u, "maxSpeed", 0 )
end
game.crashedUsers = {}
-- Start the round after 3 seconds!
self.timerEvent = function()
game:startMovementRound()
end
self.maxTime = 3
self.time = 0
server:send( CMD.SERVERCHAT,
"Game starting. You have " .. ROUND_TIME .. " seconds for each move." )
updateAdvertisementInfo()
end
if not DEDICATED then
ui:setActiveScreen( nil )
stats:clear()
-- Do a cool camera startup swing:
map:camSwingAbort()
map:camSwingToPos( map.startProjPoint.x, map.startProjPoint.y, 1.5 )
map:camZoom( 0.6, 1.5 )
self.timerEvent2 = function()
if client then
game:camToCar( client:getID() )
end
end
self.maxTime2 = 2
self.time2 = 0
ui:setActiveScreen( scr )
end
end
function game:camToCar( id )
if client then
if map:hasCar( id ) then
local x, y = map:getCarPos( id )
x = x*GRIDSIZE
y = y*GRIDSIZE
map:camSwingToPos( x, y, 1 )
map:camZoom( 0.5, 1 )
end
end
end
function game:update( dt )
map:update( dt )
-- Timer1:
if self.maxTime > 0 then
self.time = self.time + dt
if self.time >= self.maxTime then
self.maxTime = 0
self.time = 0
self.timerEvent()
end
end
-- Timer2:
if self.maxTime2 > 0 then
self.time2 = self.time2 + dt
if self.time2 >= self.maxTime2 then
self.maxTime2 = 0
self.time2 = 0
self.timerEvent2()
end
end
end
function game:draw()
if client then
map:draw()
if self.GAMESTATE == "move" then
map:drawTargetPoints( client:getID() )
end
--[[if love.keyboard.isDown( " " ) then
map:drawCarInfo()
end]]
game:drawUserList()
if game.winnerID then
local users = network:getUsers()
if users and users[game.winnerID] then
self.winnerPanel:draw()
love.graphics.setColor( 64,255,64, 255 )
love.graphics.printf( users[game.winnerID].playerName .. " wins the round!",
love.graphics.getWidth()/3, love.graphics.getHeight()/2-95,
love.graphics.getWidth()/3, "center" )
end
end
map:drawDebug()
end
end
function game:drawUserList()
-- Print list of users:
local users, num = network:getUsers()
local x, y = 20, 60
local i = 1
if client and users then
for k, u in pairs( users ) do
self.userPanel:draw( x - 5, y - 3 )
love.graphics.setColor( 255,255,255, 255 )
love.graphics.printf( i .. ":", x, y, 20, "right" )
love.graphics.printf( u.playerName, x + 25, y, 250, "left" )
local dx = love.graphics.getFont():getWidth( u.playerName ) + 40
local lapString = ""
if map:hasCar( u.id ) then
local speedString = (u.customData.speed or 0).. " km/h"
love.graphics.print( speedString, x + dx, y )
dx = dx + love.graphics.getFont():getWidth( speedString ) + 15
lapString = "Lap: " .. map:getCarRound( u.id ) .. "/" .. (self.numberOfLaps or LAPS)
love.graphics.print( lapString, x + dx, y )
end
-- Show crashed users in list:
if u.customData.crashed == true then
love.graphics.setColor( 255, 128, 128, 255 )
dx = dx + love.graphics.getFont():getWidth( lapString ) + 20
local rounds = u.customData.waitingRounds or 1
love.graphics.print( "[Crashed! (" .. rounds .. ")]", x + dx, y )
elseif not u.customData.moved == true then
love.graphics.setColor( 255, 255, 128, 255 )
dx = dx + love.graphics.getFont():getWidth( lapString ) + 20
love.graphics.print( "[Waiting for move]", x + dx, y )
elseif not u.customData.ingame == true then
love.graphics.setColor( 128, 128, 255, 255 )
dx = dx + love.graphics.getFont():getWidth( lapString )
love.graphics.print( "[spectate]", x + dx, y )
end
if map:hasCar( u.id) then
map:getCar( u.id ):drawOnUI( 435, y + 5, 0.2 )
end
y = y + 20
i = i + 1
end
end
end
function game:keypressed( key )
end
function game:mousepressed( x, y, button )
if button == "l" then
if client then
if self.GAMESTATE == "move" then
-- Turn screen coordinates into grid coordinates:
local gX, gY = map:screenToGrid( x, y )
gX = math.floor( gX + 0.5 )
gY = math.floor( gY + 0.5 )
print( "Grid position clicked:", gX, gY )
if map:isThisAValidTargetPos( client:getID(), gX, gY ) then
print("\t->is valid.")
self:sendNewCarPosition( gX, gY )
end
end
end
end
end
function game:setState( state )
self.GAMESTATE = state
--[[if self.GAMESTATE == "move" then
if client then
map:resetCarNextMovement( client:getID() )
end
end]]
end
function game:newCar( msg )
if not server then
local id, x, y = msg:match( "(.*)|(.*)|(.*)")
id = tonumber(id)
x = tonumber(x)
y = tonumber(y)
local users = client:getUsers()
local u = users[id]
if u then
local col = {
u.customData.red,
u.customData.green,
u.customData.blue,
255
}
map:newCar( id, x, y, col )
end
end
end
function game:sendNewCarPosition( x, y )
-- CLIENT ONLY!
if client then
client:send( CMD.MOVE_CAR, x .. "|" .. y )
print("\t->Sent:", CMD.MOVE_CAR, x .. "|" .. y, os.time())
--map:setCarNextMovement( client:getID(), x, y )
end
end
function game:startMovementRound()
--SERVER ONLY!
if server then
self.SERVERGAMESTATE = "move"
game.usersMoved = {}
for k, u in pairs( server:getUsers() ) do
-- On all crashed users, count one down because we're starting a new round...
if game.crashedUsers[u.id] then
-- If this is the first crash round:
--[[if game.crashedUsers[u.id] == SKIP_ROUNDS_ON_CRASH + 1 then
if math.random(20) == 1 then
local i = math.random(#tease)
server:send( CMD.SERVERCHAT, tease[i] .. u.playerName .. tease2[i] )
end
end]]
game.crashedUsers[u.id] = game.crashedUsers[u.id] - 1
if game.crashedUsers[u.id] <= 0 then
-- If I've waited long enough, let me rejoin the game:
server:setUserValue( u, "crashed", false )
game.crashedUsers[u.id] = nil
end
end
-- If a user crashed, let everyone know:
if game.crashedUsers[u.id] then
server:setUserValue( u, "waitingRounds", game.crashedUsers[u.id] )
server:setUserValue( u, "crashed", true )
-- Consider this user to be finished...
game.usersMoved[u.id] = true
else
-- Only let users move if they haven't crashed and aren't spectating:
if u.customData.ingame then
server:send( CMD.GAMESTATE, "move", u )
server:setUserValue( u, "moved", false )
end
end
end
self.timerEvent = function() game:roundTimeout() end
self.maxTime = ROUND_TIME
self.time = 0
print("----------------------------------------")
print("New round starting:", os.time())
-- If all users crashed, continue:
game:checkForRoundEnd()
end
end
function game:roundTimeout()
local found = false
if server then
for k, u in pairs( server:getUsers() ) do
-- If the user did not move their car in time, move it according to last velocity:
if not self.usersMoved[u.id] and u.customData.ingame == true then
print("Round timeout for user:", u.id )
print("\tUser Data:")
for k, v in pairs( u.customData ) do
print("\t", k, v)
end
local x, y = map:getCarCenterVel( u.id )
-- Check for crashes:
game:validateCarMovement( u.id, x, y )
found = true
end
end
if found then
server:send( CMD.SERVERCHAT, "Server: Time up. Moving on..." )
end
end
end
function game:moveAll()
if server then
for k, u in pairs( server:getUsers() ) do
if u.customData.ingame and map:hasCar( u.id ) then
--local x, y = map:getCarPos( u.id )
local x,y = self.newUserPositions[u.id].x, self.newUserPositions[u.id].y
server:send( CMD.MOVE_CAR, u.id .. "|" .. x .. "|" .. y )
-- Calculate and send car speed:
local car = map:getCar( u.id )
local vX = x - map:TransCoordPtG(car.x)
local vY = y - map:TransCoordPtG(car.y)
local speed = math.floor( math.sqrt(vX*vX + vY*vY)*100 )/10
server:setUserValue( u, "speed", speed )
if not u.customData.maxSpeed or u.customData.maxSpeed < speed then
server:setUserValue( u, "maxSpeed", speed )
end
if DEDICATED then
map:setCarPosDirectly( u.id, x, y )
end
end
end
self.timerEvent = function()
game:checkForWinner()
if not game.winnerID then
game:startMovementRound()
else
game:sendWinner( game.winnerID )
local winner = server:getUsers()[game.winnerID]
if winner then
server:setUserValue( winner, "roundsWon", winner.customData.roundsWon + 1 )
end
self.timerEvent = game.sendBackToLobby
self.maxTime = 5
self.time = 0
if DEDICATED then
if server:getUsers()[game.winnerID] and
server:getUsers()[game.winnerID].playerName then
utility.log( "[" .. os.time() .. "] Winner: " ..
server:getUsers()[game.winnerID].playerName )
end
end
end
end
self.maxTime = 1.2
self.time = 0
end
end
function game:validateCarMovement( id, x, y )
--SERVER ONLY!
if server then
-- if this user has not moved yet:
if self.usersMoved[id] == nil then
-- map:setCarPos( id, x, y )
--map:setCarPosDirectly(id, x, y) --car-id as number, pos as Gridpos
local oldX, oldY = map:getCarPos( id )
local user = server:getUsers()[id]
print("\tValidating at:", os.time())
print("\tPrevious positions:", id, map:getCar(id), oldX, oldY)
if map:isThisAValidTargetPos( id, x, y ) then
print("\tPossition is valid.")
else
print("\tPossition is NOT valid. Traceback:", debug.traceback())
server:send( CMD.SERVERCHAT,
"DEBUG: Something went wrong. " .. server:getUsers()[id].playerName .. "'s movement was invalid.")
end
if not oldX or not oldY then
print("\tWARNING: oldX or oldY aren't set!", debug.traceback())
server:send( CMD.SERVERCHAT, "DEBUG: somthing went wrong with the car position of " .. server:getUsers()[id].playerName .. "." )
oldX, oldY = 0, 0
end
-- Step along the path and check if there's a collision. If so, stop there.
local p = {x = oldX, y = oldY }
local diff = {x = x-oldX, y = y-oldY}
local dist = utility.length( diff )
local speed = math.floor( dist*100 )/10
print("\tDelta:", diff.x, diff.y)
print("\tSpeed:", speed )
diff = utility.normalize(diff)
print("\tDist:", dist)
-- Step forward in steps of 0.5 length - this makes sure no small gaps are jumped!
local crashed, crashSiteFound = false, false
local movedDist = 0
for l = 0.5, dist, 0.5 do
p = {x = oldX + l*diff.x, y = oldY + l*diff.y }
if not map:isPointOnRoad( p.x*GRIDSIZE, p.y*GRIDSIZE, 0 ) then
crashed = true
break
end
movedDist = l
end
-- Also check the end position!!
if not crashed then
-- I have managed to move the entire distance!
movedDist = dist
if not map:isPointOnRoad( x*GRIDSIZE, y*GRIDSIZE, 0 ) then
crashed = true
end
end
local crashedIntoCar = false
-- If I managed to move the full distance, then check if there's already a car there
if movedDist == dist then
for id2, bool in pairs( self.usersMoved ) do
if bool then
if self.newUserPositions[id2] then
if self.newUserPositions[id2].x == x and
self.newUserPositions[id2].y == y then
crashedIntoCar = true
crashed = true
break
end
end
end
end
end
if crashed then
print("\tCrashed")
-- Step backwards:
for lBack = movedDist-0.5, 0, -0.5 do
p = {x = oldX + lBack*diff.x, y = oldY + lBack*diff.y }
p.x = math.floor(p.x)
p.y = math.floor(p.y)
if map:isPointOnRoad( p.x*GRIDSIZE, p.y*GRIDSIZE, 0 ) then
crashSiteFound = true
x, y = p.x, p.y
break
end
end
-- remembers how many rounds the user has to wait
if crashedIntoCar then
game.crashedUsers[id] = SKIP_ROUNDS_CAR_CAR + 1
else
game.crashedUsers[id] = game:speedToCrashTimeout( speed )
end
if user then
server:setUserValue( user, "numCrashes", user.customData.numCrashes + 1 )
if speed > user.customData.topCrashSpeed then
server:setUserValue( user, "topCrashSpeed", speed )
end
end
end
if crashed and not crashSiteFound then
x, y = oldX, oldY
print("\tNo crash site found, placed to old pos:", oldX, oldY)
end
self.usersMoved[id] = true
self.newUserPositions[id] = {x=x, y=y}
if user then
-- tell this user to wait!
server:send( CMD.GAMESTATE, "wait", user )
-- Let all users know this user has already moved:
server:setUserValue( user, "moved", true )
end
game:checkForRoundEnd()
end
end
end
function game:checkForRoundEnd()
-- Check if all users have sent their move:
local doneMoving = true
for k, u in pairs( server:getUsers() ) do
if u.customData.ingame and not self.usersMoved[u.id] then
doneMoving = false
break
end
end
-- If all users have sent the move, go on to next round:
if doneMoving then
self:moveAll()
end
end
-- This function checks for a winner. A winner is found if a user has passed the startline
-- LAP times. If more than one players have done so, the winner is the one who is _furthest_
-- from the start line (i.e. crossed the line with the most speed/first)
function game:checkForWinner()
if server and not game.winnerID then
local potentialWinners = {}
for k, u in pairs( server:getUsers() ) do
if u.customData.ingame then
if map:getCarRound( u.id ) >= LAPS + 1 then
table.insert( potentialWinners, u.id )
end
end
end
-- Find the winner who has the least
local winnerID
local maxDist = -math.huge
for k, id in pairs( potentialWinners ) do
local car = map:getCar( id )
if car then
local x,y = car:getPos()
local p = {x=x, y=y}
local dist = utility.linePointDist( map.startLine.p1,map.startLine.p2, p )
print( x, y, map.startLine.p1.x, map.startLine.p1.y )
if dist > maxDist then -- so far the first player:
winnerID = id
maxDist = dist
end
end
end
if winnerID then
game.winnerID = winnerID
print("WINNER FOUND!", game.winnerID )
else
-- Fallback, just in case:
if #potentialWinners > 0 then
game.winnerID = potentialWinners[1]
end
end
end
end
function game:moveCar( msg )
-- CLIENT ONLY!
if client then
local id, x, y = msg:match( "(.*)|(.*)|(.*)" )
id = tonumber(id)
x = tonumber(x)
y = tonumber(y)
map:setCarPos( id, x, y )
end
end
function game:playerWins( msg )
if client then
game.winnerID = tonumber(msg)
game:camToCar( game.winnerID )
self.timerEvent2 = game.zoomOut
self.maxTime2 = 3
self.time2 = 0
end
end
function game:sendWinner()
if server then
server:send( CMD.PLAYER_WINS, game.winnerID )
end
end
function game:sendBackToLobby()
if server then
-- Create and send statustics:
game:sendStats()
server:send( CMD.BACK_TO_LOBBY, "" )
if DEDICATED then
lobby:show() -- must be called AFTER generating the stats!
end
end
end
function game:sendStats()
-- SERVER ONLY!
if not server then return end
local users = network:getUsers()
-- Create and send top speed string:
local statStr = "Top Speed:|km/h|"
for k, u in pairs( users ) do
if u.customData.ingame then
statStr = statStr .. u.id .. " " .. u.customData.maxSpeed .. "|"
end
end
server:send( CMD.STAT, statStr )
-- Create and send crashes string:
local statStr = "Crashes:||"
for k, u in pairs( users ) do
if u.customData.ingame then
statStr = statStr .. u.id .. " " .. u.customData.numCrashes .. "|"
end
end
server:send( CMD.STAT, statStr )
-- Create and send top speed at crashes:
local statStr = "Worst crash:|km/h|"
for k, u in pairs( users ) do
if u.customData.ingame then
statStr = statStr .. u.id .. " " .. u.customData.topCrashSpeed .. "|"
end
end
server:send( CMD.STAT, statStr )
-- Create and send top speed at crashes:
local statStr = "Rounds won:||"
for k, u in pairs( users ) do
if u.customData.ingame then
statStr = statStr .. u.id .. " " .. u.customData.roundsWon .. "|"
end
end
server:send( CMD.STAT, statStr )
end
function game:zoomOut()
local cX = map.Boundary.minX + (map.Boundary.maxX - map.Boundary.minX)*0.5
local cY = map.Boundary.minY + (map.Boundary.maxY - map.Boundary.minY)*0.5
map:camSwingToPos( cX, cY )
end
function game:synchronizeCars( user )
if server then
for k, u in pairs( server:getUsers() ) do
if u.customData.ingame then
if map:hasCar( u.id ) then
local c = map:getCar( u.id )
server:send( CMD.NEW_CAR, u.id .. "|" .. c.targetX .. "|" .. c.targetY, user )
end
end
end
end
end
function game:speedToCrashTimeout( speed )
return SKIP_ROUNDS_COLLISION_MIN + math.floor(speed*SKIP_ROUNDS_COLLISION_PER_10_KMH/10) + 1
end
function game:getNumUsersPlaying()
local num = 0
for k, u in pairs( server:getUsers() ) do
if u.customData.ingame == true then
num = num + 1
end
end
return num
end
function game:close()
local commands = {}
commands[1] = { txt = "Yes", key = "y", event = function() network:closeConnection() end }
commands[2] = { txt = "No", key = "n" }
scr:newMsgBox( "Game in progress!", "Are you sure you want to leave?", nil, nil, nil, commands)
end
return game
|
slot0 = class("ShipStatus")
slot0.flagList = {
"inChapter",
"inFleet",
"inElite",
"inActivity",
"inPvP",
"inExercise",
"inEvent",
"inClass",
"inTactics",
"inBackyard",
"inAdmiral",
"inWorld",
"isActivityNpc",
"inGuildEvent",
"inGuildBossEvent"
}
slot0.checkShipFlag = function (slot0, slot1, slot2)
if type(defaultValue(slot1[slot2], slot0.TAG_HIDE_BASE[slot2])) == "boolean" then
return not slot3 and slot0:getFlag(slot2)
elseif type(slot3) == "number" then
return slot0:getFlag(slot2, slot3)
end
end
slot0.ShipStatusToTag = function (slot0, slot1)
if slot0:checkShipFlag(slot1, "inChapter") then
return {
"shipstatus",
"red",
i18n("word_status_inFight")
}
elseif slot0:checkShipFlag(slot1, "inFleet") then
if math.fmod(slot0:getFleetId(), 10) >= 1 and slot2 <= 6 then
return {
"ui/dockyardui_atlas",
"biandui0" .. slot2,
""
}
else
return {
"shipstatus",
"red",
Fleet.DEFAULT_NAME_FOR_DOCKYARD[slot0:getFleetId()]
}
end
elseif slot0:checkShipFlag(slot1, "inElite") then
return {
"shipstatus",
"red",
i18n("word_status_inHardFormation")
}
elseif slot0:checkShipFlag(slot1, "inActivity") then
return {
"shipstatus",
"red",
i18n("word_status_challenge")
}
elseif slot0:checkShipFlag(slot1, "inPvP") then
return {
"shipstatus",
"red",
i18n("word_status_inPVP")
}
elseif slot0:checkShipFlag(slot1, "inEvent") then
return {
"shipstatus",
"green",
i18n("word_status_inEvent")
}
elseif slot0:checkShipFlag(slot1, "inBackyard") then
if slot0.state == Ship.STATE_REST then
return {
"shipstatus",
"purple",
i18n("word_status_rest")
}
elseif slot0.state == Ship.STATE_TRAIN then
return {
"shipstatus",
"purple",
i18n("word_status_train")
}
end
elseif slot0:checkShipFlag(slot1, "inClass") then
return {
"shipstatus",
"blue",
i18n("word_status_inClass")
}
elseif slot0:checkShipFlag(slot1, "inTactics") then
return {
"shipstatus",
"blue",
i18n("word_status_inTactics")
}
elseif slot0:checkShipFlag(slot1, "inAdmiral") then
return {
"shipstatus",
"light_green",
i18n("common_flag_ship")
}
elseif slot0:checkShipFlag(slot1, "inWorld") then
return {
"shipstatus",
"red",
i18n("word_status_world")
}
end
end
slot0.FILTER_SHIPS_FLAGS_1 = {
inExercise = false,
inChapter = true,
inClass = true,
inFleet = false,
inPvP = false,
inActivity = true,
inTactics = false,
inElite = false,
inGuildEvent = true,
inEvent = true,
inBackyard = false,
isActivityNpc = true,
inWorld = true,
inAdmiral = true
}
slot0.FILTER_SHIPS_FLAGS_2 = {
inExercise = true,
inChapter = true,
inClass = true,
inFleet = true,
inPvP = true,
inActivity = true,
inTactics = true,
inElite = true,
inGuildEvent = true,
inEvent = true,
inBackyard = true,
inGuildBossEvent = true,
isActivityNpc = true,
inWorld = true,
inAdmiral = true
}
slot0.FILTER_SHIPS_FLAGS_3 = {
inExercise = false,
inChapter = true,
inClass = true,
inFleet = false,
inPvP = false,
inActivity = true,
inTactics = false,
inElite = false,
inGuildEvent = true,
inEvent = true,
inBackyard = false,
isActivityNpc = true,
inWorld = true,
inAdmiral = false
}
slot0.FILTER_SHIPS_FLAGS_4 = {
inExercise = true,
inChapter = true,
inClass = true,
inFleet = true,
inPvP = true,
inActivity = true,
inTactics = true,
inElite = true,
inGuildEvent = true,
inEvent = true,
inBackyard = true,
inGuildBossEvent = true,
isActivityNpc = true,
inWorld = true,
inAdmiral = true
}
slot0.TAG_HIDE_ALL = {
inExercise = true,
inChapter = true,
inClass = true,
inFleet = true,
inPvP = true,
inActivity = true,
inTactics = true,
inElite = true,
inBackyard = true,
inEvent = true,
isActivityNpc = true,
inWorld = true,
inAdmiral = true
}
slot0.TAG_HIDE_BASE = {
inExercise = true,
inChapter = false,
inClass = false,
inFleet = false,
inPvP = false,
inActivity = false,
inTactics = false,
inElite = true,
inBackyard = false,
inEvent = false,
isActivityNpc = false,
inWorld = false,
inAdmiral = false
}
slot0.TAG_HIDE_ACTIVITY_BOSS = {
inClass = true,
inChapter = true,
inBackyard = true,
inFleet = true,
inPvP = true,
inTactics = true,
inAdmiral = true
}
slot0.TAG_HIDE_BACKYARD = {
inExercise = false,
inChapter = true,
inEvent = true,
inPvP = true,
inActivity = true,
inTactics = true
}
slot0.TAG_HIDE_PVP = {
inExercise = false,
inChapter = true,
inPvP = true,
inFleet = true,
inClass = true,
inActivity = true,
inTactics = true,
inBackyard = true
}
slot0.TAG_HIDE_DEFENSE = {
inExercise = false,
inChapter = true,
inClass = true,
inFleet = true,
inPvP = true,
inActivity = true,
inTactics = true,
inBackyard = true,
inEvent = true
}
slot0.TAG_HIDE_LEVEL = {
inBackyard = true,
inFleet = true,
inClass = true,
inActivity = true,
inTactics = true,
inAdmiral = true
}
slot0.TAG_HIDE_NORMAL = {
inExercise = false,
inClass = true,
inPvP = true,
inActivity = true,
inTactics = true,
inBackyard = true
}
slot0.TAG_HIDE_CHALLENGE = {
inBackyard = true,
inFleet = true,
inClass = true,
inActivity = true,
inTactics = true,
inAdmiral = true
}
slot0.TAG_HIDE_EVENT = {
inExercise = false,
inClass = true,
inActivity = true,
inTactics = true,
inBackyard = true
}
slot0.TAG_HIDE_TACTICES = {
inExercise = false,
inChapter = true,
inClass = true,
inFleet = true,
inPvP = true,
inActivity = true,
inTactics = true,
inBackyard = true,
inEvent = true
}
slot0.TAG_HIDE_ADMIRAL = {
inExercise = false,
inChapter = true,
inClass = true,
inFleet = true,
inPvP = true,
inActivity = true,
inTactics = true,
inBackyard = true,
inEvent = true
}
slot0.TAG_HIDE_FORMATION = {
inExercise = false,
inClass = true,
inPvP = true,
inActivity = true,
inTactics = true,
inBackyard = true
}
slot0.TAG_HIDE_WORLD = {
inFleet = true,
inActivity = true
}
slot0.TAG_HIDE_DESTROY = {
inElite = false
}
slot0.TAG_BLOCK_EVENT = {
inEvent = true
}
slot0.TAG_BLOCK_PVP = {
inEvent = true
}
slot0.TAG_BLOCK_BACKYARD = {
inClass = true
}
slot0.STATE_CHANGE_OK = -1
slot0.STATE_CHANGE_FAIL = 0
slot0.STATE_CHANGE_CHECK = 1
slot0.STATE_CHANGE_TIP = 2
slot1 = {
inFleet = {
inEvent = 0
},
inElite = {
inEvent = 0,
inElite = 0
},
inActivity = {
isActivityNpc = 0,
inEvent = 0,
inActivity = 0
},
inEvent = {
inEvent = 0,
inChapter = 0,
isActivityNpc = 0,
inFleet = 1,
inPvP = 1
},
inClass = {
isActivityNpc = 0,
inClass = 0,
inBackyard = 1
},
inTactics = {
inTactics = 0
},
inBackyard = {
inClass = 0,
isActivityNpc = 0
},
inWorld = {
isActivityNpc = 0
},
onPropose = {
inChapter = 0,
inEvent = 0
},
onModify = {
inChapter = 0
},
onDestroy = {
inExercise = 1,
inChapter = 0,
inClass = 0,
inFleet = 1,
inPvP = 1,
inActivity = 0,
inTactics = 1,
inBackyard = 1,
inGuildEvent = 0,
inEvent = 0,
inGuildBossEvent = 1,
isActivityNpc = 0,
inWorld = 0,
inAdmiral = 0
}
}
slot2 = {
inChapter = {
tips_block = "word_shipState_fight"
},
inFleet = {
tips_block = "word_shipState_fight"
},
inElite = {
tips_block = "word_shipState_fight"
},
inActivity = {
tips_block = "word_shipState_fight"
},
inPvP = {
tips_block = "word_shipState_fight"
},
inExercise = {
tips_block = "word_shipState_fight"
},
inEvent = {
tips_block = "word_shipState_event"
},
inClass = {
tips_block = "word_shipState_study"
},
inTactics = {
tips_block = "word_shipState_tactics"
},
inBackyard = {
tips_block = "word_shipState_rest"
},
inAdmiral = {
tips_block = "playerinfo_ship_is_already_flagship"
},
inGuildEvent = {
tips_block = "word_shipState_guild_event"
},
inGuildBossEvent = {
tips_block = "word_shipState_guild_event"
},
isActivityNpc = {
tips_block = "word_shipState_npc"
},
inWorld = {
tips_block = "word_shipState_world"
}
}
slot0.ShipStatusCheck = function (slot0, slot1, slot2, slot3)
slot4, slot5 = slot0:ShipStatusConflict(slot1, slot3)
if slot4 == slot0.STATE_CHANGE_FAIL then
return false, i18n(slot5)
elseif slot4 == slot0.STATE_CHANGE_CHECK then
if slot2 then
return slot0.ChangeStatusCheckBox(slot5, slot1, slot2)
else
return false
end
elseif slot4 == slot0.STATE_CHANGE_TIP then
return slot0.ChangeStatusTipBox(slot5, slot1)
elseif slot4 == slot0.STATE_CHANGE_OK then
return true
end
end
slot0.ShipStatusConflict = function (slot0, slot1, slot2)
slot3 = slot0[slot0]
slot2 = slot2 or {}
for slot7, slot8 in ipairs(slot1.flagList) do
if slot3[slot8] == slot1.STATE_CHANGE_FAIL and slot1:getFlag(slot8, slot2[slot8]) then
return slot1.STATE_CHANGE_FAIL, slot2[slot8].tips_block
end
end
for slot7, slot8 in ipairs(slot1.flagList) do
if slot3[slot8] == slot1.STATE_CHANGE_CHECK and slot1:getFlag(slot8, slot2[slot8]) then
return slot1.STATE_CHANGE_CHECK, slot8
end
end
for slot7, slot8 in ipairs(slot1.flagList) do
if slot3[slot8] == slot1.STATE_CHANGE_TIP and slot1:getFlag(slot8, slot2[slot8]) then
return slot1.STATE_CHANGE_TIP, slot8
end
end
return slot1.STATE_CHANGE_OK
end
slot0.ChangeStatusCheckBox = function (slot0, slot1, slot2)
if slot0 == "inBackyard" then
pg.MsgboxMgr.GetInstance():ShowMsgBox({
content = i18n("ship_vo_moveout_backyard"),
onYes = function ()
pg.m02:sendNotification(GAME.EXIT_SHIP, {
callback = slot0,
shipId = slot1.id
})
end
})
return false, nil
elseif slot0 == "inFleet" then
pg.MsgboxMgr.GetInstance().ShowMsgBox(slot3, {
content = i18n("ship_vo_moveout_formation"),
onYes = function ()
slot0 = getProxy(FleetProxy)
if slot0:getFleetByShip(slot0):isFirstFleet() then
slot2, slot3 = slot1:canRemoveByShipId(slot0.id)
if not slot2 then
if slot3 == TeamType.Vanguard then
pg.TipsMgr.GetInstance():ShowTips(i18n("ship_vo_vanguardFleet_must_hasShip"))
elseif slot3 == TeamType.Main then
pg.TipsMgr.GetInstance():ShowTips(i18n("ship_vo_mainFleet_must_hasShip"))
end
return
end
end
slot1:removeShip(slot0)
pg.m02:sendNotification(GAME.UPDATE_FLEET, {
callback = slot1,
fleet = slot1
})
end
})
return false, nil
elseif slot0 == "inPvP" then
pg.MsgboxMgr.GetInstance().ShowMsgBox(slot3, {
content = i18n("ship_vo_moveout_formation"),
onYes = function ()
slot0 = getProxy(FleetProxy)
slot2, slot3 = slot0:getFleetByShip(slot0).canRemoveByShipId(slot1, slot0.id)
if not slot2 then
if slot3 == TeamType.Vanguard then
pg.TipsMgr.GetInstance():ShowTips(i18n("ship_vo_vanguardFleet_must_hasShip"))
elseif slot3 == TeamType.Main then
pg.TipsMgr.GetInstance():ShowTips(i18n("ship_vo_mainFleet_must_hasShip"))
end
else
slot1:removeShip(slot0)
pg.m02:sendNotification(GAME.UPDATE_FLEET, {
callback = slot1,
fleet = slot1
})
end
end
})
return false, nil
elseif slot0 == "inExercise" then
slot5, slot6 = getProxy(MilitaryExerciseProxy).getExerciseFleet(slot3).canRemoveByShipId(slot4, slot1.id)
if not slot5 then
pg.MsgboxMgr.GetInstance():ShowMsgBox({
content = i18n("exercise_clear_fleet_tip"),
onYes = function ()
slot0:removeShip(slot0)
pg.m02:sendNotification(GAME.UPDATE_EXERCISE_FLEET, {
fleet = slot0,
callback = GAME.UPDATE_EXERCISE_FLEET
})
end
})
else
pg.MsgboxMgr.GetInstance().ShowMsgBox(slot7, {
content = i18n("exercise_fleet_exit_tip"),
onYes = function ()
slot0:removeShip(slot0)
pg.m02:sendNotification(GAME.UPDATE_EXERCISE_FLEET, {
fleet = slot0,
callback = GAME.UPDATE_EXERCISE_FLEET
})
end
})
end
return false, nil
elseif slot0 == "inTactics" then
pg.MsgboxMgr.GetInstance().ShowMsgBox(slot3, {
content = i18n("tactics_lesson_cancel"),
onYes = function ()
slot0 = getProxy(NavalAcademyProxy)
pg.m02:sendNotification(GAME.CANCEL_LEARN_TACTICS, {
callback = slot1,
shipId = slot0:getStudentIdByShipId(slot0.id),
type = Student.CANCEL_TYPE_MANUAL
})
end
})
return false, nil
elseif slot0 == "inGuildBossEvent" then
pg.MsgboxMgr.GetInstance().ShowMsgBox(slot3, {
content = i18n("word_shipState_guild_boss"),
onYes = function ()
if not getProxy(GuildProxy):getRawData() then
return
end
if not slot0:GetActiveEvent() then
return
end
if not slot1:GetBossMission() or not slot2:IsActive() then
return
end
if not slot2:GetFleetUserId(getProxy(PlayerProxy):getRawData().id, slot0.id) then
return
end
slot5 = Clone(slot4)
slot5:RemoveUserShip(slot3, slot0.id)
pg.m02:sendNotification(GAME.GUILD_UPDATE_BOSS_FORMATION, {
force = true,
editFleet = {
[slot5.id] = slot5
},
callback = slot1
})
end
})
return false, nil
end
return true
end
slot0.ChangeStatusTipBox = function (slot0, slot1)
if slot0 == "inElite" then
pg.MsgboxMgr.GetInstance():ShowMsgBox({
hideNo = true,
content = i18n("ship_vo_moveout_hardFormation")
})
end
return true
end
slot0.canDestroyShip = function (slot0, slot1)
if slot0:isBluePrintShip() then
return false, i18n("blueprint_destory_tip")
elseif slot0:GetLockState() == Ship.LOCK_STATE_LOCK then
return false, i18n("ship_vo_locked")
elseif slot0:isMetaShip() then
return false, i18n("meta_destroy_tip")
end
return slot0.ShipStatusCheck("onDestroy", slot0, slot1)
end
return slot0
|
----------------------------------------
--
-- TabbableVector3Input.lua
--
-- Creates a frame containing a label and a text input control.
-- that can be linked to other TabbableVector3Input Copied mostly from LabeldTextInput
-- but will be replace when we go to Roact
----------------------------------------
local GuiUtilities = require(script.Parent.GuiUtilities)
local FIRST_COLUMN_WIDTH = 90
local FIRST_COLUMN_OFFSET = GuiUtilities.StandardLineLabelLeftMargin
local SECOND_COLUMN_OFFSET = FIRST_COLUMN_WIDTH + FIRST_COLUMN_OFFSET
local PADDING = 4
local FONT = Enum.Font.SourceSans
local FONT_SIZE = 14
local TEXTBOX_WIDTH = 120
local TEXTBOX_HEIGHT = 22 -- does not include padding
local TEXTBOX_LABEL_WIDTH = 16
local TEXTBOX_OFFSET = TEXTBOX_LABEL_WIDTH + PADDING
local TEXTBOX_SIZE_PADDING = TEXTBOX_OFFSET + FIRST_COLUMN_OFFSET
local LABEL_BACKGROUND_DARK_COLOR = Color3.fromRGB(53, 53, 53)
local LABEL_BACKGROUND_COLOR = Color3.fromRGB(245, 245, 245)
local BORDER_COLOR = Color3.fromRGB(182, 182, 182)
local BORDER_COLOR_DARK = Color3.fromRGB(26, 26, 26)
local SELECTED_BORDER_COLOR = Color3.fromRGB(0, 162, 255)
local WARNING_RED = Color3.fromRGB(216, 104, 104)
local DEFAULT_WARNING_MESSAGE = "Input is not a valid number."
TabbableVector3Input = {}
TabbableVector3Input.__index = TabbableVector3Input
function getTextBoxCheckFunc(self, index)
return function()
-- if we encounter a tab key, it will be consumed to pass focus to the next textBox
if self._textBox[index].Text and string.find(self._textBox[index].Text, '\t') then
-- remove the tab character since we consumed it
self._textBox[index].Text = self._textBox[index].Text:gsub('\t', '')
--hack to handle the focuslost case
if not self._warning[index] then
self._textFrame[index].BorderColor3 = BORDER_COLOR
end
local nextInd = index + 1
if nextInd > 3 and self._nextTabTarget then
self._nextTabTarget:CaptureFocus()
else
nextInd = nextInd > 3 and 1 or nextInd
self._textBox[nextInd]:CaptureFocus()
end
end
-- Never let the text be too long.
-- Careful here: we want to measure number of graphemes, not characters,
-- in the text, and we want to clamp on graphemes as well.
if (utf8.len(self._textBox[index].Text) > self._MaxGraphemes) then
local count = 0
for start, stop in utf8.graphemes(self._textBox[index].Text) do
count = count + 1
if (count > self._MaxGraphemes) then
-- We have gone one too far.
-- clamp just before the beginning of this grapheme.
self._textBox[index].Text = string.sub(self._textBox[index].Text, 1, start-1)
break
end
end
-- Don't continue with rest of function: the resetting of "Text" field
-- above will trigger re-entry. We don't need to trigger value
-- changed function twice.
return
end
local num = tonumber(self._textBox[index].Text)
local validEntry, warningMessage
if self._warningFunc then
validEntry, warningMessage = self._warningFunc(self._textBox[index].Text, index)
else
validEntry = num or self._textBox[index].Text == ''
warningMessage = DEFAULT_WARNING_MESSAGE
end
if validEntry then
if self._warning[index] then
self._warning[index].Parent = nil
self._textFrame[index].BorderColor3 = BORDER_COLOR
self._warning[index] = nil
end
self._value[index] = num
else
-- layour Orders of the index are already set to (2*index - 1)
-- this way errors for the appropriate index are just 2 * index
if not self._warning[index] then
local warning = Instance.new("TextLabel")
warning.BackgroundTransparency = 1
warning.Text = warningMessage
warning.Font = FONT
warning.TextSize = FONT_SIZE
warning.TextColor3 = WARNING_RED
warning.TextXAlignment = Enum.TextXAlignment.Left
warning.Size = UDim2.new(1, 0, 0, TEXTBOX_HEIGHT)
warning.LayoutOrder = index * 2
warning.Parent = self._textBoxFrame
self._warning[index] = warning
self._textFrame[index].BorderColor3 = WARNING_RED
else
self._warning[index].Text = warningMessage
end
end
end
end
local function textBoxHelper(self, parent, name, initialValues, index, layoutOrder)
local initTheme = settings().Studio["UI Theme"]
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, TEXTBOX_WIDTH, 0, TEXTBOX_HEIGHT)
frame.BorderColor3 = initTheme == Enum.UITheme.Dark and BORDER_COLOR_DARK or BORDER_COLOR
frame.BackgroundTransparency = 0
frame.LayoutOrder = layoutOrder
frame.Parent = parent
self._textFrame[index] = frame
local label = Instance.new("TextLabel")
label.Text = name
label.Size = UDim2.new(0, TEXTBOX_LABEL_WIDTH, 1, 0)
label.BackgroundColor3 = initTheme == Enum.UITheme.Dark and LABEL_BACKGROUND_DARK_COLOR or LABEL_BACKGROUND_COLOR
label.BorderSizePixel = 0
label.Parent = frame
local box = Instance.new("TextBox")
box.ClearTextOnFocus = false
box.PlaceholderText = ""
box.Text = type(initialValues) == "table" and tostring(initialValues[index])
box.Size = UDim2.new(1, -TEXTBOX_SIZE_PADDING, 1, 0)
box.Position = UDim2.new(0, TEXTBOX_OFFSET, 0, 0)
box.BackgroundTransparency = 1
box.Font = FONT
box.TextSize = FONT_SIZE
box.TextXAlignment = Enum.TextXAlignment.Left
box.Parent = frame
self._textBox[index] = box
box.Focused:connect(self:getChangeBorderColorFunc(index, SELECTED_BORDER_COLOR))
box.FocusLost:connect(self:getChangeBorderColorFunc(index, BORDER_COLOR))
box:GetPropertyChangedSignal("Text"):connect(getTextBoxCheckFunc(self, index))
GuiUtilities.syncGuiElementFontColor(label)
GuiUtilities.syncGuiElementFontColor(box)
GuiUtilities.syncGuiElementInputFieldColor(box)
GuiUtilities.syncGuiElementBackgroundColor(frame)
--label color doesn't exist as a backgroundColor signal
settings().Studio.ThemeChanged:connect(function()
local currTheme = settings().Studio["UI Theme"]
if currTheme == Enum.UITheme.Dark then
label.BackgroundColor3 = LABEL_BACKGROUND_DARK_COLOR
frame.BorderColor3 = BORDER_COLOR_DARK
else
label.BackgroundColor3 = LABEL_BACKGROUND_COLOR
frame.BorderColor3 = BORDER_COLOR
end
end)
if type(initialValues) == "table" then
self._value[index] = initialValues[index]
end
end
-- on selected blue color and revert back
function TabbableVector3Input:getChangeBorderColorFunc(index, color)
return function()
if not self._warning[index] then
self._textFrame[index].BorderColor3 = color
end
end
end
function TabbableVector3Input.new(categoryLabel, initialValues)
local self = {}
setmetatable(self, TabbableVector3Input)
-- Note: we are using "graphemes" instead of characters.
-- In modern text-manipulation-fu, what with internationalization,
-- emojis, etc, it's not enough to count characters, particularly when
-- concerned with "how many <things> am I rendering?".
-- We are using the
self._MaxGraphemes = 10
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 0, 0)
frame.BackgroundTransparency = 1
self._frame = frame
local label = Instance.new("TextLabel")
label.Text = categoryLabel
label.Font = FONT
label.TextSize = FONT_SIZE
label.TextXAlignment = Enum.TextXAlignment.Left
label.Size = UDim2.new(0, FIRST_COLUMN_WIDTH, 0, TEXTBOX_HEIGHT)
label.Position = UDim2.new(0, FIRST_COLUMN_OFFSET, 0, 0)
label.BorderSizePixel = 0
label.BackgroundTransparency = 1
label.Parent = frame
self._label = label
local fieldFrame = Instance.new("Frame")
fieldFrame.Position = UDim2.new(0, SECOND_COLUMN_OFFSET, 0, 0)
fieldFrame.Size = UDim2.new(1, -SECOND_COLUMN_OFFSET, 0, 0)
fieldFrame.BackgroundTransparency = 1
fieldFrame.BorderSizePixel = 0
fieldFrame.Parent = frame
self._textBoxFrame = fieldFrame
self._value = {}
self._textBox = {}
self._textFrame = {}
self._warning = {}
-- odd numbers in layout order are for textbox, and even numbers are for errors when they show up
textBoxHelper(self, fieldFrame, 'X', initialValues, 1, 1)
textBoxHelper(self, fieldFrame, 'Y', initialValues, 2, 3)
textBoxHelper(self, fieldFrame, 'Z', initialValues, 3, 5)
local uiLayout = Instance.new("UIListLayout")
uiLayout.Padding = UDim.new(0, PADDING)
uiLayout.SortOrder = Enum.SortOrder.LayoutOrder
uiLayout.FillDirection = Enum.FillDirection.Vertical
uiLayout.Parent = fieldFrame
-- height depends on the number of textboxes and number of errors in those textboxes
-- can not bind this to listen to absolute size change because
-- we are at our limit of event re-entry here
local function updateFrameSize()
self._frame.Size = UDim2.new(1, 0, 0, uiLayout.AbsoluteContentSize.Y)
end
uiLayout:GetPropertyChangedSignal("AbsoluteContentSize"):connect(updateFrameSize)
updateFrameSize()
-- listen for theme color changes
GuiUtilities.syncGuiElementFontColor(label)
GuiUtilities.syncGuiElementBackgroundColor(frame)
GuiUtilities.syncGuiElementBorderColor(frame)
return self
end
function TabbableVector3Input:GetFrame()
return self._frame
end
function TabbableVector3Input:GetVector3()
if self._value[1] and self._value[2] and self._value[3] then
return Vector3.new(self._value[1], self._value[2], self._value[3])
end
return nil
end
function TabbableVector3Input:GetMaxGraphemes()
return self._MaxGraphemes
end
function TabbableVector3Input:SetMaxGraphemes(newValue)
self._MaxGraphemes = newValue
end
-- expects function that takes 2 parameters and returns
-- whether current text is valid and if it's not, return
-- a msg as the second arg
-- param1 = current text in textbox
-- param2 = index of textbox
function TabbableVector3Input:SetWarningFunc(newFunc)
self._warningFunc = newFunc
end
function TabbableVector3Input:SetValue(newValue)
if self._value ~= newValue then
self._textBox.Text = newValue
end
end
function TabbableVector3Input:CaptureFocus()
if self._textBox[1] then
self._textBox[1]:CaptureFocus()
end
end
function TabbableVector3Input:LinkToNextTabbableVector3Input(nextTarget)
self._nextTabTarget = nextTarget
end
return TabbableVector3Input
|
local Sha1 = require("mod.extlibs.api.Sha1")
local Util = {}
function Util.string_to_integer(str)
local hash_chunks = {Sha1.sha1(str)} -- list of ints
return fun.iter(hash_chunks):foldl(fun.op.add, 0)
end
return Util
|
--[[----------------------------------------------------------------------------
MyMetadataDefinitionFile.lua
MyMetadata.lrplugin
--------------------------------------------------------------------------------
ADOBE SYSTEMS INCORPORATED
Copyright 2008 Adobe Systems Incorporated
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
with the terms of the Adobe license agreement accompanying it. If you have received
this file from a source other than Adobe, then your use, modification, or distribution
of it requires the prior written permission of Adobe.
------------------------------------------------------------------------------]]
return {
metadataFieldsForPhotos = {
{
id = 'siteId',
},
{
id = 'myString',
title = "My String",
dataType = 'string', -- Specifies the data type for this field.
searchable = true,
browsable = true,
version = 2,
},
{
id = 'myboolean',
title = "My Boolean",
dataType = 'enum',
searchable = true,
browsable = true,
version = 2,
values = {
{
value = 'true',
title = "True",
},
{
value = 'false',
title = "False",
},
},
},
},
schemaVersion = 1,
}
|
/*---------------------------------------------------------
Player Transparency
Distance opacity opacity
Thanks to Jetboom for the code (Zombie Survival)
---------------------------------------------------------*/
CVars.PlayerOpacity = CreateClientConVar( "ze_playeropacity", 1, true, false )
CVars.PlayerOpacityDistance = CreateClientConVar( "ze_playeropacity_dist", 80, true, false )
local undomodelblend = false
local matWhite = Material("models/debug/debugwhite")
function GM:PrePlayerDraw( ply )
if !IsValid(LocalPlayer()) then return end
if !CVars.PlayerOpacity:GetBool() then return end
if LocalPlayer():Team() == ply:Team() then
local radius = CVars.PlayerOpacityDistance:GetInt() or 80
if radius > 0 then
local eyepos = EyePos()
local dist = ply:NearestPoint(eyepos):Distance(eyepos)
if dist < radius then
local blend = math.max((dist / radius) ^ 1.4, 0.04)
render.SetBlend(blend)
if blend < 0.4 then
render.ModelMaterialOverride(matWhite)
render.SetColorModulation(0.2, 0.2, 0.2)
end
undomodelblend = true
end
end
end
end
function GM:PostPlayerDraw( ply )
if undomodelblend then
render.SetBlend(1)
render.ModelMaterialOverride()
render.SetColorModulation(1, 1, 1)
undomodelblend = false
end
end
|
--
-- xdabbcode - BBCode writer for XDA forums
-- http://forum.xda-developers.com/misc.php?do=bbcode
--
-- Copyright (C) 2015 James Mason < jmason888 ! gmail ! com >
--
-- Invoke with: pandoc -t sample.lua
-- Blocksep is used to separate block elements.
function Blocksep()
return "\n\n"
end
-- This function is called once for the whole document. Parameters:
-- body, title, date are strings; authors is an array of strings;
-- variables is a table. One could use some kind of templating
-- system here; this just gives you a simple standalone HTML file.
function Doc(body, title, authors, date, variables)
return body .. '\n'
end
-- The functions that follow render corresponding pandoc elements.
-- s is always a string, attr is always a table of attributes, and
-- items is always an array of strings (the items in a list).
-- Comments indicate the types of other variables.
function Str(s)
return s
end
function Space()
return " "
end
function LineBreak()
return "\n"
end
function Emph(s)
return "[I]" .. s .. "[/I]"
end
function Strong(s)
return "[B]" .. s .. "[/B]"
end
function Strikeout(s)
return '[STRIKE]' .. s .. '[/STRIKE]'
end
function Link(s, src, tit)
if s then
return '[URL=' .. src .. ']' .. s .. '[/URL]'
else
return '[URL]' .. src .. '[/URL]'
end
end
function Image(s, src, tit)
return "[IMG]" .. src .. "[/IMG]"
end
function Code(s, attr)
return '[FONT="Courier New"]' .. s .. "[/FONT]"
end
function Plain(s)
return s
end
function Para(s)
return s
end
-- lev is an integer, the header level.
function Header(level, s, attr)
if level == 1 then
return "[B][SIZE=+2]" .. s .. "[/SIZE][/B]"
elseif level == 2 then
return "[B][SIZE=+1]" .. s .. "[/SIZE][/B]"
elseif level == 3 then
return "[B][U]" .. s .. "[/U][/B]"
else
return "[B]" .. s .. "[/B]"
end
end
function BlockQuote(s)
return "[QUOTE]\n" .. s .. "\n[/QUOTE]"
end
function HorizontalRule()
return "[HR][/HR]"
end
function CodeBlock(s, attr)
return "[CODE]\n" .. s .. "\n[/CODE]"
end
function BulletList(items)
local buffer = {}
for _, item in ipairs(items) do
table.insert(buffer, "[*]" .. item)
end
return "[LIST]\n" .. table.concat(buffer, "\n") .. "\n[/LIST]"
end
function OrderedList(items)
local buffer = {}
for _, item in ipairs(items) do
table.insert(buffer, "[*]" .. item)
end
return "[LIST=1]\n" .. table.concat(buffer, "\n") .. "\n[/LIST]"
end
-- Convert pandoc alignment to something HTML can use.
-- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.
function html_align(align)
if align == 'AlignLeft' then
return 'left'
elseif align == 'AlignRight' then
return 'right'
elseif align == 'AlignCenter' then
return 'center'
else
return 'left'
end
end
-- The following code will produce runtime warnings when you haven't defined
-- all of the functions you need for the custom writer, so it's useful
-- to include when you're working on a writer.
local meta = {}
meta.__index =
function(_, key)
io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key))
return function() return "" end
end
setmetatable(_G, meta)
|
--
-- patches.lua
-- kmeans-kernels
--
-- Created by Andrey Kolishchak on 12/19/15.
--
function get_patches(data, num, width)
max_width = data:size(3) - width + 1
max_heigth = data:size(4) - width + 1
local patches = data.new(num, data:size(2), width*width)
local img_num = torch.randperm(data:size(1))
for channel=1,data:size(2) do
for i=1,num do
local x = math.random(max_heigth)
local y = math.random(max_width)
local img = data[img_num[i]][channel]
local patch = img[{{x,x+width-1},{y,y+width-1}}]
patches[i][channel] = patch
end
end
return patches
end
|
local _, ns = ...
local Filger = ns.Filger
local Config = ns.Config
local Cooldowns = Config["Cooldowns"]
local BlackList = Config["BlackList"]
local Item = Item
----------------------------------------------------------------
-- Development (write anything here)
----------------------------------------------------------------
-- local frame = CreateFrame("Frame", nil, UIParent)
-- frame.name = "TEST"
-- frame.expiration = 5000
-- frame.duration = 5
-- frame.start = frame.duration + GetTime()
-- frame.first = true
-- print(frame.start, frame.duration)
-- frame:SetScript("OnUpdate", Filger.UpdateAuraTimer)
----------------------------------------------------------------
-- Item Mixin
----------------------------------------------------------------
-- local item = Item:CreateFromItemID(21524)
-- item:ContinueOnItemLoad(function()
-- local name = item:GetItemName()
-- local icon = item:GetItemIcon()
-- print(name, icon) -- "Red Winter Hat", 133169
-- end)
|
-- Copyright 2006-2017 Mitchell mitchell.att.foicica.com. See LICENSE.
-- SciTE lexer theme for Scintillua.
local property = require('lexer').property
property['color.red'] = '#F92672'
property['color.yellow'] = '#E6DB74'
property['color.black'] = '#F8F8F2'
property['color.white'] = '#272822'
property['color.green'] = '#A6E22E'
property['color.orange'] = '#FD971F'
property['color.blue'] = '#66D9EF'
property['color.purple'] = '#AE81FF'
property['color.grey'] = '#75715E'
property['color.teal'] = '#AE81FF'
-- Default style.
-- local font, size = 'Verdana', 9
local font, size = 'Consolas', 9
property['style.default'] = 'font:'..font..',size:'..size..
',fore:$(color.black),back:$(color.white)'
-- Token styles.
property['style.nothing'] = ''
property['style.class'] = 'fore:$(color.black),bold'
property['style.comment'] = 'fore:$(color.grey)'
property['style.constant'] = 'fore:$(color.teal),bold'
property['style.definition'] = 'fore:$(color.black),bold'
property['style.error'] = 'fore:$(color.red)'
property['style.function'] = 'fore:$(color.black),bold'
property['style.keyword'] = 'fore:$(color.blue),bold'
property['style.label'] = 'fore:$(color.teal),bold'
property['style.number'] = 'fore:$(color.teal)'
property['style.operator'] = 'fore:$(color.black),bold'
property['style.regex'] = '$(style.string)'
property['style.string'] = 'fore:$(color.yellow)'
property['style.preprocessor'] = 'fore:$(color.yellow)'
property['style.tag'] = 'fore:$(color.teal)'
property['style.type'] = 'fore:$(color.blue)'
property['style.variable'] = 'fore:$(color.black)'
property['style.whitespace'] = ''
property['style.embedded'] = 'fore:$(color.blue)'
property['style.identifier'] = '$(style.nothing)'
-- Predefined styles.
property['style.linenumber'] = 'fore:$(color.grey),back:$(color.white)'
property['style.bracelight'] = 'back:$(color.red),fore:$(color.black),bold'
property['style.bracebad'] = 'fore:$(color.red),bold'
property['style.controlchar'] = 'fore:$(color.grey)'
property['style.indentguide'] = 'fore:$(color.grey)'
property['style.calltip'] = 'fore:$(color.white),back:#444444'
property['style.folddisplaytext'] = 'fore:$(color.grey),back:$(color.white)'
fold.margin.colour = 'fore:$(color.grey),back:$(color.white)'
|
local path = minetest.get_modpath "trinium_machines" .. "/recipes/"
trinium.machines.recipes = {}
dofile(path .. "chemical_reactor.lua")
dofile(path .. "distillation_tower.lua")
dofile(path .. "metal_press.lua")
|
function addResourceMap ( resource, filename, dimension )
if not resource then return false end
dimension = dimension or 0
local currentFiles = getResourceFiles ( resource, "map" )
for k,path in ipairs(currentFiles) do
if path == filename then
return false
end
end
--
local newMap = xmlCreateFile ( ':' .. getResourceName(resource) .. '/' .. filename, "map" )
xmlSaveFile ( newMap )
return newMap
end
function removeResourceFile ( resource, path, filetype )
local metaNode = xmlLoadFile ( ':' .. getResourceName(resource) .. '/' .. "meta.xml" )
local i = 0
while xmlFindChild ( metaNode, filetype, i ) ~= false do
local node = xmlFindChild ( metaNode, filetype, i )
local src = xmlNodeGetAttribute ( node, "src" )
if src == path then
xmlDestroyNode ( node )
end
i = i + 1
end
xmlSaveFile ( metaNode )
xmlUnloadFile ( metaNode )
return fileDelete ( ':' .. getResourceName(resource) .. '/' .. path )
end
local quickRemove = { map=true, setting=true, settings=true }
function clearResourceMeta ( resource, quick ) --removes settings and info nodes
local metaNode = xmlLoadFile ( ':' .. getResourceName(resource) .. '/' .. "meta.xml" )
while true do
local infoNode = xmlFindChild(metaNode, "info", 0)
if infoNode then
--Remove the resource info from memory before removing from xml
local attributes = xmlNodeGetAttributes ( infoNode )
for attributesName in pairs(attributes) do
setResourceInfo ( resource, attributesName, nil )
end
xmlDestroyNode(infoNode)
else
break
end
end
--Destroy any other nodes
local nodes = xmlNodeGetChildren ( metaNode )
for key, node in ipairs(nodes) do
if quick then
if quickRemove[xmlNodeGetName ( node )] then
xmlDestroyNode ( node )
end
else
xmlDestroyNode ( node )
end
end
xmlSaveFile ( metaNode )
xmlUnloadFile ( metaNode )
return true
end
function getResourceFiles ( resource, fileType )
local meta = xmlLoadFile ( ':' .. getResourceName(resource) .. '/' .. "meta.xml" )
if not meta then return false end
local files = {}
local fileAttributes = {}
local i = 0
while xmlFindChild ( meta, fileType, i ) ~= false do
local node = xmlFindChild ( meta, fileType, i )
local file = xmlNodeGetAttribute ( node, "src" )
local otherAttributes = xmlNodeGetAttributes ( node )
otherAttributes.src = nil
fileAttributes[file] = otherAttributes
table.insert ( files, file )
i = i + 1
end
xmlUnloadFile ( meta )
return files,fileAttributes
end
local fileTypes = { "script","file","config","html" }
function copyResourceFiles ( fromResource, targetResource )
local targetPaths = {}
local copiedFiles = {}
for i,fileType in ipairs(fileTypes) do
targetPaths[fileType] = {}
local paths,attr = getResourceFiles(fromResource,fileType)
for j,filePath in ipairs(paths) do
fileCopy ( filePath, fromResource, filePath, targetResource )
local data = attr[filePath]
data.src = filePath
table.insert ( targetPaths[fileType], data )
end
end
--Return a table of new target paths
return targetPaths
end
local function recursiveDimensionSet(baseElement, dimension)
for i, element in ipairs(getElementChildren(baseElement)) do
recursiveDimensionSet(element, dimension)
end
setElementDimension(baseElement, dimension)
end
function flattenTree ( baseElement, newParent, newEditorParent, resourceTable )
local tick = getTickCount()
local resourceTable = resourceTable or {}
for i, element in ipairs(getElementChildren(baseElement)) do
local elementType = getElementType(element)
if not resourceTable[elementType] then
resourceTable[elementType] = edf.edfGetResourceForElementType(elementType)
end
if resourceTable[elementType] and not edf.edfIsRepresentation(element) then
local fromResource = resourceTable[elementType]
local edfElements = loadedEDF[fromResource].elements
local elementID = getElementID(element)
local elementDimension = edf.edfGetElementDimension(element) or 0
local creationParameters = {}
for dataField, dataDefinition in pairs(edfElements[elementType].data) do
local propertyData = edf.edfGetElementProperty(element, dataField)
if propertyData then
creationParameters[dataField] = propertyData
elseif dataDefinition.required then
creationParameters[dataField] = dataDefinition.default
end
end
creationParameters.position = {edf.edfGetElementPosition(element)}
creationParameters.rotation = {edf.edfGetElementRotation(element)}
creationParameters.interior = edf.edfGetElementInterior(element) or nil
local editorElement = edf.edfRepresentElement(element, fromResource, creationParameters, true)
if newEditorParent then
setElementData(editorElement, "me:parent", newEditorParent)
end
assignID(editorElement)
setElementParent(editorElement, newParent)
recursiveDimensionSet(editorElement, getWorkingDimension())
makeElementStatic(editorElement)
setElementData(editorElement, "me:dimension", elementDimension)
flattenTree ( element, newParent, editorElement, resourceTable )
end
if getTickCount() >= tick + 500 then
coroutine.yield()
tick = getTickCount()
end
end
return true
end
function fileCopy ( path, fromResource, targetPath, targetResource )
local sourceFile = fileOpen(':' .. getResourceName(fromResource) .. '/' .. path, true)
if sourceFile then
local readBuffer = 0
local buffer
local targetFile = fileCreate (':' .. getResourceName(targetResource) .. '/' .. targetPath)
while not fileIsEOF(sourceFile) do
buffer = fileRead(sourceFile, 500)
readBuffer = readBuffer + 500
fileWrite ( targetFile, buffer )
end
fileClose(sourceFile)
fileClose(targetFile)
return true
else
return false
end
end
|
local premake = require("premake")
local vstudio = require("vstudio")
local vcxproj = vstudio.vcxproj
local VsVcxIncludeDirTests = test.declare('VsVcxIncludeDirTests', 'vcxproj', 'vstudio')
function VsVcxIncludeDirTests.setup()
vstudio.setTargetVersion(2015)
end
local function _execute(fn)
workspace('MyWorkspace', function ()
configurations { 'Debug', 'Release' }
project('MyProject', function ()
fn()
end)
end)
return vcxproj.prepare(vstudio.fetch(2015)
.workspaces['MyWorkspace']
.projects['MyProject'])
end
---
-- If no include directories are specified, should be silent.
---
function VsVcxIncludeDirTests.clCompile_onNoValues()
local prj = _execute(function () end)
vcxproj.clCompileAdditionalIncludeDirectories(prj)
test.noOutput()
end
---
-- All values present should be listed.
---
function VsVcxIncludeDirTests.clCompile_onMultipleValues()
local prj = _execute(function ()
includeDirs { 'include/lua', 'include/zlib' }
end)
vcxproj.clCompileAdditionalIncludeDirectories(prj.configs['Debug'])
test.capture [[
<AdditionalIncludeDirectories>include\lua;include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
]]
end
---
-- Paths should be made project relative.
---
function VsVcxIncludeDirTests.clCompile_makesProjectRelative()
local prj = _execute(function ()
location 'build'
includeDirs { 'include/lua', 'include/zlib' }
end)
vcxproj.clCompileAdditionalIncludeDirectories(prj.configs['Debug'])
test.capture [[
<AdditionalIncludeDirectories>..\include\lua;..\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
]]
end
---
-- May be set at the file level.
---
function VsVcxIncludeDirTests.clCompile_perFile()
local prj = _execute(function ()
files { 'hello.cpp' }
when({ 'files:hello.cpp' }, function ()
includeDirs('include/hello')
end)
end)
vcxproj.files(prj)
test.capture [[
<ItemGroup>
<ClCompile Include="hello.cpp">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">include\hello;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">include\hello;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemGroup>
]]
end
|
object_tangible_collection_col_ent_fan_06 = object_tangible_collection_shared_col_ent_fan_06:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_col_ent_fan_06, "object/tangible/collection/col_ent_fan_06.iff")
|
local wrappers = {}
function wrappers.argPassthrough(...)
return ...
end
function wrappers.argArity0(opt)
return {}, opt
end
function wrappers.argArity1(arg1, opt)
return {arg1}, opt
end
function wrappers.argArity2(arg1, arg2, opt)
return {arg1, arg2}, opt
end
function wrappers.argArity3(arg1, arg2, arg3, opt)
return {arg1, arg2, arg3}, opt
end
function wrappers.argArity4(arg1, arg2, arg3, arg4, opt)
return {arg1, arg2, arg3, arg4}, opt
end
function wrappers.argArityN(...)
local args = {...}
local opt = args[#args]
if type(opt) == 'table' then
for k in pairs(opt) do
if type(k) ~= 'string' then
return args
end
end
args[#args] = nil
return args, opt
end
return args
end
-- Automatically wrap the tables passed to `insert`, `update` and `replace` in a datum
function wrappers.insert(reql, args, opt)
args[1] = reql.raw.datum(args[1])
return args, opt
end
function wrappers.update(reql, args, opt)
args[1] = reql.raw.datum(args[1])
return args, opt
end
function wrappers.replace(reql, args, opt)
args[1] = reql.raw.datum(args[1])
return args, opt
end
return wrappers
|
local gears = require('gears')
local wibox = require('wibox')
local lunaconf = {
dpi = require('lunaconf.dpi'),
icons = require('lunaconf.icons'),
theme = require('lunaconf.theme'),
dialogs = {
base = require('lunaconf.dialogs.base')
}
}
local bar = {}
local theme = lunaconf.theme.get()
local function recalculate_sizes(self, screen)
self._progress.margins = {
top = lunaconf.dpi.y(10, screen),
bottom = lunaconf.dpi.y(10, screen),
left = lunaconf.dpi.y(4, screen),
right = lunaconf.dpi.y(10, screen),
}
-- Modify rounded corners
self._progress.shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, lunaconf.dpi.x(2, screen))
end
self._icon_margin.margins = lunaconf.dpi.x(4, screen)
end
function bar:set_disabled(disabled)
self._progress.color = disabled and theme.dialog_bar_disabled_fg or theme.dialog_bar_fg
end
function bar:set_icon(icon_name)
local icon = lunaconf.icons.lookup_icon(icon_name)
self._icon:set_image(icon)
end
function bar:set_value(value)
self._progress:set_value(value)
end
function bar:show()
-- Recalculate all sizes on the new screen
self._base:recalculate_sizes(function (screen)
recalculate_sizes(self, screen)
end)
-- Show dialog
self._base:show()
end
local function new(_, icon_name, timeout)
local self = {}
for k,v in pairs(_) do
self[k] = v
end
local icon = lunaconf.icons.lookup_icon(icon_name)
self._icon = wibox.widget.imagebox(icon)
self._icon_margin = wibox.container.margin(self._icon)
self._progress = wibox.widget {
color = theme.dialog_bar_fg,
background_color = theme.dialog_bar_bg,
max_value = 100,
widget = wibox.widget.progressbar
}
local container = wibox.widget {
self._icon_margin,
self._progress,
layout = wibox.layout.fixed.horizontal
}
self._base = lunaconf.dialogs.base {
widget = container,
width = 250,
height = 50,
timeout = timeout or 3
}
return self
end
return setmetatable(bar, { __call = new })
|
local component = require("component")
local event = require("event")
local fs = require("filesystem")
local shell = require("shell")
local isInitialized, pendingAutoruns = false, {}
local function list()
for k,_ in component.list("filesystem", true) do
local proxy, reason = fs.proxy(k)
if proxy then
address = k
if proxy.getLabel() == nil then
short = address:sub(1, 4)
name = "filesystem" .. "-" .. short
fs.mount(short, "/media/" .. name)
else
short = address:sub(1, 4)
name = proxy.getLabel() .. "-" .. short
fs.mount(short, "/media/" .. name)
end
end
end
end
local function onInit()
isInitialized = true
for _, run in ipairs(pendingAutoruns) do
local result, reason = pcall(run)
if not result then
local path = fs.concat(os.getenv("TMPDIR") or "/tmp", "event.log")
local log = io.open(path, "a")
if log then
log:write(reason .. "\n")
log:close()
end
end
end
pendingAutoruns = nil
end
local function onComponentAdded(_, address, componentType)
if componentType == "filesystem" then
local proxy = component.proxy(address)
if proxy then
local name = address:sub(1, 3)
while fs.exists(fs.concat("/mnt", name)) and
name:len() < address:len() -- just to be on the safe side
do
name = address:sub(1, name:len() + 1)
end
name = fs.concat("/mnt", name)
fs.mount(proxy, name)
list()
if fs.isAutorunEnabled() then
local function run()
local file = shell.resolve(fs.concat(name, "autorun"), "lua") or
shell.resolve(fs.concat(name, ".autorun"), "lua")
if file then
local result, reason = shell.execute(file, _ENV, proxy)
if not result then
error(reason, 0)
end
end
end
if isInitialized then
run()
else
table.insert(pendingAutoruns, run)
end
end
end
end
end
local function onComponentRemoved(_, address, componentType)
if componentType == "filesystem" then
if fs.get(shell.getWorkingDirectory()).address == address then
shell.setWorkingDirectory("/")
end
fs.umount(address)
end
end
event.listen("init", onInit)
event.listen("component_added", onComponentAdded)
event.listen("component_removed", onComponentRemoved)
|
(getmetatable"" or {}).__index = function(self,k)
if(type(k) == "number") then return self:sub(k,k); end
return string[k];
end
local function print() end
local MEMORY_SIZE = 7; -- bytes of each ram of node
local eax, ecx, edx, ebx, esp, ebp, esi, edi, eflags = 0, 1, 2, 3, 4, 5, 6, 7, 8;
local ax, cx, dx, bx, sp, bp, si, di, flags = 0, 1, 2, 3, 4, 5, 6, 7, 8;
local al, cl, dl, bl, ah, ch, dh, bh = 0, 1, 2, 3, 4, 5, 6, 7;
_cf, _pf, _af, _zf, _sf, _tf, _if, _df, _of, _iopl, _nt =
0, 1<<1, 1<<3, 1<<5, 1<<6, 1<<7, 1<<8, 1<<9, 1<<10, 1<<11, 1<<13
local regs = {
--[[
data = {
[eax] = 0,
[ecx] = 0,
[edx] = 0,
[ebx] = 0,
[esp] = 0,
[ebp] = 0,
[esi] = 0,
[edi] = 0,
}
]]--
--[[ these get copied automagically ]]--
eip = 0,
idtr = 0,
};
function regs:get8(which)
assert(which >= 0 and which < 8);
return self.data[which] & 0xFF;
end
function regs:get16(which)
assert(which >= 0 and which < 8);
return self.data[which] & 0xFFFF;
end
function regs:get32(which)
assert(which >= 0 and which < 8);
return self.data[which] & 0xFFFFFFFF;
end
function regs:mov32(which, data)
assert(which >= 0 and which < 8);
self.data[which] = data & 0xFFFFFFFF;
end
function regs:mov16(which, data)
assert(which >= 0 and which < 8);
self.data[which] = data & 0xFFFF;
end
function regs:mov8(which, data)
assert(which >= 0 and which < 8);
self.data[which] = data & 0xFF;
end
function regs:flagset(which)
return (self.data[eflags] & which) == which
end
function regs:setflag(which, val);
if(val) then
self.data[eflags] = self.data[eflags] | which;
else
self.data[eflags] = self.data[eflags] & ~which;
end
end
function regs:push(data)
assert(type(data) == "number");
local stack = self.inst:get32(esp);
self.inst:setmemory(stack, self.inst:str32(data));
self.inst:mov32(esp, stack - 4);
end
function regs:pop()
local stack = self:get32(esp);
self:mov32(esp, stack + 4);
return self.inst:uint32(self.inst:readmemory(stack + 4, 4));
end
local data = {};
function data:uint32(str)
if(type(str) == "number") then return str; end
local b1, b2, b3, b4 =
str[1]:byte(), str[2]:byte(), str[3]:byte(), str[4]:byte();
return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24);
end
function data:int32(str)
if(type(str) == "number") then return str; end
local ret = self:uint32(str);
if((ret & (1<<31)) ~= 0) then
ret = (ret & ~(1<<31)) - 0x80000000;
end
end
function data:uint16(str)
if(type(str) == "number") then return str; end
local b1, b2 =
str[1]:byte(), str[2]:byte();
return b1 | (b2 << 8);
end
function data:int16(str)
if(type(str) == "number") then return str; end
local ret = self:uint32(str);
if((ret & (1<<15)) ~= 0) then
ret = (ret & ~(1<<15)) - 0x8000;
end
end
function data:uint8(str)
if(type(str) == "number") then return str; end
local b1 =
str[1]:byte();
return b1
end
function data:int8(str)
if(type(str) == "number") then return str; end
local ret = self:uint8(str);
if((ret & (1<<7)) ~= 0) then
ret = (ret & ~(1<<7)) - 0x80;
end
return ret;
end
function data:reg2(str)
local num = self:uint8(str);
return num & 7, (num & 56) >> 3
end
function data:reg1(str)
local num = self:uint8(str);
return num & 7;
end
function data:str8(data)
return string.char(data)
end
function data:str16(data)
local string_char = string.char;
return
string_char(data & 0xFF)..string_char((data & 0xFF00) >> 8);
end
function data:str32(data)
local string_char = string.char;
return
string_char(data & 0xFF)..string_char((data & 0xFF00) >> 8)..
string_char((data & 0xFF0000) >> 16)..string_char((data & 0xFF000000) >> 24);
end
local inst = {};
function inst:mov8(which, dat)
self.regs:mov8(which, self.data:uint8(dat));
end
function inst:mov16(which, dat)
self.regs:mov16(which, self.data:uint16(dat));
end
function inst:mov32(which, dat)
self.regs:mov32(which, self.data:uint32(dat));
end
function inst:get8(which)
return self.regs:get8(which);
end
function inst:get16(which)
return self.regs:get16(which);
end
function inst:get32(which)
return self.regs:get32(which);
end
function inst:reg2(data)
return self.data:reg2(data);
end
function inst:reg1(data)
return self.data:reg1(data);
end
function inst:readmemory(addr, size)
assert(math.type(addr) == "integer");
assert(math.type(size) == "integer" and size > 0);
local ret = "";
local off = addr % MEMORY_SIZE;
addr = addr // MEMORY_SIZE;
for i = 1, size do
if((i+off) % MEMORY_SIZE == 0) then addr = addr + 1; end
i = i - 1;
local mem = self.memory[addr];
ret = ret..string.char(mem >> ((MEMORY_SIZE - 1)*8-((i+off) % MEMORY_SIZE)*8) & 0xFF);
end
return ret;
end
function inst:setmemory(addr, set)
assert(math.type(addr) == "integer");
assert(type(set) == "string");
local ret = "";
local off = addr % MEMORY_SIZE;
addr = addr // MEMORY_SIZE;
for i = 0, set:len() - 1 do
if((i+1+off) % MEMORY_SIZE == 0) then addr = addr + 1; end
local mem = self.memory[addr];
local shift = ((MEMORY_SIZE-1)*8-((i+off) % MEMORY_SIZE)*8);
self.memory[addr] = mem & ~(0xFF<<shift)
| set[i + 1]:byte() << shift;
end
end
function inst:str32(data)
return self.data:str32(data);
end
function inst:str16(data)
return self.data:str16(data);
end
function inst:str8(data)
return self.data:str8(data);
end
function inst:getint(n)
assert(n >= 0 and n < 1024);
return self:readmemory(self.regs.idtr + 4*n, 4);
end
function inst:setint(n, addr)
assert(n >= 0 and n < 1024);
return self:setmemory(self.regs.idtr + 4*n, addr, 4);
end
function inst:int(n)
self:seteip(self:getint(n));
end
function inst:uint8(data)
return self.data:uint8(data);
end
function inst:int8(data)
return self.data:int8(data);
end
function inst:uint16(data)
return self.data:uint16(data);
end
function inst:int16(data)
return self.data:int16(data);
end
function inst:uint32(data)
return self.data:uint32(data);
end
function inst:int32(data)
return self.data:int32(data);
end
function inst:flagset(which)
return self.regs:flagset(which);
end
function inst:setflag(which, val)
return self.regs:setflag(which, val);
end
function inst:seteip(which)
assert(type(which) == "number");
self.regs.eip = which & 0xFFFFFFFF;
end
function inst:cmp(result, bits)
self:setflag(_cf, result > 0);
self:setflag(_of, result > 0x7FFFFFFF or result < -0x7FFFFFFF);
self:setflag(_zf, result == 0);
local bits_set = 0;
for i = 0, bits-1 do
if((result & (1<<i)) ~= 0) then bits_set = bits_set + 1; end
end
self:setflag(_pf, (bits_set % 2) == 0);
self:setflag(_sf, (result & (1<<(bits-1))) ~= 0);
-- todo: set _af
end
function inst:bitcmp(result, bits)
self:setflag(_cf, 0);
self:setflag(_of, 0);
self:setflag(_zf, result == 0);
local bits_set = 0;
for i = 0, bits-1 do
if((result & (1<<i)) ~= 0) then bits_set = bits_set + 1; end
end
self:setflag(_pf, (bits_set % 2) == 0);
end
function inst:eip()
return self.regs.eip;
end
function inst:push(data)
self.regs:push(data);
end
function inst:pop()
return self.regs:pop();
end
function inst:eax()
return self:get32(eax);
end
function inst:ecx()
return self:get32(ecx);
end
function inst:edx()
return self:get32(edx);
end
function inst:ebx()
return self:get32(ebx);
end
function inst:ebp()
return self:get32(ebp);
end
function inst:edi()
return self:get32(edi);
end
function inst:esi()
return self:get32(esi);
end
function inst:esp()
return self:get32(esp);
end
inst.opcodes = {};
function NewInstance(ram)
-- 128 kb
local _inst = { ram = ram or 128*1024, memory = {}, };
for i = 0, (_inst.ram / MEMORY_SIZE) - 1 do
_inst.memory[i] = 0;
end
local _regs = {stack = {}};
_inst.regs = _regs;
_regs.inst = _inst;
for k,v in next, regs do
_regs[k] = v;
end
_regs.data = {
[eax] = 0,
[ecx] = 0,
[edx] = 0,
[ebx] = 0,
[esp] = 2*1024,
[ebp] = 2*1024,
[esi] = 0,
[edi] = 0,
[eflags] = 0,
};
_inst.data = data;
for k,v in next, inst do
_inst[k] = v;
end
return _inst;
end
local FUNCTION = 1;
local ARGSIZE = 2;
local NAME = 3;
local LEN = 4;
local EXT = 5;
function AddOpcode(name, opcode, argsize, func, ext)
local len = opcode:len();
local current_table = inst.opcodes;
for i = 1, len - 1 do
local next_table = current_table[opcode[i]];
if(not next_table) then
next_table = {};
current_table[opcode[i]] = next_table;
end
current_table = next_table;
end
current_table[opcode[-1]] = current_table[opcode[-1]] or {
[FUNCTION] = func,
[ARGSIZE] = argsize,
[NAME] = name,
[LEN] = len,
[EXT] = ext ~= nil,
extensions = {},
};
if(ext) then
current_table[opcode[-1]].extensions[ext] = {
[FUNCTION] = func,
[ARGSIZE] = argsize,
[NAME] = name,
[LEN] = len,
[EXT] = ext,
};
end
end
local function RunCode(inst, bytes, offset)
local start = offset;
local current_table = inst.opcodes;
while(type(current_table[FUNCTION]) ~= "function") do
if(type(current_table) == "nil") then error("invalid code"); end
current_table = current_table[bytes[offset]];
offset = offset + 1;
end
if(current_table[EXT]) then
current_table = current_table.extensions[bytes[offset]:byte() >> 3 & 7];
end
inst:seteip(offset + current_table[ARGSIZE]);
local func = current_table[FUNCTION];
local args = bytes:sub(offset, offset + current_table[ARGSIZE] - 1);
print(current_table[NAME]);
func(inst, bytes:sub(start, start + offset - 1), args);
end
if(dofile) then
dofile"opcodes.lua";
else
require"x86/opcodes";
end
function inst:run(bytes)
self:seteip(1);
local code = bytes;
local code_len = code:len();
while(self:eip() > 0 and self:eip() <= code_len) do
RunCode(self, code, self:eip());
end
return self;
end
x86 = NewInstance();
x86:run"\xE8\x02\x00\x00\x00\xEB\x01\xC3"
|
-- Copyright 2006-2015 Mitchell mitchell.att.foicica.com. See LICENSE.
-- R LPeg lexer.
local l = require('lexer')
local token, word_match = l.token, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'rstats'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
-- Comments.
local comment = token(l.COMMENT, '#' * l.nonnewline^0)
-- Strings.
local sq_str = l.delimited_range("'", true)
local dq_str = l.delimited_range('"', true)
local string = token(l.STRING, sq_str + dq_str)
-- Numbers.
local number = token(l.NUMBER, (l.float + l.integer) * P('i')^-1)
-- Keywords.
local keyword = token(l.KEYWORD, word_match{
'break', 'else', 'for', 'if', 'in', 'next', 'repeat', 'return', 'switch',
'try', 'while', 'Inf', 'NA', 'NaN', 'NULL', 'FALSE', 'TRUE'
})
-- Types.
local type = token(l.TYPE, word_match{
'array', 'character', 'complex', 'data.frame', 'double', 'factor', 'function',
'integer', 'list', 'logical', 'matrix', 'numeric', 'vector'
})
-- Identifiers.
local identifier = token(l.IDENTIFIER, l.word)
-- Operators.
local operator = token(l.OPERATOR, S('<->+*/^=.,:;|$()[]{}'))
-- Functions
local funcs= token( l.FUNCTION, word_match{
'NCOL', 'NROW', 'UseMethod', 'abline', 'abs', 'all', 'any', 'apply', 'array', 'as', 'as.character', 'as.data.frame', 'as.double', 'as.factor', 'as.formula', 'as.integer', 'as.list', 'as.logical', 'as.matrix', 'as.name', 'as.numeric', 'as.vector', 'assign', 'attr', 'attributes', 'axis', 'c', 'cat', 'cbind', 'ceiling', 'character', 'checkPtrType', 'class', 'coef', 'colSums', 'colnames', 'cos', 'crossprod', 'cumsum', 'data.frame', 'deparse', 'diag', 'diff', 'dim', 'dimnames', 'dnorm', 'do.call', 'double', 'drop', 'eigen', 'enter', 'environment', 'errorCondition', 'eval', 'exists', 'exit', 'exp', 'expression', 'factor', 'file.path', 'floor', 'for', 'format', 'formatC', 'function', 'get', 'getOption', 'gettextRcmdr', 'grep', 'gsub', 'identical', 'if', 'ifelse', 'in', 'inherits', 'integer', 'invisible', 'is', 'is.character', 'is.data.frame', 'is.element', 'is.factor', 'is.finite', 'is.function', 'is.list', 'is.logical', 'is.matrix', 'is.na', 'is.null', 'is.numeric', 'is.vector', 'isGeneric', 'justDoIt', 'lapply', 'legend', 'length', 'levels', 'library', 'lines', 'list', 'lm', 'log', 'logger', 'match', 'match.arg', 'match.call', 'matrix', 'max', 'mean', 'median', 'message', 'min', 'missing', 'mode', 'model.frame', 'model.matrix', 'mtext', 'na.omit', 'names', 'nchar', 'ncol', 'new', 'nrow', 'numeric', 'on.exit', 'optim', 'options', 'order', 'outer', 'par', 'parent.frame', 'parse', 'paste', 'pchisq', 'plot', 'pmax', 'pnorm', 'points', 'predict', 'print', 'prod', 'qnorm', 'quantile', 'range', 'rbind', 'rep', 'rep.int', 'representation', 'require', 'return', 'rev', 'rm', 'rnorm', 'round', 'row.names', 'rowSums', 'rownames', 'runif', 'sQuote', 'sample', 'sapply', 'sd', 'segments', 'seq', 'seq_len', 'setClass', 'setGeneric', 'setMethod', 'setMethodS3', 'setdiff', 'sign', 'signature', 'signif', 'sin', 'slot', 'solve', 'sort', 'sprintf', 'sqrt', 'standardGeneric', 'stop', 'stopifnot', 'storage.mode', 'str', 'strsplit', 'structure', 'sub', 'substitute', 'substr', 'substring', 'sum', 'summary', 'svalue', 'sweep', 'switch', 't', 'table', 'tapply', 'tclVar', 'tclvalue', 'terms', 'text', 'theWidget', 'throw', 'title', 'tkadd', 'tkbind', 'tkbutton', 'tkconfigure', 'tkdestroy', 'tkentry', 'tkfocus', 'tkframe', 'tkgrid', 'tkgrid.configure', 'tkinsert', 'tklabel', 'tkpack', 'try', 'unclass', 'unique', 'unit', 'unlist', 'var', 'vector', 'warning', 'which', 'while', 'write'
})
M._rules = {
{'whitespace', ws},
{'keyword', keyword},
{'type', type},
{'function', funcs},
{'identifier', identifier},
{'string', string},
{'comment', comment},
{'number', number},
{'operator', operator},
}
M._foldsymbols = {
[l.OPERATOR] = {['{'] = 1, ['}'] = -1},
_patterns = {'[{}]'}
}
return M
|
pg = pg or {}
pg.guild_data_level = {
{
exp = 1000,
level = 1,
member_num = 20,
assistant_commander = 4
},
{
exp = 3000,
level = 2,
member_num = 22,
assistant_commander = 4
},
{
exp = 5000,
level = 3,
member_num = 24,
assistant_commander = 4
},
{
exp = 8000,
level = 4,
member_num = 26,
assistant_commander = 4
},
{
exp = 12000,
level = 5,
member_num = 28,
assistant_commander = 4
},
{
exp = 18000,
level = 6,
member_num = 30,
assistant_commander = 4
},
{
exp = 26000,
level = 7,
member_num = 32,
assistant_commander = 4
},
{
exp = 36000,
level = 8,
member_num = 34,
assistant_commander = 4
},
{
exp = 48000,
level = 9,
member_num = 37,
assistant_commander = 4
},
{
exp = 60000,
level = 10,
member_num = 40,
assistant_commander = 4
},
all = {
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
}
}
return
|
--* minimap
local E, C, L, _ = select(2, shCore()):unpack()
local unpack, select = unpack, select
local collectgarbage = collectgarbage
local floor, format = math.floor, string.format
local modf = math.modf
local CreateFrame = CreateFrame
local showLFT = true -- enable disable fps/latency and clock
local showclock = true -- ONLY show clock (local time)
local zoneTextOnMap = false -- move zone info into minimap frame
--* Latency / FPS / Time
if (showLFT ~= false) then
local LFT = CreateFrame('Button', 'LFT', Minimap)
LFT:SetAnchor(unpack(C.Anchors.LFT))
LFT:SetSize(Minimap:GetWidth()+4, A.fontSize+1)
LFT:SetFrameLevel(0)
local text = LFT:CreateFontString(nil, 'OVERLAY')
text:SetAnchor('CENTER', LFT, 4, 0)
text:SetFontObject(NumberFontNormal)
text:SetShadowOffset(0,0)
text:SetTextColor(E.Color.r, E.Color.g, E.Color.b)
local function addonCompare(a, b)
return a.memory > b.memory
end
local function MemFormat(m)
if (m > 1024) then
return format('%.2f MiB', m/1024)
else
return format('%.2f KiB', m)
end
end
local function ColorGradient(perc, ...)
if (perc > 1) then
local r, g, b = select(select('#', ...) -2, ...) return r, g, b
elseif (perc < 0) then
local r, g, b = ... return r, g, b
end
local num = select('#', ...)/3
local segment, relperc = modf(perc*(num-1))
local r1, g1, b1, r2, g2, b2 = select((segment*3) +1, ...)
return r1+(r2-r1) * relperc, g1+(g2-g1)*relperc, b1+(b2-b1) * relperc
end
local function TimeFormat(time)
local t = format('%.1ds', floor(mod(time, 60)))
if (time > 60) then
time = floor(time/60)
t = format('%.1dm ', mod(time, 60)) .. t
if (time > 60) then
time = floor(time/60)
t = format('%.1dh ', mod(time, 24)) .. t
if (time > 24) then
time = floor(time/24)
t = format('%dd ',time) .. t
end
end
end
return t
end
local function ColorizeLatency(p)
if (p < 100) then
return {r = 0, g = 1, b = 0}
elseif (p < 300) then
return {r = 1, g = 1, b = 0}
else
return {r = 1, g = 0, b = 0}
end
end
local function ColorizeFramerate(f)
if (f < 10) then
return {r = 1, g = 0, b = 0}
elseif (f < 30) then
return {r = 1, g = 1, b = 0}
else
return {r = 0, g = 1, b = 0}
end
end
local lastUpdate = 0
local updateDelay = 1
LFT:SetScript('OnUpdate', function(self, elapsed)
lastUpdate = lastUpdate + elapsed
if (lastUpdate > updateDelay) then
lastUpdate = 0
local time = date('|c00ffffff%H|r:|c00ffffff%M|r')
fps = GetFramerate()
fps = '|c00ffffff'..floor(fps+0.5)..'|r fps '
lag = select(3, GetNetStats())
lag = '|c00ffffff'..lag..'|r ms '
text:SetText(lag..fps..time)
end
end);
LFT:SetScript('OnEnter', function()
GameTooltip:SetOwner(LFT)
collectgarbage()
local memory, i, addons, total, entry, total
local latcolor = ColorizeLatency(select(3, GetNetStats()))
local fpscolor = ColorizeFramerate(GetFramerate())
GameTooltip:AddLine(date('%A, %d %B, %Y'), 1, 1, 1)
GameTooltip:AddDoubleLine('Framerate:', format('%.1f fps', GetFramerate()), E.Color.r, E.Color.g, E.Color.b, fpscolor.r, fpscolor.g, fpscolor.b)
GameTooltip:AddDoubleLine('Latency:', format('%d ms', select(3, GetNetStats())), E.Color.r, E.Color.g, E.Color.b, latcolor.r, latcolor.g, latcolor.b)
GameTooltip:AddDoubleLine('System Uptime:', TimeFormat(GetTime()), E.Color.r, E.Color.g, E.Color.b, 1, 1, 1)
GameTooltip:AddDoubleLine('. . . . . . . . . . .', '. . . . . . . . . . .', 1, 1, 1, 1, 1, 1)
addons = {}
total = 0
UpdateAddOnMemoryUsage()
for i = 1, GetNumAddOns(), 1 do
if (GetAddOnMemoryUsage(i) > 0) then
memory = GetAddOnMemoryUsage(i)
entry = {name = GetAddOnInfo(i), memory = memory}
table.insert(addons, entry)
total = total + memory
end
end
table.sort(addons, addonCompare)
for _, entry in pairs(addons) do
local cr, cg, cb = ColorGradient((entry.memory/800), 0, 1, 0, 1, 1, 0, 1, 0, 0)
GameTooltip:AddDoubleLine(entry.name, MemFormat(entry.memory), 1, 1, 1, cr, cg, cb)
end
local cr, cg, cb = ColorGradient((entry.memory/800), 0, 1, 0, 1, 1, 0, 1, 0, 0)
GameTooltip:AddDoubleLine('. . . . . . . . . . .', '. . . . . . . . . . .', 1, 1, 1, 1, 1, 1)
GameTooltip:AddDoubleLine('Total', MemFormat(total), E.Color.r, E.Color.g, E.Color.b, cr, cg, cb)
GameTooltip:AddDoubleLine('Blizzard stuff', MemFormat(collectgarbage('count')), E.Color.r, E.Color.g, E.Color.b, cr, cg, cb)
GameTooltip:Show()
end);
LFT:SetScript('OnLeave', function() GameTooltip:Hide() end);
LFT:SetScript('OnClick', function()
if (not IsAltKeyDown()) then
UpdateAddOnMemoryUsage()
local memBefore = gcinfo()
collectgarbage()
UpdateAddOnMemoryUsage()
CombatLogClearEntries()
local memAfter = gcinfo()
E.Suitag(L_MemoryClean..' |cff00FF00' .. MemFormat(memBefore - memAfter))
end
end);
end
local cluster = {
--'MinimapBorder',
'MiniMapMailBorder',
'MiniMapMeetingStoneBorder',
'MiniMapBattlefieldBorder',
}
for _, m in pairs(cluster) do
--_G[m]:SetVertexColor(.2,.2,.2,.8)
_G[m]:StripLayout()
end
MinimapBorder:ClearAllPoints()
MinimapBorder:SetAnchor(unpack(C.Anchors.mapBorder))
MinimapBorder:SetSize(MinimapCluster:GetSize())
MinimapBorder:SetTexture(A.mapTex, 'BACKGROUND')
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
Minimap:EnableMouseWheel(true)
Minimap:SetScript('OnMouseWheel', function(self, d)
if (d > 0) then Minimap_ZoomIn() else Minimap_ZoomOut() end
end);
GameTimeTexture:Hide()
MinimapBorderTop:Hide()
MiniMapWorldMapButton:Hide()
--MinimapToggleButton:Hide()
MiniMapTrackingBorder:Hide()
MiniMapMailFrame:ClearAllPoints()
MiniMapMailFrame:SetAnchor(unpack(C.Anchors.mapMail))
--* BF
MiniMapBattlefieldFrame:SetNormalTexture''
MiniMapBattlefieldFrame:SetPushedTexture''
MiniMapBattlefieldFrame:SetHighlightTexture''
MiniMapBattlefieldFrame:SetDisabledTexture''
MiniMapBattlefieldFrame:SetScale(1.4)
--* tracking
--MiniMapTracking:StripLayout()
MiniMapTrackingIcon:ClearAllPoints()
MiniMapTrackingIcon:SetAnchor(unpack(C.Anchors.mapTrackIcnTL))
MiniMapTrackingIcon:SetAnchor(unpack(C.Anchors.mapTrackIcnBR))
MiniMapTrackingIcon.SetAnchor = E.hoop
MiniMapTrackingIcon:SetTexCoord(unpack(E.TexCoords))
MiniMapTrackingBackground:Hide()
MiniMapTracking:ClearAllPoints()
MiniMapTracking:SetAnchor(unpack(C.Anchors.mapTrack))
MiniMapTracking:SetSize(24)
MinimapZoneTextButton:ClearAllPoints()
MinimapZoneTextButton:SetAnchor(unpack(C.Anchors.mapZone))
MinimapZoneTextButton:SetParent(Minimap)
MinimapNorthTag:SetVertexColor(1, .4, 0)
--* move and clickable
Minimap:SetMovable(true)
Minimap:SetUserPlaced(true)
Minimap:SetClampedToScreen(true)
Minimap:SetScript('OnMouseDown', function()
if (IsShiftKeyDown()) then
Minimap:ClearAllPoints()
Minimap:StartMoving()
end
end);
Minimap:SetScript('OnMouseUp', function(self, button)
Minimap:StopMovingOrSizing()
if (button == 'RightButton') then
ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, -(Minimap:GetWidth() * 0.7), -3)
else
Minimap_OnClick(self)
end
end);
if (showclock ~= false) then
LoadAddOn('Blizzard_TimeManager')
local clockFrame, clockTime = TimeManagerClockButton:GetRegions()
clockFrame:Hide()
clockTime:Show()
clockTime:SetFont(A.font, 12, A.fontStyle)
TimeManagerClockButton:SetAnchor(unpack(C.Anchors.mapTime))
else
LoadAddOn('Blizzard_TimeManager')
TimeManagerClockButton:Hide()
end
if (zoneTextOnMap ~= false) then
ZoneTextString:SetAnchor(unpack(C.Anchors.mapZoneText))
SubZoneTextString:SetAnchor(unpack(C.Anchors.mapSubZoneText))
else
ZoneTextString:SetAnchor(unpack(C.Anchors.zoneText))
SubZoneTextString:SetAnchor(unpack(C.Anchors.subZoneText))
end
MinimapToggleButton:CloseTemplate()
MinimapToggleButton:ClearAllPoints()
MinimapToggleButton:SetAnchor(unpack(C.Anchors.mapToggle))
|
local floor = math.floor
local Characters = {
[ 0] = "0";
[ 1] = "1";
[ 2] = "2";
[ 3] = "3";
[ 4] = "4";
[ 5] = "5";
[ 6] = "6";
[ 7] = "7";
[ 8] = "8";
[ 9] = "9";
[10] = "A";
[11] = "B";
[12] = "C";
[13] = "D";
[14] = "E";
[15] = "F";
[16] = "G";
--// add more if needed.
}
return function(Number, Base)
local Negative
if Number < 0 then
Negative = true
Number = -Number
end
local Result = ""
repeat
Result = Characters[floor(Number % Base)] .. Result
Number = floor(Number / Base)
until Number == 0
return Negative and "-" .. Result or Result
end
|
--@import see.base.Exception
--@extends see.base.Exception
--[[
Describes an exception which occurs at runtime.
]]
--[[
Constructs a new RuntimeException.
@param string:message The error message.
]]
function RuntimeException:init(message)
self:super(Exception).init(message)
end
|
-------------------------------------------------------------------------------
-- Announce Rare (BFA 8.2) By Crackpotx (US, Lightbringer)
-------------------------------------------------------------------------------
local AR = LibStub("AceAddon-3.0"):NewAddon("AnnounceRare", "AceComm-3.0", "AceConsole-3.0", "AceEvent-3.0")
AR.version = GetAddOnMetadata("AnnounceRare", "Version")
local CTL = assert(ChatThrottleLib, "AnnounceRare requires ChatThrottleLib.")
local L = LibStub("AceLocale-3.0"):GetLocale("AnnounceRare", false)
-- local api cache
local C_ChatInfo_GetNumActiveChannels = C_ChatInfo.GetNumActiveChannels
local C_Map_GetBestMapForUnit = C_Map.GetBestMapForUnit
local C_Map_GetMapInfo = C_Map.GetMapInfo
local C_Map_GetPlayerMapPosition = C_Map.GetPlayerMapPosition
local CombatLogGetCurrentEventInfo = _G["CombatLogGetCurrentEventInfo"]
local EnumerateServerChannels = _G["EnumerateServerChannels"]
local GetChannelName = _G["GetChannelName"]
local GetGameTime = _G["GetGameTime"]
local GetItemInfo = _G["GetItemInfo"]
local GetLocale = _G["GetLocale"]
local GetPlayerMapPosition = _G["GetPlayerMapPosition"]
local GetZoneText = _G["GetZoneText"]
local IsAddOnLoaded = _G["IsAddOnLoaded"]
local SendChatMessage = _G["SendChatMessage"]
local UnitAffectingCombat = _G["UnitAffectingCombat"]
local UnitAura = _G["UnitAura"]
local UnitClassification = _G["UnitClassification"]
local UnitExists = _G["UnitExists"]
local UnitGUID = _G["UnitGUID"]
local UnitHealth = _G["UnitHealth"]
local UnitHealthMax = _G["UnitHealthMax"]
local UnitIsDead = _G["UnitIsDead"]
local UnitName = _G["UnitName"]
local band = bit.band
local ceil = math.ceil
local match = string.match
local format = string.format
local pairs = pairs
local strsplit = strsplit
local tonumber = tonumber
local tostring = tostring
local channelFormat = "%s - %s"
local channelRUFormat = "%s: %s"
local outputChannel = "|cffffff00%s|r"
local messageToSend = L["%s%s (%s/%s %.2f%%) is at %s %s%s, and %s"]
local deathMessage = L["%s%s has been slain %sat %02d:%02d! (Game Time)"]
local defaults = {
global = {
armory = true,
autoAnnounce = false,
advertise = false,
announceDeath = true,
drill = true,
onLoad = false,
output = "CHANNEL",
tomtom = true,
}
}
local rares = {
[151884] = "Fungarian Furor", -- Fungarian Furor
[135497] = "Fungarian Furor", -- Fungarian Furor
[151625] = "The Scrap King", -- The Scrap King
[151623] = "The Scrap King (Mounted)", -- The Scrap King (Mounted)
[152569] = "Crazed Trogg (Green)", -- Crazed Trogg (Green)
[152570] = "Crazed Trogg (Blue)", -- Crazed Trogg (Blue)
[149847] = "Crazed Trogg (Orange)", -- Crazed Trogg (Orange)
-- for the drills
[153206] = "Ol' Big Tusk",
[154342] = "Arachnoid Harvester (Alt Time)",
[154701] = "Gorged Gear-Cruncher",
[154739] = "Caustic Mechaslime",
[152113] = "The Kleptoboss",
[153200] = "Boilburn",
[153205] = "Gemicide",
}
local function UpdateDuplicates(id)
if id == 151884 then
AR.rares[#AR.rares + 1] = 135497
elseif id == 135497 then
AR.rares[#AR.rares + 1] = 151884
elseif id == 151625 then
AR.rares[#AR.rares + 1] = 151623
elseif id == 151623 then
AR.rares[#AR.rares + 1] = 151625
elseif id == 152569 then
AR.rares[#AR.rares + 1] = 152570
AR.rares[#AR.rares + 1] = 149847
elseif id == 152570 then
AR.rares[#AR.rares + 1] = 152569
AR.rares[#AR.rares + 1] = 149847
elseif id == 149847 then
AR.rares[#AR.rares + 1] = 152569
AR.rares[#AR.rares + 1] = 152570
end
end
local function GetTargetId()
local guid = UnitGUID("target")
if guid == nil then return nil end
local unitType, _, _, _, _, unitId = strsplit("-", guid);
return (unitType == "Creature" or UnitType == "Vehicle") and tonumber(unitId) or nil
end
local function GetNPCGUID(guid)
if guid == nil then return nil end
local unitType, _, _, _, _, unitId = strsplit("-", guid);
return (unitType == "Creature" or UnitType == "Vehicle") and tonumber(unitId) or nil
end
local function GetGeneralChannelNumber()
local zoneText = GetZoneText()
local general = EnumerateServerChannels()
if zoneText == nil or general == nil then return false end
return GetChannelName(GetLocale() == "ruRU" and channelRUFormat:format(general, zoneText) or channelFormat:format(general, zoneText))
end
local function IsValidOutputChannel(chan)
return (chan == "general" or chan == "say" or chan == "guild" or chan == "yell" or chan == "party" or chan == "raid") and true or false
end
-- Time Displacement
local function IsInAltTimeline()
for i = 1, 40 do
local name = UnitAura("player", i)
if name == "Time Displacement" then
return true
end
end
return false
end
local function GetConfigStatus(configVar)
return configVar == true and L["|cff00ff00ENABLED|r"] or L["|cffff0000DISABLED|r"]
end
local function FormatNumber(n)
if n >= 10^6 then
return format("%.2fm", n / 10^6)
elseif n >= 10^3 then
return format("%.2fk", n / 10^3)
else
return tostring(n)
end
end
local function FindInArray(toFind, arraySearch)
if #arraySearch == 0 then return false end
for _, value in pairs(arraySearch) do
if value == toFind then
return true
end
end
return false
end
local function DecRound(num, decPlaces)
return format("%." .. (decPlaces or 0) .. "f", num)
end
local function AnnounceRare()
-- player target is a rare
local tarId, tarCombat = GetTargetId(), UnitAffectingCombat("target")
local tarHealth, tarHealthMax = UnitHealth("target"), UnitHealthMax("target")
local tarHealthPercent = (tarHealth / tarHealthMax) * 100
local tarPos = C_Map_GetPlayerMapPosition(C_Map_GetBestMapForUnit("player"), "player")
local genId = GetGeneralChannelNumber()
if tarId == nil then
AR:Print(L["Unable to determine target's GUID."])
elseif AR.db.global.output:upper() == "CHANNEL" and not genId then
AR:Print(L["Unable to determine your general channel number."])
else
CTL:SendChatMessage("NORMAL", "AnnounceRare", messageToSend:format(
AR.db.global.advertise == true and "AnnounceRare: " or "",
rares[tarId] ~= nil and rares[tarId] or UnitName("target"),
FormatNumber(tarHealth),
FormatNumber(tarHealthMax),
tarHealthPercent,
ceil(tarPos.x * 10000) / 100,
ceil(tarPos.y * 10000) / 100,
IsInAltTimeline() == true and " " .. L["in the alternative timeline"] or "",
UnitAffectingCombat("target") == true and L["has been engaged!"] or L["has NOT been engaged!"]
), AR.db.global.output:upper(), nil, AR.db.global.output:upper() == "CHANNEL" and genId or nil)
end
end
local function ValidTarget(cmdRun)
-- if no target, then fail
if not UnitExists("target") then
return false
else
local tarClass = UnitClassification("target")
if tarClass ~= "rare" and tarClass ~= "rareelite" then
return false
else
if UnitIsDead("target") then
return false
else
local tarId = GetNPCGUID(UnitGUID("target"))
if tarId == nil then
return false
else
return (not cmdRun and not FindInArray(tarId, AR.rares)) and true or false
end
end
end
end
end
function AR:CreateWaypoint(x, y, name)
if not TomTom then
self:Print(L["You must have TomTom installed to use waypoints."])
return
elseif not self.db.global.tomtom then
return
end
if self.lastWaypoint ~= false then
TomTom:RemoveWaypoint(self.lastWaypoint)
end
self.lastWaypoint = TomTom:AddWaypoint(C_Map_GetBestMapForUnit("player"), x / 100, y / 100, {
title = name,
persistent = false,
minimap = true,
world = true
})
-- create an auto expire timer
if self.tomtomExpire ~= false then self.tomtomExpire:Cancel() end
self.tomtomExpire = C_Timer.NewTimer(120, function()
if AR.lastWaypoint ~= nil and AR.lastWaypoint ~= false then
TomTom:RemoveWaypoint(AR.lastWaypoint)
end
end)
end
function AR:CheckZone(...)
local mapId = C_Map_GetBestMapForUnit("player")
if mapId == nil then
self.correctZone = false
else
local mapInfo = C_Map_GetMapInfo(mapId)
if (mapId == 1355 or mapInfo["parentMapID"] == 1355) or (mapId == 1462 or mapInfo["parentMapID"] == 1462) and self.correctZone == false then
self.correctZone = true
elseif ((mapId ~= 1355 and mapInfo["parentMapID"] ~= 1355 and mapId ~= 1462 and mapInfo["parentMapID"] ~= 1462) or mapId == nil) and self.correctZone == true then
self.correctZone = false
end
end
end
function AR:Print(msg)
print(("|cffff7d0aAR:|r |cffffffff%s|r"):format(msg))
end
function AR:PLAYER_TARGET_CHANGED()
if self.db.global.autoAnnounce and self.correctZone and ValidTarget(false) then
local tarId = GetTargetId()
if tarId ~= nil then
AnnounceRare()
self.rares[#self.rares + 1] = tarId
UpdateDuplicates(tarId)
end
end
end
function AR:COMBAT_LOG_EVENT_UNFILTERED()
local _, subevent, _, _, _, sourceFlags, _, srcGuid, srcName = CombatLogGetCurrentEventInfo()
if subevent == "UNIT_DIED" and self.correctZone then
local id = GetNPCGUID(srcGuid)
if id ~= 151623 and self.db.global.announceDeath == true and #self.rares > 0 and FindInArray(id, self.rares) then
local hours, minutes = GetGameTime()
local genId = GetGeneralChannelNumber()
if id == nil then
self:Print(L["Unable to determine the NPC's GUID."])
elseif self.db.global.output:upper() == "CHANNEL" and not genId then
self:Print(L["Unable to determine your general channel number."])
else
CTL:SendChatMessage("NORMAL", "AnnounceRare", deathMessage:format(
self.db.global.advertise == true and "AnnounceRare: " or "",
rares[id] ~= nil and rares[id] or srcName,
IsInAltTimeline() == true and L["in the alternative timeline"] .. " " or "",
hours,
minutes
), self.db.global.output:upper(), nil, self.db.global.output:upper() == "CHANNEL" and genId or nil)
end
end
end
end
function AR:UPDATE_MOUSEOVER_UNIT(...)
if self.correctZone then
local ttItemName = GameTooltip:GetUnit()
local armoryName = GetItemInfo(169868)
if self.db.global.armory and (ttItemName == "Broken Rustbolt Armory" or ttItemName == armoryName) and self.lastArmory <= time() - 600 then
local genId = GetGeneralChannelNumber()
local tarPos = C_Map_GetPlayerMapPosition(C_Map_GetBestMapForUnit("player"), "player")
CTL:SendChatMessage("NORMAL", "AnnounceRare", (L["%sArmory is located at %s %s!"]):format(ttItemName == "Broken Rustbolt Armory" and L["Broken"] .. " " or "", ceil(tarPos.x * 10000) / 100, ceil(tarPos.y * 10000) / 100), self.db.global.output:upper(), nil, self.db.global.output:upper() == "CHANNEL" and genId or nil)
self.lastArmory = time()
end
end
end
function AR:CHAT_MSG_CHANNEL(msg, ...)
end
--[[function AR:CHAT_MSG_MONSTER_EMOTE(msg, ...)
if self.db.global.drill and self.correctZone and msg:match("DR-") then
local _, _, drill = strsplit(" ", msg)
local x, y, rareName
if drill == "DR-TR28" then
x, y = 56.25, 36.25
rareName = "Ol' Big Tusk"
elseif drill == "DR-TR35" then
x, y = 63, 25.75
rareName = "Arachnoid Harvester (Alt Time)"
elseif drill == "DR-CC61" then
x, y = 72.71, 53.93
rareName = "Gorged Gear-Cruncher"
elseif drill == "DR-CC73" then
x, y = 66.50, 58.85
rareName = "Caustic Mechaslime"
elseif drill == "DR-CC88" then
x, y = 68.40, 48
rareName = "The Kleptoboss"
elseif drill == "DR-JD41" then
x, y = 51.25, 50.20
rareName = "Boilburn"
elseif drill == "DR-JD99" then
x, y = 59.75, 67.25
rareName = "Gemicide"
else
return
end
CTL:SendChatMessage("NORMAL", "AnnounceRare", (L["%s (%s) is up at %s %s."]):format(
drill,
rareName,
x,
y
), self.db.global.output:upper(), nil, self.db.global.output:upper() == "CHANNEL" and genId or nil)
-- create waypoint
if self.db.global.tomtom and self.tomtom then
self:CreateWaypoint(x, y, ("%s: %s"):format(drill, rareName))
end
end
end]]
function AR:PLAYER_ENTERING_WORLD()
-- init some stuff
self.rares = {}
self.correctZone = false
self.lastArmory = 0
self:CheckZone()
-- tomtom waypoint settings
self.tomtom = IsAddOnLoaded("TomTom")
self.lastWaypoint = false
self.tomtomExpire = false
-- chat command using aceconsole-3.0
self:RegisterChatCommand("rare", function(args)
local key = self:GetArgs(args, 1)
if key == "auto" then
self.db.global.autoAnnounce = not self.db.global.autoAnnounce
self:Print((L["Auto Announce has been %s!"]):format(GetConfigStatus(self.db.global.autoAnnounce)))
elseif key == "death" then
self.db.global.announceDeath = not self.db.global.announceDeath
self:Print((L["Death Announcements have been %s!"]):format(GetConfigStatus(self.db.global.announceDeath)))
elseif key == "adv" then
self.db.global.advertise = not self.db.global.advertise
self:Print((L["Advertisements have been %s!"]):format(GetConfigStatus(self.db.global.advertise)))
elseif key == "armory" then
self.db.global.armory = not self.db.global.armory
self:Print((L["Armory announcements have been %s!"]):format(GetConfigStatus(self.db.global.armory)))
--[[elseif key == "drill" then
self.db.global.drill = not self.db.global.drill
self:Print((L["Drill announcements have been %s!"]):format(GetConfigStatus(self.db.global.drill)))]]
elseif key == "help" or key == "?" then
self:Print(L["Command Line Help"])
self:Print(L["|cffffff00/rare|r - Announce rare to general chat."])
self:Print(L["|cffffff00/rare armory|r - Toggle armory announcements."])
self:Print(L["|cffffff00/rare auto|r - Toggle auto announcements."])
self:Print(L["|cffffff00/rare death|r - Toggle death announcements."])
--self:Print(L["|cffffff00/rare drill|r - Toggle drill announcements."])
self:Print(L["|cffffff00/rare load|r - Toggle loading announcement."])
self:Print(L["|cffffff00/rare tomtom|r - Toggle TomTom waypoints."])
self:Print(L["|cffffff00/rare output (general|say|yell|guild|party|raid)|r - Change output channel."])
self:Print(L["|cffffff00/rare status|r or |cffffff00/rare config|r - Print current configuration."])
self:Print(L["|cffffff00/rare help|r or |cffffff00/rare ?|r - Print this help again."])
elseif key == "load" then
self.db.global.onLoad = not self.db.global.onLoad
self:Print((L["Loading message has been %s!"]):format(GetConfigStatus(self.db.global.onLoad)))
elseif key == "reset" then
self.rares = {}
self.lastArmory = 0
self:Print(L["Rare list has been reset."])
elseif key == "status" or key == "config" then
self:Print((L["AnnounceRare by Crackpotx v%s"]):format(self.version))
self:Print(L["For Help: |cffffff00/rare help|r"])
self:Print((L["Advertisements: %s"]):format(GetConfigStatus(self.db.global.advertise)))
self:Print((L["Armory Announcements: %s"]):format(GetConfigStatus(self.db.global.armory)))
self:Print((L["Automatic Announcements: %s"]):format(GetConfigStatus(self.db.global.autoAnnounce)))
self:Print((L["Death Announcements: %s"]):format(GetConfigStatus(self.db.global.announceDeath)))
--self:Print((L["Drill Notifications: %s"]):format(GetConfigStatus(self.db.global.drill)))
self:Print((L["Load Announcement: %s"]):format(GetConfigStatus(self.db.global.onLoad)))
self:Print((L["TomTom Waypoints: %s"]):format(GetConfigStatus(self.db.global.tomtom)))
self:Print((L["Output Channel: |cffffff00%s|r"]):format(self.db.global.output:upper() == "CHANNEL" and "GENERAL" or self.db.global.output))
elseif key == "tomtom" then
self.db.global.tomtom = not self.db.global.tomtom
self:Print((L["TomTom waypoints have been %s!"]):format(GetConfigStatus(self.db.global.tomtom)))
elseif key == "output" then
local _, value = self:GetArgs(args, 2)
if value == "" or value == nil then
self:Print(L["You must provide an output channel for the announcements."])
else
value = value:lower()
if not IsValidOutputChannel(value) then
self:Print((L["Valid Outputs: %s, %s, %s, %s, %s, %s"]):format(
outputChannel:format(L["general"]),
outputChannel:format(L["say"]),
outputChannel:format(L["yell"]),
outputChannel:format(L["guild"]),
outputChannel:format(L["party"]),
outputChannel:format(L["raid"])
))
else
self.db.global.output = value ~= "general" and value:upper() or "CHANNEL"
self:Print((L["Changed output to %s!"]):format(outputChannel:format(value:upper())))
end
end
else
local zoneText = GetZoneText()
local tarClass = UnitClassification("target")
-- only do anything when the player is in mechagon or nazjatar
if self.correctZone then
if ValidTarget(true) then
AnnounceRare()
elseif not UnitExists("target") then
self:Print(L["You do not have a target."])
elseif UnitIsDead("target") then
self:Print(format(L["%s is already dead."], UnitName("target")))
elseif (tarClass ~= "rare" and tarClass ~= "rareelite") then
self:Print(format(L["%s is not a rare or you have killed it today."], UnitName("target")))
end
else
self:Print(L["You must be in Mechagon or Nazjatar to use this command."])
end
end
end)
if self.db.global.onLoad == true then
self:Print((L["AnnounceRare v%s loaded! Please use |cffffff00/rare help|r for commands."]):format(GetAddOnMetadata("AnnounceRare", "Version")))
end
end
function AR:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("AnnounceRareDB", defaults)
--self:RegisterEvent("CHAT_MSG_MONSTER_EMOTE")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PLAYER_TARGET_CHANGED")
self:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
self:RegisterEvent("ZONE_CHANGED", function() AR:CheckZone() end)
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", function() AR:CheckZone() end)
end
|
function onCreate()
makeLuaSprite('background', 'sonicexe-old-stage-lordX-background', -600, -400);
addLuaSprite('background', false);
setLuaSpriteScrollFactor('background', 1);
scaleObject('background', 0.5, 0.5);
makeLuaSprite('hills1', 'sonicexe-old-stage-lordX-hills1', -600, -500);
addLuaSprite('hills1', false);
setLuaSpriteScrollFactor('hills1', 0.98);
scaleObject('hills1', 0.5, 0.5);
makeLuaSprite('hills2', 'sonicexe-old-stage-lordX-hills2', -900, -500);
addLuaSprite('hills2', false);
setLuaSpriteScrollFactor('hills2', 0.95);
scaleObject('hills2', 0.5, 0.5);
makeLuaSprite('floor', 'sonicexe-old-stage-lordX-floor', -600, -400);
addLuaSprite('floor', false);
scaleObject('floor', 0.5, 0.5);
-- sprites that only load if Low Quality is turned off
if not lowQuality then
makeAnimatedLuaSprite('Hands', 'sonicexe-old-stage-lordX-hands', 200, -100);
addAnimationByPrefix('Hands', 'first', 'Hands', 24, true);
objectPlayAnimation('Hands', 'first');
addLuaSprite('Hands', false);
scaleObject('Hands', 0.4, 0.4);
makeAnimatedLuaSprite('Tree', 'sonicexe-old-stage-lordX-tree', 900, -150);
addAnimationByPrefix('Tree', 'first', 'Tree', 24, true);
objectPlayAnimation('Tree', 'first');
addLuaSprite('Tree', false);
scaleObject('Tree', 1.5, 1.5);
makeAnimatedLuaSprite('EyeFlower', 'sonicexe-old-stage-lordX-eyeflower', -300, 200);
addAnimationByPrefix('EyeFlower', 'first', 'EyeFlower', 12, true);
objectPlayAnimation('EyeFlower', 'first');
addLuaSprite('EyeFlower', false);
scaleObject('EyeFlower', 1.5, 1.5);
end
close(true); --For performance reasons, close this script once the stage is fully loaded, as this script won't be used anymore after loading the stage
end
|
function drawPlayer()
local map_config = loadMapConfig(map_id)
local x = love.graphics.getWidth() / 2 - (map_config.size_tile * (map_config.size_x / 2)) + player.x
local y = love.graphics.getHeight() / 2 - (map_config.size_tile * (map_config.size_y / 2)) + player.y
love.graphics.draw(broken, x, y)
end
function movePlayer()
local count = 0
local speed = 2
local count_end = 32/speed
local map_config = loadMapConfig(map_id)
--if move_mode == true then
if player.direction == "up" then
--for count = 0, count + 32, 1 do
if player.y > player.must_y then
player.y = player.y - speed
mode_move = false
else
player.direction = "none"
mode_move = true
end
--player.pos_y = player.pos_y - 1
--player.direction = "none"
elseif player.direction == "down" then
if player.y < player.must_y then
player.y = player.y + speed
mode_move = false
else
player.direction = "none"
mode_move = true
end
elseif player.direction == "left" then
--for count = 0, count + 32, 1 do
if player.x > player.must_x then
player.x = player.x - speed
mode_move = false
else
player.direction = "none"
mode_move = true
end
--player.pos_y = player.pos_y - 1
--player.direction = "none"
elseif player.direction == "right" then
if player.x < player.must_x then
player.x = player.x + speed
mode_move = false
else
player.direction = "none"
mode_move = true
end
else
player.direction = "none"
end
--end
--player.direction = "none"
end
function movePlayerDirection(direction)
--local move_speed = 1
--local count = 0
--local y
local map_config = loadMapConfig(map_id)
if direction == "up" and player.pos_y > 1 and loadMapCollisions(player.pos_x, player.pos_y - 1) == true then
player.pos_y = player.pos_y - 1
player.must_y = player.must_y - map_config.size_tile
player.direction = "up"
console_string[5] = "PLAYER MOVE DIRECTION: " .. direction
--end
elseif direction == "down" and player.pos_y < map_config.size_y and loadMapCollisions(player.pos_x, player.pos_y + 1) == true then
player.pos_y = player.pos_y + 1
player.must_y = player.must_y + map_config.size_tile
player.direction = "down"
console_string[5] = "PLAYER MOVE DIRECTION: " .. direction
--end
elseif direction == "left" and player.pos_x > 1 and loadMapCollisions(player.pos_x - 1, player.pos_y) == true then
player.pos_x = player.pos_x - 1
player.must_x = player.must_x - map_config.size_tile
player.direction = "left"
console_string[5] = "PLAYER MOVE DIRECTION: " .. direction
--end
elseif direction == "right" and player.pos_x < map_config.size_x and loadMapCollisions(player.pos_x + 1, player.pos_y) == true then
player.pos_x = player.pos_x + 1
player.must_x = player.must_x + map_config.size_tile
player.direction = "right"
console_string[5] = "PLAYER MOVE DIRECTION: " .. direction
else
console_string[5] = "THERE IS COLLISION"
end
end
function teleportPlayer(pos_x, pos_y, new_id)
local map_config = loadMapConfig(map_id)
map_id = new_id
player.x = pos_x * map_config.size_tile - 32
player.y = pos_y * map_config.size_tile - 32
player.must_x = pos_x * map_config.size_tile - 32
player.must_y = pos_y * map_config.size_tile - 32
player.direction = "none"
player.pos_x = pos_x
player.pos_y = pos_y
loadWLD()
loadWLDc()
loadMapCollisions(nil, nil)
loadMapExit(nil, nil)
end
function testWherePlayer()
if loadMapExit(player.pos_x, player.pos_y) == not true
and mode_move == true
and map_id == "house"
and player.pos_x == 16
and player.pos_y == 16
then
mode_teleport = true
player.must_tp_x = 1
player.must_tp_y = 1
new_map_id = "garden"
elseif loadMapExit(player.pos_x, player.pos_y) == not true --then
and mode_move == true
and map_id == "garden"
--and player.pos_x == 16
and player.pos_y == 16 then
mode_teleport = true
player.must_tp_x = 16
player.must_tp_y = 8
new_map_id = "house"
else
mode_teleport = false
end
end
|
local gitsigns_status_ok, gitsigns = pcall(require, 'gitsigns')
if not gitsigns_status_ok then
vim.notify('Not able to load in gitsigns', 'error')
return
end
gitsigns.setup {
signs = {
add = {hl = 'GitSignsAdd' , text = '+', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
change = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
},
numhl = false,
linehl = false,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
},
watch_index = {
interval = 1000
},
sign_priority = 1,
update_debounce = 200,
status_formatter = nil, -- Use default
use_decoration_api = false
}
|
local function copy(value)
if type(value) ~= "table" then
return value
end
local cp = {}
for k,v in pairs(value) do
cp[copy(k)] = copy(v)
end
return setmetatable(cp,value)
end
local function extends(class,...)
local extc_list = {...}
if #extc_list == 0 then return class end
for i,extc in pairs(extc_list) do
for k,v in pairs(extc) do
if class[k] == nil then
class[copy(k)] = copy(v)
end
end
end
return class
end
local function new(self,...)
local ncla = {}
extends(ncla,self)
setmetatable(ncla,ncla)
if type(ncla.__init) == "function" then
ncla:__init(...)
end
return ncla
end
return function(name,...)
local class = {}
local ext = {...}
class.new = new
class.__call = class.new
class.__name = name
setmetatable(class,class)
if #ext > 0 then
extends(class,unpack(ext))
end
return function(info)
extends(class,info)
return class
end
end
|
---------------------------------------------------------------------------------------------------
--
--filename: game.util.LuaMath
--date:2019/9/26 11:23:41
--author:heguang
--desc:
--
---------------------------------------------------------------------------------------------------
local strClassName = 'game.util.LuaMath'
local LuaMath = lua_declare("LuaMath", lua_class(strClassName))
local math_randomseed = math.randomseed
local math_random = math.random
function LuaMath.Sin(angle)
return Mathf.Sin(angle * Mathf.PI / 180)
end
function LuaMath.Cos(angle)
return Mathf.Cos(angle * Mathf.PI / 180)
end
function LuaMath.GetAngle(x, y)
local angle = 90 - (Mathf.Atan2(y,x) * Mathf.Rad2Deg)
angle = (angle + 360) % 360
return angle
end
function LuaMath.Random(min, max)
math_randomseed(tostring(os.time()):reverse():sub(1, 7))
return math_random(min, max)
end
function LuaMath.GetIntPart(x)
if x <= 0 then
return math.ceil(x)
end
if math.ceil(x) == x then
x = math.ceil(x)
else
x = math.ceil(x) - 1
end
return x
end
return LuaMath
|
local web_devicons = require('nvim-web-devicons')
|
local which_key = require("which-key")
which_key.setup()
|
data:extend(
{
{
type = "tool",
name = "more-science-pack-1",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-1.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-01]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-2",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-2.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-02]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-3",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-3.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-03]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-4",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-4.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-04]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-5",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-5.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-05]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-6",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-6.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-06]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-7",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-7.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-07]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-8",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-8.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-08]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-9",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-9.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-09]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-10",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-10.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-10]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-11",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-11.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-11]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-12",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-12.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-12]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-13",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-13.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-13]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-14",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-14.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-14]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-15",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-15.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-15]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-16",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-16.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-16]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-17",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-17.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-17]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-18",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-18.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-18]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-19",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-19.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-19]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-20",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-20.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-20]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-21",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-21.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-21]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-22",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-22.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-22]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-23",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-23.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-23]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-24",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-24.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-24]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-25",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-25.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-25]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-26",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-26.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-26]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-27",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-27.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-27]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-28",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-28.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-28]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-29",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-29.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-29]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
{
type = "tool",
name = "more-science-pack-30",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-30.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-30]",
stack_size = 200,
durability = 1,
durability_description_key = "description.science-pack-remaining-amount-key",
durability_description_value = "description.science-pack-remaining-amount-value"
},
}
)
|
local tables = {}
tables.highways = osm2pgsql.define_table{
name = 'osm2pgsql_test_highways',
ids = { type = 'way', id_column = 'way_id' },
columns = {
{ column = 'tags', type = 'hstore' },
{ column = 'refs', type = 'text' },
{ column = 'geom', type = 'linestring' },
}
}
tables.routes = osm2pgsql.define_table{
name = 'osm2pgsql_test_routes',
ids = { type = 'relation', id_column = 'rel_id' },
columns = {
{ column = 'tags', type = 'hstore' },
{ column = 'members', type = 'text' },
{ column = 'geom', type = 'multilinestring' },
}
}
local w2r = {}
function osm2pgsql.process_way(object)
if osm2pgsql.stage == 1 then
return
end
local row = {
tags = object.tags,
geom = { create = 'line' }
}
local d = w2r[object.id]
if d then
local refs = {}
for rel_id, rel_ref in pairs(d) do
refs[#refs + 1] = rel_ref
end
table.sort(refs)
row.refs = table.concat(refs, ',')
end
tables.highways:add_row(row)
end
function osm2pgsql.select_relation_members(relation)
if relation.tags.type == 'route' then
return { ways = osm2pgsql.way_member_ids(relation) }
end
end
function osm2pgsql.process_relation(object)
if object.tags.type ~= 'route' then
return
end
local mlist = {}
for _, member in ipairs(object.members) do
if member.type == 'w' then
if not w2r[member.ref] then
w2r[member.ref] = {}
end
w2r[member.ref][object.id] = object.tags.ref
mlist[#mlist + 1] = member.ref
end
end
tables.routes:add_row({
tags = object.tags,
members = table.concat(mlist, ','),
geom = { create = 'line' }
})
end
|
object_tangible_deed_vehicle_deed_vehicle_deed_sith_speeder = object_tangible_deed_vehicle_deed_shared_vehicle_deed_sith_speeder:new {
}
ObjectTemplates:addTemplate(object_tangible_deed_vehicle_deed_vehicle_deed_sith_speeder, "object/tangible/deed/vehicle_deed/vehicle_deed_sith_speeder.iff")
|
ITEM.name = "Антирад"
ITEM.category = "Медицина"
ITEM.desc = "Препарат радиозащитного действия Мексамин, широко распространенный на территории Зоны. При применении вызывает сужения периферических кровеносных сосудов и кислородное голодание, в данном случае является средством профилактики и лечения лучевой болезни. \n\nХАРАКТЕРИСТИКИП: \n-медикамент \n-быстрое использование (шприц) \n-сильный побочный эффект \n\nРадиация - 34"
ITEM.price = 1560
ITEM.weight = 0.02
ITEM.exRender = false
ITEM.model = "models/kek1ch/dev_antirad.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.iconCam = {
pos = Vector(55.049072265625, 46.191646575928, 34.036888122559),
ang = Angle(25, 220, 0),
fov = 5
}
ITEM.functions.use = {
name = "использовать",
onRun = function(item)
local client = item.player
client:setNetVar("radioactive", client:getNetVar("radioactive", 0) - 74)
return true
end,
onCanRun = function(item)
return !IsValid(item.entity)
end
}
|
for i=0,#arg do
print(i,arg[i])
end
|
local M = {}
-- Break expression into parts from which we can generate a parser and generator.
--
-- Expression should have form like this:
-- | A | B | C | D | E | F |
-- "{parent}/([%w_/]+)/{namespace}/([%w_]*){name}([%w_%.]*)"
-- With:
-- A = related files have some common parent dir.
-- B = some unique dir that indicates the end of {parent} and begin of
-- {namespace} or {name}.
-- When {namespace} exists, this has to be non-emtpy!
-- C = optional namespace, also when exists (in expression), can be empty (in filename)
-- A + B + C = file directory
-- D = prefix part of the file basename, before the common part of the basename. Optional
-- E = common part of file basename
-- F = postfix part of the file basename, after the common part of the
-- basename.
--
-- This function parses a string that conforms to the the above expression and
-- returns, B, D and F
--
-- @return dn_infix (B)
-- dirname infix: Pattern indicating end of {parent} and begin of {namespace} or
-- {name}. When {namespace} exists, this has to be non-emtpy.
-- TODO: allow for `.git` or some sentinel file to be the indicator of the namespace?
-- @return bn_prefix (D)
-- basename prefix: optional pattern before {name} (which is part of the
-- file's basename), can be empty
-- @return bn_postfix (F)
-- basename postfix: pattern after {name} but part of the file's
-- basename (including extension), can be emtpy (not tested).
-- TODO: add more error checks and better error messages
function M.parse_expression(expression)
local dn_infix, bn_prefix, bn_postfix = nil, nil, nil
-- There aren't optional capture groups, and {namespace} is optional, I
-- solve this by having 2 match patterns, one for each case. (this doesn't
-- scale, but will do for now, and I think it is easy to read).
local has_namespace = not not string.find(expression, "{namespace}")
if has_namespace then
dn_infix, bn_prefix, bn_postfix = string.match(expression, '^{parent}/([%w_/]+){namespace}/([%w_]*){name}([%w_%.]*)$')
assert(dn_infix, "Can't parse expression: " .. expression)
else
dn_infix, bn_prefix, bn_postfix = string.match(expression, '^{parent}([%w_/]*)/([%w_]*){name}([%w_%.]*)$')
assert(bn_prefix, "Can't parse expression: " .. expression)
end
return dn_infix, bn_prefix, bn_postfix
end
-- Create parser and generator for given expression
-- TODO: filetype not needed?
function M.pargen_from_expression(name, expression, vim_filetype)
local dn_infix, bn_prefix, bn_postfix = M.parse_expression(expression)
-- print("name: "..name)
-- print("expression: "..expression)
-- print("dn_infix: '"..dn_infix.."'")
-- assert(dn_infix ~= "", "There need to be a part between parent and namespace")
-- print("bn_prefix: '"..bn_prefix.."'")
-- print("bn_postfix: '"..bn_postfix.."'\n")
-- bn_postfix is not optional
local pargen = {}
pargen.parser = function (filename)
-- print("pargen.name: "..pargen.name)
-- print("filename: "..filename)
-- common representation, this is the data that is the output of a parser,
-- and servers as input for a generator
local inter_rep = {
parent = "",
namespace = "",
name = ""
}
pargen.vim_filetype = vim_filetype
pargen.name = name
pargen.expression = expression
-- Splitting up the parsing as the namespace can be empty and there are no optional capture groups.
-- probably more efficient way to do this, but this seems to work
do
local parent_pattern = "^(.*/)"..dn_infix
inter_rep.parent = string.match(filename, parent_pattern)
if not inter_rep.parent then
-- print("Pargen "..pargen.name.." can't parse parent for filename: " ..filename)
return nil
end
if dn_infix and #dn_infix > 0 then
local namespace_pattern = "/"..dn_infix.."(/?.*/)"
-- can be empty if no namespace
inter_rep.namespace = string.match(filename, namespace_pattern) or ""
end
local basename_pattern = "/"..bn_prefix.."([^/]*)"..bn_postfix.."$"
inter_rep.name = string.match(filename, basename_pattern)
if not inter_rep.name then
-- print("Pargen "..pargen.name.." can't parse name for filename: " ..filename)
return nil
end
end
-- print("Pargen "..pargen.name..":")
-- print(" parent: "..inter_rep.parent)
-- print(" namespace: '"..inter_rep.namespace.."'")
-- print(" name: "..inter_rep.name)
-- print()
return inter_rep
end
pargen.generator = function (inter_rep)
local filename = ""
filename = inter_rep.parent..dn_infix..inter_rep.namespace
filename = bn_prefix == "" and filename or filename..bn_prefix
filename = filename..inter_rep.name..bn_postfix
-- print(name.." generator filename: "..filename)
return filename
end
return pargen
end
return M
|
local util = require 'util'
--- @class Observer
-- @description Observers are simple objects that receive values from Observables.
local Observer = {}
Observer.__index = Observer
Observer.__tostring = util.constant('Observer')
--- Creates a new Observer.
-- @arg {function=} onNext - Called when the Observable produces a value.
-- @arg {function=} onError - Called when the Observable terminates due to an error.
-- @arg {function=} onCompleted - Called when the Observable completes normally.
-- @returns {Observer}
function Observer.create(onNext, onError, onCompleted)
local self = {
_onNext = onNext or util.noop,
_onError = onError or error,
_onCompleted = onCompleted or util.noop,
stopped = false
}
return setmetatable(self, Observer)
end
--- Pushes zero or more values to the Observer.
-- @arg {*...} values
function Observer:onNext(...)
if not self.stopped then
self._onNext(...)
end
end
--- Notify the Observer that an error has occurred.
-- @arg {string=} message - A string describing what went wrong.
function Observer:onError(message)
if not self.stopped then
self.stopped = true
self._onError(message)
end
end
--- Notify the Observer that the sequence has completed and will produce no more values.
function Observer:onCompleted()
if not self.stopped then
self.stopped = true
self._onCompleted()
end
end
return Observer
|
--Copyright (C) 2009 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--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 Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
object_tangible_painting_shared_bestine_history_quest_painting = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_bestine_history_quest_painting.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_planet_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:bestine_history_quest_painting",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:bestine_history_quest_painting",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3716079022,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_bestine_history_quest_painting, "object/tangible/painting/shared_bestine_history_quest_painting.iff")
object_tangible_painting_shared_bestine_quest_painting = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_bestine_quest_painting.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_jail.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:bestine_quest_painting",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:bestine_quest_painting",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 550655936,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_bestine_quest_painting, "object/tangible/painting/shared_bestine_quest_painting.iff")
object_tangible_painting_shared_painting_agrilat_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_agrilat_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_agrilat_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_agrilat_s01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_agrilat_s01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2365303481,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_agrilat_s01, "object/tangible/painting/shared_painting_agrilat_s01.iff")
object_tangible_painting_shared_painting_armor_blueprint = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_armor_blueprint.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tall_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_armor_blueprint.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:armor",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:armor",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2522220824,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_armor_blueprint, "object/tangible/painting/shared_painting_armor_blueprint.iff")
object_tangible_painting_shared_painting_bestine_blueleaf_temple = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_blueleaf_temple.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_temple_blue_leaf1.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_blueleaf_temple",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_blueleaf_temple",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2092717443,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_blueleaf_temple, "object/tangible/painting/shared_painting_bestine_blueleaf_temple.iff")
object_tangible_painting_shared_painting_bestine_blumbush = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_blumbush.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_blumbush.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_blumbush",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_blumbush",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2399181727,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_blumbush, "object/tangible/painting/shared_painting_bestine_blumbush.iff")
object_tangible_painting_shared_painting_bestine_boffa = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_boffa.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_boffa_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_boffa",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_boffa",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1521577134,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_boffa, "object/tangible/painting/shared_painting_bestine_boffa.iff")
object_tangible_painting_shared_painting_bestine_golden_flower_01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_golden_flower_01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_golden_flower_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_golden_flower_01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_golden_flower_01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 268388150,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_golden_flower_01, "object/tangible/painting/shared_painting_bestine_golden_flower_01.iff")
object_tangible_painting_shared_painting_bestine_golden_flower_02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_golden_flower_02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_golden_flower_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_golden_flower_02",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_golden_flower_02",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3572035489,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_golden_flower_02, "object/tangible/painting/shared_painting_bestine_golden_flower_02.iff")
object_tangible_painting_shared_painting_bestine_golden_flower_03 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_golden_flower_03.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_golden_flower_s03.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_golden_flower_03",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_golden_flower_03",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2649065516,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_golden_flower_03, "object/tangible/painting/shared_painting_bestine_golden_flower_03.iff")
object_tangible_painting_shared_painting_bestine_house = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_house.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_player_house.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_house",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_house",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3800373299,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_house, "object/tangible/painting/shared_painting_bestine_house.iff")
object_tangible_painting_shared_painting_bestine_krayt_skeleton = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_krayt_skeleton.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_krayt_skeleton.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_krayt_skeleton",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_krayt_skeleton",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3652558255,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_krayt_skeleton, "object/tangible/painting/shared_painting_bestine_krayt_skeleton.iff")
object_tangible_painting_shared_painting_bestine_lucky_despot = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_lucky_despot.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_lucky_despot.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_lucky_despot",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_lucky_despot",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2981494109,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_lucky_despot, "object/tangible/painting/shared_painting_bestine_lucky_despot.iff")
object_tangible_painting_shared_painting_bestine_mattberry = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_mattberry.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_mattberry.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_mattberry",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_mattberry",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4207518182,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_mattberry, "object/tangible/painting/shared_painting_bestine_mattberry.iff")
object_tangible_painting_shared_painting_bestine_moncal_eye_01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_moncal_eye_01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_moncal_eye.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_moncal_eye_01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_moncal_eye_01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1833552017,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_moncal_eye_01, "object/tangible/painting/shared_painting_bestine_moncal_eye_01.iff")
object_tangible_painting_shared_painting_bestine_moncal_eye_02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_moncal_eye_02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_moncal_eye_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_moncal_eye_02",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_moncal_eye_02",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3059638278,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_moncal_eye_02, "object/tangible/painting/shared_painting_bestine_moncal_eye_02.iff")
object_tangible_painting_shared_painting_bestine_rainbow_berry_bush = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_rainbow_berry_bush.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_rainbow_berry_bush.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_rainbow_berry_bush",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_rainbow_berry_bush",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4083160615,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_rainbow_berry_bush, "object/tangible/painting/shared_painting_bestine_rainbow_berry_bush.iff")
object_tangible_painting_shared_painting_bestine_raventhorn = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_raventhorn.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_raventhorn.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_raventhorn",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_raventhorn",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1526591701,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_raventhorn, "object/tangible/painting/shared_painting_bestine_raventhorn.iff")
object_tangible_painting_shared_painting_bestine_ronka = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bestine_ronka.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_ronka.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_ronka",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_ronka",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2667929549,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bestine_ronka, "object/tangible/painting/shared_painting_bestine_ronka.iff")
object_tangible_painting_shared_painting_bioengineer_orange = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bioengineer_orange.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_bioengineer_orange.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:bio_orange",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:bio_orange",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 232377496,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bioengineer_orange, "object/tangible/painting/shared_painting_bioengineer_orange.iff")
object_tangible_painting_shared_painting_bothan_f = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bothan_f.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_bothan_f.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_bothan_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_bothan_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 854788635,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bothan_f, "object/tangible/painting/shared_painting_bothan_f.iff")
object_tangible_painting_shared_painting_bothan_m = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bothan_m.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_bothan_m.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_bothan_m",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_bothan_m",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2819466634,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bothan_m, "object/tangible/painting/shared_painting_bothan_m.iff")
object_tangible_painting_shared_painting_bw_stormtrooper = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_bw_stormtrooper.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_bw_stormtrooper.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:bw_stormtrooper",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:bw_stormtrooper",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2585541648,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_bw_stormtrooper, "object/tangible/painting/shared_painting_bw_stormtrooper.iff")
object_tangible_painting_shared_painting_cargoport = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_cargoport.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_cargoport.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:cargoport",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:cargoport",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 8552875,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_cargoport, "object/tangible/painting/shared_painting_cargoport.iff")
object_tangible_painting_shared_painting_dance_party = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_dance_party.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tall_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_dance_party.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:dance_party",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:dance_party",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 105361220,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_dance_party, "object/tangible/painting/shared_painting_dance_party.iff")
object_tangible_painting_shared_painting_double_helix = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_double_helix.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tall_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_double_helix.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:double_helix",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:double_helix",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2823052972,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_double_helix, "object/tangible/painting/shared_painting_double_helix.iff")
object_tangible_painting_shared_painting_droid_bright = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_droid_bright.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_droid_bright.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:droid_bright",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:droid_bright",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2843033838,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_droid_bright, "object/tangible/painting/shared_painting_droid_bright.iff")
object_tangible_painting_shared_painting_endor_style_01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_endor_style_01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_endor_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8211,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@item_d:painting_endor_style_01",
gameObjectType = 8211,
locationReservationRadius = 0,
lookAtText = "@trophy_lookat:painting_endor_style_01",
noBuildRadius = 0,
objectName = "@item_n:painting_endor_style_01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 633275539,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_endor_style_01, "object/tangible/painting/shared_painting_endor_style_01.iff")
object_tangible_painting_shared_painting_fighter_pilot_human_01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_fighter_pilot_human_01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_fighter_pilot_human1.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_fighter_pilot_human_01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_fighter_pilot_human_01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4258475485,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_fighter_pilot_human_01, "object/tangible/painting/shared_painting_fighter_pilot_human_01.iff")
object_tangible_painting_shared_painting_food_baking_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_food_baking_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_food_baking_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_food_baking_s01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_food_baking_s01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3144090584,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_food_baking_s01, "object/tangible/painting/shared_painting_food_baking_s01.iff")
object_tangible_painting_shared_painting_food_baking_s02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_food_baking_s02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_food_baking_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_food_baking_s02",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_food_baking_s02",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1617996623,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_food_baking_s02, "object/tangible/painting/shared_painting_food_baking_s02.iff")
object_tangible_painting_shared_painting_freedom = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_freedom.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_freedom.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:freedom",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:freedom",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3648739651,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_freedom, "object/tangible/painting/shared_painting_freedom.iff")
object_tangible_painting_shared_painting_han_wanted = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_han_wanted.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_han_wanted.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:han_wanted",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:han_wanted",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2218996276,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_han_wanted, "object/tangible/painting/shared_painting_han_wanted.iff")
object_tangible_painting_shared_painting_human_f = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_human_f.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_human_f.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_human_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_human_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3589238977,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_human_f, "object/tangible/painting/shared_painting_human_f.iff")
object_tangible_painting_shared_painting_kite_plant = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_kite_plant.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_kite_plant.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_kite_plant",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_kite_plant",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1814671481,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_kite_plant, "object/tangible/painting/shared_painting_kite_plant.iff")
object_tangible_painting_shared_painting_leia_wanted = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_leia_wanted.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_leia_wanted.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:leia_wanted",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:leia_wanted",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3845142344,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_leia_wanted, "object/tangible/painting/shared_painting_leia_wanted.iff")
object_tangible_painting_shared_painting_luke_wanted = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_luke_wanted.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_luke_wanted.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:luke_wanted",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:luke_wanted",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1125814305,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_luke_wanted, "object/tangible/painting/shared_painting_luke_wanted.iff")
object_tangible_painting_shared_painting_nebula_flower = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_nebula_flower.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_nebula_orchid.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_blueleaf_temple",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_blueleaf_temple",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4178650060,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_nebula_flower, "object/tangible/painting/shared_painting_nebula_flower.iff")
object_tangible_painting_shared_painting_palowick_ad_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_palowick_ad_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_wide_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_palowick_ad.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_palowick_ad",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_palowick_ad",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1851630183,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_palowick_ad_s01, "object/tangible/painting/shared_painting_palowick_ad_s01.iff")
object_tangible_painting_shared_painting_palowick_ad_s02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_palowick_ad_s02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_wide_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_palowick_ad.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_palowick_ad",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_palowick_ad",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3041528560,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_palowick_ad_s02, "object/tangible/painting/shared_painting_palowick_ad_s02.iff")
object_tangible_painting_shared_painting_palowick_ad_s03 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_palowick_ad_s03.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_wide_s03.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_palowick_ad.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_palowick_ad",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_palowick_ad",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4232539517,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_palowick_ad_s03, "object/tangible/painting/shared_painting_palowick_ad_s03.iff")
object_tangible_painting_shared_painting_palowick_ad_s04 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_palowick_ad_s04.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_wide_s04.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_palowick_ad.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_palowick_ad",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_palowick_ad",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 128206441,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_palowick_ad_s04, "object/tangible/painting/shared_painting_palowick_ad_s04.iff")
object_tangible_painting_shared_painting_planet_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_planet_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_planet_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_planet_01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_planet_01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1235349261,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_planet_s01, "object/tangible/painting/shared_painting_planet_s01.iff")
object_tangible_painting_shared_painting_rodian_f = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_rodian_f.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_rodian_f.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_rodian_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_rodian_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2426371029,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_rodian_f, "object/tangible/painting/shared_painting_rodian_f.iff")
object_tangible_painting_shared_painting_rodian_f_ad_01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_rodian_f_ad_01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_rodian_f_ad_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_rodian_f_ad_01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_rodian_f_ad_01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3837717304,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_rodian_f_ad_01, "object/tangible/painting/shared_painting_rodian_f_ad_01.iff")
object_tangible_painting_shared_painting_rodian_m = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_rodian_m.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_rodian_m.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_rodian_m",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_rodian_m",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 174183492,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_rodian_m, "object/tangible/painting/shared_painting_rodian_m.iff")
object_tangible_painting_shared_painting_schematic_droid = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_schematic_droid.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_schematic_droid.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_schematic_droid",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_schematic_droid",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1382937840,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_schematic_droid, "object/tangible/painting/shared_painting_schematic_droid.iff")
object_tangible_painting_shared_painting_schematic_transport_ship = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_schematic_transport_ship.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_schematic_transport_ship.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_schematic_transport_ship",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_schematic_transport_ship",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 648855104,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_schematic_transport_ship, "object/tangible/painting/shared_painting_schematic_transport_ship.iff")
object_tangible_painting_shared_painting_schematic_weapon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_schematic_weapon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_schematic_weapon.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_schematic_weapon",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_schematic_weapon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2579175131,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_schematic_weapon, "object/tangible/painting/shared_painting_schematic_weapon.iff")
object_tangible_painting_shared_painting_schematic_weapon_s03 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_schematic_weapon_s03.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_schematic_weapon_s03.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_schematic_weapon_s03",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_schematic_weapon_s03",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 716865001,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_schematic_weapon_s03, "object/tangible/painting/shared_painting_schematic_weapon_s03.iff")
object_tangible_painting_shared_painting_skyscraper = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_skyscraper.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_skyscraper.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:skyscraper",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:skyscraper",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4253954885,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_skyscraper, "object/tangible/painting/shared_painting_skyscraper.iff")
object_tangible_painting_shared_painting_smoking_ad = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_smoking_ad.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_smoking_ad.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_smoking_ad",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_smoking_ad",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 200259882,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_smoking_ad, "object/tangible/painting/shared_painting_smoking_ad.iff")
object_tangible_painting_shared_painting_starmap = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_starmap.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_starmap.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:starmap",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:starmap",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2644531826,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_starmap, "object/tangible/painting/shared_painting_starmap.iff")
object_tangible_painting_shared_painting_tato_s03 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_tato_s03.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tato_s03.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_tato_s03",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_tato_s03",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2441069764,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_tato_s03, "object/tangible/painting/shared_painting_tato_s03.iff")
object_tangible_painting_shared_painting_tato_s04 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_tato_s04.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tato_s04.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_tato_s04",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_tato_s04",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1788669904,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_tato_s04, "object/tangible/painting/shared_painting_tato_s04.iff")
object_tangible_painting_shared_painting_teras_kasi = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_teras_kasi.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_teras_kasi.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:teras_kasi",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:teras_kasi",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4110008393,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_teras_kasi, "object/tangible/painting/shared_painting_teras_kasi.iff")
object_tangible_painting_shared_painting_teras_kasi_2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_teras_kasi_2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_teras_kasi_2.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:teras_kasi_2",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:teras_kasi_2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 956503088,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_teras_kasi_2, "object/tangible/painting/shared_painting_teras_kasi_2.iff")
object_tangible_painting_shared_painting_trandoshan_m = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_trandoshan_m.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tandoshan_m.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_trandoshan_m",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_trandoshan_m",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2913821862,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_trandoshan_m, "object/tangible/painting/shared_painting_trandoshan_m.iff")
object_tangible_painting_shared_painting_trandoshan_m_01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_trandoshan_m_01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tandoshan_m1.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_trandoshan_m1",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_trandoshan_m1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1179174055,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_trandoshan_m_01, "object/tangible/painting/shared_painting_trandoshan_m_01.iff")
object_tangible_painting_shared_painting_trandoshan_wanted = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_trandoshan_wanted.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_trandoshan_wanted.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:trandoshan_wanted",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:trandoshan_wanted",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3605402564,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_trandoshan_wanted, "object/tangible/painting/shared_painting_trandoshan_wanted.iff")
object_tangible_painting_shared_painting_tree = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_tree.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_trees_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_blueleaf_temple",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_blueleaf_temple",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3334758805,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_tree, "object/tangible/painting/shared_painting_tree.iff")
object_tangible_painting_shared_painting_trees_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_trees_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_trees_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_trees_s01",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_trees_s01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1783509906,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_trees_s01, "object/tangible/painting/shared_painting_trees_s01.iff")
object_tangible_painting_shared_painting_twilek_f = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_twilek_f.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1175481538,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f, "object/tangible/painting/shared_painting_twilek_f.iff")
object_tangible_painting_shared_painting_twilek_f_lg_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_lg_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 380699826,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_lg_s01, "object/tangible/painting/shared_painting_twilek_f_lg_s01.iff")
object_tangible_painting_shared_painting_twilek_f_lg_s02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_lg_s02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3450252325,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_lg_s02, "object/tangible/painting/shared_painting_twilek_f_lg_s02.iff")
object_tangible_painting_shared_painting_twilek_f_lg_s03 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_lg_s03.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s03.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2225851304,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_lg_s03, "object/tangible/painting/shared_painting_twilek_f_lg_s03.iff")
object_tangible_painting_shared_painting_twilek_f_lg_s04 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_lg_s04.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s04.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2135482556,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_lg_s04, "object/tangible/painting/shared_painting_twilek_f_lg_s04.iff")
object_tangible_painting_shared_painting_twilek_f_sm_s01 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_sm_s01.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_sm_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3456145212,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_sm_s01, "object/tangible/painting/shared_painting_twilek_f_sm_s01.iff")
object_tangible_painting_shared_painting_twilek_f_sm_s02 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_sm_s02.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_sm_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 353845163,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_sm_s02, "object/tangible/painting/shared_painting_twilek_f_sm_s02.iff")
object_tangible_painting_shared_painting_twilek_f_sm_s03 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_sm_s03.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_sm_s03.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1545230374,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_sm_s03, "object/tangible/painting/shared_painting_twilek_f_sm_s03.iff")
object_tangible_painting_shared_painting_twilek_f_sm_s04 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_f_sm_s04.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_sm_s04.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_twilek_f.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2818143026,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_f_sm_s04, "object/tangible/painting/shared_painting_twilek_f_sm_s04.iff")
object_tangible_painting_shared_painting_twilek_m = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_twilek_m.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_twilek_m.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_twilek_m",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_twilek_m",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3706635091,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_twilek_m, "object/tangible/painting/shared_painting_twilek_m.iff")
object_tangible_painting_shared_painting_vader_victory = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_vader_victory.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tall_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_vader_victory.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:vader_victory",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:vader_victory",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3566316574,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_vader_victory, "object/tangible/painting/shared_painting_vader_victory.iff")
object_tangible_painting_shared_painting_valley_view = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_valley_view.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_valley_view.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:valley_view",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:valley_view",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2895682928,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_valley_view, "object/tangible/painting/shared_painting_valley_view.iff")
object_tangible_painting_shared_painting_victorious_reign = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_victorious_reign.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_tall_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_victorious_reign.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:victorious_reign",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:victorious_reign",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2421149115,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_victorious_reign, "object/tangible/painting/shared_painting_victorious_reign.iff")
object_tangible_painting_shared_painting_waterfall = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_waterfall.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_square_lg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "clientdata/item/client_shared_painting_waterfall.cdf",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:waterfall",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:waterfall",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4064843162,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_waterfall, "object/tangible/painting/shared_painting_waterfall.iff")
object_tangible_painting_shared_painting_wookiee_f = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_wookiee_f.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_wookiee_f.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_wookiee_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_wookiee_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3402224478,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_wookiee_f, "object/tangible/painting/shared_painting_wookiee_f.iff")
object_tangible_painting_shared_painting_wookiee_m = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_wookiee_m.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_wookiee_m.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_wookiee_m",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_wookiee_m",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1345813711,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_wookiee_m, "object/tangible/painting/shared_painting_wookiee_m.iff")
object_tangible_painting_shared_painting_zabrak_f = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_zabrak_f.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_zabrak_f.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_zabrak_f",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_zabrak_f",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2622418438,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_zabrak_f, "object/tangible/painting/shared_painting_zabrak_f.iff")
object_tangible_painting_shared_painting_zabrak_m = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/painting/shared_painting_zabrak_m.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/frn_all_painting_zabrak_m1.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 8203,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 0,
collisionMaterialBlockFlags = 1,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@frn_d:painting_zabrak_m",
gameObjectType = 8203,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@frn_n:painting_zabrak_m",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 112214423,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/base/shared_tangible_craftable.iff", "object/tangible/furniture/base/shared_furniture_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_painting_shared_painting_zabrak_m, "object/tangible/painting/shared_painting_zabrak_m.iff")
|
local CT = ControllerTweaks
local Inventory = CT_Plugin:Subclass()
local NONE = GetString(SI_ITEMTYPE0)
local LEFT_STICK = GetString(SI_KEYCODE129)
local RIGHT_STICK = GetString(SI_KEYCODE130)
local QUATERNARY = GetString(SI_BINDING_NAME_UI_SHORTCUT_QUATERNARY)
local JUNK_ICON = "EsoUI/Art/Inventory/inventory_tabIcon_junk_up.dds"
local RESEARCH_ICON = "EsoUI/Art/Inventory/Gamepad/gp_inventory_trait_not_researched_icon.dds"
local BIND_NAME = GetString(SI_GAMEPAD_TOGGLE_OPTION) .. " " .. GetString(SI_ITEMFILTERTYPE9)
local junkHotkeyOption = {
settingKey = "JunkHotkey",
type = "dropdown",
name = "Toggle Junk Hotkey",
tooltip = "Hotkey for toggle junk command.",
choices = {NONE, LEFT_STICK, RIGHT_STICK, QUATERNARY},
choicesValues = {"NONE", "UI_SHORTCUT_LEFT_STICK", "UI_SHORTCUT_RIGHT_STICK", "UI_SHORTCUT_QUATERNARY"},
width = "full",
default = "UI_SHORTCUT_RIGHT_STICK"
}
local stackAllHotkeyOption = {
settingKey = "StackAllHotkey",
type = "dropdown",
name = "Stack All Hotkey",
tooltip = "Hotkey for stack all.",
choices = {NONE, LEFT_STICK, RIGHT_STICK, QUATERNARY},
choicesValues = {"NONE", "UI_SHORTCUT_LEFT_STICK", "UI_SHORTCUT_RIGHT_STICK", "UI_SHORTCUT_QUATERNARY"},
width = "full",
default = "UI_SHORTCUT_LEFT_STICK"
}
local destroyHotkeyOption = {
settingKey = "DestroyHotkey",
type = "dropdown",
name = "Destroy Item Hotkey",
tooltip = "Hotkey for destroy item command.",
choices = {NONE, LEFT_STICK, RIGHT_STICK, QUATERNARY},
choicesValues = {"NONE", "UI_SHORTCUT_LEFT_STICK", "UI_SHORTCUT_RIGHT_STICK", "UI_SHORTCUT_QUATERNARY"},
width = "full",
default = "UI_SHORTCUT_QUATERNARY"
}
Inventory.options = {junkHotkeyOption, stackAllHotkeyOption, destroyHotkeyOption}
local function ShowJunkIcons(control, data, selected, reselectingDuringRebuild, enabled, active)
local statusIndicator = control.statusIndicator
if statusIndicator then
if data.isEquippedInCurrentCategory or data.isEquippedInAnotherCategory then
--Don't override the equipped indicator
elseif data.isJunk then
statusIndicator:ClearIcons()
statusIndicator:AddIcon(JUNK_ICON)
statusIndicator:Show()
elseif data.traitInformation == ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED then
statusIndicator:ClearIcons()
statusIndicator:AddIcon(RESEARCH_ICON)
statusIndicator:Show()
end
end
end
local function ToggleItemJunk()
local targetData = GAMEPAD_INVENTORY.itemList:GetTargetData()
local bag, index = ZO_Inventory_GetBagAndIndex(targetData)
SetItemIsJunk(bag, index, not IsItemJunk(bag, index))
end
local _junkHotkeyIndex = nil
local _destroyHotkeyIndex = nil
local _stackAllHotkeyIndex = nil
local function UpdateInventoryHotkeys(descriptor)
local inventoryBinds = GAMEPAD_INVENTORY.itemFilterKeybindStripDescriptor
if not inventoryBinds then
return false
end
if not _destroyHotkeyIndex then
for i, hotkey in ipairs(inventoryBinds) do
if hotkey.name == GetString(SI_ITEM_ACTION_STACK_ALL) then
_stackAllHotkeyIndex = i
end
if hotkey.name == GetString(SI_ITEM_ACTION_DESTROY) then
_destroyHotkeyIndex = i
end
end
end
if _destroyHotkeyIndex then
inventoryBinds[_destroyHotkeyIndex].keybind = CT.Settings[destroyHotkeyOption.settingKey]
end
if _stackAllHotkeyIndex then
inventoryBinds[_stackAllHotkeyIndex].keybind = CT.Settings[stackAllHotkeyOption.settingKey]
end
if CT.Settings.JunkHotkey == "None" then
if _junkHotkeyIndex then
inventoryBinds.remove(_junkHotkeyIndex)
_junkHotkeyIndex = nil
end
else
if _junkHotkeyIndex then
--Already created entry, just make sure the hotkey is up to date
inventoryBinds[_junkHotkeyIndex].keybind = CT.Settings[junkHotkeyOption.settingKey]
else
_junkHotkeyIndex = #inventoryBinds + 1
inventoryBinds[_junkHotkeyIndex] = {
name = BIND_NAME,
keybind = CT.Settings[junkHotkeyOption.settingKey],
order = 1501,
disabledDuringSceneHiding = true,
visible = function()
local inventorySlot = GAMEPAD_INVENTORY.itemList:GetTargetData()
if inventorySlot then
local bag, index = ZO_Inventory_GetBagAndIndex(inventorySlot)
return bag and index and CanItemBeMarkedAsJunk(bag, index)
else
return false
end
end,
callback = ToggleItemJunk
}
end
end
return false
end
local function AddItemActions()
if not GAMEPAD_INVENTORY.itemActions or not GAMEPAD_INVENTORY.itemActions.inventorySlot then
return false
end
local bag, index = ZO_Inventory_GetBagAndIndex(GAMEPAD_INVENTORY.itemActions.inventorySlot)
if not bag or not index then
return false
end
local canBeJunk = CanItemBeMarkedAsJunk(bag, index)
if not IsItemJunk(bag, index) and canBeJunk then
GAMEPAD_INVENTORY.itemActions.slotActions:AddSlotAction(SI_ITEM_ACTION_MARK_AS_JUNK, function() SetItemIsJunk(bag, index, true) end, nil)
end
if IsItemJunk(bag, index) then
GAMEPAD_INVENTORY.itemActions.slotActions:AddSlotAction(SI_ITEM_ACTION_UNMARK_AS_JUNK, function() SetItemIsJunk(bag, index, false) end, nil)
end
if PersonalAssistant and PersonalAssistant.Junk then
local itemLink = GetItemLink(bag, index)
local paItemId = PersonalAssistant.HelperFunctions.getPAItemLinkIdentifier(itemLink)
local hasPARule = PersonalAssistant.HelperFunctions.isKeyInTable(PersonalAssistant.Junk.SavedVars.Custom.PAItemIds, paItemId)
if CanItemBeMarkedAsJunk(bag, index) and not hasPARule then
GAMEPAD_INVENTORY.itemActions.slotActions:AddSlotAction(SI_PA_SUBMENU_PAJ_MARK_PERM_JUNK, function() PersonalAssistant.Junk.addItemToPermanentJunk(itemLink, bag, index) end, nil)
end
if hasPARule then
GAMEPAD_INVENTORY.itemActions.slotActions:AddSlotAction(SI_PA_SUBMENU_PAJ_UNMARK_PERM_JUNK, function() PersonalAssistant.Junk.removeItemFromPermanentJunk(itemLink) end, nil)
end
end
if TamrielTradeCentre then
local itemLink = GetItemLink(bag, index)
GAMEPAD_INVENTORY.itemActions.slotActions:AddSlotAction(TTC_PRICE_PRICETOCHAT, function() TamrielTradeCentrePrice:PriceInfoToChat(itemLink, TamrielTradeCentreLangEnum.Default) end, nil)
end
return false
end
function Inventory:Init()
ZO_PostHook("ZO_SharedGamepadEntry_OnSetup", ShowJunkIcons)
ZO_PreHook(ZO_GamepadInventory, "SetActiveKeybinds", UpdateInventoryHotkeys)
ZO_PreHook(ZO_ItemSlotActionsController, "RefreshKeybindStrip", AddItemActions)
end
CT.Inventory = Inventory
|
function loadGangAccount(gangid)
local self = {}
self.gid = gangid
local processed = false
local query = exports.ghmattimysql:executeSync("SELECT * FROM `bank_accounts` WHERE `gangid` = @gang AND `account_type` = 'Gang'", {['@gang'] = self.gid})
if query[1] ~= nil then
self.accountnumber = query[1].account_number
self.sortcode = query[1].sort_code
self.balance = query[1].amount
self.account_type = query[1].account_type
self.accountid = query[1].record_id
end
processed = true
repeat Wait(0) until processed == true
processed = false
local state = exports.ghmattimysql:executeSync("SELECT * FROM `bank_statements` WHERE `account_number` = @ac AND `sort_code` = @sc AND `gangid` = @gid", {['@ac'] = self.accountnumber, ['@sc'] = self.sortcode, ['@gid'] = self.gid})
self.accountStatement = state
processed = true
repeat Wait(0) until processed == true
self.saveAccount = function()
exports['ghmattimysql']:execute("UPDATE `bank_accounts` SET `amount` = @balance WHERE `record_id` @aid", {['@balance'] = self.balance, ['@aid'] = self.accountid })
end
local rTable = {}
rTable.getBalance = function()
return self.balance
end
rTable.getStatement = function()
return self.accountStatement
end
rTable.getAccountDetails = function()
local accountDetails = {['number'] = self.accountnumber, ['sortcode'] = self.sortcode}
return accountDetails
end
--- Update Functions
rTable.addMoney = function(m)
if type(m) == "number" then
self.balance = self.balance + m
self.saveAccount()
end
end
rTable.removeMoney = function(m)
if type(m) == "number" then
if self.balance >= m then
self.balance = self.balance - m
self.saveAccount()
return true
else
return false
end
end
end
end
function createGangAccount(gang, startingBalance)
local newBalance = tonumber(startingBalance) or 0
local checkExists = exports.ghmattimysql:executeSync("SELECT * FROM `bank_accounts` WHERE `gangid` = @gang", {['@gang'] = gang})
if checkExists[1] == nil then
local sc = math.random(100000,999999)
local acct = math.random(10000000,99999999)
exports['ghmattimysql']:execute("INSERT INTO `bank_accounts` (`gangid`, `account_number`, `sort_code`, `amount`, `account_type`) VALUES (@gang, @acnum, @sc, @bal, 'Gang')", {['@gang'] = gang, ['@acnum'] = acct, ['@sc'] = sc, ['@bal'] = newBalance }, function(success)
if success > 0 then
gangAccounts[gang] = loadGangAccount(gang)
end
end)
end
end
exports('createGangAccount', function(gang, starting)
createGangAccount(gang, starting)
end)
|
local cutorch = require "cutorch"
local cunn = require "cunn"
local nn = require "nn"
local nngraph = require "nngraph"
local optim = require "optim"
-- set gated network hyperparameters
local opt = {}
opt.embedSize = 300
opt.gateSize = 300
opt.hiddenSize = 900
opt.batchSize = 100
opt.numEpochs = 2000
opt.saveEpochInterval = 100
opt.margin = 0.5
opt.useGPU = true -- use CUDA_VISIBLE_DEVICES to set the GPU you want to use
opt.predFile = "predict.mtrain_nogate.out"
opt.numTrainingExx = 198302
opt.numTestExx = 186
opt.trainFile = '/local/filespace/lr346/disco/experiments/negation/nncg-negation/mohammad/mtrain.train'
opt.testFile = '/local/filespace/lr346/disco/experiments/negation/nncg-negation/mohammad/mtrain.test'
opt.modelBase = 'model_mtrain_nogate'
-- define gated network graph
---- declare inputs
print("Constructing input layers")
local word_vector = nn.Identity()()
local wn_targ_vector = nn.Identity()()
local m_targ_vector = nn.Identity()()
local sample_vector = nn.Identity()()
---- define hidden layer
print("Constructing hidden state")
local h = nn.Sigmoid()(nn.Linear(opt.embedSize, opt.hiddenSize)(nn.JoinTable(2)({word_vector})))
---- define output layer
print("Constructing output")
local output = nn.Linear(opt.hiddenSize, opt.embedSize)({h})
---- Construct model
print("Constructing module")
local ged = nn.gModule({word_vector}, {output})
-- define loss function
print("Defining loss function")
local out_vec = nn.Identity()()
local out_vec2 = nn.Identity()()
local wn_targ_vec = nn.Identity()()
local m_targ_vec = nn.Identity()()
local sample_vec = nn.Identity()()
local rank = nn.Identity()()
local cos1 = nn.CosineDistance()({out_vec, m_targ_vec})
local cos2 = nn.CosineDistance()({out_vec, sample_vec})
local parInput = nn.ParallelTable()
:add(nn.Identity())
:add(nn.Identity())
local ranking_loss = nn.MarginRankingCriterion(opt.margin)({parInput({cos1, cos2}), rank})
local split1 = nn.SplitTable(1)
local split2 = nn.SplitTable(1)
local mse_loss = nn.MSECriterion()({out_vec2, wn_targ_vec})
-- local loss = nn.ParallelCriterion()({mse_loss, ranking_loss})
-- local loss_module = nn.gModule({out_vec, wn_targ_vec, m_targ_vec, sample_vec, rank}, {loss})
local mse_loss_module = nn.gModule({out_vec2, wn_targ_vec}, {mse_loss})
local ranking_loss_module = nn.gModule({out_vec, m_targ_vec, sample_vec, rank}, {ranking_loss})
-- GPU mode
if opt.useGPU then
ged:cuda()
-- loss_module:cuda()
mse_loss_module:cuda()
ranking_loss_module:cuda()
end
-- read training and test data
print("Reading training data")
traindata = torch.Tensor(opt.numTrainingExx, 5*opt.embedSize)
io.input(opt.trainFile)
linecount = 0
for line in io.lines() do
linecount = linecount + 1
valcount = 0
for num in string.gmatch(line, "%S+") do
valcount = valcount + 1
if valcount > 1 then
traindata[linecount][valcount - 1] = tonumber(num)
end
end
end
print("Reading test data")
testdata = torch.Tensor(opt.numTestExx, 5*opt.embedSize)
testwords = {}
io.input(opt.testFile)
linecount = 0
for line in io.lines() do
linecount = linecount + 1
valcount = 0
for num in string.gmatch(line, "%S+") do
valcount = valcount + 1
if valcount == 1 then
testwords[linecount] = num
else
testdata[linecount][valcount - 1] = tonumber(num)
end
end
end
-- train model
local x, gradParameters = ged:getParameters()
for epoch = 1, opt.numEpochs do
print("Training epoch", epoch)
shuffle = torch.randperm(traindata:size()[1])
current_loss = 0
for t = 1, traindata:size()[1], opt.batchSize do
-- print("example number: ", t)
local inputs = {}
local wn_targets = {}
local m_targets = {}
local samples = {}
for j = t, math.min(t + opt.batchSize - 1, traindata:size()[1]) do
local input = traindata[shuffle[j]]:narrow(1, 1, opt.embedSize):resize(1, opt.embedSize)
local wn_target = traindata[shuffle[j]]:narrow(1, 2*opt.embedSize + 1, opt.embedSize):resize(1, opt.embedSize)
local m_target = traindata[shuffle[j]]:narrow(1, 3*opt.embedSize + 1, opt.embedSize):resize(1, opt.embedSize)
local sample = traindata[shuffle[j]]:narrow(1, 4*opt.embedSize + 1, opt.embedSize):resize(1,opt.embedSize)
if opt.useGPU then
input = input:cuda()
wn_target = wn_target:cuda()
m_target = m_target:cuda()
sample = sample:cuda()
end
table.insert(inputs, input:clone())
table.insert(wn_targets, wn_target:clone())
table.insert(m_targets, m_target:clone())
table.insert(samples, sample:clone())
end
local feval = function(w) -- w = weight vector. returns loss, dloss_dw
gradParameters:zero()
inputs = torch.cat(inputs, 1)
wn_targets = torch.cat(wn_targets, 1)
m_targets = torch.cat(m_targets, 1)
samples = torch.cat(samples, 1)
ranks = torch.ones(inputs:size(1)):cuda()
-- local result = ged:forward({inputs, gates})
-- local f = loss_module:forward({result, wn_targets, m_targets, samples, ranks})
-- local gradErr = loss_module:backward({result, wn_targets, m_targets, samples, ranks}, torch.ones(1):cuda())
-- local gradOut, gradWnTarg, gradMTarg, gradSample, gradRank = unpack(gradErr)
-- ged:backward({inputs, gates}, gradOut)
local result = ged:forward({inputs})
local mse_f = mse_loss_module:forward({result, wn_targets})
-- print(mse_f)
local ranking_f = ranking_loss_module:forward({result, m_targets, samples, ranks})
-- print(ranking_f)
local ranking_gradErr = ranking_loss_module:backward({result, m_targets, samples, ranks}, torch.ones(1):cuda())
local mse_gradErr = mse_loss_module:backward({result, wn_targets}, torch.ones(1):cuda())
local mse_gradOut, mse_gradWnTarg = unpack(mse_gradErr)
local ranking_gradOut, ranking_gradMTarg, ranking_gradSample, ranking_gradRank = unpack(ranking_gradErr)
ged:backward({inputs}, (mse_gradOut+ranking_gradOut)/2)
-- DON'T normalize gradients and f(X)
-- gradParameters:div(inputs:size(1))
return (ranking_f+mse_f)/2, gradParameters
end -- local feval
_, fs = optim.adadelta(feval, x, {rho = 0.9})
current_loss = current_loss + fs[1]
end -- for t = 1, traindata:size()[1], opt.batchSize
current_loss = (current_loss * opt.batchSize) / traindata:size()[1]
print("... Current loss", current_loss[1])
if epoch % opt.saveEpochInterval == 0 then
print("Saving model")
torch.save(opt.modelBase .. tostring(epoch) .. ".net", ged)
end
end -- for epoch = 1, opt.numEpochs
-- predict
print "Predicting"
predFileStream = io.open(opt.predFile, "w")
-- module with the first half of the network
local shuffle = torch.randperm(testdata:size(1))
for t = 1, testdata:size(1) do
local input_word = testwords[t]
local input = testdata[shuffle[t]]:narrow(1, 1, opt.embedSize):resize(1, opt.embedSize)
if opt.useGPU then
input = input:cuda()
end
local output = ged:forward({input})
predFileStream:write(input_word .. "\t[")
for k = 1, output:size(2) do
predFileStream:write(output[1][k] .. ", ")
end
predFileStream:write("]\n")
end
|
TUTORIALS['en'][#TUTORIALS['en'] + 1] = {
name = "Sewers",
contents = {
{type = CONTENT_TYPES.IMAGE, value = "/images/tutorial/sewers.png"},
{type = CONTENT_TYPES.TEXT, value = "One of the best places for beginners in the game are the sewers of the cities. In this type of place you will find Pokemon at lower levels, where you can easily evolve your Pokemon until you feel comfort to explore the most dangerous places.\n\nTo enter a sewer, you first need to find a entry, as the image above. After finding, use the floor that has the metal bars."},
{type = CONTENT_TYPES.TEXT, value = "After getting into a sewer, you need to use the ladder to return to the upper floor."},
{type = CONTENT_TYPES.IMAGE, value = "/images/tutorial/ladder.png"},
}
}
|
-- PUMPKIN SPICE!!!
-- Spice
minetest.register_craftitem("pumpkinspice:pumpkinspice", {
description = "Pumpkin Spice",
inventory_image = "pumpkinspice.png"
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:pumpkinspice 2",
recipe = {"farming:pumpkin_slice"},
})
-- Latte
minetest.register_craftitem("pumpkinspice:pumpkinspice_latte", {
description = "Pumpkin Spice Latte",
inventory_image = "pumpkinspice_latte.png",
stack_max = 1,
on_use = minetest.item_eat(15, "farming:drinking_cup"),
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:pumpkinspice_latte",
recipe = {"farming:coffee_cup_hot", "pumpkinspice:pumpkinspice"}
})
-- Donut
minetest.register_craftitem("pumpkinspice:donut_pumpkinspice", {
description = "Pumpkin Spice Donut",
inventory_image = "donut_pumpkinspice.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "pumpkinspice:donut_pumpkinspice",
recipe = {
{'pumpkinspice:pumpkinspice'},
{'farming:donut'},
}
})
-- Cookie
minetest.register_craftitem("pumpkinspice:pumpkinspice_cookie", {
description = "Pumpkin Spice Cookie",
inventory_image = "pumpkinspice_cookie.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:pumpkinspice_cookie",
recipe = {"farming:cookie", "pumpkinspice:pumpkinspice"}
})
-- Bread
minetest.register_craftitem("pumpkinspice:pumpkinspice_bread", {
description = "Pumpkin Spice Bread",
inventory_image = "pumpkinspice_bread.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:pumpkinspice_bread",
recipe = {"farming:bread", "pumpkinspice:pumpkinspice"}
})
-- Muffins
-- base
minetest.register_craftitem("pumpkinspice:muffin", {
description = "Muffin",
inventory_image = "muffin_base.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "pumpkinspice:muffin 2",
recipe = {
{"default:paper", "farming:bread", "default:paper"},
{"default:paper", "farming:bread", "default:paper"},
},
})
-- re-register blueberry
minetest.register_craftitem(":farming:muffin_blueberry", {
description = "Blueberry Muffin",
inventory_image = "farming_blueberry_muffin.png",
on_use = minetest.item_eat(3),
})
minetest.register_craft({
type = "shapeless",
output = "farming:muffin_blueberry 2",
recipe = {"farming:blueberries", "pumpkinspice:muffin"},
})
-- pumpkinspice muffin
minetest.register_craftitem("pumpkinspice:muffin_pumpkinspice", {
description = "Pumpkin Spice Muffin",
inventory_image = "muffin_pumpkinspice.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:muffin_pumpkinspice 2",
recipe = {"pumpkinspice:pumpkinspice", "pumpkinspice:muffin"},
})
-- Bagels
-- base
minetest.register_craftitem("pumpkinspice:bagel", {
description = "Bagel",
inventory_image = "bagel.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "pumpkinspice:bagel 5",
recipe = {
{"farming:bread", "farming:bread", "farming:bread"},
{"farming:bread", "", "farming:bread"},
{"farming:bread", "farming:bread", "farming:bread"},
},
})
-- pumpkinspice bagel
minetest.register_craftitem("pumpkinspice:bagel_pumpkinspice", {
description = "Pumpkin Spice Bagel",
inventory_image = "pumpkinspice_bagel.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:bagel_pumpkinspice 2",
recipe = {"pumpkinspice:pumpkinspice", "pumpkinspice:bagel"},
})
-- Cake
minetest.register_craftitem("pumpkinspice:pumpkinspice_cakebatter", {
description = "Pumpkin Spice Cake Batter",
inventory_image = "pumpkinspice_cakebatter.png",
})
minetest.register_craft({
output = "pumpkinspice:pumpkinspice_cakebatter",
recipe = {
{"pumpkinspice:pumpkinspice", "pumpkinspice:pumpkinspice", "pumpkinspice:pumpkinspice"},
{"farming:flour", "farming:sugar", "farming:flour"},
},
})
minetest.register_craftitem("pumpkinspice:pumpkinspice_cake", {
description = "Pumpkin Spice Cake",
inventory_image = "pumpkinspice_cake.png",
on_use = minetest.item_eat(12),
})
minetest.register_craft({
type = "cooking",
output = "pumpkinspice:pumpkinspice_cake",
recipe = "pumpkinspice:pumpkinspice_cakebatter",
cooktime = 25,
})
|
-- shared.lua
DEFINE_BASECLASS("base_wire_entity")
ENT.PrintName = "ACF Rack"
ENT.Author = "Bubbus"
ENT.Contact = "splambob@googlemail.com"
ENT.Purpose = "Because launch tubes aren't cool enough."
ENT.Instructions = "Point towards face for removal of face. Point away from face for instant fake tan (then removal of face)."
ENT.WireDebugName = "ACF Rack"
|
require("firecast.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
require("locale.lua");
local __o_Utils = require("utils.lua");
local function constructNew_frmItemEffect()
local obj = GUI.fromHandle(_obj_newObject("form"));
local self = obj;
local sheet = nil;
rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject"));
function obj:setNodeObject(nodeObject)
sheet = nodeObject;
self.sheet = nodeObject;
self:_oldSetNodeObjectFunction(nodeObject);
end;
function obj:setNodeDatabase(nodeObject)
self:setNodeObject(nodeObject);
end;
_gui_assignInitialParentForForm(obj.handle);
obj:beginUpdate();
obj:setName("frmItemEffect");
obj:setHeight(50);
obj:setMargins({top=1});
obj.rectangle1 = GUI.fromHandle(_obj_newObject("rectangle"));
obj.rectangle1:setParent(obj);
obj.rectangle1:setAlign("top");
obj.rectangle1:setColor("#212121");
obj.rectangle1:setHeight(25);
obj.rectangle1:setVisible(true);
obj.rectangle1:setName("rectangle1");
obj.label1 = GUI.fromHandle(_obj_newObject("label"));
obj.label1:setParent(obj.rectangle1);
obj.label1:setAlign("left");
obj.label1:setWidth(50);
obj.label1:setText("Tipo");
obj.label1:setHorzTextAlign("center");
obj.label1:setName("label1");
obj.comboBox1 = GUI.fromHandle(_obj_newObject("comboBox"));
obj.comboBox1:setParent(obj.rectangle1);
obj.comboBox1:setAlign("left");
obj.comboBox1:setWidth(65);
obj.comboBox1:setField("tipo");
obj.comboBox1:setItems({'Efeito','Fixo'});
obj.comboBox1:setHint("Efeito: efeito baseado em magia. \nFixo: bônus númerico fixo.");
obj.comboBox1:setName("comboBox1");
obj.label2 = GUI.fromHandle(_obj_newObject("label"));
obj.label2:setParent(obj.rectangle1);
obj.label2:setAlign("left");
obj.label2:setWidth(50);
obj.label2:setText("Posição");
obj.label2:setHorzTextAlign("center");
obj.label2:setName("label2");
obj.comboBox2 = GUI.fromHandle(_obj_newObject("comboBox"));
obj.comboBox2:setParent(obj.rectangle1);
obj.comboBox2:setAlign("left");
obj.comboBox2:setWidth(85);
obj.comboBox2:setField("posicao");
obj.comboBox2:setItems({'Base','Adicional', 'Livre'});
obj.comboBox2:setValues({'1','2','3'});
obj.comboBox2:setHint("Base: efeito mais caro do item (preço x1). \nAdicional: efeito secundario (preço x1.5). \nLivre: efeito de item que não oculpa espaços (preço x2).");
obj.comboBox2:setName("comboBox2");
obj.label3 = GUI.fromHandle(_obj_newObject("label"));
obj.label3:setParent(obj.rectangle1);
obj.label3:setAlign("left");
obj.label3:setWidth(40);
obj.label3:setText("Valor");
obj.label3:setHorzTextAlign("center");
obj.label3:setName("label3");
obj.label4 = GUI.fromHandle(_obj_newObject("label"));
obj.label4:setParent(obj.rectangle1);
obj.label4:setAlign("left");
obj.label4:setWidth(60);
obj.label4:setField("preco");
obj.label4:setHorzTextAlign("center");
lfm_setPropAsString(obj.label4, "formatFloat", ",0.## PO");
obj.label4:setFontSize(10);
obj.label4:setName("label4");
obj.button1 = GUI.fromHandle(_obj_newObject("button"));
obj.button1:setParent(obj.rectangle1);
obj.button1:setAlign("left");
obj.button1:setWidth(25);
obj.button1:setText("X");
obj.button1:setName("button1");
obj.efeito = GUI.fromHandle(_obj_newObject("rectangle"));
obj.efeito:setParent(obj);
obj.efeito:setAlign("client");
obj.efeito:setColor("#212121");
obj.efeito:setVisible(true);
obj.efeito:setName("efeito");
obj.label5 = GUI.fromHandle(_obj_newObject("label"));
obj.label5:setParent(obj.efeito);
obj.label5:setAlign("left");
obj.label5:setWidth(50);
obj.label5:setText("NC");
obj.label5:setHorzTextAlign("center");
obj.label5:setName("label5");
obj.edit1 = GUI.fromHandle(_obj_newObject("edit"));
obj.edit1:setParent(obj.efeito);
obj.edit1:setAlign("left");
obj.edit1:setWidth(30);
obj.edit1:setField("nc");
obj.edit1:setType("number");
obj.edit1:setName("edit1");
obj.label6 = GUI.fromHandle(_obj_newObject("label"));
obj.label6:setParent(obj.efeito);
obj.label6:setAlign("left");
obj.label6:setWidth(50);
obj.label6:setText("Nível");
obj.label6:setHorzTextAlign("center");
obj.label6:setName("label6");
obj.edit2 = GUI.fromHandle(_obj_newObject("edit"));
obj.edit2:setParent(obj.efeito);
obj.edit2:setAlign("left");
obj.edit2:setWidth(30);
obj.edit2:setField("nivel");
obj.edit2:setType("number");
obj.edit2:setName("edit2");
obj.label7 = GUI.fromHandle(_obj_newObject("label"));
obj.label7:setParent(obj.efeito);
obj.label7:setAlign("left");
obj.label7:setWidth(50);
obj.label7:setText("Usos");
obj.label7:setHorzTextAlign("center");
obj.label7:setName("label7");
obj.comboBox3 = GUI.fromHandle(_obj_newObject("comboBox"));
obj.comboBox3:setParent(obj.efeito);
obj.comboBox3:setAlign("left");
obj.comboBox3:setWidth(40);
obj.comboBox3:setField("usos");
obj.comboBox3:setItems({'1','2', '3','4','5','-','x2','x4'});
obj.comboBox3:setHint("1 a 5: Quantidade de usos diarios. \n-: efeito continuo. \nx2 ou x4: efeito de uso continuo com custo elevado. ");
obj.comboBox3:setName("comboBox3");
obj.label8 = GUI.fromHandle(_obj_newObject("label"));
obj.label8:setParent(obj.efeito);
obj.label8:setAlign("left");
obj.label8:setWidth(50);
obj.label8:setText("Ativação");
obj.label8:setHorzTextAlign("center");
obj.label8:setFontSize(10);
obj.label8:setName("label8");
obj.comboBox4 = GUI.fromHandle(_obj_newObject("comboBox"));
obj.comboBox4:setParent(obj.efeito);
obj.comboBox4:setAlign("left");
obj.comboBox4:setWidth(75);
obj.comboBox4:setField("ativacao");
obj.comboBox4:setItems({'Livre','Padrão'});
obj.comboBox4:setValues({'1','2'});
obj.comboBox4:setHint("Livre: ativar os efeitos do item é uma ação livre. \nAtivar os efeitos do item requer um comando [ação padrão].");
obj.comboBox4:setName("comboBox4");
obj.fixo = GUI.fromHandle(_obj_newObject("rectangle"));
obj.fixo:setParent(obj);
obj.fixo:setAlign("client");
obj.fixo:setColor("#212121");
obj.fixo:setVisible(false);
obj.fixo:setName("fixo");
obj.label9 = GUI.fromHandle(_obj_newObject("label"));
obj.label9:setParent(obj.fixo);
obj.label9:setAlign("left");
obj.label9:setWidth(50);
obj.label9:setText("Bônus");
obj.label9:setHorzTextAlign("center");
obj.label9:setName("label9");
obj.edit3 = GUI.fromHandle(_obj_newObject("edit"));
obj.edit3:setParent(obj.fixo);
obj.edit3:setAlign("left");
obj.edit3:setWidth(50);
obj.edit3:setField("bonus");
obj.edit3:setType("number");
obj.edit3:setName("edit3");
obj.label10 = GUI.fromHandle(_obj_newObject("label"));
obj.label10:setParent(obj.fixo);
obj.label10:setAlign("left");
obj.label10:setWidth(50);
obj.label10:setText("Efeito");
obj.label10:setHorzTextAlign("center");
obj.label10:setName("label10");
obj.comboBox5 = GUI.fromHandle(_obj_newObject("comboBox"));
obj.comboBox5:setParent(obj.fixo);
obj.comboBox5:setAlign("left");
obj.comboBox5:setWidth(225);
obj.comboBox5:setField("efeito");
obj.comboBox5:setItems({'Atributos (Melhoria)','Armadura (Melhoria)','Magia Adicional','CA (Deflexão)','CA (Outro)','Armadura Natural (Melhoria)','Resistencia','Resistencia (Outro)','Pericia (Competencia)','Pericia Parcial (Competencia)','Resistencia a Magia','Deslocamento','Carga (Fácil)','Carga'});
obj.comboBox5:setValues({'1','2','3','4','5','6','7','8','9','10','11','12','13','14'});
obj.comboBox5:setHint("Atributos (Melhoria): Bônus de melhoria em atributos. Multiplos de 2, max. 6. \nArmadura (Melhoria): Bônus de melhoria na armadura. Max. 10 \nMagia Adicional: Recupera magia do nível indicado. Max. 9.\nCA (Deflexão): Bônus deflexão na CA. Max. 5.\nCA (Outro): Outro bônus na CA. Max. 1.\nArmadura Natural (Melhoria): Bônus de melhoria na armadura natural. Max. 5.\nResistencia: Bônus em testes de resistência. Max. 5.\nResistencia (Outro): Outros bônus em testes de resistÊncia. Max. 1.\nPericia (Competencia): Bônus de competencia em testes de pericia. Max. 10.\nPericia Parcial (Competencia): Bônus de competencia em certos usos da pericia. Max. 10.\nResistencia a Magia: Valor fixo de resistencia a magia. Sem limite.\nDeslocamento: Cada 1 equivale a +1,5m para deslocamento de escavar; +3m para deslocamento terrestre, natação, escalar ou voo perfeito;\n +6 de voo bom; +9m de voo medio; +12m de voo ruim; ou +15m de voo desajeitado. Max. 3.\nCarga (Fácil): Carga reduzida de 25:1 e até 100Kg. Recuperar item é ação de movimento.\nCarga: Carga reduzida de 25:1 e até 1.000Kg. Recuperar item é até ação de rodada.");
obj.comboBox5:setName("comboBox5");
obj.dataLink1 = GUI.fromHandle(_obj_newObject("dataLink"));
obj.dataLink1:setParent(obj);
obj.dataLink1:setFields({'tipo'});
obj.dataLink1:setName("dataLink1");
obj.dataLink2 = GUI.fromHandle(_obj_newObject("dataLink"));
obj.dataLink2:setParent(obj);
obj.dataLink2:setFields({'tipo','nc','nivel','usos','posicao','ativacao'});
obj.dataLink2:setName("dataLink2");
obj.dataLink3 = GUI.fromHandle(_obj_newObject("dataLink"));
obj.dataLink3:setParent(obj);
obj.dataLink3:setFields({'tipo','efeito','bonus','posicao'});
obj.dataLink3:setName("dataLink3");
obj.dataLink4 = GUI.fromHandle(_obj_newObject("dataLink"));
obj.dataLink4:setParent(obj);
obj.dataLink4:setFields({'preco'});
obj.dataLink4:setName("dataLink4");
obj._e_event0 = obj.button1:addEventListener("onClick",
function (_)
Dialogs.confirmYesNo("Deseja realmente apagar esse efeito?",
function (confirmado)
if confirmado then
NDB.deleteNode(sheet);
end;
end);
end, obj);
obj._e_event1 = obj.dataLink1:addEventListener("onChange",
function (_, field, oldValue, newValue)
if sheet==nil then return end;
if sheet.tipo=="Efeito" then
self.efeito.visible = true;
self.fixo.visible = false;
else
self.efeito.visible = false;
self.fixo.visible = true;
end;
end, obj);
obj._e_event2 = obj.dataLink2:addEventListener("onChange",
function (_, field, oldValue, newValue)
if sheet==nil then return end;
if sheet.tipo~="Efeito" then return end;
local nc = tonumber(sheet.nc) or 1;
local nivel = tonumber(sheet.nivel) or 1;
-- Calcular multiplicador base da quantidade de usos
local mult = tonumber(sheet.usos) or 5;
if sheet.usos == "x2" then mult = 10 end;
if sheet.usos == "x4" then mult = 20 end;
-- Calcular multiplicador de posição do efeito
local posicao = tonumber(sheet.posicao) or 1;
local mults = {1,1.5,2};
local mult2 = mults[posicao];
-- Calcular preço base
local base = 360;
if sheet.ativacao=="1" then base=400 end;
local preco = nivel * nc * mult * mult2 * base;
sheet.preco = preco;
end, obj);
obj._e_event3 = obj.dataLink3:addEventListener("onChange",
function (_, field, oldValue, newValue)
if sheet==nil then return end;
if sheet.tipo~="Fixo" then return end;
local bonus = tonumber(sheet.bonus) or 1;
local sel = tonumber(sheet.efeito) or 1;
local base = {1000,1000,1000,2000,2500,2000,1000,2000,100,50,1000,3000,30,20};
-- Calcular multiplicador base do tipo de bonus
local mult = 1;
local limit = {6,10,9,5,1,5,5,1,10,10,-1,6,100,1000};
if bonus > limit[sel] then mult = 10 end;
-- Calcular multiplicador de posição do efeito
local posicao = tonumber(sheet.posicao) or 1;
local mults = {1,1.5,2};
local mult2 = mults[posicao];
local preco;
if sel == 11 then
preco = (bonus-12) * base[sel] * mult * mult2;
elseif sel==13 or sel==14 then
preco = bonus * base[sel] * mult * mult2;
else
preco = bonus * bonus * base[sel] * mult * mult2;
end;
sheet.preco = preco;
end, obj);
obj._e_event4 = obj.dataLink4:addEventListener("onChange",
function (_, field, oldValue, newValue)
if sheet==nil then return end;
local node = toolSheet;
local sum = 0;
local nodes = NDB.getChildNodes(node.effectList);
for i=1, #nodes, 1 do
sum = sum + (tonumber(nodes[i].preco) or 0);
end;
node.precoWoundrous = sum;
node.custoWoundrous = sum/2;
local xp = math.ceil(sum/25)
node.xpWoundrous = xp;
end, obj);
function obj:_releaseEvents()
__o_rrpgObjs.removeEventListenerById(self._e_event4);
__o_rrpgObjs.removeEventListenerById(self._e_event3);
__o_rrpgObjs.removeEventListenerById(self._e_event2);
__o_rrpgObjs.removeEventListenerById(self._e_event1);
__o_rrpgObjs.removeEventListenerById(self._e_event0);
end;
obj._oldLFMDestroy = obj.destroy;
function obj:destroy()
self:_releaseEvents();
if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then
self:setNodeDatabase(nil);
end;
if self.fixo ~= nil then self.fixo:destroy(); self.fixo = nil; end;
if self.button1 ~= nil then self.button1:destroy(); self.button1 = nil; end;
if self.comboBox3 ~= nil then self.comboBox3:destroy(); self.comboBox3 = nil; end;
if self.label1 ~= nil then self.label1:destroy(); self.label1 = nil; end;
if self.label8 ~= nil then self.label8:destroy(); self.label8 = nil; end;
if self.comboBox5 ~= nil then self.comboBox5:destroy(); self.comboBox5 = nil; end;
if self.label3 ~= nil then self.label3:destroy(); self.label3 = nil; end;
if self.label6 ~= nil then self.label6:destroy(); self.label6 = nil; end;
if self.label4 ~= nil then self.label4:destroy(); self.label4 = nil; end;
if self.dataLink4 ~= nil then self.dataLink4:destroy(); self.dataLink4 = nil; end;
if self.comboBox1 ~= nil then self.comboBox1:destroy(); self.comboBox1 = nil; end;
if self.label7 ~= nil then self.label7:destroy(); self.label7 = nil; end;
if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end;
if self.label2 ~= nil then self.label2:destroy(); self.label2 = nil; end;
if self.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end;
if self.label5 ~= nil then self.label5:destroy(); self.label5 = nil; end;
if self.dataLink3 ~= nil then self.dataLink3:destroy(); self.dataLink3 = nil; end;
if self.comboBox4 ~= nil then self.comboBox4:destroy(); self.comboBox4 = nil; end;
if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end;
if self.label9 ~= nil then self.label9:destroy(); self.label9 = nil; end;
if self.efeito ~= nil then self.efeito:destroy(); self.efeito = nil; end;
if self.label10 ~= nil then self.label10:destroy(); self.label10 = nil; end;
if self.dataLink2 ~= nil then self.dataLink2:destroy(); self.dataLink2 = nil; end;
if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end;
if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end;
if self.comboBox2 ~= nil then self.comboBox2:destroy(); self.comboBox2 = nil; end;
self:_oldLFMDestroy();
end;
obj:endUpdate();
return obj;
end;
function newfrmItemEffect()
local retObj = nil;
__o_rrpgObjs.beginObjectsLoading();
__o_Utils.tryFinally(
function()
retObj = constructNew_frmItemEffect();
end,
function()
__o_rrpgObjs.endObjectsLoading();
end);
assert(retObj ~= nil);
return retObj;
end;
local _frmItemEffect = {
newEditor = newfrmItemEffect,
new = newfrmItemEffect,
name = "frmItemEffect",
dataType = "",
formType = "undefined",
formComponentName = "form",
title = "",
description=""};
frmItemEffect = _frmItemEffect;
Firecast.registrarForm(_frmItemEffect);
return _frmItemEffect;
|
-- [
local Log = require "log.logger"
local Util = require "util.util"
local Env = require "env"
local rpc_mgr = require "rpc.rpc_mgr"
local server_mgr = require "server.server_mgr"
local ErrorCode = require "global.error_code"
local global_define = require "global.global_define"
local ServerType = global_define.ServerType
function rpc_mgr.bridge_rpc_test(data)
Log.debug("bridge_rpc_test: data=%s", Util.table_to_string(data))
local buff = data.buff
local sum = data.sum
buff = buff .. "2"
sum = sum + 1
-- rpc to gate
local status, ret = rpc_mgr:call_by_server_type(ServerType.GATE, "gate_rpc_test", {buff=buff, sum=sum})
if not status then
Log.err("bridge_rpc_test rpc call fail")
return rpc_mgr:ret({result = ErrorCode.RPC_FAIL, buff=buff, sum=sum})
end
Log.debug("bridge_rpc_test: callback ret=%s", Util.table_to_string(ret))
buff = ret.buff
sum = ret.sum
-- rpc to scene
status, ret = rpc_mgr:call_by_server_type(ServerType.SCENE, "scene_rpc_test", {buff=buff, sum=sum})
if not status then
Log.err("bridge_rpc_test rpc call fail")
return rpc_mgr:ret({result = ErrorCode.RPC_FAIL, buff=buff, sum=sum})
end
Log.debug("bridge_rpc_test: callback ret=%s", Util.table_to_string(ret))
buff = ret.buff
sum = ret.sum
return rpc_mgr:ret({result = ErrorCode.SUCCESS, buff=buff, sum=sum})
end
function rpc_mgr.bridge_rpc_send_test(data)
Log.debug("bridge_rpc_send_test: data=%s", Util.table_to_string(data))
local buff = data.buff
local index = data.index
-- rpc send to gate
local rpc_data =
{
buff = buff,
index = index,
sum = 1,
}
rpc_mgr:send_by_server_type(ServerType.GATE, "gate_rpc_send_test", rpc_data)
rpc_data =
{
buff = buff,
index = index,
sum = 2,
}
rpc_mgr:send_by_server_type(ServerType.GATE, "gate_rpc_send_test", rpc_data)
-- rpc send to scene
local server_info = server_mgr:get_server_by_type(ServerType.SCENE)
if not server_info then
Log.warn("bridge_rpc_send_test server_info nil")
return
end
local server_id = server_info._server_id
rpc_data =
{
buff = buff,
index = index,
sum = 1,
}
rpc_mgr:send_by_server_id(server_id, "scene_rpc_send_test", rpc_data)
rpc_data =
{
buff = buff,
index = index,
sum = 2,
}
rpc_mgr:send_by_server_id(server_id, "scene_rpc_send_test", rpc_data)
end
function rpc_mgr.bridge_rpc_mix_test(data)
Log.debug("bridge_rpc_mix_test: data=%s", Util.table_to_string(data))
local buff = data.buff
local index = data.index
local sum = data.sum
buff = buff .. "2"
sum = sum + 1
-- rpc to gate
local status, ret = rpc_mgr:call_by_server_type(ServerType.GATE, "gate_rpc_test", {buff=buff, sum=sum})
if not status then
Log.err("bridge_rpc_mix_test rpc call fail")
return rpc_mgr:ret({result = ErrorCode.RPC_FAIL, buff=buff, sum=sum})
end
Log.debug("bridge_rpc_mix_test: callback ret=%s", Util.table_to_string(ret))
buff = ret.buff
sum = ret.sum
-- rpc send gate
local rpc_data =
{
buff = buff,
index = index,
sum = 1,
}
rpc_mgr:send_by_server_type(ServerType.GATE, "gate_rpc_send_test", rpc_data)
rpc_data =
{
buff = buff,
index = index,
sum = 2,
}
rpc_mgr:send_by_server_type(ServerType.GATE, "gate_rpc_send_test", rpc_data)
local server_info = server_mgr:get_server_by_type(ServerType.SCENE)
if not server_info then
Log.warn("bridge_rpc_mix_test server_info nil")
return
end
local server_id = server_info._server_id
-- rpc send to scene
rpc_data =
{
buff = buff,
index = index,
sum = 1,
}
rpc_mgr:send_by_server_id(server_id, "scene_rpc_send_test", rpc_data)
rpc_data =
{
buff = buff,
index = index,
sum = 2,
}
rpc_mgr:send_by_server_id(server_id, "scene_rpc_send_test", rpc_data)
-- rpc to scene
status, ret = rpc_mgr:call_by_server_id(server_id, "scene_rpc_test", {buff=buff, sum=sum})
if not status then
Log.err("bridge_rpc_mix_test rpc call fail")
return rpc_mgr:ret({result = ErrorCode.RPC_FAIL, buff=buff, sum=sum})
end
Log.debug("bridge_rpc_mix_test: callback ret=%s", Util.table_to_string(ret))
buff = ret.buff
sum = ret.sum
return rpc_mgr:ret({result = ErrorCode.SUCCESS, buff=buff, sum=sum})
end
-- ]
-----------------------------------------------------------
function rpc_mgr.bridge_sync_gate_conn_num(data, mailbox_id)
-- Log.debug("bridge_sync_gate_conn_num data=%s", Util.table_to_string(data))
local server_info = server_mgr:get_server_by_mailbox(mailbox_id)
if not server_info then
Log.err("bridge_sync_gate_conn_num not server")
return
end
local server_id = server_info._server_id
local server_type = server_info._server_type
if server_type ~= ServerType.GATE then
Log.err("bridge_sync_gate_conn_num not gate server server_id=%d server_type=%d", server_id, server_type)
return
end
Env.common_mgr:sync_gate_conn_num(server_id, data.num)
end
-----------------------------------------------------------
function rpc_mgr.bridge_create_role(data)
Log.debug("bridge_create_role data=%s", Util.table_to_string(data))
return rpc_mgr:ret(Env.common_mgr:rpc_create_role(data))
end
function rpc_mgr.bridge_delete_role(data)
Log.debug("bridge_delete_role: data=%s", Util.table_to_string(data))
local user_id = data.user_id
local role_id = data.role_id
return rpc_mgr:ret(Env.common_mgr:rpc_delete_role(user_id, role_id))
end
function rpc_mgr.bridge_select_role(data)
Log.debug("bridge_select_role: data=%s", Util.table_to_string(data))
local user_id = data.user_id
local role_id = data.role_id
return rpc_mgr:ret(Env.common_mgr:rpc_select_role(user_id, role_id))
end
function rpc_mgr.bridge_user_offline(data)
Log.debug("bridge_user_offline: data=%s", Util.table_to_string(data))
local user_id = data.user_id
return rpc_mgr:ret(Env.common_mgr:rpc_user_offline(user_id))
end
|
-- definitions for Lua 5.1 basic library
--# -- TODO return generics
--# assume global `assert`:
--# --[[ [assert] ]] function(v: any, message: string?)
--#
--# assume global `collectgarbage`:
--# function(opt: string?, arg: any?) --> any
--#
--# assume global `dofile`:
--# [geval] function(filename: string?) --> any
--#
--# assume global `error`:
--# function(message: string, level: integer?) --> !
--#
--# assume global `_G`:
--# [genv] table
--#
--# assume global `getfenv`:
--# function(f: function|integer?) --> table
--#
--# assume global `getmetatable`:
--# function(object: any) --> table
--#
--# assume global `ipairs`:
--# [generic_pairs]
--# function(t: vector<const WHATEVER>) -->
--# (function(vector<const WHATEVER>, integer) --> (integer?, any),
--# vector<const WHATEVER>, integer)
--#
--# -- TODO sequence conditional union: (function) | (nil, string)
--# assume global `load`:
--# [geval] function(func: function() --> string?, chunkname: string?) --> (function, string)
--#
--# -- TODO sequence conditional union: (function) | (nil, string)
--# assume global `loadfile`:
--# [geval] function(filename: string?) --> (function, string)
--#
--# -- TODO sequence conditional union: (function) | (nil, string)
--# assume global `loadstring`:
--# [geval] function(string: string, chunkname: string?) --> (function, string)
--#
--# -- TODO genericity
--# assume global `next`:
--# function(table: table, index: any?) --> (integer, any)
--#
--# assume global `pairs`:
--# [generic_pairs] function(t: table) --> (function(table, any) --> (any?, any), table, any)
--#
--# -- TODO `f` should be once function
--# -- TODO genericity
--# assume global `pcall`:
--# function(f: function, any...) --> (boolean, any...)
--#
--# assume global `print`:
--# function(any...)
--#
--# assume global `rawequal`:
--# function(v1: any, v2: any) --> boolean
--#
--# assume global `rawget`:
--# function(table: table, index: any) --> any
--#
--# assume global `rawset`:
--# function(table: table, index: any, value: any) --> table
--#
--# -- TODO genericity
--# assume global `select`:
--# function(index: number|'#', any...) --> (any...)
--#
--# assume global `setfenv`:
--# function(f: function|integer?, table: table) --> function
--#
--# assume global `setmetatable`:
--# function(table: table, metatable: any?) --> table
--#
--# assume global `tonumber`:
--# function(e: any, base: integer?) --> number
--#
--# assume global `tostring`:
--# function(e: any) --> string
--#
--# -- TODO enumerate all the possibility?
--# assume global `type`:
--# [type] function(v: any) --> string
--#
--# -- TODO genericity
--# assume global `unpack`:
--# function(list: table, i: integer?, j: integer?) --> (any...)
--#
--# assume global `_VERSION`:
--# string
--#
--# -- TODO `f` and `err` should be once function
--# -- TODO genericity
--# assume global `xpcall`:
--# function(f: function, err: function) --> (boolean, any...)
--#
--# assume global `coroutine`:
--# {
--# -- TODO genericity
--# `create`: function(f: function) --> thread;
--# `resume`: function(co: thread, any...) --> (boolean, any...);
--# `running`: function() --> thread;
--# `status`: function(co: thread) --> string;
--# -- TODO genericity
--# `wrap`: function(f: function) --> thread;
--# `yield`: function(any...) --> (any...);
--# ...
--# }
|
-- random
-- by Qige
-- 2017.01.05
seed = {}
function seed.seed()
--return math.randomseed(tostring(os.time()):reverse():sub(1, 6))
return tostring(os.time()):reverse():sub(1, 6)
end
function seed.random(from, to)
math.randomseed(seed.seed())
return math.random(from, to)
end
return seed
|
local Sky = {}
function Sky:init()
self.canvas = lg.newCanvas(scrn.w / scrn.scl, scrn.h / scrn.scl)
self.tcanvas = lg.newCanvas(scrn.w / scrn.scl, scrn.h / scrn.scl)
self.topcolor = {111, 60, 103, 255}
self.botcolor = {250, 190, 120, 255}
self.img = lg.newImage('gfx/skies/sky3.png')
self.imgh = self.img:getHeight()
self.imgw = self.img:getWidth()
self.cloud = lg.newImage('gfx/skies/clound.png')
self.cloudtrans = 150
self.x = 000
self.y = 0
self.r = 0
self.clouds = {}
for i = 1, 10 do
self.clouds[i] = ents.Create( "bgcloud", math.random(1, scrn.w), math.random(1, scrn.h) )
end
-- self.ct = math.randXYZtable( 50, 24 * 200 / 8, 24 * 200 / 8)
end
function Sky:update()
end
function Sky:draw(player)
lg.setCanvas(self.canvas)
--Draw the top color box
lg.setColor(self.topcolor)
lg.rectangle('fill', 0, 0, scrn.w, scrn.h * scrn.vscl)
--Draw the bottom color box, taking into account if there is a player reference
lg.setColor(self.botcolor)
local px
if player then px = math.floor(-player.x / 32) else px = 0 end
lg.rectangle('fill', 0, scrn.h/16 + self.imgh * cam.zoom, scrn.w, scrn.h)
--Draw the sky image
lg.setColor(white)
lg.draw(self.img, px - self.imgw / 2, self.imgh * cam.zoom, 0, 1 / cam.zoom * cam.zoom, 1 / cam.zoom * cam.zoom )
-- lg.draw(sky.img, 0, 100, 0, 1, 1)
self:drawClouds(player)
lg.setCanvas(canvas)
lg.setColor(white)
lg.draw(self.canvas, scrn.x, scrn.y, scrn.r, 1, 1 * scrn.vscl, 0, 0, scrn.xsk, scrn.ysk)
lg.setColor(255,255,255, self.cloudtrans)
lg.draw(self.tcanvas, scrn.x, scrn.y, scrn.r, 1, 1 * scrn.vscl, 0, 0, scrn.xsk, scrn.ysk)
--lg.draw(self.canvas, 0, 0, 0, scrn.scl, scrn.vscl)
end
function Sky:drawClouds(player)
lg.setCanvas(self.tcanvas)
love.graphics.setBackgroundColor(0,0,0,0)
lg.clear(self.canvas)
for i = 1, 10 do
self.clouds[i]:skydraw()
end
end
return Sky
|
{
{ name = "Иссушающий трутень", count = 4, id = 'Forestry:beeDroneGE', dmg = 0, chance = 5, color = 0xF6290C },
{ name = "Яйцо дракона", count = 1, id = 'minecraft:dragon_egg', dmg = 0, chance = 8, color = 0xF6290C },
{ name = "Звезда Ада", count = 1, id = 'minecraft:nether_star', dmg = 0, chance = 15, color = 0xEFE80A },
{ name = "Голова Иссушителя", count = 1, id = 'minecraft:skull', dmg = 1, chance = 15, color = 0xEFE80A },
{ name = "Ихор", count = 1, id = 'ThaumicTinkerer:kamiResource', dmg = 0, chance = 15, color = 0xEFE80A },
{ name = "Голова человека", count = 1, id = 'minecraft:skull', dmg = 3, chance = 15, color = 0xEFE80A },
{ name = "Драк Cлиток", count = 4, id = 'DraconicEvolution:draconiumIngot', dmg = 0, chance = 20, color = 0xD70AEF },
{ name = "Драк пыль", count = 4, id = 'DraconicEvolution:draconiumDust', dmg = 0, chance = 20, color = 0xD70AEF },
{ name = "Улучш алхим констр", count = 4, id = 'Thaumcraft:blockMetalDevice', dmg = 3, chance = 20, color = 0x0AEFE5 },
{ name = "Алхимич конструкция", count = 4, id = 'Thaumcraft:blockMetalDevice', dmg = 9, chance = 30, color = 0x0AEFE5 },
{ name = "Нитор", count = 16, id = 'Thaumcraft:ItemResource', dmg = 1, chance = 30, color = 0x131315 },
{ name = "Алюментум", count = 16, id = 'Thaumcraft:ItemResource', dmg = 0, chance = 30, color = 0x131315 },
{ name = "Пустотный металл", count = 8, id = 'Thaumcraft:ItemResource', dmg = 16, chance = 30, color = 0x131315 },
{ name = "Cлеза Гаста", count = 32, id = 'minecraft:ghast_tear', dmg = 0, chance = 30, color = 0x131315 },
{ name = "Фрагмент Знаний", count = 16, id = 'Thaumcraft:ItemResource', dmg = 9, chance = 30, color = 0x131315 },
{ name = "Жемчуг Эндера", count = 16, id = 'minecraft:ender_pearl', dmg = 0, chance = 30, color = 0x131315 },
{ name = "Сбаланс кристал", count = 24, id = 'Thaumcraft:ItemShard', dmg = 6, chance = 30, color = 0x131315 },
{ name = "Кластер", count = 32, id = 'Thaumcraft:blockCrystal', dmg = 6, chance = 30, color = 0x131315 },
{ name = "Изумруд", count = 16, id = 'minecraft:emerald', dmg = 0, chance = 40, color = 0x131315 },
{ name = "Алмаз", count = 16, id = 'minecraft:diamond', dmg = 0, chance = 40, color = 0x131315 },
{ name = "Редстоун", count = 24, id = 'minecraft:redstone_block', dmg = 0, chance = 50, color = 0x131315 },
{ name = "Блок Угля", count = 16, id = 'minecraft:coal_block', dmg = 0, chance = 50, color = 0x131315 },
{ name = "Таум слиток", count = 32, id = 'Thaumcraft:ItemResource', dmg = 2, chance = 40, color = 0x131315 },
{ name = "Железо", count = 32, id = 'minecraft:iron_ingot', dmg = 0, chance = 45, color = 0x131315 },
{ name = "Золото", count = 32, id = 'minecraft:gold_ingot', dmg = 0, chance = 40, color = 0x131315 },
{ name = "Адский нарост", count = 16, id = 'minecraft:nether_wart', dmg = 0, chance = 50, color = 0x131315 },
{ name = "Лазурит", count = 32, id = 'minecraft:dye', dmg = 4, chance = 50, color = 0x131315 },
{ name = "ПеченькО", count = 32, id = 'minecraft:cookie', dmg = 0, chance = 50, color = 0x131315 }
}
|
--
-- piepie - bot framework for Mumble
--
-- Author: Tim Cooper <tim.cooper@layeh.com>
-- License: MIT (see LICENSE)
--
local bit=require'bit'
function piepan.Permissions.new(permissionsMask)
assert(type(permissionsMask) == "number", "permissionsMask must be a number")
local permissions = {}
for permission,mask in pairs(piepan.internal.permissionsMap) do
if bit.band(permissionsMask, mask) ~= 0 then
permissions[permission] = true
end
end
setmetatable(permissions, piepan.Permissions)
return permissions
end
|
--[[-----------------------------------------------------------------------------
Button Widget
Graphical Button.
-------------------------------------------------------------------------------]]
local Type, Version = "InviteButton", 1
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
local pairs = pairs
-- WoW APIs
local _G = _G
local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
local function Button_OnClick(frame, ...)
AceGUI:ClearFocus()
PlaySound(852) -- SOUNDKIT.IG_MAINMENU_OPTION
frame.obj:Fire("OnClick", ...)
end
local function Control_OnEnter(frame)
frame.obj:Fire("OnEnter")
end
local function Control_OnLeave(frame)
frame.obj:Fire("OnLeave")
end
local id = "";
--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
local methods = {
["OnAcquire"] = function(self)
-- restore default values
self:SetHeight(24)
self:SetWidth(300)
self:SetDisabled(false)
self:SetAutoWidth(false)
self:SetText()
self:SetLabel()
self:SetFontObject()
self:SetAnswer()
end,
["SetId"] = function(self, text)
id = text
end,
["GetId"] = function(self)
return id
end,
-- ["OnRelease"] = nil,
["SetLabel"] = function(self, text)
self.label:SetText(text)
end,
["GetLabel"] = function(self)
return self.label:GetText()
end,
["SetFont"] = function(self, font, height, flags)
self.label:SetFont(font, height, flags)
end,
["SetFontObject"] = function(self, font)
self:SetFont((font or GameFontHighlightSmall):GetFont())
end,
["SetJustifyH"] = function(self, justifyH)
self.label:SetJustifyH(justifyH)
end,
["SetJustifyV"] = function(self, justifyV)
self.label:SetJustifyV(justifyV)
end,
["SetLabelColor"] = function(self, r, g, b)
if not (r and g and b) then
r, g, b = 1, 1, 1
end
self.label:SetVertexColor(r, g, b)
end,
["SetText"] = function(self, text)
self.text:SetText(text)
if self.autoWidth then
self:SetWidth(self.text:GetStringWidth() + 30)
end
end,
["SetAnswer"] = function(self, text)
self.answer:SetText(text)
if text == "OK" then
self.answer:SetVertexColor(0,1,0)
elseif text == "KO" then
self.answer:SetVertexColor(1,0,0)
end
end,
["SetAutoWidth"] = function(self, autoWidth)
self.autoWidth = autoWidth
if self.autoWidth then
self:SetWidth(self.text:GetStringWidth() + 30)
end
end,
["HideButton"] = function(self)
self.frameBtn:Hide()
end,
["ShowButton"] = function(self)
self.frameBtn:Show()
self.frameBtn:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -5, -1)
self.frameBtn:SetWidth(100)
self.frameBtn:SetHeight(24)
self.button:SetHeight(20)
self.button:SetWidth(90)
self.button:SetPoint("TOPRIGHT", self.frameBtn, "TOPRIGHT", -5, -2)
end,
["SetDisabled"] = function(self, disabled)
self.disabled = disabled
if disabled then
self.label:SetVertexColor(0, 1, 0)
self.button:Disable()
else
self.button:Enable()
end
end
}
--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
frame:Hide()
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
label:SetPoint("BOTTOMLEFT", 5, 0)
label:SetPoint("BOTTOMRIGHT")
label:SetJustifyH("LEFT")
label:SetJustifyV("TOP")
label:SetHeight(18)
local frameBtn = CreateFrame("Frame", nil, frame)
frameBtn:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -5, -1)
frameBtn:SetWidth(100)
frameBtn:SetHeight(24)
local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
local button = CreateFrame("Button", name, frameBtn, "UIPanelButtonTemplate")
button:SetHeight(20)
button:SetWidth(90)
button:SetPoint("TOPRIGHT", frameBtn, "TOPRIGHT", -5, -2)
button:EnableMouse(true)
button:SetScript("OnClick", Button_OnClick)
button:SetScript("OnEnter", Control_OnEnter)
button:SetScript("OnLeave", Control_OnLeave)
local text = button:GetFontString()
text:ClearAllPoints()
text:SetPoint("TOPLEFT", 15, -1)
text:SetPoint("BOTTOMRIGHT", -15, 1)
text:SetJustifyV("MIDDLE")
local answer = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
answer:SetPoint("TOPRIGHT", -5, 0)
answer:SetPoint("BOTTOMRIGHT")
answer:SetJustifyH("LEFT")
answer:SetJustifyV("TOP")
answer:SetHeight(18)
local widget = {
frame = frame,
label = label,
frameBtn = frameBtn,
button = button,
text = text,
answer = answer,
type = Type
}
for method, func in pairs(methods) do
widget[method] = func
end
button.obj = widget
return AceGUI:RegisterAsWidget(widget)
end
AceGUI:RegisterWidgetType(Type, Constructor, Version)
|
--[[
--=====================================================================================================--
Script Name: Server Logger, for SAPP (PC & CE)
Description: An advanced custom logger.
This script will log the following events:
1). Game start & end
2). Script load, re-load & unload
3). Team Change
4). Admin Login
5). Map Reset
6). Global, team & vehicle chat messages
7). Commands (originating from console, rcon & chat)
See config section for more information.
Copyright (c) 2021, Jericho Crosby <jericho.crosby227@gmail.com>
* Notice: You can use this document subject to the following conditions:
https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/blob/master/LICENSE
--=====================================================================================================--
]]--
api_version = "1.12.0.0"
local Logger = {
--
-- CONFIGURATION STARTS HERE --
--
-- Server log directory:
dir = "Server Log.txt",
-- Script errors (if any) will be logged to this file:
error_file = "Server Log (errors).log",
-- Timestamp format:
-- For help with date & time format, refer to this page: www.lua.org/pil/22.1.html
date_format = "!%a, %d %b %Y %H:%M:%S",
-- IP Address of the server:
ip = "localhost",
-- Name for the server console:
name = "SERVER CONSOLE",
--====================--
-- SENSITIVE CONTENT --
-- Any commands containing words in the "sensitive_content" table will not be logged.
--=================================================================================--
-- If true, console commands containing the aforementioned "words" will be logged.
ignore_console = false,
--============================--
sensitive_content = {
"login",
"admin_add",
"change_password",
"admin_change_pw",
"admin_add_manually",
},
--=========================--
-- SCRIPT LOAD & UNLOAD --
--=========================--
["ScriptLoad"] = {
Log = function(f)
if (f.reloaded) then
f:Write("[SCRIPT RE-LOAD] Server Logger was re-loaded")
else
f:Write("[SCRIPT LOAD] Server Logger was loaded")
end
end
},
["ScriptUnload"] = {
Log = function(f)
f:Write("[SCRIPT UNLOAD] Advanced Server Logger was unloaded")
end
},
--=========================--
-- GAME START & END --
--=========================--
["GameStart"] = {
Log = function(f)
f:Write("[GAME START] A new game has started on [" .. f.map .. " - " .. f.gt .. " (" .. f.mode .. ")]")
end
},
["GameEnd"] = {
Log = function(f)
f:Write("[GAME END] The game has ended. Showing post game carnage report...")
end
},
--=========================--
-- PLAYER JOIN & QUIT --
--=========================--
["PlayerJoin"] = {
Log = function(f, p)
local a = p.name -- player name [string]
local b = p.id -- player id [string]
local c = p.ip -- player ip [string]
local d = p.hash -- player hash [string]
local e = f.pn -- player count [int]
f:Write("[JOIN] Name: " .. a .. " [ID: " .. b .. " | IP: " .. c .. " | CD-Key Hash: " .. d .. " | Total Players: " .. e .. "/16]")
end
},
["PlayerQuit"] = {
Log = function(f, p)
local a = p.name -- player name [string]
local b = p.id -- player id [string]
local c = p.ip -- player ip [string]
local d = p.hash -- player hash [string]
local e = f.pn -- player count [int]
f:Write("[QUIT] Name: " .. a .. " [ID: " .. b .. " | IP: " .. c .. " | CD-Key Hash: " .. d .. " | Total Players: " .. e .. "/16]")
end
},
--=========================--
-- Team Change --
--=========================--
["TeamChange"] = {
Log = function(f, p)
local n = f.players[p].name -- player name [string]
local t = f.players[p].team(p) -- player team [string]
f:Write("[TEAM CHANGE] " .. n .. " switched teams [New team: " .. t .. "]")
end
},
--=========================--
-- Admin Login --
--=========================--
["AdminLogin"] = {
Log = function(f, n)
-- n = name
f:Write("[LOGIN] " .. n .. " has logged in")
end
},
--=========================--
-- Map Reset --
--=========================--
["MapReset"] = {
Log = function(f)
f:Write("[MAP RESET] The map has been reset.")
end
},
--=========================--
-- CHAT MESSAGE & COMMAND --
--=========================--
["MessageCreate"] = {
Log = function(f)
local str
local a = f.chat[1] -- message [string]
local b = f.chat[2] -- message type [int]
local c = f.chat[3] -- player name [string]
local d = f.chat[4] -- player id [int]
f.chat = {}
if (b == 0) then
str = "[GLOBAL] " .. c .. " ID: [" .. d .. "]: " .. a
elseif (b == 1) then
str = "[TEAM] " .. c .. " ID: [" .. d .. "]: " .. a
elseif (b == 2) then
str = "[VEHICLE] " .. c .. " ID: [" .. d .. "]: " .. a
else
str = "[UNKNOWN] " .. c .. " ID: [" .. d .. "]: " .. a
end
f:Write(str)
end
},
["Command"] = {
Log = function(fun)
local a = fun.cmd[1] -- admin (true or false) [string NOT BOOLEAN]
local b = fun.cmd[2] -- admin level [int]
local c = fun.cmd[3] -- executor name [string]
local d = fun.cmd[4] -- executor id [int]
local e = fun.cmd[5] -- execute ip (or 127.0.0.1) [string]
local f = fun.cmd[6] -- command [string]
local g = fun.cmd[7] -- command environment
fun.cmd = {}
local cmd
if (g == 0) then
cmd = "[CONSOLE COMMAND] " .. c .. ": " .. f .. " [Admin = " .. a .. " | Level: " .. b .. " | ID: " .. d .. " | IP: " .. e .. "]"
elseif (g == 1) then
cmd = "[RCON COMMAND] " .. c .. ": " .. f .. " [Admin = " .. a .. " | Level: " .. b .. " | ID: " .. d .. " | IP: " .. e .. "]"
elseif (g == 2) then
cmd = "[CHAT COMMAND] " .. c .. ": /" .. f .. " [Admin = " .. a .. " | Level: " .. b .. " | ID: " .. d .. " | IP: " .. e .. "]"
end
fun:Write(cmd)
end
},
--
-- CONFIGURATION ENDS --
--
Reset = function(l)
l.pn = 0
l.cmd = {}
l.chat = {}
l.players = {}
end
}
function OnScriptLoad()
-- register needed event callbacks:
register_callback(cb["EVENT_JOIN"], "PlayerJoin")
register_callback(cb["EVENT_LEAVE"], "PlayerQuit")
register_callback(cb["EVENT_COMMAND"], "Command")
register_callback(cb["EVENT_CHAT"], "MessageCreate")
register_callback(cb["EVENT_GAME_END"], "GameEnd")
register_callback(cb['EVENT_MAP_RESET'], "MapReset")
register_callback(cb["EVENT_GAME_START"], "GameStart")
register_callback(cb['EVENT_LOGIN'], "AdminLogin")
register_callback(cb['EVENT_TEAM_SWITCH'], "TeamChange")
Logger.reloaded = (get_var(0, "$gt") ~= "n/a") or false
Logger["ScriptLoad"].Log(Logger)
GameStart()
end
local script_version = 1.2
function OnScriptUnload()
Logger["ScriptUnload"].Log(Logger)
end
function GameStart()
local gt = get_var(0, "$gt")
if (gt ~= "n/a") then
Logger:Reset(Logger)
if (not Logger.reloaded) then
Logger.gt = gt
Logger.map = get_var(0, "$map")
Logger.mode = get_var(0, "$mode")
Logger["GameStart"].Log(Logger)
end
for i = 1, 16 do
if player_present(i) then
Logger:InitPlayer(i, false)
end
end
end
end
function GameEnd()
Logger["GameEnd"].Log(Logger)
end
local function BlackListed(P, STR)
local Args = { }
for Params in STR:gmatch("([^%s]+)") do
Args[#Args + 1] = Params:lower()
end
if (#Args > 0) then
for i = 1, #Args do
for _, word in pairs(Logger.sensitive_content) do
if Args[i]:lower():find(word) then
if (P ~= nil and P == 0 and Logger.ignore_console) then
return false
end
return true
end
end
end
end
return false
end
local function IsCommand(M)
return (M:sub(1, 1) == "/" or M:sub(1, 1) == "\\")
end
function MessageCreate(P, M, T)
if (not IsCommand(M) and Logger.players[P]) then
Logger.chat = { M, T, Logger.players[P].name, P }
Logger["MessageCreate"].Log(Logger)
end
end
local function IsAdmin(P, L)
return (P == 0 and "true") or (L >= 1 and "true" or "false")
end
function Command(P, C, E, _)
if (not BlackListed(P, C)) then
local lvl = tonumber(get_var(P, "$lvl"))
local state = IsAdmin(P, lvl)
local ip = (P > 0 and Logger.players[P].ip) or Logger.ip
local name = (P > 0 and Logger.players[P].name) or Logger.name
Logger.cmd = { state, lvl, name, P, ip, C, E }
Logger["Command"].Log(Logger)
end
end
function PlayerJoin(P)
Logger:InitPlayer(P, false)
end
function PlayerQuit(P)
Logger:InitPlayer(P, true)
end
function Logger:InitPlayer(P, Reset, Reload)
if (not Reset) then
self.players[P] = {
id = P,
ip = get_var(P, "$ip"),
name = get_var(P, "$name"),
hash = get_var(P, "$hash"),
team = function(P)
return get_var(P, "$team")
end
}
self.pn = tonumber(get_var(0, "$pn"))
if (not Reload) then
self["PlayerJoin"].Log(self, self.players[P])
end
return
end
if (self.players[P]) then
self.pn = tonumber(get_var(0, "$pn")) - 1
self["PlayerQuit"].Log(self, self.players[P])
self.players[P] = nil
end
end
function TeamChange(P)
if (Logger.players[P]) then
Logger["TeamChange"].Log(Logger, P)
end
end
function MapReset()
Logger["MapReset"].Log(Logger)
end
function AdminLogin(P)
if (Logger.players[P]) then
Logger["AdminLogin"].Log(Logger, Logger.players[P].name)
end
end
-- Start of the show; Responsible for logging messages to self.dir:
--
function Logger:Write(STR)
if (STR) then
local file = io.open(self.dir, "a+")
if (file) then
file:write("[" .. os.date(self.date_format) .. "] " .. STR .. "\n")
file:close()
end
end
end
-- Error handler:
--
local function WriteError(err)
local file = io.open(Logger.error_file, "a+")
if (file) then
file:write(err .. "\n")
file:close()
end
end
function OnError(Error)
local log = {
-- log format: {msg, console out [true/false], console color}
-- If console out = false, the message will not be logged to console.
{ os.date("[%H:%M:%S - %d/%m/%Y]"), true, 12 },
{ Error, false, 12 },
{ debug.traceback(), true, 12 },
{ "--------------------------------------------------------", true, 5 },
{ "Please report this error on github:", true, 7 },
{ "https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/issues", true, 7 },
{ "Script Version: " .. script_version, true, 7 },
{ "--------------------------------------------------------", true, 5 }
}
for _, v in pairs(log) do
WriteError(v[1])
if (v[2]) then
cprint(v[1], v[3])
end
end
WriteError("\n")
end
-- For a future update:
return Logger
--
|
local function run()
local Busy = require "Busy"
Busy.start()
app.collectgarbage()
Busy.stop()
end
return {
{
description = "Run garbage collector",
batch = false,
run = run,
suppressReset = true
}
}
|
--settings
local GO = nil
local trans = nil
delay = 0
nextScale = Vector3(0,0,0)
function Constructor()
GO = owner
trans = GO:GetComponent("Transform")
nextScale = trans:GetWorldScale()
delay = 10000
end
function OnUpdate(dt)
if(delay > 0) then
delay = delay - dt
else
trans:SetWorldScale(nextScale)
end
end
|
-------------------
-- Adonis Server --
-------------------
--[[
If you find bugs, typos, or ways to improve something please message me (Sceleratis/Davey_Bones) with
what you found so the script can be better.
Also just be aware that I'm a very messy person, so a lot of this may or may not be spaghetti.
]]
math.randomseed(os.time())
--// Module LoadOrder List; Core modules need to be loaded in a specific order; If you create new "Core" modules make sure you add them here or they won't load
local LoadingOrder = {
--// Nearly all modules rely on these to function
"Logs";
"Variables";
"Functions";
--// Core functionality
"Core";
"Remote";
"Process";
--// Misc
"Admin";
"HTTP";
"Anti";
"Commands";
}
--// Todo:
--// Fix a loooootttttttt of bugged commands
--// Probably a lot of other stuff idk
--// Transform from Sceleratis into Dr. Sceleratii; Evil alter-ego; Creator of bugs, destroyer of all code that is good
--// Maybe add a celery command at some point (wait didn't we do this?)
--// Say hi to people reading the script
--// ...
--// "Hi." - Me
--// Holiday roooaaAaaoooAaaooOod
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, elapsedTime, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, spawn, delay, task =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, elapsedTime, require, table, type, task.wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, task.defer, task.delay, task;
local ServicesWeUse = {
"Workspace";
"Players";
"Lighting";
"ServerStorage";
"ReplicatedStorage";
"JointsService";
"ReplicatedFirst";
"ScriptContext";
"ServerScriptService";
"LogService";
"Teams";
"SoundService";
"StarterGui";
"StarterPack";
"StarterPlayers";
"TestService";
"HttpService";
"InsertService";
"NetworkServer"
}
local unique = {}
local origEnv = getfenv(); setfenv(1,setmetatable({}, {__metatable = unique}))
local locals = {}
local server = {}
local Queues = {}
local service = {}
local RbxEvents = {}
local Debounces = {}
local LoopQueue = {}
local ErrorLogs = {}
local RealMethods = {}
local RunningLoops = {}
local HookedEvents = {}
local WaitingEvents = {}
local ServiceSpecific = {}
local ServiceVariables = {}
local oldReq = require
local Folder = script.Parent
local oldInstNew = Instance.new
local isModule = function(module)
for ind, modu in next, server.Modules do
if module == modu then
return true
end
end
end
local logError = function(plr, err)
if type(plr) == "string" and not err then
err = plr;
plr = nil;
end
if server.Core and server.Core.DebugMode then
warn("::Adonis:: Error: "..tostring(plr)..": "..tostring(err))
end
if server and server.Logs then
server.Logs.AddLog(server.Logs.Errors, {
Text = ((err and plr and tostring(plr) ..":") or "").. tostring(err),
Desc = err,
Player = plr
})
end
end
--local message = function(...) local Str = "" game:GetService("TestService"):Message(Str) end
local print = function(...)
print(":: Adonis ::", ...)
end
local warn = function(...)
warn(":: Adonis ::", ...)
end
local Pcall = function(func, ...)
local ran,error = pcall(func,...)
if error then
warn(error)
logError(error)
end
return ran,error
end
local cPcall = function(func, ...)
return Pcall(function(...)
coroutine.resume(coroutine.create(func),...)
end, ...)
end
local Routine = function(func, ...)
coroutine.resume(coroutine.create(func),...)
end
local GetEnv; GetEnv = function(env, repl)
local scriptEnv = setmetatable({}, {
__index = function(tab, ind)
return (locals[ind] or (env or origEnv)[ind])
end;
__metatable = unique;
})
if repl and type(repl) == "table" then
for ind, val in next, repl do
scriptEnv[ind] = val
end
end
return scriptEnv
end
local GetVargTable = function()
return {
Server = server;
Service = service;
}
end
local LoadModule = function(plugin, yield, envVars, noEnv)
noEnv = false --// Seems to make loading take longer when true (?)
local isFunc = type(plugin) == "function"
local plugin = (isFunc and service.New("ModuleScript", {Name = "Non-Module Loaded"})) or plugin
local plug = (isFunc and plugin) or require(plugin)
if server.Modules and type(plugin) ~= "function" then
table.insert(server.Modules,plugin)
end
if type(plug) == "function" then
if yield then
--Pcall(setfenv(plug,GetEnv(getfenv(plug), envVars)))
local ran,err = service.TrackTask("Plugin: ".. tostring(plugin), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable())
if not ran then
warn("Module encountered an error while loading: "..tostring(plugin))
warn(tostring(err))
else
return err;
end
else
--service.Threads.RunTask("PLUGIN: "..tostring(plugin),setfenv(plug,GetEnv(getfenv(plug), envVars)))
local ran, err = service.TrackTask("Thread: Plugin: ".. tostring(plugin), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable())
if not ran then
warn("Module encountered an error while loading: "..tostring(plugin))
warn(tostring(err))
else
return err;
end
end
else
server[plugin.Name] = plug
end
if server.Logs then
server.Logs.AddLog(server.Logs.Script,{
Text = "Loaded "..tostring(plugin).." Module";
Desc = "Adonis loaded a core module or plugin";
})
end
end;
--// WIP
local LoadPackage = function(package, folder, runNow)
--// runNow - Run immediately after unpacking (default behavior is to just unpack (((only needed if loading after startup))))
--// runNow currently not used (limitations) so all packages must be present at server startup
local unpack; unpack = function(curFolder, unpackInto)
if unpackInto then
for i,obj in ipairs(curFolder:GetChildren()) do
local clone = obj:Clone();
if obj:IsA("Folder") then
local realFolder = unpackInto:FindFirstChild(obj.Name);
if not realFolder then
clone.Parent = unpackInto;
else
unpack(obj, realFolder);
end
else
clone.Parent = unpackInto;
end
end
else
warn("Missing parent to unpack into for ".. tostring(curFolder));
end
end;
unpack(package, folder);
end;
local CleanUp = function()
--local env = getfenv(2)
--local ran,ret = pcall(function() return env.script:GetFullName() end)
warn("Beginning Adonis cleanup & shutdown process...")
--warn("CleanUp called from "..tostring((ran and ret) or "Unknown"))
--local loader = server.Core.ClientLoader
server.Model.Parent = service.ServerScriptService
server.Model.Name = "Adonis_Loader"
server.Running = false
pcall(service.Threads.StopAll)
pcall(function()
for i,v in next,RbxEvents do
print("Disconnecting event")
v:Disconnect()
table.remove(RbxEvents, i)
end
end)
--loader.Archivable = false
--loader.Disabled = true
--loader:Destroy()
if server.Core and server.Core.RemoteEvent then
pcall(server.Core.DisconnectEvent);
end
--[[delay(0, function()
for i,v in next,server do
server[i] = nil; --// Try to break it to prevent any potential hanging issues; Not very graceful...
end
--end)--]]
warn("Unloading complete")
end;
server = {
Running = true;
Modules = {};
Pcall = Pcall;
cPcall = cPcall;
Routine = Routine;
LogError = logError;
ErrorLogs = ErrorLogs;
FilteringEnabled = workspace.FilteringEnabled;
ServerStartTime = os.time();
CommandCache = {};
};
locals = {
server = server;
CodeName = "";
Settings = server.Settings;
HookedEvents = HookedEvents;
ErrorLogs = ErrorLogs;
logError = logError;
origEnv = origEnv;
Routine = Routine;
Folder = Folder;
GetEnv = GetEnv;
cPcall = cPcall;
Pcall = Pcall;
}
service = setfenv(require(Folder.Shared.Service), GetEnv(nil, {server = server}))(function(eType, msg, desc, ...)
local extra = {...}
if eType == "MethodError" then
if server and server.Logs and server.Logs.AddLog then
server.Logs.AddLog("Script", {
Text = "Cached method doesn't match found method: "..tostring(extra[1]);
Desc = "Method: "..tostring(extra[1])
})
end
elseif eType == "ServerError" then
--print("Server error")
logError("Server", msg)
elseif eType == "TaskError" then
--print("Task error")
logError("Task", msg)
end
end, function(c, parent, tab)
if not isModule(c) and c ~= server.Loader and c ~= server.Dropper and c ~= server.Runner and c ~= server.Model and c ~= script and c ~= Folder and parent == nil then
tab.UnHook()
end
end, ServiceSpecific)
--// Localize
os = service.Localize(os)
math = service.Localize(math)
table = service.Localize(table)
string = service.Localize(string)
coroutine = service.Localize(coroutine)
Instance = service.Localize(Instance)
Vector2 = service.Localize(Vector2)
Vector3 = service.Localize(Vector3)
CFrame = service.Localize(CFrame)
UDim2 = service.Localize(UDim2)
UDim = service.Localize(UDim)
Ray = service.Localize(Ray)
Rect = service.Localize(Rect)
Faces = service.Localize(Faces)
Color3 = service.Localize(Color3)
NumberRange = service.Localize(NumberRange)
NumberSequence = service.Localize(NumberSequence)
NumberSequenceKeypoint = service.Localize(NumberSequenceKeypoint)
ColorSequenceKeypoint = service.Localize(ColorSequenceKeypoint)
PhysicalProperties = service.Localize(PhysicalProperties)
ColorSequence = service.Localize(ColorSequence)
Region3int16 = service.Localize(Region3int16)
Vector3int16 = service.Localize(Vector3int16)
BrickColor = service.Localize(BrickColor)
TweenInfo = service.Localize(TweenInfo)
Axes = service.Localize(Axes)
task = service.Localize(task)
--// Wrap require = function(obj) return service.Wrap(oldReq(service.UnWrap(obj))) end --]]
Instance = {new = function(obj, parent) return oldInstNew(obj, service.UnWrap(parent)) end}
require = function(obj) return oldReq(service.UnWrap(obj)) end
rawequal = service.RawEqual
--service.Players = service.Wrap(service.Players)
--Folder = service.Wrap(Folder)
server.Folder = Folder
server.Deps = Folder.Dependencies;
server.CommandModules = Folder.Commands;
server.Client = Folder.Parent.Client;
server.Dependencies = Folder.Dependencies;
server.PluginsFolder = Folder.Plugins;
server.Service = service
--// Setting things up
for ind,loc in next,{
_G = _G;
game = game;
spawn = spawn;
script = script;
getfenv = getfenv;
setfenv = setfenv;
workspace = workspace;
getmetatable = getmetatable;
setmetatable = setmetatable;
loadstring = loadstring;
coroutine = coroutine;
rawequal = rawequal;
typeof = typeof;
print = print;
math = math;
warn = warn;
error = error;
pcall = pcall;
xpcall = xpcall;
select = select;
rawset = rawset;
rawget = rawget;
ipairs = ipairs;
pairs = pairs;
next = next;
Rect = Rect;
Axes = Axes;
os = os;
time = time;
Faces = Faces;
unpack = unpack;
string = string;
Color3 = Color3;
newproxy = newproxy;
tostring = tostring;
tonumber = tonumber;
Instance = Instance;
TweenInfo = TweenInfo;
BrickColor = BrickColor;
NumberRange = NumberRange;
ColorSequence = ColorSequence;
NumberSequence = NumberSequence;
ColorSequenceKeypoint = ColorSequenceKeypoint;
NumberSequenceKeypoint = NumberSequenceKeypoint;
PhysicalProperties = PhysicalProperties;
Region3int16 = Region3int16;
Vector3int16 = Vector3int16;
elapsedTime = elapsedTime;
require = require;
table = table;
type = type;
wait = wait;
Enum = Enum;
UDim = UDim;
UDim2 = UDim2;
Vector2 = Vector2;
Vector3 = Vector3;
Region3 = Region3;
CFrame = CFrame;
Ray = Ray;
task = task;
service = service
} do locals[ind] = loc end
--// Init
return service.NewProxy({__metatable = "Adonis"; __tostring = function() return "Adonis" end; __call = function(tab, data)
if _G["__Adonis_MODULE_MUTEX"] and type(_G["__Adonis_MODULE_MUTEX"])=="string" then
warn("\n-----------------------------------------------"
.."\nAdonis server-side is already running! Aborting..."
.."\n-----------------------------------------------")
script:Destroy()
return "FAILED"
else
_G["__Adonis_MODULE_MUTEX"] = "Running"
end
if not data or not data.Loader then
warn("WARNING: MainModule loaded without using the loader;")
end
--// Begin Script Loading
setfenv(1,setmetatable({}, {__metatable = unique}))
data = service.Wrap(data or {})
--// Warn if possibly malicious
if data.PremiumID or data.PremiumId then
warn("\n ⚠ You might be using a malicious version of the Adonis loader ⚠\n -- If you are teleported to a 'Loading...' game, your game could be identified by the backdoor creators! 👁️🗨️--\n -- 🔰 Remember, there's no such thing as Adonis Premium or Gold! -- \n -- 💠 Grab the genuine Adonis Loader from the toolbox! ✔️-- \n ")
end
--// Server Variables
local setTab = require(server.Deps.DefaultSettings)
server.Defaults = setTab
server.Settings = data.Settings or setTab.Settings or {}
server.Descriptions = data.Descriptions or setTab.Descriptions or {}
server.Order = data.Order or setTab.Order or {}
server.Data = data or {}
server.Model = data.Model or service.New("Model")
server.ModelParent = data.ModelParent or service.ServerScriptService;
server.Dropper = data.Dropper or service.New("Script")
server.Loader = data.Loader or service.New("Script")
server.Runner = data.Runner or service.New("Script")
server.LoadModule = LoadModule
server.LoadPackage = LoadPackage
server.ServiceSpecific = ServiceSpecific
server.Shared = Folder.Shared
server.ServerPlugins = data.ServerPlugins
server.ClientPlugins = data.ClientPlugins
server.Client = Folder.Parent.Client
locals.Settings = server.Settings
locals.CodeName = server.CodeName
--// THIS NEEDS TO BE DONE **BEFORE** ANY EVENTS ARE CONNECTED
if server.Settings.HideScript and data.Model then
data.Model.Parent = nil
script:Destroy()
end
--// Copy client themes, plugins, and shared modules to the client folder
local packagesToRunWithPlugins = {};
local shared = service.New("Folder", {
Name = "Shared";
Parent = server.Client;
})
for index, module in next,Folder.Shared:GetChildren() do
module:Clone().Parent = shared;
end
for index,plugin in next,(data.ClientPlugins or {}) do
plugin:Clone().Parent = server.Client.Plugins;
end
for index,theme in next,(data.Themes or {}) do
theme:Clone().Parent = server.Client.UI;
end
for index,pkg in next,(data.Packages or {}) do
LoadPackage(pkg, Folder.Parent, false);
end
for setting,value in next, server.Defaults.Settings do
if server.Settings[setting] == nil then
server.Settings[setting] = value
end
end
for desc,value in next, server.Defaults.Descriptions do
if server.Descriptions[desc] == nil then
server.Descriptions[desc] = value
end
end
--// Bind cleanup
service.DataModel:BindToClose(CleanUp)
--server.CleanUp = CleanUp;
--// Require some dependencies
server.Threading = require(server.Deps.ThreadHandler)
server.Changelog = require(server.Shared.Changelog)
server.Credits = require(server.Shared.Credits)
--// Load services
for ind, serv in next,ServicesWeUse do local temp = service[serv] end
--// Load core modules
for ind,load in next,LoadingOrder do
local modu = Folder.Core:FindFirstChild(load)
if modu then
LoadModule(modu,true,{script = script}, true) --noenv
end
end
--// Server Specific Service Functions
ServiceSpecific.GetPlayers = server.Functions.GetPlayers
--// Initialize Cores
local runLast = {}
local runAfterInit = {}
local runAfterPlugins = {}
for i,name in next,LoadingOrder do
local core = server[name]
if core then
if type(core) == "table" or (type(core) == "userdata" and getmetatable(core) == "ReadOnly_Table") then
if core.RunLast then
table.insert(runLast, core.RunLast);
core.RunLast = nil;
end
if core.RunAfterInit then
table.insert(runAfterInit, core.RunAfterInit);
core.RunAfterInit = nil;
end
if core.RunAfterPlugins then
table.insert(runAfterPlugins, core.RunAfterPlugins);
core.RunAfterPlugins = nil;
end
if core.Init then
core.Init(data);
core.Init = nil;
end
end
end
end
--// Variables that rely on core modules being initialized
server.Logs.Errors = ErrorLogs
--// Load any afterinit functions from modules (init steps that require other modules to have finished loading)
for i,f in next,runAfterInit do
f(data);
end
--// Load Plugins
for index,plugin in next,server.PluginsFolder:GetChildren() do
LoadModule(plugin, false, {script = plugin}, true); --noenv
end
for index,plugin in next,(data.ServerPlugins or {}) do
LoadModule(plugin, false, {script = plugin});
end
--// We need to do some stuff *after* plugins are loaded (in case we need to be able to account for stuff they may have changed before doing something, such as determining the max length of remote commands)
for i,f in next,runAfterPlugins do
f(data);
end
--// Below can be used to determine when all modules and plugins have finished loading; service.Events.AllModulesLoaded:Connect(function() doSomething end)
server.AllModulesLoaded = true;
service.Events.AllModulesLoaded:Fire(os.time());
--// Queue handler
--service.StartLoop("QueueHandler","Heartbeat",service.ProcessQueue)
--// Stuff to run after absolutely everything else has had a chance to run and initialize and all that
for i,f in next,runLast do
f(data);
end
if data.Loader then
warn("Loading Complete; Required by "..tostring(data.Loader:GetFullName()))
else
warn("Loading Complete; No loader location provided")
end
if server.Logs then
server.Logs.AddLog(server.Logs.Script, {
Text = "Finished Loading";
Desc = "Adonis finished loading";
})
else
warn("SERVER.LOGS TABLE IS MISSING. THIS SHOULDN'T HAPPEN! SOMETHING WENT WRONG WHILE LOADING CORE MODULES(?)");
end
service.Events.ServerInitialized:Fire();
return "SUCCESS"
end})
|
local analyse = require "analyse"
local M = {}
function M:init()
self.out_cards = 0
self.cards = {}
self.player1_hand_cards = 0
self.player2_hand_cards = 0
self.player1_out_cards = {}
self.player2_out_cards = {}
analyse.init()
end
-- 随机洗牌
function M:shuffle()
local t = {}
for i=1,9 do
table.insert(t,i)
table.insert(t,i)
table.insert(t,i)
table.insert(t,i)
end
self.cards = t
end
function M:start()
print("===============新的一局游戏开始===============")
self:shuffle()
-- 发牌
for i=1,10 do
local card = table.remove(self.cards, math.random(1,#self.cards))
self.player1_hand_cards = self.player1_hand_cards + 1*(10^(card-1))
card = table.remove(self.cards, math.random(1,#self.cards))
self.player2_hand_cards = self.player2_hand_cards + 1*(10^(card-1))
end
self.status = "ai"
end
-- 发牌
function M:dispatch(index)
if not next(self.cards) then
return
end
local card
if index == 1 then
card = table.remove(self.cards, math.random(1,#self.cards))
self.player1_hand_cards = self.player1_hand_cards + 1*(10^(card-1))
else
card = table.remove(self.cards, math.random(1,#self.cards))
self.player2_hand_cards = self.player2_hand_cards + 1*(10^(card-1))
end
return card
end
-- 显示
function M:show()
local hand_cards1 = ""
local hand_cards2 = ""
local out_cards1 = ""
local out_cards2 = ""
local aim = ""
local v = 1
for i=1,9 do
local n_hand = math.floor(self.player1_hand_cards/v)%10
if n_hand > 0 then
hand_cards1 = hand_cards1 .. string.rep(i,n_hand)
end
n_hand = math.floor(self.player2_hand_cards/v)%10
if n_hand > 0 then
hand_cards2 = hand_cards2 .. string.rep(i,n_hand)
end
if self.ai_aim then
n_hand = math.floor(self.ai_aim/v)%10
if n_hand > 0 then
aim = aim .. string.rep(i,n_hand)
end
end
v = v * 10
end
for _,v in ipairs(self.player1_out_cards) do
out_cards1 = out_cards1 .. v
end
for _,v in ipairs(self.player2_out_cards) do
out_cards2 = out_cards2 .. v
end
print("电脑手牌",hand_cards1)
print("电脑出牌",out_cards1)
print("候选牌型",aim)
print()
print("自己出牌",out_cards2)
print("自己手牌",hand_cards2)
end
function M:sleep(n)
os.execute("ping -n " .. tonumber(n + 1) .. " localhost > NUL")
end
function M:cls()
--os.execute("cls")
print("====================================================================")
print("")
print("")
end
function M:ai()
local dispatch_card = self:dispatch(1)
if not dispatch_card then
self.status = "gameover"
print("平局")
return
end
self:cls()
print("ai摸牌"..dispatch_card..",思考中。。。")
self:show()
self:sleep(4)
self:cls()
if analyse.check_hu(self.player1_hand_cards) then
print("ai胡牌")
self:show()
self.status = "gameover"
return
end
local card, ting_key = analyse.analyse(self.out_cards, self.player1_hand_cards)
self.ai_aim = ting_key
self.player1_hand_cards = self.player1_hand_cards - 1*(10^(card-1))
self.out_cards = self.out_cards + (10^(card-1))
table.insert(self.player1_out_cards,card)
print("ai出牌"..card)
self:show()
self.status = "player"
self:sleep(5)
end
function M:player()
local dispatch_card = self:dispatch(2)
if not dispatch_card then
self.status = "gameover"
print("平局")
return
end
self:cls()
print("玩家请出牌。。。")
self:show()
while true do
local card = io.read("*num")
local n = math.floor(self.player2_hand_cards/(10^(card-1)))%10
if n > 0 then
self.player2_hand_cards = self.player2_hand_cards - 1*(10^(card-1))
self.out_cards = self.out_cards + (10^(card-1))
table.insert(self.player2_out_cards,card)
self.status = "ai"
self:cls()
print("玩家已出牌。。。")
self:show()
self:sleep(5)
break
else
self:cls()
print("请重新输入。。。")
self:show()
end
end
end
function M:loop()
while true do
if self.status == "ai" then
self:ai()
elseif self.status == "player" then
self:player()
elseif self.status == "gameover" then
break
end
end
end
return M
|
minetest.register_entity("yatm_armoury:turret", {
initial_properties = {
--drawtype = "mesh",
visual = "mesh",
mesh = "yatm_turret_machine_gun.obj",
visual_scale = 1/24,
textures = {
"yatm_turret.png"
},
is_turret = true,
}
})
|
-- Room ( Dungeon room of course :v )
require "src/List"
Room = {}
function Room.new( container )
local self = setmetatable( {}, { __index = Room } )
self.x = container.x + love.math.random( 0, container.w / 3 )
self.y = container.y + love.math.random( 0, container.h / 3 )
self.w = container.w - ( self.x - container.x )
self.h = container.h - ( self.y - container.y )
self.w = self.w - love.math.random( 0, self.w / 3 )
self.h = self.h - love.math.random( 0, self.w / 3 )
return self
end
function Room:draw()
love.graphics.setColor( 255, 0, 0, 255 )
love.graphics.rectangle( "line", self.x, self.y, self.w, self.h )
end
-- Tree to List
function getRoomList( container )
if container == nil then
return nil
elseif container.left == nil and container.right == nil then
return List.new( Room.new( container.data ) )
else
print( "We need to go deeper" )
local elem, run
elem = getRoomList( container.left )
run = elem
while run.next ~= nil do
run = run.next
end
run.next = getRoomList( container.right )
return elem
end
end
|
-- Base16 {{ scheme-name }} color
-- Author: {{ scheme-author }}
-- to be use in your theme.lua
-- symlink or copy to config folder `local color = require('color')`
local M = {}
M.base00 = "#171e1f" -- ----
M.base01 = "#252c2d" -- ---
M.base02 = "#373c3d" -- --
M.base03 = "#555e5f" -- -
M.base04 = "#818f80" -- +
M.base05 = "#c7c7a5" -- ++
M.base06 = "#e3e3c8" -- +++
M.base07 = "#e1eaef" -- ++++
M.base08 = "#ff4658" -- red
M.base09 = "#e6db74" -- orange
M.base0A = "#fdb11f" -- yellow
M.base0B = "#499180" -- green
M.base0C = "#66d9ef" -- aqua/cyan
M.base0D = "#498091" -- blue
M.base0E = "#9bc0c8" -- purple
M.base0F = "#d27b53" -- brown
return M
|
local PANEL = {}
function PANEL:Init()
self:SetPos(0,0)
self:SetSize(500,500)
self:SetSpaceX(2)
self:SetSpaceY(2)
self:SetBorder(0,0)
end
vgui.Register("ZGrid",PANEL,"DIconLayout");
|
-- Natural Selection 2 Competitive Mod
-- Source located at - https://github.com/xToken/CompMod
-- lua\CompMod\CommAbilities\Rupture\shared.lua
-- - Dragon
function Rupture:OnAbilityOptionalEnd()
end
function Rupture:GetType()
return CommanderAbility.kType.Repeat
end
function Rupture:OnDestroy()
if Client then
local effect = Client.CreateCinematic(RenderScene.Zone_Default)
effect:SetCinematic(Rupture.kRuptureEffect)
effect:SetCoords(self:GetCoords())
Shared.PlayWorldSound(nil, Rupture.kBurstSound, nil, self:GetOrigin(), 1)
end
end
|
--This code is based on code from mesecons by Jeija, at:
--https://github.com/Jeija/minetest-mod-mesecons/blob/c2e3d7c4e58b2563e79aead60c6efedf27c786cf/mesecons_wires/init.lua#L12
local wire_getconnect = function (from_pos, self_pos)
local node = minetest.get_node(self_pos)
if minetest.registered_nodes[node.name]
and minetest.registered_nodes[node.name].mesecons then
-- rules of node to possibly connect to
local rules = {}
if (minetest.registered_nodes[node.name].mesecon_ito_wire or minetest.registered_nodes[node.name].mesecon_wire) then
rules = mesecon.rules.default
else
rules = mesecon.get_any_rules(node)
end
for _, r in ipairs(mesecon.flattenrules(rules)) do
if (vector.equals(vector.add(self_pos, r), from_pos)) then
return true
end
end
end
return false
end
-- Update this node
local wire_updateconnect = function (pos,ito)
local connections = {}
for _, r in ipairs(mesecon.rules.default) do
if wire_getconnect(pos, vector.add(pos, r)) then
table.insert(connections, r)
end
end
local nid = {}
for _, vec in ipairs(connections) do
-- flat component
if vec.x == 1 then nid[0] = "1" end
if vec.z == 1 then nid[1] = "1" end
if vec.x == -1 then nid[2] = "1" end
if vec.z == -1 then nid[3] = "1" end
-- slopy component
if vec.y == 1 then
if vec.x == 1 then nid[4] = "1" end
if vec.z == 1 then nid[5] = "1" end
if vec.x == -1 then nid[6] = "1" end
if vec.z == -1 then nid[7] = "1" end
end
end
local nodeid = (nid[0] or "0")..(nid[1] or "0")..(nid[2] or "0")..(nid[3] or "0")
..(nid[4] or "0")..(nid[5] or "0")..(nid[6] or "0")..(nid[7] or "0")
local state_suffix = string.find(minetest.get_node(pos).name, "_off") and "_off" or "_on"
if ito then
minetest.set_node(pos, {name = "mesecons_ito:wire_"..nodeid..state_suffix})
else
minetest.set_node(pos, {name = "mesecons:wire_"..nodeid..state_suffix})
end
end
local update_on_place_dig = function (pos, node)
-- Update placed node (get_node again as it may have been dug)
local nn = minetest.get_node(pos)
if (minetest.registered_nodes[nn.name])
and (minetest.registered_nodes[nn.name].mesecon_ito_wire or minetest.registered_nodes[nn.name].mesecon_wire) then
wire_updateconnect(pos,minetest.registered_nodes[nn.name].mesecon_ito_wire)
end
-- Update nodes around it
local rules = {}
if minetest.registered_nodes[node.name]
and minetest.registered_nodes[node.name].mesecon_ito_wire or minetest.registered_nodes[node.name].mesecon_wire then
rules = mesecon.rules.default
else
rules = mesecon.get_any_rules(node)
end
if (not rules) then return end
for _, r in ipairs(mesecon.flattenrules(rules)) do
local np = vector.add(pos, r)
if minetest.registered_nodes[minetest.get_node(np).name]
and minetest.registered_nodes[minetest.get_node(np).name].mesecon_ito_wire or minetest.registered_nodes[minetest.get_node(np).name].mesecon_wire then
wire_updateconnect(np,minetest.registered_nodes[minetest.get_node(np).name].mesecon_ito_wire)
end
end
end
mesecon.register_autoconnect_hook("wire", update_on_place_dig)
local tiles_off = { "mesecons_ito_mesecons.png" }
local tiles_on = { "mesecons_ito_mesecons.png" }
local box_center = {-1/16, -.5, -1/16, 1/16, -.5+1/32, 1/16}
local box_bump1 = { -2/16, -8/16, -2/16, 2/16, -14/32, 2/16 }
local nbox_nid =
{
[0] = {1/16, -.5, -1/16, 8/16, -.5+1/32, 1/16}, -- x positive
[1] = {-1/16, -.5, 1/16, 1/16, -.5+1/32, 8/16}, -- z positive
[2] = {-8/16, -.5, -1/16, -1/16, -.5+1/32, 1/16}, -- x negative
[3] = {-1/16, -.5, -8/16, 1/16, -.5+1/32, -1/16}, -- z negative
[4] = {.5-1/16, -.5+1/16, -1/16, .5, .4999+1/32, 1/16}, -- x positive up
[5] = {-1/16, -.5+1/16, .5-1/16, 1/16, .4999+1/32, .5}, -- z positive up
[6] = {-.5, -.5+1/16, -1/16, -.5+1/16, .4999+1/32, 1/16}, -- x negative up
[7] = {-1/16, -.5+1/16, -.5, 1/16, .4999+1/32, -.5+1/16} -- z negative up
}
local selectionbox =
{
type = "fixed",
fixed = {-.5, -.5, -.5, .5, -.5+4/16, .5}
}
-- go to the next nodeid (ex.: 01000011 --> 01000100)
local nid_inc = function() end
nid_inc = function (nid)
local i = 0
while nid[i-1] ~= 1 do
nid[i] = (nid[i] ~= 1) and 1 or 0
i = i + 1
end
-- BUT: Skip impossible nodeids:
if ((nid[0] == 0 and nid[4] == 1) or (nid[1] == 0 and nid[5] == 1)
or (nid[2] == 0 and nid[6] == 1) or (nid[3] == 0 and nid[7] == 1)) then
return nid_inc(nid)
end
return i <= 8
end
local function register_wires()
local nid = {}
while true do
-- Create group specifiction and nodeid string (see note above for details)
local nodeid = (nid[0] or "0")..(nid[1] or "0")..(nid[2] or "0")..(nid[3] or "0")
..(nid[4] or "0")..(nid[5] or "0")..(nid[6] or "0")..(nid[7] or "0")
-- Calculate nodebox
local nodebox = {type = "fixed", fixed={box_center}}
for i=0,7 do
if nid[i] == 1 then
table.insert(nodebox.fixed, nbox_nid[i])
end
end
-- Add bump to nodebox if curved
if (nid[0] == 1 and nid[1] == 1) or (nid[1] == 1 and nid[2] == 1)
or (nid[2] == 1 and nid[3] == 1) or (nid[3] == 1 and nid[0] == 1) then
table.insert(nodebox.fixed, box_bump1)
end
-- If nothing to connect to, still make a nodebox of a straight wire
if nodeid == "00000000" then
nodebox.fixed = {-8/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
end
local rules = {}
if (nid[0] == 1) then table.insert(rules, vector.new( 1, 0, 0)) end
if (nid[1] == 1) then table.insert(rules, vector.new( 0, 0, 1)) end
if (nid[2] == 1) then table.insert(rules, vector.new(-1, 0, 0)) end
if (nid[3] == 1) then table.insert(rules, vector.new( 0, 0, -1)) end
if (nid[0] == 1) then table.insert(rules, vector.new( 1, -1, 0)) end
if (nid[1] == 1) then table.insert(rules, vector.new( 0, -1, 1)) end
if (nid[2] == 1) then table.insert(rules, vector.new(-1, -1, 0)) end
if (nid[3] == 1) then table.insert(rules, vector.new( 0, -1, -1)) end
if (nid[4] == 1) then table.insert(rules, vector.new( 1, 1, 0)) end
if (nid[5] == 1) then table.insert(rules, vector.new( 0, 1, 1)) end
if (nid[6] == 1) then table.insert(rules, vector.new(-1, 1, 0)) end
if (nid[7] == 1) then table.insert(rules, vector.new( 0, 1, -1)) end
local meseconspec_off = { conductor = {
rules = rules,
state = mesecon.state.off,
onstate = "mesecons_ito:wire_"..nodeid.."_on"
}}
local meseconspec_on = { conductor = {
rules = rules,
state = mesecon.state.on,
offstate = "mesecons_ito:wire_"..nodeid.."_off"
}}
local groups_on = {dig_immediate = 3, mesecon_conductor_craftable = 1,
not_in_creative_inventory = 1}
local groups_off = {dig_immediate = 3, mesecon_conductor_craftable = 1}
if nodeid ~= "00000000" then
groups_off["not_in_creative_inventory"] = 1
end
mesecon.register_node("mesecons_ito:wire_"..nodeid, {
description = "Transparent Mesecon",
drawtype = "nodebox",
inventory_image = "mesecons_wire_inv.png^[brighten",
wield_image = "mesecons_wire_inv.png^[brighten",
paramtype = "light",
paramtype2 = "facedir",
use_texture_alpha = true,
sunlight_propagates = true,
selection_box = selectionbox,
node_box = nodebox,
walkable = false,
drop = "mesecons_ito:wire_00000000_off",
mesecon_ito_wire = true
}, {tiles = tiles_off, mesecons = meseconspec_off, groups = groups_off},
{tiles = tiles_on, mesecons = meseconspec_on, groups = groups_on})
if (nid_inc(nid) == false) then return end
end
end
register_wires()
--Code from mesecons ends here
--This code is based on code from digilines by Jeija, at:
--https://github.com/minetest-mods/digilines/blob/master/wire_std.lua#L6
box_center = {-1/16, -.5, -1/16, 1/16, -.5+1/16, 1/16}
box_bump1 = { -2/16, -8/16, -2/16, 2/16, -13/32, 2/16 }
box_bump2 = { -3/32, -13/32, -3/32, 3/32, -12/32, 3/32 }
box_xp = {1/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
box_zp = {-1/16, -.5, 1/16, 1/16, -.5+1/16, 8/16}
box_xm = {-8/16, -.5, -1/16, -1/16, -.5+1/16, 1/16}
box_zm = {-1/16, -.5, -8/16, 1/16, -.5+1/16, -1/16}
box_xpy = {.5-1/16, -.5+1/16, -1/16, .5, .4999+1/16, 1/16}
box_zpy = {-1/16, -.5+1/16, .5-1/16, 1/16, .4999+1/16, .5}
box_xmy = {-.5, -.5+1/16, -1/16, -.5+1/16, .4999+1/16, 1/16}
box_zmy = {-1/16, -.5+1/16, -.5, 1/16, .4999+1/16, -.5+1/16}
for xp=0, 1 do
for zp=0, 1 do
for xm=0, 1 do
for zm=0, 1 do
for xpy=0, 1 do
for zpy=0, 1 do
for xmy=0, 1 do
for zmy=0, 1 do
if (xpy == 1 and xp == 0) or (zpy == 1 and zp == 0)
or (xmy == 1 and xm == 0) or (zmy == 1 and zm == 0) then break end
local groups
local nodeid = tostring(xp )..tostring(zp )..tostring(xm )..tostring(zm )..
tostring(xpy)..tostring(zpy)..tostring(xmy)..tostring(zmy)
if nodeid == "00000000" then
groups = {dig_immediate = 3}
wiredesc = "Transparent Digiline"
else
groups = {dig_immediate = 3, not_in_creative_inventory = 1}
end
local nodebox = {}
local adjx = false
local adjz = false
if xp == 1 then table.insert(nodebox, box_xp) adjx = true end
if zp == 1 then table.insert(nodebox, box_zp) adjz = true end
if xm == 1 then table.insert(nodebox, box_xm) adjx = true end
if zm == 1 then table.insert(nodebox, box_zm) adjz = true end
if xpy == 1 then table.insert(nodebox, box_xpy) end
if zpy == 1 then table.insert(nodebox, box_zpy) end
if xmy == 1 then table.insert(nodebox, box_xmy) end
if zmy == 1 then table.insert(nodebox, box_zmy) end
if adjx and adjz and (xp + zp + xm + zm > 2) then
table.insert(nodebox, box_bump1)
table.insert(nodebox, box_bump2)
tiles = {
"mesecons_ito_digilines.png",
}
else
table.insert(nodebox, box_center)
tiles = {
"mesecons_ito_digilines.png",
}
end
if nodeid == "00000000" then
nodebox = {-8/16, -.5, -1/16, 8/16, -.5+1/16, 1/16}
end
minetest.register_node("mesecons_ito:wire_std_"..nodeid, {
description = wiredesc,
drawtype = "nodebox",
tiles = tiles,
inventory_image = "digiline_std_inv.png^[brighten",
wield_image = "digiline_std_inv.png^[brighten",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
use_texture_alpha = true,
digiline =
{
wire =
{
basename = "mesecons_ito:wire_std_",
use_autoconnect = true
}
},
selection_box = {
type = "fixed",
fixed = {-.5, -.5, -.5, .5, -.5+1/16, .5}
},
node_box = {
type = "fixed",
fixed = nodebox
},
groups = groups,
walkable = false,
stack_max = 99,
drop = "mesecons_ito:wire_std_00000000"
})
end
end
end
end
end
end
end
end
--Code from digilines ends here
minetest.register_craftitem("mesecons_ito:ito",{
description = "Indium/tin/mese Mixture",
inventory_image = "mesecons_ito_dust.png",
})
minetest.register_craft({
type = "shapeless",
output = "mesecons_ito:ito 8",
recipe = {
"technic:zinc_lump",
"technic:zinc_lump",
"technic:zinc_lump",
"technic:zinc_lump",
"technic:zinc_lump",
"technic:zinc_lump",
"technic:zinc_lump",
"moreores:tin_ingot",
"default:mese_crystal",
},
})
minetest.register_craft({
type = "cooking",
output = "mesecons_ito:wire_00000000_off 25",
recipe = "mesecons_ito:ito",
cooktime = 3,
})
minetest.register_craft({
output = "mesecons_ito:wire_std_00000000",
recipe = {
{"","",""},
{"mesecons_ito:wire_00000000_off","mesecons_ito:wire_00000000_off","mesecons_ito:wire_00000000_off",},
{"","default:glass",""},
},
})
|
x = {test = "bar", foo = "no", food = "yes"}
y = require("test2")
for k,v in pairs(x) do
print(k, "=>", v)
end
print("GOT", y, y[10])
|
#include "umf_core.lua"
#include "extension/tool_loader.lua"
UpdateQuickloadPatch()
|
return function(parent, dir)
local math = require 'math'
local lgi = require 'lgi'
local GObject = lgi.GObject
local Gtk = lgi.Gtk
local Gdk = lgi.Gdk
local cairo = lgi.cairo
local GtkDemo = lgi.GtkDemo
local log = lgi.log.domain 'gtk-demo'
GtkDemo:class('MirrorBin', Gtk.Bin)
function GtkDemo.MirrorBin:_init()
self.has_window = true
end
local function to_child(bin, widget_x, widget_y)
return widget_x, widget_y
end
local function to_parent(bin, offscreen_x, offscreen_y)
return offscreen_x, offscreen_y
end
function GtkDemo.MirrorBin:do_realize()
self.realized = true
-- Create Gdk.Window and bind it with the widget.
local events = self.events
events.EXPOSURE_MASK = true
events.POINTER_MOTION_MASK = true
events.BUTTON_PRESS_MASK = true
events.BUTTON_RELEASE_MASK = true
events.SCROLL_MASK = true
events.ENTER_NOTIFY_MASK = true
events.LEAVE_NOTIFY_MASK = true
local attributes = Gdk.WindowAttr {
x = self.allocation.x + self.border_width,
y = self.allocation.y + self.border_width,
width = self.allocation.width - 2 * self.border_width,
height = self.allocation.height - 2 * self.border_width,
window_type = 'CHILD',
event_mask = Gdk.EventMask(events),
visual = self:get_visual(),
wclass = 'INPUT_OUTPUT',
}
local window = Gdk.Window.new(self:get_parent_window(), attributes,
{ 'X', 'Y', 'VISUAL' })
self:set_window(window)
window.widget = self
local bin = self
function window:on_pick_embedded_child(widget_x, widget_y)
if bin.priv.child and bin.priv.child.visible then
local x, y = to_child(bin, widget_x, widget_y)
local child_area = bin.allocation
if x >= 0 and x < child_area.width
and y >= 0 and y < child_area.height then
return bin.priv.offscreen_window
end
end
end
-- Create and hook up the offscreen window.
attributes.window_type = 'OFFSCREEN'
local child_requisition = Gtk.Requisition { width = 0, height = 0 }
if self.priv.child and self.priv.child.visible then
local child_allocation = self.priv.child.allocation
attributes.width = child_allocation.width
attributes.height = child_allocation.height
end
self.priv.offscreen_window = Gdk.Window.new(self.root_window, attributes,
{ 'X', 'Y', 'VISUAL' })
self.priv.offscreen_window.widget = self
if self.priv.child then
self.priv.child:set_parent_window(bin.priv.offscreen_window)
end
Gdk.offscreen_window_set_embedder(self.priv.offscreen_window, window)
function self.priv.offscreen_window:on_to_embedder(offscreen_x, offscreen_y)
return to_parent(bin, offscreen_x, offscreen_y)
end
function self.priv.offscreen_window:on_from_embedder(parent_x, parent_y)
return to_child(bin, parent_x, parent_y)
end
-- Set background of the windows according to current context.
self.style_context:set_background(window)
self.style_context:set_background(self.priv.offscreen_window)
self.priv.offscreen_window:show()
end
function GtkDemo.MirrorBin:do_unrealize()
-- Destroy offscreen window.
self.priv.offscreen_window.widget = nil
self.priv.offscreen_window:destroy()
self.priv.offscreen_window = nil
-- Chain to parent.
GtkDemo.MirrorBin._parent.do_unrealize(self)
end
function GtkDemo.MirrorBin:do_child_type()
return self.priv.child and GObject.Type.NONE or Gtk.Widget
end
function GtkDemo.MirrorBin:do_add(widget)
if not self.priv.child then
if self.priv.offscreen_window then
widget:set_parent_window(self.priv.offscreen_window)
end
widget:set_parent(self)
self.priv.child = widget
else
log.warning("GtkDemo.MirrorBin cannot have more than one child")
end
end
function GtkDemo.MirrorBin:do_remove(widget)
local was_visible = widget.visible
if self.priv.child == widget then
widget:unparent()
self.priv.child = nil
if was_visible and self.visible then
self:queue_resize()
end
end
end
function GtkDemo.MirrorBin:do_forall(include_internals, callback)
if self.priv.child then
callback(self.priv.child, callback.user_data)
end
end
local function size_request(self)
local child_requisition = Gtk.Requisition()
if self.priv.child and self.priv.child.visible then
child_requisition = self.priv.child:get_preferred_size()
end
local w = child_requisition.width + 10 + 2 * self.border_width
local h = child_requisition.height + 10 + 2 * self.border_width
return w, h
end
function GtkDemo.MirrorBin:do_get_preferred_width()
local w, h = size_request(self)
return w, w
end
function GtkDemo.MirrorBin:do_get_preferred_height()
local w, h = size_request(self)
return h, h
end
function GtkDemo.MirrorBin:do_size_allocate(allocation)
self:set_allocation(allocation)
local w = allocation.width - self.border_width * 2
local h = allocation.height - self.border_width * 2
if self.realized then
self.window:move_resize(allocation.x + self.border_width,
allocation.y + self.border_width,
w, h)
end
if self.priv.child and self.priv.child.visible then
local child_requisition = self.priv.child:get_preferred_size()
local child_allocation = Gtk.Allocation {
height = child_requisition.height,
width = child_requisition.width
}
if self.realized then
self.priv.offscreen_window:move_resize(child_allocation.x,
child_allocation.y,
child_allocation.width,
child_allocation.height)
end
self.priv.child:size_allocate(child_allocation)
end
end
function GtkDemo.MirrorBin:do_damage(event)
self.window:invalidate_rect(nil, false)
return true
end
function GtkDemo.MirrorBin:_class_init()
-- Unfortunately, damage-event signal does not have virtual
-- function associated, so we have to go through following funky
-- dance to install default signal handler.
GObject.signal_override_class_closure(
GObject.signal_lookup('damage-event', Gtk.Widget),
GtkDemo.MirrorBin,
GObject.Closure(GtkDemo.MirrorBin.do_damage,
Gtk.Widget.on_damage_event))
end
function GtkDemo.MirrorBin:do_draw(cr)
if cr:should_draw_window(self.window) then
if self.priv.child and self.priv.child.visible then
local surface = Gdk.offscreen_window_get_surface(
self.priv.offscreen_window)
local height = self.priv.offscreen_window:get_height()
-- Paint the offscreen child
cr:set_source_surface(surface, 0, 0)
cr:paint()
local matrix = cairo.Matrix {
xx = 1, yx = 0, xy = 0.3, yy = 1, x0 = 0, y0 = 0 }
matrix:scale(1, -1)
matrix:translate(-10, -3 * height, - 10)
cr:transform(matrix)
cr:set_source_surface(surface, 0, height)
-- Create linear gradient as mask-pattern to fade out the source
local mask = cairo.LinearPattern(0, height, 0, 2 * height)
mask:add_color_stop_rgba(0, 0, 0, 0, 0)
mask:add_color_stop_rgba(0.25, 0, 0, 0, 0.01)
mask:add_color_stop_rgba(0.5, 0, 0, 0, 0.25)
mask:add_color_stop_rgba(0.75, 0, 0, 0, 0.5)
mask:add_color_stop_rgba(1, 0, 0, 0, 1)
-- Paint the reflection
cr:mask(mask)
end
elseif cr:should_draw_window(self.priv.offscreen_window) then
Gtk.render_background(self.style_context, cr, 0, 0,
self.priv.offscreen_window:get_width(),
self.priv.offscreen_window:get_height())
if self.priv.child then
self:propagate_draw(self.priv.child, cr)
end
end
return false
end
local window = Gtk.Window {
title = "Effects",
border_width = 10,
Gtk.Box {
orientation = 'VERTICAL',
expand = true,
GtkDemo.MirrorBin {
Gtk.Box {
orientation = 'HORIZONTAL',
spacing = 6,
Gtk.Button {
Gtk.Image {
stock = Gtk.STOCK_GO_BACK,
icon_size = 4,
},
},
Gtk.Entry {
expand = true,
},
Gtk.Button {
Gtk.Image {
stock = Gtk.STOCK_APPLY,
icon_size = 4,
},
},
},
},
},
}
window:show_all()
return window
end,
"Offscreen windows/Effects",
table.concat {
[[Offscreen windows can be used to render elements multiple times ]],
[[to achieve various effects.]]
}
|
-- Default style
--[[local lantern_nodebox = {
type = "fixed",
fixed = {
-- Default
{-4/16,-8/16,-4/16,4/16,2/16,4/16}, -- Base Body
{-3/16, 2/16,-3/16,3/16,4/16,3/16},
{-2/16, 4/16,-2/16,2/16,7/16,2/16},
}
}]]
-- Fancy style
local fancy_lantern_nodebox = {
type = "fixed",
fixed = {
-- Default
{-4/16,-8/16,-4/16,4/16,-7/16,4/16}, -- Base Plate
{-4/16, 1/16,-4/16,4/16,2/16,4/16}, -- Upper Plate
{-3/16,-7/16,-3/16,3/16,4/16,3/16}, -- Core
{-2/16, 4/16,-2/16,2/16,7/16,2/16}, -- Top Knob
}
}
for _,row in ipairs(yatm.colors) do
local color_basename = row.name
local color_name = row.description
minetest.register_node("yatm_foundry:lantern_carbon_steel_" .. color_basename, {
basename = "yatm_foundry:lantern_carbon_steel",
codex_entry_id = "yatm_foundry:lantern_carbon_steel",
base_description = yatm_foundry.S("Carbon Steel Lantern"),
description = yatm_foundry.S(color_name .. " Carbon Steel Lantern"),
groups = {
oddly_breakable_by_hand = 3,
cracky = 1,
lantern = 1,
carbon_steel = 1,
metallic = 1,
},
is_ground_content = false,
paramtype = "light",
sunlight_propagates = false,
light_source = minetest.LIGHT_MAX,
drawtype = "nodebox",
node_box = fancy_lantern_nodebox,
tiles = {
"yatm_carbon_steel_lanterns_" .. color_basename .. "_top.png",
"yatm_carbon_steel_lanterns_" .. color_basename .. "_bottom.png",
"yatm_carbon_steel_lanterns_" .. color_basename .. "_side.png",
"yatm_carbon_steel_lanterns_" .. color_basename .. "_side.png",
"yatm_carbon_steel_lanterns_" .. color_basename .. "_side.png",
"yatm_carbon_steel_lanterns_" .. color_basename .. "_side.png",
},
use_texture_alpha = "opaque",
})
end
|
-- Copyright 2006-2012 Mitchell mitchell.att.foicica.com. See LICENSE.
-- Bibtex LPeg lexer.
local l = lexer
local token, style, color, word_match = l.token, l.style, l.color, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'bibtex'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
-- Strings.
local string = token(l.STRING, l.delimited_range('"', '\\', true) +
l.delimited_range('{}', nil, true, true))
-- Fields.
local field = token('field', word_match{
'author', 'title', 'journal', 'year', 'volume', 'number', 'pages', 'month',
'note', 'key', 'publisher', 'editor', 'series', 'address', 'edition',
'howpublished', 'booktitle', 'organization', 'chapter', 'school',
'institution', 'type', 'isbn', 'issn', 'affiliation', 'issue', 'keyword',
'url'
})
-- Identifiers.
local identifier = token(l.IDENTIFIER, l.word)
-- Operators.
local operator = token(l.OPERATOR, S(',='))
M._rules = {
{'whitespace', ws},
{'field', field},
{'identifier', identifier},
{'string', string},
{'operator', operator},
{'any_char', l.any_char}
}
-- Embedded in Latex.
local latex = l.load('latex')
M._lexer = latex
-- Embedded Bibtex.
local entry = token('entry', P('@') * word_match({
'book', 'article', 'booklet', 'conference', 'inbook', 'incollection',
'inproceedings', 'manual', 'mastersthesis', 'lambda', 'misc', 'phdthesis',
'proceedings', 'techreport', 'unpublished'
}, nil, true))
local bibtex_start_rule = entry * ws^0 * token(l.OPERATOR, P('{'))
local bibtex_end_rule = token(l.OPERATOR, P('}'))
l.embed_lexer(latex, M, bibtex_start_rule, bibtex_end_rule)
M._tokenstyles = {
{'field', l.style_constant},
{'entry', l.style_preproc}
}
return M
|
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Packages = ReplicatedStorage.Packages
local Chickynoid = require(Packages.Chickynoid.Server)
Chickynoid.Setup()
Players.PlayerAdded:Connect(function(player)
local character = Chickynoid.SpawnForPlayerAsync(player)
RunService.Heartbeat:Connect(function()
character:Heartbeat()
end)
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.