content
stringlengths 5
1.05M
|
|---|
local Screen = Level:extend()
function Screen:activate()
--- shape value
-- floor
local floorZ = Base.gui.height - 20
-- player wall
local c1Z = 80
local c1LenX = 2.5 * 40
local c1LenY = 140
local c1LenZ = 100
-- laser wall
local c2LenX = 40 * 4
local c2LenY = c1LenY
local c2LenZ = floorZ-(c1Z+c1LenZ)
-- hole
local hLenX = 40 * 2
local hLenZ = 10
local hX1 = 3*40
local hX2 = hX1 + 40 * 3
local hZ = c1Z
-- left wall
local leftLenY = 50
local leftLenZ = 200
local leftX = hX1 - 1
local leftY = -200
local leftZ = hZ - leftLenZ + hLenZ
-- ball
local ballR = hLenX/2
-- laser
local tX = 3.5 * 40
local tBorderX = 40
local tY = leftY + leftLenY
local tZ = hZ+30--100
local tSX = 0
local tSY = 1
local tSZ = 1
---
-- levelName
local levelName = Lang.level_SuperLaser
-- player location
local playerX = 30
local playerY = 50
local playerZ = c1Z-1
-- endCube location
local endCubeX = playerX-Base.lenEndCube/2
local endCubeY = Base.gui.height+10
local endCubeZ = floorZ-Base.lenEndCube/2
-- create player and endCube
local playerPosition = Base.createPosition(playerX, playerY, playerZ)
local endCubePosition = Base.createPosition(endCubeX, endCubeY, endCubeZ)
Screen.super.activate(self, playerPosition, endCubePosition, levelName)
--- here to create shape
-- floor
self:addShape(Cuboid, 1, 1, floorZ, Base.gui.width, Base.gui.height, 1)
-- player wall
self:addShape(Cuboid, 1, 1, c1Z, c1LenX, c1LenY, c1LenZ)
-- laser wall
self:addShape(Cuboid, 1+c1LenX, 1, c1Z+c1LenZ, c2LenX, c2LenY, c2LenZ)
--left wall
self:addShape(Cuboid, leftX, leftY, leftZ, 10, leftLenY, leftLenZ)
-- hole1
self:addShape(Cuboid, hX1, leftY, hZ, hLenX, leftLenY, hLenZ)
self:addShape(Ball, hX1+ballR, leftY-10, hZ-ballR, ballR)
-- hole2
self:addShape(Cuboid, hX2, leftY, hZ, hLenX, leftLenY, hLenZ)
self:addShape(Ball, hX2+ballR, leftY-10, hZ-ballR, ballR)
-- Laser
for i = 0, 4 do
self:addShape(Laser, tX+tBorderX*i, tY, tZ, tSX, tSY, tSZ)
end
end
return Screen
|
-- Material Design Button PseudoInstances with Ripples
-- @documentation https://rostrap.github.io/Libraries/RoStrapUI/RippleButton/
-- @author Validark
local Players = game:GetService("Players")
local TextService = game:GetService("TextService")
local ContentProvider = game:GetService("ContentProvider")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Resources = require(ReplicatedStorage:WaitForChild("Resources"))
local Debug = Resources:LoadLibrary("Debug")
local Tween = Resources:LoadLibrary("Tween")
local Color = Resources:LoadLibrary("Color")
local Typer = Resources:LoadLibrary("Typer")
local Enumeration = Resources:LoadLibrary("Enumeration")
local PseudoInstance = Resources:LoadLibrary("PseudoInstance")
local Shadow = Resources:LoadLibrary("Shadow")
local Rippler = Resources:LoadLibrary("Rippler")
-- Elevations
local RAISED_BASE_ELEVATION = 3
local RAISED_ELEVATION = 8
Enumeration.ButtonStyle = {"Flat", "Outlined", "Contained"}
local StateOpacity = { -- TODO: Derive these values based on the PrimaryColor3's luminosity
-- Material Design specs have values which are more subtle, which I don't think look ideal
[Enumeration.ButtonStyle.Flat.Value] = {
Hover = 0.12;
Pressed = 0.265;
};
[Enumeration.ButtonStyle.Outlined.Value] = {
Hover = 0.12; -- 0.035;
Pressed = 0.265; --0.125;
};
[Enumeration.ButtonStyle.Contained.Value] = {
Hover = 0.12; --0.075;
Pressed = 0.3; -- 0.265;
};
}
local RaisedImages = {
[0] = "rbxassetid://132155326";
[2] = "rbxassetid://1934672242";
[4] = "rbxassetid://1934624205";
[8] = "rbxassetid://1935044829";
}
local OutlinedImages = {
[0] = "rbxassetid://2091129360";
[2] = "rbxassetid://1981015282";
[4] = "rbxassetid://1981015668";
[8] = "rbxassetid://1981285569";
}
local ImageButton = Instance.new("ImageButton")
ImageButton.BackgroundTransparency = 1
ImageButton.ScaleType = Enum.ScaleType.Slice.Value
local TextLabel = Instance.new("TextLabel")
TextLabel.BackgroundTransparency = 1
TextLabel.Font = Enum.Font.SourceSansSemibold.Value
TextLabel.Size = UDim2.new(1, 0, 1, 0)
TextLabel.TextSize = 16
TextLabel.Parent = ImageButton
local OutlineImage = Instance.new("ImageLabel")
OutlineImage.BackgroundTransparency = 1
OutlineImage.Size = UDim2.new(1, 0, 1, 0)
OutlineImage.ScaleType = Enum.ScaleType.Slice.Value
OutlineImage.ImageTransparency = 0.88
OutlineImage.Name = "Outline"
OutlineImage.ImageColor3 = Color.Black
local TOOLTIP_BORDER_RADIUS = 4
local TooltipObject = Instance.new("ImageLabel")
TooltipObject.BackgroundTransparency = 1
TooltipObject.ScaleType = Enum.ScaleType.Slice.Value
TooltipObject.ImageTransparency = 0.1
TooltipObject.ImageColor3 = Color3.fromRGB(97, 97, 97)
TooltipObject.Image = RaisedImages[TOOLTIP_BORDER_RADIUS]
TooltipObject.SliceCenter = Rect.new(TOOLTIP_BORDER_RADIUS, TOOLTIP_BORDER_RADIUS, 256 - TOOLTIP_BORDER_RADIUS, 256 - TOOLTIP_BORDER_RADIUS)
TooltipObject.Name = "Tooltip"
TooltipObject.AnchorPoint = Vector2.new(0.5, 0)
TooltipObject.Position = UDim2.new(0.5, 0, 1, 8)
local ToolTipLabel = TextLabel:Clone()
ToolTipLabel.TextColor3 = Color.White
ToolTipLabel.TextSize = 12
ToolTipLabel.TextTransparency = 1
ToolTipLabel.Name = "TextLabel"
ToolTipLabel.Parent = TooltipObject
local Touch = Enum.UserInputType.Touch
local MouseButton1 = Enum.UserInputType.MouseButton1
local MouseMovement = Enum.UserInputType.MouseMovement
local LARGE_FRAME_SIZE = Vector2.new(32767, 32767)
local Invisify = {UserInputType = MouseMovement}
return PseudoInstance:Register("RippleButton", {
WrappedProperties = {
Object = {"AnchorPoint", "Active", "Name", "Size", "Position", "LayoutOrder", "NextSelectionDown", "NextSelectionLeft", "NextSelectionRight", "NextSelectionUp", "Parent"};
TextLabel = {"TextXAlignment", "TextYAlignment"};
};
Internals = {
"TextLabel", "Rippler", "OutlineImage", "OverlayOpacity", "Shadow", "TooltipObject", "InputBegan", "InputEnded", "InputChanged", "RegisteredRippleInputs";
Render = function(self)
local PrimaryColor3 = self.PrimaryColor3
local Luminosity = PrimaryColor3.r * 0.299 + PrimaryColor3.g * 0.587 + PrimaryColor3.b * 0.114
if self.Style == Enumeration.ButtonStyle.Contained then
if self.Disabled then
PrimaryColor3 = Color3.fromRGB(204, 204, 204)
end
local SecondaryColor3 = self.SecondaryColor3 or 0.5 < Luminosity and Color.Black or Color.White
self.Rippler.RippleColor3 = SecondaryColor3
self.TextLabel.TextColor3 = SecondaryColor3
self.Object.ImageColor3 = PrimaryColor3
else
if self.Disabled then
PrimaryColor3 = Color.Black
end
self.Rippler.RippleColor3 = PrimaryColor3
self.TextLabel.TextColor3 = PrimaryColor3
self.Object.ImageColor3 = PrimaryColor3
end
end;
};
Events = {
OnPressed = function(self)
local RegisteredRippleInputs = self.RegisteredRippleInputs
return function(Signal)
RegisteredRippleInputs[Enum.UserInputType.Touch.Value] = Signal
RegisteredRippleInputs[Enum.UserInputType.MouseButton1.Value] = Signal
end, function()
RegisteredRippleInputs[Enum.UserInputType.Touch.Value] = nil
RegisteredRippleInputs[Enum.UserInputType.MouseButton1.Value] = nil
end
end;
OnRightPressed = function(self)
local RegisteredRippleInputs = self.RegisteredRippleInputs
return function(Signal)
RegisteredRippleInputs[Enum.UserInputType.MouseButton2.Value] = Signal
end, function()
RegisteredRippleInputs[Enum.UserInputType.MouseButton2.Value] = nil
end
end;
OnMiddlePressed = function(self)
local RegisteredRippleInputs = self.RegisteredRippleInputs
return function(Signal)
RegisteredRippleInputs[Enum.UserInputType.MouseButton3.Value] = Signal
end, function()
RegisteredRippleInputs[Enum.UserInputType.MouseButton3.Value] = nil
end
end;
};
Properties = {
Elevation = Typer.AssignSignature(2, Typer.EnumerationOfTypeShadowElevation, function(self, Elevation)
if Elevation.Value > 0 and self.Style ~= Enumeration.ButtonStyle.Contained then
self.Style = Enumeration.ButtonStyle.Contained
self.Shadow.Elevation = Elevation
end
self:rawset("Elevation", Elevation)
end);
Text = Typer.AssignSignature(2, Typer.String, function(self, Text)
self.TextLabel.Text = Text
self:rawset("Text", Text)
self:rawset("TextBounds", TextService:GetTextSize(Text, self.TextSize, self.Font, LARGE_FRAME_SIZE))
end);
TextSize = Typer.AssignSignature(2, Typer.Number, function(self, TextSize)
self.TextLabel.TextSize = TextSize
self:rawset("TextSize", TextSize)
self:rawset("TextBounds", TextService:GetTextSize(self.Text, TextSize, self.Font, LARGE_FRAME_SIZE))
end);
Font = Typer.AssignSignature(2, Typer.EnumOfTypeFont, function(self, Font)
self.TextLabel.Font = Font
self:rawset("Font", Font)
self:rawset("TextBounds", TextService:GetTextSize(self.Text, self.TextSize, Font, LARGE_FRAME_SIZE))
end);
TextTransparency = Typer.AssignSignature(2, Typer.Number, function(self, TextTransparency)
if not self.Disabled then
self.TextLabel.TextTransparency = TextTransparency
end
self:rawset("TextTransparency", TextTransparency)
end);
Disabled = Typer.AssignSignature(2, Typer.Boolean, function(self, Disabled)
if self.Disabled ~= Disabled then
if Disabled then
if self.Style == Enumeration.ButtonStyle.Contained then
self.Shadow.Visible = false
end
self.TextLabel.TextTransparency = 0.62
self.Janitor:Remove("InputBegan")
self.Janitor:Remove("InputEnded")
self.Janitor:Remove("InputChanged")
else
if self.Style == Enumeration.ButtonStyle.Contained then
self.Shadow.Visible = true
end
self.TextLabel.TextTransparency = self.TextTransparency
self.Janitor:Add(self.Object.InputBegan:Connect(self.InputBegan), "Disconnect", "InputBegan")
self.Janitor:Add(self.Object.InputEnded:Connect(self.InputEnded), "Disconnect", "InputEnded")
self.Janitor:Add(self.Object.InputChanged:Connect(self.InputChanged), "Disconnect", "InputChanged")
end
self:rawset("Disabled", Disabled)
self:Render()
end
end);
Tooltip = Typer.AssignSignature(2, Typer.String, function(self, Tip)
if Tip == "" then
self.TooltipObject = nil
self.Janitor:Remove("TooltipObject")
else
self.TooltipObject = TooltipObject:Clone()
self.TooltipObject.ZIndex = self.ZIndex + 1
self.TooltipObject.TextLabel.Text = Tip
self.TooltipObject.TextLabel.ZIndex = self.ZIndex + 2
self.TooltipObject.Parent = self.Object
self.Janitor:Add(self.TooltipObject, "Destroy", "TooltipObject")
end
self:rawset("Tooltip", Tip)
end);
BorderRadius = Typer.AssignSignature(2, Typer.EnumerationOfTypeBorderRadius, function(self, BorderRadius)
local Value = BorderRadius.Value
local SliceCenter = Rect.new(Value, Value, 256 - Value, 256 - Value)
self.Object.Image = RaisedImages[Value]
self.Object.SliceCenter = SliceCenter
self.Rippler.BorderRadius = Value
if self.Style == Enumeration.ButtonStyle.Outlined then
self.OutlineImage.Image = OutlinedImages[Value]
self.OutlineImage.SliceCenter = SliceCenter
end
self:rawset("BorderRadius", BorderRadius)
end);
Style = Typer.AssignSignature(2, Typer.EnumerationOfTypeButtonStyle, function(self, ButtonStyle)
self:rawset("Style", ButtonStyle)
local StateData = StateOpacity[ButtonStyle.Value]
self.OverlayOpacity = StateData.Hover
self.Rippler.RippleTransparency = 1 - StateData.Pressed
local IsOutlined = ButtonStyle == Enumeration.ButtonStyle.Outlined
if ButtonStyle == Enumeration.ButtonStyle.Flat or IsOutlined then
self.Object.ImageTransparency = 1
self.Object.ImageColor3 = self.PrimaryColor3
self.Janitor:Remove("Shadow")
self.Shadow = nil
self:rawset("Elevation", Enumeration.ShadowElevation.Elevation0)
elseif ButtonStyle == Enumeration.ButtonStyle.Contained then
self.Object.ImageTransparency = 0
-- self.Object.ImageColor3 = self.PrimaryColor3
self.Shadow = PseudoInstance.new("Shadow")
self.Shadow.Parent = self.Object
self.Janitor:Add(self.Shadow, "Destroy", "Shadow")
self.Elevation = RAISED_BASE_ELEVATION
self.Shadow.Transparency = 0
end
self:Render()
if IsOutlined then
self.OutlineImage = OutlineImage:Clone()
self.OutlineImage.ZIndex = self.ZIndex + 2
self.OutlineImage.Parent = self.Object
local Value = self.BorderRadius.Value
self.OutlineImage.Image = OutlinedImages[Value]
self.OutlineImage.SliceCenter = Rect.new(Value, Value, 256 - Value, 256 - Value)
self.Janitor:Add(self.OutlineImage, "Destroy", "OutlineImage")
else
self.OutlineImage = nil
self.Janitor:Remove("OutlineImage")
end
end);
PrimaryColor3 = Typer.AssignSignature(2, Typer.Color3, function(self, PrimaryColor3)
self:rawset("PrimaryColor3", PrimaryColor3)
self:Render()
end);
SecondaryColor3 = Typer.AssignSignature(2, Typer.OptionalColor3, function(self, SecondaryColor3)
self:rawset("SecondaryColor3", SecondaryColor3)
self:Render()
end);
Visible = Typer.AssignSignature(2, Typer.Boolean, function(self, Visible)
self.Object.Visible = Visible
if Visible then
-- self.InputBegan(Invisify)
else
self.InputEnded(Invisify)
end
self:rawset("Visible", Visible)
end);
ZIndex = Typer.AssignSignature(2, Typer.Number, function(self, ZIndex)
self.Object.ZIndex = ZIndex + 1
self.TextLabel.ZIndex = ZIndex + 3
if self.TooltipObject then
self.TooltipObject.ZIndex = ZIndex + 1
self.TooltipObject.TextLabel.ZIndex = ZIndex + 2
end
if self.OutlineImage then
self.OutlineImage.ZIndex = ZIndex + 2
end
self:rawset("ZIndex", ZIndex)
end);
};
Methods = {};
Init = function(self)
self:rawset("Object", ImageButton:Clone())
self:rawset("PrimaryColor3", Color.Black)
self:rawset("SecondaryColor3", nil)
self:rawset("Font", Enum.Font.SourceSansSemibold)
self:rawset("TextSize", 16)
self.TextLabel = self.Object.TextLabel
self.Rippler = PseudoInstance.new("Rippler")
self.Rippler.RippleTransparency = 0.68
self.Rippler.Parent = self.Object
self.Style = Enumeration.ButtonStyle.Flat
self.BorderRadius = 4
self.Tooltip = ""
self.Text = ""
self.ZIndex = 1
self.TextTransparency = 0
self.Janitor:Add(self.Object, "Destroy")
self.Janitor:Add(self.TextLabel, "Destroy")
self.Janitor:Add(self.Rippler, "Destroy")
local Int = 0
local IsHovered = false
self.RegisteredRippleInputs = {}
function self.InputBegan(InputObject)
local Signal = self.RegisteredRippleInputs[InputObject.UserInputType.Value]
if Signal then
Signal.IsDown = true
self.Rippler:Down(InputObject.Position.X, InputObject.Position.Y)
if self.Style == Enumeration.ButtonStyle.Contained then
self.Shadow:ChangeElevation(RAISED_ELEVATION)
end
elseif InputObject.UserInputType == MouseMovement then
IsHovered = true
if self.Style == Enumeration.ButtonStyle.Contained then
Tween(self.Object, "ImageColor3", self.PrimaryColor3:Lerp(self.Rippler.RippleColor3, self.OverlayOpacity), Enumeration.EasingFunction.Deceleration, 0.1, true)
else
Tween(self.Object, "ImageTransparency", 1 - self.OverlayOpacity, Enumeration.EasingFunction.Deceleration, 0.1, true)
end
local TooltipObj = self.TooltipObject
if TooltipObj then
-- Over 150ms, tooltips fade in and scale up using the deceleration curve. They fade out over 75ms.
local NewInt = Int + 1
Int = NewInt
delay(0.5, function()
if NewInt == Int then
Tween(TooltipObj, "Size", UDim2.new(0, TooltipObj.TextLabel.TextBounds.X + 16, 0, 24), Enumeration.EasingFunction.Deceleration, 0.1, true)
Tween(TooltipObj, "ImageTransparency", 0.1, Enumeration.EasingFunction.Deceleration, 0.1, true)
Tween(TooltipObj.TextLabel, "TextTransparency", 0, Enumeration.EasingFunction.Deceleration, 0.1, true)
end
end)
end
end
end
function self.InputEnded(InputObject)
local UserInputType = InputObject.UserInputType
self.Rippler:Up()
local Signal = self.RegisteredRippleInputs[UserInputType.Value]
if Signal and Signal.IsDown then
Signal.IsDown = false
Signal:Fire()
end
if self.Style == Enumeration.ButtonStyle.Contained then
self.Shadow:ChangeElevation(self.Elevation)
end
if UserInputType == MouseMovement then
for _, EventSignal in next, self.RegisteredRippleInputs do
EventSignal.IsDown = false
end
if self.Style == Enumeration.ButtonStyle.Contained then
Tween(self.Object, "ImageColor3", self.PrimaryColor3, Enumeration.EasingFunction.Deceleration, 0.1, true)
else
Tween(self.Object, "ImageTransparency", 1, Enumeration.EasingFunction.Deceleration, 0.1, true)
end
IsHovered = false
end
Int = Int + 1
local TooltipObj = self.TooltipObject
if TooltipObj then
Tween(TooltipObj, "Size", UDim2.new(), Enumeration.EasingFunction.Deceleration, 0.075, true)
Tween(TooltipObj, "ImageTransparency", 1, Enumeration.EasingFunction.Deceleration, 0.075, true)
Tween(TooltipObj.TextLabel, "TextTransparency", 1, Enumeration.EasingFunction.Deceleration, 0.075, true)
end
end
function self.InputChanged(InputObject)
if InputObject.UserInputType == MouseMovement and not IsHovered then
IsHovered = true
self.InputBegan(InputObject)
end
end
self.Disabled = false
self:superinit()
end;
})
|
-----------------------------------
-- Area: East Ronfaure
-- Mob: Pugil
-- Note: PH for Swamfisk
-----------------------------------
local ID = require("scripts/zones/East_Ronfaure/IDs")
require("scripts/globals/regimes")
require("scripts/globals/mobs")
function onMobDeath(mob, player, isKiller)
tpz.regime.checkRegime(player, mob, 64, 1, tpz.regime.type.FIELDS)
end
function onMobDespawn(mob)
tpz.mob.phOnDespawn(mob, ID.mob.SWAMFISK_PH, 7, math.random(3600, 10800)) -- 1 to 3 hours
end
|
function test_insert_wait()
local t = require "test.luaunit"
local api = require "shiori.insert_wait"
local act = [=[あつい、あつい!‥‥タスケテ。]=]
local exp = [=[あつい、\_w[400]あつい!\_w[600]‥\_w[200]‥\_w[200]タスケテ。\_w[800]]=]
t.assertEquals(api.insert_wait(act), exp)
end
|
data:extend({
{
type = "battery-equipment",
name = "uep-craft-assistent",
sprite =
{
filename = "__morebobs__/graphics/equipment/craft_assistent.png",
width = 32,
height = 32,
priority = "medium"
},
shape =
{
width = 1,
height = 1,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
},
{
type = "battery-equipment",
name = "uep-artificial-organ",
sprite =
{
filename = "__morebobs__/graphics/equipment/artificial_organ.png",
width = 32,
height = 32,
priority = "medium"
},
shape =
{
width = 1,
height = 1,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
},
{
type = "battery-equipment",
name = "uep-portable-logistic-computer",
sprite =
{
filename = "__morebobs__/graphics/equipment/portable_logistic_computer.png",
width = 32,
height = 32,
priority = "medium"
},
shape =
{
width = 1,
height = 1,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
},
{
type = "battery-equipment",
name = "uep-additional-toolbelt",
sprite =
{
filename = "__morebobs__/graphics/equipment/another_toolbelt.png",
width = 64,
height = 64,
priority = "medium"
},
shape =
{
width = 2,
height = 2,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
},
{
type = "battery-equipment",
name = "uep-armor-pocket",
sprite =
{
filename = "__morebobs__/graphics/equipment/armor-pocket.png",
width = 64,
height = 64,
priority = "medium"
},
shape =
{
width = 2,
height = 2,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
},
{
type = "battery-equipment",
name = "uep-portable-autotrash-computer",
sprite =
{
filename = "__morebobs__/graphics/equipment/portable-autotrash-computer.png",
width = 32,
height = 32,
priority = "medium"
},
shape =
{
width = 1,
height = 1,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
},
{
type = "battery-equipment",
name = "uep-combet-control-module",
sprite =
{
filename = "__morebobs__/graphics/equipment/combet-control-module.png",
width = 32,
height = 32,
priority = "medium"
},
shape =
{
width = 1,
height = 1,
type = "full"
},
energy_source =
{
type = "electric",
buffer_capacity = "100kJ",
input_flow_limit = "240kW",
drain = "100kW",
usage_priority = "primary-input"
},
energy_input = "10kW",
categories = {"armor"},
tint = {r = 0, g = 0.1, b = 0, a = 0.2}
}
})
|
package.path = '../src/?.lua;' .. package.path
local tap = require 'tapered'
-- luacheck: globals setup teardown
function setup()
print("# I'm a little teapot.")
end
tap.ok(true, "setup() only with '# I'm a little teapot.'")
function setup()
print('# This is my handle and this is my spout.')
end
function teardown()
print('# Cleanup on aisle 9!')
end
tap.ok(true, 'setup() handle and spout, teardown() cleanup on aisle 9')
function teardown()
print('# I changed this.')
end
tap.ok(true, 'setup() again handle and spout, teardown() changed')
setup = nil
teardown = nil
tap.ok(true, 'Both setup and teardown should be gone now: redefined as nil.')
tap.done()
|
local Debug = require(script.Parent.Parent.Parent.Debug)
local Typer = require(script.Parent.Parent.Parent.Typer)
local Debug_Assert = Debug.Assert
local validate = Typer.Array
local function push(list, ...)
Debug_Assert(validate(list))
local new = {}
local len = #list
for i = 1, len do
new[i] = list[i]
end
for i = 1, select("#", ...) do
new[len + i] = select(i, ...)
end
return new
end
return push
|
function Process (Mem,StringSize)
ASCII_diff = 32
local Pre;
local Pos;
local Counter;
flag = true
while(flag) do
flag = false
for i=1, StringSize do
Cur = Mem[i]
Pre = Mem[i-1]
Pos = Mem[i+1]
if(Cur >=97) then
Counter = Cur-ASCII_diff
else
Counter = Cur+ASCII_diff
end
if(Pre ~= nil and Pre == Counter) then
table.remove(Mem,i-1)
table.remove(Mem,i-1)
StringSize = StringSize-2
flag = true
break;
elseif (Pos ~= nil and Pos == Counter) then
table.remove(Mem,i)
table.remove(Mem,i)
StringSize = StringSize-2
flag = true
break;
end
end
--print(StringSize)
end
return StringSize
end
|
-- OPTIONS
RESET_FOR_TIME = false -- Set to true if you're trying to break the record, not just finish a run
BEAST_MODE = false -- WARNING: Do not engage. Will yolo everything, and reset at every opportunity in the quest for 1:47.
INITIAL_SPEED = 1500
AFTER_BROCK_SPEED = 1500
AFTER_MOON_SPEED = 500
E4_SPEED = 200
RESET_LOG = "./wiki/red/resets.txt"
VICTORY_LOG = "./wiki/red/victories.txt"
local CUSTOM_SEED = nil -- Set to a known seed to replay it, or leave nil for random runs
local NIDORAN_NAME = "A" -- Set this to the single character to name Nidoran (note, to replay a seed, it MUST match!)
local PAINT_ON = true -- Display contextual information while the bot runs
-- START CODE (hard hats on)
VERSION = "2.4.8"
CURRENT_SPEED = nil
local Data = require "data.data"
Data.init()
local Battle = require "action.battle"
local Textbox = require "action.textbox"
local Walk = require "action.walk"
local Combat = require "ai.combat"
local Control = require "ai.control"
local Strategies = require("ai."..Data.gameName..".strategies")
local Pokemon = require "storage.pokemon"
local Bridge = require "util.bridge"
local Input = require "util.input"
local Memory = require "util.memory"
local Paint = require "util.paint"
local Utils = require "util.utils"
local Settings = require "util.settings"
local hasAlreadyStartedPlaying = false
local oldSeconds
local running = true
local previousMap
-- HELPERS
function resetAll()
Strategies.softReset()
Combat.reset()
Control.reset()
Walk.reset()
Paint.reset()
Bridge.reset()
Utils.reset()
oldSeconds = 0
running = false
CURRENT_SPEED = INITIAL_SPEED
client.speedmode(INITIAL_SPEED)
if CUSTOM_SEED then
Data.run.seed = CUSTOM_SEED
Strategies.replay = true
p("RUNNING WITH A FIXED SEED ("..NIDORAN_NAME.." "..Data.run.seed.."), every run will play out identically!", true)
else
Data.run.seed = os.time()
print("PokeBot v"..VERSION..": "..(BEAST_MODE and "BEAST MODE seed" or "Seed:").." "..Data.run.seed)
end
math.randomseed(Data.run.seed)
end
-- EXECUTE
p("Welcome to PokeBot "..Utils.capitalize(Data.gameName).." v"..VERSION, true)
Control.init()
Utils.init()
STREAMING_MODE = true
if CUSTOM_SEED then
Strategies.reboot()
else
hasAlreadyStartedPlaying = Utils.ingame()
end
Strategies.init(hasAlreadyStartedPlaying)
if hasAlreadyStartedPlaying and RESET_FOR_TIME then
RESET_FOR_TIME = false
p("Disabling time-limit resets as the game is already running. Please reset the emulator and restart the script if you'd like to go for a fast time.", true)
end
if STREAMING_MODE then
if not CUSTOM_SEED or BEAST_MODE then
RESET_FOR_TIME = true
end
Bridge.init(Data.gameName)
else
if PAINT_ON then
Input.setDebug(true)
end
end
-- LOOP
local function generateNextInput(currentMap)
if not Utils.ingame() then
Bridge.pausegametime()
if currentMap == 0 then
if running then
if not hasAlreadyStartedPlaying then
if emu.framecount() ~= 1 then Strategies.reboot() end
hasAlreadyStartedPlaying = true
else
resetAll()
end
else
Settings.startNewAdventure()
end
else
if not running then
Bridge.liveSplit()
running = true
end
Settings.choosePlayerNames()
end
else
Bridge.time()
Utils.splitCheck()
local battleState = Memory.value("game", "battle")
Control.encounter(battleState)
local curr_hp = Combat.hp()
Combat.updateHP(curr_hp)
if curr_hp == 0 and not Control.canDie() and Pokemon.index(0) > 0 then
Strategies.death(currentMap)
elseif Walk.strategy then
if Strategies.execute(Walk.strategy) then
if Walk.traverse(currentMap) == false then
return generateNextInput(currentMap)
end
end
elseif battleState > 0 then
if not Control.shouldCatch() then
Battle.automate()
end
elseif Textbox.handle() then
if Walk.traverse(currentMap) == false then
return generateNextInput(currentMap)
end
end
end
end
while true do
local currentMap = Memory.value("game", "map")
if currentMap ~= previousMap then
Input.clear()
previousMap = currentMap
end
if Strategies.frames then
if Memory.value("game", "battle") == 0 then
Strategies.frames = Strategies.frames + 1
end
Utils.drawText(0, 80, Strategies.frames)
end
if Bridge.polling then
Settings.pollForResponse(NIDORAN_NAME)
end
if not Input.update() then
generateNextInput(currentMap)
end
if STREAMING_MODE then
local newSeconds = Memory.value("time", "seconds")
if newSeconds ~= oldSeconds and (newSeconds > 0 or Memory.value("time", "frames") > 0) then
Bridge.time(Utils.elapsedTime())
oldSeconds = newSeconds
end
elseif PAINT_ON then
Paint.draw(currentMap)
end
Input.advance()
emu.frameadvance()
end
Bridge.close()
|
local system = require "system"
local logger = require "logger"
local s = system.query("simpledb")
if s then
system.exit()
else
system.register(system.self(), "simpledb")
end
local db = { }
local CMD = { }
function CMD.set(key, value)
local last = db[key]
db[key] = value
return last
end
function CMD.get(key)
return db[key]
end
function CMD.ping()
return "pong"
end
while true do
system.receive {
[{"lua"}] = function(type, pattern, ref, source, f, ...)
assert(pattern == "call")
logger.info("simpledb command", f, ...)
local func = CMD[string.lower(f)]
local rets = {nil, "no value"}
if func then
rets = {func(...)}
end
system.send(source, type, "resp", ref, system.self(), table.unpack(rets))
end
}
end
|
--------------------------------------------------------------------------
-- Crytek Source File.
-- Copyright (C), Crytek Studios, 2001-2007.
--------------------------------------------------------------------------
-- $Id$
-- $DateTime$
-- Description: Elevator
--
--------------------------------------------------------------------------
-- History:
-- - 28:1:2007 : Created by Marcio Martins
--
--------------------------------------------------------------------------
Elevator =
{
Properties =
{
soclasses_SmartObjectClass = "Elevator",
objModel = "objects/box.cgf",
Sounds =
{
soundSoundOnStart = "",
soundSoundOnMove = "",
soundSoundOnStop = "",
},
bAutomatic = 0,
nFloorCount = 2,
fFloorHeight = 5,
nInitialFloor = 0,
nDestinationFloor = 1,
Slide =
{
fSpeed = 1.0,
fAcceleration = 1.0,
sAxis = "z",
fStopTime = 0.75
},
},
Editor={
Icon = "elevator.bmp",
IconOnTop=1,
},
Server = {},
Client = {},
}
Net.Expose {
Class = Elevator,
ClientMethods = {
ClSlide = { RELIABLE_UNORDERED, POST_ATTACH, INT8, BOOL },
ClInitMoving = { RELIABLE_UNORDERED, POST_ATTACH, VEC3, INT8, INT8, FLOAT, FLOAT },
},
ServerMethods = {
},
ServerProperties = {
},
};
----------------------------------------------------------------------------------------------------
function Elevator:OnPreFreeze(freeze, vapor)
if (freeze) then
return false; -- don't allow freezing
end
end
function Elevator:OnPropertyChange()
self:Reset();
end
function Elevator:OnReset()
self:Reset();
end
function Elevator:OnSpawn()
CryAction.CreateGameObjectForEntity(self.id);
CryAction.BindGameObjectToNetwork(self.id);
CryAction.ForceGameObjectUpdate(self.id, true);
self.isServer=CryAction.IsServer();
self.isClient=CryAction.IsClient();
self.originalpos=self:GetWorldPos();
self:Reset();
end
function Elevator:OnDestroy()
end
function Elevator:DoPhysicalize()
if (self.currModel ~= self.Properties.objModel) then
CryAction.ActivateExtensionForGameObject(self.id, "ScriptControlledPhysics", false);
self:LoadObject( 0,self.Properties.objModel );
self:Physicalize(0,PE_RIGID,{mass=0});
CryAction.ActivateExtensionForGameObject(self.id, "ScriptControlledPhysics", true);
end
self.currModel = self.Properties.objModel;
end
function Elevator:Reset()
self:Activate(0);
self:DoPhysicalize();
local initial=self.Properties.nInitialFloor;
self.floorpos={};
self.floorpos[initial]=self.originalpos;
if (self.Properties.nFloorCount>0) then
for i=0,self.Properties.nFloorCount-1 do
local pos=vecNew(self.originalpos);
local axis=self.Properties.Slide.sAxis;
local height=self.Properties.fFloorHeight;
local range=(i*height-initial*height);
local dir=g_Vectors.temp_v1;
if (axis=="X" or axis=="x") then
dir=self:GetDirectionVector(0, dir);
elseif (axis=="Y" or axis=="y") then
dir=self:GetDirectionVector(1, dir);
else
dir=self:GetDirectionVector(2, dir);
end
pos.x=pos.x+dir.x*range;
pos.y=pos.y+dir.y*range;
pos.z=pos.z+dir.z*range;
self.floorpos[i]=pos;
end
end
self.currFloor=initial;
self.goalFloor=initial;
self.nextFloor=nil;
self.automatic=self.Properties.bAutomatic~=0;
if (self.automatic) then
local min,max=self:GetLocalBBox();
self:SetTriggerBBox(min, max);
end
self:UpdateSlide(0);
self:AwakePhysics(1);
end
function Elevator.Server:OnTimer(timerId, msec)
if (timerId==1) then
if (self.automatic and (not self.resting)) then
self:Slide(self.Properties.nInitialFloor);
elseif (self.nextFloor and self.nextFloor~=self.currFloor) then
self:Slide(self.nextFloor);
self.nextFloor=nil;
end
else
if (self.automatic) then
self:Slide(self.Properties.nDestinationFloor);
end
end
end
function Elevator.Server:OnEnterArea(entity, areaId)
if (entity and entity.actor) then
self:SetTimer(0, 2000);
end
end
function Elevator:UpdateSlide(frameTime)
if (self.currFloor==self.goalFloor) then
return;
end
local currPos=self:GetWorldPos(g_Vectors.temp_v1);
local goalPos=self.floorpos[self.goalFloor];
if (vecLenSq(vecSub(goalPos, currPos))<0.001) then
self.currFloor=self.goalFloor;
self:SoundOff(self.Properties.Sounds.soundSoundOnMove);
self:Sound(self.Properties.Sounds.soundSoundOnStop);
if (self.isServer) then
if (self.automatic) then
if (self.currFloor==self.Properties.nInitialFloor) then
self.resting=true;
end
end
self:SetTimer(1, 3000);
end
self:Activate(0);
else
self.resting=false;
end
end
function Elevator.Server:OnCollision(collision)
end
function Elevator.Server:OnUpdate(frameTime)
self:UpdateSlide(frameTime);
end
function Elevator.Client:OnUpdate(fameTime)
if (not self.isServer) then
self:UpdateSlide(frameTime);
end
end
function Elevator.Server:OnInitClient(channelId)
if (self.currFloor==self.goalFloor) then
self.onClient:ClSlide(channelId, self.goalFloor, true);
else
self.onClient:ClInitMoving(channelId, self.currFloor, self.goalFloor, self.scp:GetSpeed(), self.scp:GetAcceleration());
end
end
function Elevator.Server:SvRequestSlide(userId, floor)
self:Slide(user, floor);
end
function Elevator.Client:ClSlide(floor)
if (not self.isServer) then
self:Slide(floor);
end
end
function Elevator:OnPostStep()
end
function Elevator:Slide(floor)
if (floor>=self.Properties.nFloorCount) then
floor=self.Properties.nFloorCount-1;
elseif (floor<0) then
floor=0;
end
local speed=self.scp:GetSpeed();
if (self.currFloor==floor and speed==0) then
return;
elseif (self.goalFloor==floor) then
return;
end
if (speed<=0) then
self:Sound(self.Properties.Sounds.soundSoundOnStart);
self:Sound(self.Properties.Sounds.soundSoundOnMove, true);
self.goalFloor=floor;
self.currFloor=-1;
self:Activate(1);
if (self.isServer) then
self.allClients:ClSlide(floor, false);
end
self.scp:MoveTo(self.floorpos[self.goalFloor], self:GetSpeed(), self.Properties.Slide.fSpeed, self.Properties.Slide.fAcceleration, self.Properties.Slide.fStopTime);
else
self.nextFloor=floor;
end
end
function Elevator:Sound(snd, loop)
if (not snd or snd=="") then
return;
end
if (loop and not self.soundIds) then
self.soundIds={};
end
local id=self:PlaySoundEvent(snd, g_Vectors.v000, g_Vectors.v010, SOUND_DEFAULT_3D, SOUND_SEMANTIC_MECHANIC_ENTITY);
--local id=self:PlaySoundEventEx(snd, SOUND_DEFAULT_3D, 1, g_Vectors.v000, 0, 0, SOUND_SEMANTIC_MECHANIC_ENTITY);
if (loop) then
self.soundIds[snd] = id;
end
end
function Elevator:SoundOff(snd)
if (self.soundIds and self.soundIds[snd]) then
self:StopSound(self.soundIds[snd]);
self.soundIds[snd]=nil;
end
end
function Elevator:Up(callFloor)
if (self.currFloor==callFloor) then
self:Slide(self.goalFloor+1);
else
self:Slide(callFloor);
end
end
function Elevator:Down(callFloor)
if (self.currFloor==callFloor) then
self:Slide(self.goalFloor-1);
else
self:Slide(callFloor);
end
end
function Elevator.Client:ClSlide(floor, instant)
if (not self.isServer) then
if (not instant) then
self:Slide(floor);
else
self.goalFloor=floor;
self.currFloor=floor;
self:SetWorldPos(self.floorpos[self.goalFloor]);
end
end
end
function Elevator.Client:ClInitMoving(currFloor, goalFloor, speed, acceleration)
self.currFloor=currFloor;
self.goalFloor=goalFloor;
self.scp:MoveTo(self.floorpos[self.goalFloor], speed, self.Properties.Slide.fSpeed, acceleration, self.Properties.Slide.fStopTime);
self:Activate(1);
end
|
template("tbox.console")
add_configfiles("xmake.lua")
add_configfiles("src/xmake.lua")
|
wrk.method = "POST"
wrk.headers["Content-Type"] = "application/json; charset=utf-8"
wrk.body = "{\"page_number\": 1,\"result_per_page\": 50}"
|
return {
__envname = "simple",
unpack = unpack,
setmetatable = setmetatable,
getmetatable = getmetatable,
tostring = tostring,
bit32 = bit32,
utf8 = utf8,
string = string,
tonumber = tonumber,
math = math,
select = select,
assert = assert,
print = print,
table = table,
next = next,
pairs = pairs,
_VERSION = _VERSION,
rawequal = rawequal,
error = error,
type = type,
ipairs = ipairs
}
|
local _module_0 = { }
return _module_0
|
object_tangible_loot_creature_loot_kashyyyk_loot_uwari_enzymes = object_tangible_loot_creature_loot_kashyyyk_loot_shared_uwari_enzymes:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_kashyyyk_loot_uwari_enzymes, "object/tangible/loot/creature_loot/kashyyyk_loot/uwari_enzymes.iff")
|
application = {
content = {
width = 320,
height = 480,
scale = 'letterbox',
},
license = {
google = {
key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAos1GQUs9cc5IRR1C5vP7tINM3sbYE+vw85NgUsJa2oOgP1ftzllKfVV3DgR+6iK1K4To+K3LwnR2jNRxaZyFIhf+gQju/kNFm/QUhrGf1ImX5UAOjtb0O5aJtWJ1HeIxaKsyi1XHk7Wt7DXtsUkKt5eAGhsDBhU2CvVZUw/5AEZ5I8NeK7/hRysloKhxU5zMpYF87iV0Ajmk1PGvIWb259jARTw4lP8hAskigwwEDVd1NMBohncEAiOQkffOLf2hFr4/H/sWfaBFzIqaWLwY22wg9qPAzfBFxxCxP8ICr48KsXr+rFoFt2X9X/6xE6fRqVlrDJtszy2OcPXxKVx5uQIDAQAB'
}
}
}
|
local resty_sha256 = require "resty.sha256"
local to_hex = require("resty.string").to_hex
local _M = {}
function _M.sha256(file_path)
local sha256 = resty_sha256:new()
local file, err = io.open(file_path, "rb")
if err then
return nil, err
end
repeat
local chunk = file:read(8192)
if chunk then
sha256:update(chunk)
end
until not chunk
return to_hex(sha256:final())
end
return _M
|
-- ========================================================================
-- $File: jcslove_gameobject.lua $
-- $Date: 2016-09-09 11:18:04 $
-- $Revision: 1.3.0 $
-- $Creator: Jen-Chieh Shen $
-- $Notice: See LICENSE.txt for modification and distribution information $
-- Copyright (c) 2016 by Shen, Jen-Chieh $
-- ========================================================================
-- DESCRIPTION:
local _PACKAGE = (...):match("^(.+)[%./][^%./]+") or ""
require (_PACKAGE .. '/jcslove_color')
require (_PACKAGE .. '/jcslove_sprite')
require (_PACKAGE .. '/jcslove_animation')
require (_PACKAGE .. '/jcslove_animator')
jcslove_gameobject =
{
name = nil,
shape = nil,
x = 0, -- x position
y = 0, -- y position
pivotX = 0,
pivoxY = 0,
-- TODO(jenchieh): work on composition?
velocity = nil,
sprite = nil, -- sprite buffer
animation = nil, -- single aniamtion
animator = nil, -- multiple animations
active = true, -- active or not active
color = nil
}
jcslove_gameobject.__index = jcslove_gameobject
------------------------------------------------
-- Constructor
------------------------------------------------
function jcslove_gameobject.new(init)
local newGameObject = {}
setmetatable(newGameObject, jcslove_gameobject)
-- instances
newGameObject.sprite = jcslove_sprite:new(newGameObject)
newGameObject.animation = jcslove_animation:new(newGameObject)
newGameObject.color = jcslove_color:new()
newGameObject.shape = jcslove_shape:new(newGameObject)
newGameObject.velocity =
{
x = 0,
y = 0,
}
newGameObject.animator = jcslove_animator:new(newGameObject)
-- set name to the default.
newGameObject.name = "GameObject"
return newGameObject
end
------------------------------------------------
-- Update logic
------------------------------------------------
-- @param dt: delta time
------------------------------------------------
function jcslove_gameobject:update(dt)
-- NOTE(JenChieh): if the object itself is
-- not active, pop the stack frame
if self.active == false then
return
end
-- do any logic here...
-- apply force
self.x = self.x + (dt * self.velocity.x)
self.y = self.y + (dt * self.velocity.y)
-- update animation
self.animation:update(dt)
-- update animator
self.animator:update(dt)
-- update position and offset.
self.shape:update(dt)
end
------------------------------------------------
-- Update graphics
------------------------------------------------
function jcslove_gameobject:draw()
-- NOTE(JenChieh): if the object itself is
-- not active, pop the stack frame
if self.active == false then
return
end
-- set the current color frame
self.color:draw()
if self.animator.length ~= 0 then
-- NOTE(jenchieh): "animator" have the
-- higher priority to be render.
-- draw the animator.
self.animator:draw()
elseif self.animation.frameCount ~= 0 then
-- NOTE(jenchieh): "animation" have the
-- higher priority to be render.
-- draw the animation
self.animation:draw()
elseif self.sprite ~= nil then
-- draw the sprite.
self.sprite:draw()
end
-- draw the collision shape
self.shape:draw()
end
------------------------------------------------
-- Set the collider base on the sprite
-- width/height/radius.
--
-- NOTE: Better dont do it every frame?
------------------------------------------------
-- @param tp: enum shape
-- * Rectangle
-- * Circle
------------------------------------------------
function jcslove_gameobject:AutoCollision(tp)
-- do nothing if the sprite is nil
if self.sprite == nil then
return
end
-- switch
if tp == "rect" then
self.width = self.sprite.sprite:getWidth()
self.heigt = self.sprite.sprite:getHeight()
elseif tp == "circ" then
local width = self.sprite.sprite:getWidth()
local height = self.sprite.sprite:getHeight()
local hyp = jcslove_math.PythTheo(width, height, "hyp")
self.radius = (hyp / 2)
else
jcslove_debug.Error("Shap u enter isnt the shape listed here.")
end
end
------------------------------------------------
--
------------------------------------------------
-- @param tp: rec, circ
------------------------------------------------
function jcslove_gameobject:AutoOffsetSprite(tp)
if self.sprite == nil then
return
end
if tp == "rect" then
elseif tp == "circ" then
local width = self.sprite.sprite:getWidth()
local height = self.sprite.sprite:getHeight()
self.sprite.x = width / 2
self.sprite.y = height / 2
else
jcslove_debug.Error("Shap u enter isnt the shape listed here.")
end
end
------------------------------------------------
--
------------------------------------------------
-- @param tp: rec, circ
------------------------------------------------
function jcslove_gameobject:AutoOffsetAnim(tp)
end
------------------------------------------------
-- Auto offset base on the texture priority.
------------------------------------------------
-- @param tp: rec, circ
------------------------------------------------
function jcslove_gameobject:AutoOffsetTexture(tp)
-- Offset base on the texture type.
if self.animation.frameCount ~= 0 then
jcslove_gameobject:AutoOffsetAnim(tp)
end
if self.sprite ~= nil then
jcslove_gameobject:AutoOffsetSprite(tp)
end
end
------------------------------------------------
-- Return sprite from love 2d engine.
------------------------------------------------
-- @return sprite: the sprite api/object loaded by
-- love2d engine.
--
-- NOTE: only use it when u want
-- to access the engine layer.
------------------------------------------------
function jcslove_gameobject:GetSpriteSprite()
return self.sprite.sprite
end
------------------------------------------------
-- Set the sprite into love2d engine's sprite
-- system.
--
-- NOTE: only use it when u want
-- to access the engine layer.
------------------------------------------------
-- @param spr: sprite u want to set
------------------------------------------------
function jcslove_gameobject:SetSpriteSprite(spr)
self.sprite:SetSprite(spr)
end
------------------------------------------------
-- Set the type of the shape
------------------------------------------------
-- @param tp: type of the shape. (rect/circ)
------------------------------------------------
function jcslove_gameobject:SetShapeType(tp)
self.shape.shapeType = tp
if tp ~= "circ" and
tp ~= "rect"
then
jcslove_debug.Error("Set the wrong shape for gameobject...")
end
end
------------------------------------------------
-- Return the shape
------------------------------------------------
function jcslove_gameobject:GetShapeType()
return self.shape.shapeType
end
|
#!/usr/bin/env lua
---
-- @author Gianluca Fiore
-- @copyright 2011-2020, Gianluca Fiore <forod.g@gmail.com>
--
local lfs = require("lfs")
local DIR = arg[1]
local PERCENTAGE = arg[2]
-- declare the table to contain the numeric index of files to keep
local NUMERIC_KEEPTABLE = {}
-- and the table to actually contain the filenames to keep
local KEEPTABLE = {}
-- commented because #FILETABLE will suffice when using lfs
--local FILECOUNT = string.gsub(io.popen("ls -A " .. DIR .. " | wc -l"):read("*a"), "\n", "")
-- this is commented because it's not needed with lfs
--local FILELIST = { io.popen("ls -1 " .. DIR):read("*a") }
---Generate a table with unique random integers
--@param n the number of integers to generate
--@param min the lowest number that can be randomly generated
--@param max the highest number that can be randomly generated
function unique_rand(n, min, max)
local res, buf = {}, {}
local range = max - min + 1
assert(n <= range)
-- set random seed to current date in ms
local milliseconds = io.popen("date +%N"):read("*a")
math.randomseed(milliseconds)
for i=1,n do
local r = math.random(range) - 1
range = range - 1
res[i] = (buf[r] or r) + min
buf[r] = buf[range] or range
end
return res
end
---"Setify" a table, using the items as string indices and their values
--set all true
--@param t the table to transform in a set
function table.set(t)
local u = {}
for _,v in ipairs(t) do
u[v] = true
end
return u
end
---Compare a table contents with a set (table with string index and true
--values) and return a table containing only the elements not presents
--in the set
--@param s the set
--@param t a table
function table.setcompare(s, t)
local u = {}
for _,v in ipairs(t) do
if not s[v] then
table.insert(u, v)
end
end
return u
end
-- declare a table and insert all filenames in DIR
local FILETABLE = {}
for f in lfs.dir(DIR) do
if f ~= "." and f ~= ".." then
table.insert(FILETABLE, f)
end
end
-- simple version without requiring lfs. Stops working when filenames
-- contain spaces
--for w in FILELIST[1]:gmatch("%S+") do
-- table.insert(FILETABLE, w)
--end
print("How many files do we have? ", #FILETABLE)
-- calculate the number of files to keep based on the wanted percentage
local to_keep = math.ceil(#FILETABLE / 100 * PERCENTAGE)
print("The number of files to keep is ", to_keep)
NUMERIC_KEEPTABLE = unique_rand(to_keep, 1, #FILETABLE)
for _,n in ipairs(NUMERIC_KEEPTABLE) do
table.insert(KEEPTABLE, FILETABLE[n])
end
-- change into DIR
lfs.chdir(DIR)
-- Make a set out of the table of files to keep
local set_keeptable = table.set(KEEPTABLE)
-- and generate a new table comparing the complete and the keeptable
-- tables
local to_delete_table = table.setcompare(set_keeptable, FILETABLE)
-- delete every file in the to_delete_table
for _,e in ipairs(to_delete_table) do
print("Deleting " .. e)
local status = os.execute("rm -rf " .. e)
end
|
-- Copyright (C) 2017 Alexey Kopytov <akopytov@gmail.com>
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-- ----------------------------------------------------------------------
-- SQL API
-- ----------------------------------------------------------------------
ffi = require("ffi")
sysbench.sql = {}
ffi.cdef[[
/*
The following definitions have been copied with modifications from db_driver.h
*/
typedef enum
{
DB_ERROR_NONE, /* no error(s) */
DB_ERROR_IGNORABLE, /* error should be ignored as defined by command
line arguments or a custom error handler */
DB_ERROR_FATAL /* non-ignorable error */
} sql_error_t;
typedef struct
{
const char *sname; /* short name */
const char *lname; /* long name */
const char opaque[?];
} sql_driver;
typedef struct {
uint32_t len; /* Value length */
const char *ptr; /* Value string */
} sql_value;
/* Result set row definition */
typedef struct
{
void *ptr; /* Driver-specific row data */
sql_value *values; /* Array of column values */
} sql_row;
/* Statistic counter types */
typedef enum
{
SB_CNT_OTHER,
SB_CNT_READ,
SB_CNT_WRITE,
SB_CNT_TRX,
SB_CNT_ERROR,
SB_CNT_RECONNECT,
SB_CNT_BYTES_READ,
SB_CNT_BYTES_WRITTEN,
SB_CNT_MAX
} sb_counter_type;
typedef struct
{
sql_error_t error; /* Driver-independent error code */
int sql_errno; /* Driver-specific error code */
const char *sql_state; /* Database-specific SQL state */
const char *sql_errmsg; /* Database-specific error message */
sql_driver *driver; /* DB driver for this connection */
const char opaque[?];
} sql_connection;
typedef struct
{
sql_connection *connection;
const char opaque[?];
} sql_statement;
/* Result set definition */
typedef struct
{
sb_counter_type counter; /* Statistical counter type */
uint32_t nrows; /* Number of affected rows */
uint32_t nfields; /* Number of fields */
sql_statement *statement; /* Pointer to prepared statement (if used) */
void *ptr; /* Pointer to driver-specific data */
sql_row row; /* Last fetched row */
} sql_result;
typedef enum
{
SQL_TYPE_NONE,
SQL_TYPE_TINYINT,
SQL_TYPE_SMALLINT,
SQL_TYPE_INT,
SQL_TYPE_BIGINT,
SQL_TYPE_FLOAT,
SQL_TYPE_DOUBLE,
SQL_TYPE_TIME,
SQL_TYPE_DATE,
SQL_TYPE_DATETIME,
SQL_TYPE_TIMESTAMP,
SQL_TYPE_CHAR,
SQL_TYPE_VARCHAR
} sql_bind_type_t;
typedef struct
{
sql_bind_type_t type;
void *buffer;
unsigned long *data_len;
unsigned long max_len;
char *is_null;
} sql_bind;
sql_driver *db_create(const char *);
int db_destroy(sql_driver *drv);
sql_connection *db_connection_create(sql_driver * drv);
int db_connection_close(sql_connection *con);
int db_connection_reconnect(sql_connection *con);
void db_connection_free(sql_connection *con);
int db_bulk_insert_init(sql_connection *, const char *, size_t);
int db_bulk_insert_next(sql_connection *, const char *, size_t);
int db_bulk_insert_done(sql_connection *);
sql_result *db_query(sql_connection *con, const char *query, size_t len);
sql_row *db_fetch_row(sql_result *rs);
sql_statement *db_prepare(sql_connection *con, const char *query, size_t len);
int db_bind_param(sql_statement *stmt, sql_bind *params, size_t len);
int db_bind_result(sql_statement *stmt, sql_bind *results, size_t len);
sql_result *db_execute(sql_statement *stmt);
int db_close(sql_statement *stmt);
int db_free_results(sql_result *);
]]
local sql_driver = ffi.typeof('sql_driver *')
local sql_connection = ffi.typeof('sql_connection *')
local sql_statement = ffi.typeof('sql_statement *')
local sql_bind = ffi.typeof('sql_bind');
local sql_result = ffi.typeof('sql_result');
local sql_value = ffi.typeof('sql_value');
local sql_row = ffi.typeof('sql_row');
sysbench.sql.type =
{
NONE = ffi.C.SQL_TYPE_NONE,
TINYINT = ffi.C.SQL_TYPE_TINYINT,
SMALLINT = ffi.C.SQL_TYPE_SMALLINT,
INT = ffi.C.SQL_TYPE_INT,
BIGINT = ffi.C.SQL_TYPE_BIGINT,
FLOAT = ffi.C.SQL_TYPE_FLOAT,
DOUBLE = ffi.C.SQL_TYPE_DOUBLE,
TIME = ffi.C.SQL_TYPE_TIME,
DATE = ffi.C.SQL_TYPE_DATE,
DATETIME = ffi.C.SQL_TYPE_DATETIME,
TIMESTAMP = ffi.C.SQL_TYPE_TIMESTAMP,
CHAR = ffi.C.SQL_TYPE_CHAR,
VARCHAR = ffi.C.SQL_TYPE_VARCHAR
}
-- Initialize a given SQL driver and return a handle to it to create
-- connections. A nil driver name (i.e. no function argument) initializes the
-- default driver, i.e. the one specified with --db-driver on the command line.
function sysbench.sql.driver(driver_name)
local drv = ffi.C.db_create(driver_name)
if (drv == nil) then
error("failed to initialize the DB driver", 2)
end
return ffi.gc(drv, ffi.C.db_destroy)
end
-- sql_driver methods
local driver_methods = {}
function driver_methods.connect(self)
local con = ffi.C.db_connection_create(self)
if con == nil then
error("connection creation failed", 2)
end
return ffi.gc(con, ffi.C.db_connection_free)
end
function driver_methods.name(self)
return ffi.string(self.sname)
end
-- sql_driver metatable
local driver_mt = {
__index = driver_methods,
__gc = ffi.C.db_destroy,
__tostring = function() return '<sql_driver>' end,
}
ffi.metatype("sql_driver", driver_mt)
-- sql_connection methods
local connection_methods = {}
function connection_methods.disconnect(self)
return assert(ffi.C.db_connection_close(self) == 0)
end
function connection_methods.reconnect(self)
return assert(ffi.C.db_connection_reconnect(self) == 0)
end
function connection_methods.check_error(self, rs, query)
if rs ~= nil or self.error == sysbench.sql.error.NONE then
return rs
end
if self.sql_state == nil or self.sql_errmsg == nil then
-- It must be an API error, don't bother trying to downgrade it an
-- ignorable error
error("SQL API error", 3)
end
local sql_state = ffi.string(self.sql_state)
local sql_errmsg = ffi.string(self.sql_errmsg)
-- Create an error descriptor containing connection, failed query, SQL error
-- number, state and error message provided by the SQL driver
errdesc = {
connection = self,
query = query,
sql_errno = self.sql_errno,
sql_state = sql_state,
sql_errmsg = sql_errmsg
}
-- Check if the error has already been marked as ignorable by the driver, or
-- there is an error hook that allows downgrading it to IGNORABLE
if (self.error == sysbench.sql.error.FATAL and
type(sysbench.hooks.sql_error_ignorable) == "function" and
sysbench.hooks.sql_error_ignorable(errdesc)) or
self.error == sysbench.sql.error.IGNORABLE
then
-- Throw a 'restart event' exception that can be caught by the user script
-- to do some extra steps to restart a transaction (e.g. reprepare
-- statements after a reconnect). Otherwise it will be caught by
-- thread_run() in sysbench.lua, in which case the entire current event
-- will be restarted without extra processing.
errdesc.errcode = sysbench.error.RESTART_EVENT
error(errdesc, 3)
end
-- Just throw a regular error message on a fatal error
error(string.format("SQL error, errno = %d, state = '%s': %s",
self.sql_errno, sql_state, sql_errmsg), 2)
end
function connection_methods.query(self, query)
local rs = ffi.C.db_query(self, query, #query)
return self:check_error(rs, query)
end
function connection_methods.bulk_insert_init(self, query)
return assert(ffi.C.db_bulk_insert_init(self, query, #query) == 0,
"db_bulk_insert_init() failed")
end
function connection_methods.bulk_insert_next(self, val)
return assert(ffi.C.db_bulk_insert_next(self, val, #val) == 0,
"db_bulk_insert_next() failed")
end
function connection_methods.bulk_insert_done(self)
return assert(ffi.C.db_bulk_insert_done(self) == 0,
"db_bulk_insert_done() failed")
end
function connection_methods.prepare(self, query)
local stmt = ffi.C.db_prepare(self, query, #query)
if stmt == nil then
self:check_error(nil, query)
end
return stmt
end
-- A convenience wrapper around sql_connection:query() and
-- sql_result:fetch_row(). Executes the specified query and returns the first
-- row from the result set, if available, or nil otherwise
function connection_methods.query_row(self, query)
local rs = self:query(query)
if rs == nil or rs.nrows == 0 then
return nil
end
return unpack(rs:fetch_row(), 1, rs.nfields)
end
-- sql_connection metatable
local connection_mt = {
__index = connection_methods,
__tostring = function() return '<sql_connection>' end,
__gc = ffi.C.db_connection_free,
}
ffi.metatype("sql_connection", connection_mt)
-- sql_param
local sql_param = {}
function sql_param.set(self, value)
local sql_type = sysbench.sql.type
local btype = self.type
if (value == nil) then
self.is_null[0] = true
return
end
self.is_null[0] = false
if btype == sql_type.TINYINT or
btype == sql_type.SMALLINT or
btype == sql_type.INT or
btype == sql_type.BIGINT
then
self.buffer[0] = value
elseif btype == sql_type.FLOAT or
btype == sql_type.DOUBLE
then
self.buffer[1] = value
elseif btype == sql_type.CHAR or
btype == sql_type.VARCHAR
then
local len = #value
len = self.max_len < len and self.max_len or len
ffi.copy(self.buffer, value, len)
self.data_len[0] = len
else
error("Unsupported argument type: " .. btype, 2)
end
end
function sql_param.set_rand_str(self, fmt)
local sql_type = sysbench.sql.type
local btype = self.type
self.is_null[0] = false
if btype == sql_type.CHAR or
btype == sql_type.VARCHAR
then
local len = #fmt
len = self.max_len < len and self.max_len or len
ffi.C.sb_rand_str(fmt, self.buffer)
self.data_len[0] = len
else
error("Unsupported argument type: " .. btype, 2)
end
end
sql_param.__index = sql_param
sql_param.__tostring = function () return '<sql_param>' end
-- sql_statement methods
local statement_methods = {}
function statement_methods.bind_create(self, btype, max_len)
local sql_type = sysbench.sql.type
local param = setmetatable({}, sql_param)
if btype == sql_type.TINYINT or
btype == sql_type.SMALLINT or
btype == sql_type.INT or
btype == sql_type.BIGINT
then
param.type = sql_type.BIGINT
param.buffer = ffi.new('int64_t[1]')
param.max_len = 8
elseif btype == sql_type.FLOAT or
btype == sql_type.DOUBLE
then
param.type = sql_type.DOUBLE
param.buffer = ffi.new('double[1]')
param.max_len = 8
elseif btype == sql_type.CHAR or
btype == sql_type.VARCHAR
then
param.type = sql_type.VARCHAR
param.buffer = ffi.new('char[?]', max_len)
param.max_len = max_len
else
error("Unsupported argument type: " .. btype, 2)
end
param.data_len = ffi.new('unsigned long[1]')
param.is_null = ffi.new('char[1]')
return param
end
function statement_methods.bind_param(self, ...)
local len = select('#', ...)
if len < 1 then return nil end
local binds = ffi.new("sql_bind[?]", len)
local i, param
for i, param in ipairs({...}) do
binds[i-1].type = param.type
binds[i-1].buffer = param.buffer
binds[i-1].data_len = param.data_len
binds[i-1].max_len = param.max_len
binds[i-1].is_null = param.is_null
end
return ffi.C.db_bind_param(self, binds, len)
end
function statement_methods.execute(self)
local rs = ffi.C.db_execute(self)
return self.connection:check_error(rs, '<prepared statement>')
end
function statement_methods.close(self)
return ffi.C.db_close(self)
end
-- sql_statement metatable
local statement_mt = {
__index = statement_methods,
__tostring = function() return '<sql_statement>' end,
__gc = ffi.C.db_close,
}
ffi.metatype("sql_statement", statement_mt)
local bind_mt = {
__tostring = function() return '<sql_bind>' end,
}
ffi.metatype("sql_bind", bind_mt)
-- sql_result methods
local result_methods = {}
-- Returns the next row of values from a result set, or nil if there are no more
-- rows to fetch. Values are returned as an array, i.e. a table with numeric
-- indexes starting from 1. The total number of values (i.e. fields in a result
-- set) can be obtained from sql_result.nfields.
function result_methods.fetch_row(self)
local res = {}
local row = ffi.C.db_fetch_row(self)
if row == nil then
return nil
end
local i
for i = 0, self.nfields-1 do
if row.values[i].ptr ~= nil then -- not a NULL value
res[i+1] = ffi.string(row.values[i].ptr, tonumber(row.values[i].len))
end
end
return res
end
function result_methods.free(self)
return assert(ffi.C.db_free_results(self) == 0, "db_free_results() failed")
end
-- sql_results metatable
local result_mt = {
__index = result_methods,
__tostring = function() return '<sql_result>' end,
__gc = ffi.C.db_free_results
}
ffi.metatype("sql_result", result_mt)
-- error codes
sysbench.sql.error = {}
sysbench.sql.error.NONE = ffi.C.DB_ERROR_NONE
sysbench.sql.error.IGNORABLE = ffi.C.DB_ERROR_IGNORABLE
sysbench.sql.error.FATAL = ffi.C.DB_ERROR_FATAL
|
function love.conf(t)
t.title = "shovelware"
t.version = "0.10.0"
t.window.width = 1200
t.window.height = 900
t.window.fullscreen = false
t.window.fullscreentype = "desktop"
-- is msaa really needed?
t.window.msaa = 4
t.window.vsync = true
-- For Windows debugging
t.console = true
end
|
local bit = _G.jit and _G.bit or require("bit")
local openssl = require('openssl')
local pkey = openssl.pkey
local bn = openssl.bn
local digest = openssl.digest.digest
local enc, dec
-- base64 code from http://lua-users.org/wiki/BaseSixtyFour
do
-- character table string
local chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
local r, b = '', x:byte()
for i = 8, 1, -1 do
r = r .. (b % 2 ^ i - b % 2 ^ (i - 1) > 0 and '1' or '0')
end
return r;
end) .. '0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c = 0
for i = 1, 6 do
c = c + (x:sub(i, i) == '1' and 2 ^ (6 - i) or 0)
end
return chars:sub(c + 1, c + 1)
end) .. ({'', '==', '='})[#data % 3 + 1])
end
-- decoding
function dec(data)
data = string.gsub(data, '[^' .. chars .. '=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r, f = '', (chars:find(x) - 1)
for i = 6, 1, -1 do
r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and '1' or '0')
end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c = 0
for i = 1, 8 do
c = c + (x:sub(i, i) == '1' and 2 ^ (8 - i) or 0)
end
return string.char(c)
end))
end
end
local function encodePrefix(body)
if string.byte(body, 1) >= 128 then body = '\0' .. body end
local len = #body
return string.char(bit.band(bit.rshift(len, 24), 0xff)) ..
string.char(bit.band(bit.rshift(len, 16), 0xff)) ..
string.char(bit.band(bit.rshift(len, 8), 0xff)) ..
string.char(bit.band(len, 0xff)) .. body
end
local function decodePrefix(input)
local len = bit.bor(bit.lshift(string.byte(input, 1), 24),
bit.lshift(string.byte(input, 2), 16),
bit.lshift(string.byte(input, 3), 8),
string.byte(input, 4))
return string.sub(input, 5, 4 + len), string.sub(input, 5 + len)
end
-- Given two openssl.bn instances for e and n, return the ssh-rsa formatted string for public keys.
local function encode(e, n)
return encodePrefix("ssh-rsa") .. encodePrefix(e:totext()) ..
encodePrefix(n:totext())
end
-- Given a raw ssh-rsa key as a binary string, parse out e and n as openssl.bn instances
local function decode(input)
local format, e, n
format, input = decodePrefix(input)
assert(format == "ssh-rsa")
e, input = decodePrefix(input)
n, input = decodePrefix(input)
assert(input == "")
return bn.text(e), bn.text(n)
end
-- Calculate an ssh style fingerprint from raw public data
local function fingerprint(data)
local parts = {}
local hash = digest("md5", data, true)
for i = 1, #hash do
parts[i] = string.format("%02x", string.byte(hash, i))
end
return table.concat(parts, ":")
end
-- Calculate the public key data from an rsa private key file
local function loadPrivate(data)
local key = pkey.read(data, true)
local rsa = key:parse().rsa:parse()
return encode(rsa.e, rsa.n)
end
-- Extract the raw data from a public key file.
local function loadPublic(data)
data = data:match("^ssh%-rsa ([^ ]+)")
data = data and data:gsub("%s", "")
return data and dec(data)
end
local function writePublic(data) return "ssh-rsa " .. enc(data) end
local function sign(body, privateKey)
-- Extract e and n from the private RSA key to build the ssh public key
local rsa = privateKey:parse().rsa:parse()
-- Encode in ssh-rsa format
local data = encode(rsa.e, rsa.n)
-- And digest in ssh fingerprint format
local fingerprint = fingerprint(data)
-- Sign the message using a sha256 message digest
local sig = privateKey:sign(body, "sha256")
return body .. "-----BEGIN RSA SIGNATURE-----\n" ..
"Format: sha256-ssh-rsa\n" .. "Fingerprint: " .. fingerprint ..
"\n\n" .. openssl.base64(sig) .. "-----END RSA SIGNATURE-----\n"
end
local function toPublicKey(data)
-- Convert to openssl format
local e, n = decode(data)
local key = pkey.new({alg = 'rsa', n = n, e = e})
-- Make sure the encoding/decoding roudtrip worked
local rsa = key:parse().rsa:parse()
assert(rsa.e == e and rsa.n == n)
return key
end
-- Given a raw body, a raw signature (PEM encoded with metadata), and a
-- publicKey instance, verify a signature.
local function verify(body, signature, data)
local key = toPublicKey(data)
return key:verify(body, dec(signature), "sha256")
end
return {
encode = encode,
decode = decode,
fingerprint = fingerprint,
loadPrivate = loadPrivate,
loadPublic = loadPublic,
writePublic = writePublic,
sign = sign,
toPublicKey = toPublicKey,
verify = verify
}
|
local mock = require "deftest.mock.mock"
local mock_fs = require "deftest.mock.fs"
local mock_time = require "deftest.mock.time"
local file = require "googleanalytics.internal.file"
return function()
local queue
local http_history
local http_status = 200
describe("queue", function()
before(function()
http_history = {}
http_status = 200
mock.mock(http)
mock_fs.mock()
mock_time.mock()
http.request.replace(function(url, method, callback, headers, post_data, options)
table.insert(http_history, { url = url, method = method, callback = callback, headers = headers, post_data = post_data, options = options })
if callback then
callback({}, "id", { status = http_status, response = "", headers = {} })
end
end)
queue = require "googleanalytics.internal.queue"
end)
after(function()
mock.unmock(http)
mock_fs.unmock()
mock_time.unmock()
package.loaded["googleanalytics.internal.queue"] = nil
end)
it("should be able to add params", function()
queue.add("foo=bar")
end)
it("should be saving added params to disk", function()
mock_time.set(100)
local filename = file.get_save_file_name("__ga_queue")
queue.add("foo=bar")
assert(mock_fs.has_file(filename))
assert(queue.last_save_time == 100)
-- nothing will happen the next time we add something
queue.add("foo=car")
assert(queue.last_save_time == 100)
mock_time.elapse(queue.minimum_save_period)
-- and nothing will happen even if we elapsed the time
assert(queue.last_save_time == 100)
-- we need to add something more before the queue is written to disk
queue.add("foo=dar")
assert(queue.last_save_time == 100 + queue.minimum_save_period)
end)
it("should be sending added params to Google Analytics", function()
queue.add("a=b")
queue.add("c=d")
queue.add("e=f")
assert(#http_history == 0)
queue.dispatch()
assert(#http_history == 1)
assert(http_history[1].post_data == "a=b&qt=0\nc=d&qt=0\ne=f&qt=0")
end)
it("should add queue time before sending to Google Analytics", function()
mock_time.set(100)
queue.add("a=b")
mock_time.set(110)
queue.add("c=d")
mock_time.set(120)
queue.add("e=f")
mock_time.elapse(300)
queue.dispatch()
assert(#http_history == 1)
assert(http_history[1].post_data == "a=b&qt=320000\nc=d&qt=310000\ne=f&qt=300000")
end)
it("should not accept very large param strings", function()
local filename = file.get_save_file_name("__ga_queue")
-- this first very large hit should be completely ignored
local large = ("x"):rep(1 + 8 * 1024)
queue.add(large)
assert(not mock_fs.has_file(filename))
assert(not queue.last_save_time)
-- a small hit should be writte to disk
queue.add("a=b")
assert(mock_fs.has_file(filename))
assert(queue.last_save_time)
-- the small hit should be sent to Google
queue.dispatch()
assert(#http_history == 1)
assert(http_history[1].post_data == "a=b&qt=0")
end)
it("should limit the size of the total http payload", function()
local large = "a=" .. ("x"):rep(8000)
queue.add(large) -- first batch
queue.add(large) -- first batch
queue.add(large) -- second batch
queue.dispatch()
assert(#http_history == 2)
assert(http_history[1].post_data == large .. "&qt=0\n" .. large .. "&qt=0")
assert(http_history[2].post_data == large .. "&qt=0")
end)
it("should send 20 params per http request", function()
local post_data1 = {}
for i=1,20 do
queue.add("a=b")
table.insert(post_data1, "a=b&qt=0")
end
local post_data2 = {}
for i=1,10 do
queue.add("a=b")
table.insert(post_data2, "a=b&qt=0")
end
queue.dispatch()
assert(#http_history == 2)
assert(http_history[1].post_data == table.concat(post_data1, "\n"))
assert(http_history[2].post_data == table.concat(post_data2, "\n"))
end)
it("should not throw away data when http request fails", function()
queue.add("a=b")
queue.add("c=d")
queue.add("e=f")
http_status = 500
queue.dispatch()
assert(#http_history == 1)
assert(http_history[1].post_data == "a=b&qt=0\nc=d&qt=0\ne=f&qt=0")
mock_time.elapse(300)
queue.add("g=h")
http_status = 200
queue.dispatch()
assert(#http_history == 2)
assert(http_history[2].post_data == "a=b&qt=300000\nc=d&qt=300000\ne=f&qt=300000\ng=h&qt=0")
end)
end)
end
|
return require "lbi.src.lbi"
|
if script.Parent.className ~= "HopperBin" then
bin = Instance.new("HopperBin")
bin.Name = "Tool"
bin.Parent = game.Players.acb227.Backpack
script.Parent = bin
end
bin = script.Parent
me = Game.Players.acb227
arm1 = Instance.new("Weld")
arm1.Parent = me.Character["Right Arm"]
arm1.Part0 = me.Character["Right Arm"]
arm1.Part1 = me.Character.Torso
arm1.C0 = CFrame.new()
arm1.C1 = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
arm2 = Instance.new("Weld")
arm2.Parent = me.Character["Left Arm"]
arm2.Part0 = me.Character["Left Arm"]
arm2.Part1 = me.Character.Torso
arm2.C0 = CFrame.new()
arm2.C1 = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
function onButton1Down(mouse)
print("hai")
end
function KD(key, mouse)
if key ~= nil then
key:lower()
--
if key == "q" then
arm1.C1 = CFrame.new(1.5, 0.5, -0.5) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0)
arm2.C1 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.fromEulerAnglesXYZ(1.57, 0, 0)
end
if key == "e" then
arm1.C1 = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
arm2.C1 = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
end
if key == "r" then
mouse.Target:BreakJoints()
end
if key == "t" then
mouse.Target.CFrame = mouse.Target.CFrame * CFrame.new(0, 15, 0)
end
if key == "y" then
arm1.C1 = CFrame.new(1.2, 0.5, -0.5) * CFrame.fromEulerAnglesXYZ(1.37, 0, -0.5)
arm2.C1 = CFrame.new(-1.2, 0.5, -0.5) * CFrame.fromEulerAnglesXYZ(1.37, 0, 0.5)
end
if key == "u" then
arm1.C1 = CFrame.new(1.2, 0.5, -0.5) * CFrame.fromEulerAnglesXYZ(1.37, 0, -1)
arm2.C1 = CFrame.new(-1.2, 0.5, -0.5) * CFrame.fromEulerAnglesXYZ(1.37, 0, 1)
end
end
end
bin.Selected:connect(function(mouse)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.KeyDown:connect(function(key) KD(key, mouse) end)
end)
|
local mod = get_mod("rwaon_talents")
mod:hook_origin(PlayerCharacterStateStunned, "update", function (self, unit, input, dt, context, t)
local csm = self.csm
local input_extension = self.input_extension
local inventory_extension = self.inventory_extension
local status_extension = self.status_extension
local locomotion_extension = self.locomotion_extension
local world = self.world
local movement_settings_table = PlayerUnitMovementSettings.get_movement_settings_table(unit)
local first_person_extension = self.first_person_extension
self.time_in_state = self.time_in_state + dt
if CharacterStateHelper.do_common_state_transitions(status_extension, csm, "stunned") then
return
end
if CharacterStateHelper.is_ledge_hanging(world, unit, self.temp_params) then
csm:change_state("ledge_hanging", self.temp_params)
return
end
if self.end_time < t then
csm:change_state("standing")
return
end
self:queue_input(input, input_extension, inventory_extension)
local player = Managers.player:owner(unit)
local is_moving = CharacterStateHelper.has_move_input(input_extension)
if is_moving then
self.movement_speed = math.min(0.75, self.movement_speed + movement_settings_table.move_acceleration_up * dt)
elseif player and player.bot_player then
self.movement_speed = 0
else
self.movement_speed = math.max(self.movement_speed_limit, self.movement_speed - movement_settings_table.move_acceleration_down * dt)
end
local walking = input_extension:get("walk")
local move_speed = (status_extension:is_crouching() and movement_settings_table.crouch_move_speed) or (walking and movement_settings_table.walk_move_speed) or movement_settings_table.move_speed
local move_speed_multiplier = status_extension:current_move_speed_multiplier()
if walking ~= self.walking then
status_extension:set_slowed(walking)
end
move_speed = move_speed * move_speed_multiplier
move_speed = move_speed * movement_settings_table.player_speed_scale
move_speed = move_speed * self.movement_speed
local movement = Vector3(0, 0, 0)
local move_input = input_extension:get("move")
if move_input then
movement = movement + move_input
end
local move_input_controller = input_extension:get("move_controller")
if move_input_controller then
local controller_length = Vector3.length(move_input_controller)
if controller_length > 0 then
move_speed = move_speed * controller_length
end
movement = movement + move_input_controller
end
local stagger = nil
if self.next_pulse < t then
stagger = Vector3(2 * (math.random() - 0.5), 2 * (math.random() - 0.5), 0)
self.next_pulse = t + 0.2
self.last_stagger:store(stagger)
self.current_stagger_speed = 1
end
movement = movement + self.last_stagger:unbox()
self.current_stagger_speed = math.max(0, self.current_stagger_speed - movement_settings_table.move_acceleration_down * dt)
move_speed = move_speed * self.current_stagger_speed * self.movement_speed_modifier
local move_input_direction = nil
move_input_direction = Vector3.normalize(movement)
if Vector3.length(move_input_direction) == 0 then
move_input_direction = self.last_input_direction:unbox()
else
self.last_input_direction:store(move_input_direction)
end
CharacterStateHelper.move_on_ground(first_person_extension, input_extension, locomotion_extension, move_input_direction, move_speed, unit)
local move_anim_3p, _ = CharacterStateHelper.get_move_animation(locomotion_extension, input_extension, status_extension)
if move_anim_3p ~= self.move_anim_3p then
CharacterStateHelper.play_animation_event(unit, move_anim_3p)
self.move_anim_3p = move_anim_3p
end
self.walking = walking
if not csm.state_next and not locomotion_extension:is_on_ground() then
csm:change_state("falling")
return
end
local look_override = nil
if self.look_override then
look_override = self.look_override:unbox()
end
local percentage_done = self.time_in_state / self.duration
local look_sense_override = math.min(self.end_look_sense_override, math.lerp(self.start_look_sense_override, 1, percentage_done))
CharacterStateHelper.look(input_extension, self.player.viewport_name, self.first_person_extension, status_extension, self.inventory_extension, look_sense_override, look_override)
self.look_override:store(0, 0, 0)
end)
|
-- This line is needed to initialize a hotloadable game.lua module
require('module').load('game')
|
function CreateCooldownsWorldpanel(keys)
local caster = keys.caster
local target = keys.target
if caster:IsRealHero() then
target.GemOfPureSoulCooldownsWorldpanel = WorldPanels:CreateWorldPanelForTeam(caster:GetTeamNumber(), {
layout = "file://{resources}/layout/custom_game/worldpanels/abilitycooldowns.xml",
entity = target,
entityHeight = 210,
data = {hasHealthBar = not target:NoHealthBar()}
})
end
end
function RemoveCooldownsWorldpanel(keys)
local target = keys.target
if target.GemOfPureSoulCooldownsWorldpanel then
target.GemOfPureSoulCooldownsWorldpanel:Delete()
target.GemOfPureSoulCooldownsWorldpanel = nil
end
end
|
application =
{
content =
{
fps = 30,
},
}
|
// Copyright 2006-2016 Mitchell mitchell.att.foicica.com. See LICENSE.
// AWK LPeg lexer.
// Modified by Wolfgang Seeberg 2012, 2013.
var l = require('lexer');
var token, word_match = l.token, l.word_match;
var P, R, S = lpeg.P, lpeg.R, lpeg.S;
var M = {_NAME = 'awk'};
var LEFTBRACKET = '[';
var RIGHTBRACKET = ']';
var SLASH = '/';
var BACKSLASH = '\\';
var CARET = '^';
var CR = '\r';
var LF = '\n';
var CRLF = CR .. LF;
var DQUOTE = '"';
var DELIMITER_MATCHES = {['('] = ')', ['['] = ']'};
var COMPANION = {['('] = '[', ['['] = '('};
var CC = {
alnum = 1, alpha = 1, blank = 1, cntrl = 1, digit = 1, graph = 1, lower = 1,
print = 1, punct = 1, space = 1, upper = 1, xdigit = 1
};
var LastRegexEnd = 0;
var BackslashAtCommentEnd = 0;
var KW_BEFORE_RX = {
case = 1, ['do'] = 1, ['else'] = 1, exit = 1, print = 1, printf = 1,
['return'] = 1
};
var function findKeyword(input, e) {
var i = e;
while( i > 0 && input->find("^[%l]", i) ) { i -= 1; }
var w = input->sub(i + 1, e);
if( i == 0 ) {
return KW_BEFORE_RX[w] == 1;
} else if( input->find("^[%u%d_]", i) ) {
return false;
} else {
return KW_BEFORE_RX[w] == 1;
}
}
var function isRegex(input, i) {
while( i >= 1 && input->find('^[ \t]', i) ) { i -= 1; }
if( i < 1 ) { return true; }
if( input->find("^[-!%%&(*+,:;<=>?[^{|}~\f]", i) || findKeyword(input, i) ) {
return true;
} else if( input->sub(i, i) == SLASH ) {
return i != LastRegexEnd; // deals with /xx/ / /yy/.
} else if( input->find('^[]%w)."]', i) ) {
return false;
} else if( input->sub(i, i) == LF ) {
if( i == 1 ) { return true; }
i -= 1;
if( input->sub(i, i) == CR ) {
if( i == 1 ) { return true; }
i -= 1;
}
} else if( input->sub(i, i) == CR ) {
if( i == 1 ) { return true; }
i -= 1;
} else {
return false;
}
if( input->sub(i, i) == BACKSLASH && i != BackslashAtCommentEnd ) {
return isRegex(input, i - 1);
} else {
return true;
}
}
var function eatCharacterClass(input, s, e) {
var i = s;
while( i <= e ) {
if( input->find('^[\r\n]', i) ) {
return false;
} else if( input->sub(i, i + 1) == ':]' ) {
var str = input->sub(s, i - 1);
return CC[str] == 1 && i + 1;
}
i += 1;
}
return false;
}
var function eatBrackets(input, i, e) {
if( input->sub(i, i) == CARET ) { i += 1; }
if( input->sub(i, i) == RIGHTBRACKET ) { i += 1; }
while( i <= e ) {
if( input->find('^[\r\n]', i) ) {
return false;
} else if( input->sub(i, i) == RIGHTBRACKET ) {
return i;
} else if( input->sub(i, i + 1) == '[:' ) {
i = eatCharacterClass(input, i + 2, e);
if( ! i ) { return false; }
} else if( input->sub(i, i) == BACKSLASH ) {
i += 1;
if( input->sub(i, i + 1) == CRLF ) { i += 1; }
}
i += 1;
}
return false;
}
var function eatRegex(input, i) {
var e = #input;
while( i <= e ) {
if( input->find('^[\r\n]', i) ) {
return false;
} else if( input->sub(i, i) == SLASH ) {
LastRegexEnd = i;
return i;
} else if( input->sub(i, i) == LEFTBRACKET ) {
i = eatBrackets(input, i + 1, e);
if( ! i ) { return false; }
} else if( input->sub(i, i) == BACKSLASH ) {
i += 1;
if( input->sub(i, i + 1) == CRLF ) { i += 1; }
}
i += 1;
}
return false;
}
var ScanRegexResult;
var function scanGawkRegex(input, index) {
if( isRegex(input, index - 2) ) {
var i = eatRegex(input, index);
if( ! i ) {
ScanRegexResult = false;
return false;
}
var rx = input->sub(index - 1, i);
for( bs in rx->gmatch("[^\\](\\+)[BSsWwy<>`']") ) {
// /\S/ is special, but /\\S/ is not.
if( #bs % 2 == 1 ) { return i + 1; }
}
ScanRegexResult = i + 1;
} else {
ScanRegexResult = false;
}
return false;
}
// Is only called immediately after scanGawkRegex().
var function scanRegex() {
return ScanRegexResult;
}
var function scanString(input, index) {
var i = index;
var e = #input;
while( i <= e ) {
if( input->find('^[\r\n]', i) ) {
return false;
} else if( input->sub(i, i) == DQUOTE ) {
return i + 1;
} else if( input->sub(i, i) == BACKSLASH ) {
i += 1;
// l.delimited_range() doesn't handle CRLF.
if( input->sub(i, i + 1) == CRLF ) { i += 1; }
}
i += 1;
}
return false;
}
// purpose: prevent isRegex() from entering a comment line that ends with a
// backslash.
var function scanComment(input, index) {
var _, i = input->find('[^\r\n]*', index);
if( input->sub(i, i) == BACKSLASH ) { BackslashAtCommentEnd = i; }
return i + 1;
}
var function scanFieldDelimiters(input, index) {
var i = index;
var e = #input;
var left = input->sub(i - 1, i - 1);
var count = 1;
var right = DELIMITER_MATCHES[left];
var left2 = COMPANION[left];
var count2 = 0;
var right2 = DELIMITER_MATCHES[left2];
while( i <= e ) {
if( input->find('^[#\r\n]', i) ) {
return false;
} else if( input->sub(i, i) == right ) {
count -= 1;
if( count == 0 ) { return count2 == 0 && i + 1; }
} else if( input->sub(i, i) == left ) {
count += 1;
} else if( input->sub(i, i) == right2 ) {
count2 -= 1;
if( count2 < 0 ) { return false; }
} else if( input->sub(i, i) == left2 ) {
count2 += 1;
} else if( input->sub(i, i) == DQUOTE ) {
i = scanString(input, i + 1);
if( ! i ) { return false; }
i -= 1;
} else if( input->sub(i, i) == SLASH ) {
if( isRegex(input, i - 1) ) {
i = eatRegex(input, i + 1);
if( ! i ) { return false; }
}
} else if( input->sub(i, i) == BACKSLASH ) {
if( input->sub(i + 1, i + 2) == CRLF ) {
i += 2;
} else if( input->find('^[\r\n]', i + 1) ) {
i += 1;
}
}
i += 1;
}
return false;
}
// Whitespace.
var ws = token(l.WHITESPACE, l.space**1);
// Comments.
var comment = token(l.COMMENT, '#' * P(scanComment));
// Strings.
var string = token(l.STRING, DQUOTE * P(scanString));
// Regular expressions.
// Slash delimited regular expressions are preceded by most operators or
// the keywords 'print' and 'case', possibly on a preceding line. They
// can contain unescaped slashes and brackets in brackets. Some escape
// sequences like '\S', '\s' have special meanings with Gawk. Tokens that
// contain them are displayed differently.
var regex = token(l.REGEX, SLASH * P(scanRegex));
var gawkRegex = token('gawkRegex', SLASH * P(scanGawkRegex));
// no leading sign because it might be binary.
var float = ((l.digit ** 1 * ('.' * l.digit ** 0) ** -1) +
('.' * l.digit ** 1)) * (S('eE') * S('+-') ** -1 * l.digit ** 1) ** -1;
// Numbers.
var number = token(l.NUMBER, float);
var gawkNumber = token('gawkNumber', l.hex_num + l.oct_num);
// Operators.
var operator = token(l.OPERATOR, S('!%&()*+,-/:;<=>?[\\]^{|}~'));
var gawkOperator = token('gawkOperator', P("|&") + "@" + "**=" + "**");
// Fields. E.g. $1, $a, $(x), $a(x), $a[x], $"1", $$a, etc.
var field = token('field', P('$') * S('$+-') ** 0 *
(float + (l.word ** 0 * '(' * P(scanFieldDelimiters)) +
(l.word ** 1 * ('[' * P(scanFieldDelimiters)) ** -1) +
('"' * P(scanString)) + ('/' * P(eatRegex) * '/')));
// Functions.
var func = token(l.FUNCTION, l.word * #P('('));
// Identifiers.
var identifier = token(l.IDENTIFIER, l.word);
// Keywords.
var keyword = token(l.KEYWORD, word_match({
'BEGIN', 'END', 'atan2', 'break', 'close', 'continue', 'cos', 'delete', 'do',
'else', 'exit', 'exp', 'fflush', 'for', 'function', 'getline', 'gsub', 'if',
'in', 'index', 'int', 'length', 'log', 'match', 'next', 'nextfile', 'print',
'printf', 'rand', 'return', 'sin', 'split', 'sprintf', 'sqrt', 'srand', 'sub',
'substr', 'system', 'tolower', 'toupper', 'while'
}));
var gawkKeyword = token('gawkKeyword', word_match({
'BEGINFILE', 'ENDFILE', 'adump', 'and', 'asort', 'asorti', 'bindtextdomain',
'case', 'compl', 'dcgettext', 'dcngettext', 'default', 'extension', 'func',
'gensub', 'include', 'isarray', 'load', 'lshift', 'mktime', 'or', 'patsplit',
'rshift', 'stopme', 'strftime', 'strtonum', 'switch', 'systime', 'xor'
}));
var builtInVariable = token('builtInVariable', word_match({
'ARGC', 'ARGV', 'CONVFMT', 'ENVIRON', 'FILENAME', 'FNR', 'FS', 'NF', 'NR',
'OFMT', 'OFS', 'ORS', 'RLENGTH', 'RS', 'RSTART', 'SUBSEP'
}));
var gawkBuiltInVariable = token('gawkBuiltInVariable', word_match ({
'ARGIND', 'BINMODE', 'ERRNO', 'FIELDWIDTHS', 'FPAT', 'FUNCTAB', 'IGNORECASE',
'LINT', 'PREC', 'PROCINFO', 'ROUNDMODE', 'RT', 'SYMTAB', 'TEXTDOMAIN'
}));
// Within each group order matters, but the groups themselves (except the
// last) can be in any order.
M._rules = {
{'whitespace', ws},
{'comment', comment},
{'string', string},
{'field', field},
{'gawkRegex', gawkRegex},
{'regex', regex},
{'gawkOperator', gawkOperator},
{'operator', operator},
{'gawkNumber', gawkNumber},
{'number', number},
{'keyword', keyword},
{'builtInVariable', builtInVariable},
{'gawkKeyword', gawkKeyword},
{'gawkBuiltInVariable', gawkBuiltInVariable},
{'function', func},
{'identifier', identifier},
};
M._tokenstyles = {
builtInVariable = l.STYLE_CONSTANT,
default = l.STYLE_ERROR,
field = l.STYLE_LABEL,
gawkBuiltInVariable = l.STYLE_CONSTANT..',underlined',
gawkKeyword = l.STYLE_KEYWORD..',underlined',
gawkNumber = l.STYLE_NUMBER..',underlined',
gawkOperator = l.STYLE_OPERATOR..',underlined',
gawkRegex = l.STYLE_PREPROCESSOR..',underlined',
regex = l.STYLE_PREPROCESSOR
};
M._foldsymbols = {
_patterns = {'[{}]', '#'},
[l.OPERATOR] = {['{'] = 1, ['}'] = -1},
[l.COMMENT] = {['#'] = l.fold_line_comments('#')}
};
return M;
|
-- Deprecated
require 'nn'
function create_embed_model(opt, data)
print('Building the first cnn: cnn1')
local cnn1 = nn.Sequential()
-- Convolutional and pooling layers
print(opt.NOutput, opt.kernelSize)
print(opt.NOutput[1], opt.kernelSize[1])
if opt.dropout and (opt.dropoutProb[1] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[1]))
end
cnn1:add(nn.VolumetricConvolution(1, opt.NOutput[1], opt.kernelSize[1], opt.kernelSize[1], opt.kernelSize[1]))
if opt.dropout and (opt.dropoutProb[2] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[2]))
end
cnn1:add(nn.VolumetricConvolution(opt.NOutput[1], opt.NOutput[2], opt.kernelSize[2], opt.kernelSize[2], opt.kernelSize[2]))
if opt.dropout and (opt.dropoutProb[3] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[3]))
end
cnn1:add(nn.VolumetricConvolution(opt.NOutput[2], 1, opt.kernelSize[3], opt.kernelSize[3], opt.kernelSize[3]))
if opt.dropout and (opt.dropoutProb[4] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[4]))
end
cnnoutsize1 = cnn1:outside({1, (#data.imgdata)[3], (#data.imgdata)[4], (#data.imgdata)[5]})
inputSize1 = cnnoutsize1[2] * cnnoutsize1[3] * cnnoutsize1[4]
cnn1:add(nn.Collapse(4))
cnn1:add(nn.Linear(inputSize1, opt.NOutput[3]))
cnn1:add(nn.Tanh())
print('Building the second cnn: cnn2')
local cnn2 = nn.Sequential()
-- Convolutional and pooling layers
if opt.dropout and (opt.dropoutProb[1] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[1]))
end
cnn2:add(nn.VolumetricConvolution(1, opt.NOutput[1], opt.kernelSize[1], opt.kernelSize[1], opt.kernelSize[1]))
if opt.dropout and (opt.dropoutProb[2] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[2]))
end
cnn2:add(nn.VolumetricConvolution(opt.NOutput[1], opt.NOutput[2], opt.kernelSize[2], opt.kernelSize[2], opt.kernelSize[2]))
if opt.dropout and (opt.dropoutProb[3] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[3]))
end
cnn2:add(nn.VolumetricConvolution(opt.NOutput[2], 1, opt.kernelSize[3], opt.kernelSize[3], opt.kernelSize[3]))
if opt.dropout and (opt.dropoutProb[4] or 0) > 0 then
-- dropout can be useful for regularization
cnn1:add(nn.Dropout(opt.dropoutProb[4]))
end
cnnoutsize2 = cnn2:outside({1, (#data.syndata)[3], (#data.syndata)[4], (#data.syndata)[5]})
inputSize2 = cnnoutsize2[2] * cnnoutsize2[3] * cnnoutsize2[4]
cnn2:add(nn.Collapse(4))
cnn2:add(nn.Linear(inputSize2, opt.NOutput[3]))
cnn2:add(nn.Tanh())
print('Combine two CNNs to parallel Table')
pr = nn.ParallelTable()
pr:add(cnn1)
pr:add(cnn2)
embed = nn.Sequential()
embed:add(pr)
embed:add(nn.PairwiseDistance(1))
crit = nn.HingeEmbeddingCriterion(1)
return embed, crit
end
return create_model
|
local modulo = { }
function modulo.somar(x, y)
return x + y
end
return modulo
|
Minigolf.Teams = Minigolf.Teams or {}
Minigolf.Teams.All = Minigolf.Teams.All or {}
Minigolf.Teams.MenuKey = KEY_T
function Minigolf.Teams.Update(owner, name, color, password, updateID)
color = color or ColorRand();
password = password ~= "" and password or nil
local teamID = updateID or #Minigolf.Teams.All + 1
Minigolf.Teams.All[teamID] = {
Name = name,
Password = password or false,
TeamOwner = owner or false,
Index = teamID,
Color = color,
}
team.SetUp(teamID, name, color)
if(SERVER)then
Minigolf.Teams.NetworkForGame(teamID, name, color)
Minigolf.Teams.NetworkAll()
end
return teamID
end
function Minigolf.Teams.Remove(teamID)
Minigolf.Teams.All[teamID] = nil
Minigolf.Teams.NetworkAll()
end
function Minigolf.Teams.FindByID(teamID)
return Minigolf.Teams.All[teamID]
end
function Minigolf.Teams.FindByName(name)
for teamID, team in pairs(Minigolf.Teams.All) do
if(team.Name == name)then
return team
end
end
return false
end
|
require "scripts.core.item"
require "scripts.core.projectile"
require "gamemode.Spark.modifiers.modifier_status_root";
Staff_Of_Binding = class(Item)
local Z_OFFSET = 3
function Staff_Of_Binding:OnCreated ()
self:RegisterVariable("max_range", 500)
self:RegisterVariable("cast_time", 0.1)
self:RegisterVariable("cast_point", 0.0)
self:RegisterVariable("range", self:GetSpecialValue("range"))
self:RegisterVariable("speed", self:GetSpecialValue("speed"))
self:RegisterVariable("root_duration", self:GetSpecialValue("root_duration"))
self:SetCastingBehavior(CastingBehavior(CastingBehavior.UNIT_TARGET));
end
function Staff_Of_Binding:OnSpellStart ()
--AudioRequestBus.Broadcast.PlaySound("Play_sfx_hook_throw");
Debug.Log('Firing Staff_Of_Binding!')
local target = self:GetCursorTarget()
local caster = self:GetCaster()
local origin = self:GetCaster():GetPosition()
Debug.Log('Origin of Staff_Of_Binding is ' .. tostring(origin) .. ' : ' .. tostring(self:GetCaster():GetId()) .. caster:GetName())
Debug.Log('Destination is ' .. tostring(target))
local direction = (target:GetPosition() - origin)
direction.z = 0
origin.z = origin.z + Z_OFFSET
direction = direction:GetNormalized()
Debug.Log('Direction is ' .. tostring(direction))
local destination = target:GetPosition()
destination.z = destination.z + Z_OFFSET
Debug.Log('Final travel point is ' .. tostring(target))
self.projectile = Projectile({
startingPosition = origin,
targetPosition = destination,
speed = self:GetValue("speed"),
particle = "hookwars.fire_ball",
triggerRadius = 1
});
self.projectile:OnEntityEnter(function (entityId)
if entityId == self:GetCaster():GetId() then
return
end
self.targetUnit = Unit({ entityId = entityId})
self.rootModifier = self.targetUnit:AddNewModifier(target, self, "modifier_status_root", {duration = self:GetValue("root_duration")})
self.projectile:Release()
self.projectile = nil
end)
self.projectile:Fire()
end
return Staff_Of_Binding
|
---@class vm
local vm = require 'vm.vm'
local guide = require 'parser.guide'
---@class vm.runner
---@field loc parser.object
---@field mainBlock parser.object
---@field blocks table<parser.object, true>
---@field steps vm.runner.step[]
local mt = {}
mt.__index = mt
mt.index = 1
---@class parser.object
---@field _casts parser.object[]
---@class vm.runner.step
---@field type 'truthy' | 'falsy' | 'as' | 'add' | 'remove' | 'object' | 'save' | 'push' | 'merge' | 'cast'
---@field pos integer
---@field order? integer
---@field node? vm.node
---@field object? parser.object
---@field name? string
---@field cast? parser.object
---@field tag? string
---@field copy? boolean
---@field new? boolean
---@field ref1? vm.runner.step
---@field ref2? vm.runner.step
---@param filter parser.object
---@param outStep vm.runner.step
---@param blockStep vm.runner.step
function mt:_compileNarrowByFilter(filter, outStep, blockStep)
if not filter then
return
end
if filter.type == 'paren' then
if filter.exp then
self:_compileNarrowByFilter(filter.exp, outStep, blockStep)
end
return
end
if filter.type == 'unary' then
if not filter.op
or not filter[1] then
return
end
if filter.op.type == 'not' then
local exp = filter[1]
if exp.type == 'getlocal' and exp.node == self.loc then
self.steps[#self.steps+1] = {
type = 'falsy',
pos = filter.finish,
new = true,
}
self.steps[#self.steps+1] = {
type = 'truthy',
pos = filter.finish,
ref1 = outStep,
}
end
end
elseif filter.type == 'binary' then
if not filter.op
or not filter[1]
or not filter[2] then
return
end
if filter.op.type == 'and' then
local dummyStep = {
type = 'save',
copy = true,
ref1 = outStep,
pos = filter.start - 1,
}
self.steps[#self.steps+1] = dummyStep
self:_compileNarrowByFilter(filter[1], dummyStep, blockStep)
self:_compileNarrowByFilter(filter[2], dummyStep, blockStep)
end
if filter.op.type == 'or' then
self:_compileNarrowByFilter(filter[1], outStep, blockStep)
local dummyStep = {
type = 'push',
copy = true,
ref1 = outStep,
pos = filter.op.finish,
}
self.steps[#self.steps+1] = dummyStep
self:_compileNarrowByFilter(filter[2], outStep, dummyStep)
self.steps[#self.steps+1] = {
type = 'push',
tag = 'or reset',
ref1 = blockStep,
pos = filter.finish,
}
end
if filter.op.type == '=='
or filter.op.type == '~=' then
local loc, exp
for i = 1, 2 do
loc = filter[i]
if loc.type == 'getlocal' and loc.node == self.loc then
exp = filter[i % 2 + 1]
break
end
end
if not loc or not exp then
return
end
if guide.isLiteral(exp) then
if filter.op.type == '==' then
self.steps[#self.steps+1] = {
type = 'remove',
name = exp.type,
pos = filter.finish,
ref1 = outStep,
}
self.steps[#self.steps+1] = {
type = 'as',
name = exp.type,
pos = filter.finish,
new = true,
}
end
if filter.op.type == '~=' then
self.steps[#self.steps+1] = {
type = 'as',
name = exp.type,
pos = filter.finish,
ref1 = outStep,
}
self.steps[#self.steps+1] = {
type = 'remove',
name = exp.type,
pos = filter.finish,
new = true,
}
end
end
end
else
if filter.type == 'getlocal' and filter.node == self.loc then
self.steps[#self.steps+1] = {
type = 'truthy',
pos = filter.finish,
new = true,
}
self.steps[#self.steps+1] = {
type = 'falsy',
pos = filter.finish,
ref1 = outStep,
}
end
end
end
---@param block parser.object
function mt:_compileBlock(block)
if self.blocks[block] then
return
end
self.blocks[block] = true
if block == self.mainBlock then
return
end
local parentBlock = guide.getParentBlock(block)
self:_compileBlock(parentBlock)
if block.type == 'if' then
---@type vm.runner.step[]
local finals = {}
for i, childBlock in ipairs(block) do
local blockStep = {
type = 'save',
tag = 'block',
copy = true,
pos = childBlock.start,
}
local outStep = {
type = 'save',
tag = 'out',
copy = true,
pos = childBlock.start,
}
self.steps[#self.steps+1] = blockStep
self.steps[#self.steps+1] = outStep
self.steps[#self.steps+1] = {
type = 'push',
ref1 = blockStep,
pos = childBlock.start,
}
self:_compileNarrowByFilter(childBlock.filter, outStep, blockStep)
if not childBlock.hasReturn
and not childBlock.hasGoTo
and not childBlock.hasBreak then
local finalStep = {
type = 'save',
pos = childBlock.finish,
tag = 'final #' .. i,
}
finals[#finals+1] = finalStep
self.steps[#self.steps+1] = finalStep
end
self.steps[#self.steps+1] = {
type = 'push',
tag = 'reset child',
ref1 = outStep,
pos = childBlock.finish,
}
end
self.steps[#self.steps+1] = {
type = 'push',
tag = 'reset if',
pos = block.finish,
copy = true,
}
for _, final in ipairs(finals) do
self.steps[#self.steps+1] = {
type = 'merge',
ref2 = final,
pos = block.finish,
}
end
end
if block.type == 'function'
or block.type == 'while'
or block.type == 'loop'
or block.type == 'in'
or block.type == 'repeat'
or block.type == 'for' then
local savePoint = {
type = 'save',
copy = true,
pos = block.start,
}
self.steps[#self.steps+1] = {
type = 'push',
copy = true,
pos = block.start,
}
self.steps[#self.steps+1] = savePoint
self.steps[#self.steps+1] = {
type = 'push',
pos = block.finish,
ref1 = savePoint,
}
end
end
---@return parser.object[]
function mt:_getCasts()
local root = guide.getRoot(self.loc)
if not root._casts then
root._casts = {}
local docs = root.docs
for _, doc in ipairs(docs) do
if doc.type == 'doc.cast' and doc.loc then
root._casts[#root._casts+1] = doc
end
end
end
return root._casts
end
function mt:_preCompile()
local startPos = self.loc.start
local finishPos = 0
for _, ref in ipairs(self.loc.ref) do
self.steps[#self.steps+1] = {
type = 'object',
object = ref,
pos = ref.range or ref.start,
}
if ref.start > finishPos then
finishPos = ref.start
end
local block = guide.getParentBlock(ref)
self:_compileBlock(block)
end
for i, step in ipairs(self.steps) do
if step.type ~= 'object' then
step.order = i
end
end
local casts = self:_getCasts()
for _, cast in ipairs(casts) do
if cast.loc[1] == self.loc[1]
and cast.start > startPos
and cast.finish < finishPos
and guide.getLocal(self.loc, self.loc[1], cast.start) == self.loc then
self.steps[#self.steps+1] = {
type = 'cast',
cast = cast,
pos = cast.start,
}
end
end
table.sort(self.steps, function (a, b)
if a.pos == b.pos then
return (a.order or 0) < (b.order or 0)
else
return a.pos < b.pos
end
end)
end
---@param loc parser.object
---@param node vm.node
---@return vm.node
local function checkAssert(loc, node)
local parent = loc.parent
if parent.type == 'binary' then
if parent.op and (parent.op.type == '~=' or parent.op.type == '==') then
local exp
for i = 1, 2 do
if parent[i] == loc then
exp = parent[i % 2 + 1]
end
end
if exp and guide.isLiteral(exp) then
local callargs = parent.parent
if callargs.type == 'callargs'
and callargs.parent.node.special == 'assert'
and callargs[1] == parent then
if parent.op.type == '~=' then
node:remove(exp.type)
end
if parent.op.type == '==' then
node = vm.compileNode(exp)
end
end
end
end
end
if parent.type == 'callargs'
and parent.parent.node.special == 'assert'
and parent[1] == loc then
node:setTruthy()
end
return node
end
---@param callback fun(src: parser.object, node: vm.node)
function mt:launch(callback)
local topNode = vm.getNode(self.loc):copy()
for _, step in ipairs(self.steps) do
local node = step.ref1 and step.ref1.node or topNode
if step.type == 'truthy' then
if step.new then
node = node:copy()
topNode = node
end
node:setTruthy()
elseif step.type == 'falsy' then
if step.new then
node = node:copy()
topNode = node
end
node:setFalsy()
elseif step.type == 'as' then
if step.new then
topNode = vm.createNode(vm.getGlobal('type', step.name))
else
node:clear()
node:merge(vm.getGlobal('type', step.name))
end
elseif step.type == 'add' then
if step.new then
node = node:copy()
topNode = node
end
node:merge(vm.getGlobal('type', step.name))
elseif step.type == 'remove' then
if step.new then
node = node:copy()
topNode = node
end
node:remove(step.name)
elseif step.type == 'object' then
topNode = callback(step.object, node) or node
if step.object.type == 'getlocal' then
topNode = checkAssert(step.object, node)
end
elseif step.type == 'save' then
if step.copy then
node = node:copy()
end
step.node = node
elseif step.type == 'push' then
if step.copy then
node = node:copy()
end
topNode = node
elseif step.type == 'merge' then
node:merge(step.ref2.node)
elseif step.type == 'cast' then
topNode = node:copy()
for _, cast in ipairs(step.cast.casts) do
if cast.mode == '+' then
if cast.optional then
topNode:addOptional()
end
if cast.extends then
topNode:merge(vm.compileNode(cast.extends))
end
elseif cast.mode == '-' then
if cast.optional then
topNode:removeOptional()
end
if cast.extends then
topNode:removeNode(vm.compileNode(cast.extends))
end
else
if cast.extends then
topNode:clear()
topNode:merge(vm.compileNode(cast.extends))
end
end
end
end
end
end
---@param loc parser.object
---@return vm.runner
function vm.createRunner(loc)
local self = setmetatable({
loc = loc,
mainBlock = guide.getParentBlock(loc),
blocks = {},
steps = {},
}, mt)
self:_preCompile()
return self
end
|
------------------------------------------------------------------
--
-- Author: Alexey Melnichuk <alexeymelnichuck@gmail.com>
--
-- Copyright (C) 2013-2016 Alexey Melnichuk <alexeymelnichuck@gmail.com>
--
-- Licensed according to the included 'LICENCE' document
--
-- This file is part of lua-path library.
--
------------------------------------------------------------------
local lfs = require"lfs"
return require"path.lfs.impl.fs"(lfs)
|
wrk.method = "PUT"
wrk.body = '{"name":"ibm", "amount":1}'
wrk.headers["Content-Type"] = "application/json"
|
local json_encode = require("cjson.safe").encode
local tostring = tostring
local type = type
local pairs = pairs
local function serialise_obj(data)
if type(data) == "function" or type(data) == "userdata"
or type(data) == "table" then
return tostring(data)
end
return data
end
local function tab_clone_with_serialise(data)
if type(data) ~= "table" then
return data
end
local t = {}
for k, v in pairs(data) do
if type(v) == "table" then
t[serialise_obj(k)] = tab_clone_with_serialise(v)
else
t[serialise_obj(k)] = serialise_obj(v)
end
end
return t
end
return {
version = 0.1,
log = require("apisix.core.log"),
config = require("apisix.core.config_etcd"),
json = {
encode = function(data, force)
if force then
data = tab_clone_with_serialise(data)
end
return json_encode(data)
end,
decode = require("cjson.safe").decode,
},
table = require("apisix.core.table"),
request = require("apisix.core.request"),
response = require("apisix.core.response"),
typeof = require("apisix.core.typeof"),
lrucache = require("apisix.core.lrucache"),
schema = require("apisix.core.schema"),
ctx = require("apisix.core.ctx"),
tablepool= require("tablepool"),
}
|
modName = "NoRespawnGun"
respawnItemsSetting_nothing = "nothing"
respawnItemsSetting_noWeapons = "noWeapons"
respawnItemsSetting_everything = "everything"
respawnItemsSettingValues = {respawnItemsSetting_nothing, respawnItemsSetting_noWeapons, respawnItemsSetting_everything}
defaultRespawnItemsSettingValue = respawnItemsSetting_nothing
local settingNamePrefix = modName .. "-"
respawnItemsSettingName = settingNamePrefix .. "respawnItems"
|
" UNICODE
" greeks
inoremap <leader>gl <C-v>u03bb
inoremap <leader>gs <C-v>u03c3
inoremap <leader>gP <C-v>u03ac
inoremap <leader>gp <C-v>u03c6
inoremap <leader>gm <C-v>u03bc
inoremap <leader>gZ <C-v>u03a9
inoremap <leader>gz <C-v>u03c9
|
ESX = nil
TriggerEvent(Config.ESX, function(obj) ESX = obj end)
Citizen.CreateThread(function()
RegisterCommand('klar', function(source, args)
local template = '<div style="padding: 0.5vw; margin: 0.5vw; background: linear-gradient(90deg, rgba(2,0,36,0.7) 0%, rgba(0,255,38,0.7) 0%, rgba(18,77,21,0.7) 100%); border-radius: 3px;"><i class="fas fa-exclamation-circle"></i> {0}:<br> {1}</div>'
local message = "Du har inte tillåtelse att göra detta!"
local grupos = getIdentity(source)
local Players = ESX.GetPlayers()
for i = 1, #Players do
local xPlayer = ESX.GetPlayerFromId(Players[i])
local rank = xPlayer.getGroup()
if grupos.group ~= 'user' then
if (rank == "admin" or rank == "mod" or rank == "superadmin" and xPlayer.source ~= source) or xPlayer.source == source then
SendDiscordMessage('**' .. GetPlayerName(source) .. ' ' .. '(' .. source .. ')' .. '**' .. ' *' .. 'har gjort klart ett ärrende!' .. '*', 'ID: ' ..table.concat(args, " "), 65280)
TriggerClientEvent('esx-qalle-chat:sendMessage', xPlayer.source, xPlayer.source, "KLAR " .. GetPlayerName(source) .." ("..source..")", "Klar med ärendet hos id: " .. table.concat(args, " ") .. "!", template)
end
else
TriggerClientEvent('esx-qalle-chat:sendMessage', source, source, "KLAR", message, template)
end
end
end)
RegisterCommand('svara', function(source, color, msg)
local template = '<div style="padding: 0.5vw; margin: 0.5vw; background: linear-gradient(90deg, rgba(2,0,36,0.7) 0%, rgba(255,158,0,0.7) 0%, rgba(61,27,27,0.7) 100%); border-radius: 3px;"><i class="fas fa-exclamation-circle"></i> {0}:<br> {1}</div>'
local message = "Du har inte tillåtelse att göra detta!"
cm = stringsplit(msg, " ")
local tPID = tonumber(cm[2])
local names2 = GetPlayerName(tPID)
local names3 = GetPlayerName(source)
local textmsg = ""
for i=1, #cm do
if i ~= 1 and i ~=2 then
textmsg = (textmsg .. " " .. tostring(cm[i]))
end
end
TriggerClientEvent('esx-qalle-chat:sendMessage', source, source, "SVAR", " Svar skickat till:^0 " .. names2 .." ".."^0 ID: " .. tPID, template)
TriggerClientEvent('esx-qalle-chat:sendMessage', tPID, tPID, "SVAR", " Staff: " .. names2 .. " " .. "(" .. tPID .. ")" .. "^0: " .. textmsg, template)
end)
RegisterCommand('report', function(source, args, user)
local template = '<div style="padding: 0.5vw; margin: 0.5vw; background: linear-gradient(90deg, rgba(2,0,36,0.7) 0%, rgba(255,0,0,0.7) 0%, rgba(61,27,27,0.7) 100%); border-radius: 3px;"><i class="fas fa-exclamation-circle"></i> {0}:<br> {1}</div>'
local message = "Meddelande: " ..table.concat(args, " ")
if not hasCooldown then
local Players = ESX.GetPlayers()
for i = 1, #Players do
local xPlayer = ESX.GetPlayerFromId(Players[i])
local rank = xPlayer.getGroup()
if (rank == "admin" or rank == "mod" or rank == "superadmin" and xPlayer.source ~= source) or xPlayer.source == source then
TriggerClientEvent('esx-qalle-chat:sendMessage', xPlayer.source, xPlayer.source, "REPORT: " .. GetPlayerName(source) .." ("..source..")", message, template)
end
end
hasCooldown = true
SendDiscordMessage('**' .. GetPlayerName(source) .. ' ' .. '(' .. source .. ')' .. '**' .. ' *' .. 'har skickat en report!' .. '*', message, 16711680)
else
local template = '<div style="padding: 0.5vw; margin: 0.5vw; background: linear-gradient(90deg, rgba(2,0,36,0.7) 0%, rgba(255,158,0,0.7) 0%, rgba(61,27,27,0.7) 100%); border-radius: 3px;"><i class="fas fa-exclamation-circle"></i> {0}:<br> {1}</div>'
local message = "Du måste vänta 10sek innan du kan skriva i report igen!"
TriggerClientEvent('esx-qalle-chat:sendMessage', source, source, "Cooldown", message, template)
end
end, false)
end)
Citizen.CreateThread(function()
while true do
Wait(5)
if hasCooldown then
Wait(10000)
hasCooldown = false
end
end
end)
function getIdentity(source)
local identifier = GetPlayerIdentifiers(source)[1]
local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", {['@identifier'] = identifier})
if result[1] ~= nil then
local identity = result[1]
return {
identifier = identity['identifier'],
name = identity['name'],
firstname = identity['firstname'],
lastname = identity['lastname'],
dateofbirth = identity['dateofbirth'],
sex = identity['sex'],
height = identity['height'],
job = identity['job'],
group = identity['group']
}
else
return nil
end
end
function loadExistingPlayers()
TriggerEvent("es:getPlayers", function(curPlayers)
for k,v in pairs(curPlayers)do
TriggerClientEvent("reply:setGroup", v.get('source'), v.get('group'))
end
end)
end
loadExistingPlayers()
AddEventHandler('es:playerLoaded', function(Source, user)
TriggerClientEvent('reply:setGroup', Source, user.getGroup())
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
function SendDiscordMessage(textdiscord, reportMessage, color)
local embeds = {
{
type = "rich",
color = color,
title = textdiscord,
author = {
["name"] = 'Force - Report',
['icon_url'] = 'https://cdn.discordapp.com/attachments/751211990227091517/953255119401676820/force-developing.png'
},
description = reportMessage,
footer = {
icon_url = 'https://cdn.discordapp.com/attachments/751211990227091517/953255208618700820/dariman.png',
text = os.date("%d") .. "/" .. os.date("%m") .. "/" .. os.date("%Y") .. " - " .. os.date("%H") .. ":" .. os.date("%M")
}
}
}
PerformHttpRequest(Config.discordWebhook, function(err, text, headers) end, "POST", json.encode({username = "force_report", embeds = embeds}), { ["Content-Type"] = "application/json" })
end
|
-- Created by Elfansoer
--[[
Ability checklist (erase if done/checked):
- Scepter Upgrade
- Break behavior
- Linken/Reflect behavior
- Spell Immune/Invulnerable/Invisible behavior
- Illusion behavior
- Stolen behavior
]]
--------------------------------------------------------------------------------
outworld_devourer_arcane_orb_lua = class({})
LinkLuaModifier( "modifier_generic_orb_effect_lua", "lua_abilities/generic/modifier_generic_orb_effect_lua", LUA_MODIFIER_MOTION_NONE )
LinkLuaModifier( "modifier_outworld_devourer_arcane_orb_lua", "lua_abilities/outworld_devourer_arcane_orb_lua/modifier_outworld_devourer_arcane_orb_lua", LUA_MODIFIER_MOTION_NONE )
LinkLuaModifier( "modifier_outworld_devourer_arcane_orb_lua_stack", "lua_abilities/outworld_devourer_arcane_orb_lua/modifier_outworld_devourer_arcane_orb_lua_stack", LUA_MODIFIER_MOTION_NONE )
--------------------------------------------------------------------------------
-- Passive Modifier
function outworld_devourer_arcane_orb_lua:GetIntrinsicModifierName()
return "modifier_generic_orb_effect_lua"
end
--------------------------------------------------------------------------------
-- Ability Start
function outworld_devourer_arcane_orb_lua:OnSpellStart()
end
--------------------------------------------------------------------------------
-- Orb Effects
function outworld_devourer_arcane_orb_lua:GetProjectileName()
return "particles/units/heroes/hero_obsidian_destroyer/obsidian_destroyer_arcane_orb.vpcf"
end
function outworld_devourer_arcane_orb_lua:OnOrbFire( params )
-- play effects
local sound_cast = "Hero_ObsidianDestroyer.ArcaneOrb"
EmitSoundOn( sound_cast, self:GetCaster() )
end
function outworld_devourer_arcane_orb_lua:OnOrbImpact( params )
local caster = self:GetCaster()
-- get data
local duration = self:GetSpecialValueFor( "int_steal_duration" )
local steal = self:GetSpecialValueFor( "int_steal" )
local mana_pool = self:GetSpecialValueFor( "mana_pool_damage_pct" )
local radius = self:GetSpecialValueFor( "radius" )
-- precache damage
local damage = caster:GetMana() * mana_pool/100
local damageTable = {
-- victim = target,
attacker = caster,
damage = damage,
damage_type = self:GetAbilityDamageType(),
ability = self, --Optional.
}
-- ApplyDamage(damageTable)
-- find enemies
local enemies = FindUnitsInRadius(
caster:GetTeamNumber(), -- int, your team number
params.target:GetOrigin(), -- point, center point
nil, -- handle, cacheUnit. (not known)
radius, -- float, radius. or use FIND_UNITS_EVERYWHERE
DOTA_UNIT_TARGET_TEAM_ENEMY, -- int, team filter
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, -- int, type filter
0, -- int, flag filter
0, -- int, order filter
false -- bool, can grow cache
)
for _,enemy in pairs(enemies) do
-- damage
damageTable.victim = enemy
ApplyDamage( damageTable )
-- overhead event
SendOverheadEventMessage(
nil,
OVERHEAD_ALERT_BONUS_SPELL_DAMAGE,
enemy,
damageTable.damage,
nil
)
end
-- add debuff
params.target:AddNewModifier(
caster, -- player source
self, -- ability source
"modifier_outworld_devourer_arcane_orb_lua", -- modifier name
{
duration = duration,
steal = steal,
} -- kv
)
-- add buff
caster:AddNewModifier(
caster, -- player source
self, -- ability source
"modifier_outworld_devourer_arcane_orb_lua", -- modifier name
{
duration = duration,
steal = steal,
} -- kv
)
-- play effects
local sound_cast = "Hero_ObsidianDestroyer.ArcaneOrb.Impact"
EmitSoundOn( sound_cast, params.target )
end
|
require 'nvim-tree'.setup {
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = {},
auto_reload_on_write = true,
open_on_tab = false,
hijack_cursor = false,
update_cwd = false,
hijack_directories = {
enable = true,
auto_open = true,
},
renderer = {
icons = {
webdev_colors = true,
show = {
git = true,
folder = true,
file = true,
folder_arrow = true,
},
glyphs = {
default = "",
symlink = "",
git = {
deleted = "",
ignored = "",
renamed = "",
staged = "",
unmerged = "",
unstaged = "",
untracked = "",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
arrow_open = "",
arrow_closed = "",
},
},
},
indent_markers = {
enable = false,
icons = {
corner = "╰╴ ",
edge = "│ ",
none = " ",
},
},
},
diagnostics = {
enable = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
}
},
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {}
},
system_open = {
cmd = nil,
args = {}
},
filters = {
dotfiles = false,
custom = {}
},
git = {
enable = true,
ignore = true,
timeout = 500,
},
view = {
width = 30,
height = 25,
hide_root_folder = true,
side = 'right',
auto_resize = true,
mappings = {
custom_only = false,
list = {}
},
number = false,
relativenumber = false,
signcolumn = "yes"
},
trash = {
cmd = "trash",
require_confirm = true
},
actions = {
change_dir = {
global = false,
},
open_file = {
quit_on_open = true,
}
}
}
|
require("advancedLua")
local bit32 = require("bit32")
local unicode = require("unicode")
local fs = require("filesystem")
-----------------------------------------------------------------------------------------------
local module = {}
local encodingMethods = {}
local OCAFSignature = "OCAF"
local readBufferSize = 1024
local ignoredFiles = {
[".DS_Store"] = true
}
-----------------------------------------------------------------------------------------------
local function getFileList(path)
local fileList = {}
for file in fs.list(path) do
table.insert(fileList, path .. "/" .. file)
end
return fileList
end
local function readPath(archiveFileHandle)
local sizeOfSizeArray = {}
for i = 1, string.byte(archiveFileHandle:read(1)) do
table.insert(sizeOfSizeArray, string.byte(archiveFileHandle:read(1)))
end
return archiveFileHandle:read(bit32.byteArrayToNumber(sizeOfSizeArray))
end
-- Записываем путь в виде <кол-во байт для размера пути> <размер пути> <путь>
local function writePath(archiveFileHandle, path)
-- Получаем юникод-байтики названия файла или папки
local pathBytes = {}
for i = 1, unicode.len(path) do
local charBytes = { string.byte(unicode.sub(path, i, i), 1, 6) }
for j = 1, #charBytes do
table.insert(pathBytes, charBytes[j])
end
end
-- Записываем количество всякой хуйни
local bytesForCountPathBytes = bit32.numberToByteArray(#pathBytes)
archiveFileHandle:write(string.char(#bytesForCountPathBytes))
for i = 1, #bytesForCountPathBytes do
archiveFileHandle:write(string.char(bytesForCountPathBytes[i]))
end
-- Записываем путь
for i = 1, #pathBytes do
archiveFileHandle:write(string.char(pathBytes[i]))
end
end
-----------------------------------------------------------------------------------------------
encodingMethods[0] = {}
encodingMethods[0].pack = function(archiveFileHandle, fileList, localPath)
for i = 1, #fileList do
local filename = fs.name(fileList[i]) or ""
local currentLocalPath = (localPath or "") .. "/" .. filename
-- print("Writing path:", currentLocalPath)
if not ignoredFiles[filename] then
if fs.isDirectory(fileList[i]) then
archiveFileHandle:write(string.char(1))
writePath(archiveFileHandle, currentLocalPath)
local success, reason = encodingMethods[0].pack(archiveFileHandle, getFileList(fileList[i]), currentLocalPath)
if not success then
return success, reason
end
else
archiveFileHandle:write(string.char(0))
writePath(archiveFileHandle, currentLocalPath)
local fileHandle, reason = io.open(fileList[i], "rb")
if fileHandle then
-- Пишем размер файла
local fileSize = fs.size(fileList[i])
local fileSizeBytes = bit32.numberToByteArray(fileSize)
archiveFileHandle:write(string.char(#fileSizeBytes))
for i = 1, #fileSizeBytes do
archiveFileHandle:write(string.char(fileSizeBytes[i]))
end
-- Пишем содержимое
local data
while true do
data = fileHandle:read(readBufferSize)
if data then
archiveFileHandle:write(data)
else
break
end
end
fileHandle:close()
else
return false, "Failed to open file for reading: " .. tostring(reason)
end
end
end
end
return true
end
encodingMethods[0].unpack = function(archiveFileHandle, unpackPath)
while true do
local typeData = archiveFileHandle:read(1)
if typeData then
local type = string.byte(typeData)
local localPath = unpackPath .. readPath(archiveFileHandle)
-- print("Readed path:", localPath)
if type == 0 then
-- Читаем размер файлика
local sizeOfSizeArray = {}
for i = 1, string.byte(archiveFileHandle:read(1)) do
table.insert(sizeOfSizeArray, string.byte(archiveFileHandle:read(1)))
end
local fileSize = bit32.byteArrayToNumber(sizeOfSizeArray)
-- print("Readed file size:", fileSize)
-- Читаем и записываем содержимое файлика
local fileHandle, reason = io.open(localPath, "wb")
if fileHandle then
local readedCount, needToRead, data = 0
while readedCount < fileSize do
needToRead = math.min(readBufferSize, fileSize - readedCount)
fileHandle:write(archiveFileHandle:read(needToRead))
readedCount = readedCount + needToRead
end
fileHandle:close()
else
return false, "Failed to open file for writing: " .. tostring(reason)
end
else
fs.makeDirectory(localPath)
end
else
return true
end
end
end
-----------------------------------------------------------------------------------------------
module.pack = function(archivePath, fileList, encodingMethod)
local archiveFileHandle, reason = io.open(archivePath, "wb")
if archiveFileHandle then
archiveFileHandle:write(OCAFSignature)
archiveFileHandle:write(string.char(encodingMethod))
if encodingMethods[encodingMethod] then
local success, reason = encodingMethods[encodingMethod].pack(archiveFileHandle, fileList)
archiveFileHandle:close()
return success, reason
else
archiveFileHandle:close()
return false, "Encoding method " .. tostring(encodingMethod) .. " doesn't supported"
end
else
return false, "Failed to open archive file for writing: " .. tostring(reason)
end
end
module.unpack = function(archivePath, unpackPath)
local archiveFileHandle, reason = io.open(archivePath, "rb")
if archiveFileHandle then
local readedSignature = archiveFileHandle:read(#OCAFSignature)
if readedSignature == OCAFSignature then
local readedEncodingMethod = string.byte(archiveFileHandle:read(1))
if encodingMethods[readedEncodingMethod] then
local success, reason = encodingMethods[readedEncodingMethod].unpack(archiveFileHandle, unpackPath)
archiveFileHandle:close()
return success, reason
else
archiveFileHandle:close()
return false, "Encoding method " .. tostring(encodingMethod) .. " doesn't supported"
end
else
archiveFileHandle:close()
return false, "Archive signature doesn't match OCAF"
end
else
return false, "Failed to open archive file for reading: " .. tostring(reason)
end
end
-----------------------------------------------------------------------------------------------
return module
|
-----------------------------------
-- Area: Navukgo Execution Chamber
-- Mob: Karababa
-----------------------------------
require("scripts/globals/status")
local ID = require("scripts/zones/Navukgo_Execution_Chamber/IDs")
-----------------------------------
function onMobFight(mob,target)
local warp = mob:getLocalVar("warp")
local wait = mob:getLocalVar("wait")
if mob:getLocalVar("warp") == 2 and wait < os.time() then
mob:getBattlefield():lose()
end
if mob:getHPP() <= 50 and mob:getLocalVar("powerup") == 0 then
target:showText(mob,ID.text.KARABABA_ENOUGH)
target:showText(mob,ID.text.KARABABA_ROUGH)
mob:addStatusEffect(tpz.effect.MAGIC_ATK_BOOST,15,0,1800)
mob:setLocalVar("powerup",1)
elseif mob:getHPP() <= 20 and warp == 0 then
mob:setLocalVar("warp",1)
end
end
function onMonsterMagicPrepare(mob, target)
local powerup = mob:getLocalVar("powerup")
local rnd = math.random(1, 6)
local warp = mob:getLocalVar("warp")
if warp == 1 then
mob:showText(mob,ID.text.KARABABA_QUIT)
mob:setLocalVar("warp",2)
mob:setLocalVar("wait", os.time()+8)
return 261
elseif rnd == 1 then
mob:showText(mob,ID.text.KARABARA_FIRE)
return 205 - powerup
elseif rnd == 2 then
mob:showText(mob,ID.text.KARABARA_ICE)
return 207 - powerup
elseif rnd == 3 then
mob:showText(mob,ID.text.KARABARA_WIND)
return 209 - powerup
elseif rnd == 4 then
mob:showText(mob,ID.text.KARABARA_EARTH)
return 211 - powerup
elseif rnd == 5 then
mob:showText(mob,ID.text.KARABARA_LIGHTNING)
return 213 - powerup
elseif rnd == 6 then
mob:showText(mob,ID.text.KARABARA_WATER)
return 215 - powerup
end
end
function onMobDeath(mob, player, isKiller)
mob:getBattlefield():lose()
end
|
local util = require "resty.s3_util"
local s3_auth = require "resty.s3_auth"
local cjson = require "cjson"
local xml = require "resty.s3_xml"
local s3_multi_upload = require("resty.s3_multi_upload")
local ok, new_tab = pcall(require, "table.new")
if not ok then
new_tab = function (narr, nrec) return {} end
end
local function proc_uri(uri)
if uri == nil then
return nil
end
if uri and string.len(uri) > 0 and string.sub(uri, 1,1) == '/' then
uri = string.sub(uri, 2)
end
return uri
end
local get_bucket_region = nil
local _M = new_tab(0, 100)
_M._VERSION = '0.10'
local mt = { __index = _M }
function _M:new(aws_access_key, aws_secret_key, aws_bucket, args)
if not aws_access_key then
return nil, "must provide aws_access_key"
end
if not aws_secret_key then
return nil, "must provide aws_secret_key"
end
args = args or {}
local timeout = 10 * 1000
local aws_region = "us-east-1"
local ssl = false
local ssl_verify = true
if args and type(args) == 'table' then
if args.timeout then
timeout = args.timeout
end
if args.aws_region then
aws_region = args.aws_region
end
if args.ssl then
ssl = args.ssl
end
if args.ssl_verify ~= ssl_verify then
ssl_verify = args.ssl_verify
end
end
local host = args.host or (aws_bucket .. ".s3.amazonaws.com")
local aws_service = "s3"
local auth = s3_auth:new(aws_access_key, aws_secret_key, aws_bucket, aws_region, aws_service, nil)
if not args.host then
if aws_region ~= "us-east-1" then
host = aws_bucket .. ".s3" .. "-" .. aws_region .. ".amazonaws.com"
end
end
local add_bucket_to_uri = false
if not util.endswith(host, ".amazonaws.com") then
add_bucket_to_uri = true
end
return setmetatable({ auth=auth, host=host, aws_bucket=aws_bucket, add_bucket_to_uri=add_bucket_to_uri, aws_region=aws_region,timeout=timeout,ssl=ssl,ssl_verify=ssl_verify}, mt)
end
function _M:get_short_uri(key)
local short_uri = '/' .. proc_uri(key)
if self.add_bucket_to_uri then
short_uri = '/' .. self.aws_bucket .. short_uri
end
return short_uri
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html
function _M:head(key)
local short_uri = self:get_short_uri(key)
local myheaders = util.new_headers()
local authorization = self.auth:authorization_v4("HEAD", short_uri, myheaders, nil)
--ngx.log(ngx.INFO, "headers [[[", cjson.encode(myheaders), "]]]")
-- TODO: check authorization.
local url = "http://" .. self.host .. util.uri_encode(short_uri, false)
local res, err, req_debug = util.http_head(url, myheaders, self.timeout)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [", req_debug, "] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", url, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 200 then
if res.status == 404 then
ngx.log(ngx.INFO, "object [", key, "] not exist")
return false, "not-exist", res.status
else
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
end
return true, res
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGET.html
function _M:get(key)
local short_uri = self:get_short_uri(key)
local myheaders = util.new_headers()
local authorization = self.auth:authorization_v4("GET", short_uri, myheaders, nil)
--ngx.log(ngx.INFO, "headers [[[", cjson.encode(myheaders), "]]]")
-- TODO: check authorization.
local url = "http://" .. self.host .. util.uri_encode(short_uri, false)
local res, err, req_debug = util.http_get(url, myheaders, self.timeout)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [", req_debug, "] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", url, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 200 then
if res.status == 404 then
ngx.log(ngx.INFO, "object [", key, "] not exist")
return false, "not-exist", res.status
else
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
end
ngx.log(ngx.INFO, "aws returned: body:", res.body)
return true, res.body
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html
function _M:put(key, body, headers)
local short_uri = self:get_short_uri(key)
headers = headers or util.new_headers()
headers['Host'] = self.host
local authorization = self.auth:authorization_v4("PUT", short_uri, headers, body)
local url = self.host .. util.uri_encode(short_uri, false)
if self.ssl then
url = "https://" .. url
else
url = "http://" .. url
end
-- local url = "http://" .. self.host .. util.uri_encode(short_uri, false)
ngx.log(ngx.INFO, "----- url: ", url)
-- TODO: check authorization.
local res, err, req_debug = util.http_put(url, body, headers, self.timeout, self.ssl_verify)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [ ", req_debug, " ] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", req_debug, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 200 then
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
ngx.log(ngx.INFO, "aws returned: body: [", res.body, "]")
return true, res
end
-- https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
function _M:copy(key, source, headers)
headers = headers or util.new_headers()
headers["x-amz-copy-source"] = ngx.escape_uri(source)
return self:put(key, "", headers)
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html
function _M:delete(key)
local short_uri = self:get_short_uri(key)
local myheaders = util.new_headers()
local authorization = self.auth:authorization_v4("DELETE", short_uri, myheaders, nil)
--ngx.log(ngx.INFO, "headers [[[", cjson.encode(myheaders), "]]]")
-- TODO: check authorization.
local url = "http://" .. self.host .. util.uri_encode(short_uri, false)
local res, err, req_debug = util.http_del(url, myheaders, self.timeout)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [ ", req_debug, " ] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", req_debug, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 204 then
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
ngx.log(ngx.INFO, "aws returned: body: [", res.body, "]")
return true, res.body
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/multiobjectdeleteapi.html
function _M:deletes(keys, quiet)
if type(keys) ~= 'table' or #keys < 1 then
ngx.log(ngx.ERR, "args [keys] invalid!")
return false, "args-invalid"
end
local url = "http://" .. self.host .. '/?delete'
if self.add_bucket_to_uri then
url = "http://" .. self.host .. '/' .. self.aws_bucket .. '?delete'
end
local myheaders = util.new_headers()
local Object = {}
for _, key in ipairs(keys) do
table.insert(Object, {Key=key})
end
if quiet == nil then
quiet = true
end
local body = {Delete={Quiet=quiet, Object=Object}}
body = xml.dumps(body)
local content_md5 = ngx.encode_base64(ngx.md5_bin(body))
myheaders["content-md5"] = content_md5
-- ngx.log(ngx.INFO, "-----------------Content-md5:", content_md5)
local authorization = self.auth:authorization_v4("POST", url, myheaders, body)
--ngx.log(ngx.INFO, "headers [[[", cjson.encode(myheaders), "]]]")
-- TODO: check authorization.
local res, err, req_debug = util.http_post(url, body, myheaders, self.timeout)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [ ", req_debug, " ] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", req_debug, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 200 then
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
ngx.log(ngx.INFO, "aws returned: body:", res.body)
local doc, err = xml.loads(res.body)
if doc == nil then
return false, "xml-invalid", 500
end
return true, doc
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html
function _M:list(prefix, delimiter, page_size, marker)
prefix = prefix or ""
local args = {prefix=prefix}
local url = "http://" .. self.host .. "/"
if self.add_bucket_to_uri then
url = url .. self.aws_bucket
end
if delimiter then
args.delimiter = delimiter
end
if page_size then
args["max-keys"] = tostring(tonumber(page_size))
end
if marker then
args.marker = tostring(marker)
end
url = url .. "?" .. ngx.encode_args(args)
local myheaders = util.new_headers()
local authorization = self.auth:authorization_v4("GET", url, myheaders, nil)
--ngx.log(ngx.INFO, "headers [[[", cjson.encode(myheaders), "]]]")
-- TODO: check authorization.
local res, err, req_debug = util.http_get(url, myheaders, self.timeout)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [", req_debug, "] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", url, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 200 then
if res.status == 404 then
ngx.log(ngx.INFO, "object [", prefix, "] not exist")
return false, "not-exist", res.status
else
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
end
ngx.log(ngx.INFO, "aws returned: body:", res.body)
local doc, err = xml.loads(res.body)
if doc == nil then
return false, "xml-invalid", 500
end
if doc.ListBucketResult == nil then
return false, "no-list-result", 500
end
return true, doc
end
-- http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadInitiate.html
function _M:start_multi_upload(key, myheaders)
local short_uri = self:get_short_uri(key)
local url = self.host .. util.uri_encode(short_uri, false) .. "?uploads"
if self.ssl then
url = "https://" .. url
else
url = "http://" .. url
end
myheaders = myheaders or util.new_headers()
myheaders['Host'] = self.host
local authorization = self.auth:authorization_v4("POST", url, myheaders, nil)
ngx.log(ngx.INFO, "headers [", cjson.encode(myheaders), "]")
-- TODO: check authorization.
local res, err, req_debug = util.http_post(url, "", myheaders, self.timeout)
if not res then
ngx.log(ngx.ERR, "fail request to aws s3 service: [", req_debug, "] err: ", err)
return false, "request to aws s3 failed", 500
end
ngx.log(ngx.INFO, "aws s3 request:", url, ", status:", res.status, ",body:", tostring(res.body))
if res.status ~= 200 then
ngx.log(ngx.ERR, "request [ ", req_debug, " ] failed! status:", res.status, ", body:", tostring(res.body))
return false, res.body or "request to aws s3 failed", res.status
end
ngx.log(ngx.INFO, "aws returned: body:", res.body)
local doc, err = xml.loads(res.body)
if doc == nil then
return false, "xml-invalid", 500
end
if type(doc.InitiateMultipartUploadResult) ~= "table" then
return false, "xml-invalid", 500
end
local uploadResult = doc.InitiateMultipartUploadResult
local upload = s3_multi_upload:new(self.auth, self.host, self.timeout, self.ssl, self.ssl_verify, uploadResult)
return true, upload
end
function _M:authorization_v4(method, url, headers)
return self.auth:authorization_v4_internal(method, url, headers)
end
return _M
|
-- spawn.lua - wrapper around Awesome awful.spawn with fallback
-- Copyright (C) 2019 Nguyễn Gia Phong
--
-- This file is part of Vicious.
--
-- Vicious is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as
-- published by the Free Software Foundation, either version 2 of the
-- License, or (at your option) any later version.
--
-- Vicious 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 Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with Vicious. If not, see <https://www.gnu.org/licenses/>.
local status, awful = pcall(require, "awful")
if status then
local spawn = awful.spawn
function spawn.with_line_callback_with_shell(cmd, callbacks)
spawn.with_line_callback({ awful.util.shell, "-c", cmd }, callbacks)
end
return spawn
end
local io = { popen = io.popen }
-- In case the Awesome library is not available,
-- fall back to this synchronous, handicapped API.
local spawn = {}
--- Spawn a program and capture its output line by line.
-- @tparam string cmd The command.
-- @tab callbacks Table containing callbacks that should be invoked on
-- various conditions.
-- @tparam[opt] function callbacks.stdout Function that is called with each
-- line of output on stdout, e.g. `stdout(line)`.
-- @tparam[opt] function callbacks.stderr Function that is supposed to be called
-- with each line of output on stderr, but due to limitation of io.popen,
-- stderr will be discarded (sorry!).
-- @tparam[opt] function callbacks.output_done Function to call when no more
-- output is produced.
-- @tparam[opt] function callbacks.exit Function to call when the spawned
-- process exits. This function gets the exit reason and code as its
-- arguments.
-- The reason can be "exit" or "signal".
-- For "exit", the second argument is the exit code.
-- For "signal", the second argument is the signal causing process
-- termination.
-- @treturn boolean|nil true if cmd terminated successfully, or nil otherwise
function spawn.with_line_callback_with_shell(cmd, callbacks)
local stdout_callback, stdout = callbacks.stdout, io.popen(cmd)
if stdout_callback then
for line in stdout:lines() do stdout_callback(line) end
end
if callbacks.output_done then callbacks.output_done() end
local success, reason, code = stdout:close() -- this requires Lua 5.2
if callbacks.exit then callbacks.exit(reason, code) end
return success
end
--- Spawn a program and capture its output.
-- @tparam string cmd The command.
-- @tab callback Function with the following arguments
-- @tparam string callback.stdout Output on stdout.
-- @tparam string callback.stderr Output on stderr,
-- which will be an empty due to limitation of io.popen.
-- @tparam string callback.exitreason Exit reason ("exit" or "signal").
-- @tparam integer callback.exitcode Exit code (exit code or signal number,
-- depending on "exitreason").
-- @treturn boolean|nil true if cmd terminated successfully, or nil otherwise
function spawn.easy_async_with_shell(cmd, callback)
local out_stream = io.popen(cmd)
local stdout = out_stream:read("*all")
local success, reason, code = out_stream:close() -- requiring Lua 5.2
callback(stdout, "", reason, code)
return success
end
-- Since io.popen always use a shell
spawn.easy_async = spawn.easy_async_with_shell
spawn.with_line_callback = spawn.with_line_callback_with_shell
return spawn
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- TradeSkillFrame.DetailsFrame RefreshDisplay
local TradeSkillMixin = {}
local version, build, date, tocversion = GetBuildInfo()
local isShadowlands = tonumber(build) > 35700
function TradeSkillMixin:GetName()
return "TradeSkill"
end
function TradeSkillMixin:Init()
return { "ADDON_LOADED", "PLAYER_LOOT_SPEC_UPDATED" }
end
function TradeSkillMixin:ADDON_LOADED(name)
if name == "Blizzard_TradeSkillUI" then
hooksecurefunc(TradeSkillFrame.DetailsFrame, "RefreshDisplay", function (...) self:OnTradeSkillDetailsRefreshDisplay(...) end)
hooksecurefunc(TradeSkillFrame.RecipeList, "RefreshDisplay", function (...) self:OnTradeSkillRecipeListRefreshDisplay(...) end)
TradeSkillFrame.RecipeList.scrollBar:HookScript("OnValueChanged", function(...) self:OnRecipeListUpdate(...) end)
end
end
function TradeSkillMixin:PLAYER_LOOT_SPEC_UPDATED()
self:Refresh()
end
function TradeSkillMixin:SetTooltipItem(tooltip, item, locationInfo)
tooltip:SetHyperlink(item:GetItemLink())
end
function TradeSkillMixin:Refresh()
if TradeSkillFrame and TradeSkillFrame:IsShown() then
self:OnTradeSkillRecipeListRefreshDisplay(TradeSkillFrame.RecipeList)
end
end
function TradeSkillMixin:GetDisplayInfo(button, item, feature, locationInfo, options, mogStatus, bindingStatus)
return {
bindingStatus = {
shouldShow = true
},
ownIcon = {
shouldShow = true
},
otherIcon = {
shouldShow = true
},
questIcon = {
shouldShow = false
},
oldExpansionIcon = {
shouldShow = false
},
sellableIcon = {
shouldShow = false
}
}
end
function TradeSkillMixin:OnRecipeListUpdate()
self:Refresh()
end
function TradeSkillMixin:OnTradeSkillRecipeListRefreshDisplay(recipeList)
local offset = HybridScrollFrame_GetOffset(recipeList);
for i, button in ipairs(recipeList.buttons) do
local dataIndex = offset + i;
local tradeSkillInfo = recipeList.dataList[dataIndex];
if tradeSkillInfo then
if tradeSkillInfo.type == "recipe" and tradeSkillInfo.recipeID ~= nil then
local options = {
relativeFrame = button.icon,
statusProminentSize = 15,
statusOffsetX = 9,
statusOffsetY = 8,
bindingScale = 0.8,
overrideBindingPosition = "LEFT",
bindingOffsetY = 0,
bindingOffsetX = 25
}
local itemLink = C_TradeSkillUI.GetRecipeItemLink(tradeSkillInfo.recipeID);
if itemLink then
local item = CaerdonItem:CreateFromItemLink(itemLink)
CaerdonWardrobe:UpdateButton(button, item, self, {
locationKey = format("recipe%d", tradeSkillInfo.recipeID),
selectedRecipeID = tradeSkillInfo.recipeID
}, options)
else
CaerdonWardrobe:ClearButton(button)
end
else
CaerdonWardrobe:ClearButton(button)
end
else
CaerdonWardrobe:ClearButton(button)
end
end
end
function TradeSkillMixin:OnTradeSkillDetailsRefreshDisplay(detailsFrame)
local button = detailsFrame.Contents.ResultIcon
local options = {
relativeFrame = button.icon
}
if detailsFrame.selectedRecipeID then
local itemLink = C_TradeSkillUI.GetRecipeItemLink(detailsFrame.selectedRecipeID);
if itemLink then
local item = CaerdonItem:CreateFromItemLink(itemLink)
CaerdonWardrobe:UpdateButton(button, item, self, {
locationKey = format("SelectedRecipe%d", detailsFrame.selectedRecipeID),
selectedRecipeID = detailsFrame.selectedRecipeID
}, options)
else
CaerdonWardrobe:ClearButton(button)
end
else
CaerdonWardrobe:ClearButton(button)
end
end
CaerdonWardrobe:RegisterFeature(TradeSkillMixin)
|
--
-- Aliases for map generators
--
-- All mapgens
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_water_source", "default:water_source")
minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
-- Additional aliases needed for mapgen v6
minetest.register_alias("mapgen_lava_source", "default:lava_source")
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_gravel", "default:gravel")
minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
minetest.register_alias("mapgen_desert_sand", "default:desert_sand")
minetest.register_alias("mapgen_dirt_with_snow", "default:dirt_with_snow")
minetest.register_alias("mapgen_snowblock", "default:snowblock")
minetest.register_alias("mapgen_snow", "default:snow")
minetest.register_alias("mapgen_ice", "default:ice")
minetest.register_alias("mapgen_tree", "default:tree")
minetest.register_alias("mapgen_leaves", "default:leaves")
minetest.register_alias("mapgen_jogan", "default:joganfruit")
minetest.register_alias("mapgen_jungletree", "default:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
minetest.register_alias("mapgen_pine_tree", "default:pine_tree")
minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
minetest.register_alias("mapgen_cobble", "default:cobble")
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
minetest.register_alias("mapgen_mossycobble", "default:mossycobble")
minetest.register_alias("mapgen_stair_desert_stone", "stairs:stair_desert_stone")
--
-- Register ores
--
-- Mgv6
function default.register_mgv6_ores()
-- Blob ore
-- These first to avoid other ores in blobs
-- Clay
-- This first to avoid clay in sand blobs
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 0,
y_min = -15,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = -316,
octaves = 1,
persist = 0.0
},
})
-- Sand
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone", "default:desert_stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 0,
y_min = -31,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 2316,
octaves = 1,
persist = 0.0
},
})
-- Dirt
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 17676,
octaves = 1,
persist = 0.0
},
})
-- Gravel
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 766,
octaves = 1,
persist = 0.0
},
})
-- Scatter ores
-- Coal
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 9,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 8,
clust_size = 3,
y_max = 64,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 24 * 24 * 24,
clust_num_ores = 27,
clust_size = 6,
y_max = 0,
y_min = -31000,
})
-- Iron
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 12,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 7 * 7 * 7,
clust_num_ores = 5,
clust_size = 3,
y_max = 0,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 24 * 24 * 24,
clust_num_ores = 27,
clust_size = 6,
y_max = -64,
y_min = -31000,
})
-- Copper
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 4,
clust_size = 3,
y_max = -16,
y_min = -63,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_max = -64,
y_min = -31000,
})
-- Tin
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 10 * 10 * 10,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 4,
clust_size = 3,
y_max = -32,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 10 * 10 * 10,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -31000,
})
-- Gold
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 3,
clust_size = 2,
y_max = -64,
y_min = -255,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 5,
clust_size = 3,
y_max = -256,
y_min = -31000,
})
-- Mese crystal
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 14 * 14 * 14,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 18 * 18 * 18,
clust_num_ores = 3,
clust_size = 2,
y_max = -64,
y_min = -255,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 14 * 14 * 14,
clust_num_ores = 5,
clust_size = 3,
y_max = -256,
y_min = -31000,
})
-- Diamond
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_beskar",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_beskar",
wherein = "default:stone",
clust_scarcity = 17 * 17 * 17,
clust_num_ores = 4,
clust_size = 3,
y_max = -128,
y_min = -255,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_beskar",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = -256,
y_min = -31000,
})
end
-- All mapgens except mgv6
function default.register_ores()
-- Stratum ores.
-- These obviously first.
-- Silver sandstone
minetest.register_ore({
ore_type = "stratum",
ore = "default:silver_sandstone",
wherein = {"default:stone"},
clust_scarcity = 1,
y_max = 46,
y_min = 10,
noise_params = {
offset = 28,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 4,
biomes = {"cold_desert"},
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:silver_sandstone",
wherein = {"default:stone"},
clust_scarcity = 1,
y_max = 42,
y_min = 6,
noise_params = {
offset = 24,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 2,
biomes = {"cold_desert"},
})
-- Desert sandstone
minetest.register_ore({
ore_type = "stratum",
ore = "default:desert_sandstone",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
y_max = 46,
y_min = 10,
noise_params = {
offset = 28,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 4,
biomes = {"desert"},
})
minetest.register_ore({
ore_type = "stratum",
ore = "default:desert_sandstone",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
y_max = 42,
y_min = 6,
noise_params = {
offset = 24,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 2,
biomes = {"desert"},
})
-- Sandstone
minetest.register_ore({
ore_type = "stratum",
ore = "default:sandstone",
wherein = {"default:desert_stone"},
clust_scarcity = 1,
y_max = 39,
y_min = 3,
noise_params = {
offset = 21,
scale = 16,
spread = {x = 128, y = 128, z = 128},
seed = 90122,
octaves = 1,
},
stratum_thickness = 2,
biomes = {"desert"},
})
-- Blob ore.
-- These before scatter ores to avoid other ores in blobs.
-- Clay
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 0,
y_min = -15,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = -316,
octaves = 1,
persist = 0.0
},
})
-- Silver sand
minetest.register_ore({
ore_type = "blob",
ore = "default:silver_sand",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 2316,
octaves = 1,
persist = 0.0
},
})
-- Dirt
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 17676,
octaves = 1,
persist = 0.0
},
-- Only where default:dirt is present as surface material
biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
"deciduous_forest", "deciduous_forest_shore", "rainforest",
"rainforest_swamp", "floatland_coniferous_forest"}
})
-- Gravel
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_max = 31000,
y_min = -31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 766,
octaves = 1,
persist = 0.0
},
})
-- Scatter ores
-- Coal
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 9,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 8,
clust_size = 3,
y_max = 64,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 30,
clust_size = 5,
y_max = -128,
y_min = -31000,
})
-- Tin
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 10 * 10 * 10,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 4,
clust_size = 3,
y_max = -64,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_tin",
wherein = "default:stone",
clust_scarcity = 10 * 10 * 10,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -31000,
})
-- Copper
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 4,
clust_size = 3,
y_max = -64,
y_min = -127,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_copper",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -31000,
})
-- Iron
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 12,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 7 * 7 * 7,
clust_num_ores = 5,
clust_size = 3,
y_max = -128,
y_min = -255,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 12 * 12 * 12,
clust_num_ores = 29,
clust_size = 5,
y_max = -256,
y_min = -31000,
})
-- Gold
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 3,
clust_size = 2,
y_max = -256,
y_min = -511,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_gold",
wherein = "default:stone",
clust_scarcity = 13 * 13 * 13,
clust_num_ores = 5,
clust_size = 3,
y_max = -512,
y_min = -31000,
})
-- Mese crystal
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 14 * 14 * 14,
clust_num_ores = 5,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 18 * 18 * 18,
clust_num_ores = 3,
clust_size = 2,
y_max = -512,
y_min = -1023,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_mese",
wherein = "default:stone",
clust_scarcity = 14 * 14 * 14,
clust_num_ores = 5,
clust_size = 3,
y_max = -1024,
y_min = -31000,
})
-- Diamond
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_beskar",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = 31000,
y_min = 1025,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_beskar",
wherein = "default:stone",
clust_scarcity = 17 * 17 * 17,
clust_num_ores = 4,
clust_size = 3,
y_max = -1024,
y_min = -2047,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_beskar",
wherein = "default:stone",
clust_scarcity = 15 * 15 * 15,
clust_num_ores = 4,
clust_size = 3,
y_max = -2048,
y_min = -31000,
})
end
--
-- Register biomes
--
-- All mapgens except mgv6
function default.register_biomes(upper_limit)
-- Icesheet
minetest.register_biome({
name = "icesheet",
node_dust = "default:snowblock",
node_top = "default:snowblock",
depth_top = 1,
node_filler = "default:snowblock",
depth_filler = 3,
node_stone = "default:cave_ice",
node_water_top = "default:ice",
depth_water_top = 10,
node_river_water = "default:ice",
node_riverbed = "default:gravel",
depth_riverbed = 2,
node_dungeon = "default:ice",
node_dungeon_stair = "stairs:stair_ice",
y_max = upper_limit,
y_min = -8,
heat_point = 0,
humidity_point = 73,
})
minetest.register_biome({
name = "icesheet_ocean",
node_dust = "default:snowblock",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_water_top = "default:ice",
depth_water_top = 10,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -9,
y_min = -255,
heat_point = 0,
humidity_point = 73,
})
minetest.register_biome({
name = "icesheet_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 0,
humidity_point = 73,
})
-- Tundra
minetest.register_biome({
name = "tundra_highland",
node_dust = "default:snow",
node_riverbed = "default:gravel",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 47,
heat_point = 0,
humidity_point = 40,
})
minetest.register_biome({
name = "tundra",
node_top = "default:permafrost_with_stones",
depth_top = 1,
node_filler = "default:permafrost",
depth_filler = 1,
node_riverbed = "default:gravel",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 4,
y_max = 46,
y_min = 2,
heat_point = 0,
humidity_point = 40,
})
minetest.register_biome({
name = "tundra_beach",
node_top = "default:gravel",
depth_top = 1,
node_filler = "default:gravel",
depth_filler = 2,
node_riverbed = "default:gravel",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = 1,
y_min = -3,
heat_point = 0,
humidity_point = 40,
})
minetest.register_biome({
name = "tundra_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:gravel",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = -4,
y_min = -255,
heat_point = 0,
humidity_point = 40,
})
minetest.register_biome({
name = "tundra_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 0,
humidity_point = 40,
})
-- Taiga
minetest.register_biome({
name = "taiga",
node_dust = "default:snow",
node_top = "default:dirt_with_snow",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 4,
heat_point = 25,
humidity_point = 70,
})
minetest.register_biome({
name = "taiga_ocean",
node_dust = "default:snow",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = 3,
y_min = -255,
heat_point = 25,
humidity_point = 70,
})
minetest.register_biome({
name = "taiga_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 25,
humidity_point = 70,
})
-- Snowy grassland
minetest.register_biome({
name = "snowy_grassland",
node_dust = "default:snow",
node_top = "default:dirt_with_snow",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 1,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 4,
heat_point = 20,
humidity_point = 35,
})
minetest.register_biome({
name = "snowy_grassland_ocean",
node_dust = "default:snow",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = 3,
y_min = -255,
heat_point = 20,
humidity_point = 35,
})
minetest.register_biome({
name = "snowy_grassland_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 20,
humidity_point = 35,
})
-- Grassland
minetest.register_biome({
name = "grassland",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 1,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 6,
heat_point = 50,
humidity_point = 35,
})
minetest.register_biome({
name = "grassland_dunes",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = 5,
y_min = 4,
heat_point = 50,
humidity_point = 35,
})
minetest.register_biome({
name = "grassland_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 3,
y_min = -255,
heat_point = 50,
humidity_point = 35,
})
minetest.register_biome({
name = "grassland_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 50,
humidity_point = 35,
})
-- Coniferous forest
minetest.register_biome({
name = "coniferous_forest",
node_top = "default:dirt_with_coniferous_litter",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 6,
heat_point = 45,
humidity_point = 70,
})
minetest.register_biome({
name = "coniferous_forest_dunes",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = 5,
y_min = 4,
heat_point = 45,
humidity_point = 70,
})
minetest.register_biome({
name = "coniferous_forest_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 3,
y_min = -255,
heat_point = 45,
humidity_point = 70,
})
minetest.register_biome({
name = "coniferous_forest_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 45,
humidity_point = 70,
})
-- Deciduous forest
minetest.register_biome({
name = "deciduous_forest",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 1,
heat_point = 60,
humidity_point = 68,
})
minetest.register_biome({
name = "deciduous_forest_shore",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 0,
y_min = -1,
heat_point = 60,
humidity_point = 68,
})
minetest.register_biome({
name = "deciduous_forest_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = -2,
y_min = -255,
heat_point = 60,
humidity_point = 68,
})
minetest.register_biome({
name = "deciduous_forest_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 60,
humidity_point = 68,
})
-- Desert
minetest.register_biome({
name = "desert",
node_top = "default:desert_sand",
depth_top = 1,
node_filler = "default:desert_sand",
depth_filler = 1,
node_stone = "default:desert_stone",
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:desert_stone",
node_dungeon_stair = "stairs:stair_desert_stone",
y_max = upper_limit,
y_min = 4,
heat_point = 92,
humidity_point = 16,
})
minetest.register_biome({
name = "desert_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_stone = "default:desert_stone",
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:desert_stone",
node_dungeon_stair = "stairs:stair_desert_stone",
vertical_blend = 1,
y_max = 3,
y_min = -255,
heat_point = 92,
humidity_point = 16,
})
minetest.register_biome({
name = "desert_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 92,
humidity_point = 16,
})
-- Sandstone desert
minetest.register_biome({
name = "sandstone_desert",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 1,
node_stone = "default:sandstone",
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:sandstonebrick",
node_dungeon_stair = "stairs:stair_sandstone_block",
y_max = upper_limit,
y_min = 4,
heat_point = 60,
humidity_point = 0,
})
minetest.register_biome({
name = "sandstone_desert_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_stone = "default:sandstone",
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:sandstonebrick",
node_dungeon_stair = "stairs:stair_sandstone_block",
y_max = 3,
y_min = -255,
heat_point = 60,
humidity_point = 0,
})
minetest.register_biome({
name = "sandstone_desert_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 60,
humidity_point = 0,
})
-- Cold desert
minetest.register_biome({
name = "cold_desert",
node_top = "default:silver_sand",
depth_top = 1,
node_filler = "default:silver_sand",
depth_filler = 1,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 4,
heat_point = 40,
humidity_point = 0,
})
minetest.register_biome({
name = "cold_desert_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = 3,
y_min = -255,
heat_point = 40,
humidity_point = 0,
})
minetest.register_biome({
name = "cold_desert_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 40,
humidity_point = 0,
})
-- Savanna
minetest.register_biome({
name = "savanna",
node_top = "default:dry_dirt_with_dry_grass",
depth_top = 1,
node_filler = "default:dry_dirt",
depth_filler = 1,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 1,
heat_point = 89,
humidity_point = 42,
})
minetest.register_biome({
name = "savanna_shore",
node_top = "default:dry_dirt",
depth_top = 1,
node_filler = "default:dry_dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 0,
y_min = -1,
heat_point = 89,
humidity_point = 42,
})
minetest.register_biome({
name = "savanna_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = -2,
y_min = -255,
heat_point = 89,
humidity_point = 42,
})
minetest.register_biome({
name = "savanna_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 89,
humidity_point = 42,
})
-- Rainforest
minetest.register_biome({
name = "rainforest",
node_top = "default:dirt_with_rainforest_litter",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_min = 1,
heat_point = 86,
humidity_point = 65,
})
minetest.register_biome({
name = "rainforest_swamp",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 0,
y_min = -1,
heat_point = 86,
humidity_point = 65,
})
minetest.register_biome({
name = "rainforest_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_riverbed = "default:sand",
depth_riverbed = 2,
node_cave_liquid = "default:water_source",
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
vertical_blend = 1,
y_max = -2,
y_min = -255,
heat_point = 86,
humidity_point = 65,
})
minetest.register_biome({
name = "rainforest_under",
node_cave_liquid = {"default:water_source", "default:lava_source"},
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = -256,
y_min = -31000,
heat_point = 86,
humidity_point = 65,
})
end
-- Biomes for floatlands
-- TODO Temporary simple biomes to be replaced by special floatland biomes later.
function default.register_floatland_biomes(floatland_level, shadow_limit)
minetest.register_biome({
name = "floatland_grassland",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 1,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 31000,
y_min = floatland_level + 2,
heat_point = 50,
humidity_point = 25,
})
minetest.register_biome({
name = "floatland_coniferous_forest",
node_top = "default:dirt_with_coniferous_litter",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 31000,
y_min = floatland_level + 2,
heat_point = 50,
humidity_point = 75,
})
minetest.register_biome({
name = "floatland_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = floatland_level + 1,
y_min = shadow_limit,
heat_point = 50,
humidity_point = 50,
})
end
--
-- Register decorations
--
-- Mgv6
function default.register_mgv6_decorations()
-- Papyrus
minetest.register_decoration({
name = "default:papyrus",
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.3,
scale = 0.7,
spread = {x = 100, y = 100, z = 100},
seed = 354,
octaves = 3,
persist = 0.7
},
y_max = 1,
y_min = 1,
decoration = "default:papyrus",
height = 2,
height_max = 4,
spawn_by = "default:water_source",
num_spawn_by = 1,
})
-- Cacti
minetest.register_decoration({
name = "default:cactus",
deco_type = "simple",
place_on = {"default:desert_sand"},
sidelen = 16,
noise_params = {
offset = -0.012,
scale = 0.024,
spread = {x = 100, y = 100, z = 100},
seed = 230,
octaves = 3,
persist = 0.6
},
y_max = 30,
y_min = 1,
decoration = "default:cactus",
height = 3,
height_max = 4,
})
-- Long grasses
for length = 1, 5 do
minetest.register_decoration({
name = "default:grass_"..length,
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.007,
spread = {x = 100, y = 100, z = 100},
seed = 329,
octaves = 3,
persist = 0.6
},
y_max = 30,
y_min = 1,
decoration = "default:grass_"..length,
})
end
-- Dry shrubs
minetest.register_decoration({
name = "default:dry_shrub",
deco_type = "simple",
place_on = {"default:desert_sand", "default:dirt_with_snow"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.035,
spread = {x = 100, y = 100, z = 100},
seed = 329,
octaves = 3,
persist = 0.6
},
y_max = 30,
y_min = 1,
decoration = "default:dry_shrub",
param2 = 4,
})
end
-- All mapgens except mgv6
local function register_grass_decoration(offset, scale, length)
minetest.register_decoration({
name = "default:grass_" .. length,
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = offset,
scale = scale,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
y_max = 31000,
y_min = 1,
decoration = "default:grass_" .. length,
})
end
local function register_dry_grass_decoration(offset, scale, length)
minetest.register_decoration({
name = "default:dry_grass_" .. length,
deco_type = "simple",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 16,
noise_params = {
offset = offset,
scale = scale,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
decoration = "default:dry_grass_" .. length,
})
end
local function register_fern_decoration(seed, length)
minetest.register_decoration({
name = "default:fern_" .. length,
deco_type = "simple",
place_on = {"default:dirt_with_coniferous_litter"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.2,
spread = {x = 100, y = 100, z = 100},
seed = seed,
octaves = 3,
persist = 0.7
},
biomes = {"coniferous_forest", "floatland_coniferous_forest"},
y_max = 31000,
y_min = 6,
decoration = "default:fern_" .. length,
})
end
function default.register_decorations()
-- Savanna bare dirt patches.
-- Must come before all savanna decorations that are placed on dry grass.
-- Noise is similar to long dry grass noise, but scale inverted, to appear
-- where long dry grass is least dense and shortest.
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 4,
noise_params = {
offset = -1.5,
scale = -1.5,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 4,
persist = 1.0
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
decoration = "default:dry_dirt",
place_offset_y = -1,
flags = "force_placement",
})
-- Jogan tree and log
minetest.register_decoration({
name = "default:jogan_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.024,
scale = 0.015,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/jogan_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "default:jogan_log",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
place_offset_y = 1,
sidelen = 16,
noise_params = {
offset = 0.0012,
scale = 0.0007,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/jogan_log.mts",
flags = "place_center_x",
rotation = "random",
spawn_by = "default:dirt_with_grass",
num_spawn_by = 8,
})
-- Emergent jungle tree
-- Due to 32 node height, altitude is limited and prescence depends on chunksize
local chunksize = tonumber(minetest.get_mapgen_setting("chunksize"))
if chunksize >= 5 then
minetest.register_decoration({
name = "default:emergent_jungle_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_rainforest_litter"},
sidelen = 80,
noise_params = {
offset = 0.0,
scale = 0.0025,
spread = {x = 250, y = 250, z = 250},
seed = 2685,
octaves = 3,
persist = 0.7
},
biomes = {"rainforest"},
y_max = 32,
y_min = 1,
schematic = minetest.get_modpath("default") ..
"/schematics/emergent_jungle_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
place_offset_y = -4,
})
end
-- Jungle tree and log
minetest.register_decoration({
name = "default:jungle_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_rainforest_litter"},
sidelen = 80,
fill_ratio = 0.1,
biomes = {"rainforest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
-- Swamp jungle trees
minetest.register_decoration({
name = "default:jungle_tree(swamp)",
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
-- Noise tuned to place swamp trees where papyrus is absent
noise_params = {
offset = 0.0,
scale = -0.1,
spread = {x = 200, y = 200, z = 200},
seed = 354,
octaves = 1,
persist = 0.5
},
biomes = {"rainforest_swamp"},
y_max = 0,
y_min = -1,
schematic = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "default:jungle_log",
deco_type = "schematic",
place_on = {"default:dirt_with_rainforest_litter"},
place_offset_y = 1,
sidelen = 80,
fill_ratio = 0.005,
biomes = {"rainforest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/jungle_log.mts",
flags = "place_center_x",
rotation = "random",
spawn_by = "default:dirt_with_rainforest_litter",
num_spawn_by = 8,
})
-- Taiga and temperate coniferous forest pine tree, small pine tree and log
minetest.register_decoration({
name = "default:pine_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
sidelen = 16,
noise_params = {
offset = 0.010,
scale = 0.048,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts",
flags = "place_center_x, place_center_z",
})
minetest.register_decoration({
name = "default:small_pine_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
sidelen = 16,
noise_params = {
offset = 0.010,
scale = -0.048,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/small_pine_tree.mts",
flags = "place_center_x, place_center_z",
})
minetest.register_decoration({
name = "default:pine_log",
deco_type = "schematic",
place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
place_offset_y = 1,
sidelen = 80,
fill_ratio = 0.0018,
biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/pine_log.mts",
flags = "place_center_x",
rotation = "random",
spawn_by = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"},
num_spawn_by = 8,
})
-- Acacia tree and log
minetest.register_decoration({
name = "default:acacia_tree",
deco_type = "schematic",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.002,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
name = "default:acacia_log",
deco_type = "schematic",
place_on = {"default:dry_dirt_with_dry_grass"},
place_offset_y = 1,
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.001,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/acacia_log.mts",
flags = "place_center_x",
rotation = "random",
spawn_by = "default:dry_dirt_with_dry_grass",
num_spawn_by = 8,
})
-- Aspen tree and log
minetest.register_decoration({
name = "default:aspen_tree",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.0,
scale = -0.015,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/aspen_tree.mts",
flags = "place_center_x, place_center_z",
})
minetest.register_decoration({
name = "default:aspen_log",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
place_offset_y = 1,
sidelen = 16,
noise_params = {
offset = 0.0,
scale = -0.0008,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/aspen_log.mts",
flags = "place_center_x",
rotation = "random",
spawn_by = "default:dirt_with_grass",
num_spawn_by = 8,
})
-- Large cactus
minetest.register_decoration({
name = "default:large_cactus",
deco_type = "schematic",
place_on = {"default:desert_sand"},
sidelen = 16,
noise_params = {
offset = -0.0003,
scale = 0.0009,
spread = {x = 200, y = 200, z = 200},
seed = 230,
octaves = 3,
persist = 0.6
},
biomes = {"desert"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/large_cactus.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
-- Cactus
minetest.register_decoration({
name = "default:cactus",
deco_type = "simple",
place_on = {"default:desert_sand"},
sidelen = 16,
noise_params = {
offset = -0.0003,
scale = 0.0009,
spread = {x = 200, y = 200, z = 200},
seed = 230,
octaves = 3,
persist = 0.6
},
biomes = {"desert"},
y_max = 31000,
y_min = 4,
decoration = "default:cactus",
height = 2,
height_max = 5,
})
-- Papyrus
minetest.register_decoration({
name = "default:papyrus",
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
noise_params = {
offset = -0.3,
scale = 0.7,
spread = {x = 200, y = 200, z = 200},
seed = 354,
octaves = 3,
persist = 0.7
},
biomes = {"savanna_shore", "rainforest_swamp"},
y_max = 0,
y_min = 0,
schematic = minetest.get_modpath("default") .. "/schematics/papyrus.mts",
})
-- Bush
minetest.register_decoration({
name = "default:bush",
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.004,
scale = 0.01,
spread = {x = 100, y = 100, z = 100},
seed = 137,
octaves = 3,
persist = 0.7,
},
biomes = {"grassland", "deciduous_forest",
"floatland_grassland"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/bush.mts",
flags = "place_center_x, place_center_z",
})
-- Blueberry bush
minetest.register_decoration({
name = "default:blueberry_bush",
deco_type = "schematic",
place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
sidelen = 16,
noise_params = {
offset = -0.004,
scale = 0.01,
spread = {x = 100, y = 100, z = 100},
seed = 697,
octaves = 3,
persist = 0.7,
},
biomes = {"grassland", "snowy_grassland"},
y_max = 31000,
y_min = 1,
place_offset_y = 1,
schematic = minetest.get_modpath("default") .. "/schematics/blueberry_bush.mts",
flags = "place_center_x, place_center_z",
})
-- Acacia bush
minetest.register_decoration({
name = "default:acacia_bush",
deco_type = "schematic",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 16,
noise_params = {
offset = -0.004,
scale = 0.01,
spread = {x = 100, y = 100, z = 100},
seed = 90155,
octaves = 3,
persist = 0.7,
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/acacia_bush.mts",
flags = "place_center_x, place_center_z",
})
-- Pine bush
minetest.register_decoration({
name = "default:pine_bush",
deco_type = "schematic",
place_on = {"default:dirt_with_snow"},
sidelen = 16,
noise_params = {
offset = -0.004,
scale = 0.01,
spread = {x = 100, y = 100, z = 100},
seed = 137,
octaves = 3,
persist = 0.7,
},
biomes = {"taiga", "snowy_grassland"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/pine_bush.mts",
flags = "place_center_x, place_center_z",
})
-- Grasses
register_grass_decoration(-0.03, 0.09, 5)
register_grass_decoration(-0.015, 0.075, 4)
register_grass_decoration(0, 0.06, 3)
register_grass_decoration(0.015, 0.045, 2)
register_grass_decoration(0.03, 0.03, 1)
-- Dry grasses
register_dry_grass_decoration(0.01, 0.05, 5)
register_dry_grass_decoration(0.03, 0.03, 4)
register_dry_grass_decoration(0.05, 0.01, 3)
register_dry_grass_decoration(0.07, -0.01, 2)
register_dry_grass_decoration(0.09, -0.03, 1)
-- Ferns
register_fern_decoration(14936, 3)
register_fern_decoration(801, 2)
register_fern_decoration(5, 1)
-- Junglegrass
minetest.register_decoration({
name = "default:junglegrass",
deco_type = "simple",
place_on = {"default:dirt_with_rainforest_litter"},
sidelen = 80,
fill_ratio = 0.1,
biomes = {"rainforest"},
y_max = 31000,
y_min = 1,
decoration = "default:junglegrass",
})
-- Dry shrub
minetest.register_decoration({
name = "default:dry_shrub",
deco_type = "simple",
place_on = {"default:desert_sand",
"default:sand", "default:silver_sand"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.02,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {"desert", "sandstone_desert", "cold_desert"},
y_max = 31000,
y_min = 2,
decoration = "default:dry_shrub",
param2 = 4,
})
-- Marram grass
minetest.register_decoration({
name = "default:marram_grass",
deco_type = "simple",
place_on = {"default:sand"},
sidelen = 4,
noise_params = {
offset = -0.7,
scale = 4.0,
spread = {x = 16, y = 16, z = 16},
seed = 513337,
octaves = 1,
persist = 0.0,
flags = "absvalue, eased"
},
biomes = {"coniferous_forest_dunes", "grassland_dunes"},
y_max = 6,
y_min = 4,
decoration = {
"default:marram_grass_1",
"default:marram_grass_2",
"default:marram_grass_3",
},
})
-- Tundra moss
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:permafrost_with_stones"},
sidelen = 4,
noise_params = {
offset = -0.8,
scale = 2.0,
spread = {x = 100, y = 100, z = 100},
seed = 53995,
octaves = 3,
persist = 1.0
},
biomes = {"tundra"},
y_max = 50,
y_min = 2,
decoration = "default:permafrost_with_moss",
place_offset_y = -1,
flags = "force_placement",
})
-- Tundra patchy snow
minetest.register_decoration({
deco_type = "simple",
place_on = {
"default:permafrost_with_moss",
"default:permafrost_with_stones",
"default:stone",
"default:gravel"
},
sidelen = 4,
noise_params = {
offset = 0,
scale = 1.0,
spread = {x = 100, y = 100, z = 100},
seed = 172555,
octaves = 3,
persist = 1.0
},
biomes = {"tundra", "tundra_beach"},
y_max = 50,
y_min = 1,
decoration = "default:snow",
})
-- Coral reef
minetest.register_decoration({
name = "default:corals",
deco_type = "simple",
place_on = {"default:sand"},
place_offset_y = -1,
sidelen = 4,
noise_params = {
offset = -4,
scale = 4,
spread = {x = 50, y = 50, z = 50},
seed = 7013,
octaves = 3,
persist = 0.7,
},
biomes = {
"desert_ocean",
"savanna_ocean",
"rainforest_ocean",
},
y_max = -2,
y_min = -8,
flags = "force_placement",
decoration = {
"default:coral_green", "default:coral_pink",
"default:coral_cyan", "default:coral_brown",
"default:coral_orange", "default:coral_skeleton",
},
})
-- Kelp
minetest.register_decoration({
name = "default:kelp",
deco_type = "simple",
place_on = {"default:sand"},
place_offset_y = -1,
sidelen = 16,
noise_params = {
offset = -0.04,
scale = 0.1,
spread = {x = 200, y = 200, z = 200},
seed = 87112,
octaves = 3,
persist = 0.7
},
biomes = {
"taiga_ocean",
"snowy_grassland_ocean",
"grassland_ocean",
"coniferous_forest_ocean",
"deciduous_forest_ocean",
"sandstone_desert_ocean",
"cold_desert_ocean"},
y_max = -5,
y_min = -10,
flags = "force_placement",
decoration = "default:sand_with_kelp",
param2 = 48,
param2_max = 96,
})
end
--
-- Detect mapgen, flags and parameters to select functions
--
-- Get setting or default
local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or
"mountains, ridges, nofloatlands, caverns"
local captures_float = string.match(mgv7_spflags, "floatlands")
local captures_nofloat = string.match(mgv7_spflags, "nofloatlands")
-- Get setting or default
-- Make global for mods to use to register floatland biomes
default.mgv7_floatland_level =
minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
default.mgv7_shadow_limit =
minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
minetest.clear_registered_biomes()
minetest.clear_registered_ores()
minetest.clear_registered_decorations()
local mg_name = minetest.get_mapgen_setting("mg_name")
if mg_name == "v6" then
default.register_mgv6_ores()
default.register_mgv6_decorations()
-- Need to check for 'nofloatlands' because that contains
-- 'floatlands' which makes the second condition true.
elseif mg_name == "v7" and
captures_float == "floatlands" and
captures_nofloat ~= "nofloatlands" then
-- Mgv7 with floatlands and floatland biomes
default.register_biomes(default.mgv7_shadow_limit - 1)
default.register_floatland_biomes(
default.mgv7_floatland_level, default.mgv7_shadow_limit)
default.register_ores()
default.register_decorations()
else
default.register_biomes(31000)
default.register_ores()
default.register_decorations()
end
|
local ready = false
AddEventHandler("playerSpawned",function() -- delay state recording
Citizen.CreateThread(function()
Citizen.Wait(30000)
ready = true
end)
end)
Citizen.CreateThread(function()
while true do
local player = GetPlayerPed(-1)
local coords = GetEntityCoords(player)
Citizen.Wait(1)
if IsPedShooting(player) then
if CheckDistance(true) then
local message = "^7^*En person affyrer skud ved " .. GetStreetName(coords) .. "!"
NotifyPeople(message,coords,true)
end
Citizen.Wait(10000)
end
end
end)
local blipList = {}
RegisterNetEvent('notifyDispatch')
AddEventHandler('notifyDispatch', function(x,y,z,message)
local blip = AddBlipForCoord(x+0.001,y+0.001,z+0.001)
SetBlipSprite(blip, 304)
SetBlipColour(blip, 67)
SetBlipAlpha(blip, 250)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("Alarmcentralen")
SetBlipScale(blip, 0.6)
EndTextCommandSetBlipName(blip)
blipList[blip] = 30000
--Citizen.Trace("x:" .. x .. " y:" .. y .. " z:" .. z)
PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", 0, 0, 1)
TriggerEvent('chatMessage', '^3[Alarmcentralen]', "^3[Alarmcentralen]", message)
end)
Citizen.CreateThread(function()
while true do
for k,v in pairs(blipList) do
if v == 0 then
RemoveBlip(k)
blipList[k] = nil
else
blipList[k] = blipList[k]-1
end
end
Citizen.Wait(1)
end
end)
local pedtypes = {0,1,2,20,6,4,5,26}
function canPedBeUsed(ped)
if ped == nil then
return false
end
if ped == GetPlayerPed(-1) then
return false
end
if not DoesEntityExist(ped) then
return false
end
if GetVehiclePedIsUsing(ped) ~= 0 then
return false
end
for a = 0, 32 do
if GetPlayerPed(a) == ped then
return false
end
end
for k,v in pairs(pedtypes) do
if GetPedType(ped) == v then
return true
end
end
return false
end
function CheckDistance(alert)
local pedCoords = GetEntityCoords(PlayerPedId())
for ped in EnumeratePeds() do
if GetEntityHealth(ped) ~= 0 then
local distanceCheck = GetDistanceBetweenCoords(pedCoords, GetEntityCoords(ped), true)
if distanceCheck <= 100.0 then
if canPedBeUsed(ped) then
if alert then
if GetPedAlertness(ped) >= 1 then
return true
end
else
return true
end
end
end
end
end
return false
end
function GetStreetName(playerPos)
local s1, s2 = Citizen.InvokeNative( 0x2EB41072B4C1E4C0, playerPos.x, playerPos.y, playerPos.z, Citizen.PointerValueInt(), Citizen.PointerValueInt() )
local street1 = GetStreetNameFromHashKey(s1)
local street2 = GetStreetNameFromHashKey(s2)
if s2 == 0 then
return street1
elseif s2 ~= 0 then
return street1 .. " - " .. street2
end
end
function NotifyPeople(message, pos, bool)
if bool then
TriggerServerEvent('dispatchpolice', pos.x, pos.y, pos.z, message)
else
TriggerServerEvent('dispatch', pos.x, pos.y, pos.z, message)
end
end
|
--
-- Created by IntelliJ IDEA.
-- User: jufeng
-- Date: 19/12/2019
-- Time: 上午10:15
-- service crud
--
local require = require
local rock_core = require('rock.core')
local service_cache = require('rock.service')
local ngx = ngx
local quote_sql_str = ngx.quote_sql_str --- 防止sql注入
local service_key = "rock_service"
local tonumber = tonumber
local _M ={}
--- 添加service
--- id route id
--- data route json
--- args
local function check(data)
if not data then
return nil, {error_msg = " json is not null"}
end
local check_status = rock_core.schema.check_service(data)
if not check_status or check_status == false then
return nil ,{error_msg = "schema error"}
end
return true ,nil
end
local function puslish(action,data)
local msg = {
worker_id = ngx.worker.id(),
action = action,
data = data
}
local redis = rock_core.redis.new()
redis:publish(service_key,rock_core.json.encode_json(msg))
end
local function action_cache(action,data)
if action == "put" then
service_cache.put(data) --- 添加or更新cache
elseif action == "delete" then
service_cache.delete(data) -- 删除
end
end
--- add new router
function _M.post(service)
---check data
local ok ,err = check(service)
if not ok then
return 400,err
end
local service_value = quote_sql_str(rock_core.json.encode_json(service))
local sql = "insert into service (`data`,created,updated) values("..service_value..",now(),now())"
local res,err = rock_core.mysql.query(sql)
if not res then
return 500,{error_msg = err}
end
service.id = res.insert_id
action_cache("put",service)
puslish("put",service)
return 200, service
end
function _M.get(id)
if not id then
return 400,{error_msg = "id is not null"}
end
local id_value = quote_sql_str(id)
local sql = "select * from service where id = ".. id_value
local res,err = rock_core.mysql.query(sql)
if not res then
return 500,{error_msg = err}
end
local service
if #res >=1 then
service = res[1].data
end
if not service then
return 200,{}
end
service = rock_core.json.decode_json(service)
service.id = id
return 200, service
end
function _M.delete(id)
if not id then
return 400,{error_msg = "id is not null"}
end
local id_value = quote_sql_str(id)
local sql = "delete from service where id = ".. id_value
local res,err = rock_core.mysql.query(sql)
if not res then
return 500,{error_msg = err}
end
action_cache("delete",id)
puslish("delete",id)
return 200, res
end
--- update service
function _M.put(service)
local ok ,err = check(service)
if not ok then
return 400,err
end
local id = service.id
if not id then
return 400,{error_msg = "id is not null"}
end
local id_value = quote_sql_str(id)
local service_value = quote_sql_str(rock_core.json.encode_json(service))
local sql = "update service set `data` = "..service_value.." where id = ".. id_value
local res,err = rock_core.mysql.query(sql)
if not res then
return 500,{error_msg = err}
end
if res.affected_rows and res.affected_rows>0 then
action_cache("put",service)
puslish("put",service)
return 200, service
end
return 500,{error_msg = "the service not found for id= " ..id_value}
end
function _M.list()
local sql = "select * from service limit 10000"
local res,err = rock_core.mysql.query(sql)
if not res then
return 500,{error_msg = err}
end
return 200, res
end
return _M
|
--[[
Steamburn Awesome WM config 3.0
github.com/copycat-killer
--]]
theme = {}
themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/steamburn"
theme.wallpaper = themes_dir .. "/green.png"
theme.font = "Ohsnap 10"
theme.menu_bg_normal = "#000000"
theme.menu_bg_focus = "#000000"
theme.bg_normal = "#000000"
theme.bg_focus = "#000000"
theme.bg_urgent = "#000000"
theme.fg_normal = "#aaaaaa"
theme.fg_focus = "#00cf00"
theme.fg_urgent = "#af1d18"
theme.fg_minimize = "#ffffff"
theme.fg_black = "#424242"
theme.fg_red = "#ce5666"
theme.fg_green = "#80a673"
theme.fg_yellow = "#ffaf5f"
theme.fg_blue = "#7788af"
theme.fg_magenta = "#94738c"
theme.fg_cyan = "#778baf"
theme.fg_white = "#aaaaaa"
theme.fg_blu = "#8ebdde"
theme.border_width = "1"
theme.border_normal = "#1c2022"
theme.border_focus = "#00cf00"
theme.border_marked = "#3ca4d8"
theme.menu_width = "110"
theme.menu_border_width = "1"
theme.menu_fg_normal = "#aaaaaa"
theme.menu_fg_focus = "#00cf00"
theme.menu_bg_normal = "#050505dd"
theme.menu_bg_focus = "#050505dd"
theme.layout_txt_tile = "[t]"
theme.layout_txt_tileleft = "[l]"
theme.layout_txt_tilebottom = "[b]"
theme.layout_txt_tiletop = "[tt]"
theme.layout_txt_fairv = "[fv]"
theme.layout_txt_fairh = "[fh]"
theme.layout_txt_spiral = "[s]"
theme.layout_txt_dwindle = "[d]"
theme.layout_txt_max = "[m]"
theme.layout_txt_fullscreen = "[F]"
theme.layout_txt_magnifier = "[M]"
theme.layout_txt_floating = "[|]"
theme.menu_submenu_icon = themes_dir .. "/icons/submenu.png"
theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.png"
theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png"
theme.tasklist_disable_icon = true
theme.tasklist_floating = ""
theme.tasklist_maximized_horizontal = ""
theme.tasklist_maximized_vertical = ""
-- lain related
theme.layout_txt_termfair = "[termfair]"
theme.layout_txt_uselessfair = "[ufv]"
theme.layout_txt_uselessfairh = "[ufh]"
theme.layout_txt_uselessdwindle = "[ud]"
theme.layout_txt_uselesstile = "[ut]"
return theme
|
local serpent = require 'serpent'
local module = {}
local mt = {}
mt.__unm = function(rhs)
return module.Vector2D(-rhs[1], -rhs[2])
end
mt.__add = function(lhs, rhs)
return module.Vector2D(lhs[1] + rhs[1], lhs[2] + rhs[2])
end
mt.__sub = function(lhs, rhs)
return module.Vector2D(lhs[1] - rhs[1], lhs[2] - rhs[2])
end
mt.__mul = function(lhs, rhs)
if type(rhs) == 'number' then
return module.Vector2D(lhs[1] * rhs, lhs[2] * rhs)
elseif type(lhs) == 'number' then
return module.Vector2D(lhs * rhs[1], lhs * rhs[2])
else
return module.Vector2D(lhs[1] * rhs[1], lhs[2] * rhs[2])
end
end
mt.__div = function(lhs, rhs)
if type(rhs) == 'number' then
return module.Vector2D(lhs[1] / rhs, lhs[2] / rhs)
elseif type(lhs) == 'number' then
return module.Vector2D(lhs / rhs[1], lhs / rhs[2])
else
return module.Vector2D(lhs[1] / rhs[1], lhs[2] / rhs[2])
end
end
mt.__tostring = function(v)
return '{'..v[1]..', '..v[1] ..'}'
end
--Comparisons
mt.__eq = function(lhs, rhs)
--Equal To operator for vector2Ds
return (lhs[1] == rhs[1]) and (lhs[2] == rhs[2])
end
local funcs = {}
function funcs:Dup()
return module.Vector3D(self[1], self[2])
end
local _sqrt = math.sqrt
function funcs:GetLength() --Return the length of the vector (i.e. the distance from (0,0), see README.md for examples of using this)
return _sqrt(self[1]^2 + self[2]^2)
end
function funcs:GetSquaredLength()
return self[1]^2 + self[2]^2
end
function funcs:Normalize()
local invLength = 1 / self:GetLength()
return module.Vector2D(
self[1] * invLength,
self[2] * invLength)
end
function funcs:Dot(other)
return self[1]*other[1] + self[2]*other[2] + self[3]*other[3]
end
mt.__index = funcs
module.Vector2D = function (ix, iy)
return setmetatable({ix, iy}, mt)
end
return module
|
require('src/items/item')
require('src/items/items')
require('src/items/inventory')
require('src/components/store/itembutton')
|
local Lerp = Object:extend()
function Lerp:new()
rawset(self, "__values", {})
rawset(self, "__lerp", 1)
end
function Lerp:__index(key)
if key == "new" then
return Lerp[key]
else
local value = self.__values[key]
if value ~= nil then
local lerp = self.__lerp
return value.value * lerp + value.old * (1 - lerp)
else
return Lerp[key]
end
end
end
function Lerp:__newindex(key, value)
local values = self.__values
if values[key] ~= nil then
if value == nil then
values[key] = nil
else
values[key].value = value
end
elseif value ~= nil then
values[key] = {
value = value,
old = value
}
end
end
function Lerp:update()
self.__lerp = 1
for _, value in pairs(self.__values) do
value.old = value.value
end
end
function Lerp:setLerp(lerp)
self.__lerp = lerp
end
return Lerp
|
local addonName = "KibsItemLevelContinued"
local addonNamespace = LibStub:NewLibrary(addonName .. "-1.0", 1)
if not addonNamespace then return end
addonNamespace.loaded = {}
|
controller= require('ControllerVI')
ffi = require('ffi')
control= ControllerVI()
--c = control:learn(ffi.new("double[3]", {1,2,3}),ffi.new("double[1]", {1}), 3, 1, 1,2)
--A = matrix{{-1,2,1},{0.1,-1,2},{0,0.1,1}}
--B = matrix{{0},{0},{1}}
--x = matrix{{2},{0},{0}}
--K = matrix{{2,0,0}}
K = {0.002}
p = 500
--matrix.print(B*2)
dt = 0.001
t = 0
--for i = 1,5 do
for i = 1,5000000 do
--u = -matrix.mul(K,x)
if i==1 then
u = -K[1]*p - K[2]*v - K[3]*a
else
u = -K[0]*p - K[1]*v - K[2]*a
end
u = u + math.sin(t)
dp = (-0.1*p + v) * dt
dv = (-0.1*v + a)*dt
da = (-0.1 * a + u)*dt
p = p + dp
--print(K[0])
--print(p)
--print(v)
--print(a)
K = control:learn(ffi.new("double[3]", x),ffi.new("double[1]", u), 3, 1, dt,t)
--print(Kadp[1])
--print(Kadp[2])
--print(Kadp[3])
i = i+1
t = t + dt
end
--c = learn(control,ffi.new("double[3]", {1,2,3}),ffi.new("double[1]", {1}), 3, 1, 1,2)
--print(c[1])
|
-- cl_init.lua
-- initializes the client-side section
local clBaseDir = BSU.DIR_BASE .. "client/"
-- setup shared scripts
include(BSU.DIR_BASE .. "sql.lua")
-- setup client-side scripts
include(clBaseDir .. "sql.lua")
include(clBaseDir .. "networking.lua")
include(clBaseDir .. "pp.lua")
-- module loading
local clModulesDir = BSU.DIR_MODULES .. "client/"
local shModules = file.Find(BSU.DIR_MODULES .. "*.lua", "LUA")
local clModules = file.Find(clModulesDir .. "*.lua", "LUA")
-- run shared modules
for _, module in ipairs(shModules) do
include(BSU.DIR_MODULES .. module)
end
-- run client-side modules
for _, module in ipairs(clModules) do
include(clModulesDir .. module)
end
|
s.sprite = {
"position",
"size",
"sprite"
}
s.sprite.draw = function(i, pos, size, sprite)
do
local _with_0 = love.graphics
_with_0.setColor(1, 1, 1)
local ox = size.w / sprite.img:getWidth()
local oy = size.h / sprite.img:getHeight()
_with_0.draw(sprite.img, pos.x + size.w / 2, pos.y + size.h / 2, sprite.r or 0, ox, oy, sprite.img:getWidth() / 2, sprite.img:getHeight() / 2)
return _with_0
end
end
|
-- Copyright © 2013, Cairthenn
-- All rights reserved.
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of DressUp nor the
-- names of its contributors may be used to endorse or promote products
-- derived from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-- DISCLAIMED. IN NO EVENT SHALL Cairthenn BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
models.body = {}
models.body["None"] = { name = "empty", model = 8192 }
models.body[10240] = { name = "Hexed Haubert" , enl = "hexed haubert", model = 8197}
models.body[10241] = { name = "Hexed Domaru" , enl = "hexed domaru", model = 8201}
models.body[10242] = { name = "Hexed Jacket" , enl = "hexed jacket", model = 8363}
models.body[10243] = { name = "Hexed Doublet" , enl = "hexed doublet", model = 8212}
models.body[10244] = { name = "Hexed Bliaut" , enl = "hexed bliaut", model = 8120}
models.body[10245] = { name = "Hexed Haubert -1" , enl = "hexed haubert -1", model = 8197}
models.body[10246] = { name = "Hexed Domaru -1" , enl = "hexed domaru -1", model = 8201}
models.body[10247] = { name = "Hexed Jacket -1" , enl = "hexed jacket -1", model = 8363}
models.body[10248] = { name = "Hexed Doublet -1" , enl = "hexed doublet -1", model = 8212}
models.body[10249] = { name = "Hexed Bliaut -1" , enl = "hexed bliaut -1", model = 8120}
models.body[10250] = { name = "Moogle Suit" , enl = "moogle suit", model = 8499} --8507 Taru M
models.body[10251] = { name = "Decennial Coat" , enl = "decennial coat", model = 8523}
models.body[10252] = { name = "Decennial Dress" , enl = "decennial dress", model = 8524}
models.body[10253] = { name = "Decennial Coat +1" , enl = "decennial coat +1", model = 8523}
models.body[10254] = { name = "Decennial Dress +1" , enl = "decennial dress +1", model = 8524}
models.body[10255] = { name = "Matanca Harness" , enl = "matanca harness", model = 8525}
models.body[10256] = { name = "Marine Gilet" , enl = "marine gilet", model = 8526}
models.body[10257] = { name = "Marine Top" , enl = "marine top", model = 8526}
models.body[10258] = { name = "Woodsy Gilet" , enl = "woodsy gilet", model = 8526}
models.body[10259] = { name = "Woodsy Top" , enl = "woodsy top", model = 8526}
models.body[10260] = { name = "Creek Maillot" , enl = "creek maillot", model = 8527}
models.body[10261] = { name = "Creek Top" , enl = "creek top", model = 8527}
models.body[10262] = { name = "River Top" , enl = "river top", model = 8526}
models.body[10263] = { name = "Dune Gilet" , enl = "dune gilet", model = 8526}
models.body[10264] = { name = "Marine Gilet +1" , enl = "marine gilet +1", model = 8526}
models.body[10265] = { name = "Marine Top +1" , enl = "marine top +1", model = 8526}
models.body[10266] = { name = "Woodsy Gilet +1" , enl = "woodsy gilet +1", model = 8526}
models.body[10267] = { name = "Woodsy Top +1" , enl = "woodsy top +1", model = 8526}
models.body[10268] = { name = "Creek Maillot +1" , enl = "creek maillot +1", model = 8527}
models.body[10269] = { name = "Creek Top +1" , enl = "creek top +1", model = 8527}
models.body[10270] = { name = "River Top +1" , enl = "river top +1", model = 8526}
models.body[10271] = { name = "Dune Gilet +1" , enl = "dune gilet +1", model = 8526}
models.body[10272] = { name = "Dux Scale Mail" , enl = "dux scale mail", model = 8528}
models.body[10273] = { name = "Dux Sc. Mail +1" , enl = "dux scale mail +1", model = 8528}
models.body[10274] = { name = "Chelona Blazer" , enl = "chelona blazer", model = 8529}
models.body[10275] = { name = "Chelona Blazer +1" , enl = "chelona blazer +1", model = 8529}
models.body[10276] = { name = "Enif Corazza" , enl = "enif corazza", model = 8351}
models.body[10277] = { name = "Adhara Manteel" , enl = "adhara manteel", model = 8352}
models.body[10278] = { name = "Murzim Corazza" , enl = "murzim corazza", model = 8351}
models.body[10279] = { name = "Shedir Manteel" , enl = "shedir manteel", model = 8351}
models.body[10280] = { name = "Laeradr Breastplate" , enl = "laeradr breastplate", model = 8391}
models.body[10281] = { name = "Manasa Chasuble" , enl = "manasa chasuble", model = 8335}
models.body[10282] = { name = "Krabat Jacket" , enl = "krabat jacket", model = 8396}
models.body[10283] = { name = "Vara Brigandine" , enl = "vara brigandine armor", model = 8235}
models.body[10284] = { name = "Grandoyne's Mail" , enl = "grandoyne's mail", model = 8252}
models.body[10285] = { name = "Beguiler's Jerkin" , enl = "beguiler's jerkin", model = 8246}
models.body[10286] = { name = "Seidr Cotehardie" , enl = "seidr cotehardie", model = 8240}
models.body[10287] = { name = "Feverish Korazin" , enl = "feverish korazin", model = 8366}
models.body[10288] = { name = "Baalmuian Robe" , enl = "baalmuian robe", model = 8538}
models.body[10289] = { name = "Sublime Breastplate" , enl = "sublime breastplate", model = 8289}
models.body[10290] = { name = "Laudan Cuirass" , enl = "laudan cuirass", model = 8394}
models.body[10291] = { name = "Febro Kaftan" , enl = "febro kaftan", model = 8426}
models.body[10292] = { name = "Wikyo Cloak" , enl = "wikyo cloak", model = 8239}
models.body[10293] = { name = "Chocobo Shirt" , enl = "chocobo shirt", model = 8501} -- 8509 Taru M
models.body[10450] = { name = "Ogier's Surcoat" , enl = "ogier's surcoat", model = 8517}
models.body[10451] = { name = "Athos's Tabard" , enl = "athos's tabard", model = 8518}
models.body[10452] = { name = "Rubeus Jacket" , enl = "rubeus jacket", model = 8519}
models.body[10453] = { name = "Praeco Doublet" , enl = "praeco doublet", model = 8521}
models.body[10454] = { name = "Asura Samue" , enl = "asura samue", model = 8290}
models.body[10455] = { name = "Asura Samue +1" , enl = "asura samue +1", model = 8290}
models.body[10456] = { name = "Avant Mail" , enl = "avant mail", model = 8221}
models.body[10457] = { name = "Avant Mail +1" , enl = "avant mail +1", model = 8221}
models.body[10458] = { name = "Kacura Harness" , enl = "kacura harness", model = 8302}
models.body[10459] = { name = "Kacura Harness +1" , enl = "kacura harness +1", model = 8302}
models.body[10460] = { name = "Sweven Coat" , enl = "sweven coat", model = 8323}
models.body[10461] = { name = "Sweven Coat +1" , enl = "sweven coat +1", model = 8323}
models.body[10462] = { name = "Calma Breastplate" , enl = "calma breastplate", model = 8473}
models.body[10463] = { name = "Mustela Harness" , enl = "mustela harness", model = 8440}
models.body[10464] = { name = "Magavan Frock" , enl = "magavan frock", model = 8461}
models.body[10465] = { name = "Fulad-Zereh" , enl = "fulad-zereh", model = 8520}
models.body[10466] = { name = "Gunman Gambison" , enl = "gunman gambison", model = 8354}
models.body[10467] = { name = "Pharmakeia Robe" , enl = "pharmakeia robe", model = 8412}
models.body[10468] = { name = "Kumarbi's Akar" , enl = "kumarbi's akar", model = 8395}
models.body[10469] = { name = "Eirene's Manteel" , enl = "eirene's manteel", model = 8352}
models.body[10470] = { name = "Rheic Korazin" , enl = "rheic korazin", model = 8387}
models.body[10471] = { name = "Rheic Korazin +1" , enl = "rheic korazin +1", model = 8387}
models.body[10472] = { name = "Rheic Korazin +2" , enl = "rheic korazin +2", model = 8387}
models.body[10473] = { name = "Rheic Korazin +3" , enl = "rheic korazin +3", model = 8387}
models.body[10474] = { name = "Phorcys Korazin" , enl = "phorcys korazin", model = 8387}
models.body[10475] = { name = "Euxine Coat" , enl = "euxine coat", model = 8388}
models.body[10476] = { name = "Euxine Coat +1" , enl = "euxine coat +1", model = 8388}
models.body[10477] = { name = "Euxine Coat +2" , enl = "euxine coat +2", model = 8388}
models.body[10478] = { name = "Euxine Coat +3" , enl = "euxine coat +3", model = 8388}
models.body[10479] = { name = "Thaumas Coat" , enl = "thaumas coat", model = 8388}
models.body[10480] = { name = "Tethyan Saio" , enl = "tethyan saio", model = 8389}
models.body[10481] = { name = "Tethyan Saio +1" , enl = "tethyan saio +1", model = 8389}
models.body[10482] = { name = "Tethyan Saio +2" , enl = "tethyan saio +2", model = 8389}
models.body[10483] = { name = "Tethyan Saio +3" , enl = "tethyan saio +3", model = 8389}
models.body[10484] = { name = "Nares Saio" , enl = "nares saio", model = 8389}
models.body[10485] = { name = "Tessera Saio" , enl = "tessera saio", model = 8522}
models.body[10486] = { name = "Porthos Byrnie" , enl = "porthos byrnie", model = 8233}
models.body[10487] = { name = "Hedera Cotehardie" , enl = "hedera cotehardie", model = 8241}
models.body[10488] = { name = "Kudzu Aketon" , enl = "kudzu aketon", model = 8288}
models.body[10489] = { name = "Huginn Haubert" , enl = "huginn haubert", model = 8515}
models.body[10490] = { name = "Tenryu Domaru +1" , enl = "tenryu domaru +1", model = 8516}
models.body[10491] = { name = "Khepri Jacket" , enl = "khepri jacket", model = 8512}
models.body[10492] = { name = "Spurrina Doublet" , enl = "spurrina doublet", model = 8514}
models.body[10493] = { name = "Iaso Bliaut" , enl = "iaso bliaut", model = 8513}
models.body[10494] = { name = "Ugol Haubert" , enl = "ugol haubert", model = 8342}
models.body[10495] = { name = "Mavros Haubert" , enl = "mavros haubert", model = 8342}
models.body[10496] = { name = "Urja Jerkin" , enl = "urja jerkin", model = 8242}
models.body[10497] = { name = "Sthira Jerkin" , enl = "sthira jerkin", model = 8242}
models.body[10498] = { name = "Spolia Saio" , enl = "spolia saio", model = 8341}
models.body[10499] = { name = "Opima Saio" , enl = "opima saio", model = 8341}
models.body[10670] = { name = "War. Lorica +2" , enl = "warrior's lorica +2", model = 8257}
models.body[10671] = { name = "Mel. Cyclas +2" , enl = "melee cyclas +2", model = 8259}
models.body[10672] = { name = "Clr. Briault +2" , enl = "cleric's briault +2", model = 8261}
models.body[10673] = { name = "Src. Coat +2" , enl = "sorcerer's coat +2", model = 8263}
models.body[10674] = { name = "Dls. Tabard +2" , enl = "duelist's tabard +2", model = 8265}
models.body[10675] = { name = "Asn. Vest +2" , enl = "assassin's vest +2", model = 8267}
models.body[10676] = { name = "Vlr. Surcoat +2" , enl = "valor surcoat +2", model = 8269}
models.body[10677] = { name = "Abs. Cuirass +2" , enl = "abyss cuirass +2", model = 8271}
models.body[10678] = { name = "Mst. Jackcoat +2" , enl = "monster jackcoat +2", model = 8273}
models.body[10679] = { name = "Brd. Jstcorps +2" , enl = "bard's justaucorps +2", model = 8275}
models.body[10680] = { name = "Sct. Jerkin +2" , enl = "scout's jerkin +2", model = 8277}
models.body[10681] = { name = "Sao. Domaru +2" , enl = "saotome domaru +2", model = 8279}
models.body[10682] = { name = "Kog. Chainmail +2" , enl = "koga chainmail +2", model = 8281}
models.body[10683] = { name = "Wym. Mail +2" , enl = "wyrm mail +2", model = 8283}
models.body[10684] = { name = "Smn. Doublet +2" , enl = "summoner's doublet +2", model = 8285}
models.body[10685] = { name = "Mirage Jubbah +2" , enl = "mirage jubbah +2", model = 8358}
models.body[10686] = { name = "Comm. Frac +2" , enl = "commodore frac +2", model = 8360}
models.body[10687] = { name = "Pantin Tobe +2" , enl = "pantin tobe +2", model = 8362}
models.body[10688] = { name = "Etoile Casaque +2" , enl = "etoile casaque +2", model = 8496} -- 8504 Taru M
models.body[10689] = { name = "Argute Gown +2" , enl = "argute gown +2", model = 8407}
models.body[11084] = { name = "Rvg. Lorica +2" , enl = "ravager's lorica +2", model = 8474}
models.body[11085] = { name = "Tantra Cyclas +2" , enl = "tantra cyclas +2", model = 8475}
models.body[11086] = { name = "Orison Bliaud +2" , enl = "orison bliaud +2", model = 8476}
models.body[11087] = { name = "Goetia Coat +2" , enl = "goetia coat +2", model = 8477}
models.body[11088] = { name = "Estq. Sayon +2" , enl = "estoqueur's sayon +2", model = 8478}
models.body[11089] = { name = "Raider's Vest +2" , enl = "raider's vest +2", model = 8479}
models.body[11090] = { name = "Creed Cuirass +2" , enl = "creed cuirass +2", model = 8480}
models.body[11091] = { name = "Bale Cuirass +2" , enl = "bale cuirass +2", model = 8481}
models.body[11092] = { name = "Ferine Gausape +2" , enl = "ferine gausape +2", model = 8482}
models.body[11093] = { name = "Aoidos' Hngrln. +2" , enl = "aoidos' hongreline +2", model = 8483}
models.body[11094] = { name = "Sylvan Caban +2" , enl = "sylvan caban +2", model = 8484}
models.body[11095] = { name = "Unkai Domaru +2" , enl = "unkai domaru +2", model = 8485}
models.body[11096] = { name = "Iga Ningi +2" , enl = "iga ningi +2", model = 8486}
models.body[11097] = { name = "Lncr. Plackart +2" , enl = "lancer's plackart +2", model = 8487}
models.body[11098] = { name = "Call. Doublet +2" , enl = "caller's doublet +2", model = 8488}
models.body[11099] = { name = "Mavi Mintan +2" , enl = "mavi mintan +2", model = 8489}
models.body[11100] = { name = "Nvrch. Frac +2" , enl = "navarch's frac +2", model = 8490}
models.body[11101] = { name = "Cirque Farsetto +2" , enl = "cirque farsetto +2", model = 8491}
models.body[11102] = { name = "Charis Casaque +2" , enl = "charis casaque +2", model = 8497} -- 8505 Taru M
models.body[11103] = { name = "Savant's Gown +2" , enl = "savant's gown +2", model = 8498} -- 8606 Taru M
models.body[11184] = { name = "Rvg. Lorica +1" , enl = "ravager's lorica +1", model = 8474}
models.body[11185] = { name = "Tantra Cyclas +1" , enl = "tantra cyclas +1", model = 8475}
models.body[11186] = { name = "Orison Bliaud +1" , enl = "orison bliaud +1", model = 8476}
models.body[11187] = { name = "Goetia Coat +1" , enl = "goetia coat +1", model = 8477}
models.body[11188] = { name = "Estq. Sayon +1" , enl = "estoqueur's sayon +1", model = 8478}
models.body[11189] = { name = "Raider's Vest +1" , enl = "raider's vest +1", model = 8479}
models.body[11190] = { name = "Creed Cuirass +1" , enl = "creed cuirass +1", model = 8480}
models.body[11191] = { name = "Bale Cuirass +1" , enl = "bale cuirass +1", model = 8481}
models.body[11192] = { name = "Ferine Gausape +1" , enl = "ferine gausape +1", model = 8482}
models.body[11193] = { name = "Aoidos' Hngrln. +1" , enl = "aoidos' hongreline +1", model = 8483}
models.body[11194] = { name = "Sylvan Caban +1" , enl = "sylvan caban +1", model = 8484}
models.body[11195] = { name = "Unkai Domaru +1" , enl = "unkai domaru +1", model = 8485}
models.body[11196] = { name = "Iga Ningi +1" , enl = "iga ningi +1", model = 8486}
models.body[11197] = { name = "Lncr. Plackart +1" , enl = "lancer's plackart +1", model = 8487}
models.body[11198] = { name = "Caller's Doublet +1" , enl = "caller's doublet +1", model = 8488}
models.body[11199] = { name = "Mavi Mintan +1" , enl = "mavi mintan +1", model = 8489}
models.body[11200] = { name = "Navarch's Frac +1" , enl = "navarch's frac +1", model = 8490}
models.body[11201] = { name = "Cirque Farsetto +1" , enl = "cirque farsetto +1", model = 8491}
models.body[11202] = { name = "Charis Casaque +1" , enl = "charis casaque +1", model = 8497} -- 8505 Taru M
models.body[11203] = { name = "Savant's Gown +1" , enl = "savant's gown +1", model = 8498} -- 8606 Taru M
models.body[11265] = { name = "Custom Gilet" , enl = "custom gilet", model = 8417}
models.body[11266] = { name = "Custom Top" , enl = "custom top", model = 8417}
models.body[11267] = { name = "Magna Gilet" , enl = "magna gilet", model = 8417}
models.body[11268] = { name = "Magna Top" , enl = "magna top", model = 8417}
models.body[11269] = { name = "Wonder Maillot" , enl = "wonder maillot", model = 8418}
models.body[11270] = { name = "Wonder Top" , enl = "wonder top", model = 8418}
models.body[11271] = { name = "Savage Top" , enl = "savage top", model = 8417}
models.body[11272] = { name = "Elder Gilet" , enl = "elder gilet", model = 8417}
models.body[11273] = { name = "Custom Gilet +1" , enl = "custom gilet +1", model = 8417}
models.body[11274] = { name = "Custom Top +1" , enl = "custom top +1", model = 8417}
models.body[11275] = { name = "Magna Gilet +1" , enl = "magna gilet +1", model = 8417}
models.body[11276] = { name = "Magna Top +1" , enl = "magna top +1", model = 8417}
models.body[11277] = { name = "Wonder Maillot +1" , enl = "wonder maillot +1", model = 8418}
models.body[11278] = { name = "Wonder Top +1" , enl = "wonder top +1", model = 8418}
models.body[11279] = { name = "Savage Top +1" , enl = "savage top +1", model = 8417}
models.body[11280] = { name = "Elder Gilet +1" , enl = "elder gilet +1", model = 8417}
models.body[11281] = { name = "Hachiryu Haramaki" , enl = "hachiryu haramaki", model = 8419}
models.body[11282] = { name = "Aurum Cuirass" , enl = "aurum cuirass", model = 8228}
models.body[11283] = { name = "Oracle's Robe" , enl = "oracle's robe", model = 8335}
models.body[11284] = { name = "Enkidu's Harness" , enl = "enkidu's harness", model = 8248}
models.body[11285] = { name = "Mrgn. Cotehardie" , enl = "morgana's cotehardie", model = 8241}
models.body[11286] = { name = "Avalon Breastplate" , enl = "avalon breastplate", model = 8306}
models.body[11287] = { name = "Antares Harness" , enl = "antares harness", model = 8226}
models.body[11288] = { name = "Zahak's Mail" , enl = "zahak's mail", model = 8252}
models.body[11289] = { name = "Ixion Cloak" , enl = "ixion cloak", model = 8238}
models.body[11290] = { name = "Tidal Talisman" , enl = "tidal talisman", model = 8420}
models.body[11291] = { name = "Magus Jubbah +1" , enl = "magus jubbah +1", model = 8357}
models.body[11292] = { name = "Mirage Jubbah" , enl = "mirage jubbah", model = 8358}
models.body[11293] = { name = "Mirage Jubbah +1" , enl = "mirage jubbah +1", model = 8358}
models.body[11294] = { name = "Corsair's Frac +1" , enl = "corsair's frac +1", model = 8359}
models.body[11295] = { name = "Commodore Frac" , enl = "commodore frac", model = 8360}
models.body[11296] = { name = "Comm. Frac +1" , enl = "commodore frac +1", model = 8360}
models.body[11297] = { name = "Pup. Tobe +1" , enl = "puppetry tobe +1", model = 8361}
models.body[11298] = { name = "Pantin Tobe" , enl = "pantin tobe", model = 8362}
models.body[11299] = { name = "Pantin Tobe +1" , enl = "pantin tobe +1", model = 8362}
models.body[11300] = { name = "Eerie Cloak" , enl = "eerie cloak", model = 8421}
models.body[11301] = { name = "Eerie Cloak +1" , enl = "eerie cloak +1", model = 8421}
models.body[11302] = { name = "Dnc. Casaque +1" , enl = "dancer's casaque +1", model = 8402}
models.body[11303] = { name = "Dnc. Casaque +1" , enl = "dancer's casaque +1", model = 8403}
models.body[11304] = { name = "Scholar's Gown +1" , enl = "scholar's gown +1", model = 8406}
models.body[11305] = { name = "Etoile Casaque" , enl = "etoile casaque", model = 8496} -- 8504 Taru M
models.body[11306] = { name = "Etoile Casaque +1" , enl = "etoile casaque +1", model = 8496} -- 8504 Taru M
models.body[11307] = { name = "Argute Gown" , enl = "argute gown", model = 8407}
models.body[11308] = { name = "Argute Gown +1" , enl = "argute gown +1", model = 8407}
models.body[11309] = { name = "Benedight Coat" , enl = "benedight coat", model = 8424}
models.body[11310] = { name = "Argent Coat" , enl = "argent coat", model = 8424}
models.body[11311] = { name = "Platino Coat" , enl = "platino coat", model = 8424}
models.body[11312] = { name = "Rambler's Cloak" , enl = "rambler's cloak", model = 8202}
models.body[11313] = { name = "Nuevo Coselete" , enl = "nuevo coselete", model = 8428}
models.body[11314] = { name = "Mirke Wardecors" , enl = "mirke wardecors", model = 8429}
models.body[11315] = { name = "Royal Redingote" , enl = "royal redingote", model = 8430}
models.body[11316] = { name = "Otokogusa Yukata" , enl = "otokogusa yukata", model = 8435}
models.body[11317] = { name = "Onnagusa Yukata" , enl = "onnagusa yukata", model = 8436}
models.body[11318] = { name = "Otokoeshi Yukata" , enl = "otokoeshi yukata", model = 8435}
models.body[11319] = { name = "Ominaeshi Yukata" , enl = "ominaeshi yukata", model = 8436}
models.body[11320] = { name = "Skeleton Robe" , enl = "skeleton robe", model = 8210}
models.body[11321] = { name = "Orange Race Silks" , enl = "orange racing silks", model = 8379}
models.body[11322] = { name = "Black Race Silks" , enl = "black racing silks", model = 8380}
models.body[11323] = { name = "Purple Race Silks" , enl = "purple racing silks", model = 8381}
models.body[11324] = { name = "S. Blue Race Silks" , enl = "sky blue racing silks", model = 8382}
models.body[11325] = { name = "Blue Race Silks" , enl = "blue racing silks", model = 8383}
models.body[11326] = { name = "Red Race Silks" , enl = "red racing silks", model = 8384}
models.body[11327] = { name = "White Race Silks" , enl = "white racing silks", model = 8385}
models.body[11328] = { name = "Green Race Silks" , enl = "green racing silks", model = 8386}
models.body[11329] = { name = "Carpenter's Smock" , enl = "carpenter's smock", model = 8336}
models.body[11330] = { name = "Blksmith. Smock" , enl = "blacksmith's smock", model = 8337}
models.body[11331] = { name = "Goldsmith's Smock" , enl = "goldsmith's smock", model = 8348}
models.body[11332] = { name = "Weaver's Smock" , enl = "weaver's smock", model = 8338}
models.body[11333] = { name = "Tanner's Smock" , enl = "tanner's smock", model = 8346}
models.body[11334] = { name = "Bonewrk. Smock" , enl = "boneworker's smock", model = 8344}
models.body[11335] = { name = "Alchemist's Smock" , enl = "alchemist's smock", model = 8339}
models.body[11336] = { name = "Culinarian's Smock" , enl = "culinarian's smock", model = 8347}
models.body[11337] = { name = "Fisherman's Smock" , enl = "fisherman's smock", model = 8345}
models.body[11338] = { name = "Aega's Doublet" , enl = "aega's doublet", model = 8213}
models.body[11339] = { name = "Channeling Robe" , enl = "channeling robe", model = 8212}
models.body[11340] = { name = "Salutary Robe" , enl = "salutary robe", model = 8210}
models.body[11341] = { name = "Vivacity Coat" , enl = "vivacity coat", model = 8211}
models.body[11342] = { name = "Restorer Cloak" , enl = "restorer cloak", model = 8203}
models.body[11343] = { name = "Thrk. Breastplate" , enl = "thrakon breastplate", model = 8300}
models.body[11344] = { name = "Styrne Byrnie" , enl = "styrne byrnie", model = 8233}
models.body[11345] = { name = "Alacer Aketon" , enl = "alacer aketon", model = 8231}
models.body[11346] = { name = "Vela Justaucorps" , enl = "vela justaucorps", model = 8236}
models.body[11347] = { name = "Menetrier's Alb" , enl = "menetrier's alb", model = 8341}
models.body[11348] = { name = "Salutary Robe +1" , enl = "salutary robe +1", model = 8210}
models.body[11349] = { name = "Vivacity Coat +1" , enl = "vivacity coat +1", model = 8211}
models.body[11350] = { name = "Styrne Byrnie +1" , enl = "styrne byrnie +1", model = 8233}
models.body[11351] = { name = "Alacer Aketon +1" , enl = "alacer aketon +1", model = 8231}
models.body[11352] = { name = "Vela Jstcorps +1" , enl = "vela justaucorps +1", model = 8236}
models.body[11353] = { name = "Menetrier's Alb +1" , enl = "menetrier's alb +1", model = 8341}
models.body[11354] = { name = "Nocturnus Mail" , enl = "nocturnus mail", model = 8423}
models.body[11355] = { name = "Dinner Jacket" , enl = "dinner jacket", model = 8422}
models.body[11356] = { name = "Ryl.Grd. Livery" , enl = "royal guard livery", model = 8303}
models.body[11357] = { name = "Myth.Msk. Livery" , enl = "mythril musketeer livery", model = 8305}
models.body[11358] = { name = "Ptr.Prt. Livery" , enl = "patriarch protector livery", model = 8304}
models.body[11359] = { name = "Velox Harness" , enl = "velox harness", model = 8302}
models.body[11360] = { name = "Taranis's Harness" , enl = "taranis's harness", model = 8340}
models.body[11361] = { name = "Pluviale" , enl = "pluviale", model = 8352}
models.body[11362] = { name = "Twilight Mail" , enl = "twilight mail", model = 8373}
models.body[11363] = { name = "Twilight Cloak" , enl = "twilight cloak", model = 8404}
models.body[11828] = { name = "Gules Harness" , enl = "gules harness", model = 8248}
models.body[11829] = { name = "Gules Harness +1" , enl = "gules harness +1", model = 8248}
models.body[11830] = { name = "Versa Hauberk" , enl = "versa hauberk", model = 8250}
models.body[11831] = { name = "Versa Hauberk +1" , enl = "versa hauberk +1", model = 8250}
models.body[11832] = { name = "Lore Robe" , enl = "lore robe", model = 8307}
models.body[11833] = { name = "Lore Robe +1" , enl = "lore robe +1", model = 8307}
models.body[11834] = { name = "Bellicus Cuirass" , enl = "bellicus cuirass", model = 8462}
models.body[11835] = { name = "Bestia Mail" , enl = "bestia mail", model = 8465}
models.body[11836] = { name = "Paragon Haubert" , enl = "paragon haubert", model = 8468}
models.body[11837] = { name = "Skopos Jerkin" , enl = "skopos jerkin", model = 8441}
models.body[11838] = { name = "Kokugetsu Togi" , enl = "kokugetsu togi", model = 8444}
models.body[11839] = { name = "Spry Vest" , enl = "spry vest", model = 8447}
models.body[11840] = { name = "Mederi Talar" , enl = "mederi talar", model = 8450}
models.body[11841] = { name = "Literae Coat" , enl = "literae coat", model = 8453}
models.body[11842] = { name = "Facio Bliaut" , enl = "facio bliaut", model = 8456}
models.body[11843] = { name = "Tristan's Brstplate" , enl = "tristan's breastplate", model = 8224}
models.body[11844] = { name = "Alcide's Harness" , enl = "alcide's harness", model = 8302}
models.body[11845] = { name = "Alcd. Harness +1" , enl = "alcide's harness +1", model = 8302}
models.body[11846] = { name = "Nemus Peti" , enl = "nemus peti", model = 8364}
models.body[11847] = { name = "Nemus Peti +1" , enl = "nemus peti +1", model = 8364}
models.body[11848] = { name = "Nebula Hpl." , enl = "nebula houppelande", model = 8293}
models.body[11849] = { name = "Nebula Hpl. +1" , enl = "nebula houppelande +1", model = 8293}
models.body[11850] = { name = "Fazheluo Mail" , enl = "fazheluo mail", model = 8398}
models.body[11851] = { name = "Cuauhtli Harness" , enl = "cuauhtli harness", model = 8390}
models.body[11852] = { name = "Hyksos Robe" , enl = "hyksos robe", model = 8397}
models.body[11853] = { name = "Novennial Coat" , enl = "novennial coat", model = 8427}
models.body[11854] = { name = "Novennial Dress" , enl = "novennial dress", model = 8437}
models.body[11855] = { name = "Mextli Harness" , enl = "mextli harness", model = 8399}
models.body[11856] = { name = "Anhur Robe" , enl = "anhur robe", model = 8400}
models.body[11857] = { name = "Fazheluo R. Mail" , enl = "fazheluo radiant mail", model = 8401}
models.body[11858] = { name = "Fazheluo Mail +1" , enl = "fazheluo mail +1", model = 8398}
models.body[11859] = { name = "Cuauh. Harness +1" , enl = "cuauhtli harness +1", model = 8390}
models.body[11860] = { name = "Hyksos Robe +1" , enl = "hyksos robe +1", model = 8397}
models.body[11861] = { name = "Hikogami Yukata" , enl = "hikogami yukata", model = 8416}
models.body[11862] = { name = "Himegami Yukata" , enl = "himegami yukata", model = 8425}
models.body[11863] = { name = "Ocelomeh Harness" , enl = "ocelomeh harness", model = 8492}
models.body[11864] = { name = "Nefer Kalasiris" , enl = "nefer kalasiris", model = 8493}
models.body[11865] = { name = "Mekira Toshugai" , enl = "mekira toshugai", model = 8494}
models.body[11866] = { name = "Toci's Harness" , enl = "toci's harness", model = 8243}
models.body[11867] = { name = "Heka's Kalasiris" , enl = "heka's kalasiris", model = 8405}
models.body[11868] = { name = "Mekira Meikogai" , enl = "mekira meikogai", model = 8495}
models.body[11869] = { name = "Ocelm. Harness +1" , enl = "ocelomeh harness +1", model = 8492}
models.body[11870] = { name = "Nefer Kalasiris +1" , enl = "nefer kalasiris +1", model = 8492}
models.body[11871] = { name = "Mekira Toshugai +1" , enl = "mekira toshugai +1", model = 8494}
models.body[11872] = { name = "Ace's Mail" , enl = "ace's mail", model = 8244}
models.body[11873] = { name = "Hrafn Haubert" , enl = "hrafn haubert", model = 8515}
models.body[11874] = { name = "Tenryu Domaru" , enl = "tenryu domaru", model = 8516}
models.body[11875] = { name = "Kheper Jacket" , enl = "kheper jacket", model = 8512}
models.body[11876] = { name = "Auspex Doublet" , enl = "auspex doublet", model = 8514}
models.body[11877] = { name = "Paean Bliaut" , enl = "paean bliaut", model = 8513}
models.body[12028] = { name = "Ravager's Lorica" , enl = "ravager's lorica", model = 8474}
models.body[12029] = { name = "Tantra Cyclas" , enl = "tantra cyclas", model = 8475}
models.body[12030] = { name = "Orison Bliaud" , enl = "orison bliaud", model = 8476}
models.body[12031] = { name = "Goetia Coat" , enl = "goetia coat", model = 8477}
models.body[12032] = { name = "Estoqueur's Sayon" , enl = "estoqueur's sayon", model = 8478}
models.body[12033] = { name = "Raider's Vest" , enl = "raider's vest", model = 8479}
models.body[12034] = { name = "Creed Cuirass" , enl = "creed cuirass", model = 8480}
models.body[12035] = { name = "Bale Cuirass" , enl = "bale cuirass", model = 8481}
models.body[12036] = { name = "Ferine Gausape" , enl = "ferine gausape", model = 8482}
models.body[12037] = { name = "Aoidos' Hongreline" , enl = "aoidos' hongreline", model = 8483}
models.body[12038] = { name = "Sylvan Caban" , enl = "sylvan caban", model = 8484}
models.body[12039] = { name = "Unkai Domaru" , enl = "unkai domaru", model = 8485}
models.body[12040] = { name = "Iga Ningi" , enl = "iga ningi", model = 8486}
models.body[12041] = { name = "Lncr. Plackart" , enl = "lancer's plackart", model = 8487}
models.body[12042] = { name = "Caller's Doublet" , enl = "caller's doublet", model = 8488}
models.body[12043] = { name = "Mavi Mintan" , enl = "mavi mintan", model = 8489}
models.body[12044] = { name = "Navarch's Frac" , enl = "navarch's frac", model = 8490}
models.body[12045] = { name = "Cirque Farsetto" , enl = "cirque farsetto", model = 8491}
models.body[12046] = { name = "Charis Casaque" , enl = "charis casaque", model = 8497} -- 8505 Taru M
models.body[12047] = { name = "Savant's Gown" , enl = "savant's gown", model = 8498} -- 8606 Taru M
models.body[12144] = { name = "Ebon Cuirass" , enl = "ebon cuirass", model = 8462}
models.body[12145] = { name = "Furia Cuirass" , enl = "furia cuirass", model = 8463}
models.body[12146] = { name = "Ebur Cuirass" , enl = "ebur cuirass", model = 8464}
models.body[12147] = { name = "Ebon Mail" , enl = "ebon mail", model = 8465}
models.body[12148] = { name = "Furia Mail" , enl = "furia mail", model = 8466}
models.body[12149] = { name = "Ebur Mail" , enl = "ebur mail", model = 8467}
models.body[12150] = { name = "Ebon Haubert" , enl = "ebon haubert", model = 8468}
models.body[12151] = { name = "Furia Haubert" , enl = "furia haubert", model = 8469}
models.body[12152] = { name = "Ebur Haubert" , enl = "ebur haubert", model = 8470}
models.body[12153] = { name = "Ebon Breastplate" , enl = "ebon breastplate", model = 8471}
models.body[12154] = { name = "Furia Breastplate" , enl = "furia breastplate", model = 8472}
models.body[12155] = { name = "Ebur Breastplate" , enl = "ebur breastplate", model = 8473}
models.body[12156] = { name = "Ebon Harness" , enl = "ebon harness", model = 8438}
models.body[12157] = { name = "Furia Harness" , enl = "furia harness", model = 8439}
models.body[12158] = { name = "Ebur Harness" , enl = "ebur harness", model = 8440}
models.body[12159] = { name = "Ebon Jerkin" , enl = "ebon jerkin", model = 8441}
models.body[12160] = { name = "Furia Jerkin" , enl = "furia jerkin", model = 8442}
models.body[12161] = { name = "Ebur Jerkin" , enl = "ebur jerkin", model = 8443}
models.body[12162] = { name = "Shikkoku Togi" , enl = "shikkoku togi", model = 8444}
models.body[12163] = { name = "Shinku Togi" , enl = "shinku togi", model = 8445}
models.body[12164] = { name = "Ginhaku Togi" , enl = "ginhaku togi", model = 8446}
models.body[12165] = { name = "Ebon Vest" , enl = "ebon vest", model = 8447}
models.body[12166] = { name = "Furia Vest" , enl = "furia vest", model = 8448}
models.body[12167] = { name = "Ebur Vest" , enl = "ebur vest", model = 8449}
models.body[12168] = { name = "Ebon Talar" , enl = "ebon talar", model = 8450}
models.body[12169] = { name = "Furia Talar" , enl = "furia talar", model = 8451}
models.body[12170] = { name = "Ebur Talar" , enl = "ebur talar", model = 8452}
models.body[12171] = { name = "Ebon Coat" , enl = "ebon coat", model = 8453}
models.body[12172] = { name = "Furia Coat" , enl = "furia coat", model = 8454}
models.body[12173] = { name = "Ebur Coat" , enl = "ebur coat", model = 8455}
models.body[12174] = { name = "Ebon Bliaut" , enl = "ebon bliaut", model = 8456}
models.body[12175] = { name = "Furia Bliaut" , enl = "furia bliaut", model = 8457}
models.body[12176] = { name = "Ebur Bliaut" , enl = "ebur bliaut", model = 8458}
models.body[12177] = { name = "Ebon Frock" , enl = "ebon frock", model = 8459}
models.body[12178] = { name = "Furia Frock" , enl = "furia frock", model = 8460}
models.body[12179] = { name = "Ebur Frock" , enl = "ebur frock", model = 8461}
models.body[12544] = { name = "Breastplate" , enl = "breastplate", model = 8194}
models.body[12545] = { name = "Mtl. Breastplate" , enl = "mythril breastplate", model = 8221}
models.body[12546] = { name = "Gold Cuirass" , enl = "gold cuirass", model = 8217}
models.body[12547] = { name = "Darksteel Cuirass" , enl = "darksteel cuirass", model = 8214}
models.body[12548] = { name = "Adaman Cuirass" , enl = "adaman cuirass", model = 8247}
models.body[12549] = { name = "Koenig Cuirass" , enl = "koenig cuirass", model = 8287}
models.body[12550] = { name = "Irn.Msk. Cuirass" , enl = "iron musketeer's cuirass", model = 8217}
models.body[12551] = { name = "Judge's Cuirass" , enl = "judge's cuirass", model = 8222}
models.body[12552] = { name = "Chainmail" , enl = "chainmail", model = 8197}
models.body[12553] = { name = "Silver Mail" , enl = "silver mail", model = 8197}
models.body[12554] = { name = "Banded Mail" , enl = "banded mail", model = 8204}
models.body[12555] = { name = "Haubergeon" , enl = "haubergeon", model = 8232}
models.body[12556] = { name = "Hauberk" , enl = "hauberk", model = 8250}
models.body[12557] = { name = "Adaman Hauberk" , enl = "adaman hauberk", model = 8255}
models.body[12558] = { name = "Ryl.Kgt. Chainmail" , enl = "royal knight's chainmail", model = 8205}
models.body[12559] = { name = "Ryl.Sqr. Chainmail" , enl = "royal squire's chainmail", model = 8204}
models.body[12560] = { name = "Scale Mail" , enl = "scale mail", model = 8220}
models.body[12561] = { name = "Brass Scale Mail" , enl = "brass scale mail", model = 8220}
models.body[12562] = { name = "Kirin's Osode" , enl = "kirin's osode", model = 8291}
models.body[12563] = { name = "Coral Scale Mail" , enl = "coral scale mail", model = 8218}
models.body[12564] = { name = "Dragon Mail" , enl = "dragon mail", model = 8252}
models.body[12565] = { name = "Gavial Mail" , enl = "gavial mail", model = 8219}
models.body[12566] = { name = "Ctr. Scale Mail" , enl = "centurion's scale mail", model = 8218}
models.body[12567] = { name = "Steam Scale Mail" , enl = "steam scale mail", model = 8220}
models.body[12568] = { name = "Leather Vest" , enl = "leather vest", model = 8193}
models.body[12569] = { name = "Lizard Jerkin" , enl = "lizard jerkin", model = 8198}
models.body[12570] = { name = "Studded Vest" , enl = "studded vest", model = 8193}
models.body[12571] = { name = "Cuir Bouilli" , enl = "cuir bouilli", model = 8193}
models.body[12572] = { name = "Raptor Jerkin" , enl = "raptor jerkin", model = 8199}
models.body[12573] = { name = "Dusk Jerkin" , enl = "dusk jerkin", model = 8301}
models.body[12574] = { name = "Tiger Jerkin" , enl = "tiger jerkin", model = 8242}
models.body[12575] = { name = "Coeurl Jerkin" , enl = "coeurl jerkin", model = 8246}
models.body[12576] = { name = "Bronze Harness" , enl = "bronze harness", model = 8207}
models.body[12577] = { name = "Brass Harness" , enl = "brass harness", model = 8207}
models.body[12578] = { name = "Padded Armor" , enl = "padded armor", model = 8206}
models.body[12579] = { name = "Scorpion Harness" , enl = "scorpion harness", model = 8226}
models.body[12580] = { name = "Darksteel Harness" , enl = "darksteel harness", model = 8206}
models.body[12581] = { name = "Coral Harness" , enl = "coral harness", model = 8248}
models.body[12582] = { name = "Bone Harness" , enl = "bone harness", model = 8208}
models.body[12583] = { name = "Beetle Harness" , enl = "beetle harness", model = 8208}
models.body[12584] = { name = "Kenpogi" , enl = "kenpogi", model = 8209}
models.body[12585] = { name = "Cotton Dogi" , enl = "cotton dogi", model = 8209}
models.body[12586] = { name = "Soil Gi" , enl = "soil gi", model = 8209}
models.body[12587] = { name = "Hara-Ate" , enl = "hara-ate", model = 8201}
models.body[12588] = { name = "Shinobi Gi" , enl = "shinobi gi", model = 8196}
models.body[12589] = { name = "Scp. Brstplate +1" , enl = "scorpion breastplate +1", model = 8306}
models.body[12590] = { name = "Power Gi" , enl = "power gi", model = 8209}
models.body[12591] = { name = "Doublet +1" , enl = "doublet +1", model = 8213}
models.body[12592] = { name = "Doublet" , enl = "doublet", model = 8213}
models.body[12593] = { name = "Cotton Doublet" , enl = "cotton doublet", model = 8213}
models.body[12594] = { name = "Gambison" , enl = "gambison", model = 8215}
models.body[12595] = { name = "Wool Gambison" , enl = "wool gambison", model = 8215}
models.body[12596] = { name = "Battle Jupon" , enl = "battle jupon", model = 8216}
models.body[12597] = { name = "War Aketon" , enl = "war aketon", model = 8288}
models.body[12598] = { name = "Mrc.Cpt. Doublet" , enl = "mercenary captain's doublet", model = 8213}
models.body[12599] = { name = "Leather Vest +1" , enl = "leather vest +1", model = 8193}
models.body[12600] = { name = "Robe" , enl = "robe", model = 8212}
models.body[12601] = { name = "Linen Robe" , enl = "linen robe", model = 8212}
models.body[12602] = { name = "Wool Robe" , enl = "wool robe", model = 8210}
models.body[12603] = { name = "Velvet Robe" , enl = "velvet robe", model = 8210}
models.body[12604] = { name = "Silk Coat" , enl = "silk coat", model = 8211}
models.body[12605] = { name = "Noble's Tunic" , enl = "noble's tunic", model = 8249}
models.body[12606] = { name = "Tct.Mgc. Coat" , enl = "tactician magician's coat", model = 8211}
models.body[12607] = { name = "Bronze Harness +1" , enl = "bronze harness +1", model = 8207}
models.body[12608] = { name = "Tunic" , enl = "tunic", model = 8195}
models.body[12609] = { name = "Black Tunic" , enl = "black tunic", model = 8195}
models.body[12610] = { name = "Cloak" , enl = "cloak", model = 8202}
models.body[12611] = { name = "White Cloak" , enl = "white cloak", model = 8203}
models.body[12612] = { name = "Silk Cloak" , enl = "silk cloak", model = 8203}
models.body[12613] = { name = "Jurfu Cloak" , enl = "jurfu cloak", model = 8203}
models.body[12614] = { name = "Cmb.Cst. Cloak" , enl = "combat caster's cloak", model = 8202}
models.body[12615] = { name = "Robe +1" , enl = "robe +1", model = 8212}
models.body[12616] = { name = "Tunic +1" , enl = "tunic +1", model = 8195}
models.body[12617] = { name = "War Shinobi Gi" , enl = "war shinobi gi", model = 8234}
models.body[12618] = { name = "Yasha Samue" , enl = "yasha samue", model = 8290}
models.body[12620] = { name = "Grim Cuirass +1" , enl = "grim cuirass +1", model = 8394}
models.body[12621] = { name = "Scp. Breastplate" , enl = "scorpion breastplate", model = 8306}
models.body[12622] = { name = "Juogi +1" , enl = "juogi +1", model = 8409}
models.body[12623] = { name = "Yhel Jacket +1" , enl = "yhel jacket +1", model = 8396}
models.body[12624] = { name = "Cotton Dogi +1" , enl = "cotton dogi +1", model = 8209}
models.body[12625] = { name = "Gambison +1" , enl = "gambison +1", model = 8215}
models.body[12626] = { name = "Linen Robe +1" , enl = "linen robe +1", model = 8212}
models.body[12627] = { name = "Wool Robe +1" , enl = "wool robe +1", model = 8210}
models.body[12628] = { name = "Battle Jupon +1" , enl = "battle jupon +1", model = 8216}
models.body[12629] = { name = "Lgn. Harness" , enl = "legionnaire's harness", model = 8207}
models.body[12630] = { name = "Ryl.Ftm. Vest" , enl = "royal footman's vest", model = 8193}
models.body[12631] = { name = "Hume Tunic" , enl = "hume tunic", model = 8200}
models.body[12632] = { name = "Hume Vest" , enl = "hume vest", model = 8200}
models.body[12633] = { name = "Elvaan Jerkin" , enl = "elvaan jerkin", model = 8200}
models.body[12634] = { name = "Elvaan Bodice" , enl = "elvaan bodice", model = 8200}
models.body[12635] = { name = "Tarutaru Kaftan" , enl = "tarutaru kaftan", model = 8200}
models.body[12636] = { name = "Mithran Separates" , enl = "mithran separates", model = 8200}
models.body[12637] = { name = "Galkan Surcoat" , enl = "galkan surcoat", model = 8200}
models.body[12638] = { name = "Fighter's Lorica" , enl = "fighter's lorica", model = 8256}
models.body[12639] = { name = "Temple Cyclas" , enl = "temple cyclas", model = 8258}
models.body[12640] = { name = "Healer's Briault" , enl = "healer's briault", model = 8260}
models.body[12641] = { name = "Wizard's Coat" , enl = "wizard's coat", model = 8262}
models.body[12642] = { name = "Warlock's Tabard" , enl = "warlock's tabard", model = 8264}
models.body[12643] = { name = "Rogue's Vest" , enl = "rogue's vest", model = 8266}
models.body[12644] = { name = "Gallant Surcoat" , enl = "gallant surcoat", model = 8268}
models.body[12645] = { name = "Chaos Cuirass" , enl = "chaos cuirass", model = 8270}
models.body[12646] = { name = "Beast Jackcoat" , enl = "beast jackcoat", model = 8272}
models.body[12647] = { name = "Choral Jstcorps" , enl = "choral justaucorps", model = 8274}
models.body[12648] = { name = "Hunter's Jerkin" , enl = "hunter's jerkin", model = 8276}
models.body[12649] = { name = "Drachen Mail" , enl = "drachen mail", model = 8282}
models.body[12650] = { name = "Evoker's Doublet" , enl = "evoker's doublet", model = 8284}
models.body[12651] = { name = "White Cloak +1" , enl = "white cloak +1", model = 8203}
models.body[12652] = { name = "Silk Coat +1" , enl = "silk coat +1", model = 8211}
models.body[12653] = { name = "Mercenary's Gi" , enl = "mercenary's gi", model = 8209}
models.body[12654] = { name = "Custom Tunic" , enl = "custom tunic", model = 8223}
models.body[12655] = { name = "Custom Vest" , enl = "custom vest", model = 8223}
models.body[12656] = { name = "Magna Jerkin" , enl = "magna jerkin", model = 8223}
models.body[12657] = { name = "Magna Bodice" , enl = "magna bodice", model = 8223}
models.body[12658] = { name = "Wonder Kaftan" , enl = "wonder kaftan", model = 8223}
models.body[12659] = { name = "Savage Separates" , enl = "savage separates", model = 8223}
models.body[12660] = { name = "Elder's Surcoat" , enl = "elder's surcoat", model = 8223}
models.body[12661] = { name = "Solid Mail" , enl = "solid mail", model = 8220}
models.body[12662] = { name = "Chainmail +1" , enl = "chainmail +1", model = 8197}
models.body[12663] = { name = "Strong Harness" , enl = "strong harness", model = 8206}
models.body[12664] = { name = "Brass Harness +1" , enl = "brass harness +1", model = 8207}
models.body[12665] = { name = "Brs. Scale Mail +1" , enl = "brass scale mail +1", model = 8220}
models.body[12666] = { name = "Silver Mail +1" , enl = "silver mail +1", model = 8197}
models.body[12667] = { name = "Banded Mail +1" , enl = "banded mail +1", model = 8204}
models.body[12668] = { name = "Kenpogi +1" , enl = "kenpogi +1", model = 8209}
models.body[12669] = { name = "Great Doublet" , enl = "great doublet", model = 8213}
models.body[12670] = { name = "Cloak +1" , enl = "cloak +1", model = 8202}
models.body[12671] = { name = "Soil Gi +1" , enl = "soil gi +1", model = 8209}
models.body[13696] = { name = "Wool Gambison +1" , enl = "wool gambison +1", model = 8215}
models.body[13697] = { name = "Fine Jerkin" , enl = "fine jerkin", model = 8198}
models.body[13699] = { name = "Beak Jerkin" , enl = "beak jerkin", model = 8198}
models.body[13703] = { name = "Brigandine" , enl = "brigandine armor", model = 8235}
models.body[13705] = { name = "Ogre Jerkin" , enl = "ogre jerkin", model = 8286}
models.body[13707] = { name = "Strong Vest" , enl = "strong vest", model = 8193}
models.body[13709] = { name = "Cuir Bouilli +1" , enl = "cuir bouilli +1", model = 8193}
models.body[13710] = { name = "Brigandine +1" , enl = "brigandine armor +1", model = 8235}
models.body[13712] = { name = "Carapace Harness" , enl = "carapace harness", model = 8208}
models.body[13714] = { name = "Cpc. Harness +1" , enl = "carapace harness +1", model = 8208}
models.body[13716] = { name = "Bone Harness +1" , enl = "bone harness +1", model = 8208}
models.body[13717] = { name = "Beetle Harness +1" , enl = "beetle harness +1", model = 8208}
models.body[13718] = { name = "Ryl.Ftm. Tunic" , enl = "royal footman's tunic", model = 8195}
models.body[13719] = { name = "Ryl.Sqr. Robe" , enl = "royal squire's robe", model = 8210}
models.body[13720] = { name = "Ryl.Kgt. Cloak" , enl = "royal knight's cloak", model = 8203}
models.body[13721] = { name = "Irn.Msk. Gambison" , enl = "iron musketeer's gambison", model = 8215}
models.body[13722] = { name = "Ryl.Kgt. Aketon" , enl = "royal knight's aketon", model = 8230}
models.body[13723] = { name = "Pyro Robe" , enl = "pyro robe", model = 8212}
models.body[13724] = { name = "Breastplate +1" , enl = "breastplate +1", model = 8194}
models.body[13725] = { name = "Mage's Tunic" , enl = "mage's tunic", model = 8195}
models.body[13726] = { name = "Mage's Robe" , enl = "mage's robe", model = 8210}
models.body[13727] = { name = "Dino Jerkin" , enl = "dino jerkin", model = 8199}
models.body[13728] = { name = "Jujitsu Gi" , enl = "jujitsu gi", model = 8229}
models.body[13729] = { name = "Priest's Robe" , enl = "priest's robe", model = 8212}
models.body[13730] = { name = "Frost Robe" , enl = "frost robe", model = 8210}
models.body[13731] = { name = "Faerie Tunic" , enl = "faerie tunic", model = 8195}
models.body[13732] = { name = "Earth Doublet" , enl = "earth doublet", model = 8235}
models.body[13733] = { name = "Shinobi Gi +1" , enl = "shinobi gi +1", model = 8196}
models.body[13734] = { name = "Scp. Harness +1" , enl = "scorpion harness +1", model = 8226}
models.body[13735] = { name = "Haubergeon +1" , enl = "haubergeon +1", model = 8232}
models.body[13736] = { name = "Stolid Breastplate" , enl = "stolid breastplate", model = 8194}
models.body[13737] = { name = "Mtl. Brstplate +1" , enl = "mythril breastplate +1", model = 8221}
models.body[13738] = { name = "Gilt Cuirass" , enl = "gilt cuirass", model = 8217}
models.body[13739] = { name = "Beak Jerkin +1" , enl = "beak jerkin +1", model = 8198}
models.body[13740] = { name = "Byrnie" , enl = "byrnie", model = 8233}
models.body[13741] = { name = "Byrnie +1" , enl = "byrnie +1", model = 8233}
models.body[13742] = { name = "Aketon" , enl = "aketon", model = 8231}
models.body[13743] = { name = "Aketon +1" , enl = "aketon +1", model = 8231}
models.body[13744] = { name = "Justaucorps" , enl = "justaucorps", model = 8236}
models.body[13745] = { name = "Justaucorps +1" , enl = "justaucorps +1", model = 8236}
models.body[13746] = { name = "Gem Cuirass" , enl = "gem cuirass", model = 8247}
models.body[13747] = { name = "Gavial Mail +1" , enl = "gavial mail +1", model = 8219}
models.body[13748] = { name = "Vermillion Cloak" , enl = "vermillion cloak", model = 8239}
models.body[13749] = { name = "Royal Cloak" , enl = "royal cloak", model = 8239}
models.body[13750] = { name = "Linen Doublet" , enl = "linen doublet", model = 8213}
models.body[13751] = { name = "Linen Doublet +1" , enl = "linen doublet +1", model = 8213}
models.body[13752] = { name = "Wool Doublet" , enl = "wool doublet", model = 8213}
models.body[13753] = { name = "Wool Doublet +1" , enl = "wool doublet +1", model = 8213}
models.body[13754] = { name = "Black Cotehardie" , enl = "black cotehardie", model = 8241}
models.body[13755] = { name = "Flora Cotehardie" , enl = "flora cotehardie", model = 8241}
models.body[13756] = { name = "Dst. Cuirass +1" , enl = "darksteel cuirass +1", model = 8214}
models.body[13757] = { name = "Lord's Cuirass" , enl = "lord's cuirass", model = 8228}
models.body[13758] = { name = "King's Cuirass" , enl = "king's cuirass", model = 8228}
models.body[13759] = { name = "Perle Hauberk" , enl = "perle hauberk", model = 8431}
models.body[13760] = { name = "Aurore Doublet" , enl = "aurore doublet", model = 8433}
models.body[13761] = { name = "Cor. Scale Mail +1" , enl = "coral scale mail +1", model = 8218}
models.body[13762] = { name = "Dragon Mail +1" , enl = "dragon mail +1", model = 8252}
models.body[13763] = { name = "Feral Jerkin" , enl = "feral jerkin", model = 8242}
models.body[13764] = { name = "Torama Jerkin" , enl = "torama jerkin", model = 8246}
models.body[13765] = { name = "Dst. Harness +1" , enl = "darksteel harness +1", model = 8206}
models.body[13766] = { name = "Merman's Harness" , enl = "merman's harness", model = 8248}
models.body[13767] = { name = "Demon's Harness" , enl = "demon's harness", model = 8227}
models.body[13768] = { name = "Dmn. Harness +1" , enl = "demon's harness +1", model = 8227}
models.body[13769] = { name = "Hara-Ate +1" , enl = "hara-ate +1", model = 8201}
models.body[13770] = { name = "War Shinobi Gi +1" , enl = "war shinobi gi +1", model = 8234}
models.body[13771] = { name = "War Aketon +1" , enl = "war aketon +1", model = 8288}
models.body[13772] = { name = "Bloody Aketon" , enl = "bloody aketon", model = 8230}
models.body[13773] = { name = "Carnage Aketon" , enl = "carnage aketon", model = 8230}
models.body[13774] = { name = "Aristocrat's Coat" , enl = "aristocrat's coat", model = 8249}
models.body[13775] = { name = "Blue Cotehardie" , enl = "blue cotehardie", model = 8240}
models.body[13776] = { name = "Blue Cotehard. +1" , enl = "blue cotehardie +1", model = 8240}
models.body[13777] = { name = "Silk Cloak +1" , enl = "silk cloak +1", model = 8203}
models.body[13778] = { name = "Teal Saio" , enl = "teal saio", model = 8432}
models.body[13779] = { name = "Black Cloak" , enl = "black cloak", model = 8238}
models.body[13780] = { name = "Demon's Cloak" , enl = "demon's cloak", model = 8238}
models.body[13781] = { name = "Myochin Domaru" , enl = "myochin domaru", model = 8278}
models.body[13782] = { name = "Ninja Chainmail" , enl = "ninja chainmail", model = 8280}
models.body[13783] = { name = "Iron Scale Mail" , enl = "iron scale mail", model = 8244}
models.body[13784] = { name = "Iron Scale Mail +1" , enl = "iron scale mail +1", model = 8244}
models.body[13785] = { name = "Steel Scale Mail" , enl = "steel scale mail", model = 8245}
models.body[13786] = { name = "Stl. Scale Mail +1" , enl = "steel scale mail +1", model = 8245}
models.body[13787] = { name = "Dalmatica" , enl = "dalmatica", model = 8299}
models.body[13788] = { name = "Dalmatica +1" , enl = "dalmatica +1", model = 8299}
models.body[13789] = { name = "Cpc. Breastplate" , enl = "carapace breastplate", model = 8300}
models.body[13790] = { name = "Cpc. Brstplate +1" , enl = "carapace breastplate +1", model = 8300}
models.body[13791] = { name = "Timarli Jawshan" , enl = "timarli jawshan", model = 8395}
models.body[13792] = { name = "Grim Cuirass" , enl = "grim cuirass", model = 8394}
models.body[13793] = { name = "Hauberk +1" , enl = "hauberk +1", model = 8250}
models.body[13794] = { name = "Heavy Cuirass" , enl = "heavy cuirass", model = 8214}
models.body[13795] = { name = "Arhat's Gi" , enl = "arhat's gi", model = 8251}
models.body[13796] = { name = "Bishop's Robe" , enl = "bishop's robe", model = 8212}
models.body[13797] = { name = "Bishop's Robe +1" , enl = "bishop's robe +1", model = 8212}
models.body[13798] = { name = "Gaia Doublet" , enl = "gaia doublet", model = 8235}
models.body[13799] = { name = "Gaia Doublet +1" , enl = "gaia doublet +1", model = 8235}
models.body[13800] = { name = "Master's Gi" , enl = "master's gi", model = 8229}
models.body[13801] = { name = "Master's Gi +1" , enl = "master's gi +1", model = 8229}
models.body[13802] = { name = "Arhat's Gi +1" , enl = "arhat's gi +1", model = 8251}
models.body[13803] = { name = "Shaman's Cloak" , enl = "shaman's cloak", model = 8203}
models.body[13804] = { name = "Minstrel's Coat" , enl = "minstrel's coat", model = 8211}
models.body[13805] = { name = "Assault Jerkin" , enl = "assault jerkin", model = 8246}
models.body[13806] = { name = "Vgd. Tunica" , enl = "vagabond's tunica", model = 8296}
models.body[13807] = { name = "Nomad's Tunica" , enl = "nomad's tunica", model = 8296}
models.body[13808] = { name = "Fsh. Tunica" , enl = "fisherman's tunica", model = 8294}
models.body[13809] = { name = "Angler's Tunica" , enl = "angler's tunica", model = 8294}
models.body[13810] = { name = "Choc. Jack Coat" , enl = "chocobo jack coat", model = 8295}
models.body[13811] = { name = "Rider's Jack Coat" , enl = "rider's jack coat", model = 8295}
models.body[13812] = { name = "Holy Breastplate" , enl = "holy breastplate", model = 8289}
models.body[13813] = { name = "Divine Breastplate" , enl = "divine breastplate", model = 8289}
models.body[13814] = { name = "Austere Robe" , enl = "austere robe", model = 8307}
models.body[13815] = { name = "Penance Robe" , enl = "penance robe", model = 8307}
models.body[13816] = { name = "Narasimha's Vest" , enl = "narasimha's vest", model = 8225}
models.body[13817] = { name = "Vishnu's Vest" , enl = "vishnu's vest", model = 8225}
models.body[13818] = { name = "Garrison Tunica" , enl = "garrison tunica", model = 8296}
models.body[13819] = { name = "Onoko Yukata" , enl = "onoko yukata", model = 8318}
models.body[13820] = { name = "Omina Yukata" , enl = "omina yukata", model = 8319}
models.body[13821] = { name = "Lord's Yukata" , enl = "lord's yukata", model = 8318}
models.body[13822] = { name = "Lady's Yukata" , enl = "lady's yukata", model = 8319}
models.body[13823] = { name = "Regen Cuirass" , enl = "regen cuirass", model = 8228}
models.body[14284] = { name = "Northern Jerkin" , enl = "northern jerkin", model = 8242}
models.body[14285] = { name = "Tundra Jerkin" , enl = "tundra jerkin", model = 8242}
models.body[14336] = { name = "Juogi" , enl = "juogi", model = 8409}
models.body[14337] = { name = "Loki's Kaftan" , enl = "loki's kaftan", model = 8426}
models.body[14338] = { name = "Bastokan Harness" , enl = "bastokan harness", model = 8207}
models.body[14339] = { name = "Republic Harness" , enl = "republic harness", model = 8207}
models.body[14340] = { name = "Ryl.Sqr. Chnml. +1" , enl = "royal squire's chainmail +1", model = 8204}
models.body[14341] = { name = "Ryl.Sqr. Chnml. +2" , enl = "royal squire's chainmail +2", model = 8204}
models.body[14342] = { name = "I.M. Cuirass +1" , enl = "iron musketeer's cuirass +1", model = 8217}
models.body[14343] = { name = "I.M. Cuirass +2" , enl = "iron musketeer's cuirass +2", model = 8217}
models.body[14344] = { name = "San d'Orian Vest" , enl = "san d'orian vest", model = 8193}
models.body[14345] = { name = "Kingdom Vest" , enl = "kingdom vest", model = 8193}
models.body[14346] = { name = "Bas. Scale Mail" , enl = "bastokan scale mail", model = 8218}
models.body[14347] = { name = "Rep. Scale Mail" , enl = "republic scale mail", model = 8218}
models.body[14348] = { name = "San d'Orian Tunic" , enl = "san d'orian tunic", model = 8195}
models.body[14349] = { name = "Kingdom Tunic" , enl = "kingdom tunic", model = 8195}
models.body[14350] = { name = "Windurstian Gi" , enl = "windurstian gi", model = 8209}
models.body[14351] = { name = "Federation Gi" , enl = "federation gi", model = 8209}
models.body[14352] = { name = "Win. Doublet" , enl = "windurstian doublet", model = 8213}
models.body[14353] = { name = "Fed. Doublet" , enl = "federation doublet", model = 8213}
models.body[14354] = { name = "C.C. Cloak +1" , enl = "combat caster's cloak +1", model = 8202}
models.body[14355] = { name = "C.C. Cloak +2" , enl = "combat caster's cloak +2", model = 8202}
models.body[14356] = { name = "Irn.Msk.Gmbsn. +1" , enl = "iron musketeer's gambison +1", model = 8215}
models.body[14357] = { name = "Irn.Msk.Gmbsn. +2" , enl = "iron musketeer's gambison +2", model = 8215}
models.body[14358] = { name = "Ryl.Sqr. Robe +1" , enl = "royal squire's robe +1", model = 8210}
models.body[14359] = { name = "Ryl.Sqr. Robe +2" , enl = "royal squire's robe +2", model = 8210}
models.body[14360] = { name = "R.K. Cloak +1" , enl = "royal knight's cloak +1", model = 8203}
models.body[14361] = { name = "R.K. Cloak +2" , enl = "royal knight's cloak +2", model = 8203}
models.body[14362] = { name = "T.M. Coat +1" , enl = "tactician magician's coat +1", model = 8211}
models.body[14363] = { name = "T.M. Coat +2" , enl = "tactician magician's coat +2", model = 8211}
models.body[14364] = { name = "Yhel Jacket" , enl = "yhel jacket", model = 8396}
models.body[14365] = { name = "Augur's Jaseran" , enl = "augur's jaseran", model = 8415}
models.body[14366] = { name = "Ogre Jerkin +1" , enl = "ogre jerkin +1", model = 8286}
models.body[14367] = { name = "Crm. Scale Mail" , enl = "crimson scale mail", model = 8254}
models.body[14368] = { name = "Blood Scale Mail" , enl = "blood scale mail", model = 8254}
models.body[14369] = { name = "Arcane Robe" , enl = "arcane robe", model = 8341}
models.body[14370] = { name = "Kaiser Cuirass" , enl = "kaiser cuirass", model = 8287}
models.body[14371] = { name = "Armada Hauberk" , enl = "armada hauberk", model = 8255}
models.body[14372] = { name = "Cardinal Vest" , enl = "cardinal vest", model = 8225}
models.body[14373] = { name = "Bachelor Vest" , enl = "bachelor vest", model = 8225}
models.body[14374] = { name = "Field Tunica" , enl = "field tunica", model = 8297}
models.body[14375] = { name = "Worker Tunica" , enl = "worker tunica", model = 8297}
models.body[14376] = { name = "Rasetsu Samue" , enl = "rasetsu samue", model = 8252}
models.body[14377] = { name = "Rasetsu Samue +1" , enl = "rasetsu samue +1", model = 8252}
models.body[14378] = { name = "Hecatomb Harness" , enl = "hecatomb harness", model = 8292}
models.body[14379] = { name = "Hct. Harness +1" , enl = "hecatomb harness +1", model = 8292}
models.body[14380] = { name = "Errant Hpl." , enl = "errant houppelande", model = 8293}
models.body[14381] = { name = "Mahatma Hpl." , enl = "mahatma houppelande", model = 8293}
models.body[14382] = { name = "Plastron" , enl = "plastron", model = 8343}
models.body[14383] = { name = "Plastron +1" , enl = "plastron +1", model = 8343}
models.body[14384] = { name = "Opaline Dress" , enl = "opaline dress", model = 8308}
models.body[14385] = { name = "Ceremonial Dress" , enl = "ceremonial dress", model = 8308}
models.body[14386] = { name = "Wedding Dress" , enl = "wedding dress", model = 8308}
models.body[14387] = { name = "Shura Togi" , enl = "shura togi", model = 8298}
models.body[14388] = { name = "Shura Togi +1" , enl = "shura togi +1", model = 8298}
models.body[14389] = { name = "Dragon Harness" , enl = "dragon harness", model = 8302}
models.body[14390] = { name = "Dragon Harness +1" , enl = "dragon harness +1", model = 8302}
models.body[14391] = { name = "Dusk Jerkin +1" , enl = "dusk jerkin +1", model = 8301}
models.body[14392] = { name = "Carpenter's Apron" , enl = "carpenter's apron", model = 8309}
models.body[14393] = { name = "Blacksmith's Apn." , enl = "blacksmith's apron", model = 8310}
models.body[14394] = { name = "Goldsmith's Apron" , enl = "goldsmith's apron", model = 8317}
models.body[14395] = { name = "Weaver's Apron" , enl = "weaver's apron", model = 8311}
models.body[14396] = { name = "Tanner's Apron" , enl = "tanner's apron", model = 8315}
models.body[14397] = { name = "Boneworker's Apn." , enl = "boneworker's apron", model = 8313}
models.body[14398] = { name = "Alchemist's Apron" , enl = "alchemist's apron", model = 8312}
models.body[14399] = { name = "Culinarian's Apron" , enl = "culinarian's apron", model = 8316}
models.body[14400] = { name = "Fisherman's Apron" , enl = "fisherman's apron", model = 8314}
models.body[14401] = { name = "Duende Cotehardie" , enl = "duende cotehardie", model = 8240}
models.body[14402] = { name = "Nokizaru Gi" , enl = "nokizaru gi", model = 8196}
models.body[14403] = { name = "Rapparee Harness" , enl = "rapparee harness", model = 8227}
models.body[14404] = { name = "Shm. Hara-Ate" , enl = "shinimusha hara-ate", model = 8201}
models.body[14405] = { name = "Wyvern Mail" , enl = "wyvern mail", model = 8220}
models.body[14406] = { name = "Shikaree Aketon" , enl = "shikaree aketon", model = 8288}
models.body[14407] = { name = "Cerise Doublet" , enl = "cerise doublet", model = 8324}
models.body[14408] = { name = "Glamor Jupon" , enl = "glamor jupon", model = 8216}
models.body[14409] = { name = "Gloom Breastplate" , enl = "gloom breastplate", model = 8221}
models.body[14410] = { name = "Nimbus Doublet" , enl = "nimbus doublet", model = 8235}
models.body[14411] = { name = "Aikido Gi" , enl = "aikido gi", model = 8229}
models.body[14412] = { name = "Parade Cuirass" , enl = "parade cuirass", model = 8228}
models.body[14413] = { name = "Gaudy Harness" , enl = "gaudy harness", model = 8248}
models.body[14414] = { name = "Sha'ir Manteel" , enl = "sha'ir manteel", model = 8327}
models.body[14415] = { name = "Sheikh Manteel" , enl = "sheikh manteel", model = 8327}
models.body[14416] = { name = "Barone Corazza" , enl = "barone corazza", model = 8328}
models.body[14417] = { name = "Conte Corazza" , enl = "conte corazza", model = 8328}
models.body[14418] = { name = "Bison Jacket" , enl = "bison jacket", model = 8326}
models.body[14419] = { name = "Brave's Jacket" , enl = "brave's jacket", model = 8326}
models.body[14420] = { name = "Igqira Weskit" , enl = "igqira weskit", model = 8329}
models.body[14421] = { name = "Genie Weskit" , enl = "genie weskit", model = 8329}
models.body[14422] = { name = "Noct Doublet" , enl = "noct doublet", model = 8325}
models.body[14423] = { name = "Mist Tunic" , enl = "mist tunic", model = 8322}
models.body[14424] = { name = "Seer's Tunic" , enl = "seer's tunic", model = 8323}
models.body[14425] = { name = "Garish Tunic" , enl = "garish tunic", model = 8322}
models.body[14426] = { name = "Shade Harness" , enl = "shade harness", model = 8321}
models.body[14427] = { name = "Seer's Tunic +1" , enl = "seer's tunic +1", model = 8323}
models.body[14428] = { name = "Kingdom Aketon" , enl = "kingdom aketon", model = 8303}
models.body[14429] = { name = "Republic Aketon" , enl = "republic aketon", model = 8305}
models.body[14430] = { name = "Federation Aketon" , enl = "federation aketon", model = 8304}
models.body[14431] = { name = "Eisenbrust" , enl = "eisenbrust", model = 8330}
models.body[14432] = { name = "Rubious Tunic" , enl = "rubious tunic", model = 8322}
models.body[14433] = { name = "Shade Harness +1" , enl = "shade harness +1", model = 8321}
models.body[14434] = { name = "Noct Doublet +1" , enl = "noct doublet +1", model = 8325}
models.body[14435] = { name = "Kampfbrust" , enl = "kampfbrust", model = 8330}
models.body[14436] = { name = "Blessed Briault" , enl = "blessed briault", model = 8334}
models.body[14437] = { name = "Hachiman Domaru" , enl = "hachiman domaru", model = 8333}
models.body[14438] = { name = "Blessed Briault +1" , enl = "blessed briault +1", model = 8334}
models.body[14439] = { name = "Hmn. Domaru +1" , enl = "hachiman domaru +1", model = 8333}
models.body[14440] = { name = "Chasuble" , enl = "chasuble", model = 8335}
models.body[14441] = { name = "Chasuble +1" , enl = "chasuble +1", model = 8335}
models.body[14442] = { name = "Yasha Samue +1" , enl = "yasha samue +1", model = 8290}
models.body[14443] = { name = "Vampire Cloak" , enl = "vampire cloak", model = 8238}
models.body[14444] = { name = "Alumine Haubert" , enl = "alumine haubert", model = 8342}
models.body[14445] = { name = "Luisant Haubert" , enl = "luisant haubert", model = 8342}
models.body[14446] = { name = "Trader's Saio" , enl = "trader's saio", model = 8341}
models.body[14447] = { name = "Baron's Saio" , enl = "baron's saio", model = 8341}
models.body[14448] = { name = "Unicorn Harness" , enl = "unicorn harness", model = 8340}
models.body[14449] = { name = "Ucn. Harness +1" , enl = "unicorn harness +1", model = 8340}
models.body[14450] = { name = "Hume Gilet" , enl = "hume gilet", model = 8349}
models.body[14451] = { name = "Hume Top" , enl = "hume top", model = 8349}
models.body[14452] = { name = "Elvaan Gilet" , enl = "elvaan gilet", model = 8349}
models.body[14453] = { name = "Elvaan Top" , enl = "elvaan top", model = 8349}
models.body[14454] = { name = "Tarutaru Maillot" , enl = "tarutaru maillot", model = 8349}
models.body[14455] = { name = "Mithra Top" , enl = "mithra top", model = 8349}
models.body[14456] = { name = "Galka Gilet" , enl = "galka gilet", model = 8349}
models.body[14457] = { name = "Hume Gilet +1" , enl = "hume gilet +1", model = 8349}
models.body[14458] = { name = "Hume Top +1" , enl = "hume top +1", model = 8349}
models.body[14459] = { name = "Elvaan Gilet +1" , enl = "elvaan gilet +1", model = 8349}
models.body[14460] = { name = "Elvaan Top +1" , enl = "elvaan top +1", model = 8349}
models.body[14461] = { name = "Taru. Maillot +1" , enl = "tarutaru maillot +1", model = 8349}
models.body[14462] = { name = "Mithra Top +1" , enl = "mithra top +1", model = 8349}
models.body[14463] = { name = "Galka Gilet +1" , enl = "galka gilet +1", model = 8349}
models.body[14464] = { name = "Trailer's Tunica" , enl = "trailer's tunica", model = 8297}
models.body[14465] = { name = "Nanban Kariginu" , enl = "nanban kariginu", model = 8294}
models.body[14466] = { name = "Fomor Tunic" , enl = "fomor tunic", model = 8195}
models.body[14467] = { name = "Archer's Jupon" , enl = "archer's jupon", model = 8216}
models.body[14468] = { name = "Yinyang Robe" , enl = "yinyang robe", model = 8229}
models.body[14469] = { name = "Reverend Mail" , enl = "reverend mail", model = 8232}
models.body[14470] = { name = "Assault Brstplate" , enl = "assault breastplate", model = 8224}
models.body[14471] = { name = "Tarutaru Top" , enl = "tarutaru top", model = 8349}
models.body[14472] = { name = "Tarutaru Top +1" , enl = "tarutaru top +1", model = 8349}
models.body[14473] = { name = "Ftr. Lorica +1" , enl = "fighter's lorica +1", model = 8256}
models.body[14474] = { name = "Tpl. Cyclas +1" , enl = "temple cyclas +1", model = 8258}
models.body[14475] = { name = "Hlr. Briault +1" , enl = "healer's briault +1", model = 8260}
models.body[14476] = { name = "Wzd. Coat +1" , enl = "wizard's coat +1", model = 8262}
models.body[14477] = { name = "Wlk. Tabard +1" , enl = "warlock's tabard +1", model = 8264}
models.body[14478] = { name = "Rog. Vest +1" , enl = "rogue's vest +1", model = 8266}
models.body[14479] = { name = "Glt. Surcoat +1" , enl = "gallant surcoat +1", model = 8268}
models.body[14480] = { name = "Chs. Cuirass +1" , enl = "chaos cuirass +1", model = 8270}
models.body[14481] = { name = "Bst. Jackcoat +1" , enl = "beast jackcoat +1", model = 8272}
models.body[14482] = { name = "Chl. Jstcorps +1" , enl = "choral justaucorps +1", model = 8274}
models.body[14483] = { name = "Htr. Jerkin +1" , enl = "hunter's jerkin +1", model = 8276}
models.body[14484] = { name = "Myn. Domaru +1" , enl = "myochin domaru +1", model = 8278}
models.body[14485] = { name = "Nin. Chainmail +1" , enl = "ninja chainmail +1", model = 8280}
models.body[14486] = { name = "Drn. Mail +1" , enl = "drachen mail +1", model = 8282}
models.body[14487] = { name = "Evk. Doublet +1" , enl = "evoker's doublet +1", model = 8284}
models.body[14488] = { name = "Homam Corazza" , enl = "homam corazza", model = 8351}
models.body[14489] = { name = "Nashira Manteel" , enl = "nashira manteel", model = 8352}
models.body[14490] = { name = "Mana Tunic" , enl = "mana tunic", model = 8195}
models.body[14491] = { name = "Mana Cloak" , enl = "mana cloak", model = 8202}
models.body[14492] = { name = "High Mana Cloak" , enl = "high mana cloak", model = 8203}
models.body[14493] = { name = "Healing Vest" , enl = "healing vest", model = 8193}
models.body[14494] = { name = "Healing Mail" , enl = "healing mail", model = 8252}
models.body[14495] = { name = "Healing Harness" , enl = "healing harness", model = 8208}
models.body[14496] = { name = "Healing Jstcorps" , enl = "healing justaucorps", model = 8236}
models.body[14497] = { name = "High Heal. Harness" , enl = "high healing harness", model = 8208}
models.body[14498] = { name = "Crow Jupon" , enl = "crow jupon", model = 8354}
models.body[14499] = { name = "Raven Jupon" , enl = "raven jupon", model = 8354}
models.body[14500] = { name = "War. Lorica +1" , enl = "warrior's lorica +1", model = 8257}
models.body[14501] = { name = "Mel. Cyclas +1" , enl = "melee cyclas +1", model = 8259}
models.body[14502] = { name = "Clr. Briault +1" , enl = "cleric's briault +1", model = 8261}
models.body[14503] = { name = "Src. Coat +1" , enl = "sorcerer's coat +1", model = 8263}
models.body[14504] = { name = "Dls. Tabard +1" , enl = "duelist's tabard +1", model = 8265}
models.body[14505] = { name = "Asn. Vest +1" , enl = "assassin's vest +1", model = 8267}
models.body[14506] = { name = "Vlr. Surcoat +1" , enl = "valor surcoat +1", model = 8269}
models.body[14507] = { name = "Abs. Cuirass +1" , enl = "abyss cuirass +1", model = 8271}
models.body[14508] = { name = "Mst. Jackcoat +1" , enl = "monster jackcoat +1", model = 8273}
models.body[14509] = { name = "Brd. Jstcorps +1" , enl = "bard's justaucorps +1", model = 8275}
models.body[14510] = { name = "Sct. Jerkin +1" , enl = "scout's jerkin +1", model = 8277}
models.body[14511] = { name = "Sao. Domaru +1" , enl = "saotome domaru +1", model = 8279}
models.body[14512] = { name = "Kog. Chainmail +1" , enl = "koga chainmail +1", model = 8281}
models.body[14513] = { name = "Wym. Mail +1" , enl = "wyrm mail +1", model = 8283}
models.body[14514] = { name = "Smn. Doublet +1" , enl = "summoner's doublet +1", model = 8285}
models.body[14515] = { name = "Hydra Doublet" , enl = "hydra doublet", model = 8324}
models.body[14516] = { name = "Hydra Harness" , enl = "hydra harness", model = 8320}
models.body[14517] = { name = "Hydra Haubert" , enl = "hydra haubert", model = 8356}
models.body[14518] = { name = "Hydra Jupon" , enl = "hydra jupon", model = 8355}
models.body[14519] = { name = "Dream Robe" , enl = "dream robe", model = 8332}
models.body[14520] = { name = "Dream Robe +1" , enl = "dream robe +1", model = 8332}
models.body[14521] = { name = "Magus Jubbah" , enl = "magus jubbah", model = 8357}
models.body[14522] = { name = "Corsair's Frac" , enl = "corsair's frac", model = 8359}
models.body[14523] = { name = "Pup. Tobe" , enl = "puppetry tobe", model = 8361}
models.body[14524] = { name = "Sipahi Jawshan" , enl = "sipahi jawshan", model = 8363}
models.body[14525] = { name = "Amir Korazin" , enl = "amir korazin", model = 8366}
models.body[14526] = { name = "Jaridah Peti" , enl = "jaridah peti", model = 8364}
models.body[14527] = { name = "Yigit Gomlek" , enl = "yigit gomlek", model = 8368}
models.body[14528] = { name = "Abtal Jawshan" , enl = "abtal jawshan", model = 8363}
models.body[14529] = { name = "Akinji Peti" , enl = "akinji peti", model = 8364}
models.body[14530] = { name = "Pln. Khazagand" , enl = "pahluwan khazagand", model = 8367}
models.body[14531] = { name = "Bannaret Mail" , enl = "bannaret mail", model = 8197}
models.body[14532] = { name = "Otoko Yukata" , enl = "otoko yukata", model = 8318}
models.body[14533] = { name = "Onago Yukata" , enl = "onago yukata", model = 8319}
models.body[14534] = { name = "Otokogimi Yukata" , enl = "otokogimi yukata", model = 8318}
models.body[14535] = { name = "Onnagimi Yukata" , enl = "onnagimi yukata", model = 8319}
models.body[14536] = { name = "Arakan Samue" , enl = "arakan samue", model = 8251}
models.body[14537] = { name = "Hydra Mail" , enl = "hydra mail", model = 8219}
models.body[14538] = { name = "Hydra Mail +1" , enl = "hydra mail +1", model = 8219}
models.body[14539] = { name = "Kyudogi" , enl = "kyudogi", model = 8372}
models.body[14540] = { name = "Kyudogi +1" , enl = "kyudogi +1", model = 8372}
models.body[14541] = { name = "Taikyoku Kenpogi" , enl = "taikyoku kenpogi", model = 8209}
models.body[14542] = { name = "Silken Coat" , enl = "silken coat", model = 8211}
models.body[14543] = { name = "Magi Coat" , enl = "magi coat", model = 8211}
models.body[14544] = { name = "Corselet" , enl = "corselet", model = 8371}
models.body[14545] = { name = "Corselet +1" , enl = "corselet +1", model = 8371}
models.body[14546] = { name = "Ares' Cuirass" , enl = "ares' cuirass", model = 8374}
models.body[14547] = { name = "Enyo's Brstplate" , enl = "enyo's breastplate", model = 8294}
models.body[14548] = { name = "Phobos's Cuirass" , enl = "phobos's cuirass", model = 8217}
models.body[14549] = { name = "Deimos's Cuirass" , enl = "deimos's cuirass", model = 8214}
models.body[14550] = { name = "Skadi's Cuirie" , enl = "skadi's cuirie", model = 8375}
models.body[14551] = { name = "Njord's Jerkin" , enl = "njord's jerkin", model = 8198}
models.body[14552] = { name = "Freyr's Jerkin" , enl = "freyr's jerkin", model = 8199}
models.body[14553] = { name = "Freya's Jerkin" , enl = "freya's jerkin", model = 8242}
models.body[14554] = { name = "Usukane Haramaki" , enl = "usukane haramaki", model = 8376}
models.body[14555] = { name = "Hoshikazu Gi" , enl = "hoshikazu gi", model = 8209}
models.body[14556] = { name = "Tsukikazu Togi" , enl = "tsukikazu togi", model = 8196}
models.body[14557] = { name = "Hikazu Hara-Ate" , enl = "hikazu hara-ate", model = 8201}
models.body[14558] = { name = "Marduk's Jubbah" , enl = "marduk's jubbah", model = 8377}
models.body[14559] = { name = "Anu's Doublet" , enl = "anu's doublet", model = 8213}
models.body[14560] = { name = "Ea's Doublet" , enl = "ea's doublet", model = 8325}
models.body[14561] = { name = "Enlil's Gambison" , enl = "enlil's gambison", model = 8215}
models.body[14562] = { name = "Morrigan's Robe" , enl = "morrigan's robe", model = 8378}
models.body[14563] = { name = "Nemain's Robe" , enl = "nemain's robe", model = 8212}
models.body[14564] = { name = "Bodb's Robe" , enl = "bodb's robe", model = 8210}
models.body[14565] = { name = "Macha's Coat" , enl = "macha's coat", model = 8211}
models.body[14566] = { name = "Khimaira Jacket" , enl = "khimaira jacket", model = 8326}
models.body[14567] = { name = "Stout Jacket" , enl = "stout jacket", model = 8326}
models.body[14568] = { name = "Askar Korazin" , enl = "askar korazin", model = 8387}
models.body[14569] = { name = "Denali Jacket" , enl = "denali jacket", model = 8388}
models.body[14570] = { name = "Goliard Saio" , enl = "goliard saio", model = 8389}
models.body[14571] = { name = "Tabin Jupon" , enl = "tabin jupon", model = 8216}
models.body[14572] = { name = "Tabin Jupon +1" , enl = "tabin jupon +1", model = 8216}
models.body[14573] = { name = "Shadow Brstplate" , enl = "shadow breastplate", model = 8392}
models.body[14574] = { name = "Valk. Breastplate" , enl = "valkyrie's breastplate", model = 8392}
models.body[14575] = { name = "Shadow Coat" , enl = "shadow coat", model = 8393}
models.body[14576] = { name = "Valkyrie's Coat" , enl = "valkyrie's coat", model = 8393}
models.body[14577] = { name = "Valhalla Brstplate" , enl = "valhalla breastplate", model = 8391}
models.body[14578] = { name = "Dancer's Casaque" , enl = "dancer's casaque", model = 8402}
models.body[14579] = { name = "Dancer's Casaque" , enl = "dancer's casaque", model = 8403}
models.body[14580] = { name = "Scholar's Gown" , enl = "scholar's gown", model = 8406}
models.body[14581] = { name = "I.R. Chainmail" , enl = "iron ram chainmail", model = 8204}
models.body[14582] = { name = "Fourth Cuirass" , enl = "fourth division cuirass", model = 8217}
models.body[14583] = { name = "Cobra Coat" , enl = "cobra unit coat", model = 8211}
models.body[14584] = { name = "I.R. Jack Coat" , enl = "iron ram jack coat", model = 8295}
models.body[14585] = { name = "Fourth Tunica" , enl = "fourth division tunica", model = 8294}
models.body[14586] = { name = "Cobra Tunica" , enl = "cobra unit tunica", model = 8297}
models.body[14587] = { name = "Pilgrim Tunica" , enl = "pilgrim tunica", model = 8296}
models.body[14588] = { name = "Iron Ram Hauberk" , enl = "iron ram hauberk", model = 8413}
models.body[14589] = { name = "Fourth Brunne" , enl = "fourth division brunne", model = 8414}
models.body[14590] = { name = "Cobra Harness" , enl = "cobra unit harness", model = 8411}
models.body[14591] = { name = "Cobra Robe" , enl = "cobra unit robe", model = 8412}
models.body[15087] = { name = "Warrior's Lorica" , enl = "warrior's lorica", model = 8257}
models.body[15088] = { name = "Melee Cyclas" , enl = "melee cyclas", model = 8259}
models.body[15089] = { name = "Cleric's Briault" , enl = "cleric's briault", model = 8261}
models.body[15090] = { name = "Sorcerer's Coat" , enl = "sorcerer's coat", model = 8263}
models.body[15091] = { name = "Duelist's Tabard" , enl = "duelist's tabard", model = 8265}
models.body[15092] = { name = "Assassin's Vest" , enl = "assassin's vest", model = 8267}
models.body[15093] = { name = "Valor Surcoat" , enl = "valor surcoat", model = 8269}
models.body[15094] = { name = "Abyss Cuirass" , enl = "abyss cuirass", model = 8271}
models.body[15095] = { name = "Monster Jackcoat" , enl = "monster jackcoat", model = 8273}
models.body[15096] = { name = "Bard's Jstcorps" , enl = "bard's justaucorps", model = 8275}
models.body[15097] = { name = "Scout's Jerkin" , enl = "scout's jerkin", model = 8277}
models.body[15098] = { name = "Saotome Domaru" , enl = "saotome domaru", model = 8279}
models.body[15099] = { name = "Koga Chainmail" , enl = "koga chainmail", model = 8281}
models.body[15100] = { name = "Wyrm Mail" , enl = "wyrm mail", model = 8283}
models.body[15101] = { name = "Summoner's Dblt." , enl = "summoner's doublet", model = 8285}
models.body[27788] = { name = "Ares' Cuirass +1" , enl = "ares' cuirass +1", model = 8374}
models.body[27789] = { name = "Skadi's Cuirie +1" , enl = "skadi's cuirie +1", model = 8375}
models.body[27790] = { name = "Usk. Haramaki +1" , enl = "usukane haramaki +1", model = 8376}
models.body[27791] = { name = "Marduk's Jubbah +1" , enl = "marduk's jubbah +1", model = 8377}
models.body[27792] = { name = "Morrigan's Robe +1" , enl = "morrigan's robe +1", model = 8378}
models.body[27793] = { name = "Ker's Cuirass" , enl = "ker's cuirass", model = 8374}
models.body[27794] = { name = "Sigyn's Cuirie" , enl = "sigyn's cuirie", model = 8375}
models.body[27795] = { name = "Omodaka Haramaki" , enl = "omodaka haramaki", model = 8376}
models.body[27796] = { name = "Nabu's Jubbah" , enl = "nabu's jubbah", model = 8377}
models.body[27797] = { name = "Fea's Robe" , enl = "fea's robe", model = 8378}
models.body[27798] = { name = "Ate's Cuirass" , enl = "ate's cuirass", model = 8214}
models.body[27799] = { name = "Idi's Jerkin" , enl = "idi's jerkin", model = 8242}
models.body[27800] = { name = "Genta Hara-Ate" , enl = "genta hara-ate", model = 8201}
models.body[27801] = { name = "Namru's Jubbah" , enl = "namru's jubbah", model = 8215}
models.body[27802] = { name = "Neit's Coat" , enl = "neit's coat", model = 8211}
models.body[27803] = { name = "Rustic Maillot" , enl = "rustic maillot", model = 8550}
models.body[27804] = { name = "Shoal Maillot" , enl = "shoal maillot", model = 8551}
models.body[27805] = { name = "Rustic Maillot +1" , enl = "rustic maillot +1", model = 8550}
models.body[27806] = { name = "Shoal Maillot +1" , enl = "shoal maillot +1", model = 8551}
models.body[27807] = { name = "Pummeler's Lorica" , enl = "pummeler's lorica" , model = 8256 }
models.body[27808] = { name = "Anchorite's Cyclas" , enl = "anchorite's cyclas" , model = 8258 }
models.body[27809] = { name = "Theo. Briault" , enl = "theophany briault" , model = 8260 }
models.body[27810] = { name = "Spaekona's Coat" , enl = "spaekona's coat" , model = 8262 }
models.body[27811] = { name = "Atrophy Tabard" , enl = "atrophy tabard" , model = 8264 }
models.body[27812] = { name = "Pillager's Vest" , enl = "pillager's vest" , model = 8266 }
models.body[27813] = { name = "Reverence Surcoat" , enl = "reverence surcoat" , model = 8268 }
models.body[27814] = { name = "Ignominy Cuirass" , enl = "ignominy cuirass" , model = 8270 }
models.body[27815] = { name = "Totemic Jackcoat" , enl = "totemic jackcoat" , model = 8272 }
models.body[27816] = { name = "Brioso Justaucorps" , enl = "brioso justaucorps" , model = 8274 }
models.body[27817] = { name = "Orion Jerkin" , enl = "orion jerkin" , model = 8276 }
models.body[27818] = { name = "Wakido Domaru" , enl = "wakido domaru" , model = 8278 }
models.body[27819] = { name = "Hachi. Chainmail" , enl = "hachiya chainmail" , model = 8280 }
models.body[27820] = { name = "Vishap Mail" , enl = "suit of vishap mail" , model = 8282 }
models.body[27821] = { name = "Convo. Doublet" , enl = "convoker's doublet" , model = 8284 }
models.body[27822] = { name = "Assim. Jubbah" , enl = "assimilator's jubbah" , model = 8357 }
models.body[27823] = { name = "Laksamana Frac" , enl = "laksmana's frac" , model = 8359 }
models.body[27824] = { name = "Foire Tobe" , enl = "foire tobe" , model = 8361 }
models.body[27825] = { name = "Maxixi Casaque" , enl = "maxixi casaque" , model = 8402 }
models.body[27826] = { name = "Maxixi Casaque" , enl = "maxixi casaque" , model = 8403 }
models.body[27827] = { name = "Academic's Gown" , enl = "academic's gown" , model = 8406 }
models.body[27828] = { name = "Pumm. Lorica +1" , enl = "pummeler's lorica +1" , model = 8256 }
models.body[27829] = { name = "Anch. Cyclas +1" , enl = "anchorite's cyclas +1" , model = 8258 }
models.body[27830] = { name = "Theo. Briault +1" , enl = "theophany briault +1" , model = 8260 }
models.body[27831] = { name = "Spae. Coat +1" , enl = "spaekona's coat +1" , model = 8262 }
models.body[27832] = { name = "Atrophy Tabard +1" , enl = "atrophy tabard +1" , model = 8264 }
models.body[27833] = { name = "Pillager's Vest +1" , enl = "pillager's vest +1" , model = 8266 }
models.body[27834] = { name = "Rev. Surcoat +1" , enl = "reverence surcoat +1" , model = 8268 }
models.body[27835] = { name = "Igno. Cuirass +1" , enl = "ignominy cuirass +1" , model = 8270 }
models.body[27836] = { name = "Tot. Jackcoat +1" , enl = "totemic jackcoat +1" , model = 8272 }
models.body[27837] = { name = "Brioso Just. +1" , enl = "brioso justaucorps +1" , model = 8274 }
models.body[27838] = { name = "Orion Jerkin +1" , enl = "orion jerkin +1" , model = 8276 }
models.body[27839] = { name = "Wakido Domaru +1" , enl = "wakido domaru +1" , model = 8278 }
models.body[27840] = { name = "Hachi. Chain. +1" , enl = "hachiya chainmail +1" , model = 8280 }
models.body[27841] = { name = "Vishap Mail +1" , enl = "vishap mail +1" , model = 8282 }
models.body[27842] = { name = "Con. Doublet +1" , enl = "convoker's doublet +1" , model = 8284 }
models.body[27843] = { name = "Assim. Jubbah +1" , enl = "assimilator's jubbah +1" , model = 8357 }
models.body[27844] = { name = "Lak. Frac +1" , enl = "laksamana's frac +1" , model = 8359 }
models.body[27845] = { name = "Foire Tobe +1" , enl = "foire tobe +1" , model = 8361 }
models.body[27846] = { name = "Maxixi Casaque +1" , enl = "maxixi casaque +1" , model = 8402 }
models.body[27847] = { name = "Maxixi Casaque +1" , enl = "maxixi casaque +1" , model = 8403 }
models.body[27848] = { name = "Acad. Gown +1" , enl = "academic's gown +1" , model = 8406 }
models.body[27849] = { name = "Geo. Tunic +1" , enl = "geomancy tunic +1" , model = 8500 }
models.body[27850] = { name = "Runeist Coat +1" , enl = "runeist coat +1" , model = 8530 }
models.body[27879] = { name = "Overalls" , enl = "overalls" , model = 8558 }
models.body[27881] = { name = "Outrider Mail" , enl = "outrider mail" , model = 8197 }
models.body[27882] = { name = "Espial Gambison" , enl = "espial gambison" , model = 8215 }
models.body[27883] = { name = "Wayfarer Robe" , enl = "wayfarer robe" , model = 8212 }
models.body[27884] = { name = "Temachtiani Shirt" , enl = "temachtiani shirt" , model = 8294 }
models.body[27888] = { name = "Kyujutsugi" , enl = "kyujutsugi" , model = 8409 }
models.body[27895] = { name = "Karieyh Haubert +1" , enl = "Karieyh haubert +1" , model = 8534 }
models.body[27896] = { name = "Thur. Tabard +1" , enl = "Thurandaut tabard +1" , model = 8535 }
models.body[27897] = { name = "Orvail Robe +1" , enl = "Orvail robe +1" , model = 8536 }
models.body[27898] = { name = "Alliance Shirt +1" , enl = "alliance shirt +1" , model = ' ' }
models.body[27899] = { name = "Alliance Shirt" , enl = "alliance shirt" , model = ' ' }
models.body[27902] = { name = "G. Spriggan Coat" , enl = "green spriggan coat" , model = 8453 }
models.body[27903] = { name = "Trench Tunic" , enl = "trench tunic", model = 8297}
models.body[27904] = { name = "Morass Tunic" , enl = "morass tunic", model = 8539}
models.body[27905] = { name = "Woodland Tunic" , enl = "woodland tunic", model = 8540}
models.body[27906] = { name = "Chocobo Suit +1" , enl = "chocobo suit +1", model = 8545}
models.body[27907] = { name = "Gorney Haubert" , enl = "gorney haubert", model = 8546}
models.body[27908] = { name = "Shneddick Tabard" , enl = "shneddick tabard", model = 8547}
models.body[27909] = { name = "Weatherspoon Robe" , enl = "weatherspoon robe", model = 8543}
models.body[27911] = { name = "Chocobo Suit" , enl = "chocobo suit", model = 8545}
models.body[27912] = { name = "Cizin Mail" , enl = "cizin mail", model = 8466}
models.body[27913] = { name = "Otronif Harness" , enl = "otronif harness", model = 8439}
models.body[27914] = { name = "Iuitl Vest" , enl = "iuitl vest", model = 8448}
models.body[27915] = { name = "Gendewitha Bliaut" , enl = "gendewitha bliaut", model = 8457}
models.body[27916] = { name = "Hagondes Coat" , enl = "hagondes coat", model = 8454}
models.body[27917] = { name = "Miki. Breastplate" , enl = "mikinaak breastplate", model = 8541}
models.body[27918] = { name = "Manibozho Jerkin" , enl = "manibozho jerkin", model = 8542}
models.body[27919] = { name = "Bokwus Robe" , enl = "bokwus robe", model = 8543}
models.body[27920] = { name = "Pak Corselet" , enl = "pak corselet", model = 8371}
models.body[27921] = { name = "Pak Corselet +1" , enl = "pak corselet +1", model = 8371}
models.body[27922] = { name = "Orvail Robe" , enl = "orvail robe", model = 8536}
models.body[27924] = { name = "Thurandaut Tabard" , enl = "thurandaut tabard", model = 8535}
models.body[27925] = { name = "Karieyh Haubert" , enl = "karieyh haubert", model = 8534}
models.body[27926] = { name = "Geomancy Tunic" , enl = "geomancy tunic", model = 8500} --8508 Taru M
models.body[27927] = { name = "Runeist Coat" , enl = "runeist coat", model = 8530}
models.body[50000] = { name = "Volunteer Solider Body" , model = 8365 }
models.body[50001] = { name = "Chasuble (Male Only)", model = 8369 }
models.body[50002] = { name = "Haudrale's Tabard" , model = 8434 }
models.body[50003] = { name = "Geomancer Relic", model = 8502 } --8510 Taru M
models.body[50004] = { name = "Rune Fencer Relic", model = 8531 }
models.body["Unknown"] = { 8410 }
models.body["Unused"] = { 8370, 8409, 8532, 8533, 8544, 8549, 8552, 8553, 8511 }
|
centaur_passive = class({})
LinkLuaModifier("modifier_centaur_passive", "pve/abilities/heroes/centaur/centaur_passive/modifier_centaur_passive", LUA_MODIFIER_MOTION_NONE)
function centaur_passive:GetIntrinsicModifierName()
return "modifier_centaur_passive"
end
|
HELP = [[
Re-imports a build from pathofexile.com automatically.
See testupdate.bat for an example of running it directly.
Usage: lua UpdateBuild.lua <build xml>|CURRENT
]]
local BUILD_XML = arg[1];
if BUILD_XML == nil then
print("Usage: UpdateBuild.lua <build xml>|CURRENT")
os.exit(1)
end
local _,_,SCRIPT_PATH=string.find(arg[0], "(.+[/\\]).-")
dofile(SCRIPT_PATH.."mockui.lua")
xml = require("xml")
inspect = require("inspect")
local testercore = require("testercore")
local pobinterface = require('pobinterface')
testercore.loadBuild(BUILD_XML)
-- Remember previously selected skill
local prevSkill = pobinterface.readSkillSelection()
print("Skill group/gem/part: "..pobinterface.skillString(prevSkill))
-- Update
print("Importing character changes...")
pobinterface.updateBuild()
-- Restore previously selected skill
print("After group/gem/part: "..pobinterface.skillString())
pobinterface.selectSkill(prevSkill)
print("Fixed group/gem/part: "..pobinterface.skillString())
testercore.saveBuild()
print("Success")
|
local ffi = require("ffi")
local List = require("udev.list")
local util = require("udev.util")
local libudev = require("udev.libudev")
local lib = libudev.lib
---@class UDevDevice
---@field context UDevContext
---@field udev_device udev_device
local Device = {}
--luacheck: push no max line length
---@overload fun(self, from: "'*'", context: UDevContext, udev_device: udev_device): UDevDevice|nil
---@overload fun(self, from: "'syspath'", context: UDevContext, syspath: string): UDevDevice|nil
---@overload fun(self, from: "'devnum'", context: UDevContext, devtype: string, devnum: number): UDevDevice|nil
---@overload fun(self, from: "'subsystem_sysname'", context: UDevContext, subsystem: string, sysname: string): UDevDevice|nil
---@overload fun(self, from: "'device_id'", context: UDevContext, devid: string): UDevDevice|nil
---@overload fun(self, from: "'environment'", context: UDevContext): UDevDevice|nil
---@param from "'*'"|"'syspath'"|"'devnum'"|"'subsystem_sysname'"|"'device_id'"|"'environment'"
---@param context UDevContext
---@return UDevDevice|nil
function Device:new(from, context, ...)
local device = setmetatable({}, { __index = self })
---@type udev_device
local udev_device
if from == "*" then
udev_device = select(1, ...)
elseif from == "syspath" then
udev_device = lib.udev_device_new_from_syspath(context.udev, select(1, ...))
elseif from == "devnum" then
udev_device = lib.udev_device_new_from_devnum(context.udev, select(1, ...), select(2, ...))
elseif from == "subsystem_sysname" then
udev_device = lib.udev_device_new_from_subsystem_sysname(context.udev, select(1, ...), select(2, ...))
elseif from == "device_id" then
udev_device = lib.udev_device_new_from_device_id(context.udev, select(1, ...))
elseif from == "environment" then
udev_device = lib.udev_device_new_from_environment(context.udev)
end
if udev_device == nil then
return nil, string.format("Error: failed to create udev device.")
end
device.context = context
device.udev_device = udev_device
ffi.gc(device.udev_device, lib.udev_device_unref)
return device
end
--luacheck: pop
---@return UDevDevice|nil
function Device:parent()
local udev_device = lib.udev_device_get_parent(self.udev_device)
if udev_device == nil then
return nil
end
return Device:new("*", self.context, udev_device)
end
---@param subsystem string
---@param devtype string
---@return UDevDevice|nil
function Device:parent_with_subsystem_devtype(subsystem, devtype)
local udev_device = lib.udev_device_get_parent_with_subsystem_devtype(self.udev_device, subsystem, devtype)
if udev_device == nil then
return nil
end
return Device:new("*", self.context, udev_device)
end
---@return string
function Device:devpath()
return util.to_string(lib.udev_device_get_devpath(self.udev_device))
end
---@return string
function Device:subsystem()
return util.to_string(lib.udev_device_get_subsystem(self.udev_device))
end
---@return string
function Device:devtype()
return util.to_string(lib.udev_device_get_devtype(self.udev_device))
end
---@return string
function Device:syspath()
return util.to_string(lib.udev_device_get_syspath(self.udev_device))
end
---@return string
function Device:sysname()
return util.to_string(lib.udev_device_get_sysname(self.udev_device))
end
---@return string
function Device:sysnum()
return util.to_string(lib.udev_device_get_sysnum(self.udev_device))
end
---@return string
function Device:devnode()
return util.to_string(lib.udev_device_get_devnode(self.udev_device))
end
---@return boolean
function Device:is_initialized()
return lib.udev_device_get_is_initialized(self.udev_device) == 1
end
---@return UDevList
function Device:devlink_list()
local head = lib.udev_device_get_devlinks_list_entry(self.udev_device)
return List:new(head)
end
---@return UDevList
function Device:property_list()
local head = lib.udev_device_get_properties_list_entry(self.udev_device)
return List:new(head)
end
---@return UDevList
function Device:tag_list()
local head = lib.udev_device_get_tags_list_entry(self.udev_device)
return List:new(head)
end
---@return UDevList
function Device:sysattr_list()
local head = lib.udev_device_get_sysattr_list_entry(self.udev_device)
return List:new(head)
end
---@param key string
---@return string
function Device:property_value(key)
return util.to_string(lib.udev_device_get_property_value(self.udev_device, key))
end
---@return string
function Device:driver()
return util.to_string(lib.udev_device_get_driver(self.udev_device))
end
---@return number
function Device:devnum()
return lib.udev_device_get_devnum(self.udev_device)
end
---@return string
function Device:action()
return util.to_string(lib.udev_device_get_action(self.udev_device))
end
---@return number
function Device:seqnum()
return lib.udev_device_get_seqnum(self.udev_device)
end
---@return number
function Device:usec_since_initialized()
return lib.udev_device_get_usec_since_initialized(self.udev_device)
end
---@param sysattr string
---@param value? string
---@return string
function Device:sysattr_value(sysattr, value)
if value then
local rc = lib.udev_device_set_sysattr_value(self.udev_device, sysattr, value)
if rc == 0 then
return value
end
return nil, string.format("Error: failed to set sysattr(%s) value(%s)", sysattr, value)
end
return util.to_string(lib.udev_device_get_sysattr_value(self.udev_device, sysattr))
end
---@param tag string
---@return boolean
function Device:has_tag(tag)
return lib.udev_device_has_tag(self.udev_device, tag) == 1
end
return Device
|
-- /re
function wrCommand(thePlayer, commandName, ...)
if getElementData(thePlayer, "player.lastw") == false then
exports.lsrp:showPopup(thePlayer, "Nie pisałeś do nikogo w ostatnim czasie.", 5 )
return
end
local msg_to_send = table.concat({...}, " ")
local select_id = tonumber(getElementData(thePlayer, "player.lastw"))
if (msg_to_send == nil) then
outputChatBox("#CCCCCCUżycie: /wr [Wiadomość]", thePlayer, 255, 255, 255, true)
return
end
local gainer = getPlayerByID(select_id)
if not gainer then
exports.lsrp:showPopup(thePlayer, "Taki gracz nie jest podłączony do serwera.", 5 )
return
end
if (getElementData(gainer, "player.logged") == false) then
exports.lsrp:showPopup(thePlayer, "Ten gracz się jeszcze nie zalogował.", 5 )
return
end
if (gainer == thePlayer) then
exports.lsrp:showPopup(thePlayer, "Nie możesz napisać sam do siebie.", 5 )
return
end
-- Kolorki do czatu
setElementData(thePlayer, "player.lastw", select_id)
local color = tonumber(getElementData(thePlayer, "player.color"))
local message = "#FF9900(( "..rank_col[color]..getElementData(thePlayer, "player.gname").."#FF9900 ["..getPlayerID(thePlayer).."]: "..msg_to_send.." ))"
outputChatBox(message, gainer, 255, 255, 255, true)
color = tonumber(getElementData(gainer, "player.color"))
message = "#FFCC33(( » "..rank_col[color]..getElementData(gainer, "player.gname").."#FFCC33 ["..getPlayerID(gainer).."]: "..msg_to_send.." ))"
outputChatBox(message, thePlayer, 255, 255, 255, true)
end
addCommandHandler("wr", wrCommand)
-- /i
function iCommand(player, commandName, ...)
if getPlayerAdmin(player) < 1 then
showPopup(player, "Brak uprawnień do użycia tej komendy.", 7)
return
end
local ac_array = {...}
local ac_text = table.concat(ac_array, " ")
if #ac_array <= 0 then
outputChatBox("#CCCCCCUżycie: /ac [Wiadomość]", player, 255, 255, 255, true)
return
end
local adminColor = tonumber(getElementData(player, "player.color"))
local out_message = "#FFFFFF(( "..rank_col[adminColor]..getElementData(player, "player.gname").."#FFFFFF: "..ac_text.." ))"
for index, p in ipairs(getElementsByType("player")) do
outputChatBox( out_message, p, 255, 255, 255, true)
end
end
addCommandHandler("i", iCommand)
-- /stats
function statsCommand(thePlayer, commandName, theTarget)
if theTarget == nil then
-- pokaż stats thePlayer
triggerClientEvent(thePlayer, "showPlayerStats", thePlayer, thePlayer)
else
if tonumber(getElementData(thePlayer, "player.admin")) ~= 0 then
-- pokaż stats theTarget
if not isElement(getPlayerByID(tonumber(theTarget))) then
triggerClientEvent(thePlayer, "showPlayerStats", thePlayer, thePlayer)
return
end
if getElementData(getPlayerByID(tonumber(theTarget)), "player.logged") ~= true then
triggerClientEvent(thePlayer, "showPlayerStats", thePlayer, thePlayer)
return
end
triggerClientEvent(thePlayer, "showPlayerStats", thePlayer, getPlayerByID(tonumber(theTarget)))
else
-- pokaż stats thePlayer
triggerClientEvent(thePlayer, "showPlayerStats", thePlayer, thePlayer)
end
end
end
addCommandHandler("stats", statsCommand)
-- /w - whisper
function wCommand(thePlayer, commandName, toWho, ...)
local msg_to_send = table.concat({...}, " ")
local select_id = tonumber(toWho)
if (toWho == nil or msg_to_send == nil) then
outputChatBox("#CCCCCCUżycie: /w [ID Gracza] [Wiadomość]", thePlayer, 255, 255, 255, true)
return
end
local gainer = getPlayerByID(select_id)
if not gainer then
exports.lsrp:showPopup(thePlayer, "Taki gracz nie jest podłączony do serwera.", 5 )
return
end
if (getElementData(gainer, "player.logged") == false) then
exports.lsrp:showPopup(thePlayer, "Ten gracz się jeszcze nie zalogował.", 5 )
return
end
if (gainer == thePlayer) then
exports.lsrp:showPopup(thePlayer, "Nie możesz napisać sam do siebie.", 5 )
return
end
-- Kolorki do czatu
setElementData(thePlayer, "player.lastw", select_id)
local color = tonumber(getElementData(thePlayer, "player.color"))
local message = "#FF9900(( "..rank_col[color]..getElementData(thePlayer, "player.gname").."#FF9900 ["..getPlayerID(thePlayer).."]: "..msg_to_send.." ))"
outputChatBox(message, gainer, 255, 255, 255, true)
color = tonumber(getElementData(gainer, "player.color"))
message = "#FFCC33(( » "..rank_col[color]..getElementData(gainer, "player.gname").."#FFCC33 ["..getPlayerID(gainer).."]: "..msg_to_send.." ))"
outputChatBox(message, thePlayer, 255, 255, 255, true)
end
addCommandHandler("w", wCommand)
-- /ac
function acCommand(player, commandName, ...)
if getPlayerAdmin(player) == ADMIN_LEVEL_NONE then
showPopup(player, "Brak uprawnień do użycia tej komendy.", 7)
return
end
local ac_array = {...}
local ac_text = table.concat(ac_array, " ")
if #ac_array <= 0 then
outputChatBox("#CCCCCCUżycie: /ac [Wiadomość]", player, 255, 255, 255, true)
return
end
local adminColor = tonumber(getElementData(player, "player.color"))
local out_message = "#CCCC99(( #990000[AC] "..rank_col[adminColor]..getElementData(player, "player.gname").."#CCCC99: "..ac_text.." ))"
for index, p in ipairs(getElementsByType("player")) do
if tonumber(getElementData(p, "player.admin")) == 1 then
outputChatBox( out_message, p, 255, 255, 255, true)
end
end
end
addCommandHandler("ac", acCommand)
-- /gc
function gcCommand(player, commandName, ...)
if getPlayerAdmin(player) == ADMIN_LEVEL_NONE then
showPopup(player, "Brak uprawnień do użycia tej komendy.", 7)
return
end
local do_array = {...}
local do_text = table.concat(do_array, " ")
if #do_array <= 0 then
outputChatBox("#CCCCCCUżycie: /gc [Wiadomość]", player, 255, 255, 255, true)
return
end
local adminColor = tonumber(getElementData(player, "player.color"))
local out_message = "#00CCFF(( #3399CC[GC] "..rank_col[adminColor]..getElementData(player, "player.gname").."#00CCFF: "..do_text.." ))"
for index, p in ipairs( getElementsByType("player") ) do
if tonumber(getElementData(p, "player.admin")) ~= 0 then
outputChatBox( out_message, p, 255, 255, 255, true)
end
end
end
addCommandHandler ( "gc", gcCommand )
-- /do
function doCommand(player, commandName, ...)
local do_array = {...}
local do_text = table.concat(do_array, " ")
if #do_array <= 0 then
outputChatBox("#CCCCCCUżycie: /do [Sytuacja]", player, 255, 255, 255, true)
return
end
local message = "#9999CC** " .. do_text .. " (( " .. playerRealName(player) .. " ))"
local posX, posY, posZ = getElementPosition( player )
local chatSphere = createColSphere( posX, posY, posZ, 10 )
local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" )
for index, nearbyPlayer in ipairs( nearbyPlayers ) do
outputChatBox( message, nearbyPlayer, 255, 255, 255, true)
end
destroyElement(chatSphere) -- optymalizacja
end
addCommandHandler ( "do", doCommand )
-- /b
function bCommand(player, commandName, ...)
local b_array = {...}
local b_text = table.concat(b_array, " ")
if #b_array <= 0 then
outputChatBox("#CCCCCCUżycie: /b [Wiadomość]", player, 255, 255, 255, true)
return
end
-- pozycja piszącego
local x, y, z = getElementPosition(player)
--message = "#666666(( #FFFFFF".. rank_col[getElementData(player, "player.color")] ..getElementData(player, "player.gname").." #666666[".. getElementData(player, "id") .."]: " ..b_text.." ))"
local posX, posY, posZ = getElementPosition( player )
local chatSphere = createColSphere( posX, posY, posZ, 10 )
local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" )
local message = nil
for index, nearbyPlayer in ipairs( nearbyPlayers ) do
local ox, oy, oz = getElementPosition(nearbyPlayer)
local distance = getDistanceBetweenPoints2D(x, y, ox, oy)
if distance < 2 then
message = "#BBBBBB(( #FFFFFF".. rank_col[getElementData(player, "player.color")] ..getElementData(player, "player.gname").." #BBBBBB[".. getElementData(player, "id") .."]: " ..b_text.." ))"
elseif distance < 4 then
message = "#AAAAAA(( #FFFFFF".. rank_col[getElementData(player, "player.color")] ..getElementData(player, "player.gname").." #AAAAAA[".. getElementData(player, "id") .."]: " ..b_text.." ))"
elseif distance < 6 then
message = "#999999(( #FFFFFF".. rank_col[getElementData(player, "player.color")] ..getElementData(player, "player.gname").." #999999[".. getElementData(player, "id") .."]: " ..b_text.." ))"
elseif distance < 8 then
message = "#888888(( #FFFFFF".. rank_col[getElementData(player, "player.color")] ..getElementData(player, "player.gname").." #888888[".. getElementData(player, "id") .."]: " ..b_text.." ))"
else
message = "#666666(( #FFFFFF".. rank_col[getElementData(player, "player.color")] ..getElementData(player, "player.gname").." #666666[".. getElementData(player, "id") .."]: " ..b_text.." ))"
end
outputChatBox( message, nearbyPlayer, 255, 255, 255, true)
end
destroyElement(chatSphere) -- optymalizacja
end
addCommandHandler ( "b", bCommand )
-- /szept /s
function sCommand(player, commandName, ...)
local b_array = {...}
local b_text = table.concat(b_array, " ")
-- Jeśli BW to niech nie gada
if(tonumber(getElementData(player, "player.bw")) > 0) then
exports.lsrp:showPopup(player, "Nie możesz się odzywać będąc nieprzytomnym.", 5 )
return
end
if #b_array <= 0 then
outputChatBox("#CCCCCCUżycie: /s [Wiadomość] - szeptanie", player, 255, 255, 255, true)
return
end
-- pozycja piszącego
local x, y, z = getElementPosition(player)
local output = playerRealName(player).." szepcze: "..firstToUpper(b_text)
local posX, posY, posZ = getElementPosition( player )
local chatSphere = createColSphere( posX, posY, posZ, 4 )
local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" )
for index, nearbyPlayer in ipairs( nearbyPlayers ) do
local ox, oy, oz = getElementPosition(nearbyPlayer)
local distance = getDistanceBetweenPoints2D(x, y, ox, oy)
if distance < 1 then
outputChatBox( "#FFFFFF"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 2 then
outputChatBox( "#EEEEEE"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 3 then
outputChatBox( "#CCCCCC"..output, nearbyPlayer, 255, 255, 255, true)
else
outputChatBox( "#BBBBBB"..output, nearbyPlayer, 255, 255, 255, true)
end
--outputChatBox( message, nearbyPlayer, 255, 255, 255, true)
end
destroyElement(chatSphere) -- optymalizacja
end
addCommandHandler ( "s", sCommand )
-- /krzyk /k
function kCommand(player, commandName, ...)
local b_array = {...}
local b_text = table.concat(b_array, " ")
-- Jeśli BW to niech nie gada
if(tonumber(getElementData(player, "player.bw")) > 0) then
exports.lsrp:showPopup(player, "Nie możesz się odzywać będąc nieprzytomnym.", 5 )
return
end
if #b_array <= 0 then
outputChatBox("#CCCCCCUżycie: /k [Wiadomość] - krzyk", player, 255, 255, 255, true)
return
end
-- pozycja piszącego
local x, y, z = getElementPosition(player)
local output = playerRealName(player).." krzyczy: "..firstToUpper(b_text).."!"
local posX, posY, posZ = getElementPosition( player )
local chatSphere = createColSphere( posX, posY, posZ, 25 )
local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" )
for index, nearbyPlayer in ipairs( nearbyPlayers ) do
local ox, oy, oz = getElementPosition(nearbyPlayer)
local distance = getDistanceBetweenPoints2D(x, y, ox, oy)
if distance < 5 then
outputChatBox( "#FFFFFF"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 10 then
outputChatBox( "#EEEEEE"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 15 then
outputChatBox( "#CCCCCC"..output, nearbyPlayer, 255, 255, 255, true)
else
outputChatBox( "#BBBBBB"..output, nearbyPlayer, 255, 255, 255, true)
end
--outputChatBox( message, nearbyPlayer, 255, 255, 255, true)
end
destroyElement(chatSphere) -- optymalizacja
end
addCommandHandler ( "k", kCommand )
-- /l lokalny
function lCommand(player, commandName, ...)
local b_array = {...}
local b_text = table.concat(b_array, " ")
-- Jeśli BW to niech nie gada
if(tonumber(getElementData(player, "player.bw")) > 0) then
exports.lsrp:showPopup(player, "Nie możesz się odzywać będąc nieprzytomnym.", 5 )
return
end
if #b_array <= 0 then
outputChatBox("#CCCCCCUżycie: /l [Wiadomość] - czat lokalny", player, 255, 255, 255, true)
return
end
-- pozycja piszącego
local x, y, z = getElementPosition(player)
local output = playerRealName(player).." mówi: "..firstToUpper(b_text)
local posX, posY, posZ = getElementPosition( player )
local chatSphere = createColSphere( posX, posY, posZ, 25 )
local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" )
for index, nearbyPlayer in ipairs( nearbyPlayers ) do
local ox, oy, oz = getElementPosition(nearbyPlayer)
local distance = getDistanceBetweenPoints2D(x, y, ox, oy)
if distance < 2 then
outputChatBox( "#FFFFFF"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 4 then
outputChatBox( "#EEEEEE"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 6 then
outputChatBox( "#DDDDDD"..output, nearbyPlayer, 255, 255, 255, true)
elseif distance < 8 then
outputChatBox( "#CCCCCC"..output, nearbyPlayer, 255, 255, 255, true)
else
outputChatBox( "#BBBBBB"..output, nearbyPlayer, 255, 255, 255, true)
end
--outputChatBox( message, nearbyPlayer, 255, 255, 255, true)
end
destroyElement(chatSphere) -- optymalizacja
end
addCommandHandler ( "l", lCommand )
|
local t = My.Translator.translate
My.EventHandler:register("onAllStationsDestroyed", function()
if My.Commander:isAlive() then
local commanderLocation = My.Commander:getLocation()
local commander = My.Commander:getPerson()
local player = My.World.player
Tools:ensureComms(commanderLocation, player, t("story_all_destroyed", commander))
end
end)
|
--arg[1] == path to REPORT.lua
--arg[2] == path to MODBUILDER
--arg[3] == 1 (check NMS MODS for conflict)
if gVerbose == nil then dofile(arg[2]..[[LoadHelpers.lua]]) end --.\MODBUILDER\
pv(">>> In CheckREPORTLOG.lua")
gfilePATH = arg[1] --to use by LoadHelpers.Report()
THIS = "In CheckREPORTLOG: "
-- print("arg[3] = ["..arg[3].."]")
local CheckMODSconflicts = (arg[3] == "1") or (arg[3] == "3")
local CheckSCRIPTconflicts = (arg[3] == "1") or (arg[3] == "4")
local LogTable = ParseTextFileIntoTable(arg[1]..[[REPORT.lua]])
local NoticeCount = 0
local WarningCount = 0
local ConflictCount = 0
local ErrorCount = 0
local BugCount = 0
for i=1,#LogTable do
if string.find(LogTable[i],"[NOTICE]",1,true) then
NoticeCount = NoticeCount + 1
end
if string.find(LogTable[i],"[WARNING]",1,true) then
WarningCount = WarningCount + 1
end
if string.find(LogTable[i],"[CONFLICT]",1,true) then
ConflictCount = ConflictCount + 1
end
if string.find(LogTable[i],"[ERROR]",1,true) then
ErrorCount = ErrorCount + 1
end
if string.find(LogTable[i],"[BUG]",1,true) then
BugCount = BugCount + 1
end
end
local say = ""
local spacerCMD = " "
local spacerREPORT = " "
local msgType = "ATTENTION"
local SeeReport = "" -- [[ >>> See "REPORT.lua" <<<]]
local say1 = ""
local say2 = [[ or on NEXUS at https://www.nexusmods.com/nomanssky/mods/957]]
if BugCount > 0 then
if BugCount > 1 then
say1 = string.format(say..[[%6u BUGs reported. PLEASE post ALL scripts AND "REPORT.lua" on Discord: https://discord.gg/8jGtEcDPEY]],BugCount)
else
say1 = string.format(say..[[%6u BUG reported. PLEASE post ALL scripts AND "REPORT.lua" on Discord: https://discord.gg/8jGtEcDPEY]],BugCount)
end
print("")
print(say1)
print(say2)
Report("")
Report("",say1,msgType)
Report("",say2,msgType)
end
say = ""
if ErrorCount > 0 then
if ErrorCount > 1 then
say = string.format(say..[[%6u ERRORS detected]],ErrorCount)
else
say = string.format(say..[[%6u ERROR detected]],ErrorCount)
end
print("")
print(say..SeeReport)
Report("")
Report("",say,msgType)
say = spacerCMD.."ERRORS will NOT produce MBIN files and a complete PAK file may not have been created."
print(say)
Report("",say,msgType)
say = spacerCMD.."You need to correct the error first!"
print(say)
Report("",say,msgType)
else
say = string.format(say.."%6u ERROR detected",ErrorCount)
print("")
print(say)
Report("")
Report("",spacerREPORT..say)
end
say = ""
if WarningCount > 0 then
-- say = "XXXXX "
if WarningCount > 1 then
say = string.format(say..[[%6u WARNINGS raised]],WarningCount)
else
say = string.format(say..[[%6u WARNING raised]],WarningCount)
end
print("")
print(say..SeeReport)
Report("")
Report("",say,msgType)
say = spacerCMD.."WARNINGS may produce good or bad PAK files. You have to be the judge!"
print(say)
Report("",say,msgType)
else
say = string.format(say.."%6u WARNING raised",WarningCount)
print("")
print(say)
Report("")
Report("",spacerREPORT..say)
end
say = ""
if NoticeCount > 0 then
-- say = "XXXXX "
if NoticeCount > 1 then
say = string.format(say..[[%6u NOTICES raised]],NoticeCount)
else
say = string.format(say..[[%6u NOTICE raised]],NoticeCount)
end
print("")
print(say..SeeReport)
Report("")
Report("",say,msgType)
say = spacerCMD.."NOTICES produce good PAK files but alert you to something."
print(say)
Report("",say,msgType)
else
say = string.format(say.."%6u NOTICE raised",NoticeCount)
print("")
print(say)
Report("")
Report("",spacerREPORT..say)
end
print("")
-- Report("")
say = ""
if ConflictCount > 0 then
if ConflictCount > 1 then
say = string.format(say..[[%6u CONFLICTS detected in processed Scripts/paks]],ConflictCount)
else
say = string.format(say..[[%6u CONFLICT detected in processed Scripts/paks]],ConflictCount)
end
print(say..SeeReport)
Report("")
Report("",say,msgType)
-- Report("")
say = spacerCMD.."CONFLICTS will prevent the mods involved from expressing their full effect."
print(say)
Report("",say,msgType)
say = spacerCMD.."Some CONFLICTS can be resolved by COMBINING mods..."
print(say)
Report("",say,msgType)
-- print()
-- Report("")
say = spacerCMD.."See file 'Creating a Patch for an existing MOD PAK.txt' for further help"
print(say)
Report("",say,msgType)
print("")
Report("")
else
if CheckMODSconflicts or CheckSCRIPTconflicts then
if CheckMODSconflicts and CheckSCRIPTconflicts then
say = string.format(say.."%6u CONFLICT detected in processed Scripts/paks",ConflictCount)
-- print("")
print(say)
Report("")
Report("",spacerREPORT..say)
if (io.open(arg[2].."OnlyOneScript.txt") == nil) then
say = spacerCMD.."It is safe to use together any of the generated PAKs"
print(say)
Report("",spacerREPORT..say)
end
elseif CheckMODSconflicts then
say = string.format(say.."%6u CONFLICT detected in processed MODS paks",ConflictCount)
-- print("")
print(say)
Report("")
Report("",spacerREPORT..say)
else --only SCRIPTS
say = string.format(say.."%6u CONFLICT detected in processed SCRIPTS",ConflictCount)
-- print("")
print(say)
Report("")
Report("",spacerREPORT..say)
end
else
say = say.." - CONFLICT Detection Skipped at user request"
-- print("")
print(say)
Report("")
Report("",spacerREPORT..say)
end
print("")
Report("")
end
LuaEndedOk(THIS)
|
a = 1 -- Here we declare a numeric variable
fruit = "banana" -- Here we declare a string datatype
needspeeling = True -- This is a boolean
local b = 2 -- This variable declaration is prefixed with a scope modifier
|
local E, C, L = select(2, ...):unpack()
----------------------------------------------------------------------------------------
-- Core Function Methods
----------------------------------------------------------------------------------------
local format = string.format
local tonumber = tonumber
----------------------------------------------------------------------------------------
-- Time format functions
----------------------------------------------------------------------------------------
function E:FormatTime(seconds, raw)
local d, h, m, str = 86400, 3600, 60
if seconds >= d then
str = format("%d" .. E.colorString .. "d", seconds / d)
elseif seconds >= h then
str = format("%d" .. E.colorString .. "h", seconds / h)
elseif seconds >= m then
str = format("%d" .. E.colorString .. "m", seconds / m)
else
if seconds <= 5 and raw then
str = format("|cffff0000%.1f|r", seconds) -- red
elseif seconds <= 10 and raw then
str = format("|cffffff00%.1f|r", seconds) -- yellow
else
str = format("%d", seconds)
end
end
return str
end
----------------------------------------------------------------------------------------
-- UTF functions
----------------------------------------------------------------------------------------
function E:UTF(string, i, dots)
if not string then return end
local bytes = string:len()
if bytes <= i then
return string
else
local len, pos = 0, 1
while (pos <= bytes) do
len = len + 1
local c = string:byte(pos)
if c > 0 and c <= 127 then
pos = pos + 1
elseif c >= 192 and c <= 223 then
pos = pos + 2
elseif c >= 224 and c <= 239 then
pos = pos + 3
elseif c >= 240 and c <= 247 then
pos = pos + 4
end
if len == i then break end
end
if len == i and pos <= bytes then
return string:sub(1, pos - 1) .. (dots and "..." or "")
else
return string
end
end
end
----------------------------------------------------------------------------------------
-- Number value function
----------------------------------------------------------------------------------------
function E:Round(number, decimals)
if not decimals then decimals = 0 end
return (("%%.%df"):format(decimals)):format(number)
end
function E:ShortValue(value)
if C.general.locale_valueformat and type(L.ValueFormat) == 'function' then
return L.ValueFormat(value)
end
if value >= 1e11 then
return ("%.0fb"):format(value / 1e9)
elseif value >= 1e10 then
return ("%.1fb"):format(value / 1e9):gsub("%.?0+([km])$", "%1")
elseif value >= 1e9 then
return ("%.2fb"):format(value / 1e9):gsub("%.?0+([km])$", "%1")
elseif value >= 1e8 then
return ("%.0fm"):format(value / 1e6)
elseif value >= 1e7 then
return ("%.1fm"):format(value / 1e6):gsub("%.?0+([km])$", "%1")
elseif value >= 1e6 then
return ("%.2fm"):format(value / 1e6):gsub("%.?0+([km])$", "%1")
elseif value >= 1e5 then
return ("%.0fk"):format(value / 1e3)
elseif value >= 1e3 then
return ("%.1fk"):format(value / 1e3):gsub("%.?0+([km])$", "%1")
else
return format("%.0f", value)
end
end
----------------------------------------------------------------------------------------
-- RGB To Hex function
----------------------------------------------------------------------------------------
function E:RGBToHex(r, g, b, raw)
if type(r) == 'table' then
if r.r then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end
end
r = tonumber(r) <= 1 and tonumber(r) >= 0 and tonumber(r) or 0
g = tonumber(g) <= tonumber(g) and tonumber(g) >= 0 and tonumber(g) or 0
b = tonumber(b) <= 1 and tonumber(b) >= 0 and tonumber(b) or 0
return format(raw and "%02x%02x%02x" or "|cff%02x%02x%02x", r * 255, g * 255, b * 255)
end
----------------------------------------------------------------------------------------
-- Chat channel check
----------------------------------------------------------------------------------------
function E:CheckChat(warning)
if IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then
return "INSTANCE_CHAT"
elseif IsInRaid(LE_PARTY_CATEGORY_HOME) then
if warning and (UnitIsGroupLeader("player") or UnitIsGroupAssistant("player") or IsEveryoneAssistant()) then
return "RAID_WARNING"
else
return "RAID"
end
elseif IsInGroup(LE_PARTY_CATEGORY_HOME) then
return "PARTY"
end
return "SAY"
end
|
local API_SE = require(script:GetCustomProperty("APIStatusEffects"))
local ABILITY = script:GetCustomProperty("Ability"):WaitForObject()
function OnExecute(ability)
local player = ability.owner
API_SE.ApplyStatusEffect(player, player, API_SE.STATUS_EFFECT_DEFINITIONS["Freeze Solid"].id)
player:ResetVelocity()
end
ABILITY.executeEvent:Connect(OnExecute)
|
WireToolSetup.setCategory( "Detection" )
WireToolSetup.open( "adv_las_receiver", "Advanced Laser Pointer Receiver", "gmod_wire_adv_las_receiver", nil, "Advanced Laser Pointer Receivers" )
if CLIENT then
language.Add( "Tool.wire_adv_las_receiver.name", "Advanced Laser Receiver Tool (Wire)" )
language.Add( "Tool.wire_adv_las_receiver.desc", "Spawns a better laser receiver prop for use with the wire system." )
TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } }
end
WireToolSetup.BaseLang()
WireToolSetup.SetupMax( 20 )
TOOL.ClientConVar = {
model = "models/jaanus/wiretool/wiretool_range.mdl",
}
function TOOL.BuildCPanel(panel)
ModelPlug_AddToCPanel(panel, "Misc_Tools", "wire_adv_las_receiver")
end
|
local M = {}
M.config = function ()
require("whichkey_setup").config{
hide_statusline = false,
default_keymap_settings = {
silent=true,
noremap=true,
},
default_mode = 'n',
}
end
return M
|
--- @class GAngle
--- List of all possible functions to manipulate angles.
--- Created by Global.Angle.
--- @field p number @The pitch component of the angle
--- @field pitch number @The pitch component of the angle
--- @field x number @The pitch component of the angle
--- @field y number @The yaw component of the angle
--- @field yaw number @The yaw component of the angle
--- @field r number @The roll component of the angle
--- @field roll number @The roll component of the angle
--- @field z number @The roll component of the angle
local GAngle = {}
--- Adds the values of the argument angle to the orignal angle.
--- This functions the same as angle1 + angle2 without creating a new angle object, skipping object construction and garbage collection.
--- @param angle GAngle @The angle to add.
function GAngle:Add(angle)
end
--- Divides all values of the original angle by a scalar. This functions the same as angle1 / num without creating a new angle object, skipping object construction and garbage collection.
--- @param scalar number @The number to divide by.
function GAngle:Div(scalar)
end
--- Returns a normal vector facing in the direction that the angle points.
--- @return GVector @The forward direction of the angle
function GAngle:Forward()
end
--- Returns whether the pitch, yaw and roll are 0 or not.
--- @return boolean @Whether the pitch, yaw and roll are 0 or not.
function GAngle:IsZero()
end
--- Multiplies a scalar to all the values of the orignal angle. This functions the same as num * angle without creating a new angle object, skipping object construction and garbage collection.
--- @param scalar number @The number to multiply.
function GAngle:Mul(scalar)
end
--- Normalizes the angles by applying a module with 360 to pitch, yaw and roll.
function GAngle:Normalize()
end
--- Returns a normal vector facing in the direction that points right relative to the angle's direction.
--- @return GVector @The right direction of the angle
function GAngle:Right()
end
--- Rotates the angle around the specified axis by the specified degrees.
--- @param axis GVector @The axis to rotate around.
--- @param rotation number @The degrees to rotate around the specified axis.
function GAngle:RotateAroundAxis(axis, rotation)
end
--- Copies pitch, yaw and roll from the second angle to the first.
--- @param originalAngle GAngle @The angle to copy the values from.
function GAngle:Set(originalAngle)
end
--- Sets the p, y, and r of the angle.
--- @param p number @The pitch component of the Angle
--- @param y number @The yaw component of the Angle
--- @param r number @The roll component of the Angle
function GAngle:SetUnpacked(p, y, r)
end
--- Snaps the angle to nearest interval of degrees.
--- ℹ **NOTE**: This will modify the original angle too!
--- @param axis string @The component/axis to snap
--- @param target number @The target angle snap interval
--- @return GAngle @The snapped angle.
function GAngle:SnapTo(axis, target)
end
--- Subtracts the values of the argument angle to the orignal angle. This functions the same as angle1 - angle2 without creating a new angle object, skipping object construction and garbage collection.
--- @param angle GAngle @The angle to subtract.
function GAngle:Sub(angle)
end
--- Returns the angle as a table with three elements.
--- @return table @The table with elements 1 = p, 2 = y, 3 = r.
function GAngle:ToTable()
end
--- Returns the pitch, yaw, and roll components of the angle.
--- @return number @p, pitch, x, or Angle[1].
--- @return number @y, yaw, or Angle[2].
--- @return number @r, roll, r, or Angle[3].
function GAngle:Unpack()
end
--- Returns a normal vector facing in the direction that points up relative to the angle's direction.
--- @return GVector @The up direction of the angle.
function GAngle:Up()
end
--- Sets pitch, yaw and roll to 0.
--- This function is faster than doing it manually.
function GAngle:Zero()
end
|
--[[
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource()),
function()
--outputDebugString('/sSkyBox to switch the effect')
triggerEvent( "switchSkyBox", resourceRoot, true )
addCommandHandler( "sSkyBox",
function()
triggerEvent( "switchSkyBox", resourceRoot, not sbxEffectEnabled )
end
)
end
)]]
-- handle the change
addEvent ( "onClientUserSettingChange", true )
addEventHandler ( "onClientUserSettingChange", root, function ( n, v )
if ( n == "usersetting_shader_skybox" ) then
if ( v ~= sbxEffectEnabled ) then
switchSkyBox ( v )
end
end
end )
addEvent ( "onClientPlayerLogin", true )
addEventHandler ( "onClientPlayerLogin", root, function ( )
local v = exports.NGPhone:getSetting ( "usersetting_shader_skybox" )
if ( v ~= sbxEffectEnabled ) then
switchSkyBox ( v )
end
end )
function switchSkyBox( sbOn )
if sbOn then
startShaderResource()
else
stopShaderResource()
end
end
addEvent( "switchSkyBox", true )
addEventHandler( "switchSkyBox", resourceRoot, switchSkyBox )
addEventHandler( "onClientResourceStop", getResourceRootElement( getThisResource()),stopShaderResource)
|
local skynet = require "skynet"
require "skynet.manager"
local httpc = require "http.httpc"
local dns = require "dns"
local ipay = require "ipay"
local CMD = {}
function CMD.create_ipay(msg)
return ipay.request(msg)
end
skynet.start(function()
httpc.dns() -- set dns server
httpc.timeout = 100 -- set timeout 1 second
skynet.dispatch("lua", function(_, _, cmd, ...)
local f = CMD[cmd]
if f then
skynet.ret(skynet.pack(f(...)))
end
end)
skynet.register("orderclient")
end)
|
---
-- Very basic SIP registrar server
-- it supports only one login/password
local sip = require "voip.sip"
local cnn = sip.connection(function()end)
cnn:set_timeout(0.01)
local ok,err = cnn:bind("*", 5060)
if not ok then
print("can not bind:", err)
return
end
local us = sip.US(cnn)
local AUTH, PASS, REALM = "1000", "1234", "LoacalRealm"
local function Make200OK(req)
local resp = sip.new_message{
"SIP/2.0 200 OK";
"Via: " .. req:getHeader('Via');
"From: " .. req:getHeader('From');
"To: " .. req:getHeader('To');
"Call-ID: " .. req:getHeader('Call-ID');
"CSeq: " .. req:getHeader('CSeq');
"Expires: " .. req:getHeader('Expires');
"Content-Length: 0";
}
return resp
end
local function Make401Unauthorized(req)
local resp = sip.new_message{
"SIP/2.0 401 Unauthorized";
"Via: " .. req:getHeader('Via');
"From: " .. req:getHeader('From');
"To: " .. req:getHeader('To');
"Call-ID: " .. req:getHeader('Call-ID');
"CSeq: " .. req:getHeader('CSeq');
'WWW-Authenticate: Digest realm="' .. REALM .. '",nonce="' .. us.private_.gen.nonce() .. '",algorithm=MD5';
"Content-Length: 0";
}
resp:addHeaderValueParameter("To",'tag', us.private_.gen.tag())
return resp
end
local function Make403Forbidden(req)
local resp = sip.new_message{
"SIP/2.0 403 Forbidden";
"Via: " .. req:getHeader('Via');
"From: " .. req:getHeader('From');
"To: " .. req:getHeader('To');
"Call-ID: " .. req:getHeader('Call-ID');
"CSeq: " .. req:getHeader('CSeq');
"Content-Length: 0";
}
resp:addHeaderValueParameter("To",'tag', us.private_.gen.tag())
return resp
end
local WORKING = true
while WORKING do repeat
local req, host, port = cnn:recvfrom()
if not req then
if err ~= "timeout" then
print("error", host)
WORKING = false
end
break
end
if req:isPing() then
print("PING", host, port) -- @todo sent back
cnn:sendto(nil, msg, host, port)
break
end
print(req)
if req:getRequestLine() ~= "REGISTER" then
print("Unsupported request:", req:getRequestLine())
-- @fixme set ACK
local resp = Make403Forbidden(req)
cnn:sendto(nil, resp, host, port)
break
end
if req:getHeaderValueParameter("Via", "rport") then
-- rfc 3581
-- @todo reg-id and +sip.instance
-- @todo set rport parameter in VIA for response
else
-- @fixme do we need use last VIA
local uri = req:getUri('contact')
if uri then
host = uri:match('sip:[^@]*@([^:]*)')
port = uri:match('sip:[^@]*@[^:]*:([0-9]+)$') or '5060'
end
end
if req:getHeader("Authorization") then
--@fixme check that it valid nonce
auth = us:check_auth_response(req, AUTH, PASS)
print('CHECK AUTH:', auth)
local resp = (auth and Make200OK or Make401Unauthorized)(req)
cnn:sendto(nil, resp, host , port)
break
end
if req:getHeader("Expires") == "0" then -- unregister
local resp = Make200OK(req)
cnn:sendto(nil, resp, host , port)
break
end
local resp = Make401Unauthorized(req)
cnn:sendto(nil, resp, host , port)
break
until true end
cnn:close()
|
-- main entry
function main(t)
-- build project
if is_host("macosx") and os.arch() ~= "arm64" then
t:build()
else
return t:skip("wrong host platform")
end
end
|
local awful = require 'awful'
local beautiful = require 'beautiful'
local hotkeys_popup = require 'awful.hotkeys_popup'
local has_fdo, freedesktop = pcall(require, 'freedesktop')
awesomemenu = {
{
'Hotkeys',
function()
hotkeys_popup.show_help(nil, awful.screen.focused())
end
},
{
'Restart',
awesome.restart
},
{
'Quit',
function()
awesome.quit()
end
}
}
local menu_awesome = {
'Awesome',
awesomemenu,
beautiful.awesome_icon
}
local menuterminal = {
terminalname,
terminal
}
local menueditor = {
editorname,
editorcmd
}
local menuplayer = {
playername,
musiccmd
}
local menubrowser = {
browsername,
browsercmd
}
restmenu = {
menuterminal,
menueditor,
menuplayer,
menubrowser,
}
if has_fdo then
mainmenu = freedesktop.menu.build {
before = {
menu_awesome
},
after = restmenu
}
else
mainmenu = awful.menu {
items = {
menu_awesome,
table.unpack(restmenu)
}
}
end
launcher = awful.widget.launcher {
image = beautiful.awesome_icon,
menu = mainmenu
}
|
local eq = assert.are.same
local errors = assert.has_error
describe('query', function()
local query = require('codicons').query
local invalid_retval_msg = '[Codicons.nvim] Invalid retval'
local invalid_pattern_range_msg = '[Codicons.nvim] First parameter must either be a range (table) or a pattern (string)'
local name_error_msg = '[Codicons.nvim] Invalid combination, retval cannot be name while identifier is a string'
local range_error_msg = '[Codicons.nvim] Invalid combination, retval cannot be unicode while identifier is a range'
local malformed_range_error_msg = '[Codicons.nvim] Range must be on the form {min, max}'
describe('pattern', function()
it('full matching, single parameter', function()
eq({ ['comment'] = '' }, query('^comment$'))
end)
it('partially matching, single parameter', function()
local expected = {
['comment'] = '',
['comment-add'] = '',
['comment-discussion'] = ''
}
local actual = query('comment')
table.sort(actual)
eq(expected, actual)
end)
it('partially matching, retval = "unicode"', function()
local expected = {
['comment'] = 60011,
['comment-add'] = 60011,
['comment-discussion'] = 60103
}
local actual = query('comment', 'unicode')
table.sort(actual)
eq(expected, actual)
end)
it('partially matching, retval = "full"', function()
local expected = {
['comment'] = { unicode = 60011, icon = '' },
['comment-add'] = { unicode = 60011, icon = '' },
['comment-discussion'] = { unicode = 60103, icon = '' }
}
local actual = query('comment', 'full')
table.sort(actual)
eq(expected, actual)
end)
end)
describe('range', function()
it('equal min and max', function()
eq({ [60011] = '' }, query({0xEA6B, 0xEA6B}))
end)
it('increasing range values', function()
eq({ [60011] = '', [60012] = '', [60013] = '' }, query({0xEA6B, 0xEA6D}))
end)
it('partially matching, retval = "unicode"', function()
local expected = {
[60011] = { 'comment', 'comment-add' },
[60012] = { 'alert', 'warning' },
[60013] = { 'search', 'search-save' }
}
local actual = query({0xEA6B, 0xEA6D}, 'name')
for _, t in pairs(actual) do
table.sort(t)
end
eq(expected, actual)
end)
it('partially matching, retval = "full"', function()
local expected = {
[60011] = { name = { 'comment', 'comment-add' }, icon = '' },
[60012] = { name = { 'alert', 'warning' }, icon = '' },
[60013] = { name = { 'search', 'search-save' }, icon = '' }
}
local actual = query({0xEA6B, 0xEA6D}, 'full')
for _, t in pairs(actual) do
table.sort(t.name)
end
eq(expected, actual)
end)
end)
describe('invalid input', function()
it('negative range returns empty table', function()
eq({}, query({60012, 60011}))
end)
it('non-matching pattern returns empty table', function()
eq({}, query('this-does-not-match-anything'))
end)
end)
describe('erronous parameter combination', function()
it('errors on pattern and name', function()
errors(function() query('^comment$', 'name') end, name_error_msg)
end)
it('errors on hexadecimal range and unicode', function()
errors(function() query({0xEA6B, 0xEA6C}, 'unicode') end, range_error_msg)
end)
it('errors on decimal range and name', function()
errors(function() query({60011, 60012}, 'unicode') end, range_error_msg)
end)
it('errors on malformed range', function()
errors(function() query({}) end, malformed_range_error_msg)
end)
it('errors on invalid pattern_range type', function()
errors(function() query(true) end, invalid_pattern_range_msg)
end)
it('errors on invalid retval', function()
errors(function() query('some-pattern', 'invalid') end, invalid_retval_msg)
end)
end)
end)
|
SLASH_ITEMINFO1 = "/iteminfo"
function SlashCmdList.ITEMINFO(msg, editbox)
local AceGUI = LibStub("AceGUI-3.0")
local window = AceGUI:Create("Window")
window:SetHeight(700)
window:SetWidth(300)
window:SetLayout("Flow")
local iteminfo = {strsplit(":", msg)}
--item:itemId:enchantId:gemId1:gemId2:gemId3:gemId4:suffixId:uniqueId:linkLevel:specializationID:upgradeId:instanceDifficultyId:numBonusIds:bonusId1:bonusId2:upgradeValue
local indexDescription = {
"itemid",
"enchantId",
"gemId1",
"gemId2",
"gemId3",
"gemId4",
"suffixId",
"uniqueId",
"linkLevel",
"specializationId",
"upgradeId",
"instanceDifficultyId",
"numBonusIds",
"bonusId1",
"bonusId2",
"upgradeValue",
"Unknown",
"Unknown",
"Unknown",
"Unknown",
"Unknown",
"Unknown",
}
local editBoxes = {}
for i=1,#indexDescription do
local label = AceGUI:Create("Label")
label:SetRelativeWidth(0.40)
label:SetText(indexDescription[i])
local editBox = AceGUI:Create("EditBox")
editBox:SetRelativeWidth(0.40)
editBoxes[i] = editBox
if #iteminfo < (i + 1) then
editBox:SetText("")
else
local txt = tostring(iteminfo[i+1])
if not txt:find("%[") then
editBox:SetText(txt)
end
end
window:AddChild(label)
window:AddChild(editBox)
end
local button = AceGUI:Create("Button")
button:SetText("Generate Link")
button:SetCallback("OnClick", function()
local input = "item"
for i=1,#editBoxes do
input = input .. ":" ..editBoxes[i]:GetText()
end
local name, link = GetItemInfo(input)
print(link)
end)
window:AddChild(button)
end
|
local backends = require("aerial.backends")
local callbacks = require("aerial.backends.lsp.callbacks")
local config = require("aerial.config")
local data = require("aerial.data")
local M = {}
-- callback args changed in Neovim 0.6. See:
-- https://github.com/neovim/neovim/pull/15504
local function mk_handler(fn)
return function(...)
local config_or_client_id = select(4, ...)
local is_new = type(config_or_client_id) ~= "number"
if is_new then
fn(...)
else
local err = select(1, ...)
local method = select(2, ...)
local result = select(3, ...)
local client_id = select(4, ...)
local bufnr = select(5, ...)
local conf = select(6, ...)
fn(err, result, { method = method, client_id = client_id, bufnr = bufnr }, conf)
end
end
end
local has_hook = false
local function add_handler(preserve_callback)
if has_hook then
return
end
has_hook = true
local old_callback = vim.lsp.handlers["textDocument/documentSymbol"]
local new_callback
new_callback = function(...)
mk_handler(callbacks.symbol_callback)(...)
if preserve_callback then
old_callback(...)
end
end
vim.lsp.handlers["textDocument/documentSymbol"] = new_callback
end
M.fetch_symbols = function()
vim.lsp.buf.document_symbol()
end
M.fetch_symbols_sync = function(timeout)
local params = vim.lsp.util.make_position_params()
local lsp_results, err = vim.lsp.buf_request_sync(
0,
"textDocument/documentSymbol",
params,
timeout or 4000
)
if err then
vim.api.nvim_err_writeln("Error when finding document symbols: " .. err)
else
callbacks.handle_symbols(lsp_results[1].result)
end
end
local function mark_lsp_attached(bufnr)
vim.api.nvim_buf_set_var(bufnr, "_aerial_lsp_attached", true)
end
local function is_lsp_attached(bufnr)
local ok, attached = pcall(vim.api.nvim_buf_get_var, bufnr, "_aerial_lsp_attached")
return ok and attached
end
M.is_supported = function(bufnr)
if not bufnr or bufnr == 0 then
bufnr = vim.api.nvim_get_current_buf()
end
return is_lsp_attached(bufnr)
end
M.on_attach = function(client, bufnr, opts)
if type(bufnr) == "table" then
opts = bufnr
bufnr = 0
elseif not bufnr then
bufnr = 0
end
opts = opts or {}
if not client.resolved_capabilities.document_symbol then
return
end
add_handler(opts.preserve_callback)
mark_lsp_attached(bufnr)
backends.attach(bufnr, true)
end
M.attach = function(bufnr)
if config.lsp.diagnostics_trigger_update then
local cmd = [[lua require'aerial.backends.lsp'._on_diagnostics_changed()]]
if vim.fn.exists("##DiagnosticChanged") == 1 then
vim.cmd(string.format(
[[augroup AerialDiagnostics
au! * <buffer>
au DiagnosticChanged <buffer> %s
augroup END
]],
cmd
))
else
vim.cmd(string.format(
[[augroup AerialDiagnostics
au!
au User LspDiagnosticsChanged %s
augroup END
]],
cmd
))
end
end
if config.open_automatic() and not config.lsp.diagnostics_trigger_update then
M.fetch_symbols()
end
end
M.detach = function(bufnr)
-- pass
end
M._on_diagnostics_changed = function()
if not backends.is_backend_attached(0, "lsp") then
return
end
local errors = #vim.diagnostic.get(0, { severity = "Error" })
-- if no errors, refresh symbols
if config.lsp.update_when_errors or errors == 0 or not data:has_symbols() then
M.fetch_symbols()
end
end
return M
|
require("utils/functions.lua")
-- Add an Object to the Update System --
function UpSys.addObj(obj)
if valid(obj) == false then return end
-- Add the Object --
UpSys.addObject(obj)
end
-- Remove an Object from the Update System --
function UpSys.removeObj(obj)
-- Remove the Object --
if obj.entID then
global.entsTable[obj.entID] = nil
end
end
-- Update System: Scan Entities --
function UpSys.scanObjs()
-- Clear the Entities Table --
global.entsTable = {}
-- Clear the Tick Table --
for k, j in pairs(global.upsysTickTable) do
if k < game.tick then
global.upsysTickTable[k] = nil
end
end
-- Add all Objects to --
for k, obj in pairs(global.objTable) do
if obj.noUpsys ~= true then
UpSys.addTable(global[obj.tableName])
end
end
-- Add all Internal Energy Cubes and Internal Quatron Cubes --
for k, MF in pairs(global.MFTable) do
UpSys.addObject(MF.dataNetwork)
UpSys.addObject(MF.networkController)
UpSys.addObject(MF.internalEnergyObj)
UpSys.addObject(MF.internalQuatronObj)
UpSys.addObject(MF.jumpDriveObj)
end
-- Save the last scan tick --
global.upSysLastScan = game.tick
end
-- Update System: Add an Object to the MF Entities Table --
function UpSys.addObject(obj)
if global.upsysTickTable == nil then global.upsysTickTable = {} end
if global.entsTable == nil then global.entsTable = {} end
-- Check the size of the UpSys Table --
if table_size(global.upsysTickTable) > 300 then
game.print("Mobile Factory - Upsys Error: table size too hight, unable to update Entities")
global.upsysTickTable = {}
return
end
-- Check if the Object is not null --
if obj ~= nil and getmetatable(obj) ~= nil then
if obj:valid() ~= true then
-- Delete the Entity --
obj:remove()
else
-- Add the Object to the Entity Table --
if obj.ent ~= nil and obj.ent.valid == true then
global.entsTable[obj.ent.unit_number] = obj
end
-- Check if the Object have to be updated --
if obj.updateTick > 0 then
-- Set Update --
local nextUpdate = game.tick + (game.tick - obj.lastUpdate)
if obj.lastUpdate == 0 or game.tick - obj.lastUpdate > obj.updateTick*2 then
-- Look for the best Tick to update --
local bestTick = 1
for i = 1, 60 do
if table_size(global.upsysTickTable[game.tick+i] or {}) < table_size(global.upsysTickTable[game.tick+bestTick] or {}) then
bestTick = i
if global.upsysTickTable[game.tick+i] == nil then
break
end
end
end
nextUpdate = game.tick + bestTick
if global.upsysTickTable[nextUpdate] == nil then global.upsysTickTable[nextUpdate] = {} end
table.insert(global.upsysTickTable[nextUpdate], obj)
obj.lastUpdate = 1
end
end
return true
end
end
return false
end
-- Update System: Add a Table to the MF Entities Table --
function UpSys.addTable(array)
-- Create the Table if needed --
if array == nil then array = {} end
-- Itinerate the Table --
for k, obj in pairs(array) do
-- Add the Object --
if UpSys.addObject(obj) == false then
array[k] = nil
end
end
end
-- Update System: Update Entities --
function UpSys.update(event)
-- Check all Object --
if game.tick - global.upSysLastScan > _mfScanTicks * 10 then
UpSys.scanObjs()
end
-- if true then return end
-- Check if there are something to update --
if global.upsysTickTable[game.tick] == nil then return end
-- Create the updated Index --
local updated = 1
-- Update Object --
for k, obj in pairs(global.upsysTickTable[game.tick]) do
-- If more objects can be updated --
if valid(obj) == true then
if updated <= global.entsUpPerTick then
obj:update(event)
updated = updated + 1
if global.upsysTickTable[game.tick + obj.updateTick] == nil then
global.upsysTickTable[game.tick + obj.updateTick] = {}
end
table.insert(global.upsysTickTable[game.tick + obj.updateTick], obj)
-- Else if there are no more update available --
else
if global.upsysTickTable[game.tick+1] == nil then
global.upsysTickTable[game.tick+1] = {}
end
table.insert(global.upsysTickTable[game.tick+1], obj)
end
end
end
-- Delete the Table --
global.upsysTickTable[game.tick] = nil
end
-- Index all Erya Structures --
-- function Erya.indexEryaStructures()
-- global.eryaIndexedTable = {}
-- local i = 0
-- for k, es in pairs(global.eryaTable) do
-- i = i + 1
-- if valid(es) then
-- global.eryaIndexedTable[i] = es
-- else
-- global.eryaTable[k] = nil
-- end
-- end
-- end
-- function Erya.updateEryaStructures(event)
-- for i=0, 10 do
-- if global.updateEryaIndex > table_size(global.eryaIndexedTable) then
-- global.updateEryaIndex = 1
-- Erya.indexEryaStructures()
-- return
-- end
-- local es = global.eryaIndexedTable[global.updateEryaIndex]
-- if valid(es) == true and es.lastUpdate + es.updateTick < event.tick then
-- es:update()
-- end
-- global.updateEryaIndex = global.updateEryaIndex + 1
-- end
-- end
|
config = {
var2 = -100
}
|
ITEM.name = "Chinese Noodle"
ITEM.model = "models/props_junk/garbage_takeoutcarton001a.mdl"
ITEM.hungerAmount = 20
ITEM.foodDesc = "A Cartoon of Chinese Food."
ITEM.price = 5
ITEM.quantity = 1
|
--- Snowflake utilities
-- @module discord.utilities.snowflake
local discord = ... --Passed as an argument
local bit = discord.utilities.bit --Universal bitwise interface
--Localised functions and values
local band, lshift, rshift = bit.band, bit.lshift, bit.rshift
local floor = math.floor
--The snowflake module
local snowflake = {}
snowflake.workerID = 1 --The worker ID of the generated snowflakes
snowflake.processID = 0 --The process ID of the generated snowflakes
snowflake.increment = 0 --The increment of the snowflakes generated using this API
--Divides a decimal number string by 2, the result is also a string
local function divideByTwo(str)
local remainder = 0
local newNum, newNumLen = {}, 1
for digit in str:gmatch("%d") do
newNum[newNumLen] = floor(digit/2) + remainder
remainder = digit % 2 > 0 and 5 or 0
newNumLen = newNumLen + 1
end
return table.concat(newNum, ""):gsub("^0*", ""), (tonumber(str:sub(-1, -1)) % 2 == 1)
end
--Converts a decimal string into a binary string, using manual math
local function str2bin(str)
local bits, bitslen = {}, 1
local isOne
while str ~= "" do
str, isOne = divideByTwo(str)
bits[bitslen] = isOne and "1" or "0"
bitslen = bitslen + 1
end
if bitslen % 2 == 0 then bits[bitslen] = "" else bitslen = bitslen - 1 end
--Reverse bits order
for i=1, bitslen/2 do bits[i], bits[bitslen-i+1] = bits[bitslen-i+1], bits[i] end
bits = table.concat(bits, "")
return bits
end
--For fixing the decoded timestamp
local fixFactor = 1024/1000
--Decodes a snowflake, returns a table with the decoded information
function snowflake.decode(sf)
local timeBits = str2bin(sf)
local largePart, smallPart = timeBits:sub(1,-33), timeBits:sub(-32, -23)
largePart, smallPart = tonumber(largePart, 2) or 0, tonumber(smallPart, 2) or 0
local time = largePart*fixFactor + smallPart/1000
time = math.floor(time + 1420070400)
sf = tonumber(sf)
local workerID = bit.band(sf,0x3E0000)
workerID = bit.rshift(workerID,17)
local processID = bit.band(sf, 0x1F000)
processID = bit.rshift(processID,12)
local increment = bit.band(sf, 0xFFF)
return {
time = time, workerID = workerID, processID = processID, increment = increment
}
end
--Converts a snowflake into a os.time() compatible value
function snowflake.toTime(sf)
sf = tonumber(sf)
return bit.rshift(sf,22) + 1420070400
end
--Generates a snowflake from the given time value
function snowflake.fromTime(time, worker)
time = time - 1420070400
time = lshift(time, 5) + (worker or snowflake.workerID)
time = lshift(time, 5) + snowflake.processID
time = lshift(time, 12) + snowflake.increment
snowflake.increment = snowflake.increment + 1 --Increase the increment counter for this process
return tostring(time)
end
--Generates a new snowflake for the current moment
function snowflake.new(worker)
return snowflake.fromTime(os.time(), worker)
end
return snowflake
|
menu = {}
function menu:new(instance)
instance = instance or {}
self.__index = self
setmetatable(instance, self)
return instance
end
function menu:Show()
if not self.canvasName then
Debug.Log("menu:Show: Missing canvasName")
return
end
if self.canvasEntityId then
Debug.Log("menu:Show: Canvas " .. self.canvasName .. " already showing: " .. tostring(self.canvasEntityId))
return
end
local canvasPath = "UI/Canvases/PlayerAccount/" .. self.canvasName .. ".uicanvas"
self.canvasEntityId = UiCanvasManagerBus.Broadcast.LoadCanvas(canvasPath)
if not self.canvasEntityId then
Debug.Log("Failed to load canvas " .. canvasPath)
return
end
self.canvasHandler = UiCanvasNotificationBus.Connect(self, self.canvasEntityId)
self:ConnectToCloudGemPlayerAccountNotificationHandler()
end
function menu:ConnectToCloudGemPlayerAccountNotificationHandler()
if not self.cloudGemPlayerAccountNotificationHandler then
self.cloudGemPlayerAccountNotificationHandler = CloudGemPlayerAccountNotificationBus.Connect(self, self.entityId)
end
end
function menu:Hide()
if self.canvasHandler then
self.canvasHandler:Disconnect()
self.canvasHandler = nil
end
if self.canvasEntityId then
UiCanvasManagerBus.Broadcast.UnloadCanvas(self.canvasEntityId)
self.canvasEntityId = nil
end
if self.cloudGemPlayerAccountNotificationHandler then
self.cloudGemPlayerAccountNotificationHandler:Disconnect()
self.cloudGemPlayerAccountNotificationHandler = nil
end
end
function menu:OnAction(entityId, actionName)
local menuName = string.match(actionName, "^Show([a-zA-Z]+)Click$")
if menuName then
self.menuManager:ShowMenu(menuName)
return
end
Debug.Log("menu:OnAction: Unrecognized action '" .. actionName .. "'")
end
function menu:OnAfterConfigurationChange()
CloudGemPlayerAccountRequestBus.Broadcast.GetCurrentUser()
end
function menu:OnGetCurrentUserComplete(result)
if not result.wasSuccessful and self.loadMainMenuOnSignOut then
Debug.Log("Not signed in, loading main menu.")
self:RunOnMainThread(function()
self.menuManager:ShowMenu("MainMenu")
end)
end
end
function menu:GetText(elementName)
local elementId = UiCanvasBus.Event.FindElementByName(self.canvasEntityId, elementName)
return UiTextBus.Event.GetText(elementId)
end
function menu:SetText(elementName, text)
local elementId = UiCanvasBus.Event.FindElementByName(self.canvasEntityId, elementName)
UiTextBus.Event.SetText(elementId, text)
end
function menu:RunOnMainThread(task)
self.menuManager:RunOnMainThread(task)
end
return menu
|
object_building_mustafar_items_must_satellite_uplink = object_building_mustafar_items_shared_must_satellite_uplink:new {
}
ObjectTemplates:addTemplate(object_building_mustafar_items_must_satellite_uplink, "object/building/mustafar/items/must_satellite_uplink.iff")
|
ITEM.name = "Generator"
ITEM.description = "Effectively a miniature nuclear reactor without the fear of a melt down, this artifact can only be utilized in an especially made conductor that contains its energy and radiation. Being a suitable replacement for a portable generator to power a building. [ +30 RAD ]"
ITEM.category = "Artifacts"
ITEM.model = "models/artefacts/generator.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.weight = 5
ITEM.isArtefact = true
ITEM.price = 61000
ITEM.flag = "A"
ITEM.debuff = "rads"
ITEM.debuffval = 30
|
local Utility = require("Utility")
local Puck = {}
local optionUltimateHelper = Menu.AddOption({"Hero Specific", "Puck"}, "Ultimate Helper", "Cast ultimate on best position once the order key is pressed")
local optionKillSteal = Menu.AddOption({"Hero Specific", "Puck"}, "Kill Steal", "Cast spell (silence) on enemy to KS")
local optionPhaseShiftProtection = Menu.AddOption({"Hero Specific", "Puck"}, "Phase Shift Protection", "don't break phase shift unless using blink or pressing S")
function Puck.OnUpdate()
local myHero = Heroes.GetLocal()
if not myHero or NPC.GetUnitName(myHero) ~= "npc_dota_hero_puck" then return end
if Menu.IsEnabled(optionKillSteal) then
Puck.KillSteal()
end
end
function Puck.OnPrepareUnitOrders(orders)
if not orders then return true end
local myHero = Heroes.GetLocal()
if not myHero then return true end
if Menu.IsEnabled(optionPhaseShiftProtection) and NPC.HasModifier(myHero, "modifier_puck_phase_shift") then
-- interrupt phase shift when using blink
if orders.ability and Entity.IsAbility(orders.ability) and Ability.GetName(orders.ability) == "item_blink" then
return true
end
-- interrupt phase shift when pressing stop
if orders.order and (orders.order == Enum.UnitOrder.DOTA_UNIT_ORDER_STOP or orders.order == Enum.UnitOrder.DOTA_UNIT_ORDER_HOLD_POSITION) then
return true
end
-- ignore other source of interruption
return false
end
if Menu.IsEnabled(optionUltimateHelper) and orders.ability and Entity.IsAbility(orders.ability)
and Ability.GetName(orders.ability) == "puck_dream_coil"
and orders.order ~= Enum.UnitOrder.DOTA_UNIT_ORDER_TRAIN_ABILITY then
Puck.UltimateHelper(orders.position)
return false
end
return true
end
function Puck.UltimateHelper(default_pos)
local myHero = Heroes.GetLocal()
if not myHero then return end
local ultimate = NPC.GetAbility(myHero, "puck_dream_coil")
if not ultimate or not Ability.IsCastable(ultimate, NPC.GetMana(myHero)) then return end
local range = 750
local radius = 375
local enemyHeroes = NPC.GetHeroesInRadius(myHero, range, Enum.TeamType.TEAM_ENEMY)
local best_pos = Utility.BestPosition(enemyHeroes, radius)
if not best_pos and default_pos then Ability.CastPosition(ultimate, default_pos) end
if best_pos then Ability.CastPosition(ultimate, best_pos) end
end
function Puck.KillSteal()
local myHero = Heroes.GetLocal()
if not myHero then return end
local orb = NPC.GetAbility(myHero, "puck_illusory_orb")
local orb_damage = 0
if orb then orb_damage = 70 * Ability.GetLevel(orb) end
local silence = NPC.GetAbility(myHero, "puck_waning_rift")
local silence_damage = 0
if silence and Ability.GetLevel(silence) > 0 then
silence_damage = 100 + 60 * (Ability.GetLevel(silence) - 1)
end
for i = 1, Heroes.Count() do
local enemy = Heroes.Get(i)
if enemy and not NPC.IsIllusion(enemy) and not Entity.IsSameTeam(myHero, enemy) and Utility.CanCastSpellOn(enemy) then
local true_silence_damage = silence_damage * NPC.GetMagicalArmorDamageMultiplier(enemy)
if true_silence_damage >= Entity.GetHealth(enemy) and Puck.CastSilence(enemy) then return end
local true_orb_damage = orb_damage * NPC.GetMagicalArmorDamageMultiplier(enemy)
if true_orb_damage >= Entity.GetHealth(enemy) then
local dis = (Entity.GetAbsOrigin(myHero) - Entity.GetAbsOrigin(enemy)):Length()
local delay = dis / 651
local pos = Utility.GetPredictedPosition(enemy, delay)
if Puck.CastOrb(pos) then return end
end
end
end
end
-- define Puck's defind behavior
-- input: target entity, can be nil
function Puck.Defend(target)
local myHero = Heroes.GetLocal()
if not myHero then return end
-- 1. use phrase shift to dodge
if Puck.CastShift() then return end
-- 2. use silence against enemy in range
if Puck.CastSilence(target) then return end
-- 3. use jaunt to dodge; it can be dangerous in some conditions
-- if Puck.CastJaunt() then return end
end
function Puck.CastOrb(pos)
local myHero = Heroes.GetLocal()
if not myHero then return false end
local orb = NPC.GetAbility(myHero, "puck_illusory_orb")
if not orb or not Ability.IsCastable(orb, NPC.GetMana(myHero)) then return false end
local range = 1950
local dis = (Entity.GetAbsOrigin(myHero) - pos):Length()
if dis > range then return false end
Ability.CastPosition(orb, pos)
return true
end
function Puck.CastJaunt()
local myHero = Heroes.GetLocal()
if not myHero then return false end
local jaunt = NPC.GetAbility(myHero, "puck_ethereal_jaunt")
if not jaunt or not Ability.IsCastable(jaunt, NPC.GetMana(myHero)) then return false end
Ability.CastNoTarget(jaunt)
return true
end
-- input: target entity, can be nil
function Puck.CastSilence(target)
local myHero = Heroes.GetLocal()
if not myHero then return false end
local silence = NPC.GetAbility(myHero, "puck_waning_rift")
if not silence or not Ability.IsCastable(silence, NPC.GetMana(myHero)) then return false end
local radius = 400
if target and (not NPC.IsEntityInRange(myHero, target, radius) or not Utility.CanCastSpellOn(target)) then return false end
Ability.CastNoTarget(silence)
return true
end
function Puck.CastShift()
local myHero = Heroes.GetLocal()
if not myHero then return false end
local shift = NPC.GetAbility(myHero, "puck_phase_shift")
if not shift or not Ability.IsCastable(shift, NPC.GetMana(myHero)) then return false end
Ability.CastNoTarget(shift)
return true
end
return Puck
|
modifier_mars_basic_attack_stacks = class({})
function modifier_mars_basic_attack_stacks:IsHidden() return false end
function modifier_mars_basic_attack_stacks:IsDebuff() return false end
function modifier_mars_basic_attack_stacks:IsStunDebuff() return false end
function modifier_mars_basic_attack_stacks:IsPurgable() return true end
function modifier_mars_basic_attack_stacks:OnCreated(kv)
if IsServer() then
self.effects_cast_weapon = {}
self:SetStackCount(1)
end
end
function modifier_mars_basic_attack_stacks:OnRefresh(kv)
local max_stacks = self:GetAbility():GetSpecialValueFor("max_stacks")
if IsServer() then
if self:GetStackCount() < max_stacks then
self.effects_cast_weapon = {}
self:IncrementStackCount()
if self:GetStackCount() == max_stacks then
self:PlayEffectsCharged()
end
end
end
end
function modifier_mars_basic_attack_stacks:OnDestroy(kv)
if IsServer() then
self:StopEffects()
end
end
function modifier_mars_basic_attack_stacks:PlayEffectsCharged()
ReplenishEFX(self:GetParent())
self:CreateGlow(0)
self:CreateGlow(1)
self:CreateGlow(2)
self:CreateGlow(3)
self:CreateGlow(4)
self:CreateGlow(5)
end
function modifier_mars_basic_attack_stacks:CreateGlow(index)
local particle_cast = "particles/units/heroes/hero_invoker_kid/invoker_kid_forge_spirit_ambient_fire.vpcf"
local caster = self:GetParent()
local origin = caster:GetOrigin()
self.effects_cast_weapon[index] = ParticleManager:CreateParticle(
particle_cast,
PATTACH_ABSORIGIN_FOLLOW,
caster
)
end
function modifier_mars_basic_attack_stacks:StopEffects()
for _,efx in pairs(self.effects_cast_weapon) do
if efx ~= nil then
ParticleManager:DestroyParticle(efx, false)
ParticleManager:ReleaseParticleIndex(efx)
end
end
end
|
-- CONFIG --
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
-- Blacklisted vehicle models
ListeBlackList = {
"RHINO",
"BLIMP",
"BLIMP2",
"CARGOPLANE",
"BESRA",
"CUBAN800",
"DODO",
"JET",
"MILJET",
"CARGOBOB",
"hydra",
"CUTTER",
"DUMP",
"BULLDOZER",
"Lazer",
"luxor",
"luxor2",
"miljet",
"nimbus",
"shamal",
"mammatus",
"besra",
"deluxo",
"tug",
"TITAN"
}
-- CODE --
Citizen.CreateThread(function()
while true do
Wait(1000)
playerPed = GetPlayerPed(-1)
if playerPed then
checkCar(GetVehiclePedIsIn(playerPed, false))
coords = GetEntityCoords(playerPed, true)
--x, y, z = table.unpack(GetEntityCoords(playerPed, true))
for _, blacklistedCar in pairs(ListeBlackList) do
local voiture = ESX.Game.GetVehiclesInArea(coords, 350) -- Changer ça si trop de MS utilisé
for _, voiture in pairs(voiture) do
checkCar(voiture)
end
end
end
end
end)
function _DeleteEntity(entity)
Citizen.InvokeNative(0xAE3CBE5BF394C9C9, Citizen.PointerValueIntInitialized(entity))
end
function checkCar(car)
if car then
carModel = GetEntityModel(car)
carName = GetDisplayNameFromVehicleModel(carModel)
VieDuVehicule = GetVehicleEngineHealth(car)
if VieDuVehicule <= 1 then
_DeleteEntity(car)
end
if isListeBlackListed(carModel) then
_DeleteEntity(car)
if carName ~= "BLIMP" then
print(carName)
AfficherAC("~r~RUBY ANTI CHEAT ACTIVER - SUPPRESSION DE VEHICULE BLACKLIST EN COURS !\nPERTE DE FPS POSSIBLE !", car, carModel, carName)
end
end
end
end
function ACdelete(car)
Wait(15000)
_DeleteEntity(car)
end
function DrawAdvancedText(x,y ,w,h,sc, text, r,g,b,a,font,jus)
SetTextFont(font)
SetTextProportional(0)
SetTextScale(sc, sc)
N_0x4e096588b13ffeca(jus)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0,255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x - 0.1+w, y - 0.02+h)
end
local textActif = false
local wait = 0
function AfficherAC(text, car, carModel, carName)
if textActif == false then
TriggerServerEvent("AC:VehModdeur", car, carModel, carName)
Citizen.CreateThread(function()
textActif = true
while wait < 200 do
wait = wait + 1
DrawAdvancedText(0.588, 0.836, 0.005, 0.0028, 0.4, text, 255, 255, 255, 255, 6, 0)
Wait(10)
end
wait = 0
textActif = false
end)
end
end
function isListeBlackListed(model)
for _, blacklistedCar in pairs(ListeBlackList) do
if model == GetHashKey(blacklistedCar) then
return true
end
end
return false
end
|
module "luci.controller.services"
function index()
local uci = require "luci.model.uci".cursor()
uci:foreach("olsrd", "LoadPlugin", function(s)
if s.library == "olsrd_nameservice" then
has_serv = true
end
end)
if has_serv then
entry({"freifunk", "services"}, template("freifunk-services/services"), _("Services"), 60)
end
end
|
local util = require("spec.util")
describe("assignment to tuple", function()
it("should not care about an array's inferred length when assigned indirectly", util.check [[
local t: {number, number}
local arr = {1, 2, 3, 4}
t = arr
]])
it("should error when an array literal is too long", util.check_type_error([[
local t: {number, number}
t = {1, 2, 3}
]], {
{ msg = "incompatible length, expected maximum length of 2, got 3", y = 2 },
}))
it("should allow an array literal when its length fits the tuple type", util.check([[
local t: {number, number, string}
t = {1, 2}
]]))
end)
|
local addon, Engine = ...
local DE = LibStub('AceAddon-3.0'):NewAddon(addon, 'AceEvent-3.0', 'AceHook-3.0')
local L = Engine.L
Engine.Core = DE
_G[addon] = Engine
-- Lua functions
local _G = _G
local format, ipairs, min, pairs, select, strsplit, tonumber = format, ipairs, min, pairs, select, strsplit, tonumber
-- WoW API / Variables
local C_ChallengeMode_GetActiveKeystoneInfo = C_ChallengeMode.GetActiveKeystoneInfo
local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
local CreateFrame = CreateFrame
local UnitGUID = UnitGUID
local tContains = tContains
local Details = _G.Details
-- GLOBALS: ElitismLog
DE.debug = false
DE.debugFakeData = false
DE.CustomDisplay = {
name = L["Avoidable Damage Taken"],
icon = 2175503,
source = false,
attribute = false,
spellid = false,
target = false,
author = "Bass",
desc = L["Show how much avoidable damage was taken."],
script_version = 1,
script = [[
local Combat, CustomContainer, Instance = ...
local total, top, amount = 0, 0, 0
if _G.Details_Elitism then
local Container = Combat:GetActorList(DETAILS_ATTRIBUTE_MISC)
for _, player in ipairs(Container) do
if player:IsGroupPlayer() then
-- we only record the players in party
local damage, cnt = _G.Details_Elitism:GetRecord(Combat:GetCombatNumber(), player:guid())
if damage > 0 or cnt > 0 then
CustomContainer:AddValue(player, damage)
end
end
end
total, top = CustomContainer:GetTotalAndHighestValue()
amount = CustomContainer:GetNumActors()
end
return total, top, amount
]],
tooltip = [[
local Actor, Combat, Instance = ...
local GameCooltip = GameCooltip
if _G.Details_Elitism then
local realCombat
for i = -1, 25 do
local current = Details:GetCombat(i)
if current and current:GetCombatNumber() == Combat.combat_counter then
realCombat = current
break
end
end
if not realCombat then return end
local sortedList = {}
_, _, spells = _G.Details_Elitism:GetRecord(Combat:GetCombatNumber(), realCombat[1]:GetActor(Actor.nome):guid())
for spellID, spelldata in pairs(spells) do
tinsert(sortedList, {spellID, spelldata.sum})
end
-- local spellList = realCombat[1]:GetActor(Actor.nome):GetSpellList()
-- local orbName = _G.Details_Elitism:RequireOrbName()
-- for spellID, spellTable in pairs(spellList) do
-- local amount = spellTable.targets[orbName]
-- if amount then
-- tinsert(sortedList, {spellID, amount})
-- end
-- end
sort(sortedList, Details.Sort2)
local format_func = Details:GetCurrentToKFunction()
for _, tbl in ipairs(sortedList) do
local spellID, amount = unpack(tbl)
local spellName, _, spellIcon = Details.GetSpellInfo(spellID)
GameCooltip:AddLine(spellName, format_func(_, amount))
Details:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon(spellIcon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
end
end
]],
total_script = [[
local value, top, total, Combat, Instance, Actor = ...
local format_func = Details:GetCurrentToKFunction()
if _G.Details_Elitism then
local damage, cnt = _G.Details_Elitism:GetRecord(Combat:GetCombatNumber(), Actor.my_actor.serial)
return "" .. format_func(_, damage) .. " (" .. cnt .. ")"
-- return _G.Details_Elitism:GetDisplayText(Combat:GetCombatNumber(), Actor.my_actor.serial)
end
return ""
]],
}
DE.CustomDisplayAuras = {
name = L["Avoidable Abilities Taken"],
icon = 2175503,
source = false,
attribute = false,
spellid = false,
target = false,
author = "Bass",
desc = L["Show how many avoidable abilities hit players."],
script_version = 1,
script = [[
local Combat, CustomContainer, Instance = ...
local total, top, amount = 0, 0, 0
if _G.Details_Elitism then
local Container = Combat:GetActorList(DETAILS_ATTRIBUTE_MISC)
for _, player in ipairs(Container) do
if player:IsGroupPlayer() then
-- we only record the players in party
local cnt, _ = _G.Details_Elitism:GetAuraRecord(Combat:GetCombatNumber(), player:guid())
-- _G.Details_Elitism:Debug("guid %s target %s hit %s", player:guid() or 0, target or 0,hit or 0)
if cnt > 0 then
CustomContainer:AddValue(player, cnt)
end
end
end
total, top = CustomContainer:GetTotalAndHighestValue()
amount = CustomContainer:GetNumActors()
end
return total, top, amount
]],
tooltip = [[
local Actor, Combat, Instance = ...
local GameCooltip = GameCooltip
if _G.Details_Elitism then
local realCombat
for i = -1, 25 do
local current = Details:GetCombat(i)
if current and current:GetCombatNumber() == Combat.combat_counter then
realCombat = current
break
end
end
if not realCombat then return end
local sortedList = {}
_, spells = _G.Details_Elitism:GetAuraRecord(Combat:GetCombatNumber(), realCombat[1]:GetActor(Actor.nome):guid())
for spellID, spelldata in pairs(spells) do
tinsert(sortedList, {spellID, spelldata.cnt})
end
-- local spellList = realCombat[1]:GetActor(Actor.nome):GetSpellList()
-- local orbName = _G.Details_Elitism:RequireOrbName()
-- for spellID, spellTable in pairs(spellList) do
-- local amount = spellTable.targets[orbName]
-- if amount then
-- tinsert(sortedList, {spellID, amount})
-- end
-- end
sort(sortedList, Details.Sort2)
local format_func = Details:GetCurrentToKFunction()
for _, tbl in ipairs(sortedList) do
local spellID, cnt = unpack(tbl)
local spellName, _, spellIcon = Details.GetSpellInfo(spellID)
GameCooltip:AddLine(spellName, format_func(_, cnt))
Details:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon(spellIcon, 1, 1, _detalhes.tooltip.line_height, _detalhes.tooltip.line_height)
end
end
]],
total_script = [[
local value, top, total, Combat, Instance, Actor = ...
local format_func = Details:GetCurrentToKFunction()
if _G.Details_Elitism then
local cnt, _ = _G.Details_Elitism:GetAuraRecord(Combat:GetCombatNumber(), Actor.my_actor.serial)
return "" .. cnt
end
return ""
]],
}
DE.Spells = {
-- Debug
--[252144] = 1,
--[252150] = 1,
-- Reaping
--[290085] = 20, -- Expel Soul (Environment)
[296142] = 20, -- Shadow Smash (Lost Soul)
-- [288693] = 20, -- Grave Bolt (Tormented Soul) Is this really avoidable?
-- Affixes
[209862] = 20, -- Volcanic Plume (Environment)
[226512] = 20, -- Sanguine Ichor (Environment)
-- Freehold
[272046] = 20, --- Dive Bomb (Sharkbait)
[257426] = 20, --- Brutal Backhand (Irontide Enforcer)
[258352] = 20, --- Grapeshot (Captain Eudora)
[256594] = 20, --- Barrel Smash (Captain Raoul)
[272374] = 20, --- Whirlpool of Blades (Captain Jolly)
[256546] = 20, --- Shark Tornado (Trothak)
[257310] = 20, --- Cannon Barrage (Harlan Sweete)
[257784] = 20, --- Frost Blast (Bilge Rat Brinescale)
[257902] = 20, --- Shell Bounce (Ludwig Von Tortollan)
[258199] = 20, --- Ground Shatter (Irontide Crusher)
[276061] = 20, --- Boulder Throw (Irontide Crusher)
[258779] = 20, --- Sea Spout (Irontide Oarsman)
[274400] = 20, --- Duelist Dash (Cutwater Duelist)
[257274] = 20, --- Vile Coating (Environment)
[258673] = 20, --- Azerite Grenade (Irontide Crackshot)
[274389] = 20, --- Rat Traps (Vermin Trapper)
[257460] = 20, --- Fiery Debris (Harlan Sweete)
--[257871] = 20, --- Blade Barrage (Irontide Buccaneer)
--[257757] = 20, --- Goin' Bananas (Bilge Rat Buccaneer)
-- Shrine of the Storm
[276268] = 20, --- Heaving Blow (Shrine Templar)
[267973] = 20, --- Wash Away (Temple Attendant)
[268059] = 20, --- Anchor of Binding (Tidesage Spiritualist)
[264155] = 20, --- Surging Rush (Aqu'sirr)
[267841] = 20, --- Blowback (Galecaller Faye)
[267899] = 20, --- Hindering Cleave (Brother Ironhull)
[268280] = 20, --- Tidal Pod (Tidesage Enforcer)
[276286] = 20, --- Slicing Hurricane (Galecaller Apprentice)
[276292] = 20, --- Whirlign Slam (Ironhull Apprentice)
[267385] = 20, --- Tentacle Slam (Vol'zith the Whisperer)
-- Siege of Boralus
[256627] = 20, --- Slobber Knocker (Kul Tiran Halberd)
[256663] = 20, --- Burning Tar (Blacktar Bomber)
[275775] = 20, --- Savage Tempest (Irontide Raider)
[257292] = 20, --- Heavy Slash (Kul Tiran Vanguard)
[272426] = 20, --- Sighted Artillery (Ashvane Spotter)
[257069] = 20, --- Watertight Shell (Kul Tiran Wavetender)
[273681] = 20, --- Heavy Hitter (Chopper Redhook)
[272874] = 20, --- Trample (Ashvane Commander)
[268260] = 20, --- Broadside (Ashvane Cannoneer)
[269029] = 20, --- Clear the Deck (Dread Captain Lockwood)
[268443] = 20, --- Dread Volley (Dread Captain Lockwood)
[272713] = 20, --- Crushing Slam (Bilge Rat Demolisher)
[274941] = 20, --- Banana Rampage swirlies(Bilge Rat Buccaneer)
[257883] = 20, --- Break Water (Hadal Darkfathom)
[276068] = 20, --- Tidal Surge (Hadal Darkfathom)
[257886] = 20, --- Brine Pool (Hadal Darkfathom)
[261565] = 20, --- Crashing Tide (Hadal Darkfathom)
[277535] = 20, --- Viq'Goth's Wrath (Viq'Goth)
-- Tol Dagor
[257119] = 20, --- Sand Trap (The Sand Queen)
[257785] = 20, --- Flashing Daggers (Jes Howlis)
[256976] = 20, --- Ignition (Knight Captain Valyri)
[256955] = 20, --- Cinderflame (Knight Captain Valyri)
[256083] = 20, --- Cross Ignition (Overseer Korgus)
[263345] = 20, --- Massive Blast (Overseer Korgus)
[258364] = 20, --- Fuselighter (Ashvane Flamecaster)
[259711] = 20, --- Lockdown (Ashvane Warden)
[256710] = 20, --- Burning Arsenal (Knight Captain Valyri)
-- Waycrest Manor
[264531] = 20, --- Shrapnel Trap (Maddened Survivalist)
[264476] = 20, --- Tracking Explosive (Crazed Marksman)
[260569] = 20, --- Wildfire (Soulbound Goliath)
[265407] = 20, --- Dinner Bell (Banquet Steward)
[264923] = 20, --- Tenderize (Raal the Gluttonous)
[264712] = 20, --- Rotten Expulsion (Raal the Gluttonous)
[272669] = 20, --- Burning Fists (Soulbound Goliath)
[278849] = 20, --- Uproot (Coven Thornshaper)
[264040] = 20, --- Uprooted Thorns (Coven Thornshaper)
[265757] = 20, --- Splinter Spike (Matron Bryndle)
[264150] = 20, --- Shatter (Thornguard)
[268387] = 20, --- Contagious Remnants (Lord Waycrest)
[268308] = 20, --- Discordant Cadenza (Lady Waycrest
-- Atal'Dazar
[253666] = 20, --- Fiery Bolt (Dazar'ai Juggernaught)
[257692] = 20, --- Tiki Blaze (Environment)
[255620] = 20, --- Festering Eruption (Reanimated Honor Guard)
[258723] = 20, --- Grotesque Pool (Renaimated Honor Guard)
[250259] = 20, --- Toxic Leap (Vol'kaal)
[250022] = 20, --- Echoes of Shadra (Yazma)
[250585] = 20, --- Toxic Pool (Vol'kaal)
[250036] = 20, --- Shadowy Remains (Echoes of Shadra)
[255567] = 20, --- Frenzied Charge (T'lonja)
-- King's Rest
[270003] = 20, --- Suppression Slam (Animated Guardian)
[269932] = 20, --- Ghust Slash (Shadow-Borne Warrior)
[265781] = 20, --- Serpentine Gust (The Golden Serpent)
[265914] = 20, --- Molten Gold (The Golden Serpent)
[270928] = 20, --- Bladestorm (King Timalji)
[270931] = 20, --- Darkshot (Queen Patlaa)
[270891] = 20, --- Channel Lightning (King Rahu'ai)
[266191] = 20, --- Whirling Axe (Council of Tribes)
[270292] = 20, --- Purifying Flame (Purification Construct)
[270503] = 20, --- Hunting Leap (Honored Raptor)
[270514] = 20, --- Ground Crush (Spectral Brute)
[271564] = 20, --- Embalming Fluid (Embalming Fluid)
[270485] = 20, --- Blooded Leap (Spectral Berserker)
[267639] = 20, --- Burn Corruption (Mchimba the Embalmer)
[268419] = 20, --- Gale Slash (King Dazar)
[268796] = 20, --- Impaling Spear (King Dazar)
-- The MOTHERLODE!!
[257371] = 20, --- Gas Can (Mechanized Peace Keeper)
[262287] = 20, --- Concussion Charge (Mech Jockey / Venture Co. Skyscorcher)
[268365] = 20, --- Mining Charge (Wanton Sapper)
[269313] = 20, --- Final Blast (Wanton Sapper)
[275907] = 20, --- Tectonic Smash (Azerokk)
[259533] = 20, --- Azerite Catalyst (Rixxa Fluxflame)
[260103] = 20, --- Propellant Blast (Rixxa Fluxflame)
[260279] = 20, --- Gattling Gun (Mogul Razdunk)
[276234] = 20, --- Micro Missiles (Mogul Razdunk)
[270277] = 20, --- Big Red Rocket (Mogul Razdunk)
[271432] = 20, --- Test Missile (Venture Co. War Machine)
--[262348] = 20, --- Mine Blast (Crawler Mine)
[257337] = 20, --- Shocking Claw (Coin-Operated Pummeler)
[268417] = 20, --- Power Through (Azerite Extractor)
[268704] = 20, --- Furious Quake (Stonefury)
[258628] = 20, --- Resonant Quake (Earthrager)
[269092] = 20, --- Artillery Barrage (Ordnance Specialist)
[271583] = 20, --- Black Powder Special (Mines near the track)
[269831] = 20, --- Toxic Sludge (Oil Environment)
-- Temple of Sethraliss
[263425] = 20, --- Arc Dash (Adderis)
[268851] = 20, --- Lightning Shield (Aspix and Adderis)
[263573] = 20, --- Cyclone Strike (Adderis)
[273225] = 20, --- Volley (Sandswept Marksman)
[272655] = 20, --- Scouring Sand (Mature Krolusk)
[273995] = 20, --- Pyrrhic Blast (Crazed Incubator)
[272696] = 20, --- Lightning in a Bottle (Crazed Incubator)
[264206] = 20, --- Burrow (Merektha)
[272657] = 20, --- Noxious Breath (Merektha)
[272821] = 20, --- Call Lightning (Imbued Stormcaller)
[264763] = 20, --- Spark (Static-charged Dervish)
[279014] = 20, --- Cardiac Shock (Avatar, Environment)
-- Underrot
[265542] = 20, --- Rotten Bile (Fetid Maggot)
[265019] = 20, --- Savage Cleave (Chosen Blood Matron)
[261498] = 20, --- Creeping Rot (Elder Leaxa)
[264757] = 20, --- Sanguine Feast (Elder Leaxa)
[265665] = 20, --- Foul Sludge (Living Rot)
[260312] = 20, --- Charge (Cragmaw the Infested)
[265511] = 20, --- Spirit Drain (Spirit Drain Totem)
[259720] = 20, --- Upheaval (Sporecaller Zancha)
[270108] = 20, --- Rotting Spore (Unbound Abomination)
[272609] = 20, --- Maddenin Gaze (Faceless Corruptor)
[272469] = 20, --- Abyssal Slam (Faceless Corruptor)
[270108] = 20, --- Rotting Spore (Unbound Abomination)
-- Mechagon Workshop
[294128] = 20, --- Rocket Barrage (Rocket Tonk)
[285020] = 20, --- Whirling Edge (The Platinum Pummeler)
[294291] = 20, --- Process Waste ()
[291930] = 20, --- Air Drop (K.U-J.0)
[294324] = 20, --- Mega Drill (Waste Processing Unit)
[293861] = 20, --- Anti-Personnel Squirrel (Anti-Personnel Squirrel)
[295168] = 20, --- Capacitor Discharge (Blastatron X-80)
[294954] = 20, --- Self-Trimming Hedge (Head Machinist Sparkflux)
-- Mechagon Junkyard
[300816] = 20, --- Slimewave (Slime Elemental)
[300188] = 20, --- Scrap Cannon (Weaponized Crawler)
[300427] = 20, --- Shockwave (Scrapbone Bully)
[294890] = 20, --- Gryro-Scrap (Malfunctioning Scrapbot)
[300129] = 20, --- Self-Destruct Protocol (Malfunctioning Scrapbot)
[300561] = 20, --- Explosion (Scrapbone Trashtosser)
[299475] = 20, --- B.O.R.K. (Scraphound)
[299535] = 20, --- Scrap Blast (Pistonhead Blaster)
[298940] = 20, --- Bolt Buster (Naeno Megacrash)
[297283] = 20, --- Cave In (King Gobbamak)
--- Awakened Lieutenant
[314309] = 20, --- Dark Fury (Urg'roth, Breaker of Heroes)
[314467] = 20, --- Volatile Rupture (Voidweaver Mal'thir)
[314565] = 20, --- Defiled Ground (Blood of the Corruptor)
}
DE.SpellsNoTank = {
-- Freehold
-- Shrine of the Storm
-- Siege of Boralus
[268230] = 20, --- Crimson Swipe (Ashvane Deckhand)
-- Tol Dagor
[258864] = 20, --- Suppression Fire (Ashvane Marine/Spotter)
-- Waycrest Manor
[263905] = 20, --- Marking Cleave (Heartsbane Runeweaver)
[265372] = 20, --- Shadow Cleave (Enthralled Guard)
[271174] = 20, --- Retch (Pallid Gorger)
-- Atal'Dazar
-- King's Rest
[270289] = 20, --- Purification Beam (Purification Construct)
-- The MOTHERLODE!!
[268846] = 20, --- Echo Blade (Weapons Tester)
[263105] = 20, --- Blowtorch (Feckless Assistant)
[263583] = 20, --- Broad Slash (Taskmaster Askari)
-- Temple of Sethraliss
[255741] = 20, --- Cleave (Scaled Krolusk Rider)
-- Underrot
[272457] = 20, --- Shockwave (Sporecaller Zancha)
[260793] = 20, --- Indigestion (Cragmaw the Infested)
}
DE.Auras = {
-- Freehold
[274516] = true, -- Slippery Suds
-- Shrine of the Storm
[268391] = true, -- Mental Assault (Abyssal Cultist)
[269104] = true, -- Explosive Void (Lord Stormsong)
[267956] = true, -- Zap (Jellyfish)
-- Siege of Boralus
[274942] = true, -- Banana Stun
[257169] = true, -- Fear
-- Tol Dagor
[256474] = true, -- Heartstopper Venom (Overseer Korgus)
-- Waycrest Manor
[265352] = true, -- Toad Blight (Toad)
[278468] = true, -- Freezing Trap
-- Atal'Dazar
[255371] = true, -- Terrifying Visage (Rezan)
-- King's Rest
[276031] = true, -- Pit of Despair (Minion of Zul)
-- The MOTHERLODE!!
-- Temple of Sethraliss
[269970] = true, -- Blinding Sand (Merektha)
-- Underrot
-- Mechagon Workshop
[293986] = true, --- Sonic Pulse (Blastatron X-80)
-- Mechaton Junkyard
[398529] = true, -- Gooped (Gunker)
[300659] = true, -- Consuming Slime (Toxic Monstrosity)
}
DE.AurasNoTank = {
[272140] = true, --- Iron Volley
}
-- Public APIs
function Engine:GetRecord(combatID, playerGUID)
if DE.db[combatID] and DE.db[combatID][playerGUID] then
return DE.db[combatID][playerGUID].sum or 0, DE.db[combatID][playerGUID].cnt or 0, DE.db[combatID][playerGUID].spells
end
return 0, 0, {}
end
function Engine:GetAuraRecord(combatID, playerGUID)
if DE.db[combatID] and DE.db[combatID][playerGUID] then
return DE.db[combatID][playerGUID].auracnt or 0, DE.db[combatID][playerGUID].auras
end
return 0, {}
end
function Engine:GetDisplayText(combatID, playerGUID)
if DE.db[combatID] and DE.db[combatID][playerGUID] then
return L["Damage: "] .. (DE.db[combatID][playerGUID].sum or 0) .. " " .. L["Hits: "] .. (DE.db[combatID][playerGUID].cnt or 0)
end
return L["Damage: "] .. "0 " .. L["Hits: "] .. "0"
end
-- Private Functions
function DE:Debug(...)
if self.debug then
_G.DEFAULT_CHAT_FRAME:AddMessage("|cFF70B8FFDetails Elitism:|r " .. format(...))
end
end
function DE:COMBAT_LOG_EVENT_UNFILTERED()
if not self.current then
return
end
local timestamp, eventType, hideCaster, srcGUID, srcName, srcFlags, srcFlags2, dstGUID, dstName, dstFlags, dstFlags2 = CombatLogGetCurrentEventInfo(); -- Those arguments appear for all combat event variants.
local eventPrefix, eventSuffix = eventType:match("^(.-)_?([^_]*)$");
if self.debugFakeData then
DE:SpellDamage(0, 0, UnitGUID("player"), "Bass", 0, UnitGUID("player"), "Bass", 0, 296142, 0, 0, 30)
DE:AuraApply(0, 0, UnitGUID("player"), "Bass", 0, UnitGUID("player"), "Bass", 0, 274516, 0, 0, 0, 0)
end
if (eventPrefix:match("^SPELL") or eventPrefix:match("^RANGE")) and eventSuffix == "DAMAGE" then
local spellId, spellName, spellSchool, sAmount, aOverkill, sSchool, sResisted, sBlocked, sAbsorbed, sCritical, sGlancing, sCrushing, sOffhand, _ = select(12,CombatLogGetCurrentEventInfo())
DE:SpellDamage(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, sAmount)
elseif eventPrefix:match("^SWING") and eventSuffix == "DAMAGE" then
local aAmount, aOverkill, aSchool, aResisted, aBlocked, aAbsorbed, aCritical, aGlancing, aCrushing, aOffhand, _ = select(12,CombatLogGetCurrentEventInfo())
DE:SwingDamage(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, aAmount)
elseif eventPrefix:match("^SPELL") and eventSuffix == "MISSED" then
local spellId, spellName, spellSchool, missType, isOffHand, mAmount = select(12,CombatLogGetCurrentEventInfo())
if mAmount then
DE:SpellDamage(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, mAmount)
end
elseif eventType == "SPELL_AURA_APPLIED" then
local spellId, spellName, spellSchool, auraType = select(12,CombatLogGetCurrentEventInfo())
DE:AuraApply(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType)
elseif eventType == "SPELL_AURA_APPLIED_DOSE" then
local spellId, spellName, spellSchool, auraType, auraAmount = select(12,CombatLogGetCurrentEventInfo())
DE:AuraApply(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, auraAmount)
end
end
function DE:SpellDamage(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, aAmount)
local unitGUID = dstGUID
if (DE.Spells[spellId] or (DE.SpellsNoTank[spellId] and UnitGroupRolesAssigned(dstName) ~= "TANK")) and UnitIsPlayer(dstName) then
if not self.db[self.current] then self.db[self.current] = {} end
if not self.db[self.current][unitGUID] then self.db[self.current][unitGUID] = {
sum = 0,
cnt = 0,
spells = {},
auras = {},
auracnt = 0
} end
if not self.db[self.current][unitGUID].spells then
self.db[self.current][unitGUID].spells = {}
end
if not self.db[self.current][unitGUID].spells[spellId] then self.db[self.current][unitGUID].spells[spellId] = {
cnt = 0,
sum = 0
} end
self.db[self.current][unitGUID].sum = self.db[self.current][unitGUID].sum + aAmount
self.db[self.current][unitGUID].cnt = self.db[self.current][unitGUID].cnt + 1
self.db[self.current][unitGUID].spells[spellId].sum = self.db[self.current][unitGUID].spells[spellId].sum + aAmount
self.db[self.current][unitGUID].spells[spellId].cnt = self.db[self.current][unitGUID].spells[spellId].cnt + 1
end
end
function DE:SwingDamage(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, aAmount)
end
function DE:AuraApply(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, auraType, auraAmount)
local unitGUID = dstGUID
if (DE.Auras[spellId] or (DE.AurasNoTank[spellId] and UnitGroupRolesAssigned(dstName) ~= "TANK")) and UnitIsPlayer(dstName) then
if not self.db[self.current] then self.db[self.current] = {} end
if not self.db[self.current][unitGUID] then self.db[self.current][unitGUID] = {
sum = 0,
cnt = 0,
spells = {},
auras = {},
auracnt = 0
} end
if not self.db[self.current][unitGUID].auras[spellId] then self.db[self.current][unitGUID].auras[spellId] = {
cnt = 0
} end
self.db[self.current][unitGUID].auracnt = self.db[self.current][unitGUID].auracnt + 1
self.db[self.current][unitGUID].auras[spellId].cnt = self.db[self.current][unitGUID].auras[spellId].cnt + 1
-- if auraAmount and ElitismHelperDB.Loud then
-- maybeSendChatMessage("<EH> "..dstName.." got hit by "..GetSpellLink(spellId)..". "..auraAmount.." Stacks.")
-- elseif ElitismHelperDB.Loud then
-- maybeSendChatMessage("<EH> "..dstName.." got hit by "..GetSpellLink(spellId)..".")
-- end
end
end
function DE:RecordTarget(unitGUID, targetGUID)
if not self.current then return end
-- self:Debug("%s target %s in combat %s", unitGUID, targetGUID, self.current)
if not self.db[self.current] then self.db[self.current] = {} end
if not self.db[self.current][unitGUID] then self.db[self.current][unitGUID] = {} end
if not self.db[self.current][unitGUID][targetGUID] then self.db[self.current][unitGUID][targetGUID] = 0 end
if self.db[self.current][unitGUID][targetGUID] ~= 1 and self.db[self.current][unitGUID][targetGUID] ~= 3 then
self.db[self.current][unitGUID][targetGUID] = self.db[self.current][unitGUID][targetGUID] + 1
self.db[self.current][unitGUID].target = (self.db[self.current][unitGUID].target or 0) + 1
end
end
function DE:RecordHit(unitGUID, targetGUID)
if not self.current then return end
-- self:Debug("%s hit %s in combat %s", unitGUID, targetGUID, self.current)
if not self.db[self.current] then self.db[self.current] = {} end
if not self.db[self.current][unitGUID] then self.db[self.current][unitGUID] = {} end
if not self.db[self.current][unitGUID][targetGUID] then self.db[self.current][unitGUID][targetGUID] = 0 end
if self.db[self.current][unitGUID][targetGUID] ~= 2 and self.db[self.current][unitGUID][targetGUID] ~= 3 then
self.db[self.current][unitGUID][targetGUID] = self.db[self.current][unitGUID][targetGUID] + 2
self.db[self.current][unitGUID].hit = (self.db[self.current][unitGUID].hit or 0) + 1
end
end
function DE:InitDataCollection()
self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
end
function DE:MergeCombat(to, from)
if self.db[from] then
self:Debug("Merging combat %s into %s", from, to)
if not self.db[to] then self.db[to] = {} end
for playerGUID, tbl in pairs(self.db[from]) do
if not self.db[to][playerGUID] then
self.db[to][playerGUID] = {
sum = 0,
cnt = 0,
spells = {},
auras = {},
auracnt = 0
}
end
self.db[to][playerGUID].sum = self.db[to][playerGUID].sum + (tbl.sum or 0)
self.db[to][playerGUID].cnt = self.db[to][playerGUID].cnt + (tbl.cnt or 0)
self.db[to][playerGUID].auracnt = self.db[to][playerGUID].auracnt + (tbl.auracnt or 0)
for spellId, spelltbl in pairs(tbl.spells) do
if not self.db[to][playerGUID].spells[spellId] then self.db[to][playerGUID].spells[spellId] = {
cnt = 0,
sum = 0
} end
self.db[to][playerGUID].spells[spellId].cnt = self.db[to][playerGUID].spells[spellId].cnt + spelltbl.cnt
self.db[to][playerGUID].spells[spellId].sum = self.db[to][playerGUID].spells[spellId].sum + spelltbl.sum
end
for spellId, spelltbl in pairs(tbl.auras) do
if not self.db[to][playerGUID].auras[spellId] then self.db[to][playerGUID].auras[spellId] = {
cnt = 0
} end
self.db[to][playerGUID].auras[spellId].cnt = self.db[to][playerGUID].auras[spellId].cnt + spelltbl.cnt
end
end
end
end
function DE:MergeSegmentsOnEnd()
self:Debug("on Details MergeSegmentsOnEnd")
local overall = Details:GetCombat(1):GetCombatNumber()
for i = 2, 25 do
local combat = Details:GetCombat(i)
if not combat or not combat:IsMythicDungeon() or combat:IsMythicDungeonOverall() then break end
self:MergeCombat(overall, combat:GetCombatNumber())
end
self:CleanDiscardCombat()
end
function DE:MergeTrashCleanup()
self:Debug("on Details MergeTrashCleanup")
local baseCombat = Details:GetCombat(2)
-- killed boss before any trash combats
if not baseCombat or not baseCombat:IsMythicDungeon() or baseCombat:IsMythicDungeonOverall() then return end
local base = baseCombat:GetCombatNumber()
local prevCombat = Details:GetCombat(3)
if prevCombat then
local prev = prevCombat:GetCombatNumber()
for i = prev + 1, base - 1 do
self:MergeCombat(base, i)
end
else
local minCombat
for combatID in pairs(self.db) do
minCombat = minCombat and min(minCombat, combatID) or combatID
end
if minCombat then
for i = minCombat, base - 1 do
self:MergeCombat(base, i)
end
end
end
self:CleanDiscardCombat()
end
function DE:MergeRemainingTrashAfterAllBossesDone()
self:Debug("on Details MergeRemainingTrashAfterAllBossesDone")
local prevTrash = Details:GetCombat(2)
if prevTrash then
local prev = prevTrash:GetCombatNumber()
self:MergeCombat(prev, self.current)
end
self:CleanDiscardCombat()
end
function DE:CleanDiscardCombat()
local remain = {}
for i = 1, 25 do
local combat = Details:GetCombat(i)
if not combat then break end
remain[combat:GetCombatNumber()] = true
end
for key in pairs(self.db) do
if not remain[key] then
self.db[key] = nil
end
end
end
function DE:OnDetailsEvent(event, combat)
-- self here is not DE, this function is called from DE.EventListener
if event == 'COMBAT_PLAYER_ENTER' then
DE.current = combat:GetCombatNumber()
DE:Debug("COMBAT_PLAYER_ENTER: %s", DE.current)
elseif event == 'COMBAT_PLAYER_LEAVE' then
DE.current = combat:GetCombatNumber()
DE:Debug("COMBAT_PLAYER_LEAVE: %s", DE.current)
if not DE.current or not DE.db[DE.current] then return end
-- for _, list in pairs(DE.db[DE.current]) do
-- for key in pairs(list) do
-- if key ~= 'target' and key ~= 'hit' then
-- list[key] = nil
-- end
-- end
-- end
elseif event == 'DETAILS_DATA_RESET' then
DE:Debug("DETAILS_DATA_RESET")
DE:CleanDiscardCombat()
end
end
function DE:LoadHooks()
self:SecureHook(_G.DetailsMythicPlusFrame, 'MergeSegmentsOnEnd')
self:SecureHook(_G.DetailsMythicPlusFrame, 'MergeTrashCleanup')
self:SecureHook(_G.DetailsMythicPlusFrame, 'MergeRemainingTrashAfterAllBossesDone')
self.EventListener = Details:CreateEventListener()
self.EventListener:RegisterEvent('COMBAT_PLAYER_ENTER')
self.EventListener:RegisterEvent('COMBAT_PLAYER_LEAVE')
self.EventListener:RegisterEvent('DETAILS_DATA_RESET')
self.EventListener.OnDetailsEvent = self.OnDetailsEvent
Details:InstallCustomObject(self.CustomDisplay)
Details:InstallCustomObject(self.CustomDisplayAuras)
self:CleanDiscardCombat()
end
function DE:OnInitialize()
-- load database
self.db = ElitismLog or {}
ElitismLog = self.db
-- unit event frames
-- self.eventFrames = {}
-- for i = 1, 5 do
-- self.eventFrames[i] = CreateFrame('frame')
-- self.eventFrames[i]:SetScript('OnEvent', targetChanged)
-- end
self:RegisterEvent('PLAYER_ENTERING_WORLD', 'InitDataCollection')
self:RegisterEvent('CHALLENGE_MODE_START', 'InitDataCollection')
self:SecureHook(Details, 'StartMeUp', 'LoadHooks')
end
|
--- Module implementing the LuaRocks "list" command.
-- Lists currently installed rocks.
--module("luarocks.list", package.seeall)
local list = {}
package.loaded["luarocks.list"] = list
local search = require("luarocks.search")
local deps = require("luarocks.deps")
local cfg = require("luarocks.cfg")
local util = require("luarocks.util")
local path = require("luarocks.path")
list.help_summary = "Lists currently installed rocks."
list.help_arguments = "[--porcelain] <filter>"
list.help = [[
<filter> is a substring of a rock name to filter by.
--outdated List only rocks for which there is a
higher version available in the rocks server.
--porcelain Produce machine-friendly output.
]]
local function check_outdated(trees, query)
local results_installed = {}
for _, tree in ipairs(trees) do
search.manifest_search(results_installed, path.rocks_dir(tree), query)
end
local outdated = {}
for name, versions in util.sortedpairs(results_installed) do
local latest_installed
local latest_available, latest_available_repo
for version, _ in util.sortedpairs(versions) do
latest_installed = version
break
end
local query_available = search.make_query(name:lower())
query.exact_name = true
local results_available, err = search.search_repos(query_available)
if results_available[name] then
for version, repos in util.sortedpairs(results_available[name], deps.compare_versions) do
latest_available = version
for _, repo in ipairs(repos) do
latest_available_repo = repo.repo
break
end
break
end
if deps.compare_versions(latest_available, latest_installed) then
table.insert(outdated, { name = name, installed = latest_installed, available = latest_available, repo = latest_available_repo })
end
end
end
return outdated
end
local function list_outdated(trees, query, porcelain)
util.title("Outdated rocks:", porcelain)
local outdated = check_outdated(trees, query)
for _, item in ipairs(outdated) do
if porcelain then
util.printout(item.name, item.installed, item.available, item.repo)
else
util.printout(item.name)
util.printout(" "..item.installed.." < "..item.available.." at "..item.repo)
util.printout()
end
end
return true
end
--- Driver function for "list" command.
-- @param filter string or nil: A substring of a rock name to filter by.
-- @param version string or nil: a version may also be passed.
-- @return boolean: True if succeeded, nil on errors.
function list.run(...)
local flags, filter, version = util.parse_flags(...)
local query = search.make_query(filter and filter:lower() or "", version)
query.exact_name = false
local trees = cfg.rocks_trees
if flags["tree"] then
trees = { flags["tree"] }
end
if flags["outdated"] then
return list_outdated(trees, query, flags["porcelain"])
end
local results = {}
for _, tree in ipairs(trees) do
search.manifest_search(results, path.rocks_dir(tree), query)
end
util.title("Installed rocks:", flags["porcelain"])
search.print_results(results, flags["porcelain"])
return true
end
return list
|
local slib = slib
local snet = slib.Components.Network
--
snet.Callback('snet_file_delete_in_client', function(ply, path)
slib.FileDelete(path)
end)
function snet.FileDeleteInServer(path)
snet.InvokeServer('snet_file_delete_in_server', path)
end
|
--[[
TheNexusAvenger
Centralizes storing and playing animations.
Unless non-Roblox animations become public, the R15 animations will not work.
--]]
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Animations = require(ReplicatedStorage:WaitForChild("Data"):WaitForChild("Animations"))
local AnimationSettings = {
--Bomb
["BombHold"] = {
FadeTime = 0,
Weight = 1,
Speed = 2,
},
--Broom
["BroomWhack"] = {
FadeTime = 0,
Weight = 1,
Speed = 10, --Should be BROOM_WHACK_SPEED
},
--Reflector
["ReflectorActivate"] = {
FadeTime = 0.1,
Weight = 1,
Speed = 6,
},
--Rocket Launcher
["RocketLauncherFireAndReload"] = {
FadeTime = 0.1,
Weight = 1,
Speed = 1.5,
},
--Lobby Flag
["FlagPlant"] = {
Speed = 0.5,
}
}
local AnimationPlayer = {}
local Tool = script.Parent
--[[
Returns an animation class for the given id.
--]]
local AnimationCache = {}
local function GetAnimation(AnimationId)
if not AnimationCache[AnimationId] then
local Animation = Instance.new("Animation")
Animation.AnimationId = AnimationId
AnimationCache[AnimationId] = Animation
end
return AnimationCache[AnimationId]
end
--[[
Players the animation by name for the tool holder.
--]]
function AnimationPlayer:PlayAnimation(AnimationName)
local Character = Tool.Parent
if Character then
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if Humanoid then
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
local AnimationGroup = Animations[AnimationName]
if AnimationGroup then
local AnimationId = AnimationGroup[Humanoid.RigType]
if AnimationId then
local LoadedAnimation = Animator:LoadAnimation(GetAnimation(AnimationId))
local AnimationData = AnimationSettings[AnimationName] or {}
LoadedAnimation:Play(AnimationData.FadeTime,AnimationData.Weight,AnimationData.Speed)
return LoadedAnimation
end
else
warn("Missing animation name: "..tostring(AnimationName))
end
end
end
end
end
return AnimationPlayer
|
class 'CBoardClient'
function CBoardClient:__init()
-- Board settings
self.iStartShowRow = 0 -- Start show players from
self.fBoardWidth = SCOREBOARD_CONFIGURATION.WIDTH
self.fBoardHeight = SCOREBOARD_CONFIGURATION.HEIGHT
self.iActivationButton = SCOREBOARD_CONFIGURATION.ACTIVATION_BUTTON
self.tBorderCols = SCOREBOARD_CONFIGURATION.COLUMNS
self.fScrollKoeff = SCOREBOARD_CONFIGURATION.SCROLL_SPEED
self.tServerPlayersData = {}
self.iServerSlots = 0
-- Create an instance of CBoardGUI
self.CBoardGUI = CBoardHud(self, self.fBoardWidth, self.fBoardHeight, self.tBorderCols)
-- Attach events handlers
Events:Subscribe( "MouseScroll", self, self.onMouseScroll )
Events:Subscribe( "LocalPlayerInput", self, self.LocalPlayerInput )
-- Attach network events handlers
Network:Subscribe( "SyncPlayerData", self, self.onSyncPlayerData )
Network:Subscribe( "UpdatePlayerStats", self, self.onUpdatePlayerStats )
end
function CBoardClient:Update()
self:setPlayers(Client:getServerPlayers())
end
function CBoardClient:SyncRequest()
Network:Send("SyncRequest", LocalPlayer)
return self
end
-- Setters/Getters:
function CBoardClient:setStartShowRow( row )
self.iStartShowRow = math.max(row, 0)
if (self.iStartShowRow + self.CBoardGUI:getAvailibleRows() > #self:getPlayers()) then
self.iStartShowRow = #self:getPlayers() - self.CBoardGUI:getAvailibleRows()
end
return self
end
function CBoardClient:getStartShowRow()
return self.iStartShowRow
end
function CBoardClient:getPlayers()
return self.ServerPlayers
end
function CBoardClient:setPlayers( players )
self.ServerPlayers = players
return self
end
function CBoardClient:getPlayersCount()
return #self.ServerPlayers
end
function CBoardClient:getServerSlots()
return self.iServerSlots
end
function CBoardClient:isPlayerAllowedForDraw( player )
if player ~= nil then
return type(self.tServerPlayersData[player:GetId()]) ~= "nil"
else
return false
end
end
function CBoardClient:isHudVisible()
if Game:GetState() ~= GUIState.Game then return end
if Key:IsDown(self.iActivationButton) then
if not LocalPlayer:GetValue( "VehCameraScroll" ) then
LocalPlayer:SetValue( "VehCameraScroll", 1 )
end
return true
else
if LocalPlayer:GetValue( "VehCameraScroll" ) then
LocalPlayer:SetValue( "VehCameraScroll", nil )
end
return false
end
end
-- Event Handlers:
function CBoardClient:onMouseScroll( args )
if (self:isHudVisible()) then
self:setStartShowRow(self:getStartShowRow() - (args.delta * self.fScrollKoeff))
end
end
function CBoardClient:LocalPlayerInput( args )
if (self:isHudVisible()) then
if args.input == Action.NextWeapon or args.input == Action.PrevWeapon then
return false
end
end
end
-- Network event handlers:
function CBoardClient:onSyncPlayerData( data )
self.tServerPlayersData = data.playersData;
self.iServerSlots = data.slotsNum
end
function CBoardClient:onUpdatePlayerStats( args )
if (self.tServerPlayersData[args.playerId]) then
for k, v in pairs(args.stats) do
self.tServerPlayersData[args.playerId][k] = v
end
end
end
Events:Subscribe( "ModuleLoad", function()
CBoardClient = CBoardClient()
end )
|
local constants = require("constants")
local util = require("prototypes.util")
local styles = data.raw["gui-style"]["default"]
-- local depot_button_height = 89
-- BUTTON STYLES
-- smaller flib slot buttons
for _, color in ipairs({ "default", "red", "green", "blue" }) do
styles["ltnm_small_slot_button_" .. color] = {
type = "button_style",
parent = "flib_slot_button_" .. color,
size = 36,
}
styles["ltnm_selected_small_slot_button_" .. color] = {
type = "button_style",
parent = "flib_selected_slot_button_" .. color,
size = 36,
}
end
styles.ltnm_train_minimap_button = {
type = "button_style",
parent = "button",
size = 90,
default_graphical_set = {},
hovered_graphical_set = {
base = { position = { 81, 80 }, size = 1, opacity = 0.7 },
},
clicked_graphical_set = { position = { 70, 146 }, size = 1, opacity = 0.7 },
}
-- CHECKBOX STYLES
-- inactive is grey until hovered
-- checked = ascending, unchecked = descending
styles.ltnm_sort_checkbox = {
type = "checkbox_style",
font = "default-bold",
-- font_color = bold_font_color,
padding = 0,
default_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-white.png",
size = { 16, 16 },
scale = 0.5,
},
hovered_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-hover.png",
size = { 16, 16 },
scale = 0.5,
},
clicked_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-white.png",
size = { 16, 16 },
scale = 0.5,
},
disabled_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-white.png",
size = { 16, 16 },
scale = 0.5,
},
selected_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-white.png",
size = { 16, 16 },
scale = 0.5,
},
selected_hovered_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-hover.png",
size = { 16, 16 },
scale = 0.5,
},
selected_clicked_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-white.png",
size = { 16, 16 },
scale = 0.5,
},
selected_disabled_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-white.png",
size = { 16, 16 },
scale = 0.5,
},
checkmark = util.empty_checkmark,
disabled_checkmark = util.empty_checkmark,
text_padding = 5,
}
-- selected is orange by default
styles.ltnm_selected_sort_checkbox = {
type = "checkbox_style",
parent = "ltnm_sort_checkbox",
-- font_color = bold_font_color,
default_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-down-active.png",
size = { 16, 16 },
scale = 0.5,
},
selected_graphical_set = {
filename = "__core__/graphics/arrows/table-header-sort-arrow-up-active.png",
size = { 16, 16 },
scale = 0.5,
},
}
-- FLOW STYLES
styles.ltnm_warning_flow = {
type = "horizontal_flow_style",
padding = 12,
horizontal_align = "center",
vertical_align = "center",
vertical_spacing = 8,
horizontally_stretchable = "on",
vertically_stretchable = "on",
}
-- FRAME STYLES
styles.ltnm_main_content_frame = {
type = "frame_style",
parent = "deep_frame_in_shallow_frame",
height = constants.gui_content_frame_height,
}
styles.ltnm_main_toolbar_frame = {
type = "frame_style",
parent = "subheader_frame",
bottom_margin = 12,
horizontal_flow_style = {
type = "horizontal_flow_style",
horizontal_spacing = 12,
vertical_align = "center",
},
}
styles.ltnm_small_slot_table_frame_light = {
type = "frame_style",
parent = "ltnm_table_inset_frame_light",
minimal_height = 36,
background_graphical_set = {
base = {
position = { 282, 17 },
corner_size = 8,
overall_tiling_horizontal_padding = 4,
overall_tiling_horizontal_size = 28,
overall_tiling_horizontal_spacing = 8,
overall_tiling_vertical_padding = 4,
overall_tiling_vertical_size = 28,
overall_tiling_vertical_spacing = 8,
},
},
}
styles.ltnm_small_slot_table_frame_dark = {
type = "frame_style",
parent = "ltnm_table_inset_frame_dark",
minimal_height = 36,
background_graphical_set = {
base = {
position = { 282, 17 },
corner_size = 8,
overall_tiling_horizontal_padding = 4,
overall_tiling_horizontal_size = 28,
overall_tiling_horizontal_spacing = 8,
overall_tiling_vertical_padding = 4,
overall_tiling_vertical_size = 28,
overall_tiling_vertical_spacing = 8,
},
},
}
styles.ltnm_table_inset_frame_light = {
type = "frame_style",
parent = "deep_frame_in_shallow_frame",
}
styles.ltnm_table_inset_frame_dark = {
type = "frame_style",
parent = "deep_frame_in_shallow_frame",
graphical_set = {
base = {
position = { 51, 0 },
corner_size = 8,
center = { position = { 42, 8 }, size = { 1, 1 } },
draw_type = "outer",
},
shadow = default_inner_shadow,
},
}
styles.ltnm_table_row_frame_light = {
type = "frame_style",
parent = "statistics_table_item_frame",
top_padding = 8,
bottom_padding = 8,
left_padding = 8,
right_padding = 8,
minimal_height = 52,
horizontal_flow_style = {
type = "horizontal_flow_style",
vertical_align = "center",
horizontal_spacing = 10,
horizontally_stretchable = "on",
},
graphical_set = {
base = {
center = { position = { 76, 8 }, size = { 1, 1 } },
-- bottom = {position = {8, 40}, size = {1, 8}},
},
},
}
styles.ltnm_table_row_frame_dark = {
type = "frame_style",
parent = "ltnm_table_row_frame_light",
-- graphical_set = {
-- base = {bottom = {position = {8, 40}, size = {1, 8}}},
-- },
graphical_set = {},
}
styles.ltnm_table_toolbar_frame = {
type = "frame_style",
parent = "subheader_frame",
left_padding = 9,
right_padding = 7 + 12, -- For scrollbar
horizontally_stretchable = "on", -- FIXME: This causes the GUI to jump when the scrollbar appears
horizontal_flow_style = {
type = "horizontal_flow_style",
horizontal_spacing = 10,
vertical_align = "center",
},
}
styles.ltnm_main_warning_frame = {
type = "frame_style",
parent = "deep_frame_in_shallow_frame",
height = constants.gui_content_frame_height,
graphical_set = {
base = {
position = { 85, 0 },
corner_size = 8,
center = { position = { 411, 25 }, size = { 1, 1 } },
draw_type = "outer",
},
shadow = default_inner_shadow,
},
}
-- LABEL STYLES
local hovered_label_color = {
r = 0.5 * (1 + default_orange_color.r),
g = 0.5 * (1 + default_orange_color.g),
b = 0.5 * (1 + default_orange_color.b),
}
styles.ltnm_clickable_semibold_label = {
type = "label_style",
parent = "ltnm_semibold_label",
hovered_font_color = hovered_label_color,
disabled_font_color = hovered_label_color,
}
styles.ltnm_minimap_label = {
type = "label_style",
font = "default-game",
font_color = default_font_color,
size = 90,
vertical_align = "bottom",
horizontal_align = "right",
right_padding = 4,
}
styles.ltnm_semibold_label = {
type = "label_style",
font = "default-semibold",
}
-- MINIMAP STYLES
styles.ltnm_train_minimap = {
type = "minimap_style",
size = 90,
}
-- SCROLL PANE STYLES
styles.ltnm_table_scroll_pane = {
type = "scroll_pane_style",
parent = "flib_naked_scroll_pane_no_padding",
vertical_flow_style = {
type = "vertical_flow_style",
vertical_spacing = 0,
},
}
styles.ltnm_slot_table_scroll_pane = {
type = "scroll_pane_style",
parent = "flib_naked_scroll_pane_no_padding",
horizontally_squashable = "off",
background_graphical_set = {
base = {
position = { 282, 17 },
corner_size = 8,
overall_tiling_horizontal_padding = 4,
overall_tiling_horizontal_size = 32,
overall_tiling_horizontal_spacing = 8,
overall_tiling_vertical_padding = 4,
overall_tiling_vertical_size = 32,
overall_tiling_vertical_spacing = 8,
},
},
}
-- TABBED PANE STYLES
styles.ltnm_tabbed_pane = {
type = "tabbed_pane_style",
tab_content_frame = {
type = "frame_style",
parent = "tabbed_pane_frame",
left_padding = 12,
right_padding = 12,
bottom_padding = 8,
},
}
|
-- Unit: A unit in the game. May be a manager, intern, or physicist.
-- DO NOT MODIFY THIS FILE
-- Never try to directly create an instance of this class, or modify its member variables.
-- Instead, you should only be reading its variables and calling its functions.
local class = require("joueur.utilities.class")
local GameObject = require("games.newtonian.gameObject")
-- <<-- Creer-Merge: requires -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
-- you can add additional require(s) here
-- <<-- /Creer-Merge: requires -->>
--- A unit in the game. May be a manager, intern, or physicist.
-- @classmod Unit
local Unit = class(GameObject)
-- initializes a Unit with basic logic as provided by the Creer code generator
function Unit:init(...)
GameObject.init(self, ...)
-- The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.
--- Whether or not this Unit has performed its action this turn.
self.acted = false
--- The amount of blueium carried by this unit. (0 to job carry capacity - other carried items).
self.blueium = 0
--- The amount of blueium ore carried by this unit. (0 to job carry capacity - other carried items).
self.blueiumOre = 0
--- The remaining health of a unit.
self.health = 0
--- The Job this Unit has.
self.job = nil
--- The number of moves this unit has left this turn.
self.moves = 0
--- The Player that owns and can control this Unit.
self.owner = nil
--- The amount of redium carried by this unit. (0 to job carry capacity - other carried items).
self.redium = 0
--- The amount of redium ore carried by this unit. (0 to job carry capacity - other carried items).
self.rediumOre = 0
--- Duration of stun immunity. (0 to timeImmune).
self.stunImmune = 0
--- Duration the unit is stunned. (0 to the game constant stunTime).
self.stunTime = 0
--- The Tile this Unit is on.
self.tile = nil
--- (inherited) String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.
-- @field[string] self.gameObjectName
-- @see GameObject.gameObjectName
--- (inherited) A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.
-- @field[string] self.id
-- @see GameObject.id
--- (inherited) Any strings logged will be stored here. Intended for debugging.
-- @field[{string, ...}] self.logs
-- @see GameObject.logs
end
--- Makes the unit do something to a machine or unit adjacent to its tile. Interns sabotage, physicists work. Interns stun physicist, physicist stuns manager, manager stuns intern.
-- @tparam Tile tile The tile the unit acts on.
-- @treturn bool True if successfully acted, false otherwise.
function Unit:act(tile)
return not not (self:_runOnServer("act", {
tile = tile,
}))
end
--- Attacks a unit on an adjacent tile.
-- @tparam Tile tile The Tile to attack.
-- @treturn bool True if successfully attacked, false otherwise.
function Unit:attack(tile)
return not not (self:_runOnServer("attack", {
tile = tile,
}))
end
--- Drops materials at the units feet or adjacent tile.
-- @tparam Tile tile The tile the materials will be dropped on.
-- @tparam number amount The number of materials to dropped. Amounts <= 0 will drop all the materials.
-- @tparam string material The material the unit will drop. 'redium', 'blueium', 'redium ore', or 'blueium ore'.
-- @treturn bool True if successfully deposited, false otherwise.
function Unit:drop(tile, amount, material)
return not not (self:_runOnServer("drop", {
tile = tile,
amount = amount,
material = material,
}))
end
--- Moves this Unit from its current Tile to an adjacent Tile.
-- @tparam Tile tile The Tile this Unit should move to.
-- @treturn bool True if it moved, false otherwise.
function Unit:move(tile)
return not not (self:_runOnServer("move", {
tile = tile,
}))
end
--- Picks up material at the units feet or adjacent tile.
-- @tparam Tile tile The tile the materials will be picked up from.
-- @tparam number amount The amount of materials to pick up. Amounts <= 0 will pick up all the materials that the unit can.
-- @tparam string material The material the unit will pick up. 'redium', 'blueium', 'redium ore', or 'blueium ore'.
-- @treturn bool True if successfully deposited, false otherwise.
function Unit:pickup(tile, amount, material)
return not not (self:_runOnServer("pickup", {
tile = tile,
amount = amount,
material = material,
}))
end
--- (inherited) Adds a message to this GameObject's logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog.
-- @function Unit:log
-- @see GameObject:log
-- @tparam string message A string to add to this GameObject's log. Intended for debugging.
-- <<-- Creer-Merge: functions -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
-- if you want to add any client side logic this is where you can add them
-- <<-- /Creer-Merge: functions -->>
return Unit
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.