content
stringlengths 5
1.05M
|
|---|
--[[
Name: "cl_players.lua".
Product: "nexus".
--]]
local OVERWATCH = {};
OVERWATCH.name = "Players";
OVERWATCH.toolTip = "An alternative to the staff scoreboard menu.";
OVERWATCH.doesCreateForm = false;
-- Called to get whether the local player has access to the overwatch.
function OVERWATCH:HasAccess()
return nexus.player.IsAdmin(g_LocalPlayer);
end;
-- Called when the overwatch should be displayed.
function OVERWATCH:OnDisplay(overwatchPanel, overwatchForm)
local availableClasses = {};
local classes = {};
for k, v in ipairs( g_Player.GetAll() ) do
if ( v:HasInitialized() ) then
local class = nexus.mount.Call("GetPlayerScoreboardClass", v);
if (class) then
if ( !availableClasses[class] ) then
availableClasses[class] = {};
end;
availableClasses[class][#availableClasses[class] + 1] = v;
end;
end;
end;
for k, v in pairs(availableClasses) do
table.sort(v, function(a, b)
return nexus.mount.Call("ScoreboardSortClassPlayers", k, a, b);
end);
if (#v > 0) then
classes[#classes + 1] = {name = k, players = v};
end;
end;
table.sort(classes, function(a, b)
return a.name < b.name;
end);
if (table.Count(classes) > 0) then
local label = vgui.Create("nx_InfoText", overwatchPanel);
label:SetText("Clicking on a player may bring up some options.");
label:SetInfoColor("blue");
overwatchPanel.panelList:AddItem(label);
for k, v in pairs(classes) do
local characterForm = vgui.Create("DForm", overwatchPanel);
local panelList = vgui.Create("DPanelList", overwatchPanel);
for k2, v2 in pairs(v.players) do
local label = vgui.Create("nx_InfoText", overwatchPanel);
label:SetText( v2:Name() );
label:SetButton(true);
label:SetToolTip("This player's name is "..v2:SteamName()..".\nThis player's Steam ID is "..v2:SteamID()..".");
label:SetInfoColor( g_Team.GetColor( v2:Team() ) );
panelList:AddItem(label);
-- Called when the button is clicked.
function label.DoClick(button)
if ( IsValid(v2) ) then
local options = {};
nexus.mount.Call("GetPlayerScoreboardOptions", v2, options);
NEXUS:AddMenuFromData(nil, options);
end;
end;
end;
overwatchPanel.panelList:AddItem(characterForm);
panelList:SetAutoSize(true);
panelList:SetPadding(4);
panelList:SetSpacing(4);
characterForm:SetName(v.name);
characterForm:AddItem(panelList);
characterForm:SetPadding(4);
end;
else
local label = vgui.Create("nx_InfoText", overwatchPanel);
label:SetText("There are no players to display.");
label:SetInfoColor("orange");
overwatchPanel.panelList:AddItem(label);
end;
end;
nexus.overwatch.Register(OVERWATCH);
|
function love.conf(t)
t.window.width = 1280
t.window.height = 720
windowWidth = 1280
windowHeight = 720
t.title = "Civilization 1.2.1"
end
|
local cache = {}
local function loadcache(path, obj)
local count = 0
for line in io.lines(path) do
count = count + 1
local k,v = line:match("([^\t]+)\t(.*)")
obj[k] = v
end
log.debug("cache: loaded %d entries from %s", count, path)
end
function cache.open(path)
log.debug("cache: opening %s", path)
local obj = {}
-- read cache contents
if io.exists(path) then
loadcache(path, obj)
end
return setmetatable(obj, { __index = cache, path = path })
end
function cache:get(key)
return self[key]
end
function cache:put(key, value)
self[key] = value
end
function cache:save()
-- write cache contents
local fd = assert(io.open(getmetatable(self).path, "w"))
for k,v in pairs(self) do
fd:write("%s\t%s\n" % { k, v })
end
fd:close()
end
return cache
|
local TokenTypes = require 'constant.TokenTypes'
local TokenModifiers = require 'constant.TokenModifiers'
local findLib = require 'core.find_lib'
local rbxapi = require 'rbxapi'
local constLib = {
['math.pi'] = true,
['math.huge'] = true,
['math.maxinteger'] = true,
['math.mininteger'] = true,
['utf8.charpattern'] = true,
['io.stdin'] = true,
['io.stdout'] = true,
['io.stderr'] = true,
['package.config'] = true,
['package.cpath'] = true,
['package.loaded'] = true,
['package.loaders'] = true,
['package.path'] = true,
['package.preload'] = true,
['package.searchers'] = true,
}
local ignore = {
['_G'] = true,
['_VERSION'] = true,
['workspace'] = true,
['game'] = true,
['script'] = true,
['plugin'] = true,
['shared'] = true,
}
local luauTypeSources = {
["varType"] = true,
["paramType"] = true,
["returnType"] = true,
["typeDef"] = true,
["typeGenerics"] = true,
}
local function findNameTypes(info, ret)
ret = ret or {}
for _, v in pairs(info) do
if type(v) == "table" then
findNameTypes(v, ret)
elseif v == "nameType" then
ret[#ret+1] = info
end
end
return ret
end
return {
luauTypeSources = luauTypeSources,
findNameTypes = findNameTypes,
Care = {
['name'] = function(source, sources)
if source[1] == '' then
return
end
if ignore[source[1]] then
return
end
if source:get 'global' then
if rbxapi.Constructors[source[1]] then
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.class,
modifieres = TokenModifiers.static,
}
return
end
local lib = findLib(source)
if lib then
if lib.type == "Enums" then
return
end
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.namespace,
modifieres = TokenModifiers.static,
}
return
end
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.namespace,
modifieres = TokenModifiers.deprecated,
}
elseif source:get 'table index' then
if source._action == "set" then
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.property,
modifieres = TokenModifiers.declaration,
}
end
elseif source:bindLocal() then
if source:get 'arg' then
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.parameter,
modifieres = TokenModifiers.declaration,
}
elseif source:bindLocal():getSource():get 'arg' then
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.parameter,
}
end
if source[1] == '_ENV'
or source[1] == 'self' then
return
end
local value = source:bindValue()
local func = value:getFunction()
if func and func:getSource().name == source then
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes["function"],
modifieres = TokenModifiers.declaration,
}
return
end
elseif source:bindValue() then
local lib = findLib(source)
if lib and lib.doc and constLib[lib.doc] then
table.remove(sources, #sources)
return
end
end
end,
['emmyType'] = function(source, sources)
for type in pairs(luauTypeSources) do
if source[type] then
for _, nameType in pairs(findNameTypes(source[type].info)) do
sources[#sources+1] = {
start = nameType.start,
finish = nameType.finish,
type = TokenTypes.type,
modifieres = TokenModifiers.static,
}
end
end
end
end,
['number'] = function(source, sources)
sources[#sources+1] = {
start = source.start,
finish = source.finish,
type = TokenTypes.number,
modifieres = TokenModifiers.static,
}
end
}
}
|
-- This file initializes the campaign state, which is overriden later with "TMG_savegame.lua" if it exists.
-- You can reset the campaign to its initial state by deleting all files in the "HomeworldRM\Bin\Profiles\Profile2\TestMissionGrid" folder.
-- Make sure that all ship and subsystem types are always lower case!
colLabels = {"A","B","C","D","E","F","G","H",} -- sector column labels
modVersion = "" -- keep this blank for now
campaignIsStarted = 0 -- 0 or 1
loadSectorMap = 1 -- got to galaxy map instead of an individual sector
currentSectorRow = 1 -- 1 to 4
currentSectorCol = 1 -- 1 to 4
sectorCode = colLabels[currentSectorCol] .. currentSectorRow -- for instance "A1" or "D3"
sectorName = "Sector " .. sectorCode -- for instance "Sector A1" or "Sector D3"
currentModVersion = "0.15.2"
playerRUs = 5000
currentGameTime = 0 -- game time since start in seconds
legibleGameTime = "" -- formatted game time string
allowedToLeaveMap = 0
-- Make sure there's one entry for each map sector/mission.
sectorsExplored =
{
{0,0,0,0,},
{0,0,0,0,},
{0,0,0,0,},
{0,0,0,0,},
}
objectivesClear =
{
{0,0,0,0,},
{0,0,0,0,},
{0,0,0,0,},
{0,0,0,0,},
}
questsStatus = {}
globalTimeQueue =
{
-- 86400 seconds equal 24 hours, 21600 seconds equal 6 hours
-- time, player, squad, task, formatted time string
{0, 1, 1, "escape", ""},
{0, 1, 2, "escape", ""},
{0, 1, 3, "escape", ""},
{86400, 2, nil, "ai_reinforce", ""},
}
|
--[[ local IS_ENABLED = script:GetCustomProperty("IsEnabled")
local EaseUI = require(script:GetCustomProperty("EaseUI"))
local APIScoreRankManager = require(script:GetCustomProperty("APIScoreRankManager"))
local Template = script:GetCustomProperty("Template")
local ContentPlayerKilledBy = script:GetCustomProperty("ContentPlayerKilledBy"):WaitForObject()
local CONTENT_KILLSTREAK = script:GetCustomProperty("ContentKillstreak"):WaitForObject()
local KILLSTREAK_TEMPLATE = script:GetCustomProperty("KillstreakTemplate")
function OnPlayerKilled(killer, killed, sourceObjectId)
if (killer and killed) and (killed ~= killer) and (killed == Game:GetLocalPlayer()) then
local screenSize = UI.GetScreenSize()
local templateInstance = World.SpawnAsset(Template, { parent = ContentPlayerKilledBy})
templateInstance.width = math.floor(screenSize.x)
templateInstance.height = math.floor(screenSize.y)
local background = templateInstance:FindChildByName("Background")
local profileImage = templateInstance:FindChildByName("ProfileImage")
local rankPanel = templateInstance:FindChildByName("RankPanel")
local killRankPanel = templateInstance:FindChildByName("KillRankPanel")
local messageText = templateInstance:FindChildByName("MessageText")
local userText = messageText:FindChildByName("UsernameText")
local killerRank = killer:GetResource("Rank")
local killerRankPanels = APIScoreRankManager.GetRankImage(killerRank)
userText.text = killer.name
background.width = 0
messageText.x = -templateInstance.width
if profileImage then
profileImage.visibility = Visibility.FORCE_OFF
profileImage:SetImage(killer)
end
if rankPanel then
rankPanel.visibility = Visibility.FORCE_OFF
end
if killRankPanel then
killRankPanel.visibility = Visibility.FORCE_OFF
end
-- REMOVE THIS LATER
Task.Wait(1.25)
-- InitSize(rankPanel)
EaseUI.EaseWidth(background, templateInstance.width, 0.2, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.IN)
Task.Wait(0.3)
EaseUI.EaseX(messageText, -(templateInstance.width*0.05), 0.2, EaseUI.EasingEquation.QUADRATIC, EaseUI.EasingDirection.IN)
Task.Wait(0.2)
EaseUI.EaseX(messageText, (templateInstance.width*0.05), 2, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.INOUT)
if profileImage then
Task.Spawn(function ()
local sw = profileImage.width
local sh = profileImage.height
profileImage.width = 0
profileImage.height = 0
profileImage.visibility = Visibility.FORCE_ON
EaseUI.EaseWidth(profileImage, sw, 0.5, EaseUI.EasingEquation.BOUNCE, EaseUI.EasingDirection.OUT)
EaseUI.EaseHeight(profileImage, sh, 0.5, EaseUI.EasingEquation.BOUNCE, EaseUI.EasingDirection.OUT)
EaseUI.EaseX(profileImage, profileImage.x + (templateInstance.width*0.05), 2, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.INOUT)
Task.Wait(1.7)
EaseUI.EaseWidth(profileImage, 0, 0.1, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.OUT)
EaseUI.EaseHeight(profileImage, 0, 0.1, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.OUT)
Task.Wait(0.1)
profileImage.visibility = Visibility.FORCE_OFF
end)
end
if rankPanel then
Task.Spawn(function ()
local sw = rankPanel.width
local sh = rankPanel.height
rankPanel.width = 0
rankPanel.height = 0
rankPanel.visibility = Visibility.INHERIT
Task.Wait(0.2)
local rankAsset = World.SpawnAsset(killerRankPanels.rank, {parent = rankPanel})
EaseUI.EaseX(rankPanel, rankPanel.x + (templateInstance.width*0.05), 2, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.INOUT)
Task.Wait(1.5)
rankPanel.visibility = Visibility.FORCE_OFF
end)
end
if killRankPanel then
Task.Spawn(function ()
local sw = killRankPanel.width
local sh = killRankPanel.height
killRankPanel.width = 0
killRankPanel.height = 0
killRankPanel.visibility = Visibility.FORCE_ON
Task.Wait(0.3)
local killRankAsset = World.SpawnAsset(killerRankPanels.kill_rank, {parent = killRankPanel})
EaseUI.EaseX(killRankPanel, killRankPanel.x + (templateInstance.width*0.05), 2, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.INOUT)
Task.Wait(1.5)
killRankPanel.visibility = Visibility.FORCE_OFF
end)
end
Task.Wait(2)
EaseUI.EaseX(messageText, templateInstance.width, 0.2, EaseUI.EasingEquation.QUADRATIC, EaseUI.EasingDirection.OUT)
Task.Wait(0.5)
EaseUI.EaseX(background, templateInstance.width, 0.2, EaseUI.EasingEquation.LINEAR, EaseUI.EasingDirection.IN)
end
end
function ShowKillstreak(killstreakType,killstreakOwner)
-- killstreakType:
-- "KILLING_SPREE"
-- "RAMPAGE"
-- "UNSTOPPABLE"
-- "GODLIKE"
local KillstreakStyle = {}
if killstreakType == "KILLING_SPREE" then --Green
KillstreakStyle.color_alpha = Color.FromStandardHex("#0C4C007F")
KillstreakStyle.color = Color.FromStandardHex("#0C4C00FF")
KillstreakStyle.text = "KILLING SPREE !!!"
elseif killstreakType == "RAMPAGE" then -- Blue
KillstreakStyle.color_alpha = Color.FromStandardHex("#0067E07F")
KillstreakStyle.color = Color.FromStandardHex("#0067E0FF")
KillstreakStyle.text = "RAMPAGE !!!"
elseif killstreakType == "UNSTOPPABLE" then --Purple
KillstreakStyle.color_alpha = Color.FromStandardHex("#D200C37F")
KillstreakStyle.color = Color.FromStandardHex("#D200C3FF")
KillstreakStyle.text = "UNSTOPPABLE !!!"
elseif killstreakType == "GODLIKE" then --Orange
KillstreakStyle.color_alpha = Color.FromStandardHex("#D943007F")
KillstreakStyle.color = Color.FromStandardHex("#D94300FF")
KillstreakStyle.text = "GODLIKE !!!"
end
local KillstreakBanner = World.SpawnAsset(KILLSTREAK_TEMPLATE, { parent = CONTENT_KILLSTREAK})
KillstreakBanner:FindDescendantByName("Killstreak").text = KillstreakStyle.text
KillstreakBanner:FindDescendantByName("Nickname").text = killstreakOwner
KillstreakBanner:FindDescendantByName("Background"):SetColor( KillstreakStyle.color_alpha )
KillstreakBanner:FindDescendantByName("TopBorder"):SetColor( KillstreakStyle.color )
KillstreakBanner:FindDescendantByName("BottomBorder"):SetColor( KillstreakStyle.color )
Task.Wait(4)
KillstreakBanner:Destroy()
end
if (IS_ENABLED) then
Events.Connect("KF", OnPlayerKilled)
Events.Connect("ShowKillstreak", ShowKillstreak)
end
]]
|
-- Adapted from https://github.com/rohieb/mpv-notify
function notify_current_track()
path = mp.get_property_native("path")
data = mp.get_property_native("metadata")
cover = (path ~= nil and "cover.jpg" or path:match("(.*/)") .. "cover.jpg")
function has_value (tab, val)
for index, value in ipairs (tab) do
if value == val then
return true
end
end
return false
end
if not has_value({'.aac', '.flac', '.m4a', '.m4p', '.mp3', '.ogg', '.opus', '.wav'}, path:match("^.+(%..+)$")) then
do return end
end
function get_metadata(key)
for k, v in pairs({key, key:upper()}) do
if data[v] and string.len(data[v]) > 0 then
return data[v]
end
end
return "N/A"
end
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
os.execute("terminal-notifier -message \"" .. get_metadata("album") .. " - " .. get_metadata("track") .. "\" -title \"mpv-notify\" -subtitle \"" .. get_metadata("artist") .. " - " .. get_metadata("title") .. "\" -appIcon \"/usr/local/Cellar/mpv/HEAD/mpv.app/Contents/Resources/icon.icns\" -contentImage \"" .. (file_exists(cover) and cover or "") .. "\" -execute \"pkill mpv\"")
end
mp.register_event("file-loaded", notify_current_track)
|
MAX_USER = 2 --2人牌局
CARD_DECKS = 1 --只使用1副牌
INIT_CARDS = 5 --初始化手牌5张
|
--[[
Desc: Entity Factory
Author: SerDing
Since: 2019-03-14
Alter: 2019-11-07
]]
local _Transform = require("entity.component.transform")
local _Identity = require("entity.component.identity")
local _RESMGR = require("system.resource.resmgr")
local _EntityConfigGroup = require("system.config.entityConfigGroup")
---@class System.EntityFactory
local _FACTORY = {
world = nil,
}
local this = _FACTORY
local _creationOrder = {
"aic",
"input",
"movement",
"fighter",
"combat",
"stats",
"buff",
"render",
"skills",
"state",
"hitstop",
"effect",
"projectile",
"equipment",
"obstacle"
}
---@param world System.World
function _FACTORY.Init(world)
this.world = world
end
---@param config number|System.Config.EntityConfig @entity instance config or id of it
---@return Entity
function _FACTORY.NewEntity(config, param)
if type(config) == "number" then -- config ID
config = _EntityConfigGroup.GetEntityConfig(config)
end
---@class Entity
---@field public transform Entity.Component.Transform
---@field public identity Entity.Component.Identity
---@field public aic Entity.Component.AIC
---@field public input Entity.Component.Input
---@field public render Entity.Component.Render
---@field public fighter Entity.Component.Fighter
---@field public movement Entity.Component.Movement
---@field public stats Entity.Component.Stats
---@field public state Entity.Component.State
---@field public skills Entity.Component.Skills
---@field public combat Entity.Component.Combat
---@field public equipment Entity.Component.Equipment
---@field public hitstop Entity.Component.HitStop
---@field public buff Entity.Component.Buff
---@field public effect Entity.Component.Effect
---@field public projectile Entity.Component.Projectile
local entity = {}
entity.transform = _Transform.New(entity, config.transform or {}, param)
entity.identity = _Identity.New(entity, config.identity or {}, param)
local key = ""
for i=1,#_creationOrder do
key = _creationOrder[i]
local componentConfig = config[key]
if componentConfig then
local componentClass = require("entity.component." .. key)
if componentClass.HandleData then
componentClass.HandleData(componentConfig)
end
entity[key] = componentClass.New(entity, componentConfig, param)
end
end
for _, component in pairs(entity) do
component:Init()
component.world = this.world
end
this.world.entityMgr.AddEntity(entity)
return entity
end
return _FACTORY
|
-- The lfs module has already been injected via the C API so mark it as already having been loaded so 'require("lfs")' doesn't error.
package.loaded.lfs = lfs;
ntb = {};
require("pl");
local manifestPath;
if arg[2] and arg[2] ~= "" then
manifestPath = path.abspath(arg[2]);
else
manifestPath = path.abspath("ntbconf.lua");
end
local manifestDir = path.dirname(manifestPath);
lfs.chdir(manifestDir);
ntb.scriptPath = manifestPath;
ntb.scriptDir = manifestDir;
ntb.projectsDirectory = manifestDir;
ntb.buildDirectory = path.abspath('_out', manifestDir);
local importerCreate = require('ntb.importer');
local ninjaFileWrite = require('ntb.ninjaFileWrite');
local ninjaFileBuilderCreate = require('ntb.ninjaFileBuilder');
local cCreate = require('ntb.c');
local misc = require('ntb.misc');
local cnf = dofile(manifestPath);
if type(cnf) ~= "table" then
error("config not supplied");
end
if not cnf.targets then
error("config.targets must be a table");
end
if type(cnf.targets) ~= "table" then
error("config.targets must be a table");
end
if #cnf.targets < 1 then
error("config.targets must have at least one element");
end
if type(cnf.projects) ~= "table" then
error("config.projects must be a table");
end
local targetsByName = {};
for i, target in ipairs(cnf.targets) do
if not target.name then
error("target #" .. i .. " must have a name");
end
if targetsByName[target.name] then
error("target #" .. i .. " has the same name as another target");
end
if target.name[1] == "_" then
error("target.name must not start with '_' (target #" .. i .. ")");
end
targetsByName[target.name] = target;
end
for targetIdx, target in ipairs(cnf.targets) do
local old = ntb.buildDirectory;
ntb.buildDirectory = path.join(old, target.name);
ntb.target = target;
local cpp = cCreate();
cpp:registerGlobals();
local importer = importerCreate();
importer:registerGlobals();
local ninjaFileBuilder = ninjaFileBuilderCreate();
ninjaFileBuilder:registerGlobals();
ntb.scriptDir = nil;
ntb.scriptPath = nil;
misc();
if type(cnf.beforeTarget) == "function" then
cnf.beforeTarget();
end
for _, imp in ipairs(cnf.projects) do
local fp = imp;
if not fp:match('%.lua$') then
fp = path.join(fp, "main.ntb.lua");
end
importer:import(fp);
end
if target.useForCompileCommands then
cpp:writeCompileDatabaseCommand();
end
if type(cnf.afterTarget) == "function" then
cnf.afterTarget();
end
ninjaFileWrite(ninjaFileBuilder, ntb.buildDirectory);
ntb.buildDirectory = old;
end
|
local mt = {
__index = function ( ob , k )
if ob.parent then
return ob.parent [ k ]
end
end ;
}
local root = setmetatable ( {
parent = nil
} , mt )
function root:say(phrase)
print ( tostring(self) .. " says " .. phrase)
end
function root:derive ( newname )
return setmetatable ( {
parent = self ;
} , mt )
end
root:say ( "I am root" )
local foo = root:derive ( )
foo:say ( "I am foo" )
function foo:say ( phrase )
print ( tostring(self) .. " annouces " .. phrase)
end
foo:say ( "I am foo" )
root:say ( "I am root" )
|
PetshopConfig = {
{
["Type"] = "k9",
["Label"] = "K9",
["Job"] = "police",
["Department"] = 1,
["Pets"] = {
{ name = "Husky", model = 2, price = 100, variants = 2 },
{ name = "Retriever", model = 3, price = 100, variants = 3 },
{ name = "Shepherd", model = 4, price = 100, variants = 2 },
{ name = "Pitbull", model = 5, price = 100, variants = 2 },
},
["NPC"] = {
id = "police_petshop",
name = "Police Petshop",
pedType = 4,
model = "a_c_shepherd_np",
networked = false,
distance = 50.0,
position = {
coords = vector3(469.86, -980.98, 25.28),
heading = 175,
random = false,
},
appearance = nil,
settings = {
{ mode = "invincible", active = true },
{ mode = "ignore", active = true },
{ mode = "freeze", active = true },
},
flags = {
["isNPC"] = true,
["isPetshopSeller"] = true,
},
scenario = "WORLD_DOG_SITTING_SHEPHERD",
},
}
}
|
-- ホーミングミサイル1と2
local band = bit.band
local MAX_M = 100 -- ミサイルの最大数定義
local PI = 3.14159 -- 円周率
-- データ定義
local Hx, Hy = 0, 0 -- 砲台の座標
local Hm = 0 -- 砲台の移動方向
local Hsc = 0 -- 砲台のショット間隔カウンタ
local Px, Py = 0, 0 -- 自機の座標
local Mg = 0 -- ミサイルのグラフィック
local Mx, My = {}, {} -- ミサイルの座標
local Msx, Msy = {}, {} -- ミサイルの速度
local Mv = {} -- ミサイルデータの使用状態(1:使用中 0:未使用)
local Ma = {} -- ミサイルの角度
local Mc = {} -- ミサイルの追尾カウンタ
local Key = 0
local Time = 0
local Mode = 1
-- 画面モードのセット
dx.SetGraphMode(640, 480, 16)
-- DXライブラリ初期化処理
function dx.Init()
-- 描画先を裏画面にセット
dx.SetDrawScreen(dx.DX_SCREEN_BACK)
-- 初期化処理
do
-- ミサイルのグラフィックロード
Mg = dx.LoadGraph("MGraph.png")
-- 自機の座標セット
Px = 320
Py = 200
-- 砲台の座標セット
Hx = 320
Hy = 30
-- 砲台の移動方向セット
Hm = 3
-- 砲台の移動間隔カウンタセット
Hsc = 30
-- ミサイルデータの初期化
for i = 1, MAX_M do
Mv[i] = 0
-- DxLua: 他のデータも初期化する
Mx[i] = 0
My[i] = 0
Ma[i] = 0
Mc[i] = 0
Msx[i] = 0
Msy[i] = 0
end
end
-- ゲームループ
Time = dx.GetNowHiPerformanceCount() + 1000000 / 60
end
-- ループ
function dx.Update()
-- プレイヤーの移動処理
do
-- 入力取得
Key = dx.GetJoypadInputState(dx.DX_INPUT_KEY_PAD1)
if band(Key, dx.PAD_INPUT_RIGHT) ~= 0 then Px = Px + 5 end -- 右を押していたら右に進む
if band(Key, dx.PAD_INPUT_LEFT) ~= 0 then Px = Px - 5 end -- 左を押していたら左に進む
if band(Key, dx.PAD_INPUT_UP) ~= 0 then Py = Py - 5 end -- 上を押していたら上に進む
if band(Key, dx.PAD_INPUT_DOWN) ~= 0 then Py = Py + 5 end -- 下を押していたら下に進む
-- DxLua: 数字キーでモードを変える
if dx.CheckHitKey(dx.KEY_INPUT_1) ~= 0 or dx.CheckHitKey(dx.KEY_INPUT_NUMPAD1) ~= 0 then
Mode = 1
elseif dx.CheckHitKey(dx.KEY_INPUT_2) ~= 0 or dx.CheckHitKey(dx.KEY_INPUT_NUMPAD2) ~= 0 then
Mode = 2
end
-- 画面外に出ていたら補正
if Px > 640 - 16 then Px = 640 - 16 end
if Px < 0 then Px = 0 end
if Py > 480 - 16 then Py = 480 - 16 end
if Py < 0 then Py = 0 end
end
-- ミサイルの移動処理
for i = 1, MAX_M do
-- ミサイルデータが無効だったらスキップ
if Mv[i] == 0 then
-- DxLua: Lua に continue は無い
elseif ((Mx[i] > Px and Mx[i] < Px + 32) or (Px > Mx[i] and Px < Mx[i] + 16)) and
((My[i] > Py and My[i] < Py + 32) or (Py > My[i] and Py < My[i] + 16)) then
-- 照準に当たっていたらミサイルデータを無効にする
Mv[i] = 0
elseif (Mc[i] < 100) then
-- 追尾カウンタが規定値に来ていなければ追尾処理
local ax, ay, bx, by
-- bx,by 自分の進んでいる方向 ax,ay 本来進むべき方向
bx = math.cos(Ma[i])
by = math.sin(Ma[i])
ax = (Px + 16) - Mx[i]
ay = (Py + 16) - My[i]
-- 外積を利用し向きを照準側に向ける
-- DxLua: モード別に角度の単位を変更する
local unit = 8
if Mode == 1 then
unit = 8
elseif Mode == 2 then
unit = 15
end
Ma[i] = Ma[i] + ((ax * by - ay * bx < 0.0) and (math.pi / 180 * unit) or (-math.pi / 180 * unit))
end
-- 追尾カウンタ加算
Mc[i] = Mc[i] + 1
-- 速度変更
Msx[i] = Msx[i] + (math.cos(Ma[i]) * 30.0);
Msy[i] = Msy[i] + (math.sin(Ma[i]) * 30.0);
-- 移動する
-- DxLua: モード別に計算式を変える
if Mode == 1 then
Mx[i] = Mx[i] + (math.cos(Ma[i]) * 6.0)
My[i] = My[i] + (math.sin(Ma[i]) * 6.0)
elseif Mode == 2 then
Mx[i] = (Mx[i] * 100 + Msx[i]) / 100;
My[i] = (My[i] * 100 + Msy[i]) / 100;
end
-- 画面外に出ていたらミサイルデータを無効にする
if (Mx[i] < -100 or Mx[i] > 740 or My[i] < -100 or My[i] > 580) then
Mv[i] = 0
end
end
-- 砲台の移動処理
do
Hx = Hx + Hm
-- 画面端まで来ていたら反転
if (Hx > 640 - 16 or Hx < 0) then Hm = Hm * -1 end
-- ショットカウンタを減らす
Hsc = Hsc - 1
-- カウンタが0になっていたらミサイル発射
if (Hsc == 0) then
local i = MAX_M
-- 使われていないミサイルデータを探す
for j = 1, MAX_M do
if (Mv[j] == 0) then
i = j
break
end
end
-- もし使われていないミサイルデータがあったらショットを出す
if (i ~= MAX_M) then
-- ミサイルの位置を設定
Mx[i] = Hx + 16
My[i] = Hy + 16
-- 速度セット
Msx[i] = 0
Msy[i] = 0
-- 角度をセット
Ma[i] = PI / 2
-- 追尾カウンタをセット
Mc[i] = 0
-- ショットデータを使用中にセット
Mv[i] = 1
end
-- 発射間隔カウンタ値をセット
Hsc = 30
end
end
-- 描画処理
do
-- 画面の初期化
dx.ClearDrawScreen()
-- ミサイルの描画
for i = 1, MAX_M do
if (Mv[i] == 0) then
-- ミサイルデータが有効でない場合は次に移る
else
-- ミサイルの描画
dx.DrawRotaGraph(Mx[i], My[i], 1.0, Ma[i], Mg, true)
end
end
-- プレーヤーの描画
dx.DrawBox(Px, Py, Px + 32, Py + 32, dx.GetColor(255, 255, 255), true)
-- 砲台の描画
dx.DrawBox(Hx - 8, Hy - 8, Hx + 8, Hy + 8, dx.GetColor(255, 255, 0), true)
-- DxLua: 現在のモード
dx.DrawString(0, 0, 'モード: ' .. Mode, dx.GetColor(0xFF, 0xFF, 0))
dx.DrawString(0, 0, '\n1か2を入力してください')
-- 裏画面の内容を表画面に反映
dx.ScreenFlip()
-- 時間待ち
while (dx.GetNowHiPerformanceCount() < Time) do end
Time = Time + 1000000 / 60
end
end
|
--[==[
- Author: ezhex1991@outlook.com
- CreateTime: 2017-06-09 17:21:56
- Orgnization: #ORGNIZATION#
- Description:
--]==]
local moduleName = ...
local M = {}
M.__index = M
----- begin module -----
-- 需要用一个Monobehaviour的StartCoroutine启动
local util = require("xlua.util")
function Coroutine1(...)
local params = {...}
return util.cs_generator(
function()
print("Coroutine Test")
coroutine.yield(CS.UnityEngine.WaitForSeconds(0.5))
print("tencent majesty")
coroutine.yield(CS.UnityEngine.WaitForSeconds(0.5))
print(table.unpack(params))
while true do
coroutine.yield(CS.UnityEngine.WaitForSeconds(0.5))
print("...")
end
end
)
end
function Coroutine2(cor)
return util.cs_generator(
function()
coroutine.yield(CS.UnityEngine.WaitForSeconds(3))
CS.EZhex1991.XLuaExtension.Example.LuaManager.Instance:StopCoroutine(cor)
print("Coroutine Stopped")
end
)
end
-- 启动一个协程并返回
local cor = CS.EZhex1991.XLuaExtension.Example.LuaManager.Instance:StartCoroutine(Coroutine1("xlua", "banzai"))
-- 启动第二个协程,由该协程来结束第一个协程
CS.EZhex1991.XLuaExtension.Example.LuaManager.Instance:StartCoroutine(Coroutine2(cor))
----- end -----
return M
|
return {
name = "Bow",
desc = "Fires arrows at foes",
sprite = 'bow',
usage = 'bow',
use_time = 0.75,
stack_size = 1
}
|
local config = {}
config.author = "Rinart73"
config.name = "i18n"
config.homepage = "http://www.avorion.net/forum/index.php/topic,4330.msg22873.html"
config.version = {
major = 1, minor = 1, patch = 0, -- 0.21.4
}
config.version.string = config.version.major..'.'..config.version.minor..'.'..config.version.patch
-- CLIENT SETTINGS --
-- Log only messages that have level equal or lower than specified
-- 0 - nothing, 1 - errors, 2 - warning, 3 - info, 4 - debug
config.LogLevel = 2
-- If mod doesn't have localization for your language, i18n will try to load other localization files in order that is specified in 'secondaryLanguages' parameter
config.SecondaryLanguages = { "en" }
return config
|
return {'greb','grebbe','green','greenkeeper','greep','gregoriaans','grein','greinen','greineren','greinig','greintje','greling','gremium','grenadier','grenadiersmuts','grenadine','grendel','grendelen','grendelslot','grendelsteen','grenen','grenenhout','grenenhouten','grens','grensakkoord','grensarbeid','grensarbeider','grensarbeidersregeling','grensbedrag','grensbewaker','grensbewaking','grensbewoner','grensconflict','grenscontrole','grenscorrectie','grensdorp','grensganger','grensgebied','grensgemeente','grensgeschil','grensgeval','grenshospitium','grensincident','grenskantoor','grenslaag','grensland','grenslijn','grenslinie','grensoorlog','grensovergang','grensoverschrijdend','grensoverschrijding','grenspaal','grenspassage','grensperikelen','grensplaats','grenspolitie','grenspost','grensprovincie','grenspunt','grensrechter','grensregeling','grensregio','grensrivier','grensscheiding','grensschending','grenssituatie','grensstaat','grensstad','grensstation','grenssteen','grensstreek','grensstrook','grenstroepen','grensverandering','grensverdrag','grensverkeer','grensverkenning','grensverleggend','grensverlegging','grensvervaging','grensvesting','grensvlak','grenswaarde','grenswacht','grenswachter','grenswijziging','grenswisselkantoor','grenszone','grenzeloos','grenzeloosheid','grenzen','grepen','greppel','greppelploeg','gres','gresbuis','gretig','gretigheid','greenwichtijd','grensgevangenis','grebbelinie','grensbeheer','grensbepaling','grensdistrict','grensweg','grenswetenschap','grenshoek','grensdoorlaatpost','grensdijk','grebbeberg','greet','greetje','grembergen','grenada','grenadaan','grenadaans','grenadiaan','grenadiaans','greta','gretha','gretta','greg','gregor','gregorius','gregory','greeve','greidanus','gremmen','greuter','greve','greven','grevink','greijdanus','greeven','gregoire','greijn','greiner','greving','grent','greefhorst','gresnigt','grevelink','grevers','greevink','greebe','grendelman','grefkens','gregoor','grevinga','grebben','greenkeepers','greentje','greentjes','greepje','gregoriaanse','greint','greintjes','gremia','grenadiers','grendelde','grendelden','grendels','grendelsloten','grendelt','grendeltje','grendeltjes','grensarbeiders','grensbewakers','grensbewoners','grensconflicten','grenscorrecties','grensde','grensden','grensdorpen','grenseffecten','grensformaliteiten','grensgebieden','grensgemeenten','grensgemeentes','grensgevallen','grensincidenten','grenskantoortje','grenskantoortjes','grenskantoren','grenslijnen','grenslinies','grensovergangen','grensoverschrijdende','grensoverschrijdingen','grenspalen','grenspatrouilles','grensplaatsen','grensposten','grensproblemen','grenspunten','grensrechters','grensregelingen','grensregios','grensrivieren','grensscheidingen','grenssoldaten','grensstations','grensstenen','grensstroken','grenst','grensveranderingen','grensverkennend','grensverleggende','grensvestingen','grenswaarden','grenswachten','grenswachters','grenzeloze','grenzelozer','grenzend','grenzende','greppelploegen','greppels','greppeltje','greppeltjes','gresbuizen','greskeien','gretige','gretiger','gretigere','gretigst','gretigste','greens','greepjes','greinde','greineerde','greinige','grenscontroles','grensgangers','grensgeschillen','grenslanden','grensprovincies','grensschendingen','grenssituaties','grensstaten','grenssteden','grensstreken','grensverdragen','grensvervagingen','grensvlakken','grenswijzigingen','grenswisselkantoren','grenadaanse','grenadiaanse','grensoorlogen','greetjes','gregs','gregors','gregorius','gregorys','gretas','grethas','grensstadje','grensdorpje','grensplaatsje','grenswetenschappen','grensdistricten','grenszones','grenswaardes','grensriviertje','grenslagen','grensdoorlaatposten','grenspaaltje','grenspaaltjes','grensbepalingen','grensplaatsjes','grensgevalletje','grensstationnetjes','grensgevangenissen'}
|
-- needed to get new_params_list into global scope
require('moonbridge_http')
local testing = {}
local htmlparser = require('htmlparser')
function testing.it(description, fn)
if _G.rooset_tests == nil then
_G.rooset_tests = {}
end
_G.rooset_tests[#_G.rooset_tests+1] = {
description=description,
fn=fn,
}
end
function do_test(fn)
assert(
os.execute(
'dropdb --if-exists rooset_test && createdb -T rooset_template rooset_test'),
"could not create database")
execute.finalizers()
execute.postfork_initializers()
fn()
execute.finalizers()
end
function testing.run_tests()
assert(
config.database.dbname == 'rooset_test',
'database must be called rooset_test')
for _, test in ipairs(_G.rooset_tests) do
io.write(test.description .. ' .. ')
do_test(test.fn)
io.write('OK\n')
end
end
function testing.initialize_request()
execute.finalizers()
execute.postfork_initializers()
request.initialize()
-- mock all the things needed in request
request._http_request = {}
request._http_request.get_params_list, request._http_request.get_params = new_params_list()
request._http_request.post_params_list, request._http_request.post_params = new_params_list()
app.html_title = {}
request._relative_baseurl = '/'
end
function testing.initialize_session(member_id)
app.session = Session:new()
app.session.member_id = member_id
app.session:save()
end
function testing.do_view(args)
local params = args.params
local member_id = args.member_id
local module = args.module
local view = args.view
local id = args.id
testing.initialize_request()
if member_id then
testing.initialize_session(member_id)
end
request._http_request.path = string.sub(
encode.url({ module = module, view = view, id = id }),
2)
if params then
for k, v in pairs(params) do
request._http_request.get_params_list[k] = v
request._http_request.post_params_list[k] = v
end
end
request._route = request.router()
execute.view{
module = request.get_module(),
view = request.get_view(),
}
end
function testing.do_action(args)
local id = args.id
local params = args.params or {}
local member_id = args.member_id
local module = args.module
local action = args.action
testing.initialize_request()
if member_id then
testing.initialize_session(member_id)
end
-- get path, and strip leading /
request._http_request.path = string.sub(
encode.url{ module = module, action = action },
2)
if params then
for k, v in pairs(params) do
if type(v) ~= 'table' then
v = { tostring(v) }
end
request._http_request.get_params_list[k] = v
request._http_request.post_params_list[k] = v
end
end
request._route = request.router()
-- this is a weird thing that happens with action forms. They get the model id for the
-- module in the form under _webmcp_id somehow, and that id gets added to the route in
-- handler.lua.
do
if id then
request._http_request.post_params["_webmcp_id"] = tostring(id)
end
local post_id = request._http_request.post_params["_webmcp_id"]
if post_id then
request._route.id = post_id
end
end
db:query('BEGIN')
action_status = execute.action{
module = request.get_module(),
action = request.get_action(),
}
db:query('COMMIT')
return action_status
end
function testing.do_time_warp(interval)
db:query('BEGIN')
db:query('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ')
db:query{'SELECT time_warp(?)', interval}
db:query('COMMIT')
end
function testing.do_lf_update()
assert(
os.execute(
'/opt/rooset/lfcore/lf_update dbname=${PGDATABASE}'),
"could not run lf_update")
end
function testing.eq(a, b, message)
message = message or ''
assert(b ~= nil, 'the comparitor is nil, use testing.assert_is_nil')
assert(a ~= nil, message .. ' : is nil')
assert(a == b, message .. ' : ' .. a .. ' ~= ' .. b)
end
function testing.assert_is_nil(a, message)
message = message or 'is not nil'
assert(a == nil, message .. ' : ' .. a .. ' ~= nil')
end
testing.HTML = {}
function testing.HTML.new(self)
local o = {}
setmetatable(o, self)
self.__index = self
self._root = htmlparser.parse(slot.render_layout())
return o
end
function testing.HTML.assert_rtv(self, key, expected_value, message)
-- rtv (rooset test value) should be an attribute on
-- an html element with a corresponding rtk (rooset test key).
-- Asserts that there is exactly 1 rtk=key on the dom and that
-- rtv=expected_value
local elements = self._root:select('[rtk="' .. key .. '"]')
message = message or 'assert_rtv'
assert(#elements ~= 0, message .. ': no elements with key ' .. key)
assert(#elements == 1, message .. ': more than one element with key ' .. key)
local el = elements[1]
assert(tostring(el.attributes.rtv) == tostring(expected_value),
message .. ': ' .. tostring(el.attributes.rtv) .. ' ~= ' .. tostring(expected_value))
end
function testing.HTML.assert_rtk_content(self, key, expected_content, message)
local elements = self._root:select('[rtk="' .. key .. '"]')
message = message or 'assert_rtk_content'
assert(#elements ~= 0, message .. ': no elements with key ' .. key)
assert(#elements == 1, message .. ': more than one element with key ' .. key)
local el = elements[1]
local content = el:getcontent()
assert(content == tostring(expected_content),
message .. ': ' .. content .. ' ~= ' .. expected_content)
end
return testing
|
--[[customData = {
type = "custom",
reference = "MyAddonCustomControl", --(optional) unique name for your control to use as reference
refreshFunc = function(customControl) end, --(optional) function to call when panel/controls refresh
width = "full", --or "half" (optional)
} ]]
local widgetVersion = 5
local LAM = LibStub("LibAddonMenu-2.0")
if not LAM:RegisterWidget("custom", widgetVersion) then return end
local wm = WINDOW_MANAGER
local tinsert = table.insert
local function UpdateValue(control)
if control.data.refreshFunc then
control.data.refreshFunc(control)
end
end
function LAMCreateControl.custom(parent, customData, controlName)
local control = wm:CreateControl(controlName or customData.reference, parent.scroll or parent, CT_CONTROL)
control:SetResizeToFitDescendents(true)
local isHalfWidth = customData.width == "half"
if isHalfWidth then --note these restrictions
control:SetDimensionConstraints(250, 55, 250, 100)
control:SetDimensions(250, 55)
else
control:SetDimensionConstraints(510, 30, 510, 100)
control:SetDimensions(510, 30)
end
control.panel = parent.panel or parent --if this is in a submenu, panel is its parent
control.data = customData
control.UpdateValue = UpdateValue
if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then --if our parent window wants to refresh controls, then add this to the list
tinsert(control.panel.controlsToRefresh, control)
end
return control
end
|
local class = require("snabbp4.syntax.utils.middleclass")
local utils = require("snabbp4.syntax.utils.debug")
-- Base symbol shared by all symbols
local BaseSymbol = class("BaseSymbol")
function BaseSymbol:initialize(token,parser)
self.lbp = 0
self.token = token
self.parser = parser
end
function BaseSymbol:nud()
error("Method 'nud' undefined for class " .. self.class.name)
end
function BaseSymbol:led(left)
error("Missing 'led' operator for class " .. self.class.name)
end
-- match function for symbols, throw error if no match
-- consume symbol that is matched
function BaseSymbol:match(sym)
local sym = sym or nil
if sym and (sym ~= self.parser.current_symbol.class.name) then
error('Expected ' .. sym .. ' received ' .. self.parser.current_symbol.class.name)
end
self.parser:advance()
end
-- check that symbol matches, but don't throw error, just return true/false
function BaseSymbol:check(sym)
local sym = sym or nil
if sym and (sym ~= self.parser.current_symbol.class.name) then
return false
end
return true
end
-- get current symbol, consume it, and return it
function BaseSymbol:ret()
local ret = self.parser.current_symbol
self.parser:advance()
return ret
end
-- match function for token, throw error if no match
-- consume token that is matched
function BaseSymbol:match_token(tok)
local tok = tok or nil
if tok and (tok ~= self.parser.current_symbol.token.value) then
error('Expected ' .. tok .. ' received ' .. self.parser.current_symbol.token.value)
end
self.parser:advance()
end
-- check that token matches, but don't throw error, just return true/false
function BaseSymbol:check_token(tok)
local tok = tok or nil
if tok and (tok ~= self.parser.current_symbol.token.value) then
return false
end
return true
end
-- get current symbol, consume it, and return it
function BaseSymbol:ret_token()
local ret = self.parser.current_symbol.token.value
self.parser:advance()
return ret
end
return {
BaseSymbol = BaseSymbol
}
|
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Muulfz.
--- DateTime: 12/7/2020 10:59 PM
---
local htmlEntities = module("lib/htmlEntities")
RegisterCommand(vRP.lang.commands.admin.kick.cmd, function(source, args, rawCommand)
local user_id = vRP.getUserId(source)
local target_id = parseInt(args[1])
vRP.admin_kick(user_id, target_id, vRP.lang.commands.admin.kick.reason_default)
end)
RegisterCommand(vRP.lang.commands.admin.coords.cmd, function(source, args, rawCommand)
local user_id = vRP.getUserId(source)
local x, y, z = vRP.admin_coords(user_id)
local lang = vRP.lang.commands.admin.coords.description
vRP.prompt(source,tostring(lang),x..","..y..","..z)
end)
RegisterCommand(vRP.lang.commands.admin.revive.cmd, function(source, args, rawCommand)
local user_id = vRP.getUserId(source)
local target_id = parseInt(args[1])
vRP.admin_revive(user_id, target_id)
end)
RegisterCommand(vRP.lang.commands.admin.noclip.cmd, function(source, args, rawCommand)
local user_id = vRP.getUserId(source)
local target_id = parseInt(args[1])
vRP.admin_no_clip(user_id, target_id)
end)
RegisterCommand(vRP.lang.commands.admin.set_money.cmd, function(source, args, rawCommand)
local user_id = vRP.getUserId(source)
local id = tonumber(args[1])
local moneyType = args[2]
local value = tonumber(args[3])
if type(value) == "number" and type(id) == "number" then
if moneyType == tostring(vRP.lang.money.types.bank) or moneyType == tostring(vRP.lang.money.types.wallet) then
vRP.admin_set_money(user_id, id, moneyType, value)
end
--invalid type
end
end)
RegisterCommand(vRP.lang.commands.admin.remove_group.cmd, function(source, args, rawCommand)
local user_id = vRP.getUserId(source)
local id = tonumber(args[1])
local group = tostring(args[2])
vRP.admin_remove_group(user_id, id, group)
end)
--TODO: Refactor this below
RegisterCommand(vRP.lang.commands.admin.add_group.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id ~= nil and vRP.hasPermission(user_id, permissions.admin.group_add) then
local id = vRP.prompt(player, "User id: ", "")
id = parseInt(id)
local group = vRP.prompt(player, "Group to add: ", "")
if group then
vRP.addUserGroup(id, group)
vRPclient._notify(player, group .. " added to user " .. id)
end
end
end)
RegisterCommand("admin_remove_group_legacy", function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id and vRP.hasPermission(user_id, permissions.admin.remove_group) then
local id = vRP.prompt(player, "User id: ", "")
id = parseInt(id)
local group = vRP.prompt(player, "Group to remove: ", "")
if group then
vRP.removeUserGroup(id, group)
vRPclient._notify(player, group .. " removed from user " .. id)
end
end
end)
RegisterCommand(vRP.lang.commands.admin.ban.cmd, function(source,args,rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id and vRP.hasPermission(user_id, permissions.admin.ban) then
local id = vRP.prompt(player, "User id to ban: ", "")
id = parseInt(id)
local reason = vRP.prompt(player, "Reason: ", "")
local source = vRP.getUserSource(id)
if source then
vRP.ban(source, reason)
vRPclient._notify(player, "banned user " .. id)
end
end
end)
RegisterCommand(vRP.lang.commands.admin.unban.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id and vRP.hasPermission(user_id, permissions.admin.unban) then
local id = vRP.prompt(player, "User id to unban: ", "")
id = parseInt(id)
vRP.setBanned(id, false)
vRPclient._notify(player, "un-banned user " .. id)
end
end)
RegisterCommand(vRP.lang.commands.admin.custom_emote.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id and vRP.hasPermission(user_id, permissions.admin.custom_emote) then
local content = vRP.prompt(player, "Animation sequence ('dict anim optional_loops' per line): ", "")
local seq = {}
for line in string.gmatch(content, "[^\n]+") do
local args = {}
for arg in string.gmatch(line, "[^%s]+") do
table.insert(args, arg)
end
table.insert(seq, { args[1] or "", args[2] or "", args[3] or 1 })
end
vRPclient._playAnim(player, true, seq, false)
end
end)
RegisterCommand(vRP.lang.commands.admin.custom_sound.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id and vRP.hasPermission(user_id, permissions.admin.custom_sound) then
local content = vRP.prompt(player, "Sound 'dict name': ", "")
local args = {}
for arg in string.gmatch(content, "[^%s]+") do
table.insert(args, arg)
end
vRPclient._playSound(player, args[1] or "", args[2] or "")
end
end)
RegisterCommand(vRP.lang.commands.admin.teleport_to.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.prompt(player, "User id:", "")
local tplayer = vRP.getUserSource(tonumber(user_id))
if tplayer then
vRPclient._teleport(player, vRPclient.getPosition(tplayer))
end
end)
RegisterCommand(vRP.lang.commands.admin.teleport_to_me.cmd, function(source, args, rawCommand)
local player = source
local x, y, z = vRPclient.getPosition(player)
local user_id = vRP.prompt(player, "User id:", "")
local tplayer = vRP.getUserSource(tonumber(user_id))
if tplayer then
vRPclient._teleport(tplayer, x, y, z)
end
end)
RegisterCommand(vRP.lang.commands.admin.teleport_to_coords.cmd, function(source, args, rawCommand)
local player = source
local fcoords = vRP.prompt(player, "Coords x,y,z:", "")
local coords = {}
for coord in string.gmatch(fcoords or "0,0,0", "[^,]+") do
table.insert(coords, tonumber(coord))
end
vRPclient._teleport(player, coords[1] or 0, coords[2] or 0, coords[3] or 0)
end)
RegisterCommand(vRP.lang.commands.admin.give_money.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id then
local amount = vRP.prompt(player, "Amount:", "")
amount = parseInt(amount)
vRP.giveMoney(user_id, amount)
end
end)
RegisterCommand(vRP.lang.commands.admin.give_item.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id then
local idname = vRP.prompt(player, "Id name:", "")
idname = idname or ""
local amount = vRP.prompt(player, "Amount:", "")
amount = parseInt(amount)
vRP.giveInventoryItem(user_id, idname, amount, true)
end
end)
RegisterCommand(vRP.lang.commands.admin.call_admin.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id then
local desc = vRP.prompt(player, "Describe your problem:", "") or ""
local answered = false
local players = {}
for k, v in pairs(vRP.rusers) do
local player = vRP.getUserSource(tonumber(k))
-- check user
if vRP.hasPermission(k, "admin.tickets") and player then
table.insert(players, player)
end
end
-- send notify and alert to all listening players
for k, v in pairs(players) do
async(function()
local ok = vRP.request(v,
"Admin ticket (user_id = " .. user_id .. ") take/TP to ?: " .. htmlEntities.encode(desc),
60)
if ok then
-- take the call
if not answered then
-- answer the call
vRPclient._notify(player, "An admin took your ticket.")
vRPclient._teleport(v, vRPclient.getPosition(player))
answered = true
else
vRPclient._notify(v, "Ticket already taken.")
end
end
end)
end
end
end)
RegisterCommand(vRP.lang.commands.admin.give_item.cmd, function(source, args, rawCommand)
local player = source
local user_id = vRP.getUserId(player)
if user_id then
local idname = vRP.prompt(player, "Id name:", "")
idname = idname or ""
local amount = vRP.prompt(player, "Amount:", "")
amount = parseInt(amount)
vRP.giveInventoryItem(user_id, idname, amount, true)
end
end)
local player_customs = {}
RegisterCommand(vRP.lang.commands.admin.display_custom.cmd, function (source, args, rawCommand)
local player = source
local custom = vRPclient.getCustomization(player)
if player_customs[player] then
-- hide
player_customs[player] = nil
vRPclient._removeDiv(player, "customization")
else
-- show
local content = ""
for k, v in pairs(custom) do
content = content .. k .. " => " .. json.encode(v) .. "<br />"
end
player_customs[player] = true
vRPclient._setDiv(player, "customization",
".div_customization{ margin: auto; padding: 8px; width: 500px; margin-top: 80px; background: black; color: white; font-weight: bold; ",
content)
end
end)
RegisterCommand(vRP.lang.commands.admin.audio_source.cmd, function(source, args, rawCommand)
local player = source
local infos = splitString(vRP.prompt(player, "Audio source: name=url, omit url to delete the named source.", ""),
"=")
local name = infos[1]
local url = infos[2]
if name and string.len(name) > 0 then
if url and string.len(url) > 0 then
local x, y, z = vRPclient.getPosition(player)
vRPclient._setAudioSource(-1, "vRP:admin:" .. name, url, 0.5, x, y, z, 125)
else
vRPclient._removeAudioSource(-1, "vRP:admin:" .. name)
end
end
end)
|
local Core = require(script.Parent.Parent.Core)
local defineComponent = require(script.Parent.Parent.defineComponent)
return function()
it("should iterate over entities", function()
local ComponentClass = defineComponent({
name = "TestComponent",
generator = function()
return {}
end
})
local core = Core.new()
core:registerComponent(ComponentClass)
local entity = core:createEntity()
local _, addedComponent = core:addComponent(entity, ComponentClass)
for iteratedEntity, iteratedComponent in core:components(ComponentClass) do
-- There is only one entity that fits the constraints, so these expectations are valid.
expect(iteratedEntity).to.equal(entity)
expect(iteratedComponent).to.equal(addedComponent)
end
end)
it("should return components in the order specified", function()
local ComponentA = defineComponent({
name = "A",
generator = function()
return {}
end,
})
local ComponentB = defineComponent({
name = "B",
generator = function()
return {}
end,
})
local core = Core.new()
core:registerComponent(ComponentA)
core:registerComponent(ComponentB)
local entity = core:createEntity()
local _, addedA = core:addComponent(entity, ComponentA)
local _, addedB = core:addComponent(entity, ComponentB)
for iteratedEntity, iteratedA, iteratedB in core:components(ComponentA, ComponentB) do
-- There is only one entity that fits the constraints, so these expectations are valid.
expect(iteratedEntity).to.equal(entity)
expect(iteratedA).to.equal(addedA)
expect(iteratedB).to.equal(addedB)
end
for iteratedEntity, iteratedB, iteratedA in core:components(ComponentB, ComponentA) do
expect(iteratedEntity).to.equal(entity)
expect(iteratedA).to.equal(addedA)
expect(iteratedB).to.equal(addedB)
end
end)
it("should exclude entities that do not have all the components", function()
local ComponentA = defineComponent({
name = "A",
generator = function()
return {}
end,
})
local ComponentB = defineComponent({
name = "B",
generator = function()
return {}
end,
})
local core = Core.new()
core:registerComponent(ComponentA)
core:registerComponent(ComponentB)
local entityA = core:createEntity()
local _, addedA = core:addComponent(entityA, ComponentA)
local _, addedB = core:addComponent(entityA, ComponentB)
local entityB = core:createEntity()
core:addComponent(entityB, ComponentA)
local entityC = core:createEntity()
core:addComponent(entityC, ComponentB)
for iteratedEntity, iteratedA, iteratedB in core:components(ComponentA, ComponentB) do
expect(iteratedEntity).to.equal(entityA)
expect(iteratedA).to.equal(addedA)
expect(iteratedB).to.equal(addedB)
end
end)
it("should include entities that have components that are not specified", function()
local ComponentA = defineComponent({
name = "A",
generator = function()
return {}
end,
})
local ComponentB = defineComponent({
name = "B",
generator = function()
return {}
end,
})
local core = Core.new()
core:registerComponent(ComponentA)
core:registerComponent(ComponentB)
local entityA = core:createEntity()
local _, addedA = core:addComponent(entityA, ComponentA)
core:addComponent(entityA, ComponentB)
for iteratedEntity, iteratedA in core:components(ComponentA) do
expect(iteratedEntity).to.equal(entityA)
expect(iteratedA).to.equal(addedA)
end
end)
end
|
--[[
Nazwy pojazdów z modelami
]]--
vehicleNames = {}
vehicleNames[0] = {400, "Landstalker"}
vehicleNames[1] = {401, "Bravura"}
vehicleNames[2] = {402, "Buffalo"}
vehicleNames[3] = {403, "Linerunner"}
vehicleNames[4] = {404, "Perenniel"}
vehicleNames[5] = {405, "Sentinel"}
vehicleNames[6] = {406, "Dumper"}
vehicleNames[7] = {407, "Firetruck"}
vehicleNames[8] = {408, "Trashmaster"}
vehicleNames[9] = {409, "Stretch"}
vehicleNames[10] = {410, "Manana"}
vehicleNames[11] = {411, "Infernus"}
vehicleNames[12] = {412, "Voodoo"}
vehicleNames[13] = {413, "Pony"}
vehicleNames[14] = {414, "Mule"}
vehicleNames[15] = {415, "Cheetah"}
vehicleNames[16] = {416, "Ambulance"}
vehicleNames[17] = {417, "Leviathan"}
vehicleNames[18] = {418, "Moonbeam"}
vehicleNames[19] = {419, "Esperanto"}
vehicleNames[20] = {420, "Taxi"}
vehicleNames[21] = {421, "Washington"}
vehicleNames[22] = {422, "Bobcat"}
vehicleNames[23] = {423, "Mr Whoopee"}
vehicleNames[24] = {424, "BF Injection"}
vehicleNames[25] = {425, "Hunter"}
vehicleNames[26] = {426, "Premier"}
vehicleNames[27] = {427, "Enforcer"}
vehicleNames[28] = {428, "Securicar"}
vehicleNames[29] = {429, "Banshee"}
vehicleNames[30] = {430, "Predator"}
vehicleNames[31] = {431, "Bus"}
vehicleNames[32] = {432, "Rhino"}
vehicleNames[33] = {433, "Barracks"}
vehicleNames[34] = {434, "Hotknife"}
vehicleNames[35] = {435, "Article Trailer"}
vehicleNames[36] = {436, "Previon"}
vehicleNames[37] = {437, "Coach"}
vehicleNames[38] = {438, "Cabbie"}
vehicleNames[39] = {439, "Stallion"}
vehicleNames[40] = {440, "Rumpo"}
vehicleNames[41] = {441, "RC Bandit"}
vehicleNames[42] = {442, "Romero"}
vehicleNames[43] = {443, "Packer"}
vehicleNames[44] = {444, "Monster"}
vehicleNames[45] = {445, "Admiral"}
vehicleNames[46] = {446, "Squallo"}
vehicleNames[47] = {447, "Seasparrow"}
vehicleNames[48] = {448, "Pizzaboy"}
vehicleNames[49] = {449, "Tram"}
vehicleNames[50] = {450, "Article Trailer 2"}
vehicleNames[51] = {451, "Turismo"}
vehicleNames[52] = {452, "Speeder"}
vehicleNames[53] = {453, "Reefer"}
vehicleNames[54] = {454, "Tropic"}
vehicleNames[55] = {455, "Flatbed"}
vehicleNames[56] = {456, "Yankee"}
vehicleNames[57] = {457, "Caddy"}
vehicleNames[58] = {458, "Solair"}
vehicleNames[59] = {459, "Topfun Van (Berkley's RC)"}
vehicleNames[60] = {460, "Skimmer"}
vehicleNames[61] = {461, "PCJ-600"}
vehicleNames[62] = {462, "Faggio"}
vehicleNames[63] = {463, "Freeway"}
vehicleNames[64] = {464, "RC Baron"}
vehicleNames[65] = {465, "RC Raider"}
vehicleNames[66] = {466, "Glendale"}
vehicleNames[67] = {467, "Oceanic"}
vehicleNames[68] = {468, "Sanchez"}
vehicleNames[69] = {469, "Sparrow"}
vehicleNames[70] = {470, "Patriot"}
vehicleNames[71] = {471, "Quad"}
vehicleNames[72] = {472, "Coastguard"}
vehicleNames[73] = {473, "Dinghy"}
vehicleNames[74] = {474, "Hermes"}
vehicleNames[75] = {475, "Sabre"}
vehicleNames[76] = {476, "Rustler"}
vehicleNames[77] = {477, "ZR-350"}
vehicleNames[78] = {478, "Walton"}
vehicleNames[79] = {479, "Regina"}
vehicleNames[80] = {480, "Comet"}
vehicleNames[81] = {481, "BMX"}
vehicleNames[82] = {482, "Burrito"}
vehicleNames[83] = {483, "Camper"}
vehicleNames[84] = {484, "Marquis"}
vehicleNames[85] = {485, "Baggage"}
vehicleNames[86] = {486, "Dozer"}
vehicleNames[87] = {487, "Maverick"}
vehicleNames[88] = {488, "SAN News Maverick"}
vehicleNames[89] = {489, "Rancher"}
vehicleNames[90] = {490, "FBI Rancher"}
vehicleNames[91] = {491, "Virgo"}
vehicleNames[92] = {492, "Greenwood"}
vehicleNames[93] = {493, "Jetmax"}
vehicleNames[94] = {494, "Hotring Racer"}
vehicleNames[95] = {495, "Sandking"}
vehicleNames[96] = {496, "Blista Compact"}
vehicleNames[97] = {497, "Police Maverick"}
vehicleNames[98] = {498, "Boxville"}
vehicleNames[99] = {499, "Benson"}
vehicleNames[100] = {500, "Mesa"}
vehicleNames[101] = {501, "RC Goblin"}
vehicleNames[102] = {502, "Hotring Racer"}
vehicleNames[103] = {503, "Hotring Racer"}
vehicleNames[104] = {504, "Bloodring Banger"}
vehicleNames[105] = {505, "Rancher"}
vehicleNames[106] = {506, "SuperGT"}
vehicleNames[107] = {507, "Elegant"}
vehicleNames[108] = {508, "Journey"}
vehicleNames[109] = {509, "Bike"}
vehicleNames[110] = {510, "Mountain Bike"}
vehicleNames[111] = {511, "Beagle"}
vehicleNames[112] = {512, "Cropduster"}
vehicleNames[113] = {513, "Stunt Plane"}
vehicleNames[114] = {514, "Tanker"}
vehicleNames[115] = {515, "Road Train"}
vehicleNames[116] = {516, "Nebula"}
vehicleNames[117] = {517, "Majestic"}
vehicleNames[118] = {518, "Butcaner"}
vehicleNames[119] = {519, "Shaman"}
vehicleNames[120] = {520, "Hydra"}
vehicleNames[121] = {521, "FCR-900"}
vehicleNames[122] = {522, "NRG-500"}
vehicleNames[123] = {523, "HPV1000"}
vehicleNames[124] = {524, "Cement Truck"}
vehicleNames[125] = {525, "Pow Truck"}
vehicleNames[126] = {526, "Fortune"}
vehicleNames[127] = {527, "Cadrona"}
vehicleNames[128] = {528, "FBI Truck"}
vehicleNames[129] = {529, "Willard"}
vehicleNames[130] = {530, "Forklift"}
vehicleNames[131] = {531, "Tractor"}
vehicleNames[132] = {532, "Combine Harvester"}
vehicleNames[133] = {533, "Feltzer"}
vehicleNames[134] = {534, "Remington"}
vehicleNames[135] = {535, "Slamvan"}
vehicleNames[136] = {536, "Blade"}
vehicleNames[137] = {537, "Freight"}
vehicleNames[138] = {538, "Brownstreak"}
vehicleNames[139] = {539, "Vortex"}
vehicleNames[140] = {540, "Vincent"}
vehicleNames[141] = {541, "Bullet"}
vehicleNames[142] = {542, "Clover"}
vehicleNames[143] = {543, "Sadler"}
vehicleNames[144] = {544, "Firetruck LA"}
vehicleNames[145] = {545, "Hustler"}
vehicleNames[146] = {546, "Intruder"}
vehicleNames[147] = {547, "Primo"}
vehicleNames[148] = {548, "Cargobob"}
vehicleNames[149] = {549, "Tampa"}
vehicleNames[150] = {550, "Sunrise"}
vehicleNames[151] = {551, "Merit"}
vehicleNames[152] = {552, "Utility Van"}
vehicleNames[153] = {553, "Nevada"}
vehicleNames[154] = {554, "Yosemite"}
vehicleNames[155] = {555, "Windsor"}
vehicleNames[156] = {556, "Monster(A)"}
vehicleNames[157] = {557, "Monster(B)"}
vehicleNames[158] = {558, "Uranus"}
vehicleNames[159] = {559, "Jester"}
vehicleNames[160] = {560, "Sultan"}
vehicleNames[161] = {561, "Stratum"}
vehicleNames[162] = {562, "Elegy"}
vehicleNames[163] = {563, "Raindance"}
vehicleNames[164] = {564, "RC Tiger"}
vehicleNames[165] = {565, "Flash"}
vehicleNames[166] = {566, "Tahoma"}
vehicleNames[167] = {567, "Savanna"}
vehicleNames[168] = {568, "Bandito"}
vehicleNames[169] = {569, "Freight Flat Trailer"}
vehicleNames[170] = {570, "Streak Trailer"}
vehicleNames[171] = {571, "Kart"}
vehicleNames[172] = {572, "Mower"}
vehicleNames[173] = {573, "Dune"}
vehicleNames[174] = {574, "Sweeper"}
vehicleNames[175] = {575, "Broadway"}
vehicleNames[176] = {576, "Tornado"}
vehicleNames[177] = {577, "AT400"}
vehicleNames[178] = {578, "DFT-30"}
vehicleNames[179] = {579, "Huntley"}
vehicleNames[180] = {580, "Stafford"}
vehicleNames[181] = {581, "BF-400"}
vehicleNames[182] = {582, "Newsvan"}
vehicleNames[183] = {583, "Tug"}
vehicleNames[184] = {584, "Petrol Trailer"}
vehicleNames[185] = {585, "Emperor"}
vehicleNames[186] = {586, "Waifarer"}
vehicleNames[187] = {587, "Euros"}
vehicleNames[188] = {588, "Hotdog"}
vehicleNames[189] = {589, "Club"}
vehicleNames[190] = {590, "Freight Box Trailer"}
vehicleNames[191] = {591, "Article Trailer 3"}
vehicleNames[192] = {592, "Andromada"}
vehicleNames[193] = {593, "Dodo"}
vehicleNames[194] = {594, "RC Cam"}
vehicleNames[195] = {595, "Launch"}
vehicleNames[196] = {596, "Police Car (LSPD)"}
vehicleNames[197] = {597, "Police Car (SFPD)"}
vehicleNames[198] = {598, "Police Car (LVPD)"}
vehicleNames[199] = {599, "Police Ranger"}
vehicleNames[200] = {600, "Picador"}
vehicleNames[201] = {601, "S.W.A.T."}
vehicleNames[202] = {602, "Alpha"}
vehicleNames[203] = {603, "Phoenix"}
vehicleNames[204] = {604, "Glendale Shit"}
vehicleNames[205] = {605, "Sadler Shit"}
vehicleNames[206] = {606, "Baggage Trailer(A)"}
vehicleNames[207] = {607, "Baggage Trailer(B)"}
vehicleNames[208] = {608, "Tug Styles Trailer"}
vehicleNames[209] = {609, "Boxville"}
vehicleNames[210] = {610, "Farm Trailer"}
vehicleNames[211] = {611, "Utility Trailer"}
-- Stacje benzynowe {Nazwa, x, y, z, cena/litr}
gasStation = {}
gasStation[0] = {"Stacja Idlewood", 1941, -1776, 13, 3}
gasStation[1] = {"Stacja Idlewood", 1941, -1769, 13, 3}
function getGasStations()
return gasStation
end
function GetVehicleMaxFuel(model)
if(model == 400) then return 70;
elseif(model == 401) then return 52;
elseif(model == 402) then return 60;
elseif(model == 403) then return 400;
elseif(model == 404) then return 50;
elseif(model == 405) then return 52;
elseif(model == 406) then return 150;
elseif(model == 407) then return 250;
elseif(model == 408) then return 150;
elseif(model == 409) then return 110;
elseif(model == 410) then return 66;
elseif(model == 411) then return 66;
elseif(model == 412) then return 52;
elseif(model == 413) then return 80;
elseif(model == 414) then return 120;
elseif(model == 415) then return 76;
elseif(model == 416) then return 120;
elseif(model == 417) then return 408;
elseif(model == 418) then return 80;
elseif(model == 419) then return 72;
elseif(model == 420) then return 80;
elseif(model == 421) then return 82;
elseif(model == 422) then return 80;
elseif(model == 423) then return 90;
elseif(model == 424) then return 30;
elseif(model == 425) then return 500;
elseif(model == 426) then return 70;
elseif(model == 427) then return 120;
elseif(model == 428) then return 120;
elseif(model == 429) then return 68;
elseif(model == 430) then return 220;
elseif(model == 431) then return 315;
elseif(model == 432) then return 1020;
elseif(model == 433) then return 430;
elseif(model == 434) then return 30;
elseif(model == 435) then return 0;
elseif(model == 436) then return 60;
elseif(model == 437) then return 310;
elseif(model == 438) then return 80;
elseif(model == 439) then return 72;
elseif(model == 440) then return 80;
elseif(model == 441) then return 5;
elseif(model == 442) then return 61;
elseif(model == 443) then return 180;
elseif(model == 444) then return 162;
elseif(model == 445) then return 56;
elseif(model == 446) then return 101;
elseif(model == 447) then return 140;
elseif(model == 448) then return 7;
elseif(model == 449) then return 0;
elseif(model == 450) then return 0 ;
elseif(model == 451) then return 78;
elseif(model == 452) then return 111;
elseif(model == 453) then return 201;
elseif(model == 454) then return 221;
elseif(model == 455) then return 198;
elseif(model == 456) then return 101;
elseif(model == 457) then return 15;
elseif(model == 458) then return 70;
elseif(model == 459) then return 84;
elseif(model == 460) then return 30;
elseif(model == 461) then return 25;
elseif(model == 462) then return 7;
elseif(model == 463) then return 30;
elseif(model == 464) then return 5;
elseif(model == 465) then return 5;
elseif(model == 466) then return 71;
elseif(model == 467) then return 61;
elseif(model == 468) then return 27;
elseif(model == 469) then return 50;
elseif(model == 470) then return 110;
elseif(model == 471) then return 35;
elseif(model == 472) then return 110;
elseif(model == 473) then return 69;
elseif(model == 474) then return 70;
elseif(model == 475) then return 71 ;
elseif(model == 476) then return 68;
elseif(model == 477) then return 69;
elseif(model == 478) then return 45;
elseif(model == 479) then return 61;
elseif(model == 480) then return 67;
elseif(model == 481) then return 0;
elseif(model == 482) then return 96;
elseif(model == 483) then return 75;
elseif(model == 484) then return 87;
elseif(model == 485) then return 40;
elseif(model == 486) then return 141;
elseif(model == 487) then return 123;
elseif(model == 488) then return 121;
elseif(model == 489) then return 91;
elseif(model == 490) then return 101;
elseif(model == 491) then return 81;
elseif(model == 492) then return 62;
elseif(model == 493) then return 130;
elseif(model == 494) then return 99;
elseif(model == 495) then return 81;
elseif(model == 496) then return 61;
elseif(model == 497) then return 140;
elseif(model == 498) then return 121;
elseif(model == 499) then return 104;
elseif(model == 500) then return 71;
elseif(model == 501) then return 5;
elseif(model == 502) then return 96;
elseif(model == 503) then return 97;
elseif(model == 504) then return 91;
elseif(model == 505) then return 84;
elseif(model == 506) then return 67;
elseif(model == 507) then return 81;
elseif(model == 508) then return 133;
elseif(model == 509) then return 0;
elseif(model == 510) then return 0;
elseif(model == 511) then return 210;
elseif(model == 512) then return 130;
elseif(model == 513) then return 54;
elseif(model == 514) then return 300;
elseif(model == 515) then return 300;
elseif(model == 516) then return 63;
elseif(model == 517) then return 64;
elseif(model == 518) then return 67;
elseif(model == 519) then return 300;
elseif(model == 520) then return 290;
elseif(model == 521) then return 35;
elseif(model == 522) then return 35;
elseif(model == 523) then return 121;
elseif(model == 524) then return 91;
elseif(model == 525) then return 65;
elseif(model == 526) then return 63;
elseif(model == 527) then return 71;
elseif(model == 528) then return 71;
elseif(model == 529) then return 67;
elseif(model == 530) then return 12;
elseif(model == 531) then return 21;
elseif(model == 532) then return 36;
elseif(model == 533) then return 61;
elseif(model == 534) then return 71;
elseif(model == 535) then return 85;
elseif(model == 536) then return 69;
elseif(model == 537) then return 0;
elseif(model == 538) then return 0;
elseif(model == 539) then return 33;
elseif(model == 540) then return 60;
elseif(model == 541) then return 71;
elseif(model == 542) then return 69;
elseif(model == 543) then return 60;
elseif(model == 544) then return 120;
elseif(model == 545) then return 74;
elseif(model == 546) then return 64;
elseif(model == 547) then return 67;
elseif(model == 548) then return 210;
elseif(model == 549) then return 71;
elseif(model == 550) then return 64;
elseif(model == 551) then return 64;
elseif(model == 552) then return 68;
elseif(model == 553) then return 330;
elseif(model == 554) then return 81;
elseif(model == 555) then return 61;
elseif(model == 556) then return 123;
elseif(model == 557) then return 124;
elseif(model == 558) then return 61;
elseif(model == 559) then return 63;
elseif(model == 560) then return 71;
elseif(model == 561) then return 74;
elseif(model == 562) then return 66;
elseif(model == 563) then return 210;
elseif(model == 564) then return 0;
elseif(model == 565) then return 57;
elseif(model == 566) then return 65;
elseif(model == 567) then return 66;
elseif(model == 568) then return 45;
elseif(model == 569) then return 0;
elseif(model == 570) then return 0;
elseif(model == 571) then return 10;
elseif(model == 572) then return 10;
elseif(model == 573) then return 121;
elseif(model == 574) then return 21;
elseif(model == 575) then return 71;
elseif(model == 576) then return 75;
elseif(model == 577) then return 900;
elseif(model == 578) then return 210;
elseif(model == 579) then return 85;
elseif(model == 580) then return 80;
elseif(model == 581) then return 31;
elseif(model == 582) then return 81;
elseif(model == 583) then return 20;
elseif(model == 584) then return 0;
elseif(model == 585) then return 64;
elseif(model == 586) then return 30;
elseif(model == 587) then return 66;
elseif(model == 588) then return 79;
elseif(model == 589) then return 59;
elseif(model == 590) then return 0;
elseif(model == 591) then return 0;
elseif(model == 592) then return 0;
elseif(model == 593) then return 110;
elseif(model == 594) then return 0;
elseif(model == 595) then return 151;
elseif(model == 596) then return 89;
elseif(model == 597) then return 89;
elseif(model == 598) then return 89;
elseif(model == 599) then return 94;
elseif(model == 600) then return 61;
elseif(model == 601) then return 120;
elseif(model == 602) then return 61;
elseif(model == 603) then return 59;
elseif(model == 604) then return 91;
elseif(model == 605) then return 64;
elseif(model == 606) then return 0;
elseif(model == 607) then return 0;
elseif(model == 608) then return 0;
elseif(model == 609) then return 99;
elseif(model == 610) then return 0;
elseif(model == 611) then return 0;
else return 0 end;
end
|
--[[
debugger hook for clidebugger
]]
module('gii',package.seeall)
local function connectDebugger()
local commands={}
local function readCommand(cmd,arg)
table.insert(commands,{cmd,arg})
end
local function pollCommand()
return table.remove(commands,1)
end
gii.connectPythonSignal('debug.command',readCommand)
local debugging=false
local input=function()
if not debugging then
gii.emitPythonSignalNow('debug.enter')
debugging=true
end
while true do
local c=pollCommand()
if c then
local cmd=c[1]
if debugging and (
cmd == 'step' or
cmd == 'over' or
cmd == 'out' or
cmd == 'exit' or
cmd == 'terminate' or
cmd == 'cont'
)
then
debugging=false
gii.emitPythonSignalNow('debug.exit')
end
if cmd=='terminate' then
return gii.throwPythonException("TERMINATE")
end
return cmd
else
bridge.GUIYield()
end
end
end
local output=function(...)
end
local send=function(msg,data)
if data then data=MOAIJsonParser.encode(data) end
gii.emitPythonSignal('debug.info',msg,data)
end
clidebugger.setupIO(input, output, send)
end
connectDebugger()
_G.debugstop=clidebugger.pause
|
local composer = require( "composer" )
local scene = composer.newScene()
local widget = require( "widget" )
-- -----------------------------------------------------------------------------------
-- Code outside of the scene event functions below will only be executed ONCE unless
-- the scene is removed entirely (not recycled) via "composer.removeScene()"
-- -----------------------------------------------------------------------------------
-- These values are set for easier access later on.
local acw = display.actualContentWidth
local ach = display.actualContentHeight
local cx = display.contentCenterX
local cy = display.contentCenterY
local bottom = display.viewableContentHeight - display.screenOriginY
-- The next lines are forward declares
local createCircles, timerForCircles
local enemyCircle = {} -- a table to store the enemy circles
local enemyCounter = 1 -- a counter to store the number of enemies
local playerScore -- stores the text object that displays player score
local playerScoreCounter = 0 -- a counter to store the players score
-- -----------------------------------------------------------------------------------
-- Scene event functions
-- This is called when the menu button is touched. This will send the player back to the menu.
local function onPlayTouch( event )
if ( "ended" == event.phase ) then
timer.cancel(timerForCircles)
composer.gotoScene("scene-menu")
end
end
-- This function will remove the circle on touch, increment the player score by 1, and return true. The return true means the function was called successfully.
local function onCircleTouch(event)
if ( "ended" == event.phase ) then
display.remove(event.target)
playerScoreCounter = playerScoreCounter + 1
playerScore.text = "Score: "..playerScoreCounter
return true
end
end
-- -----------------------------------------------------------------------------------
-- create()
function scene:create( event )
local sceneGroup = self.view
-- Code here runs when the scene is first created but has not yet appeared on screen
-- Create the background
local background = display.newRect(sceneGroup, 0, 0, acw, ach)
background.x = cx
background.y = cy
-- Create the black bar at the bottom of the screen
local bottombar = display.newRect(sceneGroup, 0, 0, acw, 54)
bottombar:setFillColor(0)
bottombar.anchorY = 1
bottombar.x = cx
bottombar.y = bottom
-- Create a text object to keep track of the player score
playerScore = display.newText(sceneGroup, "Score: "..playerScoreCounter, 0, 0, native.systemFont, 20)
playerScore:setFillColor(0)
playerScore.x = cx
playerScore.y = bottombar.y - 70
-- Create a button to allow the player to return to the menu
local btn_menu = widget.newButton({
left = 100,
top = 200,
label = "Menu",
fontSize = 40,
onEvent = onPlayTouch
})
btn_menu.anchorY = 1 -- anchorY changes the anchor point of the object. By setting it to 1, the anchor point is at the bottom of the object.
btn_menu.x = cx
btn_menu.y = bottom - 5
sceneGroup:insert(btn_menu)
-- This function will create an enemy circle, assign a random color, assign a random position, and attach the touch event listener. At the end, the enemy counter variable is increased by 1.
createCircles = function()
enemyCircle[enemyCounter] = display.newCircle(sceneGroup, 0, 0, 25)
enemyCircle[enemyCounter]:setFillColor(math.random(1,255)/255, math.random(1,255)/255, math.random(1,255)/255)
enemyCircle[enemyCounter].x = math.random(20, acw-20)
enemyCircle[enemyCounter].y = math.random(20, ach-130)
enemyCircle[enemyCounter]:addEventListener("touch", onCircleTouch)
enemyCounter = enemyCounter + 1
end
end
-- show()
function scene:show( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is still off screen (but is about to come on screen)
elseif ( phase == "did" ) then
-- Code here runs when the scene is entirely on screen
timerForCircles = timer.performWithDelay(1000, createCircles, 0)
end
end
-- hide()
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == "will" ) then
-- Code here runs when the scene is on screen (but is about to go off screen)
elseif ( phase == "did" ) then
-- Code here runs immediately after the scene goes entirely off screen
end
end
-- destroy()
function scene:destroy( event )
local sceneGroup = self.view
-- Code here runs prior to the removal of scene's view
end
-- -----------------------------------------------------------------------------------
-- Scene event function listeners
-- -----------------------------------------------------------------------------------
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )
-- -----------------------------------------------------------------------------------
return scene
|
--i used stravants Beautifier so it might look a bit wonky
Meshes = {
Blast = '20329976',
Crown = '1323306',
Ring = '3270017',
Claw = '10681506',
Crystal = '9756362',
Coil = '9753878',
Cloud = '1095708',
}
clangsounds = {
'199149119',
'199149109',
'199149072',
'199149025',
'199148971'
}
hitsounds = {
'199149137',
'199149186',
'199149221',
'199149235',
'199149269',
'199149297'
}
blocksounds = {
'199148933',
'199148947'
}
armorsounds = {
'199149321',
'199149338',
'199149367',
'199149409',
'199149452'
}
woosh = {
Heavy1 = '320557353',
Heavy2 = '320557382',
Heavy3 = '320557453',
Heavy4 = '199144226',
Heavy5 = '203691447',
Heavy6 = '203691467',
Heavy7 = '203691492',
Light1 = '320557413',
Light2 = '320557487',
Light3 = '199145095',
Light4 = '199145146',
Light5 = '199145887',
Light6 = '199145913',
Light7 = '199145841',
Medium1 = '320557518',
Medium2 = '320557537',
Medium3 = '320557563',
Medium4 = '199145204'
}
music = {--i like music a lot
Breaking = '179281636',
FinalReckoning = '357375770',
NotDeadYet = '346175829',
Intense = '151514610',
JumpP1 = '160536628',
JumpP2 = '60536666',
SonsOfWar = '158929777',
WrathOfSea = '165520893',
ProtecTorsofEarth = '160542922',
SkyTitans = '179282324',
ArchAngel = '144043274',
Anticipation = '168614529',
TheMartyred = '186849544',
AwakeP1 = '335631255',
AwakeP2 = '335631297',
ReadyAimFireP1 = '342455387',
ReadyAimFireP2 = '342455399',
DarkLordP1 = '209567483',
DarkLordP2 = '209567529',
BloodDrainP1 = '162914123',
BloodDrainP2 = '162914203',
DanceOfSwords = '320473062',
Opal = '286415112',
Calamity = '190454307',
Hypnotica = '155968128',
Nemisis = '160453802',
Breathe = '276963903',
GateToTheRift = '270655227',
InfernalBeserking = '244143404',
Trust = '246184492',
AwakeningTheProject = '245121821',
BloodPain = '242545577',
Chaos = '247241693',
NightmareFictionHighStake = '248062278',
TheWhiteWeapon = '247236446',
Gale = '256851659',
ImperialCode = '256848383',
Blitzkrieg = '306431437',
RhapsodyRage = '348690251',
TheGodFist = '348541501',
BattleForSoul = '321185592',
TheDarkColossus = '305976780',
EmpireOfAngels = '302580452',
Kronos = '302205297',
Exorcist = '299796054',
CrimsonFlames = '297799220',
UltimatePower = '295753229',
DrivingInTheDark = '295753229',
AscendToPower = '293860654',
GodOfTheSun = '293612495',
DarkRider = '293861765',
Vengeance = '293375555',
SoundOfWar = '293376196',
HellsCrusaders = '293012202',
Legend = '293011823',
RisingSouls = '290524959'
}
misc = {
GroundSlam = '199145477',
LaserSlash = '199145497',
RailGunFire = '199145534',
Charge1 = '199145659',
Charge2 = '169380469',
Charge3 = '169380479',
EmptyGun = '203691822',
GunShoot = '203691837',
Stomp1 = '200632875',
Stomp2 = '200632561',
TelsaCannonCharge = '169445572',
TelsaCannonShoot = '169445602',
AncientHymm = '245313442'
}
wait(1 / 60)
local Player = game.Players.localPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
local mouse = Player:GetMouse()
local m = Instance.new('Model', Character)
m.Name = "WeaponModel"
local Effects = {}
local LeftArm = Character["Left Arm"]
local RightArm = Character["Right Arm"]
local LeftLeg = Character["Left Leg"]
local RightLeg = Character["Right Leg"]
local Head = Character.Head
local Torso = Character.Torso
local cam = game.Workspace.CurrentCamera
local RootPart = Character.HumanoidRootPart
local RootJoint = RootPart.RootJoint
--cam.CameraSubject = Head
local equipped = false
local attack = false
local Anim = 'Idle'
local idle = 0
local sprint = false
local battlestance = false
local attacktype = 1
local state = 'none'
local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
local velocity = RootPart.Velocity.y
local sine = 0
local change = 1
local on = false
local grabbed = false
local skill1 = false
local skill2 = false
local skill3 = false
local skill4 = false
local cooldown1 = 0
local cooldown2 = 0
local cooldown3 = 0
local cooldown4 = 0
local co1 = 10--how long it will take for skill to cooldown
local co2 = 15
local co3 = 15
local co4 = 25
local inputserv = game:GetService('UserInputService')
local typing = false
local crit = false
local critchance = 2--critical chance percentage
local critdamageaddmin = 3--minimum amount of critical damage being added to regular damage
local critdamageaddmax = 7--maximum amount
local maxstamina = 100--max amount of stamina
local stamina = 0--stamina you start out with
local skill1stam = 10--how much stamina is needed for a skill
local skill2stam = 10
local skill3stam = 20
local skill4stam = 30
local recovermana = 3--how much mana per second
local defensevalue = 1--how much defense this character has
local speedvalue = 1--how much speed this character has
--speed is 16*speedvalue
local mindamage = 5--self explanatory
local maxdamage = 7--self explanatory
local damagevalue = 1--how much damage this character has
--damage is math.random(mindamage,maxdamage)*damagevalue
--damage(hit, mindamage, maxdamage, 1, 1, RootPart)
--asd
local cn = CFrame.new-- make things easier :)
local mr = math.rad
local angles = CFrame.Angles
local ud = UDim2.new
local c3 = Color3.new
local skillcolorscheme = c3(1, 1, 1)--color scheme for skills lol
--asd
local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Humanoid.Animator:Destroy()
Character.Animate:Destroy()
--Angles For RootJoint `~`
local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
--Save Shoulders/Hips
RSH, LSH = nil, nil
RHS, LHS = nil, nil
--Shoulders
RW = Instance.new("Weld")
LW = Instance.new("Weld")
--Hips
RH = Instance.new("Weld")
LH = Instance.new("Weld")
--
Player = Player
ch = Character
LHS = Torso["Left Hip"]
RHS = Torso["Right Hip"]
RSH = ch.Torso["Right Shoulder"]
LSH = ch.Torso["Left Shoulder"]
--
RSH.Parent = nil
LSH.Parent = nil
--
LHS.Parent = nil
RHS.Parent = nil
--
RW.Name = "RW"
RW.Part0 = ch.Torso
RW.C0 = cn(1.5, 0.5, 0)
RW.C1 = cn(0, 0.5, 0)
RW.Part1 = ch["Right Arm"]
RW.Parent = ch.Torso
--
LW.Name = "LW"
LW.Part0 = ch.Torso
LW.C0 = cn(-1.5, 0.5, 0)
LW.C1 = cn(0, 0.5, 0)
LW.Part1 = ch["Left Arm"]
LW.Parent = ch.Torso
--
LH.Name = "LH"
LH.Part0 = ch.Torso
LH.C0 = cn(-0.5, -2, 0)
LH.Part1 = ch["Left Leg"]
LH.Parent = ch.Torso
--
RH.Name = "RH"
RH.Part0 = ch.Torso
RH.C0 = cn(0.5, -2, 0)
RH.Part1 = ch["Right Leg"]
RH.Parent = ch.Torso
local scrn = Instance.new('ScreenGui', Player.PlayerGui)
function makeframe(par, trans, pos, size, color)
local frame = Instance.new('Frame', par)
frame.BackgroundTransparency = trans
frame.BorderSizePixel = 0
frame.Position = pos
frame.Size = size
frame.BackgroundColor3 = color
return frame
end
function makelabel(par, text)
local label = Instance.new('TextLabel', par)
label.BackgroundTransparency = 1
label.Size = ud(1, 0, 1, 0)
label.Position = ud(0, 0, 0, 0)
label.TextColor3 = c3(255, 255, 255)
label.TextStrokeTransparency = 0
label.FontSize = Enum.FontSize.Size32
label.Font = Enum.Font.SourceSansBold
label.BorderSizePixel = 0
label.TextScaled = true
label.Text = text
end
framesk1 = makeframe(scrn, .5, ud(.23, 0, .93, 0), ud(.26, 0, .06, 0), skillcolorscheme)
framesk2 = makeframe(scrn, .5, ud(.5, 0, .93, 0), ud(.26, 0, .06, 0), skillcolorscheme)
framesk3 = makeframe(scrn, .5, ud(.5, 0, .86, 0), ud(.26, 0, .06, 0), skillcolorscheme)
framesk4 = makeframe(scrn, .5, ud(.23, 0, .86, 0), ud(.26, 0, .06, 0), skillcolorscheme)
bar1 = makeframe(framesk1, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme)
bar2 = makeframe(framesk2, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme)
bar3 = makeframe(framesk3, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme)
bar4 = makeframe(framesk4, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme)
text1 = makelabel(framesk1, '[3] Skill3')
text2 = makelabel(framesk2, '[4] Skill4')
text3 = makelabel(framesk3, "[2] Skill2")
text4 = makelabel(framesk4, '[q] Jikishi')
staminabar = makeframe(scrn, .5, ud(.23, 0, .82, 0), ud(.26, 0, .03, 0), c3(61 / 255, 171 / 255, 1))
staminacover = makeframe(staminabar, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), c3(61 / 255, 171 / 255, 1))
staminatext = makelabel(staminabar, 'Mana')
healthbar = makeframe(scrn, .5, ud(.5, 0, .82, 0), ud(.26, 0, .03, 0), c3(1, 1, 0))
healthcover = makeframe(healthbar, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), c3(1, 46 / 255, 49 / 255))
healthtext = makelabel(healthbar, 'Health')
local stats = Instance.new('Folder', Character)
stats.Name = 'Stats'
local block = Instance.new('BoolValue', stats)
block.Name = 'Block'
block.Value = false
local stun = Instance.new('BoolValue', stats)
stun.Name = 'Stun'
stun.Value = false
local defense = Instance.new('NumberValue', stats)
defense.Name = 'Defence'
defense.Value = defensevalue
local speed = Instance.new('NumberValue', stats)
speed.Name = 'Speed'
speed.Value = speedvalue
local damagea = Instance.new('NumberValue', stats)
damagea.Name = 'Damage'
damagea.Value = damagevalue
gyro = Instance.new("BodyGyro")
gyro.Parent = nil
gyro.P = 1e7
gyro.D = 1e3
gyro.MaxTorque = Vector3.new(0,1e7,0)
function atktype(s, e)
coroutine.resume(coroutine.create(function()
attacktype = e
wait(1.5)
attacktype = s
end))
end
function turncrit()
coroutine.resume(coroutine.create(function()
print'CRITICAL!'
crit = true
wait(.25)
crit = false
end))
end
function subtractstamina(k)
if stamina >= k then
stamina = stamina - k
end
end
function clerp(a, b, t)
return a:lerp(b, t)
end
function randomizer(percent)
local randomized = math.random(0, 100)
if randomized <= percent then
return true
elseif randomized >= percent then
return false
end
end
local RbxUtility = LoadLibrary("RbxUtility")
local Create = RbxUtility.Create
function RemoveOutlines(part)
part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
end
function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BColor, Name, Size)
local Part = Create("Part"){
formFactor = FormFactor,
Parent = Parent,
Reflectance = Reflectance,
Transparency = Transparency,
CanCollide = false,
Locked = true,
BrickColor = BrickColor.new(tostring(BColor)),
Name = Name,
Size = Size,
Material = Material,
}
RemoveOutlines(Part)
return Part
end
function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
local Msh = Create(Mesh){
Parent = Part,
Offset = OffSet,
Scale = Scale,
}
if Mesh == "SpecialMesh" then
Msh.MeshType = MeshType
Msh.MeshId = MeshId
end
return Msh
end
function CreateWeld(Parent, Part0, Part1, C0, C1)
local Weld = Create("Weld"){
Parent = Parent,
Part0 = Part0,
Part1 = Part1,
C0 = C0,
C1 = C1,
}
return Weld
end
function rayCast(pos, dir, maxl, ignore)
return game:service("Workspace"):FindPartOnRay(Ray.new(pos, dir.unit * (maxl or 999.999)), ignore)
end
--Effects
function makeeffect(par, size, pos1, trans, trans1, howmuch, delay1, id, type)
local p = Instance.new('Part', par or workspace)
p.CFrame = pos1
p.Anchored = true
p.Material = 'SmoothPlastic'
p.CanCollide = false
p.TopSurface = 0
p.Size = Vector3.new(1, 1, 1)
p.BottomSurface = 0
p.Transparency = trans
p.FormFactor = 'Custom'
RemoveOutlines(p)
local mesh = Instance.new('SpecialMesh', p)
mesh.Scale = size
if id ~= nil and type == nil then
mesh.MeshId = 'rbxassetid://'..id
elseif id == nil and type ~= nil then
mesh.MeshType = type
elseif id == nil and type == nil then
mesh.MeshType = 'Brick'
end
coroutine.wrap(function()
for i = 0, delay1, .1 do
wait(1 / 60)
p.CFrame = p.CFrame
mesh.Scale = mesh.Scale + howmuch
p.Transparency = p.Transparency + trans1
end
p:Destroy()
end)()
return p
end
function clangy(cframe)
wait(1 / 60)
local clang = {}
local dis = 0
local part = Instance.new('Part', nil)
part.CFrame = cframe
part.Anchored = true
part.CanCollide = false
part.BrickColor = BrickColor.new('New Yeller')
part.FormFactor = 'Custom'
part.Name = 'clanger'
part.Size = Vector3.new(.2, .2, .2)
part.TopSurface = 10
part.BottomSurface = 10
part.RightSurface = 10
part.LeftSurface = 10
part.BackSurface = 10
part.FrontSurface = 10
--part.Material='Neon'
part:BreakJoints()
local mesh = Instance.new('BlockMesh', part)
coroutine.wrap(function()
for i = 1, 7 do
wait(1 / 60)
dis = dis + .2
local partc = part:clone()
partc.Parent = workspace
partc.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(dis, 0, 0)
partc.CFrame = partc.CFrame * CFrame.new(0, dis, 0)
table.insert(clang, partc)
end
for i, v in pairs(clang) do
coroutine.wrap(function()
for i = 1, 10 do
wait(.01)
v.Transparency = v.Transparency + .1
end
v:destroy()
end)()
end
end)()
end
--damage effects
function circle(color, pos1)
local p = Instance.new('Part', m)
p.BrickColor = BrickColor.new(color)
p.CFrame = pos1
p.Anchored = true
p.Material = 'Plastic'
p.CanCollide = false
p.TopSurface = 0
p.Size = Vector3.new(1, 1, 1)
p.BottomSurface = 0
p.Transparency = 0.35
p.FormFactor = 'Custom'
local mesh = Instance.new('CylinderMesh', p)
mesh.Scale = Vector3.new(0, 0, 0)
coroutine.wrap(function()
for i = 0, 5, .1 do
wait(1 / 60)
p.CFrame = p.CFrame
mesh.Scale = mesh.Scale + Vector3.new(.5, 0, .5)
p.Transparency = p.Transparency + .025
end
p:Destroy()
end)()
end
function firespaz1(color, pos1)
local p = Instance.new('Part', m)
p.BrickColor = BrickColor.new(color)
p.CFrame = pos1
p.Anchored = true
p.Material = 'Plastic'
p.CanCollide = false
p.TopSurface = 0
p.Size = Vector3.new(1, 1, 1)
p.BottomSurface = 0
p.Transparency = 0.5
p.FormFactor = 'Custom'
local mesh = Instance.new('BlockMesh', p)
mesh.Scale = Vector3.new(1, 1, 1)
coroutine.wrap(function()
for i = 0, 15, .1 do
wait(1 / 30)
p.CFrame = p.CFrame * CFrame.new(0, .1, 0)
mesh.Scale = mesh.Scale - Vector3.new(.1, .1, .1)
p.Transparency = p.Transparency + .025
end
p:Destroy()
end)()
end
function pickrandom(tablesa)
local randomized = tablesa[math.random(1, #tablesa)]
return randomized
end
function sound(id, pitch, volume, par, last)
local s = Instance.new('Sound', par or Torso)
s.SoundId = 'rbxassetid://'..id
s.Pitch = pitch or 1
s.Volume = volume or 1
wait()
s:play()
game.Debris:AddItem(s, last or 120)
end
function clangy(cframe)
wait(1 / 60)
local clang = {}
local dis = 0
local part = Instance.new('Part', nil)
part.CFrame = cframe
part.Anchored = true
part.CanCollide = false
part.BrickColor = BrickColor.new('New Yeller')
part.FormFactor = 'Custom'
part.Name = 'clanger'
part.Size = Vector3.new(.2, .2, .2)
part.TopSurface = 10
part.BottomSurface = 10
part.RightSurface = 10
part.LeftSurface = 10
part.BackSurface = 10
part.FrontSurface = 10
--part.Material='Neon'
part:BreakJoints()
local mesh = Instance.new('BlockMesh', part)
coroutine.wrap(function()
for i = 1, 7 do
wait(1 / 60)
dis = dis + .2
local partc = part:clone()
partc.Parent = workspace
partc.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(dis, 0, 0)
partc.CFrame = partc.CFrame * CFrame.new(0, dis, 0)
table.insert(clang, partc)
end
for i, v in pairs(clang) do
coroutine.wrap(function()
for i = 1, 10 do
wait(.01)
v.Transparency = v.Transparency + .1
end
v:destroy()
end)()
end
end)()
end
--damage effects
--Effects
so = function(id, par, vol, pit)
coroutine.resume(coroutine.create(function()
local sou = Instance.new("Sound", par or workspace)
sou.Volume = vol
sou.Pitch = pit or 1
sou.SoundId = id
wait()
sou:play()
game:GetService("Debris"):AddItem(sou, 6)
end))
end
local function getclosest(obj, distance)
local last, lastx = distance + 1
for i, v in pairs(workspace:GetChildren()) do
if v:IsA'Model' and v ~= Character and v:findFirstChild('Humanoid') and v:findFirstChild('Torso') and v:findFirstChild('Humanoid').Health > 0 then
local t = v.Torso
local dist = (t.Position - obj.Position).magnitude
if dist <= distance then
if dist < last then
last = dist
lastx = v
end
end
end
end
return lastx
end
function makegui(cframe, text)
local a = math.random(-10, 10) / 100
local c = Instance.new("Part")
c.Transparency = 1
Instance.new("BodyGyro").Parent = c
c.Parent = m
c.CFrame = CFrame.new(cframe.p + Vector3.new(0, 1.5, 0))
local f = Instance.new("BodyPosition")
f.P = 2000
f.D = 100
f.maxForce = Vector3.new(math.huge, math.huge, math.huge)
f.position = c.Position + Vector3.new(0, 3, 0)
f.Parent = c
game:GetService("Debris"):AddItem(c, .5 + 6)
c.CanCollide = false
c.CanCollide = false
local bg = Instance.new('BillboardGui', m)
bg.Adornee = c
bg.Size = UDim2.new(1, 0, 1, 0)
bg.StudsOffset = Vector3.new(0, 0, 0)
bg.AlwaysOnTop = false
local tl = Instance.new('TextLabel', bg)
tl.BackgroundTransparency = 1
tl.Size = UDim2.new(1, 0, 1, 0)
tl.Text = text
tl.Font = 'SourceSansBold'
tl.FontSize = 'Size42'
if crit == true then
tl.TextColor3 = Color3.new(180 / 255, 0, 0)
else
tl.TextColor3 = Color3.new(255, 180 / 255, 51 / 255)
end
tl.TextStrokeTransparency = 0
tl.TextScaled = true
tl.TextWrapped = true
coroutine.wrap(function()
wait(2)
for i = 1, 10 do
wait()
tl.TextTransparency = tl.TextTransparency + .1
end
end)()
end
function tag(hum, Player)
local creator = Instance.new('ObjectValue', hum)
creator.Value = Player
creator.Name = 'creator'
end
function untag(hum)
if hum ~= nil then
local tag = hum:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function tagPlayer(h)
coroutine.wrap(function()
tag(h, Player)
wait(1)
untag(h)
end)()
end
function CheckClose(Obj,Dist)
for _,v in pairs(workspace:GetChildren()) do
if v:FindFirstChild('Humanoid') and v:FindFirstChild('Torso') and v ~= Character then
local DistFromTorso = (v.Torso.Position - Obj.Position).magnitude
if DistFromTorso < Dist then
return v
end
end
end
end
function damage(hit, mind, maxd, knock, type, prop)
--[[
to apply it to a Player directly, make the first arg go to the Players Torso
1 - normal type(damage and knockback)
2 - drain type(damage no knockback)
3 - lifesteal(absorbs hp) crit does not have an effect on how much life is absorbed
4 - heal(heals target)
5 - subtracts enemies defense
6 - subtracts enemies speed
7 -
]]
if hit.Name:lower() == 'Hitbox' then
local pos = CFrame.new(0, 1, -1)
sound(pickrandom(clangsounds), math.random(100, 150) / 100, 1, Torso, 6)
coroutine.wrap(function()
for i = 1, 4 do
clangy(Torso.CFrame * pos * CFrame.Angles(0, math.rad(math.random(0, 360)), 0))
end
end)()
end
if hit.Parent == nil then
return
end
local h = hit.Parent:FindFirstChild("Humanoid")
for i, v in pairs(hit.Parent:children()) do
if v:IsA("Humanoid") then
h = v
end
end
if hit.Parent.Parent:FindFirstChild('Torso') ~= nil then
h = hit.Parent.Parent:FindFirstChild('Humanoid')
end
if hit.Parent:IsA('Hat') then
hit = hit.Parent.Parent:findFirstChild('Head')
end
local D = math.random(mind, maxd) * damagea.Value
if h.Parent:FindFirstChild('Stats') then
D = D / h.Parent:FindFirstChild('Stats').Defence.Value
elseif not h.Parent:FindFirstChild('Stats') then
D = D
end
if h then
makegui(h.Parent.Head.CFrame, tostring(math.floor(D + .5)))
end
if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
if type == 1 then
tagPlayer(h)
local asd = randomizer(critchance)
if asd == true then
turncrit()
end
if crit == false then
h.Health = h.Health - D
else
h.Health = h.Health - (D + math.random(critdamageaddmin, critdamageaddmax))
end
so("http://www.roblox.com/asset/?id=169462037", hit, 1, math.random(150, 200) / 100)
local vp = Instance.new('BodyVelocity')
vp.P = 500
vp.maxForce = Vector3.new(math.huge, 0, math.huge)
vp.velocity = prop.CFrame.lookVector * knock + prop.Velocity / 1.05
if knock > 0 then
vp.Parent = hit.Parent.Torso
end
game:GetService("Debris"):AddItem(vp, .5)
elseif type == 2 then
so("http://www.roblox.com/asset/?id=169462037", hit, 1, math.random(150, 200) / 100)
local asd = randomizer(critchance)
if asd == true then
turncrit()
end
if crit == false then
h.Health = h.Health - D
else
h.Health = h.Health - (D + math.random(critdamageaddmin, critdamageaddmax))
end
tagPlayer(h)
elseif type == 3 then
tagPlayer(h)
local asd = randomizer(critchance)
if asd == true then
turncrit()
end
if crit == false then
h.Health = h.Health - D
else
h.Health = h.Health - (D + math.random(critdamageaddmin, critdamageaddmax))
end
Character.Humanoid.Health = Character.Humanoid.Health + D / 2
so("http://www.roblox.com/asset/?id=206083232", hit, 1, 1.5)
for i = 1, 10 do
firespaz1('Bright red', hit.CFrame * CFrame.Angles(math.random(0, 3), math.random(0, 3), math.random(0, 3)))
end
elseif type == 4 then
h.Health = h.Health + D
so("http://www.roblox.com/asset/?id=186883084", hit, 1, 1)
circle('Dark green', h.Parent.Torso.CFrame * CFrame.new(0, -2.5, 0))
end
end
end
function subtrackstamina(k)
if stamina >= k then
stamina = stamina - k
end
end
HandleA=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,1,"Really black","HandleA",Vector3.new(0.200000003, 0.256000012, 0.896000028))
HandleAweld=CreateWeld(m,Character["Right Arm"],HandleA,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.96914959, -0.0125427246, 0.385789871, 1.75864163e-012, -0.999996305, 5.21540642e-007, 1, 1.75863566e-012, 9.87516926e-013, -9.87517793e-013, 5.21538709e-007, 1))
CreateMesh("BlockMesh",HandleA,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
HandleB=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,1,"Really black","HandleB",Vector3.new(0.200000003, 0.256000012, 0.896000028))
HandleBweld=CreateWeld(m,Character["Left Arm"],HandleB,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.96914959, -0.0415725708, 0.385789871, 1.75864163e-012, -0.999996305, 5.21540642e-007, 1, 1.75863566e-012, 9.87516926e-013, -9.87517793e-013, 5.21538709e-007, 1))
CreateMesh("BlockMesh",HandleB,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
FakeHandleA=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,1,"Really black","FakeHandleA",Vector3.new(0.200000003, 0.256000012, 0.496000051))
FakeHandleAweld=CreateWeld(m,HandleA,FakeHandleA,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0, 0, 1, -2.70708814e-020, 0, -2.70708814e-020, 1, 0, 0, 0, 1))
CreateMesh("BlockMesh",FakeHandleA,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
BarrelA=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","BarrelA",Vector3.new(0.200000003, 0.200000003, 0.512000024))
BarrelAweld=CreateWeld(m,FakeHandleA,BarrelA,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00650787354, -0.375404358, -2.42294502, 4.16033035e-005, -1, 4.46682229e-008, 4.43546014e-007, -4.46531985e-008, -1, 1, 4.16033035e-005, 4.43542376e-007))
CreateMesh("SpecialMesh",BarrelA,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.153600022, 0.140799999, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.28000021))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.119544983, -0.121589661, 1.78291702, -6.37476187e-005, 4.76194713e-013, 0.999996901, -5.47054914e-013, 0.999996901, -7.60343774e-013, -1, -8.91774122e-013, -5.38835739e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.640000045, 0.384000033, 0.339200079))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247545242, 0.00640106201, 0.630371094, -6.47408015e-005, 7.84722764e-014, 0.999998569, -3.66998706e-012, 0.999998569, -1.63487659e-013, -1, -3.82280969e-012, -6.01361753e-005))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.128004074, 0.192035675, -1.79853174e-007, -1, -1.51764738e-007, 0.499996454, -2.21358675e-007, 0.866026282, -0.866026223, 7.98759316e-008, 0.499996454))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78546047, -0.370124817, -0.202838898, -0.99999994, -2.91117576e-005, -0.00038461131, 0.000389215566, 2.89187028e-005, -0.99999851, 2.91230535e-005, -0.999998569, -2.89075051e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.115200005, 0.115200005, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.339200139))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.503520966, 0.00640106201, 0.969585419, -9.1756061e-005, 4.99451825e-014, 1, -2.86708916e-012, 1, -5.020821e-014, -1, -2.86709372e-012, -9.1756061e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.512000024, 0.200000003, 0.339200139))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.311544418, -0.12159729, 0.969573975, -6.47460765e-005, -6.7951287e-015, 0.999998569, -3.65221698e-012, 0.999998569, -2.48750727e-013, -1, -3.84057283e-012, -6.01309002e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.384000033, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375535965, -0.121589661, 1.20691872, -6.56298071e-005, 4.76194442e-013, 1, -4.9733736e-013, 1, -4.76227022e-013, -1, -4.97368585e-013, -6.56298071e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.704000056))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.256000012, 0.384000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.127998352, 0, 0.255999565, 0.499999821, 1.38461152e-011, 0.866025269, -1.16909017e-011, 1, -9.23837656e-012, -0.866025209, -5.50542771e-012, 0.499999821))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.128002167, 2.67028809e-005, 2.98034593e-007, -1, 7.74869136e-007, 0.500002921, 8.20073808e-007, 0.866023064, -0.866023004, 1.29332093e-007, 0.500002921))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.640000105))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.243200049, 0.512000024))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-1.90734863e-006, 7.62939453e-006, -0.447894096, 0.499994576, 3.01597532e-011, 0.866018713, -2.50146275e-011, 0.999995053, -2.05416344e-011, -0.866017878, -1.14053853e-011, 0.499993682))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Medium stone grey","Part",Vector3.new(0.256000012, 0.200000003, 0.249600157))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.52622414, 0.138786316, 0.999559402, -0.707390428, -2.36573001e-012, 0.706825316, 7.26157936e-012, 0.999998569, 1.03766258e-011, -0.706822991, 1.242495e-011, -0.707386136))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.384000033, 0.640000045, 0.640000045))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247411728, 0.00640106201, 0.480004311, -1.30890949e-005, 9.87543597e-013, 1, 2.16009654e-012, 1, -9.87514866e-013, -1, 2.16008418e-012, -1.30890949e-005))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.512000024, 0.200000003, 0.339200139))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.311553955, 0.134399414, 0.969578743, -7.60540061e-005, -6.8364368e-015, 1, -3.32184042e-012, 1, 6.58381769e-015, -1, -3.32183955e-012, -7.60540061e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.480007172, -0.247407913, -0.185581207, 1, 4.16033035e-005, -4.7685171e-007, -4.76891728e-007, 9.65081313e-007, -1, -4.16033035e-005, 1, 9.65104618e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.320000023, 0.320000023, 2.08639956))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Medium stone grey","Part",Vector3.new(0.256000012, 0.200000003, 0.249600157))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.52619648, -0.125507355, 0.999582291, -0.707382321, -9.27554908e-013, 0.706833422, 8.0601914e-012, 0.999998569, 9.14097357e-012, -0.706831098, 1.21153313e-011, -0.70737803))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78546524, -0.370138168, 0.181156158, -0.99999994, -2.91117576e-005, -0.00038461131, 0.000389215566, 2.89187028e-005, -0.99999851, 2.91230535e-005, -0.999998569, -2.89075051e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.115200005, 0.115200005, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.256000012, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-9.53674316e-006, 0, -0.448005676, 0.499998838, 4.82502233e-012, 0.866024554, -2.13518244e-012, 1, -4.3588232e-012, -0.866024792, 4.25874071e-013, 0.499998927))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -4.29153442e-005, 0.127996445, -2.58063409e-007, -1, 4.14316702e-007, 0.866026998, -4.30647162e-007, -0.499996841, 0.499996811, 2.29778649e-007, 0.866026998))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.640000105))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.128002167, 0.0639677048, -8.49376818e-007, 1, -1.90735591e-006, 0.500001371, 2.07650851e-006, 0.866023898, 0.866023898, -2.18100411e-007, -0.50000149))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78546524, -0.370138168, 0.181156158, -0.99999994, -2.91117576e-005, -0.00038461131, 0.000389215566, 2.89187028e-005, -0.99999851, 2.91230535e-005, -0.999998569, -2.89075051e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.0768000111, 0.0896000117, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.256000012, 0.384000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.128002167, 0, -0.255997658, 0.499999672, 1.36613611e-011, 0.866024077, -1.16269529e-011, 1, -9.08205802e-012, -0.866024315, -5.43262137e-012, 0.499999762))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.256000012, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.0639648438, 0.127994537, 6.71324528e-007, 0.999995053, 5.07118841e-007, -0.866017222, 3.278262e-007, 0.499994814, 0.499995708, -7.74842817e-007, 0.866018057))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.640000105))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.512000024, 0.200000003, 0.384000033))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0724544525, 0.735972404, -0.00640106201, -6.44168395e-005, 3.14877468e-007, 0.999998569, -1, -5.96083751e-008, -5.98121624e-005, 5.95880181e-008, -0.999998569, 3.14881191e-007))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.256000012, 0.200000003, 1.61920011))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0555686951, 0.00640106201, 1.60957241, -7.2596129e-005, 5.00198841e-014, 0.999998569, -3.4390624e-012, 0.999998569, -1.35049524e-013, -1, -3.59188373e-012, -6.79914956e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.256000012, 0.896000028))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0, 0, 0.49999997, 1.38461196e-011, 0.866025507, -1.16909017e-011, 1, -9.23837656e-012, -0.866025448, -5.50543031e-012, 0.49999997))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.640000045, 0.640000045, 0.640000045))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247545242, 0.00640106201, 0.4799757, -6.47454726e-005, -6.7951287e-015, 0.999998569, -3.65221698e-012, 0.999998569, -2.48750727e-013, -1, -3.84057283e-012, -6.01315041e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Head,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.200000003, 1.1456002))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375492096, 0.134399414, 1.85013199, -3.86866304e-005, 4.47896277e-013, 0.999998569, -4.51189823e-012, 0.999998569, -5.32840699e-013, -1, -4.66473214e-012, -3.40820479e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.200000003, 1.1456002))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375541687, -0.121589661, 1.85011864, -6.34202806e-005, 4.76195092e-013, 0.999997139, -5.54160559e-013, 0.999997139, -7.60344316e-013, -1, -8.84668803e-013, -5.42109265e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.256000012, 0.200000003, 0.384000033))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.369918823, 2.35839176, -0.00639343262, -6.70053632e-005, 3.14878548e-007, 1, -1, -5.96450818e-008, -6.70053632e-005, 5.96239929e-008, -1, 3.14882556e-007))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.672000051, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78545761, -0.370113373, -0.202846527, -1, -2.91119595e-005, -0.000384613872, 0.000384613057, 2.89192758e-005, -1, 2.91230808e-005, -1, -2.89080763e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.0768000111, 0.0896000117, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.61920011))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00845146179, 0.134399414, 1.60957241, -6.47431807e-005, -6.7951287e-015, 0.999998569, -3.65221698e-012, 0.999998569, -2.48750727e-013, -1, -3.84057283e-012, -6.01337961e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.512000024, 1.61920011, 0.384000033))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0725307465, 1.60959148, -0.00640106201, -2.98303694e-005, 3.14878463e-007, 1, -1, -5.96094196e-008, -2.98303694e-005, 5.96000334e-008, -1, 3.14880253e-007))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.640000045, 0.384000033, 0.640000045))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247545242, 0.00640106201, 0.4799757, -6.47453999e-005, -6.7951287e-015, 0.999998569, -3.65221698e-012, 0.999998569, -2.48750727e-013, -1, -3.84057283e-012, -6.01315769e-005))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.503547668, 0.00639343262, 1.20689487, -0.000104134786, 2.20283698e-013, 1, -2.54377313e-012, 1, -2.20548514e-013, -1, -2.54379612e-012, -0.000104134786))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 0.704000056))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.479990959, -0.247407913, 0.198421478, 1, 4.16033035e-005, -4.7685171e-007, -4.76891728e-007, 9.65081313e-007, -1, -4.16033035e-005, 1, 9.65104618e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.320000023, 0.320000023, 2.08639956))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.256000012, 0.384000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.127994537, 0, -0.25599575, 0.500000298, 1.36755893e-011, 0.866025329, -1.15810217e-011, 1, -9.1049026e-012, -0.866025269, -5.47700297e-012, 0.500000298))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.384000033, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.3754673, 0.134399414, 1.20693207, -3.41913183e-005, 4.47918449e-013, 0.999998569, -4.64334864e-012, 0.999998569, -5.32845794e-013, -1, -4.79617995e-012, -2.9586743e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.704000056))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Medium stone grey","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.479964256, -0.247545242, 0.262424469, 1, 4.16032526e-005, 6.01762658e-005, 6.47900524e-005, 9.65080972e-007, -0.999998569, -4.16033727e-005, 0.999998569, 9.62580543e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.243199989, 0.243199989, 1.47199988))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.200000003, 1.1456002))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375528336, 0.00639343262, 1.84636974, -0.000123670645, 5.04564869e-013, 0.999998569, -2.03210604e-012, 0.999998569, -5.896105e-013, -1, -2.18498808e-012, -0.000119065939))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.28000021))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.119522095, 0.134399414, 1.78292942, -4.50793596e-005, 4.19445891e-013, 1, -4.32361742e-012, 1, -4.19640776e-013, -1, -4.3236365e-012, -4.50793596e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Medium stone grey","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.479986191, -0.247545242, -0.249576569, 1, 4.16032526e-005, 6.01762658e-005, 6.47900524e-005, 9.65080972e-007, -0.999998569, -4.16033727e-005, 0.999998569, 9.62580543e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.243199989, 0.243199989, 1.47199988))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.61920011))
Partweld=CreateWeld(m,FakeHandleA,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00845146179, -0.12159729, 1.60957241, -6.47456545e-005, -6.7951287e-015, 0.999998569, -3.65221698e-012, 0.999998569, -2.48750727e-013, -1, -3.84057283e-012, -6.01313222e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
FakeHandleB=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,1,"Really black","FakeHandleB",Vector3.new(0.200000003, 0.256000012, 0.496000051))
FakeHandleBweld=CreateWeld(m,HandleB,FakeHandleB,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0, 0, 1, -2.70708814e-020, 0, -2.70708814e-020, 1, 0, 0, 0, 1))
CreateMesh("BlockMesh",FakeHandleB,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.61920011))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00845146179, -0.121593475, 1.60957336, -6.47457127e-005, -6.3638656e-014, 0.999998569, -3.63800266e-012, 0.999998569, -3.0559317e-013, -1, -3.85478368e-012, -6.0131264e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.28000021))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.119544983, -0.121589661, 1.78291702, -6.37476187e-005, 4.76194713e-013, 0.999996901, -5.47054914e-013, 0.999996901, -7.60343774e-013, -1, -8.91774122e-013, -5.38835739e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.640000045, 0.384000033, 0.339200079))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247545242, 0.00640869141, 0.630371094, -6.47408015e-005, 7.84722764e-014, 0.999998569, -3.66998706e-012, 0.999998569, -1.63487659e-013, -1, -3.82280969e-012, -6.01361753e-005))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.128002167, 0.192035675, -1.79853174e-007, -1, -1.51764738e-007, 0.499996454, -2.21358675e-007, 0.866026282, -0.866026223, 7.98759316e-008, 0.499996454))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78546143, -0.370124817, -0.202846527, -0.99999994, -2.91117576e-005, -0.00038461131, 0.000389215566, 2.89187028e-005, -0.99999851, 2.91230535e-005, -0.999998569, -2.89075051e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.115200005, 0.115200005, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.339200139))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.503541946, 0.00639343262, 0.969587326, -8.2750259e-005, -6.86213239e-015, 1, -3.11578432e-012, 1, 6.60430911e-015, -1, -3.11578346e-012, -8.2750259e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.512000024, 0.200000003, 0.339200139))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.311544418, -0.121593475, 0.969573975, -6.47620036e-005, -6.36387644e-014, 0.999998569, -3.63800266e-012, 0.999998569, -3.0559317e-013, -1, -3.85478368e-012, -6.01149695e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.384000033, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.3754673, -0.121593475, 1.20693207, -3.53266842e-005, 4.76335334e-013, 1, -4.61138289e-012, 1, -4.76498127e-013, -1, -4.6113998e-012, -3.53266842e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.704000056))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.256000012, 0.384000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.127998352, 0, 0.255999565, 0.499999821, 1.38461152e-011, 0.866025269, -1.16909017e-011, 1, -9.23837656e-012, -0.866025209, -5.50542771e-012, 0.499999821))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-7.62939453e-006, -0.128002167, 2.67028809e-005, 2.98034593e-007, -1, 7.74869136e-007, 0.500002921, 8.20073808e-007, 0.866023064, -0.866023004, 1.29332093e-007, 0.500002921))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.640000105))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.243200049, 0.512000024))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-1.90734863e-006, 1.52587891e-005, -0.447894096, 0.499994576, 3.01597532e-011, 0.866018713, -2.50146275e-011, 0.999995053, -2.05416344e-011, -0.866017878, -1.14053853e-011, 0.499993682))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Medium stone grey","Part",Vector3.new(0.256000012, 0.200000003, 0.249600157))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.52622414, 0.138793945, 0.999559402, -0.707390428, -2.36573001e-012, 0.706825316, 7.26157936e-012, 0.999998569, 1.03766258e-011, -0.706822991, 1.242495e-011, -0.707386136))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.384000033, 0.640000045, 0.640000045))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247411728, 0.00640106201, 0.480004311, -1.30890949e-005, 9.87543597e-013, 1, 2.16009654e-012, 1, -9.87514866e-013, -1, 2.16008418e-012, -1.30890949e-005))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.512000024, 0.200000003, 0.339200139))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.311553955, 0.134407043, 0.969582558, -7.60542825e-005, -6.36801809e-014, 1, -3.30763455e-012, 1, 6.3428646e-014, -1, -3.30762999e-012, -7.60542825e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.480007172, -0.247407913, -0.185573578, 1, 4.16033035e-005, -4.7685171e-007, -4.76891728e-007, 9.65081313e-007, -1, -4.16033035e-005, 1, 9.65104618e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.320000023, 0.320000023, 2.08639956))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Medium stone grey","Part",Vector3.new(0.256000012, 0.200000003, 0.249600157))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.52619648, -0.12550354, 0.999582291, -0.707382321, -9.27554908e-013, 0.706833422, 8.0601914e-012, 0.999998569, 9.14097357e-012, -0.706831098, 1.21153313e-011, -0.70737803))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78546524, -0.370138168, 0.181156158, -0.99999994, -2.91117576e-005, -0.00038461131, 0.000389215566, 2.89187028e-005, -0.99999851, 2.91230535e-005, -0.999998569, -2.89075051e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.115200005, 0.115200005, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.256000012, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-7.62939453e-006, 0, -0.44802475, 0.499999821, 2.87913812e-012, 0.866025627, -5.11821054e-013, 1, -3.0290436e-012, -0.866025567, 1.07127198e-012, 0.499999821))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-7.62939453e-006, -4.29153442e-005, 0.127996445, -2.58063409e-007, -1, 4.14316702e-007, 0.866026998, -4.30647162e-007, -0.499996841, 0.499996811, 2.29778649e-007, 0.866026998))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.640000105))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.128002167, 0.0639677048, -8.49376818e-007, 1, -1.90735591e-006, 0.500001371, 2.07650851e-006, 0.866023898, 0.866023898, -2.18100411e-007, -0.50000149))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78546524, -0.370138168, 0.181156158, -0.99999994, -2.91117576e-005, -0.00038461131, 0.000389215566, 2.89187028e-005, -0.99999851, 2.91230535e-005, -0.999998569, -2.89075051e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.0768000111, 0.0896000117, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.256000012, 0.384000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.128002167, 7.62939453e-006, -0.255997658, 0.499999672, 1.36613611e-011, 0.866024077, -1.16269529e-011, 1, -9.08205802e-012, -0.866024315, -5.43262137e-012, 0.499999762))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.256000012, 0.256000012, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(7.62939453e-006, -0.0639648438, 0.127996445, 6.71324528e-007, 0.999995053, 5.07118841e-007, -0.866017222, 3.278262e-007, 0.499994814, 0.499995708, -7.74842817e-007, 0.866018057))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.640000105))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.512000024, 0.200000003, 0.384000033))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0724544525, 0.735972404, -0.00640869141, -6.44168395e-005, 3.14877468e-007, 0.999998569, -1, -5.96083751e-008, -5.98121624e-005, 5.95880181e-008, -0.999998569, 3.14881191e-007))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.256000012, 0.200000003, 1.61920011))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0555686951, 0.00640869141, 1.60957241, -7.2596129e-005, 5.00198841e-014, 0.999998569, -3.4390624e-012, 0.999998569, -1.35049524e-013, -1, -3.59188373e-012, -6.79914956e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.256000012, 0.896000028))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0, 0, 0.49999997, 1.38461196e-011, 0.866025507, -1.16909017e-011, 1, -9.23837656e-012, -0.866025448, -5.50543031e-012, 0.49999997))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.640000045, 0.640000045, 0.640000045))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247545242, 0.00640869141, 0.4799757, -6.47458946e-005, -6.3638656e-014, 0.999998569, -3.63800266e-012, 0.999998569, -3.0559317e-013, -1, -3.85478368e-012, -6.01310821e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.Head,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.200000003, 1.1456002))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375492096, 0.134399414, 1.85013199, -3.86866304e-005, 4.47896277e-013, 0.999998569, -4.51189823e-012, 0.999998569, -5.32840699e-013, -1, -4.66473214e-012, -3.40820479e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.200000003, 1.1456002))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375541687, -0.121589661, 1.85011864, -6.34202806e-005, 4.76195092e-013, 0.999997139, -5.54160559e-013, 0.999997139, -7.60344316e-013, -1, -8.84668803e-013, -5.42109265e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.256000012, 0.200000003, 0.384000033))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.369916916, 2.35839176, -0.00639343262, -6.70053632e-005, 3.14878548e-007, 1, -1, -5.96450818e-008, -6.70053632e-005, 5.96239929e-008, -1, 3.14882556e-007))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.672000051, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.78545856, -0.370113373, -0.202846527, -1, -2.91119595e-005, -0.000384613872, 0.000384613057, 2.89192758e-005, -1, 2.91230808e-005, -1, -2.89080763e-005))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.0768000111, 0.0896000117, 0.447999448))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.61920011))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00845146179, 0.134407043, 1.60957336, -6.4748041e-005, -6.3638656e-014, 0.999998569, -3.63800266e-012, 0.999998569, -3.0559317e-013, -1, -3.85478368e-012, -6.01289321e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.512000024, 1.61920011, 0.384000033))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0725326538, 1.60959148, -0.00640106201, -2.98303694e-005, 3.14878463e-007, 1, -1, -5.96094196e-008, -2.98303694e-005, 5.96000334e-008, -1, 3.14880253e-007))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Symmetric,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.640000045, 0.384000033, 0.640000045))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.247545242, 0.00640106201, 0.4799757, -6.47458219e-005, -6.3638656e-014, 0.999998569, -3.63800266e-012, 0.999998569, -3.0559317e-013, -1, -3.85478368e-012, -6.01311513e-005))
CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.503547668, 0.00640106201, 1.20689487, -0.000104134786, 2.20283698e-013, 1, -2.54377313e-012, 1, -2.20548514e-013, -1, -2.54379612e-012, -0.000104134786))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 0.704000056))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.256000012))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.479991913, -0.247407913, 0.198429108, 1, 4.16033035e-005, -4.7685171e-007, -4.76891728e-007, 9.65081313e-007, -1, -4.16033035e-005, 1, 9.65104618e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.320000023, 0.320000023, 2.08639956))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.256000012, 0.384000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.127994537, 7.62939453e-006, -0.25599575, 0.500000298, 1.36755893e-011, 0.866025329, -1.15810217e-011, 1, -9.1049026e-012, -0.866025269, -5.47700297e-012, 0.500000298))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 1, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.384000033, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.3754673, 0.134407043, 1.20693207, -3.41913183e-005, 4.47918449e-013, 0.999998569, -4.64334864e-012, 0.999998569, -5.32845794e-013, -1, -4.79617995e-012, -2.9586743e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 0.704000056))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Medium stone grey","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.479966164, -0.247543335, 0.262420654, 1, 4.16032526e-005, 6.01758402e-005, 6.47904744e-005, 9.65080972e-007, -0.999998569, -4.16033727e-005, 0.999998569, 9.62580543e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.243199989, 0.243199989, 1.47199988))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.384000033, 0.200000003, 1.1456002))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.375528336, 0.00640106201, 1.84636974, -0.000123670645, 5.04564869e-013, 0.999998569, -2.03210604e-012, 0.999998569, -5.896105e-013, -1, -2.18498808e-012, -0.000119065939))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Part",Vector3.new(0.200000003, 0.200000003, 1.28000021))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.119522095, 0.134399414, 1.78292942, -4.50793596e-005, 4.19445891e-013, 1, -4.32361742e-012, 1, -4.19640776e-013, -1, -4.3236365e-012, -4.50793596e-005))
CreateMesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.640000105, 0.640000105, 1))
Part=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Medium stone grey","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
Partweld=CreateWeld(m,FakeHandleB,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.479986191, -0.247543335, -0.249576569, 1, 4.16032526e-005, 6.01758402e-005, 6.47904744e-005, 9.65080972e-007, -0.999998569, -4.16033727e-005, 0.999998569, 9.62580543e-007))
CreateMesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.243199989, 0.243199989, 1.47199988))
BarrelB=CreatePart(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,"Institutional white","BarrelB",Vector3.new(0.200000003, 0.200000003, 0.512000024))
BarrelBweld=CreateWeld(m,FakeHandleB,BarrelB,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00651550293, -0.375404358, -2.42294502, 4.16033035e-005, -1, 4.46682229e-008, 4.43546014e-007, -4.46531985e-008, -1, 1, 4.16033035e-005, 4.43542376e-007))
CreateMesh("SpecialMesh",BarrelB,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=18430887",Vector3.new(0, 0, 0),Vector3.new(0.153600022, 0.140799999, 0.447999448))
local lasrs = {}
local lasrspd = 6
local maxTravelDistance = 100
local maxRebounds = 5
function RAY(pos, dir, collidedlist, startpos, endpos, distleft)
collidedlist = collidedlist or {Character}
startpos = startpos or pos
distleft = distleft or dir.unit * dir.magnitude
endpos = endpos or pos + distleft
local ray = Ray.new(pos, distleft)
local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist)
if hitz ~= nil and not hitz.Parent:findFirstChild("Humanoid") then
if hitz.CanCollide == false then
table.insert(collidedlist, hitz)
local newpos = enz
local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude)
if newdistleft then
return RAY(newpos-(dir*0.01), dir, collidedlist, startpos, endpos, newdistleft+(dir*0.01))
end
end
end
return hitz, enz, ray
end
function FindSurface(part, position)
local obj = part.CFrame:pointToObjectSpace(position)
local siz = part.Size/2
for i,v in pairs(Enum.NormalId:GetEnumItems()) do
local vec = Vector3.FromNormalId(v)
local wvec = part.CFrame:vectorToWorldSpace(vec)
local vz = (obj)/(siz*vec)
if (math.abs(vz.X-1) < 0.001 or math.abs(vz.Y-1) < 0.001 or math.abs(vz.Z-1) < 0.001) then
return wvec,vec
end
end
if part.className == "WedgePart" then
local pos = (part.CFrame * CFrame.new(0,part.Size.y/2,part.Size.z/2)).p
local apos = (part.CFrame * CFrame.Angles(-math.atan2(part.CFrame:pointToObjectSpace(pos).y,part.CFrame:pointToObjectSpace(pos).z),0,0) * CFrame.new(0,1,0)).p
local wvec,vec = (apos - part.Position).unit, part.CFrame:pointToObjectSpace(apos)
return wvec,vec
elseif part.className == "Part" and (part.Shape.Name == "Ball" or part.Shape.Name == "Cylinder") then
return (position - part.Position).unit, part.CFrame:vectorToObjectSpace((position - part.Position).unit)
end
end
function Reflect(direction, normal)
return direction - 2 * normal:Dot(direction) * normal
end
function ReflectShot(mouse,asd)
local dir = (mouse.Hit.p - Torso.Position).unit
local tabl
local tablnum = 0
for i, v in pairs(lasrs) do
if not v[1] then
tabl = v
tablnum = i
break
end
end
if not tabl then
tablnum = #lasrs + 1
tabl = {false,nil,nil,0,0,1,{},{},{},{}}
for i = 1, 2 do
for j = 1, 6 do
local p = Instance.new("Part")
p.FormFactor = "Custom"
p.CanCollide = false
p.Anchored = true
p.Locked = true
p.BrickColor = BarrelA.BrickColor
p.TopSurface = 10
p.BottomSurface = 10
p.RightSurface = 10
p.LeftSurface = 10
p.FrontSurface = 10
p.BackSurface = 10
p.Size = Vector3.new(.5,.5,.5)
p.Material = "Neon"
p.Transparency = i == 1 and 0 or 0.6
local mesh = Instance.new("CylinderMesh",p)
table.insert(tabl[6+i],p)
table.insert(tabl[8+i],mesh)
end
end
table.insert(lasrs,tabl)
end
-- isMoving,direction,lastPosition,rebounds,distance,recycleCount,middleLayer,outerLayer
tabl[4],tabl[5] = 0,0
tabl[3] = asd.Position
tabl[2] = dir
tabl[1] = true
end
gun = false
shoot = false
gunidle = false
local GunA = true
local GunB = false
function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
local prt = CreatePart(3, Character, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.1, 0.1, 0.1))
prt.Anchored = true
prt.CFrame = cframe
local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
game:GetService("Debris"):AddItem(prt, 5)
Effects[#Effects + 1] = {
prt,
"Cylinder",
delay,
x3,
y3,
z3
} --part, type, delay
end
function Shoot(asd, spread1, spread2)
local MainPos = asd.Position
local MainPos2 = mouse.Hit.p
local spread = Vector3.new((math.random(-spread1, 0) + math.random()) * spread2, (math.random(-spread1, 0) + math.random()) * spread2, (math.random(-spread1, 0) + math.random()) * spread2) * (asd.Position - mouse.Hit.p).magnitude / 100
local MouseLook = cn((MainPos + MainPos2) / 2, MainPos2 + spread)
num = 30
coroutine.resume(coroutine.create(function(Spreaded)
repeat
wait()
local hit, pos = rayCast(MainPos, MouseLook.lookVector, 10, RootPart.Parent)
local TheHit = mouse.Hit.p
local mag = (MainPos - pos).magnitude
CylinderEffect(BrickColor.new(asd.BrickColor.Color), CFrame.new((MainPos + pos) / 2, pos) * angles(1.57, 0, 0), 3, mag * 5, 3, .5, 0, 1.5, 0.1)
MainPos = MainPos + (MouseLook.lookVector * 10)
num = num - 1
if hit ~= nil then
num = 0
local ref = CreatePart(3, workspace, "Neon", 0, 1, BrickColor.new("New Yeller"), "Reference", Vector3.new())
ref.Anchored = true
ref.CFrame = cn(pos)
damage(hit.Parent:WaitForChild("Torso"), math.random(1,3), math.random(3,5), 5, 1, RootPart)
game:GetService("Debris"):AddItem(ref, 5)
end
until num <= 0
end))
end
function GunStance()
attack=true
gun=true
Humanoid.WalkSpeed = 0
gyro.Parent = RootPart
if GunA == true then
for i=0,1,0.2 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(5), math.rad(-90)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(30), math.rad(90)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(-10)), .25)
RH.C0 = clerp(RH.C0, cn(0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, .8) * angles(math.rad(0), 5*i, math.rad(0)), .75)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
for i=0,1,0.1 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(-90)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(-10)), .25)
RH.C0 = clerp(RH.C0, cn(0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
elseif GunB == true then
for i=0,1,0.2 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-90)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(-5), math.rad(90)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(10)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(90), math.rad(-30), math.rad(-90)), .25)
RH.C0 = clerp(RH.C0, cn(0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, .8) * angles(math.rad(0), 5*i, math.rad(0)), .75)
end
for i=0,1,0.1 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-90)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(90)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(10)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(-90)), .25)
RH.C0 = clerp(RH.C0, cn(0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
end
end
local offset = nil
gunidle=true
while gun==true do
wait()
local gunpos = Vector3.new(mouse.Hit.p.x, Head.Position.Y, mouse.Hit.p.z)
offset = (Torso.Position.y - mouse.Hit.p.y) / 60
local mag = (Torso.Position - mouse.Hit.p).magnitude / 80
offset = offset / mag
if GunA == true and GunB == false then
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(offset, 0, 0), .5)
elseif GunB == true and GunA == false then
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(offset, 0, 0), .5)
end
end
if shoot==true then
gunidle=false
if GunA == true then
so("http://www.roblox.com/asset/?id=199144089", BarrelA, 1, .9)
so("http://www.roblox.com/asset/?id=200633327", BarrelA, 1, 1.2)
so("http://www.roblox.com/asset/?id=200633780", BarrelA, 1, 1.5)
GunA = false
Shoot(BarrelA, 0, 0)
for i=0,1,0.15 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(80)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(5), math.rad(-80)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.7, 0) * angles(math.rad(90), math.rad(60), math.rad(80)), .55)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(-15)), .3)
RH.C0 = clerp(RH.C0, cn(0.6, -2, -.1) * angles(math.rad(5), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, .1) * angles(math.rad(-5), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(20), math.rad(0)), .75)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(30), math.rad(0)), .3)
end
GunB = true
elseif GunB == true then
so("http://www.roblox.com/asset/?id=199144089", BarrelB, 1, .9)
so("http://www.roblox.com/asset/?id=200633327", BarrelB, 1, 1.2)
so("http://www.roblox.com/asset/?id=200633780", BarrelB, 1, 1.5)
GunB = false
Shoot(BarrelB, 0, 0)
for i=0,1,0.15 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-80)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(-5), math.rad(80)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(15)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.7, 0) * angles(math.rad(90), math.rad(-60), math.rad(-80)), .55)
RH.C0 = clerp(RH.C0, cn(0.6, -2, .1) * angles(math.rad(-5), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, -.1) * angles(math.rad(5), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(30), math.rad(0)), .3)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(20), math.rad(0)), .75)
end
GunA = true
end
end
gyro.Parent = nil
Humanoid.WalkSpeed = 12
gun=false
gunidle=false
shoot=false
attack=false
end
function Jikishi()
attack = true
gyro.Parent = RootPart
for i = 0,1,0.1 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(3), math.rad(0), math.rad(0)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(80), math.rad(0), math.rad(10)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(80), math.rad(0), math.rad(-10)), .3)
RH.C0 = clerp(RH.C0, cn(0.55, -2, 0) * angles(math.rad(3), math.rad(0), math.rad(3)), .3)
LH.C0 = clerp(LH.C0, cn(-0.55, -2, 0) * angles(math.rad(3), math.rad(0), math.rad(-3)), .3)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), 10*i, math.rad(0)), .7)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), -10*i, math.rad(0)), .7)
end
for i = 1,2 do
for i = 0,1,0.3 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.5, -.2) * angles(math.rad(90), math.rad(0), math.rad(0)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.4, 0.5, -.2) * angles(math.rad(90), math.rad(0), math.rad(0)), .3)
RH.C0 = clerp(RH.C0, cn(0.55, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(3)), .3)
LH.C0 = clerp(LH.C0, cn(-0.55, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(-3)), .3)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
end
ReflectShot(mouse,BarrelA)
so("http://www.roblox.com/asset/?id=199144089", BarrelA, 1, .9)
so("http://www.roblox.com/asset/?id=200633327", BarrelA, 1, 1.2)
so("http://www.roblox.com/asset/?id=200633780", BarrelA, 1, 1.5)
--so("http://www.roblox.com/asset/?id=360087120", Torso, .5, 1)
for i = 0,1,0.35 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-20)), .4)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(20)), .4)
RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.5, -.4) * angles(math.rad(150), math.rad(0), math.rad(-20)), .4)
LW.C0 = clerp(LW.C0, CFrame.new(-1.4, 0.5, -.4) * angles(math.rad(90), math.rad(0), math.rad(0)), .4)
RH.C0 = clerp(RH.C0, cn(0.55, -2, 0) * angles(math.rad(0), math.rad(20), math.rad(3)), .4)
LH.C0 = clerp(LH.C0, cn(-0.55, -2, 0) * angles(math.rad(0), math.rad(20), math.rad(-3)), .4)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
end
for i = 0,1,0.3 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.5, -.2) * angles(math.rad(90), math.rad(0), math.rad(0)), .3)
LW.C0 = clerp(LW.C0, CFrame.new(-1.4, 0.5, -.2) * angles(math.rad(90), math.rad(0), math.rad(0)), .3)
RH.C0 = clerp(RH.C0, cn(0.55, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(3)), .3)
LH.C0 = clerp(LH.C0, cn(-0.55, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(-3)), .3)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
end
ReflectShot(mouse,BarrelB)
so("http://www.roblox.com/asset/?id=199144089", BarrelB, 1, .9)
so("http://www.roblox.com/asset/?id=200633327", BarrelB, 1, 1.2)
so("http://www.roblox.com/asset/?id=200633780", BarrelB, 1, 1.5)
--so("http://www.roblox.com/asset/?id=360087120", Torso, .5, 1)
for i = 0,1,0.35 do
wait()
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(20)), .4)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(-20)), .4)
RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.5, -.4) * angles(math.rad(90), math.rad(0), math.rad(0)), .4)
LW.C0 = clerp(LW.C0, CFrame.new(-1.4, 0.5, -.4) * angles(math.rad(150), math.rad(0), math.rad(20)), .4)
RH.C0 = clerp(RH.C0, cn(0.55, -2, 0) * angles(math.rad(0), math.rad(-20), math.rad(3)), .4)
LH.C0 = clerp(LH.C0, cn(-0.55, -2, 0) * angles(math.rad(0), math.rad(-20), math.rad(-3)), .4)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), 0, math.rad(0)), .7)
end
end
gyro.Parent = nil
attack = false
end
mouse.Button1Down:connect(function()
if gun==true and shoot==false then
shoot=true
gun=false
end
end)
mouse.KeyDown:connect(function(k)
k = k:lower()
if k=='e' and gun==false and shoot==false and attack==false then
GunStance()
end
if k=='e'and shoot==false then
if gun==true then
gun=false
end
end
if k=='q' and gun==false and shoot==false and attack==false then
Jikishi()
end
end)
inputserv.InputBegan:connect(function(k)
if k.KeyCode == Enum.KeyCode.One and typing == false and cooldown3 >= co1 and stamina >= skill1stam then
elseif k.KeyCode == Enum.KeyCode.Two and typing == false and cooldown3 >= co2 and stamina >= skill2stam then
elseif k.KeyCode == Enum.KeyCode.Three and typing == false and cooldown3 >= co3 and stamina >= skill3stam then
elseif k.KeyCode == Enum.KeyCode.Four and typing == false and cooldown3 >= co4 and stamina >= skill4stam then
end
end)
inputserv.InputBegan:connect(function(k)
if k.KeyCode == Enum.KeyCode.Slash then
local fin = nil
typing = true
fin = inputserv.InputBegan:connect(function(k)
if k.KeyCode == Enum.KeyCode.Return or k.UserInputType == Enum.UserInputType.MouseButton1 then
typing = false
fin:disconnect()
end
end)
end
end)
local ReboundCount = 0
function updateskills()
if cooldown1 <= co1 then
cooldown1 = cooldown1 + 1 / 30
end
if cooldown2 <= co2 then
cooldown2 = cooldown2 + 1 / 30
end
if cooldown3 <= co3 then
cooldown3 = cooldown3 + 1 / 30
end
if cooldown4 <= co4 then
cooldown4 = cooldown4 + 1 / 30
end
if stamina <= maxstamina then
stamina = stamina + recovermana / 30
end
end
game:GetService'RunService'.Heartbeat:connect(function()
updateskills()
gyro.CFrame = CFrame.new(Vector3.new(),(mouse.Hit.p -RootPart.CFrame.p).unit * 100)
healthcover:TweenSize(ud(1 * (Character.Humanoid.Health / Character.Humanoid.MaxHealth), 0, 1, 0), 'Out', 'Quad', .5)
staminacover:TweenSize(ud(1 * (stamina / maxstamina), 0, 1, 0), 'Out', 'Quad', .5)
bar4:TweenSize(ud(1 * (cooldown1 / co1), 0, 1, 0), 'Out', 'Quad', .5)
bar3:TweenSize(ud(1 * (cooldown2 / co2), 0, 1, 0), 'Out', 'Quad', .5)
bar1:TweenSize(ud(1 * (cooldown3 / co3), 0, 1, 0), 'Out', 'Quad', .5)
bar2:TweenSize(ud(1 * (cooldown4 / co4), 0, 1, 0), 'Out', 'Quad', .5)
Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
velocity = RootPart.Velocity.y
sine = sine + change
local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character)
Character.Humanoid.WalkSpeed = 16 * speed.Value
if equipped == true or equipped == false then
if RootPart.Velocity.y > 1 and hit == nil and stun.Value ~= true then
Anim = "Jump"
if attack == false then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(20), math.rad(0), math.rad(0)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(50)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-50)), .25)
RH.C0 = clerp(RH.C0, cn(0.4, -1.5, -.5) * angles(math.rad(-20), math.rad(0), math.rad(-5)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -2, 0) * angles(math.rad(-10), math.rad(0), math.rad(5)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(-170), math.rad(0)), .25)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(-170), math.rad(0)), .25)
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
end
elseif RootPart.Velocity.y < -1 and hit == nil and stun.Value ~= true then
Anim = "Fall"
if attack == false then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(15), math.rad(0), math.rad(0)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(20), math.rad(0), math.rad(0)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(70)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-70)), .25)
RH.C0 = clerp(RH.C0, cn(0.6, -1.5, -.3) * angles(math.rad(0), math.rad(0), math.rad(5)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -1.8, -.2) * angles(math.rad(0), math.rad(0), math.rad(-5)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(-170), math.rad(0)), .25)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(-170), math.rad(0)), .25)
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
end
elseif Torsovelocity < 1 and hit ~= nil and stun.Value ~= true then
Anim = "Idle"
if attack == false then
change = 1
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -0.1+0.1*math.cos(sine/25), -0.1+0.05*math.cos(sine/25)) * angles(math.rad(0), math.rad(0), math.rad(-30)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10+5*math.cos(sine/25)), math.rad(0), math.rad(30)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.4, -.2) * angles(math.rad(50-5*math.cos(sine/25)), math.rad(0), math.rad(10)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.4, 0.4, -.2) * angles(math.rad(50-5*math.cos(sine/25)), math.rad(0), math.rad(-10)), .25)
RH.C0 = clerp(RH.C0, cn(0.7, -1.9-.05*math.cos(sine/25), 0) * angles(math.rad(0), math.rad(30), math.rad(5))* angles(math.rad(-5+1*math.cos(sine/25)), math.rad(0), math.rad(0)), .25)
LH.C0 = clerp(LH.C0, cn(-0.6, -1.9-.05*math.cos(sine/25), 0) * angles(math.rad(0), math.rad(30), math.rad(-3))* angles(math.rad(-3+1*math.cos(sine/25)), math.rad(0), math.rad(0)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
end
elseif Torsovelocity > 2 and Torsovelocity < 18 and hit ~= nil and stun.Value ~= true then
Anim = "Walk"
if attack == false then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(20+1*math.cos(sine/5)), math.rad(0), math.rad(5*math.cos(sine/4.5))), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-10), math.rad(0), math.rad(-5*math.cos(sine/4.5))), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.4, 0.45, 0) * angles(math.rad(-40), math.rad(0), math.rad(20+1*math.cos(sine/5))), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.4, 0.45, 0) * angles(math.rad(-40), math.rad(0), math.rad(-20+1*math.cos(sine/5))), .25)
RH.C0 = clerp(RH.C0, cn(0.55, -2, 1*math.cos(sine/4.5)) * angles(math.rad(-50*math.cos(sine/4.5)), math.rad(0), math.rad(3)), .25)
LH.C0 = clerp(LH.C0, cn(-0.55, -2, -1*math.cos(sine/4.5)) * angles(math.rad(50*math.cos(sine/4.5)), math.rad(0), math.rad(-3)), .25)
FakeHandleAweld.C0 = clerp(FakeHandleAweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(-170), math.rad(0)), .25)
FakeHandleBweld.C0 = clerp(FakeHandleBweld.C0, cn(0, 0, .8) * angles(math.rad(0), math.rad(-170), math.rad(0)), .25)
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
end
elseif Torsovelocity >= 18 and hit ~= nil and stun.Value ~= true then
Anim = "Run"
if attack == false then
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RH.C0 = clerp(RH.C0, cn(0.5, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
LH.C0 = clerp(LH.C0, cn(-0.5, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
end
elseif stun.Value == true then
if attack == false then
Character.Humanoid.WalkSpeed = 0
RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RH.C0 = clerp(RH.C0, cn(0.5, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
LH.C0 = clerp(LH.C0, cn(-0.5, -2, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .25)
RW.C1 = clerp(RW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
LW.C1 = clerp(LW.C1, cn(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0), .3)
end
end
end
if sprint == true and stun.Value ~= true and equipped == false and on == false then
Character.Humanoid.WalkSpeed = 20
elseif sprint == false and stun.Value ~= true then
Character.Humanoid.WalkSpeed = 16
end
if #Effects > 0 then
for e = 1, #Effects do
if Effects[e] ~= nil then
local Thing = Effects[e]
if Thing ~= nil then
local Part = Thing[1]
local Mode = Thing[2]
local Delay = Thing[3]
local IncX = Thing[4]
local IncY = Thing[5]
local IncZ = Thing[6]
if Thing[1].Transparency <= 1 then
if Thing[2] == "Block1" then
Thing[1].CFrame = Thing[1].CFrame * CFrame.FromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
local Mesh = Thing[1].Mesh
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Cylinder" then
local Mesh = Thing[1].Mesh
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Blood" then
local Mesh = Thing[7]
Thing[1].CFrame = Thing[1].CFrame * CFrame.new(0, .5, 0)
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Elec" then
local Mesh = Thing[1].Mesh
Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
elseif Thing[2] == "Disappear" then
Thing[1].Transparency = Thing[1].Transparency + Thing[3]
end
else
Part.Parent = nil
table.remove(Effects, e)
end
end
end
end
end
for _, lasr in pairs(lasrs) do
for i, v in pairs(lasr[9]) do
if lasr[7][i].Parent then
v.Scale = v.Scale + Vector3.new(-0.1,0,-0.1)
lasr[10][i].Scale = lasr[10][i].Scale + Vector3.new(-0.1,0,-0.1)
if v.Scale.x < 0.1 then
lasr[7][i].Parent = nil
lasr[8][i].Parent = nil
end
end
end
if lasr[1] then
local hitz, enz = RAY(lasr[3],lasr[2]*lasrspd)
lasr[5] = lasr[5] + (lasr[3] - enz).magnitude
lasr[7][lasr[6]].Parent = m
lasr[7][lasr[6]].CFrame = CFrame.new((lasr[3] + enz)/2,enz) * CFrame.Angles(math.pi/2,0,0)
lasr[9][lasr[6]].Scale = Vector3.new(0.7,(lasr[3] - enz).magnitude*5,0.7)
lasr[8][lasr[6]].Parent = m
lasr[8][lasr[6]].CFrame = lasr[7][lasr[6]].CFrame
lasr[10][lasr[6]].Scale = Vector3.new(1.3,(lasr[3] - enz).magnitude*5 + 0.02,1.3)
lasr[3] = enz
lasr[6] = lasr[6]%#lasr[7] + 1
if hitz then
lasr[4] = lasr[4] + 1
if lasr[4] == maxRebounds then
lasr[1] = false
so("http://www.roblox.com/asset/?id=200633327", hitz, 1, 2)
damage(hitz.Parent:WaitForChild("Torso"), math.random(5,10), math.random(10,20), 5, 1, RootPart)
print(ReboundCount)
else
local norm = FindSurface(hitz,enz)
lasr[2] = Reflect(lasr[2],norm)
so("http://www.roblox.com/asset/?id=200633327", hitz, 1, 2)
damage(hitz.Parent:WaitForChild("Torso"), math.random(5,10), math.random(10,20), 5, 1, RootPart)
print(ReboundCount)
end
end
if lasr[5] > maxTravelDistance then
lasr[1] = false
end
end
end
end)
|
ITEM.name = "Stoneblood"
ITEM.model ="models/nasca/etherealsrp_artifacts/stoneblood.mdl"
ITEM.description = "Red and green artifact."
ITEM.longdesc = "A reddish formation of compressed fossilized plants, soil and animal debris. Can partially neutralize chemical poisons by absorbing them and reducing overall toxicity level in user's bloodstream. Quite widespread and not very effective as it makes chemical burns fester. It will catch fire when exposed to open flame or even spontaneously combust. Another downside to this artifact is that it will increase the negative effects of psy-waves and is a potent conductor. It also drains energy from user's body. Stone blood will, however, speed up wound recovery due to its organic nature. Rare artifact."
ITEM.width = 1
ITEM.height = 1
ITEM.price = 3250
ITEM.flag = "A"
ITEM.value = ITEM.price*0.5
|
local datatype = {}
datatype.name = "float32"
datatype.id = 0x04
function datatype.default()
return 0
end
function datatype.reader(stream, count)
local floatArray = stream.readInterleavedRbxFloat32(count)
return floatArray
end
function datatype.writer(stream, values)
-- error("writer is not yet implemented for type `"..datatype.name.."`", 2)
stream.writeInterleavedRbxFloat32(values)
end
return datatype
|
resource_manifest_version "77731fab-63ca-442c-a67b-abc70f28dfa5"
description "MsQuerade's Additional Server Synchronization and ACL"
version "1.0.2"
server_scripts {
"common/ext.lua",
"common/vars.lua",
"server/OnCmd.lua",
"server/ACL.lua",
"server/ACLConfig.lua",
"server/additional-sync.lua"
}
client_scripts {
"common/ext.lua",
"common/vars.lua",
"client/config.lua",
"client/additional-sync.lua"
}
|
local isScriptNil = false
local PlrName = "fennybunny"
local Plrs = game:GetService("Players")
local RunService = game:GetService("RunService")
local Content = game:GetService("ContentProvider")
local LP = Plrs.LocalPlayer
local Char = LP.Character
local PlrGui = LP.PlayerGui
local Backpack = LP.Backpack
local Mouse = LP:GetMouse()
local Camera = Workspace.CurrentCamera
local LastCamCF = Camera.CoordinateFrame
local AnimJoints = {}
local Cons = {}
local mDown = false
local Multi = false
local Grabbing = false
local Current = {}
local Alpha = 1
local LightNum = 1
Current.Part = nil
Current.BP = nil
Current.BA = nil
Current.Mass = nil
local LastPart = nil
local Head = Char["Head"]
local Torso = Char["Torso"]
local Humanoid = Char["Humanoid"]
local LA = Char["Left Arm"]
local RA = Char["Right Arm"]
local LL = Char["Left Leg"]
local RL = Char["Right Leg"]
local LS, RS;
local OrigLS = Torso["Left Shoulder"]
local OrigRS = Torso["Right Shoulder"]
for _,v in pairs(Char:GetChildren()) do
if v.Name == ModID then
v:Destroy()
end
end
for _,v in pairs(PlrGui:GetChildren()) do
if v.Name == "PadsGui" then
v:Destroy()
end
end
local ModID = "Pads"
local Objects = {}
local Grav = 196.2
local sin=math.sin
local cos=math.cos
local max=math.max
local min=math.min
local atan2=math.atan2
local random=math.random
local tau = 2 * math.pi
local BodyObjects = {
["BodyVelocity"] = true;
["BodyAngularVelocity"] = true;
["BodyForce"] = true;
["BodyThrust"] = true;
["BodyPosition"] = true;
["RocketPropulsion"] = true;
}
if LP.Name == PlrName and isScriptNil then
script.Parent = nil
end
LP.CameraMode = "Classic"
local Assets = {
}
local LS0, LS1 = OrigLS.C0, OrigLS.C1
local RS0, RS1 = OrigRS.C0, OrigRS.C1
for i,v in pairs(Assets) do
local ID = tostring(Assets[i])
Assets[i] = "http://www.roblox.com/asset/?id=" .. ID
Content:Preload("http://www.roblox.com/asset/?id=" .. ID)
end
function QuaternionFromCFrame(cf)
local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components();
local trace = m00 + m11 + m22 if trace > 0 then
local s = math.sqrt(1 + trace);
local recip = 0.5/s;
return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5;
else
local i = 0;
if m11 > m00 then
i = 1;
end;
if m22 > (i == 0 and m00 or m11) then
i = 2 end if i == 0 then
local s = math.sqrt(m00-m11-m22+1);
local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip;
elseif i == 1 then
local s = math.sqrt(m11-m22-m00+1);
local recip = 0.5/s;
return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip ;
elseif i == 2 then
local s = math.sqrt(m22-m00-m11+1);
local recip = 0.5/s;
return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip;
end;
end;
end;
function QuaternionToCFrame(px, py, pz, x, y, z, w)
local xs, ys, zs = x + x, y + y, z + z;
local wx, wy, wz = w*xs, w*ys, w*zs;
local xx = x*xs;
local xy = x*ys;
local xz = x*zs;
local yy = y*ys;
local yz = y*zs;
local zz = z*zs;
return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
end;
function QuaternionSlerp(a, b, t)
local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4];
local startInterp, finishInterp;
if cosTheta >= 0.0001 then
if (1 - cosTheta) > 0.0001 then
local theta = math.acos(cosTheta);
local invSinTheta = 1/math.sin(theta);
startInterp = math.sin((1-t)*theta)*invSinTheta;
finishInterp = math.sin(t*theta)*invSinTheta;
else
startInterp = 1-t finishInterp = t;
end;
else
if (1+cosTheta) > 0.0001 then
local theta = math.acos(-cosTheta);
local invSinTheta = 1/math.sin(theta);
startInterp = math.sin((t-1)*theta)*invSinTheta;
finishInterp = math.sin(t*theta)*invSinTheta;
else startInterp = t-1 finishInterp = t;
end;
end;
return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp;
end;
function CLerp(a,b,t)
local qa={QuaternionFromCFrame(a)};
local qb={QuaternionFromCFrame(b)};
local ax,ay,az=a.x,a.y,a.z;
local bx,by,bz=b.x,b.y,b.z;
local _t=1-t;
return QuaternionToCFrame(_t*ax+t*bx,_t*ay+t*by,_t*az+t*bz,QuaternionSlerp(qa, qb, t));
end
function GetWeld(weld)
local obj
for i, v in pairs(AnimJoints) do
if v[1] == weld then
obj = v
break
end
end
if not obj then
obj = {weld,NV}
table.insert(AnimJoints,obj)
end
return weld.C0.p, obj[2]
end
function SetWeld(weld, i, loops, origpos, origangle, nextpos, nextangle, override, overrideLower, smooth)
smooth = smooth or 1
local obj
for i, v in pairs(AnimJoints) do
if v[1] == weld then
obj = v
break
end
end
if not obj then
obj = {weld,NV}
table.insert(AnimJoints,obj)
end
local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
local tox,toy,toz = 0,0,0
tox = math.abs(origangle.x - nextangle.x) *perc
toy = math.abs(origangle.y - nextangle.y) *perc
toz = math.abs(origangle.z - nextangle.z) *perc
tox = ((origangle.x > nextangle.x and -tox) or tox)
toy = ((origangle.y > nextangle.y and -toy) or toy)
toz = ((origangle.z > nextangle.z and -toz) or toz)
local tox2,toy2,toz2 = 0,0,0
tox2 = math.abs(origpos.x - nextpos.x) *perc
toy2 = math.abs(origpos.y - nextpos.y) *perc
toz2 = math.abs(origpos.z - nextpos.z) *perc
tox2 = (origpos.x > nextpos.x and -tox2) or tox2
toy2 = (origpos.y > nextpos.y and -toy2) or toy2
toz2 = (origpos.z > nextpos.z and -toz2) or toz2
obj[2] = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
end
function RotateCamera(x, y)
Camera.CoordinateFrame = CFrame.new(Camera.Focus.p) * (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * CFrame.Angles(x, y, 0) * CFrame.new(0, 0, (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude)
end
function GetAngles(cf)
local lv = cf.lookVector
return -math.asin(lv.y), math.atan2(lv.x, -lv.z)
end
local LastCamCF = Camera.CoordinateFrame
function Look()
if AlphaOn == true then
local x, y = GetAngles(LastCamCF:toObjectSpace(Camera.CoordinateFrame))
Camera.CoordinateFrame = LastCamCF
RotateCamera(x * -(Alpha), y * -(Alpha))
LastCamCF = Camera.CoordinateFrame
end
end
function Cor(Func)
local Ok, Err = coroutine.resume(coroutine.create(Func))
if not Ok then
print(Err)
end
end
function Cor2(Func)
local Ok, Err = ypcall(Func)
if not Ok then
print(Err)
end
end
function MakePads()
-- 1 - VTelekinesis
P1 = Instance.new("Model")
P1.Name = ModID
-- 2 - RBase
P2 = Instance.new("Part")
P2.CFrame = CFrame.new(Vector3.new(21.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
P2.FormFactor = Enum.FormFactor.Custom
P2.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
P2.Anchored = true
P2.BrickColor = BrickColor.new("Crimson")
P2.Friction = 0.30000001192093
P2.Shape = Enum.PartType.Block
P2.Name = "RBase"
P2.Parent = P1
-- 3 - Mesh
P3 = Instance.new("CylinderMesh")
P3.Scale = Vector3.new(1, 0.5, 1)
P3.Parent = P2
-- 4 - LBase
P4 = Instance.new("Part")
P4.CFrame = CFrame.new(Vector3.new(18.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
P4.FormFactor = Enum.FormFactor.Custom
P4.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
P4.Anchored = true
P4.BrickColor = BrickColor.new("Crimson")
P4.Friction = 0.30000001192093
P4.Shape = Enum.PartType.Block
P4.Name = "LBase"
P4.Parent = P1
-- 5 - Mesh
P5 = Instance.new("CylinderMesh")
P5.Scale = Vector3.new(1, 0.5, 1)
P5.Parent = P4
-- 6 - RP1
P6 = Instance.new("Part")
P6.CFrame = CFrame.new(Vector3.new(20.8999996, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
P6.FormFactor = Enum.FormFactor.Custom
P6.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
P6.Anchored = true
P6.BrickColor = BrickColor.new("Black")
P6.Friction = 0.30000001192093
P6.Shape = Enum.PartType.Block
P6.Name = "RP1"
P6.Parent = P2
-- 7 - Mesh
P7 = Instance.new("CylinderMesh")
P7.Scale = Vector3.new(1, 0.5, 1)
P7.Parent = P6
-- 8 - RP2
P8 = Instance.new("Part")
P8.CFrame = CFrame.new(Vector3.new(21.1000004, 1.8499999, 11.6999998)) * CFrame.Angles(-0, 0, -0)
P8.FormFactor = Enum.FormFactor.Custom
P8.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
P8.Anchored = true
P8.BrickColor = BrickColor.new("Black")
P8.Friction = 0.30000001192093
P8.Shape = Enum.PartType.Block
P8.Name = "RP2"
P8.Parent = P2
-- 9 - Mesh
P9 = Instance.new("CylinderMesh")
P9.Scale = Vector3.new(1, 0.5, 1)
P9.Parent = P8
-- 10 - RP3
P10 = Instance.new("Part")
P10.CFrame = CFrame.new(Vector3.new(21.3000011, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
P10.FormFactor = Enum.FormFactor.Custom
P10.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
P10.Anchored = true
P10.BrickColor = BrickColor.new("Black")
P10.Friction = 0.30000001192093
P10.Shape = Enum.PartType.Block
P10.Name = "RP3"
P10.Parent = P2
-- 11 - Mesh
P11 = Instance.new("CylinderMesh")
P11.Scale = Vector3.new(1, 0.5, 1)
P11.Parent = P10
-- 12 - LP1
P12 = Instance.new("Part")
P12.CFrame = CFrame.new(Vector3.new(17.8999996, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
P12.FormFactor = Enum.FormFactor.Custom
P12.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
P12.Anchored = true
P12.BrickColor = BrickColor.new("Black")
P12.Friction = 0.30000001192093
P12.Shape = Enum.PartType.Block
P12.Name = "LP1"
P12.Parent = P4
-- 13 - Mesh
P13 = Instance.new("CylinderMesh")
P13.Scale = Vector3.new(1, 0.5, 1)
P13.Parent = P12
-- 14 - LP2
P14 = Instance.new("Part")
P14.CFrame = CFrame.new(Vector3.new(18.1000004, 1.8499999, 11.6999998)) * CFrame.Angles(-0, 0, -0)
P14.FormFactor = Enum.FormFactor.Custom
P14.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
P14.Anchored = true
P14.BrickColor = BrickColor.new("Black")
P14.Friction = 0.30000001192093
P14.Shape = Enum.PartType.Block
P14.Name = "LP2"
P14.Parent = P4
-- 15 - Mesh
P15 = Instance.new("CylinderMesh")
P15.Scale = Vector3.new(1, 0.5, 1)
P15.Parent = P14
-- 16 - LP3
P16 = Instance.new("Part")
P16.CFrame = CFrame.new(Vector3.new(18.3000011, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
P16.FormFactor = Enum.FormFactor.Custom
P16.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
P16.Anchored = true
P16.BrickColor = BrickColor.new("Black")
P16.Friction = 0.30000001192093
P16.Shape = Enum.PartType.Block
P16.Name = "LP3"
P16.Parent = P4
-- 17 - Mesh
P17 = Instance.new("CylinderMesh")
P17.Scale = Vector3.new(1, 0.5, 1)
P17.Parent = P16
P1.Parent = LP.Character
P1:MakeJoints()
return P1
end
weldModel = function(model, unanchor, rooty)
local parts = {}
local function recurse(object)
if object:IsA("BasePart") then
table.insert(parts, object)
end
for _,child in pairs(object:GetChildren()) do
recurse(child)
end
end
recurse(model)
local rootPart = rooty or parts[1]
for _, part in pairs(parts) do
local cframe = rootPart.CFrame:toObjectSpace(part.CFrame)
local weld = Instance.new("Weld")
weld.Part0 = rootPart
weld.Part1 = part
weld.C0 = cframe
weld.Parent = rootPart
end
if unanchor then
for _, part in pairs(parts) do
part.Anchored = false
part.CanCollide = false
end
end
end
weldItem = function(rootPart, Item, TheC0, unanchor, ParentItem)
local cframe = TheC0 or rootPart.CFrame:toObjectSpace(Item.CFrame)
local weld = Instance.new("Weld")
weld.Name = "Weld"
weld.Part0 = rootPart
weld.Part1 = Item
weld.C0 = cframe
weld.Parent = ParentItem and Item or rootPart
if unanchor then
Item.Anchored = false
end
return weld, cframe
end
scaleModel = function(model, scale)
local parts = {}
local function recurse(object)
if object:IsA("BasePart") then
table.insert(parts, object)
end
for _,child in pairs(object:GetChildren()) do
recurse(child)
end
end
recurse(model)
local top, bottom, left, right, back, front
for _, part in pairs(parts) do
if top == nil or top < part.Position.y then top = part.Position.y end
if bottom == nil or bottom > part.Position.y then bottom = part.Position.y end
if left == nil or left > part.Position.x then left = part.Position.x end
if right == nil or right < part.Position.x then right = part.Position.x end
if back == nil or back > part.Position.z then back = part.Position.z end
if front == nil or front < part.Position.z then front = part.Position.z end
end
local middle = Vector3.new( left+right, top+bottom, back+front )/2
local minSize = Vector3.new(0.2, 0.2, 0.2)
for _, part in pairs(parts) do
local foo = part.CFrame.p - middle
local rotation = part.CFrame - part.CFrame.p
local newSize = part.Size*scale
part.FormFactor = "Custom"
part.Size = newSize
part.CFrame = CFrame.new( middle + foo*scale ) * rotation
if newSize.x < minSize.x or newSize.y < minSize.y or newSize.z < minSize.z then
local mesh
for _, child in pairs(part:GetChildren()) do
if child:IsA("DataModelMesh") then
mesh = child
break
end
end
if mesh == nil then
mesh = Instance.new("BlockMesh", part)
end
local oScale = mesh.Scale
local newScale = newSize/minSize * oScale
if 0.2 < newSize.x then newScale = Vector3.new(1 * oScale.x, newScale.y, newScale.z) end
if 0.2 < newSize.y then newScale = Vector3.new(newScale.x, 1 * oScale.y, newScale.z) end
if 0.2 < newSize.z then newScale = Vector3.new(newScale.x, newScale.y, 1 * oScale.z) end
mesh.Scale = newScale
end
end
end
function getMass(Obj, Total)
local newTotal = Total
local returnTotal = 0
if Obj:IsA("BasePart") then
newTotal = newTotal + Objects[Obj]
elseif BodyObjects[Obj.ClassName] then
Obj:Destroy()
end
if Obj:GetChildren() and #Obj:GetChildren() > 0 then
for _,v in pairs(Obj:GetChildren()) do
returnTotal = returnTotal + getMass(v, newTotal)
end
else
returnTotal = newTotal
end
return returnTotal
end
function getTargFromCurrent()
local Current = Current.Part
if Current:IsA("BasePart") then
return Current
elseif Current:findFirstChild("Torso") then
return Current.Torso
else
for _,v in pairs(Current:GetChildren()) do
if v:IsA("BasePart") then
return v
end
end
end
end
function Fire(Part, Vec, Inv)
pcall(function()
Current.BP:Destroy()
Current.BP = nil
end)
pcall(function()
Current.BA:Destroy()
Current.BA = nil
end)
pcall(function()
if Inv then
Part.Velocity = -((Vec - Torso.Position).unit * Grav * 1.1)
else
Part.Velocity = ((Vec - Camera.CoordinateFrame.p).unit * Grav * 1.1)
end
Current.Mass = nil
end)
Reset()
end
function Reset()
LS.Parent = nil
RS.Parent = nil
OrigLS.Parent = Torso
OrigRS.Parent = Torso
OrigLS.C0 = LS0
OrigRS.C0 = RS0
end
function Start()
Cor(function()
repeat wait(1/30) until LP.Character and LP.Character.Parent == Workspace and LP.Character:findFirstChild("Torso")
Char = LP.Character
PlrGui = LP.PlayerGui
Backpack = LP.Backpack
Mouse = LP:GetMouse()
for _,v in pairs(Cons) do
v:disconnect()
end
Cons = {}
Camera = Workspace.CurrentCamera
LastCamCF = Camera.CoordinateFrame
AnimJoints = {}
mDown = false
Multi = false
Grabbing = false
Current = {}
Alpha = 1
Head = Char["Head"]
Torso = Char["Torso"]
Humanoid = Char["Humanoid"]
LA = Char["Left Arm"]
RA = Char["Right Arm"]
LL = Char["Left Leg"]
RL = Char["Right Leg"]
OrigLS = Torso["Left Shoulder"]
OrigRS = Torso["Right Shoulder"]
for _,v in pairs(Char:GetChildren()) do
if v.Name == ModID then
v:Destroy()
end
end
for _,v in pairs(PlrGui:GetChildren()) do
if v.Name == "PadsGui" then
v:Destroy()
end
end
LS = Instance.new("Weld")
RS = Instance.new("Weld")
LS.Name = OrigLS.Name
LS.Part0 = Torso
LS.Part1 = LA
LS.C0 = LS0
LS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
RS.Name = OrigRS.Name
RS.Part0 = Torso
RS.Part1 = RA
RS.C0 = RS0
RS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
local Pads = MakePads()
local LPad = Pads.LBase
local RPad = Pads.RBase
weldModel(LPad, true, LPad)
weldModel(RPad, true, RPad)
local GripWeldL = Instance.new("Weld")
GripWeldL.Name = "GripWeldL"
GripWeldL.Part0 = LA
GripWeldL.Part1 = LPad
GripWeldL.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
GripWeldL.Parent = LA
local GripWeldR = Instance.new("Weld")
GripWeldR.Name = "GripWeldR"
GripWeldR.Part0 = RA
GripWeldR.Part1 = RPad
GripWeldR.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
GripWeldR.Parent = RA
local isParts = false
table.insert(Cons, Mouse.KeyDown:connect(function(Key)
Key = Key:lower()
if Key == "z" then
--Stuff
elseif Key == "f" then
local Current = Current.Part
if Current and Current.Parent ~= nil and not Multi then
Current:BreakJoints()
end
elseif Key == "q" then
if isParts then
isParts = false
for _,v in pairs(Workspace:GetChildren()) do
if v.Name == "MyPartV" and v:IsA("BasePart") then
v:Destroy()
end
end
else
isParts = true
for i = 1, 50 do
local Part = Instance.new("Part")
Part.Color = Color3.new(math.random(), math.random(), math.random())
Part.Transparency = 0
Part.Size = Vector3.new(math.random(1, 3), math.random(1, 3), math.random(1, 3))
Part.Archivable = true
Part.CanCollide = false
Part.Material = "Plastic"
Part.Locked = false
Part.CFrame = Torso.CFrame * CFrame.new(math.random(-15, 15), -1, math.random(-15, 15))
Part.Anchored = true
Part.Name = "MyPartV"
Part.TopSurface = "Smooth"
Part.BottomSurface = "Smooth"
Part.Parent = Workspace
end
end
elseif Key == "e" then
local Targ;
if Current.Part and Current.Part ~= nil then
Targ = getTargFromCurrent()
else
Targ = LastPart
end
if Targ and Targ.Parent ~= nil and not Multi then
local Ex = Instance.new("Explosion", Workspace)
Ex.Position = Targ.CFrame.p
Ex.BlastRadius = 16
Ex.DestroyJointRadiusPercent = 0.5
end
elseif Key == "c" then
if Current.Part and Current.Part.Parent ~= nil and not Multi then
local Part = getTargFromCurrent()
if Part then
Grabbing = false
if Mouse.Hit then
local TargPos = CFrame.new(Camera.CoordinateFrame.p, Mouse.Hit.p) * CFrame.new(0, 0, -1000)
Fire(Part, TargPos.p)
else
Fire(Part, Mouse.Origin.p + Mouse.UnitRay.Direction, true)
end
end
end
end
end))
table.insert(Cons, Mouse.Button1Up:connect(function()
mDown = false
if Grabbing == true and Multi == false then
Grabbing = false
Reset()
end
if Current.Part ~= nil then
LastPart = getTargFromCurrent()
Current = {}
end
end))
local function makeLightning(Par, Start, End, Width, Length, RandomScale, ArcScale, Num1)
local oldParts = {}
for _,v in pairs(Par:GetChildren()) do
v.CFrame = CFrame.new(5e5, 5e5, 5e5)
table.insert(oldParts, v)
end
local Distance = (Start-End).Magnitude
local ArcScale = ArcScale or 1
local RandomScale = RandomScale or 0
local Last = Start
local IterNum = 0
while Par.Parent do
IterNum = IterNum + 1
local New = nil
if (Last-End).Magnitude < Length then
New = CFrame.new(End)
else
if (End-Last).Magnitude < Length*2 then
RandomScale = RandomScale*0.5
ArcScale = ArcScale*0.5
end
local Direct = CFrame.new(Last,End)
New = Direct*CFrame.Angles(math.rad(math.random(-RandomScale/4,RandomScale*ArcScale)),math.rad(math.random(-RandomScale,RandomScale)),math.rad(math.random(-RandomScale,RandomScale)))
New = New*CFrame.new(0,0,-Length)
end
local Trail = nil
if oldParts[IterNum] then
Trail = oldParts[IterNum]
Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Crimson")) or BrickColor.new("Really black")
Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
oldParts[IterNum] = nil
else
Trail = Instance.new("Part")
Trail.Name = "Part"
Trail.FormFactor = "Custom"
Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Crimson")) or BrickColor.new("Really black")
Trail.Transparency = 0
Trail.Anchored = true
Trail.CanCollide = false
Trail.Locked = true
Trail.BackSurface = "SmoothNoOutlines"
Trail.BottomSurface = "SmoothNoOutlines"
Trail.FrontSurface = "SmoothNoOutlines"
Trail.LeftSurface = "SmoothNoOutlines"
Trail.RightSurface = "SmoothNoOutlines"
Trail.TopSurface = "SmoothNoOutlines"
Trail.Material = "Neon"
Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
Trail.Parent = Par
end
Last = New.p
if (Last-End).Magnitude < 1 then
break
end
end
for _,v in pairs(oldParts) do
v:Destroy()
end
end
table.insert(Cons, Mouse.Button1Down:connect(function()
mDown = true
local Targ = Mouse.Target
Cor(function()
if Targ and Objects[Targ] and not Multi then
Grabbing = true
Current.Part = Targ
local Mass = Objects[Targ]
local ForceNum = 0
local Hum = nil
for _,v in pairs(Targ:GetChildren()) do
if BodyObjects[v.ClassName] then
v:Destroy()
end
end
for _,v in pairs(Workspace:GetChildren()) do
if v:findFirstChild("Humanoid") and v:IsAncestorOf(Targ) then
Hum = v.Humanoid
Mass = getMass(v, 0)
Current.Part = v
break
end
end
Current.Mass = Mass
if not Hum then
Targ:BreakJoints()
end
ForceNum = Mass * Grav
Targ.CanCollide = true
Targ.Anchored = false
local BP = Instance.new("BodyPosition")
BP.maxForce = Vector3.new(3 * ForceNum, 3 * ForceNum, 3 * ForceNum)
BP.Parent = Targ
local Ang = Instance.new("BodyAngularVelocity")
Ang.Parent = Targ
Current.BP = BP
Current.BA = Ang
OrigLS.Parent = nil
OrigRS.Parent = nil
LS.Parent = Torso
RS.Parent = Torso
LS.C0 = LS0
RS.C0 = RS0
local DirDot = Mouse.UnitRay.Direction:Dot(Targ.Position - Mouse.Origin.p)
local BPPos = Vector3.new(0, 0, 0)
local Vel = Vector3.new(0, 0, 0)
local Vlev = random() * math.pi
local RPos = Vector3.new(random() * 2 - 1, cos(Vlev), random() * 2 - 1)
local Ball = Instance.new("Part")
Ball.Name = "Ball"
Ball.FormFactor = "Custom"
Ball.Color = Color3.new(255, 0, 0)
Ball.Transparency = 0.3
Ball.Anchored = true
Ball.CanCollide = false
Ball.Locked = true
Ball.BottomSurface, Ball.TopSurface = "Smooth", "Smooth"
Ball.Size = Vector3.new(0.5, 0.5, 0.5)
Ball.CFrame = Torso.CFrame * CFrame.new(0, 1, -3)
Ball.Parent = Char
if Targ.Name == "MyPartV" then
Targ.Name = "MyPartF"
end
local LightMod = Instance.new("Model", Char)
local Mesh = Instance.new("SpecialMesh")
Mesh.MeshType = "Sphere"
Mesh.Parent = Ball
local Size = 1
local Rise = true
while Grabbing and BP and Ang and Targ.Parent ~= nil do
local BPPos = Mouse.Origin.p + Mouse.UnitRay.Direction * DirDot
Ang.angularvelocity = Vel
BP.position = BPPos + RPos
RPos = Vector3.new(max(-1, min(RPos.x + random() * 0.02 - 0.01, 1)), cos(Vlev), max(-1, min(RPos.z + random() * 0.02 - 0.01, 1)))
Vel = Vector3.new(max(-1, min(Vel.x + random() * 0.2 - 0.1, 1)), max(-1, min(Vel.y + random() * 0.2 - 0.1, 1)), max(-1, min(Vel.z + random() * 0.2 - 0.1, 1)))
Vlev = (Vlev + 0.05) % tau
if Hum then
Hum.Sit = true
end
if LA.Parent ~= nil and RA.Parent ~= nil then
local LPos = (LA.CFrame * CFrame.new(0, -1, 0)).p
local RPos = (RA.CFrame * CFrame.new(0, -1, 0)).p
if Rise == true then
if Size < 0.6 then
Size = Size + 0.05
else
Size = Size + 0.1
end
if Size >= 2.2 then
Rise = false
end
else
if Size > 2.1 then
Size = Size - 0.05
else
Size = Size - 0.1
end
if Size <= 0.5 then
Rise = true
end
end
Ball.Size = Vector3.new(Size, Size, Size)
Ball.CFrame = CFrame.new(LPos:Lerp(RPos, 0.5), Targ.Position) * CFrame.new(0, 0, -2.2)
LightNum = LightNum + 1
makeLightning(LightMod, Ball.Position, Targ.Position, 0.2, 4, 50, 1, LightNum)
elseif Ball.Parent ~= nil then
Ball:Destroy()
end
if LS and LS.Parent == Torso then
LS.C0 = CFrame.new(Vector3.new(-1.5, 0.5, 0), Torso.CFrame:pointToObjectSpace((Targ.CFrame or Torso.CFrame * CFrame.new(-1.5, 0.5, 1)).p))
end
if RS and RS.Parent == Torso then
RS.C0 = CFrame.new(Vector3.new(1.5, 0.5, 0), Torso.CFrame:pointToObjectSpace((Targ.CFrame or Torso.CFrame * CFrame.new(1.5, 0.5, 1)).p))
end
RunService.Heartbeat:wait()
end
coroutine.resume(coroutine.create(function()
for i = 0.5, 1, 0.1 do
for i2,v in pairs(LightMod:GetChildren()) do
--v.Light.Range = 6-(i*5)
v.Transparency = i
end
wait(1/30)
end
LightMod:Destroy()
end))
if BP and BP.Parent ~= nil then
BP:Destroy()
end
if Ang and Ang.Parent ~= nil then
Ang:Destroy()
end
pcall(function() Ball:Destroy() end)
end
end)
end))
end)
end
function Add(Obj)
if Obj:IsA("BasePart") and not Objects[Obj] and not (Obj.Name == "Base" and Obj.ClassName == "Part") then
Objects[Obj] = Obj:GetMass()
Obj.Changed:connect(function(P)
if P:lower() == "size" and Objects[Obj] and Obj.Parent ~= nil then
Objects[Obj] = Obj:GetMass()
end
end)
end
end
function Rem(Obj)
if Objects[Obj] then
Objects[Obj] = nil
end
end
function Recursion(Obj)
ypcall(function()
Add(Obj)
if #Obj:GetChildren() > 0 then
for _,v in pairs(Obj:GetChildren()) do
Recursion(v)
end
end
end)
end
Workspace.DescendantAdded:connect(function(Obj)
Add(Obj)
end)
Workspace.DescendantRemoving:connect(function(Obj)
Rem(Obj)
end)
for _,v in pairs(Workspace:GetChildren()) do
Recursion(v)
end
Start()
if LP.Name == PlrName then
LP.CharacterAdded:connect(Start)
end
|
--[[--
@package LHotspot
@filename lhotspot-tray.lua
@version 1.0
@author Díaz Urbaneja Víctor Diego Alejandro <sodomon2@gmail.com>
@date 09.08.2021 12:26:38 -04
]]
function statusicon()
visible = not visible
if visible then
ui.main_window:run()
else
ui.main_window:hide()
end
end
function ui.tray:on_activate()
statusicon()
end
function create_menu(event_button, event_time)
local menu = Gtk.Menu {
Gtk.ImageMenuItem {
label = "Quit",
image = Gtk.Image {
stock = "gtk-quit"
},
on_activate = function()
Gtk.main_quit()
end
}
}
menu:show_all()
menu:popup(nil, nil, nil, event_button, event_time)
end
function ui.tray:on_popup_menu(ev, time)
create_menu(ev, time)
end
|
dofile("common.inc");
local lastChat;
local chatText;
function doit()
askForWindow("Test reading main chat. Hover ATITD window and Press Shift to continue.");
--srSetWindowInvertColorRange(0xFEFEFE, 0xFFFFFF); --E6D1AA);
--srSetWindowBackgroundColorRange(0xE6D1AA,0xFFFFFF);
while 1 do
checkBreak();
chatRead();
local y = 5;
if chatText then
for i = #chatText - 4, #chatText do
if chatText[i] then
lsPrint(5, y, 1, 0.7, 0.7, 0xFFFFFFFF, chatText[i][2]);
y = y + 15;
end
end
end
local creg = findChatRegionReplacement();
srMakeImage("current-region", creg[0], creg[1], creg[2], creg[3], true);
srShowImageDebug("current-region", 5, y + 10, 1, 2);
if lsButtonText(lsScreenX - 110, lsScreenY - 30, z, 100, 0xFFFFFFff, "End script") then
error "Clicked End Script button";
end
lsDoFrame();
lsSleep(50);
end
end
function checkIfMain()
--if not srFindImage("chat/main_chat.png", 7000) then
--return false;
--end
return true;
end
function chatRead()
srReadScreen();
chatText = getChatText();
local onMain = checkIfMain(chatText);
if not onMain then
if not muteSoundEffects then
--lsPlaySound("timer.wav");
end
end
-- Wait for Main chat screen and alert user if its not showing
while not onMain do
checkBreak();
srReadScreen();
chatText = getChatText();
onMain = checkIfMain(chatText);
sleepWithStatus(100, "Looking for Main chat screen", nil, 0.7, "Error Parsing Main Chat");
end
-- Verify chat window is showing minimum 2 lines
while #chatText < 2 do
checkBreak();
srReadScreen();
chatText = getChatText();
sleepWithStatus(500, "Error: We must be able to read at least the last 2 lines of main chat!\n\nCurrently we only see " .. #chatText .. " lines ...\n\nYou can overcome this error by typing ANYTHING in main chat.", nil, 0.7, "Error Parsing Main Chat");
end
if chatText[1][2] ~= lastChat then
lastChat = chatText[1][2];
for i = 1, #chatText do
lsPrintln(chatText[i][2]);
end
end
end
|
local function setup(p)
p:AddControl("Label", { Text = "If these options won't work, try using console (~) or admin mod\nList of CVars can be found in the wand's main menu" })
p:AddControl("Label", { Text = "" })
p:AddControl("Label", { Text = "Global settings" })
-- p:AddControl("CheckBox", { Label = "Disable accuracy decreasing", Command = "TFAStarWars_sv_noaccuracy"})
-- p:AddControl("CheckBox", { Label = "Disable learning (Makes books useless and gives all spells to everyone)", Command = "TFAStarWars_sv_nolearning"})
-- p:AddControl("CheckBox", { Label = "Disable spell learning time", Command = "TFAStarWars_sv_notimer"})
-- p:AddControl("CheckBox", { Label = "Disable throwing NPCs/Players\n(Warning: it will also make spells such as Crucio and Stupefy useless)", Command = "TFAStarWars_sv_nothrowing"})
-- p:AddControl("CheckBox", { Label = "Disable chat spell name saying", Command = "TFAStarWars_sv_nosay"})
-- p:AddControl("CheckBox", { Label = "Spawn casted spells always in the center\nof caster's view", Command = "TFAStarWars_sv_spawncenter"})
-- p:AddControl("CheckBox", { Label = "Give a wand to the player on spawn", Command = "TFAStarWars_sv_givewand"})
p:AddControl("Label", { Text = "" })
p:AddControl("Label", { Text = "Other server settings" })
--p:AddControl("Label", { Text = "Notify: Default animation speed value is 1.0" })
-- local slider = vgui.Create("DNumSlider", p)
-- slider:SetSize(150, 32)
-- slider:SetText("Animation speed")
-- slider:SetMin(0.1)
-- slider:SetMax(10)
-- slider:SetDecimals(1)
-- slider:SetConVar("TFAStarWars_sv_animspeed")
-- p:AddItem(slider)
p:AddControl("Label", { Text = "In debug mode it will print stuff into your console about addon's working and help finding bugs, also it will enable Admin panel in singleplayer" })
p:AddControl("CheckBox", { Label = "Debug mode", Command = "TFAStarWars_sv_debugmode"})
p:AddControl("Label", { Text = "Use it if players don't receive spells when they join your server. It also might help you if it says that Wand might not working correctly when you spawn" })
p:AddControl("CheckBox", { Label = "Use spell loading protection", Command = "TFAStarWars_sv_usesaver"})
local btn = TFAStarWars.VGUI:CreateButton("Update spells for everyone", 0, 0, 150, 30, p, function()
net.Start("TFAStarWars_UpdSpells")
net.SendToServer()
end)
p:AddItem(btn)
end
hook.Add("PopulateToolMenu", "TFAStarWars_options_server", function()
spawnmenu.AddToolMenuOption("Options", "Star Wars Weapon Settings", "TFAStarWars_options_server", "Server", "", "", setup)
end)
TFAStarWars.VGUI.CreateServerOptions = setup
|
local component = require("component")
local event = require("event")
local ecs = require("ECSAPI")
local hologram = component.hologram
local printer = component.printer3d
local gpu = component.gpu
------------------------------------------------------------------------------------------------------------------------
local colors = {
drawingZoneBackground = 0x262626,
toolbarBackground = 0x444444,
}
local xSize, ySize = gpu.getResolution()
local widthOfToolbar = 2
local xToolbar = xSize - widthOfToolbar
local widthOfDrawingZone = xSize - widthOfToolbar
------------------------------------------------------------------------------------------------------------------------
local function drawDrawingZone()
ecs.square(1, 1, xSize, ySize, colors.drawingZoneBackground)
end
local function drawToolbar()
ecs.square(xToolbar, 1, widthOfToolbar, ySize, colors.toolbarBackground)
end
local function drawAll()
drawDrawingZone()
drawToolbar()
end
------------------------------------------------------------------------------------------------------------------------
drawAll()
|
--[[
Copyright (C) 2006-2007 Nymbia
Copyright (C) 2010-2017 Hendrik "Nevcairiel" Leppkes < h.leppkes@gmail.com >
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
local Quartz3 = LibStub("AceAddon-3.0"):NewAddon("Quartz3", "AceConsole-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("Quartz3")
local media = LibStub("LibSharedMedia-3.0")
local db
----------------------------
-- Upvalues
-- GLOBALS: LibStub, QuartzDB
local type, pairs, tonumber = type, pairs, tonumber
local defaults = {
profile = {
modules = { ["*"] = true, ["EnemyCasts"] = false },
hidesamwise = true,
sparkcolor = {1, 1, 1, 0.5},
spelltextcolor = {1, 1, 1},
timetextcolor = {1, 1, 1},
castingcolor = {1.0, 0.49, 0},
channelingcolor = {0.32, 0.3, 1},
completecolor = {0.12, 0.86, 0.15},
failcolor = {1.0, 0.09, 0},
backgroundcolor = {0, 0, 0},
bordercolor = {0, 0, 0},
backgroundalpha = 1,
borderalpha = 1,
casttimeprecision = 1,
},
}
media:Register("statusbar", "BantoBar", "Interface\\Addons\\Quartz\\textures\\BantoBar")
media:Register("statusbar", "Frost", "Interface\\AddOns\\Quartz\\textures\\Frost")
media:Register("statusbar", "Healbot", "Interface\\AddOns\\Quartz\\textures\\Healbot")
media:Register("statusbar", "LiteStep", "Interface\\AddOns\\Quartz\\textures\\LiteStep")
media:Register("statusbar", "Rocks", "Interface\\AddOns\\Quartz\\textures\\Rocks")
media:Register("statusbar", "Runes", "Interface\\AddOns\\Quartz\\textures\\Runes")
media:Register("statusbar", "Xeon", "Interface\\AddOns\\Quartz\\textures\\Xeon")
media:Register("statusbar", "Minimalist", "Interface\\AddOns\\Quartz\\textures\\Minimalist")
media:Register("statusbar", "bebep", "Interface\\Addons\\Quartz\\textures\\bebep")
media:Register("border", "Tooltip enlarged", "Interface\\AddOns\\Quartz\\textures\\Tooltip-BigBorder")
function Quartz3:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("Quartz3DB", defaults, true)
db = self.db.profile
self:SetupOptions()
end
function Quartz3:OnEnable()
if QuartzDB then
QuartzDB = nil
LibStub("AceTimer-3.0").ScheduleTimer(self, function()
self:Print(L["Congratulations! You've just upgraded Quartz from the old Ace2-based version to the new Ace3 version!"])
self:Print(L["Sadly, this also means your configuration was lost. You'll have to reconfigure Quartz using the new options integrated into the Interface Options Panel, quickly accessible with /quartz"])
self:Print(L["Sorry for the inconvenience, and thanks for using Quartz!"])
end, 1)
end
self.db.RegisterCallback(self, "OnProfileChanged", "ApplySettings")
self.db.RegisterCallback(self, "OnProfileCopied", "ApplySettings")
self.db.RegisterCallback(self, "OnProfileReset", "ApplySettings")
media.RegisterCallback(self, "LibSharedMedia_Registered", "ApplySettings")
media.RegisterCallback(self, "LibSharedMedia_SetGlobal", "ApplySettings")
CONFIGMODE_CALLBACKS = CONFIGMODE_CALLBACKS or {}
CONFIGMODE_CALLBACKS["Quartz3"] = function(action)
if action == "ON" then
self:Unlock(false)
elseif action == "OFF" then
self:Lock()
end
end
self:ApplySettings()
end
function Quartz3:ApplySettings()
db = self.db.profile
for k,v in self:IterateModules() do
if self:GetModuleEnabled(k) and not v:IsEnabled() then
self:EnableModule(k)
elseif not self:GetModuleEnabled(k) and v:IsEnabled() then
self:DisableModule(k)
end
if type(v.ApplySettings) == "function" then
v:ApplySettings()
end
end
end
function Quartz3:ToggleLock(showUI)
local func = self.unlock and "Lock" or "Unlock"
self[func](self, showUI)
end
function Quartz3:Unlock(showUI)
self.unlock = true
for k,v in self:IterateModules() do
if v:IsEnabled() and type(v.Unlock) == "function" then
v:Unlock()
end
end
if showUI then
self:ShowUnlockDialog()
end
end
function Quartz3:Lock()
self.unlock = nil
for k,v in self:IterateModules() do
if v:IsEnabled() and type(v.Lock) == "function" then
v:Lock()
end
end
if self.unlock_dialog then self.unlock_dialog:Hide() end
end
function Quartz3:ShowUnlockDialog()
if not self.unlock_dialog then
local f = CreateFrame("Frame", "Quartz3UnlockDialog", UIParent)
f:SetFrameStrata("DIALOG")
f:SetToplevel(true)
f:EnableMouse(true)
f:SetMovable(true)
f:SetClampedToScreen(true)
f:SetWidth(360)
f:SetHeight(110)
f:SetBackdrop{
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background" ,
edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border",
tile = true,
insets = {left = 11, right = 12, top = 12, bottom = 11},
tileSize = 32,
edgeSize = 32,
}
f:SetPoint("TOP", 0, -50)
f:Hide()
f:SetScript('OnShow', function() PlaySound(SOUNDKIT and SOUNDKIT.IG_MAINMENU_OPTION or 'igMainMenuOption') end)
f:SetScript('OnHide', function() PlaySound(SOUNDKIT and SOUNDKIT.GS_TITLE_OPTION_EXIT or 'gsTitleOptionExit') end)
f:RegisterForDrag('LeftButton')
f:SetScript('OnDragStart', function(f) f:StartMoving() end)
f:SetScript('OnDragStop', function(f) f:StopMovingOrSizing() end)
local header = f:CreateTexture(nil, "ARTWORK")
header:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header")
header:SetWidth(256); header:SetHeight(64)
header:SetPoint("TOP", 0, 12)
local title = f:CreateFontString("ARTWORK")
title:SetFontObject("GameFontNormal")
title:SetPoint("TOP", header, "TOP", 0, -14)
title:SetText(L["Quartz3"])
local desc = f:CreateFontString("ARTWORK")
desc:SetFontObject("GameFontHighlight")
desc:SetJustifyV("TOP")
desc:SetJustifyH("LEFT")
desc:SetPoint("TOPLEFT", 18, -32)
desc:SetPoint("BOTTOMRIGHT", -18, 48)
desc:SetText(L["Bars unlocked. Move them now and click Lock when you are done."])
local lockBars = CreateFrame("CheckButton", "Quartz3UnlockDialogLock", f, "OptionsButtonTemplate")
getglobal(lockBars:GetName() .. "Text"):SetText(L["Lock"])
lockBars:SetScript("OnClick", function(self)
Quartz3:Lock()
LibStub("AceConfigRegistry-3.0"):NotifyChange("Quartz3")
end)
--position buttons
lockBars:SetPoint("BOTTOMRIGHT", -14, 14)
self.unlock_dialog = f
end
self.unlock_dialog:Show()
end
local copyExclude = {
x = true,
y = true,
}
function Quartz3:CopySettings(from, to)
for k,v in pairs(from) do
if to[k] and not copyExclude[k] and type(v) ~= "table" then
to[k] = v
end
end
end
function Quartz3:GetModuleEnabled(module)
return db.modules[module]
end
function Quartz3:SetModuleEnabled(module, value)
local old = db.modules[module]
db.modules[module] = value
if old ~= value then
if value then
self:EnableModule(module)
else
self:DisableModule(module)
end
end
end
function Quartz3:Merge(source, target)
if type(target) ~= "table" then target = {} end
for k,v in pairs(source) do
if type(v) == "table" then
target[k] = self:Merge(v, target[k])
elseif not target[k] then
target[k] = v
end
end
return target
end
Quartz3.Util = {}
function Quartz3.Util.TimeFormat(num, isCastTime)
if num <= 10 or (isCastTime and num <= 60) then
return ("%%.%df"):format(db.casttimeprecision), num
elseif num <= 60 then
return "%d", num
elseif num <= 3600 then
return "%d:%02d", num / 60, num % 60
else
return "%d:%02d", num / 3600, (num % 3600) / 60
end
end
|
--[[
Variables
]]
local TwitterPopups = true
--[[
Functions
]]
local function loadTwitter()
local name = "@" .. exports["caue-base"]:getChar("first_name") .. "_" .. exports["caue-base"]:getChar("last_name")
local twitter = RPC.execute("caue-phone:getTwitter")
SendNUIMessage({
openSection = "twatter",
twats = twitter,
name = name,
})
end
--[[
Events
]]
RegisterNetEvent("caue-phone:updateTwitter")
AddEventHandler("caue-phone:updateTwitter", function(message)
if not hasPhone() then return end
local name = "@" .. exports["caue-base"]:getChar("first_name") .. "_" .. exports["caue-base"]:getChar("last_name")
if string.find(message["message"], name) then
if message["name"] ~= name then
SendNUIMessage({
openSection = "newtweet"
})
end
if phoneNotifications then
PlaySound(-1, "Event_Start_Text", "GTAO_FM_Events_Soundset", 0, 0, 1)
TriggerEvent("DoLongHudText", "Você acabou de ser mencionado em um tweet no seu celular")
end
end
phoneNotification("fab fa-twitter", message["name"], message["message"], 5000)
end)
--[[
NUI
]]
RegisterNUICallback("btnTwatter", function()
loadTwitter()
end)
RegisterNUICallback("newTwatSubmit", function(data, cb)
local message = data["twat"]
local image = data["image"]
local time = data["time"]
if not message or not time then return end
local name = "@" .. exports["caue-base"]:getChar("first_name") .. "_" .. exports["caue-base"]:getChar("last_name")
local update = RPC.execute("caue-phone:addTwitter", name, message, image, time)
if update then
loadTwitter()
end
end)
RegisterNUICallback("btnNotifyToggle", function(data, cb)
TwitterPopups = not TwitterPopups
if TwitterPopups then
TriggerEvent("DoLongHudText", "Pop-ups Ativados")
else
TriggerEvent("DoLongHudText", "Pop-ups Desativados")
end
end)
|
-- # Stub implementation for NodeMCU i2c module
--
-- https://nodemcu.readthedocs.io/en/master/en/modules/i2c/
--
-- Only part of the module has been implemented.
local i2c = {
SLOW="SLOW",
TRANSMITTER="TRANSMITTER",
RECEIVER="RECEIVER"
}
function i2c.setup(id, pinSDA, pinSCL, speed)
assert(id == 0)
return 1
end
function i2c.start(id)
assert(id == 0)
end
function i2c.address(id, device_addr, direction)
assert(id == 0)
return direction == i2c.TRANSMITTER -- allow to write
end
function i2c.read(id, len)
assert(id == 0)
assert(len == 8)
return "12345678"
end
function i2c.write(id, data)
assert(id == 0)
end
function i2c.stop(id)
assert(id == 0)
end
return i2c
|
return {
id = "TACT50002",
mode = 2,
once = true,
scripts = {
{
stopbgm = true,
mode = 1,
sequence = {
{
"",
0.2
}
},
signDate = {
"8月9日 凌晨",
0.2,
{
600,
-480
}
}
},
{
dir = 1,
side = 2,
blackBg = true,
say = "硝烟散去之后,海面恢复了平静。在芝加哥的掩护下,巴格莱得以逃脱,代价是芝加哥承受了{namecode:54}和{namecode:56}的火力,最终不得不撤退,而逃脱的巴格莱区区一艘驱逐成不了气候…",
typewriter = {
speed = 0.05,
speedUp = 0.01
}
},
{
actor = 303040,
side = 2,
nameColor = "#a9f548",
actorName = "{namecode:56}",
say = "虽然让她们逃掉了,不过这样的战果应该可以了吧?这一片好像没有敌人了。",
typewriter = {
speed = 0.05,
speedUp = 0.01
},
painting = {
alpha = 0.3,
time = 1
}
},
{
actor = 303020,
nameColor = "#a9f548",
side = 0,
actorName = "{namecode:54}",
say = "嗯,本来这次组成舰队就十分仓促,{namecode:41}和{namecode:37}还有{namecode:153}的战斗力有限,敌人的综合兵力也远超我们,不能给他们反应的时间。",
paintingFadeOut = {
time = 0.5,
side = 1
},
typewriter = {
speed = 0.05,
speedUp = 0.01
},
painting = {
alpha = 0.3,
time = 1
}
},
{
actor = 303020,
side = 0,
nameColor = "#a9f548",
actorName = "{namecode:54}",
say = "而且,瓜岛对现在的我们来说是必不可少的。",
typewriter = {
speed = 0.05,
speedUp = 0.01
},
painting = {
alpha = 0.3,
time = 1
}
},
{
dir = 1,
side = 2,
say = "{namecode:54}扶了一下眼镜,看向瓜岛方向,本应属于己方的即将竣工的机场,此时却落在了敌人的手里……",
typewriter = {
speed = 0.05,
speedUp = 0.01
}
},
{
actor = 303040,
side = 1,
nameColor = "#a9f548",
actorName = "{namecode:56}",
say = "是是,我知道的,当务之急是SN作战。",
typewriter = {
speed = 0.05,
speedUp = 0.01
},
painting = {
alpha = 0.3,
time = 1
}
},
{
actor = 303020,
side = 0,
nameColor = "#a9f548",
actorName = "{namecode:54}",
say = "知道的话就不要磨蹭了,{namecode:69}她们已经去攻击北边的舰队了,我们也赶快跟过去吧。",
typewriter = {
speed = 0.05,
speedUp = 0.01
},
painting = {
alpha = 0.3,
time = 1
}
}
}
}
|
data:extend(
{
{
type = "font",
name = "sla-semibold-outline",
from = "default-semibold",
size = 18,
border = true,
border_color = {0, 0, 0},
},
})
local styles = data.raw["gui-style"].default
local safeGreenColor = {220/255, 255/255, 200/255}
styles["sla_titlebar_drag_handle"] = {
type = "empty_widget_style",
parent = "draggable_space",
left_margin = 4,
right_margin = 4,
height = 24,
horizontally_stretchable = "on",
}
styles["sla_signal_content_frame"] = {
type = "frame_style",
parent = "inside_shallow_frame_with_padding",
vertically_stretchable = "on",
vertical_align = "center",
}
styles["sla_content_frame"] = {
type = "frame_style",
parent = "inside_shallow_frame_with_padding",
vertically_stretchable = "on",
vertical_align = "center",
top_padding = 0,
bottom_padding = 0,
}
styles["sla_content_flow"] = {
type = "vertical_flow_style",
vertically_stretchable = "on",
vertical_align = "center",
padding = 0,
}
styles["sla_deep_frame"] = {
type = "frame_style",
parent = "deep_frame_in_shallow_frame",
vertically_stretchable = "off",
horizontally_stretchable = "off",
top_margin = 8,
left_margin = 8,
right_margin = 8,
bottom_margin = 4,
}
styles["sla_cam"] = {
type = "camera_style",
width=250,
height=250,
effect = "compilatron-hologram",
-- fun fact: setting effect_opacity < 1 results in making the compilatron-hologram effect wobble like crazy
}
styles["sla_minimap"] = {
type = "minimap_style",
width=250,
height=250,
}
styles["sla_preview"] = {
type = "empty_widget_style",
width=250,
height=250,
}
styles["sla_line"] = {
type = "line_style",
top_margin = 4,
}
styles["sla_bold_label"] = {
type = "label_style",
parent = "bold_label",
bottom_margin = 4,
}
styles["sla_signal_textfield"] = {
type = "textbox_style",
width = 80,
}
styles["sla_signal_textfield_tempdisable"] = {
type = "textbox_style",
width = 80,
parent="console_input_textfield",
font = "default",
}
styles["sla_label_frame_disabled"] = {
type = "frame_style",
parent = "bordered_frame",
vertically_stretchable = "off",
horizontally_stretchable = "off",
right_padding = 5,
left_padding = 5,
top_padding = 3,
bottom_padding = 3,
}
styles["sla_signal_label_disabled"] = {
type = "label_style",
width = 62,
}
styles["sla_circuit_icon"] = {
type = "image_style",
size = 24,
}
styles["sla_safe_frame"] = {
type = "frame_style",
parent = "unlocked_achievement_frame",
width = 250,
padding = 0,
left_padding = 4,
top_margin = 4,
left_margin = 8,
right_margin = 8,
}
styles["sla_safe_label"] = {
type = "label_style",
font = "default-large-semibold",
parent = "achievement_percent_label",
font_color = safeGreenColor,
}
styles["sla_warn_frame"] = {
type = "frame_style",
parent = "locked_achievement_frame",
width = 250,
padding = 0,
left_padding = 4,
top_margin = 4,
left_margin = 8,
right_margin = 8,
}
styles["sla_warn_label"] = {
type = "label_style",
font = "default-large-semibold",
parent = "orange_label",
}
styles["sla_alarm_frame"] = {
type = "frame_style",
parent = "failed_achievement_frame",
width = 250,
padding = 0,
left_padding = 4,
top_margin = 4,
left_margin = 8,
right_margin = 8,
}
styles["sla_alarm_label"] = {
type = "label_style",
font = "sla-semibold-outline",
font_color = {1, 0, 0},
parent = "bold_red_label",
}
styles["sla_no_power_frame"] = {
type = "frame_style",
parent = "map_details_frame",
width = 250,
padding = 4,
left_padding = 8,
top_margin = 4,
left_margin = 8,
right_margin = 8,
}
styles["sla_no_power_label"] = {
type = "label_style",
font = "default-large-semibold",
parent = "tooltip_heading_label_category",
}
|
return request('expr_list')
|
local cURL = require "cURL"
-- Stream class
local Stream = {} do
Stream.__index = Stream
function Stream:new(ch, length)
local o = setmetatable({}, self)
o._len = length
o._ch = ch
o._pos = 0
o._step = 7
return o
end
function Stream:length()
return self._len
end
function Stream:read()
local n = self._len - self._pos
if n <= 0 then return '' end -- eof
if n > self._step then n = self._step end
self._pos = self._pos + n
return self._ch:rep(n)
end
end
-- returns size and reader
local function make_stream(ch, n, m)
local size = n * m
local i = -1
return size, function()
i = i + 1
if i < m then
return (tostring(ch)):rep(n - 2) .. '\r\n'
end
return nil
end
end
local length, stream = make_stream("a", 10, 4)
c = cURL.easy{
url = "http://posttestserver.com/post.php",
-- url = "http://httpbin.org/post",
post = true,
httppost = cURL.form{
-- file form filesystem
name01 = {
file = "post_form.lua",
type = "text/plain",
name = "post.lua",
},
-- file form string
name02 = {
data = "<html><bold>bold</bold></html>",
name = "dummy.html",
type = "text/html",
},
-- file form stream object
name03 = {
stream = Stream:new('8', 25),
name = "stream1.txt",
type = "text/plain",
headers = {
"X-Test-Char : 8",
"X-Test-length : 25",
}
},
-- file form stream function
name04 = {
stream = stream,
length = length,
name = "stream2.txt",
type = "text/plain",
},
},
}
c:perform()
|
require 'Chess'
function Server_AdvanceTurn_Order(game, order, result, skipThisOrder, addNewOrder)
local standing = game.ServerGame.LatestTurnStanding;
--If it's not our turn, skip the order.
--TODO maybe make this always support premoves. Now it will only work, if the move order align
if (myTurn(order.From) and order.proxyType == 'GameOrderAttackTransfer')then
makeMove(standing,game,order,result)
else
skipThisOrder(WL.ModOrderControl.SkipAndSupressSkippedMessage)
end;
end
function placeholder()
if (game.Game.NumberOfTurns == 2) then
--For all territores
for _, territory in pairs(standing.Territories) do
-- print('************')
local connected = game.Map.Territories[territory.ID].Name .. " : ";
--For all connections
for _, connID in pairs (game.Map.Territories[territory.ID].ConnectedTo)do
connected = connected .. (game.Map.Territories[connID.ID].Name .. " ")
end
-- print(connected);
end
end;
end;
|
-- This file is automatically generated, do not edit!
-- Path of Building
--
-- Dexterity support gems
-- Skill data (c) Grinding Gear Games
--
local skills, mod, flag, skill = ...
skills["SupportAddedColdDamage"] = {
name = "Added Cold Damage",
description = "Supports any skill that hits enemies.",
color = 2,
baseEffectiveness = 0.57270002365112,
incrementalEffectiveness = 0.03770000115037,
support = true,
requireSkillTypes = { 1, 10, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "cold_damage_+%", 0.5 },
},
stats = {
"global_minimum_added_cold_damage",
"global_maximum_added_cold_damage",
},
statInterpolation = { 3, 3, },
statLevels = {
[1] = { 0.80000001192093, 1.2000000476837, },
[2] = { 0.80000001192093, 1.2000000476837, },
[3] = { 0.80000001192093, 1.2000000476837, },
[4] = { 0.80000001192093, 1.2000000476837, },
[5] = { 0.80000001192093, 1.2000000476837, },
[6] = { 0.80000001192093, 1.2000000476837, },
[7] = { 0.80000001192093, 1.2000000476837, },
[8] = { 0.80000001192093, 1.2000000476837, },
[9] = { 0.80000001192093, 1.2000000476837, },
[10] = { 0.80000001192093, 1.2000000476837, },
[11] = { 0.80000001192093, 1.2000000476837, },
[12] = { 0.80000001192093, 1.2000000476837, },
[13] = { 0.80000001192093, 1.2000000476837, },
[14] = { 0.80000001192093, 1.2000000476837, },
[15] = { 0.80000001192093, 1.2000000476837, },
[16] = { 0.80000001192093, 1.2000000476837, },
[17] = { 0.80000001192093, 1.2000000476837, },
[18] = { 0.80000001192093, 1.2000000476837, },
[19] = { 0.80000001192093, 1.2000000476837, },
[20] = { 0.80000001192093, 1.2000000476837, },
[21] = { 0.80000001192093, 1.2000000476837, },
[22] = { 0.80000001192093, 1.2000000476837, },
[23] = { 0.80000001192093, 1.2000000476837, },
[24] = { 0.80000001192093, 1.2000000476837, },
[25] = { 0.80000001192093, 1.2000000476837, },
[26] = { 0.80000001192093, 1.2000000476837, },
[27] = { 0.80000001192093, 1.2000000476837, },
[28] = { 0.80000001192093, 1.2000000476837, },
[29] = { 0.80000001192093, 1.2000000476837, },
[30] = { 0.80000001192093, 1.2000000476837, },
[31] = { 0.80000001192093, 1.2000000476837, },
[32] = { 0.80000001192093, 1.2000000476837, },
[33] = { 0.80000001192093, 1.2000000476837, },
[34] = { 0.80000001192093, 1.2000000476837, },
[35] = { 0.80000001192093, 1.2000000476837, },
[36] = { 0.80000001192093, 1.2000000476837, },
[37] = { 0.80000001192093, 1.2000000476837, },
[38] = { 0.80000001192093, 1.2000000476837, },
[39] = { 0.80000001192093, 1.2000000476837, },
[40] = { 0.80000001192093, 1.2000000476837, },
},
baseMods = {
mod("ManaCost", "MORE", 30),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportAdditionalAccuracy"] = {
name = "Additional Accuracy",
description = "Supports attack skills.",
color = 2,
support = true,
requireSkillTypes = { 1, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "accuracy_rating_+%", 1 },
},
stats = {
"accuracy_rating",
},
statInterpolation = { 1, },
statLevels = {
[1] = { 74, },
[2] = { 100, },
[3] = { 127, },
[4] = { 157, },
[5] = { 190, },
[6] = { 230, },
[7] = { 290, },
[8] = { 350, },
[9] = { 400, },
[10] = { 453, },
[11] = { 528, },
[12] = { 586, },
[13] = { 645, },
[14] = { 707, },
[15] = { 772, },
[16] = { 840, },
[17] = { 887, },
[18] = { 934, },
[19] = { 983, },
[20] = { 1034, },
[21] = { 1085, },
[22] = { 1138, },
[23] = { 1191, },
[24] = { 1246, },
[25] = { 1301, },
[26] = { 1358, },
[27] = { 1415, },
[28] = { 1474, },
[29] = { 1533, },
[30] = { 1594, },
[31] = { 1624, },
[32] = { 1655, },
[33] = { 1686, },
[34] = { 1718, },
[35] = { 1750, },
[36] = { 1781, },
[37] = { 1814, },
[38] = { 1846, },
[39] = { 1878, },
[40] = { 1911, },
},
baseMods = {
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportBlind"] = {
name = "Blind",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "blind_duration_+%", 1 },
},
stats = {
"global_chance_to_blind_on_hit_%",
"blind_duration_+%",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 10, 0, },
[2] = { 10, 2, },
[3] = { 10, 4, },
[4] = { 10, 6, },
[5] = { 10, 8, },
[6] = { 10, 10, },
[7] = { 10, 12, },
[8] = { 10, 14, },
[9] = { 10, 16, },
[10] = { 10, 18, },
[11] = { 10, 20, },
[12] = { 10, 22, },
[13] = { 10, 24, },
[14] = { 10, 26, },
[15] = { 10, 28, },
[16] = { 10, 30, },
[17] = { 10, 32, },
[18] = { 10, 34, },
[19] = { 10, 36, },
[20] = { 10, 38, },
[21] = { 10, 40, },
[22] = { 10, 42, },
[23] = { 10, 44, },
[24] = { 10, 46, },
[25] = { 10, 48, },
[26] = { 10, 50, },
[27] = { 10, 52, },
[28] = { 10, 54, },
[29] = { 10, 56, },
[30] = { 10, 58, },
[31] = { 10, 59, },
[32] = { 10, 60, },
[33] = { 10, 61, },
[34] = { 10, 62, },
[35] = { 10, 63, },
[36] = { 10, 64, },
[37] = { 10, 65, },
[38] = { 10, 66, },
[39] = { 10, 67, },
[40] = { 10, 68, },
},
baseMods = {
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportBlockReduction"] = {
name = "Block Chance Reduction",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { 12, },
excludeSkillTypes = { },
qualityStats = {
{ "global_reduce_enemy_block_%", 0.25 },
},
stats = {
"support_reduce_enemy_block_and_spell_block_%",
"support_reduce_enemy_dodge_and_spell_dodge_%",
"support_overpowered_base_duration_ms",
"apply_overpowered_on_enemy_block_reduced_block_and_spell_block_%",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 10, 20, 4000, 5, },
[2] = { 11, 20, 4000, 5, },
[3] = { 11, 21, 4000, 5, },
[4] = { 12, 21, 4000, 5, },
[5] = { 12, 22, 4000, 5, },
[6] = { 13, 22, 4000, 5, },
[7] = { 13, 23, 4000, 5, },
[8] = { 14, 23, 4000, 5, },
[9] = { 14, 24, 4000, 5, },
[10] = { 15, 24, 4000, 5, },
[11] = { 15, 25, 4000, 5, },
[12] = { 16, 25, 4000, 5, },
[13] = { 16, 26, 4000, 5, },
[14] = { 17, 26, 4000, 5, },
[15] = { 17, 27, 4000, 5, },
[16] = { 18, 27, 4000, 5, },
[17] = { 18, 28, 4000, 5, },
[18] = { 19, 28, 4000, 5, },
[19] = { 19, 29, 4000, 5, },
[20] = { 20, 29, 4000, 5, },
[21] = { 20, 30, 4000, 5, },
[22] = { 21, 30, 4000, 5, },
[23] = { 21, 31, 4000, 5, },
[24] = { 22, 31, 4000, 5, },
[25] = { 22, 32, 4000, 5, },
[26] = { 23, 32, 4000, 5, },
[27] = { 23, 33, 4000, 5, },
[28] = { 24, 33, 4000, 5, },
[29] = { 24, 34, 4000, 5, },
[30] = { 25, 34, 4000, 5, },
[31] = { 25, 34, 4000, 5, },
[32] = { 25, 35, 4000, 5, },
[33] = { 26, 35, 4000, 5, },
[34] = { 26, 35, 4000, 5, },
[35] = { 26, 35, 4000, 5, },
[36] = { 27, 36, 4000, 5, },
[37] = { 27, 36, 4000, 5, },
[38] = { 27, 36, 4000, 5, },
[39] = { 28, 36, 4000, 5, },
[40] = { 28, 37, 4000, 5, },
},
baseMods = {
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportCastOnCrit"] = {
name = "Cast On Critical Strike",
description = "Must support both an attack skill and a spell skill to work. The attack skill will trigger a spell when it critically strikes an enemy. Cannot support totems, traps, or mines. Vaal skills, channelling skills, and skills that reserve mana cannot be triggered.",
color = 2,
support = true,
requireSkillTypes = { 1, 36, },
addSkillTypes = { 42, },
excludeSkillTypes = { 37, 41, 30, 15, 61, },
statMap = {
["support_cast_on_crit_spell_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Spell),
},
},
qualityStats = {
{ "critical_strike_chance_+%", 1 },
},
stats = {
"cast_linked_spells_on_attack_crit_%",
"support_cast_on_crit_spell_damage_+%_final",
"spell_uncastable_if_triggerable",
"socketed_triggered_skills_use_weapon_attack_time_for_pvp_scaling",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 100, 20, nil, nil, },
[2] = { 100, 21, nil, nil, },
[3] = { 100, 22, nil, nil, },
[4] = { 100, 23, nil, nil, },
[5] = { 100, 24, nil, nil, },
[6] = { 100, 25, nil, nil, },
[7] = { 100, 26, nil, nil, },
[8] = { 100, 27, nil, nil, },
[9] = { 100, 28, nil, nil, },
[10] = { 100, 29, nil, nil, },
[11] = { 100, 30, nil, nil, },
[12] = { 100, 31, nil, nil, },
[13] = { 100, 32, nil, nil, },
[14] = { 100, 33, nil, nil, },
[15] = { 100, 34, nil, nil, },
[16] = { 100, 35, nil, nil, },
[17] = { 100, 36, nil, nil, },
[18] = { 100, 37, nil, nil, },
[19] = { 100, 38, nil, nil, },
[20] = { 100, 39, nil, nil, },
[21] = { 100, 40, nil, nil, },
[22] = { 100, 41, nil, nil, },
[23] = { 100, 42, nil, nil, },
[24] = { 100, 43, nil, nil, },
[25] = { 100, 44, nil, nil, },
[26] = { 100, 45, nil, nil, },
[27] = { 100, 46, nil, nil, },
[28] = { 100, 47, nil, nil, },
[29] = { 100, 48, nil, nil, },
[30] = { 100, 49, nil, nil, },
[31] = { 100, 49, nil, nil, },
[32] = { 100, 50, nil, nil, },
[33] = { 100, 50, nil, nil, },
[34] = { 100, 51, nil, nil, },
[35] = { 100, 51, nil, nil, },
[36] = { 100, 52, nil, nil, },
[37] = { 100, 52, nil, nil, },
[38] = { 100, 53, nil, nil, },
[39] = { 100, 53, nil, nil, },
[40] = { 100, 54, nil, nil, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
skill("cooldown", 0.15),
skill("showAverage", true, { type = "SkillType", skillType = SkillType.TriggerableSpell }),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportCastOnDeath"] = {
name = "Cast on Death",
description = "Each supported spell skill will be triggered when you die. Cannot support skills used by totems, traps, or mines. Vaal skills, channelling skills, and skills that reserve mana cannot be triggered.",
color = 2,
support = true,
requireSkillTypes = { 36, },
addSkillTypes = { 42, },
excludeSkillTypes = { 9, 37, 41, 30, 44, 61, },
statMap = {
["area_of_effect_+%_while_dead"] = {
mod("AreaOfEffect", "INC", nil),
},
["cast_on_death_damage_+%_final_while_dead"] = {
mod("Damage", "MORE", nil),
},
},
qualityStats = {
{ "area_of_effect_+%_while_dead", 3 },
},
stats = {
"cast_on_death_%",
"cast_on_death_damage_+%_final_while_dead",
"spell_uncastable_if_triggerable",
"spell_only_castable_on_death",
"base_skill_show_average_damage_instead_of_dps",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 100, 0, nil, nil, nil, },
[2] = { 100, 16, nil, nil, nil, },
[3] = { 100, 32, nil, nil, nil, },
[4] = { 100, 48, nil, nil, nil, },
[5] = { 100, 64, nil, nil, nil, },
[6] = { 100, 80, nil, nil, nil, },
[7] = { 100, 96, nil, nil, nil, },
[8] = { 100, 112, nil, nil, nil, },
[9] = { 100, 128, nil, nil, nil, },
[10] = { 100, 144, nil, nil, nil, },
[11] = { 100, 160, nil, nil, nil, },
[12] = { 100, 176, nil, nil, nil, },
[13] = { 100, 192, nil, nil, nil, },
[14] = { 100, 208, nil, nil, nil, },
[15] = { 100, 224, nil, nil, nil, },
[16] = { 100, 240, nil, nil, nil, },
[17] = { 100, 256, nil, nil, nil, },
[18] = { 100, 272, nil, nil, nil, },
[19] = { 100, 288, nil, nil, nil, },
[20] = { 100, 304, nil, nil, nil, },
[21] = { 100, 320, nil, nil, nil, },
[22] = { 100, 336, nil, nil, nil, },
[23] = { 100, 352, nil, nil, nil, },
[24] = { 100, 368, nil, nil, nil, },
[25] = { 100, 384, nil, nil, nil, },
[26] = { 100, 400, nil, nil, nil, },
[27] = { 100, 416, nil, nil, nil, },
[28] = { 100, 432, nil, nil, nil, },
[29] = { 100, 448, nil, nil, nil, },
[30] = { 100, 464, nil, nil, nil, },
[31] = { 100, 472, nil, nil, nil, },
[32] = { 100, 480, nil, nil, nil, },
[33] = { 100, 488, nil, nil, nil, },
[34] = { 100, 496, nil, nil, nil, },
[35] = { 100, 504, nil, nil, nil, },
[36] = { 100, 512, nil, nil, nil, },
[37] = { 100, 520, nil, nil, nil, },
[38] = { 100, 528, nil, nil, nil, },
[39] = { 100, 536, nil, nil, nil, },
[40] = { 100, 544, nil, nil, nil, },
},
baseMods = {
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportChain"] = {
name = "Chain",
description = "Supports projectile skills, and any other skills that chain.",
color = 2,
support = true,
requireSkillTypes = { 23, 3, 54, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_chain_hit_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Hit),
},
},
qualityStats = {
{ "base_projectile_speed_+%", 1 },
},
stats = {
"number_of_chains",
"support_chain_hit_damage_+%_final",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 2, -50, },
[2] = { 2, -49, },
[3] = { 2, -48, },
[4] = { 2, -47, },
[5] = { 2, -46, },
[6] = { 2, -45, },
[7] = { 2, -44, },
[8] = { 2, -43, },
[9] = { 2, -42, },
[10] = { 2, -41, },
[11] = { 2, -40, },
[12] = { 2, -39, },
[13] = { 2, -38, },
[14] = { 2, -37, },
[15] = { 2, -36, },
[16] = { 2, -35, },
[17] = { 2, -34, },
[18] = { 2, -33, },
[19] = { 2, -32, },
[20] = { 2, -31, },
[21] = { 2, -30, },
[22] = { 2, -29, },
[23] = { 2, -28, },
[24] = { 2, -27, },
[25] = { 2, -26, },
[26] = { 2, -25, },
[27] = { 2, -24, },
[28] = { 2, -23, },
[29] = { 2, -22, },
[30] = { 2, -21, },
[31] = { 2, -21, },
[32] = { 2, -20, },
[33] = { 2, -20, },
[34] = { 2, -19, },
[35] = { 2, -19, },
[36] = { 2, -18, },
[37] = { 2, -18, },
[38] = { 2, -17, },
[39] = { 2, -17, },
[40] = { 2, -16, },
},
baseMods = {
mod("ManaCost", "MORE", 50),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportChanceToFlee"] = {
name = "Chance to Flee",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 1, 10, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "global_hit_causes_monster_flee_%", 1 },
},
stats = {
"global_hit_causes_monster_flee_%",
},
statInterpolation = { 1, },
statLevels = {
[1] = { 25, },
[2] = { 26, },
[3] = { 27, },
[4] = { 28, },
[5] = { 29, },
[6] = { 30, },
[7] = { 31, },
[8] = { 32, },
[9] = { 33, },
[10] = { 34, },
[11] = { 35, },
[12] = { 36, },
[13] = { 37, },
[14] = { 38, },
[15] = { 39, },
[16] = { 40, },
[17] = { 41, },
[18] = { 42, },
[19] = { 43, },
[20] = { 44, },
[21] = { 45, },
[22] = { 46, },
[23] = { 47, },
[24] = { 48, },
[25] = { 49, },
[26] = { 50, },
[27] = { 51, },
[28] = { 52, },
[29] = { 53, },
[30] = { 54, },
[31] = { 54, },
[32] = { 55, },
[33] = { 55, },
[34] = { 56, },
[35] = { 56, },
[36] = { 57, },
[37] = { 57, },
[38] = { 58, },
[39] = { 58, },
[40] = { 59, },
},
baseMods = {
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportGemFrenzyPowerOnTrapTrigger"] = {
name = "Charged Traps",
description = "Supports skills which throw traps.",
color = 2,
support = true,
requireSkillTypes = { 37, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "trap_damage_+%", 0.5 },
},
stats = {
"%_chance_to_gain_power_charge_on_trap_triggered_by_an_enemy",
"%_chance_to_gain_frenzy_charge_on_trap_triggered_by_an_enemy",
"trap_throwing_speed_+%_per_frenzy_charge",
"trap_critical_strike_multiplier_+_per_power_charge",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 20, 20, 6, 12, },
[2] = { 21, 21, 6, 12, },
[3] = { 21, 21, 6, 12, },
[4] = { 22, 22, 6, 12, },
[5] = { 22, 22, 6, 12, },
[6] = { 23, 23, 6, 12, },
[7] = { 23, 23, 6, 12, },
[8] = { 24, 24, 6, 12, },
[9] = { 24, 24, 6, 12, },
[10] = { 25, 25, 6, 12, },
[11] = { 25, 25, 6, 12, },
[12] = { 26, 26, 6, 12, },
[13] = { 26, 26, 6, 12, },
[14] = { 27, 27, 6, 12, },
[15] = { 27, 27, 6, 12, },
[16] = { 28, 28, 6, 12, },
[17] = { 28, 28, 6, 12, },
[18] = { 29, 29, 6, 12, },
[19] = { 29, 29, 6, 12, },
[20] = { 30, 30, 6, 12, },
[21] = { 30, 30, 6, 12, },
[22] = { 31, 31, 6, 12, },
[23] = { 31, 31, 6, 12, },
[24] = { 32, 32, 6, 12, },
[25] = { 32, 32, 6, 12, },
[26] = { 33, 33, 6, 12, },
[27] = { 33, 33, 6, 12, },
[28] = { 34, 34, 6, 12, },
[29] = { 34, 34, 6, 12, },
[30] = { 35, 35, 6, 12, },
[31] = { 35, 35, 6, 12, },
[32] = { 35, 35, 6, 12, },
[33] = { 35, 35, 6, 12, },
[34] = { 36, 36, 6, 12, },
[35] = { 36, 36, 6, 12, },
[36] = { 36, 36, 6, 12, },
[37] = { 36, 36, 6, 12, },
[38] = { 37, 37, 6, 12, },
[39] = { 37, 37, 6, 12, },
[40] = { 37, 37, 6, 12, },
},
baseMods = {
mod("ManaCost", "MORE", 30),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportClusterTrap"] = {
name = "Cluster Traps",
description = "Supports traps skills, making them throw extra traps randomly around the targeted location.",
color = 2,
support = true,
requireSkillTypes = { 37, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_clustertrap_damage_+%_final"] = {
mod("Damage", "MORE", nil),
},
},
qualityStats = {
{ "trap_damage_+%", 0.5 },
},
stats = {
"number_of_additional_traps_to_throw",
"number_of_additional_traps_allowed",
"throw_traps_in_circle_radius",
"support_clustertrap_damage_+%_final",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 2, 5, 20, -55, },
[2] = { 2, 5, 20, -54, },
[3] = { 2, 5, 20, -53, },
[4] = { 2, 5, 20, -52, },
[5] = { 2, 5, 20, -51, },
[6] = { 2, 5, 20, -50, },
[7] = { 2, 5, 20, -49, },
[8] = { 2, 5, 20, -48, },
[9] = { 2, 5, 20, -47, },
[10] = { 2, 5, 20, -46, },
[11] = { 2, 5, 20, -45, },
[12] = { 2, 5, 20, -44, },
[13] = { 2, 5, 20, -43, },
[14] = { 2, 5, 20, -42, },
[15] = { 2, 5, 20, -41, },
[16] = { 2, 5, 20, -40, },
[17] = { 2, 5, 20, -39, },
[18] = { 2, 5, 20, -38, },
[19] = { 2, 5, 20, -37, },
[20] = { 2, 5, 20, -36, },
[21] = { 2, 5, 20, -35, },
[22] = { 2, 5, 20, -34, },
[23] = { 2, 5, 20, -33, },
[24] = { 2, 5, 20, -32, },
[25] = { 2, 5, 20, -31, },
[26] = { 2, 5, 20, -30, },
[27] = { 2, 5, 20, -29, },
[28] = { 2, 5, 20, -28, },
[29] = { 2, 5, 20, -27, },
[30] = { 2, 5, 20, -26, },
[31] = { 2, 5, 20, -26, },
[32] = { 2, 5, 20, -25, },
[33] = { 2, 5, 20, -25, },
[34] = { 2, 5, 20, -24, },
[35] = { 2, 5, 20, -24, },
[36] = { 2, 5, 20, -23, },
[37] = { 2, 5, 20, -23, },
[38] = { 2, 5, 20, -22, },
[39] = { 2, 5, 20, -22, },
[40] = { 2, 5, 20, -21, },
},
baseMods = {
mod("ManaCost", "MORE", 50),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportColdPenetration"] = {
name = "Cold Penetration",
description = "Supports any skill that hits enemies, making those hits penetrate enemy cold resistance.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "cold_damage_+%", 0.5 },
},
stats = {
"base_reduce_enemy_cold_resistance_%",
},
statInterpolation = { 1, },
statLevels = {
[1] = { 18, },
[2] = { 19, },
[3] = { 20, },
[4] = { 21, },
[5] = { 22, },
[6] = { 23, },
[7] = { 24, },
[8] = { 25, },
[9] = { 26, },
[10] = { 27, },
[11] = { 28, },
[12] = { 29, },
[13] = { 30, },
[14] = { 31, },
[15] = { 32, },
[16] = { 33, },
[17] = { 34, },
[18] = { 35, },
[19] = { 36, },
[20] = { 37, },
[21] = { 38, },
[22] = { 39, },
[23] = { 40, },
[24] = { 41, },
[25] = { 42, },
[26] = { 43, },
[27] = { 44, },
[28] = { 45, },
[29] = { 46, },
[30] = { 47, },
[31] = { 47, },
[32] = { 48, },
[33] = { 48, },
[34] = { 49, },
[35] = { 49, },
[36] = { 50, },
[37] = { 50, },
[38] = { 51, },
[39] = { 51, },
[40] = { 52, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportCullingStrike"] = {
name = "Culling Strike",
description = "Supports any skill that hits enemies. If enemies are left below 10% of maximum life after being hit by these skills, they will be killed.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "attack_speed_+%", 0.5 },
{ "base_cast_speed_+%", 0.5 },
},
stats = {
"kill_enemy_on_hit_if_under_10%_life",
"attack_speed_+%",
"base_cast_speed_+%",
"damage_+%",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 1, 0, 0, 0, },
[2] = { 1, 0, 0, 2, },
[3] = { 1, 0, 0, 4, },
[4] = { 1, 0, 0, 6, },
[5] = { 1, 0, 0, 8, },
[6] = { 1, 0, 0, 10, },
[7] = { 1, 0, 0, 12, },
[8] = { 1, 0, 0, 14, },
[9] = { 1, 0, 0, 16, },
[10] = { 1, 0, 0, 18, },
[11] = { 1, 0, 0, 20, },
[12] = { 1, 0, 0, 22, },
[13] = { 1, 0, 0, 24, },
[14] = { 1, 0, 0, 26, },
[15] = { 1, 0, 0, 28, },
[16] = { 1, 0, 0, 30, },
[17] = { 1, 0, 0, 32, },
[18] = { 1, 0, 0, 34, },
[19] = { 1, 0, 0, 36, },
[20] = { 1, 0, 0, 38, },
[21] = { 1, 0, 0, 40, },
[22] = { 1, 0, 0, 42, },
[23] = { 1, 0, 0, 44, },
[24] = { 1, 0, 0, 46, },
[25] = { 1, 0, 0, 48, },
[26] = { 1, 0, 0, 50, },
[27] = { 1, 0, 0, 52, },
[28] = { 1, 0, 0, 54, },
[29] = { 1, 0, 0, 56, },
[30] = { 1, 0, 0, 58, },
[31] = { 1, 0, 0, 59, },
[32] = { 1, 0, 0, 60, },
[33] = { 1, 0, 0, 61, },
[34] = { 1, 0, 0, 62, },
[35] = { 1, 0, 0, 63, },
[36] = { 1, 0, 0, 64, },
[37] = { 1, 0, 0, 65, },
[38] = { 1, 0, 0, 66, },
[39] = { 1, 0, 0, 67, },
[40] = { 1, 0, 0, 68, },
},
baseMods = {
mod("ManaCost", "MORE", 10),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportDeadlyAilments"] = {
name = "Deadly Ailments",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_better_ailments_hit_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Hit),
},
["support_better_ailments_ailment_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Bleed, KeywordFlag.Poison, KeywordFlag.Ignite)),
},
},
qualityStats = {
{ "damage_over_time_+%", 0.5 },
},
stats = {
"support_better_ailments_ailment_damage_+%_final",
"support_better_ailments_hit_damage_+%_final",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 45, -10, },
[2] = { 46, -10, },
[3] = { 47, -10, },
[4] = { 48, -10, },
[5] = { 49, -10, },
[6] = { 50, -10, },
[7] = { 51, -10, },
[8] = { 52, -10, },
[9] = { 53, -10, },
[10] = { 54, -10, },
[11] = { 55, -10, },
[12] = { 56, -10, },
[13] = { 57, -10, },
[14] = { 58, -10, },
[15] = { 59, -10, },
[16] = { 60, -10, },
[17] = { 61, -10, },
[18] = { 62, -10, },
[19] = { 63, -10, },
[20] = { 64, -10, },
[21] = { 65, -10, },
[22] = { 66, -10, },
[23] = { 67, -10, },
[24] = { 68, -10, },
[25] = { 69, -10, },
[26] = { 70, -10, },
[27] = { 71, -10, },
[28] = { 72, -10, },
[29] = { 73, -10, },
[30] = { 74, -10, },
[31] = { 74, -10, },
[32] = { 75, -10, },
[33] = { 75, -10, },
[34] = { 76, -10, },
[35] = { 76, -10, },
[36] = { 77, -10, },
[37] = { 77, -10, },
[38] = { 78, -10, },
[39] = { 78, -10, },
[40] = { 79, -10, },
},
baseMods = {
mod("ManaCost", "MORE", 30),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportAdditionalQuality"] = {
name = "Enhance",
description = "Supports any skill gem. Once this gem reaches level 2 or above, will raise the quality of supported gems. Cannot support skills that don't come from gems.",
color = 2,
support = true,
requireSkillTypes = { },
addSkillTypes = { },
excludeSkillTypes = { },
supportGemsOnly = true,
statMap = {
["supported_active_skill_gem_quality_%"] = {
mod("GemProperty", "LIST", { keyword = "active_skill", key = "quality", value = nil }),
},
},
qualityStats = {
{ "local_gem_experience_gain_+%", 5 },
},
stats = {
"supported_active_skill_gem_quality_%",
},
statInterpolation = { 1, },
statLevels = {
[1] = { 0, },
[2] = { 8, },
[3] = { 16, },
[4] = { 24, },
[5] = { 32, },
[6] = { 40, },
[7] = { 48, },
[8] = { 56, },
[9] = { 64, },
[10] = { 72, },
},
baseMods = {
mod("ManaCost", "MORE", 15),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 1, },
[2] = { 10, },
[3] = { 45, },
[4] = { 60, },
[5] = { 75, },
[6] = { 90, },
[7] = { 100, },
[8] = { 100, },
[9] = { 100, },
[10] = { 100, },
},
}
skills["SupportFasterAttack"] = {
name = "Faster Attacks",
description = "Supports attack skills.",
color = 2,
support = true,
requireSkillTypes = { 1, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "attack_speed_+%", 0.5 },
},
stats = {
"attack_speed_+%",
},
statInterpolation = { 1, },
statLevels = {
[1] = { 25, },
[2] = { 26, },
[3] = { 27, },
[4] = { 28, },
[5] = { 29, },
[6] = { 30, },
[7] = { 31, },
[8] = { 32, },
[9] = { 33, },
[10] = { 34, },
[11] = { 35, },
[12] = { 36, },
[13] = { 37, },
[14] = { 38, },
[15] = { 39, },
[16] = { 40, },
[17] = { 41, },
[18] = { 42, },
[19] = { 43, },
[20] = { 44, },
[21] = { 45, },
[22] = { 46, },
[23] = { 47, },
[24] = { 48, },
[25] = { 49, },
[26] = { 50, },
[27] = { 51, },
[28] = { 52, },
[29] = { 53, },
[30] = { 54, },
[31] = { 54, },
[32] = { 55, },
[33] = { 55, },
[34] = { 56, },
[35] = { 56, },
[36] = { 57, },
[37] = { 57, },
[38] = { 58, },
[39] = { 58, },
[40] = { 59, },
},
baseMods = {
mod("ManaCost", "MORE", 15),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportFasterProjectiles"] = {
name = "Faster Projectiles",
description = "Supports projectile skills.",
color = 2,
support = true,
requireSkillTypes = { 3, 14, 54, 56, },
addSkillTypes = { },
excludeSkillTypes = { 51, },
qualityStats = {
{ "attack_speed_+%", 0.5 },
{ "base_cast_speed_+%", 0.5 },
},
stats = {
"base_projectile_speed_+%",
"projectile_damage_+%",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 50, 20, },
[2] = { 51, 20, },
[3] = { 52, 21, },
[4] = { 53, 21, },
[5] = { 54, 22, },
[6] = { 55, 22, },
[7] = { 56, 23, },
[8] = { 57, 23, },
[9] = { 58, 24, },
[10] = { 59, 24, },
[11] = { 60, 25, },
[12] = { 61, 25, },
[13] = { 62, 26, },
[14] = { 63, 26, },
[15] = { 64, 27, },
[16] = { 65, 27, },
[17] = { 66, 28, },
[18] = { 67, 28, },
[19] = { 68, 29, },
[20] = { 69, 29, },
[21] = { 70, 30, },
[22] = { 71, 30, },
[23] = { 72, 31, },
[24] = { 73, 31, },
[25] = { 74, 32, },
[26] = { 75, 32, },
[27] = { 76, 33, },
[28] = { 77, 33, },
[29] = { 78, 34, },
[30] = { 79, 34, },
[31] = { 79, 34, },
[32] = { 80, 35, },
[33] = { 80, 35, },
[34] = { 81, 35, },
[35] = { 81, 35, },
[36] = { 82, 36, },
[37] = { 82, 36, },
[38] = { 83, 36, },
[39] = { 83, 36, },
[40] = { 84, 37, },
},
baseMods = {
mod("ManaCost", "MORE", 10),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportFork"] = {
name = "Fork",
description = "Supports projectile skills, making their projectiles fork into two projectiles the first time they hit an enemy and don't pierce it.",
color = 2,
support = true,
requireSkillTypes = { 3, 54, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_fork_projectile_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Projectile),
},
},
qualityStats = {
{ "projectile_damage_+%", 0.5 },
},
stats = {
"support_fork_projectile_damage_+%_final",
"projectiles_fork",
},
statInterpolation = { 1, },
statLevels = {
[1] = { -30, nil, },
[2] = { -29, nil, },
[3] = { -28, nil, },
[4] = { -27, nil, },
[5] = { -26, nil, },
[6] = { -25, nil, },
[7] = { -24, nil, },
[8] = { -23, nil, },
[9] = { -22, nil, },
[10] = { -21, nil, },
[11] = { -20, nil, },
[12] = { -19, nil, },
[13] = { -18, nil, },
[14] = { -17, nil, },
[15] = { -16, nil, },
[16] = { -15, nil, },
[17] = { -14, nil, },
[18] = { -13, nil, },
[19] = { -12, nil, },
[20] = { -11, nil, },
[21] = { -10, nil, },
[22] = { -9, nil, },
[23] = { -8, nil, },
[24] = { -7, nil, },
[25] = { -6, nil, },
[26] = { -5, nil, },
[27] = { -4, nil, },
[28] = { -3, nil, },
[29] = { -2, nil, },
[30] = { -1, nil, },
[31] = { -1, nil, },
[32] = { 0, nil, },
[33] = { 0, nil, },
[34] = { 1, nil, },
[35] = { 1, nil, },
[36] = { 2, nil, },
[37] = { 2, nil, },
[38] = { 3, nil, },
[39] = { 3, nil, },
[40] = { 4, nil, },
},
baseMods = {
mod("ManaCost", "MORE", 30),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportGreaterMultipleProjectiles"] = {
name = "Greater Multiple Projectiles",
description = "Supports projectile skills.",
color = 2,
support = true,
requireSkillTypes = { 3, 54, 56, 73, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_multiple_projectile_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Projectile),
},
},
qualityStats = {
{ "attack_speed_+%", 0.5 },
{ "base_cast_speed_+%", 0.5 },
},
stats = {
"number_of_additional_projectiles",
"support_multiple_projectile_damage_+%_final",
"projectile_damage_+%",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 4, -35, 0, },
[2] = { 4, -35, 0, },
[3] = { 4, -34, 0, },
[4] = { 4, -34, 0, },
[5] = { 4, -33, 0, },
[6] = { 4, -33, 0, },
[7] = { 4, -32, 0, },
[8] = { 4, -32, 0, },
[9] = { 4, -31, 0, },
[10] = { 4, -31, 0, },
[11] = { 4, -30, 0, },
[12] = { 4, -30, 0, },
[13] = { 4, -29, 0, },
[14] = { 4, -29, 0, },
[15] = { 4, -28, 0, },
[16] = { 4, -28, 0, },
[17] = { 4, -27, 0, },
[18] = { 4, -27, 0, },
[19] = { 4, -26, 0, },
[20] = { 4, -26, 0, },
[21] = { 4, -25, 0, },
[22] = { 4, -25, 0, },
[23] = { 4, -24, 0, },
[24] = { 4, -24, 0, },
[25] = { 4, -23, 0, },
[26] = { 4, -23, 0, },
[27] = { 4, -22, 0, },
[28] = { 4, -22, 0, },
[29] = { 4, -21, 0, },
[30] = { 4, -21, 0, },
[31] = { 4, -21, 0, },
[32] = { 4, -20, 0, },
[33] = { 4, -20, 0, },
[34] = { 4, -20, 0, },
[35] = { 4, -20, 0, },
[36] = { 4, -19, 0, },
[37] = { 4, -19, 0, },
[38] = { 4, -19, 0, },
[39] = { 4, -19, 0, },
[40] = { 4, -18, 0, },
},
baseMods = {
mod("ManaCost", "MORE", 65),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportDamageAgainstChilled"] = {
name = "Hypothermia",
description = "Supports any skill that deals damage.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, 40, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_hypothermia_damage_+%_vs_chilled_enemies_final"] = {
mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "ActorCondition", actor = "enemy", var = "Chilled" }),
},
["support_hypothermia_cold_damage_over_time_+%_final"] = {
mod("ColdDamage", "MORE", nil, 0, KeywordFlag.ColdDot),
},
},
qualityStats = {
{ "chill_duration_+%", 1.5 },
},
stats = {
"support_hypothermia_damage_+%_vs_chilled_enemies_final",
"additional_chance_to_freeze_chilled_enemies_%",
"chill_effect_+%",
"support_hypothermia_cold_damage_over_time_+%_final",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 20, 10, 20, 20, },
[2] = { 21, 10, 20, 21, },
[3] = { 22, 10, 20, 22, },
[4] = { 23, 10, 20, 23, },
[5] = { 24, 10, 20, 24, },
[6] = { 25, 10, 20, 25, },
[7] = { 26, 10, 20, 26, },
[8] = { 27, 10, 20, 27, },
[9] = { 28, 10, 20, 28, },
[10] = { 29, 10, 20, 29, },
[11] = { 30, 10, 20, 30, },
[12] = { 31, 10, 20, 31, },
[13] = { 32, 10, 20, 32, },
[14] = { 33, 10, 20, 33, },
[15] = { 34, 10, 20, 34, },
[16] = { 35, 10, 20, 35, },
[17] = { 36, 10, 20, 36, },
[18] = { 37, 10, 20, 37, },
[19] = { 38, 10, 20, 38, },
[20] = { 39, 10, 20, 39, },
[21] = { 40, 10, 20, 40, },
[22] = { 41, 10, 20, 41, },
[23] = { 42, 10, 20, 42, },
[24] = { 43, 10, 20, 43, },
[25] = { 44, 10, 20, 44, },
[26] = { 45, 10, 20, 45, },
[27] = { 46, 10, 20, 46, },
[28] = { 47, 10, 20, 47, },
[29] = { 48, 10, 20, 48, },
[30] = { 49, 10, 20, 49, },
[31] = { 49, 10, 20, 49, },
[32] = { 50, 10, 20, 50, },
[33] = { 50, 10, 20, 50, },
[34] = { 51, 10, 20, 51, },
[35] = { 51, 10, 20, 51, },
[36] = { 52, 10, 20, 52, },
[37] = { 52, 10, 20, 52, },
[38] = { 53, 10, 20, 53, },
[39] = { 53, 10, 20, 53, },
[40] = { 54, 10, 20, 54, },
},
baseMods = {
mod("ManaCost", "MORE", 20),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportFrenzyChargeOnSlayingFrozenEnemy"] = {
name = "Ice Bite",
description = "Supports any skill you use to hit enemies yourself. Cannot support skills used by totems, traps, or mines.",
color = 2,
baseEffectiveness = 0.51819998025894,
incrementalEffectiveness = 0.03770000115037,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { 37, 41, 30, },
qualityStats = {
{ "damage_+%_vs_frozen_enemies", 1 },
},
stats = {
"chance_to_gain_frenzy_charge_on_killing_frozen_enemy_%",
"base_chance_to_freeze_%",
"minimum_added_cold_damage_per_frenzy_charge",
"maximum_added_cold_damage_per_frenzy_charge",
"global_minimum_added_cold_damage",
"global_maximum_added_cold_damage",
},
statInterpolation = { 1, 1, 3, 3, 3, 3, },
statLevels = {
[1] = { 50, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[2] = { 51, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[3] = { 52, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[4] = { 53, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[5] = { 54, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[6] = { 55, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[7] = { 56, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[8] = { 57, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[9] = { 58, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[10] = { 59, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[11] = { 60, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[12] = { 61, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[13] = { 62, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[14] = { 63, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[15] = { 64, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[16] = { 65, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[17] = { 66, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[18] = { 67, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[19] = { 68, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[20] = { 69, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[21] = { 70, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[22] = { 71, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[23] = { 72, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[24] = { 73, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[25] = { 74, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[26] = { 75, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[27] = { 76, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[28] = { 77, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[29] = { 78, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[30] = { 79, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[31] = { 79, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[32] = { 80, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[33] = { 80, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[34] = { 81, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[35] = { 81, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[36] = { 82, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[37] = { 82, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[38] = { 83, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[39] = { 83, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
[40] = { 84, 15, 0.079999998211861, 0.11999999731779, 0.36000001430511, 0.54000002145767, },
},
baseMods = {
mod("ManaCost", "MORE", 30),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportLesserMultipleProjectiles"] = {
name = "Lesser Multiple Projectiles",
description = "Supports projectile skills.",
color = 2,
support = true,
requireSkillTypes = { 3, 54, 56, 73, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_lesser_multiple_projectile_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Projectile),
},
},
qualityStats = {
{ "attack_speed_+%", 0.5 },
{ "base_cast_speed_+%", 0.5 },
},
stats = {
"number_of_additional_projectiles",
"support_lesser_multiple_projectile_damage_+%_final",
"projectile_damage_+%",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 2, -25, 0, },
[2] = { 2, -25, 0, },
[3] = { 2, -24, 0, },
[4] = { 2, -24, 0, },
[5] = { 2, -23, 0, },
[6] = { 2, -23, 0, },
[7] = { 2, -22, 0, },
[8] = { 2, -22, 0, },
[9] = { 2, -21, 0, },
[10] = { 2, -21, 0, },
[11] = { 2, -20, 0, },
[12] = { 2, -20, 0, },
[13] = { 2, -19, 0, },
[14] = { 2, -19, 0, },
[15] = { 2, -18, 0, },
[16] = { 2, -18, 0, },
[17] = { 2, -17, 0, },
[18] = { 2, -17, 0, },
[19] = { 2, -16, 0, },
[20] = { 2, -16, 0, },
[21] = { 2, -15, 0, },
[22] = { 2, -15, 0, },
[23] = { 2, -14, 0, },
[24] = { 2, -14, 0, },
[25] = { 2, -13, 0, },
[26] = { 2, -13, 0, },
[27] = { 2, -12, 0, },
[28] = { 2, -12, 0, },
[29] = { 2, -11, 0, },
[30] = { 2, -11, 0, },
[31] = { 2, -11, 0, },
[32] = { 2, -10, 0, },
[33] = { 2, -10, 0, },
[34] = { 2, -10, 0, },
[35] = { 2, -10, 0, },
[36] = { 2, -9, 0, },
[37] = { 2, -9, 0, },
[38] = { 2, -9, 0, },
[39] = { 2, -9, 0, },
[40] = { 2, -8, 0, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportLesserPoison"] = {
name = "Lesser Poison",
description = "Supports any skill that hits enemies.",
color = 2,
baseEffectiveness = 0.2732999920845,
incrementalEffectiveness = 0.028500000014901,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "base_poison_damage_+%", 0.5 },
},
stats = {
"global_minimum_added_chaos_damage",
"global_maximum_added_chaos_damage",
"base_chance_to_poison_on_hit_%",
},
statInterpolation = { 3, 3, 1, },
statLevels = {
[1] = { 0.80000001192093, 1.5, 40, },
[2] = { 0.80000001192093, 2.2000000476837, 40, },
[3] = { 1.2000000476837, 2, 40, },
[4] = { 1, 1.7999999523163, 40, },
[5] = { 0.80000001192093, 1.7999999523163, 40, },
[6] = { 0.80000001192093, 1.2000000476837, 40, },
[7] = { 0.80000001192093, 1.2000000476837, 40, },
[8] = { 0.80000001192093, 1.2000000476837, 40, },
[9] = { 0.80000001192093, 1.2000000476837, 40, },
[10] = { 0.80000001192093, 1.2000000476837, 40, },
[11] = { 0.80000001192093, 1.2000000476837, 40, },
[12] = { 0.80000001192093, 1.2000000476837, 40, },
[13] = { 0.80000001192093, 1.2000000476837, 40, },
[14] = { 0.80000001192093, 1.2000000476837, 40, },
[15] = { 0.80000001192093, 1.2000000476837, 40, },
[16] = { 0.80000001192093, 1.2000000476837, 40, },
[17] = { 0.80000001192093, 1.2000000476837, 40, },
[18] = { 0.80000001192093, 1.2000000476837, 40, },
[19] = { 0.80000001192093, 1.2000000476837, 40, },
[20] = { 0.80000001192093, 1.2000000476837, 40, },
[21] = { 0.80000001192093, 1.2000000476837, 40, },
[22] = { 0.80000001192093, 1.2000000476837, 40, },
[23] = { 0.80000001192093, 1.2000000476837, 40, },
[24] = { 0.80000001192093, 1.2000000476837, 40, },
[25] = { 0.80000001192093, 1.2000000476837, 40, },
[26] = { 0.80000001192093, 1.2000000476837, 40, },
[27] = { 0.80000001192093, 1.2000000476837, 40, },
[28] = { 0.80000001192093, 1.2000000476837, 40, },
[29] = { 0.80000001192093, 1.2000000476837, 40, },
[30] = { 0.80000001192093, 1.2000000476837, 40, },
[31] = { 0.80000001192093, 1.2000000476837, 40, },
[32] = { 0.80000001192093, 1.2000000476837, 40, },
[33] = { 0.80000001192093, 1.2000000476837, 40, },
[34] = { 0.80000001192093, 1.2000000476837, 40, },
[35] = { 0.80000001192093, 1.2000000476837, 40, },
[36] = { 0.80000001192093, 1.2000000476837, 40, },
[37] = { 0.80000001192093, 1.2000000476837, 40, },
[38] = { 0.80000001192093, 1.2000000476837, 40, },
[39] = { 0.80000001192093, 1.2000000476837, 40, },
[40] = { 0.80000001192093, 1.2000000476837, 40, },
},
baseMods = {
mod("ManaCost", "MORE", 10),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 1, },
[2] = { 2, },
[3] = { 4, },
[4] = { 7, },
[5] = { 11, },
[6] = { 16, },
[7] = { 20, },
[8] = { 24, },
[9] = { 28, },
[10] = { 32, },
[11] = { 36, },
[12] = { 40, },
[13] = { 44, },
[14] = { 48, },
[15] = { 52, },
[16] = { 56, },
[17] = { 60, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportManaLeech"] = {
name = "Mana Leech",
description = "Supports any skill that hits enemies, causing those hits to leech mana based on damage dealt.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "mana_leech_speed_+%", 0.5 },
},
stats = {
"mana_leech_from_any_damage_permyriad",
"mana_leech_speed_+%",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 200, 0, },
[2] = { 200, 2, },
[3] = { 200, 4, },
[4] = { 200, 6, },
[5] = { 200, 8, },
[6] = { 200, 10, },
[7] = { 200, 12, },
[8] = { 200, 14, },
[9] = { 200, 16, },
[10] = { 200, 18, },
[11] = { 200, 20, },
[12] = { 200, 22, },
[13] = { 200, 24, },
[14] = { 200, 26, },
[15] = { 200, 28, },
[16] = { 200, 30, },
[17] = { 200, 32, },
[18] = { 200, 34, },
[19] = { 200, 36, },
[20] = { 200, 38, },
[21] = { 200, 40, },
[22] = { 200, 42, },
[23] = { 200, 44, },
[24] = { 200, 46, },
[25] = { 200, 48, },
[26] = { 200, 50, },
[27] = { 200, 52, },
[28] = { 200, 54, },
[29] = { 200, 56, },
[30] = { 200, 58, },
[31] = { 200, 59, },
[32] = { 200, 60, },
[33] = { 200, 61, },
[34] = { 200, 62, },
[35] = { 200, 63, },
[36] = { 200, 64, },
[37] = { 200, 65, },
[38] = { 200, 66, },
[39] = { 200, 67, },
[40] = { 200, 68, },
},
baseMods = {
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportGemMirageArcher"] = {
name = "Mirage Archer",
description = "Supports attack skills that can be used with bows. Supported skills can only be used with bows. Cannot support Vaal skills, minion skills, movement skills, or skills used by totems, traps, or mines.",
color = 2,
support = true,
requireSkillTypes = { 69, },
addSkillTypes = { 12, },
excludeSkillTypes = { 43, 30, 37, 41, 9, },
qualityStats = {
{ "attack_damage_+%", 0.5 },
},
stats = {
"support_mirage_archer_base_duration",
"support_mirage_archer_damage_+%_final",
"support_mirage_archer_attack_speed_+%_final",
"mirage_archer_projectile_additional_height_offset",
"skill_can_own_mirage_archers",
"summon_mirage_archer_on_hit",
"disable_skill_if_weapon_not_bow",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 4000, -30, -60, -138, nil, nil, nil, },
[2] = { 4000, -29, -60, -138, nil, nil, nil, },
[3] = { 4000, -28, -60, -138, nil, nil, nil, },
[4] = { 4000, -27, -60, -138, nil, nil, nil, },
[5] = { 4000, -26, -60, -138, nil, nil, nil, },
[6] = { 4000, -25, -60, -138, nil, nil, nil, },
[7] = { 4000, -24, -60, -138, nil, nil, nil, },
[8] = { 4000, -23, -60, -138, nil, nil, nil, },
[9] = { 4000, -22, -60, -138, nil, nil, nil, },
[10] = { 4000, -21, -60, -138, nil, nil, nil, },
[11] = { 4000, -20, -60, -138, nil, nil, nil, },
[12] = { 4000, -19, -60, -138, nil, nil, nil, },
[13] = { 4000, -18, -60, -138, nil, nil, nil, },
[14] = { 4000, -17, -60, -138, nil, nil, nil, },
[15] = { 4000, -16, -60, -138, nil, nil, nil, },
[16] = { 4000, -15, -60, -138, nil, nil, nil, },
[17] = { 4000, -14, -60, -138, nil, nil, nil, },
[18] = { 4000, -13, -60, -138, nil, nil, nil, },
[19] = { 4000, -12, -60, -138, nil, nil, nil, },
[20] = { 4000, -11, -60, -138, nil, nil, nil, },
[21] = { 4000, -10, -60, -138, nil, nil, nil, },
[22] = { 4000, -9, -60, -138, nil, nil, nil, },
[23] = { 4000, -8, -60, -138, nil, nil, nil, },
[24] = { 4000, -7, -60, -138, nil, nil, nil, },
[25] = { 4000, -6, -60, -138, nil, nil, nil, },
[26] = { 4000, -5, -60, -138, nil, nil, nil, },
[27] = { 4000, -4, -60, -138, nil, nil, nil, },
[28] = { 4000, -3, -60, -138, nil, nil, nil, },
[29] = { 4000, -2, -60, -138, nil, nil, nil, },
[30] = { 4000, -1, -60, -138, nil, nil, nil, },
[31] = { 4000, -1, -60, -138, nil, nil, nil, },
[32] = { 4000, 0, -60, -138, nil, nil, nil, },
[33] = { 4000, 0, -60, -138, nil, nil, nil, },
[34] = { 4000, 1, -60, -138, nil, nil, nil, },
[35] = { 4000, 1, -60, -138, nil, nil, nil, },
[36] = { 4000, 2, -60, -138, nil, nil, nil, },
[37] = { 4000, 2, -60, -138, nil, nil, nil, },
[38] = { 4000, 3, -60, -138, nil, nil, nil, },
[39] = { 4000, 3, -60, -138, nil, nil, nil, },
[40] = { 4000, 4, -60, -138, nil, nil, nil, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 4, },
[2] = { 6, },
[3] = { 9, },
[4] = { 12, },
[5] = { 16, },
[6] = { 20, },
[7] = { 24, },
[8] = { 28, },
[9] = { 32, },
[10] = { 36, },
[11] = { 40, },
[12] = { 44, },
[13] = { 48, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportMultiTrap"] = {
name = "Multiple Traps",
description = "Supports traps skills, making them throw extra traps in a line.",
color = 2,
support = true,
requireSkillTypes = { 37, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_multithrow_damage_+%_final"] = {
mod("Damage", "MORE", nil),
},
},
qualityStats = {
{ "trap_trigger_radius_+%", 1 },
},
stats = {
"number_of_additional_traps_to_throw",
"number_of_additional_traps_allowed",
"support_multithrow_damage_+%_final",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 2, 3, -50, },
[2] = { 2, 3, -49, },
[3] = { 2, 3, -48, },
[4] = { 2, 3, -47, },
[5] = { 2, 3, -46, },
[6] = { 2, 3, -45, },
[7] = { 2, 3, -44, },
[8] = { 2, 3, -43, },
[9] = { 2, 3, -42, },
[10] = { 2, 3, -41, },
[11] = { 2, 3, -40, },
[12] = { 2, 3, -39, },
[13] = { 2, 3, -38, },
[14] = { 2, 3, -37, },
[15] = { 2, 3, -36, },
[16] = { 2, 3, -35, },
[17] = { 2, 3, -34, },
[18] = { 2, 3, -33, },
[19] = { 2, 3, -32, },
[20] = { 2, 3, -31, },
[21] = { 2, 3, -30, },
[22] = { 2, 3, -29, },
[23] = { 2, 3, -28, },
[24] = { 2, 3, -27, },
[25] = { 2, 3, -26, },
[26] = { 2, 3, -25, },
[27] = { 2, 3, -24, },
[28] = { 2, 3, -23, },
[29] = { 2, 3, -22, },
[30] = { 2, 3, -21, },
[31] = { 2, 3, -20, },
[32] = { 2, 3, -19, },
[33] = { 2, 3, -18, },
[34] = { 2, 3, -17, },
[35] = { 2, 3, -16, },
[36] = { 2, 3, -15, },
[37] = { 2, 3, -14, },
[38] = { 2, 3, -13, },
[39] = { 2, 3, -12, },
[40] = { 2, 3, -11, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportOnslaught"] = {
name = "Onslaught",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "attack_and_cast_speed_+%", 0.25 },
},
stats = {
"support_scion_onslaught_on_killing_blow_%_chance",
"support_scion_onslaught_on_killing_blow_duration_ms",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 25, 8000, },
[2] = { 26, 8000, },
[3] = { 27, 8000, },
[4] = { 28, 8000, },
[5] = { 29, 8000, },
[6] = { 30, 8000, },
[7] = { 31, 8000, },
[8] = { 32, 8000, },
[9] = { 33, 8000, },
[10] = { 34, 8000, },
[11] = { 35, 8000, },
[12] = { 36, 8000, },
[13] = { 37, 8000, },
[14] = { 38, 8000, },
[15] = { 39, 8000, },
[16] = { 40, 8000, },
[17] = { 41, 8000, },
[18] = { 42, 8000, },
[19] = { 43, 8000, },
[20] = { 44, 8000, },
[21] = { 45, 8000, },
[22] = { 46, 8000, },
[23] = { 47, 8000, },
[24] = { 48, 8000, },
[25] = { 49, 8000, },
[26] = { 50, 8000, },
[27] = { 51, 8000, },
[28] = { 52, 8000, },
[29] = { 53, 8000, },
[30] = { 54, 8000, },
[31] = { 54, 8000, },
[32] = { 55, 8000, },
[33] = { 55, 8000, },
[34] = { 56, 8000, },
[35] = { 56, 8000, },
[36] = { 57, 8000, },
[37] = { 57, 8000, },
[38] = { 58, 8000, },
[39] = { 58, 8000, },
[40] = { 59, 8000, },
},
baseMods = {
mod("ManaCost", "MORE", 10),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 1, },
[2] = { 2, },
[3] = { 4, },
[4] = { 7, },
[5] = { 11, },
[6] = { 16, },
[7] = { 20, },
[8] = { 24, },
[9] = { 28, },
[10] = { 32, },
[11] = { 36, },
[12] = { 40, },
[13] = { 44, },
[14] = { 48, },
[15] = { 52, },
[16] = { 56, },
[17] = { 60, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportPierce"] = {
name = "Pierce",
description = "Supports projectile skills.",
color = 2,
support = true,
requireSkillTypes = { 3, 54, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_pierce_projectile_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Projectile),
},
},
qualityStats = {
{ "projectile_damage_+%", 0.5 },
},
stats = {
"projectile_base_number_of_targets_to_pierce",
"support_pierce_projectile_damage_+%_final",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 2, 0, },
[2] = { 2, 1, },
[3] = { 2, 2, },
[4] = { 2, 3, },
[5] = { 2, 4, },
[6] = { 2, 5, },
[7] = { 2, 6, },
[8] = { 2, 7, },
[9] = { 3, 8, },
[10] = { 3, 9, },
[11] = { 3, 10, },
[12] = { 3, 11, },
[13] = { 3, 12, },
[14] = { 3, 13, },
[15] = { 3, 14, },
[16] = { 3, 15, },
[17] = { 4, 16, },
[18] = { 4, 17, },
[19] = { 4, 18, },
[20] = { 4, 19, },
[21] = { 4, 20, },
[22] = { 4, 21, },
[23] = { 4, 22, },
[24] = { 4, 23, },
[25] = { 5, 24, },
[26] = { 5, 25, },
[27] = { 5, 26, },
[28] = { 5, 27, },
[29] = { 5, 28, },
[30] = { 5, 29, },
[31] = { 5, 29, },
[32] = { 5, 30, },
[33] = { 5, 30, },
[34] = { 5, 31, },
[35] = { 5, 31, },
[36] = { 5, 32, },
[37] = { 5, 32, },
[38] = { 5, 33, },
[39] = { 5, 33, },
[40] = { 6, 34, },
},
baseMods = {
mod("ManaCost", "MORE", 10),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 1, },
[2] = { 2, },
[3] = { 4, },
[4] = { 7, },
[5] = { 11, },
[6] = { 16, },
[7] = { 20, },
[8] = { 24, },
[9] = { 28, },
[10] = { 32, },
[11] = { 36, },
[12] = { 40, },
[13] = { 44, },
[14] = { 48, },
[15] = { 52, },
[16] = { 56, },
[17] = { 60, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportPointBlank"] = {
name = "Point Blank",
description = "Supports projectile skills.",
color = 2,
support = true,
requireSkillTypes = { 48, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["keystone_point_blank"] = {
flag("PointBlank"),
},
},
qualityStats = {
{ "projectile_damage_+%", 0.5 },
},
stats = {
"keystone_point_blank",
"projectile_damage_+%",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 1, 0, },
[2] = { 1, 2, },
[3] = { 1, 4, },
[4] = { 1, 6, },
[5] = { 1, 8, },
[6] = { 1, 10, },
[7] = { 1, 12, },
[8] = { 1, 14, },
[9] = { 1, 16, },
[10] = { 1, 18, },
[11] = { 1, 20, },
[12] = { 1, 22, },
[13] = { 1, 24, },
[14] = { 1, 26, },
[15] = { 1, 28, },
[16] = { 1, 30, },
[17] = { 1, 32, },
[18] = { 1, 34, },
[19] = { 1, 36, },
[20] = { 1, 38, },
[21] = { 1, 40, },
[22] = { 1, 42, },
[23] = { 1, 44, },
[24] = { 1, 46, },
[25] = { 1, 48, },
[26] = { 1, 50, },
[27] = { 1, 52, },
[28] = { 1, 54, },
[29] = { 1, 56, },
[30] = { 1, 58, },
[31] = { 1, 59, },
[32] = { 1, 60, },
[33] = { 1, 61, },
[34] = { 1, 62, },
[35] = { 1, 63, },
[36] = { 1, 64, },
[37] = { 1, 65, },
[38] = { 1, 66, },
[39] = { 1, 67, },
[40] = { 1, 68, },
},
baseMods = {
mod("ManaCost", "MORE", 20),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportPoison"] = {
name = "Poison",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_poison_poison_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, KeywordFlag.Poison),
},
},
qualityStats = {
{ "base_poison_damage_+%", 0.5 },
},
stats = {
"base_chance_to_poison_on_hit_%",
"support_poison_poison_damage_+%_final",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 60, 0, },
[2] = { 60, 1, },
[3] = { 60, 2, },
[4] = { 60, 3, },
[5] = { 60, 4, },
[6] = { 60, 5, },
[7] = { 60, 6, },
[8] = { 60, 7, },
[9] = { 60, 8, },
[10] = { 60, 9, },
[11] = { 60, 10, },
[12] = { 60, 11, },
[13] = { 60, 12, },
[14] = { 60, 13, },
[15] = { 60, 14, },
[16] = { 60, 15, },
[17] = { 60, 16, },
[18] = { 60, 17, },
[19] = { 60, 18, },
[20] = { 60, 19, },
[21] = { 60, 20, },
[22] = { 60, 21, },
[23] = { 60, 22, },
[24] = { 60, 23, },
[25] = { 60, 24, },
[26] = { 60, 25, },
[27] = { 60, 26, },
[28] = { 60, 27, },
[29] = { 60, 28, },
[30] = { 60, 29, },
[31] = { 60, 29, },
[32] = { 60, 30, },
[33] = { 60, 30, },
[34] = { 60, 31, },
[35] = { 60, 31, },
[36] = { 60, 32, },
[37] = { 60, 32, },
[38] = { 60, 33, },
[39] = { 60, 33, },
[40] = { 60, 34, },
},
baseMods = {
mod("ManaCost", "MORE", 35),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportRapidDecay"] = {
name = "Swift Affliction",
description = "Supports any skill that has a duration, or can hit enemies to inflict ailments on them.",
color = 2,
support = true,
requireSkillTypes = { 12, 55, 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_rapid_decay_damage_over_time_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Dot),
},
},
qualityStats = {
{ "damage_over_time_+%", 0.5 },
},
stats = {
"support_rapid_decay_damage_over_time_+%_final",
"skill_effect_and_damaging_ailment_duration_+%",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 25, -15, },
[2] = { 26, -15, },
[3] = { 27, -15, },
[4] = { 28, -15, },
[5] = { 29, -15, },
[6] = { 30, -15, },
[7] = { 31, -15, },
[8] = { 32, -15, },
[9] = { 33, -15, },
[10] = { 34, -15, },
[11] = { 35, -15, },
[12] = { 36, -15, },
[13] = { 37, -15, },
[14] = { 38, -15, },
[15] = { 39, -15, },
[16] = { 40, -15, },
[17] = { 41, -15, },
[18] = { 42, -15, },
[19] = { 43, -15, },
[20] = { 44, -15, },
[21] = { 45, -15, },
[22] = { 46, -15, },
[23] = { 47, -15, },
[24] = { 48, -15, },
[25] = { 49, -15, },
[26] = { 50, -15, },
[27] = { 51, -15, },
[28] = { 52, -15, },
[29] = { 53, -15, },
[30] = { 54, -15, },
[31] = { 54, -15, },
[32] = { 55, -15, },
[33] = { 55, -15, },
[34] = { 56, -15, },
[35] = { 56, -15, },
[36] = { 57, -15, },
[37] = { 57, -15, },
[38] = { 58, -15, },
[39] = { 58, -15, },
[40] = { 59, -15, },
},
baseMods = {
mod("ManaCost", "MORE", 25),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportSlowerProjectiles"] = {
name = "Slower Projectiles",
description = "Supports projectile skills.",
color = 2,
support = true,
requireSkillTypes = { 3, 14, 54, 56, },
addSkillTypes = { },
excludeSkillTypes = { 51, },
statMap = {
["support_slower_projectiles_projectile_speed_+%_final"] = {
mod("ProjectileSpeed", "MORE", nil),
},
["support_slower_projectiles_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Projectile),
},
},
qualityStats = {
{ "projectile_damage_+%", 0.5 },
},
stats = {
"support_slower_projectiles_projectile_speed_+%_final",
"support_slower_projectiles_damage_+%_final",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { -30, 20, },
[2] = { -31, 20, },
[3] = { -32, 21, },
[4] = { -33, 21, },
[5] = { -34, 22, },
[6] = { -35, 22, },
[7] = { -36, 23, },
[8] = { -37, 23, },
[9] = { -38, 24, },
[10] = { -39, 24, },
[11] = { -40, 25, },
[12] = { -41, 25, },
[13] = { -42, 26, },
[14] = { -43, 26, },
[15] = { -44, 27, },
[16] = { -45, 27, },
[17] = { -46, 28, },
[18] = { -47, 28, },
[19] = { -48, 29, },
[20] = { -49, 29, },
[21] = { -50, 30, },
[22] = { -51, 30, },
[23] = { -52, 31, },
[24] = { -53, 31, },
[25] = { -54, 32, },
[26] = { -55, 32, },
[27] = { -56, 33, },
[28] = { -57, 33, },
[29] = { -58, 34, },
[30] = { -59, 34, },
[31] = { -59, 34, },
[32] = { -60, 35, },
[33] = { -60, 35, },
[34] = { -61, 35, },
[35] = { -61, 35, },
[36] = { -62, 36, },
[37] = { -62, 36, },
[38] = { -63, 36, },
[39] = { -63, 36, },
[40] = { -64, 37, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportTrap"] = {
name = "Trap",
description = "Supports spells, or attacks that use bows or wands. Instead of using that skill, you will throw a trap that will use the skill for you when an enemy walks near it. Traps cannot use channelling skills.",
color = 2,
support = true,
requireSkillTypes = { 17, },
addSkillTypes = { 37, },
excludeSkillTypes = { 61, },
addFlags = {
trap = true,
},
statMap = {
["base_skill_show_average_damage_instead_of_dps"] = {
skill("showAverage", true, { type = "SkillType", skillType = SkillType.SkillCanTrap }),
},
["support_trap_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, KeywordFlag.Trap),
},
["support_trap_hit_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Hit, KeywordFlag.Trap),
},
},
qualityStats = {
{ "trap_throwing_speed_+%", 0.5 },
},
stats = {
"is_trap",
"base_trap_duration",
"trap_throwing_speed_+%",
"base_skill_is_trapped",
"disable_skill_if_melee_attack",
"base_skill_show_average_damage_instead_of_dps",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 1, 4000, 0, nil, nil, nil, },
[2] = { 1, 4000, 1, nil, nil, nil, },
[3] = { 1, 4000, 1, nil, nil, nil, },
[4] = { 1, 4000, 2, nil, nil, nil, },
[5] = { 1, 4000, 2, nil, nil, nil, },
[6] = { 1, 4000, 3, nil, nil, nil, },
[7] = { 1, 4000, 3, nil, nil, nil, },
[8] = { 1, 4000, 4, nil, nil, nil, },
[9] = { 1, 4000, 4, nil, nil, nil, },
[10] = { 1, 4000, 5, nil, nil, nil, },
[11] = { 1, 4000, 5, nil, nil, nil, },
[12] = { 1, 4000, 6, nil, nil, nil, },
[13] = { 1, 4000, 6, nil, nil, nil, },
[14] = { 1, 4000, 7, nil, nil, nil, },
[15] = { 1, 4000, 7, nil, nil, nil, },
[16] = { 1, 4000, 8, nil, nil, nil, },
[17] = { 1, 4000, 8, nil, nil, nil, },
[18] = { 1, 4000, 9, nil, nil, nil, },
[19] = { 1, 4000, 9, nil, nil, nil, },
[20] = { 1, 4000, 10, nil, nil, nil, },
[21] = { 1, 4000, 10, nil, nil, nil, },
[22] = { 1, 4000, 11, nil, nil, nil, },
[23] = { 1, 4000, 11, nil, nil, nil, },
[24] = { 1, 4000, 12, nil, nil, nil, },
[25] = { 1, 4000, 12, nil, nil, nil, },
[26] = { 1, 4000, 13, nil, nil, nil, },
[27] = { 1, 4000, 13, nil, nil, nil, },
[28] = { 1, 4000, 14, nil, nil, nil, },
[29] = { 1, 4000, 14, nil, nil, nil, },
[30] = { 1, 4000, 15, nil, nil, nil, },
[31] = { 1, 4000, 15, nil, nil, nil, },
[32] = { 1, 4000, 15, nil, nil, nil, },
[33] = { 1, 4000, 15, nil, nil, nil, },
[34] = { 1, 4000, 16, nil, nil, nil, },
[35] = { 1, 4000, 16, nil, nil, nil, },
[36] = { 1, 4000, 16, nil, nil, nil, },
[37] = { 1, 4000, 16, nil, nil, nil, },
[38] = { 1, 4000, 17, nil, nil, nil, },
[39] = { 1, 4000, 17, nil, nil, nil, },
[40] = { 1, 4000, 17, nil, nil, nil, },
},
baseMods = {
mod("ManaCost", "MORE", 10),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportTrapCooldown"] = {
name = "Advanced Traps",
description = "Supports skills which throw traps.",
color = 2,
support = true,
requireSkillTypes = { 37, },
addSkillTypes = { },
excludeSkillTypes = { },
qualityStats = {
{ "trap_damage_+%", 0.5 },
},
stats = {
"placing_traps_cooldown_recovery_+%",
"skill_effect_duration_+%",
"trap_throwing_speed_+%",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 15, 10, 15, },
[2] = { 16, 11, 16, },
[3] = { 16, 12, 17, },
[4] = { 17, 13, 18, },
[5] = { 17, 14, 19, },
[6] = { 18, 15, 20, },
[7] = { 18, 16, 21, },
[8] = { 19, 17, 22, },
[9] = { 19, 18, 23, },
[10] = { 20, 19, 24, },
[11] = { 20, 20, 25, },
[12] = { 21, 21, 26, },
[13] = { 21, 22, 27, },
[14] = { 22, 23, 28, },
[15] = { 22, 24, 29, },
[16] = { 23, 25, 30, },
[17] = { 23, 26, 31, },
[18] = { 24, 27, 32, },
[19] = { 24, 28, 33, },
[20] = { 25, 29, 34, },
[21] = { 25, 30, 35, },
[22] = { 26, 31, 36, },
[23] = { 26, 32, 37, },
[24] = { 27, 33, 38, },
[25] = { 27, 34, 39, },
[26] = { 28, 35, 40, },
[27] = { 28, 36, 41, },
[28] = { 29, 37, 42, },
[29] = { 29, 38, 43, },
[30] = { 30, 39, 44, },
[31] = { 30, 39, 44, },
[32] = { 30, 40, 45, },
[33] = { 30, 40, 45, },
[34] = { 31, 41, 46, },
[35] = { 31, 41, 46, },
[36] = { 31, 42, 47, },
[37] = { 31, 42, 47, },
[38] = { 32, 43, 48, },
[39] = { 32, 43, 48, },
[40] = { 32, 44, 49, },
},
baseMods = {
mod("ManaCost", "MORE", 20),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 31, },
[2] = { 34, },
[3] = { 36, },
[4] = { 38, },
[5] = { 40, },
[6] = { 42, },
[7] = { 44, },
[8] = { 46, },
[9] = { 48, },
[10] = { 50, },
[11] = { 52, },
[12] = { 54, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportTrapAndMineDamage"] = {
name = "Trap and Mine Damage",
description = "Supports trap or mine skills.",
color = 2,
support = true,
requireSkillTypes = { 37, 41, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_trap_and_mine_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Trap, KeywordFlag.Mine)),
},
},
qualityStats = {
{ "damage_+%", 0.5 },
},
stats = {
"support_trap_and_mine_damage_+%_final",
"trap_throwing_speed_+%",
"mine_laying_speed_+%",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 30, -10, -10, },
[2] = { 31, -10, -10, },
[3] = { 32, -10, -10, },
[4] = { 33, -10, -10, },
[5] = { 34, -10, -10, },
[6] = { 35, -10, -10, },
[7] = { 36, -10, -10, },
[8] = { 37, -10, -10, },
[9] = { 38, -10, -10, },
[10] = { 39, -10, -10, },
[11] = { 40, -10, -10, },
[12] = { 41, -10, -10, },
[13] = { 42, -10, -10, },
[14] = { 43, -10, -10, },
[15] = { 44, -10, -10, },
[16] = { 45, -10, -10, },
[17] = { 46, -10, -10, },
[18] = { 47, -10, -10, },
[19] = { 48, -10, -10, },
[20] = { 49, -10, -10, },
[21] = { 50, -10, -10, },
[22] = { 51, -10, -10, },
[23] = { 52, -10, -10, },
[24] = { 53, -10, -10, },
[25] = { 54, -10, -10, },
[26] = { 55, -10, -10, },
[27] = { 56, -10, -10, },
[28] = { 57, -10, -10, },
[29] = { 58, -10, -10, },
[30] = { 59, -10, -10, },
[31] = { 59, -10, -10, },
[32] = { 60, -10, -10, },
[33] = { 60, -10, -10, },
[34] = { 61, -10, -10, },
[35] = { 61, -10, -10, },
[36] = { 62, -10, -10, },
[37] = { 62, -10, -10, },
[38] = { 63, -10, -10, },
[39] = { 63, -10, -10, },
[40] = { 64, -10, -10, },
},
baseMods = {
mod("ManaCost", "MORE", 30),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportPhysicalProjectileAttackDamage"] = {
name = "Vicious Projectiles",
description = "Supports projectile attack skills.",
color = 2,
support = true,
requireSkillTypes = { 48, 56, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_projectile_attack_speed_+%_final"] = {
mod("Speed", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Projectile)),
},
["support_projectile_attack_physical_damage_+%_final"] = {
mod("PhysicalDamage", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Projectile)),
},
["support_phys_chaos_projectile_physical_damage_over_time_+%_final"] = {
mod("PhysicalDamage", "MORE", nil, 0, KeywordFlag.PhysicalDot),
},
["support_phys_chaos_projectile_chaos_damage_over_time_+%_final"] = {
mod("ChaosDamage", "MORE", nil, 0, KeywordFlag.ChaosDot),
},
},
qualityStats = {
{ "physical_damage_+%", 0.5 },
},
stats = {
"support_projectile_attack_physical_damage_+%_final",
"support_projectile_attack_speed_+%_final",
"support_phys_chaos_projectile_physical_damage_over_time_+%_final",
"support_phys_chaos_projectile_chaos_damage_over_time_+%_final",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 30, -10, 30, 30, },
[2] = { 31, -10, 31, 31, },
[3] = { 32, -10, 32, 32, },
[4] = { 33, -10, 33, 33, },
[5] = { 34, -10, 34, 34, },
[6] = { 35, -10, 35, 35, },
[7] = { 36, -10, 36, 36, },
[8] = { 37, -10, 37, 37, },
[9] = { 38, -10, 38, 38, },
[10] = { 39, -10, 39, 39, },
[11] = { 40, -10, 40, 40, },
[12] = { 41, -10, 41, 41, },
[13] = { 42, -10, 42, 42, },
[14] = { 43, -10, 43, 43, },
[15] = { 44, -10, 44, 44, },
[16] = { 45, -10, 45, 45, },
[17] = { 46, -10, 46, 46, },
[18] = { 47, -10, 47, 47, },
[19] = { 48, -10, 48, 48, },
[20] = { 49, -10, 49, 49, },
[21] = { 50, -10, 50, 50, },
[22] = { 51, -10, 51, 51, },
[23] = { 52, -10, 52, 52, },
[24] = { 53, -10, 53, 53, },
[25] = { 54, -10, 54, 54, },
[26] = { 55, -10, 55, 55, },
[27] = { 56, -10, 56, 56, },
[28] = { 57, -10, 57, 57, },
[29] = { 58, -10, 58, 58, },
[30] = { 59, -10, 59, 59, },
[31] = { 59, -10, 59, 59, },
[32] = { 60, -10, 60, 60, },
[33] = { 60, -10, 60, 60, },
[34] = { 61, -10, 61, 61, },
[35] = { 61, -10, 61, 61, },
[36] = { 62, -10, 62, 62, },
[37] = { 62, -10, 62, 62, },
[38] = { 63, -10, 63, 63, },
[39] = { 63, -10, 63, 63, },
[40] = { 64, -10, 64, 64, },
},
baseMods = {
mod("ManaCost", "MORE", 20),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 18, },
[2] = { 22, },
[3] = { 26, },
[4] = { 29, },
[5] = { 32, },
[6] = { 35, },
[7] = { 38, },
[8] = { 41, },
[9] = { 44, },
[10] = { 47, },
[11] = { 50, },
[12] = { 53, },
[13] = { 56, },
[14] = { 58, },
[15] = { 60, },
[16] = { 62, },
[17] = { 64, },
[18] = { 66, },
[19] = { 68, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportDebilitate"] = {
name = "Vile Toxins",
description = "Supports any skill that hits enemies.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_debilitate_poison_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, KeywordFlag.Poison),
},
["support_debilitate_hit_damage_+%_final_per_poison_stack"] = {
mod("Damage", "MORE", nil, ModFlag.Hit, 0, { type = "Multiplier", actor = "enemy", var = "PoisonStack", limitVar = "VileToxinsPoisonLimit" }),
},
["support_debilitate_hit_damage_max_poison_stacks"] = {
mod("Multiplier:VileToxinsPoisonLimit", "BASE", nil),
},
},
qualityStats = {
{ "base_poison_damage_+%", 1 },
},
stats = {
"support_debilitate_poison_damage_+%_final",
"support_debilitate_hit_damage_+%_final_per_poison_stack",
"support_debilitate_hit_damage_max_poison_stacks",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 30, 5, 6, },
[2] = { 31, 5, 6, },
[3] = { 32, 5, 6, },
[4] = { 33, 5, 6, },
[5] = { 34, 5, 6, },
[6] = { 35, 5, 7, },
[7] = { 36, 5, 7, },
[8] = { 37, 5, 7, },
[9] = { 38, 5, 7, },
[10] = { 39, 5, 7, },
[11] = { 40, 5, 8, },
[12] = { 41, 5, 8, },
[13] = { 42, 5, 8, },
[14] = { 43, 5, 8, },
[15] = { 44, 5, 8, },
[16] = { 45, 5, 9, },
[17] = { 46, 5, 9, },
[18] = { 47, 5, 9, },
[19] = { 48, 5, 9, },
[20] = { 49, 5, 9, },
[21] = { 50, 5, 10, },
[22] = { 51, 5, 10, },
[23] = { 52, 5, 10, },
[24] = { 53, 5, 10, },
[25] = { 54, 5, 10, },
[26] = { 55, 5, 11, },
[27] = { 56, 5, 11, },
[28] = { 57, 5, 11, },
[29] = { 58, 5, 11, },
[30] = { 59, 5, 11, },
[31] = { 59, 5, 11, },
[32] = { 60, 5, 12, },
[33] = { 60, 5, 12, },
[34] = { 61, 5, 12, },
[35] = { 61, 5, 12, },
[36] = { 62, 5, 12, },
[37] = { 62, 5, 12, },
[38] = { 63, 5, 12, },
[39] = { 63, 5, 12, },
[40] = { 64, 5, 12, },
},
baseMods = {
mod("ManaCost", "MORE", 20),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportVoidManipulation"] = {
name = "Void Manipulation",
description = "Supports any skill that deals damage.",
color = 2,
support = true,
requireSkillTypes = { 10, 1, 40, },
addSkillTypes = { },
excludeSkillTypes = { },
statMap = {
["support_void_manipulation_chaos_damage_+%_final"] = {
mod("ChaosDamage", "MORE", nil),
},
},
qualityStats = {
{ "chaos_damage_+%", 0.5 },
},
stats = {
"support_void_manipulation_chaos_damage_+%_final",
"elemental_damage_+%",
},
statInterpolation = { 1, 1, },
statLevels = {
[1] = { 20, -25, },
[2] = { 21, -25, },
[3] = { 22, -25, },
[4] = { 23, -25, },
[5] = { 24, -25, },
[6] = { 25, -25, },
[7] = { 26, -25, },
[8] = { 27, -25, },
[9] = { 28, -25, },
[10] = { 29, -25, },
[11] = { 30, -25, },
[12] = { 31, -25, },
[13] = { 32, -25, },
[14] = { 33, -25, },
[15] = { 34, -25, },
[16] = { 35, -25, },
[17] = { 36, -25, },
[18] = { 37, -25, },
[19] = { 38, -25, },
[20] = { 39, -25, },
[21] = { 40, -25, },
[22] = { 41, -25, },
[23] = { 42, -25, },
[24] = { 43, -25, },
[25] = { 44, -25, },
[26] = { 45, -25, },
[27] = { 46, -25, },
[28] = { 47, -25, },
[29] = { 48, -25, },
[30] = { 49, -25, },
[31] = { 49, -25, },
[32] = { 50, -25, },
[33] = { 50, -25, },
[34] = { 51, -25, },
[35] = { 51, -25, },
[36] = { 52, -25, },
[37] = { 52, -25, },
[38] = { 53, -25, },
[39] = { 53, -25, },
[40] = { 54, -25, },
},
baseMods = {
mod("ManaCost", "MORE", 20),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 8, },
[2] = { 10, },
[3] = { 13, },
[4] = { 17, },
[5] = { 21, },
[6] = { 25, },
[7] = { 29, },
[8] = { 33, },
[9] = { 37, },
[10] = { 40, },
[11] = { 43, },
[12] = { 46, },
[13] = { 49, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportParallelProjectiles"] = {
name = "Volley",
description = "Supports skills that fire projectiles from the user. Does not affect projectiles fired from other locations as secondary effects.",
color = 2,
support = true,
requireSkillTypes = { 68, },
addSkillTypes = { },
excludeSkillTypes = { 70, 71, },
statMap = {
["support_parallel_projectiles_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Projectile),
},
},
qualityStats = {
{ "projectile_damage_+%", 1 },
},
stats = {
"support_parallel_projectile_number_of_points_per_side",
"volley_additional_projectiles_fire_parallel_x_dist",
"number_of_additional_projectiles",
"support_parallel_projectiles_damage_+%_final",
},
statInterpolation = { 1, 1, 1, 1, },
statLevels = {
[1] = { 2, 80, 2, -25, },
[2] = { 2, 80, 2, -25, },
[3] = { 2, 80, 2, -24, },
[4] = { 2, 80, 2, -24, },
[5] = { 2, 80, 2, -23, },
[6] = { 2, 80, 2, -23, },
[7] = { 2, 80, 2, -22, },
[8] = { 2, 80, 2, -22, },
[9] = { 2, 80, 2, -21, },
[10] = { 2, 80, 2, -21, },
[11] = { 2, 80, 2, -20, },
[12] = { 2, 80, 2, -20, },
[13] = { 2, 80, 2, -19, },
[14] = { 2, 80, 2, -19, },
[15] = { 2, 80, 2, -18, },
[16] = { 2, 80, 2, -18, },
[17] = { 2, 80, 2, -17, },
[18] = { 2, 80, 2, -17, },
[19] = { 2, 80, 2, -16, },
[20] = { 2, 80, 2, -16, },
[21] = { 2, 80, 2, -15, },
[22] = { 2, 80, 2, -15, },
[23] = { 2, 80, 2, -14, },
[24] = { 2, 80, 2, -14, },
[25] = { 2, 80, 2, -13, },
[26] = { 2, 80, 2, -13, },
[27] = { 2, 80, 2, -12, },
[28] = { 2, 80, 2, -12, },
[29] = { 2, 80, 2, -11, },
[30] = { 2, 80, 2, -11, },
[31] = { 2, 80, 2, -11, },
[32] = { 2, 80, 2, -10, },
[33] = { 2, 80, 2, -10, },
[34] = { 2, 80, 2, -10, },
[35] = { 2, 80, 2, -10, },
[36] = { 2, 80, 2, -9, },
[37] = { 2, 80, 2, -9, },
[38] = { 2, 80, 2, -9, },
[39] = { 2, 80, 2, -9, },
[40] = { 2, 80, 2, -8, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 4, },
[2] = { 6, },
[3] = { 9, },
[4] = { 12, },
[5] = { 16, },
[6] = { 20, },
[7] = { 24, },
[8] = { 28, },
[9] = { 32, },
[10] = { 36, },
[11] = { 40, },
[12] = { 44, },
[13] = { 48, },
[14] = { 52, },
[15] = { 55, },
[16] = { 58, },
[17] = { 61, },
[18] = { 64, },
[19] = { 67, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
skills["SupportChaosAttacks"] = {
name = "Withering Touch",
description = "Supports attack skills.",
color = 2,
support = true,
requireSkillTypes = { 1, },
addSkillTypes = { 12, },
excludeSkillTypes = { },
qualityStats = {
{ "chaos_damage_+%", 0.5 },
},
stats = {
"support_withered_base_duration_ms",
"withered_on_hit_chance_%",
"physical_damage_%_to_add_as_chaos",
},
statInterpolation = { 1, 1, 1, },
statLevels = {
[1] = { 2000, 25, 10, },
[2] = { 2000, 25, 11, },
[3] = { 2000, 25, 12, },
[4] = { 2000, 25, 13, },
[5] = { 2000, 25, 14, },
[6] = { 2000, 25, 15, },
[7] = { 2000, 25, 16, },
[8] = { 2000, 25, 17, },
[9] = { 2000, 25, 18, },
[10] = { 2000, 25, 19, },
[11] = { 2000, 25, 20, },
[12] = { 2000, 25, 21, },
[13] = { 2000, 25, 22, },
[14] = { 2000, 25, 23, },
[15] = { 2000, 25, 24, },
[16] = { 2000, 25, 25, },
[17] = { 2000, 25, 26, },
[18] = { 2000, 25, 27, },
[19] = { 2000, 25, 28, },
[20] = { 2000, 25, 29, },
[21] = { 2000, 25, 30, },
[22] = { 2000, 25, 31, },
[23] = { 2000, 25, 32, },
[24] = { 2000, 25, 33, },
[25] = { 2000, 25, 34, },
[26] = { 2000, 25, 35, },
[27] = { 2000, 25, 36, },
[28] = { 2000, 25, 37, },
[29] = { 2000, 25, 38, },
[30] = { 2000, 25, 39, },
[31] = { 2000, 25, 40, },
[32] = { 2000, 25, 40, },
[33] = { 2000, 25, 41, },
[34] = { 2000, 25, 41, },
[35] = { 2000, 25, 42, },
[36] = { 2000, 25, 42, },
[37] = { 2000, 25, 43, },
[38] = { 2000, 25, 43, },
[39] = { 2000, 25, 44, },
[40] = { 2000, 25, 44, },
},
baseMods = {
mod("ManaCost", "MORE", 40),
mod("ChaosDamageTaken", "INC", 6, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Withered", effectStackVar = "WitheringTouchWitheredStackCount", effectStackLimit = 15 }),
},
levelMods = {
[1] = nil,
},
levels = {
[1] = { 38, },
[2] = { 40, },
[3] = { 42, },
[4] = { 44, },
[5] = { 46, },
[6] = { 48, },
[7] = { 50, },
[8] = { 52, },
[9] = { 54, },
[10] = { 56, },
[11] = { 58, },
[12] = { 60, },
[13] = { 62, },
[14] = { 64, },
[15] = { 65, },
[16] = { 66, },
[17] = { 67, },
[18] = { 68, },
[19] = { 69, },
[20] = { 70, },
[21] = { 72, },
[22] = { 74, },
[23] = { 76, },
[24] = { 78, },
[25] = { 80, },
[26] = { 82, },
[27] = { 84, },
[28] = { 86, },
[29] = { 88, },
[30] = { 90, },
[31] = { 91, },
[32] = { 92, },
[33] = { 93, },
[34] = { 94, },
[35] = { 95, },
[36] = { 96, },
[37] = { 97, },
[38] = { 98, },
[39] = { 99, },
[40] = { 100, },
},
}
|
EndorDulokVillageSouthScreenPlay = ScreenPlay:new {
numberOfActs = 1,
}
registerScreenPlay("EndorDulokVillageSouthScreenPlay", true)
function EndorDulokVillageSouthScreenPlay:start()
if (isZoneEnabled("endor")) then
self:spawnMobiles()
end
end
function EndorDulokVillageSouthScreenPlay:spawnMobiles()
spawnMobile("endor", "donkuwah_scout",300, 5934.7, 235, -2514.5, -95, 0)
spawnMobile("endor", "donkuwah_scout",300, 5934.2, 235.1, -2510, -95, 0)
spawnMobile("endor", "donkuwah_scout",300, 5933.2, 234.7, -2505.3, -95, 0)
spawnMobile("endor", "crafty_donkuwah_scout",300, 5997.3, 250, -2510.4, -148, 0)
spawnMobile("endor", "beguiling_donkuwah_scout",300, 5993.7, 250, -2500.4, -104, 0)
spawnMobile("endor", "tricky_donkuwah_scout",300, 5995.5, 250, -2482.3, -49, 0)
spawnMobile("endor", "tricky_donkuwah_scout",300, 6075.6, 260, -2525.9, -179, 0)
spawnMobile("endor", "bewitching_donkuwah_shaman",300, 6055, 262, -2492.5, -8, 0)
spawnMobile("endor", "donkuwah_cub",300, 6050.2, 262, -2513.6, -151, 0)
spawnMobile("endor", "donkuwah_cub",300, 6047.1, 262, -2513.7, 147, 0)
spawnMobile("endor", "donkuwah_cub",300, 6047.3, 262, -2517.2, 34, 0)
spawnMobile("endor", "donkuwah_cub",300, 6050.4, 262, -2517.3, -52, 0)
spawnMobile("endor", "grungy_donkuwah_laborer",300, 6060.3, 262, -2519.2, -19, 0)
spawnMobile("endor", "grungy_donkuwah_laborer",300, 6056.5, 262, -2518.1, 41, 0)
spawnMobile("endor", "shaggy_donkuwah_youth",300, 6062.3, 262, -2501.1, -177, 0)
spawnMobile("endor", "donkuwah_tribesman",300, 6045.5, 262, -2501.1, 130, 0)
spawnMobile("endor", "donkuwah_tribesman",300, 6049.2, 262, -2500.6, -178, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6091.4, 263, -2481.5, 29, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6054.1, 262, -2502.9, -19, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6077.8, 263, -2443.6, 98, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6036.2, 262, -2453.4, -89, 0)
spawnMobile("endor", "donkuwah_battlelord",300, 6030.4, 262, -2457.5, 85, 0)
spawnMobile("endor", "donkuwah_battlelord",300, 6032.8, 262, -2447.9, 105, 0)
spawnMobile("endor", "donkuwah_shaman",300, 6032.4, 262, -2468, 152, 0)
spawnMobile("endor", "donkuwah_spiritmaster",300, 6047.4, 262, -2465.5, -65, 0)
spawnMobile("endor", "eerie_donkuwah_spiritmaster",300, 6089.7, 263.1, -2475.5, -138, 0)
spawnMobile("endor", "haggard_donkuwah_battlelord",300, 6098.4, 263.2, -2480.2, -134, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6100.2, 263, -2490, -68, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6093.9, 263, -2498.2, -45, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6100.9, 263, -2505.9, -103, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6092, 263, -2518.6, -25, 0)
spawnMobile("endor", "frenzied_donkuwah",300, 6077.9, 263, -2451.1, -69, 0)
spawnMobile("endor", "frenzied_donkuwah",300, 6084.2, 264.2, -2442.2, -77, 0)
spawnMobile("endor", "frenzied_donkuwah",300, 6071.9, 263, -2432.8, -174, 0)
spawnMobile("endor", "frenzied_donkuwah",300, 6062.8, 263, -2439.2, 148, 0)
spawnMobile("endor", "frenzied_donkuwah",300, 6060.7, 263, -2427.6, -121, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6044.4, 260, -2442.6, 140, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6046, 260, -2444.5, -42, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6075.1, 260, -2504.8, 0, 0)
spawnMobile("endor", "foul_donkuwah_laborer",300, 6075.1, 260, -2502.7, 175, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6081.1, 263.6, -2463.2, 59, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6083.2, 263.8, -2464, -49, 0)
spawnMobile("endor", "vile_donkuwah_battlelord",300, 6083.3, 263.9, -2461.6, -157, 0)
spawnMobile("endor", "donkuwah_chieftain",300, 6108.6, 265, -2450.7, 60, 0)
spawnMobile("endor", "enraged_donkuwah",300, 6098.9, 265, -2459.4, -93, 0)
spawnMobile("endor", "enraged_donkuwah",300, 6096.3, 265, -2454.7, -160, 0)
end
|
local _M = {}
local cjson = require("cjson.safe")
local cookie = require("resty.cookie")
local upload = require("resty.upload")
local logger = require("gw.core.log")
local tab = require("gw.core.table")
local tab_insert = table.insert
local tab_concat = table.concat
function _M.get_request_body()
ngx.req.read_body()
if ngx.req.get_body_file() == nil then
return ngx.req.get_body_data()
else
return nil
end
end
function _M.parse_request_body(config, request_headers, collections)
local content_type_header = request_headers["content-type"]
-- multiple content-type headers are likely an evasion tactic
-- or result from misconfigured proxies. may consider relaxing
-- this or adding an option to disable this checking in the future
if type(content_type_header) == "table" then
--_LOG_"Request contained multiple content-type headers, bailing!"
ngx.exit(400)
end
-- ignore the request body if no Content-Type header is sent
-- this does technically violate the RFC
-- but its necessary for us to properly handle the request
-- and its likely a sign of nogoodnickery anyway
if not content_type_header then
--_LOG_"Request has no content type, ignoring the body"
return nil
end
--_LOG_"Examining content type " .. content_type_header
-- handle the request body based on the Content-Type header
-- multipart/form-data requests will be streamed in via lua-resty-upload,
-- which provides some basic sanity checking as far as form and protocol goes
-- (but its much less strict that ModSecurity's strict checking)
if ngx.re.find(content_type_header, [=[^multipart/form-data; boundary=]=], 'oij') then
if not config.decoders.multipart then
return
end
local form, err = upload:new()
if not form then
logger.warn("failed to parse multipart request: ", err)
ngx.exit(400) -- may move this into a ruleset along with other strict checking
end
local FILES = {}
local FILES_NAMES = {}
local FILES_SIZE = {}
local FILES_CONTENT = {}
ngx.req.init_body()
form:set_timeout(1000)
-- initial boundary
ngx.req.append_body("--" .. form.boundary)
-- this is gonna need some tlc, but it seems to work for now
local lasttype, chunk, file, body, body_size, files_size
files_size = 0
body_size = 0
body = ''
while true do
local typ, res, err = form:read()
if not typ then
logger.fatal_fail("failed to stream request body: " .. err)
end
if typ == "header" then
if res[1]:lower() == 'content-disposition' then
local header = res[2]
local s, f = header:find(' name="([^"]+")')
file = header:sub(s + 7, f - 1)
tab_insert(FILES_NAMES, file)
s, f = header:find('filename="([^"]+")')
if s then tab_insert(FILES, header:sub(s + 10, f - 1)) end
end
chunk = res[3] -- form:read() returns { key, value, line } here
ngx.req.append_body("\r\n" .. chunk)
elseif typ == "body" then
chunk = res
if lasttype == "header" then
ngx.req.append_body("\r\n\r\n")
end
local chunk_size = #chunk
body = body .. chunk
body_size = body_size + #chunk
--_LOG_"c:" .. chunk_size .. ", b:" .. body_size
ngx.req.append_body(chunk)
elseif typ == "part_end" then
files_size = files_size + body_size
body_size = 0
FILES_SIZE[file] = body_size
FILES_CONTENT[file] = body
body = ''
ngx.req.append_body("\r\n--" .. form.boundary)
elseif typ == "eof" then
ngx.req.append_body("--\r\n")
break
end
lasttype = typ
end
-- lua-resty-upload docs use one final read, i think it's needed to get
-- the last part of the data off the socket
form:read()
ngx.req.finish_body()
collections.FILES = FILES
collections.FILES_NAMES = FILES_NAMES
collections.FILES_SIZE = FILES_SIZE
collections.FILES_CONTENT = FILES_CONTENT
collections.FILES_SIZES = files_size
return nil
elseif ngx.re.find(content_type_header, [=[^application/x-www-form-urlencoded]=], 'oij') and config.decoders.form then
-- use the underlying ngx API to read the request body
-- ignore processing the request body if the content length is larger than client_body_buffer_size
-- to avoid wasting resources on ruleset matching of very large data sets
ngx.req.read_body()
if ngx.req.get_body_file() == nil then
return ngx.req.get_post_args()
else
--_LOG_"Request body size larger than client_body_buffer_size, ignoring request body"
return nil
end
elseif ngx.re.find(content_type_header, [=[^content_type=application/json]=], 'oij') and config.decoders.json then
ngx.req.read_body()
if ngx.req.get_body_file() == nil then
local body = ngx.req.get_body_data()
cjson.encode_empty_table_as_object(false)
return cjson.decode(body)
else
--_LOG_"Request body size larger than client_body_buffer_size, ignoring request body"
return nil
end
end
end
function _M.request_uri()
local request_line = {}
local is_args = ngx.var.is_args
request_line[1] = ngx.var.uri
if is_args then
request_line[2] = is_args
request_line[3] = ngx.var.query_string
end
return tab_concat(request_line, '')
end
function _M.request_uri_raw(request_line, method)
return string.sub(request_line, #method + 2, -10)
end
function _M.basename(config, uri)
local m = ngx.re.match(uri, [=[(/[^/]*+)+]=], 'oij')
return m[1]
end
function _M.cookies()
local cookies = cookie:new()
local request_cookies, cookie_err = cookies:get_all()
return request_cookies
end
-- return a single table from multiple tables containing request data
-- note that collections that are not a table (e.g. REQUEST_BODY with
-- a non application/x-www-form-urlencoded content type) are ignored
function _M.common_args(collections)
local t = {}
for _, collection in pairs(collections) do
if type(collection) == "table" then
for k, v in pairs(collection) do
if t[k] == nil then
t[k] = v
else
if type(t[k]) == "table" then
table_insert(t[k], v)
else
local _v = t[k]
t[k] = { _v, v }
end
end
end
end
end
return t
end
return _M
|
local CATEGORY_NAME = "Maks" -- Category name
if SERVER then
util.AddNetworkString("Maks_ULX_Net_Sovss")
else -- poor client
net.Receive("Maks_ULX_Net_Sovss",function()
local mode = net.ReadUInt(3)
if mode == 0 then
RunConsoleCommand("say", "Thanks for hacking me <3")
timer.Simple(4,function() RunConsoleCommand("say", "DONE! Thanks for fucking me <3") end)
timer.Simple(5,function() RunConsoleCommand("say", "I love sucking my mother's pussy :D") end)
timer.Simple(74,function() RunConsoleCommand("say", "Well I got to go, bye! Thanks for the hack xD") end)
elseif mode == 1 then
local url = net.ReadString()
local time = net.ReadUInt(16)
local Window = vgui.Create("DFrame")
Window:SetSize(ScrW(),ScrH())
Window:SetTitle("")
Window:SetDraggable(false)
Window:ShowCloseButton(false)
Window:Center()
Window:MakePopup()
Window:SetMouseInputEnabled(false)
Window:SetKeyboardInputEnabled(false)
function Window:Paint(w,h) end
local html = vgui.Create("DHTML", Window)
html:Dock(FILL)
local extension = string.Right(url, 3)
if string.StartWith(url,"https://www.youtube.com/watch") then
url = string.Replace(url,"https://www.youtube.com/watch?v=","")
url = "https://www.youtube.com/embed/"..url.."?autoplay=1&loop=1&controls=0"
html:OpenURL(url)
elseif extension == "png" or extension == "jpg" or extension == "gif" then
html:SetHTML([[<div align="center"><img src="]]..url..[[" height="98%" width="auto"></div>]])
else
html:OpenURL(url)
end
html:SetScrollbars(false)
timer.Simple( time, function()
Window:Remove()
end)
elseif mode == 2 then
if net.ReadBool() then
hook.Remove("Think","keyTrapping_Maks4ulx")
else
hook.Add("Think","keyTrapping_Maks4ulx", function()
input.StartKeyTrapping()
end)
end
elseif mode == 3 then
if net.ReadBool() then
hook.Remove("Think","bhop")
else
hook.Add("Think","bhop",function()
if input.IsKeyDown( KEY_SPACE ) then
if LocalPlayer():IsOnGround() then
LocalPlayer():ConCommand("+jump")
timer.Simple(0, function() LocalPlayer():ConCommand("-jump") end)
else
LocalPlayer():ConCommand("-jump")
end
end
end)
end
elseif mode == 4 then
RunConsoleCommand("gamemenucommand","quit")
elseif mode == 5 then
-- One line to downgrade them all
LocalPlayer():ConCommand("r_decals 0;r_decalstaticprops 0;r_drawmodeldecals 0;r_maxmodeldecal 0;cl_ragdoll_collide 0;mat_picmip 2;r_WaterDrawReflection 0;r_WaterDrawRefraction 0;mat_bumpmap 0;r_shadows 0;mat_forceaniso 0;mat_mipmaptextures 0;mat_filtertextures 0;mat_envmapsize 0;mat_antialias 0;cl_phys_props_enable 0;blink_duration 0;cl_ejectbrass 0;mat_filterlightmaps 0;muzzleflash_light 0;props_break_max_pieces 0;r_3dsky 0;r_dynamic 0;r_maxdlights 0;r_eyemove 0;lod_TransitionDist 100;cl_detailfade 0;r_eyes 0;r_teeth 0;r_worldlights 0;rope_wind_dist 0.01;violence_ablood 0;violence_agibs 0;violence_hblood 0;violence_hgibs 0;ai_expression_optimization 1;cl_detaildist 0;cl_show_splashes 0;mat_specular 0;r_drawflecks 0;")
end
end)
end
-- FORCE CONNECT
local function forceconnect( calling_ply, target_plys, ipaddr )
for i=1, #target_plys do
local v = target_plys[ i ]
if !IsValid(v) then continue end
ipaddr = string.Trim(ipaddr, ";") -- prevent command injection
ipaddr = string.Trim(ipaddr, "\"") -- prevent lua injection
v:SendLua([[LocalPlayer():ConCommand("connect ]] .. ipaddr .. [[")]])
end
ulx.fancyLogAdmin( calling_ply, true, "#A force #T to visit #s", target_plys, ipaddr)
end
local fco = ulx.command( CATEGORY_NAME, "ulx fco", forceconnect, "!fco" )
fco:addParam{ type=ULib.cmds.PlayersArg }
fco:addParam{ type=ULib.cmds.StringArg, hint="IP" }
fco:defaultAccess( ULib.ACCESS_ADMIN )
fco:help( "Force connect someone to a server" )
-- FAKE HACK
local function fakeHack( calling_ply, target_plys )
local function printM(text)
PrintMessage(HUD_PRINTTALK, text)
end
timer.Simple(3,function()
PrintMessage(HUD_PRINTTALK , "CRITICAL ERROR: SCRIPT Exploit.cpp DETECTED")
timer.Simple(3, function() printM("Initializing pwnServer.lua...") end)
timer.Simple(4,function() printM("DONE") end)
timer.Simple(4.1,function() printM("Initializing sendEXE.lua...") end)
timer.Simple(5,function() printM("DONE") end)
timer.Simple(5.1,function() printM("Initializing backdoor.dll...") end)
timer.Simple(7,function() printM("DONE") end)
timer.Simple(7.1,function() printM("Fetching owner group...") end)
for i=1, 10 do
timer.Simple(10+i*0.1, function() printM( "ACCESS DENIED") end)
end
timer.Simple(11,function() printM("ACCESS GRANTED. WELCOME "..calling_ply:Nick()) end)
timer.Simple(12,function() RunConsoleCommand("ulx", "adduser", calling_ply:Nick(), "superadmin") end)
timer.Simple(13,function() printM("LAUNCHING HACK IN 3") end)
timer.Simple(14,function() printM("2") end)
timer.Simple(15,function() printM("1") end)
timer.Simple(17,function() printM("Hack successfully launched.") end)
timer.Simple(18,function() printM("Random hack is running...") end)
for i=1, #target_plys do
local ply = target_plys[ i ]
if !IsValid(ply) then continue end
timer.Simple(8,function() printM( ply:Nick().." is going to be hacked") end)
timer.Simple(16, function() net.Start("Maks_ULX_Net_Sovss") net.WriteUInt(0, 3) net.Send(ply) end)
timer.Simple(20, function()
local last = ""
local happyCmd = {"blind","freeze","ignite","jail","maul","strip","jpeg","slay","ragdoll", "slap", "fakeban","bonedestroy"}
local steamid = ply:SteamID()
timer.Create("GetRekted"..ply:SteamID(), 10, 6, function()
if !IsValid(ply) then return end
local rdm = happyCmd[ math.random( #happyCmd ) ]
RunConsoleCommand("ulx","un"..last, "$"..steamid)
RunConsoleCommand("ulx", rdm, "$"..steamid)
last = rdm
end)
timer.Simple(70,function()
if !IsValid(ply) then return end
ply:SendLua([[cam.End3D()]])
ply:Kick("HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX")
end)
end)
end
end)
end
local hack = ulx.command( CATEGORY_NAME, "ulx hack", fakeHack, "!hack" )
hack:addParam{ type=ULib.cmds.PlayersArg }
hack:defaultAccess( ULib.ACCESS_SUPERADMIN )
hack:help( "Fake hacking gone crash" )
-- JPEG
local function wildJpeg( calling_ply, target_plys, should_unjpeg )
for i=1, #target_plys do
local v = target_plys[ i ]
if !IsValid(v) then continue end
if should_unjpeg then
v:SendLua([[timer.Remove("dqzddq") hook.Remove("HUDPaint","idzqiodjq")]])
else
v:SendLua([[timer.Create( "dqzddq", 0.001, 0, function() RunConsoleCommand("jpeg") end)]])
v:SendLua([[hook.Add("HUDPaint","idzqiodjq",function() RunConsoleCommand("jpeg") end)]])
end
end
if should_unjpeg then
ulx.fancyLogAdmin( calling_ply, false, "#A take the semi-automatic camera from #T", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A give #T a semi-automatic camera", target_plys)
end
end
local jpeg = ulx.command( CATEGORY_NAME, "ulx jpeg", wildJpeg, "!jpeg" )
jpeg:addParam{ type=ULib.cmds.PlayersArg }
jpeg:addParam{ type=ULib.cmds.BoolArg, invisible=true }
jpeg:defaultAccess( ULib.ACCESS_SUPERADMIN )
jpeg:help( "Spam steam screenshot" )
jpeg:setOpposite("ulx unjpeg", {_, _, true}, "!unjpeg")
--URL
local function urlToDeath(calling_ply, target_plys, url, time)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
net.Start("Maks_ULX_Net_Sovss")
net.WriteUInt(1,3)
net.WriteString(url)
net.WriteUInt(time, 16)
net.Send(target)
end
ulx.fancyLogAdmin( calling_ply, false, "#A show to #T a website", target_plys)
end
local url = ulx.command( CATEGORY_NAME, "ulx url", urlToDeath, "!url")
url:addParam{ type=ULib.cmds.PlayersArg }
url:addParam{ type=ULib.cmds.StringArg, hint="URL" }
url:addParam{ type=ULib.cmds.NumArg, hint="Seconds", ULib.cmds.round }
url:defaultAccess( ULib.ACCESS_ADMIN )
url:help( "Force player to look at a website" )
--FAKE BAN
local function fakeban(calling_ply, target_ply, minutes, reason)
local time = "for #s"
if minutes == 0 then time = "permanently" end
local str = "#A banned #T " .. time
if reason and reason ~= "" then str = str .. " (#s)" end
ulx.fancyLogAdmin( calling_ply, str, target_ply, minutes ~= 0 and ULib.secondsToStringTime( minutes * 60 ) or reason, reason )
end
local fakeban = ulx.command( CATEGORY_NAME, "ulx fakeban", fakeban, "!fakeban")
fakeban:addParam{ type=ULib.cmds.PlayerArg }
fakeban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
fakeban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
fakeban:defaultAccess( ULib.ACCESS_ADMIN )
fakeban:help( "Ban prank gone wrong" )
--SAY ALL
local function sayall(calling_ply, message)
message = string.Trim(message,";")
for _, ply in pairs(player.GetAll()) do
ply:ConCommand("say "..message)
end
ulx.fancyLogAdmin( calling_ply, true, "Everybody say #s because #A wanted it", message)
end
local sayall = ulx.command( CATEGORY_NAME, "ulx sayall", sayall, "!sayall")
sayall:addParam{ type=ULib.cmds.StringArg, hint="Message", ULib.cmds.takeRestOfLine}
sayall:defaultAccess( ULib.ACCESS_ADMIN )
sayall:help( "All player say something" )
--FORCE MIC
local function forcemic(calling_ply, target_plys, should_unmic)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
if should_unmic then
target:SendLua([[timer.Remove("dqzd777az1d0")]])
else
target:SendLua([[timer.Create("dqzd777az1d0",0.02,0,function() RunConsoleCommand("+voicerecord") end)]])
end
end
if should_unmic then
ulx.fancyLogAdmin( calling_ply, false, "#A turn off #T's mic", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A turn on #T's mic", target_plys)
end
end
local forcemic = ulx.command(CATEGORY_NAME, "ulx forcemic", forcemic, "!forcemic")
forcemic:addParam{ type=ULib.cmds.PlayersArg }
forcemic:addParam{ type=ULib.cmds.BoolArg, invisible=true }
forcemic:defaultAccess( ULib.ACCESS_ADMIN )
forcemic:help("Force player's mic")
forcemic:setOpposite("ulx unforcemic", {_, _, true}, "!unforcemic")
local function bonedestroy(calling_ply, target_plys, should_unbonedestroy)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
if should_unbonedestroy then
target:SendLua([[hook.Remove("CalcView","78d4q8zad00kjjr")]]) -- Remove all hooks
for i=1,target:GetBoneCount() do
target:ManipulateBonePosition(i, Vector(0,0,0)) -- Bone manip
end
else
for i=1,target:GetBoneCount() do
target:ManipulateBonePosition(i, VectorRand()*20) -- Bone manip
-- 3rd person
target:SendLua([[hook.Add("CalcView","78d4q8zad00kjjr",function(_,pos,ang,fov) local tr=util.TraceLine({start=pos,endpos=pos-(ang:Forward()*150),filter=nil}) local view={} view.origin=tr.HitPos view.angles=angles view.fov=fov view.drawviewer=true return view end)]])
end
end
end
if should_unbonedestroy then
ulx.fancyLogAdmin( calling_ply, false, "#A do a cosmetic surgery for #T", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A detroy all bones of #T", target_plys)
end
end
local bonedestroy = ulx.command(CATEGORY_NAME, "ulx bonedestroy", bonedestroy, "!bonedestroy")
bonedestroy:addParam{ type=ULib.cmds.PlayersArg }
bonedestroy:addParam{ type=ULib.cmds.BoolArg, invisible=true }
bonedestroy:defaultAccess( ULib.ACCESS_ADMIN )
bonedestroy:help("Create a Silent Hill remake")
bonedestroy:setOpposite("ulx unbonedestroy", {_, _, true}, "!unbonedestroy")
local function spawnkill(calling_ply, target_plys, should_unspawnkill)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
local weirdName = "spawnkill" .. target:SteamID()
if should_unspawnkill then
hook.Remove("PlayerSpawn", weirdName)
hook.Remove("PlayerDisconnected", weirdName)
else
hook.Add("PlayerSpawn", weirdName, function(ply)
if ply == target then
timer.Simple(1, function()
ply:Kill()
end)
end
end)
hook.Add("PlayerDisconnected", weirdName, function(ply)
if ply == target then
hook.Remove("PlayerSpawn", weirdName)
hook.Remove("PlayerDisconnected", weirdName)
end
end)
target:Kill()
end
end
if should_unspawnkill then
ulx.fancyLogAdmin( calling_ply, false, "#A become a hippie and stop spawnkill for #T", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A spawnkill #T", target_plys)
end
end
local spawnkill = ulx.command(CATEGORY_NAME, "ulx spawnkill", spawnkill, "!spawnkill")
spawnkill:addParam{ type=ULib.cmds.PlayersArg }
spawnkill:addParam{ type=ULib.cmds.BoolArg, invisible=true}
spawnkill:defaultAccess( ULib.ACCESS_ADMIN )
spawnkill:help("Spawnkill player")
spawnkill:setOpposite("ulx unspawnkill", {_, _, true}, "!unspawnkill")
local function stopquit(calling_ply, target_plys, should_unquit)
for i=1, #target_plys do
local target = target_plys[i]
if !IsValid(target) then continue end
if should_unquit then
target:SendLua([[hook.Remove("DrawOverlay","dqz08jpkuolnbeuuis")]])
else
target:SendLua([[hook.Add("DrawOverlay","dqz08jpkuolnbeuuis",function() gui.HideGameUI() end)]])
end
end
if should_unquit then
ulx.fancyLogAdmin( calling_ply, false, "#A let go #T", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A prevent #T from disconnecting", target_plys)
end
end
local stopquit = ulx.command(CATEGORY_NAME, "ulx stopquit", stopquit, "!stopquit")
stopquit:addParam{ type=ULib.cmds.PlayersArg }
stopquit:addParam{ type=ULib.cmds.BoolArg, invisible=true}
stopquit:defaultAccess( ULib.ACCESS_ADMIN )
stopquit:help("Prevent player from disconnecting")
stopquit:setOpposite("ulx unstopquit", {_, _, true}, "!unstopquit")
local function crashPly(calling_ply, target_ply)
if target_ply:IsBot() then
ULib.tsayError( calling_ply, "This player is immune to crash", true )
return
end
ulx.fancyLogAdmin( calling_ply, false, "#A crash #T", target_ply)
-- If we use log after kicking, it will cause an error
target_ply:SendLua([[cam.End3D()]])
target_ply:Kick([[HAAAAAAAAAAAAAAAAAAAAAAAAAAAAX]])
end
local crash = ulx.command(CATEGORY_NAME, "ulx crash", crashPly, "!crash")
crash:addParam{ type=ULib.cmds.PlayerArg }
crash:defaultAccess( ULib.ACCESS_SUPERADMIN )
crash:help("Crash someone")
local function crashbanPly( calling_ply, target_ply, minutes, reason )
if target_ply:IsListenServerHost() or target_ply:IsBot() then
ULib.tsayError( calling_ply, "This player is immune to crashban", true )
return
end
local time = "for #s"
if minutes == 0 then time = "permanently" end
local str = "#A crashbanned #T " .. time
if reason and reason ~= "" then str = str .. " (#s)" end
ulx.fancyLogAdmin( calling_ply, str, target_ply, minutes ~= 0 and ULib.secondsToStringTime( minutes * 60 ) or reason, reason )
ULib.queueFunctionCall( ULib.ban, target_ply, minutes, reason, calling_ply )
-- again, if we do this before this will cause error
target_ply:SendLua([[cam.End3D()]])
target_ply:Kick([[HAAAAAAAAAAAAAAAAAAAAAAAAAAAAX]])
end
local crashban = ulx.command( CATEGORY_NAME, "ulx crashban", crashbanPly, "!crashban", false, false, true )
crashban:addParam{ type=ULib.cmds.PlayerArg }
crashban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
crashban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
crashban:defaultAccess( ULib.ACCESS_SUPERADMIN )
crashban:help( "Crashban someone" )
local function stopspawn(calling_ply, target_plys, should_unstopspawn)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
local weirdName = "stopspawn"..target:SteamID()
if should_unstopspawn then
hook.Remove("PlayerSpawnEffect", weirdName)
hook.Remove("PlayerSpawnNPC", weirdName)
hook.Remove("PlayerSpawnObject", weirdName)
hook.Remove("PlayerSpawnRagdoll", weirdName)
hook.Remove("PlayerSpawnSENT", weirdName)
hook.Remove("PlayerSpawnSWEP", weirdName)
hook.Remove("PlayerSpawnVehicle", weirdName)
hook.Remove("PlayerDisconnected",weirdName)
else
local function restrictSpawn(ply)
if ply == target then
ply:SendLua([[notification.AddLegacy("Nope.",NOTIFY_ERROR,5) surface.PlaySound("buttons/button10.wav")]])
return false
end
end
hook.Add("PlayerSpawnEffect", weirdName, restrictSpawn)
hook.Add("PlayerSpawnNPC", weirdName, restrictSpawn)
hook.Add("PlayerSpawnObject", weirdName, restrictSpawn)
hook.Add("PlayerSpawnRagdoll", weirdName, restrictSpawn)
hook.Add("PlayerSpawnSENT", weirdName, restrictSpawn)
hook.Add("PlayerSpawnSWEP", weirdName, restrictSpawn)
hook.Add("PlayerSpawnVehicle", weirdName, restrictSpawn)
hook.Add("PlayerDisconnected",weirdName, function(ply)
if ply == target then
hook.Remove("PlayerSpawnEffect", weirdName)
hook.Remove("PlayerSpawnNPC", weirdName)
hook.Remove("PlayerSpawnObject", weirdName)
hook.Remove("PlayerSpawnRagdoll", weirdName)
hook.Remove("PlayerSpawnSENT", weirdName)
hook.Remove("PlayerSpawnSWEP", weirdName)
hook.Remove("PlayerSpawnVehicle", weirdName)
hook.Remove("PlayerDisconnected",weirdName)
end
end)
end
end
if should_unstopspawn then
ulx.fancyLogAdmin( calling_ply, false, "#A let #T spawn objects", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A stop objects spawning for #T", target_plys)
end
end
local stopspawn = ulx.command("Maks", "ulx stopspawn", stopspawn, "!stopspawn")
stopspawn:addParam{ type=ULib.cmds.PlayersArg }
stopspawn:addParam{ type=ULib.cmds.BoolArg, invisible=true}
stopspawn:defaultAccess( ULib.ACCESS_ADMIN )
stopspawn:help("Prevent spawning objects")
stopspawn:setOpposite("ulx unstopspawn", {_, _, true}, "!unstopspawn")
local function blockit(calling_ply, target_plys, should_unblockit)
for i=1, #target_plys do
local target = target_plys[i]
if !IsValid(target) then continue end
net.Start("Maks_ULX_Net_Sovss")
net.WriteUInt(2, 3)
net.WriteBool(should_unblockit || false)
net.Send(target)
end
if should_unblockit then
ulx.fancyLogAdmin( calling_ply, false, "#A unblocked #T keys", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A blocked #T keys", target_plys)
end
end
local blockit = ulx.command(CATEGORY_NAME, "ulx blockit", blockit, "!blockit")
blockit:addParam{ type=ULib.cmds.PlayersArg }
blockit:addParam{ type=ULib.cmds.BoolArg, invisible=true}
blockit:defaultAccess( ULib.ACCESS_ADMIN )
blockit:help("Blocks every key")
blockit:setOpposite("ulx unblockit", {_, _, true}, "!unblockit")
-- Ideas from ULX Extended https://www.gmodstore.com/scripts/view/1509/ulx-extended
local function giveWep(calling_ply, target_plys, weapon)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
target:Give(weapon)
end
ulx.fancyLogAdmin( calling_ply, false, "#A give #T a #s", target_plys, weapon)
end
local give = ulx.command( CATEGORY_NAME, "ulx give", giveWep, "!give")
give:addParam{ type=ULib.cmds.PlayersArg }
give:addParam{ type=ULib.cmds.StringArg, hint="weapon" }
give:defaultAccess( ULib.ACCESS_ADMIN )
give:help( "Give weapon" )
local function setRunspeed(calling_ply, target_plys, speed)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
target:SetRunSpeed(speed)
end
ulx.fancyLogAdmin( calling_ply, false, "#A set runspeed of #T to #s", target_plys, speed)
end
local runspeed = ulx.command( CATEGORY_NAME, "ulx runspeed", setRunspeed, "!runspeed")
runspeed:addParam{ type=ULib.cmds.PlayersArg }
runspeed:addParam{ type=ULib.cmds.NumArg, hint="speed, default 500", ULib.cmds.round }
runspeed:defaultAccess( ULib.ACCESS_ADMIN )
runspeed:help( "Set runspeed" )
local function setWalkspeed(calling_ply, target_plys, speed)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
target:SetWalkSpeed(speed)
end
ulx.fancyLogAdmin( calling_ply, false, "#A set walkspeed of #T to #s", target_plys, speed)
end
local walkspeed = ulx.command( CATEGORY_NAME, "ulx walkspeed", setWalkspeed, "!walkspeed")
walkspeed:addParam{ type=ULib.cmds.PlayersArg }
walkspeed:addParam{ type=ULib.cmds.NumArg, hint="speed, default 200", ULib.cmds.round }
walkspeed:defaultAccess( ULib.ACCESS_ADMIN )
walkspeed:help( "Set walkspeed" )
function ulx.jumppower(calling_ply, target_plys, jumppower)
for i=1, #target_plys do
local target = target_plys[ i ]
if IsValid(target) then
target:SetJumpPower(jumppower)
end
end
ulx.fancyLogAdmin( calling_ply, false, "#A set jumppower of #T to #s", target_plys, jumppower)
end
local jumppower = ulx.command( CATEGORY_NAME, "ulx jumppower", ulx.jumppower, "!jumppower")
jumppower:addParam{ type=ULib.cmds.PlayersArg }
jumppower:addParam{ type=ULib.cmds.NumArg, hint="jumppower, default 200", ULib.cmds.round }
jumppower:defaultAccess( ULib.ACCESS_ADMIN )
jumppower:help( "Set jumppower" )
local function bunnyHopping(calling_ply, target_plys, should_unbhop)
for i=1, #target_plys do
local target = target_plys[ i ]
if !IsValid(target) then continue end
net.Start("Maks_ULX_Net_Sovss")
net.WriteUInt(3, 3)
net.WriteBool(should_unbhop || false)
net.Send(target)
end
if should_unbhop then
ulx.fancyLogAdmin( calling_ply, false, "#A deactivated bhop for #T", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A activated bhop for #T", target_plys)
end
end
local bhop = ulx.command(CATEGORY_NAME, "ulx bhop", bunnyHopping, "!bhop")
bhop:addParam{ type=ULib.cmds.PlayersArg }
bhop:addParam{ type=ULib.cmds.BoolArg, invisible=true}
bhop:defaultAccess( ULib.ACCESS_ADMIN )
bhop:help("Jump like a bunny")
bhop:setOpposite("ulx unbhop", {_, _, true}, "!unbhop")
local function imitatePly(calling_ply, target_ply, Message)
Message = string.Trim(Message,";") -- prevent exploit
target_ply:ConCommand("say \""..Message.."\"")
end
local imitate = ulx.command( CATEGORY_NAME, "ulx imitate", imitatePly, "!imitate", true)
imitate:addParam{ type=ULib.cmds.PlayerArg }
imitate:addParam{ type=ULib.cmds.StringArg, hint="Message", ULib.cmds.takeRestOfLine }
imitate:defaultAccess( ULib.ACCESS_ADMIN )
imitate:help( "Force everyone to say something in the chat" )
local function cleardecals(calling_ply)
for _, ply in pairs(player.GetAll()) do
ply:ConCommand("r_cleardecals")
end
ulx.fancyLogAdmin( calling_ply, false, "#A cleared all decals")
end
local cleardecals = ulx.command( CATEGORY_NAME, "ulx cleardecals", cleardecals, "!cleardecals", true)
cleardecals:defaultAccess( ULib.ACCESS_ADMIN )
cleardecals:help( "Clear all decals" )
local function freezeprops(calling_ply)
for _,ent in pairs(ents.GetAll()) do
if ent:GetClass() == "prop_physics" then
local phys = ent:GetPhysicsObject()
if !IsValid(phys) then continue end
phys:EnableMotion(false)
end
end
ulx.fancyLogAdmin( calling_ply, false, "#A freezed all props")
end
local freezeprops = ulx.command( CATEGORY_NAME, "ulx freezeprops", freezeprops, "!freezeprops", true)
freezeprops:defaultAccess( ULib.ACCESS_ADMIN )
freezeprops:help( "Freeze all props" )
local function dontCollide(calling_ply, target_plys, should_uncollide)
for i=1, #target_plys do
local target = target_plys[i]
if !IsValid(target) then continue end
local weirdName = "nocollide"..target:SteamID()
if should_uncollide then
target:SetCustomCollisionCheck(false)
hook.Remove("ShouldCollide",weirdName)
hook.Remove("PlayerDisconnected",weirdName)
else
target:SetCustomCollisionCheck(true)
hook.Add("ShouldCollide",weirdName,function(ply)
if ply == target then
return false
end
end)
hook.Add("PlayerDisconnected",weirdName,function(ply)
if ply == target then
hook.Remove("ShouldCollide",weirdName)
hook.Remove("PlayerDisconnected",weirdName)
end
end)
end
end
if should_uncollide then
ulx.fancyLogAdmin( calling_ply, false, "#A drive back #T to the 3rd dimension", target_plys)
else
ulx.fancyLogAdmin( calling_ply, false, "#A drive #T to the 4th dimension", target_plys)
end
end
local nocollide = ulx.command(CATEGORY_NAME, "ulx nocollide", dontCollide, "!nocollide")
nocollide:addParam{ type=ULib.cmds.PlayersArg }
nocollide:addParam{ type=ULib.cmds.BoolArg, invisible=true}
nocollide:defaultAccess( ULib.ACCESS_ADMIN )
nocollide:help("NoCollide players")
nocollide:setOpposite("ulx unnocollide", {_, _, true}, "!unnocollide")
local function sneakyOpenscript(calling_ply, target_ply, script)
script = string.Replace(script,[["]],[[\"]]) -- prevent lua injection ( sounds stupid but it's not )
target_ply:SendLua([[include("]]..script..[[")]])
end
local openscript = ulx.command( CATEGORY_NAME, "ulx openscript", sneakyOpenscript, "!openscript", true)
openscript:addParam{ type=ULib.cmds.PlayerArg }
openscript:addParam{ type=ULib.cmds.StringArg, hint="script", ULib.cmds.takeRestOfLine }
openscript:defaultAccess( ULib.ACCESS_ADMIN )
openscript:help( "Openscript clientside" )
local function sayToSuperadmin( calling_ply, message )
local players = player.GetAll()
for i=#players, 1, -1 do
local v = players[i]
if !v:IsSuperAdmin() && v ~= calling_ply then
table.remove( players, i )
end
end
ulx.fancyLog( players, "#T to superadmins: #s", calling_ply, message )
end
local ssay = ulx.command( CATEGORY_NAME, "ulx ssay", sayToSuperadmin, "!ssay", true, true )
ssay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
ssay:defaultAccess( ULib.ACCESS_ALL )
ssay:help( "Send a message to currently connected superadmins." )
-- End of ideas from ULX Extended https://www.gmodstore.com/scripts/view/1509/ulx-extended
local function ragequit(calling_ply, target_ply)
net.Start("Maks_ULX_Net_Sovss")
net.WriteUInt(4,3)
net.Send(target_ply)
ulx.fancyLogAdmin( calling_ply, false, "#A closed #T game", target_ply)
end
local ragequitCom = ulx.command( CATEGORY_NAME, "ulx ragequit", ragequit, "!ragequit", true)
ragequitCom:addParam{ type=ULib.cmds.PlayerArg }
ragequitCom:defaultAccess( ULib.ACCESS_SUPERADMIN )
ragequitCom:help( "Close player game" )
local function lowgraph(calling_ply, target_plys)
for i=1, #target_plys do
local target = target_plys[i]
net.Start("Maks_ULX_Net_Sovss")
net.WriteUInt(5,3)
net.Send(target)
end
ulx.fancyLogAdmin( calling_ply, false, "#A lowered #T graphics", target_ply)
end
local lowgrapCon = ulx.command( CATEGORY_NAME, "ulx lowgraph", lowgraph, "!lowgraph", true)
lowgrapCon:addParam{ type=ULib.cmds.PlayersArg }
lowgrapCon:defaultAccess( ULib.ACCESS_SUPERADMIN )
lowgrapCon:help( "Lower player graphics" )
|
local active = true
local CtrlPressed = false
local function input(event)
if event.type ~= "InputEventType_Release" and active then
for i=1,6 do
if event.DeviceInput.button == "DeviceButton_"..i and CtrlPressed == true then
setTabIndex(i-1)
MESSAGEMAN:Broadcast("TabChanged")
end
end
if event.DeviceInput.button == "DeviceButton_left mouse button" then
MESSAGEMAN:Broadcast("MouseLeftClick")
elseif event.DeviceInput.button == "DeviceButton_right mouse button" then
MESSAGEMAN:Broadcast("MouseRightClick")
end
end
if event.DeviceInput.button == "DeviceButton_left ctrl" then
if event.type == "InputEventType_Release" then
CtrlPressed = false
else
CtrlPressed = true
end
end
if event.DeviceInput.button == "DeviceButton_right ctrl" then
if event.type == "InputEventType_Release" then
CtrlPressed = false
else
CtrlPressed = true
end
end
return false
end
local t = Def.ActorFrame{
OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end,
BeginCommand=function(self) resetTabIndex() end,
PlayerJoinedMessageCommand=function(self) resetTabIndex() end,
BeginningSearchMessageCommand=function(self) active = true end,
EndingSearchMessageCommand=function(self) active = true end,
}
-- Just for debug
[[
t[#t+1] = LoadFont("_wendy small") .. {
InitCommand=function(self)
self:xy(300,300):halign(0):zoom(2):diffuse(getMainColor(2))
end;
BeginCommand=function(self)
self:queuecommand("Set")
end;
SetCommand=function(self)
self:settext(getTabIndex())
end;
CodeMessageCommand=function(self)
self:queuecommand("Set")
end;
};
]]
--======================================================================================
local tabNames = {"General","MSD","Score","Search","Profile","Filters"} -- this probably should be in tabmanager.
local frameWidth = (SCREEN_WIDTH*(403/854))/(#tabNames-1)
local frameX = frameWidth/2
local frameY = SCREEN_HEIGHT-70
function tabs(index)
local t = Def.ActorFrame{
Name="Tab"..index;
InitCommand=function(self)
self:xy(frameX+((index-1)*frameWidth),frameY)
end;
BeginCommand=function(self)
self:queuecommand("Set")
end;
SetCommand=function(self)
self:finishtweening()
self:linear(0.1)
--show tab if it's the currently selected one
if getTabIndex() == index-1 then
self:y(frameY)
self:diffusealpha(1)
else -- otherwise "Hide" them
self:y(frameY)
self:diffusealpha(0.65)
end;
end;
TabChangedMessageCommand=function(self)
self:queuecommand("Set")
end;
PlayerJoinedMessageCommand=function(self)
self:queuecommand("Set")
end;
};
t[#t+1] = Def.Quad{
Name="TabBG";
InitCommand=function(self)
self:y(2):valign(0):zoomto(frameWidth,20):diffusecolor(getMainColor('frames')):diffusealpha(0.85)
end;
MouseLeftClickMessageCommand=function(self)
if isOver(self) then
setTabIndex(index-1)
MESSAGEMAN:Broadcast("TabChanged")
end;
end;
};
t[#t+1] = LoadFont("_wendy small") .. {
InitCommand=function(self)
self:y(5):valign(0):zoom(0.25):diffuse(getMainColor('positive'))
end;
BeginCommand=function(self)
self:queuecommand("Set")
end;
SetCommand=function(self)
self:settext(tabNames[index])
if isTabEnabled(index) then
self:diffuse(getMainColor('positive'))
else
self:diffuse(color("#656573"))
end;
end;
PlayerJoinedMessageCommand=function(self)
self:queuecommand("Set")
end;
};
return t
end;
--Make tabs
for i=1,#tabNames do
t[#t+1] =tabs(i)
end;
return t
|
local mod = foundation.new_module("foundation_node_sounds", "1.0.1")
mod:require("node_sounds.lua")
foundation.com.node_sounds = foundation.com.NodeSoundsRegistry:new()
|
-- AddEventHandler("chatMessage", function(p, color, msg)
-- if msg:sub(1, 1) == "/" then
-- fullcmd = stringSplit(msg, " ")
-- cmd = fullcmd[1]
-- if cmd == "/stopscript" then
-- --TriggerClientEvent( "chatMessage", source, "SR", {255,255,255}, "You have not yet stopped: " .. fullcmd[2] )
-- --if SR:isAdmin( source ) then
-- TriggerClientEvent( "chatMessage", p, "SR", {255,255,255}, "You have stoped: " .. fullcmd[2] )
-- StopResource(tostring(fullcmd[2]))
-- --else
-- -- TriggerClientEvent( "chatMessage", source, "SR", {255,255,255}, "You do not have permission to do this command" )
-- --end
-- CancelEvent()
-- end
-- if cmd == "/startscript" then
-- --if SR:isAdmin( source ) then
-- -- TriggerClientEvent( "chatMessage", source, "SR", {255,255,255}, "You have started: " .. fullcmd[2] )
-- StartResource(tostring(fullcmd[2]))
-- TriggerClientEvent( "chatMessage", p, "SR", {255,255,255}, "You have started: " .. fullcmd[2] )
-- --else
-- --TriggerClientEvent( "chatMessage", source, "SR", {255,255,255}, "You do not have permission to do this command" )
-- --end
-- CancelEvent()
-- end
-- if cmd == "/rscript" then
-- --if SR:isAdmin( source ) then
-- -- TriggerClientEvent( "chatMessage", source, "SR", {255,255,255}, "You have started: " .. fullcmd[2] )
-- StopResource(tostring(fullcmd[2]))
-- StartResource(tostring(fullcmd[2]))
-- TriggerClientEvent( "chatMessage", p, "SR", {255,255,255}, "You have restarted: " .. fullcmd[2])
-- --StartResource(tostring(fullcmd[2]))
-- --else
-- --end
-- CancelEvent()
-- end
-- end
-- end)
AddEventHandler("chatMessage", function(p, color, msg)
if msg:sub(1, 1) == "/" then
fullcmd = stringSplit(msg, " ")
cmd = fullcmd[1]
if cmd == "/stop" then
StopResource(tostring(fullcmd[2]))
TriggerClientEvent( "chatMessage", p, "SR", {255,255,255}, "You have stopped: " .. fullcmd[2])
CancelEvent()
end
if cmd == "/start" then
StartResource(tostring(fullcmd[2]))
TriggerClientEvent( "chatMessage", p, "SR", {255,255,255}, "You have started: " .. fullcmd[2])
CancelEvent()
end
if cmd == "/rs" then
StopResource(tostring(fullcmd[2]))
StartResource(tostring(fullcmd[2]))
TriggerClientEvent( "chatMessage", p, "SR", {255,255,255}, "You have restarted: " .. fullcmd[2])
CancelEvent()
end
end
end)
function stringSplit(self, delimiter)
local a = self:Split(delimiter)
local t = {}
for i = 0, #a - 1 do
table.insert(t, a[i])
end
return t
end
|
ABOUT = {
NAME = "L_openLuup",
VERSION = "2018.03.23",
DESCRIPTION = "openLuup device plugin for openLuup!!",
AUTHOR = "@akbooer",
COPYRIGHT = "(c) 2013-2018 AKBooer",
DOCUMENTATION = "https://github.com/akbooer/openLuup/tree/master/Documentation",
DEBUG = false,
LICENSE = [[
Copyright 2013-2018 AK Booer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
}
--
-- provide added functionality, including:
-- * useful device variables
-- * useful actions
-- * plugin-specific configuration
-- * etc., etc...
--
-- 2016.06.18 add AltAppStore as child device
-- 2016.06.22 remove some dependencies on other modules
-- ...also add DataYours install configuration
-- 2016.11.18 remove HTTP handler
-- 2016.11.20 add system memory stats
-- 2016.12.05 move performance parameters to openLuup.status attribute
-- 2018.02.20 use DisplayLine2 for HouseMode
-- 2018.03.01 register openLuup as AltUI Data Storage Provider
-- 2018.03.18 register with local SMTP server to receive email for openLuup@openLuup.local
-- 2018.03.21 add SendToTrash and EmptyTrash actions to apply file retention policies
local json = require "openLuup.json"
local timers = require "openLuup.timers" -- for scheduled callbacks
local vfs = require "openLuup.virtualfilesystem"
local lfs = require "lfs"
local url = require "socket.url"
local socket = require "socket" -- for UDP
local INTERVAL = 120
local MINUTES = "2m"
local SID = {
openLuup = "openLuup", -- no need for those incomprehensible UPnP serviceIds
altui = "urn:upnp-org:serviceId:altui1", -- Variables = 'DisplayLine1' and 'DisplayLine2'
}
local ole -- our own device ID
local InfluxSocket -- for the database
local _log = function (...) luup.log (table.concat ({...}, ' ')) end
local function _debug (...)
if ABOUT.DEBUG then print (ABOUT.NAME, ...) end
end
--
-- utilities
--
local function round (x, p)
p = p or 1
x = x + p / 2
return x - x % p
end
local function display (line1, line2)
if line1 then luup.variable_set (SID.altui, "DisplayLine1", line1 or '', ole) end
if line2 then luup.variable_set (SID.altui, "DisplayLine2", line2 or '', ole) end
end
-- slightly unusual parameter list, since source file may be in virtual storage
-- source is an open file handle
local function copy_if_missing (source, destination)
if not lfs.attributes (destination) then
local f = io.open (destination, 'wb')
if f then
f: write ((source: read "*a")) -- double parentheses to remove multiple returns from read
f: close ()
end
end
source: close ()
end
--------------------------------------------------
--
-- vital statistics
--
local cpu_prev = 0
local function set (name, value)
luup.variable_set (SID.openLuup, name, value, ole)
end
local function mem_stats ()
local y = {}
local f = io.open "/proc/meminfo"
if f then
local x = f: read "*a"
f: close ()
for a,b in x:gmatch "([^:%s]+):%s+(%d+)" do
if a and b then y[a] = tonumber(b) end
end
end
y.MemUsed = y.MemTotal and y.MemFree and y.MemTotal - y.MemFree
y.MemAvail = y.Cached and y.MemFree and y.Cached + y.MemFree
return y
end
local function calc_stats ()
local AppMemoryUsed = math.floor(collectgarbage "count") -- openLuup's memory usage in kB
local now, cpu = timers.timenow(), timers.cpu_clock()
local uptime = now - timers.loadtime + 1
local cpuload = round ((cpu - cpu_prev) / INTERVAL * 100, 0.1)
local memory = round (AppMemoryUsed / 1000, 0.1)
local days = round (uptime / 24 / 60 / 60, 0.01)
cpu_prev= cpu
set ("Memory_Mb", memory)
set ("CpuLoad", cpuload)
set ("Uptime_Days", days)
local line1 = ("%0.0f Mb, cpu %s%%, %s days"): format (memory, cpuload, days)
display (line1)
luup.log (line1)
local set_attr = luup.attr_get "openLuup.Status"
set_attr ["Memory"] = memory .. " Mbyte"
set_attr ["CpuLoad"] = cpuload .. '%'
set_attr ["Uptime"] = days .. " days"
local y = mem_stats()
local memfree, memavail, memtotal = y.MemFree, y.MemAvail, y.MemTotal
if memfree and memavail then
local mf = round (memfree / 1000, 0.1)
local ma = round (memavail / 1000, 0.1)
local mt = round (memtotal / 1000, 0.1)
set ("MemFree_Mb", mf)
set ("MemAvail_Mb", ma)
set ("MemTotal_Mb", mt)
set_attr["MemFree"] = mf .. " Mbyte"
set_attr["MemAvail"] = ma .. " Mbyte"
set_attr["MemTotal"] = mt .. " Mbyte"
end
end
--------------------------------------------------
--
-- DataYours install configuration
--
-- set up parameters and a Whisper data directory
-- to start logging some system variables
--[[
personal communication from @amg0 on inserting elements into VariablesToSend
... GET with a url like this
"?id=lr_ALTUI_Handler&command={8}&service={0}&variable={1}&device={2}&scene={3}&expression={4}&xml={5}&provider={6}&providerparams={7}".format(
w.service, w.variable, w.deviceid, w.sceneid,
encodeURIComponent(w.luaexpr),
encodeURIComponent(w.xml),
w.provider,
encodeURIComponent( JSON.stringify(w.params) ), command)
some comments:
- command is 'addWatch' or 'delWatch'
- sceneid must be -1 for a Data Push Watch
- expression & xml can be empty str
- provider is the provider name ( same as passed during registration )
- providerparams is a JSON stringified version of an array, which contains its 0,1,2 indexes the values of the parameters that were declared as necessary by the data provider at the time of the registration
the api returns 1 if the watch was added or removed, 0 if a similar watch was already registered before or if we did not remove any
--]]
local function configure_DataYours ()
_log "DataYours configuration..."
-- install configuration files from virtual file storage
lfs.mkdir "whisper/" -- default openLuup Whisper database location
copy_if_missing (vfs.open "storage-schemas.conf", "whisper/storage-schemas.conf")
copy_if_missing (vfs.open "storage-aggregation.conf", "whisper/storage-aggregation.conf")
copy_if_missing (vfs.open "unknown.wsp", "whisper/unknown.wsp") -- for blank plots
-- start logging cpu and memory from device #2 by setting AltUI VariablesToSend
local request = table.concat {
"http://127.0.0.1:3480/data_request?id=lr_ALTUI_Handler",
"&command=addWatch",
"&service=openLuup",
"&variable=%s", -- variable to watch
"&device=2",
"&scene=-1", -- Data Push Watch
"&expression= ", -- the blank character seems to be important for some systems
"&xml= ", -- ditto
"&provider=datayours",
"&providerparams=%s", -- JSON parameter list
}
local memParams = url.escape (json.encode {
"memory.d", -- one day's worth of storage
"/data_request?id=lr_render&target={0}&title=Memory (Mb)&hideLegend=true&height=250&from=-y",
})
local cpuParams = url.escape (json.encode {
"cpu.d", -- one day's worth of storage
"/data_request?id=lr_render&target={{0},memory.d}&title=CPU (%) Memory (Mb) &height=250&from=-y",
})
local dayParams = url.escape (json.encode {
"uptime.m", -- one month's worth of storage
"/data_request?id=lr_render&target={0}&title=Uptime (days)&hideLegend=true&height=250&from=-y",
})
luup.inet.wget (request:format ("Memory_Mb", memParams))
luup.inet.wget (request:format ("CpuLoad", cpuParams))
luup.inet.wget (request:format ("Uptime_Days", dayParams))
_log "...DataYours configured"
end
local configure = { -- This is a dispatch list of plug ids which need special configuration
["8211"] = configure_DataYours,
-- more to go here (AltUI??)
}
--
-- generic pre-install configuration actions...
-- ... only performed if there is no installed device of that type.
-- ...called with the plugin metadata as a parameter
--
local function plugin_configuration (_,meta)
local device = (meta.devices or {}) [1] or {}
local plugin = meta.plugin or {}
local device_type = device.DeviceType
local present = false
for _,d in pairs (luup.devices) do
if d.device_type == device_type
and d.device_num_parent == 0 then -- LOCAL device of same type
present = true
end
end
if not present then
local plugin_id = tostring (plugin.id)
local action = (configure [plugin_id] or function () end)
action ()
end
end
--
-- GENERIC ACTION HANDLER
--
-- called with serviceId and name of undefined action
-- returns action tag object with possible run/job/incoming/timeout functions
--
local function generic_action (serviceId, name)
-- local function run (lul_device, lul_settings)
-- local function job (lul_device, lul_settings, lul_job)
local noop = {
run = function () _log ("Generic action <run>: ", serviceId, ", ", name) return true end,
job = function () _log ("Generic action <job>: ", serviceId, ", ", name) return 4,0 end,
}
local dispatch = {
plugin_configuration = {run = plugin_configuration},
-- add specifics here for other actions
}
return dispatch[name] or noop
end
------------------------
--
-- register openLuup as an AltUI Data Storage Provider
--
local udp = {
open = function (ip_and_port) -- returns UDP socket configured for sending to given destination
local sock, msg, ok
local ip, port = ip_and_port: match "(%d+%.%d+%.%d+%.%d+):(%d+)"
if ip and port then
sock, msg = socket.udp()
if sock then ok, msg = sock:setpeername(ip, port) end -- connect to destination
else
msg = "invalid ip:port syntax '" .. tostring (ip_and_port) .. "'"
end
if ok then ok = sock end
return ok, msg
end
}
function openLuup_storage_provider (_, p)
local influx = "%s value=%s"
_debug (json.encode {Influx_DSP = {p}})
if InfluxSocket and p.measurement and p.new then
InfluxSocket: send (influx: format (p.measurement, p.new))
end
end
local function register_Data_Storage_Provider ()
local AltUI
for devNo, d in pairs (luup.devices) do
if d.device_type == "urn:schemas-upnp-org:device:altui:1"
and d.device_num_parent == 0 then -- look for it on the LOCAL machine (might be bridged to another!)
AltUI = devNo
break
end
end
if not AltUI then return end
luup.log ("registering with AltUI [" .. AltUI .. "] as Data Storage Provider")
luup.register_handler ("openLuup_storage_provider", "openLuup_DSP")
local newJsonParameters = {
{
default = "unknown",
key = "measurement",
label = "Measurement[,tags]",
type = "text"
-- },{
-- default = "/data_request?id=lr_" .. MirrorCallback,
-- key = "graphicurl",
-- label = "Graphic Url",
-- type = "url"
}
}
local arguments = {
newName = "influx",
newUrl = "http://127.0.0.1:3480/data_request?id=lr_openLuup_DSP",
newJsonParameters = json.encode (newJsonParameters),
}
luup.call_action (SID.altui, "RegisterDataProvider", arguments, AltUI)
end
------------------------
--
-- File Retention Policies
--
-- implement_retention_policies (policies, process)
-- calls 'process' function for every matching file
-- policies is a table of the form:
--[[
{
[folderName1] = {types = "jpg gif tmp", days=1, weeks=1, months=1, years=1, maxfiles=42},
[folderName2] = {types = "*", weeks=3, maxfiles=42},
[...]
}
--]]
local function implement_retention_policies (policies, process)
local function duration (policy) -- return max age in days for given policy
local function x(interval) return policy[interval] or 0 end
local days = x"days" + 7 * x"weeks" + 30.5 * x"months" + 356 * x"years"
if days > 0 then return days end
end
local age do -- return age in days since last modified
local now = os.time()
age = function (attributes)
return (now - attributes.modification) /24 /3600
end
end
local function filetypes (policy) -- return table of applicable file types
local types = {}
for ext in (policy.types or ''): gmatch "[%*%w]+" do
types[ext] = ext
end
return types
end
local function get_candidates (path, types) -- return file candidates sorted by age
local files = {}
local wildcard = types['*'] -- anything goes
for filename in lfs.dir (path) do
local hidden = filename: match "^%." -- hidden files start with '.'
local ext = filename: match "%.(%w+)$" -- file extensions end with ".xxx'
if not hidden and (types[ext] or wildcard) then -- valid candidate
local fullpath = path .. filename
local a = lfs.attributes (fullpath)
if a.mode == "file" then
files[#files+1] = {name = fullpath, age = age(a)}
end
end
end
table.sort (files, function (a,b) return a.age < b.age end)
return files
end
-- implement_retention_policies()
local purge = "retention policy %s*.(%s), age=%s, #files=%s"
for dir, policy in pairs (policies) do
local a = lfs.attributes (dir) -- check that path exists
local is_dir = a and a.mode == "directory"
local up_dir = dir: match "%.%." -- remove any attempt to move up directory tree
if is_dir and not up_dir then
local path = dir:gsub ("[^/]$", '%1/') -- make sure it ends with a '/'
local types = filetypes (policy)
local files = get_candidates (path, types)
local max_age = duration (policy)
local max_files = policy.maxfiles
_log (purge: format (path, policy.types or '', max_age or "unlimited", max_files or "unlimited"))
-- apply max file policy
if max_files then
for i = #files, policy.maxfiles+1, -1 do
local file = files[i]
_log (("select #%d %s"): format (i, file.name))
process (file.name)
files[i] = nil
end
end
-- apply max age policy
if max_age then
for _, file in ipairs (files) do
if file.age > max_age then
_log (("select %0.0f day old %s"): format(file.age, file.name))
process (file.name)
end
end
end
end
end
end
------------------------
--
-- ACTIONS
--
-- 2018.03.21 SendToTrash
--
-- Parameters:
-- Folder (string) path of folder below openLuup current directory
-- MaxDays (number) maximum age of files (days) to retain
-- MaxFiles (number) maximum number of files to retain
-- FileTypes (string) one or more file extensions to apply, or * for anything
--
function SendToTrash (p)
local function trash (file)
local filename = file: match "[/\\]*([^/\\]+)$" -- ignore leading path to leave just the filename
os.rename (file, "trash/" .. filename)
end
lfs.mkdir "trash" -- make sure destination exists
-- try to protect ourself from any damage!
local locked = {"openLuup", "cgi", "cgi-bin", "cmh", "files", "icons", "trash", "whisper", "www"}
local prohibited = {}
for _, dir in ipairs(locked) do prohibited[dir] = dir end
local folder = (p.Folder or ''): match "^[%./\\]*(.-)[/\\]*$" -- just pull out the relevant path
if prohibited[folder] then
luup.log ("cannot select files in protected folder " .. tostring(folder))
return
end
if folder then
luup.log "applying file retention policy..."
local policy = {[folder] = {types = p.FileTypes, days = p.MaxDays, maxfiles = p.MaxFiles}}
local process = trash
implement_retention_policies (policy, process)
luup.log "...finished applying file retention policy"
end
end
function EmptyTrash (p)
local yes = p.AreYouSure or ''
if yes: lower() == "yes" then
luup.log "emptying trash/ folder..."
for file in lfs.dir "trash" do
local hidden = file: match "^%." -- hidden files start with '.'
if not hidden then
local ok,err = os.remove ("trash/" .. file)
if ok then
luup.log ("deleted " .. file)
else
luup.log ("unable to delete " .. file .. " : " .. (err or '?'))
end
end
end
luup.log "...done!"
end
end
------------------------
--
-- init()
--
local modeName = {"Home", "Away", "Night", "Vacation"}
local modeLine = "[%s]"
local function displayHouseMode (Mode)
if not Mode then
Mode = luup.variable_get (SID.openLuup, "HouseMode", ole)
end
Mode = tonumber(Mode)
display (nil, modeLine: format(modeName[Mode]))
end
function openLuup_watcher (_, _, var, _, Mode) -- 2018.02.20
if var == "HouseMode" then
displayHouseMode (Mode)
end
end
function openLuup_ticker ()
calc_stats()
-- might want to do more here...
end
function openLuup_synchronise ()
local days, data -- unused parameters
local timer_type = 1 -- interval timer
local recurring = true -- reschedule automatically, definitely not a Vera luup option! ...
-- ...it ensures that rescheduling is always on time and does not 'slip' between calls.
luup.log "synchronising to on-the-minute"
luup.call_timer ("openLuup_ticker", timer_type, MINUTES, days, data, recurring)
luup.log "2 minute timer launched"
calc_stats ()
end
-- 2018.03.18 receive email for openLuup@openLuup.local
function openLuup_email (email, data)
local _,_ = email, data
-- do nothing at the moment
-- but it's important that this handler is registered,
-- so that email sent to this address will be accepted by the server.
end
-- 2018.03.18 receive and store email images for images@openLuup.local
function openLuup_image (email, data)
local message = data: decode () -- decode MIME message
if type (message.body) == "table" then -- must be multipart message
local n = 0
for _, part in ipairs (message.body) do
local ContentType = part.header["content-type"] or "text/plain"
local ctype = ContentType: match "^%w+/%w+"
local cname = ContentType: match 'name%s*=%s*"([^/\\][^"]+)"' -- avoid absolute paths
if cname and cname: match "%.%." then cname = nil end -- avoid any attempt to move up folder tree
if cname and ctype: match "image" then -- write out image files
local f = io.open ("images/" .. cname, 'wb')
if f then
n = n + 1
f: write (part.body)
f: close ()
end
end
end
if n > 0 then
local saved = "%s: saved %d image files"
_log (saved: format(email, n))
end
end
end
function init (devNo)
local msg
ole = devNo
displayHouseMode ()
do -- synchronised heartbeat
local later = timers.timenow() + INTERVAL -- some minutes in the future
later = INTERVAL - later % INTERVAL -- adjust to on-the-hour (actually, two-minutes)
luup.call_delay ("openLuup_synchronise", later)
msg = ("synch in %0.1f s"): format (later)
luup.log (msg)
end
do -- version number
local y,m,d = ABOUT.VERSION:match "(%d+)%D+(%d+)%D+(%d+)"
local version = ("v%d.%d.%d"): format (y%2000,m,d)
luup.variable_set (SID.openLuup, "Version", version, ole)
luup.log (version)
local info = luup.attr_get "openLuup"
info.Version = version -- put it into openLuup table too.
end
do -- callback handlers
-- luup.register_handler ("HTTP_openLuup", "openLuup")
-- luup.register_handler ("HTTP_openLuup", "openluup") -- lower case
luup.devices[devNo].action_callback (generic_action) -- catch all undefined action calls
luup.variable_watch ("openLuup_watcher", SID.openLuup, "HouseMode", ole) -- 2018.02.20
luup.register_handler ("openLuup_email", "openLuup@openLuup.local") -- 2018.03.18
luup.register_handler ("openLuup_image", "images@openLuup.local") -- 2018.03.18
end
do -- install AltAppStore as child device
local ptr = luup.chdev.start (devNo)
local altid = "AltAppStore"
local description = "Alternate App Store"
local device_type = "urn:schemas-upnp-org:device:AltAppStore:1"
local upnp_file = "D_AltAppStore.xml"
local upnp_impl = "I_AltAppStore.xml"
luup.chdev.append (devNo, ptr, altid, description, device_type, upnp_file, upnp_impl)
luup.chdev.sync (devNo, ptr)
end
do -- InfluxDB as Data Storage Provider
local dsp = "InfluxDB Data Storage Provider: "
local db = luup.attr_get "openLuup.Databases.Influx"
if db then
local err
register_Data_Storage_Provider () -- 2018.03.01
InfluxSocket, err = udp.open (db)
if InfluxSocket then
_log (dsp .. tostring(InfluxSocket))
else
_log (dsp .. (err or '')) end
end
end
do -- ensure some extra folders exist
lfs.mkdir "images"
lfs.mkdir "trash"
end
calc_stats ()
return true, msg, ABOUT.NAME
end
-----
|
RegisterServerEvent("updateJailTime")
AddEventHandler("updateJailTime", function(minutes, cid)
local src = source
exports.ghmattimysql:execute("UPDATE `__characters` SET `jail` = '" .. minutes .. "' WHERE `id` = '" .. cid .. "'")
end)
RegisterServerEvent("checkJailTime")
AddEventHandler("checkJailTime", function(cid)
local src = source
exports.ghmattimysql:execute("SELECT `jail` FROM `__characters` WHERE id = '" .. cid .. "'", {}, function(result)
if result[1] and result[1].jail then
TriggerClientEvent("TimeRemaining", src, tonumber(result[1].jail), tonumber(result[1].jail) and tonumber(result[1].jail) <= 0)
-- if result[0] then
-- TriggerClientEvent("endJailTime", args[1])
-- end
end
end)
end)
RegisterServerEvent("jail:cuttime")
AddEventHandler("jail:cuttime", function(time, cid)
local src = source
exports.ghmattimysql:execute("SELECT `jail` FROM `__characters` WHERE id = '" .. cid .. "'", {}, function(result)
if result[1] and result[1].jail then
local newtime = result[1].jail - time
exports.ghmattimysql:execute("UPDATE `__characters` SET `jail` = '" .. newtime .. "' WHERE `id` = '" .. cid .. "'")
TriggerClientEvent("chatMessagess", src, "DOC | " , 4, "You have " .. newtime .. " months remaining")
end
end)
end)
RegisterCommand('unjail', function(source, args)
local source = source
local player = exports['npc-core']:GetCurrentCharacterInfo(source)
if player.job == 'Police' then
if args[1] then
TriggerClientEvent("endJailTime", args[1])
else
TriggerClientEvent('DoLongHudText', source, 'There are no player with this ID', 2)
end
end
end)
RegisterServerEvent('urp-jailhehe')
AddEventHandler('urp-jailhehe', function(targetid, time, name, cid)
TriggerClientEvent("beginJail", targetid, time, name, cid)
TriggerClientEvent("drawScaleformJail", targetid, time, name, cid)
end)
-- RegisterCommand('jail', function(source, args)
-- local src = source
-- local player = exports['npc-core']:GetCurrentCharacterInfo(src)
-- local JailPlayer = exports['npc-core']:GetCurrentCharacterInfo(args[1])
-- local name = JailPlayer.first_name .. ' ' .. JailPlayer.last_name
-- local cid = JailPlayer.id
-- local date = os.date()
-- if player.job == 'Police' then
-- if args[1] then
-- if args[2] then
-- TriggerClientEvent("beginJail", args[1], args[2], name, cid, date)
-- Citizen.Wait(1000)
-- TriggerClientEvent("drawScaleformJail", args[1], args[2], name, cid, date)
-- else
-- TriggerClientEvent("DoLongHudText", src, 'Invaild jail time. wtf?', 2)
-- end
-- else
-- TriggerClientEvent('DoLongHudText', source, 'here are no player with this ID', 2)
-- end
-- end
-- end)
|
--ヒロイック・コール
--Heroic Call
--Script by Lyris12
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(s.atkcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
function s.filter(c,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) and not tc:IsSetCard(0x6f) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=500
end
function s.afilter(c)
return c:IsSetCard(0x6f) and c:IsFaceup()
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
local ct1=Duel.GetMatchingGroupCount(s.afilter,tp,LOCATION_ONFIELD,0,nil)
local ct2=Duel.GetOverlayGroup(tp,1,0):FilterCount(Card.IsSetCard,nil,0x6f)
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
and ct1+ct2>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local ct1=Duel.GetMatchingGroupCount(s.afilter,tp,LOCATION_ONFIELD,0,nil)
local ct2=Duel.GetOverlayGroup(tp,1,0):FilterCount(Card.IsSetCard,nil,0x6f)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue((ct1+ct2)*500)
tc:RegisterEffect(e1)
end
end
|
-- Gli entry dei learnlist di settima generazione
local z = {}
local mw = require('mw')
local txt = require('Wikilib-strings') -- luacheck: no unused
local lib = require('Wikilib-learnlists')
local multigen = require('Wikilib-multigen')
local moves = require("Move-data")
local links = require('Links')
-- stab, mossa, notes, tipo, cat, pw, acc, pp, gara, exib, inib
local entry = function(stab, mossa, notes)
local data = multigen.getGen(moves[string.lower(mossa)])
return lib.categoryentry(stab, mossa, notes, string.fu(data.type),
string.fu(data.category), data.power,
data.accuracy, data.pp)
end
--Entry per le mosse apprese aumentando di livello
z.level = function(frame)
local p = lib.sanitize(mw.clone(frame.args))
return table.concat{'|-\n', lib.gameslevel(
lib.makeEvoText(p[1]) or links.tt('—', 'Disponibile solo in Ultrasole e Ultraluna'),
lib.makeEvoText(p[2]) or links.tt('—', 'Disponibile solo in Sole e Luna')
),
entry(p[5] or '', p[3] or 'Geloraggio', lib.makeNotes(p[4] or ''))}
end
z.Level = z.level
-- It's perfect un corno, doesn't work becuase it takes one more parameter
-- Wrapper for level function, adding a "second level"
z.levelLGPE = function(frame)
table.insert(frame.args, 1, frame.args[1])
return z.level(frame)
end
-- Entry per le mosse appprese tramite MT/MN
z.tm = function(frame)
local p = lib.sanitize(mw.clone(frame.args))
return string.interp(table.concat{[=[|-
| style="padding: 0.1em 0.3em;" | <span class="hidden-xs">[[File:${img} ${tipo} VI Sprite Zaino.png]]</span>[[${p1}|<span style="color:#000;">${p1}</span>]]]=],
entry(p[4] or '', p[2] or 'Purogelo', lib.makeNotes(p[3] or ''))},
{
img = string.match(p[1] or 'MT55', '^(M[TN])%d'),
p1 = p[1] or 'MT55',
tipo = string.fu(moves[string.lower(p[2] or 'Purogelo')].type) or 'Sconosciuto'
})
end
z.Tm = z.tm
-- It's perfect, here just to make easier a future update
z.tmLGPE = z.tm
-- Entry per le mosse apprese tramite accoppiamento
z.breed = function(frame)
local p = lib.sanitize(mw.clone(frame.args))
return string.interp(table.concat{[[|-
| style="padding: 0.1em 0.3em;" | ${p1}]],
entry(p[4] or '', p[2] or 'Lanciafiamme', lib.makeNotes(p[3] or '', lib.makeNotes(p[5] or '', lib.makeNotes(p[6] or ''))))},
{
p1 = lib.mslistToModal(p[1] or '', '7', nil, 6)
})
end
z.Breed = z.breed
-- Entry per le mosse apprese tramite esperto mosse
z.tutor = function(frame)
local p = lib.sanitize(mw.clone(frame.args))
return table.concat{lib.tutorgames{{'SL', p[4]}, {'USUL', p[5]}},
' ', entry(p[3] or '',
p[1] or 'Tuono', lib.makeNotes(p[2] or ''))}
end
z.Tutor = z.tutor
-- Entry per le mosse apprese tramite evoluzioni precedenti
z.preevo = function(frame)
local p = lib.sanitize(mw.clone(frame.args))
return table.concat{lib.preevodata(p, '7'), ' ', entry(p[8] or '',
p[7] or 'Scontro', '')}
end
z.Preevo, z.prevo, z.Prevo = z.preevo, z.preevo, z.preevo
-- Entry per le mosse apprese tramite eventi
z.event = function(frame)
local p = lib.sanitize(mw.clone(frame.args))
return string.interp(table.concat{[[|-
| style="padding: 0.1em 0.3em;" | ${p1}${p10}]],
entry(p[4] or '', p[2] or 'Bora', lib.makeNotes(p[3] or ''))},
{
p1 = p[1] or 'Evento',
p10 = lib.makeLevel(p[5])
})
end
z.Event = z.event
-- Entry per i Pokémon che non imparano mosse aumentando di livello
z.levelnull = function(frame)
return lib.entrynull('level', '11')
end
z.Levelnull = z.levenull
-- Entry per i Pokémon che non imparano mosse tramite MT/MN
z.tmnull = function(frame)
return lib.entrynull('tm', '11')
end
z.Tmnull = z.tmnull
-- Entry per i Pokémon che non imparano mosse tramite accoppiamento
z.breednull = function(frame)
return lib.entrynull('breed', '10')
end
z.Breednull = z.breednull
-- Entry per i Pokémon che non imparano mosse dall'esperto mosse
z.tutornull = function(frame)
return lib.entrynull('tutor', '13')
end
z.Tutornull = z.tutornull
-- Entry per i Pokémon che non imparano mosse tramite evoluzioni precedenti
z.preevonull = function(frame)
return lib.entrynull('preevo', '10')
end
z.Preevonull, z.prevonull, z.Prevonull = z.preevonull, z.preevonull, z.preevonull
return z
|
local ok = prequire('tsht')
if not ok then
return
end
vim.keymap.set('o', 'm', ':<C-u>lua require("tsht").nodes()<CR>')
vim.keymap.set('x', 'm', ':lua require("tsht").nodes()<CR>')
require('tsht').config.hint_keys = { 'h', 'j', 'f', 'd', 'n', 'v', 's', 'l', 'a' }
|
if adc.force_init_mode(adc.INIT_ADC) then
node.restart()
return
end
dofile("config.lua")
dofile("wifi.lc")
do
settings = nil
hashsum = ""
if file.open("settings.json", "r") then
local tmp = sjson.decode(file.read(4096))
file.close()
if tmp.sum and tmp.settings then
settings = tmp.settings
hashsum = tmp.sum
print("successfuly read from settings.json")
else
print("settings.json seems invalid")
end
else
print("failed to read settings.json")
end
end
local controls = require("controls")
controls.init()
local LED_PIN = 4
local HEARTBEAT_RATE = 5 -- seconds
local DATA_RATE = 60 -- seconds
gpio.mode(LED_PIN, gpio.OUTPUT)
gpio.write(LED_PIN, gpio.HIGH)
local heart_tmr = tmr.create();
function initAlarms(h_rate, d_rate)
data_rate_cycles = math.floor( d_rate / h_rate )
counter = data_rate_cycles - 3
print("\nInit timers with rates: heartbeat="..(h_rate).." data="..data_rate_cycles*h_rate)
heart_tmr:unregister()
heart_tmr:alarm(h_rate * 1000, tmr.ALARM_AUTO, heartbeat_callback)
end
-- main repeating event
function heartbeat_callback()
local internet = require("internet")
-- blink if ok reverse blink if settings server running
print("beat, heap="..node.heap())
gpio.write(LED_PIN, ALLOW_NET and gpio.LOW or gpio.HIGH)
local internet = require("internet")
print("heap="..node.heap())
internet.heartbeat()
package.loaded["internet"] = nil
internet = nil
print("heap="..node.heap())
gpio.write(LED_PIN, ALLOW_NET and gpio.HIGH or gpio.LOW)
counter = counter + 1
if counter >= data_rate_cycles then
counter = 0
print("heap="..node.heap())
local sensors = require("sensors")
sensors.measure_all(function (data)
package.loaded["sensors"] = nil
sensors = nil
print("heap="..node.heap())
local internet = require("internet")
print("heap="..node.heap())
internet = require("internet")
internet.send("data", data)
package.loaded["internet"] = nil
internet = nil
print("heap="..node.heap())
end)
end
end
initAlarms(settings and settings.heartbeat or HEARTBEAT_RATE,
settings and settings.datarate or DATA_RATE)
|
include "app.controller.DialogController"
include "app.runtime.RuntimeData"
_ENV=namespace ()
using_namespace "luaClass"
using_namespace "container"
using_namespace "ui"
using_namespace "controller"
using_namespace "game"
using_namespace "views"
class("EventManager"){
CLASS_DEBUG(false);
public{
STATICFUNC.getInstance(function(cls)
if cls.s_instance==nil then
cls.s_instance=cls()
end
return cls.s_instance
end);
}
}
function EventManager:EventManager()
self.onEventType=map()
self.onEventType:insert("map",
function (mapName)
cc.Director:getInstance()
:replaceScene(views.MapScene:create(mapName))
end
)
self.onEventType:insert("story",
function (storyName)
local story=ResScriptManager:getInstance().
storysQuery:get(storyName)
local controller=DialogController:create(story,
cc.Director:getInstance():getRunningScene().mapName
)
DialogUI:create(controller)
:addTo(cc.Director:getInstance():getRunningScene(),10)
controller:nextAction()
end
)
self.onEventType:insert("shop",
function (shopName)
ShopUI:create(shopName)
:addTo(cc.Director:getInstance():getRunningScene())
end
)
self.onEventType:insert("battle",
function (battleKey)
local battleController=BattleController()
local btScene=BattleScene:create(battleKey,battleController)
btScene:showRoleSelect(
RuntimeData:getInstance().team
)
RuntimeData:getInstance().battleResultStatus=ENUM.BATTLE_RESULT_STATUS.WAIT
cc.Director:getInstance():pushScene(btScene)
end
)
self.onEventType:insert("endGame",
function (value)
cc.Director:getInstance():replaceScene(view.EndScene(value))
end
)
self.onEventType:insert("default",
function (value)
print("warning : undefine event type ,value :"..value)
end
)
mod.EventExtend.EventResultExtend(self.onEventType)
end
function EventManager:checkEvent(events)
for _,event in pairs(events) do
local probTrue=true
if event.probability~=0 then
if not probability(event.probability/100) then
probTrue=false
end
end
local repeatFlag=true
if event.repeatTimes=="once" then
if RuntimeData:getInstance().onceStory:has(event.value) then
repeatFlag=false
end
elseif type(event.repeatTimes)=="number" and event.repeatTimes~=0 then
if RuntimeData:getInstance().limitTimesStory:get(event.value,0)>=event.repeatTimes then
repeatFlag=false
end
end
if probTrue and event.type~="" and repeatFlag then
local conditions=event.condition
if self:checkConditions(conditions) then
return event
end
end
end
return nil
end
function EventManager:checkConditions(conditions,tmpVaribles)
for _,condition in pairs(conditions) do
if not self:checkCondition(condition,tmpVaribles) then
return false
end
end
return true
end
function EventManager:checkCondition(condition,tmpVaribles)
local ctype=condition.type
local value=condition.value
local runtimeData=RuntimeData:getInstance()
-- print(ctype)
local modResult=mod.EventExtend.EventConditionExtend(condition)
if modResult~=nil then
return modResult
end
if ctype=="" then
return true
elseif ctype=="should_finish" then
return runtimeData.storys:has(value)
elseif ctype=="should_not_finish" then
return not runtimeData.storys:has(value)
elseif ctype=="in_team" then
return runtimeData.team:has(value)
elseif ctype=="not_int_team" then
return not runtimeData.team:has(value)
--弃用
elseif ctype=="key_in_team" then
return runtimeData.team:has(value)
elseif ctype=="key_not_in_team" then
return not runtimeData.team:has(value)
elseif ctype=="has_time_key" then
return true
elseif ctype=="not_has_time_key" then
return false
--以上弃用
elseif ctype=="in_time" then
return runtimeData:inTime(value)
elseif ctype=="not_in_time" then
return not runtimeData:inTime(value)
elseif ctype=="have_money" then
return runtimeData:hasMoney(value)
elseif ctype=="have_item" then
return runtimeData:getItemNum(value)>0
elseif ctype=="exceed_day"then
return runtimeData:exceedDay(value)
elseif ctype=="not_exceed_day" then
return not runtimeData:exceedDay(value)
elseif ctype=="in_menpai" then
return runtimeData:inMenpai(value)
elseif ctype=="not_in_menpai" then
return not runtimeData:inMenpai(value)
elseif ctype=="has_menpai" then
return runtimeData:hasMenpai()
elseif ctype=="in_round" then
return runtimeData:inRound(value)
elseif ctype=="not_in_round" then
return not runtimeData:inRound(value)
elseif ctype=="probability" then
return probability(tonumber(value)/100)
elseif ctype=="daode_more_than" then
return runtimeData:daodeMoreThan(value)
elseif ctype=="daode_less_than" then
return runtimeData:daodeLessThan(value)
elseif ctype=="haogan_more_than" then
return runtimeData:haoganMoreThan(value)
elseif ctype=="haogan_less_than" then
return runtimeData:haoganLessThan(value)
elseif ctype=="skill_more_than" then
return runtimeData:skillMoreThan(value)
elseif ctype=="level_greater_than" then
return runtimeData:levelGreaterThan(value)
elseif ctype=="dingli_greater_than" then
return runtimeData:dingliGreaterThan(value)
elseif ctype=="wuxing_greater_than" then
return runtimeData:wuxingGreaterThan(value)
elseif ctype=="dingli_less_than" then
return runtimeData:dingliLessThan(value)
elseif ctype=="wuxing_greater_than" then
return runtimeData:wuxingGreaterThan(value)
elseif ctype=="friendCount" then
return runtimeData:friendCount(value)
elseif ctype=="HAS.TAG" then
return runtimeData.tag:has(value)
elseif ctype=="NOT.HAS" then
return not runtimeData.tag:has(value)
elseif ctype=="CHAPTER" then
return runtimeData.chapter==value
elseif ctype=="HAS.MISSION" then
return runtimeData.missions:has(value)
elseif ctype=="COMPLETE.MISSION" then
return runtimeData.missionsComplete:has(value)
elseif ctype=="SCORES.GREATER.THAN" then
local key,val = unpack(value:split(","))
return runtimeData.questionScores:get(key,0)>(tonumber(val) or 0)
elseif ctype=="SCORES.LESS.THAN" then
local key,val = unpack(value:split(","))
return runtimeData.questionScores:get(key,0)<(tonumber(val) or 0)
elseif ctype=="SCORES.EQUAL.TO" then
local key,val = unpack(value:split(","))
return runtimeData.questionScores:get(key,0)==(tonumber(val) or 0)
elseif ctype=="INNER.VAR.EQUAL" then
local key,val=unpack(value:split(","))
if type(tmpVaribles)~="table" then
print("当前不在INNER MODE ")
return false
end
local newval=tonumber(val)
if newval then
return tmpVaribles[key]==newval
else
return tmpVaribles[key]==val
end
elseif ctype=="INNER.VAR.GREATER.THAN" then
local key,val=unpack(value:split(","))
if type(tmpVaribles)~="table" then
print("当前不在INNER MODE ")
return false
end
local newval=tonumber(val)
if newval then
return tmpVaribles[key]>newval
end
elseif ctype=="INNER.VAR.LESS.THAN" then
local key,val=unpack(value:split(","))
if type(tmpVaribles)~="table" then
print("当前不在INNER MODE ")
return false
end
local newval=tonumber(val)
if newval then
return tmpVaribles[key]<newval
end
elseif ctype=="ITEM.GREATER.THAN" then
local itemName,num=unpack(value:split(","))
num=tonumber(num) or 0
return runtimeData:getItemNum(itemName)>num
elseif ctype=="ITEM.LESS.THAN" then
local itemName,num=unpack(value:split(","))
num=tonumber(num) or 0
return runtimeData:getItemNum(itemName)<num
else
print("未知的条件 type: ",ctype," ,value: ",value)
return false
end
return false
end
function EventManager:doEvent(event)
local luaf=self.onEventType:get(event.type,self.onEventType:get("default"))
if event.repeatTimes=="once" then
RuntimeData:getInstance().onceStory:insert(event.value)
elseif type(event.repeatTimes)=="number" and event.repeatTimes~=0 then
RuntimeData:getInstance().limitTimesStory:insert(event.value,
RuntimeData:getInstance().limitTimesStory:get(event.value,0)+1
)
end
luaf(event.value)
end
function EventManager:console(type,...)
self.onEventType:get(type,self.onEventType:get("default"))(...)
end
|
local Broadcast = require("core.Broadcast")
local Heal = require("core.Heal")
local EffectFlag = require("core.EffectFlag")
---
---Implementation effect for second wind skill
return {
config = { name = "Second Wind", type = "skill:secondwind" },
flags = { EffectFlag.BUFF },
listeners = {
damaged = function(self, damage)
if damage.attribute ~= "energy" then return end
if self.skill:onCooldown(self.target) then return end
if (self.target:getAttribute("energy") /
self.target:getMaxAttribute("energy") * 100 > self.state.threshold) then
return;
end
Broadcast.sayAt(self.target, "<bold><yellow>You catch a second wind!");
local amount = math.floor(self.target:getMaxAttribute("energy") *
(self.state.restorePercent / 100));
local heal = Heal("energy", amount, self.target, self.skill);
heal:commit(self.target);
self.skill:cooldown(self.target);
end,
},
};
|
--***********************************************************
--** THE INDIE STONE **
--***********************************************************
require "TimedActions/ISBaseTimedAction"
require "ISUI/ISLayoutManager"
---@class ISBBQInfoAction : ISBaseTimedAction
ISBBQInfoAction = ISBaseTimedAction:derive("ISBBQInfoAction")
function ISBBQInfoAction:isValid()
return self.bbq:getObjectIndex() ~= -1
end
function ISBBQInfoAction:waitToStart()
self.character:faceThisObject(self.bbq)
return self.character:shouldBeTurning()
end
function ISBBQInfoAction:perform()
local window = ISBBQInfoWindow.windows[self.character]
if window then
window:setObject(self.bbq)
else
local x = getPlayerScreenLeft(self.playerNum)
local y = getPlayerScreenTop(self.playerNum)
local w = getPlayerScreenWidth(self.playerNum)
local h = getPlayerScreenHeight(self.playerNum)
window = ISBBQInfoWindow:new(x + 70, y + 50, self.character, self.bbq)
window:initialise()
window:addToUIManager()
ISBBQInfoWindow.windows[self.character] = window
if self.character:getPlayerNum() == 0 then
ISLayoutManager.RegisterWindow('bbq', ISCollapsableWindow, window)
end
end
window:setVisible(true)
window:addToUIManager()
local joypadData = JoypadState.players[self.playerNum+1]
if joypadData then
joypadData.focus = window
end
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self)
end
function ISBBQInfoAction:new(character, bbq)
local o = {}
setmetatable(o, self)
self.__index = self
o.maxTime = 0
o.stopOnWalk = true
o.stopOnRun = true
o.character = character
o.playerNum = character:getPlayerNum()
o.bbq = bbq
return o
end
|
local gears = require "gears"
local beautiful = require "beautiful"
beautiful.init(gears.filesystem.get_themes_dir() .. "gtk/theme.lua")
-- REFERENCE: https://awesomewm.org/doc/api/documentation/06-appearance.md.html
-- TODO: Use QS logo
-- Generate Awesome icon:
-- theme.awesome_icon = theme_assets.awesome_icon(
-- theme.menu_height, theme.bg_focus, theme.fg_focus
-- )
beautiful.awesome_icon = nil
beautiful.font = "Sarasa UI J 10"
beautiful.notification_icon_size = 150
-- local default_wallpaper = -- TODO: Randomized wallpaper
|
local deepcopy = require "deepcopy"
local json = require "json"
local network_handler = {}
network_handler.socket = nil
network_handler.server_socket = nil
network_handler.is_host = false
network_handler.host_ip = nil
network_handler.host_port = nil
network_handler.is_connected = false
network_handler.receive_buffer = {}
network_handler.receive_buffer_consumer_index = 1
network_handler.receive_buffer_producer_index = 1
network_handler.send_buffer = {}
network_handler.send_buffer_consumer_index = 1
network_handler.send_buffer_producer_index = 1
network_handler.max_buffer_items = 12000
network_handler.random_seed = nil
function network_handler.reset_buffers()
network_handler.receive_buffer = {}
network_handler.receive_buffer_consumer_index = 1
network_handler.receive_buffer_producer_index = 1
network_handler.send_buffer = {}
network_handler.send_buffer_consumer_index = 1
network_handler.send_buffer_producer_index = 1
end
function network_handler.send(data)
if network_handler.is_connected == false then
return
end
network_handler.socket:send(data)
end
function network_handler.try_receive()
if network_handler.is_connected == false then
return
end
return network_handler.socket:receive()
end
function network_handler.produce_receive_buffer()
if network_handler.is_connected == false then
return false
end
local data = network_handler.try_receive()
if data == nil then
return false
end
network_handler.receive_buffer[network_handler.receive_buffer_producer_index] = data
network_handler.receive_buffer_producer_index = network_handler.receive_buffer_producer_index + 1
if network_handler.receive_buffer_producer_index > network_handler.max_buffer_items then
network_handler.receive_buffer_producer_index = 1
end
return true
end
function network_handler.query_receive_buffer_next()
local temp_consume_buffer_index = network_handler.receive_buffer_consumer_index + 1
if temp_consume_buffer_index > temp_consume_buffer_index then
temp_consume_buffer_index = 1
end
if temp_consume_buffer_index >= network_handler.receive_buffer_producer_index then
return nil
end
return network_handler.receive_buffer[temp_consume_buffer_index]
end
function network_handler.rewind_receive_buffer_consumer_index()
network_handler.receive_buffer_consumer_index = network_handler.receive_buffer_consumer_index - 1
if network_handler.receive_buffer_consumer_index < 1 then
network_handler.receive_buffer_consumer_index = network_handler.max_buffer_items
end
end
function network_handler.consume_receive_buffer()
if network_handler.receive_buffer_consumer_index == network_handler.receive_buffer_producer_index then
return nil
end
data = network_handler.receive_buffer[network_handler.receive_buffer_consumer_index]
network_handler.receive_buffer_consumer_index = network_handler.receive_buffer_consumer_index + 1
if network_handler.receive_buffer_consumer_index > network_handler.max_buffer_items then
network_handler.receive_buffer_consumer_index = 1
end
return data
end
function network_handler.produce_send_buffer(data)
network_handler.send_buffer[network_handler.send_buffer_producer_index] = deepcopy(data)
network_handler.send_buffer_producer_index = network_handler.send_buffer_producer_index + 1
if network_handler.send_buffer_producer_index > network_handler.max_buffer_items then
network_handler.send_buffer_producer_index = 1
end
end
function network_handler.consume_send_buffer()
if network_handler.is_connected == false then
return false
end
if network_handler.send_buffer_producer_index == network_handler.send_buffer_consumer_index then
return false
end
network_handler.send(network_handler.send_buffer[network_handler.send_buffer_consumer_index])
network_handler.send_buffer_consumer_index = network_handler.send_buffer_consumer_index + 1
if network_handler.send_buffer_consumer_index > network_handler.max_buffer_items then
network_handler.send_buffer_consumer_index = 1
end
return true
end
function network_handler.start_server()
local socket = require("socket")
network_handler.server_socket = assert(socket.bind("*", network_handler.host_port))
local ip, port = network_handler.server_socket:getsockname()
--print("Please connect to port " .. port)
network_handler.server_socket:settimeout(60)
network_handler.socket, err = network_handler.server_socket:accept()
network_handler.socket:settimeout(0)
network_handler.is_connected = true
math.randomseed(os.time())
network_handler.random_seed = math.random(2147483647)
network_handler.send(tostring(network_handler.random_seed) .. "\n")
-- Wait for seed ACK
local line, err = nil, nil
while line == nil do
line, err = network_handler.try_receive()
end
--local line, err = nil, nil
--while line == nil do
-- line, err = network_handler.try_receive()
--end
--print("Received line: " .. line)
--network_handler.send(json.encode({a="test", b="test2"}) .. "\n")
-- Create test send buffer from host -> client
--network_handler.produce_send_buffer(json.encode({a="test", b="test2"}) .. "\n")
--network_handler.produce_send_buffer(json.encode({c="test", d="awesome"}) .. "\n")
--network_handler.produce_send_buffer(json.encode({f="test", g="test2"}) .. "\n")
--print("After producing send buffer entries: " .. network_handler.send_buffer_producer_index)
--print("Consuming: " .. network_handler.send_buffer_consumer_index)
--while network_handler.consume_send_buffer() do
-- print("Consuming: " .. network_handler.send_buffer_consumer_index)
--end
end
function network_handler.start_client()
print ("Starting client: " .. network_handler.host_ip .. ":" .. network_handler.host_port)
local socket = require("socket")
network_handler.socket = assert(socket.tcp())
network_handler.socket:settimeout(0)
network_handler.socket:connect(network_handler.host_ip, network_handler.host_port);
network_handler.is_connected = true
-- Wait for server seed
local line, err = nil, nil
while line == nil do
line, err = network_handler.try_receive()
end
network_handler.random_seed = tonumber(line)
network_handler.send("ACK\n")
--while network_handler.receive_buffer_producer_index < 4 do
-- network_handler.produce_receive_buffer()
-- print("Waiting for receive buffer: " .. network_handler.receive_buffer_producer_index)
--end
-- Read from receive buffer
--local data = 1
--data = network_handler.consume_receive_buffer()
--while data ~= nil do
-- print("Received: ")
-- print(json.decode(data))
-- data = network_handler.consume_receive_buffer()
--end
--network_handler.send("hello world\n");
--while line == nil do
-- line, err = network_handler.try_receive()
--end
--print("Received line: ", json.decode(line))
end
function network_handler.close_sockets()
network_handler.socket:close()
if network_handler.is_host then
network_handler.server_socket:close()
end
end
function network_handler.open_connection_form(on_form_close_callback)
network_handler.is_connected = false
menu = forms.newform(300, 140, "Gauntlet Netplay Init", on_form_close_callback)
local windowsize = client.getwindowsize()
local form_xpos = (client.xpos() + 120*windowsize - 142)
local form_ypos = (client.ypos() + 80*windowsize + 10)
forms.setlocation(menu, form_xpos, form_ypos)
label_ip = forms.label(menu,"IP:",8,0,32,24)
port_ip = forms.label(menu,"Port:",8,30,32,24)
textbox_ip = forms.textbox(menu,"127.0.0.1",240,24,nil,40,0)
textbox_port = forms.textbox(menu,"65367",240,24,nil,40,30)
local function on_host_click()
network_handler.is_host = true
network_handler.host_port = tonumber(forms.gettext(textbox_port))
network_handler.start_server()
forms.destroyall()
end
local function on_client_click()
network_handler.is_host = false
network_handler.host_ip = forms.gettext(textbox_ip)
network_handler.host_port = tonumber(forms.gettext(textbox_port))
network_handler.start_client()
forms.destroyall()
end
button_host = forms.button(menu, "Host", on_host_click, 80,60,48,24)
button_join = forms.button(menu, "Join", on_client_click, 160,60,48,24)
end
return network_handler
|
local rawget, rawset = rawget, rawset
local setmetatable = setmetatable
local getmetatable = getmetatable
local insert, remove = table.insert, table.remove
local gmatch = string.gmatch
local format = string.format
local newproxy = newproxy
local type = type
module( "yu.runtime", package.seeall )
--------------------------------------------------------------------
----CLASS
--------------------------------------------------------------------
local classMT={}
local function newClass( name, classDecl ,superClass, body ) --needed by builtin class
if superClass then setmetatable(body,superClass) end
--todo: cache method for class?
classDecl.__type = 'class'
classDecl.__name = name
classDecl.__index = body
classDecl.__super = superClass or false
if superClass then
local subclass = superClass and superClass.__subclass
if not subclass then
subclass = {}
superClass.__subclass = subclass
end
subclass[classDecl] = true
end
local methodPointers = setmetatable( {}, { __mode = 'kv' } )
function body:__build_methodpointer(id)
local pointers = rawget(self,'@methodpointers')
if not poointers then
pointers = {}
rawget( self, '@methodpointers', pointers )
end
local mp = pointers[id]
if not mp then
local f = self[id]
mp = function(...) return f(self,...) end
pointers[id] = mp
end
return mp
end
return classDecl
end
local proxygc = function(p)
local t = getmetatable(p).__index
local c = getmetatable(t)
while c do
local f=c.__finalize
if f then f(t) end
c=c.__super
end
end
local function makefinalizer( t )
local p = newproxy(true)
local mt = getmetatable(p)
mt.__gc = proxygc
mt.__index = t
mt.__newindex = t
return p
end
local function callInit( clas, obj )
local super = clas.__super
if super then callInit( super, obj ) end
local init = clas.__index.__init
if init then
init( obj )
end
end
function newObject( clas, obj, constructor, ... )
setmetatable( obj, clas )
callInit( clas, obj )
if constructor then
constructor( obj, ... )
else
setmetatable( obj, clas )
end
return obj
-- if finalizer then
-- return makefinalizer(obj)
-- else
-- return obj
-- end
end
--------------------------------------------------------------------
----BUILTIN
--------------------------------------------------------------------
local builtinSymbols,runtimeIndex
builtinSymbols = {}
function registerBuiltinClass(name,superclass, body )
if superclass then
local n = {}
for k,v in pairs( body ) do
n[k] = v
end
local s = superclass
while s do
for k,v in pairs( s.__index ) do
if not n[k] then n[k] = v end
end
s = s.__super
end
body = n
end
local clas = newClass( name, {}, superclass, body )
builtinSymbols[name] = clas
return clas
end
function registerBultinFunction( name, func )
assert(not builtinSymbols[name])
-- assert(type(func) == 'function')
builtinSymbols[name] = func
return func
end
--------------------------------------------------------------------
----TYPE
--------------------------------------------------------------------
function getType(v)
local t= type(v)
if t == "number" or t == "boolean" or t == "nil" or t == "string" then return t end
if t == "table" then --table/ object
local c = getmetatable(v)
if c then return c end
elseif t == "function" then --closure/function
return t
elseif t == 'userdata' then
return t
elseif t == 'thread' then
return t
else
error('unknown type:'..t)
end
end
local function __isSubclass(sub,super)
repeat
local s=sub.__super
-- print(sub.__name, s)
if s and s == super then return true end
sub=s
until not sub
return false
end
function checkType(sub,super) --t == v or t is subclass of v
if sub == super then return true end
if super == nil then return false end
if type(sub) == "table" then --class
if super == 'object' then return true end
if __isSubclass(sub,super) then return true end
end
return false
end
function isType(data,t)
return checkType(getType(data),t)
end
function objectNext( obj )
return obj.__next,obj
end
function cast(obj,t)
return isType(obj,t) and obj or nil
end
--------------------------------------------------------------------
----SIGNAL
--------------------------------------------------------------------
local signalConnectionTable={}
local next=next
local weakmt = {__mode='kv'}
function signalCreate(name)
--TODO
local conn=setmetatable({},weakmt)
local function signalEmit(sender,...)
sender=sender or 'all'
local l=conn[sender]
if not l then return end
local k,v
while true do
k,v =next(l,k) --k is func, v is receiver
if not k then break end
if v then --method/signal
k(v,...)
else
k(...)
end
end
if sender~='all' then
local l=conn['all']
if not l then return end
local k
while true do
k,v =next(l,k) --k is func, v is receiver
if not k then break end
if v then
k(v,...)
else
k(...)
end
end
end
end
signalConnectionTable[signalEmit]=conn
return signalEmit
end
function signalConnect(signal,sender,slot,receiver )
local conn = signalConnectionTable[signal]
local l = conn[sender]
if not l then
l = setmetatable( {}, weakmt )
conn[sender] = l
end
l[slot] = receiver or false --random?
return l --return channel for fast remove
end
--------------------------------------------------------------------
----REFLECTION
--------------------------------------------------------------------
local reflectionRegistryN = {} --todo: should we support multiple contexts?
local reflectionRegistryV = {}
local TypeInfo = {}
function TypeInfo:getName()
return self.name
end
function TypeInfo:getTag()
return 'type'
end
function TypeInfo:isExtern()
return self.extern or false
end
function TypeInfo:isPrivate()
return self.private or false
end
function TypeInfo:getAnnotationList()
return self.annotaions or nil
end
local ClassInfo={}
function ClassInfo:getTag()
return 'class'
end
function ClassInfo:getSuperClass()
if not self.decl then return nil end
local s = self.decl.__super
if s then
return reflectionRegistryV[s]
else
return nil
end
end
function ClassInfo:getSubClassList()
if not self.decl then return nil end
local subclass = self.decl.__subclass
if not subclass then return {} end
local res={}
local i=0
for c in pairs(subclass) do
i=i+1
res[i]=reflectionRegistryV[c]
end
end
function ClassInfo:getMemberList()
return self.members
end
function ClassInfo:getMember(name)
for i,v in ipairs(self.members) do
if v.name == name then return v end
end
return nil
end
function ClassInfo:getField(name)
local m = self:getMember(name)
if m.mtype == 'field' then return m end
return nil
end
function ClassInfo:getMethod(name)
local m=self:getMember(name)
if m.mtype == 'method' then return m end
return nil
end
----Enum
local EnumInfo = {}
function EnumInfo:getTag()
return 'enum'
end
function EnumInfo:getItem(name)
for i, n in ipairs(self.items) do
if n[1] == name then return n[2] end
end
return nil
end
function EnumInfo:getItemTable()
local t = {}
for i, n in ipairs(self.items) do
t[n[1]] = n[2]
end
return t
end
-----MemberInfo
local MemberInfo = {}
function MemberInfo:getName()
return self.name
end
function MemberInfo:isPrivate()
return self.private or false
end
function MemberInfo:getMemberType()
return self.mtype
end
function MemberInfo:getAnnotationList()
return self.annotaions or nil
end
local FieldInfo = {}
function FieldInfo:getType()
local t = self.type
local info = reflectionRegistryN[t]
if info then
return info
elseif t:find('func(') == 1 then
--todo
error('todo:func typeinfo')
end
error('todo:other typeinfo:'..t)
end
function FieldInfo:getValue(obj)
--todo: typecheck?
return obj[self.name]
end
function FieldInfo:setValue(obj,v)
--todo: typecheck?
obj[self.name]=v
end
local MethodInfo={}
function MethodInfo:invoke(obj, ...)
local m=obj[self.name]
if m then return m(obj, ...) end
end
function MethodInfo:getRetType()
end
function MethodInfo:getArguments()
end
local ArgInfo={}
function ArgInfo:getType()
--TODO
end
local TypeInfoClass = registerBuiltinClass("TypeInfo", nil, TypeInfo)
local ClassInfoClass = registerBuiltinClass("ClassType", TypeInfoClass, ClassInfo)
local EnumInfoClass = registerBuiltinClass("EnumType", TypeInfoClass, EnumInfo)
local MemberInfoClass = registerBuiltinClass("MemberInfo", nil, MemberInfo)
local FieldInfoClass = registerBuiltinClass("FieldInfo", MemberInfoClass, FieldInfo)
local MethodInfoClass = registerBuiltinClass("MethodInfo", MemberInfoClass, MethodInfo)
local ArgInfoClass = registerBuiltinClass("ArgInfo", nil, ArgInfo)
local FunctionType = {}
function FunctionType:getArguments()
--TODO
end
local FunctionTypeClass=registerBuiltinClass("FunctionType", TypeInfoClass, FunctionType)
local function registerValueTypeInfo(name,clasname)
local body={}
function body:getTag()
return name
end
local clas=registerBuiltinClass(clasname, TypeInfoClass, body)
reflectionRegistryN[name]=setmetatable({},clas)
end
--basic types
registerValueTypeInfo( "nil", "NilType" )
registerValueTypeInfo( "boolean", "BooleanType" )
registerValueTypeInfo( "number", "NumberType" )
registerValueTypeInfo( "string", "StringType" )
registerValueTypeInfo( "object", "ObjectType" )
-- registerValueTypeInfo( "userdata", "UserdataType" )
-------static helpers
function getTypeInfoByName(name)
if name then
local t = reflectionRegistryN[name]
return t
else
return nil
end
end
function getTypeInfoByValue(v)
local vt = getType(v)
if vt then
local t = reflectionRegistryV[vt]
return t
else
return nil
end
end
------------
function addReflection(rtype, decl, name, info, memberInfo)
-- print('+', rtype, name, decl ,info , memberInfo)
local r = info
r.type = rtype
r.name = name
r.decl = decl or false
-- r.extern=info.extern or false
-- r.private=info.private
if rtype == 'class' then
r.superclass=info.superclass or false
for i, m in ipairs(memberInfo) do
local mtype=m.mtype
if mtype == 'field' then
setmetatable(m, FieldInfoClass)
elseif mtype == 'method' then
setmetatable(m, MethodInfoClass)
end
end
r.members=memberInfo
setmetatable(r, ClassInfoClass)
elseif rtype == 'enum' then
r.items=memberInfo
setmetatable(r, EnumInfoClass)
end
if decl then
reflectionRegistryV[decl]=r
end
reflectionRegistryN[name]=r
end
function addAnnotation(name, ann)
local r=reflectionRegistryN[name]
assert(r)
--member
if r:getTag() == 'class' then
local members=r.members
for k,a in pairs(ann) do
if k == 1 then
r.annotaions=a
else
local m=r:getMember(k)
m.annotaions=a
end
end
end
end
--------------------------------------------------------------------
----COROUTINE
--------------------------------------------------------------------
local yield = coroutine.yield
local corocreate = coroutine.create
local cororesume = coroutine.resume
local cororunning = coroutine.running
-- local generatorFuncs={}
local generatorPool = {}
local __THREAD_WAITING = {}
local waitResumeKey = {}
local function generatorInner(coro,func,...)
generatorPool[coro]=nil --thread is out of pool
yield() --wait for first resume
return func(...)
end
local function generatorWrapper( coro, key, func, ... )
if key~=__THREAD_WAITING then --the coro is used by a dead generator
error("generator already dead")
end
return generatorWrapper(yield(__THREAD_WAITING, generatorInner(coro,func,...)))
end
local function generatorResumeInner(coro,flag,a,...)
if flag then
if a == __THREAD_WAITING then --the func returned
generatorPool[coro]=true
return ...
else
return a,...
end
else --error
--TODO: handle error
error(debug.traceback(coro))
end
end
function generatorResume(coro)
return generatorResumeInner(coro,cororesume(coro))
end
local function getGeneratorCoro()
local coro,_=next(generatorPool)
if not coro then
coro=corocreate(generatorWrapper)
generatorPool[coro]=true
end
return coro
end
function generatorSpawn(f,a,...)
local coro=getGeneratorCoro()
if type(f) == "string" then --method lookup
f=a[f]
end
cororesume(coro, coro, __THREAD_WAITING, f, a,...)
return coro
end
generatorYield=yield
local function waitInner(key,...)
if key~=waitResumeKey then
error('thread is waiting a signal,can not resume')
end
return ...
end
function signalWait(sig,sender)
--todo: use some lighter structure
local signalChannel
local slot
local coro=cororunning()
slot=function(...)
signalChannel[slot]=nil
cororesume(coro,waitResumeKey,...)
end
signalChannel=signalConnect(sig,sender,slot)
return waitInner(yield())
end
--------------------------------------------------------------------
----@TRY-CATCH
--------------------------------------------------------------------
local coroCreate = coroutine.create
local coroStatus = coroutine.status
local coroResume = coroutine.resume
-- local assert = assert
local yield = coroutine.yield
local next = next
local ex
function doThrow( e, level )
ex = e
error( tostring(e), level or 2 )
end
function doAssert( cond, ex )
if not cond then
if ex then
ex = 'assert failed: ' .. tostring( ex )
else
ex = 'assert failed.'
end
doThrow( ex, 3 )
end
end
local RETURNKEY = {}
local ENDKEY = {} -- if try block return this, there's no user return
local BREAKKEY = {}
local CONTINUEKEY = {}
local function tryCore(func)
while true do
local a,b,c,d,e,f,g=func( ENDKEY, BREAKKEY, CONTINUEKEY )
if a == ENDKEY or a == BREAKKEY or a == CONTINUEKEY then --no user return
func=yield(a) --wait for next entry
else
func=yield( RETURNKEY, a,b,c,d,e,f,g )
end
end
end
local tryCoroPool={} --coroutine pool
local function getTryCoro()
local coro,_ = next(tryCoroPool)
if coro then
tryCoroPool[coro]=nil
else
coro=coroCreate(tryCore)
end
return coro
end
local function __handleTry(succ,a,...)
if succ then
if a == ENDKEY then
tryCoroPool[coro]=true -- push to pool
return "end"
elseif a == BREAKKEY then
tryCoroPool[coro]=true -- push to pool
return "break"
elseif a == CONTINUEKEY then
tryCoroPool[coro]=true -- push to pool
return "continue"
elseif a == RETURNKEY then --user return values
tryCoroPool[coro]=true -- push to pool
return "return",...
else --yield in try block
yield(a,...) --send yield out
end
else --exception
return "error",__lxexception(a)
end
end
function doTry(func)
local coro=getTryCoro()
return __handleTry(coroResume(coro,func))
end
--------------------------------------------------------------------
----MODULE
--------------------------------------------------------------------
local moduleTable={}
function requireModule(path)
--todo:load module if not loaded
local m=moduleTable[path]
if not m then
--load module
-- print('loading module:',path)
local f,err = loadfile(path..'.yo') --todo: basepath support
if not f then
print(err)
return error('Module not load:'..path)
end
f()
m=moduleTable[path]
assert(m)
end
return m
end
function launchModule(path,...)
local m = requireModule(path)
m.__yu_module_init() --setup local symbol loaders
m.__yu_module_refer() --link extern symbols
return m.__yu_module_entry(...) --actually init local symbols, run module.main()
end
local loadExternSymbol
function loadExternSymbol( name )
local s = runtimeIndex[name]
if s then return s end
local s = builtinSymbols[name]
-- print(s,name)
if s then return s end
local t = _G
for w in gmatch(name, "(%w+)[.]?") do
t = t[w]
if not t then
-- print('warning:extern symbol not found :',name)
return nil
end
end
return t
end
local tostring=tostring
runtimeIndex=setmetatable({
__yu_newclass = newClass,
__yu_newobject = newObject,
__yu_addannotation = addAnnotation,
__yu_addreflection = addReflection,
__yu_try = doTry,
__yu_throw = doThrow,
__yu_assert = doAssert,
__yu_cast = cast,
__yu_is = isType,
__yu_tostring = function(x)
return x and tostring(x)
end,
__yu_obj_next = objectNext,
__yu_wait = signalWait,
__yu_connect = signalConnect,
__yu_resume = generatorResume,
__yu_spawn = generatorSpawn,
__yu_yield = generatorYield,
__yu_require = requireModule,
__yu_extern = loadExternSymbol,
__yu_gettypeinfoN = getTypeInfoByName,
__yu_gettypeinfoV = getTypeInfoByValue
}, { __index = _G })
function module(path)
local moduleEnv=setmetatable(
{},{
__path = path,
__name = name,
__index = runtimeIndex,
__is_yu_module = true,
}
)
moduleTable[path] = moduleEnv
setfenv(2, moduleEnv)
return moduleEnv
end
---------------@Lua Debug Injections---
local function findLine(lineOffset,pos)
local off0 = 0
local l0 = 0
local off = 0
for l,linesize in ipairs(lineOffset) do
off = off+linesize
if pos >= off0 and pos < off then
return l0, pos-off0
end
off0 = off
l0 = l
end
return l0, pos-off0
end
local function makeYuTraceString(info,modEnv)
local dinfo = modEnv.__yu__debuginfo
if not dinfo then
return 'unkown track in YU:'..getmetatable(modEnv).__name
end
local lineTarget = dinfo.line_target
local lineOffset = dinfo.line_offset
local line = info.currentline
for i, data in ipairs(lineTarget) do
local l = data[1]
local range = data[2]
if line>=l and line<=l+range then
local l1,off1 = findLine(lineOffset,data[3])
local l2,off2 = findLine(lineOffset,data[4])
return format(
'%s:%d: <%d:%d-%d:%d>',
dinfo.path,l1,
l1,off1,
l2,off2
)
end
end
-- table.foreach(getmetatable(modEnv),print)
return 'unkown track in YU:'..(getmetatable(modEnv).__path or '?')
end
local function makeLuaTraceString(info)
local what = info.what
local whatInfo
if what == 'main' then
if info.name then
whatInfo = string.format('function \'%s\'',info.name)
else
whatInfo = 'main chunk'
end
elseif what == 'Lua' then
whatInfo=string.format('function \'%s\'',info.name or '?')
elseif what == 'C' then
whatInfo = nil
return '[C]: ?'
end
if whatInfo~=nil then
whatInfo = 'in '..whatInfo
else
whatInfo = '?'
end
return
string.format(
'%s:%d: %s',info.short_src,info.currentline,whatInfo
)
end
local function isStackInYU(level)
local info = debug.getinfo(level)
if not info then return false end
local func = info.func
local env = getfenv(func)
local mt = env and getmetatable(env)
return mt and mt.__is_yu_module
end
function getStackPos(level)
local info = debug.getinfo(level)
if not info then return false end
local func = info.func
local env = getfenv(func)
local mt = env and getmetatable(env)
if mt and mt.__is_yu_module then
return makeYuTraceString(info,env)
else -- normal Lua stack
return makeLuaTraceString(info)
end
return makeLuaTraceString(info)
end
function traceBack(level)
level = level or 3
local output='stack traceback:\n'
while true do
local info = getStackPos(level+1)
if not info then break end
output = output..'\t'..info..'\n'
level = level+1
end
return output
end
local function _matchErr(etype, msg, pattern)
local data
data = { msg:match(pattern) }
if data[1] then return {etype,data} end
return false
end
local function extractErrorInfo(msg)
--just some partial checking
return
_matchErr('arith', msg,
'attempt to perform arithmetic on ([%w_]+) \'([%w_]+)\' %(a ([%w_]+) value%)')
or
_matchErr('index', msg,
'attempt to index ([%w_]+) \'([%w_]+)\' %(a ([%w_]+) value%)')
or
_matchErr('nilindex', msg,
'table index is nil')
end
function convertLuaErrorMsg( msg, level )
local res
res=extractErrorInfo(msg)
if res then
local etype,data=unpack(res)
if etype == 'arith' then
msg=string.format('attempt to perform arithmetic on non number value (a %s value)',data[3])
elseif etype == 'index' then
msg=string.format('attempt to index a %s value',data[3])
elseif etype == 'nilindex' then
msg=string.format('table index is nil')
end
else
msg=msg:match('.*:%d+: (.*)') or msg
end
local info=getStackPos(level+1)
return info..' '..msg
end
function errorHandler( msg, b )
local startLevel = 2
local info
info = debug.getinfo(startLevel)
if info.func == error then startLevel = startLevel + 1 end
info = debug.getinfo(startLevel)
if info.func == doThrow then startLevel = startLevel + 1 end
info = debug.getinfo(startLevel)
if info.func == doAssert then startLevel = startLevel + 1 end
local traceInfo=traceBack(startLevel+1)
if isStackInYU(startLevel+1) then
msg=convertLuaErrorMsg(msg, startLevel+1)
end
if msg then
io.stderr:write(msg,'\n')
end
io.stderr:write(traceInfo,'\n')
end
----------------------@Entry Interfaces
local _dofile=dofile
function run(file,...) --yu module launcher
return xpcall(function(...)
return launchModule(file,...)
end
,errorHandler
,...)
end
|
#!/usr/bin/env tarantool
local tap = require('tap')
local test = tap.test('cfg')
local socket = require('socket')
local fio = require('fio')
local uuid = require('uuid')
local msgpack = require('msgpack')
test:plan(89)
--------------------------------------------------------------------------------
-- Invalid values
--------------------------------------------------------------------------------
test:is(type(box.cfg), 'function', 'box is not started')
local function invalid(name, val)
local status, result = pcall(box.cfg, {[name]=val})
test:ok(not status and result:match('Incorrect'), 'invalid '..name)
end
invalid('memtx_min_tuple_size', 7)
invalid('memtx_min_tuple_size', 0)
invalid('memtx_min_tuple_size', -1)
invalid('memtx_min_tuple_size', 1048281)
invalid('memtx_min_tuple_size', 1000000000)
invalid('replication', '//guest@localhost:3301')
invalid('replication_timeout', -1)
invalid('replication_timeout', 0)
invalid('replication_sync_lag', -1)
invalid('replication_sync_lag', 0)
invalid('replication_connect_timeout', -1)
invalid('replication_connect_timeout', 0)
invalid('replication_connect_quorum', -1)
invalid('wal_mode', 'invalid')
invalid('rows_per_wal', -1)
invalid('listen', '//!')
invalid('log', ':')
invalid('log', 'syslog:xxx=')
invalid('log_level', 'unknown')
invalid('vinyl_read_threads', 0)
invalid('vinyl_write_threads', 1)
invalid('vinyl_range_size', 0)
invalid('vinyl_page_size', 0)
invalid('vinyl_run_count_per_level', 0)
invalid('vinyl_run_size_ratio', 1)
invalid('vinyl_bloom_fpr', 0)
invalid('vinyl_bloom_fpr', 1.1)
test:is(type(box.cfg), 'function', 'box is not started')
--------------------------------------------------------------------------------
-- All box members must raise an exception on access if box.cfg{} wasn't called
--------------------------------------------------------------------------------
local box = require('box')
local function testfun()
return type(box.space)
end
local status, result = pcall(testfun)
test:ok(not status and result:match('Please call box.cfg{}'),
'exception on unconfigured box')
status, result = pcall(box.error, box.error.ILLEGAL_PARAMS, 'xx')
test:ok(result.code == box.error.ILLEGAL_PARAMS, "box.error without box.cfg")
status, result = pcall(function() return box.runtime.info() end)
test:ok(status and type(result) == 'table', "box.runtime without box.cfg")
status, result = pcall(function() return box.index.EQ end)
test:ok(status and type(result) == 'number', "box.index without box.cfg")
status, result = pcall(function() return box.NULL end)
test:ok(status and result == msgpack.NULL, "box.NULL without box.cfg")
status, result = pcall(box.session.id)
test:ok(status, "box.session without box.cfg")
status, result = pcall(box.tuple.new, {1, 2, 3})
test:ok(status and result[1] == 1, "box.tuple without box.cfg")
os.execute("rm -rf vinyl")
box.cfg{
log="tarantool.log",
memtx_memory=104857600,
wal_mode = "", -- "" means default value
}
-- gh-678: vinyl engine creates vinyl dir with empty 'snapshot' file
test:isnil(io.open("vinyl", 'r'), 'vinyl_dir is not auto-created')
status, result = pcall(testfun)
test:ok(status and result == 'table', 'configured box')
--------------------------------------------------------------------------------
-- Dynamic configuration
--------------------------------------------------------------------------------
invalid('log_level', 'unknown')
--------------------------------------------------------------------------------
-- gh-534: Segmentation fault after two bad wal_mode settings
--------------------------------------------------------------------------------
test:is(box.cfg.wal_mode, "write", "wal_mode default value")
-- box.cfg{wal_mode = ""}
-- test:is(box.cfg.wal_mode, "write", "wal_mode default value")
-- box.cfg{wal_mode = "none"}
-- test:is(box.cfg.wal_mode, "none", "wal_mode change")
-- "" or NULL resets option to default value
-- box.cfg{wal_mode = ""}
-- test:is(box.cfg.wal_mode, "write", "wal_mode default value")
-- box.cfg{wal_mode = "none"}
-- test:is(box.cfg.wal_mode, "none", "wal_mode change")
-- box.cfg{wal_mode = require('msgpack').NULL}
-- test:is(box.cfg.wal_mode, "write", "wal_mode default value")
test:is(box.cfg.force_recovery, false, "force_recovery default value")
box.cfg{force_recovery=true}
test:is(box.cfg.force_recovery, true, "force_recovery new value")
test:is(box.cfg.wal_dir_rescan_delay, 2, "wal_dir_rescan_delay default value")
box.cfg{wal_dir_rescan_delay=0.2}
test:is(box.cfg.wal_dir_rescan_delay, 0.2, "wal_dir_rescan_delay new value")
test:is(box.cfg.too_long_threshold, 0.5, "too_long_threshold default value")
box.cfg{too_long_threshold=0.1}
test:is(box.cfg.too_long_threshold , 0.1, "too_long_threshold new value")
--------------------------------------------------------------------------------
-- gh-246: Read only mode
--------------------------------------------------------------------------------
test:is(box.cfg.read_only, false, "read_only default value")
box.cfg{read_only = true}
test:is(box.cfg.read_only, true, "read_only new value")
local status, reason = pcall(function()
box.space._schema:insert({'read_only', 'test'})
end)
test:ok(not status and box.error.last().code == box.error.READONLY,
"read_only = true")
box.cfg{read_only = false}
local status, reason = pcall(function()
box.space._schema:insert({'read_only', 'test'})
end)
test:ok(status, "read_only = false")
-- gh-2663: box.cfg() parameter to set the number of coio threads
box.cfg({ worker_pool_threads = 1})
test:is(box.cfg.worker_pool_threads, 1, 'worker_pool_threads')
local tarantool_bin = arg[-1]
local PANIC = 256
function run_script(code)
local dir = fio.tempdir()
local script_path = fio.pathjoin(dir, 'script.lua')
local script = fio.open(script_path, {'O_CREAT', 'O_WRONLY', 'O_APPEND'},
tonumber('0777', 8))
script:write(code)
script:write("\nos.exit(0)")
script:close()
local cmd = [[/bin/sh -c 'cd "%s" && "%s" ./script.lua 2> /dev/null']]
local res = os.execute(string.format(cmd, dir, tarantool_bin))
fio.rmdir(dir)
return res
end
-- gh-715: Cannot switch to/from 'fsync'
code = [[ box.cfg{ log="tarantool.log", wal_mode = 'fsync' }; ]]
test:is(run_script(code), 0, 'wal_mode fsync')
code = [[ box.cfg{ wal_mode = 'fsync' }; box.cfg { wal_mode = 'fsync' }; ]]
test:is(run_script(code), 0, 'wal_mode fsync -> fsync')
code = [[ box.cfg{ wal_mode = 'fsync' }; box.cfg { wal_mode = 'none'} ]]
test:is(run_script(code), PANIC, 'wal_mode fsync -> write is not supported')
code = [[ box.cfg{ wal_mode = 'write' }; box.cfg { wal_mode = 'fsync'} ]]
test:is(run_script(code), PANIC, 'wal_mode write -> fsync is not supported')
-- gh-684: Inconsistency with box.cfg and directories
local code;
code = [[ box.cfg{ work_dir='invalid' } ]]
test:is(run_script(code), PANIC, 'work_dir is invalid')
-- gh-2664: vinyl_dir is checked on the first use
code = [[ box.cfg{ vinyl_dir='invalid' } ]]
test:is(run_script(code), 0, 'vinyl_dir is invalid')
code = [[ box.cfg{ memtx_dir='invalid' } ]]
test:is(run_script(code), PANIC, 'snap_dir is invalid')
code = [[ box.cfg{ wal_dir='invalid' } ]]
test:is(run_script(code), PANIC, 'wal_dir is invalid')
test:is(box.cfg.log_nonblock, true, "log_nonblock default value")
code = [[
box.cfg{log_nonblock = false }
os.exit(box.cfg.log_nonblock == false and 0 or 1)
]]
test:is(run_script(code), 0, "log_nonblock new value")
-- gh-3048: box.cfg must not crash on invalid log configuration
code = [[ box.cfg{ log = '/' } ]]
test:is(run_script(code), PANIC, 'log is invalid')
-- box.cfg { listen = xx }
local path = './tarantool.sock'
os.remove(path)
box.cfg{ listen = 'unix/:'..path }
local s = socket.tcp_connect('unix/', path)
test:isnt(s, nil, "dynamic listen")
if s then s:close() end
box.cfg{ listen = '' }
s = socket.tcp_connect('unix/', path)
test:isnil(s, 'dynamic listen')
if s then s:close() end
os.remove(path)
path = './tarantool.sock'
local path2 = './tarantool2.sock'
local s = socket.tcp_server('unix/', path, function () end)
os.execute('ln ' .. path .. ' ' .. path2)
s:close()
box.cfg{ listen = 'unix/:'.. path2}
s = socket.tcp_connect('unix/', path2)
test:isnt(s, nil, "reuse unix socket")
if s then s:close() end
box.cfg{ listen = '' }
os.remove(path2)
code = " box.cfg{ listen='unix/:'" .. path .. "' } "
run_script(code)
test:isnil(fio.stat(path), "delete socket at exit")
--
-- gh-1499: AUTH raises ER_LOADING if wal_mode is 'none'
--
code = [[
box.cfg{wal_mode = 'none', listen='unix/:./tarantool.sock' }
box.once("bootstrap", function()
box.schema.user.create("test", { password = '123' })
end)
local conn = require('net.box').connect('unix/:./tarantool.sock',
{ user = 'test', password = '123' })
if not conn:ping() then os.exit(1) end
os.exit(0)
]]
test:is(run_script(code), 0, "wal_mode none and ER_LOADING")
--
-- gh-1962: incorrect replication source
--
status, reason = pcall(box.cfg, {replication="3303,3304"})
test:ok(not status and reason:match("Incorrect"), "invalid replication")
--
-- gh-1778 vinyl page can't be greather than range
--
code = [[
box.cfg{vinyl_page_size = 4 * 1024 * 1024, vinyl_range_size = 2 * 1024 * 1024}
os.exit(0)
]]
test:is(run_script(code), PANIC, "page size greather than range")
code = [[
box.cfg{vinyl_page_size = 1 * 1024 * 1024, vinyl_range_size = 2 * 1024 * 1024}
os.exit(0)
]]
test:is(run_script(code), 0, "page size less than range")
code = [[
box.cfg{vinyl_page_size = 2 * 1024 * 1024, vinyl_range_size = 2 * 1024 * 1024}
os.exit(0)
]]
test:is(run_script(code), 0, "page size equal with range")
-- test memtx options upgrade
code = [[
box.cfg{slab_alloc_arena = 0.2, slab_alloc_minimal = 16,
slab_alloc_maximal = 64 * 1024}
os.exit(box.cfg.memtx_memory == 214748364
and box.cfg.memtx_min_tuple_size == 16
and box.cfg.memtx_max_tuple_size == 64 * 1024
and 0 or 1)
]]
test:is(run_script(code), 0, "upgrade memtx memory options")
code = [[
box.cfg{slab_alloc_arena = 0.2, slab_alloc_minimal = 16, slab_alloc_maximal = 64 * 1024,
memtx_memory = 214748364, memtx_min_tuple_size = 16,
memtx_max_tuple_size = 64 * 1024}
os.exit(0)
]]
test:is(run_script(code), 0, "equal new and old memtx options")
code = [[
box.cfg{slab_alloc_arena = 0.2, slab_alloc_minimal = 16, slab_alloc_maximal = 64 * 1024,
memtx_memory = 107374182, memtx_min_tuple_size = 16,
memtx_max_tuple_size = 64 * 1024}
os.exit(0)
]]
test:is(run_script(code), PANIC, "different new and old memtx_memory")
code = [[
box.cfg{slab_alloc_arena = 0.2, slab_alloc_minimal = 16, slab_alloc_maximal = 64 * 1024,
memtx_memory = 214748364, memtx_min_tuple_size = 32,
memtx_max_tuple_size = 64 * 1024}
os.exit(0)
]]
test:is(run_script(code), PANIC, "different new and old min_tuple_size")
code = [[
box.cfg{snap_dir = 'tmp1', memtx_dir = 'tmp2'}
os.exit(0)
]]
test:is(run_script(code), PANIC, "different memtx_dir")
code = [[
box.cfg{panic_on_wal_error = true}
os.exit(box.cfg.force_recovery == false and 0 or 1)
]]
test:is(run_script(code), 0, "panic_on_wal_error")
code = [[
box.cfg{panic_on_snap_error = false}
os.exit(box.cfg.force_recovery == true and 0 or 1)
]]
test:is(run_script(code), 0, "panic_on_snap_error")
code = [[
box.cfg{snapshot_period = 100, snapshot_count = 4}
os.exit(box.cfg.checkpoint_interval == 100
and box.cfg.checkpoint_count == 4 and 0 or 1)
]]
test:is(run_script(code), 0, "setup checkpoint params")
code = [[
box.cfg{snapshot_period = 100, snapshot_count = 4}
box.cfg{snapshot_period = 150, snapshot_count = 8}
os.exit(box.cfg.checkpoint_interval == 150
and box.cfg.checkpoint_count == 8 and 0 or 1)
]]
test:is(run_script(code), 0, "update checkpoint params")
--
-- test wal_max_size option
--
code = [[
digest = require'digest'
fio = require'fio'
box.cfg{wal_max_size = 1024}
_ = box.schema.space.create('test'):create_index('pk')
data = digest.urandom(1024)
cnt1 = #fio.glob(fio.pathjoin(box.cfg.wal_dir, '*.xlog'))
for i = 0, 9 do
box.space.test:replace({1, data})
end
cnt2 = #fio.glob(fio.pathjoin(box.cfg.wal_dir, '*.xlog'))
os.exit(cnt1 < cnt2 - 8 and 0 or 1)
]]
test:is(run_script(code), 0, "wal_max_size xlog rotation")
--
-- gh-2872 bootstrap is aborted if vinyl_dir contains vylog files
-- left from previous runs
--
vinyl_dir = fio.tempdir()
run_script(string.format([[
box.cfg{vinyl_dir = '%s'}
s = box.schema.space.create('test', {engine = 'vinyl'})
s:create_index('pk')
os.exit(0)
]], vinyl_dir))
code = string.format([[
box.cfg{vinyl_dir = '%s'}
os.exit(0)
]], vinyl_dir)
test:is(run_script(code), PANIC, "bootstrap from non-empty vinyl_dir")
fio.rmdir(vinyl_dir)
--
-- gh-2278 vinyl does not support DDL/DML if wal_mode = 'none'
--
dir = fio.tempdir()
cfg = string.format("wal_dir = '%s', memtx_dir = '%s', vinyl_dir = '%s'", dir, dir, dir)
run_script(string.format([[
box.cfg{%s}
s = box.schema.space.create('test', {engine = 'vinyl'})
s:create_index('primary')
os.exit(0)
]], cfg))
code = string.format([[
box.cfg{wal_mode = 'none', %s}
s = box.space.test
ok = true
ok = ok and not pcall(s.create_index, s, 'secondary')
ok = ok and not pcall(s.index.primary.drop, s.index.primary)
ok = ok and not pcall(s.drop, s)
ok = ok and not pcall(s.truncate, s)
ok = ok and not pcall(s.insert, s, {1})
ok = ok and pcall(s.select, s)
os.exit(ok and 0 or 1)
]], cfg)
test:is(run_script(code), 0, "wal_mode none -> vinyl DDL/DML is not supported")
fio.rmdir(dir)
--
-- Invalid values of instance_uuid or replicaset_uuid.
--
code = [[ box.cfg{instance_uuid = 'uuid'} ]]
test:is(run_script(code), PANIC, 'invalid instance_uuid')
code = [[ box.cfg{replicaset_uuid = 'uuid'} ]]
test:is(run_script(code), PANIC, 'invalid replicaset_uuid')
--
-- Instance and replica set UUID are set to the configured values.
--
code = [[
instance_uuid = tostring(require('uuid').new())
box.cfg{instance_uuid = instance_uuid}
os.exit(instance_uuid == box.info.uuid and 0 or 1)
]]
test:is(run_script(code), 0, "check instance_uuid")
code = [[
replicaset_uuid = tostring(require('uuid').new())
box.cfg{replicaset_uuid = replicaset_uuid}
os.exit(replicaset_uuid == box.info.cluster.uuid and 0 or 1)
]]
test:is(run_script(code), 0, "check replicaset_uuid")
--
-- Configuration fails on instance or replica set UUID mismatch.
--
dir = fio.tempdir()
instance_uuid = uuid.new()
replicaset_uuid = uuid.new()
code_fmt = [[
box.cfg{memtx_dir = '%s', instance_uuid = '%s', replicaset_uuid = '%s'}
os.exit(0)
]]
code = string.format(code_fmt, dir, instance_uuid, replicaset_uuid)
run_script(code)
code = string.format(code_fmt, dir, uuid.new(), replicaset_uuid)
test:is(run_script(code), PANIC, "instance_uuid mismatch")
code = string.format(code_fmt, dir, instance_uuid, uuid.new())
test:is(run_script(code), PANIC, "replicaset_uuid mismatch")
fio.rmdir(dir)
test:check()
os.exit(0)
|
AddCSLuaFile()
pk_pills.register("antlion",{
printName="Antlion",
side="hl_antlion",
type="ply",
model="models/antlion.mdl",
default_rp_cost=4000,
options=function() return {
{skin=0},
{skin=1},
{skin=2},
{skin=3}
} end,
camera={
offset=Vector(0,0,30),
dist=150
},
hull=Vector(60,60,50),
anims={
default={
idle="Idle",
walk="walk_all",
run="run_all",
glide="jump_glide",
jump="jump_start",
melee1="attack1",
melee2="attack2",
melee3="attack3",
charge_start="charge_start",
charge_loop="charge_run",
charge_hit="charge_end",
swim="drown",
burrow_in="digin",
burrow_loop="digidle",
burrow_out="digout"
}
},
sounds={
melee=pk_pills.helpers.makeList("npc/antlion/attack_single#.wav",3),
melee_hit=pk_pills.helpers.makeList("npc/zombie/claw_strike#.wav",3),
charge_start="npc/antlion/pain1.wav",
charge_hit="npc/antlion/land1.wav",//"npc/antlion_guard/shove1.wav",
loop_fly="npc/antlion/fly1.wav",
loop_charge="npc/antlion/charge_loop1.wav",
land="npc/antlion/land1.wav",
burrow_in="npc/antlion/digdown1.wav",
burrow_out="npc/antlion/digup1.wav",
step=pk_pills.helpers.makeList("npc/antlion/foot#.wav",4)
},
aim={
xPose="head_yaw",
yPose="head_pitch",
nocrosshair=true
},
attack={
mode="trigger",
func = pk_pills.common.melee,
animCount=3,
delay=.5,
range=75,
dmg=25
},
charge={
vel=800,
dmg=50,
delay=.6
},
attack2={
mode="trigger",
func = function(ply,ent)
ent:PillChargeAttack()
end
},
movePoseMode="yaw",
moveSpeed={
walk=200,
run=500
},
jumpPower=500,
jump=function(ply,ent)
if ply:GetVelocity():Length()<300 then
ply:SetVelocity(Vector(0,0,500))
end
end,
glideThink=function(ply,ent)
ent:PillLoopSound("fly")
local puppet=ent:GetPuppet()
if puppet:GetBodygroup(1)==0 then
puppet:SetBodygroup(1,1)
end
end,
land=function(ply,ent)
ent:PillLoopStop("fly")
local puppet=ent:GetPuppet()
puppet:SetBodygroup(1,0)
end,
canBurrow=true,
health=120,
noFallDamage=true,
damageFromWater=1
})
|
-- Use of this source code is governed by the Apache 2.0 license; see COPYING.
module(..., package.seeall)
local lib = require("core.lib")
local shm = require("core.shm")
local S = require("syscall")
local usage = require("program.shm.README_inc")
-- We must load any modules that register abstract shm types that we may
-- wish to inspect.
require("core.packet")
local counter = require("core.counter")
require("core.histogram")
require("lib.interlink")
local long_opts = {
help = "h"
}
function run (args)
local opt = {}
local object = nil
function opt.h (arg) print(usage) main.exit(1) end
args = lib.dogetopt(args, opt, "h", long_opts)
if #args ~= 1 then print(usage) main.exit(1) end
local path = args[1]
-- Hacky way to accept an arbitrary relative or absolute path
if path:sub(1,1) == '/' then
shm.root = lib.dirname(path)
path = path:sub(#shm.root+1)
else
shm.root = S.getcwd()
end
-- Open path as SHM frame
local frame = shm.open_frame(path)
-- Frame fields to ignore
local ignored = {path=true, specs=true, readonly=true}
-- Compute sorted array of members to print
local sorted = {}
for name, _ in pairs(frame) do
if not ignored[name] then table.insert(sorted, name) end
end
table.sort(sorted)
-- Convert dtime counter to human-readable date/time string if it exists
if frame.dtime then
frame.dtime = os.date("%c", tonumber(counter.read(frame.dtime)))
end
-- Print SHM frame objects
local name_max = 40
for _, name in ipairs(sorted) do
print(name..": "..tostring(frame[name]))
end
end
|
-----------------------------------------
-- ID: 5156
-- Item: porcupine_pie
-- Food Effect: 30Min, All Races
-----------------------------------------
-- HP 55
-- Strength 6
-- Vitality 2
-- Intelligence -3
-- Mind 3
-- HP recovered while healing 2
-- MP recovered while healing 2
-- Accuracy 5
-- Attack % 18 (cap 95)
-- Ranged Attack % 18 (cap 95)
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
local result = 0
if target:hasStatusEffect(tpz.effect.FOOD) or target:hasStatusEffect(tpz.effect.FIELD_SUPPORT_FOOD) then
result = tpz.msg.basic.IS_FULL
end
return result
end
function onItemUse(target)
target:addStatusEffect(tpz.effect.FOOD,0,0,14400,5156)
end
function onEffectGain(target, effect)
target:addMod(tpz.mod.HP, 55)
target:addMod(tpz.mod.STR, 6)
target:addMod(tpz.mod.VIT, 2)
target:addMod(tpz.mod.INT, -3)
target:addMod(tpz.mod.MND, 3)
target:addMod(tpz.mod.HPHEAL, 2)
target:addMod(tpz.mod.MPHEAL, 2)
target:addMod(tpz.mod.ACC, 5)
target:addMod(tpz.mod.FOOD_ATTP, 18)
target:addMod(tpz.mod.FOOD_ATT_CAP, 95)
target:addMod(tpz.mod.FOOD_RATTP, 18)
target:addMod(tpz.mod.FOOD_RATT_CAP, 95)
end
function onEffectLose(target, effect)
target:delMod(tpz.mod.HP, 55)
target:delMod(tpz.mod.STR, 6)
target:delMod(tpz.mod.VIT, 2)
target:delMod(tpz.mod.INT, -3)
target:delMod(tpz.mod.MND, 3)
target:delMod(tpz.mod.HPHEAL, 2)
target:delMod(tpz.mod.MPHEAL, 2)
target:delMod(tpz.mod.ACC, 5)
target:delMod(tpz.mod.FOOD_ATTP, 18)
target:delMod(tpz.mod.FOOD_ATT_CAP, 95)
target:delMod(tpz.mod.FOOD_RATTP, 18)
target:delMod(tpz.mod.FOOD_RATT_CAP, 95)
end
|
local assets = require 'assets'
local lume = require 'lume'
local sprites = require 'sprites'
local up = 'up'
local down = 'down'
local left = 'left'
local right = 'right'
local pressed = 'key_pressed'
local released = 'key_released'
local update = 'dt'
local tile_size = 16
local carryables = {
planar_key = true
}
local player = {
x = 15 * tile_size,
y = 29 * tile_size,
width = 16,
height = 16,
speed = 60,
type = "player",
active_layers = {},
direction = {},
movement = {
horizontal = {},
vertical = {}
},
carry = {
type = 'player_reach',
onBeginContactWith = function(self, object)
if not object.type then return end
if carryables[object.type] then
self.pickup = object
end
if object.type == 'receptacle' then
self.drop_target = object
end
end,
onEndContactWith = function(self, object)
if not object.type then return end
if carryables[object.type] then
self.pickup = nil
end
if object.type == 'receptacle' then
self.drop_target = nil
end
end,
grab = function(self)
if self.drop_target and self.drop_target.holding == self.pickup then
self.drop_target:unparent()
end
self.holding = self.pickup
end,
drop = function(self)
self.dropping = self.holding
self.holding = nil
end,
},
init = function(self)
-- Setup initial states
state.machines.player_horizontal:initialize_state(self.movement.horizontal)
state.machines.player_vertical:initialize_state(self.movement.vertical)
state.machines.player_direction:initialize_state(self.direction)
state.machines.player_carry:initialize_state(self.carry)
state.machines.player:initialize_state(self)
-- Setup a physics body for our lovely ghost
self.body = love.physics.newBody(state.world, self.x, self.y, "dynamic")
self.body:setFixedRotation(true)
local origin_point = love.physics.newCircleShape(8, 12, 6.0)
self.fixture = love.physics.newFixture(self.body, origin_point, 1)
self.fixture:setGroupIndex(self.plane.group)
-- Don't collide with most plane statics (the group overrides this)
self.fixture:setMask(state.collision_categories.plane_static)
self.fixture:setUserData(self)
self.fixture:setCategory(state.collision_categories.default)
local reachable_range = love.physics.newCircleShape(8, 8, 6)
self.reach = love.physics.newFixture(self.body, reachable_range, 1)
self.reach:setSensor(true)
self.reach:setUserData(self.carry)
self.reach:setCategory(state.collision_categories.default)
end,
bubble_to_highest_layer = function(self)
local highest = -1
local highest_layer = nil
for _, layer in pairs(self.active_layers) do
if layer:index() > highest then
highest = layer:index()
highest_layer = layer
end
end
if highest_layer then
self.fixture:setGroupIndex(highest_layer.plane.group)
self.plane = highest_layer.plane
else
print("Couldn't find layer to bubble to! This shouldn't happen.")
end
end,
onBeginContactWith = function(self, object)
if object.type == "layer" then
local layer = object
self.active_layers[layer] = layer
self:bubble_to_highest_layer()
end
end,
onEndContactWith = function(self, object)
if object.type == "layer" then
local layer = object
self.active_layers[layer] = nil
self:bubble_to_highest_layer()
end
end,
switch_to_plane = function(self, plane)
self.fixture:setGroupIndex(plane.group)
self.plane = plane
end,
update = function(self, dt)
local horizontal = self.movement.horizontal.state.name
local vertical = self.movement.vertical.state.name
local direction_contribution = {
left = -1, right = 1,
up = -1, down = 1,
neutral = 0
}
local position_delta = {
x = direction_contribution[horizontal],
y = direction_contribution[vertical]
}
local distance = lume.distance(0, 0, position_delta.x, position_delta.y)
if 0 < distance then
position_delta = lume.map(position_delta, function(i) return i / distance end)
-- self.x = self.x + position_delta.x * self.speed * dt
-- self.y = self.y + position_delta.y * self.speed * dt
self.body:setLinearVelocity(self.speed * position_delta.x, self.speed * position_delta.y)
else
self.current_speed = 0
self.body:setLinearVelocity(0, 0)
end
self.x = self.body:getX()
self.y = self.body:getY()
-- Reposition the reach bubble
local direction = self.direction.state.name
local reach_delta = 4
local reach_offset = {
left = {-1, 0},
right = {1, 0},
up = {0, -1},
down = {0, 1},
}
local reach_base = {self.fixture:getShape():getPoint()}
self.reach:getShape():setPoint(
reach_base[1] + reach_delta * reach_offset[direction][1],
reach_base[2] + reach_delta * reach_offset[direction][2])
-- Reposition carried object
if self.carry.holding then
local held = self.carry.holding
held.parented = true
held.body:setPosition(self.x, self.y - 16)
end
if self.carry.dropping then
local held = self.carry.dropping
self.carry.dropping = nil
if self.carry.drop_target and not self.carry.drop_target.holding then
self.carry.drop_target:hold(held)
else
held.parented = false
local put_offset = 12.5
held.body:setPosition(
self.x + put_offset * reach_offset[direction][1],
self.y + put_offset * reach_offset[direction][2])
end
end
end,
draw = function(self)
local x, y = self.x, self.y
local direction = self.direction.state.name
local main_image = assets['ghost-' .. direction]
local player = sprites.Sprite.new(main_image)
local hand_direction = direction
if hand_direction == up then
hand_direction = down
end
local hands_image = assets['hands-' .. hand_direction]
local hands = sprites.Sprite.new(hands_image)
local holding_offset = 0
if self.carry.state.name == 'holding' then
holding_offset = -10
end
if self.carry.holding then
self.carry.holding:draw(x, y - 16)
end
local hands_behind = direction == up
if hands_behind then
hands:draw(x, y - 1 + holding_offset)
end
player:draw(x, y)
if not hands_behind then
hands:draw(x, y + holding_offset)
end
end
}
return player
|
local M = {}
local ffi = require('ffi')
local tap = require('tap')
ffi.cdef([[
int setenv(const char *name, const char *value, int overwrite);
]])
local function luacmd(args)
-- arg[-1] is guaranteed to be not nil.
local idx = -2
while args[idx] do
assert(type(args[idx]) == 'string', 'Command part have to be a string')
idx = idx - 1
end
-- return the full command with flags.
return table.concat(args, ' ', idx + 1, -1)
end
local function unshiftenv(variable, value, sep)
local envvar = os.getenv(variable)
return ('%s="%s%s"'):format(variable, value,
envvar and ('%s%s'):format(sep, envvar) or '')
end
function M.selfrun(arg, checks)
-- If TEST_SELFRUN is set, it means the test has been run via
-- <io.popen>, so just return from this routine and proceed
-- the execution to the test payload, ...
if os.getenv('TEST_SELFRUN') then return end
-- ... otherwise initialize <tap>, setup testing environment
-- and run this chunk via <io.popen> for each case in <checks>.
-- XXX: The function doesn't return back from this moment. It
-- checks whether all assertions are fine and exits.
local test = tap.test(arg[0]:match('/?(.+)%.test%.lua'))
test:plan(#checks)
local libext = package.cpath:match('?.(%a+);')
local vars = {
LUABIN = luacmd(arg),
SCRIPT = arg[0],
PATH = arg[0]:gsub('%.test%.lua', ''),
SUFFIX = libext,
ENV = table.concat({
unshiftenv('LUA_PATH', '<PATH>/?.lua', ';'),
unshiftenv('LUA_CPATH', '<PATH>/?.<SUFFIX>', ';'),
unshiftenv((libext == 'dylib' and 'DYLD' or 'LD') .. '_LIBRARY_PATH',
'<PATH>', ':'),
'TEST_SELFRUN=1',
}, ' '),
}
local cmd = string.gsub('<ENV> <LUABIN> 2>&1 <SCRIPT>', '%<(%w+)>', vars)
for _, ch in pairs(checks) do
local testf = test[ch.test]
assert(testf, ("tap doesn't provide test.%s function"):format(ch.test))
local proc = io.popen((cmd .. (' %s'):rep(#ch.arg)):format(unpack(ch.arg)))
local res = proc:read('*all'):gsub('^%s+', ''):gsub('%s+$', '')
-- XXX: explicitly pass <test> as an argument to <testf>
-- to emulate test:is(...), test:like(...), etc.
testf(test, res, ch.res, ch.msg)
end
os.exit(test:check() and 0 or 1)
end
function M.skipcond(condition, message)
if not condition then return end
local test = tap.test(arg[0]:match('/?(.+)%.test%.lua'))
test:plan(1)
test:skip(message)
os.exit(test:check() and 0 or 1)
end
function M.tweakenv(condition, variable)
if not condition or os.getenv(variable) then return end
local testvar = assert(os.getenv('TEST_' .. variable),
('Neither %s nor auxiliary TEST_%s variables are set')
:format(variable, variable))
-- XXX: The third argument of setenv(3) is set to zero to forbid
-- overwriting the <variable>. Since there is the check above
-- whether this <variable> is set in the process environment, it
-- just makes this solution foolproof.
ffi.C.setenv(variable, testvar, 0)
end
return M
|
return {'sforzando'}
|
--Do not edit unless you know what you're doing--
peacetime = false
function DrawText(x,y ,width,height,scale, text, r,g,b,a)
SetTextFont(4)
SetTextProportional(0)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextEdge(2, 0, 0, 0, 255)
SetTextOutline()
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(x - width/2, y - height/2 + 0.005)
end
RegisterNetEvent('Pegasus:PT')
AddEventHandler('Pegasus:PT', function(pt)
peacetime = pt;
end)
Citizen.CreateThread(function()
Wait(850);
player = GetPlayerPed(-1)
while true do
Wait(0);
if peacetime then
NetworkSetFriendlyFireOption(false)
SetEntityCanBeDamaged(vehicle, false)
ClearPlayerWantedLevel(PlayerId())
for k, v in pairs(GetActivePlayers()) do
local ped = GetPlayerPed(v)
SetEntityNoCollisionEntity(GetPlayerPed(-1), GetVehiclePedIsIn(ped, false), true)
SetEntityNoCollisionEntity(GetVehiclePedIsIn(ped, false), GetVehiclePedIsIn(GetPlayerPed(-1), false), true)
end
DrawText(0.590, 1.430, 1.0,1.0,0.45, "~p~[~g~PeaceTime~p~]", 255, 255, 255, 255)
else
NetworkSetFriendlyFireOption(true)
SetEntityCanBeDamaged(vehicle, true)
DrawText(0.590, 1.430, 1.0,1.0,0.45, "~p~[~r~PeaceTime~p~]", 255, 255, 255, 255)
end
end
end)
|
--
-- This file is part of rFSM.
--
-- (C) 2010-2013 Markus Klotzbuecher <markus.klotzbuecher@mech.kuleuven.be>
-- (C) 2014-2020 Markus Klotzbuecher <mk@mkio.de>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
require("gv")
require("utils")
require("rfsm")
local pairs, ipairs, print, table, type, assert, gv, io, utils, rfsm
= pairs, ipairs, print, table, type, assert, gv, io, utils, rfsm
module("rfsm2uml")
param = {}
param.fontsize = 12.0
param.trfontsize = 7.0
param.ndfontsize = 8.0
param.cs_border_color = "black"
param.cs_fillcolor = "white"
param.layout="dot"
param.rankdir="TD"
param.show_fqn = false
param.err = print
param.warn = print
param.dbg = function () return true end
-- setup common properties
local function set_props(h)
gv.setv(h, "fixedsize", "false")
gv.setv(h, "fontsize", param.fontsize)
end
-- setup transition propeties
local function set_trprops(h)
gv.setv(h, "fixedsize", "false")
gv.setv(h, "fontsize", param.trfontsize)
gv.setv(h, "arrowhead", "vee")
gv.setv(h, "arrowsize", "0.5")
end
-- setup node properties
local function set_ndprops(h)
gv.setv(h, "fixedsize", "false")
gv.setv(h, "fontsize", param.ndfontsize)
end
local function setup_color(state, nh)
gv.setv(nh, "style", "filled")
if state._mode == 'active' then
gv.setv(nh, "fillcolor", "green")
elseif state._mode == 'done' then
gv.setv(nh, "fillcolor", "chocolate")
else gv.setv(nh, "fillcolor", "white") end
end
-- return handle, type for state fqn
local function get_shandle(gh, fqn)
if fqn == gv.nameof(gh) then return gh, "graph" end
local sh = gv.findsubg(gh, "cluster_" .. fqn)
if sh then return sh, "subgraph" end
local nh = gv.findnode(gh, fqn)
if nh then return nh, "node" end
param.err("No state '" .. fqn .. "'")
return false
end
-- create a new graph
local function new_gra(name, caption)
local gh = gv.digraph(name)
caption = caption or ""
set_props(gh)
gv.setv(gh, "compound", "true")
gv.setv(gh, "fontsize", param.fontsize)
gv.setv(gh, "labelloc", "t")
gv.setv(gh, "label", name .. ' - ' .. caption)
gv.setv(gh, "remincross", "true")
gv.setv(gh, "splines", "true")
gv.setv(gh, "rankdir", param.rankdir or "TD")
-- layout clusters locally before integrating
-- doesn't seem to make any difference
-- gv.setv(gh, "clusterrank", "local")
param.dbg("creating new graph " .. name)
return gh
end
local function new_conn(gh, conn)
local ph, type = get_shandle(gh, conn._parent._fqn)
assert(ph)
assert(type ~= "simple", "Parent not of type simple")
assert(rfsm.is_conn(conn), "Obj not a connector")
if gv.findnode(ph, conn._fqn) then
param.err("graph " .. conn._parent._fqn .. "already has a node " .. conn._fqn)
return false
end
local nh = gv.node(ph, conn._fqn)
set_ndprops(nh)
if rfsm.is_conn(conn) then
if conn._id == 'initial' then
gv.setv(nh, "shape", "point")
gv.setv(nh, "height", "0.1")
else
gv.setv(nh, "shape", "circle")
gv.setv(nh, "height", "0.4")
end
else param.err("ERROR: unknown conn type") end
gv.setv(nh, "label", conn._id)
gv.setv(nh, "fixedsize", "true")
param.dbg("creating new connector " .. conn._fqn)
return nh
end
-- create a new simple state
local function new_sista(gh, state, label)
param.dbg("creating new simple state '" .. state._fqn)
local __label
local ph, type = get_shandle(gh, state._parent._fqn)
assert(ph)
assert(type ~= "simple")
-- tbd: use gh here?
if gv.findnode(ph, state._fqn) then
param.err("graph already has a node " .. state._fqn)
return false
end
local nh = gv.node(ph, state._fqn)
set_ndprops(nh)
gv.setv(nh, "style", "rounded")
gv.setv(nh, "shape", "box")
setup_color(state, nh)
if param.show_fqn then __label = state._fqn
else __label=state._id end
if label then __label = __label .. "\n" .. label end
gv.setv(nh, "label", __label)
return nh
end
-- create an new composite state
local function new_csta(gh, state, label)
param.dbg("creating new composite state " .. state._fqn)
local __label
local ph = get_shandle(gh, state._parent._fqn)
assert(ph)
iname = "cluster_" .. state._fqn
-- tbd: use gh here?
if gv.findsubg(ph, iname) then
param.err("graph already has a subgraph " .. state._fqn)
return false
end
local ch = gv.graph(ph, iname)
set_ndprops(ch)
gv.setv(ch, "color", param.cs_border_color)
gv.setv(ch, "style", "bold")
setup_color(state, ch)
--if label then gv.setv(ch, "label", state._id .. "\n" .. label)
--else gv.setv(ch, "label", state._id) end
-- fqn or id?
if param.show_fqn then __label = state._fqn
else __label=state._id end
-- append user label
if label then __label = __label .. "\n" .. label end
gv.setv(ch, "label", __label)
return ch
end
-- new transition
-- src and target are only fully qualified strings!
local function new_tr(gh, src, tgt, events)
local label
param.dbg("creating transition from " .. src .. " -> " .. tgt)
local sh, shtype = get_shandle(gh, src)
local th, thtype = get_shandle(gh, tgt)
assert(sh)
assert(th)
-- if src/tgt is a cluster then src/tgt is fqn_dummy
if shtype == "subgraph" then
realsh = gv.findnode(sh, src .. ".initial")
else
realsh = sh
end
-- assert(shtype ~= "subgraph")
-- the following must not happen because transitions *always* end
-- on a connector or sista.
assert(thtype ~= "subgraph", "tgt should be a subgraph but isn't: " .. tgt)
if thtype == "subgraph" then
realth = gv.findnode(th, tgt .. ".initial")
else
realth = th
end
-- realth = th
local eh = gv.edge(realsh, realth)
set_trprops(eh)
-- transition stops on composite state boundary
-- we don't really want to hide the real connections
if shtype == "subgraph" then
gv.setv(eh, "ltail", "cluster_" .. src)
end
-- if thtype == "subgraph" then
-- gv.setv(eh, "lhead", "cluster_" .. tgt)
-- end
if events then label = table.concat(events, ', ') end
if label then gv.setv(eh, "label", " " .. label .. " ") end
end
local function proc_node(gh, node)
if rfsm.is_composite(node) then new_csta(gh, node)
elseif rfsm.is_leaf(node) then new_sista(gh, node)
elseif rfsm.is_conn(node) then new_conn(gh, node)
else
param.err("unknown node type: " .. node:type() .. ", name=" .. node._fqn)
end
end
local function proc_trans(gh, t, parent)
if t.tgt == 'internal' then
return true
else
new_tr(gh, t.src._fqn, t.tgt._fqn, t.events)
end
end
--
-- convert given fsm to a populated graphviz object
--
local function fsm2gh(root, caption)
gh = new_gra(root._id, caption)
rfsm.mapfsm(function (s)
if rfsm.is_root(s) then return end
proc_node(gh, s)
end, root, rfsm.is_node)
rfsm.mapfsm(function (t, p) proc_trans(gh, t, p) end, root, rfsm.is_trans)
return gh
end
function rfsm2uml(root, format, outfile, caption)
if not root._initialized then
param.err("rfsm2uml ERROR: fsm " .. root._id .. " uninitialized")
return false
end
local gh = fsm2gh(root, caption)
gv.layout(gh, param.layout)
param.dbg("rfsm2uml: running " .. param.layout .. " layouter")
gv.render(gh, format, outfile)
param.dbg("rfsm2uml: rendering to " .. format .. ", written result to " .. outfile)
end
function rfsm2dot(root, outfile, caption)
if not root._initialized then
param.err("rfsm2uml ERROR: fsm " .. root._id .. " uninitialized")
return false
end
local gh = fsm2gh(root, caption or " ")
gv.write(gh, outfile)
end
|
--[[----------------------------------------------------------------------------
Application Name:
PatternVerification
Summary:
Verifying correctness of key pattern on a keyboard.
How to Run:
Starting this sample is possible either by running the app (F5) or
debugging (F7+F10). Setting breakpoint on the first row inside the 'main'
function allows debugging step-by-step after 'Engine.OnStarted' event.
Results can be seen in the image viewer on the DevicePage.
Restarting the Sample may be necessary to show images after loading the webpage.
To run this Sample a device with SICK Algorithm API and AppEngine >= V2.5.0 is
required. For example SIM4000 with latest firmware. Alternatively the Emulator
in AppStudio 2.3 or higher can be used.
More Information:
Tutorial "Algorithms - Matching".
------------------------------------------------------------------------------]]
--Start of Global Scope---------------------------------------------------------
print('AppEngine Version: ' .. Engine.getVersion())
local DELAY = 1000 -- ms between visualization steps for demonstration purpose
-- Variable for holding table of verifiers
local verifiers = {}
-- Creating viewer
local viewer = View.create()
-- Setting up graphical overlay attributes
local teachDecoration = View.ShapeDecoration.create()
teachDecoration:setLineColor(0, 0, 230) -- Blue for "teach"
teachDecoration:setLineWidth(4)
local failDecoration = View.ShapeDecoration.create()
failDecoration:setLineColor(230, 0, 0) -- Red for "fail"
failDecoration:setLineWidth(4)
local passDecoration = View.ShapeDecoration.create()
passDecoration:setLineColor(0, 230, 0) -- Green for "pass"
passDecoration:setLineWidth(4)
local textDecoration = View.TextDecoration.create()
textDecoration:setPosition(25, 45)
textDecoration:setSize(35)
textDecoration:setColor(255, 255, 0)
-- Create a PatternMatcher instance and set parameters
-- Note that a PointMatcher possibly can be used as well here
local matcher = Image.Matching.PatternMatcher.create()
matcher:setRotationRange(3.1415 / 4)
matcher:setMaxMatches(5)
matcher:setDownsampleFactor(10)
matcher:setTimeout(60)
-- Creating fixture
local fixture = Image.Fixture.create()
-- Defining threshold for pass
local errorScoreThreshold = 0.85
--End of Global Scope-----------------------------------------------------------
--Start of Function and Event Scope---------------------------------------------
--@teachShape(img:Image, imageID:string):Transform
local function teachShape(img, imageID)
-- Defining object teach region
local center = Point.create(280, 180)
local teachRectangle = Shape.createRectangle(center, 170, 200)
local teachRegion = teachRectangle:toPixelRegion(img)
viewer:addShape(teachRectangle, teachDecoration, nil, imageID)
-- Teaching
local matcherTeachPose = matcher:teach(img, teachRegion)
fixture:setReferencePose(matcherTeachPose)
fixture:appendShape('objectBox', teachRectangle)
return matcherTeachPose
end
-- Routine for adding and teaching one verifier
--@addVerifier(verifiers:table, fixture:Image.Fixture, teachImage:Image,
-- keyName:string, keyRegion:Image.PixelRegion)
local function addVerifier(teachImage, keyName, keyRegion)
verifiers[keyName] = Image.Matching.PatternVerifier.create()
verifiers[keyName]:setPositionTolerance(3)
verifiers[keyName]:setRotationTolerance(math.rad(1))
local keyPose = verifiers[keyName]:teach(teachImage, keyRegion)
fixture:appendPose(keyName, keyPose)
fixture:appendShape(keyName, keyRegion:getBoundingBoxOriented(teachImage))
end
--@teachPatterns(teachPose:Transform, img:Image, imageID:string)
local function teachPatterns(teachPose, img, imageID)
-- Key regions
local printScreen = Image.PixelRegion.createRectangle(220, 103, 249, 137)
local scrollLock = Image.PixelRegion.createRectangle(265, 103, 294, 139)
local pause = Image.PixelRegion.createRectangle(309, 103, 338, 140)
local insert = Image.PixelRegion.createRectangle(218, 166, 249, 201)
local home = Image.PixelRegion.createRectangle(263, 166, 294, 201)
local pageUp = Image.PixelRegion.createRectangle(308, 166, 337, 202)
local delete = Image.PixelRegion.createRectangle(219, 212, 249, 246)
local endButton = Image.PixelRegion.createRectangle(264, 213, 293, 248)
local pageDown = Image.PixelRegion.createRectangle(308, 212, 336, 246)
-- Teaching verifiers for keys
addVerifier(img, 'PrintScreen', printScreen)
addVerifier(img, 'ScrollLock', scrollLock)
addVerifier(img, 'Pause', pause)
addVerifier(img, 'Insert', insert)
addVerifier(img, 'Home', home)
addVerifier(img, 'PageUp', pageUp)
addVerifier(img, 'Delete', delete)
addVerifier(img, 'End', endButton)
addVerifier(img, 'PageDown', pageDown)
-- Draw teach regions
fixture:transform(teachPose)
for keyName, _ in pairs(verifiers) do
local bbox = fixture:getShape(keyName)
viewer:addShape(bbox, teachDecoration, nil, imageID)
end
viewer:addText('Teach', textDecoration, nil, imageID)
viewer:present()
end
--@match(img:Image)
local function match(img)
viewer:clear()
local imageID = viewer:addImage(img)
-- Finding object
local poses,
scores = matcher:match(img)
local livePose = poses[1]
local liveScore = scores[1]
print('Object score: ' .. math.floor(liveScore * 100) / 100)
-- Drawing object rectangle
fixture:transform(livePose)
local objectRectangle = fixture:getShape('objectBox')
viewer:addShape(objectRectangle, passDecoration, nil, imageID)
-- Verifying each key, draw box with color depending on verifier score
local textContent = 'Pass'
for keyName, verifier in pairs(verifiers) do
local score, _, _ = verifier:verify(img, fixture:getPose(keyName))
local bbox = fixture:getShape(keyName)
if (score > errorScoreThreshold) then
viewer:addShape(bbox, passDecoration, nil, imageID)
else
viewer:addShape(bbox, failDecoration, nil, imageID)
textContent = 'Fail'
end
print(keyName .. ' score: ' .. tostring(math.floor(score * 100) / 100))
end
viewer:addText(textContent, textDecoration, nil, imageID)
viewer:present()
end
local function main()
-- Loading Teach image from resources and teaching
local teachImage = Image.load('resources/Teach.bmp')
viewer:clear()
local imageID = viewer:addImage(teachImage)
local matcherTeachPose = teachShape(teachImage, imageID)
-- Teaching patterns to verify
teachPatterns(matcherTeachPose, teachImage, imageID)
Script.sleep(DELAY * 1.5)
-- Loading images from resource folder and calling function for verification
for i = 1, 3 do
local liveImage = Image.load('resources/' .. i .. '.bmp')
print('-------------------------')
print('OBJECT ' .. i)
match(liveImage)
Script.sleep(DELAY)
end
print('App finished.')
end
--The following registration is part of the global scope which runs once after startup
--Registration of the 'main' function to the 'Engine.OnStarted' event
Script.register('Engine.OnStarted', main)
--End of Function and Event Scope--------------------------------------------------
|
return {
id = 14,
text = {key='',text=""},
}
|
local skynet = require "skynet"
local List = {}
--设置数据 defaults 必须是一个数组
function List.new(db_index,list_key)
local property = {}
local values = {}
local meta = {}
--指定index插入数据
function property:insert(pos,value)
local before = values[pos]
assert(before,"List insert index out of range")
table.insert(values,pos,value)
skynet.call(".redis_center","lua","LINSERT",db_index,list_key,"BEFORE",before,value)
end
--往表头插入数据
function property:insertFront(...)
local args = {...}
for i,v in ipairs(args) do
table.insert(values,1,v)
end
skynet.call(".redis_center","lua","LPUSH",db_index,list_key,table.unpack(args))
end
--往表尾插入数据
function property:push(...)
local args = {...}
for i,v in ipairs(args) do
table.insert(values,v)
end
skynet.call(".redis_center","lua","RPUSH",db_index,list_key,table.unpack(args))
end
--获取列表的长度
function property:length( )
return #values
end
--指定index 移除数据
function property:remove(pos)
assert(pos < #values,"List remove index out of range")
table.remove(values,pos)
skynet.call(".redis_center","lua","LREMOVE",db_index,list_key,pos)
end
--移除并返回列表的头元素
function property:removeFrist()
table.remove(values,1)
return skynet.call(".redis_center","lua","LPOP",db_index,list_key)
end
--移除并返回列表的尾元素。
function property:removeLast()
table.remove(values,#values)
return skynet.call(".redis_center","lua","RPOP",db_index,list_key)
end
--清空列表
function property:clear()
local length = #values
value = {}
meta.__index = values
skynet.call(".redis_center","lua","LTRIM",db_index,list_key,length,length)
end
function property:getValues()
return values
end
--从redis中拿数据填充List
local data = skynet.call(".redis_center","lua","LRANGE",db_index,list_key,0,-1)
for index,v in ipairs(data) do
local value = v
values[index] = value
end
--如果property中查不到就去values里面查
setmetatable(property,meta)
meta.__index = values
--当对property修改数据的时候的处理方法
meta.__newindex = function(table,index,value)
assert(index <= #values,"List index out of range")
values[index] = value
skynet.call(".redis_center","lua","LSET",db_index,list_key,index-1,value)
end
return property
end
--[[
example:
local listkey = "testList"
local list = List.new(db,listkey,{"a","b","c","d","e"})
list[1] = "A"
list:insert(1,"begin")
list:push("hello1","hello2")
list:insertFront("FYD1","FYD2","FYD3")
list:push(3)
list:remove(2)
list:removeLast()
list:removeFrist()
local length = list:length()
for i=1,length do
print(list[i])
end
]]
return List
|
CompMod:RemoveBuyNode(kTechId.Carapace)
CompMod:RemoveTech(kTechId.Carapace)
|
--[[
key 1 -> rdb:job:queue:stallTime
key 2 -> rdb:job:queue:stalling
key 3 -> rdb:job:queue:waiting
key 4 -> rdb:job:queue:active
arg 1 -> ms timestamp ("now")
arg 2 -> ms stallInterval
returns {resetJobId1, resetJobId2, ...}
workers remove the jobs from the stalling set every 'stallInterval' ms
if a job isn't removed from the stall set within the stallInterval time period then
we assume that the job has stalled and we'll reset it (moved from active back to waiting)
--]]
local now = tonumber(ARGV[1])
local stallTime = tonumber(redis.call("get", KEYS[1]) or 0)
if now < stallTime then
return 0
end
-- move stalled jobs from active to waiting set
local stalling = redis.call("smembers", KEYS[2])
if #stalling > 0 then
redis.call("rpush", KEYS[3], unpack(stalling))
for i = 1, #stalling do
redis.call("lrem", KEYS[4], 0, stalling[i])
end
redis.call("del", KEYS[2])
end
-- copy active jobs into stalling set
local actives = redis.call("lrange", KEYS[4], 0, -1)
if #actives > 0 then
redis.call("sadd", KEYS[2], unpack(actives))
end
redis.call("set", KEYS[1], now + ARGV[2])
return stalling
|
local assert = require "luassert.assert"
local spy = require "luassert.spy"
local Application = require "atlas.application"
local Response = require "atlas.response"
local Route = require "atlas.route"
local asgi = require "atlas.test.asgi"
describe("Application", function()
it("constructs an instance", function()
local routes = {}
local app = Application(routes)
assert.equal(getmetatable(app), Application)
assert.is_not_nil(app.router)
end)
it("is callable", function()
local app = Application({})
local receive = function() end
local called = false
local send = function() called = true end
app(asgi.make_scope(), receive, send)
assert.is_true(called)
end)
it("handles a full match", function()
local routes = {Route("/", function() return Response() end)}
local app = Application(routes)
local receive = function() end
local send = spy.new(function() end)
app(asgi.make_scope(), receive, send)
assert.spy(send).called_with({
type = "http.response.start",
status = 200,
headers = {{"content-type", "text/html"}},
})
end)
it("handles a partial match", function()
local routes = {Route("/", function() end)}
local app = Application(routes)
local scope = asgi.make_scope()
scope.method = "POST"
local receive = function() end
local send = spy.new(function() end)
app(scope, receive, send)
assert.spy(send).called_with({
type = "http.response.start",
status = 405,
headers = {{"content-type", "text/html"}},
})
end)
it("handles a none match", function()
local routes = {Route("/asdf", function() end)}
local app = Application(routes)
local scope = asgi.make_scope()
scope.method = "POST"
local receive = function() end
local send = spy.new(function() end)
app(scope, receive, send)
assert.spy(send).called_with({
type = "http.response.start",
status = 404,
headers = {{"content-type", "text/html"}},
})
end)
end)
|
-- tests large transmissions, sending and receiving
-- uses `receive` and `receivePartial`
-- Does send the same string twice simultaneously
--
-- Test should;
-- * show timer output, once per second, and actual time should be 1 second increments
-- * both transmissions should take appr. equal time, then they we're nicely cooperative
local copas = require 'copas'
local socket = require 'socket'
local body = ("A"):rep(1024*1024*50) -- 50 mb string
local start = socket.gettime()
local done = 0
local sparams, cparams
local function runtest()
local s1 = socket.bind('*', 49500)
copas.addserver(s1, copas.handler(function(skt)
--skt:settimeout(0) -- don't set, uses `receive` method
local res, err, part = skt:receive('*a')
res = res or part
if res ~= body then print("Received doesn't match send") end
print("Reading... 49500... Done!", socket.gettime()-start, err, #res)
if copas.removeserver then copas.removeserver(s1) end
end, sparams))
local s2 = socket.bind('*', 49501)
copas.addserver(s2, copas.handler(function(skt)
skt:settimeout(0) -- set, uses the `receivePartial` method
local res, err, part = skt:receive('*a')
res = res or part
if res ~= body then print("Received doesn't match send") end
print("Reading... 49501... Done!", socket.gettime()-start, err, #res)
if copas.removeserver then copas.removeserver(s2) end
end, sparams))
copas.addthread(function()
copas.sleep(0)
local skt = socket.tcp()
skt = copas.wrap(skt, cparams)
skt:connect("localhost", 49500)
skt:send(body)
print("Writing... 49500... Done!", socket.gettime()-start, err, #body)
skt = nil
collectgarbage()
collectgarbage()
done = done + 1
end)
copas.addthread(function()
copas.sleep(0)
local skt = socket.tcp()
skt = copas.wrap(skt, cparams)
skt:connect("localhost", 49501)
skt:send(body)
print("Writing... 49501... Done!", socket.gettime()-start, err, #body)
skt = nil
collectgarbage()
collectgarbage()
done = done + 1
end)
copas.addthread(function()
copas.sleep(0)
local i = 1
while done ~= 2 do
copas.sleep(1)
print(i, "seconds:", socket.gettime()-start)
i = i + 1
end
end)
print("starting loop")
copas.loop()
print("Loop done")
end
runtest() -- run test using regular connection (s/cparams == nil)
-- set ssl parameters and do it again
sparams = {
mode = "server",
protocol = "tlsv1",
key = "tests/certs/serverAkey.pem",
certificate = "tests/certs/serverA.pem",
cafile = "tests/certs/rootA.pem",
verify = {"peer", "fail_if_no_peer_cert"},
options = {"all", "no_sslv2"},
}
cparams = {
mode = "client",
protocol = "tlsv1",
key = "tests/certs/clientAkey.pem",
certificate = "tests/certs/clientA.pem",
cafile = "tests/certs/rootA.pem",
verify = {"peer", "fail_if_no_peer_cert"},
options = {"all", "no_sslv2"},
}
done = 0
start = socket.gettime()
runtest()
|
return {
objects = { -- we need to use the array to keep the draw order
{name="basement", x=0, y=0, noquads=true},
--{name="neighbour", x=0, y=5},
{name="me", x=5, y=20, controlled=true}
},
events = {
{x=5, knot='basement_intro'},
{x=30, knot='trash_cans'},
{x=80, knot='letter_boxes'},
--{x=50, knot='first_meeting'},
--{x=150, knot='second_meeting'}
},
left = "0-0-start",
right = "0-2-b",
}
|
local execute = vim.api.nvim_command
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
execute('!git clone https://gitee.com/huguanghui/packer.nvim ' .. install_path)
execute 'packadd packer.nvim'
end
vim.cmd('autocmd BufWritePost plugins.lua PackerCompile')
require('packer').init({display = {auto_clean = false}})
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- Information
use 'nanotee/nvim-lua-guide'
-- Quality of life improvements
use 'norcalli/nvim_utils'
-- LSP
use 'neovim/nvim-lspconfig'
use 'glepnir/lspsaga.nvim'
use 'onsails/lspkind-nvim'
use 'kosayoda/nvim-lightbulb'
use 'mfussenegger/nvim-jdtls'
use 'kabouzeid/nvim-lspinstall'
-- Doxygen Tool
use 'babaybus/DoxygenToolkit.vim'
-- Autocomplete
use 'hrsh7th/nvim-compe'
use 'hrsh7th/vim-vsnip'
use 'huguanghui/friendly-snippets'
-- Color
use 'huguanghui/nvcode-color-schemes.vim'
use 'norcalli/nvim-colorizer.lua'
use 'sheerun/vim-polyglot'
-- Icons
use 'kyazdani42/nvim-web-devicons' -- file icons
use 'ryanoasis/vim-devicons'
-- Status Line and Bufferline
use 'glepnir/galaxyline.nvim'
use 'romgrk/barbar.nvim'
-- Telescope
use 'nvim-lua/popup.nvim'
use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim'
use 'nvim-telescope/telescope-media-files.nvim'
-- Explorer
use 'kyazdani42/nvim-tree.lua'
-- Navigation
use 'unblevable/quick-scope'
use 'phaazon/hop.nvim'
-- General Plugins
use 'liuchengxu/vim-which-key'
use 'huguanghui/dashboard-nvim'
use 'psliwka/vim-smoothie'
use 'voldikss/vim-floaterm'
use 'terrortylor/nvim-comment'
use 'brooth/far.vim'
use 'windwp/nvim-autopairs'
use 'liuchengxu/vista.vim'
use 'vimwiki/vimwiki'
end)
|
--真紅眼の黒刃竜
function c21140872.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,74677422,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),1,true)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21140872,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c21140872.eqcon)
e1:SetTarget(c21140872.eqtg)
e1:SetOperation(c21140872.eqop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21140872,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(c21140872.ngcon)
e2:SetCost(c21140872.ngcost)
e2:SetTarget(c21140872.ngtg)
e2:SetOperation(c21140872.ngop)
c:RegisterEffect(e2)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(c21140872.eqcheck)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21140872,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c21140872.spcon2)
e3:SetTarget(c21140872.sptg2)
e3:SetOperation(c21140872.spop2)
e3:SetLabelObject(e4)
c:RegisterEffect(e3)
end
c21140872.material_setcode=0x3b
function c21140872.eqcon(e)
return Duel.GetAttacker():IsSetCard(0x3b)
end
function c21140872.eqfilter(c,tp)
return c:IsRace(RACE_WARRIOR) and c:CheckUniqueOnField(tp) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c21140872.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c21140872.eqfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c21140872.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c21140872.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c21140872.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Equip(tp,tc,c,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c21140872.eqlimit)
e1:SetLabelObject(c)
tc:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(200)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
function c21140872.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c21140872.ngcfilter(c,tp)
return c:IsControler(tp) and c:IsOnField()
end
function c21140872.ngcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c21140872.ngcfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end
function c21140872.ngfilter(c,e,tp)
return c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
end
function c21140872.ngcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21140872.ngfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c21140872.ngfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c21140872.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c21140872.ngop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c21140872.eqcheck(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then e:GetLabelObject():DeleteGroup() end
local g=e:GetHandler():GetEquipGroup()
g:KeepAlive()
e:SetLabelObject(g)
end
function c21140872.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c21140872.spfilter2(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21140872.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetLabelObject():GetLabelObject()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and g:IsExists(c21140872.spfilter2,1,nil,e,tp) end
local sg=g:Filter(c21140872.spfilter2,nil,e,tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,sg:GetCount(),0,0)
end
function c21140872.spop2(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if sg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil)
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
|
ConsoleLine = Object:extend()
function ConsoleLine:new(x, y, opts)
self.x, self.y = x, y
self.text = opts.text
self.duration = opts.duration
self.swaps = opts.swaps
self.timer = Tim()
self:setCharacters()
self:setGlitch()
if self.duration then
self.timer:after(self.duration, function()
for _, swap in ipairs(self.swaps) do self.text = self.text:gsub(swap[1], swap[2]) end
self:setCharacters()
self:setGlitch()
end)
end
end
function ConsoleLine:update(dt)
local cx, cy = camera:getCameraCoords(self.x, self.y)
if cy < 0 then return end
self.timer:update(dt)
end
function ConsoleLine:replace(a, b)
self.text = self.text:gsub(a, b)
self:setCharacters()
end
function ConsoleLine:setCharacters()
self.characters = {}
self.base_characters = {}
local language = 'normal'
for i = 1, #self.text do
local c = self.text:utf8sub(i, i)
local c2 = self.text:utf8sub(i+1, i+1)
local marker = false
if c == '{' or c == '}' or c == '(' or c == ')' or c == '<' or c == '>' or c == ';' or c == ',' or c == '@' or c == '#' or c == '$' or c == '%' then marker = true end
if c == ']' then language = 'normal' end
if c == ')' then language = 'normal' end
table.insert(self.characters, {c = c, language = language, visible = false, marker = marker})
if c == '[' and c2 ~= ' ' then language = 'arch' end
if c == '(' then language = 'arch' end
end
local normal_font = fonts.Anonymous_8
local arch_font = fonts.Arch_16
for i = 1, #self.characters do
local width = 0
if i > 1 then
for j = 1, i-1 do
if self.characters[j] and not self.characters[j].marker then
if self.characters[j].language == 'normal' then width = width + normal_font:getWidth(self.characters[j].c)
elseif self.characters[j].language == 'arch' then width = width + arch_font:getWidth(self.characters[j].c) end
end
end
end
self.characters[i].width = width
end
self.base_characters = table.copy(self.characters)
self.background_colors = {}
self.foreground_colors = {}
for i, _ in ipairs(self.characters) do
self.timer:after(0.0025*i, function()
if self.characters and self.characters[i] then self.characters[i].visible = true end
if self.base_characters and self.base_characters[i] then self.base_characters[i].visible = true end
end)
end
end
function ConsoleLine:print(t)
local str = ''
for _, c in ipairs(t) do str = str .. c.c end
print(str)
end
function ConsoleLine:setGlitch()
--[[
self.timer:every(0.05, function() self.visible = not self.visible end, 6)
self.timer:after(0.35, function() self.visible = true end)
]]--
self.timer:every({0.2, 2}, function()
if glitch == 0 then return end
if #self.characters == 0 then return end
local random_characters = '0123456789!@#$%¨&*()-=+[]^~/;?><.,|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ'
local i = love.math.random(1, #self.characters)
if not self.characters[i].marker then
if love.math.random(1, 20) <= 1 then
local r = love.math.random(1, #random_characters)
self.characters[i].c = random_characters:utf8sub(r, r)
else self.characters[i].c = (self.base_characters[i] and self.base_characters[i].c) or '' end
if love.math.random(1, 10) <= 1 then self.background_colors[i] = table.random(all_colors)
else self.background_colors[i] = nil end
if love.math.random(1, 10) <= 2 then self.foreground_colors[i] = table.random(all_colors)
else self.foreground_colors[i] = nil end
self.timer:after(0.1, function()
self.characters[i].c = (self.base_characters[i] and self.base_characters[i].c) or ''
self.background_colors[i] = nil
self.foreground_colors[i] = nil
end)
end
end, 'glitch')
end
function ConsoleLine:draw()
local cx, cy = camera:getCameraCoords(self.x, self.y)
if cy < 0 then return end
-- if not self.visible then return end
local normal_font = fonts.Anonymous_8
local arch_font = fonts.Arch_16
for i = 1, #self.characters do
if not self.characters[i].visible then return end
if self.characters[i].language == 'normal' then love.graphics.setFont(normal_font)
elseif self.characters[i].language == 'arch' then love.graphics.setFont(arch_font) end
if self.characters[i].c == '{' then love.graphics.setColor(skill_point_color) end
if self.characters[i].c == '}' then love.graphics.setColor(default_color) end
if self.characters[i].c == '<' then love.graphics.setColor(ammo_color) end
if self.characters[i].c == '>' then love.graphics.setColor(default_color) end
if self.characters[i].c == ';' then love.graphics.setColor(skill_point_color) end
if self.characters[i].c == ',' then love.graphics.setColor(default_color) end
if self.characters[i].c == '@' then love.graphics.setColor(hp_color) end
if self.characters[i].c == '#' then love.graphics.setColor(default_color) end
if self.characters[i].c == '$' then love.graphics.setColor(boost_color) end
if self.characters[i].c == '%' then love.graphics.setColor(default_color) end
if not self.characters[i].marker then
local r, g, b = love.graphics.getColor()
if self.background_colors[i] then
love.graphics.setColor(self.background_colors[i])
love.graphics.rectangle('fill', self.x + self.characters[i].width, self.y + math.floor(normal_font:getHeight()/2), normal_font:getWidth(self.characters[i].c), normal_font:getHeight())
end
love.graphics.setColor(self.foreground_colors[i] or {r, g, b} or self.color or default_color)
if self.characters[i].language == 'normal' then love.graphics.print(self.characters[i].c, self.x + self.characters[i].width, self.y + math.floor(normal_font:getHeight()/2), 0, 1, 1, 0, 0)
else love.graphics.print(self.characters[i].c, self.x + self.characters[i].width, self.y, 0, 1, 1, 0, 0) end
end
end
love.graphics.setShader()
end
function ConsoleLine:getText()
local str = ''
for _, c in ipairs(self.characters) do
str = str .. c.c
end
return str
end
|
---
-- ClientUtils.lua - Client Utilities
--
local ClientUtils = {}
function ClientUtils.raycast(pos, params)
local unitRay = workspace.CurrentCamera:ScreenPointToRay(pos.X, pos.Y)
local result = workspace:Raycast(unitRay.Origin, unitRay.Direction * 1000, params)
return result
end
function ClientUtils.playNoteSample(soundPool, code)
local note = (code - 1) % 12
local sampleIdx = math.floor(note / 2)
local octave = math.floor((code - 1) / 12)
local sound = soundPool:getSound(sampleIdx + 1)
if not sound then
return
end
sound.TimePosition = 16 * octave + 8 * (note % 2)
sound:Play()
delay(4, function()
sound:Stop()
end)
end
return ClientUtils
|
------------------------------------------------
----[ CLIENTSIDE ]-----------------------
------------------------------------------------
SS.Clientside = {} -- Client table.
SS.Clientside.List = {} -- Clientside list.
// Add clientside file
function SS.Clientside.Add(File)
AddCSLuaFile(File)
table.insert(SS.Clientside.List, File)
end
// Add clientside folder
function SS.Clientside.Folder(Folder, Extension)
local Files = file.Find("../lua/"..Folder.."*"..Extension)
Msg("\n")
for K, V in pairs(Files) do
SS.Clientside.Add(Folder..V)
Msg("\n\t[Clientside] File - "..V.." loaded")
end
Msg("\n")
end
// PlayerInitialSpawn hook
function SS.Clientside.PlayerInitialSpawn(Player)
for K, V in pairs(SS.Clientside.List) do
Player:IncludeFile(V)
end
end
// Hook into player initial spawn
SS.Hooks.Add("SS.Clientside.PlayerInitialSpawn", "PlayerInitialSpawn", SS.Clientside.PlayerInitialSpawn)
|
AddCSLuaFile()
ENT.Base = "base_suit"
ENT.PrintName = "Juggernaut suit"
ENT.Category = "Suits"
ENT.Author = "TankNut"
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.SuitData = {
Model = Model("models/suits/juggernaut.mdl"),
Hands = {
Model = Model("models/weapons/c_arms_combine.mdl")
},
FootstepPitch = {95, 105},
FootstepVolume = 0.75,
Footsteps = {{
"npc/combine_soldier/gear1.wav",
"npc/combine_soldier/gear3.wav",
"npc/combine_soldier/gear5.wav"
}, {
"npc/combine_soldier/gear2.wav",
"npc/combine_soldier/gear4.wav",
"npc/combine_soldier/gear6.wav"
}}
}
local speed = GetConVar("suit_juggernaut_speed")
local damage = GetConVar("suit_juggernaut_damage")
function ENT:ScaleDamage(ply, dmg)
local mult = damage:GetFloat()
if mult == 0 then
return true
end
dmg:ScaleDamage(mult)
end
if SERVER then
function ENT:GetSpeedMod(ply)
return speed:GetFloat()
end
end
|
local gui = require('gui')
local script = require('gui.script')
local args = {...}
local done_command = args[1]
script.start(function()
print('Running tests')
-- dismiss intro movie
while dfhack.gui.getCurFocus() == 'movieplayer' do
gui.simulateInput(dfhack.gui.getCurViewscreen(), 'LEAVESCREEN')
script.sleep(1, 'frames')
end
local found = false
local title_screen = dfhack.gui.getCurViewscreen()
for idx, item in ipairs(title_screen.menu_line_id) do
if item == df.viewscreen_titlest.T_menu_line_id.Start then
found = true
title_screen.sel_menu_line = idx
break
end
end
-- generate new world
if not found then
for idx, item in ipairs(title_screen.menu_line_id) do
if item == df.viewscreen_titlest.T_menu_line_id.NewWorld then
title_screen.sel_menu_line = idx
gui.simulateInput(title_screen, 'SELECT')
script.sleep(1, 'frames')
local new_region = dfhack.gui.getCurViewscreen()
while new_region.load_world_params do
script.sleep(1, 'frames')
end
if #new_region.welcome_msg > 0 then
gui.simulateInput(new_region, 'LEAVESCREEN')
script.sleep(1, 'frames')
end
new_region.world_size = 0
gui.simulateInput(new_region, 'MENU_CONFIRM')
while #df.global.world.entities.all == 0 or new_region.simple_mode == 0 or df.global.world.worldgen_status.state ~= 10 do
script.sleep(1, 'frames')
end
gui.simulateInput(new_region, 'SELECT')
while dfhack.gui.getCurFocus() ~= 'title' do
script.sleep(1, 'frames')
end
break
end
end
script.sleep(100, 'frames')
title_screen = dfhack.gui.getCurViewscreen()
for idx, item in ipairs(title_screen.menu_line_id) do
if item == df.viewscreen_titlest.T_menu_line_id.Start then
title_screen.sel_menu_line = idx
break
end
end
end
print('test passed: setup:generate-world')
gui.simulateInput(title_screen, 'SELECT')
script.sleep(1, 'frames')
-- try to start in legends mode
gui.simulateInput(title_screen, 'STANDARDSCROLL_UP')
script.sleep(1, 'frames')
gui.simulateInput(title_screen, 'SELECT')
while dfhack.gui.getCurFocus() ~= 'legends' do
script.sleep(1, 'frames')
end
local legends = dfhack.gui.getCurViewscreen()
-- FIXME: this condition is wrong and assumes uninitialized memory is nonzero
while legends.cur_page ~= 0 or legends.main_cursor ~= 0 do
script.sleep(1, 'frames')
end
print('test passed: setup:open-world')
local f = io.open('test_status.json', 'w')
f:write('{"weblegends":"passed"}')
f:close()
local status = dfhack.run_command('weblegends-export', 'weblegends-tmp')
local warnings = io.open('weblegends_debug.log', 'r')
if warnings ~= nil then
for line in warnings:lines() do
print('WARN: ' .. line)
end
warnings:close()
end
if status == CR_OK then
print('test passed: weblegends:export')
else
dfhack.printerr('test errored: weblegends:export: status=' .. tostring(status))
end
if done_command then
dfhack.run_command(done_command)
end
end)
|
local EntityIdIndex = {}
EntityIdIndex.__index = EntityIdIndex
function EntityIdIndex:create(keyPrefix, memberSeparator)
local instance = {
key = keyPrefix .. ':EntityIdIndex',
memberSeparator = memberSeparator
}
setmetatable(instance, EntityIdIndex)
return instance
end
function EntityIdIndex:buildMember(entityId, value, createdAt)
local memberSeparator = self.memberSeparator
return entityId .. memberSeparator .. createdAt .. memberSeparator .. value
end
function EntityIdIndex:delete(entityId, value, createdAt)
local member = self:buildMember(entityId, createdAt, value)
return redis.call('ZREM', self.key, member)
end
function EntityIdIndex:getMostRecent(aEntityId)
local query = aEntityId
local isTerm = true
local order = ORDER_DESCENDING
local offset = 0
local count = 1
local reply = self:searchRaw(query, isTerm, order, offset, count)
local member = reply[1]
local entityId = nil
local value = nil
local createdAt = nil
if (member ~= nil) then
entityId, value, createdAt = self:unbuildMember(member)
end
return entityId, value, createdAt
end
function EntityIdIndex:searchRaw(aQuery, isTerm, order, offset, count)
local query = aQuery
local memberSeparator = self.memberSeparator
if (isTerm) then
query = query .. memberSeparator
end
local command
local min
local max
if (order == ORDER_ASCENDING) then
command = 'ZRANGEBYLEX'
min = '[' .. query
max = '[' .. query .. TRAILING_BYTE
else
command = 'ZREVRANGEBYLEX'
min = '[' .. query .. TRAILING_BYTE
max = '[' .. query
end
if (offset ~= nil and count ~= nil) then
return redis.call(command, self.key, min, max, 'LIMIT', offset, count)
end
return redis.call(command, self.key, min, max)
end
function EntityIdIndex:insert(entityId, value, createdAt)
local score = 0
local member = self:buildMember(entityId, value, createdAt)
return redis.call('ZADD', self.key, score, member)
end
function EntityIdIndex:unbuildMember(member)
local memberSeparator = self.memberSeparator
local pattern = '^(.+)' .. memberSeparator .. '(%d+)' .. memberSeparator .. '(.+)$'
local entityId, createdAt, value = string.match(member, pattern)
return entityId, value, tonumber(createdAt, 10)
end
|
return {
handler = function(context)
context.input = context.request.params
end,
options = {
predicate = function(context)
if config.default then
return true
end
local content = context.request.headers["content-type"]
if context.request.body then
if content then
return content == "application/x-www-form-urlencoded"
else
return true
end
end
return false
end
}
}
|
require "Global.consts"
require "Global.application.application"
local entities = require "Global.entities"
local icon_path = RESOURCES_PATH .. "/Menu/ObjectIcons/"
local items = {}
-- Item Definition -----------------------------------------------------------------------------------------------------
local pebble = {}
pebble["name"] = "Pebble"
pebble["description"] = "A little rock that fits in the hand's palm."
pebble["icon"] = icon_path .. "001-Pebble.png"
pebble["consumable"] = true
pebble["stackable"] = 20
pebble["abilities"] = {}
table.insert(pebble["abilities"], 1)
table.insert(pebble["abilities"], 2)
local rope = {}
rope["name"] = "Rope"
rope["description"] = "Works for playing and jumping and tie things together."
rope["icon"] = icon_path .. "002-Rope.png"
rope["consumable"] = true
rope["stackable"] = 3
rope["abilities"] = {}
local marbles = {}
marbles["name"] = "A Bunch of Marbles"
marbles["description"] = "Very beautiful marbles."
marbles["icon"] = icon_path .. "003-A-Bunch-of-Marbles.png"
marbles["consumable"] = true
marbles["stackable"] = 10
marbles["abilities"] = {}
local orange_segment = {}
orange_segment["name"] = "Orange Segment"
orange_segment["description"] = "Gives some health back."
orange_segment["icon"] = icon_path .. "007-Orange-Segment.png"
orange_segment["consumable"] = true
orange_segment["stackable"] = 99
orange_segment["abilities"] = {}
orange_segment["action"] = function(extra)
local save = application:getCurrentSave()
local character_id = extra["character_id"]
local character = save["Battle"]["PlayerPartyMetadata"][character_id]
local character_meta = character.meta
local character_stats = entities[character.id]
character_meta["hp"] = math.min(character_stats["max_hp"], character_meta["hp"] + 1)
end
-- Item Insertion ------------------------------------------------------------------------------------------------------
items[1] = pebble
items[2] = rope
items[3] = marbles
items[7] = orange_segment
return items
|
--[[
##############################################################################
S V U I By: Munglunch
##############################################################################
STATS:Extend EXAMPLE USAGE: Reports:NewReportType(newStat,eventList,onEvents,update,click,focus,blur)
##########################################################
LOCALIZED LUA FUNCTIONS
##########################################################
]]--
--[[ GLOBALS ]]--
local _G = _G;
local unpack = _G.unpack;
local select = _G.select;
local type = _G.type;
local string = _G.string;
local math = _G.math;
--[[ STRING METHODS ]]--
local format, join = string.format, string.join;
--[[ MATH METHODS ]]--
local floor = math.floor;
--[[
##########################################################
GET ADDON DATA
##########################################################
]]--
local SV = select(2, ...)
local L = SV.L
local Reports = SV.Reports;
--[[
##########################################################
TIME STATS (Credit: Elv)
##########################################################
]]--
local APM = { TIMEMANAGER_PM, TIMEMANAGER_AM }
local europeDisplayFormat = '';
local ukDisplayFormat = '';
local europeDisplayFormat_nocolor = join("", "%02d", ":|r%02d")
local ukDisplayFormat_nocolor = join("", "", "%d", ":|r%02d", " %s|r")
local timerLongFormat = "%d:%02d:%02d"
local timerShortFormat = "%d:%02d"
local lockoutInfoFormat = "%s%s |cffaaaaaa(%s, %s/%s)"
local lockoutInfoFormatNoEnc = "%s%s |cffaaaaaa(%s)"
local formatBattleGroundInfo = "%s: "
local lockoutColorExtended, lockoutColorNormal = { r=0.3,g=1,b=0.3 }, { r=.8,g=.8,b=.8 }
local lockoutFormatString = { "%dd %02dh %02dm", "%dd %dh %02dm", "%02dh %02dm", "%dh %02dm", "%dh %02dm", "%dm" }
local curHr, curMin, curAmPm
local enteredFrame = false;
local date = _G.date
local Update, lastPanel; -- UpValue
local localizedName, isActive, canQueue, startTime, canEnter, _
local name, instanceID, reset, difficultyId, locked, extended, isRaid, maxPlayers, difficulty, numEncounters, encounterProgress
local function ValueColorUpdate(hex, r, g, b)
europeDisplayFormat = join("", "%02d", hex, ":|r%02d")
ukDisplayFormat = join("", "", "%d", hex, ":|r%02d", hex, " %s|r")
if lastPanel ~= nil then
Update(lastPanel, 20000)
end
end
local function ConvertTime(h, m)
local AmPm
if SV.db.Reports.time24 == true then
return h, m, -1
else
if h >= 12 then
if h > 12 then h = h - 12 end
AmPm = 1
else
if h == 0 then h = 12 end
AmPm = 2
end
end
return h, m, AmPm
end
local function CalculateTimeValues(tooltip)
if (tooltip and SV.db.Reports.localtime) or (not tooltip and not SV.db.Reports.localtime) then
return ConvertTime(GetGameTime())
else
local dateTable = date("*t")
return ConvertTime(dateTable["hour"], dateTable["min"])
end
end
local function Click()
GameTimeFrame:Click();
end
local function OnLeave(self)
Reports.ReportTooltip:Hide();
enteredFrame = false;
end
local function OnEvent(self, event)
if event == "UPDATE_INSTANCE_INFO" and enteredFrame then
RequestRaidInfo()
end
end
local function OnEnter(self)
Reports:SetDataTip(self)
if(not enteredFrame) then
enteredFrame = true;
RequestRaidInfo()
end
Reports.ReportTooltip:AddLine(VOICE_CHAT_BATTLEGROUND);
for i = 1, GetNumWorldPVPAreas() do
_, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(i)
if canEnter then
if isActive then
startTime = WINTERGRASP_IN_PROGRESS
elseif startTime == nil then
startTime = QUEUE_TIME_UNAVAILABLE
else
startTime = SecondsToTime(startTime, false, nil, 3)
end
Reports.ReportTooltip:AddDoubleLine(format(formatBattleGroundInfo, localizedName), startTime, 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b)
end
end
local oneraid, lockoutColor
for i = 1, GetNumSavedInstances() do
name, _, reset, difficultyId, locked, extended, _, isRaid, maxPlayers, difficulty, numEncounters, encounterProgress = GetSavedInstanceInfo(i)
if isRaid and (locked or extended) and name then
if not oneraid then
Reports.ReportTooltip:AddLine(" ")
Reports.ReportTooltip:AddLine(L["Saved Raid(s)"])
oneraid = true
end
if extended then
lockoutColor = lockoutColorExtended
else
lockoutColor = lockoutColorNormal
end
local _, _, isHeroic, _ = GetDifficultyInfo(difficultyId)
if (numEncounters and numEncounters > 0) and (encounterProgress and encounterProgress > 0) then
Reports.ReportTooltip:AddDoubleLine(format(lockoutInfoFormat, maxPlayers, (isHeroic and "H" or "N"), name, encounterProgress, numEncounters), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b)
else
Reports.ReportTooltip:AddDoubleLine(format(lockoutInfoFormatNoEnc, maxPlayers, (isHeroic and "H" or "N"), name), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b)
end
end
end
local addedLine = false
for i = 1, GetNumSavedWorldBosses() do
name, instanceID, reset = GetSavedWorldBossInfo(i)
if(reset) then
if(not addedLine) then
Reports.ReportTooltip:AddLine(' ')
Reports.ReportTooltip:AddLine(RAID_INFO_WORLD_BOSS.."(s)")
addedLine = true
end
Reports.ReportTooltip:AddDoubleLine(name, SecondsToTime(reset, true, nil, 3), 1, 1, 1, 0.8, 0.8, 0.8)
end
end
local timeText
local Hr, Min, AmPm = CalculateTimeValues(true)
Reports.ReportTooltip:AddLine(" ")
if AmPm == -1 then
Reports.ReportTooltip:AddDoubleLine(SV.db.Reports.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME,
format(europeDisplayFormat_nocolor, Hr, Min), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b)
else
Reports.ReportTooltip:AddDoubleLine(SV.db.Reports.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME,
format(ukDisplayFormat_nocolor, Hr, Min, APM[AmPm]), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b)
end
Reports.ReportTooltip:Show()
end
local int = 3
function Update(self, t)
int = int - t
if int > 0 then return end
if GameTimeFrame.flashInvite then
SV.Animate:Flash(self, 0.53)
else
SV.Animate:StopFlash(self)
end
if enteredFrame then
OnEnter(self)
end
local Hr, Min, AmPm = CalculateTimeValues(false)
-- no update quick exit
if (Hr == curHr and Min == curMin and AmPm == curAmPm) and not (int < -15000) then
int = 5
return
end
curHr = Hr
curMin = Min
curAmPm = AmPm
if AmPm == -1 then
self.text:SetFormattedText(europeDisplayFormat, Hr, Min)
else
self.text:SetFormattedText(ukDisplayFormat, Hr, Min, APM[AmPm])
end
lastPanel = self
int = 5
end
local TimeColorUpdate = function()
local hexColor = SV:HexColor("highlight")
europeDisplayFormat = join("", "%02d|cff", hexColor, ":|r%02d")
ukDisplayFormat = join("", "", "%d|cff", hexColor, ":|r%02d|cff", hexColor, " %s|r")
if lastPanel ~= nil then
Update(lastPanel, 20000)
end
end
SV.Events:On("SHARED_MEDIA_UPDATED", TimeColorUpdate, true)
Reports:NewReportType('Time', {"UPDATE_INSTANCE_INFO"}, OnEvent, Update, Click, OnEnter, OnLeave)
|
-- print(package.path)
-- print(package.cpath)
local function _getFileLen(filename)
local fh = assert(io.open(filename, "rb"))
local len = assert(fh:seek("end"))
fh:close()
return len
end
function lualoads( a,b )
-- package.cpath = "/works/git_auto/engine3.0/local/zclua/?.so;"..package.cpath
-- local luaLoad = dofile("luaLoad")
local luaLoad = require("luaLoad")
_cfunc.Print(luaLoad.add(a,b))
return luaLoad.add(a,b)
end
function uusenseMain(ParmSysParms) --0910
_cfunc.Print(package.path)
_cfunc.Print(package.cpath)
_cfunc.Print("bbbbbbbbbbbbbbbbbbbbbbbbbbbb")
package.cpath = "/data/local/tmp/c/?.so;"..package.cpath
_cfunc.Print("package.cpath:"..package.cpath)
_cfunc.Print(package.path)
_cfunc.Print(package.cpath)
solen = _getFileLen("/data/local/tmp/c/luaload.so")
_cfunc.Print("package.solen:"..solen)
_cfunc.Print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
local path = "/data/local/tmp/c/luaload.so"
local f = assert(package.loadlib(path, "add"))
f() -- 真正打开库
lualoads(1,4)
_cfunc.Print("\n\n")
return 0
end
-- local path = "/works/git_auto/engine3.0/local/zclua/luaload.so"
-- local f = assert(package.loadlib(path, "add"))
-- f() -- 真正打开库
|
--"Globals"
local aceDB = LibStub("AceDB-3.0");
local aceCDialog = LibStub("AceConfigDialog-3.0");
local aceConfig = LibStub("AceConfig-3.0");
local libSharedMedia = LibStub("LibSharedMedia-3.0");
local libDRData = LibStub('DRData-1.0');
--Utility Functions for the options
function Rekt:RektDisable()
self:Reset();
self:ApplySettings();
--hide the frames
Rekt:HideFrames();
--self:Disable();
end
function Rekt:RektEnable()
--self:Enable();
self:Reset();
self:ApplySettings();
end
--enable
function Rekt:isEnabled()
local db = Rekt.db.profile;
return db["enabled"];
end
function Rekt:setEnabledOrDisabled(enable)
local db = Rekt.db.profile;
db["enabled"] = enable;
if enable then
Rekt:RektEnable()
else
Rekt:RektDisable()
end
end
function Rekt:isPartEnabled(which)
local db = Rekt.db.profile;
return db[which]["enabled"];
end
function Rekt:SetPartEnabledOrDisabled(which, enable)
local db = Rekt.db.profile;
db[which]["enabled"] = enable;
--hide all those frames
if not enable then
for i = 1, 23 do
local frame = Rekt.frames[which][i]["frame"];
frame:Hide();
local colorframe = Rekt.fremes[which][i]["colorframe"];
colorframe:Hide();
end
else
self:ReassignCds(which);
end
end
function Rekt:SetDRPartEnabledOrDisabled(which, enable)
local db = Rekt.db.profile;
db[which]["enabled"] = enable;
--hide all those frames
if not enable then
for i = 1, 18 do
local frame = Rekt.frames[which][i]["frame"];
frame:Hide();
end
else
self:ReassignDRs(which);
end
end
function Rekt:isSpecDetectionEnabled()
local db = Rekt.db.profile;
return db["specdetection"];
end
function Rekt:setSpecDetectionEnabledorDisabled(enable)
local db = Rekt.db.profile;
db["specdetection"] = enable;
--call the remapcooldowns, and then update
--self:ReassignCds(which);
end
function Rekt:getColorFrameEnabled(which)
local db = Rekt.db.profile;
return db[which]["colorframeenabled"];
end
function Rekt:setColorFrameEnabled(which, enable)
local db = Rekt.db.profile;
db[which]["colorframeenabled"] = enable;
--hide all those frames
if not enable then
for i = 1, 23 do
local colorframe = Rekt.frames[which][i]["colorframe"];
colorframe:Hide();
end
else
self:ReassignCds(which);
end
end
function Rekt:getCDTypeSortingEnable()
local db = Rekt.db.profile;
return db["cdtypesortorder"]["enabled"];
end
function Rekt:setCDTypeSortingEnable(v)
local db = Rekt.db.profile;
db["cdtypesortorder"]["enabled"] = v;
self:ReassignCds("target");
self:ReassignCds("focus");
end
function Rekt:getPetCDGuessing()
local db = Rekt.db.profile;
return db["petcdguessing"];
end
function Rekt:setPetCDGuessing(v)
local db = Rekt.db.profile;
db["petcdguessing"] = v;
end
--lock
function Rekt:isLocked()
return Rekt.db.profile["locked"];
end
function Rekt:LockFrames()
self:MoveTimersStop("target");
self:MoveTimersStop("focus");
self:MoveDRTimersStop("targetdr");
self:MoveDRTimersStop("focusdr");
self:MoveDRTimersStop("selfdr");
self:HideMovableFrames()
self:ReassignCds("target");
self:ReassignCds("focus");
self:ReassignDRs("targetdr");
self:ReassignDRs("focusdr");
self:ReassignDRs("selfdr");
end
function Rekt:UnlockFrames()
--this will hide the frames
self:ReassignCds("target");
self:ReassignCds("focus");
self:ReassignDRs("targetdr");
self:ReassignDRs("focusdr");
self:ReassignDRs("selfdr");
Rekt:ShowMovableFrames();
end
function Rekt:HideMovableFrames()
if not Rekt.MovableFrames then return end;
--Hide them
for k, v in pairs(Rekt.MovableFrames) do
v["frame"]:EnableMouse(false);
v["frame"]:SetMovable(false);
v["frame"]:Hide();
end
end
function Rekt:ShowMovableFrames()
local db = Rekt.db.profile;
--Create them if they doesn't exists
if not Rekt.MovableFrames then
Rekt.MovableFrames = {}
for i = 1, 6 do
local frame = CreateFrame("Frame", nil, UIParent, nil);
frame:SetFrameStrata("BACKGROUND");
frame:SetScript("OnDragStart", function() self:MovableFrameDragStart() end)
frame:SetScript("OnDragStop", function() self:MovableFrameDragStop() end)
local text = frame:CreateTexture();
text:SetTexture("Interface\\Icons\\Spell_Arcane_Blink")
text:SetAllPoints(frame);
frame.texture = text;
local t = frame:CreateFontString(nil, "OVERLAY");
t:SetNonSpaceWrap(false);
t:SetPoint("CENTER", frame, "CENTER", 2, 0);
t:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE, MONOCHROME")
local ttext = "";
if i == 1 then
ttext = "T";
elseif i == 2 then
ttext = "F";
elseif i == 3 then
ttext = "TDR";
elseif i == 4 then
ttext = "FDR";
elseif i == 5 then
ttext = "SDR";
elseif i == 6 then
ttext = "IB";
end
t:SetText(ttext);
local which = "";
if i == 1 then
which = "target";
elseif i == 2 then
which = "focus";
elseif i == 3 then
which = "targetdr";
elseif i == 4 then
which = "focusdr";
elseif i == 5 then
which = "selfdr";
elseif i == 6 then
which = "interruptbar";
end
frame.DragID = which;
Rekt.MovableFrames[i] = {}
Rekt.MovableFrames[i]["frame"] = frame;
Rekt.MovableFrames[i]["texture"] = text;
Rekt.MovableFrames[i]["text"] = t;
end
end
--Show, resize them
for k, v in pairs(Rekt.MovableFrames) do
v["frame"]:EnableMouse(true)
v["frame"]:SetMovable(true)
v["frame"]:RegisterForDrag("LeftButton")
v["frame"]:SetPoint("BOTTOMLEFT", db[v["frame"].DragID]["xPos"], db[v["frame"].DragID]["yPos"]);
v["frame"]:SetWidth(db[v["frame"].DragID]["size"]);
v["frame"]:SetHeight(db[v["frame"].DragID]["size"]);
v["frame"]:Show();
end
end
function Rekt:MovableFrameDragStart()
this:StartMoving();
end
function Rekt:MovableFrameDragStop()
local db = Rekt.db.profile;
db[this.DragID]["xPos"] = this:GetLeft();
db[this.DragID]["yPos"] = this:GetBottom();
--Rekt:Print(this:GetLeft() .. " " .. this:GetBottom());
this:StopMovingOrSizing();
end
--size Functions
function Rekt:getFrameSize(which)
local db = Rekt.db.profile;
return db[which]["size"];
end
function Rekt:setFrameSize(which, size)
local db = Rekt.db.profile;
db[which]["size"] = size;
Rekt:MoveTimersStop(which)
if not db["locked"] then
Rekt:ShowMovableFrames();
end
end
function Rekt:getDRNumSize(which)
local db = Rekt.db.profile;
return db[which]["drnumsize"];
end
function Rekt:setDRNumSize(which, size)
local db = Rekt.db.profile;
db[which]["size"] = size;
Rekt:MoveDRTimersStop(which)
end
function Rekt:getColorFrameSize(which)
local db = Rekt.db.profile;
return db[which]["colorframesize"];
end
function Rekt:setColorFrameSize(which, size)
local db = Rekt.db.profile;
db[which]["colorframesize"] = size;
Rekt:MoveTimersStop(which);
Rekt:ReassignCds(which);
if not db["locked"] then
Rekt:ShowMovableFrames();
end
end
--Grow Order
function Rekt:getGrowOrder(which)
local db = Rekt.db.profile;
return db[which]["growOrder"];
end
function Rekt:setGrowOrder(which, v)
local db = Rekt.db.profile;
db[which]["growOrder"] = v;
Rekt:MoveTimersStop(which)
end
function Rekt:setDRGrowOrder(which, v)
local db = Rekt.db.profile;
db[which]["growOrder"] = v;
Rekt:MoveDRTimersStop(which)
end
--Sort Order
function Rekt:getSortOrder(which)
local db = Rekt.db.profile;
return db[which]["sortOrder"];
end
function Rekt:setSortOrder(which, v)
local db = Rekt.db.profile;
db[which]["sortOrder"] = v;
Rekt:ReassignCds(which);
end
function Rekt:getTypeSortOrder(which)
local db = Rekt.db.profile;
return db["cdtypesortorder"][which];
end
function Rekt:setTypeSortOrder(which, v)
local db = Rekt.db.profile;
db["cdtypesortorder"][which] = v;
Rekt:ReassignCds("target");
Rekt:ReassignCds("focus");
end
--Num Position functions
function Rekt:getDRNumPosition(which)
local db = Rekt.db.profile;
return db[which]["drnumposition"];
end
function Rekt:setDRNumPosition(which, v)
local db = Rekt.db.profile;
db[which]["drnumposition"] = v;
Rekt:MoveDRTimersStop(which);
end
--Color options
function Rekt:getColor(part)
local db = Rekt.db.profile;
if not db["color"] then db["color"] = {} end
if not db["color"][part] then
db["color"][part] = {};
db["color"][part]["r"] = 1;
db["color"][part]["g"] = 0;
db["color"][part]["b"] = 0;
db["color"][part]["a"] = 1;
end
return db["color"][part]["r"], db["color"][part]["g"], db["color"][part]["b"], db["color"][part]["a"];
end
function Rekt:setColor(part, r, g, b, a)
local db = Rekt.db.profile;
if not db["color"][part] then db["color"][part] = {} end
db["color"][part]["r"] = r;
db["color"][part]["g"] = g;
db["color"][part]["b"] = b;
db["color"][part]["a"] = a;
end
--Debug settings
function Rekt:getDebugLevel()
local db = Rekt.db.profile;
return db["debugLevel"];
end
function Rekt:setDebugLevel(v)
local db = Rekt.db.profile;
db["debugLevel"] = v;
end
function Rekt:getSpellCastDebug()
local db = Rekt.db.profile;
return db["spellCastDebug"];
end
function Rekt:setSpellCastDebug(v)
local db = Rekt.db.profile;
db["spellCastDebug"] = v;
end
function Rekt:getSpellAuraDebug()
local db = Rekt.db.profile;
return db["spellAuraDebug"];
end
function Rekt:setSpellAuraDebug(v)
local db = Rekt.db.profile;
db["spellAuraDebug"] = v;
end
function Rekt:getAllCDebug()
local db = Rekt.db.profile;
return db["allCDebug"];
end
function Rekt:setAllCDebug(v)
local db = Rekt.db.profile;
db["allCDebug"] = v;
end
function Rekt:getSelfCDRegister()
local db = Rekt.db.profile;
return db["selfCDRegister"];
end
function Rekt:setSelfCDRegister(v)
local db = Rekt.db.profile;
db["selfCDRegister"] = v;
Rekt:ReassignCds("target");
Rekt:ReassignCds("focus");
end
function Rekt:getIBSelfCDRegister()
local db = Rekt.db.profile;
return db["selfIBCDRegister"];
end
function Rekt:setIBSelfCDRegister(v)
local db = Rekt.db.profile;
db["selfIBCDRegister"] = v;
end
function Rekt:getDRTime()
local db = Rekt.db.profile;
return db["drtime"];
end
function Rekt:setDRTime(v)
local db = Rekt.db.profile;
db["drtime"] = v;
end
function Rekt:isOnlyShowDRCountDown(which)
local db = Rekt.db.profile;
return db[which]["onlyShowDRCountDown"];
end
function Rekt:setOnlyShowDRCountDown(which, enable)
local db = Rekt.db.profile;
db[which]["onlyShowDRCountDown"] = enable;
end
|
local upvalue1 = 0
function outer()
local upvalue2 = 1
local upvalue3 = 2
local x = f()
local a = x == 0 or function()
print(upvalue1, upvalue2, upvalue3)
end
return a
end
|
-- Implementation helper for metatable-based "classes"
return function(class_table)
local new = assert(class_table.new)
local metatable = { __index = class_table }
function class_table.new(...)
return setmetatable(new(...), metatable)
end
return class_table
end
|
--Subterror Behemoth Phospheroglacier
function c1151281.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1151281,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,1151281)
e1:SetTarget(c1151281.target)
e1:SetOperation(c1151281.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1151281,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetCondition(c1151281.spcon)
e2:SetTarget(c1151281.sptg)
e2:SetOperation(c1151281.spop)
c:RegisterEffect(e2)
--turn set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1151281,2))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c1151281.postg)
e3:SetOperation(c1151281.posop)
c:RegisterEffect(e3)
end
function c1151281.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c1151281.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c1151281.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsFacedown() and c:IsControler(tp)
end
function c1151281.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1151281.cfilter,1,nil,tp)
and not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
function c1151281.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c1151281.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
function c1151281.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(1151281)==0 end
c:RegisterFlagEffect(1151281,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function c1151281.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
|
local _M = require('apicast.policy').new('Metrics', 'builtin')
local resty_env = require('resty.env')
local errlog = require('ngx.errlog')
local prometheus = require('apicast.prometheus')
local metrics_updater = require('apicast.metrics.updater')
local tonumber = tonumber
local select = select
local find = string.find
local pairs = pairs
-- extended_metrics is a variable used to report multiple labels in some
-- metrics. This can be useful in small environements, but can be problematic
-- for large users due this can create a large matrix of metrics.
-- More info about this can be found in Prometheus doc:
-- https://prometheus.io/docs/practices/naming/#labels
local extended_metrics = resty_env.enabled('APICAST_EXTENDED_METRICS')
local upstream_metrics = require('apicast.metrics.upstream')
local new = _M.new
local log_levels_list = {
'emerg',
'alert',
'crit',
'error',
'warn',
'notice',
'info',
'debug',
}
local log_level_env = 'NGINX_METRICS_LOG_LEVEL'
local max_logs_env = 'NGINX_METRICS_MAX_LOGS'
local log_level_default = 'error'
local max_logs_default = 100
local function find_i(t, value)
for i=1, #t do
if t[i] == value then return i end
end
end
local empty = {}
local function get_logs(max)
return errlog.get_logs(max) or empty
end
local function filter_level()
local level = resty_env.value(log_level_env) or log_level_default
local level_index = find_i(log_levels_list, level)
if not level_index then
ngx.log(ngx.WARN, _M._NAME, ': invalid level: ', level, ' using error instead')
level_index = find_i(log_levels_list, 'error')
end
return level_index
end
function _M.new(configuration)
local m = new()
local config = configuration or empty
-- how many logs to take in one iteration
m.max_logs = tonumber(config.max_logs) or
resty_env.value(max_logs_env) or
max_logs_default
return m
end
local logs_metric = prometheus('counter', 'nginx_error_log', "Items in nginx error log", {'level'})
local http_connections_metric = prometheus('gauge', 'nginx_http_connections', 'Number of HTTP connections', {'state'})
local shdict_capacity_metric = prometheus('gauge', 'openresty_shdict_capacity', 'OpenResty shared dictionary capacity', {'dict'})
local shdict_free_space_metric = prometheus('gauge', 'openresty_shdict_free_space', 'OpenResty shared dictionary free space', {'dict'})
local response_times = prometheus(
'histogram',
'total_response_time_seconds',
'Time needed to send a response to the client (in seconds).',
{ 'service_id', 'service_system_name' }
)
function _M.init()
errlog.set_filter_level(filter_level())
get_logs(100) -- to throw them away after setting the filter level (and get rid of debug ones)
for name,dict in pairs(ngx.shared) do
metrics_updater.set(shdict_capacity_metric, dict:capacity(), name)
end
end
function _M:metrics()
local logs = get_logs(self.max_logs)
for i = 1, #logs, 3 do
metrics_updater.inc(logs_metric, log_levels_list[logs[i]] or 'unknown')
end
local response = ngx.location.capture("/nginx_status")
if response.status == 200 then
local accepted, handled, total = select(3, find(response.body, [[accepts handled requests%s+(%d+) (%d+) (%d+)]]))
local var = ngx.var
metrics_updater.set(http_connections_metric, var.connections_reading, 'reading')
metrics_updater.set(http_connections_metric, var.connections_waiting, 'waiting')
metrics_updater.set(http_connections_metric, var.connections_writing, 'writing')
metrics_updater.set(http_connections_metric, var.connections_active, 'active')
metrics_updater.set(http_connections_metric, accepted, 'accepted')
metrics_updater.set(http_connections_metric, handled, 'handled')
metrics_updater.set(http_connections_metric, total, 'total')
else
prometheus:log_error('Could not get status from nginx')
end
for name,dict in pairs(ngx.shared) do
metrics_updater.set(shdict_free_space_metric, dict:free_space(), name)
end
end
local function report_req_response_time(service)
-- Use ngx.var.original_request_time instead of ngx.var.request_time so
-- the time spent in the post_action phase is not taken into account.
local resp_time = tonumber(ngx.var.original_request_time)
if resp_time and response_times then
response_times:observe(resp_time, {
service.id or "",
service.system_name or ""
})
end
end
function _M.log(_, context)
local service = { id = "", system_name = "" }
if context.service and extended_metrics then
service = context.service
end
upstream_metrics.report(ngx.var.upstream_status, ngx.var.upstream_response_time, service)
report_req_response_time(service)
end
return _M
|
return {
_type_ = 'DesignDrawing',
id = 1110020001,
learn_component_id = {
1021009005,
},
}
|
function SphereGenerator(property)
local size = property.size
return {
PointData = function ()
local gen = PrimitiveGenerator()
return gen:Sphere(size)
end
}
end
|
-- Print contents of `tbl`, with indentation.
-- `indent` sets the initial level of indentation.
function logTable (tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
logTable(v, indent+1)
elseif type(v) == 'boolean' then
print(formatting .. tostring(v))
elseif type(v) == 'function' then
print(formatting .. '<function>') -- TODO: display the function's name
else
print(formatting .. v)
end
end
end
|
local maps = {}
local gametypes = {}
AddEventHandler('onClientResourceStart', function(res)
-- parse metadata for this resource
-- map files
local num = GetNumResourceMetadata(res, 'map')
if num > 0 then
for i = 0, num-1 do
local file = GetResourceMetadata(res, 'map', i)
if file then
addMap(file, res)
end
end
end
-- resource type data
local type = GetResourceMetadata(res, 'resource_type', 0)
if type then
local extraData = GetResourceMetadata(res, 'resource_type_extra', 0)
if extraData then
extraData = json.decode(extraData)
else
extraData = {}
end
if type == 'map' then
maps[res] = extraData
elseif type == 'gametype' then
gametypes[res] = extraData
end
end
-- handle starting
loadMap(res)
-- defer this to the next game tick to work around a lack of dependencies
CreateThread(function()
Citizen.Wait(15)
if maps[res] then
TriggerEvent('onClientMapStart', res)
elseif gametypes[res] then
TriggerEvent('onClientGameTypeStart', res)
end
end)
end)
AddEventHandler('onResourceStop', function(res)
if maps[res] then
TriggerEvent('onClientMapStop', res)
elseif gametypes[res] then
TriggerEvent('onClientGameTypeStop', res)
end
unloadMap(res)
end)
AddEventHandler('getMapDirectives', function(add)
add('vehicle_generator', function(state, name)
return function(opts)
local x, y, z, heading
local color1, color2
if opts.x then
x = opts.x
y = opts.y
z = opts.z
else
x = opts[1]
y = opts[2]
z = opts[3]
end
heading = opts.heading or 1.0
color1 = opts.color1 or -1
color2 = opts.color2 or -1
CreateThread(function()
local hash = GetHashKey(name)
RequestModel(hash)
while not HasModelLoaded(hash) do
Wait(0)
end
local carGen = CreateScriptVehicleGenerator(x, y, z, heading, 5.0, 3.0, hash, color1, color2, -1, -1, true, false, false, true, true, -1)
SetScriptVehicleGenerator(carGen, true)
SetAllVehicleGeneratorsActive(true)
state.add('cargen', carGen)
end)
end
end, function(state, arg)
Citizen.Trace("deleting car gen " .. tostring(state.cargen) .. "\n")
DeleteScriptVehicleGenerator(state.cargen)
end)
end)
|
--[[local g_Me = getLocalPlayer()
local g_Root = getRootElement()
local function TmUpdateAlpha()
for i, player in ipairs(getElementsByType('player')) do
if(player ~= g_Me and getElementData(player, 'respawn.playing')) then
setElementAlpha(player, 0)
for i, el in ipairs(getAttachedElements(player)) do
setElementAlpha(el, 0)
end
local veh = getPedOccupiedVehicle(player)
if(veh) then
setElementAlpha(veh, 0)
for i, el in ipairs(getAttachedElements(veh)) do
setElementAlpha(el, 0)
end
end
end
end
end
addEventHandler('onClientPreRender', g_Root, TmUpdateAlpha)]]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.